@michengai/dsh-codex-ui 0.2.87 → 0.2.88

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/CHANGELOG.md CHANGED
@@ -4,6 +4,24 @@
4
4
 
5
5
  This changelog records recent releases of DSH Codex UI and its one-click installer. Earlier changes remain available in the [Git history](https://github.com/MichengAI/dsh-codex-ui/commits/main).
6
6
 
7
+ ## 0.2.88 — 2026-08-26
8
+
9
+ Companion release: `@michengai/dsh-codex-suite-installer@0.1.5`.
10
+
11
+ ### Changed
12
+
13
+ - Replaced the lightweight **Settings → Connectors** tool list with the complete `dsh-mcp-connector` marketplace and connection manager whenever that optional external plugin is installed.
14
+ - Kept the existing **Connectors** home/sidebar action as the single entry point and suppressed the external plugin's separate launcher in both expanded and compact Codex sidebar layouts.
15
+ - Preserved the original current-session MCP tool directory as an automatic fallback when `dsh-mcp-connector` is absent or its Web UI is unavailable.
16
+
17
+ ### Compatibility
18
+
19
+ - Added a same-origin, source-validated Prompt bridge that creates or reuses a workspace session and places the selected marketplace Prompt into its draft.
20
+ - Synchronized the embedded marketplace with the DSH-selected light or dark theme without modifying the externally maintained plugin or making it a required dependency.
21
+ - Updated the lightweight installer to pin Codex UI `0.2.88`; the legacy aggregate Suite remains private and unpublished.
22
+
23
+ Published packages: [`@michengai/dsh-codex-ui@0.2.88`](https://www.npmjs.com/package/@michengai/dsh-codex-ui/v/0.2.88) and [`@michengai/dsh-codex-suite-installer@0.1.5`](https://www.npmjs.com/package/@michengai/dsh-codex-suite-installer/v/0.1.5).
24
+
7
25
  ## 0.2.87 — 2026-08-26
8
26
 
9
27
  Companion release: `@michengai/dsh-codex-suite-installer@0.1.4`.
@@ -4,6 +4,24 @@
4
4
 
5
5
  本日志记录 DSH Codex UI 及其一键安装器的最近发布;更早的变更可查看 [Git 提交历史](https://github.com/MichengAI/dsh-codex-ui/commits/main)。
6
6
 
7
+ ## 0.2.88 — 2026-08-26
8
+
9
+ 配套版本:`@michengai/dsh-codex-suite-installer@0.1.5`。
10
+
11
+ ### 调整
12
+
13
+ - 安装外部可选插件 `dsh-mcp-connector` 时,用其完整的市场与连接管理界面替换轻量的“设置 → 连接器”工具列表。
14
+ - 首页/侧边栏继续以“连接器”作为唯一入口,展开与收缩状态下均不再显示外部插件单独注入的启动入口。
15
+ - 未安装 `dsh-mcp-connector` 或其 Web UI 不可用时,自动回退到原有的当前会话 MCP 工具目录。
16
+
17
+ ### 兼容性
18
+
19
+ - 增加同源且校验消息来源的 Prompt 桥接,可创建或复用工作区会话,并把市场中的 Prompt 写入新会话草稿。
20
+ - 让内嵌市场跟随 DSH 当前选择的明暗主题;不修改外部插件,也不将其变为强制依赖。
21
+ - 轻量安装器同步固定 Codex UI `0.2.88`;旧聚合 Suite 继续保持私有且不发布。
22
+
23
+ 发布包:[`@michengai/dsh-codex-ui@0.2.88`](https://www.npmjs.com/package/@michengai/dsh-codex-ui/v/0.2.88) 与 [`@michengai/dsh-codex-suite-installer@0.1.5`](https://www.npmjs.com/package/@michengai/dsh-codex-suite-installer/v/0.1.5)。
24
+
7
25
  ## 0.2.87 — 2026-08-26
8
26
 
9
27
  配套版本:`@michengai/dsh-codex-suite-installer@0.1.4`。
package/dist/client.js CHANGED
@@ -3243,6 +3243,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
3243
3243
  .dcu-menu-icon{display:grid;place-items:center start;width:20px;height:20px}.dcu-menu-icon svg,.dcu-footer-link svg{display:block;width:16px;height:16px;color:var(--dcu-sidebar-icon)}.dcu-menu button:disabled{color:var(--dcu-sidebar-secondary);cursor:default;opacity:1}.dcu-menu button:disabled svg{color:var(--dcu-sidebar-secondary)}
3244
3244
  .dcu-extension-items{display:grid;gap:1px;margin:1px 0 4px 28px}.dcu-extension-items button{min-height:32px;color:var(--dcu-sidebar-secondary);font-size:13px;font-weight:400}
3245
3245
  .dcu-workspaces{display:flex;min-height:0;flex:1;flex-direction:column;margin-top:2px;padding-top:8px;border-top:1px solid var(--dcu-sidebar-border)}.dcu-workspaces.dcu-workspaces-tabs{padding-top:0;border-top:0}.dcu-im-tabs{display:flex;gap:16px;margin:0 8px 12px;padding:0;border-bottom:1px solid var(--dcu-sidebar-border)}.dcu-im-tab{appearance:none;border:0;background:transparent;color:var(--dcu-sidebar-secondary);padding:8px 0 7px;font:14px/22px var(--dcu-font);font-weight:500;cursor:pointer}.dcu-im-tab[data-on=true]{color:var(--dcu-sidebar-primary);font-weight:600;box-shadow:inset 0 -2px 0 currentColor}.dcu-native-workspaces{display:flex;min-height:0;flex:1}.dcu-native-workspaces>*{min-width:0;flex:1}.dcu-native-workspaces .ima-tabs,.dcu-native-workspaces [role=tablist]{display:none!important}.dcu-foot{display:grid;width:var(--dcu-sidebar-wide-width);gap:4px;padding:8px 6px 12px;border-top:1px solid var(--dcu-sidebar-border);transition:opacity 120ms ease-out,transform 160ms cubic-bezier(.16,1,.3,1)}.dcu-root.dcu-collapsing>.dcu-foot{opacity:0;transform:translateX(-4px);pointer-events:none}.dcu-footer-actions:empty,.dcu-settings-seat:empty{display:none}.dcu-settings-seat>button{width:100%;min-height:36px;padding-left:4px!important;color:var(--dcu-sidebar-navigation);font:14px/20px var(--dcu-font);font-weight:400}.dcu-compact{width:100%;align-items:flex-start;overflow:hidden;padding:10px 0 8px}.dcu-compact-nav{display:flex;flex:1;min-height:0;flex-direction:column;align-items:center;gap:2px;overflow:auto;padding:6px 0}.dcu-compact .dcu-icon{width:36px;height:36px;flex:none}.dcu-compact .dcu-foot{width:36px;margin-top:auto;margin-left:10px;padding:8px 0;border-top:0}.dcu-compact .dcu-settings-seat{width:36px;overflow:hidden}.dcu-compact .dcu-settings-seat>button{display:grid;place-items:center;width:36px;min-height:36px;padding:0!important;font-size:0!important;line-height:0}.dcu-compact .dcu-settings-seat>button svg{width:16px;height:16px}.dcu-compact .dcu-footer-link{display:flex;justify-content:center;width:36px;padding:0;font-size:0}.dcu-compact .dcu-footer-link svg{width:16px;height:16px}
3246
+ .dcu-native-workspaces{flex-direction:column}.dcu-native-workspaces>[data-mcp-connector-top-mount=true]{flex:none}.dcu-root .mcpConnectorLauncher,.dcu-root [data-mcp-connector-top-mount=true]{display:none!important}
3246
3247
  .dcu-dependency-notice{margin:0 10px 8px;border:1px solid var(--dcu-sidebar-border);border-radius:8px;padding:8px;color:var(--dcu-sidebar-secondary);font-size:12px;line-height:18px}
3247
3248
  [role="dialog"][aria-labelledby]{width:min(1000px,calc(100vw - 48px));max-width:calc(100vw - 48px);height:min(800px,calc(100vh - 48px))}
3248
3249
  .dcu-search-scrim{position:fixed;z-index:10020;inset:0;display:flex;justify-content:center;align-items:flex-start;padding:72px 20px;background:color-mix(in srgb,#000 48%,transparent);animation:dcu-search-scrim-in 140ms ease-out}.dcu-search-dialog{width:min(560px,100%);max-height:min(640px,calc(100vh - 120px));overflow:auto;border:1px solid var(--dcu-sidebar-border);border-radius:16px;padding:10px;background:var(--dsw-specific-menu);box-shadow:var(--dsw-shadow-lv4);animation:dcu-search-dialog-in 180ms cubic-bezier(.16,1,.3,1)}@keyframes dcu-search-scrim-in{from{opacity:0}to{opacity:1}}@keyframes dcu-search-dialog-in{from{opacity:0;transform:translateY(-6px) scale(.985)}to{opacity:1;transform:none}}.dcu-search-input{margin-bottom:8px}.dcu-search-section{padding:6px 0}.dcu-search-title{padding:0 8px 4px;color:var(--dcu-sidebar-tertiary);font-size:12px;font-weight:600}.dcu-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:34px;border:0;border-radius:8px;padding:6px 8px;background:transparent;color:var(--dcu-sidebar-primary);font:inherit;text-align:left;cursor:pointer}.dcu-search-row:hover,.dcu-search-row[data-active=true]{background:var(--dcu-sidebar-hover)}.dcu-search-main{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dcu-search-detail{max-width:160px;overflow:hidden;color:var(--dcu-sidebar-tertiary);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.dcu-search-empty{padding:18px 8px;color:var(--dcu-sidebar-tertiary);font-size:13px}@media (prefers-reduced-motion:reduce){.dcu-expanded-shell,.dcu-root.dcu-compact .dcu-compact-shell,.dcu-foot,.dcu-search-scrim,.dcu-search-dialog{animation:none;transition:none}}
@@ -4190,16 +4191,82 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
4190
4191
  }
4191
4192
  //#endregion
4192
4193
  //#region src/client/ConnectorsSection.tsx
4194
+ const MCP_CONNECTOR_UI = "/mcp-connector/ui/";
4195
+ const PROMPT_REQUEST_TYPE = "mcp-connector:start-session";
4196
+ const PROMPT_RESULT_TYPE = "mcp-connector:start-session-result";
4193
4197
  const stylesheet$1 = `
4194
- .dcu-connectors{color:var(--dsw-alias-label-primary)}.dcu-connectors h2{margin:0;font-size:18px}.dcu-connectors p{margin:6px 0 18px;color:var(--dsw-alias-label-secondary);font-size:12px}.dcu-connector-list{overflow:hidden;border:1px solid var(--dsw-alias-border-l2);border-radius:9px}.dcu-connector{padding:12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dcu-connector:last-child{border-bottom:0}.dcu-connector-head{display:flex;align-items:center;gap:8px;font-weight:650}.dcu-connector-meta{margin:3px 0 8px;color:var(--dsw-alias-label-tertiary);font-size:11px}.dcu-connector-tool{padding:5px 0 0 24px;color:var(--dsw-alias-label-secondary);font-size:12px}.dcu-connector-tool span{display:block;margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px}.dcu-connector-empty{padding:20px 8px;color:var(--dsw-alias-label-secondary);text-align:center}
4198
+ .dcu-connectors{color:var(--dsw-alias-label-primary)}.dcu-connectors h2{margin:0;font-size:18px}.dcu-connectors p{margin:6px 0 18px;color:var(--dsw-alias-label-secondary);font-size:12px}.dcu-connector-frame{display:block;width:100%;height:clamp(420px,calc(100vh - 160px),700px);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-base);color-scheme:light dark}.dcu-connector-list{overflow:hidden;border:1px solid var(--dsw-alias-border-l2);border-radius:9px}.dcu-connector{padding:12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dcu-connector:last-child{border-bottom:0}.dcu-connector-head{display:flex;align-items:center;gap:8px;font-weight:650}.dcu-connector-meta{margin:3px 0 8px;color:var(--dsw-alias-label-tertiary);font-size:11px}.dcu-connector-tool{padding:5px 0 0 24px;color:var(--dsw-alias-label-secondary);font-size:12px}.dcu-connector-tool span{display:block;margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px}.dcu-connector-empty{padding:20px 8px;color:var(--dsw-alias-label-secondary);text-align:center}
4195
4199
  `;
4200
+ const frameLightTheme = `:root{color-scheme:light;--bg:#f8f9fb;--card:#fff;--line:#e5e7eb;--text:#111827;--text-2:#4b5563;--muted:#9ca3af;--accent:#4f46e5;--accent-hover:#4338ca;--accent-light:#eef2ff;--ok:#059669;--ok-bg:#ecfdf5;--warn:#d97706;--warn-bg:#fffbeb;--bad:#dc2626;--bad-bg:#fef2f2;--shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.06);--shadow-lg:0 10px 25px rgba(0,0,0,.1)}`;
4201
+ const frameDarkTheme = `:root{color-scheme:dark;--bg:#111318;--card:#1b1e25;--line:#30343d;--text:#f3f4f6;--text-2:#c4c8d0;--muted:#8e96a3;--accent:#818cf8;--accent-hover:#6366f1;--accent-light:#252750;--ok:#34d399;--ok-bg:#0d3027;--warn:#fbbf24;--warn-bg:#35280b;--bad:#f87171;--bad-bg:#3b171b;--shadow:0 1px 3px rgba(0,0,0,.35);--shadow-lg:0 16px 35px rgba(0,0,0,.45)}`;
4196
4202
  function isConnector(value) {
4197
4203
  if (value === null || typeof value !== "object") return false;
4198
4204
  const item = value;
4199
4205
  return typeof item.name === "string" && Array.isArray(item.tools) && item.tools.every((tool) => tool !== null && typeof tool === "object" && typeof tool.name === "string" && typeof tool.description === "string");
4200
4206
  }
4201
- /** 设置内的 MCP 连接器目录,只暴露名称、工具数和工具说明。 */
4202
- function ConnectorsSection({ sessionStore, t }) {
4207
+ function isPromptRequest(value) {
4208
+ if (value === null || typeof value !== "object") return false;
4209
+ const item = value;
4210
+ return item.type === PROMPT_REQUEST_TYPE && typeof item.requestId === "string" && item.requestId !== "" && typeof item.prompt === "string" && item.prompt.trim() !== "";
4211
+ }
4212
+ function syncFrameTheme(frame) {
4213
+ const doc = frame?.contentDocument;
4214
+ if (doc === null || doc === void 0) return;
4215
+ let style = doc.head.querySelector("style[data-michengai-host-theme]");
4216
+ if (style === null) {
4217
+ style = doc.createElement("style");
4218
+ style.dataset.michengaiHostTheme = "true";
4219
+ doc.head.append(style);
4220
+ }
4221
+ style.textContent = document.body.hasAttribute("data-ds-dark-theme") ? frameDarkTheme : frameLightTheme;
4222
+ }
4223
+ function ConnectorMarket({ startPromptSession }) {
4224
+ const frameRef = (0, react.useRef)(null);
4225
+ (0, react.useEffect)(() => {
4226
+ const onMessage = (event) => {
4227
+ const frameWindow = frameRef.current?.contentWindow;
4228
+ if (event.origin !== window.location.origin || frameWindow === null || frameWindow === void 0 || event.source !== frameWindow) return;
4229
+ if (!isPromptRequest(event.data)) return;
4230
+ const { requestId, prompt } = event.data;
4231
+ const reply = (ok, message) => {
4232
+ frameWindow.postMessage({
4233
+ type: PROMPT_RESULT_TYPE,
4234
+ requestId,
4235
+ ok,
4236
+ message
4237
+ }, window.location.origin);
4238
+ };
4239
+ startPromptSession(prompt).then(() => {
4240
+ reply(true, "已带入新会话");
4241
+ }, (error) => {
4242
+ reply(false, error instanceof Error ? error.message : String(error));
4243
+ });
4244
+ };
4245
+ const syncTheme = () => {
4246
+ syncFrameTheme(frameRef.current);
4247
+ };
4248
+ const observer = new MutationObserver(syncTheme);
4249
+ observer.observe(document.body, {
4250
+ attributes: true,
4251
+ attributeFilter: ["data-ds-dark-theme"]
4252
+ });
4253
+ window.addEventListener("message", onMessage);
4254
+ return () => {
4255
+ observer.disconnect();
4256
+ window.removeEventListener("message", onMessage);
4257
+ };
4258
+ }, [startPromptSession]);
4259
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
4260
+ ref: frameRef,
4261
+ className: "dcu-connector-frame",
4262
+ src: MCP_CONNECTOR_UI,
4263
+ title: "MCP连接器",
4264
+ onLoad: () => {
4265
+ syncFrameTheme(frameRef.current);
4266
+ }
4267
+ });
4268
+ }
4269
+ function NativeConnectorList({ sessionStore, t }) {
4203
4270
  const sessionId = (0, react.useSyncExternalStore)(sessionStore.subscribe, () => sessionStore.getSnapshot().current);
4204
4271
  const [connectors, setConnectors] = (0, react.useState)([]);
4205
4272
  const [state, setState] = (0, react.useState)("loading");
@@ -4225,46 +4292,74 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
4225
4292
  controller.abort();
4226
4293
  };
4227
4294
  }, [sessionId]);
4295
+ if (sessionId === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4296
+ className: "dcu-connector-empty",
4297
+ children: t("connectors.openSession")
4298
+ });
4299
+ if (state === "loading") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4300
+ className: "dcu-connector-empty",
4301
+ children: t("connectors.loading")
4302
+ });
4303
+ if (state === "failed") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4304
+ className: "dcu-connector-empty",
4305
+ children: t("connectors.failed")
4306
+ });
4307
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4308
+ className: "dcu-connector-list",
4309
+ children: [connectors.map((connector) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
4310
+ className: "dcu-connector",
4311
+ children: [
4312
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4313
+ className: "dcu-connector-head",
4314
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconLinkOutline16, { size: 16 }), connector.name]
4315
+ }),
4316
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4317
+ className: "dcu-connector-meta",
4318
+ children: t("connectors.toolCount", { count: connector.tools.length })
4319
+ }),
4320
+ connector.tools.map((tool) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4321
+ className: "dcu-connector-tool",
4322
+ children: [tool.name, tool.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tool.description })]
4323
+ }, tool.name))
4324
+ ]
4325
+ }, connector.name)), connectors.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4326
+ className: "dcu-connector-empty",
4327
+ children: t("connectors.empty")
4328
+ })]
4329
+ });
4330
+ }
4331
+ /** 安装 dsh-mcp-connector 时显示完整市场,否则回退到当前会话的 MCP 工具目录。 */
4332
+ function ConnectorsSection({ sessionStore, startPromptSession, t }) {
4333
+ const [marketAvailable, setMarketAvailable] = (0, react.useState)();
4334
+ (0, react.useEffect)(() => {
4335
+ const controller = new AbortController();
4336
+ fetch(MCP_CONNECTOR_UI, {
4337
+ method: "HEAD",
4338
+ cache: "no-store",
4339
+ signal: controller.signal
4340
+ }).then((response) => {
4341
+ if (!controller.signal.aborted) setMarketAvailable(response.ok);
4342
+ }).catch(() => {
4343
+ if (!controller.signal.aborted) setMarketAvailable(false);
4344
+ });
4345
+ return () => {
4346
+ controller.abort();
4347
+ };
4348
+ }, []);
4228
4349
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4229
4350
  className: "dcu-connectors",
4230
4351
  "aria-label": t("connectors.title"),
4231
- children: [
4232
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: stylesheet$1 }),
4352
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: stylesheet$1 }), marketAvailable === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4353
+ className: "dcu-connector-empty",
4354
+ children: t("connectors.loading")
4355
+ }) : marketAvailable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConnectorMarket, { startPromptSession }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
4233
4356
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: t("connectors.title") }),
4234
4357
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("connectors.description") }),
4235
- sessionId === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4236
- className: "dcu-connector-empty",
4237
- children: t("connectors.openSession")
4238
- }) : state === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4239
- className: "dcu-connector-empty",
4240
- children: t("connectors.loading")
4241
- }) : state === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4242
- className: "dcu-connector-empty",
4243
- children: t("connectors.failed")
4244
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4245
- className: "dcu-connector-list",
4246
- children: [connectors.map((connector) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
4247
- className: "dcu-connector",
4248
- children: [
4249
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4250
- className: "dcu-connector-head",
4251
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconLinkOutline16, { size: 16 }), connector.name]
4252
- }),
4253
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4254
- className: "dcu-connector-meta",
4255
- children: t("connectors.toolCount", { count: connector.tools.length })
4256
- }),
4257
- connector.tools.map((tool) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4258
- className: "dcu-connector-tool",
4259
- children: [tool.name, tool.description !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tool.description })]
4260
- }, tool.name))
4261
- ]
4262
- }, connector.name)), connectors.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4263
- className: "dcu-connector-empty",
4264
- children: t("connectors.empty")
4265
- })]
4358
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NativeConnectorList, {
4359
+ sessionStore,
4360
+ t
4266
4361
  })
