@phreshos/cli 0.1.68 → 0.1.70
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.
|
@@ -52,8 +52,6 @@ export const executeCommandPaths = Object.freeze({
|
|
|
52
52
|
"window.maximize": ["window", "maximize"],
|
|
53
53
|
"window.setTitle": ["window", "setTitle"],
|
|
54
54
|
"window.setHeader": ["window", "setHeader"],
|
|
55
|
-
"window.setFrame": ["window", "setFrame"],
|
|
56
|
-
"window.setTransaction": ["window", "setTransaction"],
|
|
57
55
|
"window.raise": ["window", "raise"],
|
|
58
56
|
"window.wait": ["window", "wait"]
|
|
59
57
|
});
|
package/dist/commands/schemas.js
CHANGED
|
@@ -3,38 +3,6 @@ import { value } from "../contract/schema.js";
|
|
|
3
3
|
const metric = {
|
|
4
4
|
anyOf: [value.number("pixels"), value.string("workspace-relative expression")]
|
|
5
5
|
};
|
|
6
|
-
const transaction = {
|
|
7
|
-
anyOf: [
|
|
8
|
-
value.boolean("default or disabled transaction"),
|
|
9
|
-
value.number("duration in milliseconds"),
|
|
10
|
-
value.object({
|
|
11
|
-
duration: value.number("duration in milliseconds"),
|
|
12
|
-
easing: value.any("CSS easing name or cubic Bézier tuple")
|
|
13
|
-
}, ["duration", "easing"], "appearance transaction")
|
|
14
|
-
]
|
|
15
|
-
};
|
|
16
|
-
const frame = {
|
|
17
|
-
anyOf: [
|
|
18
|
-
value.boolean("default or absent frame"),
|
|
19
|
-
value.object({
|
|
20
|
-
radius: { anyOf: [value.number("radius in pixels"), value.literal("full", "fully rounded radius")] },
|
|
21
|
-
color: value.string("Appearance color role or CSS color"),
|
|
22
|
-
material: {
|
|
23
|
-
anyOf: [
|
|
24
|
-
value.literal(false, "disabled Material"),
|
|
25
|
-
value.object({
|
|
26
|
-
grain: value.number("grain frequency"),
|
|
27
|
-
grainAmount: value.number("grain intensity"),
|
|
28
|
-
backdrop: value.number("backdrop blur"),
|
|
29
|
-
opacity: value.number("Material opacity"),
|
|
30
|
-
distortion: value.number("backdrop distortion"),
|
|
31
|
-
saturation: value.number("backdrop saturation")
|
|
32
|
-
}, [], "partial Appearance Material")
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
}, [], "Window frame customization")
|
|
36
|
-
]
|
|
37
|
-
};
|
|
38
6
|
const endpointDeclaration = value.nullable(value.object({
|
|
39
7
|
start: value.boolean("whether a default Process starts this Endpoint"),
|
|
40
8
|
service: value.boolean("default Service role for new execution contexts")
|
|
@@ -44,14 +12,12 @@ const clientDeclaration = value.nullable(value.object({
|
|
|
44
12
|
service: value.boolean("default Service role for new execution contexts"),
|
|
45
13
|
title: value.nullable(value.string("default Window title")),
|
|
46
14
|
header: value.nullable(value.boolean("default Window header visibility")),
|
|
47
|
-
frame: value.nullable(frame),
|
|
48
|
-
transaction: value.nullable(transaction),
|
|
49
15
|
size: value.nullable(value.object({ width: metric, height: metric }, ["width", "height"], "default Window size")),
|
|
50
16
|
position: value.nullable(value.object({ x: metric, y: metric }, ["x", "y"], "default Window position")),
|
|
51
17
|
layer: value.nullable(value.enumeration(layers, "default Window layer")),
|
|
52
18
|
minimize: value.nullable(value.boolean("default minimized state")),
|
|
53
19
|
maximize: value.nullable(value.boolean("default maximized state"))
|
|
54
|
-
}, ["start", "service", "title", "header", "
|
|
20
|
+
}, ["start", "service", "title", "header", "size", "position", "layer", "minimize", "maximize"], "resolved Client Endpoint declaration"));
|
|
55
21
|
export const programOutput = value.object({
|
|
56
22
|
identity: value.string("stable Program identity"),
|
|
57
23
|
assetId: value.string("public Program asset identity"),
|
|
@@ -89,15 +55,13 @@ export const windowOutput = value.object({
|
|
|
89
55
|
process: value.string("owning Process identity"),
|
|
90
56
|
title: value.string("Window title"),
|
|
91
57
|
header: value.boolean("whether the Desktop-owned Window header is shown"),
|
|
92
|
-
frame,
|
|
93
|
-
transaction,
|
|
94
58
|
position: value.object({ x: metric, y: metric }, ["x", "y"], "Window position"),
|
|
95
59
|
size: value.object({ width: metric, height: metric }, ["width", "height"], "Window size"),
|
|
96
60
|
minimized: value.boolean("whether the Window is minimized"),
|
|
97
61
|
maximized: value.boolean("whether the Window is maximized"),
|
|
98
62
|
front: value.boolean("whether the Window is at the front of its layer"),
|
|
99
63
|
layer: value.enumeration(layers, "Window layer")
|
|
100
|
-
}, ["process", "title", "header", "
|
|
64
|
+
}, ["process", "title", "header", "position", "size", "minimized", "maximized", "front", "layer"], "Window state");
|
|
101
65
|
export const programPresentation = fields(["Identity", "identity"], ["Asset", "assetId"], ["Name", "name"], ["Version", "version"], ["Description", "description"], ["Installed", "installed"], ["Agent", "hasAgent"], ["Server", "server"], ["Client", "client"]);
|
|
102
66
|
export const programListPresentation = list("data", "Program", "Programs", "No matching Programs", [
|
|
103
67
|
{ label: "Name", path: "name" },
|
|
@@ -123,7 +87,7 @@ export const serviceListPresentation = list("data", "Service", "Services", "No m
|
|
|
123
87
|
{ label: "Program", path: "program" },
|
|
124
88
|
{ label: "Endpoint", path: "endpoint" }
|
|
125
89
|
]);
|
|
126
|
-
export const windowPresentation = fields(["Process", "process"], ["Title", "title"], ["Header", "header"], ["
|
|
90
|
+
export const windowPresentation = fields(["Process", "process"], ["Title", "title"], ["Header", "header"], ["Position", "position"], ["Size", "size"], ["Minimized", "minimized"], ["Maximized", "maximized"], ["Front", "front"], ["Layer", "layer"]);
|
|
127
91
|
export const windowPositionPresentation = fields(["Process", "process"], ["Position", "position"]);
|
|
128
92
|
export const windowSizePresentation = fields(["Process", "process"], ["Size", "size"]);
|
|
129
93
|
export const windowGeometryPresentation = fields(["Process", "process"], ["Position", "position"], ["Size", "size"]);
|
|
@@ -131,8 +95,6 @@ export const windowMinimizePresentation = fields(["Process", "process"], ["Minim
|
|
|
131
95
|
export const windowMaximizePresentation = fields(["Process", "process"], ["Maximized", "maximized"]);
|
|
132
96
|
export const windowTitlePresentation = fields(["Process", "process"], ["Title", "title"]);
|
|
133
97
|
export const windowHeaderPresentation = fields(["Process", "process"], ["Header", "header"]);
|
|
134
|
-
export const windowFramePresentation = fields(["Process", "process"], ["Frame", "frame"]);
|
|
135
|
-
export const windowTransactionPresentation = fields(["Process", "process"], ["Transaction", "transaction"]);
|
|
136
98
|
export const windowRaisePresentation = fields(["Process", "process"], ["Front", "front"]);
|
|
137
99
|
export const eventPresentation = fields(["Scope", "scope"], ["Event", "event"], ["Payload", "payload"]);
|
|
138
100
|
export const lifecyclePresentation = fields(["Scope", "scope"], ["Event", "event"]);
|
package/dist/commands/window.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { parseExecuteRequest
|
|
1
|
+
import { parseExecuteRequest } from "@phreshos/core";
|
|
2
2
|
import { defineCommand } from "../contract/command.js";
|
|
3
3
|
import { option, processOptions, timeoutOption, withJson } from "./options.js";
|
|
4
|
-
import { dataOutput, eventOutput, eventPresentation, windowGeometryPresentation,
|
|
4
|
+
import { dataOutput, eventOutput, eventPresentation, windowGeometryPresentation, windowHeaderPresentation, windowMinimizePresentation, windowMaximizePresentation, windowOutput, windowPositionPresentation, windowPresentation, windowRaisePresentation, windowSizePresentation, windowTitlePresentation } from "./schemas.js";
|
|
5
5
|
import { connected } from "./connection.js";
|
|
6
6
|
import { bounded, position, size } from "./input.js";
|
|
7
7
|
import { executeDescription } from "./execution.js";
|
|
@@ -56,27 +56,6 @@ export default function windowCommands(root, connect) {
|
|
|
56
56
|
options: withJson(...processOptions, option("--hide", "hide rather than show the Window header")),
|
|
57
57
|
examples: ["phresh window set-header --process main --program terminal --hide", "phresh window set-header --process main --program terminal"]
|
|
58
58
|
}, async ({ options }) => executeWindow(connect, options, { $operation: "setHeader", header: options.hide !== true }));
|
|
59
|
-
defineCommand(windows, {
|
|
60
|
-
...state("setFrame", windowFramePresentation),
|
|
61
|
-
aliases: ["set-frame"],
|
|
62
|
-
options: withJson(...processOptions, option("--default", "use the default Window frame"), option("--absent", "remove the Window frame"), option("--radius <radius>", "frame radius in pixels or full"), option("--color <color>", "Appearance color role or CSS color"), option("--without-material", "render the frame without Material"), option("--grain <value>", "frame Material grain", { parse: input => numeric(input, "--grain") }), option("--grain-amount <value>", "frame Material grain intensity", { parse: input => numeric(input, "--grain-amount") }), option("--backdrop <value>", "frame Material backdrop blur", { parse: input => numeric(input, "--backdrop") }), option("--opacity <value>", "frame Material opacity", { parse: input => numeric(input, "--opacity") }), option("--distortion <value>", "frame Material distortion", { parse: input => numeric(input, "--distortion") }), option("--saturation <value>", "frame Material saturation", { parse: input => numeric(input, "--saturation") })),
|
|
63
|
-
examples: [
|
|
64
|
-
"phresh window set-frame --process overlay --absent",
|
|
65
|
-
"phresh window set-frame --process overlay --radius full --color primary"
|
|
66
|
-
]
|
|
67
|
-
}, async ({ options }) => executeWindow(connect, options, { $operation: "setFrame", frame: frame(options) }));
|
|
68
|
-
defineCommand(windows, {
|
|
69
|
-
...state("setTransaction", windowTransactionPresentation),
|
|
70
|
-
aliases: ["set-transaction"],
|
|
71
|
-
options: withJson(...processOptions, option("--default", "use the default Appearance transaction"), option("--disabled", "disable the default Window transaction"), option("--duration <milliseconds>", "transaction duration", { parse: input => numeric(input, "--duration") }), option("--easing <easing>", "standard easing name or four comma-separated cubic Bézier values")),
|
|
72
|
-
examples: [
|
|
73
|
-
"phresh window set-transaction --process overlay --default",
|
|
74
|
-
"phresh window set-transaction --process overlay --duration 240 --easing ease-out"
|
|
75
|
-
]
|
|
76
|
-
}, async ({ options }) => executeWindow(connect, options, {
|
|
77
|
-
$operation: "setTransaction",
|
|
78
|
-
transaction: transaction(options)
|
|
79
|
-
}));
|
|
80
59
|
defineCommand(windows, {
|
|
81
60
|
...state("raise", windowRaisePresentation),
|
|
82
61
|
examples: ["phresh window raise --process main --program terminal"]
|
|
@@ -87,7 +66,7 @@ export default function windowCommands(root, connect) {
|
|
|
87
66
|
requiresSystem: true,
|
|
88
67
|
options: withJson(...processOptions, option("--event <event>", "Window event", {
|
|
89
68
|
mandatory: true,
|
|
90
|
-
choices: ["move", "resize", "minimize", "maximize", "changeTitle", "changeHeader", "
|
|
69
|
+
choices: ["move", "resize", "minimize", "maximize", "changeTitle", "changeHeader", "front"]
|
|
91
70
|
}), timeoutOption),
|
|
92
71
|
output: dataOutput(eventOutput("The observed Window event"), "One Window event", eventPresentation),
|
|
93
72
|
examples: ["phresh window wait --process main --program terminal --event move --json"]
|
|
@@ -115,61 +94,3 @@ async function executeWindow(connect, options, operation) {
|
|
|
115
94
|
});
|
|
116
95
|
return connected(connect, system => system.execute(request));
|
|
117
96
|
}
|
|
118
|
-
function frame(options) {
|
|
119
|
-
const materialValues = material(options);
|
|
120
|
-
const customized = options.radius !== undefined || options.color !== undefined || materialValues !== undefined;
|
|
121
|
-
const modes = Number(options.default === true) + Number(options.absent === true) + Number(customized);
|
|
122
|
-
if (modes !== 1)
|
|
123
|
-
throw new Error("Choose exactly one of --default, --absent, or frame customization options");
|
|
124
|
-
if (options.default)
|
|
125
|
-
return true;
|
|
126
|
-
if (options.absent)
|
|
127
|
-
return false;
|
|
128
|
-
return parseWindowFrame({
|
|
129
|
-
...(options.radius === undefined ? {} : { radius: options.radius === "full" ? "full" : numeric(options.radius, "--radius") }),
|
|
130
|
-
...(options.color === undefined ? {} : { color: options.color }),
|
|
131
|
-
...(materialValues === undefined ? {} : { material: materialValues })
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
function material(options) {
|
|
135
|
-
const values = {
|
|
136
|
-
grain: options.grain,
|
|
137
|
-
grainAmount: options.grainAmount,
|
|
138
|
-
backdrop: options.backdrop,
|
|
139
|
-
opacity: options.opacity,
|
|
140
|
-
distortion: options.distortion,
|
|
141
|
-
saturation: options.saturation
|
|
142
|
-
};
|
|
143
|
-
const customized = Object.values(values).some(value => value !== undefined);
|
|
144
|
-
const modes = Number(options.withoutMaterial === true) + Number(customized);
|
|
145
|
-
if (modes > 1)
|
|
146
|
-
throw new Error("Choose only one Material mode");
|
|
147
|
-
if (options.withoutMaterial)
|
|
148
|
-
return false;
|
|
149
|
-
if (!customized)
|
|
150
|
-
return undefined;
|
|
151
|
-
return Object.fromEntries(Object.entries(values).filter(([, value]) => value !== undefined));
|
|
152
|
-
}
|
|
153
|
-
function transaction(options) {
|
|
154
|
-
const customized = options.duration !== undefined || options.easing !== undefined;
|
|
155
|
-
const modes = Number(options.default === true) + Number(options.disabled === true) + Number(customized);
|
|
156
|
-
if (modes !== 1)
|
|
157
|
-
throw new Error("Choose exactly one of --default, --disabled, or --duration");
|
|
158
|
-
if (options.default)
|
|
159
|
-
return true;
|
|
160
|
-
if (options.disabled)
|
|
161
|
-
return false;
|
|
162
|
-
if (options.duration === undefined)
|
|
163
|
-
throw new Error("--easing requires --duration");
|
|
164
|
-
if (options.easing === undefined)
|
|
165
|
-
return parseWindowTransaction(options.duration);
|
|
166
|
-
const pieces = options.easing.split(",").map(value => value.trim());
|
|
167
|
-
const easing = pieces.length === 4 ? pieces.map(value => numeric(value, "--easing")) : options.easing;
|
|
168
|
-
return parseWindowTransaction({ duration: options.duration, easing });
|
|
169
|
-
}
|
|
170
|
-
function numeric(value, name) {
|
|
171
|
-
const result = Number(value);
|
|
172
|
-
if (!Number.isFinite(result))
|
|
173
|
-
throw new Error(`${name} must be a finite number`);
|
|
174
|
-
return result;
|
|
175
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phresh",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.43",
|
|
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.
|
|
18
|
-
"@phreshos/core": "^0.1.
|
|
19
|
-
"@phreshos/react": "^0.1.
|
|
20
|
-
"@phreshos/server": "^0.1.
|
|
17
|
+
"@phreshos/client": "^0.1.49",
|
|
18
|
+
"@phreshos/core": "^0.1.58",
|
|
19
|
+
"@phreshos/react": "^0.1.30",
|
|
20
|
+
"@phreshos/server": "^0.1.54",
|
|
21
21
|
"react": "^19.2.8",
|
|
22
22
|
"react-dom": "^19.2.8"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@phreshos/cli": "^0.1.
|
|
25
|
+
"@phreshos/cli": "^0.1.70",
|
|
26
26
|
"@types/node": "^26.4.0",
|
|
27
27
|
"@types/react": "^19.2.18",
|
|
28
28
|
"@types/react-dom": "^19.2.5",
|
|
@@ -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.
|
|
7
|
+
version: "0.1.43",
|
|
8
8
|
icon: "icon.png",
|
|
9
9
|
categories: ["Development"],
|
|
10
10
|
keywords: ["example", "counter", "client", "server"],
|
package/dist/template.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repository": "PhreshOS/phresh-program",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"sha256": "
|
|
3
|
+
"version": "0.1.43",
|
|
4
|
+
"sha256": "0088084c1afe089147520c89bb03e129558e7d70475aa2aa13745179de975322",
|
|
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.
|
|
4
|
+
"version": "0.1.70",
|
|
5
5
|
"description": "The Phresh command-line interface for Program projects and system management.",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.10"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"packageManager": "bun@1.3.14",
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@clack/prompts": "^1.7.0",
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
"@phreshos/core": "^0.1.59",
|
|
51
|
+
"@phreshos/node": "^0.1.32",
|
|
52
52
|
"adm-zip": "^0.6.0",
|
|
53
53
|
"commander": "^15.0.0",
|
|
54
54
|
"picocolors": "^1.1.1"
|