@nodetool-ai/node-sdk 0.8.4-a24.3 → 0.8.4
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/dist/.nodetool-build-stamp +1 -1
- package/dist/_sandbox/README.md +176 -0
- package/dist/_sandbox/sandbox-aws/SKILL.md +98 -0
- package/dist/_sandbox/sandbox-aws/package.json +40 -0
- package/dist/_sandbox/sandbox-chrono/SKILL.md +39 -0
- package/dist/_sandbox/sandbox-chrono/package.json +40 -0
- package/dist/_sandbox/sandbox-color/SKILL.md +35 -0
- package/dist/_sandbox/sandbox-color/package.json +43 -0
- package/dist/_sandbox/sandbox-csv/SKILL.md +50 -0
- package/dist/_sandbox/sandbox-csv/package.json +39 -0
- package/dist/_sandbox/sandbox-dates/SKILL.md +47 -0
- package/dist/_sandbox/sandbox-dates/package.json +41 -0
- package/dist/_sandbox/sandbox-decimal/SKILL.md +36 -0
- package/dist/_sandbox/sandbox-decimal/package.json +43 -0
- package/dist/_sandbox/sandbox-diff/SKILL.md +36 -0
- package/dist/_sandbox/sandbox-diff/package.json +39 -0
- package/dist/_sandbox/sandbox-docx/SKILL.md +53 -0
- package/dist/_sandbox/sandbox-docx/package.json +40 -0
- package/dist/_sandbox/sandbox-dsl/SKILL.md +137 -0
- package/dist/_sandbox/sandbox-dsl/package.json +413 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/authoring.js +382 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/core.js +382 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/gemini.audio.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/gemini.image.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/gemini.text.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/gemini.video.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/index.js +149 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/kie.dynamic_schema.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.audio.js +68 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.browser.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.charts.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.comfy.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.grid.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.channel.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.color.js +32 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.color_grading.js +44 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.draw.js +36 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.effects.js +24 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.enhance.js +28 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.filter.js +64 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.keyer.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.mask.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.image.warp.js +36 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.pdf.js +32 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.sqlite.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.stable_diffusion_cpp.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.svg.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/lib.video.download.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/messaging.discord.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/messaging.telegram.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/mistral.embeddings.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/mistral.text.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/mistral.vision.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.agents.js +32 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.audio.js +104 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.audio.realtime.js +28 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.audio.synth.js +40 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.blender.js +28 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.code.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.compare.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.constant.js +132 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.control.js +96 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.creative.js +24 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.data.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.document.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.entity.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.fake.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.game.js +36 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.generators.js +24 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.image.js +120 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.input.js +140 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.manimgx.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.model3d.js +76 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.output.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.script.js +28 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.sketch.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.storyboard.js +32 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.text.js +56 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.timeline.js +24 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.triggers.js +24 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.variable.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.video.js +136 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.workflows.app_node.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.workflows.base_node.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.workflows.subgraph.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/nodetool.workflows.workflow_node.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/openai.agents.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/openai.audio.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/openai.image.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/openai.text.js +16 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/vector.js +56 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/whisper_cpp.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/xai.image.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/xai.text.js +12 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/generated/xai.vision.js +8 -0
- package/dist/_sandbox/sandbox-dsl/sandbox/index.js +13 -0
- package/dist/_sandbox/sandbox-dsl/scripts/build.mjs +116 -0
- package/dist/_sandbox/sandbox-epub/SKILL.md +61 -0
- package/dist/_sandbox/sandbox-epub/package.json +40 -0
- package/dist/_sandbox/sandbox-exif/SKILL.md +30 -0
- package/dist/_sandbox/sandbox-exif/package.json +40 -0
- package/dist/_sandbox/sandbox-expr/SKILL.md +28 -0
- package/dist/_sandbox/sandbox-expr/package.json +40 -0
- package/dist/_sandbox/sandbox-fabric/SKILL.md +113 -0
- package/dist/_sandbox/sandbox-fabric/package.json +40 -0
- package/dist/_sandbox/sandbox-flow/SKILL.md +131 -0
- package/dist/_sandbox/sandbox-flow/package.json +411 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/gemini.audio.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/gemini.image.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/gemini.text.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/gemini.video.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/kie.dynamic_schema.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.audio.js +68 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.browser.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.charts.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.comfy.js +25 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.grid.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.channel.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.color.js +32 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.color_grading.js +44 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.draw.js +36 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.effects.js +24 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.enhance.js +28 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.filter.js +64 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.keyer.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.mask.js +16 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.image.warp.js +36 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.pdf.js +32 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.sqlite.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.stable_diffusion_cpp.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.svg.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/lib.video.download.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/messaging.discord.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/messaging.telegram.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/mistral.embeddings.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/mistral.text.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/mistral.vision.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.agents.js +41 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.audio.js +110 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.audio.realtime.js +46 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.audio.synth.js +67 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.blender.js +28 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.code.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.compare.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.constant.js +132 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.control.js +165 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.creative.js +27 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.data.js +18 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.document.js +19 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.entity.js +19 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.fake.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.game.js +39 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.generators.js +30 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.image.js +126 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.input.js +143 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.manimgx.js +16 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.model3d.js +76 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.output.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.script.js +28 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.sketch.js +16 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.storyboard.js +35 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.text.js +68 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.timeline.js +24 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.triggers.js +33 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.variable.js +15 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.video.js +145 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.workflows.app_node.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.workflows.base_node.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.workflows.subgraph.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/nodetool.workflows.workflow_node.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/openai.agents.js +25 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/openai.audio.js +16 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/openai.image.js +16 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/openai.text.js +16 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/vector.js +56 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/whisper_cpp.js +11 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/xai.image.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/xai.text.js +12 -0
- package/dist/_sandbox/sandbox-flow/sandbox/generated/xai.vision.js +8 -0
- package/dist/_sandbox/sandbox-flow/sandbox/guest-core.js +35 -0
- package/dist/_sandbox/sandbox-flow/sandbox/index.js +10 -0
- package/dist/_sandbox/sandbox-flow/scripts/build.mjs +120 -0
- package/dist/_sandbox/sandbox-game/SKILL.md +116 -0
- package/dist/_sandbox/sandbox-game/package.json +36 -0
- package/dist/_sandbox/sandbox-game/sandbox/index.js +208 -0
- package/dist/_sandbox/sandbox-gif/SKILL.md +36 -0
- package/dist/_sandbox/sandbox-gif/package.json +43 -0
- package/dist/_sandbox/sandbox-html/SKILL.md +107 -0
- package/dist/_sandbox/sandbox-html/package.json +40 -0
- package/dist/_sandbox/sandbox-ics/SKILL.md +41 -0
- package/dist/_sandbox/sandbox-ics/package.json +40 -0
- package/dist/_sandbox/sandbox-jmespath/SKILL.md +26 -0
- package/dist/_sandbox/sandbox-jmespath/package.json +43 -0
- package/dist/_sandbox/sandbox-mammoth/SKILL.md +46 -0
- package/dist/_sandbox/sandbox-mammoth/package.json +41 -0
- package/dist/_sandbox/sandbox-markdown/SKILL.md +123 -0
- package/dist/_sandbox/sandbox-markdown/package.json +41 -0
- package/dist/_sandbox/sandbox-notion/SKILL.md +101 -0
- package/dist/_sandbox/sandbox-notion/package.json +38 -0
- package/dist/_sandbox/sandbox-ocr/SKILL.md +47 -0
- package/dist/_sandbox/sandbox-ocr/package.json +40 -0
- package/dist/_sandbox/sandbox-pdf/SKILL.md +47 -0
- package/dist/_sandbox/sandbox-pdf/package.json +39 -0
- package/dist/_sandbox/sandbox-pdflib/SKILL.md +56 -0
- package/dist/_sandbox/sandbox-pdflib/package.json +38 -0
- package/dist/_sandbox/sandbox-pptx/SKILL.md +42 -0
- package/dist/_sandbox/sandbox-pptx/package.json +40 -0
- package/dist/_sandbox/sandbox-pptxgen/SKILL.md +49 -0
- package/dist/_sandbox/sandbox-pptxgen/package.json +38 -0
- package/dist/_sandbox/sandbox-qr/SKILL.md +43 -0
- package/dist/_sandbox/sandbox-qr/package.json +42 -0
- package/dist/_sandbox/sandbox-rrule/SKILL.md +37 -0
- package/dist/_sandbox/sandbox-rrule/package.json +43 -0
- package/dist/_sandbox/sandbox-stats/SKILL.md +42 -0
- package/dist/_sandbox/sandbox-stats/package.json +43 -0
- package/dist/_sandbox/sandbox-subtitle/SKILL.md +38 -0
- package/dist/_sandbox/sandbox-subtitle/package.json +41 -0
- package/dist/_sandbox/sandbox-supabase/SKILL.md +108 -0
- package/dist/_sandbox/sandbox-supabase/package.json +39 -0
- package/dist/_sandbox/sandbox-tfjs/SKILL.md +76 -0
- package/dist/_sandbox/sandbox-tfjs/package.json +42 -0
- package/dist/_sandbox/sandbox-timeline/SKILL.md +647 -0
- package/dist/_sandbox/sandbox-timeline/package.json +46 -0
- package/dist/_sandbox/sandbox-timeline/sandbox/charts.js +356 -0
- package/dist/_sandbox/sandbox-timeline/sandbox/components.js +171 -0
- package/dist/_sandbox/sandbox-timeline/sandbox/index.d.ts +700 -0
- package/dist/_sandbox/sandbox-timeline/sandbox/index.js +1658 -0
- package/dist/_sandbox/sandbox-tokens/SKILL.md +46 -0
- package/dist/_sandbox/sandbox-tokens/package.json +40 -0
- package/dist/_sandbox/sandbox-twilio/SKILL.md +93 -0
- package/dist/_sandbox/sandbox-twilio/package.json +39 -0
- package/dist/_sandbox/sandbox-xlsx/SKILL.md +74 -0
- package/dist/_sandbox/sandbox-xlsx/package.json +40 -0
- package/dist/_sandbox/sandbox-xml/SKILL.md +36 -0
- package/dist/_sandbox/sandbox-xml/package.json +40 -0
- package/dist/_sandbox/sandbox-yaml/SKILL.md +48 -0
- package/dist/_sandbox/sandbox-yaml/package.json +41 -0
- package/dist/_sandbox/sandbox-zip/SKILL.md +54 -0
- package/dist/_sandbox/sandbox-zip/package.json +40 -0
- package/dist/code-node-validation.d.ts +2 -0
- package/dist/code-node-validation.d.ts.map +1 -1
- package/dist/code-node-validation.js +1 -1
- package/dist/code-node-validation.js.map +1 -1
- package/dist/pack-loader.d.ts +1 -0
- package/dist/pack-loader.d.ts.map +1 -1
- package/dist/pack-loader.js +1 -0
- package/dist/pack-loader.js.map +1 -1
- package/dist/sandbox-catalog-host.js +1 -1
- package/dist/sandbox-catalog-host.js.map +1 -1
- package/dist/sandbox-pack-discovery.d.ts +3 -0
- package/dist/sandbox-pack-discovery.d.ts.map +1 -1
- package/dist/sandbox-pack-discovery.js +7 -3
- package/dist/sandbox-pack-discovery.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-decimal
|
|
3
|
+
description: Exact decimal arithmetic inside a Code node or CodeAct action, with decimal.js running in the guest
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Decimals in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-decimal`. One module, decimal.js. Import it
|
|
9
|
+
at the top of the body.
|
|
10
|
+
|
|
11
|
+
## Exact sums
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import Decimal from "@nodetool-ai/sandbox-decimal";
|
|
15
|
+
|
|
16
|
+
const total = inputs.amounts
|
|
17
|
+
.reduce((sum, n) => sum.plus(n), new Decimal(0));
|
|
18
|
+
return { total: total.toFixed(2) };
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Divide without float noise
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import Decimal from "@nodetool-ai/sandbox-decimal";
|
|
25
|
+
|
|
26
|
+
const share = new Decimal(inputs.cents).div(inputs.parts);
|
|
27
|
+
return { share: share.toFixed(2) };
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Gotchas
|
|
31
|
+
|
|
32
|
+
- **Default export.** `import Decimal from "@nodetool-ai/sandbox-decimal"`.
|
|
33
|
+
- **Pass strings or Decimals.** `new Decimal(0.1)` already lost precision;
|
|
34
|
+
use `new Decimal("0.1")`.
|
|
35
|
+
- **The guest has no Intl.** Format with `toFixed` / `toString`, not
|
|
36
|
+
`toLocaleString`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-decimal",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Arbitrary-precision decimal arithmetic inside the NodeTool sandbox, from decimal.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"decimal.js": "^10.6.0"
|
|
8
|
+
},
|
|
9
|
+
"nodetool": {
|
|
10
|
+
"apiVersion": 1,
|
|
11
|
+
"recommended": true,
|
|
12
|
+
"sandboxModules": [
|
|
13
|
+
{
|
|
14
|
+
"name": ".",
|
|
15
|
+
"kind": "js",
|
|
16
|
+
"npm": "decimal.js"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
23
|
+
"directory": "packages/sandbox-packs/sandbox-decimal"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://nodetool.ai",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/nodetool-ai/nodetool/issues"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"SKILL.md"
|
|
34
|
+
],
|
|
35
|
+
"keywords": [
|
|
36
|
+
"nodetool",
|
|
37
|
+
"nodetool-sandbox-pack",
|
|
38
|
+
"sandbox",
|
|
39
|
+
"decimal",
|
|
40
|
+
"money",
|
|
41
|
+
"precision"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-diff
|
|
3
|
+
description: Unified text diffs in a Code node or CodeAct action, with the diff library running on the host
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Text diffs in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-diff`. Import it at the top of the body.
|
|
9
|
+
|
|
10
|
+
The `diff` library schedules with `setTimeout`, and the guest has no timers, so
|
|
11
|
+
it cannot be compiled in. This pack is a **host module**: the import resolves to
|
|
12
|
+
a generated facade over NodeTool's own implementation.
|
|
13
|
+
|
|
14
|
+
## unified — a unified diff of two texts
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { unified } from "@nodetool-ai/sandbox-diff";
|
|
18
|
+
|
|
19
|
+
const patch = await unified(inputs.before, inputs.after, {
|
|
20
|
+
oldName: "before.md",
|
|
21
|
+
newName: "after.md",
|
|
22
|
+
context: 5
|
|
23
|
+
});
|
|
24
|
+
return { patch, changed: patch.includes("@@") };
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Options: `context` (lines of context, 0–100, default 3), `oldName`, `newName`.
|
|
28
|
+
Identical inputs produce a header with no hunks, so `includes("@@")` is the
|
|
29
|
+
cheap "did anything change" test — handy in a verify loop.
|
|
30
|
+
|
|
31
|
+
## Gotchas
|
|
32
|
+
|
|
33
|
+
- **`unified` is async.**
|
|
34
|
+
- **5 MB per side.** Larger input is refused by name.
|
|
35
|
+
- **Line-oriented.** Two texts that differ only in trailing whitespace still
|
|
36
|
+
diff; normalize first if that is noise.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-diff",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Unified text diffs inside the NodeTool sandbox, from the diff library running on the host",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"nodetool": {
|
|
7
|
+
"apiVersion": 1,
|
|
8
|
+
"recommended": true,
|
|
9
|
+
"sandboxModules": [
|
|
10
|
+
{
|
|
11
|
+
"name": ".",
|
|
12
|
+
"kind": "host",
|
|
13
|
+
"host": "diff"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
20
|
+
"directory": "packages/sandbox-packs/sandbox-diff"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://nodetool.ai",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/nodetool-ai/nodetool/issues"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"SKILL.md"
|
|
31
|
+
],
|
|
32
|
+
"keywords": [
|
|
33
|
+
"nodetool",
|
|
34
|
+
"nodetool-sandbox-pack",
|
|
35
|
+
"sandbox",
|
|
36
|
+
"diff",
|
|
37
|
+
"patch"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-docx
|
|
3
|
+
description: Build a Word document in a Code node or CodeAct action, with docx running on the host
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Word documents in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-docx`. Import it at the top of the body.
|
|
9
|
+
|
|
10
|
+
`docx` builds a document out of class instances (`Paragraph`, `TextRun`,
|
|
11
|
+
`Table`, …) that cannot cross the guest boundary as plain data. This pack is a
|
|
12
|
+
**host module**: you describe the document as a JSON element list and the host
|
|
13
|
+
builds the real `.docx` bytes.
|
|
14
|
+
|
|
15
|
+
## build — element list to `.docx` bytes
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { build } from "@nodetool-ai/sandbox-docx";
|
|
19
|
+
|
|
20
|
+
const bytes = await build({
|
|
21
|
+
properties: { title: "Q3 Report", author: "NodeTool" },
|
|
22
|
+
elements: [
|
|
23
|
+
{ type: "heading", text: "Q3 Report", level: 1 },
|
|
24
|
+
{ type: "paragraph", text: "Revenue grew 12% quarter over quarter.", bold: true },
|
|
25
|
+
{ type: "table", rows: [["Month", "Revenue"], ["Jul", "120k"], ["Aug", "134k"]] },
|
|
26
|
+
{ type: "pageBreak" },
|
|
27
|
+
{ type: "paragraph", text: "See appendix for methodology.", alignment: "CENTER" }
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
await workspace.writeBytes("report.docx", bytes);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Element types:
|
|
34
|
+
|
|
35
|
+
- `heading` — `text`, `level` (1–6, default 1)
|
|
36
|
+
- `paragraph` — `text`, `alignment` (`LEFT`/`CENTER`/`RIGHT`/`JUSTIFY`, default
|
|
37
|
+
`LEFT`), `bold`, `italic`, `fontSize` (points, default 12)
|
|
38
|
+
- `table` — `rows`, a 2D array; every cell is stringified
|
|
39
|
+
- `image` — `data` (a `Uint8Array`), `width`/`height` in inches
|
|
40
|
+
- `pageBreak` — no fields
|
|
41
|
+
|
|
42
|
+
`properties.title`/`author`/`subject`/`keywords` set the document's metadata.
|
|
43
|
+
|
|
44
|
+
## Gotchas
|
|
45
|
+
|
|
46
|
+
- **`build` is async** and returns a `Uint8Array`.
|
|
47
|
+
- **Writing only.** To read an existing `.docx`, use
|
|
48
|
+
`@nodetool-ai/sandbox-mammoth` instead — these are two different libraries on
|
|
49
|
+
two different sides of the format.
|
|
50
|
+
- **Images are inches, not pixels.** `width`/`height` follow docx's own
|
|
51
|
+
convention; omit them and the image renders at a fixed placeholder size.
|
|
52
|
+
- **10 MB per image.** The shared host-module input cap applies to each
|
|
53
|
+
`data` field.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-docx",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Build Word documents inside the NodeTool sandbox, from docx running on the host",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"nodetool": {
|
|
7
|
+
"apiVersion": 1,
|
|
8
|
+
"recommended": true,
|
|
9
|
+
"sandboxModules": [
|
|
10
|
+
{
|
|
11
|
+
"name": ".",
|
|
12
|
+
"kind": "host",
|
|
13
|
+
"host": "docx"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
20
|
+
"directory": "packages/sandbox-packs/sandbox-docx"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://nodetool.ai",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/nodetool-ai/nodetool/issues"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"SKILL.md"
|
|
31
|
+
],
|
|
32
|
+
"keywords": [
|
|
33
|
+
"nodetool",
|
|
34
|
+
"nodetool-sandbox-pack",
|
|
35
|
+
"sandbox",
|
|
36
|
+
"docx",
|
|
37
|
+
"word",
|
|
38
|
+
"document"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-dsl
|
|
3
|
+
description: Build a NodeTool workflow graph in the sandbox from generated node wrappers, one importable module per node namespace
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# The workflow DSL in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-dsl`. The root exports `workflow()` and every
|
|
9
|
+
namespace under a short name. Each namespace is also its own module:
|
|
10
|
+
`@nodetool-ai/sandbox-dsl/nodetool.image`, `@nodetool-ai/sandbox-dsl/lib.audio`,
|
|
11
|
+
and so on for all 71.
|
|
12
|
+
|
|
13
|
+
Every node type is a generated function whose name and inputs come from the
|
|
14
|
+
node's own metadata. A type this pack does not export does not exist, and the
|
|
15
|
+
import fails before the program runs — which is the difference from building a
|
|
16
|
+
graph out of type strings.
|
|
17
|
+
|
|
18
|
+
## Build a graph
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { workflow } from "@nodetool-ai/sandbox-dsl";
|
|
22
|
+
import { stringInput } from "@nodetool-ai/sandbox-dsl/nodetool.input";
|
|
23
|
+
import { resize } from "@nodetool-ai/sandbox-dsl/nodetool.image";
|
|
24
|
+
import { output } from "@nodetool-ai/sandbox-dsl/nodetool.output";
|
|
25
|
+
|
|
26
|
+
const prompt = stringInput({ name: "prompt", value: "a fox in snow" });
|
|
27
|
+
const smaller = resize({ width: 256, height: 256 });
|
|
28
|
+
return workflow(output({ name: "image", value: smaller.output() }));
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`workflow()` returns `{ nodes, edges }` in the kernel shape — nodes carry
|
|
32
|
+
`{id, type, properties}`, edges carry `{id, source, sourceHandle, target,
|
|
33
|
+
targetHandle}`. Hand that straight to `validate_workflow` or `create_workflow`.
|
|
34
|
+
|
|
35
|
+
## Check it, save it, run it
|
|
36
|
+
|
|
37
|
+
The graph is data until something checks it. Validate first — it costs nothing
|
|
38
|
+
and catches a missing property, a dangling edge, or a model nobody selected
|
|
39
|
+
before a run spends money on the half of the graph that does work:
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import { validate_workflow, create_workflow, run_workflow, debug_workflow }
|
|
43
|
+
from "@nodetool-ai/sandbox-nodetool/workflows";
|
|
44
|
+
|
|
45
|
+
const graph = workflow(output({ name: "image", value: smaller.output() }));
|
|
46
|
+
|
|
47
|
+
const check = await validate_workflow({ graph });
|
|
48
|
+
if (!check.ok) throw new Error(check.issues.map((i) => i.message).join("; "));
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`validate_workflow` answers `{ok, counts, issues}` — `ok` is false only when
|
|
52
|
+
the graph has errors, and each issue carries `{severity, code, message}`.
|
|
53
|
+
Warnings do not set `ok` false; read them off `issues`.
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
const saved = await create_workflow({ name: "Thumbnailer", graph });
|
|
57
|
+
const run = await run_workflow({
|
|
58
|
+
workflow_id: saved.id,
|
|
59
|
+
params: { prompt: "a fox in snow" }
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`run_workflow` answers `{status, outputs}`. When a run fails and the graph looks
|
|
64
|
+
right, `debug_workflow({workflow_id, params})` runs it again and answers one
|
|
65
|
+
report: `{workflow_id, run, job, workflow}`. `run` carries
|
|
66
|
+
`{status, outputs, error, verdict}` — `outputs` is keyed by output name and
|
|
67
|
+
each name holds an array of emitted values (`run.outputs.image[0]`). `job`
|
|
68
|
+
carries status, cost and logs; `verdict.headline` and `verdict.issues` say
|
|
69
|
+
which node failed and why.
|
|
70
|
+
|
|
71
|
+
Every model property must be selected before you save: assign a `find_model`
|
|
72
|
+
result's `ref` to the node's `model`. A graph saved with unselected models is
|
|
73
|
+
refused by `create_workflow`, because nothing stamps models in at run time.
|
|
74
|
+
|
|
75
|
+
Where the session mounts no capability modules, the same three verbs are
|
|
76
|
+
`nodetool.workflows.validate/create/run/debug`. Both forms reach one
|
|
77
|
+
implementation past one permission gate.
|
|
78
|
+
|
|
79
|
+
## Wiring
|
|
80
|
+
|
|
81
|
+
A node function returns a reference. `ref.output()` is the default output slot;
|
|
82
|
+
`ref.output("mask")` names one. Pass a handle as a property value and the edge
|
|
83
|
+
is wired for you:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const wired = resize({ image: source.output(), width: 512 });
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
A `list[...]` input takes an array of handles — one edge per element, and the
|
|
90
|
+
sources run in parallel:
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
const strip = combineImageGrid({
|
|
94
|
+
tiles: [a.output(), b.output(), c.output()],
|
|
95
|
+
columns: 3
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Every element must be a handle; mixing wired outputs and literal values in one
|
|
100
|
+
array throws. A handle buried inside an object value throws too — a connection
|
|
101
|
+
is only made from a handle assigned directly to an input.
|
|
102
|
+
|
|
103
|
+
A node with several outputs has no default, so `output()` without a slot throws
|
|
104
|
+
and names the slots it has. A slot the node does not have throws the same way.
|
|
105
|
+
|
|
106
|
+
## Ids
|
|
107
|
+
|
|
108
|
+
Ids are assigned from the node type: `resize`, `resize_2`, `string_input`. They
|
|
109
|
+
are stable for a given program, so a later edit can name one — but the generated
|
|
110
|
+
wrappers take inputs and nothing else, so a program cannot choose an id.
|
|
111
|
+
|
|
112
|
+
## Everything in one import
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
import * as dsl from "@nodetool-ai/sandbox-dsl";
|
|
116
|
+
|
|
117
|
+
const smaller = dsl.image.resize({ width: 256, height: 256 });
|
|
118
|
+
return dsl.workflow(dsl.output.output({ name: "image", value: smaller.output() }));
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The `nodetool.*` namespaces drop the prefix (`dsl.image`, `dsl.input`,
|
|
122
|
+
`dsl.text`); the rest keep it in camel case (`dsl.libAudio`, `dsl.openaiImage`).
|
|
123
|
+
Importing one namespace module is cheaper than the root, which pulls all 71.
|
|
124
|
+
|
|
125
|
+
## Gotchas
|
|
126
|
+
|
|
127
|
+
- **`workflow()` lives only at the root.** A program that imports namespace
|
|
128
|
+
subpaths still declares `@nodetool-ai/sandbox-dsl` for the builder.
|
|
129
|
+
- **A handle is not text.** `` `use ${node.output()}` `` throws rather than
|
|
130
|
+
writing `[object Object]` into a property and wiring no edge.
|
|
131
|
+
- **Only reachable nodes ship.** `workflow(terminal)` walks back from its
|
|
132
|
+
terminals; a node nothing wires to is dropped. Pass every terminal you want.
|
|
133
|
+
- **One graph per call.** `workflow()` clears the registry, so a handle from an
|
|
134
|
+
earlier call is spent and using it throws.
|
|
135
|
+
- **This builds a graph; it does not run one.** The pack is pure computation —
|
|
136
|
+
no models are called, no assets resolve, no node executes. Run the graph
|
|
137
|
+
through the workflow tools once it validates.
|