opentray 0.0.0 → 0.2.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.
@@ -0,0 +1,45 @@
1
+ import { r as OpenTrayTransport } from "./client-COyxXT9C.mjs";
2
+ import { BrokerEndpointIdentityOptions, ServerFrame } from "@opentray/spec";
3
+
4
+ //#region src/daemon/paths.d.ts
5
+ interface DaemonPaths {
6
+ homeDir: string;
7
+ packageVersion: string;
8
+ protocolVersion: number;
9
+ stateRoot: string;
10
+ runtimeDir: string;
11
+ endpoint: string;
12
+ pidFile: string;
13
+ lockFile: string;
14
+ readyFile: string;
15
+ }
16
+ //#endregion
17
+ //#region src/daemon/lifecycle.d.ts
18
+ interface DaemonDriver {
19
+ isAlive(pid: number): Promise<boolean>;
20
+ spawnBroker(paths: DaemonPaths): Promise<number>;
21
+ stop(pid: number): Promise<void>;
22
+ }
23
+ //#endregion
24
+ //#region src/local-broker.d.ts
25
+ type BrokerEventFrame = Extract<ServerFrame, {
26
+ type: "event" | "ext-event";
27
+ }>;
28
+ interface LocalBrokerClient extends OpenTrayTransport {
29
+ readonly endpoint: string;
30
+ readonly leaseId: string;
31
+ onEvent(listener: (frame: BrokerEventFrame) => void): () => void;
32
+ close(): Promise<void>;
33
+ }
34
+ interface ConnectLocalBrokerOptions extends Partial<BrokerEndpointIdentityOptions> {
35
+ endpoint?: string;
36
+ homeDir?: string;
37
+ clientVersion?: string;
38
+ autoStart?: boolean;
39
+ daemonDriver?: DaemonDriver;
40
+ cliEntrypoint?: string;
41
+ }
42
+ declare const connectLocalBroker: (options?: ConnectLocalBrokerOptions) => Promise<LocalBrokerClient>;
43
+ //#endregion
44
+ export { type BrokerEventFrame, type ConnectLocalBrokerOptions, type LocalBrokerClient, connectLocalBroker };
45
+ //# sourceMappingURL=node.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.mts","names":[],"sources":["../src/daemon/paths.ts","../src/daemon/lifecycle.ts","../src/local-broker.ts"],"mappings":";;;;UAQiB,WAAA;EACf,OAAA;EACA,cAAA;EACA,eAAA;EACA,SAAA;EACA,UAAA;EACA,QAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;AAAA;;;UCEe,YAAA;EACf,OAAA,CAAQ,GAAA,WAAc,OAAA;EACtB,WAAA,CAAY,KAAA,EAAO,WAAA,GAAc,OAAA;EACjC,IAAA,CAAK,GAAA,WAAc,OAAA;AAAA;;;KCFT,gBAAA,GAAmB,OAAO,CAAC,WAAA;EAAe,IAAA;AAAA;AAAA,UAErC,iBAAA,SAA0B,iBAAA;EAAA,SAChC,QAAA;EAAA,SACA,OAAA;EACT,OAAA,CAAQ,QAAA,GAAW,KAAA,EAAO,gBAAA;EAC1B,KAAA,IAAS,OAAA;AAAA;AAAA,UAGM,yBAAA,SAAkC,OAAA,CAAQ,6BAAA;EACzD,QAAA;EACA,OAAA;EACA,aAAA;EACA,SAAA;EACA,YAAA,GAAe,YAAA;EACf,aAAA;AAAA;AAAA,cAoBW,kBAAA,GACX,OAAA,GAAS,yBAAA,KACR,OAAA,CAAQ,iBAAA"}
package/dist/node.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { t as connectLocalBroker } from "./local-broker-CXOpd9Z8.mjs";
2
+ export { connectLocalBroker };
package/package.json CHANGED
@@ -1,33 +1,54 @@
1
1
  {
2
2
  "name": "opentray",
3
- "version": "0.0.0",
3
+ "version": "0.2.0",
4
4
  "description": "Developer-facing OpenTray SDK and CLI package.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "bin": {
8
- "opentray": "./dist/cli.js"
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/jixoai/opentray"
9
10
  },
10
11
  "exports": {
11
12
  ".": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js"
13
+ "types": "./dist/index.d.mts",
14
+ "import": "./dist/index.mjs"
15
+ },
16
+ "./node": {
17
+ "types": "./dist/node.d.mts",
18
+ "import": "./dist/node.mjs"
14
19
  },
15
20
  "./package.json": "./package.json"
16
21
  },
22
+ "bin": {
23
+ "opentray": "./dist/cli.mjs"
24
+ },
17
25
  "files": [
18
26
  "dist",
19
27
  "README.md"
20
28
  ],
21
29
  "sideEffects": false,
22
30
  "dependencies": {
23
- "@opentray/spec": "0.0.0"
31
+ "@opentray/spec": "0.2.0"
32
+ },
33
+ "devDependencies": {
34
+ "tsdown": "^0.22.1",
35
+ "typescript": "^6.0.3",
36
+ "vitest": "^4.1.7"
24
37
  },
25
38
  "optionalDependencies": {
26
- "@opentray/darwin-arm64": "0.0.0",
27
- "@opentray/darwin-x64": "0.0.0",
28
- "@opentray/windows-arm64": "0.0.0",
29
- "@opentray/windows-x64": "0.0.0",
30
- "@opentray/linux-x64": "0.0.0",
31
- "@opentray/linux-arm64": "0.0.0"
39
+ "@opentray/darwin-arm64": "0.1.0",
40
+ "@opentray/darwin-x64": "0.1.0",
41
+ "@opentray/linux-arm64": "0.1.0",
42
+ "@opentray/linux-x64": "0.1.0",
43
+ "@opentray/windows-arm64": "0.1.0",
44
+ "@opentray/windows-x64": "0.1.0"
45
+ },
46
+ "scripts": {
47
+ "build": "tsdown src/index.ts src/node.ts src/cli.ts --format esm --dts",
48
+ "cli": "bun run src/cli.ts",
49
+ "example:basic": "bun run examples/basic-surface.ts",
50
+ "example:daemon-tray": "bun run examples/daemon-tray.ts",
51
+ "test": "vitest run",
52
+ "typecheck": "tsc --noEmit"
32
53
  }
33
54
  }