@phreshos/client 0.1.16 → 0.1.18

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
@@ -141,7 +141,7 @@ identity is removed by the server host before the message reaches the desktop.
141
141
  The same rule applies to Client-visible traffic destinations.
142
142
 
143
143
  Client-visible Program handles can operate only within their own Program.
144
- They deliberately omit `install()` and `fork()`, and their storage areas never
144
+ They deliberately omit `install()` and `fork()`, and their `Storage` values never
145
145
  expose host filesystem paths. Every Client-side Window handle exposes the same
146
146
  authoritative, subscribable Window capability and its `window.local` physical
147
147
  representation on this desktop. Local reads and updates have no events and do
package/dist/main.d.ts CHANGED
@@ -5,4 +5,4 @@ export { current, type Current, type CurrentServer } from "./current.js";
5
5
  export { type Channel, type ChannelCapture, type ChannelEvents, type ChannelMessage } from "./channel.js";
6
6
  export { ClientServiceHandler, ServerServiceHandler, ServiceHandler, type ClientServiceChannel, type ServerServiceChannel, type ServiceChannel, type ServiceKey, type ServiceLifecycleEvents } from "@phreshos/core";
7
7
  export { Client, Endpoint, Process, Program, Server, type Window, type ProgramProcess, type AnswerCapture, type AnswerMessage, type AnswerObserver, type AskCapture, type AskMessage, type AskObserver, type ClientTraffic, type EndpointTraffic, type ServerTraffic, type TrafficCapture, type TrafficEvents, type TrafficMessage } from "./domain.js";
8
- export type { Askable, Capture, Captures, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, PermissionDecision, Permission, Position, ProgramArea, ProgramEvents, ProgramProcessEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, ServedFile, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TimedPermission, Timeoutable, Theme, ThemeEvents, ThemeProperties, Value, WritableTheme, WindowEvents, WindowGeometry, WindowLayer, WindowState, Easing, LocalWindow, LocalWindowSurface, SurfaceSettings, Transaction } from "@phreshos/core";
8
+ export type { Askable, Capture, Captures, ClientDeclaration, Cleanup, DirectoryStat, EndpointDeclaration, EntryStat, EventMessage, EventName, EventObserver, EventOptions, EventSubscriber, Exit, FileStat, Launch, LaunchClient, Layer, LogKind, LogRecord, LogSource, Message, OtherStat, Outcome, PermissionDecision, Permission, Position, Storage, ProgramEvents, ProgramProcessEvents, ProgramProcessExit, ProgramSql, ProgramStore, ProcessEvents, Publishable, ServedFile, Size, Subscribable, SubscribableEvents, SubscribableFallback, TimedAskable, TimedPermission, Timeoutable, Theme, ThemeEvents, ThemeProperties, Value, WritableTheme, WindowEvents, WindowGeometry, WindowLayer, WindowState, Easing, LocalWindow, LocalWindowSurface, SurfaceSettings, Transaction } from "@phreshos/core";
package/dist/storage.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { ProgramArea, ProgramSql, ProgramStore } from "@phreshos/core";
1
+ import type { ProgramSql, ProgramStore, Storage } from "@phreshos/core";
2
2
  /** Client-side Program storage, structurally scoped by the iframe boundary. */
3
- export declare function area(which: "data" | "cache"): ProgramArea;
3
+ export declare function area(which: "data" | "cache"): Storage;
4
4
  export declare function store(): ProgramStore;
5
5
  export declare function sql(kind: "database" | "logs"): ProgramSql;
package/dist/storage.js CHANGED
@@ -38,14 +38,12 @@ export function area(which) {
38
38
  async text(...path) { return new Response(await stream(...path)).text(); },
39
39
  async json(...path) { return JSON.parse(await new Response(await stream(...path)).text()); },
40
40
  async write(...args) {
41
- if (args.length < 2)
42
- throw new Error("Writing takes a file name and what to write");
43
41
  await transfer("write", args.slice(0, -1), content(args.at(-1)).body);
44
42
  },
45
43
  stat: (...path) => ask("stat", ...path),
46
44
  list: (...path) => ask("list", ...path),
47
45
  delete: (...path) => ask("delete", ...path),
48
- clear: () => ask("clear")
46
+ clear: (...path) => ask("clear", ...path)
49
47
  };
50
48
  }
51
49
  export function store() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/client",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "The SDK used by a Program's client 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.12"
50
+ "@phreshos/core": "^0.1.14"
51
51
  },
52
52
  "dependencies": {
53
53
  "@msgpack/msgpack": "^3.1.3"
54
54
  },
55
55
  "devDependencies": {
56
- "@phreshos/core": "^0.1.13",
56
+ "@phreshos/core": "^0.1.14",
57
57
  "typescript": "^6.0.3"
58
58
  }
59
59
  }