diff --git a/TODO_NEXT_STEPS.txt b/TODO_NEXT_STEPS.txt index df98e37..52c88cd 100644 --- a/TODO_NEXT_STEPS.txt +++ b/TODO_NEXT_STEPS.txt @@ -4,6 +4,7 @@ ================================================================================ 【已完成】 + - V10.510 Webcrumbs 從 runtime 接線推進到專案內 live plugin 試點:`/webcrumbs` 會設定 `StockPlatformSharedUI.allowedPluginUris` 並嵌入同源 `/webcrumbs-assets/plugins/finance.market-ticker-strip/0.1.0`、`finance.ai-candidate-card/0.1.0`,用同一頁同時驗 runtime、plugin proxy 與共享 UI loader 初始化。 - V10.509 新增市場情報 MCP Fetch Candidate Queue Writer Review Decision Approval Writer Preflight 安全預覽 gate:只審核 human approval 通過後由操作員貼回的 writer preflight 摘要,確認 approval identity、writer_preflight_id、row count、dedupe keys、approved decision 到 target review_state 的逐列映射、decision/approval/preflight evidence refs、exact identity / variant / overwrite guard 與 operator boundary;API 不讀 token、不執行 CLI、不開 DB、不寫 preflight/approval/decision/match、不更新 review_state、不補 queue、不掛 scheduler,只放行到後續 CLI review / run package 設計。 - V10.508 Webcrumbs 轉為 momo-pro 同源 asset proxy:`WEBCRUMBS_RUNTIME_URL` 預設改為 `/webcrumbs-assets/loader/webcrumbs-compatible-loader.js`,新增 allowlist proxy 只代理 188 Shared UI Hub 的 `loader/`、`plugins/`、`demo/`,避免 `webcrumbs.wooo.work` 公網 TLS / Basic Auth 尚未收斂時影響正式頁面載入;`/webcrumbs` 診斷頁同步顯示 asset upstream。 - V10.507 接入 Webcrumbs 共用 UI Runtime:新增 `WEBCRUMBS_*` 環境設定與 `/webcrumbs` 診斷入口,`ewoooc_base.html` 會在 runtime 啟用且 URL 有效時載入自架 Webcrumbs script;側欄新增 Webcrumbs 入口,並補 `docs/guides/webcrumbs_shared_runtime.md` 作為跨專案接入手冊。生產仍需固定版本與自架 plugin URI,不使用官方 `@latest`。 diff --git a/config.py b/config.py index 1f0bc2e..0f547f1 100644 --- a/config.py +++ b/config.py @@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.509" +SYSTEM_VERSION = "V10.510" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/docs/guides/webcrumbs_shared_runtime.md b/docs/guides/webcrumbs_shared_runtime.md index 1bef47f..8973d61 100644 --- a/docs/guides/webcrumbs_shared_runtime.md +++ b/docs/guides/webcrumbs_shared_runtime.md @@ -63,6 +63,7 @@ style.css ## 驗收 - `/webcrumbs` 顯示 runtime URL、版本與 plugin base。 +- `/webcrumbs` 會嵌入同源 `/webcrumbs-assets/plugins/...` 的 live plugin preview,作為 shared runtime 的第一個專案內試點。 - `/webcrumbs-assets/loader/webcrumbs-compatible-loader.js` 回 200 且 content type 是 JavaScript。 - `ewoooc_base.html` 在 `WEBCRUMBS_ENABLED=true` 且 runtime URL 有效時輸出 ` +
+
+ Live Plugin +

Shared UI Hub

+
+
+ {% for preview in tool.plugin_previews %} +
+ +
+ {% endfor %} +
+
+ {% endif %} +
可用入口 diff --git a/tests/test_external_tool_entrypoints.py b/tests/test_external_tool_entrypoints.py index 8b8ebb2..15545d7 100644 --- a/tests/test_external_tool_entrypoints.py +++ b/tests/test_external_tool_entrypoints.py @@ -40,6 +40,12 @@ def test_external_tool_bridge_pages_are_diagnostic_not_blank(): assert "def webcrumbs_asset_proxy(asset_path)" in route_source assert "WEBCRUMBS_ASSET_ALLOWED_PREFIXES" in route_source assert "Webcrumbs 共用 UI Runtime" in route_source + assert "plugin_previews" in route_source + assert "finance.market-ticker-strip/0.1.0" in route_source + assert "finance.ai-candidate-card/0.1.0" in route_source + assert "StockPlatformSharedUI.allowedPluginUris" in template + assert "stock-platform-plugin" in template + assert "external-tool-webcrumbs-grid" in css assert "尚未接入 proxy" in route_source assert "已由入口攔截" in route_source assert "AwoooI" not in route_source diff --git a/web/static/css/page-external-tools.css b/web/static/css/page-external-tools.css index b80416f..c769fff 100644 --- a/web/static/css/page-external-tools.css +++ b/web/static/css/page-external-tools.css @@ -6,6 +6,7 @@ .external-tool-hero, .external-tool-panel, +.external-tool-webcrumbs-preview, .external-tool-actions { background: radial-gradient(circle, rgba(45, 40, 32, 0.12) 1px, transparent 1.2px), @@ -159,6 +160,32 @@ padding: var(--momo-space-5, 24px); } +.external-tool-webcrumbs-preview { + padding: var(--momo-space-5, 24px); +} + +.external-tool-webcrumbs-grid { + display: grid; + grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); + gap: var(--momo-space-4, 16px); + align-items: stretch; + margin-top: var(--momo-space-4, 16px); +} + +.external-tool-webcrumbs-plugin { + min-height: 176px; + padding: var(--momo-space-3, 12px); + background: var(--momo-bg-paper); + border: 1px solid var(--momo-border-subtle); + border-radius: var(--momo-radius-md, 6px); + overflow: hidden; +} + +.external-tool-webcrumbs-plugin stock-platform-plugin { + display: block; + min-height: 152px; +} + .external-tool-section-title h2 { margin: var(--momo-space-2, 8px) 0 0; color: var(--momo-text-primary); @@ -210,6 +237,7 @@ .external-tool-checks, .external-tool-diagnostics, + .external-tool-webcrumbs-grid, .external-tool-action-grid { grid-template-columns: 1fr; }