@phreshos/cli 0.1.68 → 0.1.69
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,7 +52,7 @@ 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.
|
|
55
|
+
"window.setSurface": ["window", "setSurface"],
|
|
56
56
|
"window.setTransaction": ["window", "setTransaction"],
|
|
57
57
|
"window.raise": ["window", "raise"],
|
|
58
58
|
"window.wait": ["window", "wait"]
|
package/dist/commands/schemas.js
CHANGED
|
@@ -13,9 +13,9 @@ const transaction = {
|
|
|
13
13
|
}, ["duration", "easing"], "appearance transaction")
|
|
14
14
|
]
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
const surface = {
|
|
17
17
|
anyOf: [
|
|
18
|
-
value.boolean("default or absent
|
|
18
|
+
value.boolean("default or absent surface"),
|
|
19
19
|
value.object({
|
|
20
20
|
radius: { anyOf: [value.number("radius in pixels"), value.literal("full", "fully rounded radius")] },
|
|
21
21
|
color: value.string("Appearance color role or CSS color"),
|
|
@@ -32,7 +32,7 @@ const frame = {
|
|
|
32
32
|
}, [], "partial Appearance Material")
|
|
33
33
|
]
|
|
34
34
|
}
|
|
35
|
-
}, [], "Window
|
|
35
|
+
}, [], "Window surface customization")
|
|
36
36
|
]
|
|
37
37
|
};
|
|
38
38
|
const endpointDeclaration = value.nullable(value.object({
|
|
@@ -44,14 +44,14 @@ const clientDeclaration = value.nullable(value.object({
|
|
|
44
44
|
service: value.boolean("default Service role for new execution contexts"),
|
|
45
45
|
title: value.nullable(value.string("default Window title")),
|
|
46
46
|
header: value.nullable(value.boolean("default Window header visibility")),
|
|
47
|
-
|
|
47
|
+
surface: value.nullable(surface),
|
|
48
48
|
transaction: value.nullable(transaction),
|
|
49
49
|
size: value.nullable(value.object({ width: metric, height: metric }, ["width", "height"], "default Window size")),
|
|
50
50
|
position: value.nullable(value.object({ x: metric, y: metric }, ["x", "y"], "default Window position")),
|
|
51
51
|
layer: value.nullable(value.enumeration(layers, "default Window layer")),
|
|
52
52
|
minimize: value.nullable(value.boolean("default minimized state")),
|
|
53
53
|
maximize: value.nullable(value.boolean("default maximized state"))
|
|
54
|
-
}, ["start", "service", "title", "header", "
|
|
54
|
+
}, ["start", "service", "title", "header", "surface", "transaction", "size", "position", "layer", "minimize", "maximize"], "resolved Client Endpoint declaration"));
|
|
55
55
|
export const programOutput = value.object({
|
|
56
56
|
identity: value.string("stable Program identity"),
|
|
57
57
|
assetId: value.string("public Program asset identity"),
|
|
@@ -89,7 +89,7 @@ export const windowOutput = value.object({
|
|
|
89
89
|
process: value.string("owning Process identity"),
|
|
90
90
|
title: value.string("Window title"),
|
|
91
91
|
header: value.boolean("whether the Desktop-owned Window header is shown"),
|
|
92
|
-
|
|
92
|
+
surface,
|
|
93
93
|
transaction,
|
|
94
94
|
position: value.object({ x: metric, y: metric }, ["x", "y"], "Window position"),
|
|
95
95
|
size: value.object({ width: metric, height: metric }, ["width", "height"], "Window size"),
|
|
@@ -97,7 +97,7 @@ export const windowOutput = value.object({
|
|
|
97
97
|
maximized: value.boolean("whether the Window is maximized"),
|
|
98
98
|
front: value.boolean("whether the Window is at the front of its layer"),
|
|
99
99
|
layer: value.enumeration(layers, "Window layer")
|
|
100
|
-
}, ["process", "title", "header", "
|
|
100
|
+
}, ["process", "title", "header", "surface", "transaction", "position", "size", "minimized", "maximized", "front", "layer"], "Window state");
|
|
101
101
|
export const programPresentation = fields(["Identity", "identity"], ["Asset", "assetId"], ["Name", "name"], ["Version", "version"], ["Description", "description"], ["Installed", "installed"], ["Agent", "hasAgent"], ["Server", "server"], ["Client", "client"]);
|
|
102
102
|
export const programListPresentation = list("data", "Program", "Programs", "No matching Programs", [
|
|
103
103
|
{ label: "Name", path: "name" },
|
|
@@ -123,7 +123,7 @@ export const serviceListPresentation = list("data", "Service", "Services", "No m
|
|
|
123
123
|
{ label: "Program", path: "program" },
|
|
124
124
|
{ label: "Endpoint", path: "endpoint" }
|
|
125
125
|
]);
|
|
126
|
-
export const windowPresentation = fields(["Process", "process"], ["Title", "title"], ["Header", "header"], ["
|
|
126
|
+
export const windowPresentation = fields(["Process", "process"], ["Title", "title"], ["Header", "header"], ["Surface", "surface"], ["Transaction", "transaction"], ["Position", "position"], ["Size", "size"], ["Minimized", "minimized"], ["Maximized", "maximized"], ["Front", "front"], ["Layer", "layer"]);
|
|
127
127
|
export const windowPositionPresentation = fields(["Process", "process"], ["Position", "position"]);
|
|
128
128
|
export const windowSizePresentation = fields(["Process", "process"], ["Size", "size"]);
|
|
129
129
|
export const windowGeometryPresentation = fields(["Process", "process"], ["Position", "position"], ["Size", "size"]);
|
|
@@ -131,7 +131,7 @@ export const windowMinimizePresentation = fields(["Process", "process"], ["Minim
|
|
|
131
131
|
export const windowMaximizePresentation = fields(["Process", "process"], ["Maximized", "maximized"]);
|
|
132
132
|
export const windowTitlePresentation = fields(["Process", "process"], ["Title", "title"]);
|
|
133
133
|
export const windowHeaderPresentation = fields(["Process", "process"], ["Header", "header"]);
|
|
134
|
-
export const
|
|
134
|
+
export const windowSurfacePresentation = fields(["Process", "process"], ["Surface", "surface"]);
|
|
135
135
|
export const windowTransactionPresentation = fields(["Process", "process"], ["Transaction", "transaction"]);
|
|
136
136
|
export const windowRaisePresentation = fields(["Process", "process"], ["Front", "front"]);
|
|
137
137
|
export const eventPresentation = fields(["Scope", "scope"], ["Event", "event"], ["Payload", "payload"]);
|
package/dist/commands/window.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { parseExecuteRequest,
|
|
1
|
+
import { parseExecuteRequest, parseWindowSurface, parseWindowTransaction } 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, windowSurfacePresentation, windowHeaderPresentation, windowMinimizePresentation, windowMaximizePresentation, windowOutput, windowPositionPresentation, windowTransactionPresentation, 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";
|
|
@@ -57,14 +57,14 @@ export default function windowCommands(root, connect) {
|
|
|
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
59
|
defineCommand(windows, {
|
|
60
|
-
...state("
|
|
61
|
-
aliases: ["set-
|
|
62
|
-
options: withJson(...processOptions, option("--default", "use the default Window
|
|
60
|
+
...state("setSurface", windowSurfacePresentation),
|
|
61
|
+
aliases: ["set-surface"],
|
|
62
|
+
options: withJson(...processOptions, option("--default", "use the default Window surface"), option("--absent", "remove the Window surface"), option("--radius <radius>", "surface radius in pixels or full"), option("--color <color>", "Appearance color role or CSS color"), option("--without-material", "render the surface without Material"), option("--grain <value>", "surface Material grain", { parse: input => numeric(input, "--grain") }), option("--grain-amount <value>", "surface Material grain intensity", { parse: input => numeric(input, "--grain-amount") }), option("--backdrop <value>", "surface Material backdrop blur", { parse: input => numeric(input, "--backdrop") }), option("--opacity <value>", "surface Material opacity", { parse: input => numeric(input, "--opacity") }), option("--distortion <value>", "surface Material distortion", { parse: input => numeric(input, "--distortion") }), option("--saturation <value>", "surface Material saturation", { parse: input => numeric(input, "--saturation") })),
|
|
63
63
|
examples: [
|
|
64
|
-
"phresh window set-
|
|
65
|
-
"phresh window set-
|
|
64
|
+
"phresh window set-surface --process overlay --absent",
|
|
65
|
+
"phresh window set-surface --process overlay --radius full --color primary"
|
|
66
66
|
]
|
|
67
|
-
}, async ({ options }) => executeWindow(connect, options, { $operation: "
|
|
67
|
+
}, async ({ options }) => executeWindow(connect, options, { $operation: "setSurface", surface: surface(options) }));
|
|
68
68
|
defineCommand(windows, {
|
|
69
69
|
...state("setTransaction", windowTransactionPresentation),
|
|
70
70
|
aliases: ["set-transaction"],
|
|
@@ -87,7 +87,7 @@ export default function windowCommands(root, connect) {
|
|
|
87
87
|
requiresSystem: true,
|
|
88
88
|
options: withJson(...processOptions, option("--event <event>", "Window event", {
|
|
89
89
|
mandatory: true,
|
|
90
|
-
choices: ["move", "resize", "minimize", "maximize", "changeTitle", "changeHeader", "
|
|
90
|
+
choices: ["move", "resize", "minimize", "maximize", "changeTitle", "changeHeader", "changeSurface", "changeTransaction", "front"]
|
|
91
91
|
}), timeoutOption),
|
|
92
92
|
output: dataOutput(eventOutput("The observed Window event"), "One Window event", eventPresentation),
|
|
93
93
|
examples: ["phresh window wait --process main --program terminal --event move --json"]
|
|
@@ -115,17 +115,17 @@ async function executeWindow(connect, options, operation) {
|
|
|
115
115
|
});
|
|
116
116
|
return connected(connect, system => system.execute(request));
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function surface(options) {
|
|
119
119
|
const materialValues = material(options);
|
|
120
120
|
const customized = options.radius !== undefined || options.color !== undefined || materialValues !== undefined;
|
|
121
121
|
const modes = Number(options.default === true) + Number(options.absent === true) + Number(customized);
|
|
122
122
|
if (modes !== 1)
|
|
123
|
-
throw new Error("Choose exactly one of --default, --absent, or
|
|
123
|
+
throw new Error("Choose exactly one of --default, --absent, or surface customization options");
|
|
124
124
|
if (options.default)
|
|
125
125
|
return true;
|
|
126
126
|
if (options.absent)
|
|
127
127
|
return false;
|
|
128
|
-
return
|
|
128
|
+
return parseWindowSurface({
|
|
129
129
|
...(options.radius === undefined ? {} : { radius: options.radius === "full" ? "full" : numeric(options.radius, "--radius") }),
|
|
130
130
|
...(options.color === undefined ? {} : { color: options.color }),
|
|
131
131
|
...(materialValues === undefined ? {} : { material: materialValues })
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
|
|
4
|
+
"version": "0.1.69",
|
|
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.58",
|
|
51
|
+
"@phreshos/node": "^0.1.31",
|
|
52
52
|
"adm-zip": "^0.6.0",
|
|
53
53
|
"commander": "^15.0.0",
|
|
54
54
|
"picocolors": "^1.1.1"
|