@huanlin/dsh-plugin-aigc-canvas 0.1.6 → 0.1.7

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.md CHANGED
@@ -1,5 +1,5 @@
1
- <p align="center">
2
- <a href="https://dshfind.com/zh/plugins/huanlinoto/dsh-plugin-aigc-canvas"><img src="https://dshfind.com/api/card/huanlinoto/dsh-plugin-aigc-canvas?lang=zh" alt="dsh-plugin-aigc-canvas card"></a>
1
+ <p align="center">
2
+ <a href="https://dshfind.com/zh/plugins/huanlinoto/dsh-plugin-aigc-canvas"><img src="https://dshfind.com/api/card/huanlinoto/dsh-plugin-aigc-canvas?lang=zh" alt="dsh-plugin-aigc-canvas card"></a>
3
3
  </p>
4
4
 
5
5
  # dsh-aigc-canvas
@@ -107,16 +107,19 @@ dsh plugin --profile web add link:D:\Projects\deepseek-harness\dsh-aigc-canvas
107
107
  pnpm install # 安装开发依赖(schemastery、typescript、vitest、tsdown)
108
108
  pnpm run typecheck # tsc --noEmit 类型检查
109
109
  pnpm test # vitest run 单元测试(canvas-registry / tools / wire)
110
- pnpm run build # tsdown 构建 → lib/index.js + lib/invariant.js + lib/client.js
110
+ pnpm run build # tsdown 构建 → lib/index.js + lib/client.js
111
111
  pnpm watch # tsdown --watch(client bundle 热重建)
112
112
  ```
113
113
 
114
114
  构建产物:
115
115
  - `lib/index.js` — host 入口(cordis 插件,提供 `ctx.aigcCanvas` 服务 + 路由 + 工具)
116
- - `lib/invariant.js` — 包级 invariant 伴生
117
116
  - `lib/client.js` — 浏览器 bundle(`window.__ModuleLoader__.load` 闭包工厂,id = `@dsh-external/dsh-aigc-canvas`)
118
117
  - `lib/index.d.ts` 等 — TypeScript 声明(由 `tsc -p tsconfig.json` 产出,不在 tsdown 流程内)
119
118
 
119
+ > **不发布 `./invariant`**:本插件无独立可分歧的运行时观察(路由全部处于 host webServer
120
+ > 信任围栏之下,元素表由 smoke spec 覆盖,client 视图是 host 状态的纯投影),按 DSH
121
+ > v0.1.2-rc.1 收紧后的 invariant 规则不再发布空 invariant 伴生,在此记录原因。
122
+
120
123
  ## 目录结构
121
124
 
122
125
  ```
@@ -125,7 +128,6 @@ dsh-aigc-canvas/
125
128
  │ ├── index.ts # host 入口:apply + /aigc-canvas/api + /aigc-canvas/file + WS
126
129
  │ ├── config.ts # Schemastery Config schema + resolveAigcConfig
127
130
  │ ├── context-types.ts # cordis Context augmentation(结构化镜像)
128
- │ ├── invariant.ts # 包级 invariant 伴生
129
131
  │ ├── wire.ts # HTTP helpers + AigcError
130
132
  │ ├── trust-fence.ts # Host 头信任围栏(从 better-sidebar 拷贝)
131
133
  │ ├── canvas-registry.ts # 元素表 + 边 + 持久化(host-owned state)
