gpui-bridge 0.5.0 → 0.6.0
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/app.d.ts +2 -2
- package/dist/app.js +3 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/protocol.d.ts +9 -0
- package/dist/txiki.d.ts +3 -0
- package/dist/txiki.js +1 -1
- package/package.json +4 -4
package/dist/app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClientMessage, type ErrorCode, type HostMessage, type MenuItem, type NodeEvents, type NodeId, type NodeProps, type NodeType, type ThemeSet, type WindowEventName, type WindowId, type WindowTheme } from "./protocol.js";
|
|
1
|
+
import { type AppIdentity, type ClientMessage, type ErrorCode, type HostMessage, type MenuItem, type NodeEvents, type NodeId, type NodeProps, type NodeType, type ThemeSet, type WindowEventName, type WindowId, type WindowTheme } from "./protocol.js";
|
|
2
2
|
import { Tree } from "./tree.js";
|
|
3
3
|
export interface HostExit {
|
|
4
4
|
code: number | null;
|
|
@@ -400,5 +400,5 @@ export declare class App {
|
|
|
400
400
|
* Starts the host through `start` and completes the handshake. Rejects with a
|
|
401
401
|
* clear message if the host cannot start.
|
|
402
402
|
*/
|
|
403
|
-
export declare function connect(hostPath: string, start: (events: HostEvents) => HostTransport): Promise<App>;
|
|
403
|
+
export declare function connect(hostPath: string, start: (events: HostEvents) => HostTransport, identity?: AppIdentity): Promise<App>;
|
|
404
404
|
export {};
|
package/dist/app.js
CHANGED
|
@@ -697,7 +697,7 @@ export class App {
|
|
|
697
697
|
* Starts the host through `start` and completes the handshake. Rejects with a
|
|
698
698
|
* clear message if the host cannot start.
|
|
699
699
|
*/
|
|
700
|
-
export function connect(hostPath, start) {
|
|
700
|
+
export function connect(hostPath, start, identity) {
|
|
701
701
|
return new Promise((resolve, reject) => {
|
|
702
702
|
let app;
|
|
703
703
|
let ready = false;
|
|
@@ -730,6 +730,7 @@ export function connect(hostPath, start) {
|
|
|
730
730
|
},
|
|
731
731
|
});
|
|
732
732
|
app = new App(host, hostPath);
|
|
733
|
-
|
|
733
|
+
// JSON leaves out an undefined `app`, so the default hello stays `{"op":"hello","protocol":1}`.
|
|
734
|
+
host.send({ op: "hello", protocol: PROTOCOL_VERSION, app: identity });
|
|
734
735
|
});
|
|
735
736
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type App } from "./app.js";
|
|
2
|
+
import type { AppIdentity } from "./protocol.js";
|
|
2
3
|
export * from "./app.js";
|
|
3
4
|
export * from "./protocol.js";
|
|
4
5
|
export interface AppOptions {
|
|
@@ -8,6 +9,8 @@ export interface AppOptions {
|
|
|
8
9
|
debug?: boolean;
|
|
9
10
|
/** Run the host without a window (`--no-window`), e.g. for tests. */
|
|
10
11
|
headless?: boolean;
|
|
12
|
+
/** Names the app for the system (`hello`): Windows shows it on system notifications. Default: `gpui-bridge`. */
|
|
13
|
+
app?: AppIdentity;
|
|
11
14
|
}
|
|
12
15
|
/** The host to run: `$GPUI_BRIDGE_HOST`, then the packaged one, then a build in this repository. */
|
|
13
16
|
export declare function defaultHostPath(): string;
|
package/dist/index.js
CHANGED
|
@@ -54,5 +54,5 @@ export function defaultHostPath() {
|
|
|
54
54
|
export function createApp(options = {}) {
|
|
55
55
|
const path = options.hostPath ?? defaultHostPath();
|
|
56
56
|
const args = options.headless ? ["--no-window"] : [];
|
|
57
|
-
return connect(path, (events) => new HostProcess({ path, args, debug: options.debug ?? false, ...events }));
|
|
57
|
+
return connect(path, (events) => new HostProcess({ path, args, debug: options.debug ?? false, ...events }), options.app);
|
|
58
58
|
}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -25,10 +25,19 @@ export interface ThemeConfig {
|
|
|
25
25
|
}
|
|
26
26
|
/** Node props on the wire. In `setProps`, a `null` value removes the prop. */
|
|
27
27
|
export type Props = Record<string, unknown>;
|
|
28
|
+
/** The app's own name for the system (`hello`): Windows shows `name` and `icon` on system notifications. */
|
|
29
|
+
export interface AppIdentity {
|
|
30
|
+
/** Windows AppUserModelID: up to 128 characters, no spaces or `\`, e.g. `"Acme.Notes"`. */
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
/** Image file shown on the app's system notifications (PNG, ICO…). */
|
|
34
|
+
icon?: string;
|
|
35
|
+
}
|
|
28
36
|
/** Messages from the client (host stdin). */
|
|
29
37
|
export type ClientMessage = {
|
|
30
38
|
op: "hello";
|
|
31
39
|
protocol: number;
|
|
40
|
+
app?: AppIdentity;
|
|
32
41
|
} | {
|
|
33
42
|
op: "window";
|
|
34
43
|
id?: WindowId;
|
package/dist/txiki.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type App } from "./app.js";
|
|
2
|
+
import type { AppIdentity } from "./protocol.js";
|
|
2
3
|
export * from "./app.js";
|
|
3
4
|
export * from "./protocol.js";
|
|
4
5
|
export interface TxikiAppOptions {
|
|
@@ -6,5 +7,7 @@ export interface TxikiAppOptions {
|
|
|
6
7
|
hostPath?: string;
|
|
7
8
|
debug?: boolean;
|
|
8
9
|
headless?: boolean;
|
|
10
|
+
/** Names the app for the system (`hello`): Windows shows it on system notifications. Default: `gpui-bridge`. */
|
|
11
|
+
app?: AppIdentity;
|
|
9
12
|
}
|
|
10
13
|
export declare function createTxikiApp(options?: TxikiAppOptions): Promise<App>;
|
package/dist/txiki.js
CHANGED
|
@@ -86,5 +86,5 @@ function defaultHostPath() {
|
|
|
86
86
|
export function createTxikiApp(options = {}) {
|
|
87
87
|
const path = options.hostPath ?? defaultHostPath();
|
|
88
88
|
const args = options.headless ? ["--no-window"] : [];
|
|
89
|
-
return connect(path, (events) => new TxikiHost(path, args, options.debug ?? false, events));
|
|
89
|
+
return connect(path, (events) => new TxikiHost(path, args, options.debug ?? false, events), options.app);
|
|
90
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gpui-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Node.js client for the gpui-bridge native UI host",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "gpui-bridge contributors",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"node": ">=22.6"
|
|
30
30
|
},
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"@indios/gpui-bridge-darwin-arm64": "0.
|
|
33
|
-
"@indios/gpui-bridge-linux-x64": "0.
|
|
34
|
-
"@indios/gpui-bridge-win32-x64": "0.
|
|
32
|
+
"@indios/gpui-bridge-darwin-arm64": "0.6.0",
|
|
33
|
+
"@indios/gpui-bridge-linux-x64": "0.6.0",
|
|
34
|
+
"@indios/gpui-bridge-win32-x64": "0.6.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^26.6.5",
|