@phreshos/cli 0.1.70 → 0.1.71
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/commands/access.js +2 -0
- package/dist/commands/execution.js +1 -1
- package/dist/commands/program.js +0 -16
- package/dist/commands/system.js +32 -0
- package/dist/template/package.json +6 -6
- package/dist/template/phresh.config.ts +1 -1
- package/dist/template/vite.client.ts +3 -1
- package/dist/template/vitest.config.ts +1 -0
- package/dist/template.json +2 -2
- package/package.json +3 -3
package/dist/commands/access.js
CHANGED
|
@@ -6,6 +6,7 @@ import windowCommands from "./window.js";
|
|
|
6
6
|
import executeCommand from "./execute.js";
|
|
7
7
|
import operationCommands from "./operation.js";
|
|
8
8
|
import serviceCommands from "./service.js";
|
|
9
|
+
import systemCommands from "./system.js";
|
|
9
10
|
/** Expose the shared System domains through explicit Node SDK executors. */
|
|
10
11
|
export default function accessCommands(program, connect = connectSystem) {
|
|
11
12
|
executeCommand(program, connect);
|
|
@@ -14,5 +15,6 @@ export default function accessCommands(program, connect = connectSystem) {
|
|
|
14
15
|
processCommands(program, connect);
|
|
15
16
|
endpointCommands(program, connect);
|
|
16
17
|
serviceCommands(program, connect);
|
|
18
|
+
systemCommands(program, connect);
|
|
17
19
|
windowCommands(program, connect);
|
|
18
20
|
}
|
|
@@ -3,6 +3,7 @@ import { describeExecuteOperation } from "@phreshos/core";
|
|
|
3
3
|
export const executeCommandPaths = Object.freeze({
|
|
4
4
|
"operation.list": ["operation", "list"],
|
|
5
5
|
"operation.describe": ["operation", "describe"],
|
|
6
|
+
"system.logs": ["system", "logs"],
|
|
6
7
|
"program.list": ["program", "list"],
|
|
7
8
|
"program.find": ["program", "inspect"],
|
|
8
9
|
"program.agent": ["program", "agent"],
|
|
@@ -18,7 +19,6 @@ export const executeCommandPaths = Object.freeze({
|
|
|
18
19
|
"program.allowsPermission": ["program", "allowsPermission"],
|
|
19
20
|
"program.allowPermission": ["program", "allowPermission"],
|
|
20
21
|
"program.denyPermission": ["program", "denyPermission"],
|
|
21
|
-
"program.requestPermission": ["program", "requestPermission"],
|
|
22
22
|
"program.logs": ["program", "logs"],
|
|
23
23
|
"program.wait": ["program", "wait"],
|
|
24
24
|
"process.list": ["process", "list"],
|
package/dist/commands/program.js
CHANGED
|
@@ -196,22 +196,6 @@ export default function programCommands(root, connect) {
|
|
|
196
196
|
identity: options.program,
|
|
197
197
|
permission: parsePermissionName(options.permission)
|
|
198
198
|
})));
|
|
199
|
-
defineCommand(programs, {
|
|
200
|
-
name: "requestPermission",
|
|
201
|
-
aliases: ["request-permission"],
|
|
202
|
-
description: executeDescription("program", "requestPermission"),
|
|
203
|
-
requiresSystem: true,
|
|
204
|
-
options: withJson(option("--program <identity>", "Program identity", { mandatory: true }), option("--permission <name>", "permission name", { mandatory: true }), option("--value <json>", "complete requested permission value encoded as JSON"), timeoutOption),
|
|
205
|
-
output: dataOutput(value.any("permission decision"), "The permission decision", { format: "value" }),
|
|
206
|
-
examples: ["phresh program request-permission --program terminal --permission uploads"]
|
|
207
|
-
}, ({ options }) => connected(connect, system => system.execute({
|
|
208
|
-
$domain: "program",
|
|
209
|
-
$operation: "requestPermission",
|
|
210
|
-
identity: options.program,
|
|
211
|
-
permission: parsePermissionName(options.permission),
|
|
212
|
-
...(options.value === undefined ? {} : { value: permissionRequest(options.value) }),
|
|
213
|
-
...(options.timeout === undefined ? {} : { timeout: bounded(options.timeout, "--timeout", 0) })
|
|
214
|
-
})));
|
|
215
199
|
defineCommand(programs, {
|
|
216
200
|
name: "logs",
|
|
217
201
|
description: executeDescription("program", "logs"),
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineCommand } from "../contract/command.js";
|
|
2
|
+
import { value } from "../contract/schema.js";
|
|
3
|
+
import { connected } from "./connection.js";
|
|
4
|
+
import { executeDescription } from "./execution.js";
|
|
5
|
+
import { json } from "./input.js";
|
|
6
|
+
import { option, withJson } from "./options.js";
|
|
7
|
+
import { dataOutput } from "./schemas.js";
|
|
8
|
+
/** Add running-System capabilities to the System lifecycle command family. */
|
|
9
|
+
export default function systemAccessCommands(root, connect) {
|
|
10
|
+
const system = root.commands.find(command => command.name() === "system") ?? defineCommand(root, {
|
|
11
|
+
name: "system",
|
|
12
|
+
description: "access the running PhreshOS System"
|
|
13
|
+
});
|
|
14
|
+
defineCommand(system, {
|
|
15
|
+
name: "logs",
|
|
16
|
+
description: executeDescription("system", "logs"),
|
|
17
|
+
requiresSystem: true,
|
|
18
|
+
options: withJson(option("--statement <sql>", "read-only SQL statement", { mandatory: true }), option("--values <json>", "bound statement values encoded as a JSON array")),
|
|
19
|
+
output: dataOutput(value.array(value.any("log query row"), "log query rows"), "System log query result", { format: "value" }),
|
|
20
|
+
examples: ["phresh system logs --statement 'select createdAt, level, source, kind, content, data from logs order by createdAt desc limit 100' --json"]
|
|
21
|
+
}, ({ options }) => connected(connect, system => {
|
|
22
|
+
const parsed = options.values === undefined ? undefined : json(options.values, "--values");
|
|
23
|
+
if (parsed !== undefined && !Array.isArray(parsed))
|
|
24
|
+
throw new Error("--values must be a JSON array");
|
|
25
|
+
return system.execute({
|
|
26
|
+
$domain: "system",
|
|
27
|
+
$operation: "logs",
|
|
28
|
+
statement: options.statement,
|
|
29
|
+
...(parsed === undefined ? {} : { values: parsed })
|
|
30
|
+
});
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phresh",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.44",
|
|
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.50",
|
|
18
|
+
"@phreshos/core": "^0.1.59",
|
|
19
|
+
"@phreshos/react": "^0.1.31",
|
|
20
|
+
"@phreshos/server": "^0.1.55",
|
|
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.71",
|
|
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.44",
|
|
8
8
|
icon: "icon.png",
|
|
9
9
|
categories: ["Development"],
|
|
10
10
|
keywords: ["example", "counter", "client", "server"],
|
|
@@ -7,7 +7,9 @@ export default defineConfig({
|
|
|
7
7
|
plugins: [react()],
|
|
8
8
|
base: process.env.PHRESHOS_CLIENT_BASE ?? "./",
|
|
9
9
|
resolve: {
|
|
10
|
-
tsconfigPaths: true
|
|
10
|
+
tsconfigPaths: true,
|
|
11
|
+
// Linked SDKs must consume the Program's renderer instance.
|
|
12
|
+
dedupe: ["react", "react-dom"]
|
|
11
13
|
},
|
|
12
14
|
server: {
|
|
13
15
|
port: Number(process.env.PHRESHOS_CLIENT_PORT ?? "5200"),
|
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.44",
|
|
4
|
+
"sha256": "5d218afff54104c06bb8e279247f875ccbc68b7ce789b4207da8af3428946c39",
|
|
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.71",
|
|
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.60",
|
|
51
|
+
"@phreshos/node": "^0.1.33",
|
|
52
52
|
"adm-zip": "^0.6.0",
|
|
53
53
|
"commander": "^15.0.0",
|
|
54
54
|
"picocolors": "^1.1.1"
|