@cursorpool-dev/cli 0.5.6
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/bin/cursor-pool.mjs +9 -0
- package/bin/cursor-pool.ts +169 -0
- package/node_modules/@cursor-pool/extension/dist/extension.js +2910 -0
- package/node_modules/@cursor-pool/extension/package.json +64 -0
- package/node_modules/@cursor-pool/extension/resources/cursor-pool.svg +6 -0
- package/node_modules/@cursor-pool/extension/src/api.ts +545 -0
- package/node_modules/@cursor-pool/extension/src/extension.ts +104 -0
- package/node_modules/@cursor-pool/extension/src/index.ts +1 -0
- package/node_modules/@cursor-pool/extension/src/panel.ts +569 -0
- package/node_modules/@cursor-pool/extension/src/runtime.ts +22 -0
- package/node_modules/@cursor-pool/extension/test/panel.test.ts +1785 -0
- package/node_modules/@cursor-pool/patcher/package.json +17 -0
- package/node_modules/@cursor-pool/patcher/src/alwaysLocalMarker.ts +86 -0
- package/node_modules/@cursor-pool/patcher/src/hash.ts +7 -0
- package/node_modules/@cursor-pool/patcher/src/index.ts +55 -0
- package/node_modules/@cursor-pool/patcher/src/marker.ts +159 -0
- package/node_modules/@cursor-pool/patcher/src/patchCursorAgentExec.ts +154 -0
- package/node_modules/@cursor-pool/patcher/src/patchCursorAlwaysLocal.ts +142 -0
- package/node_modules/@cursor-pool/patcher/src/patchCursorWorkbenchAuthGate.ts +140 -0
- package/node_modules/@cursor-pool/patcher/src/restoreCursorAgentExec.ts +52 -0
- package/node_modules/@cursor-pool/patcher/src/restoreCursorAlwaysLocal.ts +52 -0
- package/node_modules/@cursor-pool/patcher/src/restoreCursorWorkbenchAuthGate.ts +70 -0
- package/node_modules/@cursor-pool/patcher/src/workbenchAuthGateMarker.ts +243 -0
- package/node_modules/@cursor-pool/patcher/test/patchCursorAgentExec.test.ts +630 -0
- package/node_modules/@cursor-pool/patcher/test/patchCursorAlwaysLocal.test.ts +144 -0
- package/node_modules/@cursor-pool/patcher/test/patchCursorWorkbench.test.ts +770 -0
- package/node_modules/@cursor-pool/patcher/test/restoreCursorAgentExec.test.ts +139 -0
- package/node_modules/@cursor-pool/service/package.json +17 -0
- package/node_modules/@cursor-pool/service/src/canary.ts +61 -0
- package/node_modules/@cursor-pool/service/src/diagnostics.ts +385 -0
- package/node_modules/@cursor-pool/service/src/entry.ts +161 -0
- package/node_modules/@cursor-pool/service/src/health.ts +10 -0
- package/node_modules/@cursor-pool/service/src/index.ts +29 -0
- package/node_modules/@cursor-pool/service/src/metadata.ts +22 -0
- package/node_modules/@cursor-pool/service/src/platformSession.ts +1178 -0
- package/node_modules/@cursor-pool/service/src/requestCheck.ts +81 -0
- package/node_modules/@cursor-pool/service/src/requestGate.ts +100 -0
- package/node_modules/@cursor-pool/service/src/requestGateway.ts +441 -0
- package/node_modules/@cursor-pool/service/src/runtime.ts +48 -0
- package/node_modules/@cursor-pool/service/src/server.ts +939 -0
- package/node_modules/@cursor-pool/service/src/takeover.ts +111 -0
- package/node_modules/@cursor-pool/service/test/canary.test.ts +140 -0
- package/node_modules/@cursor-pool/service/test/diagnostics.test.ts +506 -0
- package/node_modules/@cursor-pool/service/test/metadata.test.ts +63 -0
- package/node_modules/@cursor-pool/service/test/platformSession.test.ts +2428 -0
- package/node_modules/@cursor-pool/service/test/requestCheck.test.ts +152 -0
- package/node_modules/@cursor-pool/service/test/requestGate.test.ts +207 -0
- package/node_modules/@cursor-pool/service/test/requestGateway.test.ts +466 -0
- package/node_modules/@cursor-pool/service/test/runtime.test.ts +47 -0
- package/node_modules/@cursor-pool/service/test/server.test.ts +2570 -0
- package/node_modules/@cursor-pool/shared/package.json +17 -0
- package/node_modules/@cursor-pool/shared/src/clientConfig.ts +49 -0
- package/node_modules/@cursor-pool/shared/src/index.ts +14 -0
- package/node_modules/@cursor-pool/shared/src/manifest.ts +36 -0
- package/node_modules/@cursor-pool/shared/src/metadata.ts +19 -0
- package/node_modules/@cursor-pool/shared/src/paths.ts +5 -0
- package/node_modules/@cursor-pool/shared/src/runtime.ts +3 -0
- package/node_modules/@cursor-pool/shared/test/index.test.ts +56 -0
- package/node_modules/@cursor-pool/shared/test/manifest.test.ts +65 -0
- package/node_modules/@cursor-pool/shared/test/metadata.test.ts +25 -0
- package/node_modules/@cursor-pool/shared/test/runtime.test.ts +8 -0
- package/package.json +28 -0
- package/src/adHocResign.ts +65 -0
- package/src/autostart.ts +240 -0
- package/src/compat.ts +282 -0
- package/src/confirm.ts +76 -0
- package/src/cursor.ts +94 -0
- package/src/diagnostics.ts +558 -0
- package/src/environment.ts +18 -0
- package/src/extensionBundle.ts +111 -0
- package/src/extensionLink.ts +168 -0
- package/src/index.ts +23 -0
- package/src/install.ts +614 -0
- package/src/installRecord.ts +105 -0
- package/src/launch.ts +182 -0
- package/src/patchSet.ts +182 -0
- package/src/platform.ts +132 -0
- package/src/repair.ts +383 -0
- package/src/restore.ts +153 -0
- package/src/serviceCommands.ts +79 -0
- package/src/serviceProcess.ts +188 -0
- package/src/status.ts +241 -0
- package/src/target.ts +37 -0
- package/src/trial.ts +133 -0
- package/src/uninstall.ts +213 -0
- package/test/autostart.test.ts +151 -0
- package/test/compat.test.ts +192 -0
- package/test/confirm.test.ts +114 -0
- package/test/cursor-pool-bin.test.ts +658 -0
- package/test/cursor.test.ts +20 -0
- package/test/diagnostics.test.ts +709 -0
- package/test/e2e-install.test.ts +773 -0
- package/test/extensionBundle.test.ts +161 -0
- package/test/extensionLink.test.ts +209 -0
- package/test/install.test.ts +862 -0
- package/test/installRecord.test.ts +107 -0
- package/test/launch.test.ts +138 -0
- package/test/platform.test.ts +226 -0
- package/test/repair.test.ts +575 -0
- package/test/restore.test.ts +211 -0
- package/test/serviceCommands.test.ts +135 -0
- package/test/serviceProcess.test.ts +280 -0
- package/test/status.test.ts +615 -0
- package/test/target.test.ts +49 -0
- package/test/trial.test.ts +146 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { mkdir, mkdtemp, readFile, rm, symlink } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import test from 'node:test';
|
|
6
|
+
import {
|
|
7
|
+
assertDisposableCursorAppPath,
|
|
8
|
+
deleteTrialRecord,
|
|
9
|
+
readTrialRecord,
|
|
10
|
+
trialIdForAppPath,
|
|
11
|
+
writeTrialRecord,
|
|
12
|
+
} from '../src/trial';
|
|
13
|
+
|
|
14
|
+
test('assertDisposableCursorAppPath requires an explicit app path', () => {
|
|
15
|
+
assert.throws(
|
|
16
|
+
() => assertDisposableCursorAppPath(undefined),
|
|
17
|
+
/MVP-0\.1 requires --app-path to point at a disposable Cursor\.app copy/,
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('assertDisposableCursorAppPath rejects the real macOS Cursor app', () => {
|
|
22
|
+
assert.throws(
|
|
23
|
+
() => assertDisposableCursorAppPath('/Applications/Cursor.app'),
|
|
24
|
+
/Refusing to install into real Cursor app/,
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('assertDisposableCursorAppPath rejects case and trailing slash variants of the real macOS Cursor app', () => {
|
|
29
|
+
assert.throws(
|
|
30
|
+
() => assertDisposableCursorAppPath('/applications/Cursor.app/'),
|
|
31
|
+
/Refusing to install into real Cursor app/,
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('assertDisposableCursorAppPath rejects symlinks to the real macOS Cursor app', async () => {
|
|
36
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'cursor-pool-real-app-symlink-'));
|
|
37
|
+
const symlinkPath = join(tempDir, 'Cursor-Trial.app');
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
await symlink('/Applications/Cursor.app', symlinkPath);
|
|
41
|
+
|
|
42
|
+
assert.throws(
|
|
43
|
+
() => assertDisposableCursorAppPath(symlinkPath),
|
|
44
|
+
/Refusing to install into real Cursor app/,
|
|
45
|
+
);
|
|
46
|
+
} finally {
|
|
47
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('assertDisposableCursorAppPath accepts a disposable app copy path', () => {
|
|
52
|
+
assert.equal(
|
|
53
|
+
assertDisposableCursorAppPath('/Users/example/Desktop/Cursor-Pool-Trial.app'),
|
|
54
|
+
'/Users/example/Desktop/Cursor-Pool-Trial.app',
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('assertDisposableCursorAppPath rejects non app bundle paths', () => {
|
|
59
|
+
assert.throws(
|
|
60
|
+
() => assertDisposableCursorAppPath('/Users/example/Desktop/Cursor-Pool-Trial'),
|
|
61
|
+
/must point at a \.app bundle/,
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('assertDisposableCursorAppPath accepts Linux Cursor directory paths for Linux validation', () => {
|
|
66
|
+
assert.equal(
|
|
67
|
+
assertDisposableCursorAppPath('/tmp/cursor-app/squashfs-root', { platform: 'linux' }),
|
|
68
|
+
'/tmp/cursor-app/squashfs-root',
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('trial records round-trip by app path', async () => {
|
|
73
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'cursor-pool-trial-record-'));
|
|
74
|
+
const appPath = join(tempDir, 'Cursor.app');
|
|
75
|
+
const trialRecordDir = join(tempDir, 'trials');
|
|
76
|
+
await mkdir(appPath, { recursive: true });
|
|
77
|
+
|
|
78
|
+
try {
|
|
79
|
+
const record = {
|
|
80
|
+
trialId: trialIdForAppPath(appPath),
|
|
81
|
+
appPath,
|
|
82
|
+
cursorVersion: '3.5.38',
|
|
83
|
+
cursorCommit: '009bb5a3600dd98fe1c1f25798f767f686e14750',
|
|
84
|
+
targetRelativePath: 'Contents/Resources/app/extensions/cursor-agent-exec/dist/main.js',
|
|
85
|
+
originalSha256: 'abc123',
|
|
86
|
+
compatSupportStatus: 'supported' as const,
|
|
87
|
+
runtimeFile: join(tempDir, 'runtime.json'),
|
|
88
|
+
backupDir: join(tempDir, 'backups'),
|
|
89
|
+
extensionInstallPath: join(tempDir, 'extensions/cursor-pool-status'),
|
|
90
|
+
extensionLinkedPath: join(tempDir, 'Cursor-Pool-Trial-Extensions/cursor-pool.extension-0.0.0'),
|
|
91
|
+
extensionState: 'linked' as const,
|
|
92
|
+
createdAt: '2026-05-30T00:00:00.000Z',
|
|
93
|
+
updatedAt: '2026-05-30T00:00:01.000Z',
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
await writeTrialRecord(record, { trialRecordDir });
|
|
97
|
+
|
|
98
|
+
const saved = await readTrialRecord(appPath, { trialRecordDir });
|
|
99
|
+
assert.deepEqual(saved, record);
|
|
100
|
+
assert.match(
|
|
101
|
+
await readFile(join(trialRecordDir, `${record.trialId}.json`), 'utf8'),
|
|
102
|
+
/"extensionLinkedPath": /,
|
|
103
|
+
);
|
|
104
|
+
assert.match(
|
|
105
|
+
await readFile(join(trialRecordDir, `${record.trialId}.json`), 'utf8'),
|
|
106
|
+
/"extensionState": "linked"/,
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
await deleteTrialRecord(appPath, { trialRecordDir });
|
|
110
|
+
assert.equal(await readTrialRecord(appPath, { trialRecordDir }), null);
|
|
111
|
+
} finally {
|
|
112
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test('writeTrialRecord rejects mismatched trial ids', async () => {
|
|
117
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'cursor-pool-trial-record-'));
|
|
118
|
+
const appPath = join(tempDir, 'Cursor.app');
|
|
119
|
+
const trialRecordDir = join(tempDir, 'trials');
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
await assert.rejects(
|
|
123
|
+
writeTrialRecord(
|
|
124
|
+
{
|
|
125
|
+
trialId: 'not-the-app-path-id',
|
|
126
|
+
appPath,
|
|
127
|
+
cursorVersion: '3.5.38',
|
|
128
|
+
cursorCommit: '009bb5a3600dd98fe1c1f25798f767f686e14750',
|
|
129
|
+
targetRelativePath: 'Contents/Resources/app/extensions/cursor-agent-exec/dist/main.js',
|
|
130
|
+
originalSha256: 'abc123',
|
|
131
|
+
compatSupportStatus: 'supported' as const,
|
|
132
|
+
runtimeFile: join(tempDir, 'runtime.json'),
|
|
133
|
+
backupDir: join(tempDir, 'backups'),
|
|
134
|
+
extensionInstallPath: join(tempDir, 'extensions/cursor-pool-status'),
|
|
135
|
+
extensionState: 'bundled' as const,
|
|
136
|
+
createdAt: '2026-05-30T00:00:00.000Z',
|
|
137
|
+
updatedAt: '2026-05-30T00:00:01.000Z',
|
|
138
|
+
},
|
|
139
|
+
{ trialRecordDir },
|
|
140
|
+
),
|
|
141
|
+
/Trial record id does not match app path/,
|
|
142
|
+
);
|
|
143
|
+
} finally {
|
|
144
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
145
|
+
}
|
|
146
|
+
});
|