dsh-cursor-subscription 0.5.6 → 0.5.8

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/AGENTS.md CHANGED
@@ -32,6 +32,23 @@ Then ensure `dsh-cursor-subscription` is listed in the profile
32
32
  `package.json` under `dsh.profile.bundles` (the `dsh plugin add` command does
33
33
  this automatically for published packages).
34
34
 
35
+ pnpm (11+) applies a built-in 24-hour `minimumReleaseAge` supply-chain gate, so a
36
+ range such as `^0.5.0` never selects a version published within the last 24
37
+ hours. Right after a release, a plain `add` or `update` therefore falls back to
38
+ the newest release older than 24 hours — for a young package, the earliest
39
+ published version. Install the newest release by exempting this package by name
40
+ in the profile `pnpm-workspace.yaml`:
41
+
42
+ ```yaml
43
+ minimumReleaseAgeExclude:
44
+ - dsh-cursor-subscription
45
+ ```
46
+
47
+ Requesting one version explicitly (`dsh plugin --profile web add
48
+ dsh-cursor-subscription@0.5.8`) also works: pnpm then appends that single
49
+ version to the same list. Do not set `minimumReleaseAge: 0` just to install this
50
+ plugin; that drops the protection for every package in the profile.
51
+
35
52
  Update with `dsh plugin --profile web update dsh-cursor-subscription`.
36
53
  Uninstall with `dsh plugin --profile web remove dsh-cursor-subscription`.
37
54
 
@@ -44,7 +61,9 @@ dsh --profile web --dump-config
44
61
 
45
62
  Success requires:
46
63
 
47
- 1. The requested package version appears once.
64
+ 1. The requested package version appears once. A version older than the one
65
+ requested means pnpm's 24-hour release-age gate resolved the range; see
66
+ Install.
48
67
  2. `cursor-subscription` appears once in the composed config after install
49
68
  or update, and is absent after uninstall.
50
69
  3. No unrelated profile or plugin changed.
@@ -61,6 +80,14 @@ streamed reply appears in the conversation.
61
80
 
62
81
  - If the settings page reports "无法读取 Cursor 状态" the loopback RPC failed;
63
82
  confirm the plugin bundle is listed once in the composed config.
83
+ - A boot failure reading `plugin tree failed to load: failed to apply loader
84
+ entry cursor-subscription ... cannot get property "webServer" without inject`
85
+ means a plugin build that mounted its account channel through
86
+ `connection.rpc.handle` ran against a DSH whose Connection plugin no longer
87
+ declares `webServer` (for example DSH 0.1.5-rc.1). Install version 0.5.8 or
88
+ later, whose channel mount passes an owner context that declares `webServer`.
89
+ Do not fix this by adding `webServer` to the plugin's own `inject`: the failing
90
+ read happens on the providing plugin's scope and stays broken.
64
91
  - A "Cursor subscription is not signed in" error on a model call means the
65
92
  credential store is empty; the user must complete the browser login flow.
66
93
  - Cursor's Agent protocol is undocumented and changes; a transport or
package/README.md CHANGED
@@ -33,6 +33,13 @@ dsh --profile web --dump-config
33
33
 
34
34
  The installed package list should contain exactly one `dsh-cursor-subscription`, and the composed configuration should contain exactly one `cursor-subscription` entry.
35
35
 
36
+ pnpm 11 and later ship a built-in 24-hour `minimumReleaseAge` gate, so a plain `add` never selects a version published within the last 24 hours. Right after a release, install it explicitly (`dsh plugin --profile web add dsh-cursor-subscription@0.5.8`) or exempt this package by name in the profile's `pnpm-workspace.yaml`:
37
+
38
+ ```yaml
39
+ minimumReleaseAgeExclude:
40
+ - dsh-cursor-subscription
41
+ ```
42
+
36
43
  ### Local Development Installation
37
44
 
38
45
  Run the following command in the profile directory, such as `%USERPROFILE%\.dsh\profiles\web`:
@@ -68,6 +75,8 @@ If DSH is running, restart it manually after installation or an update.
68
75
  - **DSH still reports that you are signed out after sign-in:** Make sure the browser completed the entire authorization flow and redirected to the completion page. Polling waits for up to approximately 2.5 minutes.
69
76
  - **The model list is empty:** `GetUsableModels` depends on the account type. If discovery fails, the plugin uses its built-in model list, and you can still enter a model name manually.
70
77
  - **Requests return 401:** If the access token has expired and the refresh token is no longer valid, sign in again from the settings page.
78
+ - **DSH fails to start with `cannot get property "webServer" without inject`:** The installed DSH's Connection plugin does not declare `webServer`, which the older channel registration relied on. Install version 0.5.8 or later of this plugin.
79
+ - **A plain install picks an old version:** pnpm's built-in 24-hour `minimumReleaseAge` gate skips releases published within the last day. Install an explicit version or exempt this package by name; see the installation section.
71
80
  - **The server protocol changed:** Cursor's Agent protocol is unpublished. If requests fail, check for a plugin update.
72
81
 
73
82
  ## Scope and Support
package/README_zh.md CHANGED
@@ -39,6 +39,16 @@ dsh --profile web --dump-config
39
39
  安装列表中应只有一个 `dsh-cursor-subscription`,配置中应只有一个