@@ -184,7 +186,7 @@ dsh-aigc-canvas/
184
186
  按 DSH 官方插件规范组织(参考 [dsh-external/turtle-ui](https://github.com/dsh-external/turtle-ui) 与 `plugin-development-guide.md`):
185
187
 
186
188
  - **插件形态**: `export const name / inject / Config / apply`,无 default 导出
187
- - **清单**: `types` + `exports`(`.` / `./invariant` / `./client` / `./client/service` / `./package.json`)、`dsh.bundle.patch`、`peerDependencies`、`engines`、`files` 产物明细、`prepare`(消费者侧 `tsdown`,git 安装可用)
188
- - **client 契约**: 仅导出 `apply`/`inject`(+ 类型);store 为 `CanvasStore` 工厂,实例归 `apply` 所有;`src/invariant.ts` 伴生;client bundle 复刻官方 preset(externals = 平台模块表 + runtime/client 豁免、纯度门、CSS Modules 内联)
189
+ - **清单**: `types` + `exports`(`.` / `./client` / `./client/service` / `./package.json`)、`dsh.bundle.patch`、`peerDependencies`、`engines`、`files` 产物明细、`prepare`(消费者侧 `tsdown`,git 安装可用)
190
+ - **client 契约**: 仅导出 `apply`/`inject`(+ 类型);store 为 `CanvasStore` 工厂,实例归 `apply` 所有;client bundle 复刻官方 preset(externals = 平台模块表 + runtime/client 豁免、纯度门、CSS Modules 内联)
189
191
  - **预构建 `lib/` 入库**: 含 `@deepseek-ai/*` private peer,必须预构建;`lib/` 不进 `.gitignore`;`github:` 安装开箱即用
190
192
  - **零源码 patch**: 未修改 DSH checkout 任何文件
package/lib/client.js CHANGED
@@ -1315,6 +1315,7 @@ window.__ModuleLoader__.load({
1315
1315
  setConfirmDelete(void 0);
1316
1316
  },
1317
1317
  title: t("row.deleteConfirm"),
1318
+ closeLabel: t("row.close"),
1318
1319
  footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1319
1320
  type: "button",
1320
1321
  className: SettingsPage_module_css_default.secondaryButton,
@@ -1649,6 +1650,7 @@ window.__ModuleLoader__.load({
1649
1650
  "row.collapse": "收起",
1650
1651
  "row.create": "创建",
1651
1652
  "row.cancel": "取消",
1653
+ "row.close": "关闭",
1652
1654
  "row.init": "初始化",
1653
1655
  "row.initPrompt": "请帮我初始化 AIGC 供应商「{name}」(id: {id}):先用 aigc_get_provider_info 查看配置,再用 aigc_http_request 探测它的 API(apiKey 会自动附加,无需手动传入),最后调用 aigc_provider_set_instructions 把调用说明保存下来,方便以后直接使用。",
1654
1656
  "row.auth": "鉴权方式",
@@ -1720,6 +1722,7 @@ window.__ModuleLoader__.load({
1720
1722
  "row.collapse": "Collapse",
1721
1723
  "row.create": "Create",
1722
1724
  "row.cancel": "Cancel",
1725
+ "row.close": "Close",
1723
1726
  "row.init": "Initialize",
1724
1727
  "row.initPrompt": "Please initialize the AIGC provider \"{name}\" (id: {id}): first call aigc_get_provider_info to see its config, then probe its API with aigc_http_request (the apiKey is attached automatically — do not pass it yourself), and finally call aigc_provider_set_instructions to save the usage instructions so it can be used directly later.",
1725
1728
  "row.auth": "Auth scheme",
@@ -1757,6 +1760,7 @@ window.__ModuleLoader__.load({
1757
1760
  zoomIn: "拡大",
1758
1761
  zoomOut: "縮小",
1759
1762
  detailClose: "閉じる",
1763
+ "row.close": "閉じる",
1760
1764
  detailPrompt: "プロンプト",
1761
1765
  detailParams: "生成パラメータ",
1762
1766
  detailPosition: "位置",
@@ -1828,6 +1832,7 @@ window.__ModuleLoader__.load({
1828
1832
  zoomIn: "Vergrößern",
1829
1833
  zoomOut: "Verkleinern",
1830
1834
  detailClose: "Schließen",
1835
+ "row.close": "Schließen",
1831
1836
  detailPrompt: "Prompt",
1832
1837
  detailParams: "Generierungsparameter",
1833
1838
  detailPosition: "Position",
@@ -1899,6 +1904,7 @@ window.__ModuleLoader__.load({
1899
1904
  zoomIn: "Agrandir",
1900
1905
  zoomOut: "Réduire",
1901
1906
  detailClose: "Fermer",
1907
+ "row.close": "Fermer",
1902
1908
  detailPrompt: "Invite",
1903
1909
  detailParams: "Paramètres de génération",
1904
1910
  detailPosition: "Position",
@@ -1970,6 +1976,7 @@ window.__ModuleLoader__.load({
1970
1976
  zoomIn: "Ampliar",
1971
1977
  zoomOut: "Reduzir",
1972
1978
  detailClose: "Fechar",
1979
+ "row.close": "Fechar",
1973
1980
  detailPrompt: "Prompt",
1974
1981
  detailParams: "Parâmetros de geração",
1975
1982
  detailPosition: "Posição",
@@ -2041,6 +2048,7 @@ window.__ModuleLoader__.load({
2041
2048
  zoomIn: "확대",
2042
2049
  zoomOut: "축소",
2043
2050
  detailClose: "닫기",
2051
+ "row.close": "닫기",
2044
2052
  detailPrompt: "프롬프트",
2045
2053
  detailParams: "생성 매개변수",
2046
2054
  detailPosition: "위치",
@@ -2112,6 +2120,7 @@ window.__ModuleLoader__.load({
2112
2120
  zoomIn: "تكبير",
2113
2121
  zoomOut: "تصغير",
2114
2122
  detailClose: "إغلاق",
2123
+ "row.close": "إغلاق",
2115
2124
  detailPrompt: "الموجّه",
2116
2125
  detailParams: "معلمات التوليد",
2117
2126
  detailPosition: "الموضع",
@@ -2183,6 +2192,7 @@ window.__ModuleLoader__.load({
2183
2192
  zoomIn: "ज़ूम इन",
2184
2193
  zoomOut: "ज़ूम आउट",
2185
2194
  detailClose: "बंद करें",
2195
+ "row.close": "बंद करें",
2186
2196
  detailPrompt: "प्रॉम्प्ट",
2187
2197
  detailParams: "जनरेशन पैरामीटर",
2188
2198
  detailPosition: "स्थिति",
@@ -2254,6 +2264,7 @@ window.__ModuleLoader__.load({
2254
2264
  zoomIn: "Perbesar",
2255
2265
  zoomOut: "Perkecil",
2256
2266
  detailClose: "Tutup",
2267
+ "row.close": "Tutup",
2257
2268
  detailPrompt: "Prompt",
2258
2269
  detailParams: "Parameter pembuatan",
2259
2270
  detailPosition: "Posisi",
@@ -2325,6 +2336,7 @@ window.__ModuleLoader__.load({
2325
2336
  zoomIn: "Yakınlaştır",
2326
2337
  zoomOut: "Uzaklaştır",
2327
2338
  detailClose: "Kapat",
2339
+ "row.close": "Kapat",
2328
2340
  detailPrompt: "İstek",
2329
2341
  detailParams: "Üretim parametreleri",
2330
2342
  detailPosition: "Konum",
@@ -2396,6 +2408,7 @@ window.__ModuleLoader__.load({
2396
2408
  zoomIn: "Phóng to",
2397
2409
  zoomOut: "Thu nhỏ",
2398
2410
  detailClose: "Đóng",
2411
+ "row.close": "Đóng",
2399
2412
  detailPrompt: "Lời nhắc",
2400
2413
  detailParams: "Tham số tạo",
2401
2414
  detailPosition: "Vị trí",
@@ -2467,6 +2480,7 @@ window.__ModuleLoader__.load({
2467
2480
  zoomIn: "ซูมเข้า",
2468
2481
  zoomOut: "ซูมออก",
2469
2482
  detailClose: "ปิด",
2483
+ "row.close": "ปิด",
2470
2484
  detailPrompt: "พรอมต์",
2471
2485
  detailParams: "พารามิเตอร์การสร้าง",
2472
2486
  detailPosition: "ตำแหน่ง",
@@ -2538,6 +2552,7 @@ window.__ModuleLoader__.load({
2538
2552
  zoomIn: "Увеличить",
2539
2553
  zoomOut: "Уменьшить",
2540
2554
  detailClose: "Закрыть",
2555
+ "row.close": "Закрыть",
2541
2556
  detailPrompt: "Промпт",
2542
2557
  detailParams: "Параметры генерации",
2543
2558
  detailPosition: "Положение",
@@ -2609,6 +2624,7 @@ window.__ModuleLoader__.load({
2609
2624
  zoomIn: "Ingrandisci",
2610
2625
  zoomOut: "Riduci",
2611
2626
  detailClose: "Chiudi",
2627
+ "row.close": "Chiudi",
2612
2628
  detailPrompt: "Prompt",
2613
2629
  detailParams: "Parametri di generazione",
2614
2630
  detailPosition: "Posizione",
@@ -2680,6 +2696,7 @@ window.__ModuleLoader__.load({
2680
2696
  zoomIn: "Inzoomen",
2681
2697
  zoomOut: "Uitzoomen",
2682
2698
  detailClose: "Sluiten",
2699
+ "row.close": "Sluiten",
2683
2700
  detailPrompt: "Prompt",
2684
2701
  detailParams: "Generatieparameters",
2685
2702
  detailPosition: "Positie",
@@ -2751,6 +2768,7 @@ window.__ModuleLoader__.load({
2751
2768
  zoomIn: "Zooma in",
2752
2769
  zoomOut: "Zooma ut",
2753
2770
  detailClose: "Stäng",
2771
+ "row.close": "Stäng",
2754
2772
  detailPrompt: "Prompt",
2755
2773
  detailParams: "Genereringsparametrar",
2756
2774
  detailPosition: "Position",
@@ -2822,6 +2840,7 @@ window.__ModuleLoader__.load({
2822
2840
  zoomIn: "Powiększ",
2823
2841
  zoomOut: "Pomniejsz",
2824
2842
  detailClose: "Zamknij",
2843
+ "row.close": "Zamknij",
2825
2844
  detailPrompt: "Komunikat",
2826
2845
  detailParams: "Parametry generowania",
2827
2846
  detailPosition: "Pozycja",
@@ -2893,6 +2912,7 @@ window.__ModuleLoader__.load({
2893
2912
  zoomIn: "放大",
2894
2913
  zoomOut: "縮小",
2895
2914
  detailClose: "關閉",
2915
+ "row.close": "關閉",
2896
2916
  detailPrompt: "提示詞",
2897
2917
  detailParams: "產生參數",
2898
2918
  detailPosition: "位置",
@@ -2964,6 +2984,7 @@ window.__ModuleLoader__.load({
2964
2984
  zoomIn: "放大",
2965
2985
  zoomOut: "縮小",
2966
2986
  detailClose: "關閉",
2987
+ "row.close": "關閉",
2967
2988
  detailPrompt: "提示詞",
2968
2989
  detailParams: "產生參數",
2969
2990
  detailPosition: "位置",
@@ -3035,6 +3056,7 @@ window.__ModuleLoader__.load({
3035
3056
  zoomIn: "放大",
3036
3057
  zoomOut: "縮小",
3037
3058
  detailClose: "關閉",
3059
+ "row.close": "關閉",
3038
3060
  detailPrompt: "提示詞",
3039
3061
  detailParams: "產生參數",
3040
3062
  detailPosition: "位置",