feat(process): add explicitly granted process API

This commit is contained in:
Marqdo Agent committed 2026-11-21 08:46:02 +08:00
1 parent 9922bfae98
commit 3ef18fb496
17 files changed
+433 -15

No files matched your search

+1
View File
@@ -16,6 +16,7 @@ module; a mismatch is a hard error.
- `data/csv.mq.md` — quoted single-row CSV parser and formatter
- `data/table.mq.md` — value-returning table select/filter/sort/append/set/join/group/GFM
- `env.mq.md` — explicitly granted `env.get` names over `resource.request`
- `process.mq.md` — explicitly granted `process.run` with timeout/output caps
- `datetime.mq.md` — UTC ISO-8601 format/parse over Unix milliseconds (pure)
- `clock.mq.md` — project-mode `clock.now` over `resource.request`
- `path.mq.md` — lexical join/basename/dirname/extension/normalize (no I/O)
+10
View File
@@ -0,0 +1,10 @@
## 运行
`(程序, 参数列表)`
在项目模式下运行一个显式授权的可执行文件。程序路径必须与
`--allow-process PROGRAM` 精确匹配;不经过 shell,清空环境变量,
工作目录是项目根,stdin 为空。5 秒超时、1 MiB stdout/stderr 上限,
结果形状为 `{status, stdout, stderr}`。
*resource.request("process.run", [程序, 参数列表])*
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "marqdo-stdlib",
"version": "0.1.0",
"digest": "sha256:9ec0ba1a50db6bd8423ce3485ad5433fb3b8140032f61c6b4a6dd9bc97416f47"
"digest": "sha256:c7208520e3eef1fdc98327055092f9d52081851f652dd970d4f602e30e58e75f"
}
+10
View File
@@ -0,0 +1,10 @@
---
import:
process: "std:process"
---
## main
**结果 = process.运行("/bin/echo", ["hello"])**
*[结果.ok, 结果.value.status, 结果.value.stdout, 结果.value.stderr]*