@melra/terminal-runtime 0.3.0-alpha.4 → 0.3.0-alpha.5
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 +46 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @melra/terminal-runtime
|
|
2
|
+
|
|
3
|
+
Bounded process execution for [MELRA](https://github.com/XAGI-Lab/melra):
|
|
4
|
+
one-shot `run`, plus `start`/`status`/`output`/`stop` for longer-lived processes.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install @melra/terminal-runtime
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { TerminalOperationSchema } from "@melra/protocol";
|
|
12
|
+
import { TerminalRuntime } from "@melra/terminal-runtime";
|
|
13
|
+
|
|
14
|
+
const terminal = await TerminalRuntime.create({ root: workspaceRoot });
|
|
15
|
+
const result = await terminal.execute(
|
|
16
|
+
TerminalOperationSchema.parse({
|
|
17
|
+
kind: "terminal",
|
|
18
|
+
action: "run",
|
|
19
|
+
command: "git",
|
|
20
|
+
args: ["status", "--porcelain"],
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Commands are spawned without a shell. Arguments are passed as an array, never
|
|
26
|
+
interpolated into a command line, so a value containing `;` or `$(...)` is an
|
|
27
|
+
argument rather than a second command. The working directory stays inside
|
|
28
|
+
`root`, and only environment variables you name in `allowedEnvironment` are
|
|
29
|
+
passed through.
|
|
30
|
+
|
|
31
|
+
Output is captured up to the operation's `maxOutputChars` and flagged
|
|
32
|
+
`truncated` past it, and every process runs under an `AbortSignal` so a duration
|
|
33
|
+
budget actually stops work rather than just reporting a timeout.
|
|
34
|
+
|
|
35
|
+
`redactTerminalOutput` strips credential-shaped values from captured output
|
|
36
|
+
before it is persisted — tokens, `Authorization` headers, and connection strings
|
|
37
|
+
show up in stdout more often than anyone expects.
|
|
38
|
+
|
|
39
|
+
Allowlisting decides which commands may run at all, and that lives in
|
|
40
|
+
[`@melra/policy-core`](https://www.npmjs.com/package/@melra/policy-core), not
|
|
41
|
+
here.
|
|
42
|
+
|
|
43
|
+
Requires Node.js 22 or newer. Full documentation:
|
|
44
|
+
[github.com/XAGI-Lab/melra](https://github.com/XAGI-Lab/melra)
|
|
45
|
+
|
|
46
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melra/terminal-runtime",
|
|
3
|
-
"version": "0.3.0-alpha.
|
|
3
|
+
"version": "0.3.0-alpha.5",
|
|
4
4
|
"description": "Shell-free supervised terminal runtime for MELRA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@melra/protocol": "0.3.0-alpha.
|
|
24
|
+
"@melra/protocol": "0.3.0-alpha.5"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc -p tsconfig.json",
|