@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,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-markdown
|
|
3
|
+
description: Parse markdown into a token stream inside a Code node or CodeAct action, with marked's lexer running in the guest
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Markdown in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-markdown`. One module, the `marked` root
|
|
9
|
+
export. Import it at the top of the body.
|
|
10
|
+
|
|
11
|
+
`marked` is pure JavaScript — no Node builtins, no DOM — so it compiles
|
|
12
|
+
straight into the QuickJS guest. There is no pre-built "extract headers"
|
|
13
|
+
helper; `marked.lexer` gives you the token stream and you read what you need
|
|
14
|
+
out of it.
|
|
15
|
+
|
|
16
|
+
## lexer — markdown text to tokens
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import { marked } from "@nodetool-ai/sandbox-markdown";
|
|
20
|
+
|
|
21
|
+
const tokens = marked.lexer(inputs.markdown);
|
|
22
|
+
return { tokenCount: tokens.length };
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Each token carries a `type` (`heading`, `paragraph`, `list`, `code`, `table`,
|
|
26
|
+
`link` tokens nested inside `paragraph`/`text` tokens, etc.) and the fields
|
|
27
|
+
that type needs.
|
|
28
|
+
|
|
29
|
+
## Headers → a document outline
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { marked } from "@nodetool-ai/sandbox-markdown";
|
|
33
|
+
|
|
34
|
+
const headers = marked.lexer(inputs.markdown)
|
|
35
|
+
.filter((t) => t.type === "heading")
|
|
36
|
+
.map((t) => ({ level: t.depth, text: t.text }));
|
|
37
|
+
return { headers };
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Links → a flat list
|
|
41
|
+
|
|
42
|
+
`marked` nests inline tokens (links, emphasis) inside block tokens. Walk
|
|
43
|
+
`tokens.links` for a document's reference-style link definitions, or walk each
|
|
44
|
+
block's `.tokens` for inline links:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import { marked } from "@nodetool-ai/sandbox-markdown";
|
|
48
|
+
|
|
49
|
+
function collectLinks(tokens, out = []) {
|
|
50
|
+
for (const t of tokens) {
|
|
51
|
+
if (t.type === "link") out.push({ href: t.href, text: t.text });
|
|
52
|
+
if (t.tokens) collectLinks(t.tokens, out);
|
|
53
|
+
if (t.items) collectLinks(t.items, out);
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const links = collectLinks(marked.lexer(inputs.markdown));
|
|
59
|
+
return { links };
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Lists → nested items
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
import { marked } from "@nodetool-ai/sandbox-markdown";
|
|
66
|
+
|
|
67
|
+
const lists = marked.lexer(inputs.markdown)
|
|
68
|
+
.filter((t) => t.type === "list")
|
|
69
|
+
.map((t) => ({
|
|
70
|
+
ordered: t.ordered,
|
|
71
|
+
items: t.items.map((item) => item.text)
|
|
72
|
+
}));
|
|
73
|
+
return { lists };
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Code blocks → language + source
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
import { marked } from "@nodetool-ai/sandbox-markdown";
|
|
80
|
+
|
|
81
|
+
const codeBlocks = marked.lexer(inputs.markdown)
|
|
82
|
+
.filter((t) => t.type === "code")
|
|
83
|
+
.map((t) => ({ language: t.lang || "text", code: t.text }));
|
|
84
|
+
return { codeBlocks };
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Tables → rows of records
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
import { marked } from "@nodetool-ai/sandbox-markdown";
|
|
91
|
+
|
|
92
|
+
const tables = marked.lexer(inputs.markdown)
|
|
93
|
+
.filter((t) => t.type === "table")
|
|
94
|
+
.map((t) => {
|
|
95
|
+
const headers = t.header.map((cell) => cell.text);
|
|
96
|
+
return t.rows.map((row) =>
|
|
97
|
+
Object.fromEntries(row.map((cell, i) => [headers[i], cell.text]))
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
return { tables };
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Markdown → HTML
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
import { marked } from "@nodetool-ai/sandbox-markdown";
|
|
107
|
+
|
|
108
|
+
const html = marked.parse(inputs.markdown);
|
|
109
|
+
return { html };
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Gotchas
|
|
113
|
+
|
|
114
|
+
- **Everything runs in the guest.** The 64 MB guest heap holds your input text,
|
|
115
|
+
the token tree, and the returned value at once.
|
|
116
|
+
- **`marked.lexer` is synchronous**, unlike `marked.parse` (which can be async
|
|
117
|
+
when you register an async extension — the default configuration is not).
|
|
118
|
+
- **Token shapes differ by type.** A `list` token's items are themselves
|
|
119
|
+
tokens with their own `.tokens`; a `table` token has `header`/`rows`, not a
|
|
120
|
+
flat `cells` array. Log a sample token when a shape is unclear.
|
|
121
|
+
- **This pack is the only route to markdown parsing.** There is no
|
|
122
|
+
`data.parseMarkdown` global; every library the sandbox offers is an
|
|
123
|
+
importable module, and this is the one for markdown.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-markdown",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Markdown parsing inside the NodeTool sandbox, from marked's lexer running in the guest",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"marked": "^12.0.2"
|
|
8
|
+
},
|
|
9
|
+
"nodetool": {
|
|
10
|
+
"apiVersion": 1,
|
|
11
|
+
"recommended": true,
|
|
12
|
+
"sandboxModules": [
|
|
13
|
+
{
|
|
14
|
+
"name": ".",
|
|
15
|
+
"kind": "js",
|
|
16
|
+
"npm": "marked"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
23
|
+
"directory": "packages/sandbox-packs/sandbox-markdown"
|
|
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
|
+
"markdown"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-notion
|
|
3
|
+
description: Call the Notion API from a Code node or CodeAct action, with NodeTool's request builder and rich-text/block readers running on the host
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Notion in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-notion`. Import it at the top of the body.
|
|
9
|
+
|
|
10
|
+
Notion is an ordinary HTTPS API and `fetch` reaches it. What costs a script its
|
|
11
|
+
first three attempts is everything around the call — the `Notion-Version`
|
|
12
|
+
header, the rich-text arrays every piece of text is wrapped in, and the block
|
|
13
|
+
tree a page's content comes back as. Those three are this pack.
|
|
14
|
+
|
|
15
|
+
**Nothing here sends a request.** `request` builds one; the guest's own `fetch`
|
|
16
|
+
sends it, under the run's fetch cap and SSRF guard.
|
|
17
|
+
|
|
18
|
+
## request — an authenticated Notion request
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { request } from "@nodetool-ai/sandbox-notion";
|
|
22
|
+
|
|
23
|
+
const token = await nodetool.secrets.get("NOTION_API_KEY");
|
|
24
|
+
const req = await request({
|
|
25
|
+
token,
|
|
26
|
+
path: "search",
|
|
27
|
+
method: "POST",
|
|
28
|
+
body: { query: inputs.query, page_size: 10 }
|
|
29
|
+
});
|
|
30
|
+
const res = await fetch(req.url, req);
|
|
31
|
+
if (!res.ok) throw new Error(`Notion search failed: ${res.status}`);
|
|
32
|
+
return { results: res.json.results };
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Options: `token` (required), `path` (required — relative to `/v1` unless it
|
|
36
|
+
starts with `/`), `method` (default `GET`), `body` (JSON-encoded when present),
|
|
37
|
+
`query` (query-string bag), `version` (default `2022-06-28`).
|
|
38
|
+
|
|
39
|
+
Returns `{url, method, headers, body?}`, which `fetch(req.url, req)` takes
|
|
40
|
+
whole.
|
|
41
|
+
|
|
42
|
+
## plainText — a rich-text array as a string
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
import { plainText } from "@nodetool-ai/sandbox-notion";
|
|
46
|
+
|
|
47
|
+
const title = await plainText(page.properties.Name.title);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Takes the array Notion puts under every `title`, `rich_text` and heading.
|
|
51
|
+
Anything else gives `""`.
|
|
52
|
+
|
|
53
|
+
## toMarkdown — a page's blocks as markdown
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { request, toMarkdown } from "@nodetool-ai/sandbox-notion";
|
|
57
|
+
|
|
58
|
+
const req = await request({ token, path: `blocks/${inputs.page_id}/children`, query: { page_size: 100 } });
|
|
59
|
+
const blocks = (await fetch(req.url, req)).json.results;
|
|
60
|
+
return { markdown: await toMarkdown(blocks) };
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Handles paragraphs, the three heading levels, bulleted and numbered items,
|
|
64
|
+
to-dos, quotes, code fences and dividers. A block markdown has no form for —
|
|
65
|
+
a database, an embed, a synced block — contributes nothing rather than a
|
|
66
|
+
placeholder, so the result is text a model or a file can take as-is.
|
|
67
|
+
|
|
68
|
+
## Common flows
|
|
69
|
+
|
|
70
|
+
**Create a page in a database**
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
const req = await request({
|
|
74
|
+
token, path: "pages", method: "POST",
|
|
75
|
+
body: {
|
|
76
|
+
parent: { database_id: inputs.database_id },
|
|
77
|
+
properties: { Name: { title: [{ text: { content: inputs.title } }] } }
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const page = (await fetch(req.url, req)).json;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Query a database**
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const req = await request({
|
|
87
|
+
token, path: `databases/${inputs.database_id}/query`, method: "POST",
|
|
88
|
+
body: { filter: { property: "Status", select: { equals: "Open" } }, page_size: 50 }
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Gotchas
|
|
93
|
+
|
|
94
|
+
- **Every export is async.** A host call is a round trip.
|
|
95
|
+
- **Nested blocks are not fetched.** `toMarkdown` is pure over the blocks you
|
|
96
|
+
hand it. A block with `has_children` needs its own
|
|
97
|
+
`blocks/{id}/children` call.
|
|
98
|
+
- **Notion paginates at 100.** Follow `next_cursor` with
|
|
99
|
+
`query: { start_cursor }` and watch the run's fetch cap.
|
|
100
|
+
- **The integration needs access.** A page shared with nobody returns 404 even
|
|
101
|
+
with a valid token — share it with the integration in Notion first.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-notion",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Build Notion API requests and read Notion rich text and blocks inside the NodeTool sandbox, from NodeTool's helper 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": "notion"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
20
|
+
"directory": "packages/sandbox-packs/sandbox-notion"
|
|
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
|
+
"notion"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-ocr
|
|
3
|
+
description: Read the text in an image from a Code node or CodeAct action, with tesseract.js running on the host
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# OCR in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-ocr`. Import it at the top of the body.
|
|
9
|
+
|
|
10
|
+
tesseract.js runs a WASM engine, spawns workers, and downloads its language
|
|
11
|
+
data on first use — none of which the guest can do. This pack is a **host
|
|
12
|
+
module**: the import resolves to a generated facade over NodeTool's own
|
|
13
|
+
implementation.
|
|
14
|
+
|
|
15
|
+
## recognize — image bytes to text
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { recognize } from "@nodetool-ai/sandbox-ocr";
|
|
19
|
+
|
|
20
|
+
const { text, confidence, words } = await recognize(
|
|
21
|
+
await workspace.readBytes("receipt.png")
|
|
22
|
+
);
|
|
23
|
+
const total = words.find((w) => /^\d+[.,]\d{2}$/.test(w.text));
|
|
24
|
+
return { text, confidence, total: total?.text ?? null };
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
One call gives you all three readings:
|
|
28
|
+
|
|
29
|
+
- `text` — the whole page as one string.
|
|
30
|
+
- `confidence` — the page mean, 0–100.
|
|
31
|
+
- `words` — `{text, confidence, bbox: {x, y, width, height}}` per word, in
|
|
32
|
+
reading order, with the box in image pixels.
|
|
33
|
+
|
|
34
|
+
Pass `{ language: "eng+deu" }` for anything other than English; the codes are
|
|
35
|
+
Tesseract's, `+`-joined. The data file for a language it has not seen before is
|
|
36
|
+
downloaded the first time you ask for it, so that call is slower.
|
|
37
|
+
|
|
38
|
+
Get the bytes from `workspace.readBytes`, from `await response.bytes()`, or
|
|
39
|
+
from an asset with `assetToSandbox`.
|
|
40
|
+
|
|
41
|
+
## Gotchas
|
|
42
|
+
|
|
43
|
+
- **`recognize` is async**, and the first call to it pays for engine startup.
|
|
44
|
+
- **10 MB per image.** Larger input is refused by name.
|
|
45
|
+
- **20 000 words per page.**
|
|
46
|
+
- **Straight, sharp scans read best.** Use `image.rotate` and `image.adjust` to
|
|
47
|
+
deskew and raise contrast before you hand the bytes over.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-ocr",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Read text out of images inside the NodeTool sandbox, from tesseract.js 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": "ocr"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
20
|
+
"directory": "packages/sandbox-packs/sandbox-ocr"
|
|
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
|
+
"ocr",
|
|
37
|
+
"tesseract",
|
|
38
|
+
"text-recognition"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-pdf
|
|
3
|
+
description: Extract the embedded text of a PDF, whole or per page, in a Code node or CodeAct action, with pdf-parse running on the host. It reads text the PDF already carries; it does not OCR a scanned page.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PDF text in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-pdf`. Import it at the top of the body.
|
|
9
|
+
|
|
10
|
+
pdf-parse drives pdf.js, which needs Node builtins and a canvas; it is not a
|
|
11
|
+
guest-module candidate. This pack is a **host module**: the import resolves to a
|
|
12
|
+
generated facade over NodeTool's own implementation.
|
|
13
|
+
|
|
14
|
+
## extractText — whole document to plain text
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { extractText } from "@nodetool-ai/sandbox-pdf";
|
|
18
|
+
|
|
19
|
+
const bytes = await workspace.readBytes("report.pdf");
|
|
20
|
+
const text = await extractText(bytes);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
All pages concatenated, in order, with no page markers.
|
|
24
|
+
|
|
25
|
+
## extractPages — one item per page
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { extractPages } from "@nodetool-ai/sandbox-pdf";
|
|
29
|
+
|
|
30
|
+
const pages = await extractPages(bytes);
|
|
31
|
+
// [{ index: 0, pageNumber: 1, text: "Quarterly report" }, ...]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Get the bytes from `workspace.readBytes`, or from a fetched body with
|
|
35
|
+
`await response.bytes()`.
|
|
36
|
+
|
|
37
|
+
## Gotchas
|
|
38
|
+
|
|
39
|
+
- **Both exports are async.**
|
|
40
|
+
- **10 MB per document.** Larger input is refused by name.
|
|
41
|
+
- **No OCR.** Both exports read the text layer the PDF already carries. A
|
|
42
|
+
scanned page is an image and comes back empty — run
|
|
43
|
+
`@nodetool-ai/sandbox-ocr` over the page image, or a vision model, for that.
|
|
44
|
+
- **Text only.** Neither export reads images, tables as tables, or form fields.
|
|
45
|
+
Layout is approximated from text positions, so column order in a
|
|
46
|
+
multi-column page is not guaranteed.
|
|
47
|
+
- **An encrypted or malformed PDF throws** with the reason pdf.js gives.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-pdf",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Extract text from PDF files inside the NodeTool sandbox, from pdf-parse 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": "pdf"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
20
|
+
"directory": "packages/sandbox-packs/sandbox-pdf"
|
|
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
|
+
"pdf",
|
|
37
|
+
"text-extraction"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-pdflib
|
|
3
|
+
description: Build and merge PDF files in a Code node or CodeAct action, with pdf-lib running on the host
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PDF writing in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-pdflib`. Import it at the top of the body.
|
|
9
|
+
|
|
10
|
+
This pack **writes** PDFs. To extract text from an existing file, use
|
|
11
|
+
`@nodetool-ai/sandbox-pdf` instead.
|
|
12
|
+
|
|
13
|
+
## build — pages to PDF bytes
|
|
14
|
+
|
|
15
|
+
Coordinates are **top-left**, in PDF points (72 per inch). A US Letter page
|
|
16
|
+
is 612×792.
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import { build } from "@nodetool-ai/sandbox-pdflib";
|
|
20
|
+
|
|
21
|
+
const bytes = await build({
|
|
22
|
+
pages: [
|
|
23
|
+
{
|
|
24
|
+
width: 612,
|
|
25
|
+
height: 792,
|
|
26
|
+
items: [
|
|
27
|
+
{ type: "text", x: 72, y: 72, text: "Hello", size: 24, color: "#111827" },
|
|
28
|
+
{ type: "image", x: 72, y: 120, width: 200, height: 120, data: inputs.logo }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
await workspace.writeBytes("hello.pdf", bytes);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Item types:
|
|
37
|
+
|
|
38
|
+
- `text` — `x`, `y`, `text`, `size` (points, default 12), `color` (hex)
|
|
39
|
+
- `image` — `x`, `y`, `width`, `height`, `data` (`Uint8Array` PNG or JPEG)
|
|
40
|
+
|
|
41
|
+
## merge — concatenate PDFs
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import { merge } from "@nodetool-ai/sandbox-pdflib";
|
|
45
|
+
|
|
46
|
+
const bytes = await merge([inputs.first, inputs.second]);
|
|
47
|
+
await workspace.writeBytes("combined.pdf", bytes);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Each entry is a `Uint8Array` of an existing PDF.
|
|
51
|
+
|
|
52
|
+
## Gotchas
|
|
53
|
+
|
|
54
|
+
- **Host module.** `build` and `merge` are async and return a `Uint8Array`.
|
|
55
|
+
- **At most 200 pages** (or 200 source documents for `merge`).
|
|
56
|
+
- **Images are PNG or JPEG bytes**, sniffed from the magic header.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-pdflib",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Build and merge PDF files inside the NodeTool sandbox, with pdf-lib 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": "pdflib"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
20
|
+
"directory": "packages/sandbox-packs/sandbox-pdflib"
|
|
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
|
+
"pdf"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sandbox-pptx
|
|
3
|
+
description: Extract text from a PowerPoint file, whole or per slide, in a Code node or CodeAct action, with office-text-extractor running on the host
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PowerPoint text in the sandbox
|
|
7
|
+
|
|
8
|
+
Specifier: `@nodetool-ai/sandbox-pptx`. Import it at the top of the body.
|
|
9
|
+
|
|
10
|
+
office-text-extractor reads a `.pptx` buffer through Node's own zip/XML stack;
|
|
11
|
+
it is not a guest-module candidate. This pack is a **host module**: the import
|
|
12
|
+
resolves to a generated facade over NodeTool's own implementation.
|
|
13
|
+
|
|
14
|
+
## extractText — whole deck to plain text
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { extractText } from "@nodetool-ai/sandbox-pptx";
|
|
18
|
+
|
|
19
|
+
const bytes = await workspace.readBytes("deck.pptx");
|
|
20
|
+
const text = await extractText(bytes);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
All slides concatenated, in order.
|
|
24
|
+
|
|
25
|
+
## extractSlides — one item per slide
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { extractSlides } from "@nodetool-ai/sandbox-pptx";
|
|
29
|
+
|
|
30
|
+
const slides = await extractSlides(bytes);
|
|
31
|
+
// [{ index: 0, slideNumber: 1, text: "Welcome to slide one" }, ...]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Get the bytes from `workspace.readBytes`, or from a fetched body with
|
|
35
|
+
`await response.bytes()`.
|
|
36
|
+
|
|
37
|
+
## Gotchas
|
|
38
|
+
|
|
39
|
+
- **Both exports are async.**
|
|
40
|
+
- **10 MB per deck.** Larger input is refused by name.
|
|
41
|
+
- **Text only.** Neither export reads speaker notes, images, or slide layout —
|
|
42
|
+
just the text runs on each slide.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nodetool-ai/sandbox-pptx",
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "Extract text from PowerPoint files inside the NodeTool sandbox, from office-text-extractor 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": "pptx"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/nodetool-ai/nodetool.git",
|
|
20
|
+
"directory": "packages/sandbox-packs/sandbox-pptx"
|
|
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
|
+
"pptx",
|
|
37
|
+
"powerpoint",
|
|
38
|
+
"slides"
|
|
39
|
+
]
|
|
40
|
+
}
|