@phreshos/client 0.1.39 → 0.1.40

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/domain.js CHANGED
@@ -4,6 +4,7 @@ import Deadline from "./deadline.js";
4
4
  import HandleRegistry from "./handle-registry.js";
5
5
  import { area, sql, store } from "./storage.js";
6
6
  import startup from "./startup.js";
7
+ import launch from "./launch.js";
7
8
  import { programPermissions } from "./permissions.js";
8
9
  import wire from "./wire.js";
9
10
  const handles = new HandleRegistry();
@@ -19,6 +20,7 @@ class ProgramHandle extends CoreProgram {
19
20
  logs;
20
21
  database;
21
22
  startup;
23
+ launch;
22
24
  process;
23
25
  permissions;
24
26
  record;
@@ -33,6 +35,7 @@ class ProgramHandle extends CoreProgram {
33
35
  this.logs = sql("logs", this.address);
34
36
  this.database = sql("database", this.address);
35
37
  this.startup = startup(this.address);
38
+ this.launch = launch(this.address);
36
39
  this.permissions = programPermissions(this.address);
37
40
  this.process = new ProgramProcessHandle(this.address, record.reference);
38
41
  const events = scoped("program-host", record.reference, programEvent);
@@ -72,10 +75,6 @@ class ProgramHandle extends CoreProgram {
72
75
  yield programCommandChunk(value);
73
76
  }
74
77
  }
75
- async fork(identity) {
76
- const answer = await wire.request(["fork", this.address, identity]);
77
- return program(answer[0]);
78
- }
79
78
  async *uninstall(everything = false) {
80
79
  for await (const value of wire.stream(["uninstall", this.address, everything])) {
81
80
  yield programCommandChunk(value);
@@ -0,0 +1,4 @@
1
+ import { type ProgramLaunch } from "@phreshos/core";
2
+ import type { HandleAddress } from "./domain.js";
3
+ /** Bind saved launch operations to one Program handle. */
4
+ export default function launch(program: HandleAddress): ProgramLaunch;
package/dist/launch.js ADDED
@@ -0,0 +1,14 @@
1
+ import { parseLaunch } from "@phreshos/core";
2
+ import wire from "./wire.js";
3
+ /** Bind saved launch operations to one Program handle. */
4
+ export default function launch(program) {
5
+ return {
6
+ async get() {
7
+ const [value] = await wire.request(["launch", program, "get"]);
8
+ return value === null ? null : parseLaunch(value);
9
+ },
10
+ async set(value) {
11
+ await wire.request(["launch", program, "set", parseLaunch(value)]);
12
+ }
13
+ };
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phreshos/client",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "The SDK used by a Program's client endpoint.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -46,13 +46,13 @@
46
46
  "test": "vitest run --project default"
47
47
  },
48
48
  "peerDependencies": {
49
- "@phreshos/core": "^0.1.43"
49
+ "@phreshos/core": "^0.1.45"
50
50
  },
51
51
  "dependencies": {
52
52
  "@the-link/messagepack": "^0.1.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@phreshos/core": "^0.1.43",
55
+ "@phreshos/core": "^0.1.45",
56
56
  "typescript": "^6.0.3",
57
57
  "vitest": "^4.1.10"
58
58
  }