@geastack/core 0.1.40 → 0.1.41

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 CHANGED
@@ -57,6 +57,21 @@ target integration in `geastack/simulator`. Contributions should include a
57
57
  reproduction and target-specific validation. Lifecycle and representation
58
58
  changes need to preserve the shared component and native-type contracts.
59
59
 
60
+ ## Native WebSocket connection headers
61
+
62
+ `@geastack/core` 0.1.41 and `@geastack/host` 0.1.16 add an optional third
63
+ WebSocket constructor argument for connection headers on ESP32 native hosts:
64
+
65
+ ```ts
66
+ const socket = new WebSocket('wss://api.openai.com/v1/live/sessions', '', {
67
+ headers: [{ name: 'Authorization', value: `Bearer ${process.env.OPENAI_API_KEY}` }],
68
+ })
69
+ ```
70
+
71
+ Use these paired versions or newer when a service requires bearer authentication
72
+ in the WebSocket handshake. Header names and values are validated before the
73
+ connection starts. This native option is unavailable in browser WebSockets.
74
+
60
75
  ## Related packages
61
76
 
62
77
  - `@geastack/engine` renders the element tree, `@geastack/host` supplies the
package/index.d.ts CHANGED
@@ -1971,13 +1971,18 @@ export interface WebSocketInstance {
1971
1971
  }
1972
1972
 
1973
1973
  export interface WebSocketConstructor {
1974
- new (url: string, protocols?: string | string[]): WebSocketInstance
1974
+ new (url: string, protocols?: string | string[], options?: WebSocketOptions): WebSocketInstance
1975
1975
  readonly CONNECTING: 0
1976
1976
  readonly OPEN: 1
1977
1977
  readonly CLOSING: 2
1978
1978
  readonly CLOSED: 3
1979
1979
  }
1980
1980
 
1981
+ /** Native connection headers. Browser WebSockets do not support this option. */
1982
+ export interface WebSocketOptions {
1983
+ headers: { name: string; value: string }[]
1984
+ }
1985
+
1981
1986
  declare global {
1982
1987
  const WebSocket: WebSocketConstructor
1983
1988
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/core",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "GeaStack app API, reactivity headers, runtime sources, and type declarations.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -182,6 +182,7 @@ export type {
182
182
  VirtualListElement,
183
183
  WebSocketCloseEvent,
184
184
  WebSocketConstructor,
185
+ WebSocketOptions,
185
186
  WebSocketErrorEvent,
186
187
  WebSocketInstance,
187
188
  WebSocketMessageEvent,