nodetool-js-scripting
БесплатноБез исполняемых скриптовНе проверенWrite JavaScript that runs in NodeTool's QuickJS sandbox: Code node bodies, saved JS script documents, sandbox package imports, and calling nodes from code.
от nodetool-ai★ 674 звезды на GitHubОб этом скилле
Write NodeTool sandbox JavaScript
Three places take the same guest JavaScript, with the same globals, the same imports and the same limits.
| Where | What it is | Reach it with |
|---|---|---|
| Code node | A body inside a workflow graph | validate_code, run_code, test_code |
| JS script document | A named, versioned script with declared ports, secrets, a timeout and saved tests | list_js_scripts, get_js_script, save_js_script, edit_js_script, validate_js_script, run_js_script, test_js_script |
| Native flow | Guest code calling nodes as async functions, no graph | import "@nodetool-ai/sandbox-nodetool/flow" |
Pick a Code node when the logic belongs to one graph. Pick a script document when the same logic is called from several places, needs its own tests, or needs version history. Pick native flow when the control flow is easier to write than to wire.
The body contract
// inputs: { rows: [...], threshold: 10 }
const kept = inputs.rows.filter((r) => r.score > inputs.threshold);
progress(50, `kept ${kept.length}`);
for (const row of kept) await emit("row", row); // streams as it goes
await output("count", kept.length); // final, posted at the end
- Inputs arrive on the
inputsobject, never as globals of their own name. Values are deep-copied through JSON before entering the guest. - Outputs leave through
await output(name, value)andawait emit(name, value), and nothing else.namemust be a declared output handle. A secondoutputon the same handle throws.returnis ordinary control flow and its value is ignored. For a script document this is enforced: a body that declares outputs and returns them instead of emitting them is an error, because a script has no legacy return contract. A Code node still accepts the old return/yield contract for one more release, with a deprecation warning. - Media inputs arrive as refs. Read one with
media.bytes/media.text/media.info, and build one withmedia.toDocument/toImage/toAudio/toVideo. Pass the whole input object, not itsuri, so the ref's own type travels with it. Everymedia.*call is async. streamis the input side ofemit. A body that mentionsstreamruns once over the whole stream and pulls its own items. A body that never mentions it runs once per incoming item. Nothing is configured: deleting the laststreamcall flips the node back.
for await (const item of stream(name)) // one handle, in order, until EOS
for await (const [handle, item] of stream.any()) // every handle, arrival order
const item = await stream.first(name) // next value, undefined at EOS
stream.open(name) // could more still arrive?
statesurvives across streaming invocations and resets at each run.progress(percent, message)drives the node's progress bar.
Capabilities are globals, libraries are imports
Globals need no declaration: console, fetch, workspace, getSecret,
nodetool.secrets.*, sleep, crypto, format, image, audio, video,
media, canvas, assetToSandbox / sandboxToAsset, progress, emit /
output, and the pure helpers toBase64 / fromBase64 / toHex / fromHex /
parallelMap. media.* and workspace.* need a ProcessingContext, so they
throw in a bare sandbox call with no run behind it.
Everything else is a sandbox package the body imports:
import yaml from "@nodetool-ai/sandbox-yaml";
Discover them with list_sandbox_packages and read one's API with
get_sandbox_package_docs. Do not guess a specifier: a pack this host does not
carry fails validation with "Install <pack>". nodetool packs compile builds one for a dependency that is not shipped.
image.*, audio.* and video.* transforms return a sandbox://media/<id>
handle, not bytes. Chain the calls, then <type>.toAsset(handle) before the run
ends. A handle does not survive into a later run.
Running an agent from code
Use run_agent when the work needs more than one model call: look something
up, act, read the result, correct.
import { run_agent } from "@nodetool-ai/sandbox-nodetool/agents";
const answer = await run_agent({
prompt: "Read storyboard " + inputs.storyboardId + " and list its shot titles.",
model: inputs.model, // {provider, id} from a model selector
tools: ["get_storyboard"], // capability wire names, nothing else
output_schema: { type: "object", properties: { titles: { type: "array", items: { type: "string" } } } }
});
await output("titles", answer.result.titles);
Without output_schema, answer.text is the agent's final message. The agent
reports its text and tool calls while it runs. A mini app shows them in an
Agent Activity widget bound to op:<id>/exec#transcript. generate_text stays
the right call for one prompt with no tools.
Call
Установить nodetool-js-scripting в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл nodetool-js-scripting?
Write JavaScript that runs in NodeTool's QuickJS sandbox: Code node bodies, saved JS script documents, sandbox package imports, and calling nodes from code.
Как установить скилл nodetool-js-scripting?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nodetool-js-scripting запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic