@phreshos/cli 0.1.39 → 0.1.41

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.
@@ -1,4 +1,4 @@
1
- import {} from "commander";
1
+ import { Option } from "commander";
2
2
  import { commandContract } from "../command-contract.js";
3
3
  import { clientOverrideOptions, endpointOptions, outputOptions } from "./options.js";
4
4
  import { bounded, clientLaunch, connected, endpoint, endpointView, integer, output, payload, requireProcess, wait } from "./shared.js";
@@ -38,6 +38,20 @@ export default function endpointCommands(root, connect) {
38
38
  await process.server.waitReady(timeout(options.timeout));
39
39
  output(await endpointView(process, "server"), options.compact);
40
40
  }));
41
+ outputOptions(endpointOptions(endpoints.command("waitLifecycle")
42
+ .alias("wait-lifecycle")
43
+ .description("wait for one lifecycle transition of an exact Endpoint")
44
+ .addOption(new Option("--event <event>", "Endpoint lifecycle event")
45
+ .choices(["start", "stop"])
46
+ .makeOptionMandatory())
47
+ .option("--timeout <milliseconds>", "maximum wait in milliseconds", integer)))
48
+ .action(async (options) => withEndpoint(connect, options, async (process, name) => {
49
+ await wait(endpoint(process, name).lifecycle, options.event, timeout(options.timeout));
50
+ output({
51
+ scope: `endpoint:${process.identity}:${name}:lifecycle`,
52
+ event: options.event
53
+ }, options.compact);
54
+ }));
41
55
  outputOptions(endpointOptions(endpoints.command("ask")
42
56
  .description("ask a Server event and return its answer")
43
57
  .requiredOption("--event <event>", "event name")
@@ -49,7 +49,7 @@ export default function processCommands(root, connect) {
49
49
  outputOptions(process.command("wait")
50
50
  .description("wait for one Process lifecycle event")
51
51
  .addOption(new Option("--event <event>", "Process lifecycle event")
52
- .choices(["endpointStart", "endpointStop", "create", "exit"])
52
+ .choices(["create", "exit"])
53
53
  .makeOptionMandatory())
54
54
  .option("--process <identity>", "scope the event to one Process")
55
55
  .option("--program <identity>", "scope the event to one Program")
@@ -75,14 +75,6 @@ export default function processCommands(root, connect) {
75
75
  async function eventView(event, message, scoped) {
76
76
  if (event === "create")
77
77
  return processView(message);
78
- if (event === "endpointStart" || event === "endpointStop") {
79
- const endpoint = message;
80
- const process = await endpoint.process();
81
- return {
82
- process: process.identity,
83
- endpoint: endpoint === process.server ? "server" : "client"
84
- };
85
- }
86
78
  const exit = message;
87
79
  const process = exit.process ?? scoped;
88
80
  return {
@@ -48,15 +48,19 @@ export default function programCommands(root, connect) {
48
48
  output({
49
49
  scope: options.program ? `program:${options.program}` : "program",
50
50
  event: options.event,
51
- payload: await eventView(options.event, message)
51
+ payload: await eventView(options.event, message, options.program ? target : undefined)
52
52
  }, options.compact);
53
53
  }));
54
54
  }
55
- async function eventView(event, message) {
55
+ async function eventView(event, message, scoped) {
56
56
  if (event === "uninstall") {
57
+ if (scoped)
58
+ return { program: await programView(scoped), everything: message === true };
57
59
  const value = message;
58
- return { program: await programView(value.program), everythingRemoved: value.everythingRemoved };
60
+ return { program: await programView(value.program), everything: value.everything };
59
61
  }
62
+ if (scoped)
63
+ return programView(scoped);
60
64
  return programView(message);
61
65
  }
62
66
  function timeout(value) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "phresh",
3
3
  "private": true,
4
- "version": "0.1.22",
4
+ "version": "0.1.23",
5
5
  "description": "The official PhreshOS starter Program.",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -14,15 +14,15 @@
14
14
  "starter"
15
15
  ],
16
16
  "dependencies": {
17
- "@phreshos/client": "^0.1.25",
18
- "@phreshos/core": "^0.1.25",
19
- "@phreshos/react": "^0.1.13",
20
- "@phreshos/server": "^0.1.26",
17
+ "@phreshos/client": "^0.1.26",
18
+ "@phreshos/core": "^0.1.26",
19
+ "@phreshos/react": "^0.1.14",
20
+ "@phreshos/server": "^0.1.27",
21
21
  "react": "^19.2.8",
22
22
  "react-dom": "^19.2.8"
23
23
  },
24
24
  "devDependencies": {
25
- "@phreshos/cli": "^0.1.39",
25
+ "@phreshos/cli": "^0.1.41",
26
26
  "@types/node": "^26.2.0",
27
27
  "@types/react": "^19.2.18",
28
28
  "@types/react-dom": "^19.2.4",
@@ -4,7 +4,7 @@ export default defineConfig({
4
4
  identity: "phresh",
5
5
  name: "Phresh Program",
6
6
  description: "A minimal counter with direct Client and Server endpoints.",
7
- version: "0.1.22",
7
+ version: "0.1.23",
8
8
  icon: "icon.png",
9
9
  categories: ["Development"],
10
10
  keywords: ["example", "counter", "client", "server"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "repository": "PhreshOS/phresh-program",
3
- "version": "0.1.22",
4
- "sha256": "f6892e1f1deee3764dbd5ac89fbe3884e2feb850a7a021ca2a0ff3df7e12db47",
3
+ "version": "0.1.23",
4
+ "sha256": "055a84726198072f481b14bd2aabd0f155982238914aded7808008c4197c123f",
5
5
  "development": true
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phreshos/cli",
3
3
  "type": "module",
4
- "version": "0.1.39",
4
+ "version": "0.1.41",
5
5
  "description": "The Phresh command-line interface for Program projects and system management.",
6
6
  "engines": {
7
7
  "node": ">=20.10"
@@ -49,8 +49,8 @@
49
49
  "packageManager": "bun@1.3.14",
50
50
  "dependencies": {
51
51
  "@clack/prompts": "^1.7.0",
52
- "@phreshos/core": "^0.1.26",
53
- "@phreshos/node": "^0.1.5",
52
+ "@phreshos/core": "^0.1.27",
53
+ "@phreshos/node": "^0.1.6",
54
54
  "adm-zip": "^0.6.0",
55
55
  "commander": "^15.0.0",
56
56
  "picocolors": "^1.1.1"