@phreshos/core 0.1.5 → 0.1.6

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,18 +234,26 @@ 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
- ## 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
248
- from the rendered values to each new target.
237
+ ## Local representation
238
+
239
+ `Window` is the authoritative, subscribable presentation state shared through
240
+ the system. `LocalWindow` is the current desktop's physical representation of
241
+ the current Client only. Its reads and commands are deliberately eventless and
242
+ never change or publish authoritative state. A desktop projects authoritative
243
+ changes onto an ordinary `window` layer; `under` and `over` representations
244
+ receive their initial truth and control their local projection thereafter.
245
+
246
+ `SurfaceSettings` describes optional host-rendered material belonging to one
247
+ live `under` or `over` representation. Calling `set()` without settings creates
248
+ a sharp, fully opaque Surface; `remove()` removes its render node immediately.
249
+ Opacity accepts zero through one, while radius accepts a nonnegative pixel
250
+ number, a scale level, or `"full"`.
251
+
252
+ Geometry commands and Surface replacement may receive a generic `Transaction`.
253
+ It must contain a duration in milliseconds, an easing, or both; `{}` and
254
+ `{ wait: true }` are not transactions. Omitting it preserves the layer's normal
255
+ behavior. `wait: true` makes the command settle with the visual transition,
256
+ while omission or `false` settles when the desktop accepts it.
249
257
 
250
258
  ## Window geometry
251
259
 
@@ -0,0 +1,39 @@
1
+ import type { Position, Size } from "./launch.js";
2
+ import type { ScaleLevel } from "./scale.js";
3
+ import type { Transaction } from "./transaction.js";
4
+ import type { WindowGeometry, WindowLayer } from "./window.js";
5
+ /** A host Surface belonging only to one live Client representation. */
6
+ export type SurfaceSettings = Readonly<{
7
+ /** Whole-Surface opacity from zero through one. Omission means one. */
8
+ opacity?: number;
9
+ /** A Theme level, CSS pixels, or maximum proportional rounding. */
10
+ radius?: ScaleLevel | number | "full";
11
+ }>;
12
+ /** Local Surface commands for the current Client representation. */
13
+ export interface LocalWindowSurface {
14
+ /** Creates or replaces the Surface, optionally as a visual transaction. */
15
+ set(settings?: SurfaceSettings, transaction?: Transaction): Promise<void>;
16
+ /** Removes the Surface immediately. */
17
+ remove(): Promise<void>;
18
+ }
19
+ /**
20
+ * The current desktop's physical representation of the current Client Window.
21
+ * It has no events: its commands neither change authoritative state nor
22
+ * broadcast anything.
23
+ */
24
+ export interface LocalWindow {
25
+ readonly surface: LocalWindowSurface;
26
+ title(): Promise<string>;
27
+ position(): Promise<Position>;
28
+ size(): Promise<Size>;
29
+ minimized(): Promise<boolean>;
30
+ front(): Promise<boolean>;
31
+ layer(): Promise<WindowLayer>;
32
+ location(): Promise<string>;
33
+ move(position: Position, transaction?: Transaction): Promise<void>;
34
+ resize(size: Size, transaction?: Transaction): Promise<void>;
35
+ setGeometry(geometry: WindowGeometry, transaction?: Transaction): Promise<void>;
36
+ minimize(minimized?: boolean): Promise<void>;
37
+ changeTitle(title: string): Promise<void>;
38
+ raise(): Promise<void>;
39
+ }
package/dist/main.d.ts CHANGED
@@ -20,6 +20,7 @@ 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
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
+ export { type LocalWindow, type LocalWindowSurface, type SurfaceSettings } from "./local-window.js";
24
+ export { type Easing, type Transaction } from "./transaction.js";
24
25
  export { layers, type Launch, type LaunchClient, type Layer, type Position, type Size } from "./launch.js";
25
26
  export { defineConfig, type ClientConfig, type ClientDevelopment, type Config, type ServerConfig, type ServerDevelopment } from "./config.js";
package/dist/main.js CHANGED
@@ -20,6 +20,7 @@ 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
+ export {} from "./local-window.js";
24
+ export {} from "./transaction.js";
24
25
  export { layers } from "./launch.js";
25
26
  export { defineConfig } from "./config.js";
@@ -0,0 +1,18 @@
1
+ /** Stable timing curves accepted by local visual transactions. */
2
+ export type Easing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | readonly [number, number, number, number];
3
+ type TransactionOptions = Readonly<{
4
+ /** Wait for the visual transition to finish instead of only accepting it. */
5
+ wait?: boolean;
6
+ }>;
7
+ /**
8
+ * An explicit visual transaction. At least one motion value is required, so
9
+ * an empty object cannot silently replace a layer's default behavior.
10
+ */
11
+ export type Transaction = TransactionOptions & (Readonly<{
12
+ duration: number;
13
+ easing?: Easing;
14
+ }> | Readonly<{
15
+ duration?: number;
16
+ easing: Easing;
17
+ }>);
18
+ export {};
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/core",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Environment-neutral contracts and domain objects for PhreshOS Programs.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,19 +0,0 @@
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