forked from cflmy/deepseek-harness
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
daf3d50ac1 | ||
|
|
822332b74d | ||
|
|
9ccb6b38e6 |
No files matched your search
@@ -24,6 +24,7 @@ steps:
|
||||
depends_on: [install]
|
||||
environment:
|
||||
CI: "true"
|
||||
DSH_CLIENT_TITLE: "Marqdo Harness"
|
||||
commands:
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@11.28.5 --activate
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
```sh
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm run build
|
||||
DSH_CLIENT_TITLE="Marqdo Harness" pnpm run build
|
||||
MQDH_PACKAGE_WORK=/var/tmp/mqdh-package bash scripts/package.sh
|
||||
```
|
||||
|
||||
@@ -35,6 +35,7 @@ MQDH_PACKAGE_WORK=/var/tmp/mqdh-package bash scripts/package.sh
|
||||
|
||||
```powershell
|
||||
pnpm install --frozen-lockfile --ignore-scripts
|
||||
$env:DSH_CLIENT_TITLE = "Marqdo Harness"
|
||||
pnpm run build
|
||||
$env:MQDH_NODE24_DIR = 'C:\path\to\node24'
|
||||
powershell -ExecutionPolicy Bypass -File .\scripts\package-windows.ps1 -RuntimeDeps C:\path\to\runtime-deps
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
| 路径 | 修改 | 原因 | 能否使用公开 seam | 测试 | 上游 Issue/PR | 移除条件 |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| `.github/workflows/*`(发布/上传/桌面打包/Cloudflare/Pages 共 18 个) | 删除 | 防止下游误用官方发布凭证与上传路径;Gitea/Woodpecker 是下游 CI 权威 | 不需要 | 仓库内无这些 workflow;`grep` 审计 | 无(下游发布策略) | 上游发布机制被下游显式复用时重新评估 |
|
||||
| `tsdown.config.ts` | 从 workspace bundle 列表排除 `packages/marqdo/*` | 下游包以 TypeScript 源码由 Node 24 原生类型剥离执行,没有 `lib/types` 产物 | 上游 workspace 配置即公开构建入口 | `pnpm run build` 10/10 gates PASS | 无 | 下游包改为产出 `lib/types` 时 |
|
||||
| `tsdown.config.ts`、`tsconfig.client.json` | 服务端产品包由 Node 原生执行,`@marqdo/mqdh-ui` 使用上游 Client 构建 | 产品浏览器插件通过现有动态模块加载器交付 | 使用同一个 `clientBundle` preset | `pnpm run build:artifacts`、`pnpm run build:check` | 无 | 上游自动识别非标准包组的构建类型时 |
|
||||
| `apps/cli/package.json` | 增加 `@deepseek-ai/cordis-plugin-group` 运行时依赖 | app-boot 将其列为 peer;生产部署闭包需要它 | 上游依赖声明 | `pnpm install --frozen-lockfile`;部署 smoke | 可作为通用打包修复回馈 | 上游把该 peer 改为直接依赖 |
|
||||
| `packages/marqdo/harness`、`packages/marqdo/bundle`、`scripts/mqdh.mjs`、`docs/mqdh` | 新增下游产品代码与文档 | Marqdo Harness 产品能力 | 新包,不改上游 | `scripts/ci.sh` | 无 | 不适用 |
|
||||
| `packages/client/ui-sidebar/src/client/SidebarRoot.tsx` | 为导航行提供 `data-panel-entry` | MQDH 按稳定 ID 设置 Marqdo 选中态,侧栏继续负责交互和布局 | 复用原有组件及选中态 token | Chromium 整页核对浅深色与键盘导航 | 无 | 上游提供导航行样式入口时 |
|
||||
|
||||
## 未修改但依赖的上游 seam
|
||||
|
||||
@@ -15,5 +16,6 @@
|
||||
- `ctx.approval.request`:文稿执行与生态变更的一次性授权。
|
||||
- `ctx.systemPrompt.section`:产品提示词段落。
|
||||
- `ctx.webServer.register`:`/mqdh` 工作台与 JSON API。
|
||||
- `sidebar.brand.mark`、`sidebar.brand.name`、`conversation.hero.brand.mark`、`sidebar.panellist` 和 `main` 槽:产品品牌、只读插件列表及 Marqdo 生态工作台。
|
||||
- `ctx.provide('mqdhRuntime')`:host 与 web 半部共享运行时。
|
||||
- profile/bundle 的 `dsh.bundle.patch`:唯一产品组合入口。
|
||||
@@ -69,7 +69,7 @@ function PanelRow({
|
||||
const active = usePanelInfo(info => info.activePanelId === id)
|
||||
const trailing = useId()
|
||||
return (
|
||||
<div className={clsx(css.panelEntry, wide && css.panelEntryWide, active && css.panelEntryActive)}>
|
||||
<div data-panel-entry={id} className={clsx(css.panelEntry, wide && css.panelEntryWide, active && css.panelEntryActive)}>
|
||||
<Tooltip label={label} delayMs={500} disabled={wide}>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
# Product UI surfaces that imply unsupported installation/session upload.
|
||||
- id: ui-plugin-manager
|
||||
disabled: true
|
||||
- id: ui-brand-official
|
||||
disabled: true
|
||||
- id: ui-agent-preset
|
||||
disabled: true
|
||||
- id: ui-settings-session-log
|
||||
@@ -72,6 +74,9 @@
|
||||
workspace: !!js process.env.MQDH_WORKSPACE
|
||||
maxRunMs: 300000
|
||||
|
||||
- id: mqdh-ui
|
||||
name: '@marqdo/mqdh-ui'
|
||||
|
||||
- id: mqdh-web
|
||||
name: '@marqdo/mqdh-harness/web'
|
||||
config:
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@marqdo/mqdh-harness": "workspace:*"
|
||||
"@marqdo/mqdh-harness": "workspace:*",
|
||||
"@marqdo/mqdh-ui": "workspace:*"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -4,6 +4,8 @@ Marqdo Harness product services as one Cordis plugin (host half) plus the `/mqdh
|
||||
|
||||
## Surface
|
||||
|
||||
The left sidebar’s **Marqdo** entry opens the existing workbench in the main panel on its Ecosystem tab. The standalone `/mqdh` URL remains available. Its embedded view uses the same routes and allows framing by its own origin. The embedded workbench follows the shell’s active color scheme. The standalone page follows the browser’s color scheme. The adjacent **Plugins** entry displays the Host inventory with read-only access.
|
||||
|
||||
- `src/index.ts` — `mqdh-harness` plugin: provides `mqdhRuntime`, registers six tools, adds one product prompt section.
|
||||
- `src/web/index.ts` — `mqdh-web` plugin: `/mqdh` page, CSS/JS and same-origin JSON API over `ctx.webServer`.
|
||||
- `src/core/` — home layout, atomic files, lock, bounded process, safe tar, Observation 1, ValueWire.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Marqdo contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 353 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#343f22" d="M8 8v45l9-5V27l15 12 15-12v21l9 5V8L32 28z"/><path fill="#c59a55" d="m8 8 24 20L56 8 32 38z"/><path fill="#fcf9f4" d="m19 17 13 11 13-11-13 17z"/><path fill="#c59a55" d="m27 49 5-5 5 5-5 7z"/></svg>
|
||||
|
After Width: | Height: | Size: 282 B |
@@ -8,6 +8,11 @@
|
||||
* @module @marqdo/mqdh-harness/web/assets
|
||||
*/
|
||||
|
||||
import { readFileSync } from 'node:fs'
|
||||
|
||||
/** The local Marqdo brand mark shared by the workbench and the shell. */
|
||||
export const BRAND_SVG = readFileSync(new URL('../../assets/marqdo.svg', import.meta.url))
|
||||
|
||||
/** The workbench document. */
|
||||
export const APP_HTML = `<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
@@ -15,12 +20,13 @@ export const APP_HTML = `<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Marqdo Harness</title>
|
||||
<link rel="icon" href="/mqdh/brand.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="/mqdh/app.css">
|
||||
<script type="module" src="/mqdh/app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body__MQDH_EMBEDDED__>
|
||||
<header class="top">
|
||||
<div class="brand"><span class="mark">M</span><strong>Marqdo Harness</strong><span class="sub">本地单用户工作台</span></div>
|
||||
<div class="brand"><img src="/mqdh/brand.svg" width="30" height="30" alt=""><strong>Marqdo Harness</strong><span class="sub">本地单用户工作台</span></div>
|
||||
<nav class="links">
|
||||
<a href="/">对话</a>
|
||||
<a href="/mqdh" aria-current="page">工作台</a>
|
||||
@@ -30,15 +36,15 @@ export const APP_HTML = `<!doctype html>
|
||||
</header>
|
||||
<main>
|
||||
<section class="hero">
|
||||
<h1>文档即程序,知识可复用</h1>
|
||||
<p>这里展示真实的已安装状态、私人知识集合、受控执行与运行证据。所有“可用”都来自实际服务,不显示虚构进度。</p>
|
||||
<h1>Marqdo 工作台</h1>
|
||||
<p>查看本地运行时、私人知识和隐私状态。</p>
|
||||
</section>
|
||||
|
||||
<section id="status" class="cards" aria-live="polite">
|
||||
<div class="card"><h2>Runtime</h2><p class="big" id="status-runtime">读取中…</p><p id="status-runtime-detail" class="muted"></p></div>
|
||||
<div class="card"><h2>Std Bundle</h2><p class="big" id="status-std">读取中…</p><p id="status-std-detail" class="muted"></p></div>
|
||||
<div class="card"><h2>私人知识</h2><p class="big" id="status-knowledge">读取中…</p><p id="status-knowledge-detail" class="muted"></p></div>
|
||||
<div class="card"><h2>隐私默认</h2><p class="big" id="status-privacy">读取中…</p><p id="status-privacy-detail" class="muted"></p></div>
|
||||
<div class="card"><h2>隐私</h2><p class="big" id="status-privacy">读取中…</p><p id="status-privacy-detail" class="muted"></p></div>
|
||||
</section>
|
||||
|
||||
<nav class="tabs" role="tablist">
|
||||
@@ -88,7 +94,7 @@ export const APP_HTML = `<!doctype html>
|
||||
|
||||
<section id="tab-ecosystem" class="panel" role="tabpanel" hidden>
|
||||
<h2>生态目录</h2>
|
||||
<p class="muted">固定顺序 Runtime → Tool → Std → Ext → Knowledge。打开、筛选和查看详情不触发下载或执行;有副作用的操作只由按钮显式发起。</p>
|
||||
<p class="muted">按 Runtime、Tool、Std、Ext 和 Knowledge 查看本地环境。</p>
|
||||
<div id="catalog" class="catalog"></div>
|
||||
<div id="ecosystem-detail" class="results"></div>
|
||||
|
||||
@@ -247,97 +253,190 @@ export const APP_HTML = `<!doctype html>
|
||||
|
||||
/** The workbench stylesheet. */
|
||||
export const APP_CSS = `:root {
|
||||
--paper: #f6f2e8;
|
||||
--ink: #26241f;
|
||||
--muted: #6b675d;
|
||||
--olive: #4f6146;
|
||||
--olive-soft: #dfe5d6;
|
||||
--line: #d8d2c4;
|
||||
--danger: #8a3b32;
|
||||
font-family: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
|
||||
color-scheme: light dark;
|
||||
--background: light-dark(#fafafa, #202124);
|
||||
--surface: light-dark(#fff, #252629);
|
||||
--field: light-dark(#fff, #202124);
|
||||
--ink: light-dark(#202124, #ecedf0);
|
||||
--muted: light-dark(#575d66, #b4b8be);
|
||||
--line: light-dark(#e1e4e8, #37393d);
|
||||
--control-line: #838a94;
|
||||
--hover: light-dark(#eef0f2, #303236);
|
||||
--accent: light-dark(#536742, #a7b996);
|
||||
--accent-line: light-dark(#758668, #78896d);
|
||||
--selection: light-dark(#dce4d6, #414b3a);
|
||||
--status: light-dark(#ebedf0, #333538);
|
||||
--warning-bg: light-dark(#f4e9d9, #463628);
|
||||
--warning-ink: light-dark(#714b22, #f2c89a);
|
||||
--danger: light-dark(#9d3435, #f1a6a5);
|
||||
--radius: 8px;
|
||||
font: 13px / 1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
|
||||
'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* The desktop shell can select a scheme independently of the operating system. */
|
||||
:root[data-mqdh-scheme="light"] { color-scheme: light; }
|
||||
:root[data-mqdh-scheme="dark"] { color-scheme: dark; }
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.7; }
|
||||
a { color: var(--olive); }
|
||||
.top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.9rem 1.6rem; border-bottom: 1px solid var(--line); background: #fbf8f0; flex-wrap: wrap; }
|
||||
.brand { display: flex; align-items: center; gap: 0.6rem; }
|
||||
.brand .mark { width: 1.9rem; height: 1.9rem; border-radius: 0.45rem; background: var(--olive); color: #fff; display: grid; place-items: center; font-weight: 700; }
|
||||
.brand .sub { color: var(--muted); font-size: 0.85rem; }
|
||||
.links a { margin-left: 1rem; text-decoration: none; font-size: 0.92rem; }
|
||||
.links a[aria-current="page"] { border-bottom: 2px solid var(--olive); }
|
||||
main { max-width: 1080px; margin: 0 auto; padding: 1.4rem 1.6rem 4rem; }
|
||||
.hero h1 { font-size: 1.65rem; margin: 0.6rem 0 0.3rem; }
|
||||
.hero p { color: var(--muted); margin-top: 0; }
|
||||
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem; margin: 1.2rem 0; }
|
||||
.card { background: #fffdf8; border: 1px solid var(--line); border-radius: 0.7rem; padding: 0.9rem 1rem; }
|
||||
.card h2 { font-size: 0.9rem; margin: 0; color: var(--muted); font-weight: 600; }
|
||||
.card .big { font-size: 1.15rem; margin: 0.25rem 0; overflow-wrap: anywhere; }
|
||||
.muted { color: var(--muted); font-size: 0.86rem; overflow-wrap: anywhere; }
|
||||
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
|
||||
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0.55rem 0.8rem; font: inherit; color: var(--muted); cursor: pointer; }
|
||||
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--olive); }
|
||||
.panel h2 { font-size: 1.1rem; margin: 1rem 0 0.6rem; }
|
||||
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
|
||||
.form { background: #fffdf8; border: 1px solid var(--line); border-radius: 0.7rem; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
|
||||
.form.inline { flex-direction: row; align-items: end; }
|
||||
.form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
|
||||
input, select, button { font: inherit; }
|
||||
input, select { padding: 0.45rem 0.55rem; border: 1px solid var(--line); border-radius: 0.4rem; background: #fff; color: var(--ink); }
|
||||
button { padding: 0.5rem 0.9rem; border-radius: 0.45rem; border: 1px solid var(--olive); background: var(--olive); color: #fff; cursor: pointer; }
|
||||
button[data-destructive="true"], button.danger { background: var(--danger); border-color: var(--danger); }
|
||||
button.ghost { background: transparent; color: var(--olive); }
|
||||
button:disabled { opacity: 0.55; cursor: progress; }
|
||||
.catalog { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
|
||||
.group { border: 1px solid var(--line); border-radius: 0.7rem; background: #fffdf8; padding: 0.9rem 1rem; }
|
||||
.group-head { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; flex-wrap: wrap; }
|
||||
.group-head h3 { margin: 0; font-size: 1rem; }
|
||||
.group .list { margin-top: 0.6rem; }
|
||||
.panel h3 { font-size: 1rem; margin: 0.8rem 0 0.4rem; }
|
||||
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
|
||||
.list li { background: #fffdf8; border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.75rem 0.9rem; }
|
||||
.list .row { display: flex; justify-content: space-between; gap: 0.7rem; align-items: start; flex-wrap: wrap; }
|
||||
.badge { display: inline-block; font-size: 0.75rem; padding: 0.1rem 0.45rem; border-radius: 1rem; background: var(--olive-soft); color: var(--olive); margin-left: 0.35rem; }
|
||||
.badge.warn { background: #f3e4d2; color: #7a4b20; }
|
||||
.results { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
|
||||
.hit { border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.8rem 0.9rem; background: #fffdf8; }
|
||||
.hit h3 { margin: 0 0 0.2rem; font-size: 1rem; }
|
||||
.hit .src { color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
|
||||
.hit pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.85rem; margin: 0.5rem 0 0; }
|
||||
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; }
|
||||
.facts dt { color: var(--muted); }
|
||||
.facts dd { margin: 0; overflow-wrap: anywhere; }
|
||||
.code { background: #26241f; color: #f3efe5; border-radius: 0.6rem; padding: 0.9rem; overflow: auto; font-size: 0.8rem; max-height: 32rem; }
|
||||
.error { color: var(--danger); min-height: 1.5rem; }
|
||||
.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1rem; border-top: 1px solid var(--line); }
|
||||
.reader-toolbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.7rem 0; }
|
||||
.reader-frame { border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; background: #fff; }
|
||||
.reader-frame iframe { display: block; width: 100%; min-height: 70vh; border: 0; background: #fff; }
|
||||
.market { border: 1px solid var(--line); border-radius: 0.7rem; background: #fffdf8; padding: 0.9rem 1rem; margin: 1rem 0; }
|
||||
.market-toolbar { display: flex; gap: 0.7rem; align-items: end; flex-wrap: wrap; margin: 0.6rem 0; }
|
||||
.market-toolbar label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.86rem; }
|
||||
.market-toolbar input, .market-toolbar select { min-width: 11rem; }
|
||||
.segmented { display: flex; gap: 0.3rem; flex-wrap: wrap; margin: 0.4rem 0 0.6rem; }
|
||||
.segmented button { background: transparent; color: var(--olive); border-color: var(--line); }
|
||||
.segmented button[aria-selected="true"] { background: var(--olive); color: #fff; }
|
||||
.row-button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: inherit; padding: 0; cursor: pointer; }
|
||||
.row-button:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
|
||||
.market .list li { background: #fffdf8; }
|
||||
.source-config { margin-top: 1rem; }
|
||||
.source-config summary { cursor: pointer; color: var(--olive); }
|
||||
.permissions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.35rem 0; }
|
||||
.permissions span { font-size: 0.78rem; border: 1px solid var(--line); border-radius: 1rem; padding: 0.05rem 0.45rem; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root { --paper: #17181a; --ink: #e8e6e0; --muted: #aaa79f; --olive: #a7bd94; --olive-soft: #2d352a; --line: #3a3b35; --danger: #e08a80; }
|
||||
body { background: var(--paper); color: var(--ink); }
|
||||
.top, .card, .form, .group, .list li, .hit, .market, .market .list li { background: #20211e; }
|
||||
input, select { background: #262722; color: var(--ink); }
|
||||
.code { background: #0e0f0d; color: #ece9df; }
|
||||
.market-toolbar input, .market-toolbar select { background: #262722; }
|
||||
body { margin: 0; background: var(--background); color: var(--ink); }
|
||||
h1, h2, h3, strong, b { font-weight: 500; }
|
||||
a { color: var(--accent); }
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 12px 24px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
background: var(--surface);
|
||||
}
|
||||
.brand, .links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
|
||||
body[data-embedded] > .top { display: none; }
|
||||
.brand .sub { color: var(--muted); }
|
||||
.links a { text-decoration: none; }
|
||||
.links a[aria-current="page"] { border-bottom: 2px solid var(--accent); }
|
||||
|
||||
main { max-width: 1120px; margin: 0 auto; padding: 24px 24px 40px; }
|
||||
.hero h1 { font-size: 22px; line-height: 28px; margin: 0 0 4px; }
|
||||
.hero p { color: var(--muted); margin: 0; }
|
||||
.cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 152px), 1fr));
|
||||
gap: 16px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.card { min-height: 136px; padding: 14px 16px; }
|
||||
.card h2 { font-size: 13px; margin: 0; color: var(--muted); }
|
||||
.card .big { font-size: 17px; line-height: 24px; font-weight: 500; margin: 6px 0; overflow-wrap: anywhere; }
|
||||
.card .muted { margin: 0; }
|
||||
.muted { color: var(--muted); overflow-wrap: anywhere; }
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0 4px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.tabs button {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-block-end: 2px solid transparent;
|
||||
border-radius: var(--radius) var(--radius) 0 0;
|
||||
padding: 7px 10px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.tabs button[aria-selected="true"] {
|
||||
color: var(--ink);
|
||||
border-block-end-color: var(--accent);
|
||||
font-weight: 500;
|
||||
}
|
||||
.panel h2 { font-size: 17px; line-height: 24px; margin: 16px 0 8px; }
|
||||
.panel > .muted { margin: 0 0 12px; }
|
||||
.panel h3 { font-size: 15px; margin: 12px 0 6px; }
|
||||
.split {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.card, .form, .group, .list li, .hit, .market, .reader-frame {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface);
|
||||
}
|
||||
.form { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
|
||||
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: end; }
|
||||
.form label { display: flex; flex-direction: column; gap: 4px; }
|
||||
input, select, textarea, button { font: inherit; max-inline-size: 100%; }
|
||||
input, select, textarea {
|
||||
padding: 6px 8px;
|
||||
border: 1px solid var(--control-line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--field);
|
||||
color: var(--ink);
|
||||
}
|
||||
button {
|
||||
padding: 6px 12px;
|
||||
border: 1px solid var(--control-line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface);
|
||||
color: var(--ink);
|
||||
cursor: pointer;
|
||||
}
|
||||
button.ghost { background: transparent; border-color: var(--accent-line); color: var(--accent); }
|
||||
button[data-destructive="true"], button.danger { color: var(--danger); }
|
||||
button:disabled { color: var(--muted); cursor: default; }
|
||||
:where(a, button, input, select, textarea, summary):focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
@media (hover: hover) {
|
||||
button:not(:disabled):hover { background-color: var(--hover); }
|
||||
}
|
||||
|
||||
.catalog, .results { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
|
||||
.group, .market { padding: 12px 16px; }
|
||||
.group-head { display: flex; justify-content: space-between; gap: 6px 16px; align-items: baseline; flex-wrap: wrap; }
|
||||
.group-head h3, .group-head p { margin: 0; }
|
||||
.group .list { margin-top: 12px; }
|
||||
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
|
||||
.list li, .hit { padding: 10px 12px; min-inline-size: 0; }
|
||||
.list .row { display: flex; justify-content: space-between; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
|
||||
.catalog .list li { padding: 12px; }
|
||||
.catalog .row { align-items: flex-start; }
|
||||
.catalog .row > div:first-child { flex: 1 1 240px; min-inline-size: 0; }
|
||||
.catalog .row > div:empty { display: none; }
|
||||
.catalog .row p { margin: 4px 0 0; }
|
||||
.badge {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 999px;
|
||||
background: var(--status);
|
||||
color: var(--muted);
|
||||
margin-inline-start: 6px;
|
||||
}
|
||||
.badge.warn { background: var(--warning-bg); color: var(--warning-ink); }
|
||||
.results { margin-top: 16px; }
|
||||
.results:empty { display: none; }
|
||||
.hit h3 { margin: 0 0 4px; }
|
||||
.hit .src { color: var(--muted); overflow-wrap: anywhere; }
|
||||
.hit pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
|
||||
.facts { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 4px 16px; }
|
||||
.facts dt { color: var(--muted); overflow-wrap: anywhere; }
|
||||
.facts dd { margin: 0; overflow-wrap: anywhere; }
|
||||
.code {
|
||||
background: light-dark(#eef0f2, #191a1c);
|
||||
color: var(--ink);
|
||||
border-radius: var(--radius);
|
||||
padding: 12px;
|
||||
overflow: auto;
|
||||
max-height: 32rem;
|
||||
}
|
||||
.error { color: var(--danger); min-block-size: 1.5rem; }
|
||||
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; border-top: 1px solid var(--line); }
|
||||
.reader-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
|
||||
.reader-frame { overflow: hidden; }
|
||||
.reader-frame iframe { display: block; width: 100%; min-height: 70vh; border: 0; background: var(--field); }
|
||||
.market { margin: 16px 0; }
|
||||
.market-toolbar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
|
||||
.market-toolbar label { display: flex; flex-direction: column; gap: 4px; }
|
||||
.segmented { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 10px; }
|
||||
.segmented button[aria-selected="true"], .segmented button[aria-selected="true"]:hover { background: var(--selection); }
|
||||
.row-button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: inherit; padding: 0; }
|
||||
.source-config { margin-top: 16px; }
|
||||
.source-config summary { cursor: pointer; color: var(--accent); }
|
||||
.permissions { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
|
||||
.permissions span { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; }
|
||||
|
||||
@media (max-width: 640px) {
|
||||
main { padding: 1rem; }
|
||||
main, .top { padding-inline: 16px; }
|
||||
.form.inline { flex-direction: column; align-items: stretch; }
|
||||
.links a { margin-left: 0; margin-right: 0.9rem; }
|
||||
}
|
||||
`
|
||||
|
||||
@@ -509,12 +608,12 @@ async function loadEcosystem() {
|
||||
ecosystem.runtime.installed
|
||||
? (ecosystem.runtime.version + ' · ' + ecosystem.runtime.platform + ' · ' + short(ecosystem.runtime.path, 90))
|
||||
: '未安装;首次启动或生态中心可安装受信任 CLI 基础发行',
|
||||
[el('button', { class: 'ghost', type: 'button', text: '检查受信任候选', onclick: () => checkCandidates() })])];
|
||||
[el('button', { class: 'ghost', type: 'button', text: '检查候选', onclick: () => checkCandidates() })])];
|
||||
runtimeRows.push(catalogRow('Bundle',
|
||||
ecosystem.std.installed ? '已校验' : '不可用',
|
||||
ecosystem.std.installed ? (ecosystem.std.version + ' · ' + ecosystem.std.digest + ' · ' + ecosystem.std.modules.length + ' 个模块') : '随 Runtime 作为单一 Bundle 安装,不逐模块启停'));
|
||||
runtimeRows.push(catalogRow('活动环境', environment ? '已记录' : '无',
|
||||
environment ? (environment.id + ' · source ' + (environment.source_sha || 'unknown')) : '没有 current.json',
|
||||
environment ? (environment.id + ' · source ' + (environment.source_sha || 'unknown')) : '尚未激活运行环境',
|
||||
[el('button', { class: 'ghost', type: 'button', text: '查看安装/恢复', onclick: () => $('#install-form').scrollIntoView({ behavior: 'smooth' }) })]));
|
||||
if (ecosystem.staging.length > 0) {
|
||||
runtimeRows.push(catalogRow('候选 staging', '待验证', ecosystem.staging.join(', ') + '(未激活,不会被当作已安装)'));
|
||||
|
||||
@@ -21,7 +21,7 @@ import { parseSourceConfig } from '../market/config.ts'
|
||||
import { MarketError } from '../market/errors.ts'
|
||||
import { ReaderError } from '../reader/errors.ts'
|
||||
import { runProcess } from '../core/process.ts'
|
||||
import { APP_CSS, APP_HTML, APP_JS } from './assets.ts'
|
||||
import { APP_CSS, APP_HTML, BRAND_SVG, APP_JS } from './assets.ts'
|
||||
import { isLoopbackAuthority, isTrustedAuthority } from './trust.ts'
|
||||
|
||||
/** Stable Cordis plugin name. */
|
||||
@@ -125,11 +125,15 @@ function registerRoutes(
|
||||
const url = new URL(req.url ?? '/', `http://${req.headers.host ?? '127.0.0.1'}`)
|
||||
const pathname = url.pathname.replace(/\/+$/, '') || '/'
|
||||
if (pathname === '/mqdh' && (req.method === 'GET' || req.method === 'HEAD')) {
|
||||
const embedded = url.searchParams.get('embedded') === '1'
|
||||
if (embedded) fence(req)
|
||||
const html = APP_HTML.replace('__MQDH_ORIGIN__', JSON.stringify(url.origin))
|
||||
.replace('__MQDH_EMBEDDED__', embedded ? ' data-embedded' : '')
|
||||
const ancestors = embedded ? "'self'" : "'none'"
|
||||
res.writeHead(200, {
|
||||
'content-type': 'text/html; charset=utf-8',
|
||||
'content-length': Buffer.byteLength(html),
|
||||
'content-security-policy': "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; frame-src 'self'; form-action 'self'; base-uri 'none'; frame-ancestors 'none'",
|
||||
'content-security-policy': `default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; frame-src 'self'; form-action 'self'; base-uri 'none'; frame-ancestors ${ancestors}`,
|
||||
'x-content-type-options': 'nosniff',
|
||||
'referrer-policy': 'no-referrer',
|
||||
'cache-control': 'no-store',
|
||||
@@ -137,6 +141,16 @@ function registerRoutes(
|
||||
res.end(req.method === 'HEAD' ? undefined : html)
|
||||
return
|
||||
}
|
||||
if (pathname === '/mqdh/brand.svg' && (req.method === 'GET' || req.method === 'HEAD')) {
|
||||
res.writeHead(200, {
|
||||
'content-type': 'image/svg+xml',
|
||||
'content-length': BRAND_SVG.length,
|
||||
'x-content-type-options': 'nosniff',
|
||||
'cache-control': 'no-cache',
|
||||
})
|
||||
res.end(req.method === 'HEAD' ? undefined : BRAND_SVG)
|
||||
return
|
||||
}
|
||||
if (pathname === '/mqdh/app.css' && req.method === 'GET') {
|
||||
res.writeHead(200, { 'content-type': 'text/css; charset=utf-8', 'cache-control': 'no-store' })
|
||||
res.end(APP_CSS)
|
||||
|
||||
@@ -41,6 +41,9 @@ test('the product bundle disables the Node PTC preset and plugin installation',
|
||||
const byId = new Map(rows.map(row => [row.id, row]))
|
||||
assert.equal(byId.get('preset-ptc')?.disabled, true)
|
||||
assert.equal(byId.get('plugin-manager')?.disabled, true)
|
||||
assert.equal(byId.get('ui-plugin-manager')?.disabled, true)
|
||||
assert.equal(byId.get('ui-brand-official')?.disabled, true)
|
||||
assert.ok(byId.has('mqdh-ui'))
|
||||
assert.equal(byId.get('tool-plugin-manager')?.disabled, true)
|
||||
assert.equal(byId.get('session-log-deepseek')?.disabled, true)
|
||||
assert.equal(byId.get('session-telemetry-otel')?.disabled, true)
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "@marqdo/mqdh-ui",
|
||||
"version": "0.1.0",
|
||||
"description": "Marqdo branding and ecosystem navigation for the shared Harness shell",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"./client": {
|
||||
"types": "./lib/types/client/index.d.ts",
|
||||
"default": "./lib/client.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dsh": {
|
||||
"client": {
|
||||
"platform": "web",
|
||||
"inject": [
|
||||
"@deepseek-ai/dsh-api-remote-access",
|
||||
"@deepseek-ai/dsh-api-remotes",
|
||||
"@deepseek-ai/dsh-client-locale",
|
||||
"@deepseek-ai/dsh-client-ui-conversation",
|
||||
"@deepseek-ai/dsh-client-ui-layout",
|
||||
"@deepseek-ai/dsh-client-ui-renderer",
|
||||
"@deepseek-ai/dsh-client-ui-sidebar",
|
||||
"@deepseek-ai/dsh-client-ui-theme"
|
||||
]
|
||||
}
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@deepseek-ai/cordis": "workspace:~"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@deepseek-ai/cordis": "workspace:~",
|
||||
"@deepseek-ai/dsh-api-remote-access": "workspace:*",
|
||||
"@deepseek-ai/dsh-api-remotes": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-locale": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-conversation": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-layout": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-primitives": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-renderer": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-sidebar": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-slots": "workspace:*",
|
||||
"@deepseek-ai/dsh-client-ui-theme": "workspace:*",
|
||||
"react": "^18.2.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
:global([data-panel-entry='marqdo']) {
|
||||
--dsw-focus-ring-color: light-dark(#536742, #a7b996);
|
||||
}
|
||||
|
||||
:global([data-panel-entry='marqdo']):has(> :global(button[aria-current='page'])) {
|
||||
--dsw-alias-interactive-bg-hover: light-dark(#dce4d6, #414b3a);
|
||||
}
|
||||
|
||||
.workbench {
|
||||
flex: 1;
|
||||
min-block-size: 0;
|
||||
min-inline-size: 0;
|
||||
inline-size: 100%;
|
||||
border: 0;
|
||||
background: var(--dsw-alias-bg-base);
|
||||
}
|
||||
|
||||
.inventory {
|
||||
flex: 1;
|
||||
min-block-size: 0;
|
||||
overflow: auto;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
:global([data-platform='darwin']) .workbench {
|
||||
margin-block-start: var(--dsh-frame-top-clearance);
|
||||
}
|
||||
|
||||
:global([data-platform='darwin']) .inventory {
|
||||
padding-block-start: calc(var(--dsh-frame-top-clearance) + 24px);
|
||||
}
|
||||
|
||||
.inventory h1 {
|
||||
margin-block: 0 16px;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.inventory ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.inventory li {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
column-gap: 16px;
|
||||
padding-block: 8px;
|
||||
border-block-end: 1px solid var(--dsw-alias-border-l3);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.inventory li span {
|
||||
color: var(--dsw-alias-label-secondary);
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'
|
||||
import type { PluginInventorySnapshot } from '@deepseek-ai/dsh-api-remotes/client'
|
||||
import { Button, IconPluginPinwheelOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
import type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
||||
import type { HeroBrandMarkOwnerProps } from '@deepseek-ai/dsh-client-ui-conversation/client'
|
||||
import type { ThemeSnapshot } from '@deepseek-ai/dsh-client-ui-theme/client'
|
||||
import css from './Panels.module.css'
|
||||
|
||||
/** Same-origin artwork used on the workbench and the shell. */
|
||||
export const BRAND_ICON = '/mqdh/brand.svg'
|
||||
|
||||
/**
|
||||
* Brand artwork in the dimensions supplied by each slot.
|
||||
* @param props - Mark dimensions and optional host CSS.
|
||||
* @returns Decorative Marqdo mark.
|
||||
*/
|
||||
export function MarqdoMark({ size, className }: HeroBrandMarkOwnerProps) {
|
||||
return <img className={className} src={BRAND_ICON} width={size} height={size} alt="" />
|
||||
}
|
||||
|
||||
/** Wordmark in the expanded sidebar. */
|
||||
export function MarqdoName({ t }: PropsLocale<'mqdh'>) {
|
||||
return <span>{t('product')}</span>
|
||||
}
|
||||
|
||||
/** Native sidebar glyph for the read-only Plugins panel. */
|
||||
export function PluginsIcon({ size }: PropsRuntime<'sidebar.panellist'>) {
|
||||
return <IconPluginPinwheelOutlineRegular size={size} />
|
||||
}
|
||||
|
||||
/** Theme projection supplied by the shell to the same-origin workbench. */
|
||||
export interface WorkbenchTheme {
|
||||
readonly hooks: {
|
||||
readonly workbenchScheme: HostObservable<ThemeSnapshot['active']['colorScheme']>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the workbench in the current application theme.
|
||||
* @param props - Localized title and the shell's resolved color scheme.
|
||||
* @returns The embedded workbench.
|
||||
*/
|
||||
export function Workbench({ t, useWorkbenchScheme }: PropsLocale<'mqdh'> & InjectFace<WorkbenchTheme>) {
|
||||
const scheme = useWorkbenchScheme(value => value)
|
||||
const frame = useRef<HTMLIFrameElement>(null)
|
||||
const syncScheme = useCallback(() => {
|
||||
const embedded = frame.current?.contentDocument
|
||||
if (embedded?.body?.hasAttribute('data-embedded')) {
|
||||
embedded.documentElement.setAttribute('data-mqdh-scheme', scheme)
|
||||
}
|
||||
}, [scheme])
|
||||
useLayoutEffect(syncScheme, [syncScheme])
|
||||
return <iframe
|
||||
ref={frame}
|
||||
className={css.workbench}
|
||||
title={t('marqdo')}
|
||||
src="/mqdh?embedded=1#ecosystem"
|
||||
onLoad={syncScheme}
|
||||
/>
|
||||
}
|
||||
|
||||
type Inventory = PluginInventorySnapshot['entries']
|
||||
|
||||
/** Read-only inventory callback injected by the browser plugin. */
|
||||
export interface InventoryProps extends PropsLocale<'mqdh'> {
|
||||
readonly loadInventory: () => Promise<Inventory>
|
||||
}
|
||||
|
||||
type InventoryState =
|
||||
| { readonly kind: 'loading' }
|
||||
| { readonly kind: 'failed' }
|
||||
| { readonly kind: 'ready'; readonly entries: Inventory }
|
||||
|
||||
/** The Host's configured plugin list without profile or package mutations. */
|
||||
export function PluginInventory({ loadInventory, t }: InventoryProps) {
|
||||
const [attempt, setAttempt] = useState(0)
|
||||
const [state, setState] = useState<InventoryState>({ kind: 'loading' })
|
||||
useEffect(() => {
|
||||
let current = true
|
||||
setState({ kind: 'loading' })
|
||||
void loadInventory().then((entries) => {
|
||||
if (current) setState({ kind: 'ready', entries })
|
||||
}, () => {
|
||||
if (current) setState({ kind: 'failed' })
|
||||
})
|
||||
return () => { current = false }
|
||||
}, [attempt, loadInventory])
|
||||
return (
|
||||
<section className={css.inventory}>
|
||||
<h1>{t('plugins')}</h1>
|
||||
{state.kind === 'loading' && <p role="status">{t('loading')}</p>}
|
||||
{state.kind === 'failed' && <>
|
||||
<p role="alert">{t('failed')}</p>
|
||||
<Button onClick={() => { setAttempt(attempt + 1) }}>{t('retry')}</Button>
|
||||
</>}
|
||||
{state.kind === 'ready' && (state.entries.length > 0
|
||||
? <ul>{state.entries.map(entry => (
|
||||
<li key={entry.entryId}>
|
||||
{entry.moduleName}
|
||||
<span>{t(!entry.enabled ? 'disabled' : entry.fiberPhase === 'failed' ? 'failedPlugin' : 'enabled')}</span>
|
||||
</li>
|
||||
))}</ul>
|
||||
: <p>{t('empty')}</p>)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
declare module '*.module.css' {
|
||||
const classes: Readonly<Record<string, string>>
|
||||
export default classes
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/** Product-owned contributions to the inherited DSH shell. */
|
||||
import type { Context } from '@deepseek-ai/cordis'
|
||||
import type {} from '@deepseek-ai/dsh-api-remote-access/client'
|
||||
import type { PluginInventorySnapshot } from '@deepseek-ai/dsh-api-remotes/client'
|
||||
import type {} from '@deepseek-ai/dsh-client-locale/client'
|
||||
import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
||||
import type { MainPanelId } from '@deepseek-ai/dsh-client-ui-layout/client'
|
||||
import type {} from '@deepseek-ai/dsh-client-ui-renderer/client'
|
||||
import type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'
|
||||
import type {} from '@deepseek-ai/dsh-client-ui-theme/client'
|
||||
import { en, zh } from './locales.ts'
|
||||
import { BRAND_ICON, MarqdoMark, MarqdoName, PluginInventory, PluginsIcon, Workbench, type WorkbenchTheme } from './Panels.tsx'
|
||||
|
||||
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
||||
interface LocaleNamespaceMap {
|
||||
/** MQDH brand and navigation copy. */
|
||||
mqdh: keyof typeof en
|
||||
}
|
||||
}
|
||||
|
||||
const NS = 'mqdh'
|
||||
const PLUGINS = 'plugins' as MainPanelId
|
||||
const MARQDO = 'marqdo' as MainPanelId
|
||||
|
||||
/** Services used to register navigation, artwork and the read-only inventory. */
|
||||
export const inject = ['slots', 'locale', 'remote', 'remote.pluginInventory', 'remoteAccess', 'theme']
|
||||
|
||||
/**
|
||||
* Add MQDH branding and the Marqdo entry to the existing shell.
|
||||
* @param ctx - Browser context for the product profile.
|
||||
*/
|
||||
export function apply(ctx: Context): void {
|
||||
ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'mqdh: dictionaries')
|
||||
const t = ctx.locale.bind(NS)
|
||||
ctx.effect(() => {
|
||||
const icons = Array.from(document.querySelectorAll<HTMLLinkElement>('link[rel="icon"]'))
|
||||
const previous = icons.map(icon => icon.getAttribute('href'))
|
||||
icons.forEach((icon) => { icon.setAttribute('href', BRAND_ICON) })
|
||||
return () => {
|
||||
icons.forEach((icon, index) => {
|
||||
const href = previous[index]
|
||||
if (href === null || href === undefined) icon.removeAttribute('href')
|
||||
else icon.setAttribute('href', href)
|
||||
})
|
||||
}
|
||||
}, 'mqdh: favicon')
|
||||
ctx.slots.inject('sidebar.brand.mark', () =>
|
||||
ctx.slots.register({ name: 'sidebar.brand.mark' }, MarqdoMark))
|
||||
ctx.slots.inject('sidebar.brand.name', () =>
|
||||
ctx.slots.register({ name: 'sidebar.brand.name', locale: NS }, MarqdoName))
|
||||
ctx.slots.inject('conversation.hero.brand.mark', () =>
|
||||
ctx.slots.register({ name: 'conversation.hero.brand.mark' }, MarqdoMark))
|
||||
|
||||
const workbenchScheme: WorkbenchTheme['hooks']['workbenchScheme'] = {
|
||||
getSnapshot: () => ctx.theme.getTheme().active.colorScheme,
|
||||
subscribe: listener => ctx.on('theme/change', listener),
|
||||
}
|
||||
ctx.slots.inject('main', function* () {
|
||||
yield ctx.slots.register({
|
||||
name: 'main', key: MARQDO, locale: NS, inject: () => ({ hooks: { workbenchScheme } }),
|
||||
}, Workbench)
|
||||
yield ctx.slots.inject('sidebar.panellist', () =>
|
||||
ctx.slots.register({
|
||||
name: 'sidebar.panellist', id: MARQDO, order: 1, label: () => t('marqdo'),
|
||||
}, MarqdoMark))
|
||||
})
|
||||
|
||||
const loadInventory = async (): Promise<PluginInventorySnapshot['entries']> => {
|
||||
const result = await ctx.remote.pluginInventory.list()
|
||||
if (!result.ok) throw new Error('Plugin inventory is unavailable')
|
||||
return result.value.entries
|
||||
}
|
||||
|
||||
ctx.remoteAccess.whenAccess('pluginInventory/list', function* () {
|
||||
yield ctx.slots.inject('main', function* () {
|
||||
yield ctx.slots.register({
|
||||
name: 'main', key: PLUGINS, locale: NS, inject: () => ({ loadInventory }),
|
||||
}, PluginInventory)
|
||||
yield ctx.slots.inject('sidebar.panellist', () =>
|
||||
ctx.slots.register({
|
||||
name: 'sidebar.panellist', id: PLUGINS, order: 0, label: () => t('plugins'),
|
||||
}, PluginsIcon))
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/** Product navigation and read-only plugin inventory in English. */
|
||||
export const en = {
|
||||
product: 'Marqdo Harness',
|
||||
marqdo: 'Marqdo',
|
||||
plugins: 'Plugins',
|
||||
loading: 'Loading plugins…',
|
||||
failed: 'Plugins could not be loaded.',
|
||||
retry: 'Retry',
|
||||
empty: 'No plugins are configured.',
|
||||
enabled: 'Enabled',
|
||||
disabled: 'Disabled',
|
||||
failedPlugin: 'Failed to start',
|
||||
}
|
||||
|
||||
/** Product navigation and read-only plugin inventory in Simplified Chinese. */
|
||||
export const zh: Record<keyof typeof en, string> = {
|
||||
product: 'Marqdo Harness',
|
||||
marqdo: 'Marqdo',
|
||||
plugins: '插件',
|
||||
loading: '正在读取插件…',
|
||||
failed: '无法读取插件',
|
||||
retry: '重试',
|
||||
empty: '当前没有配置插件',
|
||||
enabled: '已启用',
|
||||
disabled: '已停用',
|
||||
failedPlugin: '启动失败',
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
/** Host loader entry for the MQDH browser contribution. */
|
||||
export function apply(): void {}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.base.client.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "lib/types"
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": [
|
||||
{ "path": "../../../vendor/cordis" },
|
||||
{ "path": "../../api/remote-access/tsconfig.client.json" },
|
||||
{ "path": "../../api/remotes/tsconfig.client.json" },
|
||||
{ "path": "../../client/locale/tsconfig.client.json" },
|
||||
{ "path": "../../client/ui-conversation/tsconfig.client.json" },
|
||||
{ "path": "../../client/ui-layout" },
|
||||
{ "path": "../../client/ui-primitives" },
|
||||
{ "path": "../../client/ui-renderer" },
|
||||
{ "path": "../../client/ui-sidebar" },
|
||||
{ "path": "../../client/ui-slots" },
|
||||
{ "path": "../../client/ui-theme/tsconfig.client.json" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { clientBundle } from '../../client/tsdown.client.ts'
|
||||
|
||||
export default clientBundle(import.meta.dirname, ['lib/types/index.js'])
|
||||
Generated
+42
@@ -15575,9 +15575,51 @@ importers:
|
||||
'@marqdo/mqdh-harness':
|
||||
specifier: workspace:*
|
||||
version: link:../harness
|
||||
'@marqdo/mqdh-ui':
|
||||
specifier: workspace:*
|
||||
version: link:../ui
|
||||
|
||||
packages/marqdo/harness: {}
|
||||
|
||||
packages/marqdo/ui:
|
||||
devDependencies:
|
||||
'@deepseek-ai/cordis':
|
||||
specifier: workspace:~
|
||||
version: link:../../../vendor/cordis
|
||||
'@deepseek-ai/dsh-api-remote-access':
|
||||
specifier: workspace:*
|
||||
version: link:../../api/remote-access
|
||||
'@deepseek-ai/dsh-api-remotes':
|
||||
specifier: workspace:*
|
||||
version: link:../../api/remotes
|
||||
'@deepseek-ai/dsh-client-locale':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/locale
|
||||
'@deepseek-ai/dsh-client-ui-conversation':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/ui-conversation
|
||||
'@deepseek-ai/dsh-client-ui-layout':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/ui-layout
|
||||
'@deepseek-ai/dsh-client-ui-primitives':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/ui-primitives
|
||||
'@deepseek-ai/dsh-client-ui-renderer':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/ui-renderer
|
||||
'@deepseek-ai/dsh-client-ui-sidebar':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/ui-sidebar
|
||||
'@deepseek-ai/dsh-client-ui-slots':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/ui-slots
|
||||
'@deepseek-ai/dsh-client-ui-theme':
|
||||
specifier: workspace:*
|
||||
version: link:../../client/ui-theme
|
||||
react:
|
||||
specifier: ^18.2.0
|
||||
version: 18.3.1
|
||||
|
||||
packages/mcp/mcp-account:
|
||||
dependencies:
|
||||
'@deepseek-ai/dsh-brand':
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ if [ ! -f "$root/apps/cli/lib/bin.js" ]; then
|
||||
exit 1
|
||||
fi
|
||||
echo "mqdh ci: building repository artifacts"
|
||||
pnpm run build
|
||||
DSH_CLIENT_TITLE="Marqdo Harness" pnpm run build
|
||||
fi
|
||||
|
||||
cli="${MARQDO_BIN:-}"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Build the MQDH Windows launcher (WinExe, no console window).
|
||||
#
|
||||
# The launcher only starts the bundled runtime and opens the inherited DSH Web
|
||||
# UI; it is not a second application shell. MQDH branding is tracked separately.
|
||||
# UI. Its icon is derived from the shared MQDH artwork.
|
||||
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
@@ -19,7 +19,8 @@ if (-not $csc) { throw 'C# compiler (csc.exe) not found; install .NET Framework
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
|
||||
$target = Join-Path $OutDir 'MQDH.exe'
|
||||
& $csc /nologo /codepage:65001 /target:winexe /out:$target `
|
||||
$icon = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '..\..\packages\marqdo\harness\assets\marqdo.ico')).Path
|
||||
& $csc /nologo /codepage:65001 /target:winexe /out:$target /win32icon:$icon `
|
||||
/r:System.Windows.Forms.dll /r:System.Drawing.dll `
|
||||
(Join-Path $PSScriptRoot 'MqdhLauncher.cs')
|
||||
if ($LASTEXITCODE -ne 0) { throw "launcher compilation failed: $LASTEXITCODE" }
|
||||
|
||||
@@ -87,6 +87,7 @@ async function ensureProfile(dshHome) {
|
||||
for (const [name, target] of [
|
||||
['mqdh-bundle', join(root, 'packages', 'marqdo', 'bundle')],
|
||||
['mqdh-harness', join(root, 'packages', 'marqdo', 'harness')],
|
||||
['mqdh-ui', join(root, 'packages', 'marqdo', 'ui')],
|
||||
]) {
|
||||
const link = join(nodeModules, name)
|
||||
// Junctions are the unprivileged Windows directory link; symbolic links
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
"packages/client/*/tests/**/*.host.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "./packages/marqdo/ui" },
|
||||
{ "path": "./packages/client/ui-action-cards" },
|
||||
{ "path": "./packages/client/ui-creation-recommendations" },
|
||||
{ "path": "./packages/client/ui-plugin-recommendations" },
|
||||
|
||||
+3
-4
@@ -20,11 +20,10 @@ function isBuildFaceClient(value: unknown): boolean {
|
||||
*/
|
||||
export default defineConfig(({ env }) => {
|
||||
const client = isBuildFaceClient(env?.DSH_BUILD_FACE)
|
||||
// Downstream Marqdo packages ship TypeScript executed by Node's native type
|
||||
// stripping; they have no lib/types entry and must not enter the upstream
|
||||
// bundling graph (recorded in docs/mqdh/upstream-delta.md).
|
||||
// Product server packages run as TypeScript. Its browser contribution uses
|
||||
// the same client artifact pipeline as the inherited shell.
|
||||
const packages = workspacePackageGlobs(globSync(['vendor/*/package.json', 'packages/*/*/package.json'], { cwd: import.meta.dirname }))
|
||||
.filter(directory => !directory.startsWith('packages/marqdo/'))
|
||||
.filter(directory => !directory.startsWith('packages/marqdo/') || directory === 'packages/marqdo/ui')
|
||||
return {
|
||||
workspace: [...packages, 'apps/cli', ...client ? [] : ['apps/desktop-host']],
|
||||
entry: client ? '' : ['lib/types/{index,startup}.js'],
|
||||
|
||||
Reference in new issue
Block a user