opentray 0.5.2 → 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/README.md +20 -15
- package/dist/cli.d.mts +0 -8
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +4 -527
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +166 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{local-broker-CEIHPBcK.mjs → local-broker-C9siWyRh.mjs} +4 -3
- package/dist/local-broker-C9siWyRh.mjs.map +1 -0
- package/dist/node.mjs +1 -1
- package/package.json +7 -8
- package/assets/lynx-review/README.md +0 -14
- package/assets/lynx-review/main.lynx.bundle +0 -0
- package/dist/client-DzcHIH-f.mjs +0 -168
- package/dist/client-DzcHIH-f.mjs.map +0 -1
- package/dist/local-broker-CEIHPBcK.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -60,9 +60,11 @@ Run the direct webview control demo:
|
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
62
|
pnpm --filter opentray example:webview-control
|
|
63
|
+
pnpm --filter opentray example:webview-control -- --overlay
|
|
64
|
+
pnpm --filter opentray example:webview-control -- --no-overlay
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
That demo opens a native WebView window immediately and puts the controls inside the page itself, so you can exercise frameless,
|
|
67
|
+
That demo opens a native WebView window immediately and puts the controls inside the page itself, so you can exercise frameless, background modes, keep-on-top, title, icon, screen, overlay, and navigation behavior without going through the tray menu first. The control demo enables the show-time `windowControlsOverlay` capability by default; use `-- --no-overlay` when you want to test the disabled path.
|
|
66
68
|
Treat `example:webview-control` as the API exercise surface. It is useful for probing capabilities and events, but it is not the canonical recipe for a tray-anchored glass shell.
|
|
67
69
|
|
|
68
70
|
Application code mounts WebView as a tray capability. The first WebView command loads the native extension automatically; ordinary code does not need to send `load-ext` manually:
|
|
@@ -94,8 +96,8 @@ pnpm --filter opentray example:tray-panel
|
|
|
94
96
|
```
|
|
95
97
|
|
|
96
98
|
This demo is the canonical custom TrayPanel case: one `primaryEvent` tray item, backend `tray.getBounds()`, page `navigator.opentray.tray.getBounds()`, screen-aware repositioning, and a frameless glass panel with `keepOnTop`.
|
|
97
|
-
It also follows the native-glass rule strictly:
|
|
98
|
-
|
|
99
|
+
It also follows the native-glass rule strictly: material background through `style.background`, no root HTML shell styling, and content padding only inside the page.
|
|
100
|
+
On macOS it requests `{ kind: "platformMaterial", material: "hudWindow", state: "active" }` so the tray-launched material surface does not immediately fall back to the inactive grey AppKit appearance. On Windows it uses `background: "mica"` and `cornerPreference: "round"` instead of sending macOS-only style.
|
|
99
101
|
For a step-by-step walkthrough of the examples and expected behavior, read [examples/EXAMPLE.md](./examples/EXAMPLE.md).
|
|
100
102
|
|
|
101
103
|
## Release Channels And Maturity
|
|
@@ -108,20 +110,23 @@ OpenTray uses release channels and capability maturity together. Do not read a p
|
|
|
108
110
|
Current WebView truth:
|
|
109
111
|
|
|
110
112
|
- macOS is the current `stable` human-visible acceptance path
|
|
111
|
-
- Windows
|
|
113
|
+
- Windows is the current `stable` WebView2-backed human-visible acceptance path for common bridge/window controls, background material/corner preferences, and native icon projection
|
|
114
|
+
- Linux remains supported by the OpenTray core daemon/packages, but `@opentray/ext-webview` does not publish Linux native WebView packages
|
|
112
115
|
- some requests are `unsupported by design`, such as asking the macOS runtime to apply a Windows-only style family
|
|
113
116
|
- some results are `unavailable by context`, such as tray-bounds projection when the current session has no authoritative tray anchor
|
|
114
117
|
|
|
115
118
|
When run from the repo worktree, the example automatically discovers `target/debug` or `target/release` `libopentray_ext_webview` and wires it through `OPENTRAY_EXT_PATH` before starting the daemon. The WebView mount still exercises the real generic extension loader, but example users do not author a manual `load-ext` request.
|
|
116
119
|
|
|
117
|
-
|
|
120
|
+
The published CLI is intentionally small and only owns daemon lifecycle and health:
|
|
118
121
|
|
|
119
122
|
```bash
|
|
120
|
-
opentray
|
|
121
|
-
opentray
|
|
123
|
+
opentray daemon health
|
|
124
|
+
opentray daemon start
|
|
125
|
+
opentray daemon stop
|
|
126
|
+
opentray daemon restart
|
|
122
127
|
```
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
Visual smoke is a real runtime activity, not a daemon CLI subcommand. It may auto-start or reuse the same-version daemon, write runtime coordination files under `$OPENTRAY_HOME/.opentray/<package-version>/runtime` or the user's home directory when `OPENTRAY_HOME` is unset, create a visible tray item, load native extension packages, and open real WebView/Lynx windows. Use the `opentray` skill or source-tree examples to orchestrate those checks, and run `opentray daemon stop` if you want immediate daemon cleanup or if a smoke process was interrupted.
|
|
125
130
|
|
|
126
131
|
This example starts or reuses the same-version daemon automatically, creates a real tray through the public SDK, and prints broker-routed menu events. Use manual lifecycle commands only for operator/debug control:
|
|
127
132
|
|
|
@@ -139,7 +144,7 @@ The host side of that example can call `await tray.getBounds()` to read the curr
|
|
|
139
144
|
|
|
140
145
|
The opened WebView also enables the injected page bridge so the rendered page can call `navigator.window` / `navigator.opentrayWindow` and, for the demo only, opt into `window.close()` / `window.moveTo()` / `window.resizeTo()` overrides. Use the in-page buttons to verify `getCapabilities`, `getStyle`, `setStyle({ frameless })`, move, resize, close, and tray-bounds behavior visually instead of relying only on terminal logs.
|
|
141
146
|
|
|
142
|
-
The Lynx
|
|
147
|
+
The Lynx example path uses the same generic extension loader but launches a real `OpenTrayLynxRuntime.app.zip` sidecar from `@opentray/ext-lynx-darwin-*`. It starts the requested `.lynx.bundle` in a fixed host shell, sets an initial title and icon, applies an explicit startup feature expression, and exposes `Show Window`, `Hide Window`, and `Quit Smoke` through tray-routed events. Inside the Lynx window, use the rendered controls to verify `getCapabilities`, `getStyle`, `getTitle`, `setTitle`, `getIcon`, `setIcon`, `navigator.screen.getScreenDetails()`, `resizeTo`, `moveTo`, frameless toggling, `window.resizeTo()`, `window.getScreenDetails()`, and close behavior visually. On macOS, the runtime Dock icon should no longer appear blank.
|
|
143
148
|
|
|
144
149
|
For Lynx, `frameless` currently means borderless only. It does not imply a full-window drag region, because that would steal clicks from the page content. When isolating host-feature regressions, `--features "*,!frameless"` is the fastest way to keep the bridge on while removing the borderless shell from the test.
|
|
145
150
|
|
|
@@ -151,9 +156,9 @@ pnpm run smoke:lynx -- --run <github-actions-run-id> --bundle packages/cli/asset
|
|
|
151
156
|
pnpm run smoke:lynx -- --run <github-actions-run-id> --bundle packages/cli/assets/lynx-review/main.lynx.bundle --features "*,!nativeScreenApi"
|
|
152
157
|
```
|
|
153
158
|
|
|
154
|
-
The
|
|
159
|
+
The workspace review bundle is the full human acceptance surface. The separate `input-probe.lynx.bundle` is only a low-level diagnostic asset for isolating raw click/scroll/input delivery. The empty feature set is the baseline carrier check. Use it to validate the physical window baseline: click, scroll, input, red/yellow/green controls, and resize/move. Only after that baseline is healthy should you validate explicit startup feature sets on top of the same carrier.
|
|
155
160
|
|
|
156
|
-
First-stage platform packages are published for macOS, Linux, and Windows. macOS
|
|
161
|
+
First-stage core daemon platform packages are published for macOS, Linux, and Windows. macOS and Windows are stable WebView human-visual acceptance paths for common window and bridge commands plus native material projection. Linux is not an official `@opentray/ext-webview` runtime target. Lynx is intentionally macOS-first for now and should fail honestly on other platforms instead of pretending the runtime exists.
|
|
157
162
|
|
|
158
163
|
If you are validating the current prerelease branch before stable publication, install from the alpha channel and treat that as alpha evidence rather than stable evidence:
|
|
159
164
|
|
|
@@ -161,7 +166,7 @@ If you are validating the current prerelease branch before stable publication, i
|
|
|
161
166
|
npm i opentray@alpha
|
|
162
167
|
```
|
|
163
168
|
|
|
164
|
-
For local native smoke before npm publish, stage the current platform artifacts first:
|
|
169
|
+
For local native smoke before npm publish, stage the current platform artifacts first and run source-tree examples:
|
|
165
170
|
|
|
166
171
|
```bash
|
|
167
172
|
cargo build -p opentray-bin -p opentray-ext-webview -p opentray-ext-lynx
|
|
@@ -170,8 +175,8 @@ bun run scripts/binaries/stage-local.ts --kind webview --source target/debug/lib
|
|
|
170
175
|
bun run scripts/binaries/stage-local.ts --kind lynx --source target/debug/libopentray_ext_lynx.dylib
|
|
171
176
|
bash scripts/release/build-lynx-runtime.sh /tmp/OpenTrayLynxRuntime.app.zip
|
|
172
177
|
bun run scripts/binaries/stage-local.ts --kind lynx-runtime --source /tmp/OpenTrayLynxRuntime.app.zip
|
|
173
|
-
OPENTRAY_EXAMPLE_WEBVIEW_SMOKE=1 pnpm --filter opentray
|
|
174
|
-
pnpm --filter opentray
|
|
178
|
+
OPENTRAY_EXAMPLE_WEBVIEW_SMOKE=1 pnpm --filter opentray example:daemon-tray
|
|
179
|
+
pnpm --filter opentray example:daemon-lynx -- --bundle packages/cli/assets/lynx-review/main.lynx.bundle
|
|
175
180
|
```
|
|
176
181
|
|
|
177
182
|
During source-level daemon work, restart the daemon with the freshly built broker binary before testing tray behavior. Otherwise the CLI may reuse the already staged same-version daemon:
|
|
@@ -179,7 +184,7 @@ During source-level daemon work, restart the daemon with the freshly built broke
|
|
|
179
184
|
```bash
|
|
180
185
|
cargo build -p opentray-bin
|
|
181
186
|
OPENTRAY_BROKER_BIN="$PWD/target/debug/opentray" pnpm --filter opentray cli -- daemon restart
|
|
182
|
-
OPENTRAY_BROKER_BIN="$PWD/target/debug/opentray" pnpm --filter opentray
|
|
187
|
+
OPENTRAY_BROKER_BIN="$PWD/target/debug/opentray" OPENTRAY_EXAMPLE_WEBVIEW_SMOKE=1 pnpm --filter opentray example:daemon-tray
|
|
183
188
|
```
|
|
184
189
|
|
|
185
190
|
The daemon exits automatically after 30 seconds with no connected clients. Set `OPENTRAY_DAEMON_IDLE_TIMEOUT_MS=0` to keep it alive during debugging, or provide another millisecond value for a custom idle release window.
|
package/dist/cli.d.mts
CHANGED
|
@@ -4,14 +4,6 @@ import { DaemonHealth } from "@opentray/spec";
|
|
|
4
4
|
type CliCommand = {
|
|
5
5
|
type: "daemon";
|
|
6
6
|
action: "start" | "stop" | "restart" | "health";
|
|
7
|
-
} | {
|
|
8
|
-
type: "smoke";
|
|
9
|
-
name: "daemon-tray";
|
|
10
|
-
} | {
|
|
11
|
-
type: "smoke";
|
|
12
|
-
name: "daemon-lynx";
|
|
13
|
-
bundlePath?: string;
|
|
14
|
-
featureExpression?: string;
|
|
15
7
|
} | {
|
|
16
8
|
type: "help";
|
|
17
9
|
};
|
package/dist/cli.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";;;KAqBK,UAAA;EACC,IAAA;EAAgB,MAAA;AAAA;EAChB,IAAA;AAAA;AAAA,cAEO,eAAA,GAAmB,IAAA,eAAiB,UAehD;AAAA,cAEY,MAAA,GAAgB,IAAA,eAAiB,OAAO;AAAA,cAiFxC,wBAAA,GAA4B,MAAoB,EAAZ,YAAY;AAAA,cAoBhD,eAAA,GACX,aAAA,sBACA,UAAkB"}
|