@michengai/dsh-codex-ui 1.1.49 → 2.0.0

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.
@@ -0,0 +1,17 @@
1
+ import { Context } from "@deepseek-ai/cordis";
2
+ //#region src/composer-plugin.d.ts
3
+ declare const name = "codex-ui-composer";
4
+ declare const inject: string[];
5
+ /**
6
+ * 检查 profile 的 cordis.patch.yml 中是否显式配置了 disabled: true
7
+ * 避免在 DSH 桌面端未开启 HMR 或未重启时,内存 fiber 依然错误响应 enabled: true。
8
+ */
9
+ declare function isSubPluginDisabledOnDisk(id: string, homeDir?: string, ctx?: Context): boolean;
10
+ /**
11
+ * Composer 输入框增强子组件 (Host 侧)
12
+ * 挂载时通过 webServer 暴露 /api/michengai/dsh-codex-ui/composer 端点;
13
+ * 当在 DSH 插件管理中停用此子组件时,此 fiber 被销毁或在此端点响应 enabled: false,客户端自动回退至 DSH 原生输入区。
14
+ */
15
+ declare function apply(ctx: Context): void;
16
+ //#endregion
17
+ export { apply, inject, isSubPluginDisabledOnDisk, name };
@@ -0,0 +1,41 @@
1
+ import { t as CODEX_UI_API_ENDPOINTS } from "./business-api-CSNUY-u5.mjs";
2
+ import { t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-BlLPRcE8.mjs";
3
+ //#region src/composer-plugin.ts
4
+ const name = "codex-ui-composer";
5
+ const inject = ["webServer"];
6
+ /**
7
+ * 检查 profile 的 cordis.patch.yml 中是否显式配置了 disabled: true
8
+ * 避免在 DSH 桌面端未开启 HMR 或未重启时,内存 fiber 依然错误响应 enabled: true。
9
+ */
10
+ function isSubPluginDisabledOnDisk(id, homeDir, ctx) {
11
+ return isSubPluginDisabledOnDisk$1(id, homeDir, ctx);
12
+ }
13
+ /**
14
+ * Composer 输入框增强子组件 (Host 侧)
15
+ * 挂载时通过 webServer 暴露 /api/michengai/dsh-codex-ui/composer 端点;
16
+ * 当在 DSH 插件管理中停用此子组件时,此 fiber 被销毁或在此端点响应 enabled: false,客户端自动回退至 DSH 原生输入区。
17
+ */
18
+ function apply(ctx) {
19
+ const endpoint = CODEX_UI_API_ENDPOINTS.composer;
20
+ ctx.effect(() => {
21
+ const webServer = ctx.get("webServer");
22
+ if (!webServer || typeof webServer.register !== "function") return () => {};
23
+ const dispose = webServer.register({
24
+ kind: "exact",
25
+ path: endpoint,
26
+ handler: (_request, response) => {
27
+ const disabled = isSubPluginDisabledOnDisk("codex-ui-composer", void 0, ctx);
28
+ response.writeHead(200, {
29
+ "content-type": "application/json; charset=utf-8",
30
+ "cache-control": "no-store"
31
+ });
32
+ response.end(JSON.stringify({ enabled: !disabled }));
33
+ }
34
+ });
35
+ return () => {
36
+ dispose?.();
37
+ };
38
+ }, "michengai-codex-ui: composer state");
39
+ }
40
+ //#endregion
41
+ export { apply, inject, isSubPluginDisabledOnDisk, name };