cursorconnect 0.1.10 → 0.1.11
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/bridge-runtime/connector-version.json +1 -1
- package/dist/bridge-build.js +2 -1
- package/dist/bundled-bridge-check.js +2 -3
- package/dist/diagnose.js +26 -23
- package/dist/i18n.js +50 -0
- package/dist/index.js +31 -47
- package/dist/launch.js +9 -8
- package/dist/print-pairing.js +8 -7
- package/dist/run-service.js +5 -4
- package/dist/startup-check.js +32 -23
- package/dist/version-check.js +7 -3
- package/locales/en.json +128 -0
- package/locales/ru.json +128 -0
- package/package.json +2 -1
- package/version-policy.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"cliVersion":"0.1.
|
|
1
|
+
{"cliVersion":"0.1.11","bundledAt":"2026-05-26T11:25:16Z"}
|
package/dist/bridge-build.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execSync } from 'child_process';
|
|
2
|
+
import { t } from './i18n.js';
|
|
2
3
|
import { existsSync, readdirSync, statSync } from 'fs';
|
|
3
4
|
import { join } from 'path';
|
|
4
5
|
function newestMtimeMs(dir) {
|
|
@@ -45,6 +46,6 @@ export function ensureBridgeBuilt(bridgeDir) {
|
|
|
45
46
|
return;
|
|
46
47
|
if (!isBridgeSrcNewerThanDist(bridgeDir))
|
|
47
48
|
return;
|
|
48
|
-
console.error('
|
|
49
|
+
console.error(t('bridge.rebuilding'));
|
|
49
50
|
buildBridge(bridgeDir);
|
|
50
51
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'fs';
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { resolveBridgeDir } from './bridge-dir.js';
|
|
4
|
+
import { t } from './i18n.js';
|
|
4
5
|
export function bundledBridgeHasClientVersion() {
|
|
5
6
|
let bridgeDir;
|
|
6
7
|
try {
|
|
@@ -18,8 +19,6 @@ export function bundledBridgeHasClientVersion() {
|
|
|
18
19
|
export function assertBundledBridgeSupportsRelay() {
|
|
19
20
|
if (bundledBridgeHasClientVersion())
|
|
20
21
|
return;
|
|
21
|
-
console.error('
|
|
22
|
-
' npm install -g cursorconnect@latest\n' +
|
|
23
|
-
' Если уже latest — дождитесь публикации fix или запускайте из клона: npm run bundle-bridge -w connect');
|
|
22
|
+
console.error(t('bridge.staleBundle'));
|
|
24
23
|
process.exit(1);
|
|
25
24
|
}
|
package/dist/diagnose.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { io } from 'socket.io-client';
|
|
2
2
|
import { resolveRelayConfig, DEFAULT_RELAY_URL } from './relay-config.js';
|
|
3
3
|
import { loadPairingIdentity } from './pairing-identity.js';
|
|
4
|
+
import { t } from './i18n.js';
|
|
4
5
|
function loadRelayUrl() {
|
|
5
6
|
return resolveRelayConfig().relayUrl || DEFAULT_RELAY_URL;
|
|
6
7
|
}
|
|
@@ -79,8 +80,8 @@ export async function runDiagnose() {
|
|
|
79
80
|
{
|
|
80
81
|
id: 'identity',
|
|
81
82
|
ok: false,
|
|
82
|
-
detail: '
|
|
83
|
-
hint: '
|
|
83
|
+
detail: t('diagnose.noIdentity'),
|
|
84
|
+
hint: t('diagnose.hintStart'),
|
|
84
85
|
},
|
|
85
86
|
],
|
|
86
87
|
};
|
|
@@ -95,7 +96,7 @@ export async function runDiagnose() {
|
|
|
95
96
|
id: 'relay.health',
|
|
96
97
|
ok: Boolean(j.ok),
|
|
97
98
|
detail: `ok=${j.ok} connector=${j.connector} peers=${JSON.stringify(j.peers)}`,
|
|
98
|
-
hint: j.connector ? undefined : '
|
|
99
|
+
hint: j.connector ? undefined : t('diagnose.hintStartMac'),
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
catch (e) {
|
|
@@ -103,7 +104,7 @@ export async function runDiagnose() {
|
|
|
103
104
|
id: 'relay.health',
|
|
104
105
|
ok: false,
|
|
105
106
|
detail: e.message,
|
|
106
|
-
hint: '
|
|
107
|
+
hint: t('diagnose.hintRelayUrl'),
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
// 2 Room diagnostics API
|
|
@@ -117,11 +118,11 @@ export async function runDiagnose() {
|
|
|
117
118
|
ok: ok && Boolean(j.connectorInRoom) && Boolean(j.tokenRegistered),
|
|
118
119
|
detail: JSON.stringify(j),
|
|
119
120
|
hint: !j.connectorInRoom
|
|
120
|
-
? '
|
|
121
|
+
? t('diagnose.notInRoom')
|
|
121
122
|
: !j.tokenRegistered
|
|
122
|
-
? '
|
|
123
|
+
? t('diagnose.tokenNotRegistered')
|
|
123
124
|
: !j.tokenAccepted
|
|
124
|
-
? '
|
|
125
|
+
? t('diagnose.tokenNotWhitelisted')
|
|
125
126
|
: undefined,
|
|
126
127
|
});
|
|
127
128
|
}
|
|
@@ -130,7 +131,7 @@ export async function runDiagnose() {
|
|
|
130
131
|
id: 'relay.room',
|
|
131
132
|
ok: false,
|
|
132
133
|
detail: e.message,
|
|
133
|
-
hint: '
|
|
134
|
+
hint: t('diagnose.hintDeployRelay'),
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
// 3 Local bridge
|
|
@@ -141,7 +142,7 @@ export async function runDiagnose() {
|
|
|
141
142
|
id: 'cursor-connect.local',
|
|
142
143
|
ok: Boolean(j.ok),
|
|
143
144
|
detail: `ok=${j.ok} cdp=${j.cdp}`,
|
|
144
|
-
hint: j.cdp ? undefined : '
|
|
145
|
+
hint: j.cdp ? undefined : t('diagnose.hintCdp9222'),
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
148
|
catch (e) {
|
|
@@ -149,7 +150,7 @@ export async function runDiagnose() {
|
|
|
149
150
|
id: 'cursor-connect.local',
|
|
150
151
|
ok: false,
|
|
151
152
|
detail: e.message,
|
|
152
|
-
hint: '
|
|
153
|
+
hint: t('diagnose.hintStart'),
|
|
153
154
|
});
|
|
154
155
|
}
|
|
155
156
|
// 4 Pairing code (не вызываем POST /api/pair — код одноразовый)
|
|
@@ -161,15 +162,15 @@ export async function runDiagnose() {
|
|
|
161
162
|
id: 'pair.code',
|
|
162
163
|
ok: true,
|
|
163
164
|
detail: `active ${code} (~${secLeft}s)`,
|
|
164
|
-
hint: '
|
|
165
|
+
hint: t('diagnose.hintEnterInApp'),
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
168
|
else {
|
|
168
169
|
checks.push({
|
|
169
170
|
id: 'pair.code',
|
|
170
171
|
ok: false,
|
|
171
|
-
detail: '
|
|
172
|
-
hint: '
|
|
172
|
+
detail: t('diagnose.codeExpired'),
|
|
173
|
+
hint: t('diagnose.hintStart'),
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
176
|
const auth = { token, roomId };
|
|
@@ -178,14 +179,14 @@ export async function runDiagnose() {
|
|
|
178
179
|
id: 'socket.ws+room',
|
|
179
180
|
ok: ws.ok,
|
|
180
181
|
detail: ws.detail,
|
|
181
|
-
hint: ws.ok ? undefined : '
|
|
182
|
+
hint: ws.ok ? undefined : t('diagnose.hintAppTransports'),
|
|
182
183
|
});
|
|
183
184
|
const poll = await socketProbe(relayUrl, auth, ['polling'], true);
|
|
184
185
|
checks.push({
|
|
185
186
|
id: 'socket.poll+room',
|
|
186
187
|
ok: poll.ok,
|
|
187
188
|
detail: poll.detail,
|
|
188
|
-
hint: poll.ok ? undefined : '
|
|
189
|
+
hint: poll.ok ? undefined : t('diagnose.hintPollingBlocked'),
|
|
189
190
|
});
|
|
190
191
|
const wrongRoom = await socketProbe(relayUrl, { token, roomId: 'default' }, ['websocket', 'polling'], true);
|
|
191
192
|
checks.push({
|
|
@@ -193,7 +194,7 @@ export async function runDiagnose() {
|
|
|
193
194
|
ok: !wrongRoom.ok,
|
|
194
195
|
detail: wrongRoom.detail,
|
|
195
196
|
hint: wrongRoom.ok
|
|
196
|
-
? '
|
|
197
|
+
? t('diagnose.wrongRoom')
|
|
197
198
|
: undefined,
|
|
198
199
|
});
|
|
199
200
|
const history = await historyProbe(relayUrl, auth, 'sidebar-0', 'Git repository creation and project deployment');
|
|
@@ -201,24 +202,26 @@ export async function runDiagnose() {
|
|
|
201
202
|
id: 'socket.history',
|
|
202
203
|
ok: history.ok,
|
|
203
204
|
detail: history.detail,
|
|
204
|
-
hint: history.ok ? undefined : '
|
|
205
|
+
hint: history.ok ? undefined : t('diagnose.hintHistory'),
|
|
205
206
|
});
|
|
206
207
|
return { at: new Date().toISOString(), relayUrl, roomId, checks };
|
|
207
208
|
}
|
|
208
209
|
export function formatDiagnoseReport(report) {
|
|
209
210
|
const lines = [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
t('diagnose.header', { at: report.at }),
|
|
212
|
+
t('diagnose.relay', { url: report.relayUrl }),
|
|
213
|
+
t('diagnose.room', { id: report.roomId }),
|
|
213
214
|
'',
|
|
214
215
|
];
|
|
215
216
|
for (const c of report.checks) {
|
|
216
|
-
lines.push(`${c.ok ? '
|
|
217
|
+
lines.push(`${c.ok ? t('diagnose.pass') : t('diagnose.fail')} ${c.id}`);
|
|
217
218
|
lines.push(` ${c.detail}`);
|
|
218
219
|
if (c.hint)
|
|
219
|
-
lines.push(
|
|
220
|
+
lines.push(`${t('diagnose.hintPrefix')}${c.hint}`);
|
|
220
221
|
}
|
|
221
222
|
const failed = report.checks.filter((c) => !c.ok).length;
|
|
222
|
-
lines.push('', failed === 0
|
|
223
|
+
lines.push('', failed === 0
|
|
224
|
+
? t('diagnose.allPass')
|
|
225
|
+
: t('diagnose.problems', { count: failed }));
|
|
223
226
|
return lines.join('\n');
|
|
224
227
|
}
|
package/dist/i18n.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
|
+
import { dirname, join } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const pkgRoot = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
5
|
+
function loadDict(locale) {
|
|
6
|
+
const path = join(pkgRoot, 'locales', `${locale}.json`);
|
|
7
|
+
if (!existsSync(path))
|
|
8
|
+
return {};
|
|
9
|
+
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
10
|
+
}
|
|
11
|
+
function resolveLocale() {
|
|
12
|
+
const forced = process.env.CURSORCONNECT_LANG?.trim().toLowerCase();
|
|
13
|
+
if (forced === 'ru' || forced === 'en')
|
|
14
|
+
return forced;
|
|
15
|
+
const lang = (process.env.LANG ?? process.env.LC_ALL ?? 'en').toLowerCase();
|
|
16
|
+
if (lang.startsWith('ru'))
|
|
17
|
+
return 'ru';
|
|
18
|
+
return 'en';
|
|
19
|
+
}
|
|
20
|
+
const en = loadDict('en');
|
|
21
|
+
const ru = loadDict('ru');
|
|
22
|
+
let locale = resolveLocale();
|
|
23
|
+
export function getCliLocale() {
|
|
24
|
+
return locale;
|
|
25
|
+
}
|
|
26
|
+
export function setCliLocale(next) {
|
|
27
|
+
locale = next;
|
|
28
|
+
}
|
|
29
|
+
function lookup(dict, key) {
|
|
30
|
+
const parts = key.split('.');
|
|
31
|
+
let cur = dict;
|
|
32
|
+
for (const p of parts) {
|
|
33
|
+
if (cur == null || typeof cur !== 'object')
|
|
34
|
+
return undefined;
|
|
35
|
+
cur = cur[p];
|
|
36
|
+
}
|
|
37
|
+
return typeof cur === 'string' ? cur : undefined;
|
|
38
|
+
}
|
|
39
|
+
/** English first; Russian from device or CURSORCONNECT_LANG=ru */
|
|
40
|
+
export function t(key, params) {
|
|
41
|
+
const primary = locale === 'en' ? en : ru;
|
|
42
|
+
const fallback = locale === 'en' ? ru : en;
|
|
43
|
+
let out = lookup(primary, key) ?? lookup(fallback, key) ?? key;
|
|
44
|
+
if (params) {
|
|
45
|
+
for (const [k, v] of Object.entries(params)) {
|
|
46
|
+
out = out.replaceAll(`{{${k}}}`, String(v));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -15,14 +15,13 @@ import { CLI_VERSION } from './cli-version.js';
|
|
|
15
15
|
import { askYesNo } from './ask.js';
|
|
16
16
|
import { installCursorCdpLauncher, installMacAutostart, isAutostartInstalled, uninstallMacAutostart, } from './macos-autostart.js';
|
|
17
17
|
import { runServiceLoop } from './run-service.js';
|
|
18
|
+
import { t } from './i18n.js';
|
|
18
19
|
function bridgeEnv(identity) {
|
|
19
20
|
ensureUserConfig();
|
|
20
21
|
const bridgeDotEnv = join(resolveBridgeDir(), '.env');
|
|
21
22
|
const { relayUrl, relayToken } = resolveRelayConfig([bridgeDotEnv]);
|
|
22
23
|
if (!relayToken) {
|
|
23
|
-
console.error('
|
|
24
|
-
` Переустановите: npm install -g cursorconnect\n` +
|
|
25
|
-
` Или укажите RELAY_TOKEN в ${USER_CONFIG_ENV} (свой relay).`);
|
|
24
|
+
console.error(t('start.relayTokenMissing', { path: USER_CONFIG_ENV }));
|
|
26
25
|
process.exit(1);
|
|
27
26
|
}
|
|
28
27
|
const file = {
|
|
@@ -61,15 +60,15 @@ async function cmdStart(argv) {
|
|
|
61
60
|
});
|
|
62
61
|
if (!cdpPortOk) {
|
|
63
62
|
console.error('');
|
|
64
|
-
console.error('
|
|
65
|
-
console.error(
|
|
63
|
+
console.error(t('start.cdpRequired'));
|
|
64
|
+
console.error(t('start.cdpThenRetry'));
|
|
66
65
|
console.error(' cursorconnect start');
|
|
67
66
|
console.error('');
|
|
68
67
|
printManualCdpInstructions();
|
|
69
68
|
process.exit(1);
|
|
70
69
|
}
|
|
71
70
|
if (isBridgeRunning()) {
|
|
72
|
-
console.error('
|
|
71
|
+
console.error(t('start.restartingBridge'));
|
|
73
72
|
stopBridge();
|
|
74
73
|
}
|
|
75
74
|
startBridge(env);
|
|
@@ -82,23 +81,23 @@ async function cmdStart(argv) {
|
|
|
82
81
|
process.exit(1);
|
|
83
82
|
}
|
|
84
83
|
console.log('');
|
|
85
|
-
console.log(
|
|
84
|
+
console.log(` ${t('start.checksBeforePairing')}`);
|
|
86
85
|
for (const line of formatStartupChecklist(readiness)) {
|
|
87
86
|
console.log(` ${line}`);
|
|
88
87
|
}
|
|
89
88
|
console.log('');
|
|
90
89
|
printPairingToTerminal(refreshed);
|
|
91
90
|
if (process.stdin.isTTY && !isAutostartInstalled()) {
|
|
92
|
-
const yes = await askYesNo(
|
|
91
|
+
const yes = await askYesNo(t('start.askAutostart'));
|
|
93
92
|
if (yes) {
|
|
94
93
|
installMacAutostart();
|
|
95
94
|
const cdp = installCursorCdpLauncher();
|
|
96
95
|
console.log('');
|
|
97
|
-
console.log(
|
|
98
|
-
console.log(
|
|
96
|
+
console.log(` ${t('start.autostartEnabled')}`);
|
|
97
|
+
console.log(` ${t('start.openCursorFromDock')}`);
|
|
99
98
|
console.log(` ${cdp}`);
|
|
100
|
-
console.log(
|
|
101
|
-
console.log(
|
|
99
|
+
console.log(` ${t('start.dockHint')}`);
|
|
100
|
+
console.log(` ${t('start.pairingCodeViaStatus')}`);
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
}
|
|
@@ -108,37 +107,35 @@ async function cmdRunService() {
|
|
|
108
107
|
refreshPairingCode(identity);
|
|
109
108
|
const env = bridgeEnv(identity);
|
|
110
109
|
await ensureCliVersionForRelay(env.RELAY_URL);
|
|
111
|
-
console.log('
|
|
110
|
+
console.log(t('service.starting'));
|
|
112
111
|
await runServiceLoop(env);
|
|
113
112
|
}
|
|
114
113
|
async function cmdInstallAutostart() {
|
|
115
114
|
installMacAutostart();
|
|
116
115
|
const cdp = installCursorCdpLauncher();
|
|
117
|
-
console.log('
|
|
118
|
-
console.log(
|
|
119
|
-
console.log('
|
|
116
|
+
console.log(t('autostart.enabled'));
|
|
117
|
+
console.log(t('autostart.cursorCdpPath', { path: cdp }));
|
|
118
|
+
console.log(t('autostart.codeViaStatus'));
|
|
120
119
|
}
|
|
121
120
|
async function cmdUninstallAutostart() {
|
|
122
121
|
uninstallMacAutostart();
|
|
123
|
-
console.log('
|
|
122
|
+
console.log(t('autostart.disabled'));
|
|
124
123
|
}
|
|
125
124
|
async function cmdStop() {
|
|
126
125
|
stopBridge();
|
|
127
|
-
console.log('
|
|
126
|
+
console.log(t('stop.stopped'));
|
|
128
127
|
}
|
|
129
128
|
async function cmdInit(pathArg) {
|
|
130
129
|
const target = pathArg?.trim() || process.cwd();
|
|
131
130
|
const abs = resolve(target);
|
|
132
131
|
if (!isValidBridgeDir(join(abs, 'bridge'))) {
|
|
133
|
-
console.error(
|
|
134
|
-
'Нужен клон репозитория (bridge/).\n' +
|
|
135
|
-
'После npm install -g cursorconnect команда init не нужна.');
|
|
132
|
+
console.error(t('init.notRepo', { path: abs }));
|
|
136
133
|
process.exit(1);
|
|
137
134
|
}
|
|
138
135
|
saveInstallConfig(abs);
|
|
139
|
-
console.log(
|
|
140
|
-
console.log(
|
|
141
|
-
console.log(
|
|
136
|
+
console.log(t('init.saved', { path: configFilePath() }));
|
|
137
|
+
console.log(t('init.repoRoot', { path: abs }));
|
|
138
|
+
console.log(`\n${t('init.next')}`);
|
|
142
139
|
}
|
|
143
140
|
async function cmdDiagnose() {
|
|
144
141
|
const report = await runDiagnose();
|
|
@@ -150,25 +147,27 @@ async function cmdStatus() {
|
|
|
150
147
|
const identity = loadPairingIdentity();
|
|
151
148
|
ensureUserConfig();
|
|
152
149
|
if (!identity) {
|
|
153
|
-
console.error('
|
|
150
|
+
console.error(t('status.noIdentity'));
|
|
154
151
|
process.exit(1);
|
|
155
152
|
}
|
|
156
|
-
console.log(
|
|
153
|
+
console.log(t('status.cliVersion', { version: CLI_VERSION }));
|
|
157
154
|
console.log(bundledBridgeHasClientVersion()
|
|
158
|
-
? '
|
|
159
|
-
: '
|
|
160
|
-
console.log(
|
|
155
|
+
? t('status.bundleOk')
|
|
156
|
+
: t('status.bundleStale'));
|
|
157
|
+
console.log(t('status.bridgeProcess', {
|
|
158
|
+
state: isBridgeRunning() ? t('status.bridgeRunning') : t('status.bridgeStopped'),
|
|
159
|
+
}));
|
|
161
160
|
const { relayUrl: relayUrlRaw } = resolveRelayConfig([USER_CONFIG_ENV]);
|
|
162
161
|
const relayUrl = (relayUrlRaw || DEFAULT_RELAY_URL).replace(/\/$/, '');
|
|
163
162
|
const readiness = await snapshotStartupReadiness(relayUrl, identity);
|
|
164
163
|
console.log('');
|
|
165
|
-
console.log(
|
|
164
|
+
console.log(` ${t('status.stateHeader')}`);
|
|
166
165
|
for (const line of formatStartupChecklist(readiness)) {
|
|
167
166
|
console.log(` ${line}`);
|
|
168
167
|
}
|
|
169
168
|
if (!readiness.ready) {
|
|
170
169
|
console.log('');
|
|
171
|
-
console.warn('
|
|
170
|
+
console.warn(t('status.codeMayFail'));
|
|
172
171
|
}
|
|
173
172
|
console.log('');
|
|
174
173
|
printPairingToTerminal(identity);
|
|
@@ -203,22 +202,7 @@ async function main() {
|
|
|
203
202
|
await cmdUninstallAutostart();
|
|
204
203
|
break;
|
|
205
204
|
default:
|
|
206
|
-
console.log(
|
|
207
|
-
|
|
208
|
-
start — CDP (авто-перезапуск Cursor) + Cursor Connect + код
|
|
209
|
-
start -r — то же (явный перезапуск Cursor)
|
|
210
|
-
start --no-restart-cursor — не трогать Cursor (спросит y/n в TTY)
|
|
211
|
-
stop — остановить Cursor Connect
|
|
212
|
-
status — код и статус
|
|
213
|
-
install-autostart — Mac: Cursor Connect при входе (launchd)
|
|
214
|
-
uninstall-autostart — отключить автозапуск
|
|
215
|
-
diagnose — проверка relay / Cursor Connect / socket (без гаданий)
|
|
216
|
-
init [path] — только для разработки (клон репо)
|
|
217
|
-
|
|
218
|
-
Установка (из любой папки):
|
|
219
|
-
npm install -g cursorconnect
|
|
220
|
-
cursorconnect start # первый раз: код + опционально автозапуск
|
|
221
|
-
cursorconnect install-autostart # без консоли каждый день`);
|
|
205
|
+
console.log(t('usage.body'));
|
|
222
206
|
process.exit(cmd === 'help' ? 0 : 1);
|
|
223
207
|
}
|
|
224
208
|
}
|
package/dist/launch.js
CHANGED
|
@@ -4,6 +4,7 @@ import { closeSync, existsSync, openSync, readFileSync, writeFileSync } from 'fs
|
|
|
4
4
|
import { BRIDGE_LOG_FILE, BRIDGE_PID_FILE } from './paths.js';
|
|
5
5
|
import { resolveBridgeDir } from './bridge-dir.js';
|
|
6
6
|
import { ensureBridgeBuilt } from './bridge-build.js';
|
|
7
|
+
import { t } from './i18n.js';
|
|
7
8
|
export function isBridgeRunning() {
|
|
8
9
|
if (!existsSync(BRIDGE_PID_FILE))
|
|
9
10
|
return false;
|
|
@@ -185,7 +186,7 @@ export function isCursorRunning() {
|
|
|
185
186
|
export async function quitCursor(maxWaitMs = 20_000) {
|
|
186
187
|
if (!isCursorRunning())
|
|
187
188
|
return true;
|
|
188
|
-
console.log('
|
|
189
|
+
console.log(t('cdp.quitCursor'));
|
|
189
190
|
spawnSync('osascript', ['-e', 'tell application "Cursor" to quit'], {
|
|
190
191
|
stdio: 'ignore',
|
|
191
192
|
});
|
|
@@ -195,7 +196,7 @@ export async function quitCursor(maxWaitMs = 20_000) {
|
|
|
195
196
|
if (!isCursorRunning())
|
|
196
197
|
return true;
|
|
197
198
|
}
|
|
198
|
-
console.log('
|
|
199
|
+
console.log(t('cdp.forceQuitCursor'));
|
|
199
200
|
try {
|
|
200
201
|
spawnSync('killall', ['Cursor'], { stdio: 'ignore' });
|
|
201
202
|
}
|
|
@@ -207,9 +208,9 @@ export async function quitCursor(maxWaitMs = 20_000) {
|
|
|
207
208
|
}
|
|
208
209
|
const CDP_LAUNCH_CMD = 'open -a Cursor --args --remote-debugging-port=9222';
|
|
209
210
|
export function printManualCdpInstructions() {
|
|
210
|
-
console.log(
|
|
211
|
+
console.log(`\n${t('cdp.manualTitle')}`);
|
|
211
212
|
console.log(` ${CDP_LAUNCH_CMD}`);
|
|
212
|
-
console.log(
|
|
213
|
+
console.log(` ${t('cdp.manualQuitFirst')}\n`);
|
|
213
214
|
}
|
|
214
215
|
export function launchCursorWithCdp() {
|
|
215
216
|
spawn('open', ['-a', 'Cursor', '--args', '--remote-debugging-port=9222'], {
|
|
@@ -232,7 +233,7 @@ export async function ensureCursorCdp(opts = {}) {
|
|
|
232
233
|
}
|
|
233
234
|
const running = isCursorRunning();
|
|
234
235
|
if (!running) {
|
|
235
|
-
console.log('
|
|
236
|
+
console.log(t('cdp.notRunningLaunch'));
|
|
236
237
|
launchCursorWithCdp();
|
|
237
238
|
if (await waitCdp(cdpUrl, 50))
|
|
238
239
|
return true;
|
|
@@ -244,17 +245,17 @@ export async function ensureCursorCdp(opts = {}) {
|
|
|
244
245
|
if (!shouldRestart) {
|
|
245
246
|
shouldRestart = Boolean(opts.restartCursor);
|
|
246
247
|
if (!shouldRestart && process.stdin.isTTY) {
|
|
247
|
-
shouldRestart = await askYesNo('
|
|
248
|
+
shouldRestart = await askYesNo(t('cdp.askRestart'));
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
251
|
if (!shouldRestart) {
|
|
251
252
|
printManualCdpInstructions();
|
|
252
253
|
return false;
|
|
253
254
|
}
|
|
254
|
-
console.log('
|
|
255
|
+
console.log(t('cdp.restartingWithCdp'));
|
|
255
256
|
const quitOk = await quitCursor();
|
|
256
257
|
if (!quitOk) {
|
|
257
|
-
console.warn('
|
|
258
|
+
console.warn(t('cdp.quitFailed'));
|
|
258
259
|
printManualCdpInstructions();
|
|
259
260
|
return false;
|
|
260
261
|
}
|
package/dist/print-pairing.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { renderBigCode } from './big-code.js';
|
|
2
|
+
import { t } from './i18n.js';
|
|
2
3
|
import { PAIRING_CODE_TTL_MINUTES } from './pairing-ttl.js';
|
|
3
4
|
/** Pairing code: plain ASCII (A–Z, 0–9) for app input. */
|
|
4
5
|
function pairingCodeAscii(code) {
|
|
@@ -6,23 +7,23 @@ function pairingCodeAscii(code) {
|
|
|
6
7
|
}
|
|
7
8
|
export function printPairingToTerminal(identity) {
|
|
8
9
|
const code = pairingCodeAscii(identity.pairingCode);
|
|
9
|
-
console.log('
|
|
10
|
+
console.log(t('pairing.runningInBackground'));
|
|
10
11
|
console.log('');
|
|
11
12
|
console.log('────────────────────────────────────────');
|
|
12
13
|
console.log('');
|
|
13
|
-
console.log(
|
|
14
|
+
console.log(t('pairing.computer', { name: identity.machineLabel }));
|
|
14
15
|
console.log('');
|
|
15
|
-
console.log('
|
|
16
|
+
console.log(t('pairing.enterCodeInApp'));
|
|
16
17
|
console.log('');
|
|
17
18
|
console.log(` ${code}`);
|
|
18
19
|
console.log('');
|
|
19
20
|
console.log(renderBigCode(code));
|
|
20
21
|
console.log('');
|
|
21
|
-
console.log('
|
|
22
|
-
console.log(
|
|
22
|
+
console.log(t('pairing.codeSingleUse'));
|
|
23
|
+
console.log(t('pairing.codeValidMinutes', { minutes: PAIRING_CODE_TTL_MINUTES }));
|
|
23
24
|
console.log('');
|
|
24
25
|
console.log('────────────────────────────────────────');
|
|
25
|
-
console.log(
|
|
26
|
-
console.log(
|
|
26
|
+
console.log(` ${t('pairing.stopHint')}`);
|
|
27
|
+
console.log(` ${t('pairing.consoleCanClose')}`);
|
|
27
28
|
console.log('');
|
|
28
29
|
}
|
package/dist/run-service.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ensurePairingIdentity, refreshPairingCode, } from './pairing-identity.js';
|
|
2
2
|
import { ensureCursorCdp, isBridgeRunning, startBridge, } from './launch.js';
|
|
3
3
|
import { BRIDGE_LOG_FILE } from './paths.js';
|
|
4
|
+
import { t } from './i18n.js';
|
|
4
5
|
const WATCH_MS = 8_000;
|
|
5
6
|
function sleep(ms) {
|
|
6
7
|
return new Promise((r) => setTimeout(r, ms));
|
|
@@ -15,22 +16,22 @@ export async function runServiceLoop(bridgeEnv) {
|
|
|
15
16
|
const cdpUrl = bridgeEnv.CDP_URL ?? 'http://127.0.0.1:9222';
|
|
16
17
|
const cdpOk = await ensureCursorCdp({ cdpUrl, noRestartCursor: false });
|
|
17
18
|
if (!cdpOk) {
|
|
18
|
-
console.error('
|
|
19
|
+
console.error(t('service.cdpUnavailable'));
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
try {
|
|
22
23
|
startBridge(bridgeEnv);
|
|
23
|
-
console.log(
|
|
24
|
+
console.log(t('service.bridgeStarted', { log: BRIDGE_LOG_FILE }));
|
|
24
25
|
}
|
|
25
26
|
catch (e) {
|
|
26
|
-
console.error('
|
|
27
|
+
console.error(t('service.startFailed'), e);
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
await boot();
|
|
30
31
|
for (;;) {
|
|
31
32
|
await sleep(WATCH_MS);
|
|
32
33
|
if (!isBridgeRunning()) {
|
|
33
|
-
console.error('
|
|
34
|
+
console.error(t('service.exitedRestarting'));
|
|
34
35
|
await boot();
|
|
35
36
|
}
|
|
36
37
|
}
|
package/dist/startup-check.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'fs';
|
|
2
2
|
import { BRIDGE_LOG_FILE } from './paths.js';
|
|
3
|
+
import { t } from './i18n.js';
|
|
3
4
|
import { waitBridgeHealth, waitRelayPairingReady } from './launch.js';
|
|
4
5
|
export async function fetchRelayRoomDiagnostics(relayUrl, roomId, token) {
|
|
5
6
|
const base = relayUrl.replace(/\/$/, '');
|
|
@@ -60,7 +61,6 @@ export function buildStartupReadiness(identity, local, relay, relayReachable) {
|
|
|
60
61
|
machineLabel: identity.machineLabel,
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
/** Ждём bridge + relay (комната, код на сервере, токен зарегистрирован). */
|
|
64
64
|
export async function awaitStartupReadiness(relayUrl, identity, opts) {
|
|
65
65
|
const waitMs = opts?.waitMs ?? 45_000;
|
|
66
66
|
const health = await waitBridgeHealth(Math.min(waitMs, 25_000), {
|
|
@@ -80,7 +80,6 @@ export async function awaitStartupReadiness(relayUrl, identity, opts) {
|
|
|
80
80
|
const relay = await fetchRelayRoomDiagnostics(relayUrl, identity.roomId, identity.clientToken);
|
|
81
81
|
return buildStartupReadiness(identity, { ok: health.ok, cdp: health.cdp }, relay, relayReachable);
|
|
82
82
|
}
|
|
83
|
-
/** Однократная проверка (для status). */
|
|
84
83
|
export async function snapshotStartupReadiness(relayUrl, identity) {
|
|
85
84
|
let local = { ok: false, cdp: false };
|
|
86
85
|
try {
|
|
@@ -110,62 +109,72 @@ export async function snapshotStartupReadiness(relayUrl, identity) {
|
|
|
110
109
|
}
|
|
111
110
|
export function formatStartupChecklist(r) {
|
|
112
111
|
const mark = (ok) => (ok ? '✓' : '✗');
|
|
112
|
+
const relayLabel = t('readiness.relayLine', {
|
|
113
|
+
state: r.relayReachable
|
|
114
|
+
? t('readiness.relayReachable')
|
|
115
|
+
: t('readiness.relayUnreachable'),
|
|
116
|
+
});
|
|
113
117
|
const lines = [
|
|
114
|
-
`${mark(r.localBridgeOk)}
|
|
118
|
+
`${mark(r.localBridgeOk)} ${t('readiness.localBridge')}`,
|
|
115
119
|
r.localBridgeOk
|
|
116
|
-
?
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
`${mark(r.
|
|
120
|
+
? r.localCdp
|
|
121
|
+
? t('readiness.cdpLive')
|
|
122
|
+
: t('readiness.cdpArchiveOnly')
|
|
123
|
+
: t('readiness.runStart'),
|
|
124
|
+
`${mark(r.relayReachable)} ${relayLabel}`,
|
|
125
|
+
`${mark(r.connectorInRoom)} ${t('readiness.macInRoom')}`,
|
|
126
|
+
`${mark(r.pairingCodesActive > 0)} ${t('readiness.codeOnServer')}`,
|
|
121
127
|
r.pairingCodesActive > 0
|
|
122
|
-
?
|
|
123
|
-
: '
|
|
124
|
-
`${mark(r.tokenRegistered)}
|
|
128
|
+
? t('readiness.activeCodes', { count: r.pairingCodesActive })
|
|
129
|
+
: t('readiness.codeNotRegistered'),
|
|
130
|
+
`${mark(r.tokenRegistered)} ${t('readiness.phoneToken')}`,
|
|
125
131
|
];
|
|
126
132
|
if (r.ready) {
|
|
127
|
-
lines.push('',
|
|
133
|
+
lines.push('', t('readiness.readyLine', {
|
|
134
|
+
code: r.code,
|
|
135
|
+
minutes: Math.ceil(r.codeExpiresSec / 60),
|
|
136
|
+
}));
|
|
128
137
|
}
|
|
129
138
|
return lines;
|
|
130
139
|
}
|
|
131
140
|
export function printStartupFailure(r, logPath = BRIDGE_LOG_FILE) {
|
|
132
141
|
console.error('');
|
|
133
|
-
console.error('
|
|
142
|
+
console.error(t('readiness.startupFailed'));
|
|
134
143
|
console.error('');
|
|
135
144
|
for (const line of formatStartupChecklist(r)) {
|
|
136
145
|
console.error(` ${line}`);
|
|
137
146
|
}
|
|
138
147
|
console.error('');
|
|
139
148
|
if (!r.connectorInRoom) {
|
|
140
|
-
console.error('
|
|
149
|
+
console.error(t('readiness.macNotInRoom'));
|
|
141
150
|
}
|
|
142
151
|
else if (r.pairingCodesActive === 0) {
|
|
143
|
-
console.error(
|
|
144
|
-
console.error('
|
|
152
|
+
console.error(t('readiness.codeNotOnRelay'));
|
|
153
|
+
console.error(t('readiness.doNotReuseCode'));
|
|
145
154
|
}
|
|
146
155
|
else if (!r.tokenRegistered) {
|
|
147
|
-
console.error('
|
|
156
|
+
console.error(t('readiness.tokenNotRegistered'));
|
|
148
157
|
}
|
|
149
158
|
if (!r.localCdp) {
|
|
150
|
-
console.error('
|
|
151
|
-
console.error(
|
|
152
|
-
console.error('
|
|
159
|
+
console.error(t('readiness.cdpUnavailableHint'));
|
|
160
|
+
console.error(t('readiness.cdpLaunchCmd'));
|
|
161
|
+
console.error(t('readiness.thenRestart'));
|
|
153
162
|
}
|
|
154
163
|
if (!r.localBridgeOk) {
|
|
155
|
-
console.error(
|
|
164
|
+
console.error(t('readiness.logPath', { path: logPath }));
|
|
156
165
|
tailLogLines(logPath, 12).forEach((l) => console.error(` ${l}`));
|
|
157
166
|
}
|
|
158
167
|
console.error('');
|
|
159
168
|
}
|
|
160
169
|
function tailLogLines(path, n) {
|
|
161
170
|
if (!existsSync(path))
|
|
162
|
-
return ['
|
|
171
|
+
return [t('readiness.logEmpty')];
|
|
163
172
|
try {
|
|
164
173
|
const raw = readFileSync(path, 'utf-8');
|
|
165
174
|
const lines = raw.trim().split('\n').filter(Boolean);
|
|
166
175
|
return lines.slice(-n);
|
|
167
176
|
}
|
|
168
177
|
catch {
|
|
169
|
-
return ['
|
|
178
|
+
return [t('readiness.logUnreadable')];
|
|
170
179
|
}
|
|
171
180
|
}
|
package/dist/version-check.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t } from './i18n.js';
|
|
1
2
|
import { isVersionAtLeast } from './semver.js';
|
|
2
3
|
import { CLI_VERSION } from './cli-version.js';
|
|
3
4
|
export async function fetchRemoteVersionPolicy(relayUrl) {
|
|
@@ -17,14 +18,17 @@ export async function fetchRemoteVersionPolicy(relayUrl) {
|
|
|
17
18
|
export function assertCliVersionAllowed(policy, current = CLI_VERSION) {
|
|
18
19
|
if (isVersionAtLeast(current, policy.minCliVersion))
|
|
19
20
|
return;
|
|
20
|
-
console.error(
|
|
21
|
-
|
|
21
|
+
console.error(t('version.outdated', {
|
|
22
|
+
current,
|
|
23
|
+
min: policy.minCliVersion,
|
|
24
|
+
command: policy.updateCliCommand,
|
|
25
|
+
}));
|
|
22
26
|
process.exit(1);
|
|
23
27
|
}
|
|
24
28
|
export async function ensureCliVersionForRelay(relayUrl) {
|
|
25
29
|
const policy = await fetchRemoteVersionPolicy(relayUrl);
|
|
26
30
|
if (!policy?.minCliVersion) {
|
|
27
|
-
console.warn('
|
|
31
|
+
console.warn(t('version.policyFetchFailed'));
|
|
28
32
|
return;
|
|
29
33
|
}
|
|
30
34
|
assertCliVersionAllowed(policy);
|
package/locales/en.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pairing": {
|
|
3
|
+
"runningInBackground": "Cursor Connect is running in the background",
|
|
4
|
+
"computer": "Computer: {{name}}",
|
|
5
|
+
"enterCodeInApp": "Enter this code in the Cursor Connect app:",
|
|
6
|
+
"codeSingleUse": "Code is single-use",
|
|
7
|
+
"codeValidMinutes": "Valid for {{minutes}} min",
|
|
8
|
+
"stopHint": "To stop Cursor Connect run: cursorconnect stop",
|
|
9
|
+
"consoleCanClose": "You can close this terminal."
|
|
10
|
+
},
|
|
11
|
+
"start": {
|
|
12
|
+
"checksBeforePairing": "Pre-pairing checks:",
|
|
13
|
+
"askAutostart": "Enable Cursor Connect at macOS login? (y/n): ",
|
|
14
|
+
"autostartEnabled": "Autostart enabled (launchd).",
|
|
15
|
+
"openCursorFromDock": "Cursor with CDP: launch from Dock using",
|
|
16
|
+
"dockHint": "(drag to Dock or add to Login Items in macOS Settings).",
|
|
17
|
+
"pairingCodeViaStatus": "Pairing code: cursorconnect status",
|
|
18
|
+
"restartingBridge": "[cursorconnect] Restarting Cursor Connect…",
|
|
19
|
+
"cdpRequired": "[cursorconnect] CDP is required — Cursor Connect will not start without it.",
|
|
20
|
+
"cdpThenRetry": " Start Cursor with remote debugging (port 9222), then:",
|
|
21
|
+
"relayTokenMissing": "[cursorconnect] RELAY_TOKEN not found (bundled config may be corrupt).\n Reinstall: npm install -g cursorconnect\n Or set RELAY_TOKEN in {{path}} (your own relay)."
|
|
22
|
+
},
|
|
23
|
+
"cdp": {
|
|
24
|
+
"quitCursor": "[cursorconnect] Quitting Cursor…",
|
|
25
|
+
"forceQuitCursor": "[cursorconnect] Force-quitting Cursor…",
|
|
26
|
+
"manualTitle": "[cursorconnect] Start Cursor with CDP manually:",
|
|
27
|
+
"manualQuitFirst": " (Cmd+Q first if Cursor is already open)",
|
|
28
|
+
"notRunningLaunch": "[cursorconnect] Cursor is not running — starting with --remote-debugging-port=9222…",
|
|
29
|
+
"askRestart": "Cursor has no CDP. Restart with --remote-debugging-port=9222? (y/n): ",
|
|
30
|
+
"restartingWithCdp": "[cursorconnect] Cursor has no CDP — restarting with --remote-debugging-port=9222…",
|
|
31
|
+
"quitFailed": "[cursorconnect] Could not quit Cursor (try Cmd+Q manually)."
|
|
32
|
+
},
|
|
33
|
+
"stop": {
|
|
34
|
+
"stopped": "Cursor Connect stopped"
|
|
35
|
+
},
|
|
36
|
+
"autostart": {
|
|
37
|
+
"enabled": "Cursor Connect autostart enabled.",
|
|
38
|
+
"cursorCdpPath": "Cursor with CDP (9222): {{path}}",
|
|
39
|
+
"codeViaStatus": "Phone code: cursorconnect status",
|
|
40
|
+
"disabled": "Cursor Connect autostart disabled."
|
|
41
|
+
},
|
|
42
|
+
"init": {
|
|
43
|
+
"notRepo": "Folder does not look like CursorConnect: {{path}}\nNeed a repo clone (bridge/).\nAfter npm install -g cursorconnect, init is not required.",
|
|
44
|
+
"saved": "Saved (dev): {{path}}",
|
|
45
|
+
"repoRoot": "repoRoot: {{path}}",
|
|
46
|
+
"next": "Next: cursorconnect start"
|
|
47
|
+
},
|
|
48
|
+
"status": {
|
|
49
|
+
"noIdentity": "Identity not found — run: cursorconnect start",
|
|
50
|
+
"cliVersion": "CLI: {{version}}",
|
|
51
|
+
"bundleOk": "Bridge bundle: OK (clientVersion in relay-upstream)",
|
|
52
|
+
"bundleStale": "Bridge bundle: STALE — update: npm install -g cursorconnect@latest",
|
|
53
|
+
"bridgeRunning": "running",
|
|
54
|
+
"bridgeStopped": "stopped",
|
|
55
|
+
"bridgeProcess": "Bridge process: {{state}}",
|
|
56
|
+
"stateHeader": "Status:",
|
|
57
|
+
"codeMayFail": " Terminal code may not work in the app — run: cursorconnect start"
|
|
58
|
+
},
|
|
59
|
+
"service": {
|
|
60
|
+
"starting": "[cursorconnect] run-service (background, for launchd)…",
|
|
61
|
+
"cdpUnavailable": "[cursorconnect] service: CDP unavailable — bridge will not start (port 9222 required)",
|
|
62
|
+
"bridgeStarted": "[cursorconnect] service: bridge started → {{log}}",
|
|
63
|
+
"startFailed": "[cursorconnect] service: start failed",
|
|
64
|
+
"exitedRestarting": "[cursorconnect] service: bridge exited, restarting…"
|
|
65
|
+
},
|
|
66
|
+
"version": {
|
|
67
|
+
"outdated": "[cursorconnect] Version {{current}} is outdated (need ≥ {{min}}).\n {{command}}",
|
|
68
|
+
"policyFetchFailed": "[cursorconnect] Could not check version on relay — continuing without check."
|
|
69
|
+
},
|
|
70
|
+
"bridge": {
|
|
71
|
+
"staleBundle": "[cursorconnect] Outdated bridge in npm package (no clientVersion for relay).\n npm install -g cursorconnect@latest\n If already on latest — wait for a fix publish or run from clone: npm run bundle-bridge -w connect",
|
|
72
|
+
"rebuilding": "[cursorconnect] bridge/src newer than dist — building…"
|
|
73
|
+
},
|
|
74
|
+
"readiness": {
|
|
75
|
+
"localBridge": "Cursor Connect on Mac (localhost:3847)",
|
|
76
|
+
"cdpLive": " cdp: connected — live chats from Cursor",
|
|
77
|
+
"cdpArchiveOnly": " cdp: off — JSONL archive only",
|
|
78
|
+
"runStart": " run cursorconnect start",
|
|
79
|
+
"relayLine": "Relay {{state}}",
|
|
80
|
+
"relayReachable": "reachable",
|
|
81
|
+
"relayUnreachable": "unreachable",
|
|
82
|
+
"macInRoom": "Mac in your relay room",
|
|
83
|
+
"codeOnServer": "Pairing code on server (enter in app)",
|
|
84
|
+
"activeCodes": " active codes: {{count}}",
|
|
85
|
+
"codeNotRegistered": " code not registered — run start again (do not reuse an old terminal code)",
|
|
86
|
+
"phoneToken": "Phone token registered by bridge",
|
|
87
|
+
"readyLine": " Ready to pair: code {{code}} · ~{{minutes}} min · single-use",
|
|
88
|
+
"startupFailed": "[cursorconnect] Startup not ready — the app will reject the code.",
|
|
89
|
+
"macNotInRoom": " Mac not in room: npm install -g cursorconnect@latest && cursorconnect stop && cursorconnect start",
|
|
90
|
+
"codeNotOnRelay": " Code not on relay (already used or bridge too slow): cursorconnect stop && cursorconnect start",
|
|
91
|
+
"doNotReuseCode": " Do not enter a code from a previous run — only a fresh code after start.",
|
|
92
|
+
"tokenNotRegistered": " Token not registered — restart bridge (cursorconnect start).",
|
|
93
|
+
"cdpUnavailableHint": " CDP unavailable: Cursor must run with --remote-debugging-port=9222",
|
|
94
|
+
"cdpLaunchCmd": " open -a Cursor --args --remote-debugging-port=9222",
|
|
95
|
+
"thenRestart": " Then: cursorconnect stop && cursorconnect start",
|
|
96
|
+
"logPath": " Log: {{path}}",
|
|
97
|
+
"logEmpty": "(log empty)",
|
|
98
|
+
"logUnreadable": "(could not read log)"
|
|
99
|
+
},
|
|
100
|
+
"diagnose": {
|
|
101
|
+
"header": "CursorConnect diagnose @ {{at}}",
|
|
102
|
+
"relay": "relay={{url}}",
|
|
103
|
+
"room": "room={{id}}",
|
|
104
|
+
"pass": "PASS",
|
|
105
|
+
"fail": "FAIL",
|
|
106
|
+
"hintPrefix": " → ",
|
|
107
|
+
"allPass": "Result: all checks passed",
|
|
108
|
+
"problems": "Result: {{count}} issue(s)",
|
|
109
|
+
"noIdentity": "Missing ~/.cursorconnect/identity.json",
|
|
110
|
+
"hintStart": "cursorconnect start",
|
|
111
|
+
"hintRelayUrl": "Check RELAY_URL and internet",
|
|
112
|
+
"hintStartMac": "cursorconnect start on Mac",
|
|
113
|
+
"notInRoom": "Cursor Connect not in this relay room",
|
|
114
|
+
"tokenNotRegistered": "Token not registered — restart cursorconnect start",
|
|
115
|
+
"tokenNotWhitelisted": "Token not in room whitelist",
|
|
116
|
+
"hintDeployRelay": "Update relay: npm run deploy:relay",
|
|
117
|
+
"hintCdp9222": "Cursor with --remote-debugging-port=9222",
|
|
118
|
+
"codeExpired": "Code expired or missing",
|
|
119
|
+
"hintEnterInApp": "Enter in app before expiry; start again for a new code",
|
|
120
|
+
"hintAppTransports": "Phone: needs polling+websocket in app",
|
|
121
|
+
"hintPollingBlocked": "Relay/nginx blocking long-polling?",
|
|
122
|
+
"wrongRoom": "App connects to room=default instead of your roomId",
|
|
123
|
+
"hintHistory": "connectorInRoom false or Cursor Connect not responding — cursorconnect start"
|
|
124
|
+
},
|
|
125
|
+
"usage": {
|
|
126
|
+
"body": "Usage: cursorconnect <command>\n\n start — CDP (auto-restart Cursor) + Cursor Connect + code\n start -r — same (explicit Cursor restart)\n start --no-restart-cursor — do not touch Cursor (asks y/n in TTY)\n stop — stop Cursor Connect\n status — code and status\n install-autostart — Mac: Cursor Connect at login (launchd)\n uninstall-autostart — disable autostart\n diagnose — relay / Cursor Connect / socket checks\n init [path] — dev only (repo clone)\n\nInstall (from any folder):\n npm install -g cursorconnect\n cursorconnect start # first time: code + optional autostart\n cursorconnect install-autostart # no console every day"
|
|
127
|
+
}
|
|
128
|
+
}
|
package/locales/ru.json
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pairing": {
|
|
3
|
+
"runningInBackground": "Cursor Connect запущен в фоне",
|
|
4
|
+
"computer": "Компьютер: {{name}}",
|
|
5
|
+
"enterCodeInApp": "Введите код в приложении Cursor Connect:",
|
|
6
|
+
"codeSingleUse": "Код одноразовый",
|
|
7
|
+
"codeValidMinutes": "Действует {{minutes}} мин",
|
|
8
|
+
"stopHint": "Для остановки Cursor Connect введите cursorconnect stop",
|
|
9
|
+
"consoleCanClose": "Консоль можно закрыть."
|
|
10
|
+
},
|
|
11
|
+
"start": {
|
|
12
|
+
"checksBeforePairing": "Проверки перед pairing:",
|
|
13
|
+
"askAutostart": "Включить автозапуск Cursor Connect при входе в macOS? (y/n): ",
|
|
14
|
+
"autostartEnabled": "Автозапуск включён (launchd).",
|
|
15
|
+
"openCursorFromDock": "Cursor с CDP: откройте из Dock скрипт",
|
|
16
|
+
"dockHint": "(перетащите в Dock или «Программы при входе» в настройках macOS).",
|
|
17
|
+
"pairingCodeViaStatus": "Код pairing: cursorconnect status",
|
|
18
|
+
"restartingBridge": "[cursorconnect] Перезапуск Cursor Connect…",
|
|
19
|
+
"cdpRequired": "[cursorconnect] CDP обязателен — без него Cursor Connect не запускается.",
|
|
20
|
+
"cdpThenRetry": " Cursor с remote debugging (порт 9222), затем снова:",
|
|
21
|
+
"relayTokenMissing": "[cursorconnect] Не найден RELAY_TOKEN (встроенный конфиг пакета повреждён).\n Переустановите: npm install -g cursorconnect\n Или укажите RELAY_TOKEN в {{path}} (свой relay)."
|
|
22
|
+
},
|
|
23
|
+
"cdp": {
|
|
24
|
+
"quitCursor": "[cursorconnect] Закрываю Cursor…",
|
|
25
|
+
"forceQuitCursor": "[cursorconnect] Принудительное завершение Cursor…",
|
|
26
|
+
"manualTitle": "[cursorconnect] Запустите Cursor с CDP вручную:",
|
|
27
|
+
"manualQuitFirst": " (сначала Cmd+Q, если Cursor уже открыт)",
|
|
28
|
+
"notRunningLaunch": "[cursorconnect] Cursor не запущен — старт с --remote-debugging-port=9222…",
|
|
29
|
+
"askRestart": "Cursor без CDP. Перезапустить с --remote-debugging-port=9222? (y/n): ",
|
|
30
|
+
"restartingWithCdp": "[cursorconnect] Cursor без CDP — перезапуск с --remote-debugging-port=9222…",
|
|
31
|
+
"quitFailed": "[cursorconnect] Не удалось закрыть Cursor (Cmd+Q вручную)."
|
|
32
|
+
},
|
|
33
|
+
"stop": {
|
|
34
|
+
"stopped": "Cursor Connect остановлен"
|
|
35
|
+
},
|
|
36
|
+
"autostart": {
|
|
37
|
+
"enabled": "Автозапуск Cursor Connect включён.",
|
|
38
|
+
"cursorCdpPath": "Cursor с CDP (9222): {{path}}",
|
|
39
|
+
"codeViaStatus": "Код на телефон: cursorconnect status",
|
|
40
|
+
"disabled": "Автозапуск Cursor Connect отключён."
|
|
41
|
+
},
|
|
42
|
+
"init": {
|
|
43
|
+
"notRepo": "Папка не похожа на CursorConnect: {{path}}\nНужен клон репозитория (bridge/).\nПосле npm install -g cursorconnect команда init не нужна.",
|
|
44
|
+
"saved": "Сохранено (dev): {{path}}",
|
|
45
|
+
"repoRoot": "repoRoot: {{path}}",
|
|
46
|
+
"next": "Дальше: cursorconnect start"
|
|
47
|
+
},
|
|
48
|
+
"status": {
|
|
49
|
+
"noIdentity": "Identity не найден — запустите: cursorconnect start",
|
|
50
|
+
"cliVersion": "CLI: {{version}}",
|
|
51
|
+
"bundleOk": "Bridge bundle: OK (clientVersion в relay-upstream)",
|
|
52
|
+
"bundleStale": "Bridge bundle: STALE — обновите npm install -g cursorconnect@latest",
|
|
53
|
+
"bridgeRunning": "running",
|
|
54
|
+
"bridgeStopped": "stopped",
|
|
55
|
+
"bridgeProcess": "Bridge process: {{state}}",
|
|
56
|
+
"stateHeader": "Состояние:",
|
|
57
|
+
"codeMayFail": " Код в терминале может не принять приложение — выполните: cursorconnect start"
|
|
58
|
+
},
|
|
59
|
+
"service": {
|
|
60
|
+
"starting": "[cursorconnect] run-service (фон, для launchd)…",
|
|
61
|
+
"cdpUnavailable": "[cursorconnect] service: CDP недоступен — bridge не стартует (нужен порт 9222)",
|
|
62
|
+
"bridgeStarted": "[cursorconnect] service: bridge started → {{log}}",
|
|
63
|
+
"startFailed": "[cursorconnect] service: start failed",
|
|
64
|
+
"exitedRestarting": "[cursorconnect] service: bridge exited, restarting…"
|
|
65
|
+
},
|
|
66
|
+
"version": {
|
|
67
|
+
"outdated": "[cursorconnect] Версия {{current}} устарела (нужна ≥ {{min}}).\n {{command}}",
|
|
68
|
+
"policyFetchFailed": "[cursorconnect] Не удалось проверить версию на relay — продолжаем без проверки."
|
|
69
|
+
},
|
|
70
|
+
"bridge": {
|
|
71
|
+
"staleBundle": "[cursorconnect] Устаревший bridge внутри npm-пакета (нет clientVersion для relay).\n npm install -g cursorconnect@latest\n Если уже latest — дождитесь публикации fix или запускайте из клона: npm run bundle-bridge -w connect",
|
|
72
|
+
"rebuilding": "[cursorconnect] bridge/src новее dist — сборка…"
|
|
73
|
+
},
|
|
74
|
+
"readiness": {
|
|
75
|
+
"localBridge": "Cursor Connect на Mac (localhost:3847)",
|
|
76
|
+
"cdpLive": " cdp: подключён — live-чаты из Cursor",
|
|
77
|
+
"cdpArchiveOnly": " cdp: нет — только архив JSONL",
|
|
78
|
+
"runStart": " запустите cursorconnect start",
|
|
79
|
+
"relayReachable": "доступен",
|
|
80
|
+
"relayUnreachable": "недоступен",
|
|
81
|
+
"relayLine": "Relay {{state}}",
|
|
82
|
+
"macInRoom": "Mac в вашей комнате на relay",
|
|
83
|
+
"codeOnServer": "Код на сервере (можно вводить в приложении)",
|
|
84
|
+
"activeCodes": " активных кодов: {{count}}",
|
|
85
|
+
"codeNotRegistered": " код не зарегистрирован — повторите start (не вводите старый код из терминала)",
|
|
86
|
+
"phoneToken": "Токен телефона зарегистрирован bridge'ем",
|
|
87
|
+
"readyLine": " Готово к pairing: код {{code}} · ~{{minutes}} мин · одноразовый",
|
|
88
|
+
"startupFailed": "[cursorconnect] Запуск не готов — приложение код не примет.",
|
|
89
|
+
"macNotInRoom": " Mac не в комнате: npm install -g cursorconnect@latest && cursorconnect stop && cursorconnect start",
|
|
90
|
+
"codeNotOnRelay": " Код не на relay (уже введён или bridge не успел): cursorconnect stop && cursorconnect start",
|
|
91
|
+
"doNotReuseCode": " Не вводите код из прошлого запуска — только свежий после start.",
|
|
92
|
+
"tokenNotRegistered": " Токен не зарегистрирован — перезапустите bridge (cursorconnect start).",
|
|
93
|
+
"cdpUnavailableHint": " CDP недоступен: Cursor должен быть с --remote-debugging-port=9222",
|
|
94
|
+
"cdpLaunchCmd": " open -a Cursor --args --remote-debugging-port=9222",
|
|
95
|
+
"thenRestart": " Затем: cursorconnect stop && cursorconnect start",
|
|
96
|
+
"logPath": " Лог: {{path}}",
|
|
97
|
+
"logEmpty": "(лог пуст)",
|
|
98
|
+
"logUnreadable": "(не удалось прочитать лог)"
|
|
99
|
+
},
|
|
100
|
+
"diagnose": {
|
|
101
|
+
"header": "CursorConnect diagnose @ {{at}}",
|
|
102
|
+
"relay": "relay={{url}}",
|
|
103
|
+
"room": "room={{id}}",
|
|
104
|
+
"pass": "PASS",
|
|
105
|
+
"fail": "FAIL",
|
|
106
|
+
"hintPrefix": " → ",
|
|
107
|
+
"allPass": "Итог: все проверки пройдены",
|
|
108
|
+
"problems": "Итог: {{count}} проблем(а)",
|
|
109
|
+
"noIdentity": "Нет ~/.cursorconnect/identity.json",
|
|
110
|
+
"hintStart": "cursorconnect start",
|
|
111
|
+
"hintRelayUrl": "Проверьте RELAY_URL и интернет",
|
|
112
|
+
"hintStartMac": "cursorconnect start на Mac",
|
|
113
|
+
"notInRoom": "Cursor Connect не в этой комнате на relay",
|
|
114
|
+
"tokenNotRegistered": "Токен не зарегистрирован — перезапустите cursorconnect start",
|
|
115
|
+
"tokenNotWhitelisted": "Токен не в whitelist комнаты",
|
|
116
|
+
"hintDeployRelay": "Обновите relay: npm run deploy:relay",
|
|
117
|
+
"hintCdp9222": "Cursor с --remote-debugging-port=9222",
|
|
118
|
+
"codeExpired": "Код истёк или отсутствует",
|
|
119
|
+
"hintEnterInApp": "Введите в app до истечения; повторный start — новый код",
|
|
120
|
+
"hintAppTransports": "Телефон: нужен polling+websocket в app",
|
|
121
|
+
"hintPollingBlocked": "Relay/nginx блокирует long-polling?",
|
|
122
|
+
"wrongRoom": "App подключается к room=default вместо вашего roomId",
|
|
123
|
+
"hintHistory": "connectorInRoom false или Cursor Connect не отвечает — cursorconnect start"
|
|
124
|
+
},
|
|
125
|
+
"usage": {
|
|
126
|
+
"body": "Usage: cursorconnect <command>\n\n start — CDP (авто-перезапуск Cursor) + Cursor Connect + код\n start -r — то же (явный перезапуск Cursor)\n start --no-restart-cursor — не трогать Cursor (спросит y/n в TTY)\n stop — остановить Cursor Connect\n status — код и статус\n install-autostart — Mac: Cursor Connect при входе (launchd)\n uninstall-autostart — отключить автозапуск\n diagnose — проверка relay / Cursor Connect / socket\n init [path] — только для разработки (клон репо)\n\nУстановка (из любой папки):\n npm install -g cursorconnect\n cursorconnect start # первый раз: код + опционально автозапуск\n cursorconnect install-autostart # без консоли каждый день"
|
|
127
|
+
}
|
|
128
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursorconnect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "CLI: Cursor Connect on Mac + relay pairing — install once, run from anywhere",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/**/*.js",
|
|
12
|
+
"locales/**",
|
|
12
13
|
"bridge-runtime/**",
|
|
13
14
|
"config.env.defaults",
|
|
14
15
|
"version-policy.json",
|
package/version-policy.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"minCliVersion": "0.1.7",
|
|
3
3
|
"minAppVersion": "0.2.2",
|
|
4
|
-
"latestCliVersion": "0.1.
|
|
4
|
+
"latestCliVersion": "0.1.11",
|
|
5
5
|
"latestAppVersion": "0.2.2",
|
|
6
6
|
"updateCliCommand": "npm install -g cursorconnect@latest",
|
|
7
7
|
"updateAppHint": "Обновите CursorConnect в App Store / TestFlight до последней сборки."
|