Embedding the Agent2API Admin Panel into the DeepSeek Harness Sidebar

Introduction

DeepSeek Harness (DSH) is an “everything is a plugin” client framework. Integrating external services into it typically requires writing your own proxy or redrawing the UI. If you already have an Agent2API running locally and want to open its native admin panel directly in the DSH sidebar without duplicating development effort, this plugin is designed for exactly that use case.

It doesn’t act as a gateway or forwarder — it simply “transports” the interface: via a same-origin reverse proxy on the host side, it embeds the entire Agent2API site into DSH as an iframe, preserving all native interactions and functionality.

What It Is

  • Plugin name: dsh-a2a-panel
  • Maintainer: ymf2317-tech
  • Category: Client
  • Purpose: Brings the native Agent2API admin panel into the DeepSeek Harness sidebar via a host-side same-origin reverse proxy + iframe, fully usable on mobile.

Core Capabilities

  1. Same-Origin Reverse Proxy & Iframe Embedding
    - Access /a2a-panel/ui/* in DSH Web; the host-side reverse proxy routes it to Agent2API’s /ui.
    - The iframe runs the original page, making all modules available: dashboards, accounts, check-ins, routes, model management, gateway keys, request logs, scheduled tasks, and more.
    - Eliminates the mixed-content issue that occurs when DSH is served over HTTPS and embeds HTTP content, preventing blank screens on mobile.

  2. Path Shim & <base> Tag Injection
    - The panel’s frontend uses absolute paths like /api/xxx for API calls. The reverse proxy injects a shim into the HTML that rewrites fetch, XMLHttpRequest, EventSource, and location.replace/assign absolute paths under the /a2a-panel/ui prefix.
    - Injects a <base> tag so relative resources (app.js, m/mobile.js) resolve correctly.

  3. Login Redirect Fallback
    - When the panel 302-redirects to /login or redirects to / after login, these jumps escape the iframe. The reverse proxy layer rewrites the Location header; the frontend, on the load event, re-prefixes the target path and reloads — up to 8 retries.
    - This resolves the “blank screen / fallback to DSH main UI after login” issue and the mobile “session expired → go to login → bounced back to entry point” infinite loop.

  4. Cookie Path Isolation
    - The Path attribute of session cookies is scoped to /a2a-panel/ui/, so it doesn’t interfere with DSH’s own session.

  5. Mobile Adaptation
    - When the container width is below 820px, it automatically switches to the upstream mobile version at /m/. After a narrow-screen login, the user is redirected back to /m/, forming a closed loop.

  6. Lightweight Health Probes
    - Two endpoints are provided:

    • GET /a2a-panel/api/snapshot: Aggregated snapshot with a 3-second cache.
    • GET /a2a-panel/api/health: Lightweight liveness check.

Installation & Setup

Prerequisite: You must have a running Agent2API instance (default: 127.0.0.1:3065 on the local machine).

  1. Clone the plugin repository to a location visible to your DSH profile:
git clone https://github.com/<you>/dsh-a2a-panel.git D:/dsh-workspace/packages/dsh-a2a-panel
  1. Register it in your profile’s package.json (using a local directory link):
{
  "dependencies": {
    "dsh-a2a-panel": "link:D:/dsh-workspace/packages/dsh-a2a-panel"
  },
  "dsh.profile.bundles": ["dsh-a2a-panel", ...]
}
  1. Create a symlink to avoid module resolution failures before pnpm install:
<profile>/node_modules/dsh-a2a-panel -> the directory above
  1. After modifying host-side code, restart DSH Web. If you only changed lib/client.js, simply toggle the plugin off and on.

Configuration

Set the following fields in cordis.patch.yml:

Key Description
apiBase Agent2API address, default http://127.0.0.1:3065
gatewayKey Optional. Some panel /api/* endpoints (accounts, keys, logs) accept a gateway key sk-a2a-...; the environment variable A2A_GATEWAY_KEY takes precedence — never commit real keys to the repository
timeoutMs Per-request upstream timeout, default 20000 ms (the initial page load pulls several MB, so leave ample headroom)

Typical Usage

  1. Make sure Agent2API is running (default port 3065).
  2. Install and enable the plugin following the steps above.
  3. Visit /a2a-panel/ui in DSH Web — you’ll see the native admin panel login page.
  4. Log in once inside the iframe. The session cookie persists afterward, allowing direct access to dashboards, accounts, routes, models, gateway keys, request logs, scheduled tasks, and other modules.

Use Cases & Caveats

  • Ideal for users who already have Agent2API running and want a unified panel management experience within DSH.
  • The plugin reverse-proxies a user-installed and user-operated Agent2API instance (upstream is AGPL-3.0). It does not include, link, or bundle any upstream code; all upstream panel files are always served by Agent2API itself.
  • The reverse proxy is a “pass-through” with no additional authentication: anyone who can open DSH can operate the panel.
  • If a panel upgrade introduces new absolute-path request patterns (e.g., WebSocket, service workers), the SHIM in lib/index.js must be updated accordingly.
  • Redirecting back to /m/ after a narrow-screen login is upstream layout behavior and has not been modified.

In Short

If you’re already using Agent2API and want to manage its panel conveniently from within DSH, this plugin offers a path that requires no custom proxy or UI reimplementation. Through a host-side same-origin reverse proxy + iframe, it brings the entire native interaction into DSH, making it well-suited for scenarios where you need direct access to panel details.

  • Directory page: https://www.skillhub.cn/plugins/ymf2317-tech/dsh-a2a-panel
  • GitHub: https://github.com/ymf2317-tech/dsh-a2a-panel
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye