@phreshos/core 0.1.4 → 0.1.5

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
@@ -234,22 +234,17 @@ Program and the deliberately narrow `WallpaperLaunch`, containing only `name`,
234
234
  These contracts describe capability and data shape only — they contain no
235
235
  persistence, upload, Process creation, or rendering implementation.
236
236
 
237
- ## Window Surface
238
-
239
- `client.window.surface` addresses the optional host-rendered material belonging
240
- to one Window. Its source of truth is authoritative, server-owned Window state,
241
- not iframe state. Program endpoints may explicitly replace or remove that
242
- target, but cannot read or subscribe to it. A `null` target means no Surface
243
- exists in the render tree.
244
-
245
- Only Windows currently occupying the `under` or `over` layer may call `set()`
246
- or `remove()`; `window` and `wallpaper` layers reject those operations. Calling
247
- `set()` without settings creates a sharp, fully opaque Surface. Settings may
248
- select opacity from zero to one, a nonnegative pixel radius, a scale level, or
249
- `"full"`, and an optional transaction containing a duration from zero through
250
- 60,000 milliseconds and a stable named or cubic Bézier easing. Zero opacity
251
- retains the Surface node; only `remove()` returns the authoritative target
252
- immediately to `null`. The server validates settings, and the desktop animates
237
+ ## Client Surface values
238
+
239
+ `ClientSurfaceSettings` describes optional host-rendered material requested by
240
+ one live Client representation. It is a value contract, not Window state and
241
+ not server authority. Calling the Client capability without settings creates a
242
+ sharp, fully opaque Surface. Settings may select opacity from zero to one, a
243
+ nonnegative pixel radius, a scale level, or `"full"`, and an optional
244
+ transaction containing a duration from zero through 60,000 milliseconds and a
245
+ stable named or cubic Bézier easing. Zero opacity
246
+ retains the Surface node; the Client capability's separate `remove()` command
247
+ removes it immediately. The receiving desktop validates settings and animates
253
248
  from the rendered values to each new target.
254
249
 
255
250
  ## Window geometry
@@ -261,6 +256,15 @@ pixel number or a linear relative expression such as `"1/2"`, `"50% + 10"`, or
261
256
  offset. The CLI, runtime validation, and desktop layout all consume this one
262
257
  Core definition rather than maintaining separate parsers.
263
258
 
259
+ `move()` and `resize()` change one dimension of authoritative geometry.
260
+ `setGeometry({ position, size })` validates and commits both dimensions as one
261
+ operation, then emits one `geometry` event. Compound interactions such as
262
+ resizing from a top or left edge and snapping must use this atomic form so a
263
+ remote representation never observes a new position with the previous size.
264
+ `move` and `resize` subscribers are also notified after the complete geometry
265
+ has committed; those component notifications never represent partial
266
+ authoritative state.
267
+
264
268
  ## Process parentage
265
269
 
266
270
  Process parentage belongs to `Process`, not to contextual SDK state. Each
