@phreshos/node 0.1.8 → 0.1.9
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/README.md +48 -40
- package/dist/traffic.d.ts +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,66 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@phreshos/node`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Node.js access to a running PhreshOS System and local Program projects.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
The Node SDK exposes the same System model used inside Server Endpoints and adds
|
|
6
|
+
only connection lifecycle and project tooling.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const system = await System.connect()
|
|
8
|
+
## Installation
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
| Package manager | Command |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| npm | `npm install @phreshos/node` |
|
|
13
|
+
| pnpm | `pnpm add @phreshos/node` |
|
|
14
|
+
| Bun | `bun add @phreshos/node` |
|
|
15
|
+
| Yarn | `yarn add @phreshos/node` |
|
|
16
|
+
|
|
17
|
+
## System
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
```ts
|
|
20
|
+
import { System } from "@phreshos/node"
|
|
21
|
+
|
|
22
|
+
const system = await System.connect()
|
|
16
23
|
const programs = await system.program.list()
|
|
17
24
|
|
|
18
25
|
await system.disconnect()
|
|
19
26
|
```
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
The transport is not public API. Code receives the same System, Program,
|
|
29
|
+
Process, Endpoint, Service, Window, storage, and upload handles used by the
|
|
30
|
+
Server SDK. `disconnect()` exists because external Node code owns the
|
|
31
|
+
connection.
|
|
24
32
|
|
|
25
|
-
Project
|
|
33
|
+
## Project
|
|
26
34
|
|
|
27
35
|
```ts
|
|
28
|
-
|
|
36
|
+
import { Project, System } from "@phreshos/node"
|
|
37
|
+
|
|
38
|
+
const project = await Project.open()
|
|
29
39
|
const system = await System.connect()
|
|
30
40
|
|
|
31
|
-
await project.pack()
|
|
32
41
|
for await (const event of await project.start(system, { signal })) {
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
for await (const event of await project.dev(system, { signal })) {
|
|
37
|
-
// started, output, exited
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
for await (const chunk of await project.install(system)) {
|
|
41
|
-
// stdout or stderr
|
|
42
|
+
console.log(event)
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
await system.disconnect()
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
`Project` owns authoring concerns: builds, development and production
|
|
49
|
+
definitions, installation, execution shortcuts, and packaging. The System
|
|
50
|
+
receives only the resulting Program definition.
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
`Project.open()` starts from the current working directory by default.
|
|
53
|
+
`System.connect()` resolves an explicit System home, then `PHRESHOS_HOME`,
|
|
54
|
+
then the current owner's default System home.
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
const definition = project.productionDefinition()
|
|
55
|
-
// const definition = project.developmentDefinition()
|
|
56
|
+
## Development
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
```sh
|
|
59
|
+
bun install --frozen-lockfile
|
|
60
|
+
bun run verify
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
See the [Node SDK documentation](https://github.com/PhreshOS/docs/blob/main/content/docs/sdks/node.mdx)
|
|
64
|
+
for the public model.
|
|
65
|
+
|
|
66
|
+
## Repository boundary
|
|
67
|
+
|
|
68
|
+
This repository owns the external Node connection and local-project API. Core
|
|
69
|
+
owns the domain model, Server owns the Endpoint runtime adapter, and CLI owns
|
|
70
|
+
terminal presentation and native service management.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
Licensed under the [MIT License](LICENSE). Copyright © 2026 Zohayr SLILEH.
|
package/dist/traffic.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class EndpointTrafficHandle<Definitions extends object = {}> exte
|
|
|
15
15
|
event: string;
|
|
16
16
|
questionId: string;
|
|
17
17
|
message: Readonly<{
|
|
18
|
-
to: import("@phreshos/core").Server<{}
|
|
18
|
+
to: import("@phreshos/core").Server<{}> | null;
|
|
19
19
|
payload: Payload;
|
|
20
20
|
}>;
|
|
21
21
|
}>>;
|
|
@@ -28,7 +28,7 @@ export declare class ServerTrafficHandle<Definitions extends object = {}> extend
|
|
|
28
28
|
event: string;
|
|
29
29
|
questionId: string;
|
|
30
30
|
message: Readonly<{
|
|
31
|
-
to: Endpoint<{}
|
|
31
|
+
to: Endpoint<{}> | null;
|
|
32
32
|
outcome: import("@phreshos/core").Outcome<Result>;
|
|
33
33
|
}>;
|
|
34
34
|
}>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phreshos/node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Node.js access to PhreshOS and Program projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"prepack": "node --run build"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@phreshos/core": "^0.1.
|
|
39
|
+
"@phreshos/core": "^0.1.31",
|
|
40
40
|
"adm-zip": "^0.6.0",
|
|
41
41
|
"jiti": "^2.7.0"
|
|
42
42
|
},
|