@bobfrankston/msger 0.1.35 → 0.1.37
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 +15 -34
- package/cli.d.ts.map +1 -1
- package/cli.js +1 -1
- package/cli.js.map +1 -1
- package/cli.ts +3 -3
- package/clihandler.d.ts +1 -1
- package/clihandler.d.ts.map +1 -1
- package/clihandler.ts +1 -1
- package/index.d.ts +1 -29
- package/index.d.ts.map +1 -1
- package/index.js +2 -100
- package/index.js.map +1 -1
- package/index.ts +6 -150
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Breadcrumbs +13 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/BrowserMetrics/BrowserMetrics-68FD19A9-AF84.pma +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Crashpad/settings.dat +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/AutofillAiModelCache/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/AutofillStrikeDatabase/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/BrowsingTopicsState +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/BudgetDatabase/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/ClientCertificates/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DIPS +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DawnGraphiteCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/DawnWebGPUCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Download Service/EntryDB/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Extension State/LOG +3 -2
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Extension State/LOG.old +2 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Feature Engagement Tracker/AvailabilityDB/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Feature Engagement Tracker/EventDB/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/GPUCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG +3 -2
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG.old +2 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/PersistentOriginTrials/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Preferences +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Session Storage/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Session Storage/LOG +3 -2
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Session Storage/LOG.old +2 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOG +3 -2
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOG.old +2 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOG +3 -2
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOG.old +2 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/commerce_subscription_db/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/discount_infos_db/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/discounts_db/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/favorites_diagnostic.log +1 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/optimization_guide_hint_cache_store/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/parcel_tracking_db/LOG.old +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/LOG +3 -2
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/LOG.old +2 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/000003.log +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOG +3 -2
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOG.old +2 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/data_0 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/data_1 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/data_3 +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GrShaderCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/GraphiteDawnCache/index +0 -0
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Last Version +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Local State +1 -1
- package/msger-native/bin/msgernative.exe.WebView2/EBWebView/ShaderCache/index +0 -0
- package/msger-native/src/main.rs +0 -18
- package/msgernative-linux-x64 +0 -0
- package/msgernative-win32-x64.exe +0 -0
- package/package.json +1 -1
- package/shower.d.ts +30 -0
- package/shower.d.ts.map +1 -0
- package/shower.js +98 -0
- package/shower.js.map +1 -0
- package/shower.ts +144 -0
package/README.md
CHANGED
|
@@ -26,13 +26,6 @@ npm install -g @bobfrankston/msger
|
|
|
26
26
|
|
|
27
27
|
The correct binary is automatically selected based on your platform and architecture.
|
|
28
28
|
|
|
29
|
-
**Important: Linux/WSL Requirements**
|
|
30
|
-
- Requires a display server (X11 or Wayland)
|
|
31
|
-
- WSL users need WSLg (Windows 11) or an X server (VcXsrv, Xming)
|
|
32
|
-
- Headless systems cannot display GUI windows
|
|
33
|
-
- If you see "UnsupportedWindowHandle" error, there's no display server
|
|
34
|
-
- Alternative: Use the Windows binary directly instead of WSL
|
|
35
|
-
|
|
36
29
|
## Usage
|
|
37
30
|
|
|
38
31
|
### As a Library (Recommended)
|
|
@@ -62,25 +55,20 @@ msger -t "Hello" -m "Hello, World!"
|
|
|
62
55
|
# With HTML content
|
|
63
56
|
msger -t "Welcome" -html "<h1>Welcome!</h1><p>This is <strong>HTML</strong></p>"
|
|
64
57
|
|
|
65
|
-
# Load a URL (web page or local file)
|
|
58
|
+
# Load a URL (web page or local file)
|
|
66
59
|
msger -url "https://example.com"
|
|
67
60
|
msger -url "file:///path/to/page.html"
|
|
68
61
|
|
|
69
62
|
# With custom size
|
|
70
|
-
msger -t "Big Window" -m "Hello" -
|
|
63
|
+
msger -t "Big Window" -m "Hello" -w 800 -h 600
|
|
71
64
|
|
|
72
65
|
# With timeout (auto-close after 5 seconds)
|
|
73
66
|
msger -t "Notification" -m "This will close in 5 seconds" -timeout 5
|
|
74
67
|
|
|
75
|
-
# Detached mode - CLI exits immediately, window stays open
|
|
76
|
-
msger -detach -t "Background Window" -m "This window stays open"
|
|
77
|
-
|
|
78
68
|
# See all options
|
|
79
69
|
msger --help
|
|
80
70
|
```
|
|
81
71
|
|
|
82
|
-
**Note on `-detach` mode:** When using `-detach` in the CLI, the message box window opens and the CLI exits immediately without waiting for user interaction. The window remains open independently. This is useful for fire-and-forget notifications. In library mode, `detach: true` makes the Promise resolve immediately with `{button: 'detached'}` while the window stays open.
|
|
83
|
-
|
|
84
72
|
## API
|
|
85
73
|
|
|
86
74
|
### `showMessageBox(options: MessageBoxOptions): Promise<MessageBoxResult>`
|
|
@@ -315,28 +303,21 @@ All binaries are bundled with the npm package, and the correct one is selected a
|
|
|
315
303
|
## CLI Options
|
|
316
304
|
|
|
317
305
|
```
|
|
318
|
-
Usage: msger [options]
|
|
306
|
+
Usage: msger [options]
|
|
319
307
|
|
|
320
308
|
Options:
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
-html <html>
|
|
324
|
-
-url <url>
|
|
325
|
-
-
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
-help, --help, -? Show help message
|
|
334
|
-
|
|
335
|
-
Examples:
|
|
336
|
-
msger Hello World
|
|
337
|
-
msger -message "Save changes?" -buttons Yes No Cancel
|
|
338
|
-
msger -url "https://github.com/BobFrankston/msger"
|
|
339
|
-
msger -detach -message "Background notification"
|
|
309
|
+
-t, --title <title> Window title
|
|
310
|
+
-m, --message <message> Plain text message
|
|
311
|
+
-html, --html <html> HTML content
|
|
312
|
+
-url, --url <url> URL to load (web or file://)
|
|
313
|
+
-w, --width <width> Window width in pixels (default: 600)
|
|
314
|
+
-h, --height <height> Window height in pixels (default: 400)
|
|
315
|
+
-b, --buttons <buttons> Comma-separated button labels (default: "OK")
|
|
316
|
+
-i, --allowInput Enable input field
|
|
317
|
+
-d, --defaultValue <value> Default input value
|
|
318
|
+
-timeout, --timeout <sec> Auto-close after N seconds
|
|
319
|
+
--help Show help
|
|
320
|
+
--version Show version
|
|
340
321
|
```
|
|
341
322
|
|
|
342
323
|
## License
|
package/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["cli.ts"],"names":[],"mappings":";AAKA,wBAA8B,IAAI,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["cli.ts"],"names":[],"mappings":";AAKA,wBAA8B,IAAI,kBAuCjC"}
|
package/cli.js
CHANGED
package/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtE,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI;IAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,2BAA2B;IAC3B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpB,QAAQ,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,+BAA+B;IAC/B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAEjG,IAAI,cAAc,EAAE,CAAC;QACjB,QAAQ,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAAA,CAAC;IAErB,IAAI,iBAAiB,EAAE,CAAC;QACpB,WAAW,EAAE,CAAC;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAE7C,wDAAwD;QACxD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAE7C,iCAAiC;QACjC,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,sEAAsE;AAEtE,IAAI,EAAE,CAAC"}
|
package/cli.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { showMessageBox } from './
|
|
3
|
+
import { showMessageBox } from './shower.js';
|
|
4
4
|
import { parseCliArgs, showHelp, showVersion } from './clihandler.js';
|
|
5
5
|
|
|
6
6
|
export default async function main() {
|
|
@@ -17,8 +17,7 @@ export default async function main() {
|
|
|
17
17
|
|
|
18
18
|
if (shouldShowHelp) {
|
|
19
19
|
showHelp();
|
|
20
|
-
process.exit(0);
|
|
21
|
-
}
|
|
20
|
+
process.exit(0);}
|
|
22
21
|
|
|
23
22
|
if (shouldShowVersion) {
|
|
24
23
|
showVersion();
|
|
@@ -46,4 +45,5 @@ export default async function main() {
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
// Run main when file is executed (either directly or as a bin script)
|
|
48
|
+
|
|
49
49
|
main();
|
package/clihandler.d.ts
CHANGED
package/clihandler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clihandler.d.ts","sourceRoot":"","sources":["clihandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"clihandler.d.ts","sourceRoot":"","sources":["clihandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA4DhD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAAE,OAAO,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CA+HpH;AAED,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,wBAAgB,WAAW,IAAI,IAAI,CAElC"}
|
package/clihandler.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
title?: string; /** The title text displayed in the window title bar */
|
|
3
|
-
message?: string; /** The plain text message to display (optional if url or html is provided) */
|
|
4
|
-
html?: string; /** HTML content to display in the message box */
|
|
5
|
-
url?: string; /** URL to load external content (web URL or file path) */
|
|
6
|
-
size?: {
|
|
7
|
-
width: number; /** Window width */
|
|
8
|
-
height: number; /** Window height */
|
|
9
|
-
};
|
|
10
|
-
buttons?: string[]; /** Array of button labels to display (default: ['OK']) */
|
|
11
|
-
defaultValue?: string; /** Default value for input field when allowInput is true */
|
|
12
|
-
allowInput?: boolean; /** Enable an input field in the message box (default: false) */
|
|
13
|
-
timeout?: number; /** Auto-close the message box after specified seconds */
|
|
14
|
-
detach?: boolean; /** Launch the message box detached from parent process */
|
|
15
|
-
}
|
|
16
|
-
export interface MessageBoxResult {
|
|
17
|
-
button: string;
|
|
18
|
-
value?: string;
|
|
19
|
-
form?: Record<string, any>;
|
|
20
|
-
closed?: boolean;
|
|
21
|
-
dismissed?: boolean;
|
|
22
|
-
timeout?: boolean;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Show a message box dialog using native Rust implementation
|
|
26
|
-
* @param options Message box configuration
|
|
27
|
-
* @returns Promise that resolves with user's response
|
|
28
|
-
*/
|
|
29
|
-
export declare function showMessageBox(options: MessageBoxOptions): Promise<MessageBoxResult>;
|
|
1
|
+
export {};
|
|
30
2
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
package/index.js
CHANGED
|
@@ -1,103 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { platform } from 'os';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import fs from 'fs';
|
|
5
|
-
/**
|
|
6
|
-
* Show a message box dialog using native Rust implementation
|
|
7
|
-
* @param options Message box configuration
|
|
8
|
-
* @returns Promise that resolves with user's response
|
|
9
|
-
*/
|
|
10
|
-
export async function showMessageBox(options) {
|
|
11
|
-
return new Promise((resolve, reject) => {
|
|
12
|
-
const isWindows = platform() === 'win32';
|
|
13
|
-
const arch = process.arch;
|
|
14
|
-
// Determine the binary name based on platform and architecture
|
|
15
|
-
let binaryName;
|
|
16
|
-
if (isWindows) {
|
|
17
|
-
binaryName = 'msgernative.exe';
|
|
18
|
-
}
|
|
19
|
-
else if (arch === 'arm64') {
|
|
20
|
-
binaryName = 'msgernative-arm64';
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
binaryName = 'msgernative';
|
|
24
|
-
}
|
|
25
|
-
const binaryPath = path.join(import.meta.dirname, 'msger-native', 'bin', binaryName);
|
|
26
|
-
// Check if binary exists
|
|
27
|
-
if (!fs.existsSync(binaryPath)) {
|
|
28
|
-
reject(new Error(`Binary not found: ${binaryPath}`));
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
// On Unix systems, check if binary is executable
|
|
32
|
-
if (!isWindows) {
|
|
33
|
-
try {
|
|
34
|
-
fs.accessSync(binaryPath, fs.constants.X_OK);
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
reject(new Error(`Binary is not executable: ${binaryPath}\n` +
|
|
38
|
-
`Please run: sudo chmod +x ${binaryPath}`));
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// Spawn the Rust binary
|
|
43
|
-
const child = spawn(binaryPath, [], {
|
|
44
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
45
|
-
detached: options.detach || false
|
|
46
|
-
});
|
|
47
|
-
// If detached, unref the child so parent can exit
|
|
48
|
-
if (options.detach) {
|
|
49
|
-
child.unref();
|
|
50
|
-
}
|
|
51
|
-
let stdout = '';
|
|
52
|
-
let stderr = '';
|
|
53
|
-
// Collect stdout
|
|
54
|
-
child.stdout.on('data', (data) => {
|
|
55
|
-
stdout += data.toString();
|
|
56
|
-
});
|
|
57
|
-
// Collect stderr
|
|
58
|
-
child.stderr.on('data', (data) => {
|
|
59
|
-
stderr += data.toString();
|
|
60
|
-
});
|
|
61
|
-
// Handle process completion
|
|
62
|
-
child.on('close', (code) => {
|
|
63
|
-
if (code !== 0) {
|
|
64
|
-
reject(new Error(`msger exited with code ${code}: ${stderr}`));
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
const result = JSON.parse(stdout.trim());
|
|
69
|
-
resolve(result);
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
reject(new Error(`Failed to parse result: ${error.message}\nOutput: ${stdout}`));
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
// Handle process errors
|
|
76
|
-
child.on('error', (error) => {
|
|
77
|
-
reject(new Error(`Failed to spawn msger: ${error.message}`));
|
|
78
|
-
});
|
|
79
|
-
// Handle stdin errors (e.g., EPIPE when child dies early)
|
|
80
|
-
child.stdin.on('error', (error) => {
|
|
81
|
-
// Don't reject here - the 'close' or 'error' event will handle it
|
|
82
|
-
// This prevents unhandled EPIPE errors
|
|
83
|
-
});
|
|
84
|
-
// Send options to stdin
|
|
85
|
-
try {
|
|
86
|
-
child.stdin.write(JSON.stringify(options));
|
|
87
|
-
child.stdin.end();
|
|
88
|
-
// If detached, resolve immediately after sending options
|
|
89
|
-
if (options.detach) {
|
|
90
|
-
resolve({ button: 'detached', dismissed: false });
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
reject(new Error(`Failed to write to stdin: ${error.message}`));
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
// If run directly (not imported), invoke CLI
|
|
1
|
+
import main from "./cli.js";
|
|
99
2
|
if (import.meta.main) {
|
|
100
|
-
|
|
101
|
-
await cliMain();
|
|
3
|
+
await main();
|
|
102
4
|
}
|
|
103
5
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,UAAU,CAAC;AAG5B,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,IAAI,EAAE,CAAC;AACjB,CAAC"}
|
package/index.ts
CHANGED
|
@@ -1,150 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface MessageBoxOptions {
|
|
8
|
-
title?: string; /** The title text displayed in the window title bar */
|
|
9
|
-
message?: string; /** The plain text message to display (optional if url or html is provided) */
|
|
10
|
-
html?: string; /** HTML content to display in the message box */
|
|
11
|
-
url?: string; /** URL to load external content (web URL or file path) */
|
|
12
|
-
// fullPage?: boolean; /** Display HTML as a complete page without wrapping (default: false) */
|
|
13
|
-
size?: { /** Window size in pixels */
|
|
14
|
-
width: number; /** Window width */
|
|
15
|
-
height: number; /** Window height */
|
|
16
|
-
};
|
|
17
|
-
// pos?: { /** Window position */
|
|
18
|
-
// x: number; /** Window X position in pixels */
|
|
19
|
-
// y: number; /** Window Y position in pixels */
|
|
20
|
-
// screen?: number; /** Optional screen index (0-based, Windows only) */
|
|
21
|
-
// };
|
|
22
|
-
// zoomPercent?: number; /** Initial zoom level as percentage (100=100%, 150=150%, 50=50%, etc.) */
|
|
23
|
-
buttons?: string[]; /** Array of button labels to display (default: ['OK']) */
|
|
24
|
-
defaultValue?: string; /** Default value for input field when allowInput is true */
|
|
25
|
-
allowInput?: boolean; /** Enable an input field in the message box (default: false) */
|
|
26
|
-
// devTools?: boolean; /** Open DevTools for debugging (default: false) */
|
|
27
|
-
timeout?: number; /** Auto-close the message box after specified seconds */
|
|
28
|
-
detach?: boolean; /** Launch the message box detached from parent process */
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface MessageBoxResult {
|
|
32
|
-
button: string;
|
|
33
|
-
value?: string;
|
|
34
|
-
form?: Record<string, any>;
|
|
35
|
-
closed?: boolean;
|
|
36
|
-
dismissed?: boolean;
|
|
37
|
-
timeout?: boolean;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Show a message box dialog using native Rust implementation
|
|
42
|
-
* @param options Message box configuration
|
|
43
|
-
* @returns Promise that resolves with user's response
|
|
44
|
-
*/
|
|
45
|
-
export async function showMessageBox(options: MessageBoxOptions): Promise<MessageBoxResult> {
|
|
46
|
-
return new Promise((resolve, reject) => {
|
|
47
|
-
const isWindows = platform() === 'win32';
|
|
48
|
-
const arch = process.arch;
|
|
49
|
-
|
|
50
|
-
// Determine the binary name based on platform and architecture
|
|
51
|
-
let binaryName: string;
|
|
52
|
-
if (isWindows) {
|
|
53
|
-
binaryName = 'msgernative.exe';
|
|
54
|
-
} else if (arch === 'arm64') {
|
|
55
|
-
binaryName = 'msgernative-arm64';
|
|
56
|
-
} else {
|
|
57
|
-
binaryName = 'msgernative';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const binaryPath = path.join(import.meta.dirname, 'msger-native', 'bin', binaryName);
|
|
61
|
-
|
|
62
|
-
// Check if binary exists
|
|
63
|
-
if (!fs.existsSync(binaryPath)) {
|
|
64
|
-
reject(new Error(`Binary not found: ${binaryPath}`));
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// On Unix systems, check if binary is executable
|
|
69
|
-
if (!isWindows) {
|
|
70
|
-
try {
|
|
71
|
-
fs.accessSync(binaryPath, fs.constants.X_OK);
|
|
72
|
-
} catch (error) {
|
|
73
|
-
reject(new Error(
|
|
74
|
-
`Binary is not executable: ${binaryPath}\n` +
|
|
75
|
-
`Please run: sudo chmod +x ${binaryPath}`
|
|
76
|
-
));
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Spawn the Rust binary
|
|
82
|
-
const child = spawn(binaryPath, [], {
|
|
83
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
84
|
-
detached: options.detach || false
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
// If detached, unref the child so parent can exit
|
|
88
|
-
if (options.detach) {
|
|
89
|
-
child.unref();
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
let stdout = '';
|
|
93
|
-
let stderr = '';
|
|
94
|
-
|
|
95
|
-
// Collect stdout
|
|
96
|
-
child.stdout.on('data', (data) => {
|
|
97
|
-
stdout += data.toString();
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// Collect stderr
|
|
101
|
-
child.stderr.on('data', (data) => {
|
|
102
|
-
stderr += data.toString();
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// Handle process completion
|
|
106
|
-
child.on('close', (code) => {
|
|
107
|
-
if (code !== 0) {
|
|
108
|
-
reject(new Error(`msger exited with code ${code}: ${stderr}`));
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
try {
|
|
113
|
-
const result = JSON.parse(stdout.trim()) as MessageBoxResult;
|
|
114
|
-
resolve(result);
|
|
115
|
-
} catch (error: any) {
|
|
116
|
-
reject(new Error(`Failed to parse result: ${error.message}\nOutput: ${stdout}`));
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
// Handle process errors
|
|
121
|
-
child.on('error', (error) => {
|
|
122
|
-
reject(new Error(`Failed to spawn msger: ${error.message}`));
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// Handle stdin errors (e.g., EPIPE when child dies early)
|
|
126
|
-
child.stdin.on('error', (error: any) => {
|
|
127
|
-
// Don't reject here - the 'close' or 'error' event will handle it
|
|
128
|
-
// This prevents unhandled EPIPE errors
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
// Send options to stdin
|
|
132
|
-
try {
|
|
133
|
-
child.stdin.write(JSON.stringify(options));
|
|
134
|
-
child.stdin.end();
|
|
135
|
-
|
|
136
|
-
// If detached, resolve immediately after sending options
|
|
137
|
-
if (options.detach) {
|
|
138
|
-
resolve({ button: 'detached', dismissed: false });
|
|
139
|
-
}
|
|
140
|
-
} catch (error: any) {
|
|
141
|
-
reject(new Error(`Failed to write to stdin: ${error.message}`));
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// If run directly (not imported), invoke CLI
|
|
147
|
-
if (import.meta.main) {
|
|
148
|
-
const { default: cliMain } = await import('./cli.js');
|
|
149
|
-
await cliMain();
|
|
150
|
-
}
|
|
1
|
+
import main from "./cli.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
if (import.meta.main) {
|
|
5
|
+
await main();
|
|
6
|
+
}
|
|
@@ -11,3 +11,16 @@
|
|
|
11
11
|
0:00:00 Tab1 FinishNav2
|
|
12
12
|
0:00:00 Tab1 PageLoad
|
|
13
13
|
0:00:08 Microsoft.Shutdown.TabStripModel.SendDetachWebContentsNotifications
|
|
14
|
+
0:00:00 Startup
|
|
15
|
+
0:00:00 Microsoft.DeleteProfileHelper.CleanUpEphemeralProfiles
|
|
16
|
+
0:00:00 Microsoft.DeleteProfileHelper.CleanUpDeletedProfiles
|
|
17
|
+
0:00:00 Microsoft.NewBrowser_Popup
|
|
18
|
+
0:00:00 Microsoft.BrowserList.AddBrowser
|
|
19
|
+
0:00:00 Browser1 Insert active Tab1 at 0
|
|
20
|
+
0:00:00 Tab1 StartNav1 #auto_toplevel
|
|
21
|
+
0:00:00 Tab1 FinishNav1
|
|
22
|
+
0:00:00 Tab1 PageLoad
|
|
23
|
+
0:00:00 Tab1 StartNav2 #link
|
|
24
|
+
0:00:00 Tab1 FinishNav2
|
|
25
|
+
0:00:00 Tab1 PageLoad
|
|
26
|
+
0:00:03 Microsoft.Shutdown.TabStripModel.SendDetachWebContentsNotifications
|
|
Binary file
|
|
Binary file
|
package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/AutofillAiModelCache/LOG.old
ADDED
|
File without changes
|
package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/AutofillStrikeDatabase/LOG.old
ADDED
|
File without changes
|
|
File without changes
|
package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/ClientCertificates/LOG.old
ADDED
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Download Service/EntryDB/LOG.old
ADDED
|
File without changes
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
2025/10/
|
|
2
|
-
2025/10/
|
|
1
|
+
2025/10/25-14:40:42.612 d01c Reusing MANIFEST Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Extension State/MANIFEST-000001
|
|
2
|
+
2025/10/25-14:40:42.614 d01c Recovering log #3
|
|
3
|
+
2025/10/25-14:40:42.614 d01c Reusing old log Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Extension State/000003.log
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
2025/10/22-15:11:59.216 8b50 Creating DB Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Extension State since it was missing.
|
|
2
|
+
2025/10/22-15:11:59.315 8b50 Reusing MANIFEST Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Extension State/MANIFEST-000001
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
2025/10/
|
|
2
|
-
2025/10/
|
|
1
|
+
2025/10/25-14:40:42.503 d3ac Reusing MANIFEST Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
|
|
2
|
+
2025/10/25-14:40:42.526 d3ac Recovering log #3
|
|
3
|
+
2025/10/25-14:40:42.532 d3ac Reusing old log Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Local Storage\leveldb/000003.log
|
package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG.old
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
2025/10/22-15:11:59.138 1e70 Creating DB Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Local Storage\leveldb since it was missing.
|
|
2
|
+
2025/10/22-15:11:59.206 1e70 Reusing MANIFEST Y:\dev\utils\msger\msger-native\bin\msgernative.exe.WebView2\EBWebView\Default\Local Storage\leveldb/MANIFEST-000001
|
package/msger-native/bin/msgernative.exe.WebView2/EBWebView/Default/PersistentOriginTrials/LOG.old
ADDED
|
File without changes
|