@@ -0,0 +1,19 @@
1
+ import type { ScaleLevel } from "./scale.js";
2
+ /** Stable easing accepted by one Client representation's Surface transaction. */
3
+ export type ClientSurfaceEasing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | readonly [number, number, number, number];
4
+ /** Motion applied locally when one Client representation replaces its Surface target. */
5
+ export type ClientSurfaceTransaction = Readonly<{
6
+ /** Duration in milliseconds. Omission uses the desktop duration. */
7
+ duration?: number;
8
+ /** Timing curve. Omission uses the desktop curve. */
9
+ easing?: ClientSurfaceEasing;
10
+ }>;
11
+ /** Local host Surface requested by one live Client representation. */
12
+ export type ClientSurfaceSettings = Readonly<{
13
+ /** Whole-Surface opacity from zero through one. Omission means one. */
14
+ opacity?: number;
15
+ /** A Theme-derived level, CSS pixels, or maximum proportional rounding. Omission means zero. */
16
+ radius?: ScaleLevel | number | "full";
17
+ /** Optional motion from the currently rendered values to this target. */
18
+ transaction?: ClientSurfaceTransaction;
19
+ }>;
File without changes
package/dist/main.d.ts CHANGED
@@ -19,6 +19,7 @@ export { Server, type AnswerCapture, type AnswerMessage, type AnswerObserver, ty
19
19
  export { Client, type ClientTraffic } from "./client.js";
20
20
  export { Process, type Exit, type ProcessEvents } from "./process.js";
21
21
  export { Program, type ClientDeclaration, type EndpointDeclaration, type ProgramEvents, type ProgramIconSize, type ProgramProcessExit } from "./program.js";
22
- export { type Window, type WindowEvents, type WindowLayer, type WindowState, type WindowSurface, type WindowSurfaceEasing, type WindowSurfaceSettings, type WindowSurfaceTransaction } from "./window.js";
22
+ export { type Window, type WindowEvents, type WindowGeometry, type WindowLayer, type WindowState } from "./window.js";
23
+ export { type ClientSurfaceEasing, type ClientSurfaceSettings, type ClientSurfaceTransaction } from "./client-surface.js";
23
24
  export { layers, type Launch, type LaunchClient, type Layer, type Position, type Size } from "./launch.js";
24
25
  export { defineConfig, type ClientConfig, type ClientDevelopment, type Config, type ServerConfig, type ServerDevelopment } from "./config.js";
package/dist/main.js CHANGED
@@ -20,5 +20,6 @@ export { Client } from "./client.js";
20
20
  export { Process } from "./process.js";
21
21
  export { Program } from "./program.js";
22
22
  export {} from "./window.js";
23
+ export {} from "./client-surface.js";
23
24
  export { layers } from "./launch.js";
24
25
  export { defineConfig } from "./config.js";
@@ -14,7 +14,7 @@ export interface TimedPermissions {
14
14
  /** Requests one permission, resolving `null` if the deadline expires. */
15
15
  request(name: PermissionName): Promise<PermissionDecision>;
16
16
  }
17
- /** Client access to the current Process's permissions. */
17
+ /** Client access to one Program's effective permission decisions. */
18
18
  export interface Permissions extends Timeoutable<TimedPermissions> {
19
19
  /** Reads the effective decision without prompting the user. */
20
20
  granted(name: PermissionName): Promise<PermissionDecision>;
package/dist/window.d.ts CHANGED
@@ -1,39 +1,22 @@
1
1
  import type { Layer, Position, Size } from "./launch.js";
2
- import type { ScaleLevel } from "./scale.js";
3
2
  import type { Subscribable } from "./subscribable.js";
4
3
  /** The authoritative runtime layer occupied by a Window. */
5
4
  export type WindowLayer = Layer | "wallpaper";
6
- /** Stable easing accepted by a Window Surface transaction. */
7
- export type WindowSurfaceEasing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | readonly [number, number, number, number];
8
- /** Motion applied by a desktop when one authoritative Surface target replaces another. */
9
- export type WindowSurfaceTransaction = Readonly<{
10
- /** Duration in milliseconds. Omission uses the system duration. */
11
- duration?: number;
12
- /** Timing curve. Omission uses the system curve. */
13
- easing?: WindowSurfaceEasing;
14
- }>;
15
- /** Authoritative target settings for one Window's optional host Surface. */
16
- export type WindowSurfaceSettings = Readonly<{
17
- /** Whole-Surface opacity from zero through one. Omission means one. */
18
- opacity?: number;
19
- /** A Theme-derived level, CSS pixels, or maximum proportional rounding. Omission means zero. */
20
- radius?: ScaleLevel | number | "full";
21
- /** Optional motion from the currently rendered values to this target. */
22
- transaction?: WindowSurfaceTransaction;
5
+ /** Position and size committed as one authoritative Window change. */
6
+ export type WindowGeometry = Readonly<{
7
+ /** Complete top-left position. */
8
+ position: Position;
9
+ /** Complete width and height. */
10
+ size: Size;
23
11
  }>;
24
- /** Optional host-rendered material owned by one authoritative Window. */
25
- export interface WindowSurface {
26
- /** Creates or replaces the authoritative target. Omission creates the default Surface. */
27
- set(settings?: WindowSurfaceSettings): Promise<void>;
28
- /** Immediately removes the authoritative Surface. */
29
- remove(): Promise<void>;
30
- }
31
12
  /** Events emitted when authoritative Window state changes. */
32
13
  export type WindowEvents = {
33
14
  /** The authoritative top-left position changed. */
34
15
  move: Position;
35
16
  /** The authoritative width or height changed. */
36
17
  resize: Size;
18
+ /** Position and size changed in one atomic operation. */
19
+ geometry: WindowGeometry;
37
20
  /** The authoritative minimized state changed. */
38
21
  minimize: boolean;
39
22
  /** The authoritative title changed. */
@@ -60,8 +43,6 @@ export type WindowState = Readonly<{
60
43
  }>;
61
44
  /** Presentation capability owned by one Client handle. */
62
45
  export interface Window extends Subscribable<WindowEvents, never> {
63
- /** Authoritative host-rendered material associated with this Window. */
64
- readonly surface: WindowSurface;
65
46
  /** Returns the current title. */
66
47
  title(): Promise<string>;
67
48
  /** Returns the current top-left position. */
@@ -80,6 +61,8 @@ export interface Window extends Subscribable<WindowEvents, never> {
80
61
  move(position: Position): Promise<void>;
81
62
  /** Resizes the authoritative Window. */
82
63
  resize(size: Size): Promise<void>;
64
+ /** Changes position and size as one authoritative operation. */
65
+ setGeometry(geometry: WindowGeometry): Promise<void>;
83
66
  /** Changes whether the Window is minimized. */
84
67
  minimize(minimized?: boolean): Promise<void>;
85
68
  /** Changes the Window title. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/core",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Environment-neutral contracts and domain objects for PhreshOS Programs.",
5
5
  "type": "module",
6
6
  "sideEffects": false,