@huanlin/dsh-plugin-copilot 0.2.0 → 0.2.1

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
@@ -68,10 +68,10 @@ Host gateway (src/gateway.ts, ctx.webServer)
68
68
  pnpm install
69
69
  pnpm run typecheck # tsc --noEmit(类型经 ~/.dsh/source/current 解析)
70
70
  pnpm test # vitest run(48 个用例:status join / gateway / 控制器 / 卡片渲染)
71
- pnpm run build # tsdown(lib/index.js + lib/invariant.js + lib/client.js)+ tsc 声明
71
+ pnpm run build # tsdown(lib/index.js + lib/client.js)+ tsc 声明
72
72
  ```
73
73
 
74
- 目录:`src/index.ts`(host 入口:命名空间注册 + gateway + 工具)· `src/status.ts`(状态 join 与 flow 探查)· `src/gateway.ts`(/copilot/api 路由与登录状态机)· `src/tools.ts`(copilot_status 工具)· `src/invariant.ts`(不变量伴生)· `src/client/`(浏览器半:卡片 + 控制器 + 词典)。
74
+ 目录:`src/index.ts`(host 入口:命名空间注册 + gateway + 工具)· `src/status.ts`(状态 join 与 flow 探查)· `src/gateway.ts`(/copilot/api 路由与登录状态机)· `src/tools.ts`(copilot_status 工具)· `src/client/`(浏览器半:卡片 + 控制器 + 词典)。
75
75
 
76
76
  设计依据见 `docs/plans/2026-08-28-webui-copilot-auth-design.md`。
77
77
 
package/lib/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import { settingsNamespace } from "@deepseek-ai/dsh-settings";
2
1
  import z from "schemastery";
3
2
  import { AuthorizationDeclinedError } from "@deepseek-ai/dsh-authorization";
4
3
  import { credentialKey } from "@deepseek-ai/dsh-credentials";
@@ -471,7 +470,7 @@ const inject = ["tools", "webServer"];
471
470
  * The plugin's own settings namespace: the card owns no configurable fields,
472
471
  * but the flow's enterprise question is answered from here.
473
472
  */
474
- const CARD_NAMESPACE = settingsNamespace("dsh-plugin-copilot");
473
+ const CARD_NAMESPACE = "dsh-plugin-copilot";
475
474
  const Config = z.object({ enterpriseDomain: z.string().default("").description("GitHub Enterprise domain (e.g. company.ghe.com); blank serves github.com") });
476
475
  /** The pi-ai settings namespace as a branded settings-namespace value. */
477
476
  const PI_AI_NS = COPILOT_SETTINGS_NS;
@@ -20,7 +20,7 @@
20
20
  * @module @huanlin/dsh-plugin-copilot
21
21
  */
22
22
  import type { Context } from '@deepseek-ai/cordis';
23
- import { type SettingsNamespace } from '@deepseek-ai/dsh-settings';
23
+ import type { SettingsNamespace } from '@deepseek-ai/dsh-settings';
24
24
  import z from 'schemastery';
25
25
  export { registerCopilotGateway } from './gateway.ts';
26
26
  export { registerCopilotTools } from './tools.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huanlin/dsh-plugin-copilot",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -17,10 +17,6 @@
17
17
  "types": "./lib/types/index.d.ts",
18
18
  "import": "./lib/index.js"
19
19
  },
20
- "./invariant": {
21
- "types": "./lib/types/invariant.d.ts",
22
- "import": "./lib/invariant.js"
23
- },
24
20
  "./client": {
25
21
  "types": "./lib/types/client/index.d.ts",
26
22
  "default": "./lib/client.js"
@@ -47,24 +43,17 @@
47
43
  "platform": "web"
48
44
  }
49
45
  },
50
- "scripts": {
51
- "typecheck": "tsc --noEmit -p tsconfig.json",
52
- "test": "vitest run",
53
- "build": "tsdown -c tsdown.config.ts && tsc -p tsconfig.json",
54
- "bundle:client": "tsdown -c tsdown.config.ts"
55
- },
56
46
  "peerDependencies": {
57
47
  "@deepseek-ai/cordis": "^4.0.1",
58
- "@deepseek-ai/dsh-authorization": "^0.1.2-alpha.1",
59
- "@deepseek-ai/dsh-client-locale": "^0.1.2-alpha.1",
60
- "@deepseek-ai/dsh-client-store": "^0.1.2-alpha.1",
61
- "@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-alpha.1",
62
- "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.2-alpha.1",
63
- "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-alpha.1",
64
- "@deepseek-ai/dsh-credentials": "^0.1.2-alpha.1",
65
- "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.1",
66
- "@deepseek-ai/dsh-settings": "^0.1.2-alpha.1",
67
- "@deepseek-ai/dsh-tools": "^0.1.2-alpha.1",
48
+ "@deepseek-ai/dsh-authorization": "^0.1.2-rc.1",
49
+ "@deepseek-ai/dsh-client-locale": "^0.1.2-rc.1",
50
+ "@deepseek-ai/dsh-client-store": "^0.1.2-rc.1",
51
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-rc.1",
52
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.2-rc.1",
53
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.2-rc.1",
54
+ "@deepseek-ai/dsh-credentials": "^0.1.2-rc.1",
55
+ "@deepseek-ai/dsh-settings": "^0.1.2-rc.1",
56
+ "@deepseek-ai/dsh-tools": "^0.1.2-rc.1",
68
57
  "react": "^18.2.0",
69
58
  "schemastery": "^3.18.0"
70
59
  },
@@ -93,9 +82,6 @@
93
82
  "@deepseek-ai/dsh-credentials": {
94
83
  "optional": true
95
84
  },
96
- "@deepseek-ai/dsh-invariants": {
97
- "optional": true
98
- },
99
85
  "@deepseek-ai/dsh-settings": {
100
86
  "optional": true
101
87
  },
@@ -122,5 +108,11 @@
122
108
  },
123
109
  "engines": {
124
110
  "node": ">=22.0.0"
111
+ },
112
+ "scripts": {
113
+ "typecheck": "tsc --noEmit -p tsconfig.json",
114
+ "test": "vitest run",
115
+ "build": "tsdown -c tsdown.config.ts && tsc -p tsconfig.json",
116
+ "bundle:client": "tsdown -c tsdown.config.ts"
125
117
  }
126
- }
118
+ }
package/lib/invariant.js DELETED
@@ -1,23 +0,0 @@
1
- //#region src/invariant.ts
2
- const PACKAGE_NAME = "@huanlin/dsh-plugin-copilot";
3
- /** Cordis companion plugin name. */
4
- const name = "dsh-plugin-copilot-invariant";
5
- /** Service required before the companion can reserve package ownership. */
6
- const inject = ["invariants"];
7
- /**
8
- * No runtime invariant: the gateway route, the settings-namespace
9
- * registration, and the `copilot_status` tool registration are cordis
10
- * effect contributions auto-disposed with the plugin fiber. The gateway's
11
- * in-flight login slot is intentionally non-durable — a dropped page just
12
- * re-polls, and a half-finished device flow holds no authority.
13
- */
14
- const install = () => {};
15
- /**
16
- * Register this package's invariant companion.
17
- * @param ctx - Cordis context carrying the invariant service.
18
- * @returns the installed registration's disposer after setup succeeds.
19
- */
20
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
21
-
22
- //#endregion
23
- export { apply, inject, name };
@@ -1,16 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@huanlin/dsh-plugin-copilot`.
3
- *
4
- * @module @huanlin/dsh-plugin-copilot/invariant
5
- */
6
- import type { Context } from '@deepseek-ai/cordis';
7
- /** Cordis companion plugin name. */
8
- export declare const name = "dsh-plugin-copilot-invariant";
9
- /** Service required before the companion can reserve package ownership. */
10
- export declare const inject: string[];
11
- /**
12
- * Register this package's invariant companion.
13
- * @param ctx - Cordis context carrying the invariant service.
14
- * @returns the installed registration's disposer after setup succeeds.
15
- */
16
- export declare const apply: (ctx: Context) => Promise<() => void>;