@phreshos/core 0.1.6 → 0.1.8

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
@@ -59,23 +59,22 @@ explicit, asynchronous read of one complete, immutable value. `Theme` extends
59
59
  the ordinary `Subscribable` capability with a `change` event; it has no
60
60
  dedicated subscription shape of its own.
61
61
 
62
- Theme properties are expressed as concrete default values. `themeLimits`
63
- declares the system-owned customization bounds for spacing, corner radius, and
64
- glass-material properties; implementing authorities validate replacements
65
- against those bounds. Core defines one fixed numeric scale around any explicit
66
- number and one fixed color scale around any explicit CSS color it does not
67
- prescribe which value an interface ultimately chooses to derive. Background,
68
- foreground, and accent are independent CSS color sources, with standard values
69
- of `#edf8fc`, `#183447`, and `#4c9cff` the established pale surface, primary
70
- ink, and original system blue, respectively. Core stores only those source
71
- colors, never their derived treatments. The declared glass-opacity range ends
72
- at `0.3`.
73
-
74
- `standardTheme` is the single, complete initial value shared by every
75
- environment; the running system remains the authority for its current value.
76
- `createThemeSnapshot()` copies and freezes a complete replacement at the
77
- contract boundary; validation remains the implementing authority's
78
- responsibility.
62
+ Theme properties are expressed as concrete values. `themeLimits` declares the
63
+ contractual customization bounds for spacing, corner radius, and Surface
64
+ properties; implementing authorities validate replacements against those
65
+ bounds. Core defines one fixed numeric scale around any explicit number and one
66
+ fixed color scale around any explicit CSS color. `standardTheme` is the
67
+ canonical reusable default value for that contract, shared by systems,
68
+ interfaces, websites, and Programs that need the same baseline. It is not an
69
+ authoritative environment's mutable Theme state. Background, foreground, and
70
+ accent remain independent CSS color sources. Surface derives its color from
71
+ background and adds grain intensity, animation rate, optional backdrop blur,
72
+ and material opacity; its standard backdrop is zero, so blur is opt-in.
73
+
74
+ `createThemeSnapshot()` copies and freezes one complete value at the contract
75
+ boundary. An implementing authority remains responsible for validation,
76
+ persistence, and the current value; its own schema may derive its defaults from
77
+ `standardTheme` rather than duplicating them.
79
78
 
80
79
  Derived variants are calculations, not persisted `Theme` state. `numericScale()`
81
80
  produces `xsmall`, `small`, `medium`, `large`, and `xlarge`, preserving the
@@ -86,9 +85,9 @@ supplied value exactly at `medium`. `color()` produces `subtle`, `soft`, `base`,
86
85
  after that registration exists. It never supplies an initial snapshot and
87
86
  never replays a change published earlier; Programs request the current
88
87
  snapshot explicitly when they need one. `WritableTheme` adds asynchronous
89
- authority to replace the value a read-only environment exposes `Theme`,
90
- while an authorized environment may expose `WritableTheme` without altering
91
- the shared lifecycle.
88
+ authority to replace the value. A read-only environment exposes `Theme`, while
89
+ an authorized environment may expose `WritableTheme` without altering the
90
+ shared lifecycle.
92
91
 
93
92
  `Colorable`, `Sizable`, `Shapeable`, `Variantable`, and `Elevatable` are
94
93
  independent element capabilities whose concrete value vocabularies are defined
@@ -237,11 +236,13 @@ persistence, upload, Process creation, or rendering implementation.
237
236
  ## Local representation
238
237
 
