@phreshos/server 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
@@ -77,9 +77,9 @@ lifetime. Each Client permanently owns one synchronous `window` capability,
77
77
  whose operations address that Client's current live presentation state.
78
78
 
79
79
  An `under` or `over` Client Window may own an authoritative host Surface through
80
- `client.window.surface`. `snapshot()` explicitly reads its current settings,
81
- `subscribe("change", listener)` receives only future complete replacements,
82
- and `set()` or `remove()` changes the server-owned value. Radius may be a
80
+ `client.window.surface`. It is command-only: `set()` or `remove()` changes the
81
+ server-owned value, while Program endpoints cannot read or subscribe to it.
82
+ Radius may be a
83
83
  nonnegative pixel number, `"full"`, or a semantic `ScaleLevel` resolved by the
84
84
  desktop against its current Theme. Ordinary `window` and system `wallpaper`
85
85
  layers reject Surface mutations.
package/dist/domain.js CHANGED
@@ -273,30 +273,11 @@ class WindowHandle extends Events {
273
273
  async changeTitle(title) { await wire.request(["changeTitle", await this.target(), title]); }
274
274
  async raise() { await wire.request(["raise", await this.target()]); }
275
275
  }
276
- class WindowSurfaceHandle extends Events {
276
+ class WindowSurfaceHandle {
277
277
  target;
278
278
  constructor(target) {
279
- super((event, listener, impossible) => {
280
- if (event !== "change") {
281
- impossible?.(new Error(`A Window Surface has no "${String(event)}" event`));
282
- return () => undefined;
283
- }
284
- return deferred(target, subject => wire.on("host-end", "surface", (...values) => {
285
- const message = unscoped(subject, values);
286
- if (message)
287
- listener(message[0]);
288
- }, subject, impossible), impossible);
289
- }, observer => deferred(target, subject => wire.on("host-end", "surface", (...values) => {
290
- const message = unscoped(subject, values);
291
- if (message)
292
- observer("change", message[0]);
293
- }, subject)));
294
279
  this.target = target;
295
280
  }
296
- async snapshot() {
297
- const answer = await wire.request(["window", await this.target()]);
298
- return answer[0].surface;
299
- }
300
281
  async set(settings = {}) { await wire.request(["surfaceSet", await this.target(), settings]); }
301
282
  async remove() { await wire.request(["surfaceRemove", await this.target()]); }
302
283
  }
package/dist/main.d.ts CHANGED
@@ -3,4 +3,4 @@ export { current, type Current, type CurrentClient } from "./current.js";
3
3
  export { type Answerer, type Channel } from "./channel.js";
4
4
  export { type ProgramStartup } from "./startup.js";
5
5
  export { Client, Endpoint, Process, Program, Server, type Window, type ProgramArea } from "./domain.js";
6
- export type { AnswerCapture, AnswerMessage, AnswerObserver, Askable, AskCapture, AskMessage, AskObserver, Capture, Captures, ChannelCapture, ChannelEvents, ChannelMessage, ClientTraffic, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EndpointTraffic, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, Position, ProgramEvents, ProgramPermissions, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, ServedFile, ServerTraffic, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TrafficCapture, TrafficEvents, TrafficMessage, Value, Theme, ThemeEvents, ThemeProperties, WallpaperLaunch, FileWallpaper, DesktopWallpaper, WritableTheme, WindowEvents, WindowLayer, WindowState, WindowSurface, WindowSurfaceEasing, WindowSurfaceEvents, WindowSurfaceSettings, WindowSurfaceTransaction } from "@phreshos/core";
6
+ export type { AnswerCapture, AnswerMessage, AnswerObserver, Askable, AskCapture, AskMessage, AskObserver, Capture, Captures, ChannelCapture, ChannelEvents, ChannelMessage, ClientTraffic, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EndpointTraffic, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, Position, ProgramEvents, ProgramPermissions, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, ServedFile, ServerTraffic, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TrafficCapture, TrafficEvents, TrafficMessage, Value, Theme, ThemeEvents, ThemeProperties, WallpaperLaunch, FileWallpaper, DesktopWallpaper, 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/server",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "The SDK used by a Program's server 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
  "@types/node": "^26.2.0",
54
54
  "typescript": "^6.0.3"
55
55
  }