@opentray/spec 0.1.0 → 0.3.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/README.md +12 -1
- package/dist/index.d.mts +102 -34
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +62 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ Shared TypeScript protocol and contract package for OpenTray.
|
|
|
5
5
|
## Role
|
|
6
6
|
|
|
7
7
|
- Define JSON-RPC payload shapes.
|
|
8
|
-
- Define
|
|
8
|
+
- Define broker protocol version and endpoint identity helpers.
|
|
9
|
+
- Define public `Space`, `Tray`, `Session`, and extension contract types.
|
|
9
10
|
- Keep protocol types reusable by the `opentray` package and official extensions.
|
|
10
11
|
|
|
11
12
|
This package must stay platform-neutral and must not import native implementation packages.
|
|
@@ -17,3 +18,13 @@ Run a protocol parser example that shows successful server-frame parsing and mal
|
|
|
17
18
|
```bash
|
|
18
19
|
pnpm --filter @opentray/spec example:parse
|
|
19
20
|
```
|
|
21
|
+
|
|
22
|
+
Endpoint identity is version-scoped during the current unstable broker stage:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { createBrokerEndpointIdentity, formatUnixSocketPath } from "@opentray/spec";
|
|
26
|
+
|
|
27
|
+
const identity = createBrokerEndpointIdentity({ packageVersion: "0.1.0" });
|
|
28
|
+
console.log(formatUnixSocketPath("~", identity));
|
|
29
|
+
// ~/.opentray/0.1.0/opentray-p1.sock
|
|
30
|
+
```
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
//#region src/index.d.ts
|
|
2
|
-
type
|
|
3
|
-
type
|
|
2
|
+
type SessionId = string;
|
|
3
|
+
type RequestId = string;
|
|
4
|
+
type SpaceId = string;
|
|
4
5
|
type TrayId = string;
|
|
5
6
|
type MenuItemId = number;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
/** @deprecated Use `SessionId`. */
|
|
8
|
+
type LeaseId = SessionId;
|
|
9
|
+
/** @deprecated Use `SpaceId`. */
|
|
10
|
+
type SurfaceId = SpaceId;
|
|
11
|
+
declare const PROTOCOL_VERSION = 1;
|
|
12
|
+
interface BrokerEndpointIdentity {
|
|
13
|
+
packageVersion: string;
|
|
14
|
+
protocolVersion: number;
|
|
15
|
+
}
|
|
16
|
+
interface BrokerEndpointIdentityOptions {
|
|
17
|
+
packageVersion: string;
|
|
18
|
+
protocolVersion?: number;
|
|
19
|
+
}
|
|
20
|
+
declare const createBrokerEndpointIdentity: ({
|
|
21
|
+
packageVersion,
|
|
22
|
+
protocolVersion
|
|
23
|
+
}: BrokerEndpointIdentityOptions) => BrokerEndpointIdentity;
|
|
24
|
+
declare const isSupportedProtocolVersion: (protocolVersion: number) => boolean;
|
|
25
|
+
declare const formatBrokerEndpointName: (identity: BrokerEndpointIdentity) => string;
|
|
26
|
+
declare const formatBrokerStateRoot: (homeDir: string, identity: BrokerEndpointIdentity) => string;
|
|
27
|
+
declare const formatUnixSocketPath: (homeDir: string, identity: BrokerEndpointIdentity) => string;
|
|
28
|
+
declare const formatWindowsPipeName: (identity: BrokerEndpointIdentity) => string;
|
|
29
|
+
interface SpaceOptions {
|
|
30
|
+
id?: SpaceId;
|
|
8
31
|
title?: string;
|
|
9
32
|
icon?: Icon;
|
|
10
33
|
default?: boolean;
|
|
11
34
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
35
|
+
/** @deprecated Use `SpaceOptions`. */
|
|
36
|
+
type SurfaceOptions = SpaceOptions;
|
|
37
|
+
interface SpaceRef {
|
|
38
|
+
spaceId: SpaceId;
|
|
15
39
|
}
|
|
40
|
+
/** @deprecated Use `SpaceRef`. */
|
|
41
|
+
type SurfaceRef = SpaceRef;
|
|
16
42
|
interface TrayOptions {
|
|
17
43
|
trayId?: TrayId;
|
|
18
44
|
appId?: string;
|
|
@@ -76,27 +102,27 @@ interface Rect {
|
|
|
76
102
|
type MouseButton = "left" | "right" | "middle";
|
|
77
103
|
type TrayEvent = {
|
|
78
104
|
type: "ready";
|
|
79
|
-
|
|
105
|
+
spaceId: SpaceId;
|
|
80
106
|
} | {
|
|
81
107
|
type: "menuClick";
|
|
82
|
-
|
|
108
|
+
spaceId: SpaceId;
|
|
83
109
|
trayId: TrayId;
|
|
84
110
|
itemId: MenuItemId;
|
|
85
111
|
} | {
|
|
86
112
|
type: "trayClick";
|
|
87
|
-
|
|
113
|
+
spaceId: SpaceId;
|
|
88
114
|
button: MouseButton;
|
|
89
115
|
x: number;
|
|
90
116
|
y: number;
|
|
91
117
|
} | {
|
|
92
118
|
type: "trayDoubleClick";
|
|
93
|
-
|
|
119
|
+
spaceId: SpaceId;
|
|
94
120
|
button: MouseButton;
|
|
95
121
|
x: number;
|
|
96
122
|
y: number;
|
|
97
123
|
};
|
|
98
124
|
interface ExtensionScope {
|
|
99
|
-
|
|
125
|
+
spaceId: SpaceId;
|
|
100
126
|
trayId?: TrayId;
|
|
101
127
|
ext: string;
|
|
102
128
|
}
|
|
@@ -104,78 +130,120 @@ interface ExtensionEnvelope<TData = unknown> {
|
|
|
104
130
|
scope: ExtensionScope;
|
|
105
131
|
data: TData;
|
|
106
132
|
}
|
|
133
|
+
interface DaemonSessionHealth {
|
|
134
|
+
sessionId: number;
|
|
135
|
+
internalLeaseId?: SessionId;
|
|
136
|
+
initialized: boolean;
|
|
137
|
+
}
|
|
138
|
+
interface DaemonHealth {
|
|
139
|
+
pid: number;
|
|
140
|
+
packageVersion: string;
|
|
141
|
+
protocolVersion: number;
|
|
142
|
+
endpoint: string;
|
|
143
|
+
sessionCount: number;
|
|
144
|
+
sessions: DaemonSessionHealth[];
|
|
145
|
+
}
|
|
107
146
|
type ClientFrame = {
|
|
108
147
|
type: "init";
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
148
|
+
protocolVersion: number;
|
|
149
|
+
clientVersion: string;
|
|
150
|
+
} | ClientRequestFrame | {
|
|
151
|
+
type: "exit";
|
|
152
|
+
};
|
|
153
|
+
type ClientRequestFrame = ({
|
|
154
|
+
type: "create-space";
|
|
155
|
+
requestId: RequestId;
|
|
156
|
+
} & SpaceOptions) | {
|
|
157
|
+
type: "resolve-default-space";
|
|
158
|
+
requestId: RequestId;
|
|
114
159
|
} | {
|
|
115
160
|
type: "create-tray";
|
|
116
|
-
|
|
161
|
+
requestId: RequestId;
|
|
162
|
+
space: SpaceRef;
|
|
117
163
|
tray: TrayOptions;
|
|
118
164
|
} | {
|
|
119
165
|
type: "destroy-tray";
|
|
120
|
-
|
|
166
|
+
requestId: RequestId;
|
|
167
|
+
spaceId: SpaceId;
|
|
121
168
|
trayId: TrayId;
|
|
122
169
|
} | {
|
|
123
170
|
type: "set-tray-menu";
|
|
124
|
-
|
|
171
|
+
requestId: RequestId;
|
|
172
|
+
spaceId: SpaceId;
|
|
125
173
|
trayId: TrayId;
|
|
126
174
|
menu: Menu;
|
|
127
175
|
} | {
|
|
128
176
|
type: "set-tray-icon";
|
|
129
|
-
|
|
177
|
+
requestId: RequestId;
|
|
178
|
+
spaceId: SpaceId;
|
|
130
179
|
trayId: TrayId;
|
|
131
180
|
icon: Icon;
|
|
132
181
|
} | {
|
|
133
182
|
type: "set-tray-tooltip";
|
|
134
|
-
|
|
183
|
+
requestId: RequestId;
|
|
184
|
+
spaceId: SpaceId;
|
|
135
185
|
trayId: TrayId;
|
|
136
186
|
tooltip: Tooltip;
|
|
137
187
|
} | {
|
|
138
188
|
type: "load-ext";
|
|
139
|
-
|
|
189
|
+
requestId: RequestId;
|
|
190
|
+
spaceId: SpaceId;
|
|
140
191
|
name: string;
|
|
141
192
|
path: string;
|
|
142
193
|
} | {
|
|
143
194
|
type: "ext-command";
|
|
144
|
-
|
|
195
|
+
requestId: RequestId;
|
|
196
|
+
spaceId: SpaceId;
|
|
145
197
|
trayId: TrayId;
|
|
146
198
|
ext: string;
|
|
147
199
|
data: unknown;
|
|
148
200
|
} | {
|
|
149
201
|
type: "unload-ext";
|
|
150
|
-
|
|
202
|
+
requestId: RequestId;
|
|
203
|
+
spaceId: SpaceId;
|
|
151
204
|
name: string;
|
|
152
205
|
} | {
|
|
153
|
-
type: "
|
|
206
|
+
type: "health";
|
|
207
|
+
requestId: RequestId;
|
|
154
208
|
};
|
|
155
209
|
type ServerFrame = {
|
|
156
210
|
type: "ready";
|
|
157
|
-
|
|
211
|
+
protocolVersion: number;
|
|
212
|
+
brokerVersion: string;
|
|
213
|
+
sessionId: SessionId;
|
|
158
214
|
} | {
|
|
159
|
-
type: "
|
|
160
|
-
|
|
215
|
+
type: "space-created";
|
|
216
|
+
requestId: RequestId;
|
|
217
|
+
space: SpaceRef;
|
|
161
218
|
} | {
|
|
162
|
-
type: "default-
|
|
163
|
-
|
|
219
|
+
type: "default-space";
|
|
220
|
+
requestId: RequestId;
|
|
221
|
+
space: SpaceRef;
|
|
164
222
|
} | {
|
|
165
223
|
type: "tray-created";
|
|
166
|
-
|
|
224
|
+
requestId: RequestId;
|
|
225
|
+
spaceId: SpaceId;
|
|
167
226
|
trayId: TrayId;
|
|
227
|
+
} | {
|
|
228
|
+
type: "ack";
|
|
229
|
+
requestId: RequestId;
|
|
230
|
+
} | {
|
|
231
|
+
type: "daemon-health";
|
|
232
|
+
requestId: RequestId;
|
|
233
|
+
health: DaemonHealth;
|
|
168
234
|
} | {
|
|
169
235
|
type: "event";
|
|
170
236
|
event: TrayEvent;
|
|
171
237
|
} | {
|
|
172
238
|
type: "ext-event";
|
|
173
|
-
|
|
239
|
+
spaceId: SpaceId;
|
|
174
240
|
trayId: TrayId;
|
|
175
241
|
ext: string;
|
|
176
242
|
data: unknown;
|
|
177
243
|
} | {
|
|
178
244
|
type: "error";
|
|
245
|
+
requestId?: RequestId;
|
|
246
|
+
code: string;
|
|
179
247
|
message: string;
|
|
180
248
|
};
|
|
181
249
|
interface ParseResult<T> {
|
|
@@ -186,5 +254,5 @@ interface ParseResult<T> {
|
|
|
186
254
|
declare const parseServerFrame: (line: string) => ParseResult<ServerFrame>;
|
|
187
255
|
declare const isServerFrame: (value: unknown) => value is ServerFrame;
|
|
188
256
|
//#endregion
|
|
189
|
-
export { ClientFrame, ExtensionEnvelope, ExtensionScope, Icon, LeaseId, Menu, MenuItem, MenuItemId, MouseButton, ParseResult, Rect, ServerFrame, SurfaceId, SurfaceOptions, SurfaceRef, Tooltip, TrayEvent, TrayId, TrayOptions, isServerFrame, parseServerFrame };
|
|
257
|
+
export { BrokerEndpointIdentity, BrokerEndpointIdentityOptions, ClientFrame, ClientRequestFrame, DaemonHealth, DaemonSessionHealth, ExtensionEnvelope, ExtensionScope, Icon, LeaseId, Menu, MenuItem, MenuItemId, MouseButton, PROTOCOL_VERSION, ParseResult, Rect, RequestId, ServerFrame, SessionId, SpaceId, SpaceOptions, SpaceRef, SurfaceId, SurfaceOptions, SurfaceRef, Tooltip, TrayEvent, TrayId, TrayOptions, createBrokerEndpointIdentity, formatBrokerEndpointName, formatBrokerStateRoot, formatUnixSocketPath, formatWindowsPipeName, isServerFrame, isSupportedProtocolVersion, parseServerFrame };
|
|
190
258
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";KAAY,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";KAAY,SAAA;AAAA,KACA,SAAA;AAAA,KACA,OAAA;AAAA,KACA,MAAA;AAAA,KACA,UAAA;AAJS;AAAA,KAOT,OAAA,GAAU,SAAS;;KAEnB,SAAA,GAAY,OAAO;AAAA,cAElB,gBAAA;AAAA,UAEI,sBAAA;EACf,cAAA;EACA,eAAe;AAAA;AAAA,UAGA,6BAAA;EACf,cAAA;EACA,eAAe;AAAA;AAAA,cAGJ,4BAAA;EAAgC,cAAA;EAAA;AAAA,GAG1C,6BAAA,KAAgC,sBA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A;EACf,EAAA;EACA,KAAA,GAAQ,CAAC;EACT,KAAA;AAAA;AAAA,cAGW,gBAAA,GAAoB,IAAA,aAAe,WAAW,CAAC,WAAA;AAAA,cAkB/C,aAAA,GAAiB,KAAA,cAAiB,KAAA,IAAS,WA2CvD"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
//#region src/index.ts
|
|
2
|
+
const PROTOCOL_VERSION = 1;
|
|
3
|
+
const createBrokerEndpointIdentity = ({ packageVersion, protocolVersion = 1 }) => {
|
|
4
|
+
assertEndpointComponent(packageVersion, "packageVersion");
|
|
5
|
+
if (!Number.isInteger(protocolVersion) || protocolVersion <= 0) throw new Error(`protocolVersion must be a positive integer: ${protocolVersion}`);
|
|
6
|
+
return {
|
|
7
|
+
packageVersion,
|
|
8
|
+
protocolVersion
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const isSupportedProtocolVersion = (protocolVersion) => protocolVersion === 1;
|
|
12
|
+
const formatBrokerEndpointName = (identity) => {
|
|
13
|
+
assertEndpointIdentity(identity);
|
|
14
|
+
return `opentray-${identity.packageVersion}-p${identity.protocolVersion}`;
|
|
15
|
+
};
|
|
16
|
+
const formatBrokerStateRoot = (homeDir, identity) => {
|
|
17
|
+
assertEndpointIdentity(identity);
|
|
18
|
+
if (homeDir.length === 0) throw new Error("homeDir must not be empty");
|
|
19
|
+
return `${homeDir.replace(/[\\/]+$/u, "")}/.opentray/${identity.packageVersion}`;
|
|
20
|
+
};
|
|
21
|
+
const formatUnixSocketPath = (homeDir, identity) => `${formatBrokerStateRoot(homeDir, identity)}/opentray-p${identity.protocolVersion}.sock`;
|
|
22
|
+
const formatWindowsPipeName = (identity) => `\\\\.\\pipe\\${formatBrokerEndpointName(identity)}`;
|
|
23
|
+
const endpointComponentPattern = /^[0-9A-Za-z._+-]+$/u;
|
|
24
|
+
const assertEndpointIdentity = (identity) => {
|
|
25
|
+
assertEndpointComponent(identity.packageVersion, "packageVersion");
|
|
26
|
+
if (!Number.isInteger(identity.protocolVersion) || identity.protocolVersion <= 0) throw new Error(`protocolVersion must be a positive integer: ${identity.protocolVersion}`);
|
|
27
|
+
};
|
|
28
|
+
const assertEndpointComponent = (value, name) => {
|
|
29
|
+
if (value.length === 0) throw new Error(`${name} must not be empty`);
|
|
30
|
+
if (!endpointComponentPattern.test(value)) throw new Error(`${name} contains invalid endpoint characters: ${value}`);
|
|
31
|
+
};
|
|
2
32
|
const parseServerFrame = (line) => {
|
|
3
33
|
try {
|
|
4
34
|
const value = JSON.parse(line);
|
|
@@ -18,8 +48,38 @@ const parseServerFrame = (line) => {
|
|
|
18
48
|
}
|
|
19
49
|
};
|
|
20
50
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21
|
-
const isServerFrame = (value) =>
|
|
51
|
+
const isServerFrame = (value) => {
|
|
52
|
+
if (!isRecord(value) || typeof value.type !== "string") return false;
|
|
53
|
+
switch (value.type) {
|
|
54
|
+
case "ready": return typeof value.protocolVersion === "number" && typeof value.brokerVersion === "string" && typeof value.sessionId === "string";
|
|
55
|
+
case "space-created": return typeof value.requestId === "string" && isRecord(value.space);
|
|
56
|
+
case "default-space": return typeof value.requestId === "string" && isRecord(value.space);
|
|
57
|
+
case "tray-created": return typeof value.requestId === "string" && typeof value.spaceId === "string" && typeof value.trayId === "string";
|
|
58
|
+
case "ack": return typeof value.requestId === "string";
|
|
59
|
+
case "daemon-health": return typeof value.requestId === "string" && isDaemonHealth(value.health);
|
|
60
|
+
case "event": return isTrayEvent(value.event);
|
|
61
|
+
case "ext-event": return typeof value.spaceId === "string" && typeof value.trayId === "string" && typeof value.ext === "string";
|
|
62
|
+
case "error": return (value.requestId === void 0 || typeof value.requestId === "string") && typeof value.code === "string" && typeof value.message === "string";
|
|
63
|
+
default: return false;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const isDaemonHealth = (value) => {
|
|
67
|
+
if (!isRecord(value)) return false;
|
|
68
|
+
return typeof value.pid === "number" && typeof value.packageVersion === "string" && typeof value.protocolVersion === "number" && typeof value.endpoint === "string" && typeof value.sessionCount === "number" && Array.isArray(value.sessions) && value.sessions.every(isDaemonSessionHealth);
|
|
69
|
+
};
|
|
70
|
+
const isDaemonSessionHealth = (value) => isRecord(value) && typeof value.sessionId === "number" && (value.internalLeaseId === void 0 || typeof value.internalLeaseId === "string") && typeof value.initialized === "boolean";
|
|
71
|
+
const isTrayEvent = (value) => {
|
|
72
|
+
if (!isRecord(value) || typeof value.type !== "string") return false;
|
|
73
|
+
switch (value.type) {
|
|
74
|
+
case "ready": return typeof value.spaceId === "string";
|
|
75
|
+
case "menuClick": return typeof value.spaceId === "string" && typeof value.trayId === "string" && typeof value.itemId === "number";
|
|
76
|
+
case "trayClick":
|
|
77
|
+
case "trayDoubleClick": return typeof value.spaceId === "string" && isMouseButton(value.button) && typeof value.x === "number" && typeof value.y === "number";
|
|
78
|
+
default: return false;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const isMouseButton = (value) => value === "left" || value === "right" || value === "middle";
|
|
22
82
|
//#endregion
|
|
23
|
-
export { isServerFrame, parseServerFrame };
|
|
83
|
+
export { PROTOCOL_VERSION, createBrokerEndpointIdentity, formatBrokerEndpointName, formatBrokerStateRoot, formatUnixSocketPath, formatWindowsPipeName, isServerFrame, isSupportedProtocolVersion, parseServerFrame };
|
|
24
84
|
|
|
25
85
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export type LeaseId = string;\nexport type SurfaceId = string;\nexport type TrayId = string;\nexport type MenuItemId = number;\n\nexport interface SurfaceOptions {\n appId: string;\n title?: string;\n icon?: Icon;\n default?: boolean;\n}\n\nexport interface SurfaceRef {\n surfaceId: SurfaceId;\n appId: string;\n}\n\nexport interface TrayOptions {\n trayId?: TrayId;\n appId?: string;\n title?: string;\n tooltip?: Tooltip;\n icon: Icon;\n menu?: Menu;\n}\n\nexport interface Tooltip {\n title: string;\n description: string;\n}\n\nexport interface Menu {\n items: MenuItem[];\n}\n\nexport type MenuItem =\n | {\n type: \"item\";\n id: MenuItemId;\n title: string;\n enabled?: boolean;\n shortcut?: string;\n }\n | {\n type: \"check\";\n id: MenuItemId;\n title: string;\n enabled?: boolean;\n checked?: boolean;\n }\n | {\n type: \"radio\";\n id: MenuItemId;\n title: string;\n enabled?: boolean;\n checked?: boolean;\n group: number;\n }\n | {\n type: \"separator\";\n }\n | {\n type: \"submenu\";\n title: string;\n enabled?: boolean;\n items: MenuItem[];\n };\n\nexport type Icon =\n | { type: \"rgba\"; data: Uint8Array | number[]; width: number; height: number }\n | { type: \"encoded\"; data: Uint8Array | number[] }\n | { type: \"file\"; path: string };\n\nexport interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport type MouseButton = \"left\" | \"right\" | \"middle\";\n\nexport type TrayEvent =\n | { type: \"ready\"; surfaceId: SurfaceId }\n | { type: \"menuClick\"; surfaceId: SurfaceId; trayId: TrayId; itemId: MenuItemId }\n | { type: \"trayClick\"; surfaceId: SurfaceId; button: MouseButton; x: number; y: number }\n | { type: \"trayDoubleClick\"; surfaceId: SurfaceId; button: MouseButton; x: number; y: number };\n\nexport interface ExtensionScope {\n surfaceId: SurfaceId;\n trayId?: TrayId;\n ext: string;\n}\n\nexport interface ExtensionEnvelope<TData = unknown> {\n scope: ExtensionScope;\n data: TData;\n}\n\nexport type ClientFrame =\n | { type: \"init\"; version: number }\n | ({ type: \"create-surface\" } & SurfaceOptions)\n | { type: \"resolve-default-surface\" }\n | { type: \"create-tray\"; surface: SurfaceRef; tray: TrayOptions }\n | { type: \"destroy-tray\"; surfaceId: SurfaceId; trayId: TrayId }\n | { type: \"set-tray-menu\"; surfaceId: SurfaceId; trayId: TrayId; menu: Menu }\n | { type: \"set-tray-icon\"; surfaceId: SurfaceId; trayId: TrayId; icon: Icon }\n | { type: \"set-tray-tooltip\"; surfaceId: SurfaceId; trayId: TrayId; tooltip: Tooltip }\n | { type: \"load-ext\"; surfaceId: SurfaceId; name: string; path: string }\n | { type: \"ext-command\"; surfaceId: SurfaceId; trayId: TrayId; ext: string; data: unknown }\n | { type: \"unload-ext\"; surfaceId: SurfaceId; name: string }\n | { type: \"exit\" };\n\nexport type ServerFrame =\n | { type: \"ready\"; version: number }\n | { type: \"surface-created\"; surface: SurfaceRef }\n | { type: \"default-surface\"; surface: SurfaceRef }\n | { type: \"tray-created\"; surfaceId: SurfaceId; trayId: TrayId }\n | { type: \"event\"; event: TrayEvent }\n | { type: \"ext-event\"; surfaceId: SurfaceId; trayId: TrayId; ext: string; data: unknown }\n | { type: \"error\"; message: string };\n\nexport interface ParseResult<T> {\n ok: boolean;\n frame?: T;\n error?: string;\n}\n\nexport const parseServerFrame = (line: string): ParseResult<ServerFrame> => {\n try {\n const value: unknown = JSON.parse(line);\n if (!isServerFrame(value)) {\n return { ok: false, error: \"invalid server frame\" };\n }\n return { ok: true, frame: value };\n } catch (error) {\n return {\n ok: false,\n error: error instanceof Error ? error.message : \"unknown parse error\",\n };\n }\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport const isServerFrame = (value: unknown): value is ServerFrame =>\n isRecord(value) && typeof value.type === \"string\";\n"],"mappings":";AAgIA,MAAa,oBAAoB,SAA2C;CAC1E,IAAI;EACF,MAAM,QAAiB,KAAK,MAAM,IAAI;EACtC,IAAI,CAAC,cAAc,KAAK,GACtB,OAAO;GAAE,IAAI;GAAO,OAAO;EAAuB;EAEpD,OAAO;GAAE,IAAI;GAAM,OAAO;EAAM;CAClC,SAAS,OAAO;EACd,OAAO;GACL,IAAI;GACJ,OAAO,iBAAiB,QAAQ,MAAM,UAAU;EAClD;CACF;AACF;AAEA,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,MAAa,iBAAiB,UAC5B,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export type SessionId = string;\nexport type RequestId = string;\nexport type SpaceId = string;\nexport type TrayId = string;\nexport type MenuItemId = number;\n\n/** @deprecated Use `SessionId`. */\nexport type LeaseId = SessionId;\n/** @deprecated Use `SpaceId`. */\nexport type SurfaceId = SpaceId;\n\nexport const PROTOCOL_VERSION = 1;\n\nexport interface BrokerEndpointIdentity {\n packageVersion: string;\n protocolVersion: number;\n}\n\nexport interface BrokerEndpointIdentityOptions {\n packageVersion: string;\n protocolVersion?: number;\n}\n\nexport const createBrokerEndpointIdentity = ({\n packageVersion,\n protocolVersion = PROTOCOL_VERSION,\n}: BrokerEndpointIdentityOptions): BrokerEndpointIdentity => {\n assertEndpointComponent(packageVersion, \"packageVersion\");\n if (!Number.isInteger(protocolVersion) || protocolVersion <= 0) {\n throw new Error(`protocolVersion must be a positive integer: ${protocolVersion}`);\n }\n\n return {\n packageVersion,\n protocolVersion,\n };\n};\n\nexport const isSupportedProtocolVersion = (protocolVersion: number): boolean =>\n protocolVersion === PROTOCOL_VERSION;\n\nexport const formatBrokerEndpointName = (identity: BrokerEndpointIdentity): string => {\n assertEndpointIdentity(identity);\n return `opentray-${identity.packageVersion}-p${identity.protocolVersion}`;\n};\n\nexport const formatBrokerStateRoot = (homeDir: string, identity: BrokerEndpointIdentity): string => {\n assertEndpointIdentity(identity);\n if (homeDir.length === 0) {\n throw new Error(\"homeDir must not be empty\");\n }\n\n const normalizedHome = homeDir.replace(/[\\\\/]+$/u, \"\");\n return `${normalizedHome}/.opentray/${identity.packageVersion}`;\n};\n\nexport const formatUnixSocketPath = (homeDir: string, identity: BrokerEndpointIdentity): string =>\n `${formatBrokerStateRoot(homeDir, identity)}/opentray-p${identity.protocolVersion}.sock`;\n\nexport const formatWindowsPipeName = (identity: BrokerEndpointIdentity): string =>\n `\\\\\\\\.\\\\pipe\\\\${formatBrokerEndpointName(identity)}`;\n\nconst endpointComponentPattern = /^[0-9A-Za-z._+-]+$/u;\n\nconst assertEndpointIdentity = (identity: BrokerEndpointIdentity): void => {\n assertEndpointComponent(identity.packageVersion, \"packageVersion\");\n if (!Number.isInteger(identity.protocolVersion) || identity.protocolVersion <= 0) {\n throw new Error(`protocolVersion must be a positive integer: ${identity.protocolVersion}`);\n }\n};\n\nconst assertEndpointComponent = (value: string, name: string): void => {\n if (value.length === 0) {\n throw new Error(`${name} must not be empty`);\n }\n if (!endpointComponentPattern.test(value)) {\n throw new Error(`${name} contains invalid endpoint characters: ${value}`);\n }\n};\n\nexport interface SpaceOptions {\n id?: SpaceId;\n title?: string;\n icon?: Icon;\n default?: boolean;\n}\n\n/** @deprecated Use `SpaceOptions`. */\nexport type SurfaceOptions = SpaceOptions;\n\nexport interface SpaceRef {\n spaceId: SpaceId;\n}\n\n/** @deprecated Use `SpaceRef`. */\nexport type SurfaceRef = SpaceRef;\n\nexport interface TrayOptions {\n trayId?: TrayId;\n appId?: string;\n title?: string;\n tooltip?: Tooltip;\n icon: Icon;\n menu?: Menu;\n}\n\nexport interface Tooltip {\n title: string;\n description: string;\n}\n\nexport interface Menu {\n items: MenuItem[];\n}\n\nexport type MenuItem =\n | {\n type: \"item\";\n id: MenuItemId;\n title: string;\n enabled?: boolean;\n shortcut?: string;\n }\n | {\n type: \"check\";\n id: MenuItemId;\n title: string;\n enabled?: boolean;\n checked?: boolean;\n }\n | {\n type: \"radio\";\n id: MenuItemId;\n title: string;\n enabled?: boolean;\n checked?: boolean;\n group: number;\n }\n | {\n type: \"separator\";\n }\n | {\n type: \"submenu\";\n title: string;\n enabled?: boolean;\n items: MenuItem[];\n };\n\nexport type Icon =\n | { type: \"rgba\"; data: Uint8Array | number[]; width: number; height: number }\n | { type: \"encoded\"; data: Uint8Array | number[] }\n | { type: \"file\"; path: string };\n\nexport interface Rect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport type MouseButton = \"left\" | \"right\" | \"middle\";\n\nexport type TrayEvent =\n | { type: \"ready\"; spaceId: SpaceId }\n | { type: \"menuClick\"; spaceId: SpaceId; trayId: TrayId; itemId: MenuItemId }\n | { type: \"trayClick\"; spaceId: SpaceId; button: MouseButton; x: number; y: number }\n | { type: \"trayDoubleClick\"; spaceId: SpaceId; button: MouseButton; x: number; y: number };\n\nexport interface ExtensionScope {\n spaceId: SpaceId;\n trayId?: TrayId;\n ext: string;\n}\n\nexport interface ExtensionEnvelope<TData = unknown> {\n scope: ExtensionScope;\n data: TData;\n}\n\nexport interface DaemonSessionHealth {\n sessionId: number;\n internalLeaseId?: SessionId;\n initialized: boolean;\n}\n\nexport interface DaemonHealth {\n pid: number;\n packageVersion: string;\n protocolVersion: number;\n endpoint: string;\n sessionCount: number;\n sessions: DaemonSessionHealth[];\n}\n\nexport type ClientFrame =\n | { type: \"init\"; protocolVersion: number; clientVersion: string }\n | ClientRequestFrame\n | { type: \"exit\" };\n\nexport type ClientRequestFrame =\n | ({ type: \"create-space\"; requestId: RequestId } & SpaceOptions)\n | { type: \"resolve-default-space\"; requestId: RequestId }\n | { type: \"create-tray\"; requestId: RequestId; space: SpaceRef; tray: TrayOptions }\n | { type: \"destroy-tray\"; requestId: RequestId; spaceId: SpaceId; trayId: TrayId }\n | { type: \"set-tray-menu\"; requestId: RequestId; spaceId: SpaceId; trayId: TrayId; menu: Menu }\n | { type: \"set-tray-icon\"; requestId: RequestId; spaceId: SpaceId; trayId: TrayId; icon: Icon }\n | { type: \"set-tray-tooltip\"; requestId: RequestId; spaceId: SpaceId; trayId: TrayId; tooltip: Tooltip }\n | { type: \"load-ext\"; requestId: RequestId; spaceId: SpaceId; name: string; path: string }\n | { type: \"ext-command\"; requestId: RequestId; spaceId: SpaceId; trayId: TrayId; ext: string; data: unknown }\n | { type: \"unload-ext\"; requestId: RequestId; spaceId: SpaceId; name: string }\n | { type: \"health\"; requestId: RequestId };\n\nexport type ServerFrame =\n | { type: \"ready\"; protocolVersion: number; brokerVersion: string; sessionId: SessionId }\n | { type: \"space-created\"; requestId: RequestId; space: SpaceRef }\n | { type: \"default-space\"; requestId: RequestId; space: SpaceRef }\n | { type: \"tray-created\"; requestId: RequestId; spaceId: SpaceId; trayId: TrayId }\n | { type: \"ack\"; requestId: RequestId }\n | { type: \"daemon-health\"; requestId: RequestId; health: DaemonHealth }\n | { type: \"event\"; event: TrayEvent }\n | { type: \"ext-event\"; spaceId: SpaceId; trayId: TrayId; ext: string; data: unknown }\n | { type: \"error\"; requestId?: RequestId; code: string; message: string };\n\nexport interface ParseResult<T> {\n ok: boolean;\n frame?: T;\n error?: string;\n}\n\nexport const parseServerFrame = (line: string): ParseResult<ServerFrame> => {\n try {\n const value: unknown = JSON.parse(line);\n if (!isServerFrame(value)) {\n return { ok: false, error: \"invalid server frame\" };\n }\n return { ok: true, frame: value };\n } catch (error) {\n return {\n ok: false,\n error: error instanceof Error ? error.message : \"unknown parse error\",\n };\n }\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport const isServerFrame = (value: unknown): value is ServerFrame => {\n if (!isRecord(value) || typeof value.type !== \"string\") {\n return false;\n }\n\n switch (value.type) {\n case \"ready\":\n return (\n typeof value.protocolVersion === \"number\" &&\n typeof value.brokerVersion === \"string\" &&\n typeof value.sessionId === \"string\"\n );\n case \"space-created\":\n return typeof value.requestId === \"string\" && isRecord(value.space);\n case \"default-space\":\n return typeof value.requestId === \"string\" && isRecord(value.space);\n case \"tray-created\":\n return (\n typeof value.requestId === \"string\" &&\n typeof value.spaceId === \"string\" &&\n typeof value.trayId === \"string\"\n );\n case \"ack\":\n return typeof value.requestId === \"string\";\n case \"daemon-health\":\n return typeof value.requestId === \"string\" && isDaemonHealth(value.health);\n case \"event\":\n return isTrayEvent(value.event);\n case \"ext-event\":\n return (\n typeof value.spaceId === \"string\" &&\n typeof value.trayId === \"string\" &&\n typeof value.ext === \"string\"\n );\n case \"error\":\n return (\n (value.requestId === undefined || typeof value.requestId === \"string\") &&\n typeof value.code === \"string\" &&\n typeof value.message === \"string\"\n );\n default:\n return false;\n }\n};\n\nconst isDaemonHealth = (value: unknown): value is DaemonHealth => {\n if (!isRecord(value)) {\n return false;\n }\n\n return (\n typeof value.pid === \"number\" &&\n typeof value.packageVersion === \"string\" &&\n typeof value.protocolVersion === \"number\" &&\n typeof value.endpoint === \"string\" &&\n typeof value.sessionCount === \"number\" &&\n Array.isArray(value.sessions) &&\n value.sessions.every(isDaemonSessionHealth)\n );\n};\n\nconst isDaemonSessionHealth = (value: unknown): value is DaemonSessionHealth =>\n isRecord(value) &&\n typeof value.sessionId === \"number\" &&\n (value.internalLeaseId === undefined || typeof value.internalLeaseId === \"string\") &&\n typeof value.initialized === \"boolean\";\n\nconst isTrayEvent = (value: unknown): value is TrayEvent => {\n if (!isRecord(value) || typeof value.type !== \"string\") {\n return false;\n }\n\n switch (value.type) {\n case \"ready\":\n return typeof value.spaceId === \"string\";\n case \"menuClick\":\n return (\n typeof value.spaceId === \"string\" &&\n typeof value.trayId === \"string\" &&\n typeof value.itemId === \"number\"\n );\n case \"trayClick\":\n case \"trayDoubleClick\":\n return (\n typeof value.spaceId === \"string\" &&\n isMouseButton(value.button) &&\n typeof value.x === \"number\" &&\n typeof value.y === \"number\"\n );\n default:\n return false;\n }\n};\n\nconst isMouseButton = (value: unknown): value is MouseButton =>\n value === \"left\" || value === \"right\" || value === \"middle\";\n"],"mappings":";AAWA,MAAa,mBAAmB;AAYhC,MAAa,gCAAgC,EAC3C,gBACA,kBAAA,QAC2D;CAC3D,wBAAwB,gBAAgB,gBAAgB;CACxD,IAAI,CAAC,OAAO,UAAU,eAAe,KAAK,mBAAmB,GAC3D,MAAM,IAAI,MAAM,+CAA+C,iBAAiB;CAGlF,OAAO;EACL;EACA;CACF;AACF;AAEA,MAAa,8BAA8B,oBACzC,oBAAA;AAEF,MAAa,4BAA4B,aAA6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