4267
- ]
4362
+ ] })]
4268
4363
  });
4269
4364
  }
4270
4365
  //#endregion
@@ -4975,7 +5070,8 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
4975
5070
  "workspaces",
4976
5071
  "layout",
4977
5072
  "locale",
4978
- "connection"
5073
+ "connection",
5074
+ "conversation"
4979
5075
  ];
4980
5076
  function hasDeleteSession(value) {
4981
5077
  return value !== null && typeof value === "object" && "deleteSession" in value && typeof value.deleteSession === "function";
@@ -5063,6 +5159,21 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
5063
5159
  const result = await registry.deleteSession(sessionId);
5064
5160
  if (!result.ok) throw new Error(result.error?.message ?? t("sessions.deleteUnavailable"));
5065
5161
  };
5162
+ const startConnectorPromptSession = async (promptText) => {
5163
+ const prompt = promptText.trim();
5164
+ if (prompt === "") throw new Error("Prompt 不能为空");
5165
+ const workspaces = ctx.workspaces.list.getSnapshot();
5166
+ const currentSessionId = ctx.sessions.list.getSnapshot().current;
5167
+ const targetWorkspaceId = (currentSessionId === void 0 ? void 0 : workspaces.items.find((workspace) => workspace.sessionIds.includes(currentSessionId))?.workspaceId) ?? workspaces.recentWorkspaceId;
5168
+ if (targetWorkspaceId === void 0) throw new Error("请先选择一个工作空间,再使用示例 Prompt");
5169
+ const sessionId = await ctx.workspaces.connectWorkspace(targetWorkspaceId);
5170
+ const conversation = ctx.get("conversation");
5171
+ if (conversation === void 0) throw new Error("DSH 对话服务尚未就绪,请稍后重试");
5172
+ const binding = ctx.sessions.binding(sessionId);
5173
+ if (binding === void 0) throw new Error("新会话尚未就绪,请稍后重试");
5174
+ conversation.input.for(binding.ctx).setDraft(prompt);
5175
+ ctx.sessions.open(sessionId);
5176
+ };
5066
5177
  ctx.slots.inject("sidebar.workspaces", () => ctx.slots.register({
5067
5178
  name: "sidebar.workspaces",
5068
5179
  priority: -1,
@@ -5106,6 +5217,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
5106
5217
  icon: "connector",
5107
5218
  inject: () => ({
5108
5219
  sessionStore: ctx.sessions.list,
5220
+ startPromptSession: startConnectorPromptSession,
5109
5221
  t
5110
5222
  })
5111
5223
  }, ConnectorsSection));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-codex-ui",
3
- "version": "0.2.87",
3
+ "version": "0.2.88",
4
4
  "description": "以 Codex 风格重构 DSH Web 侧栏的独立客户端插件",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {