ds-harness-remote 0.4.3 → 0.4.4
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 +57 -9
- package/bin/ds-harness-remote.js +11 -0
- package/cordis.patch.yml +22 -0
- package/dist/cli.d.ts +31 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +283 -0
- package/dist/cli.js.map +1 -0
- package/dist/codex/domain.d.ts +4 -2
- package/dist/codex/domain.d.ts.map +1 -1
- package/dist/codex/domain.js +192 -68
- package/dist/codex/domain.js.map +1 -1
- package/dist/codex/method-policy.d.ts +7 -7
- package/dist/codex/virtual-harness.d.ts +3 -0
- package/dist/codex/virtual-harness.d.ts.map +1 -1
- package/dist/codex/virtual-harness.js +89 -20
- package/dist/codex/virtual-harness.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1147 -258
- package/dist/index.js.map +4 -4
- package/dist/server-api.d.ts.map +1 -1
- package/dist/server-api.js +15 -2
- package/dist/server-api.js.map +1 -1
- package/dist/server-credentials.d.ts +2 -2
- package/dist/service.d.ts +4 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +34 -2
- package/dist/service.js.map +1 -1
- package/dist/tui-command.d.ts +13 -0
- package/dist/tui-command.d.ts.map +1 -0
- package/dist/tui-command.js +378 -0
- package/dist/tui-command.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dsh-plugin.json +41 -0
- package/package.json +6 -1
- package/public.d.ts +1 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { renderCompactTerminalQr, renderTerminalQr } from './cli.js';
|
|
2
|
+
import { ServerApiError } from './server-api.js';
|
|
3
|
+
const QR_POLL_INTERVAL_MS = 2_000;
|
|
4
|
+
const REMOTE_LOGIN_SCENE_ID = 'remote-login';
|
|
5
|
+
const REMOTE_STATUS_SCENE_ID = 'remote-status';
|
|
6
|
+
/** Soft TUI integration: Desktop profiles never wait for terminal-only services. */
|
|
7
|
+
export function installTuiRemoteCommand(ctx, resolveTarget) {
|
|
8
|
+
const tuiContext = ctx;
|
|
9
|
+
// The bundle's TUI-only Loader row exposes these services at the entry
|
|
10
|
+
// boundary. A Desktop entry has neither and stays completely inert here.
|
|
11
|
+
const commands = tuiContext.get('commands', false);
|
|
12
|
+
if (commands === undefined)
|
|
13
|
+
return;
|
|
14
|
+
// Newer dsh-TUI versions attribute commands to their owning plugin through
|
|
15
|
+
// this optional service. Older versions only expose the direct registry.
|
|
16
|
+
const pluginHost = tuiContext.get('tuiPluginHost', false);
|
|
17
|
+
const trees = tuiContext.get('tuiCommandTrees', false);
|
|
18
|
+
const scenes = tuiContext.get('tuiScenes', false);
|
|
19
|
+
const login = new RemoteLoginController(resolveTarget);
|
|
20
|
+
const LoginScene = createRemoteLoginScene(login);
|
|
21
|
+
const StatusScene = createRemoteStatusScene(resolveTarget);
|
|
22
|
+
tuiContext.effect(() => {
|
|
23
|
+
const definition = {
|
|
24
|
+
name: 'remote',
|
|
25
|
+
description: 'Manage Remote Host login and connection status',
|
|
26
|
+
input: { hint: '[status | login [github|zhihu] | logout]' },
|
|
27
|
+
recordInput: false,
|
|
28
|
+
handler: async ({ rawInput }) => {
|
|
29
|
+
const args = rawInput.trim().split(/\s+/u).filter(Boolean);
|
|
30
|
+
const command = args[0] ?? 'status';
|
|
31
|
+
if (command === 'status' && args.length <= 1) {
|
|
32
|
+
if (scenes?.open(REMOTE_STATUS_SCENE_ID) === true)
|
|
33
|
+
return { kind: 'success' };
|
|
34
|
+
return { kind: 'success', text: formatRemoteStatusInline(resolveTarget()) };
|
|
35
|
+
}
|
|
36
|
+
if (command === 'login' && args.length <= 2) {
|
|
37
|
+
const provider = args[1] ?? 'zhihu';
|
|
38
|
+
if (provider !== 'github' && provider !== 'zhihu') {
|
|
39
|
+
return { kind: 'error', text: 'Usage: /remote login [github|zhihu]' };
|
|
40
|
+
}
|
|
41
|
+
if (scenes === undefined) {
|
|
42
|
+
return {
|
|
43
|
+
kind: 'error',
|
|
44
|
+
text: `The Remote login screen is unavailable. Run "ds-harness-remote login ${provider}" outside dsh-TUI, then restart it.`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
login.start(provider);
|
|
48
|
+
if (!scenes.open(REMOTE_LOGIN_SCENE_ID)) {
|
|
49
|
+
login.cancel();
|
|
50
|
+
return { kind: 'error', text: 'The Remote login screen is unavailable.' };
|
|
51
|
+
}
|
|
52
|
+
return { kind: 'success' };
|
|
53
|
+
}
|
|
54
|
+
if (command === 'logout' && args.length === 1) {
|
|
55
|
+
const target = resolveTarget();
|
|
56
|
+
if (target === undefined)
|
|
57
|
+
return remoteNotReady();
|
|
58
|
+
try {
|
|
59
|
+
await target.runtime.clearHostAuthorization();
|
|
60
|
+
return {
|
|
61
|
+
kind: 'success',
|
|
62
|
+
text: 'Remote Host logged out and its local device identity was rotated.',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return {
|
|
67
|
+
kind: 'error',
|
|
68
|
+
text: `Local Remote Host credentials were cleared, but Server revocation failed (${errorCode(error)}).`,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (command === 'config') {
|
|
73
|
+
return { kind: 'error', text: 'Host configuration is not supported yet.' };
|
|
74
|
+
}
|
|
75
|
+
return { kind: 'error', text: remoteCommandUsage() };
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
const disposeCommand = registerRemoteCommand(tuiContext, commands, pluginHost, definition);
|
|
79
|
+
const disposeTree = registerOptional(tuiContext, 'command completion', () => trees?.register({
|
|
80
|
+
root: 'remote',
|
|
81
|
+
descriptions: {
|
|
82
|
+
en: 'Manage Remote Host login and connection status',
|
|
83
|
+
zh: '管理 Remote Host 登录和连接状态',
|
|
84
|
+
},
|
|
85
|
+
children: remoteCommandChildren,
|
|
86
|
+
}));
|
|
87
|
+
const disposeScene = registerOptional(tuiContext, 'login scene', () => scenes?.register({
|
|
88
|
+
id: REMOTE_LOGIN_SCENE_ID,
|
|
89
|
+
title: 'Remote Host login',
|
|
90
|
+
component: LoginScene,
|
|
91
|
+
}, tuiContext));
|
|
92
|
+
const disposeStatusScene = registerOptional(tuiContext, 'status scene', () => scenes?.register({
|
|
93
|
+
id: REMOTE_STATUS_SCENE_ID,
|
|
94
|
+
title: 'Remote Host status',
|
|
95
|
+
component: StatusScene,
|
|
96
|
+
}, tuiContext));
|
|
97
|
+
return () => {
|
|
98
|
+
login.cancel();
|
|
99
|
+
disposeCommand();
|
|
100
|
+
disposeTree();
|
|
101
|
+
disposeScene();
|
|
102
|
+
disposeStatusScene();
|
|
103
|
+
};
|
|
104
|
+
}, 'ds-harness-remote: dsh-tui /remote command');
|
|
105
|
+
}
|
|
106
|
+
function registerRemoteCommand(ctx, commands, pluginHost, definition) {
|
|
107
|
+
if (pluginHost === undefined)
|
|
108
|
+
return commands.register(definition);
|
|
109
|
+
try {
|
|
110
|
+
return pluginHost.registerCommand(ctx, definition);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
// dsh rc.2 with dsh-TUI 0.10.0-beta.4 mounts the mediated service but its
|
|
114
|
+
// Cordis bundle loader does not admit third-party activations yet. Keep the
|
|
115
|
+
// command usable on that exact compatibility seam; every other mediated
|
|
116
|
+
// registration failure remains fail-closed.
|
|
117
|
+
if (!hasErrorCode(error, 'COMPONENT_NOT_ADMITTED'))
|
|
118
|
+
throw error;
|
|
119
|
+
ctx.logger.debug('dsh-TUI Remote command is using the legacy command registry because Component admission is unavailable');
|
|
120
|
+
return commands.register(definition);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function hasErrorCode(error, code) {
|
|
124
|
+
return typeof error === 'object' && error !== null && 'code' in error
|
|
125
|
+
&& error.code === code;
|
|
126
|
+
}
|
|
127
|
+
function registerOptional(ctx, feature, register) {
|
|
128
|
+
try {
|
|
129
|
+
return register() ?? (() => { });
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
ctx.logger.warn(`dsh-TUI Remote ${feature} is unavailable`, { code: errorCode(error) });
|
|
133
|
+
return () => { };
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function remoteCommandChildren(canonicalPath) {
|
|
137
|
+
if (canonicalPath.length === 1 && canonicalPath[0] === 'remote') {
|
|
138
|
+
return [
|
|
139
|
+
{
|
|
140
|
+
name: 'status',
|
|
141
|
+
description: 'Show Remote Host authorization and connection status',
|
|
142
|
+
descriptions: { zh: '查看 Remote Host 授权和连接状态' },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'login',
|
|
146
|
+
description: 'Authorize this Host with a GitHub or Zhihu QR code',
|
|
147
|
+
descriptions: { zh: '使用 GitHub 或知乎二维码授权当前 Host' },
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'logout',
|
|
151
|
+
description: 'Revoke this Host and rotate its local identity',
|
|
152
|
+
descriptions: { zh: '撤销当前 Host 并轮换本地身份' },
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
if (canonicalPath.length === 2 && canonicalPath[0] === 'remote' && canonicalPath[1] === 'login') {
|
|
157
|
+
return [
|
|
158
|
+
{ name: 'zhihu', description: 'Sign in with Zhihu (default)', descriptions: { zh: '使用知乎登录(默认)' } },
|
|
159
|
+
{ name: 'github', description: 'Sign in with GitHub', descriptions: { zh: '使用 GitHub 登录' } },
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
function remoteStatusLines(target) {
|
|
165
|
+
if (target === undefined) {
|
|
166
|
+
return ['Remote Host is disabled or still starting. Check the ds-harness-remote settings and retry.'];
|
|
167
|
+
}
|
|
168
|
+
const { runtime, config } = target;
|
|
169
|
+
const status = runtime.hostStatus();
|
|
170
|
+
const diagnostics = runtime.diagnostics();
|
|
171
|
+
const codex = runtime.codexStatus();
|
|
172
|
+
const capabilities = new Set(diagnostics.capabilities);
|
|
173
|
+
const connection = status.online
|
|
174
|
+
? 'online'
|
|
175
|
+
: status.reconnecting
|
|
176
|
+
? 'reconnecting'
|
|
177
|
+
: status.accountRequired
|
|
178
|
+
? 'authorization required'
|
|
179
|
+
: 'offline';
|
|
180
|
+
return [
|
|
181
|
+
`Server: ${config.serverUrl ?? 'not configured'}`,
|
|
182
|
+
'Host control: enabled',
|
|
183
|
+
`Device: ${status.deviceId ?? 'not initialized'}`,
|
|
184
|
+
`Authorization: ${status.authorized ? status.account === undefined ? 'logged in' : `logged in (${status.account})` : 'logged out'}`,
|
|
185
|
+
`Server connection: ${connection}`,
|
|
186
|
+
`Harness Remote API: ${capabilities.has('harness.api.v1')
|
|
187
|
+
? 'available (ApiProxy)'
|
|
188
|
+
: capabilities.has('harness.remote.v1')
|
|
189
|
+
? 'available (Typert Remote)'
|
|
190
|
+
: 'unavailable'}`,
|
|
191
|
+
`Remote clients: ${diagnostics.activeConnections}`,
|
|
192
|
+
`Codex Remote: ${codex.enabled ? codex.state : 'disabled'}`,
|
|
193
|
+
'',
|
|
194
|
+
'Commands: /remote login [github|zhihu] · /remote status · /remote logout',
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
function formatRemoteStatusInline(target) {
|
|
198
|
+
return remoteStatusLines(target).filter(Boolean).join(' · ');
|
|
199
|
+
}
|
|
200
|
+
function remoteCommandUsage() {
|
|
201
|
+
return [
|
|
202
|
+
'Usage:',
|
|
203
|
+
' /remote',
|
|
204
|
+
' /remote status',
|
|
205
|
+
' /remote login [github|zhihu]',
|
|
206
|
+
' /remote logout',
|
|
207
|
+
].join('\n');
|
|
208
|
+
}
|
|
209
|
+
function remoteNotReady() {
|
|
210
|
+
return {
|
|
211
|
+
kind: 'error',
|
|
212
|
+
text: 'Remote Host is disabled or still starting. Check the ds-harness-remote settings and retry.',
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
class RemoteLoginController {
|
|
216
|
+
resolveTarget;
|
|
217
|
+
current = { phase: 'idle', provider: 'zhihu' };
|
|
218
|
+
listeners = new Set();
|
|
219
|
+
attempt = 0;
|
|
220
|
+
constructor(resolveTarget) {
|
|
221
|
+
this.resolveTarget = resolveTarget;
|
|
222
|
+
}
|
|
223
|
+
snapshot = () => this.current;
|
|
224
|
+
subscribe = (listener) => {
|
|
225
|
+
this.listeners.add(listener);
|
|
226
|
+
return () => { this.listeners.delete(listener); };
|
|
227
|
+
};
|
|
228
|
+
start(provider) {
|
|
229
|
+
const attempt = ++this.attempt;
|
|
230
|
+
this.update({ phase: 'loading', provider });
|
|
231
|
+
void this.run(attempt, provider);
|
|
232
|
+
}
|
|
233
|
+
cancel() {
|
|
234
|
+
this.attempt += 1;
|
|
235
|
+
}
|
|
236
|
+
async run(attempt, provider) {
|
|
237
|
+
try {
|
|
238
|
+
const target = this.resolveTarget();
|
|
239
|
+
if (target === undefined)
|
|
240
|
+
throw new Error('REMOTE_NOT_READY');
|
|
241
|
+
const session = await target.runtime.startHostOAuthQrLogin(provider);
|
|
242
|
+
const [qr, compactQr] = await Promise.all([
|
|
243
|
+
renderTerminalQr(session.scanUrl),
|
|
244
|
+
renderCompactTerminalQr(session.scanUrl),
|
|
245
|
+
]);
|
|
246
|
+
if (attempt !== this.attempt)
|
|
247
|
+
return;
|
|
248
|
+
this.update({ phase: 'waiting', provider, qr, compactQr, scanUrl: session.scanUrl });
|
|
249
|
+
await this.poll(attempt, provider, session, target.runtime);
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
if (attempt !== this.attempt)
|
|
253
|
+
return;
|
|
254
|
+
this.update({ phase: 'error', provider, error: errorCode(error) });
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async poll(attempt, provider, session, runtime) {
|
|
258
|
+
const deadline = Date.now() + session.expiresIn * 1_000;
|
|
259
|
+
while (attempt === this.attempt && Date.now() < deadline) {
|
|
260
|
+
try {
|
|
261
|
+
const result = await runtime.pollHostOAuthQrLogin(session.qrId);
|
|
262
|
+
if (attempt !== this.attempt)
|
|
263
|
+
return;
|
|
264
|
+
if (result.status === 'complete') {
|
|
265
|
+
this.update({ phase: 'complete', provider, account: result.authorization.account });
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
if (result.status === 'expired')
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
if (!(error instanceof ServerApiError) || !error.retryable)
|
|
273
|
+
throw error;
|
|
274
|
+
}
|
|
275
|
+
await wait(Math.min(QR_POLL_INTERVAL_MS, Math.max(1, deadline - Date.now())));
|
|
276
|
+
}
|
|
277
|
+
if (attempt === this.attempt)
|
|
278
|
+
this.update({ phase: 'expired', provider });
|
|
279
|
+
}
|
|
280
|
+
update(snapshot) {
|
|
281
|
+
this.current = snapshot;
|
|
282
|
+
for (const listener of this.listeners)
|
|
283
|
+
listener(snapshot);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function createRemoteLoginScene(controller) {
|
|
287
|
+
return function RemoteLoginScene({ React, ui, close }) {
|
|
288
|
+
const [snapshot, setSnapshot] = React.useState(controller.snapshot());
|
|
289
|
+
const terminal = ui.useTerminalSize();
|
|
290
|
+
React.useEffect(() => {
|
|
291
|
+
const unsubscribe = controller.subscribe(setSnapshot);
|
|
292
|
+
return () => {
|
|
293
|
+
unsubscribe();
|
|
294
|
+
controller.cancel();
|
|
295
|
+
};
|
|
296
|
+
}, []);
|
|
297
|
+
ui.useInput((input, key) => {
|
|
298
|
+
if (key.escape === true || input.toLowerCase() === 'q') {
|
|
299
|
+
controller.cancel();
|
|
300
|
+
close();
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
const provider = snapshot.provider === 'github' ? 'GitHub' : 'Zhihu';
|
|
304
|
+
const other = snapshot.provider === 'github' ? '/remote login zhihu' : '/remote login github';
|
|
305
|
+
const children = [
|
|
306
|
+
React.createElement(ui.Text, { key: 'title', bold: true, color: 'accent' }, 'Remote Host login'),
|
|
307
|
+
React.createElement(ui.Text, { key: 'provider' }, `Provider: ${provider} · You can also use ${other}`),
|
|
308
|
+
];
|
|
309
|
+
if (snapshot.phase === 'loading') {
|
|
310
|
+
children.push(React.createElement(ui.Text, { key: 'loading', color: 'subtle' }, 'Creating authorization QR code…'));
|
|
311
|
+
}
|
|
312
|
+
else if (snapshot.phase === 'waiting' && snapshot.qr !== undefined && snapshot.scanUrl !== undefined) {
|
|
313
|
+
const fullRows = snapshot.qr.split('\n').length;
|
|
314
|
+
const fullColumns = printableWidth(snapshot.qr.split('\n')[0] ?? '');
|
|
315
|
+
const useFullQr = terminal.rows >= fullRows + 7 && terminal.columns >= fullColumns + 4;
|
|
316
|
+
const qr = useFullQr || snapshot.compactQr === undefined ? snapshot.qr : snapshot.compactQr;
|
|
317
|
+
const qrRows = qr.split('\n').length;
|
|
318
|
+
const qrColumns = printableWidth(qr.split('\n')[0] ?? '');
|
|
319
|
+
if (terminal.rows < qrRows + 7 || terminal.columns < qrColumns + 4) {
|
|
320
|
+
children.push(React.createElement(ui.Text, { key: 'size-warning', color: 'warning' }, `Resize the terminal to at least ${qrColumns + 4} × ${qrRows + 7} if the QR code is clipped.`));
|
|
321
|
+
}
|
|
322
|
+
children.push(React.createElement(ui.Text, { key: 'scan' }, 'Scan this QR code to authorize this Host:'), React.createElement(ui.Text, { key: 'qr', wrap: 'truncate' }, qr), React.createElement(ui.Text, { key: 'url', color: 'link', underline: true }, terminalLink(snapshot.scanUrl)), React.createElement(ui.Text, { key: 'waiting', color: 'subtle' }, 'Waiting for authorization…'));
|
|
323
|
+
}
|
|
324
|
+
else if (snapshot.phase === 'complete') {
|
|
325
|
+
children.push(React.createElement(ui.Text, { key: 'complete', color: 'success' }, snapshot.account === undefined
|
|
326
|
+
? 'Remote Host login complete. The Host is reconnecting now.'
|
|
327
|
+
: `Remote Host login complete for ${snapshot.account}. The Host is reconnecting now.`));
|
|
328
|
+
}
|
|
329
|
+
else if (snapshot.phase === 'expired') {
|
|
330
|
+
children.push(React.createElement(ui.Text, { key: 'expired', color: 'warning' }, 'The QR code expired. Close this screen and run /remote login again.'));
|
|
331
|
+
}
|
|
332
|
+
else if (snapshot.phase === 'error') {
|
|
333
|
+
children.push(React.createElement(ui.Text, { key: 'error', color: 'error' }, `Remote Host login failed (${snapshot.error ?? 'UNKNOWN'}).`));
|
|
334
|
+
}
|
|
335
|
+
children.push(React.createElement(ui.Text, { key: 'close', color: 'subtle' }, 'Press Esc or q to return.'));
|
|
336
|
+
return React.createElement(ui.Box, {
|
|
337
|
+
flexDirection: 'column',
|
|
338
|
+
gap: 1,
|
|
339
|
+
paddingX: Math.max(0, Math.min(2, Math.floor((terminal.columns - 1) / 2))),
|
|
340
|
+
}, ...children);
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function createRemoteStatusScene(resolveTarget) {
|
|
344
|
+
return function RemoteStatusScene({ React, ui, close }) {
|
|
345
|
+
const terminal = ui.useTerminalSize();
|
|
346
|
+
ui.useInput((input, key) => {
|
|
347
|
+
if (key.escape === true || input.toLowerCase() === 'q')
|
|
348
|
+
close();
|
|
349
|
+
});
|
|
350
|
+
const children = [
|
|
351
|
+
React.createElement(ui.Text, { key: 'title', bold: true, color: 'accent' }, 'Remote Host status'),
|
|
352
|
+
...remoteStatusLines(resolveTarget()).map((line, index) => React.createElement(ui.Text, { key: `status-${index}`, color: line === '' ? 'subtle' : undefined }, line === '' ? ' ' : line)),
|
|
353
|
+
React.createElement(ui.Text, { key: 'close', color: 'subtle' }, 'Press Esc or q to return.'),
|
|
354
|
+
];
|
|
355
|
+
return React.createElement(ui.Box, {
|
|
356
|
+
flexDirection: 'column',
|
|
357
|
+
gap: 1,
|
|
358
|
+
paddingX: Math.max(0, Math.min(2, Math.floor((terminal.columns - 1) / 2))),
|
|
359
|
+
}, ...children);
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function terminalLink(url) {
|
|
363
|
+
return `\u001B]8;;${url}\u0007${url}\u001B]8;;\u0007`;
|
|
364
|
+
}
|
|
365
|
+
function printableWidth(value) {
|
|
366
|
+
return value.replace(/\u001B\[[0-9;]*m/gu, '').length;
|
|
367
|
+
}
|
|
368
|
+
function errorCode(error) {
|
|
369
|
+
if (error instanceof ServerApiError)
|
|
370
|
+
return error.code;
|
|
371
|
+
if (error instanceof Error && 'code' in error && typeof error.code === 'string')
|
|
372
|
+
return error.code;
|
|
373
|
+
return 'CONNECTION_FAILED';
|
|
374
|
+
}
|
|
375
|
+
function wait(milliseconds) {
|
|
376
|
+
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=tui-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tui-command.js","sourceRoot":"","sources":["../src/tui-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,EAAE,cAAc,EAA2C,MAAM,iBAAiB,CAAA;AAGzF,MAAM,mBAAmB,GAAG,KAAK,CAAA;AACjC,MAAM,qBAAqB,GAAG,cAAc,CAAA;AAC5C,MAAM,sBAAsB,GAAG,eAAe,CAAA;AAmF9C,oFAAoF;AACpF,MAAM,UAAU,uBAAuB,CACrC,GAAY,EACZ,aAAgD;IAEhD,MAAM,UAAU,GAAG,GAAiB,CAAA;IACpC,uEAAuE;IACvE,yEAAyE;IACzE,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAmC,CAAA;IACpF,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAM;IAClC,2EAA2E;IAC3E,yEAAyE;IACzE,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAkC,CAAA;IAC1F,MAAM,KAAK,GAAG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OAAO,mBAAmB,CAAA;AAC5B,CAAC;AAED,SAAS,IAAI,CAAC,YAAoB;IAChC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAA;AAClE,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dsh-plugin.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
|
|
3
|
+
"id": "com.r2049.ds-harness-remote",
|
|
4
|
+
"name": "ds-harness-remote",
|
|
5
|
+
"version": "0.4.4",
|
|
6
|
+
"manifestVersion": "0.15",
|
|
7
|
+
"facets": {
|
|
8
|
+
"host": {
|
|
9
|
+
"entry": "dist/index.js",
|
|
10
|
+
"apiVersion": "v1alpha1"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"requires": {
|
|
14
|
+
"contracts": [
|
|
15
|
+
{
|
|
16
|
+
"apiVersion": "commands.dsh/v1alpha1",
|
|
17
|
+
"kind": "Command"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"contributes": {
|
|
22
|
+
"commands": [
|
|
23
|
+
{
|
|
24
|
+
"id": "ds-harness.remote",
|
|
25
|
+
"title": "Manage Remote Host login and connection status"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"permissions": [
|
|
30
|
+
{
|
|
31
|
+
"name": "commands.invoke",
|
|
32
|
+
"scope": "ds-harness.remote",
|
|
33
|
+
"reason": "run /remote status, login, and logout from dsh-TUI"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"subscriptions": [],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"source": {
|
|
39
|
+
"repository": "https://github.com/liguobao/ds-harness-remote"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ds-harness-remote",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "DeepSeek 远程连接",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
|
+
"bin": {
|
|
16
|
+
"ds-harness-remote": "./bin/ds-harness-remote.js"
|
|
17
|
+
},
|
|
15
18
|
"types": "./public.d.ts",
|
|
16
19
|
"exports": {
|
|
17
20
|
".": {
|
|
@@ -23,7 +26,9 @@
|
|
|
23
26
|
"./package.json": "./package.json"
|
|
24
27
|
},
|
|
25
28
|
"files": [
|
|
29
|
+
"bin",
|
|
26
30
|
"dist",
|
|
31
|
+
"dsh-plugin.json",
|
|
27
32
|
"cordis.patch.yml",
|
|
28
33
|
"public.d.ts",
|
|
29
34
|
"README.md",
|
package/public.d.ts
CHANGED