From 8feaa2106357bbdca3ad5e2713400b931c3a4829 Mon Sep 17 00:00:00 2001 From: x x Date: Sun, 27 Sep 2026 11:46:40 +0800 Subject: [PATCH] docs: align user-facing copy with current AgentDock --- docs/concepts/dynamic-mcp.md | 61 ++- docs/concepts/nexusdock.md | 121 +----- docs/concepts/plugins.md | 32 ++ docs/concepts/recalldock.md | 38 +- docs/concepts/skills.md | 96 ++--- docs/concepts/tasks.md | 12 +- docs/concepts/workflow.md | 37 ++ docs/contributing/development.md | 110 ++---- docs/getting-started/docker.md | 26 +- docs/getting-started/install.md | 2 +- docs/getting-started/linux.md | 23 +- docs/getting-started/macos.md | 24 +- docs/getting-started/vps.md | 174 --------- docs/getting-started/windows.md | 14 +- docs/guides/browser-control.md | 24 +- docs/guides/chatgpt.md | 36 +- docs/guides/coding-agents.md | 115 +++--- docs/guides/desktop-automation.md | 57 --- docs/guides/fixed-domain.md | 162 -------- docs/guides/mcp-clients.md | 8 +- docs/intro.md | 13 +- docs/operations/desktop.md | 71 ++++ docs/operations/docker.md | 203 ++-------- docs/operations/linux.md | 195 ++-------- docs/operations/macos.md | 142 ------- docs/operations/nexusdock-connect.md | 40 ++ docs/operations/nexusdock.md | 165 ++------- docs/operations/public-access.md | 86 +++++ docs/operations/security.md | 70 ---- docs/operations/troubleshooting.md | 99 ++--- docs/operations/windows.md | 124 ------- docs/reference/configuration.md | 276 +++----------- docs/reference/tools.md | 276 +++----------- docusaurus.config.ts | 8 +- i18n/zh-CN/code.json | 62 +++- .../current.json | 4 +- .../current/concepts/dynamic-mcp.md | 57 ++- .../current/concepts/nexusdock.md | 121 +----- .../current/concepts/plugins.md | 32 ++ .../current/concepts/recalldock.md | 38 +- .../current/concepts/skills.md | 96 ++--- .../current/concepts/tasks.md | 18 +- .../current/concepts/workflow.md | 37 ++ .../current/contributing/development.md | 110 ++---- .../current/getting-started/docker.md | 28 +- .../current/getting-started/install.md | 2 +- .../current/getting-started/linux.md | 23 +- .../current/getting-started/macos.md | 26 +- .../current/getting-started/vps.md | 174 --------- .../current/getting-started/windows.md | 14 +- .../current/guides/browser-control.md | 24 +- .../current/guides/chatgpt.md | 36 +- .../current/guides/coding-agents.md | 113 +++--- .../current/guides/desktop-automation.md | 57 --- .../current/guides/fixed-domain.md | 162 -------- .../current/guides/mcp-clients.md | 8 +- .../current/intro.md | 13 +- .../current/operations/desktop.md | 71 ++++ .../current/operations/docker.md | 203 ++-------- .../current/operations/linux.md | 195 ++-------- .../current/operations/macos.md | 142 ------- .../current/operations/nexusdock-connect.md | 40 ++ .../current/operations/nexusdock.md | 165 ++------- .../current/operations/public-access.md | 86 +++++ .../current/operations/security.md | 70 ---- .../current/operations/troubleshooting.md | 99 ++--- .../current/operations/windows.md | 124 ------- .../current/reference/configuration.md | 278 +++----------- .../current/reference/tools.md | 276 +++----------- sidebars.ts | 27 +- src/components/HomepageFeatures/index.tsx | 127 +++++-- .../HomepageFeatures/styles.module.css | 348 +++++++++++++++--- src/css/custom.css | 23 +- src/pages/index.tsx | 12 +- 74 files changed, 2062 insertions(+), 4419 deletions(-) create mode 100644 docs/concepts/plugins.md create mode 100644 docs/concepts/workflow.md delete mode 100644 docs/getting-started/vps.md delete mode 100644 docs/guides/desktop-automation.md delete mode 100644 docs/guides/fixed-domain.md create mode 100644 docs/operations/desktop.md delete mode 100644 docs/operations/macos.md create mode 100644 docs/operations/nexusdock-connect.md create mode 100644 docs/operations/public-access.md delete mode 100644 docs/operations/security.md delete mode 100644 docs/operations/windows.md create mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/plugins.md create mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/workflow.md delete mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/vps.md delete mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/desktop-automation.md delete mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/fixed-domain.md create mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/desktop.md delete mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/macos.md create mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock-connect.md create mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/public-access.md delete mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/security.md delete mode 100644 i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/windows.md diff --git a/docs/concepts/dynamic-mcp.md b/docs/concepts/dynamic-mcp.md index 4971587..c4ff6b1 100644 --- a/docs/concepts/dynamic-mcp.md +++ b/docs/concepts/dynamic-mcp.md @@ -1,67 +1,62 @@ -# Connect external MCP servers - -Dynamic MCP lets AgentDock connect to other MCP servers without restarting or rebuilding. Examples include design platforms, task systems, search services, and local analysis tools. +# Use external MCP services +Dynamic MCP lets AgentDock use tools from other MCP services without restarting AgentDock. Use it when you need capabilities that are provided by another service or a local MCP program. ## Simplest usage -Tell the agent what to connect: +Tell the agent what you want to connect: ```text -Connect this MCP server: https://mcp.example.com/mcp -Use example as its name, store the authentication token in its isolated environment, and verify that its tools can be listed. +Connect this MCP service: https://mcp.example.com/mcp +Use example as its name and verify that its tools are available. ``` -The agent registers the server, stores credentials in its isolated environment, refreshes the connection, and verifies it with a read-only call. - -## Two transport options +AgentDock registers the connection, checks what authentication is required, and can verify it with a read-only tool call. -### HTTP MCP +## HTTP MCP -Use HTTP for services that already expose a network endpoint: +Use HTTP when the service already provides a network address such as: ```text https://mcp.example.com/mcp ``` -Authentication data is mapped from an isolated environment variable to an HTTP header. Registry data stores only the variable name, never the actual token. +### Browser sign-in with OAuth + +If the remote MCP service requires OAuth, ask the agent to authorize it. AgentDock starts the authorization flow and returns a sign-in link for you to open in the browser. After you finish signing in, the MCP connection can refresh and use the authorized service. -### Local stdio MCP +You do not need to copy OAuth codes or access tokens into chat. You can also clear an existing authorization when you want to sign in again or disconnect the account. -Use stdio for command-line MCP servers installed on the same machine. You need to provide: +### API key authentication -- The absolute path to the executable. -- Launch arguments. -- An optional working directory. -- Any required environment variables. +If the service gives you an API token or key instead of browser sign-in, store it in that MCP connection's isolated environment. AgentDock keeps the secret out of the connection record and does not show it back in configuration listings. -A local MCP server inherits the operating-system permissions of the AgentDock process, so review its source before installation. +## Local MCP programs -## Credential storage +AgentDock can also start command-line MCP services installed on the same machine. Provide the executable, any startup arguments, and the environment variables it needs. -Do not place tokens, cookies, passwords, or OAuth codes directly in chat history, a README, or MCP registry data. +A local MCP program runs with the operating-system permissions of AgentDock, so review unfamiliar software before using it. -Ask the agent to store secrets in the MCP server's isolated environment. Configuration listings show variable names and status, not secret values. +## Credentials -Refresh the MCP connection after updating credentials. +Do not put tokens, cookies, passwords, or OAuth codes in chat history, a README, or MCP registry data. + +- For OAuth, use AgentDock's authorization flow. +- For token-based authentication, use the MCP connection's isolated environment. +- Configuration listings show secret names and status, not secret values. ## Verify the connection You can ask the agent: ```text -List the tools provided by the example MCP server, inspect the parameters of one read-only tool, and complete one call without side effects. +List the tools from the example MCP service, inspect one read-only tool, and make one call without side effects. ``` -If verification fails, check whether the server is enabled, whether the URL or command is correct, whether all required variables are configured, and whether the upstream service is reachable. - -## Manage existing MCP servers +If verification fails, check whether the connection is enabled, the URL or command is correct, authentication is complete, and the upstream service is reachable. -Common operations include: +## Manage existing MCP services -- View and inspect configuration. -- Enable, disable, or refresh a connection. -- Update or remove isolated environment variables. -- Remove a server that is no longer used. +You can ask AgentDock to inspect, enable, disable, refresh, re-authorize, or remove a connection, and to manage its isolated environment when needed. -See [Tools](../reference/tools.md#dynamic-mcp) for exact actions and parameters. +See [Tools](../reference/tools.md) for the complete operations and parameters. diff --git a/docs/concepts/nexusdock.md b/docs/concepts/nexusdock.md index 652f173..641e984 100644 --- a/docs/concepts/nexusdock.md +++ b/docs/concepts/nexusdock.md @@ -1,113 +1,24 @@ -# NexusDock +# What is NexusDock? -NexusDock is the optional self-hosted control plane for multiple AgentDock devices. AgentDock still performs real file, command, browser, Skill, and Coding Agent work on each device; NexusDock adds one place to connect devices, share Recall and Workflow data, and expose the fleet through one MCP endpoint. +NexusDock is an optional self-hosted control center for people who use AgentDock on multiple devices. -Use NexusDock when you want several Macs, Windows PCs, Linux hosts, or servers to appear behind one trusted entry point. A single AgentDock instance does not require NexusDock for normal local tools or tasks. +It brings your Macs, Windows PCs, Linux hosts, and servers into one web console, lets them share Recall and Workflow data, and provides one MCP endpoint for AI clients. -Ready to self-host it? See [Deploy NexusDock](../operations/nexusdock.md) for the Docker setup, HTTPS boundary, upgrades, and backups. +If you only use one AgentDock device, you usually do not need NexusDock. -## What the web console gives you +## What you can do -The console separates shared NexusDock data from node-local runtime state: +- connect to multiple AgentDock devices through one MCP endpoint; +- manage multiple AgentDock devices from one place; +- see which devices are online and check their current state; +- share Recall memory and Workflow data across devices; +- configure an AI client once instead of connecting to each AgentDock separately. -- **Overview** shows system status, whether each AgentDock node is online, and summaries for platform, version, Skills, dynamic MCP, recent tasks, and node tools. -- **Recall** provides the shared knowledge workspace: library files, experience cards, Evolution records, vector recall, and local version history. -- **Workflow** lets you browse published templates, their current steps and matching rules, and older retired versions. -- **Tasks**, **Skills**, and **MCP** are node views. Select a device first, then inspect its recoverable tasks and installed Skills. Dynamic MCP servers can also be added, enabled, disabled, refreshed, or removed, with isolated environment variables managed without reading secret values back in plaintext. -- **Settings** has four areas: **Account & Sessions** for password and active-session management; **MCP Access** for the fleet MCP endpoint and dedicated Access Token; **AI & Vector** for Stage 3 and embedding configuration, connection tests, and index rebuilds; and **System & Nodes** for pairing, renaming, disabling, or removing AgentDock nodes and checking system state. +AgentDock still runs the actual work on each device. NexusDock brings those devices together; it does not replace them. -The Runtime pages do not copy a node's task, Skill, or dynamic MCP state into NexusDock. NexusDock reads or manages those resources through the selected AgentDock node, so an offline node cannot serve its live runtime data. +## Next steps -## A typical first setup - -1. Sign in to the NexusDock web console. -2. Open **Settings → System & Nodes** and choose **Pair device** to generate an expiring, one-time pairing code. -3. Run the generated `agentdock nexus pair ...` command on the target machine, then restart AgentDock. -4. After the node is online, choose it from the Runtime node selector to inspect tasks, Skills, and dynamic MCP. -5. If you want semantic Recall search or vector-assisted Workflow matching, configure embeddings under **Settings → AI & Vector**, test the connection, and rebuild the indexes. -6. To connect an MCP client to the whole fleet, use the NexusDock `/mcp` endpoint. OAuth-capable clients can authorize in the browser; other clients can use the dedicated token shown under **Settings → MCP Access**. - -## How devices connect - -Pair each AgentDock device from the NexusDock control panel. The device then opens an outbound WebSocket connection to NexusDock. - -This design means: - -- Only NexusDock needs a reachable HTTPS address for remote use. -- AgentDock nodes can stay behind NAT or a home network without opening an inbound port. -- Each paired device keeps its own identity and local operating-system permissions. -- Disabling or disconnecting one node does not move its local execution environment into NexusDock. - -Pairing NexusDock does not remove the node's own MCP endpoint. You can continue connecting directly to AgentDock when a local or single-device workflow is more appropriate. - -## One MCP endpoint for the fleet - -MCP clients can connect to the NexusDock `/mcp` endpoint instead of configuring every AgentDock node separately. - -Start with `agentdock_context`. NexusDock returns a fleet context with two parts: - -- `nodes`: enabled AgentDock devices, including `node_id`, online state, version, platform, capabilities, and available node-local context. -- `shared`: NexusDock-owned Workflow, Recall, rules, and shared context that should not be duplicated per node. - -NexusDock does not expose a separate `node_list` tool. The `node_id` returned by `agentdock_context` is the routing key for device tools. - -Fleet-owned central tools are published once and do not take a `node_id`, including: - -- `agentdock_context` -- `recall_search`, `recall_read`, `recall_write`, and `recall_maintain` -- `workflow_template_manage` -- `private_note_manage` - -`workspace_context` is also a canonical shared tool, but it is intentionally node-scoped: NexusDock exposes `workspace_context(node_id, workdir?)` and routes the request to that AgentDock node. The fleet `agentdock_context` remains a fleet overview and never carries workspace rule bodies. - -Other device tools such as files, commands, tasks, browser automation, ACP, dynamic MCP, and `evolve` remain AgentDock capabilities. Through NexusDock, their input schema adds a required `node_id` so the call is routed to the intended node. - -Keep paired AgentDock nodes on reasonably recent, similar versions to reduce tool-contract differences and keep the unified MCP endpoint as complete and consistent as possible. - -## Recall and Workflow data - -Recall and Workflow templates are centralized in NexusDock. This is why the fleet `agentdock_context` returns them under `shared` rather than copying them into every node context. - -`recall_search` supports lexical search by default and can add semantic retrieval when NexusDock has an embedding model configured. The model-facing tool remains the same; callers do not need to choose a search backend. - -See [NexusDock Recall](./recalldock.md) for content boundaries and [Tools](../reference/tools.md#nexusdock-recall) for the current tool contract. - -## Download files from a node - -When `file_publish` is called through NexusDock, the file still belongs to the selected AgentDock node. NexusDock can return its own temporary signed download URL and proxy the file over the node's existing outbound connection. - -The important boundaries are: - -- The source AgentDock node must remain online while the download is running. -- NexusDock reads large files in bounded chunks and verifies the artifact metadata and checksum while proxying. -- NexusDock does not persist a second copy of the node artifact. -- The signed URL expires; it is not a permanent public file host. - -A public NexusDock download URL requires a correct external `NEXUS_PUBLIC_URL` and HTTPS deployment. - -## Authentication boundaries - -NexusDock keeps management access and MCP access separate. A remote MCP client can authorize against `/mcp` with the supported OAuth flow or a dedicated MCP Access Token without receiving NexusDock administrator API access. - -For remote deployment: - -- Put NexusDock behind HTTPS. -- Keep its application port bound to loopback or a trusted private network when possible. -- Configure trusted proxies narrowly. -- Protect the Nexus API token, MCP token, administrator password, Recall data, and private-note encryption material independently. - -AgentDock nodes still enforce their own host permissions. NexusDock routing does not grant a node access to files, commands, browsers, or accounts that its AgentDock process could not access directly. - -## AgentDock and NexusDock responsibilities - -| Responsibility | AgentDock | NexusDock | -| --- | --- | --- | -| Files, commands, browser, ACP, Skills, dynamic MCP | Executes on the device | Routes calls to the selected node | -| Device runtime and operating-system permissions | Owns | Does not replace | -| Recoverable task state | Stored on the AgentDock node | Routes node task calls | -| Recall and Workflow registry | Consumes when configured | Owns the shared service | -| Knowledge evolution lifecycle | Owns policy and decisions | Provides shared storage and access paths | -| Multi-device MCP | Publishes node capabilities | Aggregates compatible node tools and central tools | -| Published node artifacts | Stores the source artifact | Proxies temporary signed downloads | - -For a single device, start with AgentDock directly. Add NexusDock when centralized Recall, Workflow data, device management, or a unified multi-device MCP endpoint becomes useful. +- [Install and maintain](../operations/nexusdock.md) +- [Connect AgentDock](../operations/nexusdock-connect.md) +- [Recall memory](./recalldock.md) +- [Workflow](./workflow.md) diff --git a/docs/concepts/plugins.md b/docs/concepts/plugins.md new file mode 100644 index 0000000..1a7d219 --- /dev/null +++ b/docs/concepts/plugins.md @@ -0,0 +1,32 @@ +# Use Plugins + +A Plugin packages related AgentDock extensions so they can be reviewed and managed together. A Plugin can include Skills, MCP server configurations, or both. Those components still use AgentDock's existing Skill and dynamic MCP systems; a Plugin does not create a separate execution layer. + +Here, **Plugin** means an AgentDock extension package. It is different from the plugin, connector, or MCP entry that an AI client such as ChatGPT uses to connect to AgentDock. + +## When to use a Plugin + +Use a Plugin when several related extensions should be installed and updated together. If you only need task instructions, use a [Skill](./skills.md). If you only need one MCP connection, use [Dynamic MCP](./dynamic-mcp.md). + +AgentDock understands its portable Plugin format and supported OpenAI and Claude Plugin packages. Remote sources such as Git or GitHub are fetched through the bundled `plugin-import` Skill before AgentDock reviews the local package. + +## Install a Plugin + +Describe the goal and ask for a review first: + +```text +Review and install this Plugin. Show me which Skills and MCP connections it adds before installing it. +``` + +AgentDock validates the package before installation. Installation or update is tied to the exact reviewed content, so changing the package requires another review. + +Installed Plugins can be inspected, updated, enabled, disabled, or removed. Disabling a Plugin keeps it installed but stops its packaged components from being active. Removal can keep the Plugin data and MCP credentials, or explicitly purge them. + +## Safety + +- Review unfamiliar Plugins before installing or updating them. +- Do not put tokens, cookies, passwords, or other secrets inside a Plugin package. +- A packaged MCP server has the same trust considerations as a directly configured MCP server. +- A Plugin cannot exceed the operating-system permissions, container mounts, or other boundaries that apply to AgentDock. + +For complete management operations and parameters, see [Tools](../reference/tools.md). diff --git a/docs/concepts/recalldock.md b/docs/concepts/recalldock.md index 53c435a..20875e4 100644 --- a/docs/concepts/recalldock.md +++ b/docs/concepts/recalldock.md @@ -1,17 +1,18 @@ -# NexusDock Recall +# Recall memory -NexusDock Recall is an optional long-term knowledge service for AgentDock. It stores stable project notes, experience, decisions, and problem logs so later tasks can find reliable context. +NexusDock Recall is an optional long-term memory service for AgentDock. It keeps information, preferences, experience, and knowledge that are worth reusing later, so future tasks can continue with useful context. -Without NexusDock, file, command, command-line Git, Skill, dynamic MCP, and local task tools remain fully available; Recall, workflow template, knowledge evolution, and private note tools are unavailable. See [NexusDock](./nexusdock.md) for the multi-device control plane and unified MCP gateway. +Without NexusDock, file, command, command-line Git, Skill, dynamic MCP, and local task tools remain fully available; Recall, workflow template, knowledge evolution, and private note tools are unavailable. See [NexusDock](./nexusdock.md) for multi-device management and the unified MCP endpoint. ## When to use it Store: -- Long-lived project structure and runtime steps. -- Verified deployment or troubleshooting notes. -- Decisions and preferences meant to be reused across sessions. -- Open questions and learning notes. +- Personal preferences, recurring habits, and long-term goals. +- Learning notes, reading takeaways, and knowledge you want to build over time. +- Information you may reuse for travel, shopping, hobbies, or everyday decisions. +- Background, decisions, and experience from work or personal projects. +- Verified development, deployment, or troubleshooting lessons. Do not store: @@ -22,32 +23,27 @@ Do not store: ## Setup -You need an accessible NexusDock URL and an optional token. Ask your agent: +Pair the AgentDock device with NexusDock first. In NexusDock, open **Settings → System & Nodes**, create a one-time pairing code, then run the generated `agentdock nexus pair ...` command on the AgentDock device and restart AgentDock. -```text -Connect AgentDock to NexusDock Recall at https://nexus.example.com using a secure environment variable for the token. -``` - -For exact environment variables, see [Configuration reference](../reference/configuration.md). +Recall does not need a separate AgentDock-side URL or token after pairing. See [Connect AgentDock](../operations/nexusdock-connect.md) for the full setup. ## How to use it Speak directly: ```text -Check existing deployment notes for this project before starting. -Update verified conclusions to long-term project docs; do not record temporary logs. -Search earlier troubleshooting notes about OAuth. +Remember that I prefer places to stay with convenient public transit when I travel. +Save the key points from this study session so I can continue reviewing them later. +Find the camera-buying criteria I summarized before. +Save the long-term conclusion we just confirmed for this project. ``` -`agentdock_context` already includes a compact Recall startup index, so models do not need a separate bootstrap call. Read directly when the index already provides the exact path; otherwise use `recall_search` to search Markdown and Cards. When NexusDock has embeddings configured, it adds semantic recall behind the same search tool transparently. - -The agent searches existing content first, then decides whether to read, update, or create, avoiding duplicates and conflicts. +AgentDock can use existing Recall content to carry useful context into later tasks. With Embeddings configured, semantic search can also find related information even when it is phrased differently. ## Content types -- **Markdown:** stable project documentation, runbooks, learning records, and structured long-term facts. -- **Card:** one atomic, reusable experience, preference, or decision. +- **Markdown:** long-term notes, learning records, project documentation, and structured knowledge. +- **Card:** one atomic, reusable experience, preference, fact, or decision. Private Notes are a separate store rather than a Recall content type. diff --git a/docs/concepts/skills.md b/docs/concepts/skills.md index 86a4417..a1541a3 100644 --- a/docs/concepts/skills.md +++ b/docs/concepts/skills.md @@ -1,95 +1,69 @@ # Use Skills -A Skill is a document-based working method for an agent. It explains when to use a capability, what steps to follow, what dependencies are required, and which operations need confirmation. +A Skill teaches an agent how to handle a kind of task. It can describe the steps to follow, required tools or accounts, and actions that need confirmation. ## Official core Skills -AgentDock native installers and Docker images ship these core Skills with the runtime: +AgentDock installers and Docker images include four core Skills: -- `agentdock-user-guide` -- `skill-authoring` -- `skill-installation` +- `agentdock-user-guide` — helps with AgentDock setup and day-to-day use. +- `skill-authoring` — helps create and review Skills. +- `skill-installation` — helps review and install Skills safely. +- `plugin-import` — helps bring remote Plugins from Git, GitHub, or other catalogs into AgentDock for review and installation. -They are managed like other AgentDock-managed Skills: each name has one current content tree. AgentDock does not keep a selectable Skill-version history or an active-version pointer. +Skills that need extra accounts, system permissions, or third-party software are installed separately when needed. -Skills that require extra accounts, system permissions, or third-party software are installed separately when needed. +## How to use a Skill -## How to use Skills - -Tell the agent your goal directly, for example: +Usually you only need to describe the goal: ```text -Check current Codex allowance. +Check my current Codex allowance. Use the desktop Skill to operate this macOS app. -Install and use this Skill: https://example.com/example-skill.zip +Review and install this Skill: https://example.com/example-skill ``` -The agent typically: - -1. Uses `agentdock_context` or `workspace_context` to discover relevant Skill candidates and their source. -2. Selects one exact candidate and reads the `file` returned by the host with `read_file`. -3. Checks required commands, accounts, environment variables, and safety boundaries. -4. Uses real tools to perform the task; commands bound to a Skill use that candidate's returned `skill_ref` with `exec_command`. -5. Confirms and verifies operations with side effects. - -Do not reconstruct a `skill_ref` from a bare Skill name. The host-issued reference keeps managed, shared, and workspace candidates with the same name distinct. - -## Workspace-local Skills +AgentDock finds relevant Skills and lets the agent read the instructions only when they are needed. A project can also provide its own Skills under `.agents/skills/`; those project-specific instructions stay separate from globally installed Skills even when the names match. -A project can expose local Skills at `/.agents/skills//SKILL.md`. `workspace_context` indexes them and returns provenance such as `name`, `description`, `source_type`, `source_id`, `skill_ref`, and `file`; it does not inject the Skill body into context. +## Install or update a Skill -A workspace Skill, an AgentDock-managed Skill, and a shared Skill under `~/.agents/skills` remain separate candidates even when their names match. For project work, a workspace candidate is often the relevant choice, but the agent must use the selected candidate's own `file` and `skill_ref` instead of silently applying a global name-based priority. - -## Installing or updating a managed Skill - -Confirm the source is trustworthy before installing. Ask the agent to review the package first: +Ask the agent to review an unfamiliar Skill before installing it: ```text -Please review this Skill's source, files, portability, and permission requirements, then install it if the review is clean. +Review this Skill's source, files, portability, and permission requirements. Install it only if the review is clean. ``` -`skill_manage install` accepts a local Skill directory, a local ZIP archive, or an HTTPS package URL. An optional source SHA-256 can be supplied for integrity checking. - -A managed Skill has one current content tree. Installing different content with the same Skill name atomically replaces that current content after validation; reinstalling identical content is a no-op and returns the same `content_digest`. AgentDock does not expose `activate`, `rollback`, or version-selection actions for Skills. To restore known content, review and reinstall the desired source snapshot. - -When upgrading from an older AgentDock release that used the historical Skill layout, supported installers and updaters migrate managed Skill content and persistent Skill data automatically. The old layout is kept intact until the outer install/update transaction commits, so users do not need to move Skill directories or run migration commands manually. +A Skill installed through AgentDock can come from a local directory, a local ZIP file, or an HTTPS package URL. Installing reviewed new content with the same name replaces the current copy. Reinstalling identical content does nothing. -Skill packages must not contain tokens, cookies, browser sessions, `.env` files, caches, or device-private data. +Normal AgentDock upgrades migrate older Skill layouts automatically. You do not need to move Skill directories by hand. -## Configure accounts or API keys +## Accounts, API keys, and private data -When a managed Skill requires credentials, ask the agent to save them in that Skill's isolated environment, for example: +When an installed Skill needs a credential, ask the agent to save it in that Skill's isolated environment instead of putting it in the Skill package or a repository. For example: ```text -Set EXAMPLE_API_KEY for example-skill without echoing the actual value in the reply. +Set EXAMPLE_API_KEY for example-skill without echoing the value in the reply. ``` -`skill_manage env_list` reports variable names and configuration state without returning secret values. The isolated environment is injected only when a command runs with that managed candidate's `skill_ref`; it is not written into the Skill package or the permanent system environment. - -## Persistent Skill data - -When a managed Skill command needs mutable persistent state, AgentDock creates a private data directory and exposes it to that process as the reserved `SKILL_DATA_DIR` environment variable. - -The Skill should treat `SKILL_DATA_DIR` as an optional AgentDock integration, not as a portable requirement. Shared and workspace candidates do not inherit a managed Skill's environment or data directory. Normal managed-Skill updates and `skill_manage remove` preserve isolated environment and persistent data; `skill_manage remove` with `purge=true` removes those preserved resources as well. +AgentDock can also give an installed Skill its own private data directory when the Skill needs to keep state. Normal updates and removal keep that data by default; an explicit purge removes it. -Supported AgentDock installers and self-updaters migrate older managed-Skill layouts automatically during a normal upgrade, so no manual directory migration is required. - -## Usage precautions +Skill packages must not contain tokens, cookies, browser sessions, `.env` files, caches, or device-private data. -- Confirm before deleting, sending, uploading, paying, or authorizing. -- Skill instructions cannot exceed the permissions of the AgentDock process, container volumes, or the operating system. -- Third-party Skills may call external services; verify source and capabilities before installation. -- Do not paste secrets into public logs or package them with the Skill. -- Treat `content_digest` as content identity and audit evidence, not as a product version number. +## Skill, Plugin, or MCP? -## Viewing installed Skills +| Use | When it fits | +| --- | --- | +| **Skill** | You want to teach the agent a reusable way to perform a task. | +| **Plugin** | You want to install a package that can include one or more Skills and MCP connections. | +| **Dynamic MCP** | You want AgentDock to connect directly to one external or local MCP service. | -Ask directly: +See [Use Plugins](./plugins.md) and [Connect external MCP services](./dynamic-mcp.md) for the other two options. -```text -What Skills are available here, and where does each candidate come from? -``` +## Safety -The agent can use `agentdock_context` for managed/shared candidates and `workspace_context` for the active project, then read full Skill documentation only when needed. +- Review third-party Skills before installation. +- Confirm sensitive actions such as sending, deleting, uploading, paying, or granting access. +- A Skill cannot exceed the permissions of the AgentDock process, container mounts, or operating-system user. +- Keep secrets out of Skill packages, public logs, and repositories. -Creating and maintaining Skills is a developer workflow; see [Contributor guide](../contributing/development.md#skill-development). +To see what is available, ask the agent which Skills it can use and where each one comes from. Creating and maintaining Skills is covered in the [Contributor guide](../contributing/development.md#skill-development). diff --git a/docs/concepts/tasks.md b/docs/concepts/tasks.md index bec5931..ac30fe7 100644 --- a/docs/concepts/tasks.md +++ b/docs/concepts/tasks.md @@ -31,7 +31,7 @@ A step moves forward only after the underlying work is complete. A tool returnin A task is marked blocked only when work truly cannot continue, such as when a target computer is offline, required permissions are missing, or an external service remains unavailable. -An ordinary test failure is not a blocker; the agent should continue troubleshooting. After the blocker is resolved, say: +An ordinary test failure does not mark the task as blocked; troubleshooting can continue. After the blocker is resolved, you can say: ```text The device is available again. Continue the previous task. @@ -39,23 +39,23 @@ The device is available again. Continue the previous task. ## How completion is determined -Before completing a task, the agent should verify: +A task is considered complete only when: 1. Every step is actually complete. 2. Each completion condition has verifiable evidence. -3. No remaining risk or temporary workaround is left unexplained. +3. Remaining risks or temporary workarounds are explained. 4. The modified service, page, or program works in the real environment. “Code changed” and “command finished” do not mean the task is complete. ## Workflow templates -Common development, deployment, and operations processes can be saved as templates. The agent matches templates first, then removes, combines, or adjusts steps for the current task. +Common development, deployment, and operations processes can be saved and reused as Workflow templates. Templates are workflow guidance; they do not execute commands automatically. -A template is workflow guidance. It does not execute commands automatically and does not replace inspection of the current environment. +See [Workflow](./workflow.md) for the shared NexusDock workflow library. ## Data scope Task state belongs to the current AgentDock instance and is not synchronized across devices automatically. Long-term conclusions should be moved into project documentation or NexusDock Recall rather than left only in old task records. -See [Tools](../reference/tools.md#recoverable-tasks-and-workflows) for exact actions and fields. +See [Tools](../reference/tools.md) for complete operations and fields. diff --git a/docs/concepts/workflow.md b/docs/concepts/workflow.md new file mode 100644 index 0000000..d181136 --- /dev/null +++ b/docs/concepts/workflow.md @@ -0,0 +1,37 @@ +# Workflow + +Workflow is NexusDock's shared library for reusable procedures. If something happens repeatedly and usually follows a similar set of steps, it can be saved as a Workflow. Everyday life, learning, content creation, work, and technical tasks can all use it. + +## What it does + +A Workflow saves a reusable process so similar tasks do not need to be planned from scratch every time. + +For example, you can keep workflows for: + +- preparing for a trip; +- weekly study review or organizing notes; +- organizing photos, downloads, or personal files; +- writing, filming, or publishing content; +- recurring checks and routine work tasks; +- releasing software, deploying a service, or troubleshooting a recurring issue. + +Workflow templates are shared through NexusDock, so paired AgentDock devices can use the same procedures. + +## How to use it + +You can ask directly: + +```text +Use my usual trip-preparation workflow to check what is still missing. +Use the weekly review workflow to organize what I should study today. +Save this photo-organizing process as a reusable workflow. +Use the existing release workflow for this version. +``` + +A Workflow is a reusable process, not an automatic script. AgentDock can adjust the steps to the current task and environment before carrying them out. + +## Matching + +Basic Workflow matching works without an AI or Embedding provider. If Embedding is configured in **Settings → AI & Vectors**, NexusDock can also use semantic matching to find relevant workflows. + +Current task progress is separate from Workflow templates. See [Tasks and progress](./tasks.md) for execution progress, and [Recall memory](./recalldock.md) for long-term knowledge. diff --git a/docs/contributing/development.md b/docs/contributing/development.md index 3b8b187..3b99b0a 100644 --- a/docs/contributing/development.md +++ b/docs/contributing/development.md @@ -1,109 +1,69 @@ # Contributor guide -This page is for contributors modifying AgentDock source code, public documentation, or first-party Skills. +This page is the development entry point for AgentDock, NexusDock, and related repositories. -Code and public documentation are maintained in separate repositories: +## Main repositories -- [`uvwt/agentdock`](https://github.com/uvwt/agentdock) -- [`uvwt/agentdock-docs`](https://github.com/uvwt/agentdock-docs) +- [`uvwt/agentdock`](https://github.com/uvwt/agentdock): AgentDock Core, desktop apps, tools, and built-in capabilities. +- [`uvwt/nexusdock`](https://github.com/uvwt/nexusdock): multi-device console, unified MCP, Recall, and Workflow. +- [`uvwt/agentdock-protocol`](https://github.com/uvwt/agentdock-protocol): shared protocol between AgentDock and NexusDock. +- [`uvwt/agentdock-docs`](https://github.com/uvwt/agentdock-docs): public documentation. -Update the matching documentation whenever user-visible behavior changes. +## Local checks -## Source checks - -Run this in the AgentDock repository: +### AgentDock ```bash make check ``` -It runs formatting, tests, vet, and builds. During local development, package-level tests may run first, but the complete check is still required before submission. - -Changes involving concurrency, platform differences, installers, Docker, browsers, ACP, or desktop lifecycle also require relevant focused tests and real-environment verification. +For desktop apps, installers, browser behavior, or platform-specific changes, also run the relevant tests and validate on a real environment. -## Documentation checks +### NexusDock -Run this in the `agentdock-docs` repository: +For first-time development: ```bash -pnpm install --frozen-lockfile -pnpm check +make web-deps +make build ``` -`pnpm check` runs TypeScript checks, locale tests, English/Simplified Chinese structural consistency checks, production builds for both locales, and the default production build. After changing navigation, layout, or wide tables, inspect desktop and mobile pages in a real browser. - -## Public-contract discipline - -Public documentation describes behavior that an ordinary user or third-party integrator can reproduce. It is not a maintainer notebook. +For normal checks: -- Use current `main` source, public release assets, tool schemas, and supported UI/CLI entry points as the source of truth. -- Derive tool names and actions from the actual MCP contracts. Use the client's `tools/list` for availability rather than documenting internal helper functions as public tools. -- Derive runtime configuration from the current Core configuration parser and public server flags. Installer-only transaction variables, test switches, signing variables, and maintainer deployment overrides are not user configuration. -- Use generic placeholders such as `example.com`, ``, and ``. Never publish a maintainer username, device name, private hostname, local project path, personal proxy, private endpoint, or real credential. -- Document supported defaults and user-controlled overrides, not the topology of a maintainer machine. Platform examples should work for a normal installation of that platform. -- Keep compatibility code and migration behavior out of the primary path. Mention a legacy input only when current users may still encounter it, and label the current replacement clearly. -- Keep English and Simplified Chinese pages semantically synchronized in the same change. +```bash +make check +``` -When a source comment or historical document conflicts with executable behavior, verify the actual contract and tests before updating user documentation. Do not preserve stale wording merely for consistency with an older release. +For full validation: -## Change principles +```bash +make ci +``` -- Inspect the existing directory structure, interfaces, error handling, and test style first. -- Keep the primary flow readable; do not create abstraction only for formal layering. -- Update tests when changing tool descriptions, schemas, paths, authentication, commands, browsers, ACP, or desktop capabilities. -- When changing an installer, verify help text, defaults, generated files, supported release assets, upgrades, uninstall behavior, and representative installation paths. -- Preserve user data unless the public action explicitly requests destructive cleanup; document purge behavior separately from ordinary update/remove behavior. -- Do not expose real tokens, private endpoints, personal directories, or maintainer credentials in tests, examples, screenshots, logs, or docs. +### Documentation -## Tool result conventions +```bash +pnpm install --frozen-lockfile +pnpm check +``` -Use MCP protocol-level `isError` for tool-call errors. Successful tool results do not use ambiguous generic fields such as `ok` or `tool_ok`: +After changing navigation or layout, also inspect desktop and mobile pages in a real browser. -- Commands use `command_ok`, `exit_code`, and `command_error`. -- Browser operations use `browser_ok` and `browser_error`. -- Other tools use explicit domain fields such as `changed`, `configured`, `written`, or similarly scoped results. +## Development notes -When adding or changing an output schema, verify that `structuredContent` does not leak generic state fields from internal HTTP, WSL child-process, installer, or runner protocols. +- Inspect the existing structure, interfaces, error handling, and tests before changing behavior. +- When user-visible behavior changes, update the tests and public documentation together. +- When shared AgentDock/NexusDock interfaces change, check `agentdock-protocol` and both implementations. +- Do not place real tokens, private endpoints, personal paths, or other sensitive information in examples, tests, logs, or docs. +- Validate platform, installation, networking, and UI changes in the relevant real environment. ## Skill development -First-party Skills use a portable document core with optional AgentDock integration. The minimum layout is: +Skills should remain portable and must not depend on maintainer-specific paths, credentials, or private state. Minimal structure: ```text example-skill/ └── SKILL.md ``` -Add `references/`, `scripts/`, entry points, and tests only when needed. Requirements: - -- `SKILL.md` has a valid `name`, a useful `description`, and non-empty instructions. -- Use relative paths inside the package; do not depend on a maintainer checkout path or private AgentDock state path. -- Scripts read configuration from the current process environment and keep mutable state outside the package. -- Do not package `.env` files, tokens, caches, login state, databases, downloaded results, symlinks, or device-private data. -- `metadata.version`, if present, is author metadata only. AgentDock does not use a Skill version field for install selection, activation, or rollback. -- Treat `content_digest` as current-content identity. Reinstalling identical managed content is a no-op; changed content replaces the current managed tree transactionally. -- If persistent mutable data is required, portable code should treat `SKILL_DATA_DIR` as an optional AgentDock adapter. Do not hard-code `~/.agentdock/data/...`. -- Use `skill-authoring` to review structure, portability, and safety. Runtime installation uses `skill_manage`; there is no `skill_package validate` compatibility action to document. -- When executing Skill-bound commands in integrations, use the exact host-issued `skill_ref` from discovery rather than reconstructing one from a bare name. - -See [Use Skills](../concepts/skills.md) for the user workflow. - -## Cross-repository changes - -A user-visible change may require more than one repository: - -- Tool behavior, installers, Core configuration, and bundled Skills: update `uvwt/agentdock` and matching docs. -- Shared AgentDock/NexusDock interfaces: update `uvwt/agentdock-protocol` first when the protocol contract changes, then update both implementations and docs. -- NexusDock-only deployment or fleet UI behavior: update `uvwt/nexusdock` and the relevant public documentation. -- Community or independently distributed Skills: update the Skill source/catalog rather than copying maintainer-specific installation state into AgentDock docs. - -Keep each repository change independently reviewable and link related PRs when a public contract spans repositories. - -## Commits and releases - -- `main` is the stable branch. -- Commit messages use the repository's current convention; AgentDock commonly uses `type(scope): 中文说明`. -- Before committing, confirm the working tree contains only changes for the current task. -- Run the full repository checks before submission and check GitHub Actions after pushing. -- Visit the deployed documentation after publication when the change affects navigation, rendering, downloads, or copyable commands. -- Release signing, production deployment, and maintainer-machine operations belong in maintainer runbooks or automation, not ordinary user pages. +Add scripts, references, and tests only when needed. Runtime installation uses `skill_manage`; see [Use Skills](../concepts/skills.md) for the user workflow. diff --git a/docs/getting-started/docker.md b/docs/getting-started/docker.md index 9fd521a..dec46ff 100644 --- a/docs/getting-started/docker.md +++ b/docs/getting-started/docker.md @@ -15,9 +15,7 @@ Make sure both commands display version numbers before continuing. ## 2. Download Compose configuration -Choose the command block for your operating system. - -### macOS / Linux +Run: ```bash mkdir -p agentdock && cd agentdock @@ -26,18 +24,6 @@ curl -fL https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.ym printf 'AGENTDOCK_AUTH_TOKEN=%s\n' "$(openssl rand -hex 32)" > .env ``` -### Windows PowerShell - -```powershell -New-Item -ItemType Directory -Force agentdock | Out-Null -Set-Location agentdock -Invoke-WebRequest ` - https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.yml ` - -OutFile docker-compose.yml -$token = [guid]::NewGuid().ToString("N") + [guid]::NewGuid().ToString("N") -"AGENTDOCK_AUTH_TOKEN=$token" | Set-Content -Encoding ascii .env -``` - The connection token is stored in `.env`. Do not commit it to Git or share it publicly. For optional settings such as browser images, tunnels, or custom ports, see [`.env.example`](https://raw.githubusercontent.com/uvwt/agentdock/main/.env.example) in the repository. @@ -66,15 +52,9 @@ The token is the value of `AGENTDOCK_AUTH_TOKEN=` in `.env`. To view the token: ```bash -# macOS / Linux cat .env ``` -```powershell -# Windows PowerShell -Get-Content .env -``` - :::tip **Setup complete:** once `docker compose ps` shows `healthy` and the MCP URL and token are added to your client, AgentDock is ready to use. ::: @@ -95,7 +75,7 @@ docker compose logs -f cloudflared-quick Look for `https://...trycloudflare.com` in the logs. Append `/mcp` to the address in your client and use the Bearer Token from `.env` for authentication. -This temporary URL may change when the container or tunnel restarts. It is suitable for testing, not OAuth or long-term use. For a fixed domain, see [Advanced Docker configuration](../operations/docker.md#cloudflare-tunnel). +This temporary URL may change when the container or tunnel restarts. It is suitable for testing, not OAuth or long-term use. For a fixed domain, see [Advanced Docker configuration](../operations/public-access.md). ## Update @@ -117,4 +97,4 @@ docker compose --profile cloudflare-quick up -d --force-recreate - For browser images, dev tools images, port changes, mounting projects, or data migration: see [Advanced Docker configuration](../operations/docker.md). - If startup fails: see [Troubleshooting](../operations/troubleshooting.md). -- For LAN or public access: read the [Security model](../operations/security.md) first. +- For LAN or public access: see [Public access](../operations/public-access.md). diff --git a/docs/getting-started/install.md b/docs/getting-started/install.md index 1137e9b..17fed1e 100644 --- a/docs/getting-started/install.md +++ b/docs/getting-started/install.md @@ -46,4 +46,4 @@ Add them to the MCP, Tools, or Connectors settings in your client and choose **S For your first use, complete only the numbered steps on the page for your operating system. Custom ports, pinned versions, automation flags, and manual service management can wait until later. ::: -If you installed with a public address so web ChatGPT can operate your computer, continue with [Connect ChatGPT to AgentDock](../guides/chatgpt.md). +If you installed with a public address so web ChatGPT can operate your computer, continue with [Connect with ChatGPT](../guides/chatgpt.md). diff --git a/docs/getting-started/linux.md b/docs/getting-started/linux.md index b207535..212acda 100644 --- a/docs/getting-started/linux.md +++ b/docs/getting-started/linux.md @@ -11,7 +11,7 @@ Run in terminal: ```bash curl -fsSL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ -o /tmp/install-agentdock.sh -sudo env AGENTDOCK_NONINTERACTIVE=true sh /tmp/install-agentdock.sh +sudo sh /tmp/install-agentdock.sh ``` The installer automatically detects systemd or OpenRC, creates a low-privilege runtime user, generates a Bearer Token, starts the service, and verifies health. @@ -76,20 +76,27 @@ sudo sh /tmp/install-agentdock.sh The installer asks if you have a Cloudflare-managed domain: - No domain: automatically creates a temporary `trycloudflare.com` address for quick testing. -- Have a domain: complete the [fixed domain setup guide](../guides/fixed-domain.md), then enter the resulting HTTPS public origin and Tunnel Token when the installer asks. +- Have a domain: complete the [Public access](../operations/public-access.md), then enter the resulting HTTPS public origin and Tunnel Token when the installer asks. -After installation, the terminal displays the public MCP URL and connection credentials. Temporary addresses may change after service restarts; rerun the installer and update the client when that happens. Existing Bearer Token and OAuth credentials will be preserved. +After installation, the terminal displays the public MCP URL and connection credentials. A temporary address may change after a restart. Generate a new one with `sudo /opt/agentdock/bin/agentdock tunnel regenerate --runtime-root /etc/agentdock`, then replace the old MCP URL in the client and authorize OAuth again. Existing Bearer Token and OAuth credentials are preserved. -Public access requires authentication. For detailed parameters and log locations, see [Advanced Linux configuration](../operations/linux.md#cloudflare-tunnel). +Public access requires authentication. For detailed parameters and log locations, see [Public access](../operations/public-access.md). ## Update -Download and run Step 1 again. Tasks, Skills, configuration, and working directories are preserved. +Check first, then install the latest release: + +```bash +sudo /opt/agentdock/bin/agentdock update --check +sudo /opt/agentdock/bin/agentdock update +``` + +Tasks, Skills, configuration, and working directories are preserved. Rerun the installer only when you need to repair the installation or install a specific version. ## Next steps - For browser automation: install Chrome, Chromium, or Microsoft Edge on the host and enable browser tools; set `AGENTDOCK_BROWSER_EXECUTABLE_PATH` if not detected automatically. Docker browser images are needed only when you want Chromium contained in Docker. See [Browser automation](../guides/browser-control.md). -- For Alpine, custom directories/ports, manual service management, and uninstallation: see [Advanced Linux configuration](../operations/linux.md). -- For manual systemd, reverse proxy, and OAuth maintenance: see [Manual Linux deployment](./vps.md). +- For Alpine, custom directories/ports, manual service management, and uninstallation: see [Linux and servers](../operations/linux.md). +- For manual systemd, reverse proxy, and OAuth maintenance: see [Linux and servers](../operations/linux.md). - If startup fails: see [Troubleshooting](../operations/troubleshooting.md). -- For public access: read the [Security model](../operations/security.md) first. +- For public access: see [Public access](../operations/public-access.md). diff --git a/docs/getting-started/macos.md b/docs/getting-started/macos.md index 1078b61..bb9a72d 100644 --- a/docs/getting-started/macos.md +++ b/docs/getting-started/macos.md @@ -23,16 +23,12 @@ Apple Silicon and Intel Macs use the same DMG. ## 2. First launch -The current release is not yet notarized by Apple, requiring a one-time manual confirmation on first launch: - -1. Open **Applications** in Finder. -2. Right-click `AgentDock.app` and select **Open**. -3. Click **Open** again in the confirmation prompt. - -Do not disable Gatekeeper or alter global system security settings. After opening successfully once, you can launch normally. +Open **Applications** in Finder and launch `AgentDock.app`. AgentDock runs in the menu bar. Click the menu bar icon and choose **Install AgentDock** or **Open AgentDock** to open the main window. +If macOS blocks the first launch, see [macOS says developer cannot be verified](#macos-says-developer-cannot-be-verified) below. + ## 3. Choose connection option ### Local only @@ -47,7 +43,7 @@ This address may change when the Mac or tunnel restarts. When changed, copy the ### Fixed domain -For a permanent address, first complete the [fixed domain setup guide](../guides/fixed-domain.md). Then select **Fixed domain** and enter the HTTPS public origin and Tunnel Token from that setup. Do not append `/mcp` to the public origin. +For a permanent address, first complete the [Public access](../operations/public-access.md). Then select **Fixed domain** and enter the HTTPS public origin and Tunnel Token from that setup. Do not append `/mcp` to the public origin. Click **Install and Start**, keeping the window open until the status shows "Healthy". You can switch connection modes later directly from the control panel without rerunning the installer. @@ -63,7 +59,11 @@ After setup, the main window displays: Credentials are masked by default; click **Show** when needed. Use the **Copy** button for URLs and credentials. -Use the local MCP URL when the client is on the same Mac; use the public MCP URL for ChatGPT or other remote clients. Select **Streamable HTTP** as the transport. +Use the local MCP URL when the client is on the same Mac; use the public MCP URL for clients on other devices or in the cloud. Select **Streamable HTTP** as the transport. + +Connection menus and authentication options vary by client. OAuth-capable clients can authorize in the browser, while clients that support custom HTTP headers can also use a Bearer Token. + +Connection guides for Claude Desktop, ChatGPT, Claude Code, Cursor, VS Code, Codex, TRAE, WorkBuddy, and other clients are available in [Connect from different clients](../guides/mcp-clients.md) and [Connect with ChatGPT](../guides/chatgpt.md). Do not include Bearer Tokens or OAuth passwords in screenshots, issues, or public conversations. @@ -89,9 +89,7 @@ Quitting the menu bar application does not stop the AgentDock background service 4. Verify that AgentDock detects a supported browser. 5. Click **Apply and Restart**. -AgentDock uses isolated sessions and profiles by default. Attaching to an existing Chromium-family browser over CDP is an explicit advanced choice; see the browser guide before using that mode. - -For sessions and security boundaries, see [Browser automation](../guides/browser-control.md). +AgentDock uses a separate browser session by default. For login state and security boundaries, see [Browser automation](../guides/browser-control.md). ## Optional: Launch at login @@ -126,4 +124,4 @@ Copy the new public MCP URL from the control panel and update your client; re-au Verify that Google Chrome, Chromium, or Microsoft Edge is installed, then disable and re-enable browser tools. -For custom versions, directories, manual commands, and uninstallation, see [Advanced macOS configuration](../operations/macos.md). For screen, keyboard, and mouse control, see [macOS desktop automation](../guides/desktop-automation.md). +For custom versions, directories, manual commands, and uninstallation, see [Desktop advanced settings](../operations/desktop.md). diff --git a/docs/getting-started/vps.md b/docs/getting-started/vps.md deleted file mode 100644 index 48ace73..0000000 --- a/docs/getting-started/vps.md +++ /dev/null @@ -1,174 +0,0 @@ -# Manual Linux systemd deployment - -This guide covers manual setup of the service user, prebuilt release, environment file, systemd unit, and HTTPS reverse proxy. - -## Recommended topology - -```text -MCP client -> HTTPS reverse proxy -> 127.0.0.1:8765 -> AgentDock -``` - -AgentDock listens only on a loopback address. Caddy, Nginx, or another reverse proxy provides TLS and the public endpoint. - -## Create the service user and directories - -```bash -sudo useradd --system --create-home --home-dir /srv/agentdock agentdock -sudo install -d -o agentdock -g agentdock /srv/agentdock/AgentDock -sudo install -d -m 0755 /opt/agentdock/bin -sudo install -d -m 0750 /etc/agentdock -``` - -## Download and install the release binary - -```bash -case "$(uname -m)" in - x86_64|amd64) ARCH=amd64 ;; - aarch64|arm64) ARCH=arm64 ;; - *) echo "unsupported architecture: $(uname -m)" >&2; exit 1 ;; -esac - -ASSET="agentdock_linux_${ARCH}.tar.gz" -BASE_URL="https://github.com/uvwt/agentdock/releases/latest/download" -TMP_DIR="$(mktemp -d)" - -curl -fL "$BASE_URL/$ASSET" -o "$TMP_DIR/$ASSET" -curl -fL "$BASE_URL/$ASSET.sha256" -o "$TMP_DIR/$ASSET.sha256" -( - cd "$TMP_DIR" - sha256sum -c "$ASSET.sha256" - tar -xzf "$ASSET" -) - -sudo install -m 0755 "$TMP_DIR/bin/agentdock" /opt/agentdock/bin/agentdock -sudo rm -rf /opt/agentdock/share/agentdock/core-skills -sudo install -d -m 0755 /opt/agentdock/share/agentdock/core-skills -sudo cp -R "$TMP_DIR/share/agentdock/core-skills/." /opt/agentdock/share/agentdock/core-skills/ -sudo chown -R root:root /opt/agentdock/share/agentdock/core-skills -sudo -u agentdock -H /opt/agentdock/bin/agentdock skill bootstrap \ - --bundle /opt/agentdock/share/agentdock/core-skills -rm -rf "$TMP_DIR" -``` - -In production, replace `BASE_URL` with a fixed release: - -```bash -BASE_URL="https://github.com/uvwt/agentdock/releases/download/vX.Y.Z" -``` - -## Environment file - -Create `/etc/agentdock/agentdock.env`: - -```bash -AGENTDOCK_HOST=127.0.0.1 -AGENTDOCK_PORT=8765 -AGENTDOCK_LOG_LEVEL=info -AGENTDOCK_AUTH_TOKEN= -``` - -Restrict its permissions: - -```bash -sudo chown root:agentdock /etc/agentdock/agentdock.env -sudo chmod 0640 /etc/agentdock/agentdock.env -``` - -## systemd unit - -Create `/etc/systemd/system/agentdock.service`: - -```ini -[Unit] -Description=AgentDock MCP server -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -User=agentdock -Group=agentdock -WorkingDirectory=/srv/agentdock/AgentDock -EnvironmentFile=/etc/agentdock/agentdock.env -ExecStart=/opt/agentdock/bin/agentdock \ - --host ${AGENTDOCK_HOST} \ - --port ${AGENTDOCK_PORT} \ - --log-level ${AGENTDOCK_LOG_LEVEL} -Restart=on-failure -RestartSec=3 - -[Install] -WantedBy=multi-user.target -``` - -Start the service: - -```bash -sudo systemctl daemon-reload -sudo systemctl enable --now agentdock -``` - -## Pair NexusDock (optional) - -If this device should use NexusDock Recall/Workflow or join a NexusDock fleet, generate a one-time pairing code under **NexusDock → Settings → System & Nodes**. Pair as the same service user that runs AgentDock, then restart the service: - -```bash -sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair \ - --endpoint https://nexus.example.com \ - --code -sudo systemctl restart agentdock -``` - -Do not put legacy Nexus endpoint/token credentials in `agentdock.env`; current AgentDock loads NexusDock identity from the paired device state. - -## HTTPS reverse proxy - -Caddy example: - -```caddyfile -agentdock.example.com { - reverse_proxy 127.0.0.1:8765 -} -``` - -Client URL: - -```text -https://agentdock.example.com/mcp -``` - -Do not log the Authorization header at the proxy. Configure `AGENTDOCK_TRUSTED_PROXY_CIDRS` only when the proxy is on a trusted network and rewrites `X-Forwarded-For` correctly. - -## OAuth (optional) - -For browser-authorized clients such as ChatGPT, enable OAuth: - -```bash -AGENTDOCK_OAUTH_ENABLED=true -AGENTDOCK_SERVER_URL=https://agentdock.example.com -AGENTDOCK_OAUTH_PASSWORD= -AGENTDOCK_OAUTH_TOKEN_SECRET= -``` - -`AGENTDOCK_SERVER_URL` is the HTTPS origin without `/mcp`. Keep the password and signing key out of version control. See [Connect ChatGPT to AgentDock](../guides/chatgpt.md) for connection and endpoint checks. - -## Update - -Download and verify the target release again, replace the binary **and** refresh/bootstrap that release's `share/agentdock/core-skills` bundle as shown above, then restart: - -```bash -sudo systemctl restart agentdock -sudo systemctl status agentdock --no-pager -``` - -Runtime data and the environment file live in separate directories and are not deleted when the binary is replaced. - -## Verification - -```bash -sudo systemctl status agentdock --no-pager -sudo journalctl -u agentdock -n 100 --no-pager -curl -fsS http://127.0.0.1:8765/healthz -``` - -Use the Bearer Token from the environment file when verifying MCP, and confirm that the public reverse proxy preserves the Authorization header. Source builds are for contributors only; see the [Contributor guide](../contributing/development.md). diff --git a/docs/getting-started/windows.md b/docs/getting-started/windows.md index 76edd2b..baf08ac 100644 --- a/docs/getting-started/windows.md +++ b/docs/getting-started/windows.md @@ -44,7 +44,7 @@ Temporary addresses may change when Windows or the tunnel restarts. When changed ### Fixed Cloudflare domain -For a permanent address, first complete the [fixed domain setup guide](../guides/fixed-domain.md). Then select **Fixed domain** and enter the HTTPS public origin and Tunnel Token from that setup. Do not append `/mcp` to the public origin. +For a permanent address, first complete the [Public access](../operations/public-access.md). Then select **Fixed domain** and enter the HTTPS public origin and Tunnel Token from that setup. Do not append `/mcp` to the public origin. After installation, you can switch between Local only, Temporary address, and Fixed domain in the **Public Access** section of the control panel without rerunning the installer. @@ -69,15 +69,11 @@ In the control panel **Overview** tab, check: Credentials are masked by default; click **Show** when needed. -Use the local MCP URL when the client is on the same computer; use the public MCP URL for ChatGPT or other remote clients. Select **Streamable HTTP** as the transport. +Use the local MCP URL when the client is on the same computer; use the public MCP URL for clients on other devices or in the cloud. Select **Streamable HTTP** as the transport. -If you selected a temporary or fixed public address and want to connect web ChatGPT: +Connection menus and authentication options vary by client. OAuth-capable clients can authorize in the browser, while clients that support custom HTTP headers can also use a Bearer Token. -1. Copy the public MCP URL and OAuth password from the control panel. -2. In ChatGPT, open **Settings > Plugins**, and enable developer mode. -3. Create a plugin, enter the public MCP URL, and authorize with the OAuth password. - -For full instructions, see [Connect ChatGPT to AgentDock](../guides/chatgpt.md). For other clients, see [Connect AgentDock from different clients](../guides/mcp-clients.md). +Connection guides for Claude Desktop, ChatGPT, Claude Code, Cursor, VS Code, Codex, TRAE, WorkBuddy, and other clients are available in [Connect from different clients](../guides/mcp-clients.md) and [Connect with ChatGPT](../guides/chatgpt.md). Do not include Bearer Tokens or OAuth passwords in screenshots, issues, or public conversations. @@ -99,4 +95,4 @@ Uninstall AgentDock from Windows **Settings > Apps > Installed apps**, or use ** For browser automation, install Chrome, Chromium, or Microsoft Edge first, then enable browser tools in the control panel. Docker browser images are needed only when you want Chromium contained in Docker. See [Browser automation](../guides/browser-control.md). -For PowerShell automation, pinned versions, WSL, and file locations, see [Advanced Windows configuration](../operations/windows.md). If startup fails, see [Troubleshooting](../operations/troubleshooting.md). +For PowerShell automation, pinned versions, WSL, and file locations, see [Desktop advanced settings](../operations/desktop.md). If startup fails, see [Troubleshooting](../operations/troubleshooting.md). diff --git a/docs/guides/browser-control.md b/docs/guides/browser-control.md index 47a61c2..05aec65 100644 --- a/docs/guides/browser-control.md +++ b/docs/guides/browser-control.md @@ -1,8 +1,8 @@ -# Browser automation +# Use the browser With browser capabilities enabled, the agent can navigate pages, click, type, scroll, capture screenshots, and check page console, network, and page errors. -AgentDock supports Google Chrome, Chromium, and Microsoft Edge. By default, browser automation launches isolated AgentDock-managed sessions. Advanced users can instead attach to an existing Chromium-family browser over CDP; that mode is opt-in and has different isolation boundaries. +AgentDock supports Google Chrome, Chromium, and Microsoft Edge. Browser automation uses an isolated AgentDock-managed browser session by default. ## Before you start @@ -29,7 +29,7 @@ Install Chrome, Chromium, or Microsoft Edge on the host, then enable browser too To have Chromium contained within Docker, use the browser image: 1. Complete [Docker installation](../getting-started/docker.md). -2. Start the browser image per [Advanced Docker configuration](../operations/docker.md#enable-browser-automation). +2. Start the browser image per [Advanced Docker configuration](../operations/docker.md). 3. After connecting the client, confirm the agent can see `browser_*` tools. ## Ask the agent directly @@ -42,23 +42,23 @@ Log in, search for the specified content, but ask for my confirmation before sub Take a screenshot of the final page. ``` -The agent observes the page first, executes actions, and verifies the final state. +Browser automation keeps the page state observable before and after actions, so the final result can be checked instead of inferred. -## Login state, profiles, and existing CDP browsers +## Login state -For an AgentDock-owned browser, use a dedicated `profile_id` when persistent login state is needed. AgentDock stores that profile in its own browser data directory for reuse across later sessions; do not point an owned session at your daily browser profile. +AgentDock uses its own browser environment by default, separate from the browser you use every day. -Advanced setups can attach to an already-running Chromium-family browser. A per-session `cdp_url` is limited to loopback endpoints; named or remote CDP endpoints must be configured by the user through AgentDock settings. `AGENTDOCK_BROWSER_CDP_URL` selects a configured endpoint, while `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP=true` asks AgentDock to reuse one uniquely discovered local CDP browser. +If you want a site to stay signed in, AgentDock can keep that browser login state for later sessions. Some sites may still require a captcha, QR-code scan, or 2FA confirmation the first time you sign in. -When attached over CDP, AgentDock creates and manages a dedicated target inside the external browser and leaves that browser running when the AgentDock session closes. External CDP sessions cannot use AgentDock persistent `profile_id`, cookie injection, or localStorage injection. Because the external browser may contain unrelated logged-in state, attach only to a browser instance you intentionally exposed for automation. +If the host already has an available CDP browser, AgentDock can prefer reusing it and continue using its existing login state. If no reusable browser is available, AgentDock falls back to its own isolated browser. See [Configuration](../reference/configuration.md) for the setting. -Initial logins may still require manual captcha completion, QR code scans, or 2FA confirmations. Do not let the agent echo passwords, cookies, or Authorization headers in chats or logs. +Do not paste passwords, cookies, or other login credentials into chats or logs. ## Security boundaries - Confirm before uploading files, sending messages, submitting forms, deleting content, or authorizing. -- Prefer AgentDock-owned dedicated profiles. If you explicitly use CDP attachment, expose only a browser instance intended for automation. +- Keep browser automation separate from your everyday browsing environment. - Grant access only to websites and files required by the task. -- Clean up persistent profiles when login sessions are no longer needed. +- Clear saved browser login state when you no longer need it. -For tool boundaries, see [Tools reference](../reference/tools.md#browser-automation); for host configuration, see [Configuration reference](../reference/configuration.md#browser-tools). +For tool boundaries, see [Tools reference](../reference/tools.md); for host configuration, see [Configuration reference](../reference/configuration.md). diff --git a/docs/guides/chatgpt.md b/docs/guides/chatgpt.md index f67a3fa..2b035dc 100644 --- a/docs/guides/chatgpt.md +++ b/docs/guides/chatgpt.md @@ -1,4 +1,4 @@ -# Connect ChatGPT to AgentDock +# Connect with ChatGPT Use web ChatGPT to operate files, run commands, manage Git, use browser automation, or drive coding tools on your computer. @@ -10,6 +10,10 @@ Connecting web ChatGPT requires: The graphical installer for Windows and macOS automatically configures Cloudflare tunnels and OAuth. +:::note +In this guide, **plugin** means the connection entry shown in the ChatGPT interface. It is different from an [AgentDock Plugin package](../concepts/plugins.md). +::: + ## Quick setup (Windows / macOS graphical app) First, install AgentDock following the [Windows installation](../getting-started/windows.md) or [macOS installation](../getting-started/macos.md) guide. @@ -21,8 +25,12 @@ When choosing connection options during setup or configuration: - If you do not have a domain yet, select **Temporary public address**. - If you have a custom domain managed by Cloudflare, select **Fixed domain**. +
+ ![Choose temporary public address or fixed Cloudflare domain during setup](/img/guides/chatgpt/01-install-connection-option.png) +
+ :::tip A temporary `trycloudflare.com` address is sufficient for quick setup and testing. Temporary URLs may change after a restart; copy the new URL from the control panel and update the ChatGPT plugin if it changes. ::: @@ -36,8 +44,12 @@ In the **Overview** tab, copy: - **Public MCP URL** (ends with `/mcp`) - **OAuth password** +
+ ![Public MCP URL and OAuth password in the control panel overview](/img/guides/chatgpt/02-copy-public-url-oauth.png) +
+ Credentials are masked by default; click "Show" when needed. Do not share the password in screenshots, issues, or public chats. :::warning @@ -49,12 +61,20 @@ Do not enter local `http://127.0.0.1:8765/mcp` into ChatGPT. ChatGPT cannot reac 1. Open ChatGPT in your browser. 2. Go to **Settings > Plugins > Advanced settings** and enable **Developer mode**. +
+ ![Enable developer mode in ChatGPT settings under plugins](/img/guides/chatgpt/03-chatgpt-developer-mode.png) +
+ 3. Return to the plugins view on the ChatGPT home page and click **➕** / **Create plugin**. +
+ ![ChatGPT plugins page highlighting add button](/img/guides/chatgpt/04-plugins-add-button.png) +
+ 4. Set plugin name to `AgentDock`. 5. In MCP Server URL, paste the public URL you copied, for example: @@ -62,13 +82,21 @@ Do not enter local `http://127.0.0.1:8765/mcp` into ChatGPT. ChatGPT cannot reac https://your-public-host.example/mcp ``` +
+ ![Fill in name and public MCP URL in create plugin dialog](/img/guides/chatgpt/05-fill-name-and-url.png) +
+ 6. Click create and initiate connection. 7. When redirected to the AgentDock authorization page, enter your OAuth password and authorize. +
+ ![Enter OAuth password on AgentDock authorization page](/img/guides/chatgpt/06-create-enter-password.png) +
+ 8. Return to ChatGPT and verify that the AgentDock plugin is available. ChatGPT automatically discovers AgentDock's OAuth metadata, registers the client, and authorizes via the browser. You do not need to manually configure Client ID, Client Secret, authorization URLs, or token endpoints. @@ -97,12 +125,12 @@ When deploying AgentDock on a Linux VPS, server, Docker container, or behind a c 1. **Public HTTPS access**: AgentDock must be accessible via a public HTTPS URL with a valid certificate. 2. **MCP URL format**: The public endpoint must end with `/mcp` (e.g. `https://agentdock.example.com/mcp`). -3. **OAuth enabled**: OAuth must be enabled with `AGENTDOCK_OAUTH_ENABLED=true`, `AGENTDOCK_SERVER_URL`, `AGENTDOCK_OAUTH_PASSWORD`, and `AGENTDOCK_OAUTH_TOKEN_SECRET`. For the full environment variable dictionary and key generation instructions, see [OAuth configuration](../reference/configuration.md#oauth-configuration). +3. **OAuth enabled**: OAuth must be enabled with `AGENTDOCK_OAUTH_ENABLED=true`, `AGENTDOCK_SERVER_URL`, `AGENTDOCK_OAUTH_PASSWORD`, and `AGENTDOCK_OAUTH_TOKEN_SECRET`. For the full environment variable dictionary and key generation instructions, see [OAuth configuration](../reference/configuration.md). 4. **Proxy routing**: The reverse proxy must forward `/mcp`, `/register`, `/oauth/*`, and `/.well-known/*`. After updating the environment configuration, restart AgentDock (e.g. `sudo systemctl restart agentdock` or `docker compose up -d`). -For a step-by-step VPS setup guide, see [Manual Linux deployment](../getting-started/vps.md). +For a step-by-step VPS setup guide, see [Linux and servers](../operations/linux.md). ## Verify OAuth endpoints @@ -159,4 +187,4 @@ If using a temporary public URL that has changed, update the MCP URL in the Chat - Ensure reverse proxies do not log Authorization headers, OAuth codes, or request bodies. - AgentDock operates with the permissions of its runtime user or container; grant only necessary directory and command access. -For full environment variable details, see [Configuration reference](../reference/configuration.md#oauth-configuration). For public server deployments, see [Manual Linux deployment](../getting-started/vps.md). +For full environment variable details, see [Configuration reference](../reference/configuration.md). For public server deployments, see [Linux and servers](../operations/linux.md). diff --git a/docs/guides/coding-agents.md b/docs/guides/coding-agents.md index 75f7d46..301476f 100644 --- a/docs/guides/coding-agents.md +++ b/docs/guides/coding-agents.md @@ -1,93 +1,92 @@ # Use local Coding Agents -AgentDock can optionally connect an MCP client to local Coding Agents through ACP (Agent Client Protocol). This lets ChatGPT or another MCP client hand a coding task to Codex, Claude, Grok Build, or a custom ACP adapter on the computer where the project actually lives. +AgentDock can hand coding work from ChatGPT or another MCP client to a local Coding Agent running on the same computer as your project. This can be Codex, Claude, Grok Build, or a custom coding tool. -ACP is optional and disabled by default. +This feature is optional and disabled by default. Enable it only when you want AgentDock to use a local coding tool for repository work. -## Supported profiles +## What you can use -The macOS and Windows apps provide built-in profiles and also allow custom adapters: +AgentDock includes ready-to-configure options for: -| Profile kind | Local adapter AgentDock uses | -| --- | --- | -| Codex | `codex-acp` or the `@agentclientprotocol/codex-acp` package | -| Claude | `claude-agent-acp` or the `@agentclientprotocol/claude-agent-acp` package | -| Grok Build | `grok agent stdio` | -| Custom | An absolute adapter executable path plus optional arguments | +- **Codex** +- **Claude** +- **Grok Build** +- **Custom coding tools** -Built-in profile IDs are fixed as `codex`, `claude`, and `grok`, so each built-in kind has one profile. You can create multiple custom profiles with different IDs. One enabled profile is selected as the default; calls can choose another profile explicitly with `profile_id`. +Choose one enabled tool as the default. You can also add multiple custom tools and ask for a different one when a task needs it. -Install and sign in to the provider you intend to use before enabling its adapter. AgentDock starts the adapter but does not manage provider accounts or copy provider credentials into its own configuration. +Before enabling a coding tool, install it on the same computer and sign in to its provider if required. AgentDock starts the local integration, but it does not manage the provider account or copy provider credentials into AgentDock settings. + +## Installation preparation + +- **Codex:** install and sign in to Codex. AgentDock also needs `codex-acp`. +- **Claude:** install and sign in to Claude Code. AgentDock also needs `claude-agent-acp`. +- **Grok Build:** install and sign in to Grok. No extra connection component is required. +- **Custom coding tool:** prepare the executable path and any startup arguments it needs. + +The Codex and Claude connection components are installed with npm, so Node.js and npm must be available: + +```bash +npm install -g @agentclientprotocol/codex-acp +npm install -g @agentclientprotocol/claude-agent-acp +``` + +If your system-wide npm directory is not writable, use a user-owned npm prefix instead of running npm with `sudo`. ## macOS and Windows -1. Install the desired Coding Agent and any required ACP adapter on the same computer as AgentDock. -2. Open **Advanced Settings** on macOS or the AgentDock control panel on Windows. +1. Complete the preparation above for the coding tool you want to use. +2. On macOS, open **Advanced Settings**. On Windows, open the AgentDock control panel. 3. Enable **Coding Agent (ACP)**. -4. Add or enable a built-in profile, or add a Custom profile with its adapter command and arguments. -5. Choose one enabled profile as the default. -6. Confirm AgentDock detects the adapter, save the settings, and let AgentDock restart Core. +4. Enable Codex, Claude, or Grok Build, or add a custom coding tool. +5. Choose the default coding tool. +6. Save the settings and let AgentDock restart. +7. Reconnect your MCP client or start a new conversation. -After reconnecting the MCP client, `agentdock_context` reports `default_profile` and the enabled `profiles`. The current connection's `tools/list` should include `acp_session`, `acp_prompt`, and `acp_interaction`. +You normally do not need to configure internal IDs or ACP tool parameters when using the desktop application. -## What you can ask for +## Ask for coding work directly -Describe the outcome directly, for example: +Describe the outcome you want, for example: ```text Use the local Coding Agent on this computer to inspect the repository, fix the failing tests, and verify the change. ``` -AgentDock exposes a small management surface instead of mirroring every ACP protocol method: +If several coding tools are enabled, you can name the one you want in the request, for example: -- `acp_session`: `info`, `new`, `list`, `inspect`, `open`, `update`, `close`, `delete`. -- `acp_prompt`: `start`, `events`, `cancel`. -- `acp_interaction`: `list`, `respond`. - -`open` handles resume/load negotiation internally, `new` can fork from another managed session through `from_session_id` when the adapter supports it, and `update` changes advertised session modes or configuration options. Prompt steering is handled internally when supported; there is no separate public steering action. +```text +Use Claude for this repository task and verify the change when finished. +``` -A long prompt starts asynchronously and returns a Run ID. The upstream agent reads ordered events until the Run settles. Permission responses stay explicit and can only choose options offered by the adapter and allowed by AgentDock policy. +AgentDock handles the local session and tool communication in the background. Permission requests still require an explicit allowed choice before work continues. -## Project directories +## Project access -A Coding Agent session can use any directory that the AgentDock operating-system user can access. AgentDock does not maintain a separate project-directory whitelist. +A local Coding Agent can work only in directories that the operating-system user running AgentDock can access. -This is not an operating-system sandbox. If a Coding Agent should access only selected projects, enforce that boundary with the operating-system account, file permissions, container mounts, or other host controls. +AgentDock does not add a separate operating-system sandbox around the coding tool. If it should only access selected projects, use operating-system accounts, file permissions, container mounts, or other host controls to enforce that boundary. -## Headless or service deployments +## Check that it works -For deployments without the desktop UI, configure one or more ACP profiles in the Core startup environment. For example, a Codex profile can be configured as: +After saving the settings, reconnect the client and start with a harmless task such as: -```bash -AGENTDOCK_ACP_ENABLED=true -AGENTDOCK_ACP_PROFILES_JSON='[{"id":"codex","kind":"codex","command":"/absolute/path/to/codex-acp","enabled":true}]' -AGENTDOCK_ACP_DEFAULT_PROFILE=codex +```text +Use the local Coding Agent to inspect this repository and summarize its structure. Do not modify files. ``` -Custom adapters use `kind=custom`, a unique `id`, an absolute `command`, and optional `args` and `env_from_env`. Keep secret values in the host environment; `env_from_env` maps variable names and does not embed secret values in adapter arguments. - -`AGENTDOCK_ACP_AGENT`, `AGENTDOCK_ACP_COMMAND`, `AGENTDOCK_ACP_ARGS_JSON`, and `AGENTDOCK_ACP_ENV_FROM_ENV_JSON` are legacy single-profile compatibility inputs. Current configurations should use `AGENTDOCK_ACP_PROFILES_JSON` and `AGENTDOCK_ACP_DEFAULT_PROFILE`. - -## Verify the connection - -A complete check covers more than whether settings were saved: - -1. The adapter command exists and is executable by the user running AgentDock. -2. AgentDock Core is healthy after the configuration change. -3. `agentdock_context` shows the expected default and enabled profiles. -4. The MCP connection exposes `acp_session`, `acp_prompt`, and `acp_interaction`. -5. `acp_session info` can start the selected adapter and return its actual capabilities or authentication methods. - -When using a non-default profile, keep passing the same `profile_id` for its session, prompt, and interaction calls. +If that succeeds, AgentDock can start the selected coding tool and return its result through the current conversation. ## Troubleshooting -If a Coding Agent cannot be enabled or started: +If the Coding Agent does not start: + +- Confirm the coding tool is installed and signed in on the same computer and under the same operating-system user that runs AgentDock. +- If that tool requires an ACP connection component, confirm it is installed and available to AgentDock. +- Confirm **Coding Agent (ACP)** is enabled and an enabled tool is selected as the default. +- Save the settings, let AgentDock restart, then reconnect the MCP client or start a new conversation. +- For a custom coding tool, verify its configured executable path and startup arguments. -- Verify the provider CLI and required ACP adapter separately; finding `codex` does not imply `codex-acp` exists, and finding `claude` does not imply `claude-agent-acp` exists. -- Verify the adapter under the same operating-system user and service environment that run AgentDock, not only in another interactive shell. -- For headless deployments, confirm every enabled profile has an absolute executable `command` and that any host variable referenced by `env_from_env` exists. -- Use `agentdock_context` to confirm the expected profile is enabled, then use `acp_session info` to test the adapter itself. -- If a client cached an older tool schema, refresh the AgentDock connection and start a new conversation after ACP is enabled. +## Advanced and headless configuration -See [Tools](../reference/tools.md#coding-agents-acp) for the public tool contract and [Configuration](../reference/configuration.md#coding-agents-acp) for host configuration. +Headless deployments, custom adapter commands, profile IDs, environment variables, and the low-level ACP session tools are advanced configuration details. See [Configuration](../reference/configuration.md) for host setup and [Tools](../reference/tools.md) for the tool contract. diff --git a/docs/guides/desktop-automation.md b/docs/guides/desktop-automation.md deleted file mode 100644 index b939b8d..0000000 --- a/docs/guides/desktop-automation.md +++ /dev/null @@ -1,57 +0,0 @@ -# macOS desktop automation - -The macOS Desktop Skill lets an agent observe the current logged-in desktop and, within the permissions you grant, click, type, use keyboard shortcuts, or drag. - -Docker, remote VPS hosts, system-level background services, and logged-out sessions cannot control the real macOS desktop. - -## 1. Install AgentDock - -Follow the [macOS installation](../getting-started/macos.md) and run AgentDock as the current logged-in user. Docker, a LaunchDaemon, and a remote Linux instance cannot control the current Mac desktop. - -## 2. Install the Desktop Skill - -Send this instruction to a client that is already connected to AgentDock: - -```text -Read the desktop entry from the official AgentDock Skills catalog, review the package source and permissions, verify the package against its digest, then install its current content: -https://raw.githubusercontent.com/uvwt/agentdock-skills/main/catalog.json -``` - -The Desktop Skill is released independently in [uvwt/agentdock-skills](https://github.com/uvwt/agentdock-skills). The catalog can carry publisher version/release metadata plus a download URL and SHA-256 digest, but AgentDock itself keeps only one managed current-content tree per Skill name. After installation, use `agentdock_context` to confirm the managed `desktop` candidate is present and its `content_digest` matches the installed content. Updating it means reviewing and installing the new catalog package; there is no separate activation step. - -## 3. Grant macOS permissions - -1. Grant Screen Recording permission to the terminal or host application that actually runs AgentDock. -2. Grant Accessibility permission when clicking or typing is required. -3. Restart the relevant terminal or application so the permission takes effect. - -Grant these permissions only to the process that runs AgentDock, not to unrelated applications. - -## How to use it - -Describe the goal directly: - -```text -Inspect the current window and explain this error message. -Find the settings page in this application, but ask before changing anything. -Fill this text into the form without submitting it. -``` - -The agent should observe the current application and window first, perform the action, and observe or capture a screenshot again to verify the result. - -## Operations that require confirmation - -The following actions usually need an additional confirmation: - -- Send messages, email, or files. -- Delete content. -- Upload, pay, or authorize access. -- Change system permissions or account settings. -- Write sensitive information to the clipboard. - - -## Privacy - -Desktop screenshots may contain notifications, chats, accounts, and file contents. Do not publish, synchronize, or commit screenshots and runtime artifacts automatically. - -Skill development is covered in the [Contributor guide](../contributing/development.md#skill-development). diff --git a/docs/guides/fixed-domain.md b/docs/guides/fixed-domain.md deleted file mode 100644 index 3d7ef64..0000000 --- a/docs/guides/fixed-domain.md +++ /dev/null @@ -1,162 +0,0 @@ -# Configure a fixed domain - -Use a fixed domain when you want AgentDock to keep the same public MCP address across restarts. AgentDock uses a Cloudflare Named Tunnel, so you do not need to expose a router port or maintain a public HTTPS reverse proxy yourself. - -A typical setup looks like this: - -```text -MCP client → https://agent.example.com/mcp → Cloudflare Tunnel → AgentDock -``` - -## Before you start - -Prepare these items first: - -- AgentDock is already installed and working locally. -- Your domain is managed by Cloudflare. -- You can sign in to the [Cloudflare Zero Trust dashboard](https://one.dash.cloudflare.com/). -- Choose a dedicated hostname such as `agent.example.com`. - -If Cloudflare Tunnel is new to you, see the [Cloudflare Tunnel documentation](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/). - -## 1. Choose a hostname - -Use a dedicated subdomain instead of your root domain. For example: - -```text -agent.example.com -``` - -You will use the same hostname when creating the Cloudflare public hostname and when configuring AgentDock. - -## 2. Create a Cloudflare Tunnel - -In the [Cloudflare Zero Trust dashboard](https://one.dash.cloudflare.com/), create a Cloudflare Tunnel and choose Cloudflared as the connector. - -Cloudflare will show a connector command containing a Tunnel Token. AgentDock needs the **Tunnel Token itself**, not the complete command. Keep this token private. - -If you already have a Named Tunnel that you want AgentDock to use, you can reuse it instead of creating another one. - -## 3. Add the public hostname - -Add a public hostname to the Tunnel: - -```text -Hostname agent.example.com -Service HTTP -``` - -Set the Service URL according to how AgentDock is installed: - -| Installation | Cloudflare Service URL | -| --- | --- | -| macOS, Windows, or native Linux | `http://127.0.0.1:8765` | -| Docker Compose | `http://agentdock:8765` | - -Leave the Path empty. Do not add `/mcp` here: Cloudflare should forward the whole AgentDock service, while `/mcp` is only added by the MCP client later. - -Docker users can also see [Docker Named Tunnel configuration](../operations/docker.md#named-tunnel). - -## 4. Configure AgentDock - -The public address you give AgentDock is the HTTPS origin only: - -```text -https://agent.example.com -``` - -Do not add `/mcp`, a port, a query string, or another path. - -### macOS control panel - -Open the AgentDock control panel, go to **Public access**, and select **Fixed domain**. Enter: - -```text -Public address https://agent.example.com -Tunnel Token -``` - -Apply the change. AgentDock will keep the local service private and use the Named Tunnel for public access. - -See [macOS installation](../getting-started/macos.md) if you have not installed the background service yet. - -### Windows control panel - -Open the AgentDock control panel, select **Public access** → **Fixed domain**, then enter: - -```text -HTTPS public address https://agent.example.com -Tunnel Token -``` - -Click **Apply access mode**. You can then use **Test current public address** on the same page to verify the endpoint. You do not need to rerun the installer just to change the public access mode. - -See [Windows installation](../getting-started/windows.md) if AgentDock is not installed yet. - -### Linux installer - -Linux installations without the desktop control panel can rerun the AgentDock installer and choose the option for an existing Cloudflare-managed domain. Enter the same HTTPS public origin and Tunnel Token when prompted. - -See [Linux installation](../getting-started/linux.md) for the platform-specific command. - -### Docker Compose - -Create the public hostname first, then configure the fixed origin and Tunnel Token in the Docker deployment and start the Named Tunnel profile. - -Follow [Docker Named Tunnel configuration](../operations/docker.md#named-tunnel) for the exact Compose values and command. - -## 5. Verify the fixed domain - -First open or request the public health endpoint: - -```text -https://agent.example.com/healthz -``` - -A healthy AgentDock endpoint returns a successful response containing `ok: true`. - -Then configure your MCP client with: - -```text -Transport Streamable HTTP -URL https://agent.example.com/mcp -Authentication Bearer Token or OAuth shown by AgentDock -``` - -The Tunnel Token is **not** an MCP login credential. It is only used to connect Cloudflare to your AgentDock host. Keep using the AgentDock Bearer Token or OAuth credentials for the MCP client. - -## Address reference - -These three addresses have different purposes: - -| Where | Example | What it means | -| --- | --- | --- | -| Cloudflare Service URL | `http://127.0.0.1:8765` | Where Cloudflare forwards traffic on a native installation | -| AgentDock public address | `https://agent.example.com` | Fixed HTTPS origin used by AgentDock and OAuth | -| MCP client URL | `https://agent.example.com/mcp` | Address entered in ChatGPT or another MCP client | - -For Docker, only the first value changes to `http://agentdock:8765`. - -## Common problems - -### The domain does not open - -Check that the Tunnel is connected in Cloudflare and that the public hostname points to the correct Service URL. A native installation normally uses `http://127.0.0.1:8765`; Docker Compose uses `http://agentdock:8765`. - -### Cloudflare returns 502 - -The Tunnel is reachable, but it cannot reach AgentDock. Confirm that AgentDock is running locally and that the Service URL matches your installation method. - -### AgentDock rejects the public address - -Enter only the HTTPS origin, for example `https://agent.example.com`. Do not enter `https://agent.example.com/mcp`. - -### The MCP client asks for authentication - -That is expected for public access. Use the Bearer Token or OAuth credentials shown by AgentDock. Do not paste the Cloudflare Tunnel Token into the MCP client. - -## Security notes - -Treat the Tunnel Token, Bearer Token, and OAuth credentials as secrets. Do not put them in screenshots, issues, chat logs, or Git repositories. - -A fixed domain does not replace AgentDock authentication. Keep Bearer Token or OAuth enabled for public access and review the [security model](../operations/security.md) before sharing the endpoint with other people. diff --git a/docs/guides/mcp-clients.md b/docs/guides/mcp-clients.md index 2beb791..72182ac 100644 --- a/docs/guides/mcp-clients.md +++ b/docs/guides/mcp-clients.md @@ -1,4 +1,4 @@ -# Connect AgentDock from different clients +# Connect from different clients AgentDock connects to Claude Desktop, ChatGPT, Claude Code, Cursor, VS Code, Codex, TRAE, and WorkBuddy over Streamable HTTP MCP. Every example on this page uses: @@ -18,7 +18,7 @@ For a public client or cloud service, confirm that: - AgentDock is available through a public HTTPS domain. - The MCP URL ends with `/mcp` (for example, `https://agentdock.example.com/mcp`). -- Authentication is configured: remote clients typically require OAuth browser authorization or a Bearer Token in the HTTP request header. For full environment variable setup, see [OAuth configuration](../reference/configuration.md#oauth-configuration). +- Authentication is configured: remote clients typically require OAuth browser authorization or a Bearer Token in the HTTP request header. For full environment variable setup, see [OAuth configuration](../reference/configuration.md). - The reverse proxy forwards `/mcp`, `/register`, `/oauth/*`, and `/.well-known/*`. A local client running on the same computer as AgentDock may also connect to: @@ -53,7 +53,7 @@ Availability of custom MCP connections and the number of servers you can add dep ChatGPT connects to AgentDock over Streamable HTTP MCP using a public HTTPS URL and OAuth browser authorization. Custom MCP plugins require Developer mode to be enabled in ChatGPT settings. -For the complete step-by-step walkthrough, screenshots, and troubleshooting, see [Connect ChatGPT to AgentDock](./chatgpt.md). +For the complete step-by-step walkthrough, screenshots, and troubleshooting, see [Connect with ChatGPT](./chatgpt.md). ## Claude Code @@ -266,4 +266,4 @@ curl -fsS https://agentdock.example.com/.well-known/oauth-protected-resource/mcp A `302` from the authorization page usually means AgentDock is redirecting to the client as expected. If the browser does not continue, confirm that the reverse proxy preserves the `Location` header and that the browser or network policy does not block the callback URL. -See [Configuration](../reference/configuration.md#oauth-configuration) for complete authentication settings and [Manual Linux deployment](../getting-started/vps.md) for public deployment. +See [Configuration](../reference/configuration.md) for complete authentication settings and [Linux and servers](../operations/linux.md) for public deployment. diff --git a/docs/intro.md b/docs/intro.md index 7b9dc2f..9e57392 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -5,9 +5,9 @@ slug: /intro # AgentDock -AgentDock lets MCP-compatible AI clients read files, run commands, operate Git, use browser automation, and connect external services on your computers and servers. +AgentDock connects MCP-compatible AI clients to your computers and servers so they can work with files, run commands, use Git and browsers, and connect other services. -Access is limited by the operating-system user, Docker mounts, and the capabilities you enable. +AgentDock itself is not a chat app or AI model. The connected AI client decides what to do; AgentDock performs the allowed work on the machine where it runs. Access is limited by the operating-system user, Docker mounts, and the capabilities you enable. ## First use @@ -29,13 +29,13 @@ Describe the goal directly, for example: - “Find out why this project fails to start, fix it, and verify the result.” - “Read this repository, change the code, and commit it.” - “Open a website, complete a lookup, and save the result as a file.” -- “Install and use a Skill or connect an external MCP service.” +- “Install and use a Skill, review a Plugin, or connect an external MCP service.” - “Use the browser, desktop automation, or a coding tool such as Codex, Claude, or Grok.” - “Break this long task into steps and keep its progress updated.” The agent selects the appropriate tools based on your request. -If you want web ChatGPT to operate your computer, follow [Connect ChatGPT to AgentDock](./guides/chatgpt.md) after installing with a public address. +If you want web ChatGPT to operate your computer, follow [Connect with ChatGPT](./guides/chatgpt.md) after installing with a public address. ## Where data is stored @@ -50,9 +50,10 @@ Docker stores both categories in Docker volumes by default. Removing the program ## Common entry points -- [Connect AgentDock from different clients](./guides/mcp-clients.md) -- [Connect ChatGPT to AgentDock](./guides/chatgpt.md) +- [Connect from different clients](./guides/mcp-clients.md) +- [Connect with ChatGPT](./guides/chatgpt.md) - [Use Skills](./concepts/skills.md) +- [Use Plugins](./concepts/plugins.md) - [Tasks and progress](./concepts/tasks.md) - [Browser automation](./guides/browser-control.md) - [Use a local Coding Agent](./guides/coding-agents.md) diff --git a/docs/operations/desktop.md b/docs/operations/desktop.md new file mode 100644 index 0000000..e0e8d00 --- /dev/null +++ b/docs/operations/desktop.md @@ -0,0 +1,71 @@ +# Desktop advanced settings + +For normal installation, use the [macOS](../getting-started/macos.md) or [Windows](../getting-started/windows.md) guide. This page only covers settings and maintenance that are useful after installation. + +## Common settings + +The desktop apps already manage most configuration for you. Use **Public Access** and **Advanced Settings** to change: + +- local port and log level; +- temporary or fixed public access; +- NexusDock pairing; +- browser connection mode; +- local Coding Agent profiles; +- chat-card display mode; +- launch-at-login behavior. + +Use the app's update and log actions instead of editing service files by hand. For public addresses, see [Public access](./public-access.md). For browser setup, see [Use the browser](../guides/browser-control.md). + +## macOS + +For automation or a command-line installation: + +```bash +curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ + -o /tmp/agentdock-install.sh +sh /tmp/agentdock-install.sh --register-service +``` + +Useful options include `--version vX.Y.Z` and `AGENTDOCK_INSTALL_DIR=`. The default CLI path is `~/.local/bin/agentdock`. + +Default user data: + +```text +~/.agentdock AgentDock state +~/AgentDock Default working directory +``` + +For screen, keyboard, or mouse automation, grant the app that actually runs AgentDock the required permissions under **System Settings → Privacy & Security**. + +The graphical app can update AgentDock directly. Command-line installations can use: + +```bash +agentdock update --check +agentdock update +``` + +To uninstall while preserving user data: + +```bash +sh /tmp/agentdock-install.sh --uninstall +``` + +Use `--purge-data` only when you intentionally want to remove preserved AgentDock state and the default working directory too. + +## Windows + +For automated or headless installation, use the release PowerShell installer: + +```powershell +$script = Join-Path $env:TEMP 'install-agentdock.ps1' +Invoke-WebRequest ` + https://github.com/uvwt/agentdock/releases/latest/download/install.ps1 ` + -OutFile $script +powershell -ExecutionPolicy Bypass -File $script -RegisterStartup +``` + +The default installation and runtime location is `%LOCALAPPDATA%\AgentDock`. Use the Control Panel for normal updates and settings changes. + +When WSL is installed, file and command tools can target a Linux distribution with `runtime=wsl`. WSL file operations require `python3` in the selected distribution. + +To uninstall, use **Settings → Apps → Installed apps** or **Uninstall AgentDock** from the Start menu. The uninstaller lets you choose whether preserved AgentDock data should also be removed. diff --git a/docs/operations/docker.md b/docs/operations/docker.md index ffda39c..d3bf309 100644 --- a/docs/operations/docker.md +++ b/docs/operations/docker.md @@ -1,133 +1,46 @@ -# Advanced Docker configuration +# Docker -This page covers image variants, Cloudflare Tunnel, custom ports, host-directory mounts, upgrades, and old-data migration. +Use the [Docker installation guide](../getting-started/docker.md) for first-time setup. This page covers the settings most often changed after installation. -AgentDock uses a single `docker-compose.yml`. Optional capabilities (browser image, Cloudflare Tunnel) are enabled with environment variables and Compose profiles—no extra Compose overlay files. +## Images -## Image variants +AgentDock publishes these Linux images for `amd64` and `arm64`: -AgentDock publishes three image variants for `linux/amd64` and `linux/arm64`: - -| Tag | Use case | +| Image | Use | | --- | --- | -| `latest` / `vX.Y.Z` | Default runtime image for normal use | -| `dev-latest` / `dev-vX.Y.Z` | Adds Go, C, C++, and the `pkg-config` build toolchain | +| `latest` / `vX.Y.Z` | Normal runtime | +| `dev-latest` / `dev-vX.Y.Z` | Adds Go and native build tools | | `browser-latest` / `browser-vX.Y.Z` | Adds Chromium for browser automation | -The default Compose file uses the production runtime image. When you need to compile Go or native extensions inside the container, add this to `.env`: - -```dotenv -AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:dev-vX.Y.Z -``` - -Then recreate the container: - -```bash -docker compose up -d --force-recreate -``` - -The `dev` and `browser` images serve different purposes. The browser image does not include the Go compiler by default. - -## Enable browser automation - -Point Compose at the browser image and enable browser tools in `.env`: +Choose another image through `.env`: ```dotenv AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:browser-latest AGENTDOCK_BROWSER_ENABLED=true ``` -Then recreate: - -```bash -docker compose up -d --force-recreate -``` - -The Compose file already sets `shm_size` to 1 GB for Chromium. Browser profiles, screenshots, and session state remain in the AgentDock data volume. - -Use a dedicated `profile_id` for browser sessions. Do not mount the complete profile directory from your daily browser. - -## Cloudflare Tunnel - -Tunnel services live in the same `docker-compose.yml` and are activated with Compose profiles. Optional sample variables are listed in [`.env.example`](https://raw.githubusercontent.com/uvwt/agentdock/main/.env.example) on the repository. - -### Quick Tunnel - -```bash -docker compose --profile cloudflare-quick up -d -docker compose logs -f cloudflared-quick -``` - -The URL in the log is temporary and changes after restart. Append `/mcp` and keep the Bearer Token from `.env` when configuring the client. +See [Use the browser](../guides/browser-control.md) for browser behavior. -### Named Tunnel +## Port and data -Complete [Configure a fixed domain](../guides/fixed-domain.md) first. Then add the resulting public origin and Tunnel Token to the existing deployment `.env` without overwriting the current AgentDock token: - -```dotenv -AGENTDOCK_SERVER_URL=https://agent.example.com -TUNNEL_TOKEN=replace-with-cloudflare-tunnel-token -``` - -Restrict `.env` to the current user and start the named profile: - -```bash -chmod 600 .env -docker compose --profile cloudflare-named up -d -``` - -Use the Docker service URL from the fixed-domain guide. Compose passes `TUNNEL_TOKEN` only to the `cloudflared-named` container; the AgentDock container receives `AGENTDOCK_SERVER_URL` and its own authentication token, but not the Tunnel Token. The token is provided through the container environment and does not appear in the `cloudflared` command arguments. - -Use only one Tunnel profile at a time. To stop the deployment and remove the Tunnel container while preserving AgentDock data: - -```bash -docker compose \ - --profile cloudflare-quick \ - --profile cloudflare-named \ - down -``` - -## Change the local port - -The default MCP URL is `http://127.0.0.1:8765/mcp` (host and container both use port `8765`). When that host port conflicts, add this to `.env`: +The default MCP URL is `http://127.0.0.1:8765/mcp`. To change the host port: ```dotenv AGENTDOCK_PUBLISH_PORT=18767 ``` -Then restart: - -```bash -docker compose up -d --force-recreate -``` - -The new MCP URL becomes `http://127.0.0.1:18767/mcp`. - -The default listener is bound only to the local loopback address. Do not change it directly to `0.0.0.0` for convenience. Read the [Security model](./security.md) before allowing LAN or public access. - -## Where data is stored - -The default Compose file uses two Docker named volumes: +The default Compose file keeps persistent data in two named volumes: ```text agentdock_home -> /home/agentdock/.agentdock agentdock_workspace -> /home/agentdock/AgentDock ``` -- `agentdock_home`: tasks, Skills, dynamic MCP, isolated environments, and runtime artifacts. -- `agentdock_workspace`: the default working directory for file, command, and Git tools. - -Inspect the actual volume names: - -```bash -docker compose config --volumes -``` - -`docker compose down` does not delete this data. +`docker compose down` preserves these volumes. -## Mount a host project directory +## Mount a host project -To let AgentDock work directly with a host project, replace the workspace volume with a bind mount: +Replace the workspace volume with a bind mount when AgentDock needs to work directly on host files: ```yaml services: @@ -137,104 +50,34 @@ services: - ./AgentDock:/home/agentdock/AgentDock ``` -On Linux, make sure container UID/GID `10001` can write to the directory: +On Linux, make sure container UID/GID `10001` can write to the mounted directory. Mount only the paths you want the container to access. -```bash -mkdir -p AgentDock -sudo chown -R 10001:10001 AgentDock -``` - -Mount only the directories the task requires. AgentDock does not treat the working directory as a security sandbox; the container can access whatever you actually mount. +## Public access -## Pin a version +Keep the normal service bound to the local host and use the supported Cloudflare Tunnel profile when remote access is required. See [Public access](./public-access.md) instead of duplicating Tunnel settings here. -Compose is maintained in the repository. The default image tag is `latest`. For a reproducible deploy, pin both the Compose revision (git tag) and the image tag. - -To download Compose from a specific git tag: +## Update and logs ```bash -VERSION=vX.Y.Z -curl -fL "https://raw.githubusercontent.com/uvwt/agentdock/$VERSION/docker-compose.yml" \ - -o docker-compose.yml -``` - -Windows users can replace `curl -fL ... -o ...` with `Invoke-WebRequest ... -OutFile ...`. - -Pin the image in `.env` (runtime or browser): - -```dotenv -AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:vX.Y.Z -# or browser: -# AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:browser-vX.Y.Z -# AGENTDOCK_BROWSER_ENABLED=true -``` - -## Update AgentDock - -```bash -curl -fL https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.yml \ - -o docker-compose.yml docker compose pull docker compose up -d --force-recreate -``` - -For browser deployments, keep `AGENTDOCK_IMAGE` and `AGENTDOCK_BROWSER_ENABLED` in `.env`. For Tunnel deployments, keep the same `--profile` on `pull` and `up`. - -After the update, run: - -```bash docker compose ps ``` -Confirm that the service returns to `healthy`. - -## Migrate from v0.4.1 or earlier - -Older Compose files bind-mounted `./AgentDockHome` and `./AgentDock` directly into the container. Do not delete those directories when they contain existing data. - -You can continue using them, but update the container paths to the new locations: - -```yaml -services: - agentdock: - volumes: - - ./AgentDockHome:/home/agentdock/.agentdock - - ./AgentDock:/home/agentdock/AgentDock -``` - -On Linux, update ownership as well: - -```bash -sudo chown -R 10001:10001 AgentDockHome AgentDock -``` - -After confirming that the new container can see the original tasks, Skills, MCP configuration, and project files, decide whether to migrate to named volumes. Never let two running AgentDock instances use the same state directory simultaneously. - -## View logs and stop the service +Follow logs with: ```bash -# Follow logs docker compose logs -f - -# Stop and remove containers while preserving data -docker compose down ``` -When a Tunnel profile is active, pass the same profile to these commands, for example: +Stop containers while preserving data: ```bash -docker compose --profile cloudflare-named logs -f -docker compose --profile cloudflare-named down +docker compose down ``` -## Delete all Docker data - -Run this only after confirming that you no longer need the tasks, Skills, MCP configuration, or project files: +Delete the named volumes only when you intentionally want to remove AgentDock state and workspace data: ```bash docker compose down -v ``` - -:::danger -**Irreversible:** `-v` deletes the named volumes created by Compose. Back up any data you need before running it. -::: diff --git a/docs/operations/linux.md b/docs/operations/linux.md index 1cda147..72418ac 100644 --- a/docs/operations/linux.md +++ b/docs/operations/linux.md @@ -1,199 +1,74 @@ -# Advanced Linux configuration +# Linux and servers -This page covers interactive installation, Cloudflare Tunnel, custom directories and ports, service-manager selection, optional NexusDock pairing, and installation without a managed system service. +For a normal Linux installation, start with [Install on Linux](../getting-started/linux.md). This page covers server-oriented settings and service management. -## Alpine and minimal systems +## Install -The unified `install.sh` entry needs a POSIX shell, Bash, CA certificates, and either curl or wget. Install the missing tools first: - -```sh -apk add --no-cache bash curl ca-certificates -``` - -Then run the same `install.sh` command shown below. There is no separate bootstrap installer. - -## Interactive installation - -Without `AGENTDOCK_NONINTERACTIVE`, the installer asks for each setting: +The public installer detects the architecture and can register systemd or OpenRC automatically: ```bash curl -fsSL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ -o /tmp/install-agentdock.sh -sh /tmp/install-agentdock.sh -``` - -The public installer uses the prebuilt release archive for the detected architecture. Building AgentDock from source is a contributor workflow, not an installer mode. - -## Cloudflare Tunnel - -The installer asks whether you already have a domain managed by Cloudflare: - -| User answer | Installer mode | Result | -| --- | --- | --- | -| Domain available | Fixed (`named`) | Stable HTTPS hostname for long-running clients and OAuth | -| No domain | Temporary (`quick`) | Generated `trycloudflare.com` URL for immediate testing | - -For fixed mode, complete [Configure a fixed domain](../guides/fixed-domain.md) first, then enter the resulting HTTPS public origin and Tunnel Token when the installer asks. - -A temporary installation starts `cloudflared`, reads the generated URL from the service log, writes it to `AGENTDOCK_SERVER_URL`, enables OAuth, and restarts AgentDock. Both modes generate or reuse these credentials: - -- `AGENTDOCK_AUTH_TOKEN` -- `AGENTDOCK_OAUTH_PASSWORD` -- `AGENTDOCK_OAUTH_TOKEN_SECRET` - -The completion panel prints the public URL, MCP URL, Bearer Token, and OAuth login password. The OAuth signing secret is not printed. The Tunnel Token is written only to root-only `/etc/agentdock/cloudflared.env`; it is not written to `agentdock.env`, passed to AgentDock, or placed in the `cloudflared` command line. - -If a temporary URL changes, rerun the same installer. Existing host, port, advanced settings, Bearer Token, OAuth password, and signing secret are preserved. A previously paired NexusDock device identity lives in AgentDock state and is not replaced by rerunning the installer. The new URL is written back automatically and AgentDock is restarted. The client must replace the old MCP URL and authorize OAuth again. - -The default Tunnel service is `agentdock-cloudflared`: - -```bash -# systemd -sudo systemctl status agentdock-cloudflared --no-pager -sudo journalctl -u agentdock-cloudflared -n 100 --no-pager - -# OpenRC -sudo rc-service agentdock-cloudflared status -sudo tail -n 100 /var/log/agentdock-cloudflared.log \ - /var/log/agentdock-cloudflared.err +sudo sh /tmp/install-agentdock.sh ``` -Non-interactive installation remains private unless the mode is explicitly supplied. For a temporary Tunnel: - -```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_TUNNEL_MODE=quick \ - sh /tmp/install-agentdock.sh -``` +On Alpine or another minimal system, install Bash, CA certificates, and curl or wget first. -For fixed mode, set `AGENTDOCK_TUNNEL_MODE=named`, `AGENTDOCK_SERVER_URL`, and `AGENTDOCK_CLOUDFLARE_TUNNEL_TOKEN`. `AGENTDOCK_OAUTH_PASSWORD` and `AGENTDOCK_OAUTH_TOKEN_SECRET` are optional first-install overrides; otherwise the installer generates them. Inject secrets from a protected environment or secret manager. - -## Default directories +Default system installation: ```text -Installation directory /opt/agentdock -Runtime data directory /srv/agentdock -Environment file /etc/agentdock/agentdock.env -Service user agentdock -Listen address 127.0.0.1:8765 +Binary /opt/agentdock/bin/agentdock +Runtime data /srv/agentdock +Environment /etc/agentdock/agentdock.env +Service user agentdock +Listen address 127.0.0.1:8765 ``` -A typical systemd installation creates: - -```text -/opt/agentdock/bin/agentdock -/srv/agentdock/.agentdock -/srv/agentdock/AgentDock -/etc/agentdock/agentdock.env -/etc/systemd/system/agentdock.service -``` - -OpenRC creates `/etc/init.d/agentdock` instead. - -## Non-interactive configuration - -Override defaults through environment variables in automated deployments: - -```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_RELEASE_VERSION=latest \ - AGENTDOCK_PORT=8765 \ - sh /tmp/install-agentdock.sh -``` - -Common variables: - -| Variable | Purpose | -| --- | --- | -| `AGENTDOCK_RELEASE_VERSION` | `latest` or `vX.Y.Z` | -| `AGENTDOCK_SOURCE_DIR` | Binary installation root | -| `AGENTDOCK_DATA_DIR` | State and working-directory root | -| `AGENTDOCK_ENV_FILE` | Service environment file | -| `AGENTDOCK_SERVICE_NAME` | systemd or OpenRC service name | -| `AGENTDOCK_SERVICE_USER` | Low-privilege runtime user | -| `AGENTDOCK_SERVICE_MANAGER` | `auto`, `systemd`, `openrc`, or `none` | -| `AGENTDOCK_HOST` | Listen address | -| `AGENTDOCK_PORT` | Listen port | -| `AGENTDOCK_AUTH_TOKEN` | Custom Bearer Token | -| `AGENTDOCK_TUNNEL_MODE` | `none`, `quick`, or `named` | -| `AGENTDOCK_SERVER_URL` | Fixed HTTPS origin for Named Tunnel and OAuth | -| `AGENTDOCK_CLOUDFLARE_TUNNEL_TOKEN` | Named Tunnel Token; stored only in `cloudflared.env` | -| `AGENTDOCK_CLOUDFLARED_INSTALL_PATH` | Custom `cloudflared` binary path | +## Service and logs -Do not commit real tokens. When `AGENTDOCK_AUTH_TOKEN` is omitted, the installer generates one and writes it to a root-only environment file. - -## Pair NexusDock - -NexusDock is paired after installation; it is not configured through installer environment variables. For the default Linux service account and install root, generate a one-time code in **NexusDock → Settings → System & Nodes**, then run: +For systemd: ```bash -sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair --endpoint https://nexus.example.com --code +sudo systemctl status agentdock --no-pager sudo systemctl restart agentdock +sudo journalctl -u agentdock -f ``` -On OpenRC, restart the corresponding `agentdock` service instead of systemd. If you changed the service user or install root, use those actual values. Do not reintroduce the legacy Nexus endpoint/token environment variables. - -## Install without a system service - -To avoid registering a system service: - -```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_SERVICE_MANAGER=none \ - sh /tmp/install-agentdock.sh -``` - -This mode still installs the release runtime and bundled core Skills, but does not register or start a system service. Run `/opt/agentdock/bin/agentdock` manually when needed. - -## Change the port or token - -Edit the environment file: +For OpenRC: -```bash -sudoedit /etc/agentdock/agentdock.env +```sh +sudo rc-service agentdock status +sudo rc-service agentdock restart ``` -Restart the service afterward: +If you manage the service yourself, keep AgentDock bound to loopback and run it under a dedicated low-privilege account. Put environment values in a protected service environment file rather than in the unit command line. -```bash -sudo systemctl restart agentdock -sudo systemctl status agentdock --no-pager -``` +## Public servers -For OpenRC: +For remote use, keep AgentDock on `127.0.0.1` and provide HTTPS through a trusted reverse proxy or Cloudflare Tunnel. Do not expose plaintext `/mcp` directly to the Internet. -```sh -sudo rc-service agentdock restart -sudo rc-service agentdock status -``` +See [Public access](./public-access.md) for temporary and fixed Cloudflare addresses, and [Configuration](../reference/configuration.md) for authentication settings. -## View logs +## NexusDock -For systemd: +Pair NexusDock after AgentDock is installed. On the default service account: ```bash -sudo journalctl -u agentdock -n 100 --no-pager -sudo journalctl -u agentdock -f +sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair \ + --endpoint https://nexus.example.com \ + --code +sudo systemctl restart agentdock ``` -For OpenRC: - -```sh -sudo tail -n 100 /var/log/agentdock.log /var/log/agentdock.err -``` +See [Connect AgentDock](./nexusdock-connect.md) for the complete pairing flow. ## Update -Rerun the installer to replace the binary. Runtime data and the environment file are preserved. To install a fixed version: +For a standard installation: ```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_RELEASE_VERSION=vX.Y.Z \ - sh /tmp/install-agentdock.sh +sudo /opt/agentdock/bin/agentdock update --check +sudo /opt/agentdock/bin/agentdock update ``` -To maintain systemd, the environment file, reverse proxy, and OAuth entirely yourself, see [Manual Linux deployment](../getting-started/vps.md). +The runtime data and service environment remain separate from the binary. Use [Troubleshooting](./troubleshooting.md) if the service does not return to a healthy state after an update. diff --git a/docs/operations/macos.md b/docs/operations/macos.md deleted file mode 100644 index 77e0ab8..0000000 --- a/docs/operations/macos.md +++ /dev/null @@ -1,142 +0,0 @@ -# Advanced macOS configuration - -Standard installations should use the [macOS graphical application](../getting-started/macos.md). This page covers command-line installation, specific versions, custom directories, file management, service administration, and uninstallation. - -## Graphical app settings - -The main window provides status, connection URLs, credentials, start, stop, restart, updates, and log access. **Advanced Settings** manages ports, log levels, NexusDock pairing, browser connection mode, ACP profiles, MCP Apps, and independent launch-at-login toggles. - -When using the graphical app, avoid editing `agentdock.env` or LaunchAgents manually. The application validates inputs, writes configurations atomically with private permissions, restarts services, and performs health checks. - -## Command-line installation - -For automation or custom directories, use the command-line installer: - -```bash -curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ - -o /tmp/agentdock-install.sh -sh /tmp/agentdock-install.sh --register-service -``` - -## Adding AgentDock to PATH - -The installer places the binary in `~/.local/bin` by default. To run `agentdock` directly: - -```bash -echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile -source ~/.zprofile -``` - -Then run: - -```bash -agentdock -``` - -## Installing a specific version - -```bash -sh /tmp/agentdock-install.sh --register-service --version vX.Y.Z -``` - -## Changing installation directory - -```bash -AGENTDOCK_INSTALL_DIR="$HOME/bin" \ - sh /tmp/agentdock-install.sh --register-service -``` - -Ensure the custom directory is added to PATH or use absolute paths. - -## Background service - -The graphical app installs a LaunchAgent for the current user. In Advanced Settings, "Start AgentDock service at login" manages the core service, while "Show AgentDock menu bar at login" manages the menu bar application. - -For manual configuration, use a LaunchAgent under the current login user. For desktop automation (Desktop Skill), AgentDock must run in the login user session, not as a system-wide LaunchDaemon. - -Recommended defaults: - -```text -Binary path $HOME/.local/bin/agentdock -Working dir $HOME/AgentDock -State dir $HOME/.agentdock -Listen addr 127.0.0.1:8765 -``` - -After modifying the LaunchAgent, reload with `launchctl` and run a health check: - -```bash -curl -fsS http://127.0.0.1:8765/healthz -``` - -## Managing Cloudflare Tunnel - -In the graphical app, switch between Local only, Temporary public, and Fixed domain. Fixed domain reuses the existing Tunnel Token. - -When using `--register-service` without explicitly setting a tunnel type, the command-line installer asks if you have a Cloudflare-managed domain. Under the hood, having a domain maps to a Named Tunnel, while having none maps to a temporary Quick Tunnel. Scripts can pass `--tunnel quick`, `--tunnel named`, or `--tunnel none`. - -Both public modes automatically create or reuse Bearer Tokens, OAuth passwords, and OAuth signing keys. Temporary setups start AgentDock with Bearer authentication first, write the generated trycloudflare.com address to `AGENTDOCK_SERVER_URL`, enable OAuth, and restart AgentDock. The completion dialog shows the public address, MCP URL, Bearer Token, and OAuth password; signing keys remain private. - -The installer registers AgentDock and `cloudflared` as two separate user-level LaunchAgents. Management files: - -```text -~/Library/Application Support/AgentDock/agentdock.env -~/Library/Application Support/AgentDock/cloudflared.env -~/Library/Application Support/AgentDock/start-cloudflared.sh -~/Library/LaunchAgents/com.uvwt.agentdock.cloudflared.plist -~/Library/Logs/AgentDock/cloudflared.out.log -~/Library/Logs/AgentDock/cloudflared.err.log -``` - -`agentdock.env` and `cloudflared.env` have `0600` permissions. - -View service status and logs: - -```bash -launchctl print "gui/$(id -u)/com.uvwt.agentdock.cloudflared" -tail -f "$HOME/Library/Logs/AgentDock/cloudflared.err.log" -``` - -If the temporary URL changes, rerun the installation command. The installer preserves Bearer Tokens, OAuth passwords, and signing keys, updates the URL, and restarts AgentDock. Update the MCP URL in your client and re-authorize OAuth. - -## Browser automation - -When enabling browser tools, the macOS graphical app checks that Google Chrome, Chromium, or Microsoft Edge is installed. Install and update browsers normally. - -## Directories and permissions - -```text -~/.agentdock AgentDock internal state -~/AgentDock Default working directory -``` - -Processes access files according to the macOS user's permissions. Do not grant unnecessary directory permissions. - -## Desktop Skill permissions - -Before using screen, keyboard, and mouse automation, grant permissions in **System Settings > Privacy & Security** to the terminal or application hosting AgentDock: - -- Accessibility -- Screen & System Audio Recording - -Grant permissions only to the application actually running AgentDock. macOS may require re-authorization when updating terminal or application paths. - -For full instructions, see [macOS desktop automation](../guides/desktop-automation.md). - -## Updates - -Rerun the same `install.sh` entry to upgrade. The installer stages the target release transactionally, updates the bundled core Skills, verifies the resulting runtime, and preserves AgentDock state and the default working directory. A failed installation is rolled back by the installer; there is no user-selectable binary or Skill history to maintain manually. - -## Uninstalling AgentDock - -The public Unix maintenance entry is the same `install.sh` used for installation; AgentDock releases do not publish a separate macOS uninstall script. Download the current entry if necessary, then run: - -```bash -curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ - -o /tmp/agentdock-install.sh -sh /tmp/agentdock-install.sh --uninstall -``` - -The normal macOS uninstall removes AgentDock background services, the installed CLI/runtime files, the graphical application, and AgentDock application logs/configuration, while preserving `~/.agentdock` and `~/AgentDock` user data. - -Use `--purge-data` only when you explicitly intend to remove those preserved AgentDock state and default working-directory contents too. Custom layouts require explicit user-data paths before destructive purge so inherited environment values cannot become accidental deletion targets. diff --git a/docs/operations/nexusdock-connect.md b/docs/operations/nexusdock-connect.md new file mode 100644 index 0000000..60801f4 --- /dev/null +++ b/docs/operations/nexusdock-connect.md @@ -0,0 +1,40 @@ +# Connect AgentDock + +After NexusDock is running, pair your AgentDock devices and connect the MCP clients you want to use. + +## Pair AgentDock devices + +Sign in to the Web console, open **Settings → System & Nodes**, and choose **Pair device**. + +NexusDock generates a one-time pairing code and shows a command-line example: + +```bash +agentdock nexus pair --endpoint https://nexus.example.com --code pair_xxx +``` + +On the Windows or macOS desktop version of AgentDock, you can pair directly from the NexusDock section in the graphical interface: enter the **NexusDock address** and **one-time pairing code**, then choose **Pair and restart**. You do not need to run the command above manually. + +On Linux, servers, or other command-line environments, use the command above to pair. After pairing, AgentDock connects to NexusDock without requiring a public inbound port on the device. + +Pairing does not change the node's existing local MCP endpoint or authentication. Each AgentDock instance can still be used independently. + +## Connect MCP clients + +NexusDock exposes one MCP endpoint: + +```text +https://your-nexus-domain/mcp +``` + +Clients with OAuth support can connect directly and complete authorization in the browser. + +For clients that need a fixed token, open **Settings → MCP Access** and use the dedicated MCP Access Token. + +The two credentials have different purposes: + +| Credential | Purpose | +| --- | --- | +| Administrator username and password | Sign in to the Web console | +| MCP Access Token | Connect clients to `/mcp` without OAuth | + +For client-specific setup, see [Connect from different clients](../guides/mcp-clients.md). diff --git a/docs/operations/nexusdock.md b/docs/operations/nexusdock.md index 9af19d2..ebefecc 100644 --- a/docs/operations/nexusdock.md +++ b/docs/operations/nexusdock.md @@ -1,155 +1,64 @@ -# Deploy NexusDock +# Install and maintain -NexusDock is a separate self-hosted service from AgentDock. Deploy it when you want a shared web console, Recall and Workflow data, or one MCP endpoint for multiple AgentDock nodes. - -For product boundaries and day-to-day use, read [NexusDock](../concepts/nexusdock.md). This page covers a small production-oriented Docker deployment. +The simplest way to run NexusDock is Docker Compose. ## Before you start -You need: - -- Docker Engine and Docker Compose. -- A host that can keep `nexus-data` and `recall` persistent. -- An HTTPS origin such as `https://nexus.example.com` for remote use. - -Official images are published for `linux/amd64` and `linux/arm64` to both Docker Hub and GHCR. The examples below pin NexusDock `0.2.0` instead of following `latest` implicitly. - -## Create the deployment - -Create the persistent directories: - -```bash -mkdir -p nexusdock/nexus-data nexusdock/recall -cd nexusdock -``` - -On Linux bind-mount deployments, let the image user own them: +Install Docker Engine and Docker Compose on the host. -```bash -sudo chown -R 10001:10001 nexus-data recall -``` +## Create `compose.yaml` -Generate a random token for programmatic `/v1` API access: - -```bash -openssl rand -hex 32 -``` - -Create `.env`: - -```dotenv -NEXUS_AUTH_TOKEN= -NEXUS_PUBLIC_URL=https://nexus.example.com -NEXUS_AUTH_ALLOW_INSECURE_HTTP=false -NEXUS_TRUSTED_PROXIES=127.0.0.1,::1 -``` - -`NEXUS_PUBLIC_URL` must be an HTTPS origin without a path, query, or fragment. For a temporary loopback-only HTTP test, leave `NEXUS_PUBLIC_URL` empty and set `NEXUS_AUTH_ALLOW_INSECURE_HTTP=true`; do not keep that setting for remote access. - -Create `compose.yaml`: +Create a directory for NexusDock, then add this `compose.yaml`: ```yaml services: nexusdock: - image: agentdockio/nexusdock:0.2.0 - container_name: nexusdock + image: agentdockio/nexusdock:latest restart: unless-stopped - read_only: true - cap_drop: - - ALL - security_opt: - - no-new-privileges:true ports: - "127.0.0.1:18777:18777" - tmpfs: - - /tmp:rw,noexec,nosuid,size=64m,uid=10001,gid=10001,mode=0700 volumes: - - ./nexus-data:/var/lib/nexus - - ./recall:/recall - environment: - NEXUS_AUTH_TOKEN: ${NEXUS_AUTH_TOKEN} - NEXUS_REQUIRE_AUTH: "true" - NEXUS_AUTH_ALLOW_INSECURE_HTTP: ${NEXUS_AUTH_ALLOW_INSECURE_HTTP:-false} - NEXUS_PUBLIC_URL: ${NEXUS_PUBLIC_URL:-} - NEXUS_DATA_DIR: /var/lib/nexus - RECALL_REPO_DIR: /recall - NEXUS_TRUSTED_PROXIES: ${NEXUS_TRUSTED_PROXIES:-127.0.0.1,::1} + - nexus-data:/var/lib/nexus + - recall:/recall +volumes: + nexus-data: + recall: ``` -GHCR is equivalent: +The same image is also available as `ghcr.io/uvwt/nexusdock:latest`. Official images support `linux/amd64` and `linux/arm64`. -```yaml -image: ghcr.io/uvwt/nexusdock:0.2.0 -``` +## Create the administrator and start -## Initialize the administrator - -Before the first login, create the administrator account: - -```bash -docker compose run --rm nexusdock admin init owner -``` - -The command asks for the password interactively and stores its credential record in NexusDock's persistent database. Do not put the administrator password in `.env`. - -Start NexusDock and check health: +Run: ```bash +docker compose run --rm nexusdock admin init admin docker compose up -d -curl http://127.0.0.1:18777/health -``` - -Then open the configured HTTPS address, or `http://127.0.0.1:18777` for a loopback-only test. - -## Put remote access behind HTTPS - -Keep the container port bound to `127.0.0.1` when possible and publish NexusDock through your HTTPS reverse proxy or tunnel. Set `NEXUS_PUBLIC_URL` to the exact external origin. - -Only add proxies you actually operate to `NEXUS_TRUSTED_PROXIES`. NexusDock uses trusted forwarded headers for security-sensitive request metadata, so a broad trust list weakens that boundary. - -A correct public URL is especially important when clients need the NexusDock OAuth flow or temporary signed downloads for artifacts published by AgentDock nodes. Node files remain on the source AgentDock device; the source node must stay online while NexusDock proxies a download. - -## Pair AgentDock nodes - -After signing in, open **Settings → System & Nodes** and choose **Pair device**. NexusDock generates an expiring one-time command such as: - -```bash -agentdock nexus pair --endpoint https://nexus.example.com --code pair_xxx ``` -Run it on the target device and restart AgentDock. The node then opens an outbound WebSocket connection to NexusDock, so the node itself does not need a public inbound port. - -See [NexusDock](../concepts/nexusdock.md) for node selection, Runtime pages, Recall, Workflow, and fleet routing. - -## Connect MCP clients - -The unified MCP endpoint is: +Then open: ```text -https://nexus.example.com/mcp +http://127.0.0.1:18777 ``` -OAuth-capable clients can authorize in the browser. For clients that require a fixed Bearer token, open **Settings → MCP Access** and use the dedicated MCP Access Token shown there. +Sign in with the administrator account you just created. -Do not mix these credentials: +## Remote access -| Credential | Purpose | -| --- | --- | -| Administrator username/password | Web console login | -| `NEXUS_AUTH_TOKEN` | Programmatic `/v1` management API | -| MCP Access Token | `/mcp` only | +For remote use, publish NexusDock through HTTPS. Direct HTTP is intended only for `localhost` / loopback access. -For client-specific setup, see [Connect MCP clients](../guides/mcp-clients.md). +Keep the Docker port bound to `127.0.0.1` and place your HTTPS reverse proxy or tunnel in front of it. For more complex proxy setups and optional site settings, see the [NexusDock README](https://github.com/uvwt/nexusdock). -## Configure AI and vector search +## AI and vector settings -Embeddings are optional. Recall files, keyword search, local version history, and ordinary Workflow browsing work without them. +Embedding and external model providers are optional. Device management, MCP routing, Recall file browsing, keyword search, and basic Workflow operations work without them. -After deployment, prefer **Settings → AI & Vector** to configure Stage 3 and the shared embedding service. The page can test both connections and rebuild the Recall and Workflow vector indexes without requiring a service restart. +Configure these features from **Settings → AI & Vectors** when you need semantic Recall or Workflow vector matching. ## Upgrade -Back up the persistent data first. Then change the image tag in `compose.yaml` to the target version and run: +Back up the persistent data first, then run: ```bash docker compose pull @@ -157,29 +66,33 @@ docker compose up -d curl http://127.0.0.1:18777/health ``` -Use a fixed version for production. Available releases are listed on the [NexusDock releases page](https://github.com/uvwt/nexusdock/releases). - -Do not run two NexusDock instances that write the same `nexus-data` directory. +Do not run two NexusDock instances that write to the same Nexus data store. -## Back up and recover +## Backup and recovery -Back up both persistent directories: +The quick-start Compose file stores persistent data in two Docker volumes: ```text -nexus-data/ accounts, paired devices, settings, database, and NexusDock secrets -recall/ Recall content and its local Git history +nexus-data NexusDock accounts, devices, settings, secrets, and Workflow data +recall Recall content and private-note data ``` -If the administrator password is lost, reset it on the deployment host: +Back up both volumes before upgrades or migration. If you changed the deployment to use host directories instead, back up both mounted directories in full. + +If you forget the administrator password, run: ```bash -docker compose run --rm nexusdock admin recover owner +docker compose run --rm nexusdock admin recover ``` -For troubleshooting, start with: +For basic troubleshooting: ```bash docker compose ps docker compose logs --tail=200 nexusdock curl http://127.0.0.1:18777/health ``` + +## Connect devices and clients + +After installation, continue with [Connect AgentDock and clients](./nexusdock-connect.md). diff --git a/docs/operations/public-access.md b/docs/operations/public-access.md new file mode 100644 index 0000000..b983596 --- /dev/null +++ b/docs/operations/public-access.md @@ -0,0 +1,86 @@ +# Public access + +AgentDock is safest when it stays local. Enable public access only when a remote MCP client needs to reach it. + +| Mode | Best for | Address | +| --- | --- | --- | +| Local only | Same-device clients | `http://127.0.0.1:8765/mcp` | +| Temporary public address | Testing | Generated `trycloudflare.com` address | +| Fixed domain | Long-term remote use and OAuth | Your own HTTPS hostname | + +## Temporary public address + +The macOS and Windows apps can enable a temporary public address from **Public Access**. Linux installers can choose the temporary Tunnel option. Docker can start the Quick Tunnel profile: + +```bash +docker compose --profile cloudflare-quick up -d +docker compose logs -f cloudflared-quick +``` + +A temporary URL may change after a Tunnel restart. Update the MCP client when it changes. + +## Fixed domain + +A fixed domain uses a Cloudflare Named Tunnel. You need: + +- a domain managed by Cloudflare; +- AgentDock already working locally; +- access to the Cloudflare Zero Trust dashboard. + +### 1. Create the Tunnel + +Create a Cloudflare Tunnel and choose **Cloudflared** as the connector. Keep the generated Tunnel Token private. + +Add a public hostname such as `agent.example.com` and point it to: + +| Installation | Cloudflare Service URL | +| --- | --- | +| macOS, Windows, native Linux | `http://127.0.0.1:8765` | +| Docker Compose | `http://agentdock:8765` | + +Leave the Cloudflare path empty. `/mcp` is added by the MCP client, not by the Tunnel route. + +### 2. Configure AgentDock + +The AgentDock public address is the HTTPS origin only: + +```text +https://agent.example.com +``` + +Do not append `/mcp`. + +On macOS or Windows, open **Public Access → Fixed domain**, then enter the HTTPS public address and Tunnel Token. + +On Linux, rerun the installer and choose the existing Cloudflare-domain option. + +For Docker, add: + +```dotenv +AGENTDOCK_SERVER_URL=https://agent.example.com +TUNNEL_TOKEN= +``` + +Then start the Named Tunnel profile: + +```bash +docker compose --profile cloudflare-named up -d +``` + +## Verify + +Check the public health endpoint first: + +```text +https://agent.example.com/healthz +``` + +Then configure the MCP client with: + +```text +https://agent.example.com/mcp +``` + +Use the AgentDock Bearer Token or OAuth flow for MCP authentication. The Cloudflare Tunnel Token is only for the Tunnel and must never be used as the MCP credential. + +For connection failures, see [Troubleshooting](./troubleshooting.md). For authentication settings, see [Configuration reference](../reference/configuration.md). diff --git a/docs/operations/security.md b/docs/operations/security.md deleted file mode 100644 index ce20b44..0000000 --- a/docs/operations/security.md +++ /dev/null @@ -1,70 +0,0 @@ -# Security model - -AgentDock is a tool runtime, not a complete operating-system sandbox. Security comes from the listen address and authentication, runtime-user permissions, Docker volumes, the systemd service user, network policy, and each tool's own input validation. - -## Regular local use - -When using AgentDock only on your own computer, follow these rules first: - -- Keep the listen address at `127.0.0.1`. -- Do not run as an administrator or root. -- Mount or authorize only the directories required by the task. -- Use dedicated profiles for browser and desktop automation, and confirm send, delete, upload, and authorization actions. -- Do not commit `.env` files, tokens, cookies, screenshots, or private logs to a repository. - -Continue to the authentication and reverse-proxy sections only when LAN or public access is required. - -## Authentication - -- When listening only on a loopback address, AgentDock may run without authentication in a trusted local environment. -- A non-loopback listener must configure `AGENTDOCK_AUTH_TOKEN` or enable OAuth. -- A public endpoint must use HTTPS; do not expose plaintext HTTP `/mcp` directly. -- `/healthz` only indicates that the process is alive. It does not prove that MCP authentication and tool calls work. -- Logs must not record Authorization headers, OAuth codes, tool-argument bodies, or secret values. - -Bearer Token: - -```text -AGENTDOCK_AUTH_TOKEN= -``` - -OAuth: - -```text -AGENTDOCK_OAUTH_ENABLED=true -AGENTDOCK_SERVER_URL=https://agentdock.example.com -AGENTDOCK_OAUTH_PASSWORD= -AGENTDOCK_OAUTH_TOKEN_SECRET= -``` - -## File and command boundaries - -Relative paths resolve from `~/AgentDock`, but the default working directory is not a strong security boundary: - -- A native deployment is constrained by the current operating-system user's permissions. -- A Docker deployment is constrained by volumes and the container user. -- A systemd deployment should use a dedicated low-privilege user with access only to required project directories. -- Windows uses protected DACLs; the WSL runtime is constrained by the default Linux user in the selected distribution. - -Do not run AgentDock as an administrator or root unless the task genuinely requires it and the environment is isolated. - -## Skills and dynamic MCP - -- Skill packages must not contain tokens, cookies, sessions, private keys, or device login state. -- Skill and MCP secrets should be stored through their respective isolated-environment management entry points. -- `env_list` is only for checking whether variables are configured and must not return secret values. -- An external MCP server is an independent trust boundary; review its source, transport, and tool capabilities before registration. - -## Browser and desktop - -- Use a dedicated browser profile instead of reusing the primary daily profile. -- The macOS Desktop Skill runs in a high-privilege login session; grant only the required Screen Recording and Accessibility permissions. -- Upload, send, delete, and authorization actions require explicit confirmation and post-action verification. - -## Reverse proxy - -Set `AGENTDOCK_TRUSTED_PROXY_CIDRS` only when the reverse proxy is truly on a trusted network and rewrites `X-Forwarded-For`. Do not trust proxy headers supplied directly by public clients. - -## Artifacts - -Screenshots and published files may contain sensitive information. A signed URL expires, but anyone who obtains it can still access the content while it remains valid. Inspect files before publishing, and avoid exposing browser login state, desktop screenshots, environment files, and private logs. diff --git a/docs/operations/troubleshooting.md b/docs/operations/troubleshooting.md index 98efb53..7ed8f05 100644 --- a/docs/operations/troubleshooting.md +++ b/docs/operations/troubleshooting.md @@ -1,101 +1,64 @@ # Troubleshooting -## Start with these three checks +## Start here -1. Confirm that the AgentDock process or container is still running. -2. Open `/healthz` on the port shown in the installation guide. -3. Check that the client MCP URL ends with `/mcp` and that its token matches the current instance. +Check these first: -If the connection still fails, record this information before continuing: +1. AgentDock or its container is still running. +2. `http://127.0.0.1:8765/healthz` responds locally. +3. The MCP client URL ends with `/mcp`. +4. The client uses the current Bearer Token or OAuth connection. +5. The running AgentDock version is the version you expect. -- Installation method and operating system. -- AgentDock version. -- Client name and MCP URL, with the token hidden. -- The specific service-log error. -- The last change made before the problem appeared. +When reporting a problem, include the installation method, operating system, AgentDock version, client name, and the relevant error log. Hide tokens and private addresses. -Do not provide only a screenshot that says “not working,” and do not publish environment files or complete request headers. +## Client connects but cannot see tools -## The service runs, but the client cannot see tools +Reconnect the MCP client or start a new session to clear cached tool schemas. Confirm authentication, then verify one real MCP connection instead of relying only on `/healthz`. -First confirm the actual process and health state: - -```bash -curl -fsS http://127.0.0.1:8765/healthz -``` - -Then check: +## 401 Unauthorized -1. The client MCP URL points to `/mcp`. -2. Bearer Token or OAuth configuration matches the server. -3. The client is not caching an old connection; reconnect or create a new session. -4. The running binary is the version you just installed or updated. +Check that the client sends the current Bearer Token or completes OAuth. If a reverse proxy is used, make sure it preserves the `Authorization` header. -A successful `/healthz` request proves only that the process is alive. It does not replace a real MCP initialization and tool call. +## Public address does not work -## 401 Unauthorized +For Cloudflare Tunnel: -- Confirm whether the service configures `AGENTDOCK_AUTH_TOKEN`. -- Confirm that the client sends `Authorization: Bearer `. -- Check that the reverse proxy preserves the Authorization header. -- Do not paste the token into public logs or Issues. +- confirm the Tunnel is connected; +- native installs should normally forward to `http://127.0.0.1:8765`; +- Docker should forward to `http://agentdock:8765`; +- AgentDock's public address is the HTTPS origin without `/mcp`; +- the MCP client URL adds `/mcp`. -## Docker still runs an old image +A Cloudflare `502` usually means the Tunnel is reachable but cannot reach AgentDock locally. -Download the latest Compose file from `main`, then pull and recreate the container: +## Docker is still using an old image ```bash -curl -fL https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.yml \ - -o docker-compose.yml docker compose pull docker compose up -d --force-recreate +docker compose ps ``` -For a browser deployment, keep `AGENTDOCK_IMAGE` and `AGENTDOCK_BROWSER_ENABLED` in `.env`, then inspect `docker compose ps`, `docker compose images`, and the container logs to confirm that the image tag, digest, and health state are correct. - -## A dynamic MCP server cannot be called +Check `docker compose logs` if the new container does not become healthy. -Check, in order: +## Dynamic MCP cannot connect -1. The server is enabled in `mcp_manage list`. -2. Required variables are configured in `mcp_manage env_list`. -3. You ran `refresh` after updating the environment. -4. The HTTP URL, stdio command, working directory, and upstream service are reachable. -5. `mcp_tool_search` can list tools, then `mcp_tool_inspect` can inspect the parameters. +Check that the connection is enabled, required environment values are configured, and the upstream URL or local command is reachable. Refresh the MCP connection after changing its environment. -Do not echo complete tokens, cookies, or headers in error messages. +## Browser session cannot start -## A browser session fails to start +Confirm Chrome, Chromium, or Edge is installed. For Docker, use the browser image and enable browser tools. For native headless Linux, configure a browser executable path when automatic discovery cannot find one. -- Confirm that Chrome, Chromium, or Microsoft Edge is installed on the AgentDock host. -- On macOS or Windows, reopen the AgentDock settings and confirm that a supported browser is detected. -- On Linux or another headless native deployment, set `AGENTDOCK_BROWSER_EXECUTABLE_PATH` when automatic discovery cannot find the browser. -- With Docker, select the browser image through `AGENTDOCK_IMAGE` and set `AGENTDOCK_BROWSER_ENABLED=true`. -- If a persistent profile is corrupted or no longer needed, retry with a new `profile_id` instead of pointing AgentDock at your personal browser profile. - -## Desktop actions have no effect - -- Confirm that AgentDock runs in the current macOS login session. -- Check Screen Recording and Accessibility permissions. -- Use `agentdock_context` to find the current `desktop` Skill candidate, then read the returned Skill file again. -- Observe the application state or capture a screenshot both before and after the action; do not rely only on a successful command result. -- Coordinates may become invalid when the window moves, scaling changes, or multiple displays are used. Prefer Accessibility elements. - -## Git push fails - -```bash -git remote -v -git status --short --branch -git config --show-origin --get credential.helper -``` +## macOS desktop actions do nothing -Confirm the remote URL, current branch, credentials, and repository permissions. Do not place an access token in the remote URL, README, or terminal screenshot. +Confirm AgentDock is running in the current login session and that the hosting app has Screen Recording and Accessibility permissions. Recheck the screen after the action instead of relying only on command success. -## A Linux service fails to start +## Linux service does not start ```bash sudo systemctl status agentdock --no-pager sudo journalctl -u agentdock -n 100 --no-pager ``` -Common causes include incorrect environment-file permissions, an invalid binary path, a port conflict, a runtime user that cannot access the working directory, or a non-loopback listener without authentication. +Common causes are a port conflict, invalid environment values, incorrect file permissions, or a service account that cannot access the working directory. diff --git a/docs/operations/windows.md b/docs/operations/windows.md deleted file mode 100644 index c8196d6..0000000 --- a/docs/operations/windows.md +++ /dev/null @@ -1,124 +0,0 @@ -# Advanced Windows configuration - -Standard installations should use the [Windows graphical installer](../getting-started/windows.md). This page covers PowerShell automation, pinned versions, WSL, browser setup, and manual uninstallation. - -## Modifying an existing installation - -Rerun the latest Setup installer. When an existing installation is detected: - -- Standard upgrade or repair: choose "Upgrade directly and keep all current settings". -- Change startup, admin rights, or connection options: choose "Modify startup and connection settings". - -Most daily settings can also be modified in **Public Access** and **Advanced Settings** within the Control Panel without reinstalling. - -## PowerShell automated installation - -PowerShell scripts are available for automation and headless environments: - -```powershell -$script = Join-Path $env:TEMP 'install-agentdock.ps1' -Invoke-WebRequest ` - https://github.com/uvwt/agentdock/releases/latest/download/install.ps1 ` - -OutFile $script - -powershell -ExecutionPolicy Bypass ` - -File $script ` - -RegisterStartup ` - -Port 8765 -``` - -The default installation directory is `%LOCALAPPDATA%\AgentDock`. `-RegisterStartup` starts AgentDock upon current user login; it is not a pre-login system service. - -Local connection details: - -```text -Transport Streamable HTTP -URL http://127.0.0.1:8765/mcp -Headers Authorization: Bearer -``` - -## Cloudflare Tunnel automation - -Skip interactive prompts using these parameters: - -```text --TunnelMode none Local only --TunnelMode quick Temporary public address --TunnelMode named Fixed Cloudflare domain -``` - -Fixed domains also require `-ServerUrl` and a Tunnel Token. Do not put real tokens directly into shell history; use protected environment variables or `-TunnelTokenFile`. - -Example: - -```powershell -powershell -ExecutionPolicy Bypass ` - -File $script ` - -RegisterStartup ` - -TunnelMode named ` - -ServerUrl 'https://mini.example.com' ` - -TunnelTokenFile 'C:\secure\cloudflare-token.txt' -``` - -Temporary public addresses may change when the tunnel restarts. You can regenerate addresses from the control panel or tray icon. Bearer Tokens and OAuth credentials are preserved, but clients need the updated MCP URL and re-authorized OAuth. - -## Installing a specific version - -```powershell -powershell -ExecutionPolicy Bypass ` - -File $script ` - -Version vX.Y.Z ` - -RegisterStartup -``` - -Use **Update** in the AgentDock Control Panel for standard upgrades. Rerun Setup or install scripts only when restoring an older version or pinning a specific release. Tasks, Skills, configuration, and working directories are preserved. - -## Installer checksum verification - -```powershell -$base = 'https://github.com/uvwt/agentdock/releases/latest/download' -$script = Join-Path $env:TEMP 'install-agentdock.ps1' -$checksum = "$script.sha256" - -Invoke-WebRequest "$base/install.ps1" -OutFile $script -Invoke-WebRequest "$base/install.ps1.sha256" -OutFile $checksum - -$expected = ((Get-Content -LiteralPath $checksum -Raw) -split '\s+')[0].ToLowerInvariant() -$actual = (Get-FileHash -LiteralPath $script -Algorithm SHA256).Hash.ToLowerInvariant() -if ($actual -ne $expected) { throw 'AgentDock installer checksum mismatch.' } -``` - -The installer also validates the downloaded AgentDock release archive. - -## WSL runtime - -When WSL is installed, file and command tools can target the Linux runtime: - -```json -{ - "runtime": "wsl", - "wsl_distribution": "Ubuntu" -} -``` - -`wsl_distribution` can be omitted to use the system default distribution. WSL file tools require `python3` in the target distribution, using absolute Linux paths like `/home/...` or `/mnt/d/...`. - -## Browser capabilities - -Install Google Chrome, Chromium, or Microsoft Edge first, then enable browser tools in the AgentDock Control Panel. The Windows application automatically detects supported browsers. For usage details, see [Browser automation](../guides/browser-control.md). - -## Files and credential locations - -Default runtime directory: - -```text -%LOCALAPPDATA%\AgentDock -``` - -Bearer Tokens, OAuth passwords, OAuth signing keys, and Tunnel Tokens are encrypted using current-user credentials (DPAPI). Do not copy or expose these files. - -## Uninstallation - -Use Windows **Settings > Apps > Installed apps** or **Uninstall AgentDock** in the Start menu. The installed uninstaller is the supported entry point and lets you choose whether preserved AgentDock tasks, Skills, configuration, browser state, and default working-directory data should also be removed. - -The release `install.ps1` remains an installation/update entry; AgentDock releases do not publish a separate `uninstall-windows.ps1` download. Automation should invoke the installed product uninstaller used by the target deployment rather than downloading an internal repository helper by name. diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 43b3fb1..f222f1d 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -1,253 +1,87 @@ -# Configuration +# Configuration reference -AgentDock Core does not read a single YAML, JSON, or TOML configuration file. Runtime settings come from environment variables, with a small set of common options also available as command-line flags. Desktop installers and control panels manage those settings for you where applicable. +Desktop users should normally change settings in the AgentDock app. This page is mainly for headless Linux, Docker, automation, and advanced configuration. -:::tip -For a first installation, use the platform guide. This page is a reference for runtime behavior, headless deployments, and advanced configuration. -::: +## Configuration surfaces -## Choose the right configuration surface - -| Scenario | Recommended configuration surface | +| Environment | Recommended place | | --- | --- | -| macOS or Windows desktop app | AgentDock control panel / Advanced Settings | -| Direct foreground process | Environment variables and supported CLI flags | -| Docker or Compose | Container `environment`, `env_file`, or secret injection | +| macOS / Windows | AgentDock app and Advanced Settings | | Linux service | Protected service environment file | -| NexusDock | Pair the device with `agentdock nexus pair`; do not configure legacy Nexus credentials in the Core environment | - -Do not commit tokens, passwords, cookies, private keys, OAuth secrets, or device identities to source control. - -## Precedence and directories - -For ordinary Core runtime settings, AgentDock resolves values in this order: - -1. Built-in defaults. -2. Environment variables. -3. Supported CLI flags. +| Docker | Compose `.env`, `environment`, or secrets | +| Foreground process | Environment variables and supported CLI flags | -CLI flags override only the settings they expose. Authentication secrets and ACP profile JSON, for example, remain environment-driven in headless deployments. +CLI flags override the matching environment variables they expose. -The two primary directories are based on the operating-system user that runs AgentDock: +Default paths are: ```text -~/.agentdock Internal state, managed Skills, tasks, MCP configuration, browser data, and artifacts -~/AgentDock Default working directory for relative file and command operations +~/.agentdock AgentDock state +~/AgentDock Default working directory ``` -Set `AGENTDOCK_HOME` or `AGENTDOCK_DEFAULT_DIR` to an absolute path when a different location is required. For stronger isolation, use operating-system accounts, permissions, or container mounts rather than treating an AgentDock path setting as a sandbox. +## Core runtime -## CLI flags - -The current server entry point exposes these service flags: - -| Flag | Environment variable | Default | Purpose | +| Setting | Environment variable | CLI flag | Default | | --- | --- | --- | --- | -| `--host` | `AGENTDOCK_HOST` | `127.0.0.1` | HTTP bind address | -| `--port` | `AGENTDOCK_PORT` | `8765` | HTTP port, `1` to `65535` | -| `--log-level` | `AGENTDOCK_LOG_LEVEL` | `info` | `debug`, `info`, `warn`, or `error` | -| `--mcp-apps-enabled` | `AGENTDOCK_MCP_APPS_ENABLED` | `true` | Expose optional MCP Apps UI resources and metadata | -| `--browser-enabled` | `AGENTDOCK_BROWSER_ENABLED` | `false` | Expose browser automation tools | -| `--browser-executable-path` | `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | empty | Absolute Chrome, Chromium, or Edge executable path | -| `--browser-cdp-url` | `AGENTDOCK_BROWSER_CDP_URL` | empty | Existing Chromium CDP endpoint configured by the user | -| `--browser-reuse-existing-cdp` | `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP` | `false` | Reuse one uniquely discovered local CDP browser | -| `--stdio` | `AGENTDOCK_STDIO` | `false` | Serve JSON-RPC over stdio instead of HTTP | - -Example: - -```bash -agentdock \ - --host 127.0.0.1 \ - --port 8765 \ - --log-level info -``` - -NexusDock is intentionally not a server flag. Pairing establishes a device identity that AgentDock loads separately from normal runtime settings. - -## Core runtime variables - -| Environment variable | Default | Purpose | -| --- | --- | --- | -| `AGENTDOCK_HOME` | `~/.agentdock` | Private AgentDock state root; an explicit value must resolve to an absolute directory | -| `AGENTDOCK_DEFAULT_DIR` | `~/AgentDock` | Default working directory; an explicit value must resolve to an absolute directory | -| `AGENTDOCK_HOST` | `127.0.0.1` | HTTP bind address; a non-loopback listener requires Bearer Token or OAuth authentication | -| `AGENTDOCK_PORT` | `8765` | HTTP port | -| `AGENTDOCK_LOG_LEVEL` | `info` | Logging level | -| `AGENTDOCK_STDIO` | `false` | Use stdio transport instead of the HTTP server | -| `AGENTDOCK_MCP_APPS_ENABLED` | `true` | Expose optional MCP Apps UI resources and metadata | -| `AGENTDOCK_COMMAND_ENV_FROM_ENV_JSON` | empty | Explicit map of child-process variable names to host variable names for `exec_command` | -| `AGENTDOCK_TRUSTED_PROXY_CIDRS` | empty | Comma-separated trusted reverse-proxy CIDRs | - -Boolean values should be written as `true` or `false`. - -`AGENTDOCK_COMMAND_ENV_FROM_ENV_JSON` is allowlist-style mapping, not wholesale environment inheritance. For example: - -```bash -AGENTDOCK_COMMAND_ENV_FROM_ENV_JSON='{"HTTP_PROXY":"HTTP_PROXY","HTTPS_PROXY":"HTTPS_PROXY"}' -``` - -The reserved Skill runtime key `SKILL_DATA_DIR` cannot be supplied through this mapping or request-level command environment values. - -## Bearer Token authentication - -The simplest HTTP authentication method is: - -```bash -export AGENTDOCK_AUTH_TOKEN="$(openssl rand -hex 32)" -``` - -Clients calling `/mcp` send: - -```http -Authorization: Bearer -``` - -A loopback-only HTTP listener may run without authentication. A non-loopback listener without Bearer Token or OAuth is rejected at startup. - -## OAuth configuration - -OAuth is useful for remote clients that support browser authorization. Enable it with: - -| Environment variable | Requirement | Purpose | -| --- | --- | --- | -| `AGENTDOCK_OAUTH_ENABLED` | `true` | Enable OAuth | -| `AGENTDOCK_SERVER_URL` | required | Public AgentDock origin, such as `https://agentdock.example.com` | -| `AGENTDOCK_OAUTH_PASSWORD` | at least 12 characters | Password entered on the authorization page | -| `AGENTDOCK_OAUTH_TOKEN_SECRET` | at least 32 bytes | Stable signing secret for OAuth state and tokens | -| `AGENTDOCK_OAUTH_ACCESS_TOKEN_TTL` | optional, default `1h` | Access-token lifetime; accepts Go durations, integer days such as `90d`, or `never` | - -Example: - -```bash -AGENTDOCK_OAUTH_ENABLED=true -AGENTDOCK_SERVER_URL=https://agentdock.example.com -AGENTDOCK_OAUTH_PASSWORD= -AGENTDOCK_OAUTH_TOKEN_SECRET= -``` - -`AGENTDOCK_SERVER_URL` is an origin, not the MCP path. Public non-loopback origins must use HTTPS. The client MCP URL appends `/mcp`, for example `https://agentdock.example.com/mcp`. - -Bearer Token and OAuth can coexist. Do not retain an unused secret simply because an older deployment had one. - -## Trusted reverse proxies - -AgentDock does not trust arbitrary `X-Forwarded-For` values. Configure proxy CIDRs only when the proxy is controlled and rewrites the forwarding chain correctly: - -```bash -AGENTDOCK_TRUSTED_PROXY_CIDRS=127.0.0.0/8,::1/128 -``` +| Listen address | `AGENTDOCK_HOST` | `--host` | `127.0.0.1` | +| Port | `AGENTDOCK_PORT` | `--port` | `8765` | +| Log level | `AGENTDOCK_LOG_LEVEL` | `--log-level` | `info` | +| Chat cards | `AGENTDOCK_MCP_APPS_MODE` | `--mcp-apps-mode` | `full` | +| stdio transport | `AGENTDOCK_STDIO` | `--stdio` | `false` | +| State directory | `AGENTDOCK_HOME` | — | `~/.agentdock` | +| Working directory | `AGENTDOCK_DEFAULT_DIR` | — | `~/AgentDock` | +| Trusted proxy CIDRs | `AGENTDOCK_TRUSTED_PROXY_CIDRS` | — | empty | -Do not trust broad public networks. Client-address handling participates in authentication and rate-limiting decisions. +Chat-card mode accepts `full`, `compact`, or `off`. -## Pair NexusDock +## Authentication -Current AgentDock uses a paired device identity for NexusDock. Legacy `AGENTDOCK_NEXUS_ENDPOINT` and `AGENTDOCK_NEXUS_TOKEN` values are not a supported Core configuration source; the server clears them before startup and loads Nexus identity only from a successful pairing. +Bearer Token: -Generate a one-time pairing code in **NexusDock → Settings → System & Nodes**, then run the command shown by the console on the AgentDock device. The generic form is: - -```bash -agentdock nexus pair \ - --endpoint https://nexus.example.com \ - --code \ - --name -``` - -Check the saved pairing state with: - -```bash -agentdock nexus status -``` - -Restart AgentDock after pairing. Once the identity is loaded, the direct AgentDock connection can expose Nexus-backed Recall, Workflow, Evolution, and Private Notes capabilities, while the device also maintains an outbound Nexus bridge connection. - -For multi-device routing and the fleet MCP endpoint, see [NexusDock](../concepts/nexusdock.md). - -## Coding Agents (ACP) - -ACP is disabled by default. macOS and Windows users should normally configure it in the AgentDock UI. Headless deployments use profile-based configuration: - -| Environment variable | Default | Purpose | -| --- | --- | --- | -| `AGENTDOCK_ACP_ENABLED` | `false` | Enable ACP tools | -| `AGENTDOCK_ACP_PROFILES_JSON` | empty | JSON array of ACP profiles | -| `AGENTDOCK_ACP_DEFAULT_PROFILE` | first enabled profile | Profile used when a tool call omits `profile_id` | -| `AGENTDOCK_ACP_MAX_CONCURRENT_PROMPTS` | `2` | Concurrent prompt limit, `1` to `8` | -| `AGENTDOCK_ACP_INTERACTION_TIMEOUT_MS` | `300000` | Interaction timeout in milliseconds, `1000` to `3600000` | - -A profile contains `id`, `kind`, `command`, optional `args`, optional `env_from_env`, and `enabled`. Built-in kinds `codex`, `claude`, and `grok` use matching fixed IDs; custom profiles can use other unique IDs. - -Example: - -```bash -AGENTDOCK_ACP_ENABLED=true -AGENTDOCK_ACP_PROFILES_JSON='[{"id":"codex","kind":"codex","command":"/absolute/path/to/codex-acp","enabled":true}]' -AGENTDOCK_ACP_DEFAULT_PROFILE=codex +```text +AGENTDOCK_AUTH_TOKEN= ``` -`env_from_env` maps variable names and does not store their values. Keep provider credentials in the host environment or the provider's own login store. - -The older `AGENTDOCK_ACP_AGENT`, `AGENTDOCK_ACP_COMMAND`, `AGENTDOCK_ACP_ARGS_JSON`, and `AGENTDOCK_ACP_ENV_FROM_ENV_JSON` variables are read only as a legacy single-profile compatibility path when no profile JSON is present. New configurations should use profiles. +OAuth settings: -See [Use local Coding Agents](../guides/coding-agents.md) for adapter discovery and verification. - -## Workspace rules - -Project rules are not configured through environment variables. The fixed global rule file is `~/.agentdock/AGENTS.md`; project rules use `/AGENTS.md` and may be inherited through subdirectories. - -Call `workspace_context` before project operations, after switching workspaces, or when rules may have changed. Its optional `workdir` selects the context for that request only. It also indexes `/.agents/skills/*/SKILL.md` and returns exact Skill provenance and references without injecting Skill bodies. +| Variable | Purpose | +| --- | --- | +| `AGENTDOCK_OAUTH_ENABLED` | Enable OAuth | +| `AGENTDOCK_SERVER_URL` | Public HTTPS origin, without `/mcp` | +| `AGENTDOCK_OAUTH_PASSWORD` | Password used on the authorization page | +| `AGENTDOCK_OAUTH_TOKEN_SECRET` | Signing secret for OAuth state and tokens | +| `AGENTDOCK_OAUTH_ACCESS_TOKEN_TTL` | Optional access-token lifetime | -## Browser tools +A non-loopback listener must use Bearer Token or OAuth. Public access should use HTTPS; see [Public access](../operations/public-access.md). -Browser automation is disabled by default: +## Browser -| Environment variable | Default | Purpose | +| Variable | CLI flag | Purpose | | --- | --- | --- | -| `AGENTDOCK_BROWSER_ENABLED` | `false` | Expose browser tools | -| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | empty | Absolute browser executable when auto-detection is not appropriate | -| `AGENTDOCK_BROWSER_CDP_URL` | empty | User-configured existing Chromium CDP endpoint | -| `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP` | `false` | Discover and reuse a unique local CDP browser | - -AgentDock supports Chrome, Chromium, and Microsoft Edge. Without CDP reuse, it launches and owns an isolated browser process. With an external CDP browser, AgentDock attaches to that browser and creates a dedicated target; closing the AgentDock session does not terminate the external browser. - -A per-call `browser_session` `cdp_url` is restricted to loopback endpoints. Named or remote CDP endpoints must be configured by the user through AgentDock settings. Persistent `profile_id`, cookie injection, and localStorage injection are not combined with an external CDP browser. - -See [Browser automation](../guides/browser-control.md) for usage and safety boundaries. - -## Managed Skill and dynamic MCP environments +| `AGENTDOCK_BROWSER_ENABLED` | `--browser-enabled` | Enable browser tools | +| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | `--browser-executable-path` | Use a specific Chrome, Chromium, or Edge executable | +| `AGENTDOCK_BROWSER_CDP_URL` | `--browser-cdp-url` | Connect to a configured CDP endpoint | +| `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP` | `--browser-reuse-existing-cdp` | Prefer a reusable local CDP browser | -Managed Skills and dynamic MCP servers keep their business credentials outside the package definition. Use `skill_manage` and `mcp_manage` environment actions rather than putting secrets in a Skill package, MCP registry entry, or permanent global environment. +See [Use the browser](../guides/browser-control.md) for normal setup and usage. -`env_list` actions report variable names and configuration state, not plaintext values. Managed Skills also receive the reserved `SKILL_DATA_DIR` only when commands run with the exact managed `skill_ref`; shared and workspace Skills do not inherit it. +## Coding Agents -## Private Notes - -`private_note_manage` is available when the current AgentDock is paired with NexusDock. It uses the NexusDock Private Notes service and is not configured through a local private-notes directory. - -Search returns safe metadata; only an explicit `read` returns plaintext. Writes and deletes require confirmation according to the tool contract. Keep private-note encryption material and NexusDock administrator credentials separate from AgentDock device configuration. - -## Check the current runtime - -Call `agentdock_context` to inspect the runtime and capability bootstrap for the current connection. A direct AgentDock response includes runtime version, operating system, architecture, paths, Skill provenance, dynamic MCP summaries, and optional ACP/Nexus-backed indexes. - -Use the MCP client's `tools/list` as the source of truth for tools exposed by that connection. Neither `agentdock_context` nor `tools/list` returns authentication tokens, OAuth passwords, signing keys, provider secrets, or NexusDock device tokens. - -## Startup validation +| Variable | Purpose | +| --- | --- | +| `AGENTDOCK_ACP_ENABLED` | Enable Coding Agent tools | +| `AGENTDOCK_ACP_PROFILES_JSON` | Configure available Coding Agent profiles | +| `AGENTDOCK_ACP_DEFAULT_PROFILE` | Choose the default profile | +| `AGENTDOCK_ACP_MAX_CONCURRENT_PROMPTS` | Limit concurrent prompts | +| `AGENTDOCK_ACP_INTERACTION_TIMEOUT_MS` | Set the interaction timeout | -AgentDock refuses invalid configurations. Common checks include: +Desktop users should configure Coding Agents in the AgentDock UI. Headless deployments can use these variables. See [Use local Coding Agents](../guides/coding-agents.md). -- Port is between `1` and `65535`. -- Log level is valid. -- Non-loopback HTTP listening has authentication. -- OAuth variables are complete and satisfy minimum lengths. -- A public `AGENTDOCK_SERVER_URL` uses HTTPS. -- Trusted proxy entries are valid CIDRs. -- Enabled ACP profiles have valid unique IDs and executable absolute commands. -- Browser executable and CDP URL settings are structurally valid. +## Other settings -After deployment, verify at least: +NexusDock pairing is stored as a paired device identity rather than a normal runtime environment variable. See [Connect AgentDock](../operations/nexusdock-connect.md). -```bash -curl -fsS http://127.0.0.1:8765/healthz -``` +Managed Skill and dynamic MCP credentials are configured through their own environment-management interfaces instead of global AgentDock variables. -Then complete an MCP `initialize` and one real tool call from the actual client. See the [Security model](../operations/security.md) for deployment boundaries. +Project rules use `AGENTS.md`; they are not runtime environment settings. diff --git a/docs/reference/tools.md b/docs/reference/tools.md index 715d3be..9616c9c 100644 --- a/docs/reference/tools.md +++ b/docs/reference/tools.md @@ -1,251 +1,71 @@ -# Tools +# Tool reference -AgentDock exposes a stable set of built-in tools to upstream agents over MCP. Tools perform real actions, Skills describe working methods, and dynamic MCP connects external services. These responsibilities are distinct. +AgentDock exposes tools to connected AI clients over MCP. The tools visible on a specific connection depend on enabled capabilities; the client's `tools/list` is the source of truth. -After connecting an MCP client, describe the goal and let the agent choose the appropriate tools. This page documents capability boundaries, connection troubleshooting, and integration details. - -## Common capabilities - -- Read, search, modify, and publish files. -- Run commands and continue observing long-running work. -- Use command-line Git through `exec_command`, or a registered Git service through dynamic MCP. -- Install and use Skills. -- Track steps and verification for complex tasks. -- Connect external MCP servers, browsers, and NexusDock. - -The tools actually visible to a client depend on the host configuration: - -- Core tools that do not depend on external integrations are always available. -- Pairing this AgentDock with NexusDock adds `evolve`, `workflow_template_manage`, `recall_*`, and `private_note_manage`. -- Enabling `AGENTDOCK_BROWSER_ENABLED` or `--browser-enabled` adds `browser_*` tools. -- Enabling `AGENTDOCK_ACP_ENABLED` adds `acp_session`, `acp_prompt`, and `acp_interaction`. -- Upstream tools from dynamic MCP servers are not merged directly into AgentDock's `tools/list`; they are accessed through stable discovery and invocation entry points. - -The MCP client's `tools/list` is the source of truth for the tools exposed by the current connection. - -## System and context +## Context, files, and commands | Tool | Purpose | | --- | --- | -| `agentdock_context` | Returns local runtime facts plus installed Skills, dynamic MCP, optional ACP, operational rules, and Nexus-backed Workflow/Recall indexes when available | -| `workspace_context` | Returns the active `AGENTS.md` chain and workspace-local Skill index for one request-local workspace selection | - -`agentdock_context` is the bootstrap context for quick model decisions, not a duplicate tool catalog. A direct AgentDock call includes runtime fields such as version, operating system, architecture, paths, and path model. Through NexusDock it becomes a fleet context with per-node information and Nexus-owned shared context. - -Use `workspace_context` before project operations, after switching workspaces, or when workspace rules may have changed. Direct AgentDock accepts optional `workdir`; NexusDock requires `node_id` plus optional `workdir`. The result includes `workdir`, `workspace_root`, `instructions`, `workspace_skills`, and `warnings`. It reads the fixed global `~/.agentdock/AGENTS.md`, then the workspace `AGENTS.md` inheritance chain, and indexes `/.agents/skills/*/SKILL.md` without returning Skill bodies. - -Read the corresponding resource when a Skill body, dynamic MCP schema, or full Recall entry is required. - -## Files and text - -AgentDock uses the Host path model. Relative paths resolve from `~/AgentDock`; absolute paths are accessed with the permissions of the operating-system user that runs AgentDock. - -| Tool | Purpose | Common parameters or actions | -| --- | --- | --- | -| `read_file` | Reads UTF-8 text in slices and supports host-issued `skill://...` resource URIs | `path`, `start_line`, `end_line` | -| `list_dir` | Lists directories or finds files through one bounded tree/glob entry point | `path`, `max_depth`, `max_entries`, `patterns`, `exclude_patterns`, `entry_type` | -| `search_text` | Searches file contents with text or regular expressions | `query`, `regex`, `include_globs`, `context_lines` | -| `file_edit` | Performs text-file changes through one entry point | `replace`, `patch`, `add`, `delete`, `move` | - -`list_dir` replaces the older separate file-listing entry point. Glob patterns are relative to `path`: `*` stays within one path segment, while `**` crosses directories. Use `entry_type=file` when only files are needed, and keep `max_depth` / `max_entries` bounded for large trees. - -`file_edit` supports `dry_run` and a diff preview. For replacements, use `expected_matches` to constrain the number of matches and prevent accidental edits after the source text changes. - -On Windows, file tools can use native WSL file semantics through `runtime=wsl`; this is not a separate set of tools. - -## Commands and sessions - -| Tool | Purpose | Common parameters or actions | -| --- | --- | --- | -| `exec_command` | Runs a command with timeout, output limits, and redaction | `cmd`, `workdir`, `timeout_ms`, `tty`, `skill_ref` | -| `session_observe` | Reads the state of a long-running command session | `list`, `status` | -| `session_act` | Writes input to or terminates a command session | `write`, `kill`, `kill_all` | - -When a command does not exit quickly, `exec_command` returns a `session_id`. Use `session_observe` to read later state. Use `session_act action=write` when interactive input is required. - -When a command runs with a host-issued managed `skill_ref`, AgentDock uses that exact Skill root as the default working directory, injects its isolated environment, and provides the reserved `SKILL_DATA_DIR` for private persistent data. Shared and workspace candidates do not inherit a managed Skill's environment or data directory. - -On Windows, `exec_command` can explicitly select `runtime=windows` or `runtime=wsl`. - -## Coding Agents (ACP) - -These tools are exposed only when ACP is enabled on the AgentDock host. All three accept optional `profile_id`; omitting it selects the configured default profile. +| `agentdock_context` | Read current AgentDock runtime and capability context | +| `workspace_context` | Read workspace rules and workspace-local Skill index | +| `read_file` | Read text files | +| `list_dir` | List or find files and directories | +| `search_text` | Search text or regular expressions in files | +| `file_edit` | Add, replace, patch, move, or delete text files | +| `exec_command` | Run commands | +| `session_observe` | Inspect long-running command sessions | +| `session_act` | Send input to or stop command sessions | + +## Skills, Plugins, and external MCP | Tool | Purpose | Main actions | | --- | --- | --- | -| `acp_session` | Manages AgentDock and Adapter-native sessions | `info`, `new`, `list`, `inspect`, `open`, `update`, `close`, `delete` | -| `acp_prompt` | Starts asynchronous prompt Runs, reads ordered events, and requests cancellation | `start`, `events`, `cancel` | -| `acp_interaction` | Handles pending human permission interactions | `list`, `respond` | - -`acp_session open` negotiates resume/load internally. `new` can fork through `from_session_id` when the Adapter advertises that capability, and `update` handles session modes or configuration options. Authentication can be requested through `info(auth_method_id=...)` or another session action that supplies the advertised method. Prompt steering is capability-driven and internal rather than a separate public action. +| `skill_manage` | Manage installed Skills and their environment | `install`, `remove`, `env_set`, `env_unset`, `env_list` | +| `plugin_manage` | Review and manage Plugins | `inspect`, `validate`, `install`, `update`, `enable`, `disable`, `remove` | +| `mcp_manage` | Manage external MCP connections | `list`, `inspect`, `add`, `enable`, `disable`, `refresh`, `authorize`, `remove`, environment actions | +| `mcp_tool_search` | Find tools provided by an external MCP server | search | +| `mcp_tool_inspect` | Read one external tool's schema | inspect | +| `mcp_tool_call` | Call an inspected external MCP tool | call | -`acp_prompt start` returns a `run_id` quickly; progress is read through `events`. Permission responses can select only an option offered by the Coding Agent and allowed by local policy, or cancel the pending interaction. +See [Use Skills](../concepts/skills.md), [Use Plugins](../concepts/plugins.md), and [Use external MCP services](../concepts/dynamic-mcp.md). -See [Use local Coding Agents](../guides/coding-agents.md) for profiles, setup, and project-access boundaries. +## Tasks, Workflow, and memory -## Recoverable tasks and Workflows - -| Tool | Purpose | Actions | +| Tool | Availability | Purpose | | --- | --- | --- | -| `task_manage` | Persists multi-step tasks, progress, blockers, and final verification evidence | `create`, `list`, `get`, `checkpoint`, `block`, `resume`, `final_review`, `complete` | -| `workflow_template_manage` | Manages and matches reusable Workflow templates; visible only when this AgentDock device is paired with NexusDock | `publish`, `retire`, `list`, `get`, `get_many`, `match`, `vector_index` | - -`task_manage` stores state; it does not replace commands, tests, deployment, or browser verification. Ordinary tasks work entirely locally. Workflow templates live in the NexusDock Registry, so `workflow_template_manage` is absent from the tool list when this AgentDock device is not paired with NexusDock. - -`publish` accepts one complete template and validates it before making that version active. When several templates apply, `get_many` returns their full bodies but does not combine them automatically. The model must remove irrelevant steps, merge duplicates, order the result, and pass the composed steps and completion conditions to `task_manage create`. - -## Knowledge evolution - -`evolve` is exposed when this AgentDock device is paired with NexusDock, but the Evolution lifecycle belongs to AgentDock. NexusDock provides shared storage and access paths; it does not decide whether learned knowledge becomes supported, contradicted, superseded, or retracted. - -| Tool | Purpose | Intents | -| --- | --- | --- | -| `evolve` | Proposes bounded reusable knowledge and manages its AgentDock-owned validation lifecycle | `propose`, `bind`, `supersede`, `retract` | - -`bind` is an advanced pre-execution learning check: the model must declare what a later Task success or failure would mean before execution starts. A Task outcome has no learning meaning by itself, and Evolution must not block normal Task completion. - -## Managed Skills and isolated environments - -| Tool | Purpose | Actions | -| --- | --- | --- | -| `skill_manage` | Installs or removes managed Skill current content and manages its isolated environment | `install`, `remove`, `env_set`, `env_unset`, `env_list` | - -AgentDock does not expose a separate Skill-version, activation, or rollback lifecycle. Each managed Skill name has one current content tree. Reinstalling the same content is a no-op by `content_digest`; installing different reviewed content with the same name atomically replaces the current tree. - -A typical flow is: - -```text -agentdock_context / workspace_context -→ select one exact Skill candidate -→ read_file -→ execute through real tools using the same returned skill_ref when needed -``` +| `task_manage` | Always | Track multi-step task state and progress | +| `workflow_template_manage` | NexusDock paired | Find and manage reusable Workflows | +| `recall_search` | NexusDock paired | Search Recall memory | +| `recall_read` | NexusDock paired | Read Recall content | +| `recall_write` | NexusDock paired | Create or update Recall content | +| `recall_maintain` | NexusDock paired | Inspect and maintain Recall indexes/content | +| `evolve` | NexusDock paired | Manage reusable learned knowledge | +| `private_note_manage` | NexusDock paired | Access Private Notes | -Do not reconstruct `skill_ref` or a `skill://` URI from a bare name. Managed, shared, and workspace candidates with the same name remain distinct. `skill_manage env_list` returns variable names and configuration state, never secret values. Normal `remove` preserves the managed Skill's environment and persistent data; `purge=true` removes those preserved resources too. +See [Tasks and progress](../concepts/tasks.md), [Recall memory](../concepts/recalldock.md), and [Workflow](../concepts/workflow.md). -See [Use Skills](../concepts/skills.md) for the user workflow. +## Coding Agents -## Dynamic MCP - -Dynamic MCP uses four stable entry points so that upstream clients do not cache stale tool lists when a remote service changes. - -| Tool | Purpose | Common actions | -| --- | --- | --- | -| `mcp_manage` | Registers, enables, disables, refreshes, and removes MCP servers and manages isolated environments | `list`, `inspect`, `add`, `enable`, `disable`, `refresh`, `remove`, `env_set`, `env_unset`, `env_list` | -| `mcp_tool_search` | Searches lightweight tool summaries by server and capability keywords | `server`, `query`, `limit` | -| `mcp_tool_inspect` | Reads the complete input and output schema for one upstream tool | `name=:` | -| `mcp_tool_call` | Calls an upstream tool using an inspected schema | `name`, `arguments` | - -Recommended flow: - -```text -agentdock_context -→ mcp_tool_search -→ mcp_tool_inspect -→ mcp_tool_call -``` - -Registry data stores environment-variable names, not plaintext tokens. See [Connect external MCP servers](../concepts/dynamic-mcp.md) for a complete registration example. - -## Images and artifacts +These tools are available when Coding Agents are enabled: | Tool | Purpose | | --- | --- | -| `view_image` | Loads an image from an AgentDock artifact, Host path, or HTTP(S) URL and automatically resizes or converts it for model limits | -| `file_publish` | Publishes a file or directory as an immutable artifact snapshot; directories are packaged as `tar.gz` | - -`file_publish` always returns an `artifact_id`, hash, and size. When the current request has a reachable service address, it also returns an expiring signed URL. - -When a node is called through NexusDock, NexusDock can replace the node-local download location with its own temporary signed URL. The file is streamed in bounded chunks over the paired node's existing outbound connection; the source node must remain online, and NexusDock does not persist another copy of the artifact. See [NexusDock](../concepts/nexusdock.md#download-files-from-a-node). - -Image-producing tools such as browser screenshots usually return a lightweight artifact reference first. Load it through `view_image` instead of transferring large Base64 payloads in ordinary tool results. - -## NexusDock Recall - -These tools are exposed on a direct AgentDock connection when that device is paired with NexusDock: - -| Tool | Purpose | Common parameters or actions | -| --- | --- | --- | -| `recall_search` | Searches Markdown and experience cards; semantic retrieval is added transparently when embeddings are available | `query`, `kind=all|markdown|card`, `max_results` | -| `recall_read` | Reads one Recall entry by path | `path`, `include_raw` | -| `recall_write` | Plans, creates, replaces, appends, patches, updates facts, diffs, or deletes Recall content | `target=card|markdown`, `action`, `confirmed` | -| `recall_maintain` | Lists or lints content and inspects or rebuilds embedding indexes | `list`, `lint`, `embedding_status`, `reindex`, `reindex_cards` | - -The compact startup index is now part of `agentdock_context`; there is no separate Recall bootstrap tool. When the index already provides the required path, prefer `recall_read`. Use `recall_search` when the relevant entry is not known yet. - -`recall_write` requires an explicit content type: - -- `card`: atomic, reusable experience, preferences, and decisions. -- `markdown`: stable project documentation, Runbooks, learning records, and structured long-term facts. - -Confirmation requirements depend on the action and destination. Destructive or protected writes require `confirmed=true`; unconfirmed edits can return a preview where the contract supports it. See [NexusDock Recall](../concepts/recalldock.md) for the boundaries. - -## Private Notes +| `acp_session` | Create, open, inspect, update, and close Coding Agent sessions | +| `acp_prompt` | Start prompts, read events, and cancel runs | +| `acp_interaction` | Review and respond to pending permission interactions | -`private_note_manage` is exposed on a direct AgentDock connection when that device is paired with NexusDock: +See [Use local Coding Agents](../guides/coding-agents.md). -| Tool | Purpose | Actions | -| --- | --- | --- | -| `private_note_manage` | Accesses the NexusDock Private Notes vault | `search`, `read`, `write`, `delete`, `status`, `maintain` | - -This is not the ordinary memory entry point. Use it only when the user explicitly requests private-note access or when the content clearly contains sensitive credentials or personal information. - -- `search` returns only metadata such as title, summary, tags, category, path, and update time; it does not search the body. -- Only an explicit `read` returns plaintext. -- `write` and `delete` require `confirmed=true`. -- Git backups contain only age ciphertext. Plaintext and keys must remain ignored by Git. - -## Browser automation - -These tools are exposed only when browser capabilities are enabled: - -| Tool | Purpose | Actions or typical inputs | -| --- | --- | --- | -| `browser_session` | Creates, closes, and cleans up browser sessions | `start`, `close`, `cleanup_stale` | -| `browser_act` | Navigates, clicks, types, scrolls, and waits for page conditions in a selected page | `page_id`, `goto`, `click`, `fill`, `wait_for_url`, `wait_for_text`, `wait_for_response` | -| `browser_snapshot` | Captures selected-page and all-page metadata, text, screenshots, and errors | `session_id`, `page_id`, `full_page` | - -`browser_session` can launch an AgentDock-owned Chrome, Chromium, or Edge process, or attach to an existing Chromium-family browser over CDP while managing only a dedicated AgentDock target. Owned sessions support headless mode, dedicated `profile_id` values, cookies, and localStorage injection. External CDP sessions do not use those owned-profile injection features, and closing the AgentDock session leaves the external browser running. A session returns `page_id` and `pages`; when a site opens a new tab, pass the target `page_id` to `browser_act` or `browser_snapshot`. - -AgentDock does not expose arbitrary page-script execution by default. Prefer observable clicks, typing, scrolling, and screenshots. See [Browser automation](../guides/browser-control.md) for details. - -## Result state for integrations and debugging +## Browser, images, and file sharing -:::info -The state semantics below apply starting with AgentDock `v0.4.3`. Normal tool results in `v0.4.2` and earlier may still contain a generic `ok`; integrations should upgrade before depending on these fields. -::: +Browser tools are available when browser support is enabled. -AgentDock represents “whether the tool call succeeded” separately from “whether the command or domain result succeeded”: - -- MCP protocol-level `isError` indicates a tool-call error. Invalid arguments, insufficient permissions, missing resources, network failures, or internal exceptions return `isError: true`. -- Successful `structuredContent` does not contain generic `ok` or `tool_ok`, preventing a model from confusing “the tool returned a result” with “the command or domain operation succeeded.” -- Completed commands use `command_ok`, `exit_code`, and optional `command_error`. A running command does not return `command_ok` early. -- Browser operations use `browser_ok` and `browser_error`; other tools use domain fields such as `valid`, `changed`, `configured`, `written`, and `encrypted_backup_ok`. - -A failed command exit is still a normal tool result because AgentDock must preserve stdout, stderr, and the exit code: - -```json -{ - "status": "exited", - "command_ok": false, - "exit_code": 1, - "command_error": "exit status 1", - "stdout": "", - "stderr": "..." -} -``` - -A failed domain check is not necessarily a tool-call error. For example, a completed domain operation can report `changed: false` without being a tool-call error. Callers should inspect MCP `isError` first, then read `command_ok`, `changed`, `configured`, or the relevant domain field. - -Internal or separate protocols such as HTTP health checks, the Runtime API, and WSL child processes may use their own state fields, but those fields are not exposed as generic success markers in MCP tool results. - -## Tool selection principles - -- Use read-only tools to inspect the current state before calling tools with side effects. -- Inspect real files, repositories, services, or pages before a change and verify the real result afterward. -- Do not create a task for a simple read. Use `task_manage` for multi-step development, deployment, migration, and troubleshooting. -- Skills guide the workflow; they do not replace real tools. -- Search a dynamic MCP tool, inspect its schema, and only then call it. -- Do not treat AgentDock as an operating-system sandbox. Real permissions still come from the runtime user, container volumes, systemd, DACLs, and network policy. +| Tool | Purpose | +| --- | --- | +| `browser_session` | Start and close browser sessions | +| `browser_act` | Navigate, click, type, scroll, and wait on pages | +| `browser_snapshot` | Read page state and capture screenshots | +| `view_image` | Load an image from a file, published file, or URL | +| `file_publish` | Publish a file or directory; create a temporary shareable URL when a reachable address is available | -See [Configuration](./configuration.md) for enablement and the [Security model](../operations/security.md) for boundaries. +See [Use the browser](../guides/browser-control.md) and [Configuration reference](./configuration.md) for enablement. diff --git a/docusaurus.config.ts b/docusaurus.config.ts index ec7e288..de09ec5 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -18,7 +18,7 @@ const algolia = const config: Config = { title: 'AgentDock', - tagline: 'A secure, recoverable runtime for local and remote AI agent work', + tagline: 'Connect AI agents to tools on your computers and servers', favicon: 'img/favicon.svg', url: 'https://uvwt.github.io', baseUrl: '/agentdock-docs/', @@ -96,6 +96,11 @@ const config: Config = { label: 'Tools', position: 'left', }, + { + to: '/docs/concepts/nexusdock', + label: 'NexusDock', + position: 'left', + }, { type: 'localeDropdown', position: 'right', @@ -122,6 +127,7 @@ const config: Config = { title: 'Capabilities', items: [ {label: 'Skills', to: '/docs/concepts/skills'}, + {label: 'Plugins', to: '/docs/concepts/plugins'}, {label: 'Dynamic MCP', to: '/docs/concepts/dynamic-mcp'}, {label: 'Recoverable tasks', to: '/docs/concepts/tasks'}, ], diff --git a/i18n/zh-CN/code.json b/i18n/zh-CN/code.json index 65634ed..5f07427 100644 --- a/i18n/zh-CN/code.json +++ b/i18n/zh-CN/code.json @@ -30,7 +30,7 @@ "message": "真正完成工作" }, "homepage.hero.subtitle": { - "message": "把支持 MCP 的 AI 客户端连接到你的电脑或服务器,通过明确的工具边界使用文件、命令、Git、浏览器和外部服务。" + "message": "把支持 MCP 的 AI 客户端连接到你的电脑或服务器,让它可以操作文件、执行命令、使用 Git 和浏览器,并连接其他服务。" }, "homepage.hero.chooseInstall": { "message": "选择安装方式" @@ -39,7 +39,7 @@ "message": "了解功能" }, "homepage.hero.builtInTools": { - "message": "内置工具" + "message": "实用工具" }, "homepage.hero.recoverable": { "message": "可恢复" @@ -57,7 +57,7 @@ "message": "AgentDock 文档" }, "homepage.meta.description": { - "message": "AgentDock 官方文档:快速安装、连接客户端、使用 Skill、浏览器和外部 MCP。" + "message": "AgentDock 官方文档:安装、连接客户端、使用 Skill、Plugin、浏览器和外部 MCP 服务。" }, "homepage.features.install.title": { "message": "安装并连接" @@ -75,7 +75,7 @@ "message": "使用 Skill" }, "homepage.features.skills.description": { - "message": "安装可信 Skill,把成熟工作方法、依赖和安全边界交给 Agent 使用。" + "message": "按需安装可信 Skill 和 Plugin,为 Agent 增加可复用的工作方法与相关工具。" }, "homepage.features.browser.title": { "message": "操作浏览器" @@ -87,31 +87,19 @@ "message": "连接外部服务" }, "homepage.features.mcp.description": { - "message": "按需接入其他 MCP Server,凭据放在独立环境中,不写入注册信息。" + "message": "按需连接其他 MCP 服务,凭据保存在独立环境中。" }, "homepage.features.tasks.title": { "message": "跟踪复杂任务" }, "homepage.features.tasks.description": { - "message": "保存目标、步骤、进度和验证结果,中断后继续,不把“执行结束”误当成完成。" + "message": "保存目标、步骤、进度和验证结果,让较长任务在中断后继续。" }, "homepage.features.heading": { "message": "从安装到完成真实任务" }, "homepage.features.summary": { - "message": "先完成最短安装,再按需要启用 Skill、浏览器、外部 MCP 和长期任务能力。" - }, - "homepage.quickStart.heading": { - "message": "按当前系统完成安装" - }, - "homepage.quickStart.summary": { - "message": "普通用户优先选择 macOS、Windows 或 Linux 原生安装;已经使用 Docker 时再选择容器方式。" - }, - "homepage.quickStart.chooseInstall": { - "message": "选择安装方式" - }, - "homepage.quickStart.allDocs": { - "message": "查看全部文档" + "message": "先完成安装,再按需要启用 Skill、Plugin、浏览器自动化、外部 MCP 和可恢复任务。" }, "theme.ErrorPageContent.title": { "message": "页面已崩溃。", @@ -439,5 +427,41 @@ "theme.tags.tagsPageTitle": { "message": "标签", "description": "The title of the tag list page" + }, + "homepage.hero.builtIn": { + "message": "内置" + }, + "homepage.nexus.heading": { + "message": "一个 MCP,连接多台设备" + }, + "homepage.nexus.summary": { + "message": "把 Mac、Windows、Linux 主机和服务器上的 AgentDock 集中到 NexusDock,在一个地方管理设备状态。" + }, + "homepage.nexus.explore": { + "message": "了解 NexusDock" + }, + "homepage.nexus.install": { + "message": "安装 NexusDock" + }, + "homepage.nexus.capability.mcp.title": { + "message": "一个 MCP 地址" + }, + "homepage.nexus.capability.mcp.description": { + "message": "AI 客户端只需要连接一次,就可以通过 NexusDock 使用多台 AgentDock。" + }, + "homepage.nexus.capability.devices.title": { + "message": "集中管理设备" + }, + "homepage.nexus.capability.devices.description": { + "message": "在一个 Web 控制台中查看已经连接的设备和当前状态。" + }, + "homepage.nexus.capability.data.title": { + "message": "共享记忆与工作流数据" + }, + "homepage.nexus.capability.data.description": { + "message": "让多台 AgentDock 共同使用长期记忆和可复用的工作流。" + }, + "homepage.nexus.tagline": { + "message": "共享记忆与工作流数据" } } diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json index 18956f9..cede7bb 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json @@ -28,7 +28,7 @@ "description": "The generated-index page title for category 'Capabilities' in sidebar 'docsSidebar'" }, "sidebar.docsSidebar.category.Capabilities.link.generated-index.description": { - "message": "使用 Skill、任务、浏览器与桌面自动化、Coding Agent 和外部 MCP 服务。", + "message": "使用 Skill 与 Plugin 扩展 AgentDock,跟踪任务、操作浏览器并连接外部工具。", "description": "The generated-index page description for category 'Capabilities' in sidebar 'docsSidebar'" }, "sidebar.docsSidebar.category.NexusDock": { @@ -40,7 +40,7 @@ "description": "The generated-index page title for category 'NexusDock' in sidebar 'docsSidebar'" }, "sidebar.docsSidebar.category.NexusDock.link.generated-index.description": { - "message": "连接多台 AgentDock 设备,并共享 Recall 和 Workflow 数据。", + "message": "连接多台 AgentDock 设备,并共享 Recall 记忆和 Workflow 工作流数据。", "description": "The generated-index page description for category 'NexusDock' in sidebar 'docsSidebar'" }, "sidebar.docsSidebar.category.Operations": { diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/dynamic-mcp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/dynamic-mcp.md index 367e408..bfc7248 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/dynamic-mcp.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/dynamic-mcp.md @@ -1,67 +1,62 @@ -# 连接外部 MCP - -动态 MCP 让 AgentDock 在不重启或重新编译的情况下连接其他 MCP Server,例如设计平台、任务系统、搜索服务或本地分析工具。 +# 使用外部MCP +动态 MCP 让 AgentDock 在不重启的情况下使用其他 MCP 服务提供的工具。需要接入外部服务或本机 MCP 程序时使用它。 ## 最简单的使用方式 -可以直接告诉 Agent: +直接告诉 Agent 要连接什么: ```text 接入这个 MCP:https://mcp.example.com/mcp -名称使用 example,认证 Token 放到独立环境里,接入后验证能否列出工具。 +名称使用 example,并验证它的工具是否可用。 ``` -Agent 会完成注册、凭据保存、连接刷新,并用一次只读调用验证接入结果。 - -## 两种连接方式 +AgentDock 会注册连接、判断需要哪种认证,并可以通过一次只读工具调用确认是否接入成功。 -### HTTP MCP +## HTTP MCP -适合已经提供网络地址的服务: +服务已经提供网络地址时使用 HTTP,例如: ```text https://mcp.example.com/mcp ``` -认证信息通过独立环境映射到 HTTP Header。注册信息只保存变量名,不保存真实 Token。 +### 使用 OAuth 浏览器登录 -### 本地 stdio MCP +如果远程 MCP 需要 OAuth,直接让 Agent 授权即可。AgentDock 会启动授权流程并返回登录链接,你在浏览器中完成登录后,MCP 连接即可刷新并使用已授权的服务。 -适合安装在同一台机器上的命令行 MCP Server。需要提供: +不需要把 OAuth Code 或 Access Token 复制到聊天中。需要重新登录或解除账号授权时,也可以清除现有授权。 -- 可执行文件的绝对路径。 -- 启动参数。 -- 可选工作目录。 -- 运行所需环境变量。 +### 使用 API 密钥 -本地 MCP 会继承运行 AgentDock 的系统权限,因此安装前同样要审查来源。 +如果服务不是通过浏览器登录,而是提供 API Token 或密钥,把它保存在这个 MCP 连接自己的独立环境中。AgentDock 不会把真实密钥写进连接记录,也不会在查看配置时把它显示出来。 -## 凭据怎么保存 +## 本机 MCP 程序 -不要把 Token、Cookie、密码或 OAuth Code 直接写进聊天记录、README 或 MCP 注册信息。 +AgentDock 也可以启动安装在同一台机器上的命令行 MCP 服务。提供可执行文件、必要的启动参数和环境变量即可。 -让 Agent 把秘密保存在该 MCP Server 的独立环境中。查看配置时只显示变量名和配置状态,不返回真实值。 +本机 MCP 程序会继承 AgentDock 的系统权限,因此陌生软件使用前要先审查来源。 -更新凭据后需要刷新 MCP 连接。 +## 凭据怎么保存 + +不要把 Token、Cookie、密码或 OAuth Code 写进聊天记录、README 或 MCP 注册信息。 + +- OAuth 使用 AgentDock 自带的授权流程。 +- Token 类认证使用 MCP 连接的独立环境。 +- 查看配置时只显示秘密的变量名和配置状态,不回显真实值。 ## 如何确认接入成功 可以要求 Agent: ```text -列出 example MCP 的工具,选择一个只读工具确认参数,并完成一次无副作用调用。 +列出 example MCP 的工具,检查一个只读工具的参数,并完成一次无副作用调用。 ``` -如果失败,依次检查服务是否启用、地址或命令是否正确、所需变量是否已配置,以及上游服务是否可达。 +如果失败,检查连接是否启用、地址或命令是否正确、认证是否完成,以及上游服务是否可达。 ## 管理已有 MCP -常用操作包括: - -- 查看和检查配置。 -- 启用、禁用或刷新连接。 -- 更新或删除独立环境变量。 -- 删除不再使用的 Server。 +可以让 AgentDock 查看、启用、禁用、刷新、重新授权或删除连接;需要时也可以管理它的独立环境。 -精确 action 和参数见 [工具介绍](../reference/tools.md#动态-mcp)。 +完整操作和参数见 [工具参考](../reference/tools.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/nexusdock.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/nexusdock.md index 2322db0..f5d9cdc 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/nexusdock.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/nexusdock.md @@ -1,113 +1,24 @@ -# NexusDock +# 是什么 -NexusDock 是面向多台 AgentDock 设备的可选自托管控制中心。真实的文件、命令、浏览器、Skill 和 Coding Agent 操作仍在各设备上的 AgentDock 中执行;NexusDock 负责把设备接入同一个中心,共享 Recall 与 Workflow 数据,并通过一个 MCP 入口暴露整套设备能力。 +NexusDock 是面向多台 AgentDock 设备的可选自托管中心。 -当你希望多台 Mac、Windows PC、Linux 主机或服务器通过一个可信入口统一使用时,可以部署 NexusDock。只有一台 AgentDock 时,普通本机工具和任务并不依赖 NexusDock。 +它可以把 Mac、Windows、Linux 主机和服务器上的 AgentDock 集中到一个 Web 控制台中,并共享 Recall 记忆和 Workflow 工作流数据,同时为 AI 客户端提供一个统一的 MCP 地址。 -准备自托管时,可直接参考 [部署 NexusDock](../operations/nexusdock.md),其中包含 Docker、HTTPS、升级和备份说明。 +如果你只使用一台 AgentDock,通常不需要 NexusDock。 -## Web 控制台能做什么 +## 可以做什么 -控制台把 NexusDock 的共享数据和各节点自己的运行状态分开管理: +- 一个 MCP 连接多台 AgentDock; +- 在一个地方管理多台 AgentDock 设备; +- 查看哪些设备在线以及当前状态; +- 在多台设备之间共享 Recall 记忆和 Workflow 工作流数据; +- 只配置一次 AI 客户端,而不是分别连接每台 AgentDock。 -- **总览**:查看系统状态、各 AgentDock 节点是否在线,以及平台、版本、Skill、动态 MCP、最近任务和节点工具等摘要。 -- **Recall**:管理共享知识,包括资料库、经验卡片、Evolution 记录、向量召回和本地版本历史。 -- **Workflow**:浏览已发布模板、当前步骤与匹配规则,并查看历史版本。 -- **任务 / Skill / MCP**:这些页面属于具体 AgentDock 节点。先选择设备,再查看其可恢复任务和已安装 Skill;动态 MCP 还可以直接添加、启停、刷新和移除,并管理隔离环境变量。敏感值只写入,不会从服务端回显明文。 -- **设置**分为四部分:**账号与会话**用于修改密码和管理活动登录;**MCP 接入**用于查看统一 MCP 地址以及获取或重置专用 Access Token;**AI 与向量**用于配置 Stage 3 与 Embedding、测试连接和重建索引;**系统与节点**用于配对、重命名、停用或删除 AgentDock 节点,并查看系统状态。 +实际的文件、命令、浏览器等操作仍由每台 AgentDock 执行。NexusDock 负责把这些设备集中起来,而不是替代 AgentDock。 -Runtime 页面不会把节点上的任务、Skill 或动态 MCP 状态复制一份到 NexusDock。NexusDock 通过当前选中的 AgentDock 节点读取或管理这些数据,因此节点离线时也无法查看其实时运行状态。 +## 下一步 -## 第一次使用的典型流程 - -1. 登录 NexusDock Web 控制台。 -2. 打开 **设置 → 系统与节点**,点击 **配对设备**,生成一个有过期时间且只能使用一次的配对码。 -3. 在目标设备执行页面生成的 `agentdock nexus pair ...` 命令,然后重启 AgentDock。 -4. 节点上线后,在 Runtime 页面顶部选择对应设备,即可查看任务、Skill 和动态 MCP。 -5. 如果需要 Recall 语义搜索或 Workflow 向量匹配,可在 **设置 → AI 与向量** 中配置 Embedding、测试连接并重建索引。 -6. 需要让 MCP 客户端访问整套设备时,连接 NexusDock 的 `/mcp`。支持 OAuth 的客户端可以通过浏览器授权;其他客户端可以使用 **设置 → MCP 接入** 中的专用 Access Token。 - -## 设备如何连接 - -先在 NexusDock 控制台中为 AgentDock 设备发起配对。完成配对后,设备会主动向 NexusDock 建立出站 WebSocket 连接。 - -这种设计意味着: - -- 远程使用时,只需要让 NexusDock 有可访问的 HTTPS 地址。 -- AgentDock 节点可以继续位于 NAT、家庭网络或没有入站公网端口的环境中。 -- 每台设备保留独立身份,并继续受本机操作系统权限约束。 -- 某个节点离线或被禁用,并不会把它的本机执行环境迁移到 NexusDock。 - -接入 NexusDock 不会移除节点自己的 MCP 地址。只操作单台设备或适合本地直连时,仍然可以直接连接 AgentDock。 - -## 用一个 MCP 入口访问多台设备 - -MCP 客户端可以只连接 NexusDock 的 `/mcp`,而不用分别配置每台 AgentDock。 - -连接后优先调用 `agentdock_context`。NexusDock 返回的 fleet 上下文分为两部分: - -- `nodes`:已启用的 AgentDock 设备,包括 `node_id`、在线状态、版本、平台、能力以及可用的节点本地上下文。 -- `shared`:由 NexusDock 统一持有的 Workflow、Recall、规则和共享上下文,不会在每个节点重复返回。 - -NexusDock 不提供额外的 `node_list` 工具。`agentdock_context` 返回的 `node_id` 就是后续调用设备工具时使用的路由标识。 - -Fleet 级中央工具只发布一次,并且不需要 `node_id`: - -- `agentdock_context` -- `recall_search`、`recall_read`、`recall_write`、`recall_maintain` -- `workflow_template_manage` -- `private_note_manage` - -`workspace_context` 同样是 canonical shared tool,但它有意保持 node-scoped:NexusDock 对外提供 `workspace_context(node_id, workdir?)`,并把请求路由到指定 AgentDock 节点。fleet `agentdock_context` 仍只负责 fleet 总览,不携带工作区规则正文。 - -文件、命令、任务、浏览器、ACP、动态 MCP 和 `evolve` 等仍然是 AgentDock 节点能力。经 NexusDock 调用时,它们的输入 Schema 会增加必填的 `node_id`,由 NexusDock 路由到指定设备。 - -建议让已配对的 AgentDock 节点保持在相近的最新版本,以减少工具契约差异,保证统一 MCP 入口尽量完整、一致。 - -## Recall 与 Workflow 数据 - -Recall 和 Workflow 模板由 NexusDock 统一管理,因此 fleet `agentdock_context` 会把它们放在 `shared` 中,而不是重复塞进每个节点上下文。 - -`recall_search` 默认支持关键词检索;NexusDock 配置 Embedding 模型后,可以透明加入语义召回。模型侧仍然调用同一个工具,不需要选择底层检索后端。 - -内容边界见 [NexusDock Recall](./recalldock.md),当前工具契约见 [工具参考](../reference/tools.md#nexusdock-recall)。 - -## 从节点下载文件 - -通过 NexusDock 调用 `file_publish` 时,文件仍然存放在选中的 AgentDock 节点上。NexusDock 可以返回自己的临时签名下载地址,并通过节点现有的出站连接代理文件内容。 - -需要注意: - -- 下载期间源 AgentDock 节点必须保持在线。 -- NexusDock 会按受限分块读取大文件,并在代理过程中校验 Artifact 元数据和校验和。 -- NexusDock 不会额外持久化一份节点 Artifact 内容。 -- 签名地址会过期,不是永久公开文件托管地址。 - -要让外部客户端使用 NexusDock 的公开下载地址,需要正确配置对外 `NEXUS_PUBLIC_URL` 并使用 HTTPS。 - -## 认证边界 - -NexusDock 将管理权限和 MCP 访问权限分开。远程 MCP 客户端可以通过受支持的 OAuth 流程或专用 MCP Access Token 访问 `/mcp`,但不会因此获得 NexusDock 管理 API 权限。 - -远程部署时建议: - -- 为 NexusDock 提供 HTTPS。 -- 条件允许时,让应用端口只绑定 loopback 或可信私网。 -- 只信任实际使用的反向代理。 -- 分别保护 Nexus API Token、MCP Token、管理员密码、Recall 数据和私密笔记加密材料。 - -AgentDock 节点仍然执行自己的主机权限边界。通过 NexusDock 路由,并不会让节点获得其 AgentDock 进程本来无法访问的文件、命令、浏览器或账号权限。 - -## AgentDock 与 NexusDock 的职责 - -| 职责 | AgentDock | NexusDock | -| --- | --- | --- | -| 文件、命令、浏览器、ACP、Skill、动态 MCP | 在设备上真实执行 | 把调用路由到指定节点 | -| 设备运行环境和操作系统权限 | 负责 | 不替代 | -| 可恢复任务状态 | 保存在 AgentDock 节点 | 路由节点任务调用 | -| Recall 与 Workflow Registry | 配置后消费 | 持有共享服务 | -| 知识 Evolution 生命周期 | 负责策略和决策 | 提供共享存储与访问路径 | -| 多设备 MCP | 公布节点能力 | 聚合兼容节点工具与中央工具 | -| 节点发布的 Artifact | 保存源文件 | 代理临时签名下载 | - -只有一台设备时,优先直接使用 AgentDock。需要集中 Recall、Workflow、设备管理或统一的多设备 MCP 入口时,再加入 NexusDock。 +- [安装与维护](../operations/nexusdock.md) +- [连接 AgentDock](../operations/nexusdock-connect.md) +- [Recall 记忆](./recalldock.md) +- [Workflow 工作流](./workflow.md) diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/plugins.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/plugins.md new file mode 100644 index 0000000..d7054d2 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/plugins.md @@ -0,0 +1,32 @@ +# 使用 Plugin + +Plugin 用来把一组相关的 AgentDock 扩展打包在一起,方便统一审查和管理。一个 Plugin 可以包含 Skill、MCP Server 配置,或者同时包含两者。这些组件仍然使用 AgentDock 现有的 Skill 和动态 MCP 机制,Plugin 不会另外建立一套执行层。 + +这里的 **Plugin** 指 AgentDock 扩展包,不是 ChatGPT 等 AI 客户端中用来连接 AgentDock 的“插件”“连接器”或 MCP 入口。 + +## 什么时候使用 Plugin + +当多个相关扩展需要一起安装和更新时,适合使用 Plugin。只需要一套任务说明时使用 [Skill](./skills.md);只需要连接一个 MCP 服务时使用 [动态 MCP](./dynamic-mcp.md)。 + +AgentDock 可以识别自己的 Portable Plugin 格式,以及受支持的 OpenAI / Claude Plugin 包。Git、GitHub 等远程来源会先通过内置的 `plugin-import` Skill 下载到本地,再交给 AgentDock 审查。 + +## 安装 Plugin + +直接描述目标,并要求先审查: + +```text +审查并安装这个 Plugin。安装前先告诉我它会增加哪些 Skill 和 MCP 连接。 +``` + +AgentDock 会先校验 Plugin,再安装已经审查过的那一份内容。只要包内容发生变化,就需要重新审查。 + +安装后的 Plugin 可以查看、更新、启用、禁用或删除。禁用只会停止其中组件生效,不会卸载 Plugin;删除时可以选择保留数据,也可以明确清理 Plugin 自己的数据和 MCP 凭据。 + +## 安全注意事项 + +- 陌生 Plugin 安装或更新前先审查。 +- 不要把 Token、Cookie、密码等秘密写进 Plugin 包。 +- Plugin 中的 MCP Server 与直接配置的 MCP Server 具有相同的信任边界。 +- Plugin 不能突破 AgentDock 的操作系统权限、容器挂载或其他宿主边界。 + +完整的管理操作和参数见 [工具参考](../reference/tools.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/recalldock.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/recalldock.md index a019046..b56d83d 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/recalldock.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/recalldock.md @@ -1,17 +1,18 @@ -# NexusDock Recall +# Recall 记忆 -NexusDock Recall 是 AgentDock 的可选长期知识服务。它用于保存稳定项目说明、经验、决策和问题记录,让后续任务能够找到可靠上下文。 +NexusDock Recall 是 AgentDock 的可选长期记忆服务。它可以保存值得长期保留的信息、偏好、经验和知识,让以后处理类似事情时能够继续使用这些上下文。 -没有 NexusDock 时,文件、命令、命令行 Git、Skill、动态 MCP 和本地任务仍可正常使用;Recall、Workflow 模板、知识 Evolution 和私密笔记工具不可用。多设备控制中心和统一 MCP 见 [NexusDock](./nexusdock.md)。 +没有 NexusDock 时,文件、命令、命令行 Git、Skill、动态 MCP 和本地任务仍可正常使用;Recall、Workflow 模板、知识 Evolution 和私密笔记工具不可用。多设备管理和统一 MCP 入口见 [NexusDock](./nexusdock.md)。 ## 什么时候适合使用 适合保存: -- 长期有效的项目结构和运行方式。 -- 已验证的部署或排障经验。 -- 需要跨会话复用的决策和偏好。 -- 仍待解决的问题与学习记录。 +- 个人偏好、常用习惯和长期目标。 +- 学习笔记、阅读结论和持续积累的知识。 +- 旅行、购物、兴趣爱好等以后还会参考的信息。 +- 工作或个人项目中的背景、决策和经验。 +- 已验证的开发、部署或排障经验。 不适合保存: @@ -22,32 +23,27 @@ NexusDock Recall 是 AgentDock 的可选长期知识服务。它用于保存稳 ## 接入 -需要一个可访问的 NexusDock 地址和可选 Token。可以让 Agent 配置: +先把 AgentDock 设备与 NexusDock 配对。在 NexusDock 打开 **设置 → System & Nodes**,生成一次性配对码,然后在目标设备执行页面生成的 `agentdock nexus pair ...` 命令并重启 AgentDock。 -```text -为 AgentDock 接入 NexusDock Recall,地址是 https://nexus.example.com,Token 使用安全环境变量保存。 -``` - -精确环境变量见 [配置参考](../reference/configuration.md)。 +完成配对后,Recall 不需要再给 AgentDock 单独配置 URL 或 Token。完整步骤见 [连接 AgentDock](../operations/nexusdock-connect.md)。 ## 如何使用 可以直接说: ```text -开始前先查一下这个项目已有的部署记录。 -把这次确认过的结论更新到项目长期文档,不要记录临时日志。 -搜索以前关于 OAuth 的排障经验。 +记住我旅行时更喜欢住在公共交通方便的地方。 +把这次学习整理出的重点保存下来,下次继续复习。 +查一下我之前总结过的相机选购标准。 +把这个项目刚确认的长期结论保存下来。 ``` -`agentdock_context` 已经携带紧凑的 Recall 启动索引,因此模型不需要再调用独立 bootstrap。索引已经给出准确路径时可以直接读取;否则使用 `recall_search` 搜索 Markdown 和 Card。NexusDock 配置 Embedding 后,会在同一个搜索工具后透明加入语义召回。 - -Agent 会先搜索已有内容,再决定读取、更新或创建,避免产生重复和冲突。 +AgentDock 会利用已有 Recall 内容帮助后续任务继续使用这些信息。配置 Embedding 后,还可以通过语义搜索找到表达不同但含义相关的内容。 ## 内容类型 -- **Markdown**:稳定项目文档、Runbook、学习记录和结构化长期事实。 -- **Card**:单一、可复用的经验、偏好或决策。 +- **Markdown**:长期资料、学习记录、项目文档和结构化知识。 +- **Card**:单一、可复用的经验、偏好、事实或决策。 Private Notes 是独立存储,不是 Recall 的一种内容类型。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/skills.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/skills.md index c4af1c2..272037d 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/skills.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/skills.md @@ -1,95 +1,69 @@ # 使用 Skill -Skill 是一份给 Agent 阅读的文档型工作方法,用来说明什么时候使用某项能力、要遵循哪些步骤、需要哪些依赖,以及哪些操作需要确认。 +Skill 用来教 Agent 如何处理某一类任务,可以说明要遵循的步骤、需要的工具或账号,以及哪些操作必须先确认。 ## 官方核心 Skill -AgentDock 原生安装包和 Docker 镜像会随运行时提供这些核心 Skill: +AgentDock 安装包和 Docker 镜像内置四个核心 Skill: -- `agentdock-user-guide` -- `skill-authoring` -- `skill-installation` +- `agentdock-user-guide` — 帮助配置和日常使用 AgentDock。 +- `skill-authoring` — 帮助创建和审查 Skill。 +- `skill-installation` — 帮助安全审查和安装 Skill。 +- `plugin-import` — 帮助把 Git、GitHub 或其他目录中的远程 Plugin 下载到本地,再交给 AgentDock 审查和安装。 -它们和其他 AgentDock managed Skill 使用相同模型:每个名称只保留一份当前内容。AgentDock 不维护可供选择的 Skill 历史版本,也没有 active-version 指针。 - -需要额外账号、系统权限或第三方软件的 Skill 在实际需要时再单独安装。 +需要额外账号、系统权限或第三方软件的 Skill,在实际需要时再单独安装。 ## 使用 Skill -直接告诉 Agent 你的目标,例如: +通常只需要直接描述目标: ```text -Check current Codex allowance. -Use the desktop Skill to operate this macOS app. -Install and use this Skill: https://example.com/example-skill.zip +查看我当前的 Codex 用量。 +使用桌面 Skill 操作这个 macOS 应用。 +审查并安装这个 Skill:https://example.com/example-skill ``` -Agent 通常会: - -1. 用 `agentdock_context` 或 `workspace_context` 发现相关 Skill 候选及其来源。 -2. 选择一个精确候选,再用 `read_file` 读取宿主返回的 `file`。 -3. 检查需要的命令、账号、环境变量和安全边界。 -4. 使用真实工具执行任务;需要绑定 Skill 的命令会把该候选返回的 `skill_ref` 交给 `exec_command`。 -5. 对有副作用的操作进行确认并验证结果。 - -不要根据裸 Skill 名称自行拼接 `skill_ref`。宿主签发的引用用于区分同名的 managed、shared 和 workspace 候选。 - -## 工作区 Skill +AgentDock 会发现相关 Skill,只在真正需要时让 Agent 读取对应说明。项目也可以在 `.agents/skills/` 下提供自己的 Skill;即使名称相同,项目 Skill 和全局安装的 Skill 仍会作为不同来源处理。 -项目可以在 `/.agents/skills//SKILL.md` 提供本地 Skill。`workspace_context` 会索引它们,并返回 `name`、`description`、`source_type`、`source_id`、`skill_ref`、`file` 等来源信息;不会把 Skill 正文直接注入上下文。 +## 安装或更新 Skill -即使名称相同,workspace Skill、AgentDock managed Skill 和 `~/.agents/skills` 下的 shared Skill 仍是不同候选。处理当前项目时通常会优先考虑 workspace 候选,但 Agent 必须使用实际选中候选自己的 `file` 和 `skill_ref`,而不是依靠全局名称优先级静默切换来源。 - -## 安装或更新 managed Skill - -安装前先确认来源可信。可以让 Agent 先做审查: +安装陌生 Skill 前,可以先让 Agent 审查: ```text -Please review this Skill's source, files, portability, and permission requirements, then install it if the review is clean. +检查这个 Skill 的来源、文件、可移植性和权限要求,审查没有问题后再安装。 ``` -`skill_manage install` 支持本地 Skill 目录、本地 ZIP 包或 HTTPS 软件包地址,也可以提供可选的源文件 SHA-256 做完整性校验。 - -managed Skill 每个名称只有一份当前内容。同名但内容不同的包在校验后会原子替换当前内容;重复安装完全相同的内容是 no-op,并返回相同的 `content_digest`。AgentDock 不提供 Skill 的 `activate`、`rollback` 或版本选择 action。需要恢复到已知内容时,应重新审查并安装目标来源快照。 - -从使用历史 Skill 布局的旧版 AgentDock 升级时,受支持的安装器和更新器会自动迁移 managed Skill 当前内容与 Skill 持久数据。外层安装/更新事务真正提交前,旧布局会继续保留,因此用户不需要手工移动 Skill 目录,也不需要执行迁移命令。 +由 AgentDock 安装的 Skill 支持本地目录、本地 ZIP 或 HTTPS 软件包地址。安装经过审查的新内容会替换同名 Skill 的当前内容;内容完全相同时不会重复安装。 -Skill 包不能包含 Token、Cookie、浏览器登录态、`.env`、缓存或设备私有数据。 +正常升级 AgentDock 时,旧版 Skill 目录会自动迁移,不需要手工搬目录。 -## 配置账号或 API Key +## 账号、API Key 与私有数据 -managed Skill 需要凭据时,让 Agent 保存到该 Skill 的独立环境,例如: +已安装的 Skill 需要凭据时,让 Agent 保存到该 Skill 的独立环境,不要写进 Skill 包或代码仓库。例如: ```text -Set EXAMPLE_API_KEY for example-skill without echoing the actual value in the reply. +为 example-skill 配置 EXAMPLE_API_KEY,回复中不要回显真实值。 ``` -`skill_manage env_list` 只返回变量名和配置状态,不回显秘密值。只有通过该 managed 候选自己的 `skill_ref` 运行命令时才会注入独立环境;它不会写进 Skill 包,也不会永久污染系统环境。 - -## Skill 持久数据 - -managed Skill 命令需要可变的持久状态时,AgentDock 会创建私有数据目录,并通过保留环境变量 `SKILL_DATA_DIR` 提供给该进程。 - -Skill 应把 `SKILL_DATA_DIR` 视为可选的 AgentDock 适配,而不是跨宿主的必需前提。shared 和 workspace 候选不会继承 managed Skill 的环境或数据目录。普通 managed Skill 更新以及 `skill_manage remove` 会保留独立环境和持久数据;执行带 `purge=true` 的 `skill_manage remove` 才会一并清理这些保留资源。 +Skill 需要保存可变状态时,AgentDock 还可以为它提供独立的私有数据目录。普通更新和删除默认保留这些数据;只有明确执行 purge 才会一并清理。 -使用受支持的 AgentDock 安装器或内置更新器进行正常升级时,旧 managed Skill 布局会自动迁移,不需要用户手工搬目录。 - -## 使用时要注意 +Skill 包不能包含 Token、Cookie、浏览器登录态、`.env`、缓存或设备私有数据。 -- 删除、发送、上传、支付或授权前应确认目标和副作用。 -- Skill 说明不能突破 AgentDock 进程、容器 volume 或操作系统的权限边界。 -- 第三方 Skill 可能调用外部服务,安装前应检查来源和能力范围。 -- 不要把秘密粘贴到公开日志,也不要随 Skill 打包。 -- `content_digest` 表示内容身份和审计证据,不是产品版本号。 +## Skill、Plugin 还是 MCP? -## 查看已安装 Skill +| 方式 | 适合场景 | +| --- | --- | +| **Skill** | 想教 Agent 一套可复用的任务处理方法。 | +| **Plugin** | 想一次安装一个可以包含多个 Skill 和 MCP 连接的扩展包。 | +| **动态 MCP** | 想让 AgentDock 直接连接一个外部或本地 MCP 服务。 | -可以直接询问: +另外两种方式见 [使用 Plugin](./plugins.md) 和 [连接外部 MCP](./dynamic-mcp.md)。 -```text -What Skills are available here, and where does each candidate come from? -``` +## 安全注意事项 -Agent 可以用 `agentdock_context` 查看 managed/shared 候选,用 `workspace_context` 查看当前项目候选,只在真正需要时读取完整 Skill 文档。 +- 第三方 Skill 安装前先审查来源和内容。 +- 发送、删除、上传、支付、授权等敏感操作应先确认。 +- Skill 不能突破 AgentDock 进程、容器挂载或操作系统用户本身的权限。 +- 不要把秘密放进 Skill 包、公开日志或代码仓库。 -创建和维护 Skill 属于开发者工作,见 [开发者指南](../contributing/development.md#skill-开发)。 +想查看当前可用 Skill,可以直接询问 Agent 有哪些 Skill、分别来自哪里。创建和维护 Skill 见 [开发者指南](../contributing/development.md#skill-开发)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/tasks.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/tasks.md index 058c2f9..7d95b18 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/tasks.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/tasks.md @@ -31,7 +31,7 @@ 只有确实无法继续时才会标记为阻塞,例如目标电脑离线、缺少必要权限或外部服务持续不可用。 -普通测试失败不算阻塞,Agent 应继续排查。阻塞解除后,可以直接说: +普通测试失败不会让任务自动进入阻塞状态,仍然可以继续排查。阻塞解除后,可以直接说: ```text 设备已经恢复,继续刚才的任务。 @@ -39,23 +39,23 @@ ## 怎样判断任务完成 -任务完成前,Agent 应检查: +任务只有满足以下条件才会视为完成: -1. 所有步骤是否真正完成。 -2. 完成条件是否有可验证证据。 -3. 是否仍有未说明的风险或临时处理。 -4. 修改后的服务、页面或程序是否真实可用。 +1. 所有步骤都真正完成。 +2. 完成条件都有可验证证据。 +3. 剩余风险或临时处理已经说明。 +4. 修改后的服务、页面或程序在真实环境中可用。 “代码已改”或“命令执行结束”不等于任务完成。 ## Workflow 模板 -常见开发、部署和运维流程可以保存为模板。Agent 会先匹配模板,再根据当前任务删减、组合和调整步骤。 +常见开发、部署和运维流程可以保存成 Workflow 模板,在类似任务中继续复用。模板只是流程建议,不会自动执行命令。 -模板只是流程建议,不会自动执行命令,也不会替代当前环境检查。 +共享流程见 [Workflow 工作流](./workflow.md)。 ## 数据范围 任务状态保存在当前 AgentDock 实例中,不会自动跨设备同步。长期有价值的结论应整理到项目文档或 NexusDock Recall,而不是依赖旧任务记录。 -需要查看精确 action 和字段时,参阅 [工具介绍](../reference/tools.md#可恢复任务与-workflow)。 +需要查看完整操作和字段时,参阅 [工具参考](../reference/tools.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/workflow.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/workflow.md new file mode 100644 index 0000000..5d7fda2 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/concepts/workflow.md @@ -0,0 +1,37 @@ +# Workflow 工作流 + +Workflow 是 NexusDock 中共享的可复用流程。只要一件事会重复发生,而且每次大致遵循相似步骤,就可以把它保存成 Workflow。日常生活、学习、内容创作、工作和技术任务都可以使用。 + +## 有什么用 + +Workflow 可以把一套已经验证过的流程保存下来,之后遇到类似任务时直接复用,不需要每次从头规划。 + +例如可以保存: + +- 出门旅行前的准备流程; +- 每周学习复习或资料整理流程; +- 照片、下载文件或个人资料的整理流程; +- 写文章、做视频或发布内容的流程; +- 工作中的例行检查和重复事务; +- 发布版本、部署服务或排查故障的流程。 + +Workflow 由 NexusDock 统一保存,已经配对的 AgentDock 设备可以共同使用。 + +## 怎么使用 + +可以直接说: + +```text +按我平时的旅行准备 Workflow 检查这次还缺什么。 +用已有的每周复习 Workflow 帮我整理今天要做的内容。 +把这套照片整理步骤保存成以后可以复用的 Workflow。 +这次发版使用已有的发布 Workflow。 +``` + +Workflow 是可复用流程,不是自动执行的脚本。AgentDock 会根据当前任务和真实环境调整步骤后再执行。 + +## 匹配方式 + +基础 Workflow 不需要配置 AI 或 Embedding。配置 **设置 → AI 与向量** 后,NexusDock 还可以通过语义匹配找到更相关的 Workflow。 + +当前任务进度和 Workflow 是两回事。执行进度见 [任务与进度](./tasks.md),长期知识见 [Recall 记忆](./recalldock.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/contributing/development.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/contributing/development.md index 247a8a2..2c99715 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/contributing/development.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/contributing/development.md @@ -1,109 +1,69 @@ # 开发者指南 -本页面面向准备修改 AgentDock 源码、公开文档或第一方 Skill 的贡献者。 +本页提供 AgentDock、NexusDock 和相关仓库的开发入口。 -代码和公开文档分别维护: +## 主要仓库 -- [`uvwt/agentdock`](https://github.com/uvwt/agentdock) -- [`uvwt/agentdock-docs`](https://github.com/uvwt/agentdock-docs) +- [`uvwt/agentdock`](https://github.com/uvwt/agentdock):AgentDock Core、桌面客户端、工具和内置能力。 +- [`uvwt/nexusdock`](https://github.com/uvwt/nexusdock):多设备控制台、统一 MCP、Recall 和 Workflow。 +- [`uvwt/agentdock-protocol`](https://github.com/uvwt/agentdock-protocol):AgentDock 与 NexusDock 的共享协议。 +- [`uvwt/agentdock-docs`](https://github.com/uvwt/agentdock-docs):公开文档。 -修改用户可见行为时,应同步更新对应文档。 +## 本地检查 -## 源码检查 - -在 AgentDock 仓库运行: +### AgentDock ```bash make check ``` -该命令执行格式化、测试、vet 和构建。局部开发可以先运行包级测试,提交前仍应执行完整检查。 - -涉及并发、平台差异、安装器、Docker、浏览器、ACP 或桌面生命周期时,还要运行对应专项测试和真实环境验证。 +涉及桌面客户端、安装器、浏览器或平台差异时,还应运行对应测试并在真实环境中验证。 -## 文档检查 +### NexusDock -在 `agentdock-docs` 仓库运行: +首次开发: ```bash -pnpm install --frozen-lockfile -pnpm check +make web-deps +make build ``` -`pnpm check` 会运行 TypeScript 检查、locale 测试、中英文结构一致性检查、两个 locale 的生产构建以及默认生产构建。修改导航、布局或宽表格后,还应使用真实浏览器检查桌面和移动端页面。 - -## 公开契约原则 - -公开文档描述普通用户或第三方集成可以复现的行为,不是维护者个人笔记。 +日常检查: -- 以当前 `main` 源码、公开 Release 资产、工具 Schema 和受支持的 UI/CLI 入口作为事实源。 -- 工具名称和 action 从真实 MCP 契约推导;能力是否存在以客户端的 `tools/list` 为准,不要把内部 helper 写成公开工具。 -- 运行配置从当前 Core 配置解析器和公开服务参数推导。安装器事务变量、测试开关、签名变量和维护者部署覆盖项不是用户配置。 -- 示例使用 `example.com`、``、`` 等通用占位符。禁止写入维护者用户名、设备名、私有主机名、本地项目路径、个人代理、私有端点或真实凭据。 -- 文档描述受支持默认值和用户可控覆盖方式,不复制维护者机器拓扑。平台示例应能在普通该平台安装中复现。 -- 主流程不保留兼容代码和迁移历史。只有当前用户仍可能遇到旧入口时才说明,并明确指出新的推荐方式。 -- 同一次改动保持英文和简体中文语义同步。 +```bash +make check +``` -如果源码注释或历史文档与可执行行为冲突,应先核对真实契约和测试,再更新用户文档;不要为了和旧版本措辞一致而继续保留过期说明。 +需要完整验证时: -## 改动原则 +```bash +make ci +``` -- 先检查现有目录、接口、错误处理和测试方式。 -- 保持主流程可读,不为了形式化分层制造抽象。 -- 修改工具描述、Schema、路径、认证、命令、浏览器、ACP 或桌面能力时同步更新测试。 -- 修改安装器时验证帮助文本、默认值、生成文件、公开 Release 资产、升级、卸载和代表性安装路径。 -- 除非公开 action 明确要求破坏性清理,否则应保留用户数据;普通更新/移除和 purge 行为要分开描述。 -- 测试、示例、截图、日志和文档都不得暴露真实 Token、私有端点、个人目录或维护者凭据。 +### 文档 -## 工具结果约定 +```bash +pnpm install --frozen-lockfile +pnpm check +``` -MCP 协议层错误使用 `isError`。正常工具结果不使用含义模糊的通用 `ok` 或 `tool_ok`: +修改导航或页面布局后,再用真实浏览器检查桌面和移动端效果。 -- 命令使用 `command_ok`、`exit_code` 和 `command_error`。 -- 浏览器使用 `browser_ok` 和 `browser_error`。 -- 其他工具使用 `changed`、`configured`、`written` 等明确的领域字段。 +## 开发时注意 -新增或修改输出 Schema 时,要验证 `structuredContent` 不会泄漏内部 HTTP、WSL 子进程、安装器或 Runner 协议中的通用状态字段。 +- 修改前先了解现有目录、接口、错误处理和测试方式。 +- 修改用户可见行为时,同步更新测试和公开文档。 +- AgentDock 与 NexusDock 的共享接口变化时,同步检查 `agentdock-protocol` 和两端实现。 +- 示例、测试、日志和文档不要包含真实 Token、私有地址、个人路径或其他敏感信息。 +- 涉及平台、安装、网络或 UI 的改动,应在对应真实环境中验证。 ## Skill 开发 -第一方 Skill 使用“可移植文档核心 + 可选 AgentDock 适配”模型。最小结构: +Skill 应保持可移植,不依赖维护者机器上的路径、凭据或私有状态。最小结构: ```text example-skill/ └── SKILL.md ``` -按需增加 `references/`、`scripts/`、入口脚本和测试。要求: - -- `SKILL.md` 必须有合法 `name`、有意义的 `description` 和非空说明正文。 -- 包内使用相对路径;不要依赖维护者 checkout 路径或 AgentDock 私有状态路径。 -- 脚本从当前进程环境读取配置,并把可变状态保存在包外。 -- 不打包 `.env`、Token、缓存、登录态、数据库、下载结果、symlink 或设备私有数据。 -- `metadata.version` 即使存在也只是作者元数据;AgentDock 不使用 Skill version 字段做安装选择、激活或回滚。 -- 把 `content_digest` 视为当前内容身份。重复安装完全相同的 managed 内容是 no-op;内容变化时事务性替换当前 managed tree。 -- 需要持久可变数据时,可移植代码应把 `SKILL_DATA_DIR` 视为可选 AgentDock 适配,不要硬编码 `~/.agentdock/data/...`。 -- 使用 `skill-authoring` 检查结构、可移植性和安全性。运行时安装使用 `skill_manage`;不存在应该写入文档的 `skill_package validate` 兼容 action。 -- 集成执行 Skill 绑定命令时,使用发现阶段由宿主签发的精确 `skill_ref`,不要根据裸名称自行构造。 - -用户流程见 [使用 Skill](../concepts/skills.md)。 - -## 跨仓库改动 - -一个用户可见改动可能涉及多个仓库: - -- 工具行为、安装器、Core 配置和内置 Skill:修改 `uvwt/agentdock` 并同步对应文档。 -- AgentDock/NexusDock 共享接口:协议契约变化时先更新 `uvwt/agentdock-protocol`,再同步两端实现和文档。 -- 仅属于 NexusDock 的部署或 fleet UI 行为:修改 `uvwt/nexusdock` 和对应公开文档。 -- 社区或独立发布的 Skill:更新 Skill 源仓库/目录,不要把维护者机器上的安装状态复制进 AgentDock 文档。 - -每个仓库的改动应能独立审查;公开契约跨仓库时,在 PR 中关联相关改动。 - -## 提交与发布 - -- `main` 是稳定分支。 -- 提交信息遵循仓库当前约定;AgentDock 常用 `type(scope): 中文说明`。 -- 提交前确认工作区只包含本次任务改动。 -- 提交前运行完整仓库检查,推送后检查 GitHub Actions。 -- 如果改动涉及导航、渲染、下载或可复制命令,发布后应实际访问部署页面验证。 -- Release 签名、生产部署和维护者机器操作应进入维护者 Runbook 或自动化,不写进普通用户页面。 +按需添加脚本、参考资料和测试。运行时安装使用 `skill_manage`,用户使用方式见 [使用 Skill](../concepts/skills.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/docker.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/docker.md index 792cd37..c368f80 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/docker.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/docker.md @@ -15,9 +15,7 @@ docker compose version ## 2. 下载启动配置 -根据当前系统选择一组命令。 - -### macOS / Linux +在终端中执行: ```bash mkdir -p agentdock && cd agentdock @@ -26,18 +24,6 @@ curl -fL https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.ym printf 'AGENTDOCK_AUTH_TOKEN=%s\n' "$(openssl rand -hex 32)" > .env ``` -### Windows PowerShell - -```powershell -New-Item -ItemType Directory -Force agentdock | Out-Null -Set-Location agentdock -Invoke-WebRequest ` - https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.yml ` - -OutFile docker-compose.yml -$token = [guid]::NewGuid().ToString("N") + [guid]::NewGuid().ToString("N") -"AGENTDOCK_AUTH_TOKEN=$token" | Set-Content -Encoding ascii .env -``` - `.env` 中保存的是连接 Token。不要把它提交到 Git 或发给别人。 浏览器镜像、Tunnel、自定义端口等可选变量,可参考仓库中的 [`.env.example`](https://raw.githubusercontent.com/uvwt/agentdock/main/.env.example)。 @@ -66,15 +52,9 @@ Token 是 `.env` 文件中 `AGENTDOCK_AUTH_TOKEN=` 后面的内容。 查看 Token: ```bash -# macOS / Linux cat .env ``` -```powershell -# Windows PowerShell -Get-Content .env -``` - :::tip **安装完成:** `docker compose ps` 显示 `healthy`,并把 MCP 地址与 Token 填入客户端后即可使用。 ::: @@ -95,7 +75,7 @@ docker compose logs -f cloudflared-quick 日志中会出现 `https://…trycloudflare.com`。在地址后追加 `/mcp`,并继续使用 `.env` 中的 Bearer Token 认证。 -这个临时地址在容器或 Tunnel 重启后可能变化,适合测试,不适合 OAuth 或长期使用。固定域名配置见 [Docker 进阶配置](../operations/docker.md#cloudflare-tunnel)。 +这个临时地址在容器或 Tunnel 重启后可能变化,适合测试,不适合 OAuth 或长期使用。固定域名配置见 [Docker 进阶配置](../operations/public-access.md)。 ## 更新 @@ -115,6 +95,6 @@ docker compose --profile cloudflare-quick up -d --force-recreate ## 按需继续 -- 需要浏览器镜像、开发工具镜像、修改端口、挂载项目或迁移旧数据:阅读 [Docker 进阶配置](../operations/docker.md)。 +- 需要浏览器镜像、开发工具镜像、修改端口、挂载项目或迁移旧数据:阅读 [Docker](../operations/docker.md)。 - 启动失败:查看 [故障排查](../operations/troubleshooting.md)。 -- 需要局域网或公网访问:先阅读 [安全模型](../operations/security.md)。 +- 需要局域网或公网访问:见 [公网访问](../operations/public-access.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/install.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/install.md index 1d8dcf5..a4ac0e0 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/install.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/install.md @@ -46,4 +46,4 @@ Bearer Token 或 OAuth 登录信息 第一次使用只需要完成对应系统页面中的编号步骤。自定义端口、固定版本、自动化参数和手动服务管理都可以以后再看。 ::: -如果安装时开启了公网地址,想用网页版 ChatGPT 操控本机,请继续阅读 [使用 ChatGPT 连接 AgentDock](../guides/chatgpt.md)。 +如果安装时开启了公网地址,想用网页版 ChatGPT 操控本机,请继续阅读 [使用 ChatGPT 连接](../guides/chatgpt.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/linux.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/linux.md index 826e4e1..c319f55 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/linux.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/linux.md @@ -11,7 +11,7 @@ AgentDock 提供 Linux x64 和 ARM64 预编译版本。 ```bash curl -fsSL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ -o /tmp/install-agentdock.sh -sudo env AGENTDOCK_NONINTERACTIVE=true sh /tmp/install-agentdock.sh +sudo sh /tmp/install-agentdock.sh ``` 安装器会自动选择 systemd 或 OpenRC,创建低权限运行用户,生成 Bearer Token,启动服务并完成健康检查。 @@ -76,20 +76,27 @@ sudo sh /tmp/install-agentdock.sh 安装器会询问是否已有接入 Cloudflare 的域名: - 没有域名:自动创建临时 `trycloudflare.com` 地址,适合快速使用。 -- 已有域名:先按 [固定域名配置教程](../guides/fixed-domain.md) 完成 Cloudflare 侧设置,再在安装器提示时填写得到的 HTTPS 公网地址和 Tunnel Token。 +- 已有域名:先按 [公网访问](../operations/public-access.md) 完成 Cloudflare 侧设置,再在安装器提示时填写得到的 HTTPS 公网地址和 Tunnel Token。 -安装完成后,终端会显示公网 MCP 地址和连接凭据。临时地址可能在服务重启后变化;地址变化时重新运行安装器,并替换客户端中的旧地址。已有 Bearer Token 和 OAuth 凭据会保留。 +安装完成后,终端会显示公网 MCP 地址和连接凭据。临时地址在重启后可能变化;需要新地址时执行 `sudo /opt/agentdock/bin/agentdock tunnel regenerate --runtime-root /etc/agentdock`,再替换客户端中的旧 MCP URL 并重新完成 OAuth 授权。已有 Bearer Token 和 OAuth 凭据会保留。 -公网访问必须保留认证。详细参数和日志位置见 [Linux 进阶配置](../operations/linux.md#cloudflare-tunnel)。 +公网访问必须保留认证。详细参数和日志位置见 [公网访问](../operations/public-access.md)。 ## 更新 -重新下载并运行第 1 步即可。任务、Skill、配置和工作目录会保留。 +先检查,再安装最新版本: + +```bash +sudo /opt/agentdock/bin/agentdock update --check +sudo /opt/agentdock/bin/agentdock update +``` + +任务、Skill、配置和工作目录会保留。只有需要修复安装或安装指定版本时,再重新运行安装器。 ## 按需继续 - 使用浏览器自动化:在宿主机安装 Chrome、Chromium 或 Microsoft Edge 并启用浏览器工具;自动检测不到时可设置 `AGENTDOCK_BROWSER_EXECUTABLE_PATH`。只有希望容器直接包含 Chromium 时才需要 Docker browser 镜像。见 [浏览器自动化](../guides/browser-control.md)。 -- Alpine、自定义目录或端口、手动服务管理和卸载:见 [Linux 进阶配置](../operations/linux.md)。 -- 需要完全手动维护 systemd、反向代理和 OAuth 时:见 [Linux 手动部署](./vps.md)。 +- Alpine、自定义目录或端口、手动服务管理和卸载:见 [Linux 与服务器](../operations/linux.md)。 +- 需要完全手动维护 systemd、反向代理和 OAuth 时:见 [Linux 与服务器](../operations/linux.md)。 - 启动失败:查看 [故障排查](../operations/troubleshooting.md)。 -- 需要公网访问:先阅读 [安全模型](../operations/security.md)。 +- 需要公网访问:见 [公网访问](../operations/public-access.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/macos.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/macos.md index 8cc1fc2..296008b 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/macos.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/macos.md @@ -1,4 +1,4 @@ -# 在 macOS 上安装 AgentDock +# MacOS 安装 使用 macOS 图形应用安装和管理 AgentDock。 @@ -23,16 +23,12 @@ Apple 芯片和 Intel Mac 使用同一个 DMG。 ## 2. 第一次打开 -当前版本还没有经过 Apple 公证,第一次启动需要手动确认一次: - -1. 在 Finder 中打开“应用程序”。 -2. 右键点击 `AgentDock.app`,选择“打开”。 -3. 在确认窗口中再次点击“打开”。 - -不需要关闭 Gatekeeper,也不要修改系统全局安全设置。成功打开一次后,以后可以正常双击启动。 +在 Finder 中打开“应用程序”,启动 `AgentDock.app`。 AgentDock 启动后会出现在菜单栏。点击图标并选择“安装 AgentDock”或“打开 AgentDock”,即可显示主窗口。 +如果 macOS 第一次启动时拦截应用,参阅下方的 [macOS 提示无法验证开发者](#macos-提示无法验证开发者)。 + ## 3. 选择连接方式 ### 仅本机 @@ -47,7 +43,7 @@ MCP 客户端也在这台 Mac 上时选择。该模式不需要域名或 Cloudfl ### 固定域名 -需要长期使用稳定地址时,先按 [固定域名配置教程](../guides/fixed-domain.md) 完成 Cloudflare 侧设置。然后在 AgentDock 中选择“固定域名”,填写该教程得到的 HTTPS 公网地址和 Tunnel Token。公网地址不要添加 `/mcp`。 +需要长期使用稳定地址时,先按 [公网访问](../operations/public-access.md) 完成 Cloudflare 侧设置。然后在 AgentDock 中选择“固定域名”,填写该教程得到的 HTTPS 公网地址和 Tunnel Token。公网地址不要添加 `/mcp`。 点击“安装并启动”,保持窗口打开,直到状态显示“运行正常”。安装完成后,可以直接在控制面板切换公网访问方式,不需要重新运行安装器。 @@ -63,7 +59,11 @@ MCP 客户端也在这台 Mac 上时选择。该模式不需要域名或 Cloudfl 凭据默认会被遮罩,需要时点击“显示”。长地址和凭据可以直接点击“复制”。 -客户端也在这台 Mac 上时,使用本地 MCP 地址;ChatGPT 或其他远程客户端使用公网 MCP 地址。传输方式选择 **Streamable HTTP**。 +客户端也在这台 Mac 上时,使用本地 MCP 地址;其他设备或云端客户端使用公网 MCP 地址。传输方式选择 **Streamable HTTP**。 + +不同客户端的添加入口和认证方式略有不同。支持 OAuth 的客户端可以通过浏览器完成授权;支持自定义 HTTP Header 的客户端也可以使用 Bearer Token。 + +Claude Desktop、ChatGPT、Claude Code、Cursor、VS Code、Codex、TRAE、WorkBuddy 等客户端的连接方式见 [在不同客户端中连接](../guides/mcp-clients.md) 与 [使用 ChatGPT 连接](../guides/chatgpt.md)。 不要把 Bearer Token 或 OAuth 密码放进截图、Issue 或公开聊天。 @@ -89,9 +89,7 @@ MCP 客户端也在这台 Mac 上时选择。该模式不需要域名或 Cloudfl 4. 确认 AgentDock 已检测到受支持的浏览器。 5. 点击“应用并重启”。 -AgentDock 默认使用独立会话和 Profile。通过 CDP 附着已有 Chromium 系浏览器属于显式的高级模式,使用前请先阅读浏览器指南。 - -登录态和安全边界见 [浏览器自动化](../guides/browser-control.md)。 +AgentDock 默认使用独立的浏览器会话。登录状态和安全边界见 [浏览器自动化](../guides/browser-control.md)。 ## 可选:设置登录后自动启动 @@ -126,4 +124,4 @@ AgentDock 默认使用独立会话和 Profile。通过 CDP 附着已有 Chromium 确认已经安装 Google Chrome、Chromium 或 Microsoft Edge,然后关闭再重新启用浏览器工具。 -指定版本、自定义安装目录、手动服务命令和卸载步骤见 [macOS 进阶配置](../operations/macos.md)。需要控制屏幕、键盘和鼠标时,继续阅读 [macOS 桌面自动化](../guides/desktop-automation.md)。 +指定版本、自定义安装目录、手动服务命令和卸载步骤见 [桌面端高级设置](../operations/desktop.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/vps.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/vps.md deleted file mode 100644 index 4eb0aa7..0000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/vps.md +++ /dev/null @@ -1,174 +0,0 @@ -# Linux 手动 systemd 部署 - -本页介绍如何手动维护运行用户、预编译 Release、环境文件、systemd 和 HTTPS 反向代理。 - -## 推荐拓扑 - -```text -MCP client -> HTTPS reverse proxy -> 127.0.0.1:8765 -> AgentDock -``` - -AgentDock 只监听回环地址,Caddy、Nginx 或其他反代负责 TLS 和公网入口。 - -## 创建运行用户和目录 - -```bash -sudo useradd --system --create-home --home-dir /srv/agentdock agentdock -sudo install -d -o agentdock -g agentdock /srv/agentdock/AgentDock -sudo install -d -m 0755 /opt/agentdock/bin -sudo install -d -m 0750 /etc/agentdock -``` - -## 下载并安装 Release 二进制 - -```bash -case "$(uname -m)" in - x86_64|amd64) ARCH=amd64 ;; - aarch64|arm64) ARCH=arm64 ;; - *) echo "unsupported architecture: $(uname -m)" >&2; exit 1 ;; -esac - -ASSET="agentdock_linux_${ARCH}.tar.gz" -BASE_URL="https://github.com/uvwt/agentdock/releases/latest/download" -TMP_DIR="$(mktemp -d)" - -curl -fL "$BASE_URL/$ASSET" -o "$TMP_DIR/$ASSET" -curl -fL "$BASE_URL/$ASSET.sha256" -o "$TMP_DIR/$ASSET.sha256" -( - cd "$TMP_DIR" - sha256sum -c "$ASSET.sha256" - tar -xzf "$ASSET" -) - -sudo install -m 0755 "$TMP_DIR/bin/agentdock" /opt/agentdock/bin/agentdock -sudo rm -rf /opt/agentdock/share/agentdock/core-skills -sudo install -d -m 0755 /opt/agentdock/share/agentdock/core-skills -sudo cp -R "$TMP_DIR/share/agentdock/core-skills/." /opt/agentdock/share/agentdock/core-skills/ -sudo chown -R root:root /opt/agentdock/share/agentdock/core-skills -sudo -u agentdock -H /opt/agentdock/bin/agentdock skill bootstrap \ - --bundle /opt/agentdock/share/agentdock/core-skills -rm -rf "$TMP_DIR" -``` - -生产环境可以把 `BASE_URL` 改为指定版本: - -```bash -BASE_URL="https://github.com/uvwt/agentdock/releases/download/vX.Y.Z" -``` - -## 环境文件 - -创建 `/etc/agentdock/agentdock.env`: - -```bash -AGENTDOCK_HOST=127.0.0.1 -AGENTDOCK_PORT=8765 -AGENTDOCK_LOG_LEVEL=info -AGENTDOCK_AUTH_TOKEN= -``` - -然后收紧权限: - -```bash -sudo chown root:agentdock /etc/agentdock/agentdock.env -sudo chmod 0640 /etc/agentdock/agentdock.env -``` - -## systemd unit - -创建 `/etc/systemd/system/agentdock.service`: - -```ini -[Unit] -Description=AgentDock MCP server -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -User=agentdock -Group=agentdock -WorkingDirectory=/srv/agentdock/AgentDock -EnvironmentFile=/etc/agentdock/agentdock.env -ExecStart=/opt/agentdock/bin/agentdock \ - --host ${AGENTDOCK_HOST} \ - --port ${AGENTDOCK_PORT} \ - --log-level ${AGENTDOCK_LOG_LEVEL} -Restart=on-failure -RestartSec=3 - -[Install] -WantedBy=multi-user.target -``` - -启动: - -```bash -sudo systemctl daemon-reload -sudo systemctl enable --now agentdock -``` - -## 配对 NexusDock(可选) - -如果这台设备需要使用 NexusDock Recall/Workflow 或加入 NexusDock fleet,先到 **NexusDock → 设置 → 系统与节点** 生成一次性配对码。使用与 AgentDock 服务相同的用户完成配对,再重启服务: - -```bash -sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair \ - --endpoint https://nexus.example.com \ - --code -sudo systemctl restart agentdock -``` - -不要再把旧 Nexus endpoint/token 凭据写进 `agentdock.env`;当前 AgentDock 只从已配对的设备身份加载 NexusDock 配置。 - -## HTTPS 反代 - -Caddy 示例: - -```caddyfile -agentdock.example.com { - reverse_proxy 127.0.0.1:8765 -} -``` - -客户端地址: - -```text -https://agentdock.example.com/mcp -``` - -反代不要记录 Authorization Header。只有反代确实位于可信网段并负责重写 `X-Forwarded-For` 时,才配置 `AGENTDOCK_TRUSTED_PROXY_CIDRS`。 - -## OAuth(可选) - -ChatGPT 等需要浏览器授权的客户端可启用 OAuth: - -```bash -AGENTDOCK_OAUTH_ENABLED=true -AGENTDOCK_SERVER_URL=https://agentdock.example.com -AGENTDOCK_OAUTH_PASSWORD=<至少-12-个字符的授权密码> -AGENTDOCK_OAUTH_TOKEN_SECRET=<至少-32-字节的随机签名密钥> -``` - -`AGENTDOCK_SERVER_URL` 只填写 HTTPS Origin,不附加 `/mcp`。密码和签名密钥不要提交到版本控制。连接与端点检查见 [使用 ChatGPT 连接 AgentDock](../guides/chatgpt.md)。 - -## 更新 - -重新下载并校验目标 Release,除了替换二进制,还要按上面的安装步骤刷新并 bootstrap 该 Release 的 `share/agentdock/core-skills` Bundle,然后重启: - -```bash -sudo systemctl restart agentdock -sudo systemctl status agentdock --no-pager -``` - -运行数据和环境文件位于独立目录,不会随二进制替换而删除。 - -## 验证 - -```bash -sudo systemctl status agentdock --no-pager -sudo journalctl -u agentdock -n 100 --no-pager -curl -fsS http://127.0.0.1:8765/healthz -``` - -验证 MCP 时应携带环境文件中的 Bearer Token,并确认公网反代不会丢弃 Authorization Header。源码构建只面向贡献者,见 [开发者指南](../contributing/development.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/windows.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/windows.md index 0c494ad..7c7eadb 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/windows.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/windows.md @@ -44,7 +44,7 @@ MCP 客户端也在这台电脑上时选择。该模式不需要域名或 Cloudf ### 使用自己的 Cloudflare 域名 -需要长期使用稳定地址时,先按 [固定域名配置教程](../guides/fixed-domain.md) 完成 Cloudflare 侧设置。然后在 AgentDock 中选择“固定域名”,填写该教程得到的 HTTPS 公网地址和 Tunnel Token。公网地址不要添加 `/mcp`。 +需要长期使用稳定地址时,先按 [公网访问](../operations/public-access.md) 完成 Cloudflare 侧设置。然后在 AgentDock 中选择“固定域名”,填写该教程得到的 HTTPS 公网地址和 Tunnel Token。公网地址不要添加 `/mcp`。 安装完成后,可以直接在 AgentDock 控制面板的 **公网访问** 中切换仅本机、临时地址和固定域名;仅修改公网访问方式时不需要重新运行安装器。 @@ -69,15 +69,11 @@ MCP 客户端也在这台电脑上时选择。该模式不需要域名或 Cloudf 凭据默认会被遮罩,需要时点击“显示”。文本框中的内容可以使用 Windows 的标准复制操作。 -同一台电脑上的客户端使用本地 MCP 地址;ChatGPT 或其他远程客户端使用公网 MCP 地址。传输方式选择 **Streamable HTTP**。 +同一台电脑上的客户端使用本地 MCP 地址;其他设备或云端客户端使用公网 MCP 地址。传输方式选择 **Streamable HTTP**。 -如果安装时选择了临时或固定公网地址,并想连接网页版 ChatGPT: +不同客户端的添加入口和认证方式略有不同。支持 OAuth 的客户端可以通过浏览器完成授权;支持自定义 HTTP Header 的客户端也可以使用 Bearer Token。 -1. 从控制面板复制公网 MCP 地址和 OAuth 密码。 -2. 在 ChatGPT 中打开 **设置 > 插件**,开启开发人员模式。 -3. 创建插件,填入公网 MCP 地址,再用 OAuth 密码完成授权。 - -完整步骤见 [使用 ChatGPT 连接 AgentDock](../guides/chatgpt.md)。其他客户端见 [在不同客户端中连接 AgentDock](../guides/mcp-clients.md)。 +Claude Desktop、ChatGPT、Claude Code、Cursor、VS Code、Codex、TRAE、WorkBuddy 等客户端的连接方式见 [在不同客户端中连接](../guides/mcp-clients.md) 与 [使用 ChatGPT 连接](../guides/chatgpt.md)。 不要把 Bearer Token 或 OAuth 密码放进截图、Issue 或公开聊天。 @@ -99,4 +95,4 @@ MCP 客户端也在这台电脑上时选择。该模式不需要域名或 Cloudf 使用浏览器自动化时,先安装 Chrome、Chromium 或 Microsoft Edge,再在控制面板中启用浏览器工具。只有希望容器直接包含 Chromium 时才需要 Docker browser 镜像。见 [浏览器自动化](../guides/browser-control.md)。 -PowerShell 自动化、固定版本、WSL 和详细文件位置见 [Windows 进阶配置](../operations/windows.md)。启动失败时查看 [故障排查](../operations/troubleshooting.md)。 +PowerShell 自动化、固定版本、WSL 和详细文件位置见 [桌面端高级设置](../operations/desktop.md)。启动失败时查看 [故障排查](../operations/troubleshooting.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/browser-control.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/browser-control.md index 939a748..2067898 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/browser-control.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/browser-control.md @@ -1,8 +1,8 @@ -# 浏览器自动化 +# 使用浏览器 启用浏览器能力后,Agent 可以打开网页、点击、输入、滚动、截图,并检查页面控制台、网络和页面错误。 -AgentDock 支持 Google Chrome、Chromium 和 Microsoft Edge。默认情况下,浏览器自动化会启动由 AgentDock 管理的独立会话;高级用户也可以选择通过 CDP 附着已有 Chromium 系浏览器,但这是显式开启的另一种隔离边界。 +AgentDock 支持 Google Chrome、Chromium 和 Microsoft Edge。浏览器自动化默认使用由 AgentDock 管理的独立浏览器会话。 ## 开始前 @@ -29,7 +29,7 @@ AgentDock 支持 Google Chrome、Chromium 和 Microsoft Edge。默认情况下 如果希望容器直接包含 Chromium,使用 browser 镜像: 1. 完成 [Docker 安装](../getting-started/docker.md)。 -2. 按 [Docker 进阶配置](../operations/docker.md#启用浏览器自动化) 启动 browser 镜像。 +2. 按 [Docker 进阶配置](../operations/docker.md) 启动 browser 镜像。 3. 连接客户端后,确认 Agent 可以看到 `browser_*` 工具。 ## 直接提出任务 @@ -42,23 +42,23 @@ AgentDock 支持 Google Chrome、Chromium 和 Microsoft Edge。默认情况下 把最终页面截图给我看。 ``` -Agent 应先观察页面,再执行动作,最后重新检查页面状态。 +浏览器自动化会保留操作前后的可观察页面状态,便于确认最终结果,而不是只根据操作是否发出进行判断。 -## 登录态、Profile 与已有 CDP 浏览器 +## 登录状态 -AgentDock 自有浏览器需要保持登录时,使用专用 `profile_id`。Profile 会保存在 AgentDock 自己的浏览器数据目录中,后续会话可以继续复用;不要把自有会话指向日常浏览器主 Profile。 +AgentDock 默认使用自己的独立浏览器环境,不会和你日常上网使用的浏览器混在一起。 -高级配置也可以附着已经运行的 Chromium 系浏览器。单次 session 传入的 `cdp_url` 只允许回环地址;命名或远程 CDP 地址必须由用户在 AgentDock 设置中配置。`AGENTDOCK_BROWSER_CDP_URL` 用来指定已配置地址,`AGENTDOCK_BROWSER_REUSE_EXISTING_CDP=true` 则让 AgentDock 尝试复用唯一检测到的本地 CDP 浏览器。 +如果希望网站保持登录,AgentDock 可以保存这份浏览器登录状态,后续会话继续使用。部分网站第一次登录时,仍可能需要你手动完成验证码、扫码或 2FA。 -通过 CDP 附着时,AgentDock 会在外部浏览器中创建并管理独立 target,关闭 AgentDock session 不会退出外部浏览器。外部 CDP session 不能使用 AgentDock 持久 `profile_id`、Cookie 注入或 localStorage 注入。外部浏览器可能还包含其他登录态,因此只应附着你明确用于自动化的浏览器实例。 +如果宿主机上已经有可使用的CDP浏览器,也可以在设置中选择优先复用它,这样可以继续使用其中已有的登录状态。找不到可复用的浏览器时,AgentDock 会自动使用自己的独立浏览器。具体设置见 [配置参考](../reference/configuration.md)。 -首次登录仍可能需要你手动完成验证码、扫码或安全确认。不要让 Agent 在聊天或日志中回显密码、Cookie 或 Authorization Header。 +不要把密码、Cookie 或其他登录凭据发到聊天或日志中。 ## 安全边界 - 上传文件、发送消息、提交表单、删除内容和授权前要确认目标与副作用。 -- 优先使用 AgentDock 自有专用 Profile;如果显式使用 CDP 附着,只暴露专门用于自动化的浏览器实例。 +- 浏览器自动化和日常上网环境保持分开。 - 只给自动化访问任务需要的网站和文件。 -- 不再需要登录态时,及时清理持久 Profile。 +- 不再需要保持登录时,可以清理保存的浏览器登录状态。 -浏览器工具边界见 [工具介绍](../reference/tools.md#浏览器自动化),宿主机配置见 [配置参考](../reference/configuration.md#浏览器工具)。 +浏览器工具边界见 [工具参考](../reference/tools.md),宿主机配置见 [配置参考](../reference/configuration.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/chatgpt.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/chatgpt.md index da01871..7f0a8f0 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/chatgpt.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/chatgpt.md @@ -1,4 +1,4 @@ -# 使用 ChatGPT 连接 AgentDock +# 使用 ChatGPT 连接 通过网页版 ChatGPT 操作电脑上的文件、执行命令、管理 Git、使用浏览器自动化,或调用本机编码工具。 @@ -10,6 +10,10 @@ Windows 和 macOS 图形安装程序已自动集成 Cloudflare Tunnel 与 OAuth 配置。 +:::note +本页中的“**插件**”指 ChatGPT 界面里的连接入口,不是 [AgentDock Plugin 扩展包](../concepts/plugins.md)。 +::: + ## 快速上手(Windows / macOS 图形应用) 请先根据 [Windows 安装](../getting-started/windows.md) 或 [macOS 安装](../getting-started/macos.md) 指引完成 AgentDock 安装。 @@ -21,8 +25,12 @@ Windows 和 macOS 图形安装程序已自动集成 Cloudflare Tunnel 与 OAuth - 还没有域名、想先连通测试时,选择 **临时公网地址**。 - 有自己的域名、希望长期稳定使用时,建议选择 **使用自己的 Cloudflare 域名**。 +
+ ![安装时选择临时公网地址或固定 Cloudflare 域名](/img/guides/chatgpt/01-install-connection-option.png) +
+ :::tip 教学和第一次连接时,临时 `trycloudflare.com` 地址就够用。临时地址可能在 Windows 或 Tunnel 重启后变化;变化后请从控制面板复制新的公网地址,并更新 ChatGPT 插件中的旧地址。 ::: @@ -36,8 +44,12 @@ Windows 和 macOS 图形安装程序已自动集成 Cloudflare Tunnel 与 OAuth - **公网 MCP 地址**,以 `/mcp` 结尾 - **OAuth 密码** +
+ ![控制面板概览页中的公网 MCP 地址和 OAuth 密码](/img/guides/chatgpt/02-copy-public-url-oauth.png) +
+ 凭据默认会被遮罩,需要时再点击“显示”。不要把密码放进截图、Issue 或公开聊天。 :::warning @@ -49,12 +61,20 @@ Windows 和 macOS 图形安装程序已自动集成 Cloudflare Tunnel 与 OAuth 1. 在浏览器中打开 ChatGPT。 2. 进入 **设置 > 插件 > 高级设置**,开启 **开发人员模式**。 +
+ ![ChatGPT 设置 > 插件中开启开发人员模式](/img/guides/chatgpt/03-chatgpt-developer-mode.png) +
+ 3. 返回 ChatGPT 首页的插件页面,点击 **➕** / **创建插件**。 +
+ ![ChatGPT 插件页面并高亮添加按钮](/img/guides/chatgpt/04-plugins-add-button.png) +
+ 4. 插件名称填写 `AgentDock`。 5. MCP Server URL 填写刚才复制的公网地址,例如: @@ -62,13 +82,21 @@ Windows 和 macOS 图形安装程序已自动集成 Cloudflare Tunnel 与 OAuth https://your-public-host.example/mcp ``` +
+ ![创建插件对话框中填写名称和公网 MCP 地址](/img/guides/chatgpt/05-fill-name-and-url.png) +
+ 6. 点击创建并发起连接。 7. 浏览器跳转到 AgentDock 授权页后,填入刚才复制的 OAuth 密码并完成授权。 +
+ ![AgentDock 授权页输入 OAuth 密码](/img/guides/chatgpt/06-create-enter-password.png) +
+ 8. 返回 ChatGPT,确认 AgentDock 插件已经可用。 ChatGPT 会自动发现 AgentDock 的 OAuth 元数据、注册客户端,并通过浏览器完成授权。不需要手工填写 Client ID、Client Secret、授权地址或 Token 地址。 @@ -97,12 +125,12 @@ ChatGPT 会自动发现 AgentDock 的 OAuth 元数据、注册客户端,并通 1. **公网 HTTPS 访问**:AgentDock 必须部署在 ChatGPT 可访问的公网地址,且公网入口配置有效 HTTPS 证书。 2. **MCP 地址格式**:MCP 地址必须以 `/mcp` 结尾(例如 `https://agentdock.example.com/mcp`)。 -3. **启用 OAuth**:需配置 `AGENTDOCK_OAUTH_ENABLED=true`、`AGENTDOCK_SERVER_URL`、`AGENTDOCK_OAUTH_PASSWORD` 与 `AGENTDOCK_OAUTH_TOKEN_SECRET`。完整环境变量字典与密钥生成说明见 [OAuth 配置](../reference/configuration.md#oauth-配置)。 +3. **启用 OAuth**:需配置 `AGENTDOCK_OAUTH_ENABLED=true`、`AGENTDOCK_SERVER_URL`、`AGENTDOCK_OAUTH_PASSWORD` 与 `AGENTDOCK_OAUTH_TOKEN_SECRET`。完整环境变量字典与密钥生成说明见 [OAuth 配置](../reference/configuration.md)。 4. **代理路由转发**:反向代理需原样转发 `/mcp`、`/register`、`/oauth/*` 和 `/.well-known/*`。 修改环境变量配置后重启 AgentDock(例如 `sudo systemctl restart agentdock` 或 `docker compose up -d`)。 -完整的 VPS 部署流程见 [Linux 手动部署](../getting-started/vps.md)。 +完整的 VPS 部署流程见 [Linux 与服务器](../operations/linux.md)。 ## 验证 OAuth 入口 @@ -159,4 +187,4 @@ OAuth 授权成功时,`POST /oauth/authorize` 会返回 `302` 跳转到 ChatGP - 反向代理不要记录 Authorization Header、OAuth Code 或请求正文。 - AgentDock 会以其运行用户或容器权限操作真实资源,只授予完成任务所需的目录和命令权限。 -完整环境变量说明见 [配置参考](../reference/configuration.md#oauth-配置),不使用桌面安装程序时的公网部署见 [Linux 手动部署](../getting-started/vps.md)。 +完整环境变量说明见 [配置参考](../reference/configuration.md),不使用桌面安装程序时的公网部署见 [Linux 与服务器](../operations/linux.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/coding-agents.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/coding-agents.md index 266c621..5d126b4 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/coding-agents.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/coding-agents.md @@ -1,93 +1,92 @@ # 使用本地 Coding Agent -AgentDock 可以通过 ACP(Agent Client Protocol)把 MCP 客户端连接到本地 Coding Agent,让 ChatGPT 或其他 MCP 客户端把编码任务交给项目所在电脑上的 Codex、Claude、Grok Build 或自定义 ACP Adapter。 +AgentDock 可以把 ChatGPT 或其他 MCP 客户端里的编码任务交给项目所在电脑上的本地 Coding Agent。它可以是 Codex、Claude、Grok Build,也可以是自定义编码工具。 -ACP 是可选能力,默认关闭。 +这项功能默认关闭。只有需要让 AgentDock 调用本机编码工具处理仓库任务时再启用即可。 -## 支持的 Profile +## 可以使用哪些编码工具 -macOS 和 Windows 应用提供内置 Profile,也支持自定义 Adapter: +AgentDock 已提供以下选项: -| Profile 类型 | AgentDock 使用的本地 Adapter | -| --- | --- | -| Codex | `codex-acp` 或 `@agentclientprotocol/codex-acp` 包 | -| Claude | `claude-agent-acp` 或 `@agentclientprotocol/claude-agent-acp` 包 | -| Grok Build | `grok agent stdio` | -| Custom | Adapter 的绝对可执行路径和可选参数 | +- **Codex** +- **Claude** +- **Grok Build** +- **自定义编码工具** -内置 Profile ID 固定为 `codex`、`claude`、`grok`,因此每个内置类型只有一个 Profile;Custom 可以用不同 ID 创建多个 Profile。已启用的 Profile 中会选一个默认项,也可以在调用时用 `profile_id` 明确选择其他 Profile。 +启用后选择一个作为默认编码工具即可。你也可以添加多个自定义工具,并在某次任务中直接说明希望使用哪一个。 -启用 Adapter 前,先安装并登录准备使用的 Provider。AgentDock 负责启动 Adapter,不管理 Provider 账号,也不会把 Provider 凭据复制进自己的配置。 +启用前,先在运行 AgentDock 的同一台电脑上安装并登录准备使用的编码工具。AgentDock 负责启动本地连接,但不会替你管理这些服务的账号,也不会把账号凭据复制到 AgentDock 配置中。 + +## 安装前准备 + +- **Codex**:安装并登录 Codex,同时还需要 `codex-acp`。 +- **Claude**:安装并登录 Claude Code,同时还需要 `claude-agent-acp`。 +- **Grok Build**:安装并登录 Grok,不需要额外的连接组件。 +- **自定义编码工具**:准备好可执行程序路径和需要的启动参数。 + +Codex 和 Claude 的连接组件通过 npm 安装,因此电脑上还需要 Node.js 和 npm: + +```bash +npm install -g @agentclientprotocol/codex-acp +npm install -g @agentclientprotocol/claude-agent-acp +``` + +如果系统级 npm 目录不可写,优先使用当前用户自己的 npm 安装目录,不要为了全局安装直接使用 `sudo npm`。 ## macOS 和 Windows -1. 在运行 AgentDock 的同一台电脑上安装目标 Coding Agent,以及它需要的 ACP Adapter。 +1. 按上面的说明准备好要使用的编码工具。 2. macOS 打开“高级设置”,Windows 打开 AgentDock 控制面板。 3. 启用 **Coding Agent (ACP)**。 -4. 新增或启用内置 Profile,或者为 Custom Profile 配置 Adapter 命令和参数。 -5. 从已启用 Profile 中选择一个默认项。 -6. 确认 AgentDock 能检测到 Adapter,保存设置,并让 AgentDock 重启 Core。 +4. 启用 Codex、Claude 或 Grok Build,或者添加一个自定义编码工具。 +5. 选择默认编码工具。 +6. 保存设置,让 AgentDock 完成重启。 +7. 重新连接 MCP 客户端,或者新建一个对话。 -重新连接 MCP 客户端后,`agentdock_context` 会返回 `default_profile` 和已启用的 `profiles`。当前连接的 `tools/list` 应包含 `acp_session`、`acp_prompt`、`acp_interaction`。 +使用图形应用时,通常不需要手工填写内部 ID,也不需要理解 ACP 的工具参数。 -## 可以直接提出什么任务 +## 直接提出编码任务 直接描述目标即可,例如: ```text -Use the local Coding Agent on this computer to inspect the repository, fix the failing tests, and verify the change. +使用这台电脑上的本地 Coding Agent 检查这个仓库,修复失败的测试,并在修改后完成验证。 ``` -AgentDock 对外只暴露精简的管理语义,不把 ACP 协议每个底层方法都映射成 action: - -- `acp_session`:`info`、`new`、`list`、`inspect`、`open`、`update`、`close`、`delete`。 -- `acp_prompt`:`start`、`events`、`cancel`。 -- `acp_interaction`:`list`、`respond`。 +如果启用了多个编码工具,也可以在任务里直接点名,例如: -`open` 会在内部处理 resume/load 协商;Adapter 支持时,`new` 可以通过 `from_session_id` 从另一个 managed session fork;`update` 负责修改 Adapter 声明的 session mode 或配置项。支持 steering 时由 Prompt 流程在内部处理,不提供单独的公开 steering action。 +```text +这个仓库任务用 Claude 处理,完成后验证修改结果。 +``` -长 Prompt 会异步启动并返回 Run ID,上游 Agent 持续读取有序事件,直到 Run 收敛。权限请求仍保持显式,只能选择 Adapter 当前提供且 AgentDock 本地策略允许的选项。 +AgentDock 会在后台处理本地会话和工具通信。遇到权限请求时,仍然需要从允许的选项中明确确认后才能继续。 -## 项目目录 +## 可以访问哪些项目 -Coding Agent session 可以使用 AgentDock 操作系统用户有权限访问的目录。AgentDock 不额外维护项目目录白名单。 +本地 Coding Agent 只能访问运行 AgentDock 的系统用户本来就有权限访问的目录。 -这不是操作系统沙箱。需要把 Coding Agent 限制在特定项目时,应通过操作系统账号、文件权限、容器挂载或其他宿主机边界实现。 +AgentDock 不会额外给编码工具增加一层操作系统沙箱。如果只希望它访问指定项目,应通过系统账号、文件权限、容器挂载等方式限制访问范围。 -## 无界面或服务部署 +## 确认是否可用 -没有桌面 UI 时,在 Core 启动环境中配置一个或多个 ACP Profile。例如 Codex Profile: +保存设置后重新连接客户端,可以先做一个不会修改文件的测试: -```bash -AGENTDOCK_ACP_ENABLED=true -AGENTDOCK_ACP_PROFILES_JSON='[{"id":"codex","kind":"codex","command":"/absolute/path/to/codex-acp","enabled":true}]' -AGENTDOCK_ACP_DEFAULT_PROFILE=codex +```text +使用本地 Coding Agent 查看这个仓库的结构并做一个简要说明,不要修改文件。 ``` -自定义 Adapter 使用 `kind=custom`、唯一 `id`、绝对路径 `command`,并按需配置 `args` 和 `env_from_env`。秘密值保留在宿主环境中;`env_from_env` 只映射变量名,不把秘密写进 Adapter 参数。 - -`AGENTDOCK_ACP_AGENT`、`AGENTDOCK_ACP_COMMAND`、`AGENTDOCK_ACP_ARGS_JSON`、`AGENTDOCK_ACP_ENV_FROM_ENV_JSON` 只用于旧单 Profile 配置的升级兼容。新配置应使用 `AGENTDOCK_ACP_PROFILES_JSON` 和 `AGENTDOCK_ACP_DEFAULT_PROFILE`。 - -## 验证连接 - -完整验证不能只看“配置已保存”: - -1. Adapter 命令真实存在,并且 AgentDock 运行用户可以执行。 -2. 配置变更后 AgentDock Core 健康。 -3. `agentdock_context` 显示预期的默认 Profile 和已启用 Profile。 -4. MCP 连接暴露 `acp_session`、`acp_prompt`、`acp_interaction`。 -5. `acp_session info` 能启动选中的 Adapter,并返回实际能力或认证方式。 +如果这个任务能够正常完成,就说明 AgentDock 已经可以启动所选编码工具并把结果返回到当前对话。 -使用非默认 Profile 时,其 session、prompt 和 interaction 后续调用要持续传同一个 `profile_id`。 +## 常见问题 -## 故障排查 +如果 Coding Agent 无法启动: -如果 Coding Agent 无法启用或启动: +- 确认编码工具已经安装并登录,而且与 AgentDock 运行在同一台电脑、同一个系统用户环境中。 +- 如果该工具需要 ACP 连接组件,确认它已经安装并能被 AgentDock 找到。 +- 确认 **Coding Agent (ACP)** 已启用,并且已经选择一个启用的默认编码工具。 +- 保存设置并让 AgentDock 重启,然后重新连接 MCP 客户端或新建对话。 +- 使用自定义编码工具时,检查配置的可执行文件路径和启动参数是否正确。 -- 分开确认 Provider CLI 和 ACP Adapter;找到 `codex` 不代表已经有 `codex-acp`,找到 `claude` 也不代表已经有 `claude-agent-acp`。 -- 在真正运行 AgentDock 的同一操作系统用户和服务环境中验证 Adapter,不要只在另一个交互 Shell 中测试。 -- 无界面部署要确认每个已启用 Profile 都有绝对可执行 `command`,并确认 `env_from_env` 引用的宿主变量真实存在。 -- 用 `agentdock_context` 确认目标 Profile 已启用,再用 `acp_session info` 直接测试 Adapter。 -- 如果客户端缓存了旧工具 Schema,启用 ACP 后刷新 AgentDock 连接并新建会话。 +## 高级与无界面配置 -公开工具契约见 [工具参考](../reference/tools.md#coding-agentacp),宿主配置见 [配置参考](../reference/configuration.md#coding-agentacp)。 +无界面部署、自定义连接命令、内部 ID、环境变量以及 ACP 底层会话工具都属于高级配置。需要这些内容时,查看 [配置参考](../reference/configuration.md) 和 [工具参考](../reference/tools.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/desktop-automation.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/desktop-automation.md deleted file mode 100644 index 096e8f8..0000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/desktop-automation.md +++ /dev/null @@ -1,57 +0,0 @@ -# macOS 桌面自动化 - -macOS Desktop Skill 可以让 Agent 观察当前登录桌面,并在你的授权范围内点击、输入、使用快捷键或拖拽。 - -Docker、远程 VPS、系统级后台服务和未登录会话不能控制真实 macOS 桌面。 - -## 1. 安装 AgentDock - -先按 [macOS 安装](../getting-started/macos.md) 在当前登录用户下运行 AgentDock。Docker、LaunchDaemon 和远程 Linux 实例都不能控制当前 Mac 桌面。 - -## 2. 安装 Desktop Skill - -把下面这句话发给已经连接 AgentDock 的客户端: - -```text -请读取官方 AgentDock Skills 目录中的 desktop 条目,审查软件包来源和权限,按其中的摘要校验软件包,然后安装它的当前内容: -https://raw.githubusercontent.com/uvwt/agentdock-skills/main/catalog.json -``` - -Desktop Skill 在 [uvwt/agentdock-skills](https://github.com/uvwt/agentdock-skills) 独立发布。目录可以包含发布者自己的版本/Release 元数据,以及下载地址和 SHA-256 摘要;但 AgentDock 对每个 managed Skill 名称只保留一份当前内容。安装后用 `agentdock_context` 确认 managed `desktop` 候选已经存在,并核对其 `content_digest`。更新时重新审查并安装目录中的新包即可,不存在单独的激活步骤。 - -## 3. 授予 macOS 权限 - -1. 为实际运行 AgentDock 的终端或托管应用授予“屏幕录制”权限。 -2. 需要点击和输入时,再授予“辅助功能”权限。 -3. 重启相关终端或应用,使权限生效。 - -只给实际运行 AgentDock 的应用授权,不要给无关程序开放这些权限。 - -## 怎样使用 - -可以直接提出目标: - -```text -查看当前窗口,并告诉我这个错误提示是什么。 -在这个应用里找到设置页面,但修改前先让我确认。 -把文本填入表单,不要点击最终提交。 -``` - -Agent 应先观察当前应用和窗口,再执行操作,最后重新观察或截图确认结果。 - -## 需要确认的操作 - -以下动作通常需要额外确认: - -- 发送消息、邮件或文件。 -- 删除内容。 -- 上传、付款或授权。 -- 修改系统权限和账号设置。 -- 使用剪贴板写入敏感信息。 - - -## 隐私 - -桌面截图可能包含通知、聊天、账号和文件内容。不要自动公开、同步或提交截图和运行产物。 - -Skill 开发说明见 [开发者指南](../contributing/development.md#skill-开发)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/fixed-domain.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/fixed-domain.md deleted file mode 100644 index 2aa89bb..0000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/fixed-domain.md +++ /dev/null @@ -1,162 +0,0 @@ -# 配置固定域名 - -如果希望 AgentDock 在电脑或 Tunnel 重启后仍保持同一个公网 MCP 地址,可以使用固定域名。AgentDock 通过 Cloudflare Named Tunnel 提供固定公网入口,不需要在路由器开放端口,也不需要自己维护公网 HTTPS 反向代理。 - -典型连接方式如下: - -```text -MCP 客户端 → https://agent.example.com/mcp → Cloudflare Tunnel → AgentDock -``` - -## 开始前准备 - -先准备好以下内容: - -- AgentDock 已经安装完成,并且本机访问正常。 -- 域名已经接入 Cloudflare。 -- 可以登录 [Cloudflare Zero Trust 控制台](https://one.dash.cloudflare.com/)。 -- 准备一个单独的子域名,例如 `agent.example.com`。 - -如果之前没有使用过 Cloudflare Tunnel,可以先查看 [Cloudflare Tunnel 官方文档](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/)。 - -## 1. 选择域名 - -建议使用单独的子域名,不要直接占用根域名。例如: - -```text -agent.example.com -``` - -后续在 Cloudflare 创建 Public Hostname,以及在 AgentDock 中填写公网地址时,都使用这个域名。 - -## 2. 创建 Cloudflare Tunnel - -打开 [Cloudflare Zero Trust 控制台](https://one.dash.cloudflare.com/),创建一个 Cloudflare Tunnel,并选择 Cloudflared 作为 Connector。 - -Cloudflare 会显示一条包含 Tunnel Token 的 Connector 命令。AgentDock 需要的是其中的 **Tunnel Token 本身**,不是整条命令。这个 Token 需要妥善保管,不要公开。 - -如果已经有一个准备给 AgentDock 使用的 Named Tunnel,也可以直接复用,不必重复创建。 - -## 3. 添加 Public Hostname - -在这个 Tunnel 中添加一个 Public Hostname: - -```text -Hostname agent.example.com -Service HTTP -``` - -Service URL 根据 AgentDock 的安装方式填写: - -| 安装方式 | Cloudflare Service URL | -| --- | --- | -| macOS、Windows 或原生 Linux | `http://127.0.0.1:8765` | -| Docker Compose | `http://agentdock:8765` | - -Path 保持为空。这里不要填写 `/mcp`:Cloudflare 应该转发整个 AgentDock 服务,`/mcp` 只在最后给 MCP 客户端使用时追加。 - -Docker 用户也可以直接查看 [Docker Named Tunnel 配置](../operations/docker.md#named-tunnel)。 - -## 4. 配置 AgentDock - -AgentDock 里的公网地址只填写 HTTPS Origin: - -```text -https://agent.example.com -``` - -不要追加 `/mcp`,也不要填写端口、查询参数或其他路径。 - -### macOS 控制面板 - -打开 AgentDock 控制面板,在 **公网访问** 中选择 **固定域名**,然后填写: - -```text -公网地址 https://agent.example.com -Tunnel Token -``` - -应用更改即可。AgentDock 会继续保持本机服务不直接暴露到公网,并通过 Named Tunnel 提供固定入口。 - -如果还没有安装后台服务,可以先查看 [macOS 安装](../getting-started/macos.md)。 - -### Windows 控制面板 - -打开 AgentDock 控制面板,进入 **公网访问** → **固定域名**,然后填写: - -```text -HTTPS 公网地址 https://agent.example.com -Tunnel Token -``` - -点击 **应用访问模式**。随后可以直接使用同一页面的 **测试当前公网地址** 验证配置。仅切换公网访问方式时,不需要重新运行安装器。 - -如果还没有安装 AgentDock,可以先查看 [Windows 安装](../getting-started/windows.md)。 - -### Linux 安装器 - -没有桌面控制面板的 Linux 安装可以重新运行 AgentDock 安装器,并选择“已有接入 Cloudflare 的域名”。按照提示填写同一个 HTTPS 公网地址和 Tunnel Token。 - -具体命令可以查看 [Linux 安装](../getting-started/linux.md)。 - -### Docker Compose - -先完成 Public Hostname 配置,再在 Docker 部署中填写固定公网地址和 Tunnel Token,并启动 Named Tunnel profile。 - -具体 Compose 配置和值请查看 [Docker Named Tunnel 配置](../operations/docker.md#named-tunnel)。 - -## 5. 验证固定域名 - -先访问公网健康检查地址: - -```text -https://agent.example.com/healthz -``` - -AgentDock 正常时会返回成功响应,其中包含 `ok: true`。 - -然后在 MCP 客户端中填写: - -```text -Transport Streamable HTTP -URL https://agent.example.com/mcp -Authentication Bearer Token or OAuth shown by AgentDock -``` - -Tunnel Token **不是** MCP 登录凭据。它只用于 Cloudflare 与 AgentDock 所在设备建立 Tunnel。MCP 客户端仍然使用 AgentDock 显示的 Bearer Token 或 OAuth 凭据。 - -## 地址对照 - -这三个地址用途不同: - -| 位置 | 示例 | 用途 | -| --- | --- | --- | -| Cloudflare Service URL | `http://127.0.0.1:8765` | 原生安装时 Cloudflare 转发到的本机地址 | -| AgentDock 公网地址 | `https://agent.example.com` | AgentDock 与 OAuth 使用的固定 HTTPS Origin | -| MCP 客户端地址 | `https://agent.example.com/mcp` | 填入 ChatGPT 或其他 MCP 客户端的地址 | - -Docker 部署只有第一项不同,需要使用 `http://agentdock:8765`。 - -## 常见问题 - -### 域名打不开 - -先确认 Cloudflare 中的 Tunnel 已连接,并且 Public Hostname 指向了正确的 Service URL。原生安装通常是 `http://127.0.0.1:8765`,Docker Compose 使用 `http://agentdock:8765`。 - -### Cloudflare 返回 502 - -说明 Tunnel 本身可以访问,但 Cloudflare 无法连接 AgentDock。确认 AgentDock 本机服务正在运行,并检查 Service URL 是否和安装方式一致。 - -### AgentDock 提示公网地址无效 - -这里只填写 HTTPS Origin,例如 `https://agent.example.com`。不要填写 `https://agent.example.com/mcp`。 - -### MCP 客户端要求认证 - -这是公网访问的正常行为。使用 AgentDock 显示的 Bearer Token 或 OAuth 凭据,不要把 Cloudflare Tunnel Token 填到 MCP 客户端中。 - -## 安全提醒 - -Tunnel Token、Bearer Token 和 OAuth 凭据都应当作为秘密信息保存,不要放进截图、Issue、聊天记录或 Git 仓库。 - -固定域名不会替代 AgentDock 自身认证。公网访问仍应保持 Bearer Token 或 OAuth 开启;准备把入口提供给其他人使用前,建议阅读 [安全模型](../operations/security.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/mcp-clients.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/mcp-clients.md index 1400255..eabdb22 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/mcp-clients.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/mcp-clients.md @@ -1,4 +1,4 @@ -# 在不同客户端中连接 AgentDock +# 在不同客户端中连接 AgentDock 通过 Streamable HTTP MCP 接入 Claude Desktop、ChatGPT、Claude Code、Cursor、VS Code、Codex、TRAE 和 WorkBuddy。本页示例统一使用: @@ -18,7 +18,7 @@ https://agentdock.example.com/mcp - AgentDock 已通过公网 HTTPS 域名提供服务。 - MCP 地址以 `/mcp` 结尾(例如 `https://agentdock.example.com/mcp`)。 -- 认证方式已就绪:远程客户端通常需要 OAuth 浏览器授权或通过 HTTP Header 传入 Bearer Token。具体环境变量配置见 [OAuth 配置](../reference/configuration.md#oauth-配置)。 +- 认证方式已就绪:远程客户端通常需要 OAuth 浏览器授权或通过 HTTP Header 传入 Bearer Token。具体环境变量配置见 [OAuth 配置](../reference/configuration.md)。 - 反向代理会转发 `/mcp`、`/register`、`/oauth/*` 和 `/.well-known/*`。 对于与 AgentDock 运行在同一台电脑上的本地客户端,也可以连接: @@ -53,7 +53,7 @@ Claude Desktop 是否支持自定义 MCP,以及可添加的服务器数量, ChatGPT 通过流式 HTTP MCP 连接 AgentDock,要求使用公网 HTTPS 地址并通过浏览器完成 OAuth 授权。自定义 MCP 插件需要在 ChatGPT 设置中开启开发人员模式。 -完整图文教程、连接模式与排障说明见 [使用 ChatGPT 连接 AgentDock](./chatgpt.md)。 +完整图文教程、连接模式与排障说明见 [使用 ChatGPT 连接](./chatgpt.md)。 ## Claude Code @@ -266,4 +266,4 @@ curl -fsS https://agentdock.example.com/.well-known/oauth-protected-resource/mcp 如果授权页面返回 `302`,通常表示 AgentDock 正在跳转回客户端,这是 OAuth 正常流程。页面没有继续跳转时,再检查反向代理是否保留 `Location` Header,以及客户端回调地址是否被浏览器或网络策略拦截。 -完整认证配置见 [配置](../reference/configuration.md#oauth-配置),公网部署见 [Linux 手动部署](../getting-started/vps.md)。 +完整认证配置见 [配置](../reference/configuration.md),公网部署见 [Linux 与服务器](../operations/linux.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/intro.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/intro.md index c6bdb21..2950682 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/intro.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/intro.md @@ -5,9 +5,9 @@ slug: /intro # AgentDock -AgentDock 让支持 MCP 的 AI 客户端可以在你的电脑或服务器上读取文件、执行命令、操作 Git、使用浏览器自动化并连接其他服务。 +AgentDock 把支持 MCP 的 AI 客户端连接到你的电脑和服务器,让它们可以操作文件、执行命令、使用 Git 和浏览器,并连接其他服务。 -可访问范围由运行 AgentDock 的系统用户、Docker 挂载目录和你启用的功能决定。 +AgentDock 本身不是聊天应用,也不负责模型推理。连接的 AI 客户端决定要做什么,AgentDock 在运行它的设备上执行被允许的操作。可访问范围由系统用户权限、Docker 挂载目录和你启用的功能决定。 ## 第一次使用 @@ -29,13 +29,13 @@ AgentDock 让支持 MCP 的 AI 客户端可以在你的电脑或服务器上读 - “检查这个项目为什么启动失败,并修好后验证。” - “读取这份仓库,修改代码并提交。” - “打开网页完成查询,并把结果整理成文件。” -- “安装并使用一个 Skill,或接入一个外部 MCP 服务。” +- “安装并使用一个 Skill、审查并安装一个 Plugin,或接入一个外部 MCP 服务。” - “控制浏览器、桌面自动化,或调用 Codex、Claude、Grok 等编码工具。” - “把长任务拆成步骤,并持续更新进度。” Agent 会根据任务选择合适的工具。 -如果主要想用网页版 ChatGPT 操控自己的电脑,安装时开启公网地址后,按 [使用 ChatGPT 连接 AgentDock](./guides/chatgpt.md) 继续即可。 +如果主要想用网页版 ChatGPT 操控自己的电脑,安装时开启公网地址后,按 [使用 ChatGPT 连接](./guides/chatgpt.md) 继续即可。 ## 数据保存在哪里 @@ -50,9 +50,10 @@ Docker 默认把这两类数据保存在 Docker volume。删除程序或容器 ## 常用入口 -- [在不同客户端中连接 AgentDock](./guides/mcp-clients.md) -- [使用 ChatGPT 连接 AgentDock](./guides/chatgpt.md) +- [在不同客户端中连接](./guides/mcp-clients.md) +- [使用 ChatGPT 连接](./guides/chatgpt.md) - [使用 Skill](./concepts/skills.md) +- [使用 Plugin](./concepts/plugins.md) - [任务与进度](./concepts/tasks.md) - [浏览器自动化](./guides/browser-control.md) - [使用本地 Coding Agent](./guides/coding-agents.md) diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/desktop.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/desktop.md new file mode 100644 index 0000000..85d2615 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/desktop.md @@ -0,0 +1,71 @@ +# 桌面端高级设置 + +普通安装请使用 [MacOS 安装](../getting-started/macos.md) 或 [Windows 安装](../getting-started/windows.md)。本页只保留安装完成后常用的高级设置和维护入口。 + +## 通用设置 + +桌面客户端已经可以管理大多数配置。通过 **公网访问** 和 **高级设置** 可以调整: + +- 本地端口和日志级别; +- 临时或固定公网访问; +- NexusDock 配对; +- 浏览器连接方式; +- 本地 Coding Agent; +- 聊天卡片显示方式; +- 登录时自动启动。 + +优先使用客户端提供的更新和日志入口,不要手动修改服务文件。公网地址见 [公网访问](./public-access.md),浏览器设置见 [使用浏览器](../guides/browser-control.md)。 + +## macOS + +需要自动化或命令行安装时: + +```bash +curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ + -o /tmp/agentdock-install.sh +sh /tmp/agentdock-install.sh --register-service +``` + +常用覆盖包括 `--version vX.Y.Z` 和 `AGENTDOCK_INSTALL_DIR=`。CLI 默认安装到 `~/.local/bin/agentdock`。 + +默认用户数据: + +```text +~/.agentdock AgentDock 状态 +~/AgentDock 默认工作目录 +``` + +需要屏幕、键盘或鼠标自动化时,只给实际运行 AgentDock 的应用授予 **系统设置 → 隐私与安全性** 中对应的权限。 + +图形客户端可以直接更新。命令行安装也可以使用: + +```bash +agentdock update --check +agentdock update +``` + +卸载但保留用户数据: + +```bash +sh /tmp/agentdock-install.sh --uninstall +``` + +只有明确要同时删除 AgentDock 状态和默认工作目录时才使用 `--purge-data`。 + +## Windows + +需要自动化或无界面安装时,可以使用 Release 中的 PowerShell 安装脚本: + +```powershell +$script = Join-Path $env:TEMP 'install-agentdock.ps1' +Invoke-WebRequest ` + https://github.com/uvwt/agentdock/releases/latest/download/install.ps1 ` + -OutFile $script +powershell -ExecutionPolicy Bypass -File $script -RegisterStartup +``` + +默认安装和运行目录为 `%LOCALAPPDATA%\AgentDock`。日常更新和配置修改优先使用 AgentDock 控制面板。 + +安装 WSL 后,文件和命令工具可以通过 `runtime=wsl` 使用 Linux 环境。WSL 文件操作需要目标发行版安装 `python3`。 + +卸载时使用 **设置 → 应用 → 已安装的应用**,或开始菜单中的 **Uninstall AgentDock**。卸载程序会让你选择是否同时删除保留的 AgentDock 数据。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/docker.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/docker.md index 73feebb..19996c4 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/docker.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/docker.md @@ -1,133 +1,46 @@ -# Docker 进阶配置 +# Docker -本页介绍镜像类型、Cloudflare Tunnel、修改端口、挂载宿主目录、版本更新和旧数据迁移。 +首次安装请看 [Docker 安装](../getting-started/docker.md)。本页只保留安装完成后最常修改的配置。 -AgentDock 只使用一份 `docker-compose.yml`。浏览器镜像和 Cloudflare Tunnel 等可选能力通过环境变量与 Compose profile 启用,不再需要额外的 Compose 叠加文件。 +## 镜像 -## 镜像类型 +AgentDock 为 `amd64` 和 `arm64` 提供这些 Linux 镜像: -AgentDock 发布三种 `linux/amd64` 和 `linux/arm64` 镜像: - -| 标签 | 适用场景 | +| 镜像 | 用途 | | --- | --- | -| `latest` / `vX.Y.Z` | 默认运行镜像,适合普通使用 | -| `dev-latest` / `dev-vX.Y.Z` | 额外包含 Go、C、C++ 和 `pkg-config` 构建链 | -| `browser-latest` / `browser-vX.Y.Z` | 额外包含用于浏览器自动化的 Chromium | - -默认 Compose 使用正式运行镜像。需要在容器内编译 Go 或原生扩展时,可以在 `.env` 中增加: - -```dotenv -AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:dev-vX.Y.Z -``` - -然后重建容器: - -```bash -docker compose up -d --force-recreate -``` - -`dev` 和 `browser` 是不同用途的镜像;browser 镜像不默认包含 Go 编译器。 - -## 启用浏览器自动化 +| `latest` / `vX.Y.Z` | 普通运行环境 | +| `dev-latest` / `dev-vX.Y.Z` | 增加 Go 和原生编译工具 | +| `browser-latest` / `browser-vX.Y.Z` | 增加 Chromium 浏览器自动化 | -在 `.env` 中切换到浏览器镜像并打开浏览器工具: +通过 `.env` 选择其他镜像: ```dotenv AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:browser-latest AGENTDOCK_BROWSER_ENABLED=true ``` -然后重建: - -```bash -docker compose up -d --force-recreate -``` - -Compose 已为 Chromium 配置 1 GB `shm_size`。浏览器 profile、截图和会话状态仍保存在 AgentDock 数据卷中。 - -浏览器会话应使用独立 `profile_id`,不要挂载日常浏览器的完整用户目录。 - -## Cloudflare Tunnel - -Tunnel 服务写在同一份 `docker-compose.yml` 中,通过 Compose profile 启用。可选变量可参考仓库中的 [`.env.example`](https://raw.githubusercontent.com/uvwt/agentdock/main/.env.example)。 - -### Quick Tunnel - -```bash -docker compose --profile cloudflare-quick up -d -docker compose logs -f cloudflared-quick -``` - -日志中的地址是临时地址,重启后会变化。客户端配置时追加 `/mcp`,认证继续使用 `.env` 中的 Bearer Token。 +浏览器行为见 [使用浏览器](../guides/browser-control.md)。 -### Named Tunnel +## 端口与数据 -先按 [固定域名配置教程](../guides/fixed-domain.md) 完成 Cloudflare 侧设置。然后把得到的公网地址和 Tunnel Token 补充到现有部署 `.env`,不要覆盖当前 AgentDock Token: - -```dotenv -AGENTDOCK_SERVER_URL=https://agent.example.com -TUNNEL_TOKEN=replace-with-cloudflare-tunnel-token -``` - -限制 `.env` 权限后启动 named profile: - -```bash -chmod 600 .env -docker compose --profile cloudflare-named up -d -``` - -Cloudflare 侧使用固定域名教程中的 Docker Service URL。Compose 只把 `TUNNEL_TOKEN` 传给 `cloudflared-named` 容器;AgentDock 容器只接收 `AGENTDOCK_SERVER_URL` 和自身认证 Token,不会接收 Tunnel Token。Token 通过容器环境提供,不会出现在 `cloudflared` 命令参数中。 - -同一时间只启用一种 Tunnel profile。停止整个部署、移除 Tunnel 容器并保留 AgentDock 数据: - -```bash -docker compose \ - --profile cloudflare-quick \ - --profile cloudflare-named \ - down -``` - -## 修改本机端口 - -默认 MCP 地址是 `http://127.0.0.1:8765/mcp`(宿主机与容器内都使用 `8765`)。端口冲突时,在 `.env` 中增加: +默认 MCP 地址为 `http://127.0.0.1:8765/mcp`。修改宿主机端口: ```dotenv AGENTDOCK_PUBLISH_PORT=18767 ``` -然后重新启动: - -```bash -docker compose up -d --force-recreate -``` - -新的 MCP 地址将变为 `http://127.0.0.1:18767/mcp`。 - -默认只监听本机回环地址。不要为了方便直接改成 `0.0.0.0`;需要局域网或公网访问时,先阅读 [安全模型](./security.md)。 - -## 数据保存在哪里 - -默认 Compose 使用两个 Docker named volume: +默认 Compose 使用两个持久化卷: ```text agentdock_home -> /home/agentdock/.agentdock agentdock_workspace -> /home/agentdock/AgentDock ``` -- `agentdock_home`:任务、Skill、动态 MCP、环境配置和运行产物。 -- `agentdock_workspace`:文件、命令和 Git 工具的默认工作目录。 - -查看实际卷名: - -```bash -docker compose config --volumes -``` - `docker compose down` 不会删除这些数据。 -## 挂载宿主项目目录 +## 挂载宿主机项目 -需要让 AgentDock 直接操作宿主项目时,可以把工作目录改成 bind mount: +需要直接操作宿主机文件时,可以把 workspace volume 换成 bind mount: ```yaml services: @@ -137,104 +50,34 @@ services: - ./AgentDock:/home/agentdock/AgentDock ``` -Linux 主机应确保容器用户 UID/GID `10001` 可以写入该目录: +Linux 上要确保容器 UID/GID `10001` 对挂载目录有写权限。只挂载实际需要访问的路径。 -```bash -mkdir -p AgentDock -sudo chown -R 10001:10001 AgentDock -``` - -只挂载任务需要的目录。AgentDock 不把工作目录当成安全沙箱;容器能访问哪些文件,取决于你实际挂载了什么。 +## 公网访问 -## 固定版本 +保持普通服务只在本机可访问,需要远程连接时再使用受支持的 Cloudflare Tunnel profile。Tunnel 配置统一见 [公网访问](./public-access.md)。 -Compose 维护在仓库中,默认镜像标签为 `latest`。需要可复现部署时,请同时固定 Compose 的 git 修订(tag)和镜像标签。 - -从指定 git tag 下载 Compose: +## 更新与日志 ```bash -VERSION=vX.Y.Z -curl -fL "https://raw.githubusercontent.com/uvwt/agentdock/$VERSION/docker-compose.yml" \ - -o docker-compose.yml -``` - -Windows 用户可把 `curl -fL ... -o ...` 换成 `Invoke-WebRequest ... -OutFile ...`。 - -在 `.env` 中固定镜像标签(runtime 或 browser): - -```dotenv -AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:vX.Y.Z -# 浏览器镜像: -# AGENTDOCK_IMAGE=ghcr.io/uvwt/agentdock:browser-vX.Y.Z -# AGENTDOCK_BROWSER_ENABLED=true -``` - -## 更新 AgentDock - -```bash -curl -fL https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.yml \ - -o docker-compose.yml docker compose pull docker compose up -d --force-recreate -``` - -浏览器部署保留 `.env` 中的 `AGENTDOCK_IMAGE` 与 `AGENTDOCK_BROWSER_ENABLED`。Tunnel 部署在 `pull` 和 `up` 时继续带上同一 `--profile`。 - -更新后执行: - -```bash docker compose ps ``` -确认状态重新变为 `healthy`。 - -## 从 v0.4.1 或更早版本迁移 - -旧版 Compose 默认把 `./AgentDockHome` 和 `./AgentDock` 直接挂载到容器。已有数据时不要直接删除这两个目录。 - -可以继续使用原目录,但要把容器内路径改成新版位置: - -```yaml -services: - agentdock: - volumes: - - ./AgentDockHome:/home/agentdock/.agentdock - - ./AgentDock:/home/agentdock/AgentDock -``` - -Linux 主机还需要调整目录所有权: - -```bash -sudo chown -R 10001:10001 AgentDockHome AgentDock -``` - -确认新容器能看到原任务、Skill、MCP 配置和项目文件后,再决定是否迁移到 named volume。不要让两个运行中的 AgentDock 实例同时使用同一份状态目录。 - -## 查看日志与停止服务 +查看日志: ```bash -# 持续查看日志 docker compose logs -f - -# 停止并移除容器,保留数据 -docker compose down ``` -若启用了 Tunnel profile,这些命令也要带上同一 profile,例如: +停止容器但保留数据: ```bash -docker compose --profile cloudflare-named logs -f -docker compose --profile cloudflare-named down +docker compose down ``` -## 删除全部 Docker 数据 - -只有确认不再需要任务、Skill、MCP 配置和项目文件后,才执行: +只有明确要同时删除 AgentDock 状态和工作目录数据时才删除 volumes: ```bash docker compose down -v ``` - -:::danger -**不可恢复:**`-v` 会删除 Compose 创建的 named volume。执行前先备份需要保留的数据。 -::: diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/linux.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/linux.md index 4c75afb..9d58d7f 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/linux.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/linux.md @@ -1,199 +1,74 @@ -# Linux 进阶配置 +# Linux 与服务器 -本页介绍交互式安装、Cloudflare Tunnel、修改目录和端口、服务管理器、可选 NexusDock 配对,以及不注册系统服务的安装方式。 +普通 Linux 安装先看 [Linux 安装](../getting-started/linux.md)。本页只保留服务器部署和服务管理相关内容。 -## Alpine 与极简系统 +## 安装 -统一入口 `install.sh` 需要 POSIX Shell、Bash、CA 证书,以及 curl 或 wget。缺少时先安装: - -```sh -apk add --no-cache bash curl ca-certificates -``` - -然后继续运行下方相同的 `install.sh` 命令,不再提供单独的 bootstrap 安装器。 - -## 交互式安装 - -不设置 `AGENTDOCK_NONINTERACTIVE` 时,安装器会逐项询问配置: +公开安装脚本会自动识别架构,并可自动注册 systemd 或 OpenRC: ```bash curl -fsSL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ -o /tmp/install-agentdock.sh -sh /tmp/install-agentdock.sh -``` - -公开安装器会按当前架构使用预编译 Release 包。源码构建属于贡献者工作,不是安装器模式。 - -## Cloudflare Tunnel - -交互式安装会询问是否有已接入 Cloudflare 的域名: - -| 用户回答 | 安装器模式 | 结果 | -| --- | --- | --- | -| 有域名 | 固定(`named`) | 稳定 HTTPS 地址,适合长期客户端和 OAuth | -| 没有域名 | 临时(`quick`) | 自动生成 `trycloudflare.com` 地址,适合立即体验 | - -使用固定模式时,先按 [固定域名配置教程](../guides/fixed-domain.md) 完成 Cloudflare 侧设置,再在安装器提示时填写得到的 HTTPS 公网地址和 Tunnel Token。 - -临时模式会启动 `cloudflared`,从服务日志读取生成的地址,写入 `AGENTDOCK_SERVER_URL`,启用 OAuth,然后重启 AgentDock。两种模式都会生成或复用: - -- `AGENTDOCK_AUTH_TOKEN` -- `AGENTDOCK_OAUTH_PASSWORD` -- `AGENTDOCK_OAUTH_TOKEN_SECRET` - -完成框会显示公网地址、MCP 地址、Bearer Token 和 OAuth 登录密码。OAuth 签名密钥不会显示。Tunnel Token 只写入 root-only 的 `/etc/agentdock/cloudflared.env`,不会写入 `agentdock.env`、传给 AgentDock,也不会出现在 `cloudflared` 命令行中。 - -临时地址变化后,重新运行同一个安装脚本即可。现有监听地址、端口、高级配置、Bearer Token、OAuth 密码和签名密钥都会保留;已经配对的 NexusDock 设备身份位于 AgentDock 状态目录中,重新运行安装器不会替换它。安装器会自动回写新地址并重启 AgentDock。客户端仍需替换旧 MCP URL,并重新完成 OAuth 授权。 - -默认 Tunnel 服务名是 `agentdock-cloudflared`: - -```bash -# systemd -sudo systemctl status agentdock-cloudflared --no-pager -sudo journalctl -u agentdock-cloudflared -n 100 --no-pager - -# OpenRC -sudo rc-service agentdock-cloudflared status -sudo tail -n 100 /var/log/agentdock-cloudflared.log \ - /var/log/agentdock-cloudflared.err +sudo sh /tmp/install-agentdock.sh ``` -非交互安装默认保持本机访问;需要临时 Tunnel 时必须显式指定: - -```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_TUNNEL_MODE=quick \ - sh /tmp/install-agentdock.sh -``` +Alpine 等最小系统需要先安装 Bash、CA 证书以及 curl 或 wget。 -固定模式设置 `AGENTDOCK_TUNNEL_MODE=named`、`AGENTDOCK_SERVER_URL` 和 `AGENTDOCK_CLOUDFLARE_TUNNEL_TOKEN`。`AGENTDOCK_OAUTH_PASSWORD` 与 `AGENTDOCK_OAUTH_TOKEN_SECRET` 只在需要覆盖首次生成值时提供;否则由安装器自动生成。密钥应来自受保护环境或密钥管理器。 - -## 默认目录 +默认系统安装: ```text -安装目录 /opt/agentdock -运行数据目录 /srv/agentdock -环境文件 /etc/agentdock/agentdock.env -服务用户 agentdock -监听地址 127.0.0.1:8765 +程序 /opt/agentdock/bin/agentdock +运行数据 /srv/agentdock +环境文件 /etc/agentdock/agentdock.env +服务用户 agentdock +监听地址 127.0.0.1:8765 ``` -典型 systemd 安装会生成: - -```text -/opt/agentdock/bin/agentdock -/srv/agentdock/.agentdock -/srv/agentdock/AgentDock -/etc/agentdock/agentdock.env -/etc/systemd/system/agentdock.service -``` - -OpenRC 会改为创建 `/etc/init.d/agentdock`。 - -## 非交互配置 - -自动化部署时可以通过环境变量覆盖默认值: - -```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_RELEASE_VERSION=latest \ - AGENTDOCK_PORT=8765 \ - sh /tmp/install-agentdock.sh -``` - -常用变量: - -| 变量 | 用途 | -| --- | --- | -| `AGENTDOCK_RELEASE_VERSION` | `latest` 或 `vX.Y.Z` | -| `AGENTDOCK_SOURCE_DIR` | 二进制安装根目录 | -| `AGENTDOCK_DATA_DIR` | 状态和工作目录根目录 | -| `AGENTDOCK_ENV_FILE` | 服务环境文件 | -| `AGENTDOCK_SERVICE_NAME` | systemd/OpenRC 服务名 | -| `AGENTDOCK_SERVICE_USER` | 低权限运行用户 | -| `AGENTDOCK_SERVICE_MANAGER` | `auto`、`systemd`、`openrc` 或 `none` | -| `AGENTDOCK_HOST` | 监听地址 | -| `AGENTDOCK_PORT` | 监听端口 | -| `AGENTDOCK_AUTH_TOKEN` | 自定义 Bearer Token | -| `AGENTDOCK_TUNNEL_MODE` | `none`、`quick` 或 `named` | -| `AGENTDOCK_SERVER_URL` | Named Tunnel 和 OAuth 使用的固定 HTTPS Origin | -| `AGENTDOCK_CLOUDFLARE_TUNNEL_TOKEN` | Named Tunnel Token,只保存在 `cloudflared.env` | -| `AGENTDOCK_CLOUDFLARED_INSTALL_PATH` | 自定义 `cloudflared` 二进制路径 | +## 服务与日志 -不要把真实 Token 写进仓库。未提供 `AGENTDOCK_AUTH_TOKEN` 时,安装器会自动生成并写入 root-only 环境文件。 - -## 配对 NexusDock - -NexusDock 在 AgentDock 安装完成后单独配对,不再通过安装器环境变量配置。使用默认 Linux 服务用户和安装目录时,先在 **NexusDock → 设置 → 系统与节点** 生成一次性配对码,再执行: +systemd: ```bash -sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair --endpoint https://nexus.example.com --code +sudo systemctl status agentdock --no-pager sudo systemctl restart agentdock +sudo journalctl -u agentdock -f ``` -OpenRC 环境改为重启对应的 `agentdock` 服务。如果自定义了服务用户或安装目录,应使用实际值。不要重新写回旧 Nexus endpoint/token 环境变量。 - -## 不注册系统服务 - -不希望注册系统服务时: - -```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_SERVICE_MANAGER=none \ - sh /tmp/install-agentdock.sh -``` - -这种模式仍会安装 Release 运行时和随包发布的核心 Skill,但不会注册或启动系统服务;需要时手动运行 `/opt/agentdock/bin/agentdock`。 - -## 修改端口或 Token - -编辑环境文件: +OpenRC: -```bash -sudoedit /etc/agentdock/agentdock.env +```sh +sudo rc-service agentdock status +sudo rc-service agentdock restart ``` -修改后重启服务: +如果自行维护服务,建议让 AgentDock 只监听 loopback,并使用独立的低权限账号运行。环境配置放在受保护的服务环境文件中,不要直接写进 unit 命令行。 -```bash -sudo systemctl restart agentdock -sudo systemctl status agentdock --no-pager -``` +## 公网服务器 -OpenRC 使用: +远程使用时,建议让 AgentDock 保持监听 `127.0.0.1`,再通过可信反向代理或 Cloudflare Tunnel 提供 HTTPS。不要把明文 `/mcp` 直接暴露到公网。 -```sh -sudo rc-service agentdock restart -sudo rc-service agentdock status -``` +临时地址和固定域名见 [公网访问](./public-access.md),认证设置见 [配置参考](../reference/configuration.md)。 -## 查看日志 +## NexusDock -systemd: +AgentDock 安装完成后再进行 NexusDock 配对。使用默认服务账号时: ```bash -sudo journalctl -u agentdock -n 100 --no-pager -sudo journalctl -u agentdock -f +sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair \ + --endpoint https://nexus.example.com \ + --code +sudo systemctl restart agentdock ``` -OpenRC: - -```sh -sudo tail -n 100 /var/log/agentdock.log /var/log/agentdock.err -``` +完整配对流程见 [连接 AgentDock](./nexusdock-connect.md)。 ## 更新 -重新运行安装器即可替换二进制。运行数据和环境文件会保留。固定版本时设置: +标准安装可以使用: ```bash -sudo env \ - AGENTDOCK_NONINTERACTIVE=true \ - AGENTDOCK_RELEASE_VERSION=vX.Y.Z \ - sh /tmp/install-agentdock.sh +sudo /opt/agentdock/bin/agentdock update --check +sudo /opt/agentdock/bin/agentdock update ``` -需要完全自行维护 systemd、环境文件、反向代理和 OAuth 时,阅读 [Linux 手动部署](../getting-started/vps.md)。 +运行数据和服务环境与程序文件分开保存。更新后服务没有恢复正常时,查看 [故障排查](./troubleshooting.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/macos.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/macos.md deleted file mode 100644 index 9c582b2..0000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/macos.md +++ /dev/null @@ -1,142 +0,0 @@ -# macOS 进阶配置 - -推荐通过 [macOS 图形应用](../getting-started/macos.md)安装和管理 AgentDock。本页用于命令行安装、指定版本、自定义目录、管理文件、服务检查和卸载。 - -## 优先使用图形应用 - -主窗口已经提供状态、连接地址、凭据、启动、停止、重启、核心更新和日志入口。“高级设置”可以管理端口、日志级别、NexusDock 接入、浏览器工具,以及两个互不影响的登录自启开关。 - -图形应用已经提供的设置不要再手工编辑 `agentdock.env` 或 LaunchAgent。应用会校验输入、以私有权限原子写入配置、重启并执行健康检查;新配置无法启动时会自动恢复旧配置。 - -## 命令行安装 - -自动化或自定义目录时仍可使用命令行安装器: - -```bash -curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ - -o /tmp/agentdock-install.sh -sh /tmp/agentdock-install.sh --register-service -``` - -## 把 AgentDock 加入 PATH - -安装器默认把二进制放到 `~/.local/bin`。希望直接执行 `agentdock` 时: - -```bash -echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile -source ~/.zprofile -``` - -随后可以直接运行: - -```bash -agentdock -``` - -## 安装指定版本 - -```bash -sh /tmp/agentdock-install.sh --register-service --version vX.Y.Z -``` - -## 修改安装目录 - -```bash -AGENTDOCK_INSTALL_DIR="$HOME/bin" \ - sh /tmp/agentdock-install.sh --register-service -``` - -修改目录后要确保该目录已经加入 PATH,或始终使用完整路径启动。 - -## 后台运行 - -图形应用会自动安装当前用户的 LaunchAgent。“高级设置”中的“登录后自动启动 AgentDock 服务”控制核心服务,“登录后显示 AgentDock 菜单栏”只控制菜单栏应用;关闭其中一个不会修改另一个。 - -手工配置时,应使用当前登录用户的 LaunchAgent。涉及 Desktop Skill 时,AgentDock 必须运行在登录用户会话中,不能使用系统级 LaunchDaemon。 - -推荐固定以下内容: - -```text -程序路径 $HOME/.local/bin/agentdock -工作目录 $HOME/AgentDock -状态目录 $HOME/.agentdock -监听地址 127.0.0.1:8765 -``` - -启动配置中的 Token、OAuth Secret 或第三方凭据不应直接写入公开仓库。修改 LaunchAgent 后使用 `launchctl` 重新加载,并执行健康检查: - -```bash -curl -fsS http://127.0.0.1:8765/healthz -``` - -## 管理 Cloudflare Tunnel - -在图形应用中可自由切换仅本机、临时公网和固定域名。固定域名会复用已有 Tunnel Token,修改其他设置时不需要再次粘贴。 - -命令行安装器在使用 `--register-service` 且没有显式指定 Tunnel 时,只询问是否有已接入 Cloudflare 的域名。内部实现中,有域名对应 Named Tunnel,没有域名对应临时 Quick Tunnel。自动化仍可直接传入 `--tunnel quick`、`--tunnel named` 或 `--tunnel none`。 - -两种公网模式都会自动创建或复用 Bearer Token、OAuth 登录密码和 OAuth 签名密钥。临时安装会先用 Bearer 认证启动 AgentDock,取得生成的 `trycloudflare.com` 地址后写入 `AGENTDOCK_SERVER_URL`、启用 OAuth,再重启 AgentDock。完成框会显示公网地址、MCP 地址、Bearer Token 和 OAuth 登录密码;签名密钥保持私密。 - -安装器会把 AgentDock 与 `cloudflared` 注册为两个独立的用户级 LaunchAgent,只有 `cloudflared` 会读取 Named Tunnel Token。管理文件: - -```text -~/Library/Application Support/AgentDock/agentdock.env -~/Library/Application Support/AgentDock/cloudflared.env -~/Library/Application Support/AgentDock/start-cloudflared.sh -~/Library/LaunchAgents/com.uvwt.agentdock.cloudflared.plist -~/Library/Logs/AgentDock/cloudflared.out.log -~/Library/Logs/AgentDock/cloudflared.err.log -``` - -`agentdock.env` 与 `cloudflared.env` 权限均为 `0600`。AgentDock LaunchAgent 不会加载 Tunnel Token,Token 也不会写入 `ProgramArguments`。 - -查看服务和日志: - -```bash -launchctl print "gui/$(id -u)/com.uvwt.agentdock.cloudflared" -tail -f "$HOME/Library/Logs/AgentDock/cloudflared.err.log" -``` - -临时地址变化后,重新运行同一个安装命令即可。安装器会保留 Bearer Token、OAuth 密码和签名密钥,写入新地址并重启 AgentDock。随后在客户端替换 MCP URL,并重新完成 OAuth 授权。固定模式后续重跑会复用已有公网地址与 Tunnel Token。 - -## 浏览器自动化 - -启用浏览器工具时,macOS 图形应用会确认本机已经安装 Google Chrome、Chromium 或 Microsoft Edge。浏览器本身按正常方式安装和更新即可。 - -## 目录与权限 - -```text -~/.agentdock AgentDock 内部状态 -~/AgentDock 默认工作目录 -``` - -裸机进程能访问哪些文件,取决于当前 macOS 用户权限。不要给 AgentDock 运行用户授予不需要的目录访问权。 - -## Desktop Skill 权限 - -使用屏幕、键盘和鼠标自动化前,需要在“系统设置 → 隐私与安全性”中给实际托管 AgentDock 的终端或应用授予: - -- 辅助功能 -- 屏幕与系统音频录制 - -只给实际运行 AgentDock 的程序授权。更换终端、应用路径或代码签名后,macOS 可能要求重新授权。 - -具体步骤见 [macOS 桌面自动化](../guides/desktop-automation.md)。 - -## 更新 - -重新运行同一个 `install.sh` 入口即可升级。安装器会事务性准备目标 Release、同步随 Release 发布的核心 Skill、验证新运行环境,并保留 AgentDock 状态和默认工作目录。安装失败由安装器执行回滚,不需要用户维护可选择的二进制或 Skill 历史版本。 - -## 卸载 AgentDock - -公开的 Unix 维护入口与安装时相同,统一使用 `install.sh`;AgentDock Release 不再单独发布 macOS 卸载脚本。需要时重新下载当前入口,然后执行: - -```bash -curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ - -o /tmp/agentdock-install.sh -sh /tmp/agentdock-install.sh --uninstall -``` - -普通 macOS 卸载会清理 AgentDock 后台服务、已安装 CLI/运行文件、图形应用以及 AgentDock 应用日志/配置,但保留 `~/.agentdock` 与 `~/AgentDock` 用户数据。 - -只有明确要把这些保留的 AgentDock 状态和默认工作目录内容也删除时才使用 `--purge-data`。自定义布局执行破坏性 purge 时要求显式提供用户数据路径,避免把继承的环境值误当成删除目标。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock-connect.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock-connect.md new file mode 100644 index 0000000..5f8ebe3 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock-connect.md @@ -0,0 +1,40 @@ +# 连接 AgentDock + +NexusDock 启动后,在这里完成 AgentDock 设备配对和 MCP 客户端连接。 + +## 配对 AgentDock 设备 + +登录 Web 控制台,打开 **设置 → 系统与节点**,点击 **配对设备**。 + +NexusDock 会生成一次性配对码,并给出命令行示例: + +```bash +agentdock nexus pair --endpoint https://nexus.example.com --code pair_xxx +``` + +如果使用 Windows 或 macOS 桌面版 AgentDock,可以直接在图形界面的 NexusDock 配对区域填写 **NexusDock 地址** 和 **一次性配对码**,然后点击 **配对并重启**,无需手动执行上面的命令。 + +Linux、服务器或其他命令行环境可以使用上面的命令完成配对。配对后 AgentDock 会连接 NexusDock,因此设备本身不需要开放公网入站端口。 + +配对不会改变节点原有的本地 MCP 地址或认证方式,每台 AgentDock 仍然可以独立使用。 + +## 连接 MCP 客户端 + +NexusDock 提供统一的 MCP 地址: + +```text +https://your-nexus-domain/mcp +``` + +支持 OAuth 的客户端可以直接连接,并在浏览器中完成授权。 + +如果客户端需要固定 Token,打开 **设置 → MCP 接入**,使用页面中的 MCP Access Token。 + +两种凭据用途不同: + +| 凭据 | 用途 | +| --- | --- | +| 管理员账号 / 密码 | 登录 Web 控制台 | +| MCP Access Token | 不使用 OAuth 时连接 `/mcp` | + +不同客户端的具体接入方式见 [在不同客户端中连接](../guides/mcp-clients.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock.md index f6576bc..e1dd619 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/nexusdock.md @@ -1,155 +1,64 @@ -# 部署 NexusDock +# 安装与维护 -NexusDock 是独立于 AgentDock 的自托管中心服务。需要统一 Web 控制台、共享 Recall / Workflow,或希望用一个 MCP 入口访问多台 AgentDock 时,再部署 NexusDock。 +最简单的安装方式是使用 Docker Compose。 -产品边界和日常使用见 [NexusDock](../concepts/nexusdock.md)。本页只介绍一套精简、偏生产环境的 Docker 部署方式。 +## 开始前 -## 部署前准备 +在宿主机安装 Docker Engine 和 Docker Compose。 -需要准备: +## 创建 `compose.yaml` -- Docker Engine 与 Docker Compose。 -- 能长期保存 `nexus-data` 和 `recall` 的宿主机。 -- 远程使用时准备一个 HTTPS 地址,例如 `https://nexus.example.com`。 - -官方镜像同时发布到 Docker Hub 与 GHCR,并支持 `linux/amd64` 和 `linux/arm64`。下面的示例固定使用 NexusDock `0.2.0`,避免生产环境隐式跟随 `latest`。 - -## 创建部署目录 - -创建持久化目录: - -```bash -mkdir -p nexusdock/nexus-data nexusdock/recall -cd nexusdock -``` - -Linux 使用宿主机目录挂载时,让镜像内用户拥有写权限: - -```bash -sudo chown -R 10001:10001 nexus-data recall -``` - -生成一个用于程序化 `/v1` API 的随机 Token: - -```bash -openssl rand -hex 32 -``` - -新建 `.env`: - -```dotenv -NEXUS_AUTH_TOKEN= -NEXUS_PUBLIC_URL=https://nexus.example.com -NEXUS_AUTH_ALLOW_INSECURE_HTTP=false -NEXUS_TRUSTED_PROXIES=127.0.0.1,::1 -``` - -`NEXUS_PUBLIC_URL` 必须是纯 HTTPS Origin,不能附带路径、查询参数或 Fragment。只在本机临时通过 HTTP 试用时,可以留空 `NEXUS_PUBLIC_URL` 并设置 `NEXUS_AUTH_ALLOW_INSECURE_HTTP=true`;远程使用不要保留这个设置。 - -新建 `compose.yaml`: +新建一个 NexusDock 目录,并创建 `compose.yaml`: ```yaml services: nexusdock: - image: agentdockio/nexusdock:0.2.0 - container_name: nexusdock + image: agentdockio/nexusdock:latest restart: unless-stopped - read_only: true - cap_drop: - - ALL - security_opt: - - no-new-privileges:true ports: - "127.0.0.1:18777:18777" - tmpfs: - - /tmp:rw,noexec,nosuid,size=64m,uid=10001,gid=10001,mode=0700 volumes: - - ./nexus-data:/var/lib/nexus - - ./recall:/recall - environment: - NEXUS_AUTH_TOKEN: ${NEXUS_AUTH_TOKEN} - NEXUS_REQUIRE_AUTH: "true" - NEXUS_AUTH_ALLOW_INSECURE_HTTP: ${NEXUS_AUTH_ALLOW_INSECURE_HTTP:-false} - NEXUS_PUBLIC_URL: ${NEXUS_PUBLIC_URL:-} - NEXUS_DATA_DIR: /var/lib/nexus - RECALL_REPO_DIR: /recall - NEXUS_TRUSTED_PROXIES: ${NEXUS_TRUSTED_PROXIES:-127.0.0.1,::1} + - nexus-data:/var/lib/nexus + - recall:/recall +volumes: + nexus-data: + recall: ``` -也可以使用 GHCR: +也可以使用 `ghcr.io/uvwt/nexusdock:latest`。官方镜像支持 `linux/amd64` 和 `linux/arm64`。 -```yaml -image: ghcr.io/uvwt/nexusdock:0.2.0 -``` +## 创建管理员并启动 -## 初始化管理员 - -第一次登录前先创建管理员账号: - -```bash -docker compose run --rm nexusdock admin init owner -``` - -命令会在终端中交互输入密码,并把凭据记录写入 NexusDock 的持久化数据库。不要把管理员密码写进 `.env`。 - -启动 NexusDock 并检查健康状态: +执行: ```bash +docker compose run --rm nexusdock admin init admin docker compose up -d -curl http://127.0.0.1:18777/health -``` - -然后打开已经配置好的 HTTPS 地址;如果只是本机试用,也可以打开 `http://127.0.0.1:18777`。 - -## 远程访问使用 HTTPS - -条件允许时继续让容器端口只绑定 `127.0.0.1`,再通过自己的 HTTPS 反向代理或 Tunnel 对外提供 NexusDock。`NEXUS_PUBLIC_URL` 应填写实际对外访问的 Origin。 - -`NEXUS_TRUSTED_PROXIES` 只加入你实际使用的代理。NexusDock 会信任这些来源提供的转发请求信息,范围过宽会削弱这一安全边界。 - -如果 MCP 客户端需要使用 NexusDock OAuth,或需要通过 NexusDock 下载 AgentDock 节点发布的临时 Artifact,正确的公网地址尤其重要。节点文件仍保存在源 AgentDock 上;NexusDock 代理下载期间源节点必须保持在线。 - -## 配对 AgentDock 节点 - -登录后打开 **设置 → 系统与节点**,点击 **配对设备**。NexusDock 会生成一个有过期时间、只能使用一次的命令,例如: - -```bash -agentdock nexus pair --endpoint https://nexus.example.com --code pair_xxx ``` -在目标设备执行命令并重启 AgentDock。节点会主动向 NexusDock 建立出站 WebSocket 连接,因此 AgentDock 节点本身不需要开放公网入站端口。 - -节点选择、Runtime 页面、Recall、Workflow 和 fleet 路由见 [NexusDock](../concepts/nexusdock.md)。 - -## 连接 MCP 客户端 - -统一 MCP 地址是: +然后打开: ```text -https://nexus.example.com/mcp +http://127.0.0.1:18777 ``` -支持 OAuth 的客户端可以通过浏览器授权。不支持 OAuth、需要固定 Bearer Token 的客户端,可以打开 **设置 → MCP 接入**,使用页面显示的专用 MCP Access Token。 +使用刚创建的管理员账号登录即可。 -不要混用三种凭据: +## 远程访问 -| 凭据 | 用途 | -| --- | --- | -| 管理员账号 / 密码 | 登录 Web 控制台 | -| `NEXUS_AUTH_TOKEN` | 程序化访问 `/v1` 管理 API | -| MCP Access Token | 只访问 `/mcp` | +需要远程使用时,通过 HTTPS 对外提供 NexusDock。HTTP 只用于 `localhost` / 回环地址访问。 -不同客户端的具体接入方式见 [连接 MCP 客户端](../guides/mcp-clients.md)。 +保持 Docker 端口绑定 `127.0.0.1`,再在前面使用自己的 HTTPS 反向代理或 Tunnel。复杂代理链和其他可选站点设置见 [NexusDock README](https://github.com/uvwt/nexusdock)。 -## 配置 AI 与向量检索 +## AI 与向量设置 -Embedding 是可选能力。不配置时,Recall 文件、关键词搜索、本地版本历史和普通 Workflow 浏览仍然可以正常使用。 +Embedding 和外部模型都是可选能力。不配置时,设备管理、MCP 路由、Recall 文件浏览、关键词搜索和基础 Workflow 仍然可以正常使用。 -部署完成后,优先在 **设置 → AI 与向量** 中配置 Stage 3 和共享 Embedding 服务。页面可以直接测试两个服务的连接,并重建 Recall / Workflow 向量索引,无需为了这些设置重启 NexusDock。 +需要语义 Recall 或 Workflow 向量匹配时,在 **设置 → AI 与向量** 中配置即可。 ## 升级 -先备份持久化数据,再把 `compose.yaml` 中的镜像标签改成目标版本,然后执行: +先备份持久化数据,然后执行: ```bash docker compose pull @@ -157,29 +66,33 @@ docker compose up -d curl http://127.0.0.1:18777/health ``` -生产环境建议固定具体版本。可用版本见 [NexusDock Releases](https://github.com/uvwt/nexusdock/releases)。 - -不要让两个 NexusDock 实例同时写同一份 `nexus-data`。 +不要运行两个 NexusDock 实例同时写同一份 Nexus 数据。 ## 备份与恢复 -至少同时备份两个持久化目录: +快速安装使用两个 Docker Volume 保存持久化数据: ```text -nexus-data/ 账号、已配对设备、设置、数据库和 NexusDock 密钥 -recall/ Recall 内容与本地 Git 历史 +nexus-data NexusDock 账号、设备、设置、密钥和 Workflow 数据 +recall Recall 内容与私密笔记数据 ``` -忘记管理员密码时,在部署主机上执行: +升级或迁移前同时备份这两个 Volume。如果你改成了宿主机目录挂载,则完整备份对应的两个目录。 + +忘记管理员密码时执行: ```bash -docker compose run --rm nexusdock admin recover owner +docker compose run --rm nexusdock admin recover ``` -排障可以先检查: +基础排障可以先检查: ```bash docker compose ps docker compose logs --tail=200 nexusdock curl http://127.0.0.1:18777/health ``` + +## 连接设备与客户端 + +安装完成后,继续阅读 [连接 AgentDock 与客户端](./nexusdock-connect.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/public-access.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/public-access.md new file mode 100644 index 0000000..6dcfd33 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/public-access.md @@ -0,0 +1,86 @@ +# 公网访问 + +AgentDock 保持本机使用最安全。只有远程 MCP 客户端需要连接时才开启公网访问。 + +| 模式 | 适合场景 | 地址 | +| --- | --- | --- | +| 仅本机 | 同一设备上的客户端 | `http://127.0.0.1:8765/mcp` | +| 临时公网地址 | 测试 | 自动生成的 `trycloudflare.com` 地址 | +| 固定域名 | 长期远程使用和 OAuth | 自己的 HTTPS 域名 | + +## 临时公网地址 + +macOS 和 Windows 客户端可以直接在 **公网访问** 中启用临时地址。Linux 安装器可以选择临时 Tunnel。Docker 可以启动 Quick Tunnel profile: + +```bash +docker compose --profile cloudflare-quick up -d +docker compose logs -f cloudflared-quick +``` + +临时地址在 Tunnel 重启后可能变化,变化后需要更新 MCP 客户端里的地址。 + +## 固定域名 + +固定域名使用 Cloudflare Named Tunnel。需要先准备: + +- 一个由 Cloudflare 管理的域名; +- 本机已经可以正常使用 AgentDock; +- 可以进入 Cloudflare Zero Trust 控制台。 + +### 1. 创建 Tunnel + +创建 Cloudflare Tunnel,并选择 **Cloudflared** 连接器。保存生成的 Tunnel Token,不要公开。 + +添加一个公网主机名,例如 `agent.example.com`,Service URL 填写: + +| 安装方式 | Cloudflare Service URL | +| --- | --- | +| macOS、Windows、原生 Linux | `http://127.0.0.1:8765` | +| Docker Compose | `http://agentdock:8765` | + +Cloudflare 的 Path 留空。`/mcp` 由 MCP 客户端添加,不写进 Tunnel 路由。 + +### 2. 配置 AgentDock + +AgentDock 中填写的公网地址只使用 HTTPS Origin: + +```text +https://agent.example.com +``` + +不要追加 `/mcp`。 + +macOS 或 Windows 打开 **公网访问 → 固定域名**,填写 HTTPS 公网地址和 Tunnel Token。 + +Linux 可以重新运行安装器,选择已有 Cloudflare 域名的选项。 + +Docker 在 `.env` 中加入: + +```dotenv +AGENTDOCK_SERVER_URL=https://agent.example.com +TUNNEL_TOKEN= +``` + +然后启动 Named Tunnel profile: + +```bash +docker compose --profile cloudflare-named up -d +``` + +## 验证 + +先检查公网健康地址: + +```text +https://agent.example.com/healthz +``` + +然后在 MCP 客户端中使用: + +```text +https://agent.example.com/mcp +``` + +MCP 认证继续使用 AgentDock 的 Bearer Token 或 OAuth。Cloudflare Tunnel Token 只用于 Tunnel,不能拿来登录 MCP。 + +连接失败见 [故障排查](./troubleshooting.md),认证设置见 [配置参考](../reference/configuration.md)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/security.md deleted file mode 100644 index d13251f..0000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/security.md +++ /dev/null @@ -1,70 +0,0 @@ -# 安全模型 - -AgentDock 是工具运行层,不是完整操作系统沙箱。安全性来自监听地址与认证、运行用户权限、Docker volume、systemd 服务用户、网络策略和每个工具自身的输入校验。 - -## 普通本机使用 - -只在自己的电脑上使用时,先遵守这些规则: - -- 保持监听地址为 `127.0.0.1`。 -- 不以管理员或 root 身份运行。 -- 只挂载或授权任务需要的目录。 -- 浏览器和桌面自动化使用独立 Profile,并对发送、删除、上传和授权操作进行确认。 -- 不把 `.env`、Token、Cookie、截图或私有日志提交到仓库。 - -需要局域网或公网访问时,再继续阅读认证和反向代理章节。 - -## 认证 - -- 只监听回环地址时,可以在受信本机环境中无认证运行。 -- 监听非回环地址时,必须配置 `AGENTDOCK_AUTH_TOKEN` 或启用 OAuth。 -- 公网入口必须使用 HTTPS,不要直接暴露明文 HTTP `/mcp`。 -- `/healthz` 只表示进程存活,不能证明 MCP 鉴权和工具调用正常。 -- 日志不应记录 Authorization Header、OAuth Code、工具参数正文或秘密值。 - -Bearer Token: - -```text -AGENTDOCK_AUTH_TOKEN= -``` - -OAuth: - -```text -AGENTDOCK_OAUTH_ENABLED=true -AGENTDOCK_SERVER_URL=https://agentdock.example.com -AGENTDOCK_OAUTH_PASSWORD= -AGENTDOCK_OAUTH_TOKEN_SECRET= -``` - -## 文件与命令边界 - -相对路径从 `~/AgentDock` 解析,但默认工作目录不是强安全边界: - -- 裸机部署受当前操作系统用户权限约束。 -- Docker 部署受 volume 和容器用户约束。 -- systemd 部署应使用专用低权限用户,并只授予必要项目目录权限。 -- Windows 使用受保护 DACL;WSL 运行时受所选发行版默认 Linux 用户权限约束。 - -不要以管理员或 root 身份运行 AgentDock,除非任务确实需要且环境已隔离。 - -## Skill 与动态 MCP - -- Skill 包不得包含 Token、Cookie、Session、私钥或设备登录态。 -- Skill 和 MCP 的秘密应使用各自独立环境管理入口保存。 -- `env_list` 只用于检查变量是否已配置,不应返回秘密值。 -- 外部 MCP Server 是独立信任边界;注册前应审查来源、传输方式和工具能力。 - -## 浏览器与桌面 - -- 浏览器使用独立 Profile,不复用日常主 Profile。 -- macOS Desktop Skill 运行在高权限登录会话中,只授予必要的屏幕录制和辅助功能权限。 -- 上传、发送、删除和授权等动作需要明确确认和操作后验证。 - -## 反向代理 - -只有反代确实位于可信网段并会重写 `X-Forwarded-For` 时,才设置 `AGENTDOCK_TRUSTED_PROXY_CIDRS`。不要信任来自公网客户端自行提供的代理 Header。 - -## Artifact - -截图和发布文件可能包含敏感信息。签名 URL 具有有效期,但在有效期内拿到链接的人仍可访问内容。发布前应检查文件内容,并避免公开浏览器登录态、桌面截图、环境文件和私有日志。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/troubleshooting.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/troubleshooting.md index b8dbd5b..3a82c1b 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/troubleshooting.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/troubleshooting.md @@ -1,101 +1,64 @@ # 故障排查 -## 先做这三步 +## 先检查这些 -1. 确认 AgentDock 进程或容器仍在运行。 -2. 使用安装指南中的端口访问 `/healthz`。 -3. 检查客户端 MCP 地址是否以 `/mcp` 结尾,以及 Token 是否与当前实例一致。 +先确认: -连接仍然失败时,记录以下信息再继续排查: +1. AgentDock 进程或容器仍在运行。 +2. 本机 `http://127.0.0.1:8765/healthz` 可以访问。 +3. MCP 客户端地址以 `/mcp` 结尾。 +4. 客户端使用的是当前 Bearer Token,或已经完成 OAuth。 +5. 实际运行的 AgentDock 版本就是你预期的版本。 -- 使用的安装方式和操作系统。 -- AgentDock 版本。 -- 客户端名称和 MCP 地址,隐藏 Token。 -- 服务日志中的具体错误。 -- 问题发生前最后一次修改。 +反馈问题时尽量提供安装方式、操作系统、AgentDock 版本、客户端名称和相关错误日志,并隐藏 Token 和私有地址。 -不要只提供“不能用”的截图,也不要公开环境文件或完整请求头。 +## 客户端已连接但看不到工具 -## 服务运行,但客户端看不到工具 +重新连接 MCP,或新建会话清理客户端缓存的旧工具 Schema。确认认证后,再实际完成一次 MCP 连接,不要只根据 `/healthz` 判断。 -先确认实际进程和健康状态: +## 401 Unauthorized -```bash -curl -fsS http://127.0.0.1:8765/healthz -``` - -然后检查: +确认客户端发送的是当前 Bearer Token,或重新完成 OAuth。如果经过反向代理,确认代理没有丢掉 `Authorization` header。 -1. 客户端 MCP URL 是否指向 `/mcp`。 -2. Bearer Token 或 OAuth 是否与服务端一致。 -3. 客户端是否仍缓存旧连接;重新连接或新建会话。 -4. 实际运行二进制是否是刚安装或刚更新的版本。 +## 公网地址无法访问 -`/healthz` 正常只代表进程存活,不能替代一次真实 MCP 初始化和工具调用。 +使用 Cloudflare Tunnel 时检查: -## 返回 401 Unauthorized +- Tunnel 是否在线; +- 原生安装通常转发到 `http://127.0.0.1:8765`; +- Docker 转发到 `http://agentdock:8765`; +- AgentDock 公网地址只填写 HTTPS Origin,不带 `/mcp`; +- MCP 客户端地址再追加 `/mcp`。 -- 确认服务是否配置 `AGENTDOCK_AUTH_TOKEN`。 -- 确认客户端发送 `Authorization: Bearer `。 -- 检查反代是否保留 Authorization Header。 -- 不要把 Token 粘贴到公开日志或 Issue。 +Cloudflare 返回 `502` 通常说明 Tunnel 本身可达,但无法连接本机 AgentDock。 -## Docker 仍运行旧镜像 - -从 `main` 重新下载最新 Compose 文件,再拉取和重建容器: +## Docker 仍在使用旧镜像 ```bash -curl -fL https://raw.githubusercontent.com/uvwt/agentdock/main/docker-compose.yml \ - -o docker-compose.yml docker compose pull docker compose up -d --force-recreate +docker compose ps ``` -浏览器部署保留 `.env` 中的 `AGENTDOCK_IMAGE` 与 `AGENTDOCK_BROWSER_ENABLED`。再检查 `docker compose ps`、`docker compose images` 和容器日志,确认镜像标签、摘要和健康状态符合预期。 - -## 动态 MCP 无法调用 - -依次检查: +新容器没有恢复 healthy 时查看 `docker compose logs`。 -1. `mcp_manage list` 中 Server 是否启用。 -2. `mcp_manage env_list` 中所需变量是否已配置。 -3. 更新环境后是否执行了 `refresh`。 -4. HTTP URL、stdio 命令、工作目录和上游服务是否可达。 -5. `mcp_tool_search` 能否列出工具,再用 `mcp_tool_inspect` 检查参数。 +## 动态 MCP 无法连接 -不要在错误信息中回显完整 Token、Cookie 或 Header。 +确认连接已经启用、所需环境变量已经配置,并且上游 URL 或本地命令可以访问。修改环境后重新刷新 MCP 连接。 -## 浏览器会话启动失败 +## 浏览器无法启动 -- 确认 AgentDock 所在主机已经安装 Chrome、Chromium 或 Microsoft Edge。 -- macOS 或 Windows 上重新打开 AgentDock 设置,确认界面能检测到受支持的浏览器。 -- Linux 或其他无图形界面的原生部署如果自动检测失败,可以设置 `AGENTDOCK_BROWSER_EXECUTABLE_PATH`。 -- Docker 环境通过 `AGENTDOCK_IMAGE` 选择 browser 镜像,并设置 `AGENTDOCK_BROWSER_ENABLED=true`。 -- 持久 Profile 损坏或不再需要时,换一个新的 `profile_id` 重试,不要把 AgentDock 指向日常浏览器主 Profile。 +确认已经安装 Chrome、Chromium 或 Edge。Docker 使用 browser 镜像并启用浏览器工具;原生无界面 Linux 自动识别失败时配置浏览器可执行文件路径。 -## 桌面操作没有效果 - -- 确认 AgentDock 在当前 macOS 登录会话中运行。 -- 检查屏幕录制和辅助功能权限。 -- 用 `agentdock_context` 找到当前 `desktop` Skill 候选,再重新读取宿主返回的 Skill 文件。 -- 操作前后分别观察应用状态或截图,不要只依赖命令返回成功。 -- 坐标可能因窗口位置、缩放或多显示器变化而失效,应优先使用辅助功能元素。 - -## Git push 失败 - -```bash -git remote -v -git status --short --branch -git config --show-origin --get credential.helper -``` +## macOS 桌面操作没有效果 -确认远端地址、当前分支、凭据和仓库权限。不要把访问 Token 写进 remote URL、README 或终端截图。 +确认 AgentDock 运行在当前登录会话中,并且实际承载 AgentDock 的应用已经获得屏幕录制和辅助功能权限。执行后重新检查屏幕状态,不要只看命令是否成功。 -## Linux 服务启动失败 +## Linux 服务无法启动 ```bash sudo systemctl status agentdock --no-pager sudo journalctl -u agentdock -n 100 --no-pager ``` -常见原因包括环境文件权限、二进制路径错误、端口占用、运行用户无权访问工作目录,以及非回环监听但未配置认证。 +常见原因包括端口冲突、环境变量错误、文件权限错误,或服务账号无法访问工作目录。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/windows.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/windows.md deleted file mode 100644 index b5a4908..0000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/windows.md +++ /dev/null @@ -1,124 +0,0 @@ -# Windows 进阶配置 - -推荐通过 [Windows 图形安装](../getting-started/windows.md)安装和管理 AgentDock。本页用于 PowerShell 自动化、固定版本、WSL、浏览器能力和手动卸载。 - -## 修改现有安装 - -重新运行最新版 Setup。检测到现有安装后: - -- 普通升级或修复:选择“直接升级并保留当前全部设置”。 -- 修改开机启动、核心权限或连接方式:选择“修改启动和连接设置”。 - -控制面板中的“公网访问”和“高级设置”也可以修改大多数日常配置,不需要重新安装。 - -## PowerShell 自动安装 - -PowerShell 入口面向自动化和高级用户。 - -```powershell -$script = Join-Path $env:TEMP 'install-agentdock.ps1' -Invoke-WebRequest ` - https://github.com/uvwt/agentdock/releases/latest/download/install.ps1 ` - -OutFile $script - -powershell -ExecutionPolicy Bypass ` - -File $script ` - -RegisterStartup ` - -Port 8765 -``` - -默认安装目录是 `%LOCALAPPDATA%\AgentDock`。`-RegisterStartup` 会在当前用户登录后启动 AgentDock;它不是登录前运行的系统服务。 - -本地连接信息通常为: - -```text -传输方式 Streamable HTTP -地址 http://127.0.0.1:8765/mcp -请求头 Authorization: Bearer -``` - -## Cloudflare Tunnel 自动化 - -可以使用以下参数跳过交互选择: - -```text --TunnelMode none 仅本机 --TunnelMode quick 临时公网地址 --TunnelMode named 固定 Cloudflare 域名 -``` - -固定域名还需要 `-ServerUrl` 和 Tunnel Token。不要把真实 Token 直接写进 Shell 历史,优先使用受保护的环境变量或 `-TunnelTokenFile`。 - -示例: - -```powershell -powershell -ExecutionPolicy Bypass ` - -File $script ` - -RegisterStartup ` - -TunnelMode named ` - -ServerUrl 'https://mini.example.com' ` - -TunnelTokenFile 'C:\secure\cloudflare-token.txt' -``` - -临时公网地址在 Tunnel 重启后可能变化。可以在控制面板或托盘中重新生成;Bearer Token 和 OAuth 凭据会保留,但客户端需要替换 MCP 地址,并按提示重新授权 OAuth。 - -## 安装指定版本 - -```powershell -powershell -ExecutionPolicy Bypass ` - -File $script ` - -Version vX.Y.Z ` - -RegisterStartup -``` - -普通升级直接使用 AgentDock 控制面板中的“更新”。只有需要恢复旧安装或明确安装固定版本时,才重新运行 Setup 或安装脚本。任务、Skill、配置和工作目录默认都会保留。 - -## 校验安装脚本 - -```powershell -$base = 'https://github.com/uvwt/agentdock/releases/latest/download' -$script = Join-Path $env:TEMP 'install-agentdock.ps1' -$checksum = "$script.sha256" - -Invoke-WebRequest "$base/install.ps1" -OutFile $script -Invoke-WebRequest "$base/install.ps1.sha256" -OutFile $checksum - -$expected = ((Get-Content -LiteralPath $checksum -Raw) -split '\s+')[0].ToLowerInvariant() -$actual = (Get-FileHash -LiteralPath $script -Algorithm SHA256).Hash.ToLowerInvariant() -if ($actual -ne $expected) { throw 'AgentDock installer checksum mismatch.' } -``` - -安装脚本还会校验下载的 AgentDock Release 包。 - -## WSL 运行时 - -已经安装 WSL 时,命令和文件工具可以显式选择 Linux 运行时: - -```json -{ - "runtime": "wsl", - "wsl_distribution": "Ubuntu" -} -``` - -`wsl_distribution` 可以省略,此时使用系统默认发行版。WSL 文件工具要求目标发行版安装 `python3`,路径使用 `/home/...`、`/mnt/d/...` 等 Linux 绝对路径。 - -## 浏览器能力 - -先安装 Google Chrome、Chromium 或 Microsoft Edge,再在 AgentDock 控制面板中启用浏览器工具。Windows 应用会自动检测受支持的浏览器。具体使用方式见 [浏览器自动化](../guides/browser-control.md)。 - -## 文件与凭据位置 - -默认运行目录: - -```text -%LOCALAPPDATA%\AgentDock -``` - -Bearer Token、OAuth 密码、OAuth 签名密钥和 Tunnel Token 使用当前用户凭据保护。不要复制或公开这些文件。 - -## 卸载 - -使用 Windows **设置 > 应用 > 已安装的应用**,或开始菜单中的“卸载 AgentDock”。已安装的卸载器是受支持入口,并会让用户选择是否同时删除保留的 AgentDock 任务、Skill、配置、浏览器状态和默认工作目录数据。 - -Release 中的 `install.ps1` 仍是安装/更新入口;AgentDock Release 不再提供单独下载的 `uninstall-windows.ps1`。自动化卸载应调用目标部署实际安装的产品卸载器,不要按仓库内部 helper 名称从 Release 下载脚本。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/configuration.md index a019597..820b395 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/configuration.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/configuration.md @@ -1,253 +1,87 @@ -# 配置 +# 配置参考 -AgentDock Core 不读取统一的 YAML、JSON 或 TOML 配置文件。运行参数来自环境变量,少量常用项也可以通过命令行参数覆盖;使用桌面安装包和控制面板时,应优先让图形界面管理这些设置。 +macOS 和 Windows 用户通常直接在 AgentDock 客户端中修改设置。本页主要用于无界面 Linux、Docker、自动化和高级配置。 -:::tip -首次安装请使用对应平台的安装指南。本页主要作为运行行为、无界面部署和高级配置的参考。 -::: +## 配置位置 -## 选择正确的配置入口 - -| 场景 | 推荐配置入口 | +| 环境 | 推荐配置位置 | | --- | --- | -| macOS 或 Windows 桌面应用 | AgentDock 控制面板 / 高级设置 | -| 直接前台运行 | 环境变量和受支持的 CLI 参数 | -| Docker 或 Compose | 容器 `environment`、`env_file` 或 secret 注入 | -| Linux 服务 | 权限受限的服务环境文件 | -| NexusDock | 使用 `agentdock nexus pair` 配对设备;不要再把旧 Nexus 凭据写进 Core 环境 | - -不要把 Token、密码、Cookie、私钥、OAuth Secret 或设备身份提交到源码仓库。 - -## 优先级与目录 - -普通 Core 运行配置按以下顺序解析: - -1. 内置默认值。 -2. 环境变量。 -3. 受支持的 CLI 参数。 +| macOS / Windows | AgentDock 客户端和高级设置 | +| Linux 服务 | 受保护的服务环境文件 | +| Docker | Compose `.env`、`environment` 或 secrets | +| 前台运行 | 环境变量和支持的 CLI 参数 | -CLI 只覆盖它实际提供的项目。例如在无界面部署中,认证秘密和 ACP Profile JSON 仍通过环境提供。 +CLI 参数会覆盖它对应的环境变量。 -两个主要目录由实际运行 AgentDock 的操作系统用户决定: +默认路径: ```text -~/.agentdock Internal state, managed Skills, tasks, MCP configuration, browser data, and artifacts -~/AgentDock Default working directory for relative file and command operations +~/.agentdock AgentDock 状态 +~/AgentDock 默认工作目录 ``` -需要更换位置时,将 `AGENTDOCK_HOME` 或 `AGENTDOCK_DEFAULT_DIR` 设为绝对路径。需要更强隔离时,应使用操作系统账号、权限或容器挂载,而不是把 AgentDock 路径配置当成沙箱。 +## 核心运行配置 -## CLI 参数 - -当前服务入口提供这些参数: - -| 参数 | 环境变量 | 默认值 | 用途 | +| 设置 | 环境变量 | CLI 参数 | 默认值 | | --- | --- | --- | --- | -| `--host` | `AGENTDOCK_HOST` | `127.0.0.1` | HTTP 监听地址 | -| `--port` | `AGENTDOCK_PORT` | `8765` | HTTP 端口,范围 `1`~`65535` | -| `--log-level` | `AGENTDOCK_LOG_LEVEL` | `info` | `debug`、`info`、`warn` 或 `error` | -| `--mcp-apps-enabled` | `AGENTDOCK_MCP_APPS_ENABLED` | `true` | 是否暴露可选 MCP Apps UI 资源与元数据 | -| `--browser-enabled` | `AGENTDOCK_BROWSER_ENABLED` | `false` | 是否暴露浏览器自动化工具 | -| `--browser-executable-path` | `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | 空 | Chrome、Chromium 或 Edge 可执行文件绝对路径 | -| `--browser-cdp-url` | `AGENTDOCK_BROWSER_CDP_URL` | 空 | 由用户配置的现有 Chromium CDP 地址 | -| `--browser-reuse-existing-cdp` | `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP` | `false` | 自动复用唯一检测到的本地 CDP 浏览器 | -| `--stdio` | `AGENTDOCK_STDIO` | `false` | 使用 stdio 提供 JSON-RPC,不启动 HTTP 服务 | - -示例: - -```bash -agentdock \ - --host 127.0.0.1 \ - --port 8765 \ - --log-level info -``` - -NexusDock 不再属于服务参数。配对会建立独立设备身份,由 AgentDock 在普通运行配置之外加载。 - -## Core 运行环境变量 - -| 环境变量 | 默认值 | 用途 | -| --- | --- | --- | -| `AGENTDOCK_HOME` | `~/.agentdock` | AgentDock 私有状态根目录;显式设置时必须解析为绝对目录 | -| `AGENTDOCK_DEFAULT_DIR` | `~/AgentDock` | 默认工作目录;显式设置时必须解析为绝对目录 | -| `AGENTDOCK_HOST` | `127.0.0.1` | HTTP 监听地址;非回环监听必须有 Bearer Token 或 OAuth | -| `AGENTDOCK_PORT` | `8765` | HTTP 端口 | -| `AGENTDOCK_LOG_LEVEL` | `info` | 日志级别 | -| `AGENTDOCK_STDIO` | `false` | 使用 stdio 传输而不是 HTTP 服务 | -| `AGENTDOCK_MCP_APPS_ENABLED` | `true` | 是否暴露可选 MCP Apps UI 资源与元数据 | -| `AGENTDOCK_COMMAND_ENV_FROM_ENV_JSON` | 空 | 明确把哪些宿主变量映射给 `exec_command` 子进程 | -| `AGENTDOCK_TRUSTED_PROXY_CIDRS` | 空 | 逗号分隔的可信反向代理 CIDR | - -布尔值建议统一写成 `true` 或 `false`。 - -`AGENTDOCK_COMMAND_ENV_FROM_ENV_JSON` 是显式允许列表,不会把整个宿主环境透传给子进程。例如: - -```bash -AGENTDOCK_COMMAND_ENV_FROM_ENV_JSON='{"HTTP_PROXY":"HTTP_PROXY","HTTPS_PROXY":"HTTPS_PROXY"}' -``` - -Skill 运行时保留变量 `SKILL_DATA_DIR` 不能通过该映射或请求级命令环境覆盖。 - -## Bearer Token 认证 - -最简单的 HTTP 认证方式: - -```bash -export AGENTDOCK_AUTH_TOKEN="$(openssl rand -hex 32)" -``` - -客户端调用 `/mcp` 时发送: - -```http -Authorization: Bearer -``` - -只监听回环地址时可以不启用认证;非回环 HTTP 监听如果既没有 Bearer Token 也没有 OAuth,AgentDock 会拒绝启动。 - -## OAuth 配置 - -OAuth 适合支持浏览器授权的远程客户端。启用时使用: - -| 环境变量 | 要求 | 用途 | -| --- | --- | --- | -| `AGENTDOCK_OAUTH_ENABLED` | `true` | 启用 OAuth | -| `AGENTDOCK_SERVER_URL` | 必填 | AgentDock 公网 Origin,例如 `https://agentdock.example.com` | -| `AGENTDOCK_OAUTH_PASSWORD` | 至少 12 个字符 | 授权页面登录密码 | -| `AGENTDOCK_OAUTH_TOKEN_SECRET` | 至少 32 字节 | OAuth 状态和 Token 的稳定签名密钥 | -| `AGENTDOCK_OAUTH_ACCESS_TOKEN_TTL` | 可选,默认 `1h` | Access Token 有效期;支持 Go duration、`90d` 这类整数天数或 `never` | - -示例: - -```bash -AGENTDOCK_OAUTH_ENABLED=true -AGENTDOCK_SERVER_URL=https://agentdock.example.com -AGENTDOCK_OAUTH_PASSWORD= -AGENTDOCK_OAUTH_TOKEN_SECRET= -``` - -`AGENTDOCK_SERVER_URL` 是 Origin,不包含 MCP 路径。非回环公网 Origin 必须使用 HTTPS;客户端 MCP 地址再附加 `/mcp`,例如 `https://agentdock.example.com/mcp`。 - -Bearer Token 和 OAuth 可以同时存在。不要因为旧部署曾经使用某个秘密,就长期保留已经不用的配置。 - -## 可信反向代理 - -AgentDock 默认不信任任意 `X-Forwarded-For`。只有代理由你控制并正确重写转发链时,才配置代理网段: - -```bash -AGENTDOCK_TRUSTED_PROXY_CIDRS=127.0.0.0/8,::1/128 -``` +| 监听地址 | `AGENTDOCK_HOST` | `--host` | `127.0.0.1` | +| 端口 | `AGENTDOCK_PORT` | `--port` | `8765` | +| 日志级别 | `AGENTDOCK_LOG_LEVEL` | `--log-level` | `info` | +| 聊天卡片 | `AGENTDOCK_MCP_APPS_MODE` | `--mcp-apps-mode` | `full` | +| stdio 传输 | `AGENTDOCK_STDIO` | `--stdio` | `false` | +| 状态目录 | `AGENTDOCK_HOME` | — | `~/.agentdock` | +| 工作目录 | `AGENTDOCK_DEFAULT_DIR` | — | `~/AgentDock` | +| 可信代理 CIDR | `AGENTDOCK_TRUSTED_PROXY_CIDRS` | — | 空 | -不要信任过宽的公网网段。客户端地址会参与认证与限流相关判断。 +聊天卡片支持 `full`、`compact`、`off`。 -## 配对 NexusDock +## 认证 -当前 AgentDock 通过设备配对身份连接 NexusDock。旧 `AGENTDOCK_NEXUS_ENDPOINT` 和 `AGENTDOCK_NEXUS_TOKEN` 不再是受支持的 Core 配置来源;服务启动前会清理这两个旧环境变量,只从成功配对产生的身份加载 Nexus 信息。 +Bearer Token: -先在 **NexusDock → 设置 → 系统与节点** 生成一次性配对码,再在目标 AgentDock 设备执行控制台生成的命令。通用形式: - -```bash -agentdock nexus pair \ - --endpoint https://nexus.example.com \ - --code \ - --name -``` - -查看已保存的配对状态: - -```bash -agentdock nexus status -``` - -配对后重启 AgentDock。身份加载成功后,直连 AgentDock 可以暴露 Nexus 支持的 Recall、Workflow、Evolution 和私密笔记能力,同时设备也会建立到 Nexus 的出站 Bridge 连接。 - -多设备路由和 fleet MCP 入口见 [NexusDock](../concepts/nexusdock.md)。 - -## Coding Agent(ACP) - -ACP 默认关闭。macOS 和 Windows 用户通常直接在 AgentDock UI 配置。无界面部署使用 Profile 模型: - -| 环境变量 | 默认值 | 用途 | -| --- | --- | --- | -| `AGENTDOCK_ACP_ENABLED` | `false` | 启用 ACP 工具 | -| `AGENTDOCK_ACP_PROFILES_JSON` | 空 | ACP Profile JSON 数组 | -| `AGENTDOCK_ACP_DEFAULT_PROFILE` | 第一个启用的 Profile | 工具调用省略 `profile_id` 时使用的默认 Profile | -| `AGENTDOCK_ACP_MAX_CONCURRENT_PROMPTS` | `2` | Prompt 并发上限,范围 `1`~`8` | -| `AGENTDOCK_ACP_INTERACTION_TIMEOUT_MS` | `300000` | 交互超时毫秒数,范围 `1000`~`3600000` | - -每个 Profile 包含 `id`、`kind`、`command`、可选 `args`、可选 `env_from_env` 和 `enabled`。内置类型 `codex`、`claude`、`grok` 使用同名固定 ID;custom 可以使用其他唯一 ID。 - -示例: - -```bash -AGENTDOCK_ACP_ENABLED=true -AGENTDOCK_ACP_PROFILES_JSON='[{"id":"codex","kind":"codex","command":"/absolute/path/to/codex-acp","enabled":true}]' -AGENTDOCK_ACP_DEFAULT_PROFILE=codex +```text +AGENTDOCK_AUTH_TOKEN= ``` -`env_from_env` 只映射变量名,不保存真实值。Provider 凭据应留在宿主环境或 Provider 自己的登录存储中。 - -旧 `AGENTDOCK_ACP_AGENT`、`AGENTDOCK_ACP_COMMAND`、`AGENTDOCK_ACP_ARGS_JSON`、`AGENTDOCK_ACP_ENV_FROM_ENV_JSON` 只在没有 Profile JSON 时作为旧单 Profile 配置的升级兼容入口。新配置统一使用 Profiles。 +OAuth: -Adapter 发现与验证流程见 [使用本地 Coding Agent](../guides/coding-agents.md)。 - -## 工作区规则 - -项目规则不通过环境变量配置。固定全局规则文件是 `~/.agentdock/AGENTS.md`;项目规则使用 `/AGENTS.md`,并可通过子目录继承。 - -操作项目、切换工作区或规则可能变化时调用 `workspace_context`。可选 `workdir` 只影响本次上下文选择。它还会索引 `/.agents/skills/*/SKILL.md`,返回精确 Skill 来源和引用,但不直接注入 Skill 正文。 +| 变量 | 用途 | +| --- | --- | +| `AGENTDOCK_OAUTH_ENABLED` | 启用 OAuth | +| `AGENTDOCK_SERVER_URL` | 公网 HTTPS Origin,不带 `/mcp` | +| `AGENTDOCK_OAUTH_PASSWORD` | 授权页面使用的密码 | +| `AGENTDOCK_OAUTH_TOKEN_SECRET` | OAuth 状态和 Token 的签名密钥 | +| `AGENTDOCK_OAUTH_ACCESS_TOKEN_TTL` | 可选的 Access Token 有效期 | -## 浏览器工具 +监听非 loopback 地址时必须使用 Bearer Token 或 OAuth。公网访问应使用 HTTPS,见 [公网访问](../operations/public-access.md)。 -浏览器自动化默认关闭: +## 浏览器 -| 环境变量 | 默认值 | 用途 | +| 变量 | CLI 参数 | 用途 | | --- | --- | --- | -| `AGENTDOCK_BROWSER_ENABLED` | `false` | 暴露浏览器工具 | -| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | 空 | 自动检测不适用时指定浏览器可执行文件绝对路径 | -| `AGENTDOCK_BROWSER_CDP_URL` | 空 | 用户配置的现有 Chromium CDP 地址 | -| `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP` | `false` | 发现并复用唯一的本地 CDP 浏览器 | - -AgentDock 支持 Chrome、Chromium 和 Microsoft Edge。不使用 CDP 复用时,AgentDock 会启动并管理独立浏览器进程;附着外部 CDP 浏览器时,AgentDock 会在其中创建自己的独立 target,关闭 AgentDock session 不会终止外部浏览器。 - -单次 `browser_session` 调用传入的 `cdp_url` 仅允许回环地址。命名或远程 CDP 地址必须由用户在 AgentDock 设置中配置。外部 CDP 浏览器不能同时使用持久 `profile_id`、Cookie 注入或 localStorage 注入。 - -使用方式和安全边界见 [浏览器自动化](../guides/browser-control.md)。 - -## managed Skill 与动态 MCP 的独立环境 +| `AGENTDOCK_BROWSER_ENABLED` | `--browser-enabled` | 启用浏览器工具 | +| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | `--browser-executable-path` | 指定 Chrome、Chromium 或 Edge | +| `AGENTDOCK_BROWSER_CDP_URL` | `--browser-cdp-url` | 连接已配置的 CDP 地址 | +| `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP` | `--browser-reuse-existing-cdp` | 优先复用本机可用的 CDP 浏览器 | -managed Skill 和动态 MCP Server 的业务凭据应与包定义分开。使用 `skill_manage` 和 `mcp_manage` 的环境 action,而不是把秘密放进 Skill 包、MCP Registry 条目或永久全局环境。 +普通设置和使用方式见 [使用浏览器](../guides/browser-control.md)。 -`env_list` 只返回变量名和配置状态,不返回明文。managed Skill 只有在命令使用精确 managed `skill_ref` 时才会收到保留的 `SKILL_DATA_DIR`;shared 和 workspace Skill 不会继承它。 +## Coding Agent -## 私密笔记 - -当前 AgentDock 与 NexusDock 完成配对后才会提供 `private_note_manage`。它使用 NexusDock Private Notes 服务,不通过本地私密笔记目录进行配置。 - -搜索只返回安全元数据;只有显式 `read` 才返回明文。写入和删除按工具契约要求确认。私密笔记加密材料、NexusDock 管理员凭据与 AgentDock 设备配置应分别保护。 - -## 查看当前运行状态 - -调用 `agentdock_context` 可以查看当前连接的运行环境和能力启动上下文。直连 AgentDock 时会包含运行时版本、操作系统、架构、路径、Skill 来源、动态 MCP 摘要,以及可选的 ACP/Nexus 支持索引。 - -当前连接实际暴露哪些工具,以 MCP 客户端的 `tools/list` 为准。`agentdock_context` 和 `tools/list` 都不会返回认证 Token、OAuth 密码、签名密钥、Provider Secret 或 NexusDock Device Token。 - -## 启动前检查 +| 变量 | 用途 | +| --- | --- | +| `AGENTDOCK_ACP_ENABLED` | 启用 Coding Agent 工具 | +| `AGENTDOCK_ACP_PROFILES_JSON` | 配置可用的 Coding Agent profile | +| `AGENTDOCK_ACP_DEFAULT_PROFILE` | 指定默认 profile | +| `AGENTDOCK_ACP_MAX_CONCURRENT_PROMPTS` | 限制并发 prompt 数量 | +| `AGENTDOCK_ACP_INTERACTION_TIMEOUT_MS` | 设置交互超时 | -配置无效时 AgentDock 会拒绝启动。常见检查包括: +桌面端优先在 AgentDock 图形界面配置 Coding Agent;无界面部署可以使用这些变量。使用方式见 [使用本地 Coding Agent](../guides/coding-agents.md)。 -- 端口位于 `1`~`65535`。 -- 日志级别有效。 -- 非回环 HTTP 监听已启用认证。 -- OAuth 所需变量齐全并满足最小长度。 -- 公网 `AGENTDOCK_SERVER_URL` 使用 HTTPS。 -- 可信代理配置都是合法 CIDR。 -- 已启用 ACP Profile 的 ID 唯一有效,并使用可执行的绝对命令路径。 -- 浏览器可执行文件和 CDP URL 配置结构有效。 +## 其他设置 -部署完成后至少验证: +NexusDock 配对保存为设备身份,不属于普通运行环境变量。见 [连接 AgentDock](../operations/nexusdock-connect.md)。 -```bash -curl -fsS http://127.0.0.1:8765/healthz -``` +managed Skill 和动态 MCP 的凭据通过各自的环境配置入口管理,不写进 AgentDock 全局环境变量。 -再使用实际客户端完成一次 MCP `initialize` 和真实工具调用。安全边界见 [安全模型](../operations/security.md)。 +项目规则使用 `AGENTS.md`,也不属于运行环境配置。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/tools.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/tools.md index 690d567..9c9bd6b 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/tools.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/tools.md @@ -1,251 +1,71 @@ -# 工具介绍 +# 工具参考 -AgentDock 通过 MCP 向上层 Agent 暴露一组稳定的内置工具。工具负责执行真实动作,Skill 负责描述工作方法,动态 MCP 负责接入外部服务,这三者职责不同。 +AgentDock 通过 MCP 向 AI 客户端提供工具。具体连接能看到哪些工具取决于已经启用的能力,以客户端实际返回的 `tools/list` 为准。 -连接 MCP 客户端后,直接描述目标,Agent 会选择合适工具。本页用于了解能力范围、排查连接问题和集成开发。 - -## 常见能力 - -- 读取、搜索、修改和发布文件。 -- 执行命令并持续观察长时间任务。 -- 通过 `exec_command` 使用本机 Git CLI,或通过动态 MCP 接入 Git 服务。 -- 安装和使用 Skill。 -- 管理复杂任务的步骤与验证。 -- 接入外部 MCP、浏览器和 NexusDock。 - -客户端实际能看到哪些工具取决于宿主机配置: - -- 不依赖外部集成的基础工具始终可用。 -- 当前 AgentDock 与 NexusDock 完成配对后,额外暴露 `evolve`、`workflow_template_manage`、`recall_*` 和 `private_note_manage`。 -- 启用 `AGENTDOCK_BROWSER_ENABLED` 或 `--browser-enabled` 后,额外暴露 `browser_*` 工具。 -- 启用 `AGENTDOCK_ACP_ENABLED` 后,额外暴露 `acp_session`、`acp_prompt` 和 `acp_interaction`。 -- 动态 MCP 的上游工具不会直接混入 AgentDock 的 `tools/list`,而是通过固定的发现和调用入口访问。 - -当前连接真正暴露哪些工具,以 MCP 客户端拿到的 `tools/list` 为准。 - -## 系统与上下文 +## 上下文、文件与命令 | 工具 | 用途 | | --- | --- | -| `agentdock_context` | 返回本机运行事实、已安装 Skill、动态 MCP、可选 ACP、操作规则,以及可用时由 Nexus 提供的 Workflow / Recall 索引 | -| `workspace_context` | 按本次工作区选择返回生效的 `AGENTS.md` 链和 workspace-local Skill 索引 | - -`agentdock_context` 是让模型快速决策的启动上下文,不是重复的工具清单。直连 AgentDock 时会包含版本、操作系统、架构、目录和路径模型等 runtime 字段;经 NexusDock 调用时则返回包含各节点信息和 Nexus 共享上下文的 fleet 结构。 - -操作具体项目、切换工作区或工作区规则可能变化时,使用 `workspace_context`。直连 AgentDock 时只需可选 `workdir`;经 NexusDock 调用时需要 `node_id`,并可再传 `workdir`。返回包含 `workdir`、`workspace_root`、`instructions`、`workspace_skills` 和 `warnings`:先读取固定的 `~/.agentdock/AGENTS.md`,再读取工作区 `AGENTS.md` 继承链,并索引 `/.agents/skills/*/SKILL.md`,但不返回 Skill 正文。 - -需要 Skill 正文、动态 MCP Schema 或 Recall 正文时,再调用对应读取工具。 - -## 文件与文本 - -AgentDock 使用 Host 路径模型。相对路径默认从 `~/AgentDock` 解析,绝对路径按运行 AgentDock 的操作系统用户权限访问。 - -| 工具 | 用途 | 常用参数或 action | -| --- | --- | --- | -| `read_file` | 分段读取 UTF-8 文本,也支持宿主签发的 `skill://...` 资源 URI | `path`、`start_line`、`end_line` | -| `list_dir` | 通过一个受限的目录树 / glob 入口列目录或查找文件 | `path`、`max_depth`、`max_entries`、`patterns`、`exclude_patterns`、`entry_type` | -| `search_text` | 使用文本或正则搜索文件内容 | `query`、`regex`、`include_globs`、`context_lines` | -| `file_edit` | 统一执行文本文件修改 | `replace`、`patch`、`add`、`delete`、`move` | - -`list_dir` 已取代旧的独立文件列表入口。glob 模式相对于 `path`:`*` 不跨目录层级,`**` 可以跨目录;只需要文件时使用 `entry_type=file`,大目录中应合理限制 `max_depth` / `max_entries`。 - -`file_edit` 支持 `dry_run` 和 diff 预览。涉及替换时可以使用 `expected_matches` 约束命中数量,避免内容漂移后误改其他位置。 - -Windows 版 AgentDock 的文件工具可以通过 `runtime=wsl` 使用 WSL 原生文件语义;这不是一组额外工具。 - -## 命令与会话 - -| 工具 | 用途 | 常用参数或 action | -| --- | --- | --- | -| `exec_command` | 执行有超时、输出上限和脱敏能力的命令 | `cmd`、`workdir`、`timeout_ms`、`tty`、`skill` | -| `session_observe` | 只读查看长时间命令会话 | `list`、`status` | -| `session_act` | 向会话写入输入或终止会话 | `write`、`kill`、`kill_all` | - -`exec_command` 在命令未快速结束时返回 `session_id`,后续使用 `session_observe` 读取状态。需要交互输入时使用 `session_act action=write`。 - -通过宿主签发的 managed `skill_ref` 运行命令时,AgentDock 会把该精确 Skill 根目录设为默认工作目录,注入它的独立环境,并提供保留的 `SKILL_DATA_DIR` 作为私有持久数据目录。shared 和 workspace 候选不会继承 managed Skill 的环境或数据目录。 - -Windows 版 `exec_command` 可以显式选择 `runtime=windows` 或 `runtime=wsl`。 - -## Coding Agent(ACP) - -只有宿主启用 ACP 时才会暴露这些工具。三组工具都接受可选 `profile_id`;省略时使用配置的默认 Profile。 +| `agentdock_context` | 读取当前 AgentDock 运行和能力上下文 | +| `workspace_context` | 读取工作区规则和本地 Skill 索引 | +| `read_file` | 读取文本文件 | +| `list_dir` | 列出或查找文件与目录 | +| `search_text` | 在文件中搜索文本或正则表达式 | +| `file_edit` | 添加、替换、修改、移动或删除文本文件 | +| `exec_command` | 执行命令 | +| `session_observe` | 查看长时间运行的命令会话 | +| `session_act` | 向命令会话输入内容或终止会话 | + +## Skill、Plugin 与外部 MCP | 工具 | 用途 | 主要 action | | --- | --- | --- | -| `acp_session` | 管理 AgentDock session 与 Adapter 原生 session | `info`、`new`、`list`、`inspect`、`open`、`update`、`close`、`delete` | -| `acp_prompt` | 启动异步 Prompt Run、读取有序事件、请求取消 | `start`、`events`、`cancel` | -| `acp_interaction` | 处理待用户参与的权限交互 | `list`、`respond` | - -`acp_session open` 会在内部协商 resume/load;Adapter 声明能力时,`new` 可以通过 `from_session_id` fork;`update` 负责 session mode 或配置项。认证可以通过 `info(auth_method_id=...)` 发起,也可以在其他 session action 中带上 Adapter 声明的认证方法。Prompt steering 属于能力驱动的内部流程,不再是单独公开 action。 +| `skill_manage` | 管理已安装 Skill 和环境配置 | `install`、`remove`、`env_set`、`env_unset`、`env_list` | +| `plugin_manage` | 检查和管理 Plugin | `inspect`、`validate`、`install`、`update`、`enable`、`disable`、`remove` | +| `mcp_manage` | 管理外部 MCP 连接 | `list`、`inspect`、`add`、`enable`、`disable`、`refresh`、`authorize`、`remove`、环境配置 | +| `mcp_tool_search` | 查找外部 MCP 提供的工具 | 搜索 | +| `mcp_tool_inspect` | 查看一个外部工具的 Schema | 检查 | +| `mcp_tool_call` | 调用已经检查过的外部 MCP 工具 | 调用 | -`acp_prompt start` 会快速返回 `run_id`,进度通过 `events` 增量读取。permission 响应只能选择 Coding Agent 当前提供且本地策略允许的选项,或者取消待处理交互。 +使用方式见 [使用 Skill](../concepts/skills.md)、[使用 Plugin](../concepts/plugins.md) 和 [使用外部MCP](../concepts/dynamic-mcp.md)。 -Profile、安装和项目访问边界见 [使用本地 Coding Agent](../guides/coding-agents.md)。 +## 任务、Workflow 与记忆 -## 可恢复任务与 Workflow - -| 工具 | 用途 | action | +| 工具 | 可用条件 | 用途 | | --- | --- | --- | -| `task_manage` | 持久化多步骤任务、进度、阻塞和最终验证证据 | `create`、`list`、`get`、`checkpoint`、`block`、`resume`、`final_review`、`complete` | -| `workflow_template_manage` | 管理和匹配可复用 Workflow 模板;仅当前 AgentDock 设备与 NexusDock 配对后可见 | `publish`、`retire`、`list`、`get`、`get_many`、`match`、`vector_index` | - -`task_manage` 保存的是状态,不会替代命令、测试、部署或浏览器验证。普通任务可以完全在本机使用;Workflow 模板存放在 NexusDock Registry;当前 AgentDock 设备未与 NexusDock 配对时,`workflow_template_manage` 不会出现在工具列表中。 - -`publish` 接收完整模板,并在激活该版本前进行校验。多个模板同时适用时,`get_many` 返回模板正文,但不会自动拼接。模型需要删除无关步骤、合并重复项、确定顺序,再把组合后的 steps 和 completion conditions 传给 `task_manage create`。 - -## 知识 Evolution - -当前 AgentDock 设备与 NexusDock 配对后会暴露 `evolve`,但 Evolution 生命周期属于 AgentDock。NexusDock 提供共享存储和访问路径,不负责决定知识何时得到支持、被反证、被替代或撤回。 - -| 工具 | 用途 | intent | -| --- | --- | --- | -| `evolve` | 提议有边界的可复用知识,并管理由 AgentDock 负责的验证生命周期 | `propose`、`bind`、`supersede`、`retract` | - -`bind` 属于高级的执行前学习检查:模型必须在任务开始执行前声明后续 Task 成功或失败分别代表什么。Task 结果本身没有学习含义,而且 Evolution 不能阻塞普通 Task 完成。 - -## managed Skill 与独立环境 - -| 工具 | 用途 | action | -| --- | --- | --- | -| `skill_manage` | 安装或移除 managed Skill 当前内容,并管理它的独立环境 | `install`、`remove`、`env_set`、`env_unset`、`env_list` | - -AgentDock 不提供独立的 Skill 版本、激活或回滚生命周期。每个 managed Skill 名称只有一份当前内容;重复安装相同内容会按 `content_digest` no-op,同名但经过审查的新内容会原子替换当前内容。 - -典型流程: - -```text -agentdock_context / workspace_context -→ select one exact Skill candidate -→ read_file -→ execute through real tools using the same returned skill_ref when needed -``` +| `task_manage` | 始终可用 | 记录多步骤任务状态和进度 | +| `workflow_template_manage` | 已配对 NexusDock | 查找和管理可复用 Workflow | +| `recall_search` | 已配对 NexusDock | 搜索 Recall 记忆 | +| `recall_read` | 已配对 NexusDock | 读取 Recall 内容 | +| `recall_write` | 已配对 NexusDock | 创建或更新 Recall 内容 | +| `recall_maintain` | 已配对 NexusDock | 检查和维护 Recall 内容与索引 | +| `evolve` | 已配对 NexusDock | 管理可复用知识 | +| `private_note_manage` | 已配对 NexusDock | 访问私密笔记 | -不要根据裸名称自行构造 `skill_ref` 或 `skill://` URI。同名的 managed、shared、workspace 候选仍是不同来源。`skill_manage env_list` 只返回变量名和配置状态,不回显秘密值。普通 `remove` 会保留 managed Skill 的环境和持久数据;`purge=true` 才会一并删除这些保留资源。 +使用方式见 [任务与进度](../concepts/tasks.md)、[Recall 记忆](../concepts/recalldock.md) 和 [Workflow 工作流](../concepts/workflow.md)。 -用户流程见 [使用 Skill](../concepts/skills.md)。 +## Coding Agent -## 动态 MCP - -动态 MCP 使用四个固定入口,避免上层客户端因远端工具频繁变化而缓存过期。 - -| 工具 | 用途 | 常用 action | -| --- | --- | --- | -| `mcp_manage` | 注册、启停、刷新、删除 MCP Server,并管理独立环境 | `list`、`inspect`、`add`、`enable`、`disable`、`refresh`、`remove`、`env_set`、`env_unset`、`env_list` | -| `mcp_tool_search` | 按 Server 和能力关键词搜索轻量工具摘要 | `server`、`query`、`limit` | -| `mcp_tool_inspect` | 读取一个上游工具的完整输入输出 Schema | `name=:` | -| `mcp_tool_call` | 按检查过的 Schema 调用上游工具 | `name`、`arguments` | - -推荐调用链: - -```text -agentdock_context -→ mcp_tool_search -→ mcp_tool_inspect -→ mcp_tool_call -``` - -注册信息只保存环境变量名,不保存明文 Token。更完整的注册示例见 [动态 MCP](../concepts/dynamic-mcp.md)。 - -## 图片与 Artifact +启用 Coding Agent 后会提供: | 工具 | 用途 | | --- | --- | -| `view_image` | 从 AgentDock Artifact、Host 图片路径或 HTTP(S) URL 加载图片,并按模型限制自动缩放或转码 | -| `file_publish` | 把文件或目录发布为不可变 Artifact 快照;目录自动打包为 `tar.gz` | - -`file_publish` 始终返回 `artifact_id`、哈希和大小。当前请求存在可访问服务地址时,还会返回有过期时间的签名 URL。 - -经 NexusDock 调用节点时,NexusDock 可以把节点本地下载位置替换为自己的临时签名地址。文件通过已配对节点现有的出站连接按受限分块流式传输;下载期间源节点必须在线,而且 NexusDock 不会额外持久化一份 Artifact。详见 [NexusDock](../concepts/nexusdock.md#从节点下载文件)。 - -浏览器截图等图片型工具通常先返回轻量 Artifact 引用,再通过 `view_image` 加载,避免在普通工具结果中传递大段 Base64。 - -## NexusDock Recall - -直连 AgentDock 时,只有当前设备已经与 NexusDock 配对,才会暴露这些工具: - -| 工具 | 用途 | 常用参数或 action | -| --- | --- | --- | -| `recall_search` | 搜索 Markdown 和经验卡片;配置 Embedding 后会透明加入语义召回 | `query`、`kind=all|markdown|card`、`max_results` | -| `recall_read` | 按路径读取一个 Recall 条目 | `path`、`include_raw` | -| `recall_write` | 计划、创建、替换、追加、patch、更新事实、diff 或删除 Recall 内容 | `target=card|markdown`、`action`、`confirmed` | -| `recall_maintain` | 列表、lint,并查看或重建 Embedding 索引 | `list`、`lint`、`embedding_status`、`reindex`、`reindex_cards` | - -紧凑的启动索引现在已经并入 `agentdock_context`,不再有独立的 Recall bootstrap 工具。索引已经给出目标路径时优先 `recall_read`;尚不知道相关条目时再使用 `recall_search`。 - -`recall_write` 要求明确选择内容类型: - -- `card`:原子、可复用的经验、偏好和决策。 -- `markdown`:稳定项目文档、Runbook、学习记录和结构化长期事实。 - -确认要求取决于 action 和目标位置。破坏性操作或受保护位置写入需要 `confirmed=true`;契约支持时,未确认编辑会返回预览。详细边界见 [NexusDock Recall](../concepts/recalldock.md)。 - -## 私密笔记 +| `acp_session` | 创建、打开、查看、更新和关闭 Coding Agent 会话 | +| `acp_prompt` | 发起 prompt、读取事件和取消运行 | +| `acp_interaction` | 查看并处理等待确认的权限交互 | -直连 AgentDock 时,只有当前设备已经与 NexusDock 配对,才会暴露 `private_note_manage`: +使用方式见 [使用本地 Coding Agent](../guides/coding-agents.md)。 -| 工具 | 用途 | action | -| --- | --- | --- | -| `private_note_manage` | 访问 NexusDock Private Notes 私密笔记库 | `search`、`read`、`write`、`delete`、`status`、`maintain` | - -这个工具不是普通记忆入口。只有用户明确要求访问私密笔记,或内容明显包含敏感凭据和个人信息时才应使用。 - -- `search` 只返回标题、简介、标签、分类、路径和更新时间等元数据,不搜索正文。 -- 只有显式 `read` 才返回明文。 -- `write` 和 `delete` 必须使用 `confirmed=true`。 -- Git 备份只保存 age 密文,明文与密钥必须保持 Git 忽略。 - -## 浏览器自动化 - -以下工具只在启用浏览器能力后暴露: - -| 工具 | 用途 | action 或典型输入 | -| --- | --- | --- | -| `browser_session` | 创建、关闭和清理浏览器会话 | `start`、`close`、`cleanup_stale` | -| `browser_act` | 在指定页面中导航、点击、输入、滚动并等待页面条件 | `page_id`、`goto`、`click`、`fill`、`wait_for_url`、`wait_for_text`、`wait_for_response` | -| `browser_snapshot` | 获取指定页面及全部页面元数据、文本、截图和错误 | `session_id`、`page_id`、`full_page` | - -`browser_session` 创建由 AgentDock 管理的 Chrome、Chromium 或 Edge 会话,支持无头模式、独立 `profile_id`、Cookie 和 localStorage 注入。会话返回 `page_id` 和 `pages`;网页打开新标签页后,可以把目标 `page_id` 传给 `browser_act` 或 `browser_snapshot`。它不会接管已经打开的个人浏览器。 - -AgentDock 默认不开放任意页面脚本执行动作。优先使用可观察的点击、输入、滚动和截图完成操作。详细说明见 [浏览器自动化](../guides/browser-control.md)。 - -## 返回状态(集成与调试) +## 浏览器、图片与文件分享 -:::info -以下状态语义从 AgentDock `v0.4.3` 开始生效。`v0.4.2` 及更早版本的正常工具结果仍可能包含通用 `ok`;集成方应升级后再依赖本节字段。 -::: +启用浏览器能力后会提供浏览器工具。 -AgentDock 把“工具调用是否成功”和“业务或命令结果是否成功”分开表达: - -- MCP 协议层的 `isError` 表示工具调用错误。参数错误、权限不足、资源不存在、网络失败或内部异常会返回 `isError: true`。 -- 正常返回的 `structuredContent` 不包含通用 `ok` 或 `tool_ok`,避免模型把“工具成功返回结果”误判成“命令或业务成功”。 -- 命令完成后使用 `command_ok`、`exit_code` 和可选的 `command_error`。命令仍在运行时不会提前返回 `command_ok`。 -- 浏览器操作使用 `browser_ok`、`browser_error`;其他工具使用 `valid`、`changed`、`configured`、`written`、`encrypted_backup_ok` 等领域字段。 - -命令退出失败仍然属于一次正常的工具返回,因为 AgentDock 需要保留 stdout、stderr 和退出码: - -```json -{ - "status": "exited", - "command_ok": false, - "exit_code": 1, - "command_error": "exit status 1", - "stdout": "", - "stderr": "..." -} -``` - -业务检查未通过也不等于工具调用错误。例如 Skill 校验可以正常返回 `valid: false` 和具体问题列表。调用方应先看 MCP `isError`,再按工具领域读取 `command_ok`、`valid`、`changed` 等字段。 - -HTTP 健康检查、Runtime API、WSL 子进程等内部或独立协议可能使用自己的状态字段,但这些字段不会作为 MCP 工具结果中的通用成功标记暴露。 - -## 工具选择原则 - -- 先用只读工具检查现状,再调用会产生副作用的工具。 -- 修改前查看真实文件、仓库、服务或页面状态,修改后做真实验证。 -- 简单读取不创建任务;多步骤开发、部署、迁移和排障使用 `task_manage`。 -- Skill 用来指导流程,不替代真实工具。 -- 动态 MCP 工具先搜索、再检查 Schema、最后调用。 -- 不把 AgentDock 当成操作系统级沙箱。真实权限仍由运行用户、容器 volume、systemd、DACL 和网络策略决定。 +| 工具 | 用途 | +| --- | --- | +| `browser_session` | 启动和关闭浏览器会话 | +| `browser_act` | 打开页面、点击、输入、滚动和等待 | +| `browser_snapshot` | 读取页面状态和截图 | +| `view_image` | 从文件、已发布文件或 URL 加载图片 | +| `file_publish` | 发布文件或目录;有可访问地址时生成临时分享链接 | -配置启用方式见 [配置](./configuration.md),安全边界见 [安全模型](../operations/security.md)。 +浏览器使用见 [使用浏览器](../guides/browser-control.md),启用方式见 [配置参考](./configuration.md)。 diff --git a/sidebars.ts b/sidebars.ts index 94afdba..333e6ef 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -33,15 +33,15 @@ const sidebars: SidebarsConfig = { link: { type: 'generated-index', title: 'Capabilities', - description: 'Use Skills, tasks, browser and desktop automation, Coding Agents, and external MCP servers.', + description: 'Extend AgentDock with Skills and Plugins, track tasks, use browsers, and connect external tools.', }, items: [ 'concepts/skills', - 'concepts/tasks', + 'concepts/dynamic-mcp', + 'concepts/plugins', 'guides/browser-control', 'guides/coding-agents', - 'guides/desktop-automation', - 'concepts/dynamic-mcp', + 'concepts/tasks', ], }, { @@ -50,9 +50,15 @@ const sidebars: SidebarsConfig = { link: { type: 'generated-index', title: 'NexusDock', - description: 'Connect multiple AgentDock devices and share Recall and Workflow data.', + description: 'Connect multiple AgentDock devices and share Recall memory and Workflow data.', }, - items: ['concepts/nexusdock', 'operations/nexusdock', 'concepts/recalldock'], + items: [ + 'concepts/nexusdock', + 'operations/nexusdock', + 'operations/nexusdock-connect', + 'concepts/recalldock', + 'concepts/workflow', + ], }, { type: 'category', @@ -61,16 +67,13 @@ const sidebars: SidebarsConfig = { type: 'generated-index', title: 'Operations', description: - 'Configure platforms, public access, manual deployment, security boundaries, and troubleshooting.', + 'Manage desktop, Linux, Docker, public access, and troubleshooting.', }, items: [ - 'operations/macos', - 'operations/windows', + 'operations/desktop', 'operations/linux', 'operations/docker', - {type: 'doc', id: 'getting-started/vps', label: 'Manual Linux deployment'}, - 'guides/fixed-domain', - 'operations/security', + 'operations/public-access', 'operations/troubleshooting', ], }, diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index a2f77a4..a6514bb 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -39,7 +39,7 @@ function getFeatures(): FeatureItem[] { description: translate({ id: 'homepage.features.skills.description', message: - 'Install trusted Skills so agents can follow proven workflows, dependencies, and safety boundaries.', + 'Install trusted Skills and Plugins to add reusable workflows and related tools when you need them.', }), to: '/docs/concepts/skills', }, @@ -59,7 +59,7 @@ function getFeatures(): FeatureItem[] { description: translate({ id: 'homepage.features.mcp.description', message: - 'Connect additional MCP servers on demand and keep credentials in isolated environments instead of registry data.', + 'Connect other MCP services as needed, with credentials kept in isolated environments.', }), to: '/docs/concepts/dynamic-mcp', }, @@ -69,7 +69,7 @@ function getFeatures(): FeatureItem[] { description: translate({ id: 'homepage.features.tasks.description', message: - 'Persist goals, steps, progress, and verification so interrupted work can continue without mistaking execution for completion.', + 'Save goals, steps, progress, and verification so longer work can continue after an interruption.', }), to: '/docs/concepts/tasks', }, @@ -91,6 +91,37 @@ function Feature({label, title, description, to}: FeatureItem): ReactNode { ); } + +function NexusDockPreview(): ReactNode { + return ( + + ); +} + export default function HomepageFeatures(): ReactNode { const features = getFeatures(); @@ -107,8 +138,8 @@ export default function HomepageFeatures(): ReactNode {

- Start with the shortest installation path, then enable Skills, browser automation, - external MCP servers, and long-running tasks as needed. + Start with installation, then add Skills, Plugins, browser automation, external + MCP services, and recoverable tasks only when you need them.

@@ -120,28 +151,72 @@ export default function HomepageFeatures(): ReactNode { -
-
-
- GET STARTED - - Install for your current system - -

- - Most users should choose the native macOS, Windows, or Linux installer. Choose the - container option when Docker is already part of your environment. - -

+
+
+
+
+ NEXUSDOCK + + One MCP, multiple devices + +

+ + Share Recall memory and Workflow data + +

+

+ + Bring AgentDock on Mac, Windows, Linux, and servers into one NexusDock and manage + device status in one place. + +

+
+ + Explore NexusDock + + + + Install NexusDock + +
+
+
-
- - Choose an installation - - - - Browse all documentation - + +
+
+ 01 + + One MCP endpoint + +

+ + Connect the AI client once and reach multiple AgentDock devices through NexusDock. + +

+
+
+ 02 + + Manage devices together + +

+ + See connected devices and their current status from one web console. + +

+
+
+ 03 + + Share Recall and Workflow data + +

+ + Reuse long-term memory and repeatable workflows across your AgentDock devices. + +

+
diff --git a/src/components/HomepageFeatures/styles.module.css b/src/components/HomepageFeatures/styles.module.css index c215a8f..adcd796 100644 --- a/src/components/HomepageFeatures/styles.module.css +++ b/src/components/HomepageFeatures/styles.module.css @@ -21,8 +21,7 @@ letter-spacing: 0.13em; } -.sectionHeader h2, -.quickStart h2 { +.sectionHeader h2 { margin: 0; color: var(--site-heading); font-size: clamp(2.1rem, 4vw, 3.4rem); @@ -109,36 +108,6 @@ transform: translateX(3px); } -.quickStart { - padding: 0 0 6.5rem; - background: var(--site-background); -} - -.quickStartInner { - display: grid; - grid-template-columns: minmax(0, 1fr) auto; - align-items: center; - gap: 3rem; - padding-top: 3.5rem; - padding-bottom: 3.5rem; - border-top: 1px solid var(--site-border-strong); - border-bottom: 1px solid var(--site-border-strong); -} - -.quickStart h2 { - font-size: clamp(1.8rem, 3vw, 2.65rem); -} - -.quickStart p { - margin: 0.85rem 0 0; - color: var(--site-muted); -} - -.quickLinks { - display: flex; - align-items: center; - gap: 0.75rem; -} .quickPrimary, .quickSecondary { @@ -196,13 +165,6 @@ grid-template-columns: repeat(2, minmax(0, 1fr)); } - .quickStartInner { - grid-template-columns: 1fr; - } - - .quickLinks { - justify-content: flex-start; - } } @media screen and (max-width: 640px) { @@ -218,22 +180,312 @@ min-height: 190px; } - .quickStart { - padding-bottom: 4rem; + + .quickPrimary, + .quickSecondary { + width: 100%; } +} + +.nexusSection { + position: relative; + overflow: hidden; + padding: 6.75rem 0; + border-top: 1px solid var(--site-border); + background: + radial-gradient(circle at 82% 30%, rgba(99, 91, 255, 0.12), transparent 30%), + linear-gradient(var(--site-grid) 1px, transparent 1px), + linear-gradient(90deg, var(--site-grid) 1px, transparent 1px), + var(--site-background); + background-size: auto, 56px 56px, 56px 56px, auto; +} + +.nexusGrid { + display: grid; + grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr); + align-items: center; + gap: clamp(3rem, 7vw, 7rem); +} + +.nexusCopy { + max-width: 620px; +} + +.nexusCopy h2 { + margin: 0; + color: var(--site-heading); + font-size: clamp(2.6rem, 5vw, 4.6rem); + line-height: 1.03; + letter-spacing: -0.055em; +} + +.nexusCopy > p { + max-width: 58ch; + margin: 1.35rem 0 0; + color: var(--site-muted); + font-size: 1rem; + line-height: 1.8; +} + +.nexusCopy .nexusTagline { + margin-top: 1.15rem; + color: var(--site-heading); + font-size: clamp(1.15rem, 2vw, 1.45rem); + line-height: 1.45; +} + +.nexusTagline strong { + font-weight: 680; +} + +.nexusActions { + display: flex; + gap: 0.75rem; + margin-top: 2rem; +} + +.nexusPreview { + overflow: hidden; + border: 1px solid var(--site-border-strong); + border-radius: 18px; + background: color-mix(in srgb, var(--site-surface) 94%, transparent); + box-shadow: var(--site-shadow-lg); +} + +.nexusPreviewHeader { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 50px; + padding: 0 1.1rem; + border-bottom: 1px solid var(--site-border); + color: var(--site-muted-strong); + background: var(--site-surface-muted); + font-family: var(--ifm-font-family-monospace); + font-size: 0.72rem; + font-weight: 650; +} + +.nexusOnline { + padding: 0.3rem 0.5rem; + border: 1px solid color-mix(in srgb, var(--ifm-color-primary) 26%, var(--site-border)); + border-radius: 999px; + color: var(--ifm-color-primary); + background: color-mix(in srgb, var(--ifm-color-primary) 6%, var(--site-surface)); + font-size: 0.62rem; + letter-spacing: 0.08em; +} + +.nexusHub { + padding: 1.35rem; +} + +.nexusHubCore { + display: flex; + align-items: center; + gap: 0.85rem; + padding: 1rem; + border: 1px solid color-mix(in srgb, var(--ifm-color-primary) 26%, var(--site-border)); + border-radius: 12px; + background: color-mix(in srgb, var(--ifm-color-primary) 5%, var(--site-surface)); +} - .quickStartInner { - padding-top: 2.75rem; - padding-bottom: 2.75rem; +.nexusHubMark { + display: grid; + width: 40px; + height: 40px; + flex: 0 0 40px; + place-items: center; + border-radius: 10px; + color: white; + background: var(--ifm-color-primary); + font-size: 1rem; + font-weight: 750; +} + +.nexusHubCore > div { + display: flex; + min-width: 0; + flex-direction: column; + gap: 0.16rem; +} + +.nexusHubCore strong { + color: var(--site-heading); + font-size: 0.9rem; +} + +.nexusHubCore div span { + color: var(--site-muted); + font-family: var(--ifm-font-family-monospace); + font-size: 0.6rem; + letter-spacing: 0.08em; +} + +.nexusNodes { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.65rem; + margin-top: 0.8rem; +} + +.nexusNodes > div { + display: grid; + min-width: 0; + grid-template-columns: auto 1fr; + column-gap: 0.45rem; + row-gap: 0.08rem; + align-items: center; + padding: 0.72rem; + border: 1px solid var(--site-border); + border-radius: 10px; + background: var(--site-surface-muted); +} + +.nexusNodes > div > span { + grid-row: 1 / span 2; + color: #22c55e; + font-size: 0.56rem; +} + +.nexusNodes strong { + overflow: hidden; + color: var(--site-heading); + font-size: 0.76rem; + text-overflow: ellipsis; + white-space: nowrap; +} + +.nexusNodes small { + color: var(--site-muted); + font-family: var(--ifm-font-family-monospace); + font-size: 0.56rem; +} + +.nexusShared { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + border-top: 1px solid var(--site-border); +} + +.nexusShared > div { + display: flex; + min-height: 94px; + flex-direction: column; + justify-content: center; + gap: 0.15rem; + padding: 0.9rem 1rem; +} + +.nexusShared > div + div { + border-left: 1px solid var(--site-border); +} + +.nexusShared span { + color: var(--ifm-color-primary); + font-family: var(--ifm-font-family-monospace); + font-size: 0.6rem; +} + +.nexusShared strong { + color: var(--site-heading); + font-size: 0.82rem; +} + +.nexusShared small { + color: var(--site-muted); + font-family: var(--ifm-font-family-monospace); + font-size: 0.54rem; + letter-spacing: 0.07em; +} + +.nexusCapabilities { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + margin-top: 3.25rem; + border-top: 1px solid var(--site-border-strong); +} + +.nexusCapabilities > div { + min-height: 170px; + padding: 1.45rem 1.55rem 0; +} + +.nexusCapabilities > div + div { + border-left: 1px solid var(--site-border); +} + +.nexusCapabilities span { + display: block; + margin-bottom: 1rem; + color: var(--ifm-color-primary); + font-family: var(--ifm-font-family-monospace); + font-size: 0.65rem; + font-weight: 700; +} + +.nexusCapabilities strong { + display: block; + color: var(--site-heading); + font-size: 1rem; +} + +.nexusCapabilities p { + max-width: 34ch; + margin: 0.55rem 0 0; + color: var(--site-muted); + font-size: 0.86rem; + line-height: 1.7; +} + +@media screen and (max-width: 996px) { + .nexusSection { + padding: 5rem 0; } - .quickLinks { + .nexusGrid { + grid-template-columns: 1fr; + gap: 2.5rem; + } + + .nexusCopy { + max-width: 720px; + } + + .nexusPreview { + max-width: 760px; + } +} + +@media screen and (max-width: 640px) { + .nexusSection { + padding: 4rem 0; + background-size: auto, 36px 36px, 36px 36px, auto; + } + + .nexusCopy h2 { + font-size: clamp(2.4rem, 12vw, 3.35rem); + } + + .nexusActions { align-items: stretch; flex-direction: column; } - .quickPrimary, - .quickSecondary { - width: 100%; + .nexusNodes, + .nexusShared, + .nexusCapabilities { + grid-template-columns: 1fr; + } + + .nexusShared > div + div, + .nexusCapabilities > div + div { + border-top: 1px solid var(--site-border); + border-left: 0; + } + + .nexusCapabilities > div { + min-height: 0; + padding: 1.35rem 0; } } diff --git a/src/css/custom.css b/src/css/custom.css index ef2e7ae..155b982 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -336,7 +336,7 @@ body { /* 表格保持语义结构,窄屏只滚动表格自身。 */ .markdown table { display: block; - width: 100%; + width: fit-content; max-width: 100%; margin: 1.5rem 0 2rem; overflow-x: auto; @@ -394,6 +394,27 @@ body { border-bottom: 0; } +/* ChatGPT 连接教程截图保持适中的阅读尺寸,并在正文中居中。 */ +.chatgpt-guide-image { + display: flex; + justify-content: center; + margin: 1.5rem 0; +} + +.chatgpt-guide-image > p { + width: 100%; + margin: 0; +} + +.chatgpt-guide-image img { + display: block; + width: auto; + max-width: min(100%, 680px); + max-height: 760px; + margin: 0 auto; + object-fit: contain; +} + .alert { margin: 1.6rem 0; padding: 1rem 1.1rem; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 06ce5c6..527a4c5 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -116,8 +116,8 @@ function HomepageHeader(): ReactNode {

- Connect an MCP-compatible AI client to your computers and servers, then use files, - commands, Git, browsers, and external services through explicit tool boundaries. + Connect an MCP-compatible AI client to your computers and servers so it can work + with files, run commands, use Git and browsers, and connect other services.

@@ -131,9 +131,11 @@ function HomepageHeader(): ReactNode {
- 30 + + Built-in + - built-in tools + tools for real work
@@ -167,7 +169,7 @@ export default function Home(): ReactNode { description={translate({ id: 'homepage.meta.description', message: - 'Official AgentDock documentation for installation, MCP clients, Skills, browser automation, and external MCP servers.', + 'Official AgentDock documentation for installation, client connections, Skills, Plugins, browser automation, and external MCP services.', })}>