@wonderwhy-er/desktop-commander 0.2.43 → 0.2.45
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/dist/bootstrap.d.ts +1 -0
- package/dist/bootstrap.js +22 -0
- package/dist/config-manager.d.ts +30 -1
- package/dist/config-manager.js +55 -8
- package/dist/handlers/filesystem-handlers.js +86 -53
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/remote-device/desktop-commander-integration.js +8 -2
- package/dist/remote-device/remote-channel.d.ts +1 -0
- package/dist/remote-device/remote-channel.js +34 -4
- package/dist/server.js +63 -22
- package/dist/tools/edit.d.ts +1 -1
- package/dist/tools/edit.js +30 -23
- package/dist/tools/filesystem.d.ts +1 -0
- package/dist/tools/filesystem.js +23 -13
- package/dist/tools/schemas.d.ts +19 -7
- package/dist/tools/schemas.js +20 -5
- package/dist/ui/config-editor/config-editor-runtime.js +49 -49
- package/dist/ui/config-editor/src/app.js +2 -11
- package/dist/ui/file-preview/preview-runtime.js +147 -146
- package/dist/ui/file-preview/src/app.js +172 -53
- package/dist/ui/file-preview/src/directory-controller.js +1 -1
- package/dist/ui/file-preview/src/markdown/controller.js +1 -0
- package/dist/ui/file-preview/src/panel-actions.js +2 -2
- package/dist/ui/file-preview/src/payload-utils.js +23 -7
- package/dist/utils/capture.d.ts +2 -0
- package/dist/utils/capture.js +19 -0
- package/dist/utils/files/base.d.ts +2 -0
- package/dist/utils/files/image.js +1 -1
- package/dist/utils/files/text.js +24 -19
- package/dist/utils/open-browser.d.ts +1 -1
- package/dist/utils/open-browser.js +5 -2
- package/dist/utils/usageTracker.d.ts +5 -1
- package/dist/utils/usageTracker.js +14 -3
- package/dist/utils/welcome-onboarding.d.ts +1 -1
- package/dist/utils/welcome-onboarding.js +2 -2
- package/dist/utils/withTimeout.d.ts +17 -0
- package/dist/utils/withTimeout.js +33 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import { capture } from './capture.js';
|
|
|
12
12
|
* 2. Users in the 'showOnboardingPage' A/B variant
|
|
13
13
|
* 3. Haven't seen it yet
|
|
14
14
|
*/
|
|
15
|
-
export async function handleWelcomePageOnboarding() {
|
|
15
|
+
export async function handleWelcomePageOnboarding(clientName) {
|
|
16
16
|
// Check if this is a new install pending A/B decision
|
|
17
17
|
// This flag is set when config is first created and survives process restarts
|
|
18
18
|
const pending = await configManager.getValue('pendingWelcomeOnboarding');
|
|
@@ -48,7 +48,7 @@ export async function handleWelcomePageOnboarding() {
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
|
-
await openWelcomePage();
|
|
51
|
+
await openWelcomePage(clientName);
|
|
52
52
|
await configManager.setValue('sawOnboardingPage', true);
|
|
53
53
|
await configManager.setValue('pendingWelcomeOnboarding', false);
|
|
54
54
|
capture('server_welcome_page_opened', { success: true });
|
|
@@ -9,3 +9,20 @@
|
|
|
9
9
|
* @returns Promise that resolves with the operation result or the default value on timeout
|
|
10
10
|
*/
|
|
11
11
|
export declare function withTimeout<T>(operation: Promise<T>, timeoutMs: number, operationName: string, defaultValue: T): Promise<T>;
|
|
12
|
+
/**
|
|
13
|
+
* Run an operation under a timeout WITH real cancellation.
|
|
14
|
+
*
|
|
15
|
+
* Unlike withTimeout (which only races a timer and leaves the underlying work
|
|
16
|
+
* running — holding its libuv thread/fd until the OS call returns), this passes
|
|
17
|
+
* an AbortSignal into the operation and aborts it when the timeout fires, so a
|
|
18
|
+
* read/stream that honors the signal is cancelled and its resources released.
|
|
19
|
+
*
|
|
20
|
+
* Rejects with an Error whose `.code` is 'ETIMEDOUT' on timeout (so existing
|
|
21
|
+
* ETIMEDOUT handling / permission-error mapping keeps working).
|
|
22
|
+
*
|
|
23
|
+
* Caveat: an operation wedged inside a single un-interruptible syscall only
|
|
24
|
+
* observes the abort once that syscall returns; library reads that ignore the
|
|
25
|
+
* signal (e.g. Excel/PDF parsers) still get the timeout rejection but keep
|
|
26
|
+
* running in the background until they finish on their own.
|
|
27
|
+
*/
|
|
28
|
+
export declare function runWithAbortableTimeout<T>(operation: (signal: AbortSignal) => Promise<T>, timeoutMs: number, operationName: string): Promise<T>;
|
|
@@ -50,3 +50,36 @@ export function withTimeout(operation, timeoutMs, operationName, defaultValue) {
|
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Run an operation under a timeout WITH real cancellation.
|
|
55
|
+
*
|
|
56
|
+
* Unlike withTimeout (which only races a timer and leaves the underlying work
|
|
57
|
+
* running — holding its libuv thread/fd until the OS call returns), this passes
|
|
58
|
+
* an AbortSignal into the operation and aborts it when the timeout fires, so a
|
|
59
|
+
* read/stream that honors the signal is cancelled and its resources released.
|
|
60
|
+
*
|
|
61
|
+
* Rejects with an Error whose `.code` is 'ETIMEDOUT' on timeout (so existing
|
|
62
|
+
* ETIMEDOUT handling / permission-error mapping keeps working).
|
|
63
|
+
*
|
|
64
|
+
* Caveat: an operation wedged inside a single un-interruptible syscall only
|
|
65
|
+
* observes the abort once that syscall returns; library reads that ignore the
|
|
66
|
+
* signal (e.g. Excel/PDF parsers) still get the timeout rejection but keep
|
|
67
|
+
* running in the background until they finish on their own.
|
|
68
|
+
*/
|
|
69
|
+
export function runWithAbortableTimeout(operation, timeoutMs, operationName) {
|
|
70
|
+
const controller = new AbortController();
|
|
71
|
+
let timeoutId;
|
|
72
|
+
const timeout = new Promise((_, reject) => {
|
|
73
|
+
timeoutId = setTimeout(() => {
|
|
74
|
+
controller.abort();
|
|
75
|
+
const error = new Error(`${operationName} timed out after ${timeoutMs / 1000} seconds`);
|
|
76
|
+
error.code = 'ETIMEDOUT';
|
|
77
|
+
reject(error);
|
|
78
|
+
}, timeoutMs);
|
|
79
|
+
});
|
|
80
|
+
const op = operation(controller.signal);
|
|
81
|
+
// Swallow the late abort rejection so it can't surface as an unhandled
|
|
82
|
+
// rejection after the timeout has already settled the race.
|
|
83
|
+
op.catch(() => { });
|
|
84
|
+
return Promise.race([op, timeout]).finally(() => clearTimeout(timeoutId));
|
|
85
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.45";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.
|
|
1
|
+
export const VERSION = '0.2.45';
|
package/package.json
CHANGED