From 47c672c23308eec3a36a30cf7c5c34fb170e49b0 Mon Sep 17 00:00:00 2001 From: EterUltimate <1831303476@qq.com> Date: Sat, 12 Sep 2026 13:18:48 +0800 Subject: [PATCH 1/3] feat(integrations): surface LivingMemory official plugin page link LivingMemory 2.6.0+ removed its standalone WebUI and now ships an AstrBot official plugin page (pages/dashboard/index.html). The integration service now detects that page from the star's module_path and the astrbot_config dashboard host/port, and exposes it as dashboard.official_page_url (AstrBot Dashboard hash route /#/plugin-page//). Because official plugin pages are served with X-Frame-Options: SAMEORIGIN and fetch page assets with a short-lived JWT token, they cannot be embedded in an iframe; embeddable is therefore reported as false and the embed shell degrades from 'panel unavailable' to 'open in a new window'. The integrations page adds an official-panel button on the LivingMemory card. Companion contract re-check against livingmemory 2.7.0-beta.1 (9e1c2d7) and group_chat_plus V1.2.3.hotfix.2 (89ae2e1): registration name, initializer.memory_engine, memory_engine.graph_store, get_graph_snapshot signature/return keys and get_statistics are all unchanged, so the local graph adapter needs no further changes. The defensive full-graph snapshot caps added in LM 2.6.0 only affect get_full_graph_snapshot, which this plugin never calls. AstrBot API surface re-check against v4.28 (e606a3037): every symbol this plugin imports still exists and astrbot/api/event + astrbot/api/web saw no commits since v4.27.5. --- docs/integrations.md | 6 +- tests/unit/test_integration_service.py | 99 +++++++++++++++++++ ...{index-B_IP2WTj.css => index-B-FWb1Zi.css} | 2 +- .../static/dashboard/assets/index-BUfCwZyG.js | 17 ---- .../static/dashboard/assets/index-DfjsDeQS.js | 17 ++++ web_res/static/dashboard/index.html | 4 +- .../business/IntegrationCard.module.scss | 6 ++ .../components/business/IntegrationCard.tsx | 11 ++- .../pages/integrations/IntegrationsPage.tsx | 17 +++- webui/services/integration_service.py | 62 +++++++++++- 10 files changed, 213 insertions(+), 28 deletions(-) rename web_res/static/dashboard/assets/{index-B_IP2WTj.css => index-B-FWb1Zi.css} (59%) delete mode 100644 web_res/static/dashboard/assets/index-BUfCwZyG.js create mode 100644 web_res/static/dashboard/assets/index-DfjsDeQS.js diff --git a/docs/integrations.md b/docs/integrations.md index add886a7..f2d2b008 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -77,7 +77,7 @@ Dashboard -> 功能融合 页面内容: - Self Learning 当前面板。 -- LivingMemory 状态、外部面板入口和本地图谱适配 API 列表。 +- LivingMemory 状态、官方插件页/外部面板入口和本地图谱适配 API 列表。 - Group Chat Plus 状态、面板入口和开发 API 列表。 - `Integration_Settings` 快速编辑。 - Self Learning Hub 稳定 HTTP 契约和可对接能力。 @@ -154,6 +154,7 @@ GET /api/hub/v1/status | `delegated` | 当前能力是否已委托 | | `plugin` | AstrBot star 元信息 | | `dashboard` | 面板 URL、本地图谱路由、入口类型;`embeddable` 为 `false` 表示面板响应头禁止 iframe 嵌入(如 Group Chat Plus 的 `X-Frame-Options: DENY`),此时嵌入壳会提示改用新窗口打开 | +| `dashboard.official_page_url` | 伴随插件自带 AstrBot 官方插件页时的入口(LivingMemory 2.6.0+)。指向 AstrBot Dashboard 前端 hash 路由 `/#/plugin-page/<插件名>/<页名>`,由集成服务探测插件 `pages/<页名>/index.html` 与主配置 `dashboard.host/port` 自动生成;该页面需 AstrBot 会话 JWT,iframe 内不可用,只能新窗口打开(功能融合页的「官方面板」按钮) | | `dev_api` | 该插件公开 API 列表 | | `settings_group` | 相关配置组 | @@ -262,8 +263,9 @@ ECharts 图谱 payload。记忆图和知识图谱都会优先读取 LivingMemory | Dashboard 显示未委托 | 目标插件是否已加载、启用、名称是否匹配 | | LivingMemory 已安装但仍写入本地记忆 | `delegate_memory_to_livingmemory` 和 `disable_local_memory_when_delegated` 是否为 `true` | | Group Chat Plus 已安装但仍创建本地回复器 | `delegate_reply_to_group_chat_plus` 和 `disable_local_reply_when_delegated` 是否为 `true` | -| 面板入口为空 | 目标插件 Web 面板是否开启;图谱模块仍可通过本插件 `/api/graphs/*` 查看 | +| 面板入口为空 | 目标插件 Web 面板是否开启;LivingMemory 2.6.0+ 由集成服务自动探测其官方插件页(`pages/` 目录 + AstrBot 主配置 `dashboard` 段),图谱模块仍可通过本插件 `/api/graphs/*` 查看 | | Group Chat Plus 嵌入壳显示"面板禁止内嵌" | 该面板自 v1.2.x 起返回 `X-Frame-Options: DENY`,无法被 iframe 嵌入,属预期行为;集成服务会探测响应头并自动改用新窗口入口 | +| LivingMemory 嵌入壳显示"面板禁止内嵌" | AstrBot 官方插件页固定返回 `X-Frame-Options: SAMEORIGIN` 且资产需 JWT 换取,iframe 内无法携带凭据,属预期行为;请用嵌入壳或功能融合页的「官方面板」新窗口打开 | | API 列表不匹配 | 以目标插件当前开发 API 为准,更新 `webui/services/integration_service.py` | ## 测试 diff --git a/tests/unit/test_integration_service.py b/tests/unit/test_integration_service.py index 784ee212..28bc06ad 100644 --- a/tests/unit/test_integration_service.py +++ b/tests/unit/test_integration_service.py @@ -339,3 +339,102 @@ def test_embed_shell_keeps_iframe_when_embedding_allowed(): assert '