@phreshos/server 0.1.21 → 0.1.22

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/dist/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { system, type System, type SystemProcess, type SystemProgram, type ClientDescription, type SystemProcessEvents, type SystemProcessExit, type SystemProgramEvents, type SystemProgramUninstall, type ProgramDescription, type ServerDescription } from "./system.js";
1
+ export { system } from "./system.js";
2
2
  export { current, type Current, type CurrentClient } from "./current.js";
3
3
  export { type Answerer, type Channel, type ChannelCapture, type ChannelEvents, type ChannelMessage } from "./channel.js";
4
4
  export { type ProgramStartup } from "./startup.js";
@@ -6,4 +6,4 @@ export { type Storage } from "./storage.js";
6
6
  export { ClientServiceHandler, ServerServiceHandler } from "./service.js";
7
7
  export { ServiceHandler, type ClientServiceChannel, type ServerServiceChannel, type ServiceChannel, type ServiceKey, type ServiceLifecycleEvents } from "@phreshos/core";
8
8
  export { Client, Endpoint, Process, Program, Server, type Window, type ProgramProcess } from "./domain.js";
9
- export type { AnswerCapture, AnswerMessage, AnswerObserver, Askable, AskCapture, AskMessage, AskObserver, Capture, Captures, 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, ProgramPermission, ProgramProcessEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, SystemUploads, Upload, ServerTraffic, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TrafficCapture, TrafficEvents, TrafficMessage, Value, Appearance, AppearanceEvents, AppearanceSource, AppearanceSurface, ThemedValue, WritableAppearance, WindowEvents, WindowGeometry, WindowLayer, WindowState } from "@phreshos/core";
9
+ export type { AnswerCapture, AnswerMessage, AnswerObserver, Askable, AskCapture, AskMessage, AskObserver, Capture, Captures, 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, ProgramPermission, ProgramProcessEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, SystemUploads, Upload, ServerTraffic, System, SystemProcess, SystemProcessEntity, SystemProcessEntityEvents, SystemProgram, SystemProgramEntity, SystemProgramProcess, SystemProgramProcessEvents, SystemEndpointEntity, SystemServerEntity, SystemClientEntity, ClientDescription, SystemProcessEvents, SystemProcessExit, SystemProgramEvents, SystemProgramUninstall, ProgramDescription, ServerDescription, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TrafficCapture, TrafficEvents, TrafficMessage, Value, Appearance, AppearanceEvents, AppearanceSource, AppearanceSurface, ThemedValue, WritableAppearance, WindowEvents, WindowGeometry, WindowLayer, WindowState } from "@phreshos/core";
package/dist/system.d.ts CHANGED
@@ -1,133 +1,3 @@
1
- import type { Exit, Layer, Position, ServiceKey, Size, Subscribable, SystemUploads, WritableAppearance } from "@phreshos/core";
2
- import type { ClientServiceHandler, ServerServiceHandler } from "./service.js";
3
- import { type Client, type Process, type Program, type Server } from "./domain.js";
4
- import { type Storage } from "./storage.js";
5
- /** Resolved production description for a Program's Server. */
6
- type ServerDescriptionBase = Readonly<{
7
- /** Absolute directory containing the production Server files. */
8
- location: string;
9
- /** Whether newly created Processes start this Server by default. */
10
- start?: boolean;
11
- /** Command used to install the Server's production dependencies. */
12
- installCommand?: string;
13
- }>;
14
- export type ServerDescription = ServerDescriptionBase & (Readonly<{
15
- /** Command used to start an isolated Server process. */
16
- startCommand: string;
17
- entryFile?: never;
18
- }> | Readonly<{
19
- startCommand?: never;
20
- /** JavaScript module loaded as a worker owned by the System. */
21
- entryFile: string;
22
- }>);
23
- /** Resolved production description for a Program's Client and initial Window. */
24
- export type ClientDescription = Readonly<{
25
- /** Absolute directory containing the production Client files. */
26
- location: string;
27
- /** Whether newly created Processes start this Client by default. */
28
- start?: boolean;
29
- /** Default Window title. */
30
- title?: string;
31
- /** Default Window size. */
32
- size?: Size;
33
- /** Default Window position. */
34
- position?: Position;
35
- /** Default Window layer. */
36
- layer?: Layer;
37
- /** Whether the Window starts minimized. */
38
- minimize?: boolean;
39
- }>;
40
- type Description = Readonly<{
41
- /** Stable identity assigned to the Program. */
42
- identity: string;
43
- /** Human-readable Program name. */
44
- name?: string;
45
- /** Declared Program version. */
46
- version?: string;
47
- /** Short human-readable Program description. */
48
- description?: string;
49
- /** Absolute validated PNG source used to derive the Program's hosted icon sizes. */
50
- icon?: string;
51
- /** Absolute Markdown file describing Program-specific operation to agents. */
52
- agent?: string;
53
- /** Absolute directory used for the Program's persistent storage. */
54
- storage: string;
55
- }>;
56
- /** Complete runtime description used to create a Program. */
57
- export type ProgramDescription = Description & (Readonly<{
58
- /** Required Server description when no Client is described. */
59
- server: ServerDescription;
60
- /** Optional Client description. */
61
- client?: ClientDescription;
62
- }> | Readonly<{
63
- /** Optional Server description. */
64
- server?: ServerDescription;
65
- /** Required Client description when no Server is described. */
66
- client: ClientDescription;
67
- }>);
68
- /** An uninstall reported with the affected Program and removal scope. */
69
- export type SystemProgramUninstall = Readonly<{
70
- /** Program that left the installed state. */
71
- program: Program;
72
- /** Whether all installed resources, including storage, were removed. */
73
- everythingRemoved: boolean;
74
- }>;
75
- /** A Process exit reported with the Process that ended. */
76
- export type SystemProcessExit = Exit & Readonly<{
77
- /** Process that ended. */
78
- process: Process;
79
- }>;
80
- /** Authoritative lifecycle events visible to the Server system. */
81
- export type SystemProgramEvents = {
82
- /** A Program entered the runtime registry. */
83
- create: Program;
84
- /** A Program left the runtime registry. */
85
- forget: Program;
86
- /** A Program entered the installed state. */
87
- install: Program;
88
- /** A Program left the installed state. */
89
- uninstall: SystemProgramUninstall;
90
- };
91
- /** Authoritative Process lifecycle events visible to the Server system. */
92
- export type SystemProcessEvents = {
93
- /** One Process Endpoint entered a new live incarnation. */
94
- endpointStart: Server | Client;
95
- /** One Process Endpoint incarnation ended. */
96
- endpointStop: Server | Client;
97
- /** A Process entered the runtime set. */
98
- create: Process;
99
- /** A Process left the runtime set. */
100
- exit: SystemProcessExit;
101
- };
102
- /** Authoritative Program registry available to a Server endpoint. */
103
- export interface SystemProgram extends Subscribable<SystemProgramEvents, never> {
104
- list(onlyInstalled?: boolean): Promise<Program[]>;
105
- find(identity: string): Promise<Program | null>;
106
- create(source: ProgramDescription | string): Promise<Program>;
107
- }
108
- /** Authoritative Process registry available to a Server endpoint. */
109
- export interface SystemProcess extends Subscribable<SystemProcessEvents, never> {
110
- list(): Promise<Process[]>;
111
- find(identity: string): Promise<Process | null>;
112
- }
113
- /** Authoritative system capabilities available to a Server endpoint. */
114
- export interface System {
115
- /** Native operating-system home storage available to Server endpoints. */
116
- readonly storage: Storage;
117
- /** Complete unresolved Appearance authority owned by the System. */
118
- readonly appearance: WritableAppearance;
119
- readonly program: SystemProgram;
120
- readonly process: SystemProcess;
121
- /** Flat System-owned public uploads capability. */
122
- readonly uploads: SystemUploads;
123
- /** Returns a stable handle for one exact Service identity. */
124
- service<ServiceEvents extends object = {}>(key: ServiceKey & {
125
- endpoint: "server";
126
- }): ServerServiceHandler<ServiceEvents>;
127
- service<ServiceEvents extends object = {}>(key: ServiceKey & {
128
- endpoint: "client";
129
- }): ClientServiceHandler<ServiceEvents>;
130
- }
1
+ import type { System } from "@phreshos/core";
131
2
  /** Authoritative system capabilities for the currently executing Server. */
132
3
  export declare const system: System;
133
- export {};
package/dist/system.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Events from "./events.js";
2
- import { exit, lifecycleEndpoint, process, program } from "./domain.js";
2
+ import { exit, lifecycleEndpoint, process, program, } from "./domain.js";
3
3
  import { uploads } from "./uploads.js";
4
4
  import ServerAppearance from "./appearance.js";
5
5
  import wire from "./wire.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/server",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "The SDK used by a Program's server endpoint.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -47,13 +47,13 @@
47
47
  "prepack": "node --run build"
48
48
  },
49
49
  "peerDependencies": {
50
- "@phreshos/core": "^0.1.20"
50
+ "@phreshos/core": "^0.1.21"
51
51
  },
52
52
  "dependencies": {
53
53
  "@msgpack/msgpack": "^3.1.3"
54
54
  },
55
55
  "devDependencies": {
56
- "@phreshos/core": "^0.1.20",
56
+ "@phreshos/core": "^0.1.21",
57
57
  "@types/node": "^26.2.0",
58
58
  "typescript": "^6.0.3"
59
59
  }