@phreshos/client 0.1.1 → 0.1.2

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
@@ -114,16 +114,10 @@ Promises confirm that the current Client host accepted and applied the local
114
114
  draft; they do not enter server authority or emit Window events.
115
115
 
116
116
  An `under` or `over` Client may own one authoritative host-rendered Surface.
117
- The capability remains silent until Program code explicitly reads, changes, or
118
- subscribes to it:
117
+ The capability is command-only: Program code may change or remove it, but
118
+ cannot read or subscribe to its server-owned state:
119
119
 
120
120
  ```ts
121
- const initial = await window.surface.snapshot()
122
-
123
- const stop = window.surface.subscribe("change", surface => {
124
- // Future replacements only; subscriptions do not replay `initial`.
125
- })
126
-
127
121
  await window.surface.set({
128
122
  opacity: 0.65,
129
123
  radius: "large",
@@ -133,14 +127,14 @@ await window.surface.set({
133
127
  await window.surface.remove()
134
128
  ```
135
129
 
136
- The server stores the target beside its Window and broadcasts complete future
137
- replacements. `set()` with no settings creates a sharp, fully opaque Surface.
130
+ The server stores the target beside its Window and delivers it internally to
131
+ the desktop. `set()` with no settings creates a sharp, fully opaque Surface.
138
132
  Opacity is a finite number from `0` through `1`; zero retains the Surface node.
139
133
  Radius accepts a nonnegative pixel number, a Theme-derived `ScaleLevel`, or
140
134
  `"full"`. Only `remove()` restores exact `null` and immediately removes the
141
135
  node. The optional transaction uses milliseconds and a stable named or cubic
142
136
  Bézier easing; the desktop performs the motion, honors reduced motion, and does
143
- not replay a stored transaction when restoring an initial snapshot. The sharp
137
+ does not replay a stored transaction when restoring desktop state. The sharp
144
138
  container follows the iframe geometry while the independently rounded Surface
145
139
  neither clips nor masks Client content. `window` and `wallpaper` layers reject
146
140
  the capability.
package/dist/domain.js CHANGED
@@ -230,30 +230,11 @@ class WindowHandle extends Events {
230
230
  async changeTitle(title) { await wire.request(["changeTitle", await this.target(), title]); }
231
231
  async raise() { await wire.request(["raise", await this.target()]); }
232
232
  }
233
- class WindowSurfaceHandle extends Events {
233
+ class WindowSurfaceHandle {
234
234
  target;
235
235
  constructor(target) {
236
- super((event, listener, impossible) => {
237
- if (event !== "change") {
238
- impossible?.(new Error(`A Window Surface has no "${String(event)}" event`));
239
- return () => undefined;
240
- }
241
- return deferred(target, subject => wire.on("host-end", "surface", (...values) => {
242
- const message = unscoped(subject, values);
243
- if (message)
244
- listener(message[0]);
245
- }, subject, impossible), impossible);
246
- }, observer => deferred(target, subject => wire.on("host-end", "surface", (...values) => {
247
- const message = unscoped(subject, values);
248
- if (message)
249
- observer("change", message[0]);
250
- }, subject)));
251
236
  this.target = target;
252
237
  }
253
- async snapshot() {
254
- const answer = await wire.request(["window", await this.target()]);
255
- return answer[0].surface;
256
- }
257
238
  async set(settings = {}) { await wire.request(["surfaceSet", await this.target(), settings]); }
258
239
  async remove() { await wire.request(["surfaceRemove", await this.target()]); }
259
240
  }
package/dist/main.d.ts CHANGED
@@ -4,4 +4,4 @@ export { type HostSurface, type Surface, type SurfaceEvents } from "./surface.js
4
4
  export { current, type Current, type CurrentServer } from "./current.js";
5
5
  export { type Channel, type ChannelCapture, type ChannelEvents, type ChannelMessage } from "./channel.js";
6
6
  export { Client, Endpoint, Process, Program, Server, type Window, type AnswerCapture, type AnswerMessage, type AnswerObserver, type AskCapture, type AskMessage, type AskObserver, type ClientTraffic, type EndpointTraffic, type ServerTraffic, type TrafficCapture, type TrafficEvents, type TrafficMessage } from "./domain.js";
7
- export type { Askable, Capture, Captures, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, PermissionDecision, Permissions, Position, ProgramArea, ProgramEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, ServedFile, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TimedPermissions, Timeoutable, Theme, ThemeEvents, ThemeProperties, Value, WritableTheme, WindowEvents, WindowLayer, WindowState, WindowSurface, WindowSurfaceEasing, WindowSurfaceEvents, WindowSurfaceSettings, WindowSurfaceTransaction } from "@phreshos/core";
7
+ export type { Askable, Capture, Captures, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, PermissionDecision, Permissions, Position, ProgramArea, ProgramEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, ServedFile, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TimedPermissions, Timeoutable, Theme, ThemeEvents, ThemeProperties, Value, WritableTheme, WindowEvents, WindowLayer, WindowState, WindowSurface, WindowSurfaceEasing, WindowSurfaceSettings, WindowSurfaceTransaction } from "@phreshos/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/client",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "The SDK used by a Program's client endpoint.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -46,10 +46,10 @@
46
46
  "prepack": "node --run build"
47
47
  },
48
48
  "peerDependencies": {
49
- "@phreshos/core": "^0.1.1"
49
+ "@phreshos/core": "^0.1.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@phreshos/core": "^0.1.1",
52
+ "@phreshos/core": "^0.1.2",
53
53
  "typescript": "^6.0.3"
54
54
  }
55
55
  }