239
238
  `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.
239
+ the system. `LocalWindow` describes one Client Window's physical representation
240
+ on the current desktop. Its reads and commands are deliberately eventless and
241
+ never change or publish authoritative state. Client SDKs may attach this
242
+ capability to their Window handles; Server SDKs must not. A desktop projects
243
+ authoritative changes onto an ordinary `window` layer, while `under` and `over`
244
+ representations receive their initial truth and control their local projection
245
+ thereafter.
245
246
 
246
247
  `SurfaceSettings` describes optional host-rendered material belonging to one
247
248
  live `under` or `over` representation. Calling `set()` without settings creates
@@ -9,7 +9,7 @@ export type SurfaceSettings = Readonly<{
9
9
  /** A Theme level, CSS pixels, or maximum proportional rounding. */
10
10
  radius?: ScaleLevel | number | "full";
11
11
  }>;
12
- /** Local Surface commands for the current Client representation. */
12
+ /** Local Surface commands for one Client Window representation. */
13
13
  export interface LocalWindowSurface {
14
14
  /** Creates or replaces the Surface, optionally as a visual transaction. */
15
15
  set(settings?: SurfaceSettings, transaction?: Transaction): Promise<void>;
@@ -17,9 +17,9 @@ export interface LocalWindowSurface {
17
17
  remove(): Promise<void>;
18
18
  }
19
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.
20
+ * One Client Window's physical representation on the current desktop. It has
21
+ * no events: its commands neither change authoritative state nor broadcast
22
+ * anything.
23
23
  */
24
24
  export interface LocalWindow {
25
25
  readonly surface: LocalWindowSurface;
package/dist/main.d.ts CHANGED
@@ -10,7 +10,7 @@ export { type DesktopWallpaper, type FileWallpaper, type WallpaperLaunch } from
10
10
  export { isRelativeValue, parseRelativeValue, type RelativeValue, type Value } from "./value.js";
11
11
  export { color, type ColorLevel, type ColorScale } from "./color.js";
12
12
  export { isScaleLevel, numericScale, scale, scaleMultiplier, type NumericScale, type ScaleLevel } from "./scale.js";
13
- export { createThemeSnapshot, standardTheme, themeLimits, type Colorable, type Elevatable, type Shapeable, type Sizable, type Theme, type ThemeEvents, type ThemeGlass, type ThemeProperties, type ThemeRange, type Variantable, type WritableTheme } from "./theme.js";
13
+ export { createThemeSnapshot, standardTheme, themeLimits, type Colorable, type Elevatable, type Shapeable, type Sizable, type Theme, type ThemeEvents, type ThemeProperties, type ThemeRange, type ThemeSurface, type Variantable, type WritableTheme } from "./theme.js";
14
14
  export { type DirectoryStat, type EntryStat, type FileStat, type OtherStat, type ProgramArea, type ProgramStore } from "./storage.js";
15
15
  export { type LogKind, type LogRecord, type LogSource, type ProgramSql } from "./sql.js";
16
16
  export { Endpoint, type AskCapture, type AskMessage, type AskObserver, type EndpointTraffic, type TrafficCapture, type TrafficEvents, type TrafficMessage } from "./endpoint.js";
package/dist/theme.d.ts CHANGED
@@ -6,22 +6,20 @@ export type ThemeRange = Readonly<{
6
6
  /** Largest accepted value. */
7
7
  maximum: number;
8
8
  }>;
9
- /** Bounded controls for the shared glass material. */
10
- export type ThemeGlass = Readonly<{
11
- /** Default strength of the refracted backdrop. */
12
- distortion: number;
13
- /** Default backdrop blur in CSS pixels. */
14
- blur: number;
15
- /** Default backdrop saturation multiplier. */
16
- saturation: number;
17
- /** Default backdrop brightness multiplier. */
18
- brightness: number;
19
- /** Default material opacity from zero to the system's glass cap. */
9
+ /** Concrete defaults for the shared opaque Surface material. */
10
+ export type ThemeSurface = Readonly<{
11
+ /** Grain intensity from zero to one. */
12
+ grain: number;
13
+ /** Grain texture changes per second. */
14
+ animation: number;
15
+ /** Optional backdrop blur in CSS pixels. */
16
+ backdrop: number;
17
+ /** Material opacity from zero to one. */
20
18
  opacity: number;
21
19
  }>;
22
20
  /** The complete set of system-defined Theme properties. */
23
21
  export type ThemeProperties = Readonly<{
24
- /** CSS color underlying shared interface surfaces and materials. */
22
+ /** CSS color underlying interfaces and painted by Surface materials. */
25
23
  background: string;
26
24
  /** CSS color used for shared interface content. */
27
25
  foreground: string;
@@ -31,8 +29,8 @@ export type ThemeProperties = Readonly<{
31
29
  spacing: number;
32
30
  /** Default component corner radius expressed in CSS pixels. */
33
31
  radius: number;
34
- /** Default values for the shared glass material. */
35
- glass: ThemeGlass;
32
+ /** Default values for the shared opaque Surface material. */
33
+ surface: ThemeSurface;
36
34
  }>;
37
35
  /** System-owned bounds for Theme customization. */
38
36
  export declare const themeLimits: Readonly<{
@@ -44,32 +42,28 @@ export declare const themeLimits: Readonly<{
44
42
  minimum: 6;
45
43
  maximum: 18;
46
44
  }>;
47
- glass: Readonly<{
48
- distortion: Readonly<{
49
- minimum: 48;
50
- maximum: 92;
51
- }>;
52
- blur: Readonly<{
53
- minimum: 2;
54
- maximum: 8;
45
+ surface: Readonly<{
46
+ grain: Readonly<{
47
+ minimum: 0;
48
+ maximum: 1;
55
49
  }>;
56
- saturation: Readonly<{
57
- minimum: 1.25;
58
- maximum: 1.8;
50
+ animation: Readonly<{
51
+ minimum: 0;
52
+ maximum: 16;
59
53
  }>;
60
- brightness: Readonly<{
61
- minimum: 1.02;
62
- maximum: 1.1;
54
+ backdrop: Readonly<{
55
+ minimum: 0;
56
+ maximum: 24;
63
57
  }>;
64
58
  opacity: Readonly<{
65
59
  minimum: 0;
66
- maximum: 0.3;
60
+ maximum: 1;
67
61
  }>;
68
62
  }>;
69
63
  }>;
70
64
  /** Complete standard Theme available to every environment. */
71
65
  export declare const standardTheme: Readonly<{
72
- /** CSS color underlying shared interface surfaces and materials. */
66
+ /** CSS color underlying interfaces and painted by Surface materials. */
73
67
  background: string;
74
68
  /** CSS color used for shared interface content. */
75
69
  foreground: string;
@@ -79,8 +73,8 @@ export declare const standardTheme: Readonly<{
79
73
  spacing: number;
80
74
  /** Default component corner radius expressed in CSS pixels. */
81
75
  radius: number;
82
- /** Default values for the shared glass material. */
83
- glass: ThemeGlass;
76
+ /** Default values for the shared opaque Surface material. */
77
+ surface: ThemeSurface;
84
78
  }>;
85
79
  /** Creates a complete immutable Theme snapshot at the contract boundary. */
86
80
  export declare function createThemeSnapshot(theme: ThemeProperties): ThemeProperties;
package/dist/theme.js CHANGED
@@ -2,33 +2,31 @@
2
2
  export const themeLimits = Object.freeze({
3
3
  spacing: Object.freeze({ minimum: 6, maximum: 18 }),
4
4
  radius: Object.freeze({ minimum: 6, maximum: 18 }),
5
- glass: Object.freeze({
6
- distortion: Object.freeze({ minimum: 48, maximum: 92 }),
7
- blur: Object.freeze({ minimum: 2, maximum: 8 }),
8
- saturation: Object.freeze({ minimum: 1.25, maximum: 1.8 }),
9
- brightness: Object.freeze({ minimum: 1.02, maximum: 1.1 }),
10
- opacity: Object.freeze({ minimum: 0, maximum: 0.3 })
5
+ surface: Object.freeze({
6
+ grain: Object.freeze({ minimum: 0, maximum: 1 }),
7
+ animation: Object.freeze({ minimum: 0, maximum: 16 }),
8
+ backdrop: Object.freeze({ minimum: 0, maximum: 24 }),
9
+ opacity: Object.freeze({ minimum: 0, maximum: 1 })
11
10
  })
12
11
  });
13
12
  /** Complete standard Theme available to every environment. */
14
13
  export const standardTheme = createThemeSnapshot({
15
- background: "#edf8fc",
14
+ background: "#f5f4ee",
16
15
  foreground: "#183447",
17
16
  accent: "#4c9cff",
18
17
  spacing: 12,
19
18
  radius: 10,
20
- glass: {
21
- distortion: 70,
22
- blur: 4,
23
- saturation: 1.8,
24
- brightness: 1.06,
25
- opacity: 0.12
19
+ surface: {
20
+ grain: 0.04,
21
+ animation: 0,
22
+ backdrop: 0,
23
+ opacity: 1
26
24
  }
27
25
  });
28
26
  /** Creates a complete immutable Theme snapshot at the contract boundary. */
29
27
  export function createThemeSnapshot(theme) {
30
28
  return Object.freeze({
31
29
  ...theme,
32
- glass: Object.freeze({ ...theme.glass })
30
+ surface: Object.freeze({ ...theme.surface })
33
31
  });
34
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/core",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Environment-neutral contracts and domain objects for PhreshOS Programs.",
5
5
  "type": "module",
6
6
  "sideEffects": false,