@cursorpool-dev/cli 0.5.8 → 0.5.10

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.
Files changed (49) hide show
  1. package/node_modules/@cursor-pool/extension/dist/extension.js +46 -116
  2. package/node_modules/@cursor-pool/extension/package.json +3 -3
  3. package/node_modules/@cursor-pool/extension/src/api.ts +2 -17
  4. package/node_modules/@cursor-pool/extension/src/panel.ts +3 -26
  5. package/node_modules/@cursor-pool/extension/test/panel.test.ts +1 -34
  6. package/node_modules/@cursor-pool/patcher/package.json +2 -2
  7. package/node_modules/@cursor-pool/patcher/src/marker.ts +72 -7
  8. package/node_modules/@cursor-pool/patcher/src/workbenchAuthGateMarker.ts +102 -19
  9. package/node_modules/@cursor-pool/patcher/test/patchCursorAgentExec.test.ts +88 -13
  10. package/node_modules/@cursor-pool/patcher/test/patchCursorWorkbench.test.ts +162 -149
  11. package/node_modules/@cursor-pool/service/package.json +2 -2
  12. package/node_modules/@cursor-pool/service/src/platformSession.ts +7 -30
  13. package/node_modules/@cursor-pool/service/src/server.ts +1 -1
  14. package/node_modules/@cursor-pool/service/test/platformSession.test.ts +4 -5
  15. package/node_modules/@cursor-pool/service/test/server.test.ts +1 -130
  16. package/node_modules/@cursor-pool/shared/package.json +1 -1
  17. package/node_modules/@cursor-pool/shared/src/manifest.ts +0 -35
  18. package/node_modules/@cursor-pool/shared/test/manifest.test.ts +9 -43
  19. package/package.json +5 -7
  20. package/src/compat.ts +201 -194
  21. package/src/cursor.ts +45 -4
  22. package/src/extensionBundle.ts +1 -1
  23. package/src/extensionLink.ts +8 -29
  24. package/src/install.ts +10 -62
  25. package/src/installRecord.ts +0 -2
  26. package/src/patchSet.ts +49 -13
  27. package/src/platform.ts +3 -3
  28. package/src/repair.ts +9 -13
  29. package/src/restore.ts +11 -12
  30. package/src/status.ts +5 -9
  31. package/src/target.ts +12 -0
  32. package/src/trial.ts +2 -3
  33. package/src/uninstall.ts +6 -2
  34. package/test/compat.test.ts +146 -192
  35. package/test/cursor.test.ts +54 -0
  36. package/test/e2e-install.test.ts +29 -46
  37. package/test/extensionLink.test.ts +26 -49
  38. package/test/install.test.ts +4 -64
  39. package/test/patchSet.test.ts +71 -0
  40. package/test/repair.test.ts +131 -1
  41. package/test/restore.test.ts +59 -3
  42. package/test/status.test.ts +0 -1
  43. package/test/target.test.ts +28 -0
  44. package/test/trial.test.ts +15 -1
  45. package/node_modules/@cursor-pool/takeover-plans/package.json +0 -12
  46. package/node_modules/@cursor-pool/takeover-plans/src/index.ts +0 -22
  47. package/node_modules/@cursor-pool/takeover-plans/src/plans.ts +0 -37
  48. package/node_modules/@cursor-pool/takeover-plans/src/types.ts +0 -9
  49. package/node_modules/@cursor-pool/takeover-plans/test/registry.test.ts +0 -23
@@ -808,6 +808,7 @@ test('local service allows Cursor workbench renderer preflight and takeover POST
808
808
  assert.equal(preflight.headers.get('access-control-allow-origin'), 'vscode-file://vscode-app');
809
809
  assert.match(preflight.headers.get('access-control-allow-methods') ?? '', /POST/);
810
810
  assert.match(preflight.headers.get('access-control-allow-headers') ?? '', /content-type/i);
811
+ assert.equal(preflight.headers.get('access-control-allow-private-network'), 'true');
811
812
 
812
813
  const response = await requestJson(service.port, '/agent/takeover', {
813
814
  method: 'POST',
@@ -829,64 +830,6 @@ test('local service allows Cursor workbench renderer preflight and takeover POST
829
830
  }
830
831
  });
831
832
 
832
- test('local service allows Cursor workbench renderer null-origin platform status reads', async () => {
833
- const tempDir = await mkdtemp(join(tmpdir(), 'cursor-pool-service-status-cors-'));
834
- const platformSessionFile = join(tempDir, 'platform-session.json');
835
- const platformApi = await createPlatformApiServer((request, response) => {
836
- if (request.method === 'GET' && request.url === '/me') {
837
- writeJson(response, 200, {
838
- user: { id: 'usr_1', email: 'dev@example.com' },
839
- device: { id: 'dev_1', status: 'active', lastHeartbeatAt: '2026-06-01T00:00:00.000Z' },
840
- });
841
- return;
842
- }
843
-
844
- writeJson(response, 404, { ok: false });
845
- });
846
- const service = await startServer({
847
- runtimeFile: join(tempDir, 'runtime.json'),
848
- platformSessionFile,
849
- platformApiBaseUrl: platformApi.apiBaseUrl,
850
- });
851
- await writeFile(
852
- platformSessionFile,
853
- `${JSON.stringify({
854
- apiBaseUrl: platformApi.apiBaseUrl,
855
- deviceToken: 'cp_dev_secret',
856
- createdAt: '2026-06-01T00:00:00.000Z',
857
- user: { id: 'usr_1', email: 'dev@example.com' },
858
- device: { id: 'dev_1', status: 'active', lastHeartbeatAt: '2026-06-01T00:00:00.000Z' },
859
- platformMode: 'active',
860
- activeProductId: 'prod_basic',
861
- platformModeStartedAt: '2026-06-01T00:05:00.000Z',
862
- routeToken: {
863
- token: 'rt_secret_value',
864
- expiresAt: '2999-06-01T00:10:00.000Z',
865
- },
866
- }, null, 2)}\n`,
867
- 'utf8',
868
- );
869
-
870
- try {
871
- const response = await requestJson(service.port, '/platform/status', {
872
- headers: { origin: 'null' },
873
- });
874
-
875
- assert.equal(response.status, 200);
876
- assert.equal(response.body.state, 'logged-in');
877
- assert.deepEqual(response.body.mode, {
878
- state: 'active',
879
- productId: 'prod_basic',
880
- startedAt: '2026-06-01T00:05:00.000Z',
881
- route: { state: 'ready', expiresAt: '2999-06-01T00:10:00.000Z' },
882
- });
883
- } finally {
884
- await service.stop();
885
- await platformApi.close();
886
- await rm(tempDir, { recursive: true, force: true });
887
- }
888
- });
889
-
890
833
  test('local service stores and returns the latest sanitized agent canary', async () => {
891
834
  const tempDir = await mkdtemp(join(tmpdir(), 'cursor-pool-service-canary-'));
892
835
  const platformSessionFile = join(tempDir, 'platform-session.json');
@@ -2564,78 +2507,6 @@ test('local service returns release reason from platform status route', async ()
2564
2507
  }
2565
2508
  });
2566
2509
 
2567
- test('local service platform status and catalog expose the same active route state', async () => {
2568
- const tempDir = await mkdtemp(join(tmpdir(), 'cursor-pool-service-unified-route-'));
2569
- const sessionFile = join(tempDir, 'session.json');
2570
- const platformApi = await createPlatformApiServer((request, response) => {
2571
- if (request.method === 'GET' && request.url === '/me') {
2572
- writeJson(response, 200, {
2573
- user: { id: 'usr_1', email: 'dev@example.com' },
2574
- device: { id: 'dev_1', status: 'active', lastHeartbeatAt: '2026-05-31T00:01:00.000Z' },
2575
- });
2576
- return;
2577
- }
2578
- if (request.method === 'GET' && request.url === '/account/summary') {
2579
- writeJson(response, 200, { credits: 1000 });
2580
- return;
2581
- }
2582
- if (request.method === 'GET' && request.url === '/products') {
2583
- writeJson(response, 200, {
2584
- products: [{
2585
- id: 'prod_basic',
2586
- name: '基础组',
2587
- description: '基础号池。',
2588
- status: 'available',
2589
- minCredits: 100,
2590
- usageLabel: '按请求消耗,倍率 1x',
2591
- }],
2592
- });
2593
- return;
2594
- }
2595
- writeJson(response, 404, { ok: false });
2596
- });
2597
- const service = await startServer({ platformSessionFile: sessionFile });
2598
- await writeFile(
2599
- sessionFile,
2600
- `${JSON.stringify({
2601
- apiBaseUrl: platformApi.apiBaseUrl,
2602
- deviceToken: 'cp_dev_secret',
2603
- createdAt: '2026-05-31T00:00:00.000Z',
2604
- user: { id: 'usr_1', email: 'dev@example.com' },
2605
- device: { id: 'dev_1', status: 'active', lastHeartbeatAt: '2026-05-31T00:00:00.000Z' },
2606
- selectedProductId: 'prod_basic',
2607
- platformMode: 'active',
2608
- activeProductId: 'prod_basic',
2609
- platformModeStartedAt: '2026-05-31T00:00:00.000Z',
2610
- routeToken: {
2611
- token: 'rt_secret_value',
2612
- expiresAt: '2999-05-31T00:10:00.000Z',
2613
- },
2614
- }, null, 2)}\n`,
2615
- 'utf8',
2616
- );
2617
-
2618
- try {
2619
- const status = await requestJson(service.port, '/platform/status');
2620
- const catalog = await requestJson(service.port, '/platform/catalog');
2621
-
2622
- assert.equal(status.status, 200);
2623
- assert.equal(catalog.status, 200);
2624
- assert.deepEqual(status.body.mode, {
2625
- state: 'active',
2626
- productId: 'prod_basic',
2627
- startedAt: '2026-05-31T00:00:00.000Z',
2628
- route: { state: 'ready', expiresAt: '2999-05-31T00:10:00.000Z' },
2629
- });
2630
- assert.deepEqual(catalog.body.mode, status.body.mode);
2631
- assert.doesNotMatch(JSON.stringify(catalog.body), /rt_secret_value|routeToken/);
2632
- } finally {
2633
- await service.stop();
2634
- await platformApi.close();
2635
- await rm(tempDir, { recursive: true, force: true });
2636
- }
2637
- });
2638
-
2639
2510
  test('startServer finds a free loopback port when the requested port is busy', async () => {
2640
2511
  const occupied = createNodeServer();
2641
2512
  await new Promise<void>((resolve) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cursor-pool/shared",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "exports": {
@@ -5,28 +5,12 @@ export type CompatibilityStatus =
5
5
  | 'blocked'
6
6
  | 'unknown';
7
7
 
8
- export interface CompatibilityPatchTarget {
9
- name: string;
10
- targetRelativePath: string;
11
- expectedSha256: string;
12
- patchStrategy: string;
13
- verifyMarker: string;
14
- }
15
-
16
8
  export interface CompatibilityManifestEntry {
17
9
  platform: string;
18
10
  arch: string;
19
- officialSourceUrl?: string;
20
- officialDownloadUrl?: string;
21
- officialDownloadPlatform?: string;
22
- verifiedCursorVersion?: string;
23
11
  cursorVersion: string;
24
12
  cursorCommit: string;
25
13
  supportStatus: CompatibilityStatus;
26
- adapterVersion?: string;
27
- takeoverPlanId: string;
28
- structureFamily?: string;
29
- patchTargets?: CompatibilityPatchTarget[];
30
14
  targetRelativePath: string;
31
15
  expectedSha256: string;
32
16
  structureSignature: string;
@@ -41,25 +25,6 @@ export interface CompatibilityManifestEntry {
41
25
  userMessage: string;
42
26
  }
43
27
 
44
- export interface ClientReleaseManifest {
45
- version: string;
46
- adapterVersion: string;
47
- revision: string;
48
- builtAt: string;
49
- releaseNotes?: string;
50
- bundledTakeoverPlans: string[];
51
- assets: Array<{
52
- platform: string;
53
- label: string;
54
- arch: string;
55
- kind: string;
56
- fileName: string;
57
- url: string;
58
- bytes: number;
59
- sha256: string;
60
- }>;
61
- }
62
-
63
28
  export type CompatibilityManifestSignatureAlgorithm = 'hmac-sha256-dev';
64
29
 
65
30
  export interface CompatibilityManifestEnvelope {
@@ -14,44 +14,22 @@ test('compatibility manifest entry captures patch compatibility metadata', () =>
14
14
  cursorVersion: '1.0.0',
15
15
  cursorCommit: 'abc123',
16
16
  supportStatus,
17
- adapterVersion: '0.5.8',
18
- takeoverPlanId: 'cursor-3.5-mac-agent-f-workbench-p-l0',
19
- structureFamily: 'mac-agent-F-workbench-p-L0',
20
- patchTargets: [
21
- {
22
- name: 'agent-exec',
23
- targetRelativePath: 'Contents/Resources/app/extensions/cursor-agent-exec/dist/main.js',
24
- expectedSha256: 'agent-sha256',
25
- patchStrategy: 'cursor-agent-exec-snippet',
26
- verifyMarker: 'cursor-pool',
27
- },
28
- {
29
- name: 'workbench',
30
- targetRelativePath: 'Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js',
31
- expectedSha256: 'workbench-sha256',
32
- patchStrategy: 'cursor-workbench-auth-gate',
33
- verifyMarker: 'cursor-pool-workbench',
34
- },
35
- ],
36
- targetRelativePath: 'Contents/Resources/app/extensions/cursor-agent-exec/dist/main.js',
17
+ targetRelativePath: 'Contents/Resources/app/out/main.js',
37
18
  expectedSha256: 'sha256',
38
19
  structureSignature: 'signature',
39
20
  patchStrategy: 'replace-marker',
40
21
  verifyMarker: 'cursor-pool',
41
22
  restoreStrategy: 'backup',
42
- minCliVersion: '0.5.8',
43
- minExtensionVersion: '0.5.8',
44
- minServiceVersion: '0.5.8',
23
+ minCliVersion: '0.5.10',
24
+ minExtensionVersion: '0.5.10',
25
+ minServiceVersion: '0.5.10',
45
26
  requiresWritableAppBundle: true,
46
27
  requiresAdHocResign: true,
47
28
  userMessage: 'Supported Cursor build.',
48
29
  };
49
30
 
50
31
  assert.equal(entry.supportStatus, 'supported');
51
- assert.equal(entry.targetRelativePath, 'Contents/Resources/app/extensions/cursor-agent-exec/dist/main.js');
52
- assert.equal(entry.adapterVersion, '0.5.8');
53
- assert.equal(entry.structureFamily, 'mac-agent-F-workbench-p-L0');
54
- assert.equal(entry.patchTargets?.[1]?.name, 'workbench');
32
+ assert.equal(entry.targetRelativePath, 'Contents/Resources/app/out/main.js');
55
33
  });
56
34
 
57
35
  test('compatibility manifest envelope captures signed rule payload', () => {
@@ -61,27 +39,15 @@ test('compatibility manifest envelope captures signed rule payload', () => {
61
39
  cursorVersion: '1.0.0',
62
40
  cursorCommit: 'abc123',
63
41
  supportStatus: 'supported',
64
- adapterVersion: '0.5.8',
65
- takeoverPlanId: 'cursor-3.5-mac-agent-f-workbench-p-l0',
66
- structureFamily: 'mac-agent-F-workbench-p-L0',
67
- patchTargets: [
68
- {
69
- name: 'agent-exec',
70
- targetRelativePath: 'Contents/Resources/app/extensions/cursor-agent-exec/dist/main.js',
71
- expectedSha256: 'agent-sha256',
72
- patchStrategy: 'cursor-agent-exec-snippet',
73
- verifyMarker: 'cursor-pool',
74
- },
75
- ],
76
- targetRelativePath: 'Contents/Resources/app/extensions/cursor-agent-exec/dist/main.js',
42
+ targetRelativePath: 'Contents/Resources/app/out/main.js',
77
43
  expectedSha256: 'sha256',
78
44
  structureSignature: 'signature',
79
45
  patchStrategy: 'replace-marker',
80
46
  verifyMarker: 'cursor-pool',
81
47
  restoreStrategy: 'backup',
82
- minCliVersion: '0.5.8',
83
- minExtensionVersion: '0.5.8',
84
- minServiceVersion: '0.5.8',
48
+ minCliVersion: '0.5.10',
49
+ minExtensionVersion: '0.5.10',
50
+ minServiceVersion: '0.5.10',
85
51
  requiresWritableAppBundle: true,
86
52
  requiresAdHocResign: false,
87
53
  userMessage: 'Supported Cursor build.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cursorpool-dev/cli",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "bin": {
@@ -12,18 +12,16 @@
12
12
  "dependencies": {
13
13
  "esbuild": "~0.28.0",
14
14
  "tsx": "^4.22.3",
15
- "@cursor-pool/extension": "0.5.8",
16
- "@cursor-pool/patcher": "0.5.8",
17
- "@cursor-pool/service": "0.5.8",
18
- "@cursor-pool/takeover-plans": "0.5.8",
19
- "@cursor-pool/shared": "0.5.8"
15
+ "@cursor-pool/extension": "0.5.10",
16
+ "@cursor-pool/service": "0.5.10",
17
+ "@cursor-pool/patcher": "0.5.10",
18
+ "@cursor-pool/shared": "0.5.10"
20
19
  },
21
20
  "bundledDependencies": [
22
21
  "@cursor-pool/extension",
23
22
  "@cursor-pool/patcher",
24
23
  "@cursor-pool/service",
25
24
  "@cursor-pool/shared",
26
- "@cursor-pool/takeover-plans",
27
25
  "esbuild",
28
26
  "tsx"
29
27
  ],