Skip to content

A2A 面板原生化 + a2a.json 全可视化管理 - #3

Merged
ryubyte merged 5 commits into
mainfrom
fix/gui-native-ui
Aug 26, 2026
Merged

ryubyte merged 5 commits into
mainfrom
fix/gui-native-ui

Conversation

@ryubyte

@ryubyte ryubyte commented Aug 26, 2026

Copy link
Copy Markdown
Owner

概述

把 A2A 设置面板重构为 DSH 原生风格,并让 a2a.json 的连接级配置完全可视化——新用户无需手改配置文件即可完成配置与上线。同时修复了几个存量问题。

改动(按层)

feat(host) 0e9c867

  • server.ts:新增 updateCard()/getBaseUrl()/rebuildInterfaceUrls(),支持运行时就地修改对外身份(名称/描述/版本/baseUrl/端点/skills),重建 AgentCard 即时生效。
  • dashboard.ts:新增 setServerIdentity/updateAgent hook 与 set-server-identity/update-agent 控制动作。
  • index.ts:server 效果总是挂载(路由注册由 enabled=wantsServer 门控),使 client-only profile 也能从 UI 运行时创建并上线服务、无需重启;持久化 server.enabled;serverCard() 读实时值(修复广告了过期 baseUrl 的存量 bug);baseUrl 传空串=清 pin 并按真实监听地址重新推导。
  • a2a-config.ts:修复——无现存 a2a.json 时,写入落到 --profile 指定的 profile 目录而非 cwd,保证 UI 生成的配置落在 dsh 下次会读的位置(否则重启即丢)。

feat(ui) 75e5cc6

  • 新增 dashboard.css.ts:基于 --dsw-alias-* token 的幂等样式表,响应式改用 @container(按面板真实宽度而非视口),修复窄面板下输入框+按钮/URL+复制被拆行的拥挤问题。
  • 三 tab 合并为按角色的两 tab:「连接的 Agent」(客户端)、「对外服务」(服务端,含入站连接)。
  • 服务身份:只读展示 + 就地编辑表单(skills 完整增删改);全新安装显示预填默认值的引导表单,「创建并上线」一步生成 a2a.json 并启动。
  • 每个 Agent 的「设置」:超时/技能拆分/Token 就地编辑并重连生效。

build 7c34f78

重新编译 lib/;tsconfig 增加 DOM/DOM.Iterable(client 半区直接用 document/navigator)。

docs 1b7b5db

README 中英更新为两 tab + 全可视化;澄清 baseUrl 自动推导与可选的 mode 字段;替换 4 张旧截图为 2 张最新截图。

测试

  • npm test:46 用例全过(含新增的 profile-dir 兜底 +2 用例)+ client bundle 冒烟。
  • CDP 端到端实测:身份编辑即时生效、endpointPath 变更路由重注册、引导创建落 profile 目录且重启不丢、baseUrl 清空回到自动推导。

…-dir config

- server.ts: add updateCard()/getBaseUrl()/rebuildInterfaceUrls() so the
  advertised AgentCard identity (name/description/version/baseUrl/endpointPath/
  skills) can change at runtime, in place.
- dashboard.ts: add setServerIdentity/updateAgent hooks + set-server-identity/
  update-agent control actions.
- index.ts: always mount the server effect (gate routes on enabled=wantsServer)
  so a client-only profile can create+enable the A2A server from the UI with no
  restart; persist server.enabled; wire the new hooks; serverCard() reads live
  values (fixes stale advertised baseUrl); baseUrl '' clears the pin and
  re-infers from the real listen address.
- a2a-config.ts: when no a2a.json exists yet, write to the --profile dir instead
  of cwd, so a UI-generated config lands where dsh reads it on next launch.
- test: cover the profile-dir fallback (+2 cases).
…ement

- New dashboard.css.ts: idempotent stylesheet built on --dsw-alias-* tokens,
  with @container (not @media) responsive breakpoints keyed to the settings
  drawer's own width, plus smooth transitions. Fixes the cramped input+button
  and value+copy rows by moving the aggressive full-width wraps to a <440px band.
- Merge the three tabs into two by role: 「连接的 Agent」(client) and
  「对外服务」(server), the latter folding in serve config + inbound peers.
- Serve identity: read-only view + inline edit form with full skill add/edit/
  remove; guided first-run setup pre-filled with sensible defaults
  (「创建并上线」) so a new user configures everything without touching JSON.
- Per-agent advanced settings (timeout/mapSkills/token) via a 设置 form.
- baseUrl field: blank = auto-infer; always sent so the host can clear the pin.
Rebuilt lib/ (client.js bundle, index.js, type declarations) for the host and
UI changes above. tsconfig: add DOM/DOM.Iterable libs — the client half now
uses document/navigator directly.
- Rewrite the connection-dashboard section for the two role tabs and the
  fully-visual a2a.json management (guided setup, identity/skill editing,
  per-agent settings).
- Clarify baseUrl auto-inference (blank = infer real listen address) and that
  UI-generated configs omit the optional mode field.
- Replace the four stale three-block screenshots with two current tab shots.
The plugin marketplace moved from a shared data/screenshots.json to per-repo
declaration. Point at the two current panel screenshots, relative to this file
at the repo root.
@ryubyte
ryubyte merged commit 5ba2e4b into main Aug 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant