@linxin666/dsh-client-ui-community-plugins 0.1.19 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # node scripts/verify-docs.mjs --write <dir>
5
- README.md: d3b52cd705d9337a169e8655b6a59852e7098279
6
- README.zh.md: f3403ed2441c683ac8321e52117bae36b4ce62ef
5
+ README.md: d096b72db93f88ddb1cddbb33b4dd759b50bcceb
6
+ README.zh.md: 379780df2779dd969c35d0dd6d9997b470998da0
package/README.md CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  English | [中文](README.zh.md)
4
4
 
5
- Community plugin index section for the dsh web GUI settings page: a first-level settings entry (alongside Web UI Plugins, Skin Center and Pet) that opens directly expanded, lists community-contributed plugins with links to each contributor's own repository, and carries its own enable switch.
5
+ Community plugin index section for the dsh web GUI settings page: a first-level settings entry (alongside Web UI Plugins, Skin Center and Pet) that opens directly expanded, lists community-contributed plugins in a marketplace-style grid (search box, category filter pills, cards with a one-click copy-install-command button), and carries its own enable switch.
6
6
 
7
7
  ## What it does
8
8
 
9
9
  - **First-level section**: registers one settings section next to General / Models / Plugins / Agent presets and the Web UI Plugins, Skin Center and Pet sections. The content renders directly expanded (no disclosure fold), with its own enable switch backed by the community-plugins settings namespace.
10
+ - **Marketplace display**: entries render as a searchable, category-filterable card grid — a search box over names, descriptions and authors, category pills with per-category counts, and a two-column card layout (name, npm/repo marker, a `category · author` meta line, a two-line description, a repository link and a primary copy-install-command button).
10
11
  - **Index only**: every entry links to the contributor's own repository; the package never vendors the listed code. The registry lives in community.json and is compiled into the client bundle by scripts/community-index.
11
12
 
12
13
  ## Install
@@ -31,6 +32,7 @@ Restart `dsh web` for the card to appear in the settings page.
31
32
  ## Config
32
33
 
33
34
  - **Enable switch**: inside the Community Plugins first-level section itself (the section carries its own switch). Turning it off hides the index list until it is turned back on; the choice persists in the community-plugins settings namespace.
35
+ - **Category filter**: entries may carry a `category` in community.json — one of the fixed marketplace categories `ui`, `agent`, `tools`, `knowledge`, `integration`, `security` or `utility`. The card renders them as filter pills with counts, plus a search box over names, descriptions and authors; the "npm published / repo install" marker on each card comes from the `npm` field.
34
36
  - **Running a listed plugin**: the index only registers entries, it never installs code. Each entry shows its install command (the npm package when published, else the contributor repository URL); run it in a terminal, e.g. `dsh plugin --profile web add <name>`. Once installed, the plugin provides its own switch and config (if any) in the plugin configuration section.
35
37
 
36
38
  ## Known limitations
package/README.zh.md CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- 面向 dsh web GUI 设置页的社区插件索引分区:作为一级菜单项(与 Web UI 插件、皮肤中心、宠物同级)直接展开,列出社区贡献的插件并链接到每位贡献者自己的仓库,配有自己的启用开关。
5
+ 面向 dsh web GUI 设置页的社区插件索引分区:作为一级菜单项(与 Web UI 插件、皮肤中心、宠物同级)直接展开,以插件市场风格网格展示社区贡献的插件(搜索框、分类筛选胶囊、带一键复制安装命令按钮的卡片),并配有自己的启用开关。
6
6
 
7
7
  ## 功能
8
8
 
9
9
  - **一级菜单项**:在设置页注册一个一级分区,与通用设置 / 模式 / 插件 / Agent 预设以及 Web UI 插件、皮肤中心、宠物同级;内容直接展开(无折叠层),自带启用开关,由 community-plugins 设置命名空间持久化。
10
+ - **市场风格展示**:条目以可搜索、可按分类筛选的卡片网格呈现——按名称 / 简介 / 作者的搜索框、带各分类计数的筛选胶囊,以及双列卡片布局(名称、npm/仓库标记、`分类 · 作者` 元信息行、两行简介、仓库链接与主要的「复制安装命令」按钮)。
10
11
  - **只做索引**:每个条目链接到贡献者自己的仓库;本包不打包任何被索引的代码。注册表在 community.json,由 scripts/community-index 编译进客户端 bundle。
11
12
 
12
13
  ## 安装
@@ -31,6 +32,7 @@ dsh plugin --profile web add link:$(pwd)/packages/dsh-community-plugins
31
32
  ## 配置
32
33
 
33
34
  - **启用开关**:位于「社区插件」一级分区自身(分区卡片自带的开关)。关闭后隐藏索引列表,重新打开即恢复;选择持久化在 community-plugins 设置命名空间。
35
+ - **分类筛选**:条目可在 community.json 中带 `category`(固定市场分类之一:`ui`、`agent`、`tools`、`knowledge`、`integration`、`security` 或 `utility`),卡片将它们渲染为带计数的筛选胶囊,并提供按名称 / 简介 / 作者搜索的搜索框;每张卡片上的「npm 已发布 / 仓库安装」标记来自 `npm` 字段。
34
36
  - **运行已登记的插件**:索引只登记、不安装代码。每个条目显示安装命令(已发布 npm 用包名,否则用贡献者仓库地址),在终端执行即可,如 `dsh plugin --profile web add <包名>`。安装后,插件自带的开关与配置(若有)出现在插件配置区。
35
37
 
36
38
  ## 已知限制
package/lib/client.js CHANGED
@@ -491,6 +491,23 @@ window.__ModuleLoader__.load({
491
491
  };
492
492
  //#endregion
493
493
  //#region src/client/generated/community.ts
494
+ /**
495
+ * AUTO-GENERATED by scripts/community-index — do not edit by hand.
496
+ * Community plugin index for the settings page: every entry links to the
497
+ * contributor's own repository. This repository never vendors the listed
498
+ * plugins — it only points users at them.
499
+ * Regenerate with `node scripts/community-index`.
500
+ */
501
+ /** Stable category ids rendered as marketplace-style filter pills (the runtime guard imports this). */
502
+ const COMMUNITY_CATEGORIES = [
503
+ "ui",
504
+ "agent",
505
+ "tools",
506
+ "knowledge",
507
+ "integration",
508
+ "security",
509
+ "utility"
510
+ ];
494
511
  /** Every community plugin, in community.json order. */
495
512
  const COMMUNITY_PLUGINS = [
496
513
  {
@@ -500,7 +517,8 @@ window.__ModuleLoader__.load({
500
517
  "author": "omdsh-dev",
501
518
  "repo": "https://github.com/omdsh-dev/dsh-data-agent",
502
519
  "description": "为 DSH 定义专用 Data Agent 预设,让 AI 帮你查询、更新、分析数据。",
503
- "descriptionEn": "Defines a dedicated Data Agent preset for DSH so the AI can query, update and analyze data."
520
+ "descriptionEn": "Defines a dedicated Data Agent preset for DSH so the AI can query, update and analyze data.",
521
+ "category": "agent"
504
522
  },
505
523
  {
506
524
  "id": "dsh-tui",
@@ -509,7 +527,8 @@ window.__ModuleLoader__.load({
509
527
  "author": "ccch1mneyyy",
510
528
  "repo": "https://github.com/ccch1mneyyy/dsh-TUI",
511
529
  "description": "Claude Code 风格全屏交互终端插件:像素鲸鱼顶栏、实时工作状态行、思考流式展开、双击 Esc 回滚、上下文进度条与 TPS 仪表。",
512
- "descriptionEn": "A Claude Code style fullscreen interactive terminal plugin: pixel-whale header, live working-state line, streaming reasoning expansion, double-Esc rollback, context progress bar and TPS gauges."
530
+ "descriptionEn": "A Claude Code style fullscreen interactive terminal plugin: pixel-whale header, live working-state line, streaming reasoning expansion, double-Esc rollback, context progress bar and TPS gauges.",
531
+ "category": "ui"
513
532
  },
514
533
  {
515
534
  "id": "dsh-tianshu-tui",
@@ -518,7 +537,8 @@ window.__ModuleLoader__.load({
518
537
  "author": "huiliyi37",
519
538
  "repo": "https://github.com/huiliyi37/dsh-tianshu-tui",
520
539
  "description": "基于官方 DeepSeek Harness 的交互式终端 UI 插件,在官方基础上增加 TDD 与证据门等工作流。",
521
- "descriptionEn": "An interactive terminal UI plugin for DeepSeek Harness that adds TDD and evidence-gate workflows on top of the official base."
540
+ "descriptionEn": "An interactive terminal UI plugin for DeepSeek Harness that adds TDD and evidence-gate workflows on top of the official base.",
541
+ "category": "ui"
522
542
  },
523
543
  {
524
544
  "id": "dsh-chat-summary",
@@ -528,7 +548,8 @@ window.__ModuleLoader__.load({
528
548
  "repo": "https://github.com/v833/dsh-chat-summary",
529
549
  "description": "总结当前对话并导出为 Markdown / DOCX / PDF,可选 LLM 智能总结(用户自配 API Key)。",
530
550
  "descriptionEn": "Summarize the current conversation and export it as Markdown / DOCX / PDF, with optional LLM summarization using your own API key.",
531
- "npm": "@linxin666/dsh-client-ui-chat-summary"
551
+ "npm": "@linxin666/dsh-client-ui-chat-summary",
552
+ "category": "knowledge"
532
553
  },
533
554
  {
534
555
  "id": "dsh-builtin-toggles",
@@ -538,7 +559,8 @@ window.__ModuleLoader__.load({
538
559
  "repo": "https://github.com/Starfie1d1272/dsh-builtin-toggles",
539
560
  "description": "Evidence-backed 内置 capability Inspector:展示 DSH Web built-in capability 的 provenance、compatibility 与 structural drift;仅对 9 个经过审阅的 UI leaves 提供 fail-closed 开关。",
540
561
  "descriptionEn": "Evidence-backed built-in capability Inspector: surfaces provenance, compatibility and structural drift of DSH Web built-ins, with fail-closed toggles for only the nine reviewed UI leaves.",
541
- "npm": "dsh-builtin-toggles"
562
+ "npm": "dsh-builtin-toggles",
563
+ "category": "tools"
542
564
  },
543
565
  {
544
566
  "id": "dsh-pilot",
@@ -547,7 +569,8 @@ window.__ModuleLoader__.load({
547
569
  "author": "guo6x",
548
570
  "repo": "https://github.com/guo6x/dsh-pilot",
549
571
  "description": "给 agent 一双会开车的手:零依赖 CDP 浏览器操控(8 个 pilot_* 工具:导航/点击/输入/按键/JS/截图)+ Web GUI 可拖拽驾驶舱面板,无需 Playwright、无需 API key。",
550
- "descriptionEn": "Give your agent hands: zero-dependency CDP browser control (8 pilot_* tools: navigate/click/type/keys/eval/screenshot) plus a draggable cockpit panel in the Web GUI - no Playwright, no API key."
572
+ "descriptionEn": "Give your agent hands: zero-dependency CDP browser control (8 pilot_* tools: navigate/click/type/keys/eval/screenshot) plus a draggable cockpit panel in the Web GUI - no Playwright, no API key.",
573
+ "category": "tools"
551
574
  },
552
575
  {
553
576
  "id": "dsh-housekeeper",
@@ -556,7 +579,8 @@ window.__ModuleLoader__.load({
556
579
  "author": "guo6x",
557
580
  "repo": "https://github.com/guo6x/dsh-housekeeper",
558
581
  "description": "管住 agent 的脏手:工具链台账(node/pnpm/git/gh/ffmpeg 等自动探测)、缓存与临时目录扫描 + 白名单安全一键清理、机器规则 AGENTS.md 查看编辑,全在设置面板完成。",
559
- "descriptionEn": "Keep your agent's hands clean: toolchain inventory, scratch/cache scan with whitelist-guarded one-click cleanup, and the machine rules file (AGENTS.md) view/edit - all in the settings panel."
582
+ "descriptionEn": "Keep your agent's hands clean: toolchain inventory, scratch/cache scan with whitelist-guarded one-click cleanup, and the machine rules file (AGENTS.md) view/edit - all in the settings panel.",
583
+ "category": "utility"
560
584
  },
561
585
  {
562
586
  "id": "dsh-deepread",
@@ -566,7 +590,8 @@ window.__ModuleLoader__.load({
566
590
  "repo": "https://github.com/xiehuan123/dsh-deepread",
567
591
  "description": "五种模式精读插件(quick / deep / map / feynman / book),支持公众号链接与文件输入、批量对比、预算预检与后台任务进度透明,导出 md / mm / html,Web UI 提供工具结果卡片与精读面板。",
568
592
  "descriptionEn": "A five-mode deep reading plugin (quick / deep / map / feynman / book) for links and files, with batch comparison, budget preflight, transparent background-job progress, md / mm / html exports, and Web UI tool-result cards plus a reading panel.",
569
- "npm": "dsh-deepread"
593
+ "npm": "dsh-deepread",
594
+ "category": "knowledge"
570
595
  },
571
596
  {
572
597
  "id": "dsh-mnemon",
@@ -576,7 +601,8 @@ window.__ModuleLoader__.load({
576
601
  "repo": "https://github.com/omdsh-dev/dsh-mnemon",
577
602
  "description": "与 Mnemon CLI 集成的跨 Agent、本地优先持久记忆插件:用户画像 / 工作记忆 / 项目档案与长期 Memory Spaces,支持导入导出。",
578
603
  "descriptionEn": "A cross-agent, local-first persistent memory plugin integrating the Mnemon CLI: profiles, working memory, project documents and long-term Memory Spaces, with import and export.",
579
- "npm": "dsh-mnemon"
604
+ "npm": "dsh-mnemon",
605
+ "category": "knowledge"
580
606
  },
581
607
  {
582
608
  "id": "dsh-plugin-hub",
@@ -585,7 +611,8 @@ window.__ModuleLoader__.load({
585
611
  "author": "Noob-stupid",
586
612
  "repo": "https://github.com/Noob-stupid/dsh-plugin-hub",
587
613
  "description": "插件管理面板:已安装插件一键启用/停用,内置 GitHub dsh-plugin 插件市场(官方/聚合识别、子包浏览、一键安装与本地 AI 兜底修复、删除卸载)。",
588
- "descriptionEn": "Plugin management panel: one-click enable/disable, a GitHub dsh-plugin marketplace with official/aggregate detection, subpackage browsing, one-click installs with local-AI fallback repair, and uninstall."
614
+ "descriptionEn": "Plugin management panel: one-click enable/disable, a GitHub dsh-plugin marketplace with official/aggregate detection, subpackage browsing, one-click installs with local-AI fallback repair, and uninstall.",
615
+ "category": "tools"
589
616
  },
590
617
  {
591
618
  "id": "dsh-genui",
@@ -594,7 +621,8 @@ window.__ModuleLoader__.load({
594
621
  "author": "omdsh-dev",
595
622
  "repo": "https://github.com/omdsh-dev/dsh-genui",
596
623
  "description": "给模型输出配交互式 UI:助手回复内联渲染 dsh-ui fence(布局、图表、表单、Mermaid、3D),支持流式渲染与面板停靠,组件交互可回传模型。",
597
- "descriptionEn": "Interactive UI inside assistant replies via the dsh-ui fence: layouts, charts, forms, Mermaid and 3D with streaming rendering, panel docking and actions that loop back to the model."
624
+ "descriptionEn": "Interactive UI inside assistant replies via the dsh-ui fence: layouts, charts, forms, Mermaid and 3D with streaming rendering, panel docking and actions that loop back to the model.",
625
+ "category": "ui"
598
626
  },
599
627
  {
600
628
  "id": "dsh-annotation",
@@ -603,7 +631,8 @@ window.__ModuleLoader__.load({
603
631
  "author": "omdsh-dev",
604
632
  "repo": "https://github.com/omdsh-dev/dsh-annotation",
605
633
  "description": "选中助手文字即可批注,回车随消息发送;自己的气泡只显示问题与「批注 ×N」标签,模型按 Annotation N 逐条对照回复(悬浮芯片)。",
606
- "descriptionEn": "Select text in an assistant reply to annotate it; annotations are sent with your next message, hidden from your own bubble behind an Annotations xN chip, and the model replies per Annotation N with hoverable chips."
634
+ "descriptionEn": "Select text in an assistant reply to annotate it; annotations are sent with your next message, hidden from your own bubble behind an Annotations xN chip, and the model replies per Annotation N with hoverable chips.",
635
+ "category": "ui"
607
636
  },
608
637
  {
609
638
  "id": "deepseek-harness-auth",
@@ -613,7 +642,8 @@ window.__ModuleLoader__.load({
613
642
  "repo": "https://github.com/taichuy/deepseek-harness-auth",
614
643
  "description": "为 DSH Web 公网部署提供登录认证前置代理,支持账号密码、验证码、失败锁定和 IP/CIDR 白名单。",
615
644
  "descriptionEn": "An authentication proxy for public DSH Web deployments with password login, captcha, failed-attempt locking, and IP/CIDR allowlists.",
616
- "npm": "deepseek-harness-auth"
645
+ "npm": "deepseek-harness-auth",
646
+ "category": "security"
617
647
  },
618
648
  {
619
649
  "id": "dsh-cloud-sync",
@@ -623,11 +653,48 @@ window.__ModuleLoader__.load({
623
653
  "repo": "https://github.com/dickpy/dsh-cloud-sync",
624
654
  "description": "支持 WebDAV、S3、阿里云 OSS、腾讯云 COS 与 MinIO 的 DSH 云同步插件,可同步 profile、插件配置及本地插件源码归档。",
625
655
  "descriptionEn": "DSH cloud sync for WebDAV, S3, Alibaba Cloud OSS, Tencent Cloud COS and MinIO, syncing profiles, plugin settings and local plugin source archives.",
626
- "npm": "@dickpy/dsh-cloud-sync"
656
+ "npm": "@dickpy/dsh-cloud-sync",
657
+ "category": "integration"
658
+ },
659
+ {
660
+ "id": "dsh-auto-memory",
661
+ "name": "自动记忆",
662
+ "nameEn": "Auto Memory",
663
+ "author": "Aik358",
664
+ "repo": "https://github.com/Aik358/dsh-auto-memory",
665
+ "description": "三层自动记忆插件:用户级/项目笔记/每日日志自动注入与检索、每轮自动沉淀、AI 时段问候、智能检索、日历与工作区思维导图,支持继承 WorkBuddy/CodeBuddy/Claude Code/Codex 等其他 AI 工具的记忆。",
666
+ "descriptionEn": "Three-layer auto memory for DSH: user-level/project-notes/daily-logs with automatic injection and retrieval, per-turn auto-consolidation, AI greetings, smart search, calendar, workspace mind map, and inheritance from WorkBuddy/CodeBuddy/Claude Code/Codex.",
667
+ "npm": "@a9i5k4/dsh-auto-memory",
668
+ "category": "knowledge"
669
+ },
670
+ {
671
+ "id": "dsh-memoir",
672
+ "name": "项目记忆 Memoir",
673
+ "nameEn": "Project Memory Memoir",
674
+ "author": "Qinling-Melon-Farmers",
675
+ "repo": "https://github.com/Qinling-Melon-Farmers/dsh-memoir",
676
+ "description": "项目持久化记忆与会话经验沉淀:memoir_record / memoir_read 工具(BM25 相关度排序检索)、每轮工作自动蒸馏、记忆诊断面板与跨项目全局检索,纯本地零外部依赖。",
677
+ "descriptionEn": "Project persistent memory and session-lessons distillation: memoir_record / memoir_read tools with BM25-ranked retrieval, per-turn auto-distill, a memory diagnostics panel and cross-project search - fully local, no external dependency.",
678
+ "category": "knowledge"
627
679
  }
628
680
  ];
629
681
  //#endregion
630
682
  //#region src/client/community-guard.ts
683
+ /**
684
+ * Runtime guard for the generated community index entries. The index is
685
+ * build-time generated data, but the card renders whatever the module
686
+ * carries; a hand-written narrowing keeps one malformed entry from breaking
687
+ * the whole list at render time.
688
+ */
689
+ /** Category ids the card knows how to label; others are treated as uncategorized. */
690
+ const KNOWN_CATEGORIES = COMMUNITY_CATEGORIES;
691
+ /**
692
+ * The install command is pasted into a shell, so repo/npm must be free of
693
+ * shell metacharacters: repo is a plain https URL of path-safe characters,
694
+ * npm a standard (optionally scoped) package name.
695
+ */
696
+ const REPO_SAFE_RE = /^https:\/\/[A-Za-z0-9._~\/-]+$/;
697
+ const NPM_SAFE_RE = /^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
631
698
  /** True when the value is a well-formed community plugin entry. */
632
699
  function isCommunityPluginEntry(value) {
633
700
  if (typeof value !== "object" || value === null) return false;
@@ -635,15 +702,16 @@ window.__ModuleLoader__.load({
635
702
  if (typeof entry.id !== "string" || entry.id === "") return false;
636
703
  if (typeof entry.name !== "string" || typeof entry.nameEn !== "string") return false;
637
704
  if (typeof entry.author !== "string" || entry.author === "") return false;
638
- if (typeof entry.repo !== "string" || !entry.repo.startsWith("https://")) return false;
705
+ if (typeof entry.repo !== "string" || !REPO_SAFE_RE.test(entry.repo)) return false;
639
706
  if (entry.description !== void 0 && typeof entry.description !== "string") return false;
640
707
  if (entry.descriptionEn !== void 0 && typeof entry.descriptionEn !== "string") return false;
641
- if (entry.npm !== void 0 && typeof entry.npm !== "string") return false;
708
+ if (entry.npm !== void 0 && (typeof entry.npm !== "string" || !NPM_SAFE_RE.test(entry.npm))) return false;
709
+ if (entry.category !== void 0 && (typeof entry.category !== "string" || !KNOWN_CATEGORIES.includes(entry.category))) return false;
642
710
  return true;
643
711
  }
644
712
  //#endregion
645
713
  //#region \0dsh-css:packages/dsh-community-plugins/src/client/community.module.css.mjs
646
- const css = ".z0J_8a_sectionList{margin:0;padding:0;list-style:none}.z0J_8a_entries{flex-direction:column;gap:8px;margin:8px 0 0;padding:0;list-style:none;display:flex}.z0J_8a_entry{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:6px;flex-direction:column;gap:4px;padding:10px 12px;display:flex}.z0J_8a_entryHead{justify-content:space-between;align-items:baseline;gap:8px;min-width:0;display:flex}.z0J_8a_entryName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.z0J_8a_entryAuthor{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:12px;overflow:hidden}.z0J_8a_entryDescription,.z0J_8a_entryDescriptionEn{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.4}.z0J_8a_entryDescriptionEn{color:var(--dsw-alias-label-tertiary);font-size:12px}.z0J_8a_entryLinks{flex-wrap:wrap;align-items:center;gap:10px;margin-top:2px;display:flex}.z0J_8a_entryLink{color:var(--dsw-alias-link-primary,var(--dsw-alias-button-info-fill));font-size:13px;text-decoration:underline}.z0J_8a_entryLink:hover{text-decoration:none}.z0J_8a_entryNpm{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.z0J_8a_entryInstall{flex-wrap:wrap;align-items:center;gap:8px;margin-top:2px;display:flex}.z0J_8a_entryCommand{min-width:0;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);overflow-wrap:anywhere;border-radius:4px;flex:1;padding:2px 6px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}.z0J_8a_copyButton{color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;background:0 0;border-radius:4px;flex:none;padding:2px 10px;font-size:12px;line-height:1.5}.z0J_8a_copyButton:hover{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.z0J_8a_installNote{color:var(--dsw-alias-label-tertiary);margin:8px 2px 0;font-size:12px;line-height:1.4}.z0J_8a_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:8px 2px;font-size:13px}.z0J_8a_off{color:var(--dsw-alias-label-tertiary);margin:8px 2px 0;font-size:13px}.z0J_8a_notice{color:var(--dsw-alias-label-tertiary);margin:10px 2px 0;font-size:12px;line-height:1.4}";
714
+ const css = ".z0J_8a_sectionList{margin:0;padding:0;list-style:none}.z0J_8a_market{flex-direction:column;gap:10px;margin-top:12px;display:flex}.z0J_8a_toolbar{display:flex}.z0J_8a_search{min-width:0;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;flex:1;padding:6px 10px;font-size:13px;line-height:1.5}.z0J_8a_search::placeholder{color:var(--dsw-alias-label-tertiary)}.z0J_8a_search:focus{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.z0J_8a_search:disabled{opacity:.5}.z0J_8a_filters{flex-wrap:wrap;gap:6px;display:flex}.z0J_8a_pill{font:inherit;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;border-radius:999px;padding:2px 10px;font-size:12px;line-height:1.6}.z0J_8a_pill:hover:enabled{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.z0J_8a_pill:disabled{opacity:.5;cursor:default}.z0J_8a_pillActive{color:var(--dsw-alias-bg-layer-3);background:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-primary);font-weight:600}.z0J_8a_pillActive:hover:enabled{color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary)}.z0J_8a_resultCount{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.4}.z0J_8a_grid{grid-template-columns:repeat(auto-fill,minmax(256px,1fr));gap:8px;margin:0;padding:0;list-style:none;display:grid}.z0J_8a_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:8px;flex-direction:column;gap:6px;min-width:0;padding:12px;display:flex}.z0J_8a_card:hover{border-color:var(--dsw-alias-label-dimmed)}.z0J_8a_cardHead{justify-content:space-between;align-items:baseline;gap:8px;min-width:0;display:flex}.z0J_8a_cardName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.z0J_8a_badge{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);white-space:nowrap;border-radius:999px;flex:none;padding:0 8px;font-size:11px;line-height:1.6}.z0J_8a_badgePublished{color:var(--dsw-alias-link-primary,var(--dsw-alias-button-info-fill));border-color:var(--dsw-alias-link-primary,var(--dsw-alias-button-info-fill))}.z0J_8a_cardMeta{min-width:0;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;margin:0;font-size:12px;line-height:1.4;display:flex}.z0J_8a_cardCategory{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none}.z0J_8a_cardDot{flex:none}.z0J_8a_cardAuthor{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.z0J_8a_cardDescription{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;margin:0;font-size:13px;line-height:1.45;display:-webkit-box;overflow:hidden}.z0J_8a_cardFooter{flex-direction:column;gap:6px;margin-top:auto;padding-top:6px;display:flex}.z0J_8a_cardTop{justify-content:space-between;align-items:center;gap:8px;min-width:0;display:flex}.z0J_8a_cardLink{color:var(--dsw-alias-link-primary,var(--dsw-alias-button-info-fill));font-size:13px;text-decoration:none}.z0J_8a_cardLink:hover{text-decoration:underline}.z0J_8a_cardCommand{box-sizing:border-box;width:100%;min-width:0;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);white-space:nowrap;text-overflow:ellipsis;border-radius:4px;padding:2px 6px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;overflow:hidden}.z0J_8a_installButton{font:inherit;color:var(--dsw-alias-bg-layer-3);background:var(--dsw-alias-button-info-fill);border:1px solid var(--dsw-alias-button-info-fill);cursor:pointer;white-space:nowrap;border-radius:6px;flex:none;padding:4px 12px;font-size:12px;font-weight:600;line-height:1.5}.z0J_8a_installButton:hover:enabled{opacity:.88}.z0J_8a_installButton:disabled{opacity:.5;cursor:default}.z0J_8a_installButtonCopied{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed);background:0 0}.z0J_8a_installNote{color:var(--dsw-alias-label-tertiary);margin:8px 2px 0;font-size:12px;line-height:1.4}.z0J_8a_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:8px 2px;font-size:13px}.z0J_8a_off{color:var(--dsw-alias-label-tertiary);margin:8px 2px 0;font-size:13px}.z0J_8a_notice{color:var(--dsw-alias-label-tertiary);margin:10px 2px 0;font-size:12px;line-height:1.4}";
647
715
  const tagId = "@linxin666/dsh-client-ui-community-plugins/community.module.css";
648
716
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
649
717
  const tag = document.createElement("style");
@@ -653,33 +721,45 @@ window.__ModuleLoader__.load({
653
721
  document.head.appendChild(tag);
654
722
  }
655
723
  var community_module_css_default = {
656
- "copyButton": "z0J_8a_copyButton",
724
+ "badge": "z0J_8a_badge",
725
+ "badgePublished": "z0J_8a_badgePublished",
726
+ "card": "z0J_8a_card",
727
+ "cardAuthor": "z0J_8a_cardAuthor",
728
+ "cardCategory": "z0J_8a_cardCategory",
729
+ "cardCommand": "z0J_8a_cardCommand",
730
+ "cardDescription": "z0J_8a_cardDescription",
731
+ "cardDot": "z0J_8a_cardDot",
732
+ "cardFooter": "z0J_8a_cardFooter",
733
+ "cardHead": "z0J_8a_cardHead",
734
+ "cardLink": "z0J_8a_cardLink",
735
+ "cardMeta": "z0J_8a_cardMeta",
736
+ "cardName": "z0J_8a_cardName",
737
+ "cardTop": "z0J_8a_cardTop",
657
738
  "empty": "z0J_8a_empty",
658
- "entries": "z0J_8a_entries",
659
- "entry": "z0J_8a_entry",
660
- "entryAuthor": "z0J_8a_entryAuthor",
661
- "entryCommand": "z0J_8a_entryCommand",
662
- "entryDescription": "z0J_8a_entryDescription",
663
- "entryDescriptionEn": "z0J_8a_entryDescriptionEn",
664
- "entryHead": "z0J_8a_entryHead",
665
- "entryInstall": "z0J_8a_entryInstall",
666
- "entryLink": "z0J_8a_entryLink",
667
- "entryLinks": "z0J_8a_entryLinks",
668
- "entryName": "z0J_8a_entryName",
669
- "entryNpm": "z0J_8a_entryNpm",
739
+ "filters": "z0J_8a_filters",
740
+ "grid": "z0J_8a_grid",
741
+ "installButton": "z0J_8a_installButton",
742
+ "installButtonCopied": "z0J_8a_installButtonCopied",
670
743
  "installNote": "z0J_8a_installNote",
744
+ "market": "z0J_8a_market",
671
745
  "notice": "z0J_8a_notice",
672
746
  "off": "z0J_8a_off",
673
- "sectionList": "z0J_8a_sectionList"
747
+ "pill": "z0J_8a_pill",
748
+ "pillActive": "z0J_8a_pillActive",
749
+ "resultCount": "z0J_8a_resultCount",
750
+ "search": "z0J_8a_search",
751
+ "sectionList": "z0J_8a_sectionList",
752
+ "toolbar": "z0J_8a_toolbar"
674
753
  };
675
754
  //#endregion
676
755
  //#region src/client/CommunityPluginsCard.tsx
677
756
  /**
678
757
  * The community plugin index card: a first-level settings section that is
679
- * always open (a static header with the index list directly visible). Its own
680
- * enable switch (backed by the community-plugins settings namespace) gates
681
- * the entry list; the list itself points at contributors' own repositories
682
- * this package only indexes them, it never vendors their code.
758
+ * always open. Its own enable switch (backed by the community-plugins
759
+ * settings namespace) gates the list, which is presented marketplace-style:
760
+ * a search box, category filter pills with counts, and a two-column card grid
761
+ * whose entries link to contributors' own repositories this package only
762
+ * indexes them, it never vendors their code.
683
763
  */
684
764
  /** Bridges the community-plugins scope onto the card's staged form. */
685
765
  var CommunityPluginsCardController = class {
@@ -719,6 +799,25 @@ window.__ModuleLoader__.load({
719
799
  return `dsh plugin --profile web add ${entry.npm ?? entry.repo}`;
720
800
  }
721
801
  /**
802
+ * Localized entry copy read through the card's `t`. Falls back to the raw
803
+ * entry field when the key is missing — the dictionary only carries the
804
+ * generated registry, so injected test entries land on the fallback.
805
+ */
806
+ function entryCopy(t, key, fallback) {
807
+ const value = t(key);
808
+ return value === key ? fallback : value;
809
+ }
810
+ /** Maps a category id onto its locale dictionary key (kept in the generated union). */
811
+ const CATEGORY_KEY = {
812
+ ui: "category.ui",
813
+ agent: "category.agent",
814
+ tools: "category.tools",
815
+ knowledge: "category.knowledge",
816
+ integration: "category.integration",
817
+ security: "category.security",
818
+ utility: "category.utility"
819
+ };
820
+ /**
722
821
  * Render the community plugin index card.
723
822
  * @param props - locale copy, the card snapshot, its form actions, and the
724
823
  * (default-generated) entry list.
@@ -727,7 +826,9 @@ window.__ModuleLoader__.load({
727
826
  function CommunityPluginsCard(props) {
728
827
  const { t } = props;
729
828
  const state = props.useCommunityPluginsCard((snapshot) => snapshot);
730
- const plugins = (props.plugins ?? COMMUNITY_PLUGINS).filter(isCommunityPluginEntry);
829
+ const plugins = (0, react.useMemo)(() => (props.plugins ?? COMMUNITY_PLUGINS).filter(isCommunityPluginEntry), [props.plugins]);
830
+ const [query, setQuery] = (0, react.useState)("");
831
+ const [category, setCategory] = (0, react.useState)(null);
731
832
  const [copiedId, setCopiedId] = (0, react.useState)(null);
732
833
  const copyCommand = (id, command) => {
733
834
  const mark = () => {
@@ -759,6 +860,33 @@ window.__ModuleLoader__.load({
759
860
  invalidLabel: t("settings.invalidNumber"),
760
861
  disabled
761
862
  };
863
+ const categoryCounts = (0, react.useMemo)(() => {
864
+ const counts = /* @__PURE__ */ new Map();
865
+ for (const plugin of plugins) if (plugin.category) counts.set(plugin.category, (counts.get(plugin.category) ?? 0) + 1);
866
+ return [...counts.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
867
+ }, [plugins]);
868
+ const visiblePlugins = (0, react.useMemo)(() => {
869
+ const needle = query.trim().toLowerCase();
870
+ return plugins.filter((plugin) => {
871
+ if (category !== null && plugin.category !== category) return false;
872
+ if (!needle) return true;
873
+ const categoryLabel = plugin.category ? t(CATEGORY_KEY[plugin.category]) : "";
874
+ return [
875
+ plugin.name,
876
+ plugin.nameEn,
877
+ plugin.author,
878
+ plugin.description,
879
+ plugin.descriptionEn,
880
+ plugin.npm ?? "",
881
+ categoryLabel
882
+ ].join(" ").toLowerCase().includes(needle);
883
+ });
884
+ }, [
885
+ plugins,
886
+ query,
887
+ category,
888
+ t
889
+ ]);
762
890
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PluginSettingsCard, {
763
891
  t,
764
892
  titleKey: "settings.title",
@@ -784,68 +912,147 @@ window.__ModuleLoader__.load({
784
912
  props.resetField("enabled");
785
913
  }
786
914
  }),
787
- visible ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
788
- className: community_module_css_default.entries,
789
- children: plugins.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
790
- className: community_module_css_default.empty,
791
- role: "status",
792
- children: t("empty")
793
- }) : plugins.map((plugin) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
794
- className: community_module_css_default.entry,
795
- children: [
796
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
797
- className: community_module_css_default.entryHead,
798
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
799
- className: community_module_css_default.entryName,
800
- title: plugin.name,
801
- children: plugin.name
802
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
803
- className: community_module_css_default.entryAuthor,
804
- title: plugin.author,
915
+ visible ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
916
+ className: community_module_css_default.market,
917
+ children: [
918
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
919
+ className: community_module_css_default.toolbar,
920
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
921
+ id: "settings-community-search",
922
+ className: community_module_css_default.search,
923
+ type: "search",
924
+ placeholder: t("search.placeholder"),
925
+ "aria-label": t("search.label"),
926
+ value: query,
927
+ disabled,
928
+ onChange: (event) => {
929
+ setQuery(event.target.value);
930
+ }
931
+ })
932
+ }),
933
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
934
+ className: community_module_css_default.filters,
935
+ role: "group",
936
+ "aria-label": t("filter.all"),
937
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
938
+ type: "button",
939
+ className: category === null ? `${community_module_css_default.pill} ${community_module_css_default.pillActive}` : community_module_css_default.pill,
940
+ "aria-pressed": category === null,
941
+ disabled,
942
+ onClick: () => {
943
+ setCategory(null);
944
+ },
945
+ children: [
946
+ t("filter.all"),
947
+ " ",
948
+ plugins.length
949
+ ]
950
+ }), categoryCounts.map(([id, count]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
951
+ type: "button",
952
+ className: category === id ? `${community_module_css_default.pill} ${community_module_css_default.pillActive}` : community_module_css_default.pill,
953
+ "aria-pressed": category === id,
954
+ disabled,
955
+ onClick: () => {
956
+ setCategory(category === id ? null : id);
957
+ },
958
+ children: [
959
+ t(CATEGORY_KEY[id]),
960
+ " ",
961
+ count
962
+ ]
963
+ }, id))]
964
+ }),
965
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
966
+ className: community_module_css_default.resultCount,
967
+ role: "status",
968
+ children: t("result.count", {
969
+ shown: visiblePlugins.length,
970
+ total: plugins.length
971
+ })
972
+ }),
973
+ plugins.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
974
+ className: community_module_css_default.empty,
975
+ role: "status",
976
+ children: t("empty")
977
+ }) : visiblePlugins.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
978
+ className: community_module_css_default.empty,
979
+ role: "status",
980
+ children: t("noMatch")
981
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
982
+ className: community_module_css_default.grid,
983
+ children: visiblePlugins.map((plugin) => {
984
+ const command = installCommand(plugin);
985
+ const copied = copiedId === plugin.id;
986
+ const name = entryCopy(t, `name.${plugin.id}`, plugin.nameEn || plugin.name);
987
+ const description = entryCopy(t, `desc.${plugin.id}`, plugin.descriptionEn ?? plugin.description ?? "");
988
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
989
+ className: community_module_css_default.card,
805
990
  children: [
806
- t("author"),
807
- ": ",
808
- plugin.author
991
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
992
+ className: community_module_css_default.cardHead,
993
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
994
+ className: community_module_css_default.cardName,
995
+ title: name,
996
+ children: name
997
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
998
+ className: plugin.npm ? `${community_module_css_default.badge} ${community_module_css_default.badgePublished}` : community_module_css_default.badge,
999
+ title: plugin.npm ?? plugin.repo,
1000
+ children: plugin.npm ? t("badge.published") : t("badge.source")
1001
+ })]
1002
+ }),
1003
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1004
+ className: community_module_css_default.cardMeta,
1005
+ children: [
1006
+ plugin.category ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1007
+ className: community_module_css_default.cardCategory,
1008
+ children: t(CATEGORY_KEY[plugin.category])
1009
+ }) : null,
1010
+ plugin.category ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1011
+ className: community_module_css_default.cardDot,
1012
+ "aria-hidden": "true",
1013
+ children: "·"
1014
+ }) : null,
1015
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1016
+ className: community_module_css_default.cardAuthor,
1017
+ title: plugin.author,
1018
+ children: plugin.author
1019
+ })
1020
+ ]
1021
+ }),
1022
+ description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1023
+ className: community_module_css_default.cardDescription,
1024
+ children: description
1025
+ }) : null,
1026
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1027
+ className: community_module_css_default.cardFooter,
1028
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1029
+ className: community_module_css_default.cardTop,
1030
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1031
+ className: community_module_css_default.cardLink,
1032
+ href: plugin.repo,
1033
+ target: "_blank",
1034
+ rel: "noreferrer",
1035
+ children: t("repository")
1036
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1037
+ type: "button",
1038
+ className: copied ? `${community_module_css_default.installButton} ${community_module_css_default.installButtonCopied}` : community_module_css_default.installButton,
1039
+ title: command,
1040
+ onClick: () => {
1041
+ copyCommand(plugin.id, command);
1042
+ },
1043
+ children: copied ? t("copied") : t("install")
1044
+ })]
1045
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
1046
+ className: community_module_css_default.cardCommand,
1047
+ title: command,
1048
+ children: command
1049
+ })]
1050
+ })
809
1051
  ]
810
- })]
811
- }),
812
- plugin.description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
813
- className: community_module_css_default.entryDescription,
814
- children: plugin.description
815
- }) : null,
816
- plugin.descriptionEn ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
817
- className: community_module_css_default.entryDescriptionEn,
818
- children: plugin.descriptionEn
819
- }) : null,
820
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
821
- className: community_module_css_default.entryLinks,
822
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
823
- className: community_module_css_default.entryLink,
824
- href: plugin.repo,
825
- target: "_blank",
826
- rel: "noreferrer",
827
- children: t("repository")
828
- }), plugin.npm ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
829
- className: community_module_css_default.entryNpm,
830
- children: plugin.npm
831
- }) : null]
832
- }),
833
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
834
- className: community_module_css_default.entryInstall,
835
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
836
- className: community_module_css_default.entryCommand,
837
- children: installCommand(plugin)
838
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
839
- type: "button",
840
- className: community_module_css_default.copyButton,
841
- onClick: () => {
842
- copyCommand(plugin.id, installCommand(plugin));
843
- },
844
- children: copiedId === plugin.id ? t("copied") : t("copy")
845
- })]
1052
+ }, plugin.id);
846
1053
  })
847
- ]
848
- }, plugin.id))
1054
+ })
1055
+ ]
849
1056
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
850
1057
  className: community_module_css_default.off,
851
1058
  role: "status",