40
40
  `cursor-subscription` 条目。
41
41
 
42
+ pnpm 11 及以后内置了 24 小时的 `minimumReleaseAge` 供应链防护:普通 `add`
43
+ 不会选择 24 小时内发布的版本。刚发布完新版本时,请显式指定版本安装
44
+ (`dsh plugin --profile web add dsh-cursor-subscription@0.5.8`),或在 profile 的
45
+ `pnpm-workspace.yaml` 里按包名豁免:
46
+
47
+ ```yaml
48
+ minimumReleaseAgeExclude:
49
+ - dsh-cursor-subscription
50
+ ```
51
+
42
52
  ### 本地开发安装
43
53
 
44
54
  在 profile 目录(如 `%USERPROFILE%\.dsh\profiles\web`)执行:
@@ -81,6 +91,11 @@ dsh plugin --profile web remove dsh-cursor-subscription # 卸载
81
91
  - **模型列表为空**:`GetUsableModels` 依赖账户类型,失败时插件会使用内置模型列表,
82
92
  仍可手动输入模型名。
83
93
  - **请求报 401**:令牌过期且 refresh token 失效时,需要在设置页重新登录。
94
+ - **DSH 启动失败并报 `cannot get property "webServer" without inject`**:当前 DSH 的
95
+ Connection 插件不再自己声明 `webServer`,旧版插件注册账户通道时依赖了它。请安装
96
+ 0.5.8 或更高版本的本插件。
97
+ - **普通安装装到的是旧版本**:pnpm 内置的 24 小时 `minimumReleaseAge` 防护会跳过
98
+ 最近一天内发布的版本。请显式指定版本安装,或按包名豁免该包;见安装章节。
84
99
  - **服务端协议变更**:Cursor 的 Agent 协议是未公开接口,若请求失败请检查插件更新。
85
100
 
86
101
  ## 边界与支持
package/lib/index.js CHANGED
@@ -124,6 +124,8 @@ export const inject = ["llm", "credentials", "connection"];
124
124
  export const PROVIDER = "cursor-subscription";
125
125
  export const CREDENTIAL_REF = credentialRef("CURSOR_SUBSCRIPTION_OAUTH");
126
126
  export const CHANNEL = "/cursor-subscription";
127
+ /** Connection registry options: accept the account channel from loopback Hosts only. */
128
+ const LOOPBACK_RPC = Object.freeze({ authority: "loopback" });
127
129
 
128
130
  export const CURSOR_BASE_URL = "https://api2.cursor.sh";
129
131
  export const CURSOR_LOGIN_URL = "https://cursor.com/loginDeepControl";
@@ -2917,9 +2919,26 @@ export function apply(ctx, config = {}) {
2917
2919
  modelsProvider: adapter,
2918
2920
  settings: settingsController,
2919
2921
  });
2920
- ctx.effect(
2921
- () => ctx.connection.rpc.handle(CHANNEL, handler, { authority: "loopback" }),
2922
- "cursor-subscription: loopback account RPC",
2923
- );
2922
+ // Mount the loopback account channel through Connection. `rpc.handle`
2923
+ // registers the channel on the Context that reads the Connection service,
2924
+ // but resolves that Context's `webServer` through the providing plugin's own
2925
+ // scope, so it only works while the Connection plugin itself declares
2926
+ // `webServer`. @deepseek-ai/dsh-client-connection 0.1.5-rc.1 declares
2927
+ // `credentials` alone and mounts `/api` from a nested `webServer` Context, so
2928
+ // `rpc.handle` fails the entire plugin tree with
2929
+ // `cannot get property "webServer" without inject`. Calling the same registry
2930
+ // method Connection uses internally with an explicit owner Context that
2931
+ // declares `webServer` reuses Connection's envelope, trust fence, and browser
2932
+ // authentication, and keeps the route on this plugin's fiber. Fall back to
2933
+ // the public `rpc.handle` if that registry method ever disappears.
2934
+ ctx.inject(["connection", "webServer"], (webCtx) => {
2935
+ const connection = webCtx.connection;
2936
+ webCtx.effect(() => {
2937
+ if (typeof connection.register === "function") {
2938
+ return connection.register(webCtx, CHANNEL, handler, LOOPBACK_RPC);
2939
+ }
2940
+ return connection.rpc.handle(CHANNEL, handler, LOOPBACK_RPC);
2941
+ }, "cursor-subscription: loopback account RPC");
2942
+ });
2924
2943
  }
2925
2944
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cursor-subscription",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "packageManager": "pnpm@11.19.0",
5
5
  "description": "Cursor subscription for DeepSeek Harness with browser login, token refresh, model discovery, and the Cursor Agent chat protocol",
6
6
  "type": "module",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@deepseek-ai/cordis": "4.0.1",
68
- "@deepseek-ai/dsh-client-connection": "0.1.0-rc.6",
68
+ "@deepseek-ai/dsh-client-connection": ">=0.1.0-rc.6 <0.2.0",
69
69
  "@deepseek-ai/dsh-client-locale": "0.1.0-rc.6",
70
70
  "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.6",
71
71
  "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.6",