@plurnk/plurnk-execs-common 3.0.2 → 3.0.3
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 +6 -6
- package/docs/js.md +5 -8
- package/docs/python3.md +5 -11
- package/docs/sh.md +13 -30
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -30,12 +30,12 @@ file in the `(target)` slot is instead the script each interpreter reads
|
|
|
30
30
|
directly, and the body is tokenized by shell quoting (`tokenizeArgv`) into the
|
|
31
31
|
script's arguments ({§executor-subprocess}, {§executor-contract}).
|
|
32
32
|
|
|
33
|
-
```
|
|
34
|
-
--release "two words"
|
|
33
|
+
```ts
|
|
34
|
+
await plurnk.sh({ script: "./deploy.sh", args: '--release "two words"' });
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
```
|
|
38
|
-
--format json
|
|
37
|
+
```ts
|
|
38
|
+
await plurnk.python3({ script: "transform.py", args: "--format json" });
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
All declared tags run host code, so every invocation is proposal-gated ({§executor-results}). Inline programs have no
|
|
@@ -63,8 +63,8 @@ without adding any PLURNK-specific knob or altering default behavior.
|
|
|
63
63
|
|
|
64
64
|
**Scope choices** ({§execution-output-identity}):
|
|
65
65
|
|
|
66
|
-
- **Workspace scope** (`
|
|
67
|
-
- **Session scope** (`
|
|
66
|
+
- **Workspace scope** (`plurnk.env` with `scope: "workspace"`): `NODE_OPTIONS` reaches both `js` execution children and Node-based MCP server subprocesses in the workspace.
|
|
67
|
+
- **Session scope** (`plurnk.env` with `scope: "session"`): `NODE_OPTIONS` reaches `js` execution children of that session only.
|
|
68
68
|
|
|
69
69
|
**Honest ledger:** Node's permission model provides same-UID accident containment, not adversarial security boundaries. PLURNK owns authority, consent, and audit, and never claims containment; for OS-account separation, combine with `PLURNK_EXECS_SPAWN_USER` ({§executor-policy}) or an external container/VM sandbox.
|
|
70
70
|
|
package/docs/js.md
CHANGED
|
@@ -3,16 +3,13 @@
|
|
|
3
3
|
A JavaScript snippet, run via `node -e`. Node is the daemon's own runtime, so it
|
|
4
4
|
is always available (no PATH probe).
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
const os = require("node:os");
|
|
8
|
-
console.log(JSON.stringify({ platform: os.platform(), cpus: os.cpus().length }));
|
|
9
|
-
```
|
|
6
|
+
await plurnk.js({ code: "const os = require(\"node:os\");\nconsole.log(JSON.stringify({ platform: os.platform(), cpus: os.cpus().length }));" }); // the code is the snippet
|
|
10
7
|
|
|
11
|
-
`js
|
|
12
|
-
|
|
8
|
+
`await plurnk.js({ script: "tool.js", args: ["--flag"] });` runs that JavaScript file and passes `args` as its arguments,
|
|
9
|
+
also for `session://` and `skill://` targets.
|
|
13
10
|
Relative imports resolve from the script; ordinary relative filesystem paths
|
|
14
11
|
resolve from the working directory. Environment, working directory, channels,
|
|
15
|
-
output on completion, exit status
|
|
16
|
-
as `plurnk
|
|
12
|
+
output on completion, and exit status are every subprocess executor's,
|
|
13
|
+
as `mcp:///plurnk/sh.json` states. Stdout is text, so structured output is serialized
|
|
17
14
|
(`console.log(JSON.stringify(value))`); a thrown error exits nonzero with its
|
|
18
15
|
stack on stderr.
|
package/docs/python3.md
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
# python3
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
quoting), as for every interpreter (`plurnk:///sh.md`).
|
|
3
|
+
The `code` is Python code, run with `python3 -c`. Setting `cwd` selects the
|
|
4
|
+
working directory for that inline code. A `script` instead runs that file and
|
|
5
|
+
passes `args` as its arguments, as for every interpreter (`mcp:///plurnk/sh.json`).
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
import json, sys
|
|
10
|
-
print(json.dumps({"python": list(sys.version_info[:2])}))
|
|
11
|
-
```
|
|
7
|
+
await plurnk.python3({ code: "import json, sys\nprint(json.dumps({\"python\": list(sys.version_info[:2])}))" }); // the code is the program
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
--help
|
|
15
|
-
```
|
|
9
|
+
await plurnk.python3({ script: "tools/report.py", args: ["--help"] });
|
|
16
10
|
|
|
17
11
|
Native skill files retain their sibling imports and source-relative assets.
|
package/docs/sh.md
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# sh
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
environment's `$SHELL`, or `/bin/sh` when that names no executable file. The
|
|
3
|
+
`plurnk.sh` runs the `command` with `-c` in the shell its summary names: the
|
|
4
|
+
environment's `$SHELL`, or `/bin/sh` when that names no executable file. The command
|
|
5
5
|
reaches it character-perfect, whitespace included; write for that shell.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
printf 'hello\n' > hello.txt
|
|
9
|
-
wc -l hello.txt
|
|
10
|
-
```
|
|
7
|
+
await plurnk.sh({ command: "printf 'hello\\n' > hello.txt\nwc -l hello.txt" }); // the command is the script itself
|
|
11
8
|
|
|
12
|
-
A script
|
|
13
|
-
|
|
9
|
+
A `script` runs that script: `await plurnk.sh({ script: "greet.sh" });` runs it with no arguments;
|
|
10
|
+
`args` (an array of argument strings or a shell-quoted string) is passed as its arguments
|
|
14
11
|
(plain words split on whitespace, quoted arguments stay whole, nothing is
|
|
15
12
|
expanded). The interpreter reads the script directly, so it needs no executable
|
|
16
|
-
bit; a script path authored inside a shell
|
|
13
|
+
bit; a script path authored inside a shell `command` still follows the kernel's
|
|
17
14
|
ordinary executable-bit rules. The same applies to local, `session://`, and
|
|
18
15
|
`skill://` script targets across every interpreter.
|
|
19
16
|
|
|
@@ -22,13 +19,13 @@ ordinary executable-bit rules. The same applies to local, `session://`, and
|
|
|
22
19
|
The command receives a scoped environment: provider keys and every `PLURNK_*`
|
|
23
20
|
setting are stripped before the child starts, so `printenv` cannot read
|
|
24
21
|
plurnk's credentials, and the project's environment passes through, overlaid
|
|
25
|
-
with the `env` registry (`mcp:///
|
|
22
|
+
with the `env` registry (`mcp:///plurnk/env.json`).
|
|
26
23
|
|
|
27
24
|
## Working directory
|
|
28
25
|
|
|
29
26
|
The working directory is the workspace project root, or in a workspace without
|
|
30
|
-
one the directory the shell would run in anyway.
|
|
31
|
-
|
|
27
|
+
one the directory the shell would run in anyway. Setting `cwd` overrides it for
|
|
28
|
+
an inline command (`await plurnk.sh({ command: "npm test", cwd: "packages/api" });`); a receipt names the
|
|
32
29
|
directory, relative to the project root, only when the command ran elsewhere.
|
|
33
30
|
|
|
34
31
|
## Channels
|
|
@@ -37,13 +34,12 @@ An execution is a host effect, subject to approval. Output streams
|
|
|
37
34
|
under the receipt's `stream` address, such as `sh:///ab3d5678`: `#stdout` is
|
|
38
35
|
the default channel and `#stderr` the second; both are `text/stream`. While it
|
|
39
36
|
runs, the packet's `## Open Work` streams list reports each channel's size and
|
|
40
|
-
growth, and
|
|
41
|
-
`_plurnk`
|
|
37
|
+
growth, and `plurnk.read` can inspect any range. On completion, the harness adds one
|
|
38
|
+
`_plurnk` `read` per channel: the whole output when it fits the context budget,
|
|
42
39
|
otherwise a bodiless receipt naming its size, with the `range` extent and the
|
|
43
|
-
terminal exit status.
|
|
40
|
+
terminal exit status. Read a range of the observation's `path` for any part:
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
```
|
|
42
|
+
await plurnk.read({ path: "sh:///ab3d5678#stdout", range: "17,40" });
|
|
47
43
|
|
|
48
44
|
The observation carries the `exitCode`; a nonzero one is the command's answer,
|
|
49
45
|
not a failure. Stdout and stderr are separate channels,
|
|
@@ -51,16 +47,3 @@ and a diagnostic may be on either. The `log:///…/sh` receipt's own body is the
|
|
|
51
47
|
program exactly as sent, never output. A receipt with a non-200 status and no
|
|
52
48
|
`stream` address ran nothing; its body is still the program, and its Problem
|
|
53
49
|
says why it was refused.
|
|
54
|
-
|
|
55
|
-
## Lifetime
|
|
56
|
-
|
|
57
|
-
The heading's `lifetime` metadata bounds the command's total runtime, not idle
|
|
58
|
-
time. This command is stopped after 30 seconds if it has not finished:
|
|
59
|
-
|
|
60
|
-
```sh [{"lifetime": "30s"}]
|
|
61
|
-
npm test
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Expiry closes the stream with status 504. By contrast, `WAIT [30]` limits one
|
|
65
|
-
wait to 30 seconds without stopping the command. Without `lifetime`,
|
|
66
|
-
the command is loop-bound; see `mcp:///plurnk_env.md` for other `lifetime` values (`detached`, `turn`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-execs-common",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Subprocess executor for plurnk-service's exec scheme — exposing the shell, Node.js, and Python 3.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"@plurnk/plurnk-contracts": "^7.0.0",
|
|
66
66
|
"@plurnk/plurnk-execs": "^4.0.0"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "9d234b81e14a1d3fe88b9be3f7c643a0eb929533"
|
|
69
69
|
}
|