@plurnk/plurnk-execs-common 0.2.3 → 0.2.4
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/docs/node.md +15 -0
- package/docs/sh.md +15 -0
- package/package.json +7 -4
package/docs/node.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# node
|
|
2
|
+
|
|
3
|
+
A JavaScript snippet, run via `node -e`. Node is the daemon's own runtime, so it's always available (no PATH probe).
|
|
4
|
+
|
|
5
|
+
## Environment
|
|
6
|
+
|
|
7
|
+
The same scoped environment as `sh`: the daemon's own secrets (`PLURNK_*`, provider keys) are stripped, so `process.env` inside the snippet sees the project's environment, not plurnk's.
|
|
8
|
+
|
|
9
|
+
## Output
|
|
10
|
+
|
|
11
|
+
Whatever the snippet writes to stdout streams to the `stdout` channel (stderr → `stderr`); both are text. To return structured data, `console.log(JSON.stringify(x))` and `READ` it back. A thrown error exits non-zero (status 500) with the stack on `stderr`.
|
|
12
|
+
|
|
13
|
+
## Working directory
|
|
14
|
+
|
|
15
|
+
Runs in the session project root by default; `EXEC[node](./dir):…` sets cwd, and relative `import` / `require` / `fs` paths resolve against it.
|
package/docs/sh.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# sh
|
|
2
|
+
|
|
3
|
+
A shell command line, run via `sh -c`. Bare `EXEC` (no runtime tag) defaults to `sh`, so `<<EXEC:ls -la:EXEC` and `<<EXEC[sh]:ls -la:EXEC` are equivalent.
|
|
4
|
+
|
|
5
|
+
## Environment
|
|
6
|
+
|
|
7
|
+
The command runs with a **scoped** environment: the host daemon's own secrets — provider API keys and every `PLURNK_*` config var — are stripped before the child sees them, so `printenv` / `env` cannot read plurnk's credentials. The project's own environment passes through unchanged.
|
|
8
|
+
|
|
9
|
+
## Working directory
|
|
10
|
+
|
|
11
|
+
`EXEC[sh](./dir):…` runs in `./dir`. With no target the command runs in the session's project root — the same place the `file` scheme writes — so it finds files a prior `EDIT` just created, rather than the daemon's cwd.
|
|
12
|
+
|
|
13
|
+
## Channels
|
|
14
|
+
|
|
15
|
+
Output streams into two channels on the `exec://` entry: `#stdout` (default) and `#stderr` (both `text/stream`); `READ` the entry to see them. A host-effecting command proposes for review before it runs; a read-only one runs inline and returns its output the same turn. A non-zero exit closes the entry with status 500, the message on `stderr`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-execs-common",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Universal subprocess executor for plurnk-service's exec scheme — one package exposing the shell + node + python floor plus whichever host interpreters (perl, ruby, php, lua, awk, bc, …) are present.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"runtimes": [
|
|
36
36
|
{
|
|
37
37
|
"name": "sh",
|
|
38
|
-
"glyph": "🐚"
|
|
38
|
+
"glyph": "🐚",
|
|
39
|
+
"example": "EXEC:chmod +x ./example.sh && ./example.sh:EXEC"
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
"name": "bash",
|
|
@@ -43,7 +44,8 @@
|
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
"name": "node",
|
|
46
|
-
"glyph": "⬢"
|
|
47
|
+
"glyph": "⬢",
|
|
48
|
+
"example": "EXEC[node]:console.log(new Date(Date.now() + 14 * 86_400_000).toISOString().slice(0, 10)):EXEC"
|
|
47
49
|
},
|
|
48
50
|
{
|
|
49
51
|
"name": "python",
|
|
@@ -107,7 +109,8 @@
|
|
|
107
109
|
"files": [
|
|
108
110
|
"dist/**/*",
|
|
109
111
|
"README.md",
|
|
110
|
-
".env.example"
|
|
112
|
+
".env.example",
|
|
113
|
+
"docs/**/*"
|
|
111
114
|
],
|
|
112
115
|
"scripts": {
|
|
113
116
|
"test:lint": "tsc --noEmit",
|