From 279907403ba4dacc068f8e0d43d2b01775d3951d Mon Sep 17 00:00:00 2001 From: x x Date: Wed, 23 Sep 2026 09:34:18 +0800 Subject: [PATCH] =?UTF-8?q?docs(sync):=20=E5=AF=B9=E9=BD=90=20AgentDock=20?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=85=AC=E5=BC=80=E5=A5=91=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/concepts/skills.md | 62 ++-- docs/contributing/development.md | 68 ++-- docs/getting-started/macos.md | 2 +- docs/getting-started/vps.md | 28 +- docs/guides/browser-control.md | 12 +- docs/guides/coding-agents.md | 79 +++-- docs/guides/desktop-automation.md | 4 +- docs/operations/linux.md | 23 +- docs/operations/macos.md | 31 +- docs/operations/troubleshooting.md | 2 +- docs/operations/windows.md | 24 +- docs/reference/configuration.md | 300 +++++++----------- docs/reference/tools.md | 55 ++-- .../current/concepts/skills.md | 76 +++-- .../current/contributing/development.md | 70 ++-- .../current/getting-started/macos.md | 2 +- .../current/getting-started/vps.md | 28 +- .../current/guides/browser-control.md | 12 +- .../current/guides/coding-agents.md | 89 ++++-- .../current/guides/desktop-automation.md | 4 +- .../current/operations/linux.md | 23 +- .../current/operations/macos.md | 29 +- .../current/operations/troubleshooting.md | 2 +- .../current/operations/windows.md | 24 +- .../current/reference/configuration.md | 300 +++++++----------- .../current/reference/tools.md | 51 +-- scripts/check-i18n.mjs | 2 +- 27 files changed, 717 insertions(+), 685 deletions(-) diff --git a/docs/concepts/skills.md b/docs/concepts/skills.md index f690b16..86a4417 100644 --- a/docs/concepts/skills.md +++ b/docs/concepts/skills.md @@ -1,19 +1,18 @@ # Use Skills -A Skill is a set of instructions for the agent explaining when to use it, what steps to follow, what dependencies are required, and which operations require user confirmation. - +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. ## Official core Skills -AgentDock native installers and Docker images automatically install and activate these official core Skills: +AgentDock native installers and Docker images ship these core Skills with the runtime: +- `agentdock-user-guide` - `skill-authoring` - `skill-installation` -- `skill-vetter-runtime` -They use the same version selection and rollback mechanism as other installed Skills. +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. -`desktop` and Skills requiring accounts, system permissions, or third-party configuration are not installed automatically. +Skills that require extra accounts, system permissions, or third-party software are installed separately when needed. ## How to use Skills @@ -27,53 +26,70 @@ Install and use this Skill: https://example.com/example-skill.zip The agent typically: -1. Checks whether a matching Skill is already installed. -2. Reads the Skill instructions and safety boundaries. -3. Checks required commands, accounts, or environment variables. -4. Uses actual tools to perform the task. +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 -A project can expose local Skills at `/.agents/skills//SKILL.md`. `workspace_context` returns only their `name`, `description`, and `file` index; it does not inject the Skill body into context. Read the returned `SKILL.md` with `read_file` only when that Skill is needed. +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. -When names overlap, prefer the workspace Skill for the active project, then AgentDock Skills, then global common Skills under `~/.agents/skills`. +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 a Skill +## Installing or updating a managed Skill -Confirm the source is trustworthy before installing. Ask the agent to vet the package before installing and activating: +Confirm the source is trustworthy before installing. Ask the agent to review the package first: ```text -Please vet this Skill's source, files, and permission requirements, and install it once confirmed safe. +Please review this Skill's source, files, portability, and permission requirements, then install it if the review is clean. ``` -Remote sources must point to a ZIP archive; local sources can be a Skill directory or ZIP file. A Skill can have multiple installed versions, but only one is active at any time. When installing a new version, you can leave it inactive. Use `skill_package activate` to switch active versions, or rollback to a previous version if switching fails. Skill packages must not contain tokens, cookies, browser sessions, or personal environment files. +`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. + +Skill packages must not contain tokens, cookies, browser sessions, `.env` files, caches, or device-private data. ## Configure accounts or API keys -When a Skill requires credentials, ask the agent to store them in that Skill's isolated environment, for example: +When a managed Skill requires credentials, ask the agent to save them in that Skill's isolated environment, for example: ```text Set EXAMPLE_API_KEY for example-skill without echoing the actual value in the reply. ``` -Isolated environments are injected only when running that Skill; they are not written into the Skill package or the permanent system environment. +`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. + +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 - Confirm before deleting, sending, uploading, paying, or authorizing. -- Skill instructions cannot exceed the permissions of the running user, Docker volumes, or the OS. +- 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. -- On failure, check missing dependencies or configuration first; do not paste secrets into public logs. +- 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. ## Viewing installed Skills Ask directly: ```text -What Skills are installed? What does each do? +What Skills are available here, and where does each candidate come from? ``` -The agent checks installed Skill names and descriptions, then reads full documentation as needed. +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. -Creating and maintaining Skills is a developer workflow; see [Developer Guide](../contributing/development.md#skill-development). +Creating and maintaining Skills is a developer workflow; see [Contributor guide](../contributing/development.md#skill-development). diff --git a/docs/contributing/development.md b/docs/contributing/development.md index 0111328..3b8b187 100644 --- a/docs/contributing/development.md +++ b/docs/contributing/development.md @@ -19,7 +19,7 @@ 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, or browsers also require the relevant focused tests and real-environment verification. +Changes involving concurrency, platform differences, installers, Docker, browsers, ACP, or desktop lifecycle also require relevant focused tests and real-environment verification. ## Documentation checks @@ -30,16 +30,30 @@ pnpm install --frozen-lockfile pnpm check ``` -`pnpm check` runs the TypeScript check, verifies English and Simplified Chinese structure, builds both Docusaurus locales for production, and checks internal links. After changing navigation, layout, or wide tables, inspect desktop and mobile pages in a real browser. +`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. + +- 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. + +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. ## Change principles - 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, or desktop capabilities. -- When changing an installer, verify help text, defaults, generated files, and representative installation paths. -- Do not publish real tokens, private endpoints, personal directories, or maintainer credentials. -- Keep migration history, temporary compatibility behavior, and maintainer-machine deployment details out of user documentation. +- 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. ## Tool result conventions @@ -47,13 +61,13 @@ Use MCP protocol-level `isError` for tool-call errors. Successful tool results d - 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 `valid`, `changed`, and `configured`. +- Other tools use explicit domain fields such as `changed`, `configured`, `written`, or similarly scoped results. -When adding or changing an output schema, verify that `structuredContent` does not leak generic state fields from internal HTTP, WSL child-process, or runner protocols. +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. ## Skill development -First-party Skills use a “portable core plus optional AgentDock integration” model. The minimum layout is: +First-party Skills use a portable document core with optional AgentDock integration. The minimum layout is: ```text example-skill/ @@ -62,20 +76,34 @@ example-skill/ Add `references/`, `scripts/`, entry points, and tests only when needed. Requirements: -- Use relative paths inside the package. -- Scripts read only from the current process environment. -- Do not hard-code user-specific absolute paths, installed versions, or private AgentDock state files. -- Do not package environment files, caches, login state, or device-private data. -- Increment the semantic version after changing instructions, references, or scripts. -- Use `skill-authoring` to review content and portability, then use `skill_package validate` to validate package structure. +- `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. -See [Use Skills](../concepts/skills.md) for usage details. +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 `type(scope): 中文说明`. +- 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. -- Check GitHub Actions after pushing. -- Visit the deployed page after documentation is published. -- Follow the current source-repository maintenance rules for releases, signing, production deployment, and maintainer-machine operations; do not duplicate those procedures in user documentation. +- 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. diff --git a/docs/getting-started/macos.md b/docs/getting-started/macos.md index 563b728..1078b61 100644 --- a/docs/getting-started/macos.md +++ b/docs/getting-started/macos.md @@ -89,7 +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 for browser automation, never taking over your primary browser profile. +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). diff --git a/docs/getting-started/vps.md b/docs/getting-started/vps.md index d71ac45..48ace73 100644 --- a/docs/getting-started/vps.md +++ b/docs/getting-started/vps.md @@ -41,6 +41,12 @@ curl -fL "$BASE_URL/$ASSET.sha256" -o "$TMP_DIR/$ASSET.sha256" ) 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" ``` @@ -68,13 +74,6 @@ sudo chown root:agentdock /etc/agentdock/agentdock.env sudo chmod 0640 /etc/agentdock/agentdock.env ``` -Add these variables when NexusDock Recall or workflow templates are required: - -```bash -AGENTDOCK_NEXUS_ENDPOINT=https://nexus.example.com -AGENTDOCK_NEXUS_TOKEN= -``` - ## systemd unit Create `/etc/systemd/system/agentdock.service`: @@ -109,6 +108,19 @@ 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: @@ -142,7 +154,7 @@ AGENTDOCK_OAUTH_TOKEN_SECRET= ## Update -Download and verify the target release again, replace `/opt/agentdock/bin/agentdock`, then restart: +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 diff --git a/docs/guides/browser-control.md b/docs/guides/browser-control.md index 33a2e3f..47a61c2 100644 --- a/docs/guides/browser-control.md +++ b/docs/guides/browser-control.md @@ -2,7 +2,7 @@ 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. Browser automation uses isolated sessions managed by AgentDock, separated from your primary browser profile. +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. ## Before you start @@ -44,18 +44,20 @@ Take a screenshot of the final page. The agent observes the page first, executes actions, and verifies the final state. -## Login state and profiles +## Login state, profiles, and existing CDP browsers -When persistent logins are needed, use AgentDock's dedicated browser profiles. Specifying a `profile_id` saves the profile in AgentDock's browser data directory for reuse across subsequent sessions. +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. -Do not point AgentDock to your daily personal browser profile. Browser tools use isolated sessions managed by AgentDock and do not take over existing open personal browsers. +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. + +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. 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. ## Security boundaries - Confirm before uploading files, sending messages, submitting forms, deleting content, or authorizing. -- Use AgentDock dedicated profiles instead of personal browser profiles. +- Prefer AgentDock-owned dedicated profiles. If you explicitly use CDP attachment, expose only a browser instance intended for automation. - Grant access only to websites and files required by the task. - Clean up persistent profiles when login sessions are no longer needed. diff --git a/docs/guides/coding-agents.md b/docs/guides/coding-agents.md index a339fa3..75f7d46 100644 --- a/docs/guides/coding-agents.md +++ b/docs/guides/coding-agents.md @@ -1,31 +1,34 @@ # Use local Coding Agents -AgentDock can optionally connect an MCP client to a local Coding Agent through ACP (Agent Client Protocol). This is useful when you want ChatGPT or another MCP client to hand a coding task to Codex, Claude, or Grok Build on the computer where the project actually lives. +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. -This capability is optional and is disabled by default. +ACP is optional and disabled by default. -## Supported presets +## Supported profiles -The macOS and Windows apps currently provide these presets: +The macOS and Windows apps provide built-in profiles and also allow custom adapters: -| Preset | Local adapter AgentDock looks 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` with its ACP/stdio mode | +| Grok Build | `grok agent stdio` | +| Custom | An absolute adapter executable path plus optional arguments | -Install and sign in to the Coding Agent you intend to use before enabling it in AgentDock. AgentDock does not provide or manage the provider account itself. +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`. + +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. ## macOS and Windows -1. Install the desired Coding Agent or ACP adapter on the same computer as AgentDock. -2. Open AgentDock **Advanced Settings** / the Windows control panel. -3. Turn on **Coding Agent (`启用 Coding Agent`)**. -4. Choose **Codex**, **Claude**, or **Grok Build**. -5. Confirm that AgentDock reports the adapter as detected. -6. Apply the settings and restart the AgentDock service. +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. +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. -After reconnecting your MCP client, `agentdock_context` can show that ACP is enabled and which adapter profile is configured. +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`. ## What you can ask for @@ -35,34 +38,56 @@ Describe the outcome directly, for example: Use the local Coding Agent on this computer to inspect the repository, fix the failing tests, and verify the change. ``` -For a long coding turn, AgentDock starts the work asynchronously and lets the upstream agent continue reading progress events. Permission requests from the Coding Agent remain explicit; AgentDock does not turn a one-time permission choice into permanent authorization. +AgentDock exposes a small management surface instead of mirroring every ACP protocol method: + +- `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. + +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. ## Project directories 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. -This is not an operating-system sandbox. If a Coding Agent should only access selected projects, enforce that boundary with the operating-system account, file permissions, container mounts, or other host controls. +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. ## Headless or service deployments -For deployments without the desktop UI, ACP is enabled with host configuration. At minimum, provide an absolute adapter executable path: +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: ```bash AGENTDOCK_ACP_ENABLED=true -AGENTDOCK_ACP_AGENT=codex -AGENTDOCK_ACP_COMMAND=/absolute/path/to/codex-acp +AGENTDOCK_ACP_PROFILES_JSON='[{"id":"codex","kind":"codex","command":"/absolute/path/to/codex-acp","enabled":true}]' +AGENTDOCK_ACP_DEFAULT_PROFILE=codex ``` -Optional arguments and environment mappings are documented in [Configuration](../reference/configuration.md#coding-agents-acp). Keep credentials in host environment variables rather than embedding secret values in arguments. +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. ## Troubleshooting -If the Coding Agent cannot be enabled or started: +If a Coding Agent cannot be enabled or started: -- Verify that the selected adapter is installed and can run under the same user account as AgentDock. -- On macOS or Windows, reopen Advanced Settings and check the adapter detection message. -- For headless deployments, confirm that `AGENTDOCK_ACP_COMMAND` is an absolute executable file path. -- Confirm that any host environment variable referenced by `AGENTDOCK_ACP_ENV_FROM_ENV_JSON` actually exists. -- Use `agentdock_context` to confirm that ACP is enabled and the expected adapter is selected, then let the MCP client retry with a new session. +- 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. -See [Tools](../reference/tools.md#coding-agents-acp) for the user-visible ACP tool boundaries. +See [Tools](../reference/tools.md#coding-agents-acp) for the public tool contract and [Configuration](../reference/configuration.md#coding-agents-acp) for host configuration. diff --git a/docs/guides/desktop-automation.md b/docs/guides/desktop-automation.md index a34633e..b939b8d 100644 --- a/docs/guides/desktop-automation.md +++ b/docs/guides/desktop-automation.md @@ -13,11 +13,11 @@ Follow the [macOS installation](../getting-started/macos.md) and run AgentDock a Send this instruction to a client that is already connected to AgentDock: ```text -Read the desktop entry from the official AgentDock Skills catalog, verify the package against its digest, then install and activate it: +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 versioned and released independently in [uvwt/agentdock-skills](https://github.com/uvwt/agentdock-skills). The catalog pins its download URL and SHA-256 digest. After installation, ask whether the `desktop` Skill is active. +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 diff --git a/docs/operations/linux.md b/docs/operations/linux.md index 600cdf8..1cda147 100644 --- a/docs/operations/linux.md +++ b/docs/operations/linux.md @@ -1,6 +1,6 @@ # Advanced Linux configuration -This page covers interactive installation, Cloudflare Tunnel, custom directories and ports, service-manager selection, NexusDock configuration, and binary-only installation. +This page covers interactive installation, Cloudflare Tunnel, custom directories and ports, service-manager selection, optional NexusDock pairing, and installation without a managed system service. ## Alpine and minimal systems @@ -22,7 +22,7 @@ curl -fsSL https://github.com/uvwt/agentdock/releases/latest/download/install.sh sh /tmp/install-agentdock.sh ``` -Keep the `binary` mode for a normal deployment. `source` and `auto` are only for development or troubleshooting when prebuilt artifacts are unavailable. +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 @@ -43,7 +43,7 @@ A temporary installation starts `cloudflared`, reads the generated URL from the 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, signing secret, and NexusDock configuration are preserved. The new URL is written back automatically and AgentDock is restarted. The client must replace the old MCP URL and authorize OAuth again. +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`: @@ -117,8 +117,6 @@ Common variables: | `AGENTDOCK_HOST` | Listen address | | `AGENTDOCK_PORT` | Listen port | | `AGENTDOCK_AUTH_TOKEN` | Custom Bearer Token | -| `AGENTDOCK_NEXUS_ENDPOINT` | NexusDock URL | -| `AGENTDOCK_NEXUS_TOKEN` | NexusDock 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` | @@ -126,7 +124,18 @@ Common variables: Do not commit real tokens. When `AGENTDOCK_AUTH_TOKEN` is omitted, the installer generates one and writes it to a root-only environment file. -## Install only the binary +## 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: + +```bash +sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair --endpoint https://nexus.example.com --code +sudo systemctl restart agentdock +``` + +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: @@ -137,7 +146,7 @@ sudo env \ sh /tmp/install-agentdock.sh ``` -This mode does not start AgentDock automatically. Run `/opt/agentdock/bin/agentdock` manually. +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 diff --git a/docs/operations/macos.md b/docs/operations/macos.md index f9c404e..77e0ab8 100644 --- a/docs/operations/macos.md +++ b/docs/operations/macos.md @@ -4,7 +4,7 @@ Standard installations should use the [macOS graphical application](../getting-s ## Graphical app settings -The main window provides status, connection URLs, credentials, start, stop, restart, core updates, and log access. **Advanced Settings** manages ports, log levels, NexusDock integration, browser tools, and independent launch-at-login toggles. +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. @@ -42,7 +42,8 @@ sh /tmp/agentdock-install.sh --register-service --version vX.Y.Z ## Changing installation directory ```bash -sh /tmp/agentdock-install.sh --register-service --install-dir "$HOME/bin" +AGENTDOCK_INSTALL_DIR="$HOME/bin" \ + sh /tmp/agentdock-install.sh --register-service ``` Ensure the custom directory is added to PATH or use absolute paths. @@ -122,30 +123,20 @@ Grant permissions only to the application actually running AgentDock. macOS may For full instructions, see [macOS desktop automation](../guides/desktop-automation.md). -## Updates and backups +## Updates -Rerun the install script to upgrade. Old binaries are backed up to: - -```text -~/.agentdock/backups/bin -``` - -Runtime data and default working directories are preserved. +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 -Before removing the application, disable "Show AgentDock menu bar at login" in Advanced Settings, apply changes, and quit AgentDock. - -Download and run the official uninstallation script: +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/uninstall-macos.sh \ - -o /tmp/uninstall-agentdock.sh -zsh /tmp/uninstall-agentdock.sh +curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ + -o /tmp/agentdock-install.sh +sh /tmp/agentdock-install.sh --uninstall ``` -The default command removes background services, support files, and logs, while preserving binaries, `~/.agentdock`, and `~/AgentDock`. - -Use `--remove-binary` to remove the installed binary. Use `--purge-data` only when explicitly intending to remove binaries, all AgentDock state, browser profiles, and default working directories. +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. -Finally, move `AgentDock.app` in Applications to the Trash. +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/troubleshooting.md b/docs/operations/troubleshooting.md index 4443312..98efb53 100644 --- a/docs/operations/troubleshooting.md +++ b/docs/operations/troubleshooting.md @@ -77,7 +77,7 @@ Do not echo complete tokens, cookies, or headers in error messages. - Confirm that AgentDock runs in the current macOS login session. - Check Screen Recording and Accessibility permissions. -- Read the active `desktop` Skill instructions again. +- 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. diff --git a/docs/operations/windows.md b/docs/operations/windows.md index b0f5e35..c8196d6 100644 --- a/docs/operations/windows.md +++ b/docs/operations/windows.md @@ -119,26 +119,6 @@ Bearer Tokens, OAuth passwords, OAuth signing keys, and Tunnel Tokens are encryp ## Uninstallation -Uninstall from Windows **Settings > Apps > Installed apps**, or use **Uninstall AgentDock** in the Start menu. +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. -For automated uninstallation, run the release script: - -```powershell -$uninstaller = Join-Path $env:TEMP 'uninstall-windows.ps1' -Invoke-WebRequest ` - https://github.com/uvwt/agentdock/releases/latest/download/uninstall-windows.ps1 ` - -OutFile $uninstaller -powershell -ExecutionPolicy Bypass -File $uninstaller -``` - -To also remove tasks, Skills, configuration, and default working directory: - -```powershell -powershell -ExecutionPolicy Bypass ` - -File $uninstaller ` - -PurgeState -``` - -:::danger -`-PurgeState` deletes user data and default working directories. Back up required files before running. -::: +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 ace654e..43b3fb1 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -1,60 +1,57 @@ # Configuration -AgentDock does not currently read one unified YAML, JSON, or TOML configuration file. Runtime configuration is supplied through environment variables, and some common values can also be overridden with CLI flags. +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. :::tip -Use the platform installation guides for first setup. This page covers ports, remote access, authentication, browser automation, NexusDock, and advanced deployment settings. +For a first installation, use the platform guide. This page is a reference for runtime behavior, headless deployments, and advanced configuration. ::: -## Common configuration +## Choose the right configuration surface -| Scenario | What to configure | +| Scenario | Recommended configuration surface | | --- | --- | -| Local foreground process | Usually keep `127.0.0.1` and the default port | -| Docker | `AGENTDOCK_AUTH_TOKEN` in `.env`; keep the remaining Compose defaults | -| Browser automation | Enable browser tools and prepare Chrome, Edge, or the browser image | -| NexusDock (Recall, Workflow, Evolution, Private Notes) | Configure the service URL and optional token | -| LAN or public access | Authentication, HTTPS, and a reverse proxy; changing only the listen address is not enough | +| 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 | +| Linux service | Protected service environment file | +| NexusDock | Pair the device with `agentdock nexus pair`; do not configure legacy Nexus credentials in the Core environment | -Manage configuration according to the deployment method: +Do not commit tokens, passwords, cookies, private keys, OAuth secrets, or device identities to source control. -- Local foreground process: shell environment variables or CLI flags. -- Docker Compose: `environment` or a local `.env` in the project root. -- systemd: a permission-restricted `EnvironmentFile`. -- Windows login startup: the current-user configuration and DPAPI-protected data generated by the installer. +## Precedence and directories -Do not commit tokens, passwords, cookies, private keys, or OAuth secrets to a source repository. - -## Configuration sources and precedence - -AgentDock resolves configuration in this order: +For ordinary Core runtime settings, AgentDock resolves values in this order: 1. Built-in defaults. 2. Environment variables. -3. CLI flags. +3. Supported CLI flags. -CLI flags override only the values they explicitly provide. Authentication secrets, OAuth passwords, and NexusDock tokens are available only through environment variables. +CLI flags override only the settings they expose. Authentication secrets and ACP profile JSON, for example, remain environment-driven in headless deployments. -The operating-system user that runs AgentDock determines its two primary directories: +The two primary directories are based on the operating-system user that runs AgentDock: ```text -~/.agentdock Internal state, Skills, tasks, MCP configuration, and artifacts -~/AgentDock Default working directory for file, command, and Git tools +~/.agentdock Internal state, managed Skills, tasks, MCP configuration, browser data, and artifacts +~/AgentDock Default working directory for relative file and command operations ``` -Set `AGENTDOCK_HOME` or `AGENTDOCK_DEFAULT_DIR` to absolute paths when you need different locations. For stronger data isolation, use a separate operating-system user or explicit container volumes. +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. ## CLI flags -| Flag | Environment variable | Default | Description | +The current server entry point exposes these service flags: + +| Flag | Environment variable | Default | Purpose | | --- | --- | --- | --- | -| `--host` | `AGENTDOCK_HOST` | `127.0.0.1` | HTTP listen address | -| `--port` | `AGENTDOCK_PORT` | `8765` | HTTP listen port, from `1` to `65535` | +| `--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` | -| `--nexus-endpoint` | `AGENTDOCK_NEXUS_ENDPOINT` | empty | NexusDock service root URL | +| `--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 | Use a specific Chrome, Chromium, or Edge executable | -| `--stdio` | `AGENTDOCK_STDIO` | `false` | Serve JSON-RPC over standard input and output instead of starting HTTP | +| `--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: @@ -65,22 +62,31 @@ agentdock \ --log-level info ``` -## Core runtime configuration +NexusDock is intentionally not a server flag. Pairing establishes a device identity that AgentDock loads separately from normal runtime settings. -| Environment variable | Default | Description | +## Core runtime variables + +| Environment variable | Default | Purpose | | --- | --- | --- | -| `AGENTDOCK_HOME` | `~/.agentdock` | Internal state directory; when set, it must resolve to an absolute directory | -| `AGENTDOCK_DEFAULT_DIR` | `~/AgentDock` | Default working directory for relative file, command, and Git operations; when set, it must resolve to an absolute directory | -| `AGENTDOCK_HOST` | `127.0.0.1` | HTTP listen address. A non-loopback address requires Bearer Token or OAuth authentication | -| `AGENTDOCK_PORT` | `8765` | HTTP listen port | -| `AGENTDOCK_LOG_LEVEL` | `info` | Log level | -| `AGENTDOCK_STDIO` | `false` | Whether to use stdio mode | -| `AGENTDOCK_BROWSER_ENABLED` | `false` | Whether to expose `browser_*` tools | -| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | empty | Optional absolute Chrome, Chromium, or Edge executable path | -| `AGENTDOCK_NEXUS_ENDPOINT` | empty | NexusDock service root URL; enables Recall, Workflow, Evolution, and Private Notes capabilities | -| `AGENTDOCK_NEXUS_TOKEN` | empty | NexusDock Bearer Token | - -Use only `true` or `false` for boolean values to avoid differences between service managers. +| `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 @@ -90,37 +96,25 @@ The simplest HTTP authentication method is: export AGENTDOCK_AUTH_TOKEN="$(openssl rand -hex 32)" ``` -The client sends this header when it accesses `/mcp`: +Clients calling `/mcp` send: ```http Authorization: Bearer ``` -Authentication may be omitted only when AgentDock listens exclusively on a loopback address. When it listens on `0.0.0.0`, a LAN address, or a public address, it refuses to start without authentication. - -Docker Compose example: - -```yaml -services: - agentdock: - environment: - AGENTDOCK_AUTH_TOKEN: "${AGENTDOCK_AUTH_TOKEN:?set AGENTDOCK_AUTH_TOKEN}" -``` +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 suitable for remote MCP clients such as ChatGPT that require browser authorization. AgentDock supports Authorization Code, PKCE S256, dynamic client registration, and Refresh Tokens. Compatible clients can register automatically from server metadata; administrators do not need to create a Client ID or Client Secret in advance. - -All of these variables are required when OAuth is enabled: +OAuth is useful for remote clients that support browser authorization. Enable it with: -| Environment variable | Requirement | Description | +| Environment variable | Requirement | Purpose | | --- | --- | --- | | `AGENTDOCK_OAUTH_ENABLED` | `true` | Enable OAuth | -| `AGENTDOCK_SERVER_URL` | required | Public AgentDock origin, for example `https://agentdock.example.com` | -| `AGENTDOCK_OAUTH_PASSWORD` | at least 12 characters | Connection password entered on the authorization page | -| `AGENTDOCK_OAUTH_TOKEN_SECRET` | at least 32 bytes | Signing key for OAuth state and tokens; store it persistently instead of regenerating it on each restart | - -Optional: `AGENTDOCK_OAUTH_ACCESS_TOKEN_TTL` controls Access Token lifetime. The default is `1h`; Go duration values such as `12h`, integer day values such as `90d`, and `never` are supported. +| `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: @@ -131,172 +125,124 @@ AGENTDOCK_OAUTH_PASSWORD= AGENTDOCK_OAUTH_TOKEN_SECRET= ``` -Generate random values with OpenSSL: - -```bash -openssl rand -base64 24 -openssl rand -hex 32 -``` +`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`. -`AGENTDOCK_SERVER_URL` must be a complete origin without a path, query, or fragment. A non-loopback address must use HTTPS; only `localhost` or a loopback IP may use HTTP. The MCP URL entered in a client adds `/mcp`, for example `https://agentdock.example.com/mcp`. - -Enabling OAuth exposes these endpoints: - -| Path | Purpose | -| --- | --- | -| `/.well-known/oauth-authorization-server` | OAuth Authorization Server metadata | -| `/.well-known/oauth-protected-resource/mcp` | MCP Protected Resource metadata | -| `/register` | Dynamic client registration | -| `/oauth/authorize` | Browser authorization page | -| `/oauth/token` | Exchange Authorization Codes and Refresh Tokens | - -Bearer Token and OAuth may be enabled together. When only one method is required, do not keep unused secrets. See [Connect ChatGPT to AgentDock](../guides/chatgpt.md) for the complete ChatGPT flow. +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 a client-provided `X-Forwarded-For` header by default. Configure trusted proxies only when the reverse proxy is in a controlled network and rewrites the forwarding chain correctly: +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 ``` -Separate multiple networks with commas. Do not add uncontrolled public networks, or authentication rate limiting and client-address checks may be spoofed. +Do not trust broad public networks. Client-address handling participates in authentication and rate-limiting decisions. + +## Pair NexusDock -## NexusDock Recall, Workflows, Evolution, and Private Notes +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. -After NexusDock is configured, AgentDock exposes `recall_*`, `workflow_template_manage`, `evolve`, and `private_note_manage`. Recall and Workflows use NexusDock shared services, AgentDock owns the Evolution lifecycle policy, and Private Notes use NexusDock Private Notes: +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_ENDPOINT=https://nexus.example.com -AGENTDOCK_NEXUS_TOKEN= +agentdock nexus pair \ + --endpoint https://nexus.example.com \ + --code \ + --name ``` -`AGENTDOCK_NEXUS_ENDPOINT` is the NexusDock service root URL; do not append a specific API path. When it is not configured: +Check the saved pairing state with: -- Local `task_manage` still manages ordinary recoverable tasks. -- `evolve`, `recall_*`, `workflow_template_manage`, and `private_note_manage` do not appear in `tools/list`. +```bash +agentdock nexus status +``` -For multi-device routing, fleet context, and node Artifact downloads, see [NexusDock](../concepts/nexusdock.md). +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. -## Coding Agents (ACP) +For multi-device routing and the fleet MCP endpoint, see [NexusDock](../concepts/nexusdock.md). -ACP is disabled by default. Desktop users should normally enable it from AgentDock Advanced Settings; see [Use local Coding Agents](../guides/coding-agents.md). +## Coding Agents (ACP) -Headless deployments can use these host settings: +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 | Description | +| Environment variable | Default | Purpose | | --- | --- | --- | -| `AGENTDOCK_ACP_ENABLED` | `false` | Expose the built-in ACP tools | -| `AGENTDOCK_ACP_AGENT` | `claude` | Short profile name reported for the configured Coding Agent | -| `AGENTDOCK_ACP_COMMAND` | empty | Required absolute executable path when ACP is enabled | -| `AGENTDOCK_ACP_ARGS_JSON` | empty | Optional JSON string array of adapter arguments | -| `AGENTDOCK_ACP_ENV_FROM_ENV_JSON` | empty | Optional JSON object mapping child variable names to existing host variable names | -| `AGENTDOCK_ACP_MAX_CONCURRENT_PROMPTS` | `2` | Maximum concurrent prompt runs, from `1` to `8` | -| `AGENTDOCK_ACP_INTERACTION_TIMEOUT_MS` | `300000` | Permission-interaction timeout in milliseconds, from `1000` to `3600000` | +| `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 environment mapping: +Example: ```bash -AGENTDOCK_ACP_ENV_FROM_ENV_JSON='{"OPENAI_API_KEY":"OPENAI_API_KEY"}' +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 ``` -Only the variable names are stored in the mapping; the child process receives the current host value when AgentDock starts. Keep secrets in the host environment and avoid embedding them directly in `AGENTDOCK_ACP_ARGS_JSON`. +`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. -AgentDock does not maintain an ACP project-root whitelist. Session workspaces may use any host-accessible directory, so use operating-system permissions or container mounts when a Coding Agent needs a stricter boundary. +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. -## Workspace rules +See [Use local Coding Agents](../guides/coding-agents.md) for adapter discovery and verification. -AgentDock does not expose an environment variable for project instructions. The global rule file is fixed at `~/.agentdock/AGENTS.md`. Project rules use `/AGENTS.md` and may be inherited by nested directories. +## Workspace rules -Call `workspace_context` before operating on a project, after switching workspaces, or when workspace rules may have changed. Its optional `workdir` applies only to that request and does not change the default directory for later commands. The tool returns the active `AGENTS.md` chain plus the workspace-local Skill index under `/.agents/skills/*/SKILL.md`; read a returned Skill file with `read_file` when its full instructions are needed. +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. -MCP initialization instructions remain stable AgentDock guidance and never embed `AGENTS.md` contents. +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. ## Browser tools -Browser automation is disabled by default. Enable it with: - -```bash -AGENTDOCK_BROWSER_ENABLED=true -``` - -or: +Browser automation is disabled by default: -```bash -agentdock --browser-enabled -``` - -AgentDock supports Chrome, Chromium, and Microsoft Edge. If automatic browser discovery is not suitable, configure the browser executable explicitly. - -| Environment variable | Default | Description | +| Environment variable | Default | Purpose | | --- | --- | --- | -| `AGENTDOCK_BROWSER_ENABLED` | `false` | Expose `browser_session`, `browser_act`, and `browser_snapshot` | -| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | empty | Optional absolute browser executable path when automatic discovery is not suitable | +| `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 | -The macOS and Windows apps detect installed supported browsers before enabling the feature. The Docker browser image includes Chromium and configures its executable path automatically. See [Browser automation](../guides/browser-control.md) for usage details. +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. -## Isolated environments for Skills and dynamic MCP +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. -Do not keep business secrets for Skills and dynamic MCP servers in the main AgentDock process environment longer than necessary. Prefer each integration's isolated environment: +See [Browser automation](../guides/browser-control.md) for usage and safety boundaries. -```json -{ - "action": "env_set", - "skill": "example-skill", - "key": "EXAMPLE_API_KEY", - "value": "..." -} -``` +## Managed Skill and dynamic MCP environments -```json -{ - "action": "env_set", - "name": "example-mcp", - "key": "SERVICE_TOKEN", - "value": "..." -} -``` +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. -Use `skill_package` and `mcp_manage`, respectively. `env_list` returns only variable names and whether they are configured; it never returns actual values. +`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. ## Private Notes -Starting with `v0.4.4`, `private_note_manage` uses the NexusDock Private Notes API. It no longer reads a local AgentDock private-note directory or `AGENTDOCK_PRIVATE_NOTES_*` environment variables. Configure `AGENTDOCK_NEXUS_ENDPOINT` and the optional token first. - -NexusDock manages plaintext boundaries, age X25519 encrypted backups, and Git ignore rules. Initialize or inspect encryption through a maintenance action: - -```json -{ - "action": "maintain", - "maintenance_action": "init-encryption" -} -``` - -Search matches only safe metadata such as title, summary, tags, category, and path. It does not search or return the body. Only an explicit `read` returns plaintext; both `write` and `delete` require `confirmed=true`. - -## Inspect current state +`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. -Call `agentdock_context` to inspect the runtime and capability bootstrap for the current connection. A direct AgentDock response includes: +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. -- AgentDock version, operating system, and architecture. -- AgentDock home, default directory, current default working directory, and path model. -- Installed Skill summaries and enabled dynamic MCP servers. -- Optional ACP state plus Nexus-backed Workflow and Recall indexes when configured. +## Check the current runtime -`agentdock_context` does not duplicate the built-in MCP tool catalog or report the active authentication method. Use the MCP client's `tools/list` for the tools actually exposed by that connection, and inspect the deployment configuration or desktop control panel for authentication settings. +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. -Neither `agentdock_context` nor `tools/list` returns authentication tokens, OAuth passwords, signing keys, or NexusDock tokens. +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 -AgentDock refuses to start when configuration is invalid. Common checks include: +AgentDock refuses invalid configurations. Common checks include: -- The port is between `1` and `65535`. -- The log level is valid. -- Authentication is enabled for a non-loopback listener. -- All OAuth variables are present and satisfy length requirements. +- 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. -- Every entry in `AGENTDOCK_TRUSTED_PROXY_CIDRS` is a valid CIDR. +- 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. After deployment, verify at least: @@ -304,4 +250,4 @@ After deployment, verify at least: curl -fsS http://127.0.0.1:8765/healthz ``` -Then complete one real MCP `initialize` and tool call from the actual client. See the [Security model](../operations/security.md) for deployment boundaries and recommendations. +Then complete an MCP `initialize` and one real tool call from the actual client. See the [Security model](../operations/security.md) for deployment boundaries. diff --git a/docs/reference/tools.md b/docs/reference/tools.md index ece45ce..715d3be 100644 --- a/docs/reference/tools.md +++ b/docs/reference/tools.md @@ -16,7 +16,7 @@ After connecting an MCP client, describe the goal and let the agent choose the a The tools actually visible to a client depend on the host configuration: - Core tools that do not depend on external integrations are always available. -- Configuring `AGENTDOCK_NEXUS_ENDPOINT` adds `evolve`, `workflow_template_manage`, `recall_*`, and `private_note_manage`. +- 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. @@ -42,7 +42,7 @@ AgentDock uses the Host path model. Relative paths resolve from `~/AgentDock`; a | Tool | Purpose | Common parameters or actions | | --- | --- | --- | -| `read_file` | Reads UTF-8 text in slices and supports `skill:///` | `path`, `start_line`, `end_line` | +| `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` | @@ -57,44 +57,46 @@ On Windows, file tools can use native WSL file semantics through `runtime=wsl`; | Tool | Purpose | Common parameters or actions | | --- | --- | --- | -| `exec_command` | Runs a command with timeout, output limits, and redaction | `cmd`, `workdir`, `timeout_ms`, `tty`, `skill` | +| `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 `skill=`, AgentDock uses the active Skill root as the default working directory and injects that Skill's isolated environment only into the child process. +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. Describe the coding task directly; the upstream agent manages the ACP session and progress flow. +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. | Tool | Purpose | Main actions | | --- | --- | --- | -| `acp_session` | Checks the configured Coding Agent and creates, resumes, configures, inspects, or closes persistent sessions | `info`, `authenticate`, `new`, `load`, `resume`, `fork`, `set_mode`, `set_config`, `list`, `inspect`, `close`, `delete` | -| `acp_prompt` | Starts a coding turn and reads progress, steering, or cancellation | `start`, `events`, `steer`, `cancel` | -| `acp_interaction` | Handles explicit permission interactions raised by the Coding Agent | `list`, `inspect`, `respond`, `cancel` | +| `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` | -A prompt `start` returns a `run_id` quickly; progress is read through `events` instead of keeping one tool call open for the entire coding turn. Permission responses can only select an option currently offered by the Coding Agent and allowed by local AgentDock policy. +`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. -See [Use local Coding Agents](../guides/coding-agents.md) for setup and project-access boundaries. +`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 local Coding Agents](../guides/coding-agents.md) for profiles, setup, and project-access boundaries. ## Recoverable tasks and Workflows | Tool | Purpose | Actions | | --- | --- | --- | | `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 NexusDock is configured | `publish`, `retire`, `list`, `get`, `get_many`, `match`, `vector_index` | +| `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 NexusDock is not configured. +`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 NexusDock is configured, 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. +`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 | | --- | --- | --- | @@ -102,21 +104,26 @@ See [Use local Coding Agents](../guides/coding-agents.md) for setup and project- `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. -## Skill packages and isolated environments +## Managed Skills and isolated environments | Tool | Purpose | Actions | | --- | --- | --- | -| `skill_package` | Validates, installs, activates, and rolls back Skills, and manages each Skill's isolated environment | `validate`, `install`, `activate`, `rollback`, `env_set`, `env_unset`, `env_list` | +| `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 Skill is a document-based working method read by the model, not a hidden executor. A typical flow is: +A typical flow is: ```text -agentdock_context -→ read_file skill:///SKILL.md -→ execute through real file, command, browser, or MCP tools +agentdock_context / workspace_context +→ select one exact Skill candidate +→ read_file +→ execute through real tools using the same returned skill_ref when needed ``` -`skill_package env_list` returns variable names and configuration state, never secret values. See [Use Skills](../concepts/skills.md) for usage details. +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 [Use Skills](../concepts/skills.md) for the user workflow. ## Dynamic MCP @@ -155,7 +162,7 @@ Image-producing tools such as browser screenshots usually return a lightweight a ## NexusDock Recall -These tools are exposed only when `AGENTDOCK_NEXUS_ENDPOINT` is configured: +These tools are exposed on a direct AgentDock connection when that device is paired with NexusDock: | Tool | Purpose | Common parameters or actions | | --- | --- | --- | @@ -175,7 +182,7 @@ Confirmation requirements depend on the action and destination. Destructive or p ## Private Notes -`private_note_manage` is exposed only when `AGENTDOCK_NEXUS_ENDPOINT` is configured: +`private_note_manage` is exposed on a direct AgentDock connection when that device is paired with NexusDock: | Tool | Purpose | Actions | | --- | --- | --- | @@ -198,7 +205,7 @@ These tools are exposed only when browser capabilities are enabled: | `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` creates an AgentDock-managed Chrome, Chromium, or Edge session. It supports headless mode, dedicated `profile_id` values, cookies, and localStorage injection. 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`. It does not take over an already-open personal browser. +`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. @@ -228,7 +235,7 @@ A failed command exit is still a normal tool result because AgentDock must prese } ``` -A failed domain check is not necessarily a tool-call error. For example, Skill validation can return `valid: false` with a list of issues. Callers should inspect MCP `isError` first, then read `command_ok`, `valid`, `changed`, or the relevant domain field. +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. 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 afc40ec..c4af1c2 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,79 +1,95 @@ # 使用 Skill -Skill 是一份给 Agent 阅读的工作说明,里面写明什么时候使用、要遵守什么步骤、需要哪些依赖,以及哪些操作必须谨慎确认。 - +Skill 是一份给 Agent 阅读的文档型工作方法,用来说明什么时候使用某项能力、要遵循哪些步骤、需要哪些依赖,以及哪些操作需要确认。 ## 官方核心 Skill -AgentDock 原生安装包和 Docker 镜像会自动安装并激活以下官方核心 Skill: +AgentDock 原生安装包和 Docker 镜像会随运行时提供这些核心 Skill: +- `agentdock-user-guide` - `skill-authoring` - `skill-installation` -- `skill-vetter-runtime` -它们与其他已安装 Skill 使用相同的版本选择和回滚机制。 +它们和其他 AgentDock managed Skill 使用相同模型:每个名称只保留一份当前内容。AgentDock 不维护可供选择的 Skill 历史版本,也没有 active-version 指针。 -`desktop` 以及需要账号、系统权限或第三方服务配置的 Skill 不会自动安装。 +需要额外账号、系统权限或第三方软件的 Skill 在实际需要时再单独安装。 ## 使用 Skill -直接告诉 Agent 你的目标即可,例如: +直接告诉 Agent 你的目标,例如: ```text -查看当前 Codex 额度。 -用 desktop Skill 操作这个 macOS 应用。 -安装并使用这个 Skill:https://example.com/example-skill.zip +Check current Codex allowance. +Use the desktop Skill to operate this macOS app. +Install and use this Skill: https://example.com/example-skill.zip ``` Agent 通常会: -1. 检查当前是否已经安装匹配的 Skill。 -2. 读取 Skill 的说明和安全边界。 -3. 检查需要的命令、账号或环境变量。 -4. 使用真实工具执行任务。 -5. 对有副作用的操作进行确认和验证。 +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 -项目可以在 `/.agents/skills//SKILL.md` 提供本地 Skill。`workspace_context` 只返回这些 Skill 的 `name`、`description` 和 `file` 索引,不会把 Skill 正文直接注入上下文;只有确定要使用某个 Skill 时,再用 `read_file` 读取返回的 `SKILL.md`。 +项目可以在 `/.agents/skills//SKILL.md` 提供本地 Skill。`workspace_context` 会索引它们,并返回 `name`、`description`、`source_type`、`source_id`、`skill_ref`、`file` 等来源信息;不会把 Skill 正文直接注入上下文。 -同名时优先使用当前项目的 workspace Skill,其次是 AgentDock Skill,最后才是 `~/.agents/skills` 下的全局 common Skill。 +即使名称相同,workspace Skill、AgentDock managed Skill 和 `~/.agents/skills` 下的 shared Skill 仍是不同候选。处理当前项目时通常会优先考虑 workspace 候选,但 Agent 必须使用实际选中候选自己的 `file` 和 `skill_ref`,而不是依靠全局名称优先级静默切换来源。 -## 安装 Skill +## 安装或更新 managed Skill -安装前应先确认来源可信。可以让 Agent 先校验包,再安装并激活: +安装前先确认来源可信。可以让 Agent 先做审查: ```text -请先审查这个 Skill 的来源、文件和权限需求,确认安全后再安装。 +Please review this Skill's source, files, portability, and permission requirements, then install it if the review is clean. ``` -远程地址必须指向 ZIP 包;本机来源可以是 Skill 目录或 ZIP 文件。一个 Skill 可以同时保留多个已安装版本,但任何时刻只有一个激活版本。安装新版时可以选择暂不激活;需要切换到已安装版本时使用 `skill_package activate`;切换失败时可以回滚到最近仍存在的旧版本。Skill 包不应包含 Token、Cookie、浏览器登录态或个人环境文件。 +`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 目录,也不需要执行迁移命令。 + +Skill 包不能包含 Token、Cookie、浏览器登录态、`.env`、缓存或设备私有数据。 ## 配置账号或 API Key -Skill 需要账号凭据时,让 Agent 使用该 Skill 的独立环境保存,例如: +managed Skill 需要凭据时,让 Agent 保存到该 Skill 的独立环境,例如: ```text -为 example-skill 配置 EXAMPLE_API_KEY,但不要在回复中回显真实值。 +Set EXAMPLE_API_KEY for example-skill without echoing the actual value in the reply. ``` -独立环境只在运行对应 Skill 时注入,不会写入 Skill 包,也不会永久污染系统环境。 +`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` 才会一并清理这些保留资源。 + +使用受支持的 AgentDock 安装器或内置更新器进行正常升级时,旧 managed Skill 布局会自动迁移,不需要用户手工搬目录。 ## 使用时要注意 -- 删除、发送、上传、支付、授权等操作仍需要明确确认。 -- Skill 说明不能突破运行用户、Docker volume 或系统权限。 +- 删除、发送、上传、支付或授权前应确认目标和副作用。 +- Skill 说明不能突破 AgentDock 进程、容器 volume 或操作系统的权限边界。 - 第三方 Skill 可能调用外部服务,安装前应检查来源和能力范围。 -- 遇到失败时,优先查看缺少的依赖或配置,不要把秘密粘贴到公开日志。 +- 不要把秘密粘贴到公开日志,也不要随 Skill 打包。 +- `content_digest` 表示内容身份和审计证据,不是产品版本号。 ## 查看已安装 Skill 可以直接询问: ```text -当前有哪些 Skill?它们分别做什么? +What Skills are available here, and where does each candidate come from? ``` -Agent 会先查看已安装 Skill 的名称和说明,需要时再读取对应使用文档。 +Agent 可以用 `agentdock_context` 查看 managed/shared 候选,用 `workspace_context` 查看当前项目候选,只在真正需要时读取完整 Skill 文档。 -创建或维护 Skill 属于开发者工作,见 [开发者指南](../contributing/development.md#skill-开发)。 +创建和维护 Skill 属于开发者工作,见 [开发者指南](../contributing/development.md#skill-开发)。 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 c776495..247a8a2 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,6 +1,6 @@ # 开发者指南 -本页面向准备修改 AgentDock 源码、文档或第一方 Skill 的贡献者。 +本页面面向准备修改 AgentDock 源码、公开文档或第一方 Skill 的贡献者。 代码和公开文档分别维护: @@ -19,7 +19,7 @@ make check 该命令执行格式化、测试、vet 和构建。局部开发可以先运行包级测试,提交前仍应执行完整检查。 -涉及并发、平台差异、安装器、Docker 或浏览器时,还应运行对应专项测试和真实验证。 +涉及并发、平台差异、安装器、Docker、浏览器、ACP 或桌面生命周期时,还要运行对应专项测试和真实环境验证。 ## 文档检查 @@ -30,16 +30,30 @@ pnpm install --frozen-lockfile pnpm check ``` -`pnpm check` 会运行 TypeScript 检查、Docusaurus 生产构建和内部链接验证。修改导航、布局或长表格后,还要用真实浏览器检查桌面和移动端。 +`pnpm check` 会运行 TypeScript 检查、locale 测试、中英文结构一致性检查、两个 locale 的生产构建以及默认生产构建。修改导航、布局或宽表格后,还应使用真实浏览器检查桌面和移动端页面。 + +## 公开契约原则 + +公开文档描述普通用户或第三方集成可以复现的行为,不是维护者个人笔记。 + +- 以当前 `main` 源码、公开 Release 资产、工具 Schema 和受支持的 UI/CLI 入口作为事实源。 +- 工具名称和 action 从真实 MCP 契约推导;能力是否存在以客户端的 `tools/list` 为准,不要把内部 helper 写成公开工具。 +- 运行配置从当前 Core 配置解析器和公开服务参数推导。安装器事务变量、测试开关、签名变量和维护者部署覆盖项不是用户配置。 +- 示例使用 `example.com`、``、`` 等通用占位符。禁止写入维护者用户名、设备名、私有主机名、本地项目路径、个人代理、私有端点或真实凭据。 +- 文档描述受支持默认值和用户可控覆盖方式,不复制维护者机器拓扑。平台示例应能在普通该平台安装中复现。 +- 主流程不保留兼容代码和迁移历史。只有当前用户仍可能遇到旧入口时才说明,并明确指出新的推荐方式。 +- 同一次改动保持英文和简体中文语义同步。 + +如果源码注释或历史文档与可执行行为冲突,应先核对真实契约和测试,再更新用户文档;不要为了和旧版本措辞一致而继续保留过期说明。 ## 改动原则 - 先检查现有目录、接口、错误处理和测试方式。 - 保持主流程可读,不为了形式化分层制造抽象。 -- 修改工具描述、Schema、路径、认证、命令、浏览器或桌面能力时同步更新测试。 -- 修改安装脚本时验证帮助文本、默认值、生成文件和代表性安装路径。 -- 不在公开文档中记录真实 Token、私有端点、个人目录或维护者凭据。 -- 迁移历史、临时兼容和维护者机器部署细节不进入用户文档。 +- 修改工具描述、Schema、路径、认证、命令、浏览器、ACP 或桌面能力时同步更新测试。 +- 修改安装器时验证帮助文本、默认值、生成文件、公开 Release 资产、升级、卸载和代表性安装路径。 +- 除非公开 action 明确要求破坏性清理,否则应保留用户数据;普通更新/移除和 purge 行为要分开描述。 +- 测试、示例、截图、日志和文档都不得暴露真实 Token、私有端点、个人目录或维护者凭据。 ## 工具结果约定 @@ -47,13 +61,13 @@ MCP 协议层错误使用 `isError`。正常工具结果不使用含义模糊的 - 命令使用 `command_ok`、`exit_code` 和 `command_error`。 - 浏览器使用 `browser_ok` 和 `browser_error`。 -- 其他工具使用 `valid`、`changed`、`configured` 等明确领域字段。 +- 其他工具使用 `changed`、`configured`、`written` 等明确的领域字段。 -新增或修改输出 Schema 时,要验证 `structuredContent` 不会泄漏内部 HTTP、WSL 子进程或 Runner 协议中的通用状态字段。 +新增或修改输出 Schema 时,要验证 `structuredContent` 不会泄漏内部 HTTP、WSL 子进程、安装器或 Runner 协议中的通用状态字段。 ## Skill 开发 -第一方 Skill 采用“可移植核心 + 可选 AgentDock 适配”。最小结构: +第一方 Skill 使用“可移植文档核心 + 可选 AgentDock 适配”模型。最小结构: ```text example-skill/ @@ -62,20 +76,34 @@ example-skill/ 按需增加 `references/`、`scripts/`、入口脚本和测试。要求: -- 包内使用相对路径。 -- 脚本只读取当前进程环境。 -- 不硬编码用户绝对路径、安装版本或 AgentDock 私有状态文件。 -- 不把环境文件、缓存、登录态和设备私有数据打进包。 -- 修改正文、引用或脚本后递增语义化版本。 -- 先用 `skill-authoring` 检查内容和可移植性,再用 `skill_package validate` 检查包结构。 +- `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 文档。 -Skill 使用方式见 [使用 Skill](../concepts/skills.md)。 +每个仓库的改动应能独立审查;公开契约跨仓库时,在 PR 中关联相关改动。 ## 提交与发布 - `main` 是稳定分支。 -- 提交信息使用 `type(scope): 中文说明`。 +- 提交信息遵循仓库当前约定;AgentDock 常用 `type(scope): 中文说明`。 - 提交前确认工作区只包含本次任务改动。 -- 推送后检查 GitHub Actions。 -- 文档改动上线后实际访问页面。 -- Release、签名、生产部署和维护者机器操作应遵循源码仓库当前维护规范,不复制到用户页面。 +- 提交前运行完整仓库检查,推送后检查 GitHub Actions。 +- 如果改动涉及导航、渲染、下载或可复制命令,发布后应实际访问部署页面验证。 +- Release 签名、生产部署和维护者机器操作应进入维护者 Runbook 或自动化,不写进普通用户页面。 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 764f6b9..8cc1fc2 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 @@ -89,7 +89,7 @@ MCP 客户端也在这台 Mac 上时选择。该模式不需要域名或 Cloudfl 4. 确认 AgentDock 已检测到受支持的浏览器。 5. 点击“应用并重启”。 -AgentDock 会为浏览器自动化使用独立的会话和 Profile,不会直接接管日常浏览器主 Profile。 +AgentDock 默认使用独立会话和 Profile。通过 CDP 附着已有 Chromium 系浏览器属于显式的高级模式,使用前请先阅读浏览器指南。 登录态和安全边界见 [浏览器自动化](../guides/browser-control.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 index 9929b76..4eb0aa7 100644 --- 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 @@ -41,6 +41,12 @@ curl -fL "$BASE_URL/$ASSET.sha256" -o "$TMP_DIR/$ASSET.sha256" ) 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" ``` @@ -68,13 +74,6 @@ sudo chown root:agentdock /etc/agentdock/agentdock.env sudo chmod 0640 /etc/agentdock/agentdock.env ``` -需要 NexusDock Recall 或 Workflow 模板时,额外配置: - -```bash -AGENTDOCK_NEXUS_ENDPOINT=https://nexus.example.com -AGENTDOCK_NEXUS_TOKEN= -``` - ## systemd unit 创建 `/etc/systemd/system/agentdock.service`: @@ -109,6 +108,19 @@ 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 示例: @@ -142,7 +154,7 @@ AGENTDOCK_OAUTH_TOKEN_SECRET=<至少-32-字节的随机签名密钥> ## 更新 -重新下载并校验目标 Release,覆盖 `/opt/agentdock/bin/agentdock`,然后重启: +重新下载并校验目标 Release,除了替换二进制,还要按上面的安装步骤刷新并 bootstrap 该 Release 的 `share/agentdock/core-skills` Bundle,然后重启: ```bash sudo systemctl restart agentdock 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 8bb171c..939a748 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 @@ -2,7 +2,7 @@ 启用浏览器能力后,Agent 可以打开网页、点击、输入、滚动、截图,并检查页面控制台、网络和页面错误。 -AgentDock 支持 Google Chrome、Chromium 和 Microsoft Edge。浏览器自动化使用由 AgentDock 管理的独立会话,与日常浏览器 Profile 分开。 +AgentDock 支持 Google Chrome、Chromium 和 Microsoft Edge。默认情况下,浏览器自动化会启动由 AgentDock 管理的独立会话;高级用户也可以选择通过 CDP 附着已有 Chromium 系浏览器,但这是显式开启的另一种隔离边界。 ## 开始前 @@ -44,18 +44,20 @@ AgentDock 支持 Google Chrome、Chromium 和 Microsoft Edge。浏览器自动 Agent 应先观察页面,再执行动作,最后重新检查页面状态。 -## 登录态与 Profile +## 登录态、Profile 与已有 CDP 浏览器 -需要保持登录时,使用 AgentDock 自己的浏览器 Profile。指定 `profile_id` 后,Profile 会保存在 AgentDock 的浏览器数据目录中,后续会话可以继续复用登录态。 +AgentDock 自有浏览器需要保持登录时,使用专用 `profile_id`。Profile 会保存在 AgentDock 自己的浏览器数据目录中,后续会话可以继续复用;不要把自有会话指向日常浏览器主 Profile。 -不要把 AgentDock 指向日常浏览器主 Profile。浏览器工具使用 AgentDock 管理的独立会话,不会接管已经打开的个人浏览器。 +高级配置也可以附着已经运行的 Chromium 系浏览器。单次 session 传入的 `cdp_url` 只允许回环地址;命名或远程 CDP 地址必须由用户在 AgentDock 设置中配置。`AGENTDOCK_BROWSER_CDP_URL` 用来指定已配置地址,`AGENTDOCK_BROWSER_REUSE_EXISTING_CDP=true` 则让 AgentDock 尝试复用唯一检测到的本地 CDP 浏览器。 + +通过 CDP 附着时,AgentDock 会在外部浏览器中创建并管理独立 target,关闭 AgentDock session 不会退出外部浏览器。外部 CDP session 不能使用 AgentDock 持久 `profile_id`、Cookie 注入或 localStorage 注入。外部浏览器可能还包含其他登录态,因此只应附着你明确用于自动化的浏览器实例。 首次登录仍可能需要你手动完成验证码、扫码或安全确认。不要让 Agent 在聊天或日志中回显密码、Cookie 或 Authorization Header。 ## 安全边界 - 上传文件、发送消息、提交表单、删除内容和授权前要确认目标与副作用。 -- 使用 AgentDock 专用 Profile,不要复用日常浏览器主 Profile。 +- 优先使用 AgentDock 自有专用 Profile;如果显式使用 CDP 附着,只暴露专门用于自动化的浏览器实例。 - 只给自动化访问任务需要的网站和文件。 - 不再需要登录态时,及时清理持久 Profile。 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 5db52cd..266c621 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,68 +1,93 @@ # 使用本地 Coding Agent -AgentDock 可以通过 ACP(Agent Client Protocol)把 MCP 客户端连接到本机 Coding Agent。这样 ChatGPT 或其他 MCP 客户端就可以把编码任务交给真正位于项目电脑上的 Codex、Claude 或 Grok Build 执行。 +AgentDock 可以通过 ACP(Agent Client Protocol)把 MCP 客户端连接到本地 Coding Agent,让 ChatGPT 或其他 MCP 客户端把编码任务交给项目所在电脑上的 Codex、Claude、Grok Build 或自定义 ACP Adapter。 -这是一项可选能力,默认关闭。 +ACP 是可选能力,默认关闭。 -## 支持的预设 +## 支持的 Profile -macOS 和 Windows 图形应用目前提供这些预设: +macOS 和 Windows 应用提供内置 Profile,也支持自定义 Adapter: -| 预设 | AgentDock 会查找的本地 Adapter | +| Profile 类型 | AgentDock 使用的本地 Adapter | | --- | --- | | Codex | `codex-acp` 或 `@agentclientprotocol/codex-acp` 包 | | Claude | `claude-agent-acp` 或 `@agentclientprotocol/claude-agent-acp` 包 | -| Grok Build | 使用 ACP/stdio 模式的 `grok` | +| Grok Build | `grok agent stdio` | +| Custom | Adapter 的绝对可执行路径和可选参数 | -启用前,请先在同一台电脑上安装并登录你要使用的 Coding Agent。AgentDock 不负责提供或管理对应服务商账号。 +内置 Profile ID 固定为 `codex`、`claude`、`grok`,因此每个内置类型只有一个 Profile;Custom 可以用不同 ID 创建多个 Profile。已启用的 Profile 中会选一个默认项,也可以在调用时用 `profile_id` 明确选择其他 Profile。 + +启用 Adapter 前,先安装并登录准备使用的 Provider。AgentDock 负责启动 Adapter,不管理 Provider 账号,也不会把 Provider 凭据复制进自己的配置。 ## macOS 和 Windows -1. 在运行 AgentDock 的电脑上安装目标 Coding Agent 或 ACP Adapter。 -2. 打开 AgentDock“高级设置”或 Windows 控制面板。 -3. 勾选“启用 Coding Agent”。 -4. 选择 **Codex**、**Claude** 或 **Grok Build**。 -5. 确认界面显示已经检测到对应 Adapter。 -6. 应用设置并重启 AgentDock 服务。 +1. 在运行 AgentDock 的同一台电脑上安装目标 Coding Agent,以及它需要的 ACP Adapter。 +2. macOS 打开“高级设置”,Windows 打开 AgentDock 控制面板。 +3. 启用 **Coding Agent (ACP)**。 +4. 新增或启用内置 Profile,或者为 Custom Profile 配置 Adapter 命令和参数。 +5. 从已启用 Profile 中选择一个默认项。 +6. 确认 AgentDock 能检测到 Adapter,保存设置,并让 AgentDock 重启 Core。 -重新连接 MCP 客户端后,可以通过 `agentdock_context` 确认 ACP 已启用,以及当前配置的 Adapter Profile。 +重新连接 MCP 客户端后,`agentdock_context` 会返回 `default_profile` 和已启用的 `profiles`。当前连接的 `tools/list` 应包含 `acp_session`、`acp_prompt`、`acp_interaction`。 -## 直接描述编码任务 +## 可以直接提出什么任务 -直接描述结果即可,例如: +直接描述目标即可,例如: ```text -使用这台电脑上的本地 Coding Agent 检查仓库,修复失败测试,并验证修改结果。 +Use the local Coding Agent on this computer to inspect the repository, fix the failing tests, and verify the change. ``` -对于耗时较长的编码任务,AgentDock 会异步启动 Coding Agent,并让上游 Agent 持续读取进度事件。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。 + +长 Prompt 会异步启动并返回 Run ID,上游 Agent 持续读取有序事件,直到 Run 收敛。权限请求仍保持显式,只能选择 Adapter 当前提供且 AgentDock 本地策略允许的选项。 ## 项目目录 -Coding Agent 会话可以使用 AgentDock 运行用户本身有权限访问的任意目录。AgentDock 不再维护额外的项目目录白名单。 +Coding Agent session 可以使用 AgentDock 操作系统用户有权限访问的目录。AgentDock 不额外维护项目目录白名单。 -这并不等于操作系统沙箱。如果某个 Coding Agent 只能访问指定项目,应通过独立系统用户、文件权限、容器挂载等宿主机边界限制访问范围。 +这不是操作系统沙箱。需要把 Coding Agent 限制在特定项目时,应通过操作系统账号、文件权限、容器挂载或其他宿主机边界实现。 -## 无图形界面的服务部署 +## 无界面或服务部署 -没有桌面界面时,可以通过宿主机配置启用 ACP。最少需要提供 Adapter 的绝对可执行文件路径: +没有桌面 UI 时,在 Core 启动环境中配置一个或多个 ACP Profile。例如 Codex Profile: ```bash AGENTDOCK_ACP_ENABLED=true -AGENTDOCK_ACP_AGENT=codex -AGENTDOCK_ACP_COMMAND=/absolute/path/to/codex-acp +AGENTDOCK_ACP_PROFILES_JSON='[{"id":"codex","kind":"codex","command":"/absolute/path/to/codex-acp","enabled":true}]' +AGENTDOCK_ACP_DEFAULT_PROFILE=codex ``` -可选参数和环境变量映射见 [配置参考](../reference/configuration.md)。凭据应保存在宿主机环境变量中,不要直接塞进命令参数。 +自定义 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,并返回实际能力或认证方式。 + +使用非默认 Profile 时,其 session、prompt 和 interaction 后续调用要持续传同一个 `profile_id`。 -## 常见问题 +## 故障排查 如果 Coding Agent 无法启用或启动: -- 确认所选 Adapter 已安装,并且 AgentDock 的运行用户可以直接执行它。 -- macOS 或 Windows 上重新打开高级设置,检查 Adapter 检测提示。 -- 无图形界面的部署要确认 `AGENTDOCK_ACP_COMMAND` 是绝对可执行文件路径。 -- 使用 `AGENTDOCK_ACP_ENV_FROM_ENV_JSON` 时,确认映射引用的宿主机环境变量确实存在。 -- 用 `agentdock_context` 确认 ACP 已启用且选择了预期 Adapter,再让 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 连接并新建会话。 -用户可见的 ACP 工具边界见 [工具介绍](../reference/tools.md)。 +公开工具契约见 [工具参考](../reference/tools.md#coding-agentacp),宿主配置见 [配置参考](../reference/configuration.md#coding-agentacp)。 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 index 146263d..096e8f8 100644 --- 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 @@ -13,11 +13,11 @@ Docker、远程 VPS、系统级后台服务和未登录会话不能控制真实 把下面这句话发给已经连接 AgentDock 的客户端: ```text -请读取官方 AgentDock Skills 目录中的 desktop 条目,按其中的摘要校验软件包,然后安装并激活: +请读取官方 AgentDock Skills 目录中的 desktop 条目,审查软件包来源和权限,按其中的摘要校验软件包,然后安装它的当前内容: https://raw.githubusercontent.com/uvwt/agentdock-skills/main/catalog.json ``` -Desktop Skill 在 [uvwt/agentdock-skills](https://github.com/uvwt/agentdock-skills) 中独立版本化和发布,目录会锁定下载地址与 SHA-256 摘要。安装完成后可以询问“当前 desktop Skill 是否已经激活”进行确认。 +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 权限 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 706c2c9..4c75afb 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,6 +1,6 @@ # Linux 进阶配置 -本页介绍交互式安装、Cloudflare Tunnel、修改目录和端口、服务管理器、NexusDock 和二进制安装。 +本页介绍交互式安装、Cloudflare Tunnel、修改目录和端口、服务管理器、可选 NexusDock 配对,以及不注册系统服务的安装方式。 ## Alpine 与极简系统 @@ -22,7 +22,7 @@ curl -fsSL https://github.com/uvwt/agentdock/releases/latest/download/install.sh sh /tmp/install-agentdock.sh ``` -普通部署保持 `binary` 即可。`source` 和 `auto` 只用于开发或预编译产物不可用的调试场景。 +公开安装器会按当前架构使用预编译 Release 包。源码构建属于贡献者工作,不是安装器模式。 ## Cloudflare Tunnel @@ -43,7 +43,7 @@ sh /tmp/install-agentdock.sh 完成框会显示公网地址、MCP 地址、Bearer Token 和 OAuth 登录密码。OAuth 签名密钥不会显示。Tunnel Token 只写入 root-only 的 `/etc/agentdock/cloudflared.env`,不会写入 `agentdock.env`、传给 AgentDock,也不会出现在 `cloudflared` 命令行中。 -临时地址变化后,重新运行同一个安装脚本即可。现有监听地址、端口、高级配置、Bearer Token、OAuth 密码、签名密钥和 NexusDock 配置都会保留;安装器会自动回写新地址并重启 AgentDock。客户端仍需替换旧 MCP URL,并重新完成 OAuth 授权。 +临时地址变化后,重新运行同一个安装脚本即可。现有监听地址、端口、高级配置、Bearer Token、OAuth 密码和签名密钥都会保留;已经配对的 NexusDock 设备身份位于 AgentDock 状态目录中,重新运行安装器不会替换它。安装器会自动回写新地址并重启 AgentDock。客户端仍需替换旧 MCP URL,并重新完成 OAuth 授权。 默认 Tunnel 服务名是 `agentdock-cloudflared`: @@ -117,8 +117,6 @@ sudo env \ | `AGENTDOCK_HOST` | 监听地址 | | `AGENTDOCK_PORT` | 监听端口 | | `AGENTDOCK_AUTH_TOKEN` | 自定义 Bearer Token | -| `AGENTDOCK_NEXUS_ENDPOINT` | NexusDock 地址 | -| `AGENTDOCK_NEXUS_TOKEN` | NexusDock Token | | `AGENTDOCK_TUNNEL_MODE` | `none`、`quick` 或 `named` | | `AGENTDOCK_SERVER_URL` | Named Tunnel 和 OAuth 使用的固定 HTTPS Origin | | `AGENTDOCK_CLOUDFLARE_TUNNEL_TOKEN` | Named Tunnel Token,只保存在 `cloudflared.env` | @@ -126,7 +124,18 @@ sudo env \ 不要把真实 Token 写进仓库。未提供 `AGENTDOCK_AUTH_TOKEN` 时,安装器会自动生成并写入 root-only 环境文件。 -## 只安装二进制 +## 配对 NexusDock + +NexusDock 在 AgentDock 安装完成后单独配对,不再通过安装器环境变量配置。使用默认 Linux 服务用户和安装目录时,先在 **NexusDock → 设置 → 系统与节点** 生成一次性配对码,再执行: + +```bash +sudo -u agentdock -H /opt/agentdock/bin/agentdock nexus pair --endpoint https://nexus.example.com --code +sudo systemctl restart agentdock +``` + +OpenRC 环境改为重启对应的 `agentdock` 服务。如果自定义了服务用户或安装目录,应使用实际值。不要重新写回旧 Nexus endpoint/token 环境变量。 + +## 不注册系统服务 不希望注册系统服务时: @@ -137,7 +146,7 @@ sudo env \ sh /tmp/install-agentdock.sh ``` -这种模式不会自动启动 AgentDock,需要手动运行 `/opt/agentdock/bin/agentdock`。 +这种模式仍会安装 Release 运行时和随包发布的核心 Skill,但不会注册或启动系统服务;需要时手动运行 `/opt/agentdock/bin/agentdock`。 ## 修改端口或 Token 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 index 339ce2c..9c582b2 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/macos.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/macos.md @@ -42,7 +42,8 @@ sh /tmp/agentdock-install.sh --register-service --version vX.Y.Z ## 修改安装目录 ```bash -sh /tmp/agentdock-install.sh --register-service --install-dir "$HOME/bin" +AGENTDOCK_INSTALL_DIR="$HOME/bin" \ + sh /tmp/agentdock-install.sh --register-service ``` 修改目录后要确保该目录已经加入 PATH,或始终使用完整路径启动。 @@ -122,30 +123,20 @@ tail -f "$HOME/Library/Logs/AgentDock/cloudflared.err.log" 具体步骤见 [macOS 桌面自动化](../guides/desktop-automation.md)。 -## 更新与备份 +## 更新 -重新运行安装脚本即可升级。旧二进制会备份到: - -```text -~/.agentdock/backups/bin -``` - -运行数据和默认工作目录不会被删除。 +重新运行同一个 `install.sh` 入口即可升级。安装器会事务性准备目标 Release、同步随 Release 发布的核心 Skill、验证新运行环境,并保留 AgentDock 状态和默认工作目录。安装失败由安装器执行回滚,不需要用户维护可选择的二进制或 Skill 历史版本。 ## 卸载 AgentDock -删除应用前,先在“高级设置”中关闭“登录后显示 AgentDock 菜单栏”,应用更改后退出 AgentDock。 - -下载并运行官方卸载脚本: +公开的 Unix 维护入口与安装时相同,统一使用 `install.sh`;AgentDock Release 不再单独发布 macOS 卸载脚本。需要时重新下载当前入口,然后执行: ```bash -curl -fL https://github.com/uvwt/agentdock/releases/latest/download/uninstall-macos.sh \ - -o /tmp/uninstall-agentdock.sh -zsh /tmp/uninstall-agentdock.sh +curl -fL https://github.com/uvwt/agentdock/releases/latest/download/install.sh \ + -o /tmp/agentdock-install.sh +sh /tmp/agentdock-install.sh --uninstall ``` -默认命令会删除后台服务、支持文件和日志,但保留二进制、`~/.agentdock` 与 `~/AgentDock`。 - -需要同时删除安装的二进制时使用 `--remove-binary`。只有明确要删除二进制、全部 AgentDock 状态、浏览器支持和默认工作目录时,才使用 `--purge-data`。 +普通 macOS 卸载会清理 AgentDock 后台服务、已安装 CLI/运行文件、图形应用以及 AgentDock 应用日志/配置,但保留 `~/.agentdock` 与 `~/AgentDock` 用户数据。 -最后把“应用程序”中的 `AgentDock.app` 移到废纸篓。 +只有明确要把这些保留的 AgentDock 状态和默认工作目录内容也删除时才使用 `--purge-data`。自定义布局执行破坏性 purge 时要求显式提供用户数据路径,避免把继承的环境值误当成删除目标。 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 315968a..b8dbd5b 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 @@ -77,7 +77,7 @@ docker compose up -d --force-recreate - 确认 AgentDock 在当前 macOS 登录会话中运行。 - 检查屏幕录制和辅助功能权限。 -- 重新读取当前激活的 `desktop` Skill 文档。 +- 用 `agentdock_context` 找到当前 `desktop` Skill 候选,再重新读取宿主返回的 Skill 文件。 - 操作前后分别观察应用状态或截图,不要只依赖命令返回成功。 - 坐标可能因窗口位置、缩放或多显示器变化而失效,应优先使用辅助功能元素。 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 index f74a53a..b5a4908 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/windows.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/operations/windows.md @@ -119,26 +119,6 @@ Bearer Token、OAuth 密码、OAuth 签名密钥和 Tunnel Token 使用当前用 ## 卸载 -从 Windows **设置 > 应用 > 已安装的应用** 卸载,或使用开始菜单中的“卸载 AgentDock”。 +使用 Windows **设置 > 应用 > 已安装的应用**,或开始菜单中的“卸载 AgentDock”。已安装的卸载器是受支持入口,并会让用户选择是否同时删除保留的 AgentDock 任务、Skill、配置、浏览器状态和默认工作目录数据。 -自动化卸载可以运行 Release 中的脚本: - -```powershell -$uninstaller = Join-Path $env:TEMP 'uninstall-windows.ps1' -Invoke-WebRequest ` - https://github.com/uvwt/agentdock/releases/latest/download/uninstall-windows.ps1 ` - -OutFile $uninstaller -powershell -ExecutionPolicy Bypass -File $uninstaller -``` - -同时删除任务、Skill、配置和默认工作目录: - -```powershell -powershell -ExecutionPolicy Bypass ` - -File $uninstaller ` - -PurgeState -``` - -:::danger -`-PurgeState` 会删除用户数据和默认工作目录。执行前先备份需要保留的内容。 -::: +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 6435fbc..a019597 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,60 +1,57 @@ # 配置 -AgentDock 当前不读取统一的 YAML、JSON 或 TOML 配置文件。运行配置通过环境变量提供,部分常用项还可以使用 CLI 参数覆盖。 +AgentDock Core 不读取统一的 YAML、JSON 或 TOML 配置文件。运行参数来自环境变量,少量常用项也可以通过命令行参数覆盖;使用桌面安装包和控制面板时,应优先让图形界面管理这些设置。 :::tip -首次安装请使用对应平台的安装指南。本页集中说明端口、远程访问、认证、浏览器、NexusDock 和高级部署配置。 +首次安装请使用对应平台的安装指南。本页主要作为运行行为、无界面部署和高级配置的参考。 ::: -## 常用配置 +## 选择正确的配置入口 -| 场景 | 需要处理的内容 | +| 场景 | 推荐配置入口 | | --- | --- | -| 本机前台运行 | 通常保持 `127.0.0.1` 和默认端口即可 | -| Docker | `.env` 中的 `AGENTDOCK_AUTH_TOKEN`,其余使用 Compose 默认值 | -| 浏览器自动化 | 启用浏览器工具,并准备 Chrome、Edge 或 browser 镜像 | -| NexusDock(Recall、Workflow、Evolution、私密笔记) | 配置服务地址和可选 Token | -| 局域网或公网访问 | 认证、HTTPS 和反向代理,不能只修改监听地址 | +| macOS 或 Windows 桌面应用 | AgentDock 控制面板 / 高级设置 | +| 直接前台运行 | 环境变量和受支持的 CLI 参数 | +| Docker 或 Compose | 容器 `environment`、`env_file` 或 secret 注入 | +| Linux 服务 | 权限受限的服务环境文件 | +| NexusDock | 使用 `agentdock nexus pair` 配对设备;不要再把旧 Nexus 凭据写进 Core 环境 | -推荐按部署方式管理配置: +不要把 Token、密码、Cookie、私钥、OAuth Secret 或设备身份提交到源码仓库。 -- 本地前台运行:Shell 环境变量或 CLI 参数。 -- Docker Compose:`environment` 或项目根目录的本地 `.env`。 -- systemd:权限受限的 `EnvironmentFile`。 -- Windows 登录自启动:安装脚本生成的当前用户配置和 DPAPI 保护数据。 +## 优先级与目录 -不要把 Token、密码、Cookie、私钥或 OAuth Secret 提交到源码仓库。 - -## 配置方式与优先级 - -AgentDock 启动时按以下顺序解析: +普通 Core 运行配置按以下顺序解析: 1. 内置默认值。 2. 环境变量。 -3. CLI 参数。 +3. 受支持的 CLI 参数。 -CLI 只覆盖它明确提供的参数。认证秘密、OAuth 密码和 NexusDock Token 等配置只能通过环境变量提供。 +CLI 只覆盖它实际提供的项目。例如在无界面部署中,认证秘密和 ACP Profile JSON 仍通过环境提供。 -AgentDock 的两个主要目录由运行它的操作系统用户决定: +两个主要目录由实际运行 AgentDock 的操作系统用户决定: ```text -~/.agentdock 内部状态、Skill、任务、MCP 配置和 Artifact -~/AgentDock 文件、命令和 Git 工具的默认工作目录 +~/.agentdock Internal state, managed Skills, tasks, MCP configuration, browser data, and artifacts +~/AgentDock Default working directory for relative file and command operations ``` -需要修改目录时,可以把 `AGENTDOCK_HOME` 或 `AGENTDOCK_DEFAULT_DIR` 设置为绝对路径。需要更强的数据隔离时,仍应使用独立系统用户或明确的容器挂载。 +需要更换位置时,将 `AGENTDOCK_HOME` 或 `AGENTDOCK_DEFAULT_DIR` 设为绝对路径。需要更强隔离时,应使用操作系统账号、权限或容器挂载,而不是把 AgentDock 路径配置当成沙箱。 ## CLI 参数 -| 参数 | 对应环境变量 | 默认值 | 说明 | +当前服务入口提供这些参数: + +| 参数 | 环境变量 | 默认值 | 用途 | | --- | --- | --- | --- | | `--host` | `AGENTDOCK_HOST` | `127.0.0.1` | HTTP 监听地址 | -| `--port` | `AGENTDOCK_PORT` | `8765` | HTTP 监听端口,范围 `1`~`65535` | +| `--port` | `AGENTDOCK_PORT` | `8765` | HTTP 端口,范围 `1`~`65535` | | `--log-level` | `AGENTDOCK_LOG_LEVEL` | `info` | `debug`、`info`、`warn` 或 `error` | -| `--nexus-endpoint` | `AGENTDOCK_NEXUS_ENDPOINT` | 空 | NexusDock 服务根地址 | -| `--browser-enabled` | `AGENTDOCK_BROWSER_ENABLED` | `false` | 暴露浏览器自动化工具 | -| `--browser-executable-path` | `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | 空 | 指定 Chrome、Chromium 或 Edge 可执行文件 | -| `--stdio` | `AGENTDOCK_STDIO` | `false` | 通过标准输入输出提供 JSON-RPC,不启动 HTTP 服务 | +| `--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 服务 | 示例: @@ -65,62 +62,59 @@ agentdock \ --log-level info ``` -## 基础运行配置 +NexusDock 不再属于服务参数。配对会建立独立设备身份,由 AgentDock 在普通运行配置之外加载。 -| 环境变量 | 默认值 | 说明 | +## Core 运行环境变量 + +| 环境变量 | 默认值 | 用途 | | --- | --- | --- | -| `AGENTDOCK_HOME` | `~/.agentdock` | AgentDock 内部状态目录;手工设置时必须解析为绝对目录 | -| `AGENTDOCK_DEFAULT_DIR` | `~/AgentDock` | 相对文件、命令和 Git 操作的默认工作目录;手工设置时必须解析为绝对目录 | -| `AGENTDOCK_HOST` | `127.0.0.1` | HTTP 监听地址;非回环地址必须启用 Bearer Token 或 OAuth | -| `AGENTDOCK_PORT` | `8765` | HTTP 监听端口 | +| `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 模式 | -| `AGENTDOCK_BROWSER_ENABLED` | `false` | 是否暴露 `browser_*` 工具 | -| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | 空 | 可选的 Chrome、Chromium 或 Edge 可执行文件绝对路径 | -| `AGENTDOCK_NEXUS_ENDPOINT` | 空 | NexusDock 服务根地址;启用 Recall、Workflow、Evolution 和私密笔记能力 | -| `AGENTDOCK_NEXUS_TOKEN` | 空 | NexusDock Bearer Token | +| `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` 是显式允许列表,不会把整个宿主环境透传给子进程。例如: -布尔值统一使用 `true` 或 `false`,避免不同服务管理器产生解析差异。 +```bash +AGENTDOCK_COMMAND_ENV_FROM_ENV_JSON='{"HTTP_PROXY":"HTTP_PROXY","HTTPS_PROXY":"HTTPS_PROXY"}' +``` + +Skill 运行时保留变量 `SKILL_DATA_DIR` 不能通过该映射或请求级命令环境覆盖。 ## Bearer Token 认证 -最简单的 HTTP 认证方式是设置: +最简单的 HTTP 认证方式: ```bash export AGENTDOCK_AUTH_TOKEN="$(openssl rand -hex 32)" ``` -客户端访问 `/mcp` 时发送: +客户端调用 `/mcp` 时发送: ```http Authorization: Bearer ``` -只监听回环地址时允许不配置认证;一旦监听 `0.0.0.0`、局域网地址或公网地址,AgentDock 会拒绝在无认证状态下启动。 - -Docker Compose 示例: - -```yaml -services: - agentdock: - environment: - AGENTDOCK_AUTH_TOKEN: "${AGENTDOCK_AUTH_TOKEN:?set AGENTDOCK_AUTH_TOKEN}" -``` +只监听回环地址时可以不启用认证;非回环 HTTP 监听如果既没有 Bearer Token 也没有 OAuth,AgentDock 会拒绝启动。 ## OAuth 配置 -OAuth 适合 ChatGPT 等需要浏览器授权流程的远程 MCP 客户端。AgentDock 支持 Authorization Code、PKCE S256、动态客户端注册和 Refresh Token;兼容客户端可以通过服务端元数据自动完成注册,不需要管理员预先创建 Client ID 或 Client Secret。 +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` 用于控制 Access Token 有效期,默认 `1h`;支持 `12h` 这类 Go duration、`90d` 这类整数天数以及 `never`。 +| `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` | 示例: @@ -131,172 +125,124 @@ AGENTDOCK_OAUTH_PASSWORD= AGENTDOCK_OAUTH_TOKEN_SECRET= ``` -可使用 OpenSSL 生成随机值: - -```bash -openssl rand -base64 24 -openssl rand -hex 32 -``` - -`AGENTDOCK_SERVER_URL` 必须是没有路径、查询参数或 Fragment 的完整 Origin。非回环地址必须使用 HTTPS;仅 `localhost` 或回环 IP 可以使用 HTTP。客户端实际填写的 MCP 地址则需要附加 `/mcp`,例如 `https://agentdock.example.com/mcp`。 +`AGENTDOCK_SERVER_URL` 是 Origin,不包含 MCP 路径。非回环公网 Origin 必须使用 HTTPS;客户端 MCP 地址再附加 `/mcp`,例如 `https://agentdock.example.com/mcp`。 -启用后会公开以下 OAuth 入口: - -| 路径 | 用途 | -| --- | --- | -| `/.well-known/oauth-authorization-server` | OAuth Authorization Server 元数据 | -| `/.well-known/oauth-protected-resource/mcp` | MCP Protected Resource 元数据 | -| `/register` | 动态客户端注册 | -| `/oauth/authorize` | 浏览器授权页 | -| `/oauth/token` | Authorization Code 和 Refresh Token 兑换 | - -Bearer Token 和 OAuth 可以同时配置。只需要一种认证方式时,不要额外保留无用秘密。面向 ChatGPT 的完整连接流程见 [使用 ChatGPT 连接 AgentDock](../guides/chatgpt.md)。 +Bearer Token 和 OAuth 可以同时存在。不要因为旧部署曾经使用某个秘密,就长期保留已经不用的配置。 ## 可信反向代理 -默认情况下,AgentDock 不信任客户端提供的 `X-Forwarded-For`。只有反向代理确实位于受控网段,并且会正确重写代理链时,才配置: +AgentDock 默认不信任任意 `X-Forwarded-For`。只有代理由你控制并正确重写转发链时,才配置代理网段: ```bash AGENTDOCK_TRUSTED_PROXY_CIDRS=127.0.0.0/8,::1/128 ``` -多个网段使用逗号分隔。不要把不受控制的公网网段加入该变量,否则认证限流和客户端地址判断可能被伪造。 +不要信任过宽的公网网段。客户端地址会参与认证与限流相关判断。 -## NexusDock Recall、Workflow、Evolution 与私密笔记 +## 配对 NexusDock -配置 NexusDock 后,AgentDock 会暴露 `recall_*`、`workflow_template_manage`、`evolve` 和 `private_note_manage`。Recall 与 Workflow 使用 NexusDock 共享服务,Evolution 生命周期策略由 AgentDock 负责,私密笔记使用 NexusDock Private Notes: +当前 AgentDock 通过设备配对身份连接 NexusDock。旧 `AGENTDOCK_NEXUS_ENDPOINT` 和 `AGENTDOCK_NEXUS_TOKEN` 不再是受支持的 Core 配置来源;服务启动前会清理这两个旧环境变量,只从成功配对产生的身份加载 Nexus 信息。 + +先在 **NexusDock → 设置 → 系统与节点** 生成一次性配对码,再在目标 AgentDock 设备执行控制台生成的命令。通用形式: ```bash -AGENTDOCK_NEXUS_ENDPOINT=https://nexus.example.com -AGENTDOCK_NEXUS_TOKEN= +agentdock nexus pair \ + --endpoint https://nexus.example.com \ + --code \ + --name ``` -`AGENTDOCK_NEXUS_ENDPOINT` 使用 NexusDock 服务根地址,不要附加具体 API 路径。未配置时: +查看已保存的配对状态: -- 本地 `task_manage` 仍可管理普通可恢复任务。 -- `evolve`、`recall_*`、`workflow_template_manage` 和 `private_note_manage` 不会出现在 `tools/list`。 +```bash +agentdock nexus status +``` -多设备路由、fleet 上下文和节点 Artifact 下载见 [NexusDock](../concepts/nexusdock.md)。 +配对后重启 AgentDock。身份加载成功后,直连 AgentDock 可以暴露 Nexus 支持的 Recall、Workflow、Evolution 和私密笔记能力,同时设备也会建立到 Nexus 的出站 Bridge 连接。 -## Coding Agent(ACP) +多设备路由和 fleet MCP 入口见 [NexusDock](../concepts/nexusdock.md)。 -ACP 默认关闭。macOS 和 Windows 用户通常直接在 AgentDock 高级设置中启用即可,完整流程见 [使用本地 Coding Agent](../guides/coding-agents.md)。 +## Coding Agent(ACP) -无图形界面的部署可以使用这些宿主机配置: +ACP 默认关闭。macOS 和 Windows 用户通常直接在 AgentDock UI 配置。无界面部署使用 Profile 模型: -| 环境变量 | 默认值 | 说明 | +| 环境变量 | 默认值 | 用途 | | --- | --- | --- | -| `AGENTDOCK_ACP_ENABLED` | `false` | 是否暴露内置 ACP 工具 | -| `AGENTDOCK_ACP_AGENT` | `claude` | 当前 Coding Agent 的简短配置名称 | -| `AGENTDOCK_ACP_COMMAND` | 空 | 启用 ACP 时必填的 Adapter 可执行文件绝对路径 | -| `AGENTDOCK_ACP_ARGS_JSON` | 空 | 可选的 Adapter 参数 JSON 字符串数组 | -| `AGENTDOCK_ACP_ENV_FROM_ENV_JSON` | 空 | 可选 JSON 对象,把子进程变量名映射到已有宿主机变量名 | -| `AGENTDOCK_ACP_MAX_CONCURRENT_PROMPTS` | `2` | 同时运行的 Prompt 上限,范围 `1` 到 `8` | -| `AGENTDOCK_ACP_INTERACTION_TIMEOUT_MS` | `300000` | 权限交互超时毫秒数,范围 `1000` 到 `3600000` | +| `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_ENV_FROM_ENV_JSON='{"OPENAI_API_KEY":"OPENAI_API_KEY"}' +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 ``` -映射只保存变量名;AgentDock 启动时再把宿主机中的当前值传给子进程。凭据应保存在宿主机环境中,不要直接写进 `AGENTDOCK_ACP_ARGS_JSON`。 +`env_from_env` 只映射变量名,不保存真实值。Provider 凭据应留在宿主环境或 Provider 自己的登录存储中。 -AgentDock 不再维护 ACP 项目根目录白名单。会话可以使用运行用户有权限访问的任意宿主机目录;需要更严格边界时,应使用操作系统权限或容器挂载限制 Coding Agent。 +旧 `AGENTDOCK_ACP_AGENT`、`AGENTDOCK_ACP_COMMAND`、`AGENTDOCK_ACP_ARGS_JSON`、`AGENTDOCK_ACP_ENV_FROM_ENV_JSON` 只在没有 Profile JSON 时作为旧单 Profile 配置的升级兼容入口。新配置统一使用 Profiles。 -## 工作区规则 +Adapter 发现与验证流程见 [使用本地 Coding Agent](../guides/coding-agents.md)。 -AgentDock 不通过环境变量配置项目规则。全局规则固定为 `~/.agentdock/AGENTS.md`;项目规则使用 `/AGENTS.md`,并可由子目录逐级继承。 +## 工作区规则 -操作具体项目、切换工作区或工作区规则可能变化时,先调用 `workspace_context`。可选 `workdir` 只影响本次请求,不会修改后续命令的默认工作目录。工具会返回当前生效的 `AGENTS.md` 链,以及 `/.agents/skills/*/SKILL.md` 下的工作区 Skill 索引;需要完整 Skill 说明时,再用 `read_file` 读取返回的文件路径。 +项目规则不通过环境变量配置。固定全局规则文件是 `~/.agentdock/AGENTS.md`;项目规则使用 `/AGENTS.md`,并可通过子目录继承。 -MCP 初始化 Instructions 只保留稳定的 AgentDock 使用说明,不会嵌入任何 `AGENTS.md` 正文。 +操作项目、切换工作区或规则可能变化时调用 `workspace_context`。可选 `workdir` 只影响本次上下文选择。它还会索引 `/.agents/skills/*/SKILL.md`,返回精确 Skill 来源和引用,但不直接注入 Skill 正文。 ## 浏览器工具 -浏览器自动化默认关闭,可以这样启用: - -```bash -AGENTDOCK_BROWSER_ENABLED=true -``` - -或: +浏览器自动化默认关闭: -```bash -agentdock --browser-enabled -``` - -AgentDock 支持 Chrome、Chromium 和 Microsoft Edge。自动检测不适用时,可以显式配置浏览器可执行文件路径。 - -| 环境变量 | 默认值 | 说明 | +| 环境变量 | 默认值 | 用途 | | --- | --- | --- | -| `AGENTDOCK_BROWSER_ENABLED` | `false` | 暴露 `browser_session`、`browser_act` 和 `browser_snapshot` | -| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | 空 | 自动检测不合适时,可指定浏览器可执行文件绝对路径 | +| `AGENTDOCK_BROWSER_ENABLED` | `false` | 暴露浏览器工具 | +| `AGENTDOCK_BROWSER_EXECUTABLE_PATH` | 空 | 自动检测不适用时指定浏览器可执行文件绝对路径 | +| `AGENTDOCK_BROWSER_CDP_URL` | 空 | 用户配置的现有 Chromium CDP 地址 | +| `AGENTDOCK_BROWSER_REUSE_EXISTING_CDP` | `false` | 发现并复用唯一的本地 CDP 浏览器 | -macOS 和 Windows 图形应用会在启用前检测已经安装的受支持浏览器。Docker browser 镜像直接包含 Chromium,并自动配置可执行文件路径。使用方式见 [浏览器自动化](../guides/browser-control.md)。 +AgentDock 支持 Chrome、Chromium 和 Microsoft Edge。不使用 CDP 复用时,AgentDock 会启动并管理独立浏览器进程;附着外部 CDP 浏览器时,AgentDock 会在其中创建自己的独立 target,关闭 AgentDock session 不会终止外部浏览器。 -## Skill 与动态 MCP 的独立环境 +单次 `browser_session` 调用传入的 `cdp_url` 仅允许回环地址。命名或远程 CDP 地址必须由用户在 AgentDock 设置中配置。外部 CDP 浏览器不能同时使用持久 `profile_id`、Cookie 注入或 localStorage 注入。 -Skill 和动态 MCP 的业务秘密不应长期放在 AgentDock 主进程环境中。优先使用各自的独立环境: +使用方式和安全边界见 [浏览器自动化](../guides/browser-control.md)。 -```json -{ - "action": "env_set", - "skill": "example-skill", - "key": "EXAMPLE_API_KEY", - "value": "..." -} -``` +## managed Skill 与动态 MCP 的独立环境 -```json -{ - "action": "env_set", - "name": "example-mcp", - "key": "SERVICE_TOKEN", - "value": "..." -} -``` +managed Skill 和动态 MCP Server 的业务凭据应与包定义分开。使用 `skill_manage` 和 `mcp_manage` 的环境 action,而不是把秘密放进 Skill 包、MCP Registry 条目或永久全局环境。 -分别通过 `skill_package` 和 `mcp_manage` 调用。`env_list` 只返回变量名和是否已配置,不返回真实值。 +`env_list` 只返回变量名和配置状态,不返回明文。managed Skill 只有在命令使用精确 managed `skill_ref` 时才会收到保留的 `SKILL_DATA_DIR`;shared 和 workspace Skill 不会继承它。 ## 私密笔记 -从 `v0.4.4` 开始,`private_note_manage` 通过 NexusDock Private Notes 接口工作,不再读取 AgentDock 本机的私密笔记目录或 `AGENTDOCK_PRIVATE_NOTES_*` 环境变量。需要先配置 `AGENTDOCK_NEXUS_ENDPOINT` 和可选 Token。 - -NexusDock 负责明文存储边界、age X25519 密文备份和 Git 忽略规则。可以通过维护动作初始化或检查加密: - -```json -{ - "action": "maintain", - "maintenance_action": "init-encryption" -} -``` - -搜索只匹配标题、简介、标签、分类和路径等安全元数据,不搜索或返回正文。只有显式 `read` 才返回明文;`write` 和 `delete` 都需要 `confirmed=true`。 - -## 查看当前状态 +当前 AgentDock 与 NexusDock 完成配对后才会提供 `private_note_manage`。它使用 NexusDock Private Notes 服务,不通过本地私密笔记目录进行配置。 -调用 `agentdock_context` 可以查看当前连接的运行环境和能力启动上下文。直连 AgentDock 时会包含: +搜索只返回安全元数据;只有显式 `read` 才返回明文。写入和删除按工具契约要求确认。私密笔记加密材料、NexusDock 管理员凭据与 AgentDock 设备配置应分别保护。 -- AgentDock 版本、操作系统和架构。 -- AgentDock Home、默认目录、当前默认工作目录和路径模型。 -- 已安装 Skill 摘要和已启用的动态 MCP Server。 -- 配置后可见的 ACP 状态,以及 Nexus 提供的 Workflow / Recall 索引。 +## 查看当前运行状态 -`agentdock_context` 不会重复内置 MCP 工具清单,也不会报告当前使用的认证方式。当前连接实际暴露哪些工具,以 MCP 客户端的 `tools/list` 为准;认证配置请从部署环境或桌面控制面板检查。 +调用 `agentdock_context` 可以查看当前连接的运行环境和能力启动上下文。直连 AgentDock 时会包含运行时版本、操作系统、架构、路径、Skill 来源、动态 MCP 摘要,以及可选的 ACP/Nexus 支持索引。 -`agentdock_context` 和 `tools/list` 都不会返回认证 Token、OAuth 密码、签名密钥或 NexusDock Token。 +当前连接实际暴露哪些工具,以 MCP 客户端的 `tools/list` 为准。`agentdock_context` 和 `tools/list` 都不会返回认证 Token、OAuth 密码、签名密钥、Provider Secret 或 NexusDock Device Token。 ## 启动前检查 -配置错误会让 AgentDock 直接拒绝启动。常见检查包括: +配置无效时 AgentDock 会拒绝启动。常见检查包括: -- 端口是否位于 `1`~`65535`。 -- 日志级别是否有效。 -- 非回环监听是否已启用认证。 -- OAuth 所需变量是否齐全、长度是否满足要求。 -- 公网 `AGENTDOCK_SERVER_URL` 是否使用 HTTPS。 -- `AGENTDOCK_TRUSTED_PROXY_CIDRS` 是否都是合法 CIDR。 +- 端口位于 `1`~`65535`。 +- 日志级别有效。 +- 非回环 HTTP 监听已启用认证。 +- OAuth 所需变量齐全并满足最小长度。 +- 公网 `AGENTDOCK_SERVER_URL` 使用 HTTPS。 +- 可信代理配置都是合法 CIDR。 +- 已启用 ACP Profile 的 ID 唯一有效,并使用可执行的绝对命令路径。 +- 浏览器可执行文件和 CDP URL 配置结构有效。 部署完成后至少验证: @@ -304,4 +250,4 @@ NexusDock 负责明文存储边界、age X25519 密文备份和 Git 忽略规则 curl -fsS http://127.0.0.1:8765/healthz ``` -再使用实际客户端完成一次 MCP `initialize` 和工具调用。安全边界与部署建议见 [安全模型](../operations/security.md)。 +再使用实际客户端完成一次 MCP `initialize` 和真实工具调用。安全边界见 [安全模型](../operations/security.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 f06235f..690d567 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 @@ -16,7 +16,7 @@ AgentDock 通过 MCP 向上层 Agent 暴露一组稳定的内置工具。工具 客户端实际能看到哪些工具取决于宿主机配置: - 不依赖外部集成的基础工具始终可用。 -- 配置 `AGENTDOCK_NEXUS_ENDPOINT` 后,额外暴露 `evolve`、`workflow_template_manage`、`recall_*` 和 `private_note_manage`。 +- 当前 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`,而是通过固定的发现和调用入口访问。 @@ -42,7 +42,7 @@ AgentDock 使用 Host 路径模型。相对路径默认从 `~/AgentDock` 解析 | 工具 | 用途 | 常用参数或 action | | --- | --- | --- | -| `read_file` | 分段读取 UTF-8 文本,也支持 `skill:///` | `path`、`start_line`、`end_line` | +| `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` | @@ -63,38 +63,40 @@ Windows 版 AgentDock 的文件工具可以通过 `runtime=wsl` 使用 WSL 原 `exec_command` 在命令未快速结束时返回 `session_id`,后续使用 `session_observe` 读取状态。需要交互输入时使用 `session_act action=write`。 -通过 `skill=` 运行命令时,AgentDock 会把当前激活 Skill 根目录设为默认工作目录,并只向该子进程注入 Skill 独立环境。 +通过宿主签发的 managed `skill_ref` 运行命令时,AgentDock 会把该精确 Skill 根目录设为默认工作目录,注入它的独立环境,并提供保留的 `SKILL_DATA_DIR` 作为私有持久数据目录。shared 和 workspace 候选不会继承 managed Skill 的环境或数据目录。 Windows 版 `exec_command` 可以显式选择 `runtime=windows` 或 `runtime=wsl`。 ## Coding Agent(ACP) -这些工具只有在宿主机启用 ACP 后才会暴露。直接描述编码任务即可,由上游 Agent 管理 ACP 会话和进度读取。 +只有宿主启用 ACP 时才会暴露这些工具。三组工具都接受可选 `profile_id`;省略时使用配置的默认 Profile。 -| 工具 | 用途 | 主要动作 | +| 工具 | 用途 | 主要 action | | --- | --- | --- | -| `acp_session` | 检查当前 Coding Agent,并创建、恢复、配置、查看或关闭持久会话 | `info`、`authenticate`、`new`、`load`、`resume`、`fork`、`set_mode`、`set_config`、`list`、`inspect`、`close`、`delete` | -| `acp_prompt` | 启动编码轮次,并读取进度、steering 或取消任务 | `start`、`events`、`steer`、`cancel` | -| `acp_interaction` | 处理 Coding Agent 发起的显式权限交互 | `list`、`inspect`、`respond`、`cancel` | +| `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_prompt start` 会很快返回 `run_id`,后续通过 `events` 读取进度,而不是让一次工具调用一直等待完整编码轮次。权限响应只能选择 Coding Agent 当前明确提供、且本地 AgentDock 策略允许的选项。 +`acp_session open` 会在内部协商 resume/load;Adapter 声明能力时,`new` 可以通过 `from_session_id` fork;`update` 负责 session mode 或配置项。认证可以通过 `info(auth_method_id=...)` 发起,也可以在其他 session action 中带上 Adapter 声明的认证方法。Prompt steering 属于能力驱动的内部流程,不再是单独公开 action。 -安装方式和项目访问边界见 [使用本地 Coding Agent](../guides/coding-agents.md)。 +`acp_prompt start` 会快速返回 `run_id`,进度通过 `events` 增量读取。permission 响应只能选择 Coding Agent 当前提供且本地策略允许的选项,或者取消待处理交互。 + +Profile、安装和项目访问边界见 [使用本地 Coding Agent](../guides/coding-agents.md)。 ## 可恢复任务与 Workflow | 工具 | 用途 | action | | --- | --- | --- | | `task_manage` | 持久化多步骤任务、进度、阻塞和最终验证证据 | `create`、`list`、`get`、`checkpoint`、`block`、`resume`、`final_review`、`complete` | -| `workflow_template_manage` | 管理和匹配可复用 Workflow 模板;仅配置 NexusDock 后可见 | `publish`、`retire`、`list`、`get`、`get_many`、`match`、`vector_index` | +| `workflow_template_manage` | 管理和匹配可复用 Workflow 模板;仅当前 AgentDock 设备与 NexusDock 配对后可见 | `publish`、`retire`、`list`、`get`、`get_many`、`match`、`vector_index` | -`task_manage` 保存的是状态,不会替代命令、测试、部署或浏览器验证。普通任务可以完全在本机使用;Workflow 模板存放在 NexusDock Registry,未配置 NexusDock 时 `workflow_template_manage` 不会出现在工具列表中。 +`task_manage` 保存的是状态,不会替代命令、测试、部署或浏览器验证。普通任务可以完全在本机使用;Workflow 模板存放在 NexusDock Registry;当前 AgentDock 设备未与 NexusDock 配对时,`workflow_template_manage` 不会出现在工具列表中。 `publish` 接收完整模板,并在激活该版本前进行校验。多个模板同时适用时,`get_many` 返回模板正文,但不会自动拼接。模型需要删除无关步骤、合并重复项、确定顺序,再把组合后的 steps 和 completion conditions 传给 `task_manage create`。 ## 知识 Evolution -配置 NexusDock 后会暴露 `evolve`,但 Evolution 生命周期属于 AgentDock。NexusDock 提供共享存储和访问路径,不负责决定知识何时得到支持、被反证、被替代或撤回。 +当前 AgentDock 设备与 NexusDock 配对后会暴露 `evolve`,但 Evolution 生命周期属于 AgentDock。NexusDock 提供共享存储和访问路径,不负责决定知识何时得到支持、被反证、被替代或撤回。 | 工具 | 用途 | intent | | --- | --- | --- | @@ -102,21 +104,26 @@ Windows 版 `exec_command` 可以显式选择 `runtime=windows` 或 `runtime=wsl `bind` 属于高级的执行前学习检查:模型必须在任务开始执行前声明后续 Task 成功或失败分别代表什么。Task 结果本身没有学习含义,而且 Evolution 不能阻塞普通 Task 完成。 -## Skill 包与独立环境 +## managed Skill 与独立环境 | 工具 | 用途 | action | | --- | --- | --- | -| `skill_package` | 校验、安装、激活和回滚 Skill,并管理每个 Skill 的独立环境 | `validate`、`install`、`activate`、`rollback`、`env_set`、`env_unset`、`env_list` | +| `skill_manage` | 安装或移除 managed Skill 当前内容,并管理它的独立环境 | `install`、`remove`、`env_set`、`env_unset`、`env_list` | + +AgentDock 不提供独立的 Skill 版本、激活或回滚生命周期。每个 managed Skill 名称只有一份当前内容;重复安装相同内容会按 `content_digest` no-op,同名但经过审查的新内容会原子替换当前内容。 -Skill 是模型读取的文档型工作方法,不是隐藏执行器。常见调用顺序: +典型流程: ```text -agentdock_context -→ read_file skill:///SKILL.md -→ 使用真实文件、命令、浏览器或 MCP 工具执行 +agentdock_context / workspace_context +→ select one exact Skill candidate +→ read_file +→ execute through real tools using the same returned skill_ref when needed ``` -`skill_package env_list` 不返回秘密值,只返回变量名和是否已配置。使用方式见 [使用 Skill](../concepts/skills.md)。 +不要根据裸名称自行构造 `skill_ref` 或 `skill://` URI。同名的 managed、shared、workspace 候选仍是不同来源。`skill_manage env_list` 只返回变量名和配置状态,不回显秘密值。普通 `remove` 会保留 managed Skill 的环境和持久数据;`purge=true` 才会一并删除这些保留资源。 + +用户流程见 [使用 Skill](../concepts/skills.md)。 ## 动态 MCP @@ -155,7 +162,7 @@ agentdock_context ## NexusDock Recall -以下工具只在配置 `AGENTDOCK_NEXUS_ENDPOINT` 后暴露: +直连 AgentDock 时,只有当前设备已经与 NexusDock 配对,才会暴露这些工具: | 工具 | 用途 | 常用参数或 action | | --- | --- | --- | @@ -175,7 +182,7 @@ agentdock_context ## 私密笔记 -`private_note_manage` 只在配置 `AGENTDOCK_NEXUS_ENDPOINT` 后暴露: +直连 AgentDock 时,只有当前设备已经与 NexusDock 配对,才会暴露 `private_note_manage`: | 工具 | 用途 | action | | --- | --- | --- | diff --git a/scripts/check-i18n.mjs b/scripts/check-i18n.mjs index 24dd62e..e2397af 100644 --- a/scripts/check-i18n.mjs +++ b/scripts/check-i18n.mjs @@ -88,7 +88,7 @@ function parseMarkdown(source) { const technicalTokenPatterns = [ /\bAGENTDOCK_[A-Z0-9_*]+\b/gu, - /\b(?:agentdock_context|browser_[a-z0-9_*]+|exec_command|file_edit|file_publish|list_dir|list_files|mcp_manage|mcp_tool_call|mcp_tool_inspect|mcp_tool_search|private_note_manage|read_file|recall_[a-z0-9_*]+|search_text|server_info|session_act|session_observe|skill_package|task_manage|view_image|workflow_template_manage)\b/gu, + /\b(?:agentdock_context|browser_[a-z0-9_*]+|exec_command|file_edit|file_publish|list_dir|list_files|mcp_manage|mcp_tool_call|mcp_tool_inspect|mcp_tool_search|private_note_manage|read_file|recall_[a-z0-9_*]+|search_text|server_info|session_act|session_observe|skill_manage|task_manage|view_image|workspace_context|workflow_template_manage|acp_[a-z0-9_*]+)\b/gu, ]; const technicalTokens = technicalTokenPatterns .flatMap((pattern) => [...source.matchAll(pattern)].map(([token]) => token))