feat(code): 新增通用 code 零件(sandbox inline JS)—— Arcrun#10 設計+PoC
n8n Code node 式逃生口:config 帶 inline JS、stdin 帶 input JSON、
stdout 回 {success,data}|{success:false,error,error_type}。
沙箱=QuickJS-wasm:user JS 跑在 QuickJS context,global 只有純 ECMAScript
內建 + 唯一 curated builtin sha256(純函式);碰不到網路/檔案/env/secret/
Worker 物件圖。資源上限:timeout(interrupt)/memory/stack/output/code size。
本輪=設計+PoC,未部署 leo21c。sandbox.mjs + test/ 為 Node/vitest 可跑實作
(12 測試全綠,含 card→envelope 與原模組 planCard 逐欄全等)。index.ts 為
Worker host 骨架、DESIGN.md 記錄機制/安全性質/生產路徑/設計岔路(A/B)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJiLCRUU2o3aSpPEzVCt2o
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "arcrun-component-code",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "arcrun code 零件 —— sandbox inline JS(QuickJS-wasm)",
|
||||
"scripts": {
|
||||
"test": "vitest run --config vitest.config.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"quickjs-emscripten": "^0.31.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "^3.1.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user