@@ -883,10 +1090,14 @@ window.__ModuleLoader__.load({
883
1090
  //#endregion
884
1091
  //#region src/client/locales.ts
885
1092
  /**
886
- * The community-plugins locale dictionaries for the index card.
1093
+ * The community-plugins locale dictionaries for the index card. Static copy
1094
+ * for the card chrome plus one localized name/description pair per index
1095
+ * entry (`name.<id>` / `desc.<id>`), so the card localizes data-driven text
1096
+ * through the same `t` the rest of the settings UI uses — the document
1097
+ * `<html lang>` attribute is not a reliable locale signal in the GUI.
887
1098
  */
888
- /** Simplified Chinese dictionary (the key-set source of truth). */
889
- const zh = {
1099
+ /** Simplified Chinese copy for the card chrome (the key-set source of truth). */
1100
+ const STATIC_ZH = {
890
1101
  "settings.title": "社区插件",
891
1102
  "settings.description": "社区贡献者开发与维护的插件,链接指向作者自己的仓库。",
892
1103
  "settings.enabled": "启用社区插件索引",
@@ -910,13 +1121,28 @@ window.__ModuleLoader__.load({
910
1121
  "repository": "仓库",
911
1122
  "copy": "复制",
912
1123
  "copied": "已复制",
1124
+ "install": "复制安装命令",
1125
+ "noMatch": "没有匹配的社区插件。",
1126
+ "search.placeholder": "搜索名称、作者或简介",
1127
+ "search.label": "搜索社区插件",
1128
+ "filter.all": "全部",
1129
+ "result.count": "显示 {shown} / {total} 个",
1130
+ "badge.published": "npm 已发布",
1131
+ "badge.source": "仓库安装",
1132
+ "category.ui": "界面与体验",
1133
+ "category.agent": "Agent 与自动化",
1134
+ "category.tools": "开发者工具",
1135
+ "category.knowledge": "记忆与知识",
1136
+ "category.integration": "集成与分享",
1137
+ "category.security": "安全与运维",
1138
+ "category.utility": "实用工具",
913
1139
  "installHint": "索引只登记、不安装代码。要运行某个插件,复制它的安装命令到终端执行;安装后,插件自带的开关与配置(若有)会出现在插件配置里。",
914
1140
  "empty": "暂无社区插件登记。",
915
1141
  "off": "社区插件索引已关闭。",
916
1142
  "notice": "条目由贡献者自行登记,与 dsh-web-ui 的发布内容无关;使用前请自行评估。"
917
1143
  };
918
- /** English dictionary, checked complete against the zh key set. */
919
- const en = {
1144
+ /** English copy for the card chrome, checked complete against the zh key set. */
1145
+ const STATIC_EN = {
920
1146
  "settings.title": "Community Plugins",
921
1147
  "settings.description": "Plugins developed and maintained by community contributors, linking to each author's own repository.",
922
1148
  "settings.enabled": "Enable the community plugin index",
@@ -940,11 +1166,39 @@ window.__ModuleLoader__.load({
940
1166
  "repository": "Repository",
941
1167
  "copy": "Copy",
942
1168
  "copied": "Copied",
1169
+ "install": "Copy install command",
1170
+ "noMatch": "No matching community plugin found.",
1171
+ "search.placeholder": "Search name, author or description",
1172
+ "search.label": "Search community plugins",
1173
+ "filter.all": "All",
1174
+ "result.count": "Showing {shown} / {total}",
1175
+ "badge.published": "Published on npm",
1176
+ "badge.source": "Install from repo",
1177
+ "category.ui": "UI & Experience",
1178
+ "category.agent": "Agents & Automation",
1179
+ "category.tools": "Developer Tools",
1180
+ "category.knowledge": "Memory & Knowledge",
1181
+ "category.integration": "Integration & Sharing",
1182
+ "category.security": "Security & Ops",
1183
+ "category.utility": "Utilities",
943
1184
  "installHint": "The index only registers entries, it never installs code. To run a plugin, copy its install command into a terminal; once installed, the plugin provides its own switch and config (if any) in the plugin configuration section.",
944
1185
  "empty": "No community plugins registered yet.",
945
1186
  "off": "The community plugin index is turned off.",
946
1187
  "notice": "Entries are contributed by their authors and are separate from dsh-web-ui releases; evaluate before use."
947
1188
  };
1189
+ /** Build the runtime dictionary: static copy plus one localized name/description pair per index entry. */
1190
+ function build(base, lang) {
1191
+ const dict = { ...base };
1192
+ for (const entry of COMMUNITY_PLUGINS) {
1193
+ dict[`name.${entry.id}`] = lang === "zh" ? entry.name : entry.nameEn;
1194
+ dict[`desc.${entry.id}`] = lang === "zh" ? entry.description ?? entry.descriptionEn ?? "" : entry.descriptionEn ?? entry.description ?? "";
1195
+ }
1196
+ return dict;
1197
+ }
1198
+ /** Simplified Chinese dictionary for the index card (chrome + per-entry copy). */
1199
+ const zh = build(STATIC_ZH, "zh");
1200
+ /** English dictionary, built from the same key set. */
1201
+ const en = build(STATIC_EN, "en");
948
1202
  //#endregion
949
1203
  //#region src/client/index.ts
950
1204
  /** Settings namespace the card's enable switch edits (the Host plugin registers it). */
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["css","css"],"sources":["../../../packages/dsh-community-plugins/src/client/PluginSettingsCard.tsx","../../../packages/dsh-community-plugins/src/client/settings-form.ts","../../../packages/dsh-community-plugins/src/client/generated/community.ts","../../../packages/dsh-community-plugins/src/client/community-guard.ts","../../../packages/dsh-community-plugins/src/client/CommunityPluginsCard.tsx","../../../packages/dsh-community-plugins/src/client/locales.ts","../../../packages/dsh-community-plugins/src/client/index.ts"],"sourcesContent":["// Generated by scripts/sync-shared.mjs from shared/client/settings/PluginSettingsCard.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family-shared chrome for plugin settings cards: a disclosure header naming\n * the plugin and what its settings govern, the controls inside, and the save\n * that writes them. Renders nothing while the namespace is unavailable — a\n * deployment that does not compose the owning plugin should show no trace of\n * it. Inlined into each consumer's client bundle; mirrors the official\n * ui-plugin-config PluginCard in a self-contained slice.\n */\n\nimport { useState, type ReactNode } from 'react'\nimport type { CardShell } from './settings-form.ts'\nimport css from './settings-card.module.css'\n\n/** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */\nexport const CARD_COPY_KEYS = [\n 'settings.collapse',\n 'settings.expand',\n 'settings.notExposed',\n 'settings.unsaved',\n 'settings.readOnly',\n 'settings.saveFailed',\n 'settings.discard',\n 'settings.save',\n 'settings.saving',\n] as const\n\n/** Copy key the card chrome itself reads. */\nexport type CardCopyKey = (typeof CARD_COPY_KEYS)[number]\n\n/** Key domain for the plugin's own copy (inferred per consumer). */\nexport type SettingsCardKey<TKey extends string = string> = TKey | CardCopyKey\n\n/** Card chrome shared by every plugin settings card. */\nexport interface PluginSettingsCardProps<TKey extends string = string> {\n /** Locale reader for this card's copy. */\n t: (key: SettingsCardKey<TKey>, params?: Record<string, string | number>) => string\n /** Locale key of the plugin's name. */\n titleKey: TKey\n /** Locale key of the line describing what this plugin's settings govern. */\n descriptionKey: TKey\n /** The card's form state: availability, writability, and what a save would do. */\n state: CardShell\n /** Write every staged edit. */\n onSave: () => void\n /** Drop every staged edit. */\n onDiscard: () => void\n /**\n * Render the controls expanded on arrival (still collapsible). Defaults to\n * true: promoted first-level sections show their settings immediately.\n */\n defaultOpen?: boolean\n /**\n * Render without the collapse affordance: a static header and an always\n * visible body. Used by first-level settings sections whose nav entry\n * already provides the selection.\n */\n alwaysOpen?: boolean\n /** The plugin's controls. */\n children: ReactNode\n}\n\n/**\n * Render one plugin settings card.\n * @param props - the plugin's copy keys, its form state, and its controls.\n * @returns the card, or nothing while the namespace is still loading.\n */\nexport function PluginSettingsCard<TKey extends string = string>(props: PluginSettingsCardProps<TKey>) {\n const [open, setOpen] = useState(props.defaultOpen ?? true)\n const { state, alwaysOpen } = props\n if (!state.available) return null\n const title = props.t(props.titleKey)\n const description = props.t(props.descriptionKey)\n const blocked = !state.dirty || state.invalid || state.saving\n const expanded = alwaysOpen === true || open\n const cardClass = expanded ? `${css.cardOpen} ${css.card}` : css.card\n // With alwaysOpen the nav entry already provides the selection, so the\n // header is a static title row instead of a disclosure button.\n const header = alwaysOpen === true\n ? (\n <div className={css.headerStatic}>\n <span className={css.headText}>\n <span className={css.name} title={title}>{title}</span>\n <span className={css.description} title={description}>{description}</span>\n </span>\n {state.dirty ? <span className={css.pending} title={props.t('settings.unsaved')}>{props.t('settings.unsaved')}</span> : null}\n </div>\n )\n : (\n <button\n type=\"button\"\n className={css.header}\n aria-expanded={open}\n aria-label={`${props.t(open ? 'settings.collapse' : 'settings.expand')}: ${title}`}\n onClick={() => { setOpen(!open) }}\n >\n <span className={css.headText}>\n <span className={css.name} title={title}>{title}</span>\n <span className={css.description} title={description}>{description}</span>\n </span>\n {state.dirty ? <span className={css.pending} title={props.t('settings.unsaved')}>{props.t('settings.unsaved')}</span> : null}\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={open ? `${css.chevron} ${css.chevronOpen}` : css.chevron}\n >\n <path\n d=\"M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n )\n // The namespace exists but the Host does not serve it to this client (the\n // official settings allowlist omits third-party namespaces): show a card\n // that explains the gap instead of vanishing, so a missing card never\n // reads as a missing plugin.\n if (!state.exposed) {\n return (\n <li className={cardClass}>\n {header}\n {expanded\n ? (\n <div className={css.body}>\n <p className={css.notExposed} role=\"status\">{props.t('settings.notExposed')}</p>\n </div>\n )\n : null}\n </li>\n )\n }\n return (\n <li className={cardClass}>\n {header}\n {expanded\n ? (\n <div className={css.body}>\n {!state.writable ? <p className={css.readOnly} role=\"status\">{props.t('settings.readOnly')}</p> : null}\n {props.children}\n <div className={css.footer}>\n {state.failed\n ? (\n <p className={css.failed} role=\"status\">\n {props.t('settings.saveFailed')}{state.failedReason ? ' - ' + state.failedReason : ''}\n </p>\n )\n : null}\n <button\n type=\"button\"\n className={css.discard}\n disabled={!state.dirty || state.saving}\n onClick={props.onDiscard}\n >\n {props.t('settings.discard')}\n </button>\n <button\n type=\"button\"\n className={css.save}\n disabled={blocked}\n onClick={props.onSave}\n >\n {props.t(!state.saving ? 'settings.save' : 'settings.saving')}\n </button>\n </div>\n </div>\n )\n : null}\n </li>\n )\n}\n\n/** Props every field control needs regardless of its value type. */\nexport interface FieldProps {\n /** Stable id associating the label with its control. */\n id: string\n /** Visible label. */\n label: string\n /** One-line explanation rendered under the control. */\n hint: string\n /** Draft text this control renders. */\n text: string\n /** True when saving would leave a user-layer entry for this field. */\n overridden: boolean\n /** True when the draft is not a value this field accepts. */\n invalid: boolean\n /** Copy for the overridden badge. */\n overriddenLabel: string\n /** Copy for the reset control. */\n resetLabel: string\n /** Copy shown in place of the hint while the draft is invalid. */\n invalidLabel: string\n /** Disables every control (read-only document, or an unavailable namespace). */\n disabled: boolean\n /** Stage draft text. */\n onEdit: (text: string) => void\n /** Stage a clear so the field re-inherits the composition layer. */\n onReset: () => void\n}\n\n/** A staged value field. `numeric` only hints the keypad: which drafts a field accepts is decided by its spec. */\nexport function ValueField(props: FieldProps & {\n /** Hints a numeric keypad without narrowing what the control accepts. */\n numeric?: boolean\n /** Placeholder shown while the draft is empty. */\n placeholder?: string\n}) {\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n <input\n id={props.id}\n className={props.invalid ? css.inputInvalid : css.input}\n type=\"text\"\n {...props.numeric === true ? { inputMode: 'numeric' as const } : {}}\n {...props.invalid ? { 'aria-invalid': true } : {}}\n value={props.text}\n placeholder={props.placeholder ?? ''}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n />\n <p className={props.invalid ? css.invalid : css.hint}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n\n/** A staged boolean field: 继承 / 开 / 关. */\nexport function BooleanField(props: FieldProps & {\n /** Copy for the inherit option. */\n inheritLabel: string\n /** Copy for the on option. */\n onLabel: string\n /** Copy for the off option. */\n offLabel: string\n}) {\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n <select\n id={props.id}\n className={css.select}\n value={props.text}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n >\n <option value=\"\">{props.inheritLabel}</option>\n <option value=\"true\">{props.onLabel}</option>\n <option value=\"false\">{props.offLabel}</option>\n </select>\n <p className={css.hint}>{props.hint}</p>\n </div>\n )\n}\n\n/** A staged enumerated field rendered as a select. */\nexport function ChoiceField(props: FieldProps & {\n /** Copy for the inherit option (draft text is the empty string). */\n inheritLabel: string\n /** Choices rendered in order; `value` is the draft/stored text. */\n choices: ReadonlyArray<{ value: string; label: string }>\n}) {\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n <select\n id={props.id}\n className={css.select}\n value={props.text}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n >\n <option value=\"\">{props.inheritLabel}</option>\n {props.choices.map(choice => (\n <option key={choice.value} value={choice.value}>{choice.label}</option>\n ))}\n </select>\n <p className={props.invalid ? css.invalid : css.hint}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Staged form model behind the plugin settings card. A card stages what the\n * user types and writes it only when they save — the settings write is a\n * durable, revision-fenced document mutation, so staging keeps what is on\n * screen exactly what a save would store. Family-shared slice inlined into\n * each plugin's client bundle; mirrors the official ui-plugin-config\n * card-store pattern.\n */\n\nimport type { SettingsScope, SettingsScopeSnapshot, SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\n\n/** The write one field's staged text performs when the card is saved. */\nexport type FieldWrite =\n | { kind: 'set'; value: unknown }\n | { kind: 'clear' }\n\n/** How one field converts between its stored value and its draft text. */\nexport interface FieldSpec {\n /** Field name inside the namespace section. */\n field: string\n /**\n * Whether the Host treats this field as a secret and redacts its value from\n * the read-back (role('secret') in the section schema). Redacted secrets are\n * never compared against the draft on save; the field lands when the scope\n * reports the write succeeded (its secret-set marker under the bridge), so\n * a successful secret save is not misreported as failed.\n */\n secret?: boolean\n /** Render a stored value as draft text; the empty string when the section carries none. */\n format: (value: unknown) => string\n /**\n * The write this draft text stages, or undefined when the text is not a\n * value this field accepts — which blocks the save rather than discarding it.\n */\n parse: (text: string) => FieldWrite | undefined\n}\n\n/** One field as the card renders it. */\nexport interface FieldState {\n /** Draft text the control renders. */\n text: string\n /** Whether saving would leave a user-layer entry for this field. */\n overridden: boolean\n /** Whether the draft is not a value this field accepts, which blocks saving. */\n invalid: boolean\n}\n\n/** Form state every plugin settings card shares. */\nexport interface CardShell {\n /** False while the namespace is still loading; the card renders nothing. */\n available: boolean\n /**\n * Whether the namespace is actually served to this client. False when the\n * Host deployment does not expose it (e.g. the official apiproxy settings\n * allowlist omits third-party namespaces): the card renders an explanation\n * instead of its form, so a missing namespace never looks like a missing\n * plugin.\n */\n exposed: boolean\n /** Whether the Host document accepts writes. */\n writable: boolean\n /** Whether the form holds edits that a save would write. */\n dirty: boolean\n /** Whether any staged draft is invalid, which blocks the save. */\n invalid: boolean\n /** Whether a save is crossing the wire. */\n saving: boolean\n /** Whether the last save did not land as staged; cleared by the next edit or save. */\n failed: boolean\n /**\n * The rejection code/message the Host returned for the last failed save,\n * surfaced next to the generic failure text. Undefined while no save has\n * failed (or the failure carried no server reason).\n */\n failedReason?: string\n}\n\n/** The write actions the card's slot entry injects. */\nexport interface CardActions {\n /** Stage draft text for one field. */\n edit: (field: string, text: string) => void\n /** Stage a clear, so saving lets the field re-inherit the composition layer. */\n resetField: (field: string) => void\n /** Write every staged edit, then re-seed from what the Host accepted. */\n save: () => void\n /** Drop every staged edit. */\n discard: () => void\n}\n\n/** One field's staged edit. */\ninterface StagedEdit {\n /** Draft text the control renders. */\n text: string\n /** True when this edit clears the field whatever text it shows. */\n clear: boolean\n}\n\n/** One staged edit resolved into the write a save performs. */\ninterface PlannedWrite {\n /** Field this entry writes. */\n field: string\n /** The durable write this entry performs, described for a batched scope. */\n op: BatchedWrite\n /** Perform the write and report whether the Host holds the staged value afterwards. */\n run: (() => Promise<boolean>) | undefined\n}\n\n/** One durable write a batched settings scope performs. */\nexport interface BatchedWrite {\n /** Field this entry writes. */\n field: string\n /** set stores a value; unset drops the leaf. */\n op: 'set' | 'unset'\n /** Value for op set (absent for unset). */\n value?: unknown\n}\n\n/** Per-field outcome of one batched scope write. */\nexport interface BatchedFieldResult {\n /** Field this entry writes. */\n field: string\n /** Whether the Host accepted this field's write (per the read-back view). */\n landed: boolean\n}\n\n/**\n * Result of a batched scope write. The bridge scope posts every planned write\n * in one /mutate so the Host validate hook judges baseURL+model together; a\n * batched refusal fails the whole save rather than per-field.\n */\nexport interface BatchResult {\n /** Whether the whole mutate was accepted. */\n ok: boolean\n /** Per-field success, in the request order (always present when ok). */\n fields: BatchedFieldResult[]\n /** Host rejection code (mutate refused). */\n code?: string\n /** Host rejection message (mutate refused). */\n message?: string\n}\n\n/** The optional batch surface the bridge scope adds over the SettingsScope contract. */\ninterface BatchedSettingsScope {\n /** Write every operation in one scope mutation, reporting per-field success. */\n mutate: (writes: BatchedWrite[]) => Promise<BatchResult>\n}\n\n/** Constraints a numeric field's accepted drafts must satisfy, mirroring the host schema. */\nexport interface NumberConstraints {\n /** The accepted value must be a whole number. */\n integer?: boolean\n /** The accepted value must be at least this. */\n min?: number\n}\n\n/** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints blocks the save. */\nexport function numberField(field: string, constraints: NumberConstraints = {}): FieldSpec {\n const { integer = false, min } = constraints\n return {\n field,\n format: value => typeof value === 'number' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n const parsed = Number(trimmed)\n if (!Number.isFinite(parsed)) return undefined\n if (integer && !Number.isInteger(parsed)) return undefined\n if (min !== undefined && parsed < min) return undefined\n return { kind: 'set', value: parsed }\n },\n }\n}\n\n/** A free-text field. An empty draft clears the field. */\nexport function textField(field: string): FieldSpec {\n return {\n field,\n format: value => typeof value === 'string' ? value : '',\n parse: (text) => {\n const trimmed = text.trim()\n return trimmed === '' ? { kind: 'clear' } : { kind: 'set', value: trimmed }\n },\n }\n}\n\n/**\n * A free-text field the Host treats as a secret and redacts from the read-back\n * (role('secret') in the section schema). The card still edits it like text,\n * but a save never compares the redacted value back and relies on the scope\n * reporting the write landed.\n */\nexport function secretField(field: string): FieldSpec {\n return { ...textField(field), secret: true }\n}\n\n/** A boolean field, edited through true/false draft text. */\nexport function booleanField(field: string): FieldSpec {\n return {\n field,\n format: value => typeof value === 'boolean' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n if (trimmed === 'true') return { kind: 'set', value: true }\n if (trimmed === 'false') return { kind: 'set', value: false }\n return undefined\n },\n }\n}\n\n/** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */\nexport function choiceField(field: string, choices: readonly string[]): FieldSpec {\n return {\n field,\n format: value => typeof value === 'string' && choices.includes(value) ? value : '',\n parse: (text) => {\n if (text === '') return { kind: 'clear' }\n return choices.includes(text) ? { kind: 'set', value: text } : undefined\n },\n }\n}\n\n/**\n * Stages one card's edits over one settings namespace and writes them on save.\n *\n * The Host is the only authority on whether a value was accepted — its\n * validators own the constraints no schema can express — so the outcome is\n * read back from the section rather than predicted here. A save that did not\n * land keeps its drafts, so the user can correct them instead of retyping.\n */\nexport class CardForm<T> {\n private readonly specs: Map<string, FieldSpec>\n private readonly staged = new Map<string, StagedEdit>()\n private readonly listeners = new Set<() => void>()\n /** The scope subscription installed in the constructor; released by dispose(). */\n private readonly disposeScope: () => void\n private disposed = false\n private saving = false\n private failed = false\n private failedReason: string | undefined\n\n /** @param scope - the bound settings scope for this card's namespace. */\n constructor(\n private readonly scope: SettingsScope<T>,\n specs: FieldSpec[],\n ) {\n this.specs = new Map(specs.map(spec => [spec.field, spec]))\n this.disposeScope = scope.subscribe(() => { this.publish() })\n }\n\n /**\n * Release the scope subscription and every bound store listener. The card\n * must call this on teardown; later calls are no-ops.\n */\n dispose(): void {\n if (this.disposed) return\n this.disposed = true\n this.disposeScope()\n this.listeners.clear()\n }\n\n /** Publish a projection of this form, rebuilt whenever the scope or a draft changes. */\n bind<S>(project: () => S): SnapshotStore<S> {\n const store = createSnapshotStore(project())\n this.listeners.add(() => { store.set(project()) })\n return store\n }\n\n /** Read the card-level state: what the Host serves, and what a save would do. */\n shell(): CardShell {\n const snapshot = this.scope.getSnapshot()\n const plan = this.plan()\n return {\n available: snapshot.status !== 'loading',\n exposed: snapshot.status === 'ready',\n writable: snapshot.writable,\n dirty: plan.length > 0,\n invalid: plan.some(item => item.run === undefined),\n saving: this.saving,\n failed: this.failed,\n ...this.failedReason === undefined ? {} : { failedReason: this.failedReason },\n }\n }\n\n /** Read one field's state from the effective section and its staged draft. */\n field(field: string): FieldState {\n const spec = this.specOf(field)\n const staged = this.staged.get(field)\n if (staged === undefined) {\n return { text: spec.format(this.sectionValue(field)), overridden: this.stored(field), invalid: false }\n }\n const write = staged.clear ? { kind: 'clear' as const } : spec.parse(staged.text)\n return {\n text: staged.text,\n overridden: write?.kind === 'set',\n invalid: write === undefined,\n }\n }\n\n /** The actions the card's slot registration injects. */\n actions(): CardActions {\n return {\n edit: (field, text) => { this.stage(field, { text, clear: false }) },\n resetField: (field) => {\n this.stage(field, { text: this.specOf(field).format(this.baseValue(field)), clear: true })\n },\n save: () => { void this.save() },\n discard: () => {\n if (this.staged.size === 0 && !this.failed) return\n this.staged.clear()\n this.failed = false\n this.failedReason = undefined\n this.publish()\n },\n }\n }\n\n /**\n * Write every staged edit, then re-seed from what the Host accepted.\n *\n * When the scope carries the optional batch surface (the dsh-web-ui\n * bridge scope), every planned write rides one mutation so cross-field\n * validate hooks (baseURL+model) judge the batch as a unit instead of\n * deadlocking on per-field writes. Otherwise the per-field loop runs.\n * A field lands only when the Host reports it held the staged value; a\n * landed field's draft is dropped, a failed one stays staged for the user.\n * @returns settlement after every write and the read-back.\n */\n async save(): Promise<void> {\n const plan = this.plan()\n const valid = plan.filter(item => item.run !== undefined)\n if (plan.length === 0 || this.saving || valid.length !== plan.length) return\n const plannedWrites = valid.map(item => item.op)\n // Snapshot the fields this save writes, so edits staged while it is in\n // flight survive: only the staged keys this save actually wrote are cleared.\n const fields = new Set(plan.map(item => item.field))\n this.saving = true\n this.failed = false\n this.failedReason = undefined\n this.publish()\n const landed = new Set<string>()\n const batch = this.batchedScope()\n if (batch !== undefined) {\n const result = await batch.mutate(plannedWrites)\n if (result.ok) {\n for (const field of result.fields) {\n if (field.landed) landed.add(field.field)\n }\n } else {\n this.failedReason = result.message\n }\n } else {\n for (const item of valid) {\n if (await item.run!()) landed.add(item.field)\n }\n }\n for (const field of fields) {\n if (landed.has(field)) this.staged.delete(field)\n }\n this.saving = false\n this.failed = landed.size !== fields.size\n this.publish()\n }\n\n /** The scope's batch surface when it supports one; undefined conservatively otherwise. */\n private batchedScope(): BatchedSettingsScope | undefined {\n const candidate = this.scope as unknown as BatchedSettingsScope | undefined\n return typeof candidate?.mutate === 'function' ? candidate : undefined\n }\n\n /**\n * Every staged edit a save would write. An entry whose draft is not a value\n * its field accepts carries no write: the form is still dirty, and the save\n * refuses rather than dropping the edit. A staged edit that matches the\n * effective section is not a write at all.\n * @returns the planned writes, in the order the fields were staged.\n */\n private plan(): PlannedWrite[] {\n const plan: PlannedWrite[] = []\n for (const [field, staged] of this.staged) {\n const spec = this.specOf(field)\n if (staged.clear) {\n if (this.stored(field)) plan.push({ field, op: { field, op: 'unset' }, run: () => this.clear(field) })\n continue\n }\n if (staged.text === spec.format(this.sectionValue(field))) continue\n const write = spec.parse(staged.text)\n if (write === undefined) plan.push({ field, op: { field, op: 'unset' }, run: undefined })\n else if (write.kind === 'clear') plan.push({ field, op: { field, op: 'unset' }, run: () => this.clear(field) })\n else plan.push({ field, op: { field, op: 'set', value: write.value }, run: () => this.store(field, write.value) })\n }\n return plan\n }\n\n private async clear(field: string): Promise<boolean> {\n await this.scope.unset(field)\n return !this.stored(field)\n }\n\n private async store(field: string, value: unknown): Promise<boolean> {\n await this.scope.set(field, value)\n // A redacted secret never appears in the user layer read-back; judging it\n // by value would misreport a successful secret save as failed. The bridge\n // reports secret writes through its secret-set markers (batch path); on\n // the per-field path the scope resolved, so the write is landed.\n if (this.specOf(field).secret) return true\n return this.userLayer()?.[field] === value\n }\n\n private stage(field: string, edit: StagedEdit): void {\n this.staged.set(field, edit)\n this.failed = false\n this.failedReason = undefined\n this.publish()\n }\n\n private specOf(field: string): FieldSpec {\n const spec = this.specs.get(field)\n // Every call site names a field this card declared; a missing one is a\n // wiring mistake that must not degrade into a silently inert control.\n if (spec === undefined) throw new Error(`settings card has no field ${field}`)\n return spec\n }\n\n private snapshotOf(): SettingsScopeSnapshot<T> {\n return this.scope.getSnapshot()\n }\n\n private sectionValue(field: string): unknown {\n return (this.snapshotOf().value as Record<string, unknown> | undefined)?.[field]\n }\n\n private baseValue(field: string): unknown {\n return (this.snapshotOf().base as Record<string, unknown> | undefined)?.[field]\n }\n\n private userLayer(): Record<string, unknown> | undefined {\n return this.snapshotOf().user as Record<string, unknown> | undefined\n }\n\n private stored(field: string): boolean {\n const user = this.userLayer()\n return user !== undefined && Object.hasOwn(user, field)\n }\n\n private publish(): void {\n for (const listener of this.listeners) listener()\n }\n}\n","/**\n * AUTO-GENERATED by scripts/community-index — do not edit by hand.\n * Community plugin index for the settings page: every entry links to the\n * contributor's own repository. This repository never vendors the listed\n * plugins — it only points users at them.\n * Regenerate with `node scripts/community-index`.\n */\n\n/** One community plugin entry: contributor metadata plus the repository link. */\nexport interface CommunityPluginEntry {\n /** Stable entry id (unique in community.json). */\n id: string\n /** Display name (zh). */\n name: string\n /** Display name (en). */\n nameEn: string\n /** Contributor (GitHub user or organization). */\n author: string\n /** One-line description (zh). */\n description?: string\n /** One-line description (en). */\n descriptionEn?: string\n /** The contributor's own repository URL. */\n repo: string\n /** npm package name, when the plugin is published there. */\n npm?: string\n}\n\n/** Every community plugin, in community.json order. */\nexport const COMMUNITY_PLUGINS: readonly CommunityPluginEntry[] = [\n {\"id\":\"dsh-data-agent\",\"name\":\"Data Agent\",\"nameEn\":\"Data Agent\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-data-agent\",\"description\":\"为 DSH 定义专用 Data Agent 预设,让 AI 帮你查询、更新、分析数据。\",\"descriptionEn\":\"Defines a dedicated Data Agent preset for DSH so the AI can query, update and analyze data.\"},\n {\"id\":\"dsh-tui\",\"name\":\"dsh-TUI\",\"nameEn\":\"dsh-TUI\",\"author\":\"ccch1mneyyy\",\"repo\":\"https://github.com/ccch1mneyyy/dsh-TUI\",\"description\":\"Claude Code 风格全屏交互终端插件:像素鲸鱼顶栏、实时工作状态行、思考流式展开、双击 Esc 回滚、上下文进度条与 TPS 仪表。\",\"descriptionEn\":\"A Claude Code style fullscreen interactive terminal plugin: pixel-whale header, live working-state line, streaming reasoning expansion, double-Esc rollback, context progress bar and TPS gauges.\"},\n {\"id\":\"dsh-tianshu-tui\",\"name\":\"天书 TUI\",\"nameEn\":\"Tianshu TUI\",\"author\":\"huiliyi37\",\"repo\":\"https://github.com/huiliyi37/dsh-tianshu-tui\",\"description\":\"基于官方 DeepSeek Harness 的交互式终端 UI 插件,在官方基础上增加 TDD 与证据门等工作流。\",\"descriptionEn\":\"An interactive terminal UI plugin for DeepSeek Harness that adds TDD and evidence-gate workflows on top of the official base.\"},\n {\"id\":\"dsh-chat-summary\",\"name\":\"Chat Summary\",\"nameEn\":\"Chat Summary\",\"author\":\"v833\",\"repo\":\"https://github.com/v833/dsh-chat-summary\",\"description\":\"总结当前对话并导出为 Markdown / DOCX / PDF,可选 LLM 智能总结(用户自配 API Key)。\",\"descriptionEn\":\"Summarize the current conversation and export it as Markdown / DOCX / PDF, with optional LLM summarization using your own API key.\",\"npm\":\"@linxin666/dsh-client-ui-chat-summary\"},\n {\"id\":\"dsh-builtin-toggles\",\"name\":\"内置能力检查器\",\"nameEn\":\"Built-in Capability Inspector\",\"author\":\"Starfie1d1272\",\"repo\":\"https://github.com/Starfie1d1272/dsh-builtin-toggles\",\"description\":\"Evidence-backed 内置 capability Inspector:展示 DSH Web built-in capability 的 provenance、compatibility 与 structural drift;仅对 9 个经过审阅的 UI leaves 提供 fail-closed 开关。\",\"descriptionEn\":\"Evidence-backed built-in capability Inspector: surfaces provenance, compatibility and structural drift of DSH Web built-ins, with fail-closed toggles for only the nine reviewed UI leaves.\",\"npm\":\"dsh-builtin-toggles\"},\n {\"id\":\"dsh-pilot\",\"name\":\"Pilot 浏览器驾驶舱\",\"nameEn\":\"Pilot Browser Cockpit\",\"author\":\"guo6x\",\"repo\":\"https://github.com/guo6x/dsh-pilot\",\"description\":\"给 agent 一双会开车的手:零依赖 CDP 浏览器操控(8 个 pilot_* 工具:导航/点击/输入/按键/JS/截图)+ Web GUI 可拖拽驾驶舱面板,无需 Playwright、无需 API key。\",\"descriptionEn\":\"Give your agent hands: zero-dependency CDP browser control (8 pilot_* tools: navigate/click/type/keys/eval/screenshot) plus a draggable cockpit panel in the Web GUI - no Playwright, no API key.\"},\n {\"id\":\"dsh-housekeeper\",\"name\":\"环境管家\",\"nameEn\":\"Environment Housekeeper\",\"author\":\"guo6x\",\"repo\":\"https://github.com/guo6x/dsh-housekeeper\",\"description\":\"管住 agent 的脏手:工具链台账(node/pnpm/git/gh/ffmpeg 等自动探测)、缓存与临时目录扫描 + 白名单安全一键清理、机器规则 AGENTS.md 查看编辑,全在设置面板完成。\",\"descriptionEn\":\"Keep your agent's hands clean: toolchain inventory, scratch/cache scan with whitelist-guarded one-click cleanup, and the machine rules file (AGENTS.md) view/edit - all in the settings panel.\"},\n {\"id\":\"dsh-deepread\",\"name\":\"DeepRead 精读助手\",\"nameEn\":\"DeepRead Assistant\",\"author\":\"xiehuan123\",\"repo\":\"https://github.com/xiehuan123/dsh-deepread\",\"description\":\"五种模式精读插件(quick / deep / map / feynman / book),支持公众号链接与文件输入、批量对比、预算预检与后台任务进度透明,导出 md / mm / html,Web UI 提供工具结果卡片与精读面板。\",\"descriptionEn\":\"A five-mode deep reading plugin (quick / deep / map / feynman / book) for links and files, with batch comparison, budget preflight, transparent background-job progress, md / mm / html exports, and Web UI tool-result cards plus a reading panel.\",\"npm\":\"dsh-deepread\"},\n {\"id\":\"dsh-mnemon\",\"name\":\"Mnemon 记忆系统\",\"nameEn\":\"Mnemon Memory\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-mnemon\",\"description\":\"与 Mnemon CLI 集成的跨 Agent、本地优先持久记忆插件:用户画像 / 工作记忆 / 项目档案与长期 Memory Spaces,支持导入导出。\",\"descriptionEn\":\"A cross-agent, local-first persistent memory plugin integrating the Mnemon CLI: profiles, working memory, project documents and long-term Memory Spaces, with import and export.\",\"npm\":\"dsh-mnemon\"},\n {\"id\":\"dsh-plugin-hub\",\"name\":\"插件中心(dsh-plugin-hub)\",\"nameEn\":\"Plugin Hub\",\"author\":\"Noob-stupid\",\"repo\":\"https://github.com/Noob-stupid/dsh-plugin-hub\",\"description\":\"插件管理面板:已安装插件一键启用/停用,内置 GitHub dsh-plugin 插件市场(官方/聚合识别、子包浏览、一键安装与本地 AI 兜底修复、删除卸载)。\",\"descriptionEn\":\"Plugin management panel: one-click enable/disable, a GitHub dsh-plugin marketplace with official/aggregate detection, subpackage browsing, one-click installs with local-AI fallback repair, and uninstall.\"},\n {\"id\":\"dsh-genui\",\"name\":\"GenUI 生成式 UI\",\"nameEn\":\"GenUI\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-genui\",\"description\":\"给模型输出配交互式 UI:助手回复内联渲染 dsh-ui fence(布局、图表、表单、Mermaid、3D),支持流式渲染与面板停靠,组件交互可回传模型。\",\"descriptionEn\":\"Interactive UI inside assistant replies via the dsh-ui fence: layouts, charts, forms, Mermaid and 3D with streaming rendering, panel docking and actions that loop back to the model.\"},\n {\"id\":\"dsh-annotation\",\"name\":\"选中批注\",\"nameEn\":\"Selection Annotation\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-annotation\",\"description\":\"选中助手文字即可批注,回车随消息发送;自己的气泡只显示问题与「批注 ×N」标签,模型按 Annotation N 逐条对照回复(悬浮芯片)。\",\"descriptionEn\":\"Select text in an assistant reply to annotate it; annotations are sent with your next message, hidden from your own bubble behind an Annotations xN chip, and the model replies per Annotation N with hoverable chips.\"},\n {\"id\":\"deepseek-harness-auth\",\"name\":\"DeepSeek Harness Auth\",\"nameEn\":\"DeepSeek Harness Auth\",\"author\":\"taichuy\",\"repo\":\"https://github.com/taichuy/deepseek-harness-auth\",\"description\":\"为 DSH Web 公网部署提供登录认证前置代理,支持账号密码、验证码、失败锁定和 IP/CIDR 白名单。\",\"descriptionEn\":\"An authentication proxy for public DSH Web deployments with password login, captcha, failed-attempt locking, and IP/CIDR allowlists.\",\"npm\":\"deepseek-harness-auth\"},\n {\"id\":\"dsh-cloud-sync\",\"name\":\"云同步服务\",\"nameEn\":\"Cloud Sync\",\"author\":\"dickpy\",\"repo\":\"https://github.com/dickpy/dsh-cloud-sync\",\"description\":\"支持 WebDAV、S3、阿里云 OSS、腾讯云 COS 与 MinIO 的 DSH 云同步插件,可同步 profile、插件配置及本地插件源码归档。\",\"descriptionEn\":\"DSH cloud sync for WebDAV, S3, Alibaba Cloud OSS, Tencent Cloud COS and MinIO, syncing profiles, plugin settings and local plugin source archives.\",\"npm\":\"@dickpy/dsh-cloud-sync\"},\n]\n","/**\n * Runtime guard for the generated community index entries. The index is\n * build-time generated data, but the card renders whatever the module\n * carries; a hand-written narrowing keeps one malformed entry from breaking\n * the whole list at render time.\n */\n\nimport type { CommunityPluginEntry } from './generated/community.ts'\n\n/** True when the value is a well-formed community plugin entry. */\nexport function isCommunityPluginEntry(value: unknown): value is CommunityPluginEntry {\n if (typeof value !== 'object' || value === null) return false\n const entry = value as Record<string, unknown>\n if (typeof entry.id !== 'string' || entry.id === '') return false\n if (typeof entry.name !== 'string' || typeof entry.nameEn !== 'string') return false\n if (typeof entry.author !== 'string' || entry.author === '') return false\n if (typeof entry.repo !== 'string' || !entry.repo.startsWith('https://')) return false\n if (entry.description !== undefined && typeof entry.description !== 'string') return false\n if (entry.descriptionEn !== undefined && typeof entry.descriptionEn !== 'string') return false\n if (entry.npm !== undefined && typeof entry.npm !== 'string') return false\n return true\n}\n","/**\n * The community plugin index card: a first-level settings section that is\n * always open (a static header with the index list directly visible). Its own\n * enable switch (backed by the community-plugins settings namespace) gates\n * the entry list; the list itself points at contributors' own repositories —\n * this package only indexes them, it never vendors their code.\n */\n\nimport { useState, type ReactNode } from 'react'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\n// Type-only: pulls the settings-surface SlotMap merge (the 'settings.section' entry).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { SettingsScope, SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\nimport { PluginSettingsCard, BooleanField } from './PluginSettingsCard.tsx'\nimport { CardForm, booleanField, type CardActions, type CardShell, type FieldState as CardFieldState } from './settings-form.ts'\nimport type { CommunityPluginKey } from './locales.ts'\nimport { COMMUNITY_PLUGINS, type CommunityPluginEntry } from './generated/community.ts'\nimport { isCommunityPluginEntry } from './community-guard.ts'\nimport css from './community.module.css'\n\n/** The settings fields this card edits (the namespace's full schema). */\nexport interface CommunityPluginsSettings {\n /** Master switch for the index card. */\n enabled?: boolean\n}\n\n/** What the community plugin card renders. */\nexport interface CommunityPluginsCardState extends CardShell {\n /** Master switch. */\n enabled: CardFieldState\n}\n\n/** The registration-side face the card's slot entry injects. */\nexport interface CommunityPluginsCardFace extends CardActions {\n hooks: {\n /** Card snapshot bound by the renderer as useCommunityPluginsCard. */\n communityPluginsCard: SnapshotStore<CommunityPluginsCardState>\n }\n}\n\n/** Bridges the community-plugins scope onto the card's staged form. */\nexport class CommunityPluginsCardController {\n private readonly form: CardForm<CommunityPluginsSettings>\n private readonly store: SnapshotStore<CommunityPluginsCardState>\n\n /** @param scope - the bound settings scope for the community-plugins namespace. */\n constructor(scope: SettingsScope<CommunityPluginsSettings>) {\n this.form = new CardForm(scope, [\n booleanField('enabled'),\n ])\n this.store = this.form.bind(() => this.projection())\n }\n\n private projection(): CommunityPluginsCardState {\n return {\n ...this.form.shell(),\n enabled: this.form.field('enabled'),\n }\n }\n\n /**\n * Build the face the card's slot registration injects.\n * @returns the card's snapshot and its form actions.\n */\n inject(): CommunityPluginsCardFace {\n return { hooks: { communityPluginsCard: this.store }, ...this.form.actions() }\n }\n\n /**\n * Release the card's scope subscription and bound stores; the slot\n * disposer calls this on teardown.\n */\n dispose(): void {\n this.form.dispose()\n }\n}\n\n/** The one-line install command for an entry: npm package when published, else the contributor repository URL. */\nfunction installCommand(entry: CommunityPluginEntry): string {\n return `dsh plugin --profile web add ${entry.npm ?? entry.repo}`\n}\n\n/** Props the renderer binds for the community plugin card. */\nexport type CommunityPluginsCardProps =\n PropsLocale<'community-plugins'>\n & InjectFace<CommunityPluginsCardFace>\n & {\n /** Index entries; defaults to the generated registry (injected for tests). */\n plugins?: readonly CommunityPluginEntry[]\n }\n\n/**\n * Render the community plugin index card.\n * @param props - locale copy, the card snapshot, its form actions, and the\n * (default-generated) entry list.\n * @returns the card.\n */\nexport function CommunityPluginsCard(props: CommunityPluginsCardProps): ReactNode {\n const { t } = props\n const state = props.useCommunityPluginsCard(snapshot => snapshot)\n const plugins = (props.plugins ?? COMMUNITY_PLUGINS).filter(isCommunityPluginEntry)\n const [copiedId, setCopiedId] = useState<string | null>(null)\n const copyCommand = (id: string, command: string): void => {\n const mark = (): void => { setCopiedId(id) }\n const clipboard = typeof navigator !== 'undefined' ? navigator.clipboard : undefined\n if (clipboard?.writeText !== undefined) {\n void clipboard.writeText(command).then(mark, mark)\n return\n }\n // Fallback for browsers without the async clipboard API (or tests).\n try {\n const area = document.createElement('textarea')\n area.value = command\n area.setAttribute('readonly', '')\n area.style.position = 'fixed'\n area.style.opacity = '0'\n document.body.append(area)\n area.select()\n document.execCommand('copy')\n area.remove()\n } catch { /* the command stays visible to select by hand */ }\n mark()\n }\n const disabled = !state.writable\n // The draft text drives the list: '' (inherit) and 'true' keep it visible,\n // 'false' hides it until the switch is turned back on.\n const visible = state.enabled.text !== 'false'\n const fieldProps = {\n overriddenLabel: t('settings.overridden'),\n resetLabel: t('settings.reset'),\n invalidLabel: t('settings.invalidNumber'),\n disabled,\n }\n return (\n <PluginSettingsCard\n t={t}\n titleKey=\"settings.title\"\n descriptionKey=\"settings.description\"\n state={state}\n alwaysOpen\n onSave={props.save}\n onDiscard={props.discard}\n >\n <BooleanField\n id=\"settings-community-enabled\"\n label={t('settings.enabled')}\n hint={t('settings.enabledHint')}\n inheritLabel={t('settings.inherit')}\n onLabel={t('settings.on')}\n offLabel={t('settings.off')}\n {...fieldProps}\n {...state.enabled}\n onEdit={(text) => { props.edit('enabled', text) }}\n onReset={() => { props.resetField('enabled') }}\n />\n {visible\n ? (\n <ul className={css.entries}>\n {plugins.length === 0\n ? <li className={css.empty} role=\"status\">{t('empty')}</li>\n : plugins.map((plugin) => (\n <li key={plugin.id} className={css.entry}>\n <span className={css.entryHead}>\n <span className={css.entryName} title={plugin.name}>{plugin.name}</span>\n <span className={css.entryAuthor} title={plugin.author}>{t('author')}: {plugin.author}</span>\n </span>\n {plugin.description ? <p className={css.entryDescription}>{plugin.description}</p> : null}\n {plugin.descriptionEn ? <p className={css.entryDescriptionEn}>{plugin.descriptionEn}</p> : null}\n <span className={css.entryLinks}>\n <a className={css.entryLink} href={plugin.repo} target=\"_blank\" rel=\"noreferrer\">{t('repository')}</a>\n {plugin.npm ? <code className={css.entryNpm}>{plugin.npm}</code> : null}\n </span>\n <span className={css.entryInstall}>\n <code className={css.entryCommand}>{installCommand(plugin)}</code>\n <button\n type=\"button\"\n className={css.copyButton}\n onClick={() => { copyCommand(plugin.id, installCommand(plugin)) }}\n >\n {copiedId === plugin.id ? t('copied') : t('copy')}\n </button>\n </span>\n </li>\n ))}\n </ul>\n )\n : <p className={css.off} role=\"status\">{t('off')}</p>}\n <p className={css.installNote} role=\"note\">{t('installHint')}</p>\n <p className={css.notice} role=\"note\">{t('notice')}</p>\n </PluginSettingsCard>\n )\n}\n\n/** Props the settings section binds for the community plugin page. */\nexport type CommunityPluginsSectionProps =\n PropsRuntime<'settings.section'>\n & PropsLocale<'community-plugins'>\n & InjectFace<CommunityPluginsCardFace>\n & {\n /** Index entries; defaults to the generated registry (injected for tests). */\n plugins?: readonly CommunityPluginEntry[]\n }\n\n/** Render the community plugin index as a first-level settings page. */\nexport function CommunityPluginsSection(props: CommunityPluginsSectionProps): ReactNode {\n const { t, useCommunityPluginsCard, save, discard, edit, resetField, plugins } = props\n return (\n <ul className={css.sectionList}>\n <CommunityPluginsCard t={t} useCommunityPluginsCard={useCommunityPluginsCard} save={save} discard={discard} edit={edit} resetField={resetField} plugins={plugins} />\n </ul>\n )\n}\n","/**\n * The community-plugins locale dictionaries for the index card.\n */\n\n/** Simplified Chinese dictionary (the key-set source of truth). */\nexport const zh = {\n 'settings.title': '社区插件',\n 'settings.description': '社区贡献者开发与维护的插件,链接指向作者自己的仓库。',\n 'settings.enabled': '启用社区插件索引',\n 'settings.enabledHint': '此开关只控制索引列表的显示与否,关闭后在这里重新打开。',\n 'settings.inherit': '继承',\n 'settings.on': '开',\n 'settings.off': '关',\n 'settings.overridden': '已覆盖',\n 'settings.reset': '恢复默认',\n 'settings.notExposed': '当前 DSH 版本未向设置页暴露本插件的配置命名空间,表单不可用。可编辑 ~/.dsh/settings.yaml 直接配置,或为 dsh-host-apiproxy 的 WEB_SETTINGS_NAMESPACES 白名单补充本命名空间后重启。',\n 'settings.readOnly': '当前部署的设置只读。',\n 'settings.expand': '展开设置',\n 'settings.collapse': '收起设置',\n 'settings.save': '保存',\n 'settings.saving': '保存中…',\n 'settings.discard': '放弃',\n 'settings.unsaved': '未保存',\n 'settings.saveFailed': '部署未接受这些值,已保留供你修改。',\n 'settings.invalidNumber': '请输入数字,留空则使用默认值。',\n 'author': '作者',\n 'repository': '仓库',\n 'copy': '复制',\n 'copied': '已复制',\n 'installHint': '索引只登记、不安装代码。要运行某个插件,复制它的安装命令到终端执行;安装后,插件自带的开关与配置(若有)会出现在插件配置里。',\n 'empty': '暂无社区插件登记。',\n 'off': '社区插件索引已关闭。',\n 'notice': '条目由贡献者自行登记,与 dsh-web-ui 的发布内容无关;使用前请自行评估。',\n} satisfies Record<string, string>\n\n/** Key union for this namespace. */\nexport type CommunityPluginKey = keyof typeof zh\n\n/** English dictionary, checked complete against the zh key set. */\nexport const en = {\n 'settings.title': 'Community Plugins',\n 'settings.description': \"Plugins developed and maintained by community contributors, linking to each author's own repository.\",\n 'settings.enabled': 'Enable the community plugin index',\n 'settings.enabledHint': 'This switch only controls whether the index list is shown; turn it back on here.',\n 'settings.inherit': 'Inherit',\n 'settings.on': 'On',\n 'settings.off': 'Off',\n 'settings.overridden': 'Overridden',\n 'settings.reset': 'Reset to default',\n 'settings.notExposed': \"This DSH version does not expose this plugin's settings namespace to the configuration page, so the form is unavailable. Edit ~/.dsh/settings.yaml directly, or add the namespace to dsh-host-apiproxy's WEB_SETTINGS_NAMESPACES allowlist and restart.\",\n 'settings.readOnly': 'This deployment stores settings read-only.',\n 'settings.expand': 'Show settings',\n 'settings.collapse': 'Hide settings',\n 'settings.save': 'Save',\n 'settings.saving': 'Saving…',\n 'settings.discard': 'Discard',\n 'settings.unsaved': 'Unsaved',\n 'settings.saveFailed': 'The deployment did not accept these values; they were left for you to correct.',\n 'settings.invalidNumber': 'Enter a number, or leave blank to use the default.',\n 'author': 'Author',\n 'repository': 'Repository',\n 'copy': 'Copy',\n 'copied': 'Copied',\n 'installHint': 'The index only registers entries, it never installs code. To run a plugin, copy its install command into a terminal; once installed, the plugin provides its own switch and config (if any) in the plugin configuration section.',\n 'empty': 'No community plugins registered yet.',\n 'off': 'The community plugin index is turned off.',\n 'notice': 'Entries are contributed by their authors and are separate from dsh-web-ui releases; evaluate before use.',\n} satisfies Record<CommunityPluginKey, string>\n","/**\n * Community plugin index, browser half. Registers the community-plugins\n * dictionaries and one section into the settings panel's first-level nav\n * (settings.section; the promoted family sections sit beside the built-in\n * general / models / plugins / agent-presets entries). The card carries its\n * own enable switch (backed by the community-plugins settings namespace) and\n * lists community plugins with links to each contributor's own repository.\n * @module @linxin666/dsh-client-ui-community-plugins/client\n */\n\nimport type { ClientContext, SettingsScope, SettingsScopeSpec } from '@deepseek-ai/dsh-client-runtime/client'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale).\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the settings-surface Context merge (ctx.settingsScope).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// Type-only: pulls the slot-surface types (the settings.section seat).\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\nimport { CommunityPluginsCardController, CommunityPluginsSection, type CommunityPluginsSettings } from './CommunityPluginsCard.tsx'\nimport { en, zh, type CommunityPluginKey } from './locales.ts'\n\nexport type { CommunityPluginsCardProps, CommunityPluginsSectionProps } from './CommunityPluginsCard.tsx'\n\n/** Settings namespace the card's enable switch edits (the Host plugin registers it). */\nconst COMMUNITY_PLUGINS_NS = 'community-plugins'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Community plugin index card copy. */\n 'community-plugins': CommunityPluginKey\n }\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n /**\n * Optional rc.6 compatibility binder provided by dsh-web-ui-settings;\n * absent when that group plugin is not installed, so callers fall back to\n * the official settings scope.\n */\n webUiSettings?: { bind<S>(spec: SettingsScopeSpec<S>): SettingsScope<S> }\n }\n}\n\n/** Required services. */\nexport const inject = ['slots', 'locale', 'connection', 'settingsScope', 'remote']\n\n/**\n * Register the community plugin index as a first-level settings section, with\n * its own enable switch over the community-plugins settings namespace.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register('community-plugins', { zh, en }), 'community-plugins: dictionaries')\n\n const binder = ctx.get('webUiSettings') ?? ctx.settingsScope\n const settingsScope = binder.bind<CommunityPluginsSettings>({ namespace: COMMUNITY_PLUGINS_NS })\n const controller = new CommunityPluginsCardController(settingsScope)\n\n ctx.slots.inject('settings.section', () => {\n const unregister = ctx.slots.register({\n name: 'settings.section',\n id: 'community-plugins',\n order: 140,\n label: () => ctx.locale.bind('community-plugins')('settings.title'),\n locale: 'community-plugins',\n inject: () => controller.inject(),\n }, CommunityPluginsSection)\n return () => {\n controller.dispose()\n unregister()\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEA,SAAgB,mBAAiD,OAAsC;GACrG,MAAM,CAAC,MAAM,YAAA,GAAA,MAAA,SAAA,CAAoB,MAAM,eAAe,IAAI;GAC1D,MAAM,EAAE,OAAO,eAAe;GAC9B,IAAI,CAAC,MAAM,WAAW,OAAO;GAC7B,MAAM,QAAQ,MAAM,EAAE,MAAM,QAAQ;GACpC,MAAM,cAAc,MAAM,EAAE,MAAM,cAAc;GAChD,MAAM,UAAU,CAAC,MAAM,SAAS,MAAM,WAAW,MAAM;GACvD,MAAM,WAAW,eAAe,QAAQ;GACxC,MAAM,YAAY,WAAW,GAAGA,iCAAI,SAAS,GAAGA,iCAAI,SAASA,iCAAI;GAGjE,MAAM,SAAS,eAAe,OAE1B,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAWA,iCAAI;cAApB,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;KAAM,WAAWA,iCAAI;eAArB,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;MAAM,WAAWA,iCAAI;MAAa;gBAAQ;KAAY,CAAA,GACtD,iBAAA,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AAI;KACJ,OAAO;KACP,aAAa,IAAI,OAAO,KAAK,mBAAmB,CAAC,CAAC,gBAAgB;KAClE,QAAQ;KACR,cAAc,WAAW,OAAO;IAClC,GAAG,uBAAuB;IAC1B,aAAa;KACX,WAAW,QAAQ;KACnB,WAAW;IACb;GACF,CAAC;EACH"}
1
+ {"version":3,"file":"client.js","names":["css","css"],"sources":["../../../packages/dsh-community-plugins/src/client/PluginSettingsCard.tsx","../../../packages/dsh-community-plugins/src/client/settings-form.ts","../../../packages/dsh-community-plugins/src/client/generated/community.ts","../../../packages/dsh-community-plugins/src/client/community-guard.ts","../../../packages/dsh-community-plugins/src/client/CommunityPluginsCard.tsx","../../../packages/dsh-community-plugins/src/client/locales.ts","../../../packages/dsh-community-plugins/src/client/index.ts"],"sourcesContent":["// Generated by scripts/sync-shared.mjs from shared/client/settings/PluginSettingsCard.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family-shared chrome for plugin settings cards: a disclosure header naming\n * the plugin and what its settings govern, the controls inside, and the save\n * that writes them. Renders nothing while the namespace is unavailable — a\n * deployment that does not compose the owning plugin should show no trace of\n * it. Inlined into each consumer's client bundle; mirrors the official\n * ui-plugin-config PluginCard in a self-contained slice.\n */\n\nimport { useState, type ReactNode } from 'react'\nimport type { CardShell } from './settings-form.ts'\nimport css from './settings-card.module.css'\n\n/** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */\nexport const CARD_COPY_KEYS = [\n 'settings.collapse',\n 'settings.expand',\n 'settings.notExposed',\n 'settings.unsaved',\n 'settings.readOnly',\n 'settings.saveFailed',\n 'settings.discard',\n 'settings.save',\n 'settings.saving',\n] as const\n\n/** Copy key the card chrome itself reads. */\nexport type CardCopyKey = (typeof CARD_COPY_KEYS)[number]\n\n/** Key domain for the plugin's own copy (inferred per consumer). */\nexport type SettingsCardKey<TKey extends string = string> = TKey | CardCopyKey\n\n/** Card chrome shared by every plugin settings card. */\nexport interface PluginSettingsCardProps<TKey extends string = string> {\n /** Locale reader for this card's copy. */\n t: (key: SettingsCardKey<TKey>, params?: Record<string, string | number>) => string\n /** Locale key of the plugin's name. */\n titleKey: TKey\n /** Locale key of the line describing what this plugin's settings govern. */\n descriptionKey: TKey\n /** The card's form state: availability, writability, and what a save would do. */\n state: CardShell\n /** Write every staged edit. */\n onSave: () => void\n /** Drop every staged edit. */\n onDiscard: () => void\n /**\n * Render the controls expanded on arrival (still collapsible). Defaults to\n * true: promoted first-level sections show their settings immediately.\n */\n defaultOpen?: boolean\n /**\n * Render without the collapse affordance: a static header and an always\n * visible body. Used by first-level settings sections whose nav entry\n * already provides the selection.\n */\n alwaysOpen?: boolean\n /** The plugin's controls. */\n children: ReactNode\n}\n\n/**\n * Render one plugin settings card.\n * @param props - the plugin's copy keys, its form state, and its controls.\n * @returns the card, or nothing while the namespace is still loading.\n */\nexport function PluginSettingsCard<TKey extends string = string>(props: PluginSettingsCardProps<TKey>) {\n const [open, setOpen] = useState(props.defaultOpen ?? true)\n const { state, alwaysOpen } = props\n if (!state.available) return null\n const title = props.t(props.titleKey)\n const description = props.t(props.descriptionKey)\n const blocked = !state.dirty || state.invalid || state.saving\n const expanded = alwaysOpen === true || open\n const cardClass = expanded ? `${css.cardOpen} ${css.card}` : css.card\n // With alwaysOpen the nav entry already provides the selection, so the\n // header is a static title row instead of a disclosure button.\n const header = alwaysOpen === true\n ? (\n <div className={css.headerStatic}>\n <span className={css.headText}>\n <span className={css.name} title={title}>{title}</span>\n <span className={css.description} title={description}>{description}</span>\n </span>\n {state.dirty ? <span className={css.pending} title={props.t('settings.unsaved')}>{props.t('settings.unsaved')}</span> : null}\n </div>\n )\n : (\n <button\n type=\"button\"\n className={css.header}\n aria-expanded={open}\n aria-label={`${props.t(open ? 'settings.collapse' : 'settings.expand')}: ${title}`}\n onClick={() => { setOpen(!open) }}\n >\n <span className={css.headText}>\n <span className={css.name} title={title}>{title}</span>\n <span className={css.description} title={description}>{description}</span>\n </span>\n {state.dirty ? <span className={css.pending} title={props.t('settings.unsaved')}>{props.t('settings.unsaved')}</span> : null}\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={open ? `${css.chevron} ${css.chevronOpen}` : css.chevron}\n >\n <path\n d=\"M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n )\n // The namespace exists but the Host does not serve it to this client (the\n // official settings allowlist omits third-party namespaces): show a card\n // that explains the gap instead of vanishing, so a missing card never\n // reads as a missing plugin.\n if (!state.exposed) {\n return (\n <li className={cardClass}>\n {header}\n {expanded\n ? (\n <div className={css.body}>\n <p className={css.notExposed} role=\"status\">{props.t('settings.notExposed')}</p>\n </div>\n )\n : null}\n </li>\n )\n }\n return (\n <li className={cardClass}>\n {header}\n {expanded\n ? (\n <div className={css.body}>\n {!state.writable ? <p className={css.readOnly} role=\"status\">{props.t('settings.readOnly')}</p> : null}\n {props.children}\n <div className={css.footer}>\n {state.failed\n ? (\n <p className={css.failed} role=\"status\">\n {props.t('settings.saveFailed')}{state.failedReason ? ' - ' + state.failedReason : ''}\n </p>\n )\n : null}\n <button\n type=\"button\"\n className={css.discard}\n disabled={!state.dirty || state.saving}\n onClick={props.onDiscard}\n >\n {props.t('settings.discard')}\n </button>\n <button\n type=\"button\"\n className={css.save}\n disabled={blocked}\n onClick={props.onSave}\n >\n {props.t(!state.saving ? 'settings.save' : 'settings.saving')}\n </button>\n </div>\n </div>\n )\n : null}\n </li>\n )\n}\n\n/** Props every field control needs regardless of its value type. */\nexport interface FieldProps {\n /** Stable id associating the label with its control. */\n id: string\n /** Visible label. */\n label: string\n /** One-line explanation rendered under the control. */\n hint: string\n /** Draft text this control renders. */\n text: string\n /** True when saving would leave a user-layer entry for this field. */\n overridden: boolean\n /** True when the draft is not a value this field accepts. */\n invalid: boolean\n /** Copy for the overridden badge. */\n overriddenLabel: string\n /** Copy for the reset control. */\n resetLabel: string\n /** Copy shown in place of the hint while the draft is invalid. */\n invalidLabel: string\n /** Disables every control (read-only document, or an unavailable namespace). */\n disabled: boolean\n /** Stage draft text. */\n onEdit: (text: string) => void\n /** Stage a clear so the field re-inherits the composition layer. */\n onReset: () => void\n}\n\n/** A staged value field. `numeric` only hints the keypad: which drafts a field accepts is decided by its spec. */\nexport function ValueField(props: FieldProps & {\n /** Hints a numeric keypad without narrowing what the control accepts. */\n numeric?: boolean\n /** Placeholder shown while the draft is empty. */\n placeholder?: string\n}) {\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n <input\n id={props.id}\n className={props.invalid ? css.inputInvalid : css.input}\n type=\"text\"\n {...props.numeric === true ? { inputMode: 'numeric' as const } : {}}\n {...props.invalid ? { 'aria-invalid': true } : {}}\n value={props.text}\n placeholder={props.placeholder ?? ''}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n />\n <p className={props.invalid ? css.invalid : css.hint}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n\n/** A staged boolean field: 继承 / 开 / 关. */\nexport function BooleanField(props: FieldProps & {\n /** Copy for the inherit option. */\n inheritLabel: string\n /** Copy for the on option. */\n onLabel: string\n /** Copy for the off option. */\n offLabel: string\n}) {\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n <select\n id={props.id}\n className={css.select}\n value={props.text}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n >\n <option value=\"\">{props.inheritLabel}</option>\n <option value=\"true\">{props.onLabel}</option>\n <option value=\"false\">{props.offLabel}</option>\n </select>\n <p className={css.hint}>{props.hint}</p>\n </div>\n )\n}\n\n/** A staged enumerated field rendered as a select. */\nexport function ChoiceField(props: FieldProps & {\n /** Copy for the inherit option (draft text is the empty string). */\n inheritLabel: string\n /** Choices rendered in order; `value` is the draft/stored text. */\n choices: ReadonlyArray<{ value: string; label: string }>\n}) {\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n <select\n id={props.id}\n className={css.select}\n value={props.text}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n >\n <option value=\"\">{props.inheritLabel}</option>\n {props.choices.map(choice => (\n <option key={choice.value} value={choice.value}>{choice.label}</option>\n ))}\n </select>\n <p className={props.invalid ? css.invalid : css.hint}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Staged form model behind the plugin settings card. A card stages what the\n * user types and writes it only when they save — the settings write is a\n * durable, revision-fenced document mutation, so staging keeps what is on\n * screen exactly what a save would store. Family-shared slice inlined into\n * each plugin's client bundle; mirrors the official ui-plugin-config\n * card-store pattern.\n */\n\nimport type { SettingsScope, SettingsScopeSnapshot, SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\n\n/** The write one field's staged text performs when the card is saved. */\nexport type FieldWrite =\n | { kind: 'set'; value: unknown }\n | { kind: 'clear' }\n\n/** How one field converts between its stored value and its draft text. */\nexport interface FieldSpec {\n /** Field name inside the namespace section. */\n field: string\n /**\n * Whether the Host treats this field as a secret and redacts its value from\n * the read-back (role('secret') in the section schema). Redacted secrets are\n * never compared against the draft on save; the field lands when the scope\n * reports the write succeeded (its secret-set marker under the bridge), so\n * a successful secret save is not misreported as failed.\n */\n secret?: boolean\n /** Render a stored value as draft text; the empty string when the section carries none. */\n format: (value: unknown) => string\n /**\n * The write this draft text stages, or undefined when the text is not a\n * value this field accepts — which blocks the save rather than discarding it.\n */\n parse: (text: string) => FieldWrite | undefined\n}\n\n/** One field as the card renders it. */\nexport interface FieldState {\n /** Draft text the control renders. */\n text: string\n /** Whether saving would leave a user-layer entry for this field. */\n overridden: boolean\n /** Whether the draft is not a value this field accepts, which blocks saving. */\n invalid: boolean\n}\n\n/** Form state every plugin settings card shares. */\nexport interface CardShell {\n /** False while the namespace is still loading; the card renders nothing. */\n available: boolean\n /**\n * Whether the namespace is actually served to this client. False when the\n * Host deployment does not expose it (e.g. the official apiproxy settings\n * allowlist omits third-party namespaces): the card renders an explanation\n * instead of its form, so a missing namespace never looks like a missing\n * plugin.\n */\n exposed: boolean\n /** Whether the Host document accepts writes. */\n writable: boolean\n /** Whether the form holds edits that a save would write. */\n dirty: boolean\n /** Whether any staged draft is invalid, which blocks the save. */\n invalid: boolean\n /** Whether a save is crossing the wire. */\n saving: boolean\n /** Whether the last save did not land as staged; cleared by the next edit or save. */\n failed: boolean\n /**\n * The rejection code/message the Host returned for the last failed save,\n * surfaced next to the generic failure text. Undefined while no save has\n * failed (or the failure carried no server reason).\n */\n failedReason?: string\n}\n\n/** The write actions the card's slot entry injects. */\nexport interface CardActions {\n /** Stage draft text for one field. */\n edit: (field: string, text: string) => void\n /** Stage a clear, so saving lets the field re-inherit the composition layer. */\n resetField: (field: string) => void\n /** Write every staged edit, then re-seed from what the Host accepted. */\n save: () => void\n /** Drop every staged edit. */\n discard: () => void\n}\n\n/** One field's staged edit. */\ninterface StagedEdit {\n /** Draft text the control renders. */\n text: string\n /** True when this edit clears the field whatever text it shows. */\n clear: boolean\n}\n\n/** One staged edit resolved into the write a save performs. */\ninterface PlannedWrite {\n /** Field this entry writes. */\n field: string\n /** The durable write this entry performs, described for a batched scope. */\n op: BatchedWrite\n /** Perform the write and report whether the Host holds the staged value afterwards. */\n run: (() => Promise<boolean>) | undefined\n}\n\n/** One durable write a batched settings scope performs. */\nexport interface BatchedWrite {\n /** Field this entry writes. */\n field: string\n /** set stores a value; unset drops the leaf. */\n op: 'set' | 'unset'\n /** Value for op set (absent for unset). */\n value?: unknown\n}\n\n/** Per-field outcome of one batched scope write. */\nexport interface BatchedFieldResult {\n /** Field this entry writes. */\n field: string\n /** Whether the Host accepted this field's write (per the read-back view). */\n landed: boolean\n}\n\n/**\n * Result of a batched scope write. The bridge scope posts every planned write\n * in one /mutate so the Host validate hook judges baseURL+model together; a\n * batched refusal fails the whole save rather than per-field.\n */\nexport interface BatchResult {\n /** Whether the whole mutate was accepted. */\n ok: boolean\n /** Per-field success, in the request order (always present when ok). */\n fields: BatchedFieldResult[]\n /** Host rejection code (mutate refused). */\n code?: string\n /** Host rejection message (mutate refused). */\n message?: string\n}\n\n/** The optional batch surface the bridge scope adds over the SettingsScope contract. */\ninterface BatchedSettingsScope {\n /** Write every operation in one scope mutation, reporting per-field success. */\n mutate: (writes: BatchedWrite[]) => Promise<BatchResult>\n}\n\n/** Constraints a numeric field's accepted drafts must satisfy, mirroring the host schema. */\nexport interface NumberConstraints {\n /** The accepted value must be a whole number. */\n integer?: boolean\n /** The accepted value must be at least this. */\n min?: number\n}\n\n/** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints blocks the save. */\nexport function numberField(field: string, constraints: NumberConstraints = {}): FieldSpec {\n const { integer = false, min } = constraints\n return {\n field,\n format: value => typeof value === 'number' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n const parsed = Number(trimmed)\n if (!Number.isFinite(parsed)) return undefined\n if (integer && !Number.isInteger(parsed)) return undefined\n if (min !== undefined && parsed < min) return undefined\n return { kind: 'set', value: parsed }\n },\n }\n}\n\n/** A free-text field. An empty draft clears the field. */\nexport function textField(field: string): FieldSpec {\n return {\n field,\n format: value => typeof value === 'string' ? value : '',\n parse: (text) => {\n const trimmed = text.trim()\n return trimmed === '' ? { kind: 'clear' } : { kind: 'set', value: trimmed }\n },\n }\n}\n\n/**\n * A free-text field the Host treats as a secret and redacts from the read-back\n * (role('secret') in the section schema). The card still edits it like text,\n * but a save never compares the redacted value back and relies on the scope\n * reporting the write landed.\n */\nexport function secretField(field: string): FieldSpec {\n return { ...textField(field), secret: true }\n}\n\n/** A boolean field, edited through true/false draft text. */\nexport function booleanField(field: string): FieldSpec {\n return {\n field,\n format: value => typeof value === 'boolean' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n if (trimmed === 'true') return { kind: 'set', value: true }\n if (trimmed === 'false') return { kind: 'set', value: false }\n return undefined\n },\n }\n}\n\n/** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */\nexport function choiceField(field: string, choices: readonly string[]): FieldSpec {\n return {\n field,\n format: value => typeof value === 'string' && choices.includes(value) ? value : '',\n parse: (text) => {\n if (text === '') return { kind: 'clear' }\n return choices.includes(text) ? { kind: 'set', value: text } : undefined\n },\n }\n}\n\n/**\n * Stages one card's edits over one settings namespace and writes them on save.\n *\n * The Host is the only authority on whether a value was accepted — its\n * validators own the constraints no schema can express — so the outcome is\n * read back from the section rather than predicted here. A save that did not\n * land keeps its drafts, so the user can correct them instead of retyping.\n */\nexport class CardForm<T> {\n private readonly specs: Map<string, FieldSpec>\n private readonly staged = new Map<string, StagedEdit>()\n private readonly listeners = new Set<() => void>()\n /** The scope subscription installed in the constructor; released by dispose(). */\n private readonly disposeScope: () => void\n private disposed = false\n private saving = false\n private failed = false\n private failedReason: string | undefined\n\n /** @param scope - the bound settings scope for this card's namespace. */\n constructor(\n private readonly scope: SettingsScope<T>,\n specs: FieldSpec[],\n ) {\n this.specs = new Map(specs.map(spec => [spec.field, spec]))\n this.disposeScope = scope.subscribe(() => { this.publish() })\n }\n\n /**\n * Release the scope subscription and every bound store listener. The card\n * must call this on teardown; later calls are no-ops.\n */\n dispose(): void {\n if (this.disposed) return\n this.disposed = true\n this.disposeScope()\n this.listeners.clear()\n }\n\n /** Publish a projection of this form, rebuilt whenever the scope or a draft changes. */\n bind<S>(project: () => S): SnapshotStore<S> {\n const store = createSnapshotStore(project())\n this.listeners.add(() => { store.set(project()) })\n return store\n }\n\n /** Read the card-level state: what the Host serves, and what a save would do. */\n shell(): CardShell {\n const snapshot = this.scope.getSnapshot()\n const plan = this.plan()\n return {\n available: snapshot.status !== 'loading',\n exposed: snapshot.status === 'ready',\n writable: snapshot.writable,\n dirty: plan.length > 0,\n invalid: plan.some(item => item.run === undefined),\n saving: this.saving,\n failed: this.failed,\n ...this.failedReason === undefined ? {} : { failedReason: this.failedReason },\n }\n }\n\n /** Read one field's state from the effective section and its staged draft. */\n field(field: string): FieldState {\n const spec = this.specOf(field)\n const staged = this.staged.get(field)\n if (staged === undefined) {\n return { text: spec.format(this.sectionValue(field)), overridden: this.stored(field), invalid: false }\n }\n const write = staged.clear ? { kind: 'clear' as const } : spec.parse(staged.text)\n return {\n text: staged.text,\n overridden: write?.kind === 'set',\n invalid: write === undefined,\n }\n }\n\n /** The actions the card's slot registration injects. */\n actions(): CardActions {\n return {\n edit: (field, text) => { this.stage(field, { text, clear: false }) },\n resetField: (field) => {\n this.stage(field, { text: this.specOf(field).format(this.baseValue(field)), clear: true })\n },\n save: () => { void this.save() },\n discard: () => {\n if (this.staged.size === 0 && !this.failed) return\n this.staged.clear()\n this.failed = false\n this.failedReason = undefined\n this.publish()\n },\n }\n }\n\n /**\n * Write every staged edit, then re-seed from what the Host accepted.\n *\n * When the scope carries the optional batch surface (the dsh-web-ui\n * bridge scope), every planned write rides one mutation so cross-field\n * validate hooks (baseURL+model) judge the batch as a unit instead of\n * deadlocking on per-field writes. Otherwise the per-field loop runs.\n * A field lands only when the Host reports it held the staged value; a\n * landed field's draft is dropped, a failed one stays staged for the user.\n * @returns settlement after every write and the read-back.\n */\n async save(): Promise<void> {\n const plan = this.plan()\n const valid = plan.filter(item => item.run !== undefined)\n if (plan.length === 0 || this.saving || valid.length !== plan.length) return\n const plannedWrites = valid.map(item => item.op)\n // Snapshot the fields this save writes, so edits staged while it is in\n // flight survive: only the staged keys this save actually wrote are cleared.\n const fields = new Set(plan.map(item => item.field))\n this.saving = true\n this.failed = false\n this.failedReason = undefined\n this.publish()\n const landed = new Set<string>()\n const batch = this.batchedScope()\n if (batch !== undefined) {\n const result = await batch.mutate(plannedWrites)\n if (result.ok) {\n for (const field of result.fields) {\n if (field.landed) landed.add(field.field)\n }\n } else {\n this.failedReason = result.message\n }\n } else {\n for (const item of valid) {\n if (await item.run!()) landed.add(item.field)\n }\n }\n for (const field of fields) {\n if (landed.has(field)) this.staged.delete(field)\n }\n this.saving = false\n this.failed = landed.size !== fields.size\n this.publish()\n }\n\n /** The scope's batch surface when it supports one; undefined conservatively otherwise. */\n private batchedScope(): BatchedSettingsScope | undefined {\n const candidate = this.scope as unknown as BatchedSettingsScope | undefined\n return typeof candidate?.mutate === 'function' ? candidate : undefined\n }\n\n /**\n * Every staged edit a save would write. An entry whose draft is not a value\n * its field accepts carries no write: the form is still dirty, and the save\n * refuses rather than dropping the edit. A staged edit that matches the\n * effective section is not a write at all.\n * @returns the planned writes, in the order the fields were staged.\n */\n private plan(): PlannedWrite[] {\n const plan: PlannedWrite[] = []\n for (const [field, staged] of this.staged) {\n const spec = this.specOf(field)\n if (staged.clear) {\n if (this.stored(field)) plan.push({ field, op: { field, op: 'unset' }, run: () => this.clear(field) })\n continue\n }\n if (staged.text === spec.format(this.sectionValue(field))) continue\n const write = spec.parse(staged.text)\n if (write === undefined) plan.push({ field, op: { field, op: 'unset' }, run: undefined })\n else if (write.kind === 'clear') plan.push({ field, op: { field, op: 'unset' }, run: () => this.clear(field) })\n else plan.push({ field, op: { field, op: 'set', value: write.value }, run: () => this.store(field, write.value) })\n }\n return plan\n }\n\n private async clear(field: string): Promise<boolean> {\n await this.scope.unset(field)\n return !this.stored(field)\n }\n\n private async store(field: string, value: unknown): Promise<boolean> {\n await this.scope.set(field, value)\n // A redacted secret never appears in the user layer read-back; judging it\n // by value would misreport a successful secret save as failed. The bridge\n // reports secret writes through its secret-set markers (batch path); on\n // the per-field path the scope resolved, so the write is landed.\n if (this.specOf(field).secret) return true\n return this.userLayer()?.[field] === value\n }\n\n private stage(field: string, edit: StagedEdit): void {\n this.staged.set(field, edit)\n this.failed = false\n this.failedReason = undefined\n this.publish()\n }\n\n private specOf(field: string): FieldSpec {\n const spec = this.specs.get(field)\n // Every call site names a field this card declared; a missing one is a\n // wiring mistake that must not degrade into a silently inert control.\n if (spec === undefined) throw new Error(`settings card has no field ${field}`)\n return spec\n }\n\n private snapshotOf(): SettingsScopeSnapshot<T> {\n return this.scope.getSnapshot()\n }\n\n private sectionValue(field: string): unknown {\n return (this.snapshotOf().value as Record<string, unknown> | undefined)?.[field]\n }\n\n private baseValue(field: string): unknown {\n return (this.snapshotOf().base as Record<string, unknown> | undefined)?.[field]\n }\n\n private userLayer(): Record<string, unknown> | undefined {\n return this.snapshotOf().user as Record<string, unknown> | undefined\n }\n\n private stored(field: string): boolean {\n const user = this.userLayer()\n return user !== undefined && Object.hasOwn(user, field)\n }\n\n private publish(): void {\n for (const listener of this.listeners) listener()\n }\n}\n","/**\n * AUTO-GENERATED by scripts/community-index — do not edit by hand.\n * Community plugin index for the settings page: every entry links to the\n * contributor's own repository. This repository never vendors the listed\n * plugins — it only points users at them.\n * Regenerate with `node scripts/community-index`.\n */\n\n/** Stable category ids rendered as marketplace-style filter pills (the runtime guard imports this). */\nexport const COMMUNITY_CATEGORIES = ['ui', 'agent', 'tools', 'knowledge', 'integration', 'security', 'utility'] as const\n\n/** One category id. */\nexport type CommunityPluginCategory = typeof COMMUNITY_CATEGORIES[number]\n\n/** One community plugin entry: contributor metadata plus the repository link. */\nexport interface CommunityPluginEntry {\n /** Stable entry id (unique in community.json). */\n id: string\n /** Display name (zh). */\n name: string\n /** Display name (en). */\n nameEn: string\n /** Contributor (GitHub user or organization). */\n author: string\n /** One-line description (zh). */\n description?: string\n /** One-line description (en). */\n descriptionEn?: string\n /** The contributor's own repository URL. */\n repo: string\n /** npm package name, when the plugin is published there. */\n npm?: string\n /** Category id for the marketplace filter pills. */\n category?: CommunityPluginCategory\n}\n\n/** Every community plugin, in community.json order. */\nexport const COMMUNITY_PLUGINS: readonly CommunityPluginEntry[] = [\n {\"id\":\"dsh-data-agent\",\"name\":\"Data Agent\",\"nameEn\":\"Data Agent\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-data-agent\",\"description\":\"为 DSH 定义专用 Data Agent 预设,让 AI 帮你查询、更新、分析数据。\",\"descriptionEn\":\"Defines a dedicated Data Agent preset for DSH so the AI can query, update and analyze data.\",\"category\":\"agent\"},\n {\"id\":\"dsh-tui\",\"name\":\"dsh-TUI\",\"nameEn\":\"dsh-TUI\",\"author\":\"ccch1mneyyy\",\"repo\":\"https://github.com/ccch1mneyyy/dsh-TUI\",\"description\":\"Claude Code 风格全屏交互终端插件:像素鲸鱼顶栏、实时工作状态行、思考流式展开、双击 Esc 回滚、上下文进度条与 TPS 仪表。\",\"descriptionEn\":\"A Claude Code style fullscreen interactive terminal plugin: pixel-whale header, live working-state line, streaming reasoning expansion, double-Esc rollback, context progress bar and TPS gauges.\",\"category\":\"ui\"},\n {\"id\":\"dsh-tianshu-tui\",\"name\":\"天书 TUI\",\"nameEn\":\"Tianshu TUI\",\"author\":\"huiliyi37\",\"repo\":\"https://github.com/huiliyi37/dsh-tianshu-tui\",\"description\":\"基于官方 DeepSeek Harness 的交互式终端 UI 插件,在官方基础上增加 TDD 与证据门等工作流。\",\"descriptionEn\":\"An interactive terminal UI plugin for DeepSeek Harness that adds TDD and evidence-gate workflows on top of the official base.\",\"category\":\"ui\"},\n {\"id\":\"dsh-chat-summary\",\"name\":\"Chat Summary\",\"nameEn\":\"Chat Summary\",\"author\":\"v833\",\"repo\":\"https://github.com/v833/dsh-chat-summary\",\"description\":\"总结当前对话并导出为 Markdown / DOCX / PDF,可选 LLM 智能总结(用户自配 API Key)。\",\"descriptionEn\":\"Summarize the current conversation and export it as Markdown / DOCX / PDF, with optional LLM summarization using your own API key.\",\"npm\":\"@linxin666/dsh-client-ui-chat-summary\",\"category\":\"knowledge\"},\n {\"id\":\"dsh-builtin-toggles\",\"name\":\"内置能力检查器\",\"nameEn\":\"Built-in Capability Inspector\",\"author\":\"Starfie1d1272\",\"repo\":\"https://github.com/Starfie1d1272/dsh-builtin-toggles\",\"description\":\"Evidence-backed 内置 capability Inspector:展示 DSH Web built-in capability 的 provenance、compatibility 与 structural drift;仅对 9 个经过审阅的 UI leaves 提供 fail-closed 开关。\",\"descriptionEn\":\"Evidence-backed built-in capability Inspector: surfaces provenance, compatibility and structural drift of DSH Web built-ins, with fail-closed toggles for only the nine reviewed UI leaves.\",\"npm\":\"dsh-builtin-toggles\",\"category\":\"tools\"},\n {\"id\":\"dsh-pilot\",\"name\":\"Pilot 浏览器驾驶舱\",\"nameEn\":\"Pilot Browser Cockpit\",\"author\":\"guo6x\",\"repo\":\"https://github.com/guo6x/dsh-pilot\",\"description\":\"给 agent 一双会开车的手:零依赖 CDP 浏览器操控(8 个 pilot_* 工具:导航/点击/输入/按键/JS/截图)+ Web GUI 可拖拽驾驶舱面板,无需 Playwright、无需 API key。\",\"descriptionEn\":\"Give your agent hands: zero-dependency CDP browser control (8 pilot_* tools: navigate/click/type/keys/eval/screenshot) plus a draggable cockpit panel in the Web GUI - no Playwright, no API key.\",\"category\":\"tools\"},\n {\"id\":\"dsh-housekeeper\",\"name\":\"环境管家\",\"nameEn\":\"Environment Housekeeper\",\"author\":\"guo6x\",\"repo\":\"https://github.com/guo6x/dsh-housekeeper\",\"description\":\"管住 agent 的脏手:工具链台账(node/pnpm/git/gh/ffmpeg 等自动探测)、缓存与临时目录扫描 + 白名单安全一键清理、机器规则 AGENTS.md 查看编辑,全在设置面板完成。\",\"descriptionEn\":\"Keep your agent's hands clean: toolchain inventory, scratch/cache scan with whitelist-guarded one-click cleanup, and the machine rules file (AGENTS.md) view/edit - all in the settings panel.\",\"category\":\"utility\"},\n {\"id\":\"dsh-deepread\",\"name\":\"DeepRead 精读助手\",\"nameEn\":\"DeepRead Assistant\",\"author\":\"xiehuan123\",\"repo\":\"https://github.com/xiehuan123/dsh-deepread\",\"description\":\"五种模式精读插件(quick / deep / map / feynman / book),支持公众号链接与文件输入、批量对比、预算预检与后台任务进度透明,导出 md / mm / html,Web UI 提供工具结果卡片与精读面板。\",\"descriptionEn\":\"A five-mode deep reading plugin (quick / deep / map / feynman / book) for links and files, with batch comparison, budget preflight, transparent background-job progress, md / mm / html exports, and Web UI tool-result cards plus a reading panel.\",\"npm\":\"dsh-deepread\",\"category\":\"knowledge\"},\n {\"id\":\"dsh-mnemon\",\"name\":\"Mnemon 记忆系统\",\"nameEn\":\"Mnemon Memory\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-mnemon\",\"description\":\"与 Mnemon CLI 集成的跨 Agent、本地优先持久记忆插件:用户画像 / 工作记忆 / 项目档案与长期 Memory Spaces,支持导入导出。\",\"descriptionEn\":\"A cross-agent, local-first persistent memory plugin integrating the Mnemon CLI: profiles, working memory, project documents and long-term Memory Spaces, with import and export.\",\"npm\":\"dsh-mnemon\",\"category\":\"knowledge\"},\n {\"id\":\"dsh-plugin-hub\",\"name\":\"插件中心(dsh-plugin-hub)\",\"nameEn\":\"Plugin Hub\",\"author\":\"Noob-stupid\",\"repo\":\"https://github.com/Noob-stupid/dsh-plugin-hub\",\"description\":\"插件管理面板:已安装插件一键启用/停用,内置 GitHub dsh-plugin 插件市场(官方/聚合识别、子包浏览、一键安装与本地 AI 兜底修复、删除卸载)。\",\"descriptionEn\":\"Plugin management panel: one-click enable/disable, a GitHub dsh-plugin marketplace with official/aggregate detection, subpackage browsing, one-click installs with local-AI fallback repair, and uninstall.\",\"category\":\"tools\"},\n {\"id\":\"dsh-genui\",\"name\":\"GenUI 生成式 UI\",\"nameEn\":\"GenUI\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-genui\",\"description\":\"给模型输出配交互式 UI:助手回复内联渲染 dsh-ui fence(布局、图表、表单、Mermaid、3D),支持流式渲染与面板停靠,组件交互可回传模型。\",\"descriptionEn\":\"Interactive UI inside assistant replies via the dsh-ui fence: layouts, charts, forms, Mermaid and 3D with streaming rendering, panel docking and actions that loop back to the model.\",\"category\":\"ui\"},\n {\"id\":\"dsh-annotation\",\"name\":\"选中批注\",\"nameEn\":\"Selection Annotation\",\"author\":\"omdsh-dev\",\"repo\":\"https://github.com/omdsh-dev/dsh-annotation\",\"description\":\"选中助手文字即可批注,回车随消息发送;自己的气泡只显示问题与「批注 ×N」标签,模型按 Annotation N 逐条对照回复(悬浮芯片)。\",\"descriptionEn\":\"Select text in an assistant reply to annotate it; annotations are sent with your next message, hidden from your own bubble behind an Annotations xN chip, and the model replies per Annotation N with hoverable chips.\",\"category\":\"ui\"},\n {\"id\":\"deepseek-harness-auth\",\"name\":\"DeepSeek Harness Auth\",\"nameEn\":\"DeepSeek Harness Auth\",\"author\":\"taichuy\",\"repo\":\"https://github.com/taichuy/deepseek-harness-auth\",\"description\":\"为 DSH Web 公网部署提供登录认证前置代理,支持账号密码、验证码、失败锁定和 IP/CIDR 白名单。\",\"descriptionEn\":\"An authentication proxy for public DSH Web deployments with password login, captcha, failed-attempt locking, and IP/CIDR allowlists.\",\"npm\":\"deepseek-harness-auth\",\"category\":\"security\"},\n {\"id\":\"dsh-cloud-sync\",\"name\":\"云同步服务\",\"nameEn\":\"Cloud Sync\",\"author\":\"dickpy\",\"repo\":\"https://github.com/dickpy/dsh-cloud-sync\",\"description\":\"支持 WebDAV、S3、阿里云 OSS、腾讯云 COS 与 MinIO 的 DSH 云同步插件,可同步 profile、插件配置及本地插件源码归档。\",\"descriptionEn\":\"DSH cloud sync for WebDAV, S3, Alibaba Cloud OSS, Tencent Cloud COS and MinIO, syncing profiles, plugin settings and local plugin source archives.\",\"npm\":\"@dickpy/dsh-cloud-sync\",\"category\":\"integration\"},\n {\"id\":\"dsh-auto-memory\",\"name\":\"自动记忆\",\"nameEn\":\"Auto Memory\",\"author\":\"Aik358\",\"repo\":\"https://github.com/Aik358/dsh-auto-memory\",\"description\":\"三层自动记忆插件:用户级/项目笔记/每日日志自动注入与检索、每轮自动沉淀、AI 时段问候、智能检索、日历与工作区思维导图,支持继承 WorkBuddy/CodeBuddy/Claude Code/Codex 等其他 AI 工具的记忆。\",\"descriptionEn\":\"Three-layer auto memory for DSH: user-level/project-notes/daily-logs with automatic injection and retrieval, per-turn auto-consolidation, AI greetings, smart search, calendar, workspace mind map, and inheritance from WorkBuddy/CodeBuddy/Claude Code/Codex.\",\"npm\":\"@a9i5k4/dsh-auto-memory\",\"category\":\"knowledge\"},\n {\"id\":\"dsh-memoir\",\"name\":\"项目记忆 Memoir\",\"nameEn\":\"Project Memory Memoir\",\"author\":\"Qinling-Melon-Farmers\",\"repo\":\"https://github.com/Qinling-Melon-Farmers/dsh-memoir\",\"description\":\"项目持久化记忆与会话经验沉淀:memoir_record / memoir_read 工具(BM25 相关度排序检索)、每轮工作自动蒸馏、记忆诊断面板与跨项目全局检索,纯本地零外部依赖。\",\"descriptionEn\":\"Project persistent memory and session-lessons distillation: memoir_record / memoir_read tools with BM25-ranked retrieval, per-turn auto-distill, a memory diagnostics panel and cross-project search - fully local, no external dependency.\",\"category\":\"knowledge\"},\n]\n","/**\n * Runtime guard for the generated community index entries. The index is\n * build-time generated data, but the card renders whatever the module\n * carries; a hand-written narrowing keeps one malformed entry from breaking\n * the whole list at render time.\n */\n\nimport { COMMUNITY_CATEGORIES, type CommunityPluginCategory, type CommunityPluginEntry } from './generated/community.ts'\n\n/** Category ids the card knows how to label; others are treated as uncategorized. */\nconst KNOWN_CATEGORIES: readonly CommunityPluginCategory[] = COMMUNITY_CATEGORIES\n\n/**\n * The install command is pasted into a shell, so repo/npm must be free of\n * shell metacharacters: repo is a plain https URL of path-safe characters,\n * npm a standard (optionally scoped) package name.\n */\nconst REPO_SAFE_RE = /^https:\\/\\/[A-Za-z0-9._~\\/-]+$/\nconst NPM_SAFE_RE = /^(@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/\n\n/** True when the value is a well-formed community plugin entry. */\nexport function isCommunityPluginEntry(value: unknown): value is CommunityPluginEntry {\n if (typeof value !== 'object' || value === null) return false\n const entry = value as Record<string, unknown>\n if (typeof entry.id !== 'string' || entry.id === '') return false\n if (typeof entry.name !== 'string' || typeof entry.nameEn !== 'string') return false\n if (typeof entry.author !== 'string' || entry.author === '') return false\n if (typeof entry.repo !== 'string' || !REPO_SAFE_RE.test(entry.repo)) return false\n if (entry.description !== undefined && typeof entry.description !== 'string') return false\n if (entry.descriptionEn !== undefined && typeof entry.descriptionEn !== 'string') return false\n if (entry.npm !== undefined && (typeof entry.npm !== 'string' || !NPM_SAFE_RE.test(entry.npm))) return false\n if (entry.category !== undefined && (typeof entry.category !== 'string' || !KNOWN_CATEGORIES.includes(entry.category as CommunityPluginCategory))) return false\n return true\n}\n","/**\n * The community plugin index card: a first-level settings section that is\n * always open. Its own enable switch (backed by the community-plugins\n * settings namespace) gates the list, which is presented marketplace-style:\n * a search box, category filter pills with counts, and a two-column card grid\n * whose entries link to contributors' own repositories — this package only\n * indexes them, it never vendors their code.\n */\n\nimport { useMemo, useState, type ReactNode } from 'react'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\n// Type-only: pulls the settings-surface SlotMap merge (the 'settings.section' entry).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { SettingsScope, SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\nimport { PluginSettingsCard, BooleanField } from './PluginSettingsCard.tsx'\nimport { CardForm, booleanField, type CardActions, type CardShell, type FieldState as CardFieldState } from './settings-form.ts'\nimport type { CommunityPluginKey } from './locales.ts'\nimport { COMMUNITY_PLUGINS, type CommunityPluginCategory, type CommunityPluginEntry } from './generated/community.ts'\nimport { isCommunityPluginEntry } from './community-guard.ts'\nimport css from './community.module.css'\n\n/** The settings fields this card edits (the namespace's full schema). */\nexport interface CommunityPluginsSettings {\n /** Master switch for the index card. */\n enabled?: boolean\n}\n\n/** What the community plugin card renders. */\nexport interface CommunityPluginsCardState extends CardShell {\n /** Master switch. */\n enabled: CardFieldState\n}\n\n/** The registration-side face the card's slot entry injects. */\nexport interface CommunityPluginsCardFace extends CardActions {\n hooks: {\n /** Card snapshot bound by the renderer as useCommunityPluginsCard. */\n communityPluginsCard: SnapshotStore<CommunityPluginsCardState>\n }\n}\n\n/** Bridges the community-plugins scope onto the card's staged form. */\nexport class CommunityPluginsCardController {\n private readonly form: CardForm<CommunityPluginsSettings>\n private readonly store: SnapshotStore<CommunityPluginsCardState>\n\n /** @param scope - the bound settings scope for the community-plugins namespace. */\n constructor(scope: SettingsScope<CommunityPluginsSettings>) {\n this.form = new CardForm(scope, [\n booleanField('enabled'),\n ])\n this.store = this.form.bind(() => this.projection())\n }\n\n private projection(): CommunityPluginsCardState {\n return {\n ...this.form.shell(),\n enabled: this.form.field('enabled'),\n }\n }\n\n /**\n * Build the face the card's slot registration injects.\n * @returns the card's snapshot and its form actions.\n */\n inject(): CommunityPluginsCardFace {\n return { hooks: { communityPluginsCard: this.store }, ...this.form.actions() }\n }\n\n /**\n * Release the card's scope subscription and bound stores; the slot\n * disposer calls this on teardown.\n */\n dispose(): void {\n this.form.dispose()\n }\n}\n\n/** The one-line install command for an entry: npm package when published, else the contributor repository URL. */\nfunction installCommand(entry: CommunityPluginEntry): string {\n return `dsh plugin --profile web add ${entry.npm ?? entry.repo}`\n}\n\n/**\n * Localized entry copy read through the card's `t`. Falls back to the raw\n * entry field when the key is missing — the dictionary only carries the\n * generated registry, so injected test entries land on the fallback.\n */\nfunction entryCopy(t: (key: string) => string, key: string, fallback: string): string {\n const value = t(key)\n return value === key ? fallback : value\n}\n\n/** Maps a category id onto its locale dictionary key (kept in the generated union). */\nconst CATEGORY_KEY: Record<CommunityPluginCategory, `category.${CommunityPluginCategory}`> = {\n ui: 'category.ui',\n agent: 'category.agent',\n tools: 'category.tools',\n knowledge: 'category.knowledge',\n integration: 'category.integration',\n security: 'category.security',\n utility: 'category.utility',\n}\n\n/** Props the renderer binds for the community plugin card. */\nexport type CommunityPluginsCardProps =\n PropsLocale<'community-plugins'>\n & InjectFace<CommunityPluginsCardFace>\n & {\n /** Index entries; defaults to the generated registry (injected for tests). */\n plugins?: readonly CommunityPluginEntry[]\n }\n\n/**\n * Render the community plugin index card.\n * @param props - locale copy, the card snapshot, its form actions, and the\n * (default-generated) entry list.\n * @returns the card.\n */\nexport function CommunityPluginsCard(props: CommunityPluginsCardProps): ReactNode {\n const { t } = props\n const state = props.useCommunityPluginsCard(snapshot => snapshot)\n // Memoized so the categoryCounts/visiblePlugins caches below only\n // recompute when the registry actually changes, not on every keystroke.\n const plugins = useMemo(() => (props.plugins ?? COMMUNITY_PLUGINS).filter(isCommunityPluginEntry), [props.plugins])\n const [query, setQuery] = useState('')\n const [category, setCategory] = useState<CommunityPluginCategory | null>(null)\n const [copiedId, setCopiedId] = useState<string | null>(null)\n\n const copyCommand = (id: string, command: string): void => {\n const mark = (): void => { setCopiedId(id) }\n const clipboard = typeof navigator !== 'undefined' ? navigator.clipboard : undefined\n if (clipboard?.writeText !== undefined) {\n void clipboard.writeText(command).then(mark, mark)\n return\n }\n // Fallback for browsers without the async clipboard API (or tests).\n try {\n const area = document.createElement('textarea')\n area.value = command\n area.setAttribute('readonly', '')\n area.style.position = 'fixed'\n area.style.opacity = '0'\n document.body.append(area)\n area.select()\n document.execCommand('copy')\n area.remove()\n } catch { /* the command stays visible to select by hand */ }\n mark()\n }\n const disabled = !state.writable\n // The draft text drives the list: '' (inherit) and 'true' keep it visible,\n // 'false' hides it until the switch is turned back on.\n const visible = state.enabled.text !== 'false'\n const fieldProps = {\n overriddenLabel: t('settings.overridden'),\n resetLabel: t('settings.reset'),\n invalidLabel: t('settings.invalidNumber'),\n disabled,\n }\n\n // Category pills in descending count (stable tie-break by id).\n const categoryCounts = useMemo(() => {\n const counts = new Map<CommunityPluginCategory, number>()\n for (const plugin of plugins) {\n if (plugin.category) counts.set(plugin.category, (counts.get(plugin.category) ?? 0) + 1)\n }\n return [...counts.entries()].sort(\n (a, b) => b[1] - a[1] || a[0].localeCompare(b[0]),\n )\n }, [plugins])\n\n // Both the active pill and the search text narrow the list (AND).\n const visiblePlugins = useMemo(() => {\n const needle = query.trim().toLowerCase()\n return plugins.filter((plugin) => {\n if (category !== null && plugin.category !== category) return false\n if (!needle) return true\n const categoryLabel = plugin.category ? t(CATEGORY_KEY[plugin.category]) : ''\n const haystack = [plugin.name, plugin.nameEn, plugin.author, plugin.description, plugin.descriptionEn, plugin.npm ?? '', categoryLabel]\n .join(' ')\n .toLowerCase()\n return haystack.includes(needle)\n })\n }, [plugins, query, category, t])\n\n return (\n <PluginSettingsCard\n t={t}\n titleKey=\"settings.title\"\n descriptionKey=\"settings.description\"\n state={state}\n alwaysOpen\n onSave={props.save}\n onDiscard={props.discard}\n >\n <BooleanField\n id=\"settings-community-enabled\"\n label={t('settings.enabled')}\n hint={t('settings.enabledHint')}\n inheritLabel={t('settings.inherit')}\n onLabel={t('settings.on')}\n offLabel={t('settings.off')}\n {...fieldProps}\n {...state.enabled}\n onEdit={(text) => { props.edit('enabled', text) }}\n onReset={() => { props.resetField('enabled') }}\n />\n {visible\n ? (\n <div className={css.market}>\n <div className={css.toolbar}>\n <input\n id=\"settings-community-search\"\n className={css.search}\n type=\"search\"\n placeholder={t('search.placeholder')}\n aria-label={t('search.label')}\n value={query}\n disabled={disabled}\n onChange={(event) => { setQuery(event.target.value) }}\n />\n </div>\n <div className={css.filters} role=\"group\" aria-label={t('filter.all')}>\n <button\n type=\"button\"\n className={category === null ? `${css.pill} ${css.pillActive}` : css.pill}\n aria-pressed={category === null}\n disabled={disabled}\n onClick={() => { setCategory(null) }}\n >\n {t('filter.all')} {plugins.length}\n </button>\n {categoryCounts.map(([id, count]) => (\n <button\n key={id}\n type=\"button\"\n className={category === id ? `${css.pill} ${css.pillActive}` : css.pill}\n aria-pressed={category === id}\n disabled={disabled}\n onClick={() => { setCategory(category === id ? null : id) }}\n >\n {t(CATEGORY_KEY[id])} {count}\n </button>\n ))}\n </div>\n <p className={css.resultCount} role=\"status\">\n {t('result.count', { shown: visiblePlugins.length, total: plugins.length })}\n </p>\n {plugins.length === 0\n ? <p className={css.empty} role=\"status\">{t('empty')}</p>\n : visiblePlugins.length === 0\n ? <p className={css.empty} role=\"status\">{t('noMatch')}</p>\n : (\n <ul className={css.grid}>\n {visiblePlugins.map((plugin) => {\n const command = installCommand(plugin)\n const copied = copiedId === plugin.id\n const name = entryCopy(t, `name.${plugin.id}`, plugin.nameEn || plugin.name)\n const description = entryCopy(t, `desc.${plugin.id}`, plugin.descriptionEn ?? plugin.description ?? '')\n return (\n <li key={plugin.id} className={css.card}>\n <span className={css.cardHead}>\n <span className={css.cardName} title={name}>{name}</span>\n <span\n className={plugin.npm ? `${css.badge} ${css.badgePublished}` : css.badge}\n title={plugin.npm ?? plugin.repo}\n >\n {plugin.npm ? t('badge.published') : t('badge.source')}\n </span>\n </span>\n <span className={css.cardMeta}>\n {plugin.category ? <span className={css.cardCategory}>{t(CATEGORY_KEY[plugin.category])}</span> : null}\n {plugin.category ? <span className={css.cardDot} aria-hidden=\"true\">·</span> : null}\n <span className={css.cardAuthor} title={plugin.author}>{plugin.author}</span>\n </span>\n {description ? <p className={css.cardDescription}>{description}</p> : null}\n <span className={css.cardFooter}>\n <span className={css.cardTop}>\n <a className={css.cardLink} href={plugin.repo} target=\"_blank\" rel=\"noreferrer\">{t('repository')}</a>\n <button\n type=\"button\"\n className={copied ? `${css.installButton} ${css.installButtonCopied}` : css.installButton}\n title={command}\n onClick={() => { copyCommand(plugin.id, command) }}\n >\n {copied ? t('copied') : t('install')}\n </button>\n </span>\n <code className={css.cardCommand} title={command}>{command}</code>\n </span>\n </li>\n )\n })}\n </ul>\n )}\n </div>\n )\n : <p className={css.off} role=\"status\">{t('off')}</p>}\n <p className={css.installNote} role=\"note\">{t('installHint')}</p>\n <p className={css.notice} role=\"note\">{t('notice')}</p>\n </PluginSettingsCard>\n )\n}\n\n/** Props the settings section binds for the community plugin page. */\nexport type CommunityPluginsSectionProps =\n PropsRuntime<'settings.section'>\n & PropsLocale<'community-plugins'>\n & InjectFace<CommunityPluginsCardFace>\n & {\n /** Index entries; defaults to the generated registry (injected for tests). */\n plugins?: readonly CommunityPluginEntry[]\n }\n\n/** Render the community plugin index as a first-level settings page. */\nexport function CommunityPluginsSection(props: CommunityPluginsSectionProps): ReactNode {\n const { t, useCommunityPluginsCard, save, discard, edit, resetField, plugins } = props\n return (\n <ul className={css.sectionList}>\n <CommunityPluginsCard t={t} useCommunityPluginsCard={useCommunityPluginsCard} save={save} discard={discard} edit={edit} resetField={resetField} plugins={plugins} />\n </ul>\n )\n}\n","/**\n * The community-plugins locale dictionaries for the index card. Static copy\n * for the card chrome plus one localized name/description pair per index\n * entry (`name.<id>` / `desc.<id>`), so the card localizes data-driven text\n * through the same `t` the rest of the settings UI uses — the document\n * `<html lang>` attribute is not a reliable locale signal in the GUI.\n */\n\nimport { COMMUNITY_PLUGINS } from './generated/community.ts'\n\n/** Simplified Chinese copy for the card chrome (the key-set source of truth). */\nconst STATIC_ZH = {\n 'settings.title': '社区插件',\n 'settings.description': '社区贡献者开发与维护的插件,链接指向作者自己的仓库。',\n 'settings.enabled': '启用社区插件索引',\n 'settings.enabledHint': '此开关只控制索引列表的显示与否,关闭后在这里重新打开。',\n 'settings.inherit': '继承',\n 'settings.on': '开',\n 'settings.off': '关',\n 'settings.overridden': '已覆盖',\n 'settings.reset': '恢复默认',\n 'settings.notExposed': '当前 DSH 版本未向设置页暴露本插件的配置命名空间,表单不可用。可编辑 ~/.dsh/settings.yaml 直接配置,或为 dsh-host-apiproxy 的 WEB_SETTINGS_NAMESPACES 白名单补充本命名空间后重启。',\n 'settings.readOnly': '当前部署的设置只读。',\n 'settings.expand': '展开设置',\n 'settings.collapse': '收起设置',\n 'settings.save': '保存',\n 'settings.saving': '保存中…',\n 'settings.discard': '放弃',\n 'settings.unsaved': '未保存',\n 'settings.saveFailed': '部署未接受这些值,已保留供你修改。',\n 'settings.invalidNumber': '请输入数字,留空则使用默认值。',\n 'author': '作者',\n 'repository': '仓库',\n 'copy': '复制',\n 'copied': '已复制',\n 'install': '复制安装命令',\n 'noMatch': '没有匹配的社区插件。',\n 'search.placeholder': '搜索名称、作者或简介',\n 'search.label': '搜索社区插件',\n 'filter.all': '全部',\n 'result.count': '显示 {shown} / {total} 个',\n 'badge.published': 'npm 已发布',\n 'badge.source': '仓库安装',\n 'category.ui': '界面与体验',\n 'category.agent': 'Agent 与自动化',\n 'category.tools': '开发者工具',\n 'category.knowledge': '记忆与知识',\n 'category.integration': '集成与分享',\n 'category.security': '安全与运维',\n 'category.utility': '实用工具',\n 'installHint': '索引只登记、不安装代码。要运行某个插件,复制它的安装命令到终端执行;安装后,插件自带的开关与配置(若有)会出现在插件配置里。',\n 'empty': '暂无社区插件登记。',\n 'off': '社区插件索引已关闭。',\n 'notice': '条目由贡献者自行登记,与 dsh-web-ui 的发布内容无关;使用前请自行评估。',\n} satisfies Record<string, string>\n\n/** English copy for the card chrome, checked complete against the zh key set. */\nconst STATIC_EN = {\n 'settings.title': 'Community Plugins',\n 'settings.description': \"Plugins developed and maintained by community contributors, linking to each author's own repository.\",\n 'settings.enabled': 'Enable the community plugin index',\n 'settings.enabledHint': 'This switch only controls whether the index list is shown; turn it back on here.',\n 'settings.inherit': 'Inherit',\n 'settings.on': 'On',\n 'settings.off': 'Off',\n 'settings.overridden': 'Overridden',\n 'settings.reset': 'Reset to default',\n 'settings.notExposed': \"This DSH version does not expose this plugin's settings namespace to the configuration page, so the form is unavailable. Edit ~/.dsh/settings.yaml directly, or add the namespace to dsh-host-apiproxy's WEB_SETTINGS_NAMESPACES allowlist and restart.\",\n 'settings.readOnly': 'This deployment stores settings read-only.',\n 'settings.expand': 'Show settings',\n 'settings.collapse': 'Hide settings',\n 'settings.save': 'Save',\n 'settings.saving': 'Saving…',\n 'settings.discard': 'Discard',\n 'settings.unsaved': 'Unsaved',\n 'settings.saveFailed': 'The deployment did not accept these values; they were left for you to correct.',\n 'settings.invalidNumber': 'Enter a number, or leave blank to use the default.',\n 'author': 'Author',\n 'repository': 'Repository',\n 'copy': 'Copy',\n 'copied': 'Copied',\n 'install': 'Copy install command',\n 'noMatch': 'No matching community plugin found.',\n 'search.placeholder': 'Search name, author or description',\n 'search.label': 'Search community plugins',\n 'filter.all': 'All',\n 'result.count': 'Showing {shown} / {total}',\n 'badge.published': 'Published on npm',\n 'badge.source': 'Install from repo',\n 'category.ui': 'UI & Experience',\n 'category.agent': 'Agents & Automation',\n 'category.tools': 'Developer Tools',\n 'category.knowledge': 'Memory & Knowledge',\n 'category.integration': 'Integration & Sharing',\n 'category.security': 'Security & Ops',\n 'category.utility': 'Utilities',\n 'installHint': 'The index only registers entries, it never installs code. To run a plugin, copy its install command into a terminal; once installed, the plugin provides its own switch and config (if any) in the plugin configuration section.',\n 'empty': 'No community plugins registered yet.',\n 'off': 'The community plugin index is turned off.',\n 'notice': 'Entries are contributed by their authors and are separate from dsh-web-ui releases; evaluate before use.',\n} satisfies Record<keyof typeof STATIC_ZH, string>\n\n/** Build the runtime dictionary: static copy plus one localized name/description pair per index entry. */\nfunction build(base: Record<string, string>, lang: 'zh' | 'en'): Record<string, string> {\n const dict: Record<string, string> = { ...base }\n for (const entry of COMMUNITY_PLUGINS) {\n dict[`name.${entry.id}`] = lang === 'zh' ? entry.name : entry.nameEn\n dict[`desc.${entry.id}`] = lang === 'zh'\n ? (entry.description ?? entry.descriptionEn ?? '')\n : (entry.descriptionEn ?? entry.description ?? '')\n }\n return dict\n}\n\n/** Simplified Chinese dictionary for the index card (chrome + per-entry copy). */\nexport const zh = build(STATIC_ZH, 'zh')\n\n/** English dictionary, built from the same key set. */\nexport const en = build(STATIC_EN, 'en')\n\n/** Key union for this namespace (chrome keys plus per-entry name/description keys). */\nexport type CommunityPluginKey = keyof typeof zh\n","/**\n * Community plugin index, browser half. Registers the community-plugins\n * dictionaries and one section into the settings panel's first-level nav\n * (settings.section; the promoted family sections sit beside the built-in\n * general / models / plugins / agent-presets entries). The card carries its\n * own enable switch (backed by the community-plugins settings namespace) and\n * lists community plugins with links to each contributor's own repository.\n * @module @linxin666/dsh-client-ui-community-plugins/client\n */\n\nimport type { ClientContext, SettingsScope, SettingsScopeSpec } from '@deepseek-ai/dsh-client-runtime/client'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale).\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the settings-surface Context merge (ctx.settingsScope).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// Type-only: pulls the slot-surface types (the settings.section seat).\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\nimport { CommunityPluginsCardController, CommunityPluginsSection, type CommunityPluginsSettings } from './CommunityPluginsCard.tsx'\nimport { en, zh, type CommunityPluginKey } from './locales.ts'\n\nexport type { CommunityPluginsCardProps, CommunityPluginsSectionProps } from './CommunityPluginsCard.tsx'\n\n/** Settings namespace the card's enable switch edits (the Host plugin registers it). */\nconst COMMUNITY_PLUGINS_NS = 'community-plugins'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Community plugin index card copy. */\n 'community-plugins': CommunityPluginKey\n }\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n /**\n * Optional rc.6 compatibility binder provided by dsh-web-ui-settings;\n * absent when that group plugin is not installed, so callers fall back to\n * the official settings scope.\n */\n webUiSettings?: { bind<S>(spec: SettingsScopeSpec<S>): SettingsScope<S> }\n }\n}\n\n/** Required services. */\nexport const inject = ['slots', 'locale', 'connection', 'settingsScope', 'remote']\n\n/**\n * Register the community plugin index as a first-level settings section, with\n * its own enable switch over the community-plugins settings namespace.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register('community-plugins', { zh, en }), 'community-plugins: dictionaries')\n\n const binder = ctx.get('webUiSettings') ?? ctx.settingsScope\n const settingsScope = binder.bind<CommunityPluginsSettings>({ namespace: COMMUNITY_PLUGINS_NS })\n const controller = new CommunityPluginsCardController(settingsScope)\n\n ctx.slots.inject('settings.section', () => {\n const unregister = ctx.slots.register({\n name: 'settings.section',\n id: 'community-plugins',\n order: 140,\n label: () => ctx.locale.bind('community-plugins')('settings.title'),\n locale: 'community-plugins',\n inject: () => controller.inject(),\n }, CommunityPluginsSection)\n return () => {\n controller.dispose()\n unregister()\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEA,SA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7B,MAAa,SAAS;GAAC;GAAS;GAAU;GAAc;GAAiB;EAAQ;;;;;;EAOjF,SAAgB,MAAM,KAA0B;GAC9C,IAAI,aAAa,IAAI,OAAO,SAAS,qBAAqB;IAAE;IAAI;GAAG,CAAC,GAAG,iCAAiC;GAIxG,MAAM,aAAa,IAAI,gCAFR,IAAI,IAAI,eAAe,KAAK,IAAI,cAAA,CAClB,KAA+B,EAAE,WAAW,qBAAqB,CAC5B,CAAC;GAEnE,IAAI,MAAM,OAAO,0BAA0B;IACzC,MAAM,aAAa,IAAI,MAAM,SAAS;KACpC,MAAM;KACN,IAAI;KACJ,OAAO;KACP,aAAa,IAAI,OAAO,KAAK,mBAAmB,CAAC,CAAC,gBAAgB;KAClE,QAAQ;KACR,cAAc,WAAW,OAAO;IAClC,GAAG,uBAAuB;IAC1B,aAAa;KACX,WAAW,QAAQ;KACnB,WAAW;IACb;GACF,CAAC;EACH"}
package/lib/index.js CHANGED
@@ -1,5 +1,46 @@
1
1
  import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
2
2
  import z from "schemastery";
3
+ //#region src/mount-once.ts
4
+ /**
5
+ * Host single-instance guard shared by the plugin family. The family bundle
6
+ * (dsh-web-ui-all / dsh-skins) namespaces every child row id (web-ui-*), so
7
+ * the loader accepts a standalone install of the same package side by side;
8
+ * without this guard the second instance would still re-register the same
9
+ * webserver routes, tools, settings namespaces, and system-prompt sections
10
+ * and fail the boot. mountOnce makes the second host apply a no-op for the
11
+ * lifetime of the first instance (the browser half is already deduped by
12
+ * package name in the client module host).
13
+ *
14
+ * The registry rides a global symbol so two module instances of the same
15
+ * package (npm copy vs repository link) still share one verdict. cordis
16
+ * `ctx.effect` runs its callback immediately and treats the callback's
17
+ * return value as the fiber disposer, so the unmarker is returned, not run.
18
+ */
19
+ const MOUNTED = Symbol.for("dsh-web-ui.mounted-plugins");
20
+ function mountedSet() {
21
+ const registry = globalThis;
22
+ return registry[MOUNTED] ??= /* @__PURE__ */ new Set();
23
+ }
24
+ /**
25
+ * Wrap a cordis plugin apply so the package runs at most once per process.
26
+ * The first mount registers normally and unmarks when its fiber disposes;
27
+ * any later mount of the same package name is a no-op.
28
+ * @param packageName - npm package identity shared by every install source.
29
+ * @param fn - the original plugin apply.
30
+ * @returns an apply of the same shape.
31
+ */
32
+ function mountOnce(packageName, fn) {
33
+ return ((...args) => {
34
+ const mounted = mountedSet();
35
+ if (mounted.has(packageName)) return;
36
+ mounted.add(packageName);
37
+ args[0]?.effect?.(() => () => {
38
+ mounted.delete(packageName);
39
+ });
40
+ return fn(...args);
41
+ });
42
+ }
43
+ //#endregion
3
44
  //#region src/index.ts
4
45
  /** Stable cordis plugin name (matches cordis.patch.yml insert id). */
5
46
  const name = "ui-community-plugins";
@@ -19,7 +60,8 @@ const Config = z.object({ enabled: z.boolean().default(true) });
19
60
  * settings service is mounted (pure community-card installs skip it).
20
61
  * @param ctx - cordis context.
21
62
  */
22
- function apply(ctx) {
63
+ const apply = mountOnce("@linxin666/dsh-client-ui-community-plugins", applyImpl);
64
+ function applyImpl(ctx) {
23
65
  installSettingsSection(ctx, COMMUNITY_PLUGINS_SETTINGS_NAMESPACE, Config, {}, {
24
66
  setSource: () => {},
25
67
  onChange: () => {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-client-ui-community-plugins",
3
3
  "description": "Community plugin index card for the dsh web GUI settings page: lists community-contributed plugins with links to each contributor's own repository, gated by its own enable switch in the plugin configuration section.",
4
- "version": "0.1.19",
4
+ "version": "0.1.20",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {