@nodetool-ai/text-nodes 0.8.1

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/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @nodetool-ai/text-nodes
2
+
3
+ Text-processing nodes for [NodeTool](https://nodetool.ai).
4
+
5
+ A pack of text nodes for NodeTool workflows: concatenate and template strings,
6
+ filter streams, embed and transcribe, and assemble SVG documents. HTML and
7
+ Markdown parsing moved to the `@nodetool-ai/sandbox-html` and
8
+ `@nodetool-ai/sandbox-markdown` sandbox packs, importable from a Code node.
9
+
10
+ The string-manipulation, comparison, regex, parsing, and token-counting node
11
+ classes were removed: `nodetool.code.Code` covers that ground in three lines of
12
+ JavaScript. Saved workflows keep working — `NODE_TYPE_MIGRATIONS` in
13
+ `packages/protocol/src/graph.ts` rewrites each removed type to a Code node with
14
+ the equivalent body prefilled.
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ npm install @nodetool-ai/text-nodes
20
+ ```
21
+
22
+ ## Nodes
23
+
24
+ ### Composition
25
+
26
+ - `nodetool.text.Concat`, `nodetool.text.Template`, `nodetool.text.Prompt`, `nodetool.text.Collect`
27
+
28
+ ### Stream filters
29
+
30
+ - `nodetool.text.FilterString`, `nodetool.text.FilterRegexString`
31
+
32
+ ### Embeddings and speech
33
+
34
+ - `nodetool.text.Embedding`, `nodetool.text.AutomaticSpeechRecognition`
35
+
36
+ ### I/O
37
+
38
+ - `nodetool.text.LoadTextAssets`, `nodetool.text.LoadTextFolder`, `nodetool.text.SaveText`, `nodetool.text.SaveTextFile`
39
+
40
+ ### SVG
41
+
42
+ `lib.svg.Document` assembles an element list into a document; `lib.svg.SVGToImage`
43
+ rasterizes one through the native `sharp` addon. The 12 element builders (`Rect`,
44
+ `Circle`, `Text`, `Gradient`, …) were removed — an `svg_element` is a plain
45
+ object, so a Code node builds the whole list in one place, where the array order
46
+ is the paint order. The editor ships them as the `svg-*` snippets.
47
+
48
+ The `lib.nlp.*` nodes (tokenize, stem, classify, entities, sentiment, TF-IDF,
49
+ phonetic match) were removed with their 2,766 lines of vendored algorithms. No
50
+ replacement pack ships yet.
51
+
52
+ ## Links
53
+
54
+ - [NodeTool](https://nodetool.ai)
55
+ - [GitHub](https://github.com/nodetool-ai/nodetool)
@@ -0,0 +1 @@
1
+ 2026-09-28T09:19:11.005Z
@@ -0,0 +1,3 @@
1
+ export * from "./nodes/text-extra.js";
2
+ export * from "./nodes/lib-svg.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./nodes/text-extra.js";
2
+ export * from "./nodes/lib-svg.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { BaseNode } from "@nodetool-ai/node-sdk";
2
+ import type { Platform } from "@nodetool-ai/protocol";
3
+ type SvgElementLike = {
4
+ name: string;
5
+ attributes?: Record<string, string>;
6
+ children?: SvgElementLike[];
7
+ content?: string;
8
+ };
9
+ /**
10
+ * What a `list[svg_element]` slot delivers: an element, a nested list of them,
11
+ * or a scalar somebody wired straight into the slot.
12
+ */
13
+ type SvgContent = SvgElementLike | SvgContent[] | string | number | boolean | null | undefined;
14
+ /** Output handles DocumentLibNode.process() emits. */
15
+ type DocumentLibNodeOutputs = {
16
+ output: {
17
+ data: string;
18
+ };
19
+ };
20
+ export declare class DocumentLibNode extends BaseNode {
21
+ static readonly nodeType = "lib.svg.Document";
22
+ static readonly retrySafe = true;
23
+ static readonly title = "SVG Document";
24
+ static readonly description = "Combine SVG elements into a complete SVG document.\n svg, document, combine\n\n Use cases:\n - Combine multiple SVG elements into a single document\n - Set document-level properties like viewBox and dimensions\n - Export complete SVG documents";
25
+ static readonly inlineFields: never[];
26
+ static readonly inputFields: string[];
27
+ static readonly metadataOutputTypes: {
28
+ output: string;
29
+ };
30
+ elements: SvgContent[];
31
+ width: number;
32
+ height: number;
33
+ viewBox: string;
34
+ process(): Promise<DocumentLibNodeOutputs>;
35
+ }
36
+ /** Output handles SVGToImageLibNode.process() emits. */
37
+ type SVGToImageLibNodeOutputs = {
38
+ output: {
39
+ type: string;
40
+ data: string;
41
+ mimeType: string;
42
+ width: number;
43
+ height: number;
44
+ };
45
+ };
46
+ export declare class SVGToImageLibNode extends BaseNode {
47
+ static readonly nodeType = "lib.svg.SVGToImage";
48
+ static readonly retrySafe = true;
49
+ static readonly platforms: readonly Platform[];
50
+ static readonly title = "SVG to Image";
51
+ static readonly description = "Create an SVG document and convert it to a raster image in one step.\n svg, document, raster, convert\n\n Use cases:\n - Create and rasterize SVG documents in a single operation\n - Generate image files from SVG elements\n - Convert vector graphics to bitmap format with custom dimensions";
52
+ static readonly inlineFields: never[];
53
+ static readonly inputFields: string[];
54
+ static readonly metadataOutputTypes: {
55
+ output: string;
56
+ };
57
+ elements: SvgContent[];
58
+ width: number;
59
+ height: number;
60
+ viewBox: string;
61
+ scale: number;
62
+ process(): Promise<SVGToImageLibNodeOutputs>;
63
+ }
64
+ export declare const LIB_SVG_NODES: (typeof DocumentLibNode | typeof SVGToImageLibNode)[];
65
+ export {};
66
+ //# sourceMappingURL=lib-svg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-svg.d.ts","sourceRoot":"","sources":["../../src/nodes/lib-svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAQ,MAAM,uBAAuB,CAAC;AAGvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA2CtD,KAAK,cAAc,GAAG;IAC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,QAAQ;IAC7C,MAAM,CAAC,QAAQ,CAAC,QAAQ,wBAAwB;IAChD,MAAM,CAAC,QAAQ,CAAC,SAAS,QAAQ;IAGjC,MAAM,CAAC,QAAQ,CAAC,SAAS,sBAAa;IACtC,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAkB;IACvC,MAAM,CAAC,QAAQ,CAAC,WAAW,qTACyR;IACpT,MAAM,CAAC,QAAQ,CAAC,YAAY,UAAM;IAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAgB;IAC3C,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QACjC,MAAM;MACN;IAQM,QAAQ,EAAE,UAAU,EAAE,CAAC;IAUvB,KAAK,EAAE,MAAM,CAAC;IAUd,MAAM,EAAE,MAAM,CAAC;IAQf,OAAO,EAAE,MAAM,CAAC;IAUhB,KAAK,EAAE,MAAM,CAAC;IAEhB,OAAO,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAoBjD;CACF;AAED,eAAO,MAAM,aAAa,uDAAoD,CAAC"}
@@ -0,0 +1,212 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BaseNode, prop } from "@nodetool-ai/node-sdk";
8
+ import { tagAsServer } from "@nodetool-ai/nodes-utils";
9
+ import { importHidden } from "@nodetool-ai/config";
10
+ // SVGToImage rasterizes via the native `sharp` addon, so it is Node-only (its
11
+ // per-class override below wins over the list-level tagAsServer). Document is a
12
+ // pure string generator and stays server-portable.
13
+ const NODE_ONLY = ["node"];
14
+ /** Actionable error thrown by SVGToImage when the native `sharp` addon is absent. */
15
+ const SHARP_UNAVAILABLE_MESSAGE = "SVG to Image requires the native 'sharp' addon, which is only available on a " +
16
+ "Node server (install/reinstall sharp for this platform/arch — e.g. musl or a " +
17
+ "serverless target). It is not available in the browser/edge/workers.";
18
+ /** sharp's CJS export is either the callable itself or a namespace with `default`. */
19
+ function isSharpFn(mod) {
20
+ return typeof mod === "function";
21
+ }
22
+ let _sharpPromise = null;
23
+ async function loadSharp() {
24
+ if (!_sharpPromise) {
25
+ const attempt = (async () => {
26
+ const mod = await importHidden("sharp");
27
+ if (!mod)
28
+ return null;
29
+ if (isSharpFn(mod))
30
+ return mod;
31
+ return mod.default ?? null;
32
+ })();
33
+ _sharpPromise = attempt;
34
+ attempt.catch(() => {
35
+ if (_sharpPromise === attempt)
36
+ _sharpPromise = null;
37
+ });
38
+ }
39
+ return _sharpPromise.catch(() => null);
40
+ }
41
+ function isSvgElement(content) {
42
+ return (content !== null &&
43
+ typeof content === "object" &&
44
+ !Array.isArray(content) &&
45
+ "name" in content);
46
+ }
47
+ function escapeXmlText(value) {
48
+ return value
49
+ .replaceAll("&", "&amp;")
50
+ .replaceAll("<", "&lt;")
51
+ .replaceAll(">", "&gt;");
52
+ }
53
+ function escapeXmlAttribute(value) {
54
+ return escapeXmlText(value).replaceAll('"', "&quot;");
55
+ }
56
+ function elementToString(el) {
57
+ const attrs = Object.entries(el.attributes ?? {})
58
+ .map(([k, v]) => `${k}="${escapeXmlAttribute(String(v))}"`)
59
+ .join(" ");
60
+ const open = attrs ? `<${el.name} ${attrs}>` : `<${el.name}>`;
61
+ const children = (el.children ?? []).map(elementToString).join("");
62
+ const content = escapeXmlText(el.content ?? "");
63
+ return `${open}${content}${children}</${el.name}>`;
64
+ }
65
+ function svgDocument(content, width, height, viewBox) {
66
+ return `<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="${viewBox}">${content}</svg>`;
67
+ }
68
+ function normalizeContent(content) {
69
+ if (Array.isArray(content)) {
70
+ return content.map((child) => normalizeContent(child)).join("\n");
71
+ }
72
+ if (isSvgElement(content)) {
73
+ return elementToString(content);
74
+ }
75
+ return String(content ?? "");
76
+ }
77
+ export class DocumentLibNode extends BaseNode {
78
+ static nodeType = "lib.svg.Document";
79
+ static retrySafe = true;
80
+ static title = "SVG Document";
81
+ static description = "Combine SVG elements into a complete SVG document.\n svg, document, combine\n\n Use cases:\n - Combine multiple SVG elements into a single document\n - Set document-level properties like viewBox and dimensions\n - Export complete SVG documents";
82
+ static inlineFields = [];
83
+ static inputFields = ["elements"];
84
+ static metadataOutputTypes = {
85
+ output: "svg"
86
+ };
87
+ async process() {
88
+ const content = normalizeContent(this.elements);
89
+ const doc = svgDocument(content, this.width, this.height, this.viewBox);
90
+ return { output: { data: Buffer.from(doc, "utf-8").toString("base64") } };
91
+ }
92
+ }
93
+ __decorate([
94
+ prop({
95
+ type: "list[svg_element]",
96
+ default: [],
97
+ title: "Elements",
98
+ description: "List of SVG elements"
99
+ })
100
+ ], DocumentLibNode.prototype, "elements", void 0);
101
+ __decorate([
102
+ prop({
103
+ type: "int",
104
+ default: 800,
105
+ title: "Width",
106
+ description: "Document width",
107
+ min: 1,
108
+ max: 4096
109
+ })
110
+ ], DocumentLibNode.prototype, "width", void 0);
111
+ __decorate([
112
+ prop({
113
+ type: "int",
114
+ default: 600,
115
+ title: "Height",
116
+ description: "Document height",
117
+ min: 1,
118
+ max: 4096
119
+ })
120
+ ], DocumentLibNode.prototype, "height", void 0);
121
+ __decorate([
122
+ prop({
123
+ type: "str",
124
+ default: "0 0 800 600",
125
+ title: "Viewbox",
126
+ description: "SVG viewBox attribute"
127
+ })
128
+ ], DocumentLibNode.prototype, "viewBox", void 0);
129
+ export class SVGToImageLibNode extends BaseNode {
130
+ static nodeType = "lib.svg.SVGToImage";
131
+ static retrySafe = true;
132
+ // Native `sharp` rasterization — Node only. Overrides the LIB_SVG_NODES
133
+ // tagAsServer tag (per-class platforms always win over the list tagger).
134
+ static platforms = NODE_ONLY;
135
+ static title = "SVG to Image";
136
+ static description = "Create an SVG document and convert it to a raster image in one step.\n svg, document, raster, convert\n\n Use cases:\n - Create and rasterize SVG documents in a single operation\n - Generate image files from SVG elements\n - Convert vector graphics to bitmap format with custom dimensions";
137
+ static inlineFields = [];
138
+ static inputFields = ["elements"];
139
+ static metadataOutputTypes = {
140
+ output: "image"
141
+ };
142
+ async process() {
143
+ const sharp = await loadSharp();
144
+ if (!sharp)
145
+ throw new Error(SHARP_UNAVAILABLE_MESSAGE);
146
+ const content = normalizeContent(this.elements);
147
+ const { width, height, scale } = this;
148
+ const doc = svgDocument(content, width, height, this.viewBox);
149
+ const svgBuffer = Buffer.from(doc, "utf-8");
150
+ const pngBuffer = await sharp(svgBuffer, { density: 72 * scale })
151
+ .resize(width * scale, height * scale)
152
+ .png()
153
+ .toBuffer();
154
+ return {
155
+ output: {
156
+ type: "image",
157
+ data: pngBuffer.toString("base64"),
158
+ mimeType: "image/png",
159
+ width: width * scale,
160
+ height: height * scale
161
+ }
162
+ };
163
+ }
164
+ }
165
+ __decorate([
166
+ prop({
167
+ type: "list[svg_element]",
168
+ default: [],
169
+ title: "Elements",
170
+ description: "List of SVG elements"
171
+ })
172
+ ], SVGToImageLibNode.prototype, "elements", void 0);
173
+ __decorate([
174
+ prop({
175
+ type: "int",
176
+ default: 800,
177
+ title: "Width",
178
+ description: "Document width",
179
+ min: 1,
180
+ max: 4096
181
+ })
182
+ ], SVGToImageLibNode.prototype, "width", void 0);
183
+ __decorate([
184
+ prop({
185
+ type: "int",
186
+ default: 600,
187
+ title: "Height",
188
+ description: "Document height",
189
+ min: 1,
190
+ max: 4096
191
+ })
192
+ ], SVGToImageLibNode.prototype, "height", void 0);
193
+ __decorate([
194
+ prop({
195
+ type: "str",
196
+ default: "0 0 800 600",
197
+ title: "Viewbox",
198
+ description: "SVG viewBox attribute"
199
+ })
200
+ ], SVGToImageLibNode.prototype, "viewBox", void 0);
201
+ __decorate([
202
+ prop({
203
+ type: "int",
204
+ default: 1,
205
+ title: "Scale",
206
+ description: "Scale factor for rasterization",
207
+ min: 1,
208
+ max: 10
209
+ })
210
+ ], SVGToImageLibNode.prototype, "scale", void 0);
211
+ export const LIB_SVG_NODES = tagAsServer([DocumentLibNode, SVGToImageLibNode]);
212
+ //# sourceMappingURL=lib-svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-svg.js","sourceRoot":"","sources":["../../src/nodes/lib-svg.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,8EAA8E;AAC9E,gFAAgF;AAChF,mDAAmD;AACnD,MAAM,SAAS,GAAwB,CAAC,MAAM,CAAC,CAAC;AAEhD,qFAAqF;AACrF,MAAM,yBAAyB,GAC7B,+EAA+E;IAC/E,+EAA+E;IAC/E,sEAAsE,CAAC;AAUzE,sFAAsF;AACtF,SAAS,SAAS,CAAC,GAA0B;IAC3C,OAAO,OAAO,GAAG,KAAK,UAAU,CAAC;AACnC,CAAC;AAED,IAAI,aAAa,GAAmC,IAAI,CAAC;AACzD,KAAK,UAAU,SAAS;IACtB,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,MAAM,OAAO,GAAG,CAAC,KAAK,IAA6B,EAAE;YACnD,MAAM,GAAG,GAAG,MAAM,YAAY,CAAwB,OAAO,CAAC,CAAC;YAC/D,IAAI,CAAC,GAAG;gBAAE,OAAO,IAAI,CAAC;YACtB,IAAI,SAAS,CAAC,GAAG,CAAC;gBAAE,OAAO,GAAG,CAAC;YAC/B,OAAO,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC;QACL,aAAa,GAAG,OAAO,CAAC;QACxB,OA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X,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,sBAAsB;KACpC,CAAC;mDAC6B;AAUvB;IARP,IAAI,CAAC;QACJ,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,gBAAgB;QAC7B,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,IAAI;KACV,CAAC;gDACoB;AAUd;IARP,IAAI,CAAC;QACJ,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,GAAG;QACZ,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,iBAAiB;QAC9B,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,IAAI;KACV,CAAC;iDACqB;AAQf;IANP,IAAI,CAAC;QACJ,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,aAAa;QACtB,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,uBAAuB;KACrC,CAAC;kDACsB;AAUhB;IARP,IAAI,CAAC;QACJ,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,gCAAgC;QAC7C,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;KACR,CAAC;gDACoB;AAyBxB,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,303 @@
1
+ import { BaseNode } from "@nodetool-ai/node-sdk";
2
+ import type { Platform } from "@nodetool-ai/protocol";
3
+ import type { ProcessingContext } from "@nodetool-ai/runtime";
4
+ /** What an `audio` slot delivers: an `AudioRef`, or `{}` before one is wired. */
5
+ type AudioLike = {
6
+ data?: unknown;
7
+ uri?: unknown;
8
+ };
9
+ /**
10
+ * What a `folder` slot delivers: a bare path, a `FolderRef` carrying a `uri`,
11
+ * or a local-folder object carrying a `path`.
12
+ */
13
+ type FolderLike = string | {
14
+ path?: unknown;
15
+ uri?: unknown;
16
+ } | null | undefined;
17
+ /**
18
+ * What a `*_model` slot carries: the provider and model ids naming a
19
+ * provider-backed model, and — on an embedding model — the vector width.
20
+ */
21
+ type ModelSelection = {
22
+ provider?: unknown;
23
+ id?: unknown;
24
+ dimensions?: unknown;
25
+ } | null | undefined;
26
+ /** Output handles AutomaticSpeechRecognitionNode.process() emits. */
27
+ type AutomaticSpeechRecognitionNodeOutputs = {
28
+ text: string;
29
+ output: string;
30
+ };
31
+ export declare class AutomaticSpeechRecognitionNode extends BaseNode {
32
+ static readonly nodeType = "nodetool.text.AutomaticSpeechRecognition";
33
+ static readonly body = "content_card";
34
+ static readonly title = "Automatic Speech Recognition";
35
+ static readonly description = "Transcribe audio to text using automatic speech recognition models.\n audio, speech, recognition, transcription, ASR, whisper";
36
+ static readonly metadataOutputTypes: {
37
+ text: string;
38
+ };
39
+ static readonly inputFields: string[];
40
+ model: ModelSelection;
41
+ audio: AudioLike | null;
42
+ language: string;
43
+ prompt: string;
44
+ temperature: number;
45
+ process(context?: ProcessingContext): Promise<AutomaticSpeechRecognitionNodeOutputs>;
46
+ }
47
+ /** Output handles EmbeddingTextNode.process() emits. */
48
+ type EmbeddingTextNodeOutputs = {
49
+ output: number[];
50
+ };
51
+ export declare class EmbeddingTextNode extends BaseNode {
52
+ static readonly nodeType = "nodetool.text.Embedding";
53
+ static readonly title = "Embedding";
54
+ static readonly description = "Generate vector representations of text using any supported embedding provider (OpenAI, Gemini, Mistral).\n embeddings, similarity, search, clustering, classification, vectors, semantic\n\n Use cases:\n - Semantic search and recommendation\n - Text clustering and classification\n - Anomaly detection\n - Measuring text similarity and diversity";
55
+ static readonly metadataOutputTypes: {
56
+ output: string;
57
+ };
58
+ static readonly inlineFields: never[];
59
+ static readonly inputFields: string[];
60
+ model: ModelSelection;
61
+ input: string;
62
+ chunk_size: number;
63
+ process(context?: ProcessingContext): Promise<EmbeddingTextNodeOutputs>;
64
+ }
65
+ /** Output handles SaveTextFileNode.process() emits. */
66
+ type SaveTextFileNodeOutputs = {
67
+ output: {
68
+ uri: string;
69
+ data: string;
70
+ };
71
+ };
72
+ export declare class SaveTextFileNode extends BaseNode {
73
+ static readonly nodeType = "nodetool.text.SaveTextFile";
74
+ static readonly platforms: readonly Platform[];
75
+ static readonly title = "Save Text File";
76
+ static readonly description = "Saves input text to a file in the assets folder.\n text, save, file";
77
+ static readonly metadataOutputTypes: {
78
+ output: string;
79
+ };
80
+ static readonly inlineFields: string[];
81
+ static readonly inputFields: string[];
82
+ text: string;
83
+ save_to_workspace: boolean;
84
+ folder: string;
85
+ name: string;
86
+ process(context?: ProcessingContext): Promise<SaveTextFileNodeOutputs>;
87
+ }
88
+ /** Output handles SaveTextNode.process() emits. */
89
+ type SaveTextNodeOutputs = {
90
+ output: {
91
+ uri: string;
92
+ data: string;
93
+ };
94
+ };
95
+ export declare class SaveTextNode extends BaseNode {
96
+ static readonly nodeType = "nodetool.text.SaveText";
97
+ static readonly platforms: readonly Platform[];
98
+ static readonly title = "Save Text";
99
+ static readonly description = "Saves input text to a file in the assets folder.\n text, save, file\n\n Use cases:\n - Persisting processed text results\n - Creating text files for downstream nodes or external use\n - Archiving text data within the workflow";
100
+ static readonly metadataOutputTypes: {
101
+ output: string;
102
+ };
103
+ static readonly inputFields: string[];
104
+ text: string;
105
+ folder: FolderLike;
106
+ name: string;
107
+ process(): Promise<SaveTextNodeOutputs>;
108
+ }
109
+ /** Output handles LoadTextFolderNode.genProcess() emits. */
110
+ type LoadTextFolderNodeStreamOutputs = {
111
+ path?: string;
112
+ text?: string;
113
+ texts?: string[];
114
+ paths?: string[];
115
+ };
116
+ /** Output handles LoadTextFolderNode.process() emits. */
117
+ type LoadTextFolderNodeOutputs = {
118
+ text: string;
119
+ path: string;
120
+ texts: string[];
121
+ paths: string[];
122
+ };
123
+ export declare class LoadTextFolderNode extends BaseNode {
124
+ static readonly nodeType = "nodetool.text.LoadTextFolder";
125
+ static readonly platforms: readonly Platform[];
126
+ static readonly title = "Load Text Folder";
127
+ static readonly description = "Load all text files from a folder, optionally including subfolders.\n text, load, folder, files";
128
+ static readonly metadataOutputTypes: {
129
+ text: string;
130
+ path: string;
131
+ texts: string;
132
+ paths: string;
133
+ };
134
+ folder: string;
135
+ include_subdirectories: boolean;
136
+ extensions: string[];
137
+ pattern: string;
138
+ process(): Promise<LoadTextFolderNodeOutputs>;
139
+ _walkFiles(): AsyncGenerator<{
140
+ text: string;
141
+ path: string;
142
+ }>;
143
+ genProcess(): AsyncGenerator<LoadTextFolderNodeStreamOutputs>;
144
+ }
145
+ /**
146
+ * Output handles LoadTextAssetsNode emits. `genProcess` yields them in two
147
+ * waves — one file at a time, then the collected lists — so every handle is
148
+ * optional.
149
+ */
150
+ type LoadTextAssetsNodeOutputs = {
151
+ text?: string;
152
+ name?: string;
153
+ texts?: string[];
154
+ names?: string[];
155
+ };
156
+ export declare class LoadTextAssetsNode extends BaseNode {
157
+ static readonly nodeType = "nodetool.text.LoadTextAssets";
158
+ static readonly title = "Load Text Assets";
159
+ static readonly description = "Load text files from an asset folder.\n load, text, file, import";
160
+ static readonly metadataOutputTypes: {
161
+ text: string;
162
+ name: string;
163
+ texts: string;
164
+ names: string;
165
+ };
166
+ folder: FolderLike;
167
+ process(): Promise<LoadTextAssetsNodeOutputs>;
168
+ genProcess(): AsyncGenerator<LoadTextAssetsNodeOutputs>;
169
+ }
170
+ /** The filters FilterStringNode implements; its enum prop offers exactly these. */
171
+ declare const FILTER_STRING_TYPES: readonly ["contains", "starts_with", "ends_with", "length_greater", "length_less", "exact_length"];
172
+ type FilterStringType = (typeof FILTER_STRING_TYPES)[number];
173
+ /** Output handles FilterStringNode.process() emits. */
174
+ type FilterStringNodeOutputs = {
175
+ output?: string;
176
+ };
177
+ export declare class FilterStringNode extends BaseNode {
178
+ static readonly nodeType = "nodetool.text.FilterString";
179
+ static readonly retrySafe = true;
180
+ static readonly title = "Filter String";
181
+ static readonly description = "Filters a stream of strings based on various criteria.\n filter, strings, text, stream";
182
+ static readonly metadataOutputTypes: {
183
+ output: string;
184
+ };
185
+ static readonly outputCorrelation: {
186
+ output: {
187
+ kind: "forward";
188
+ source: string;
189
+ };
190
+ };
191
+ /** null when the prop names no filter this node implements — nothing matches. */
192
+ private _filterType;
193
+ private _criteria;
194
+ value: string;
195
+ filter_type: FilterStringType;
196
+ criteria: string;
197
+ private readFilterProps;
198
+ initialize(): Promise<void>;
199
+ process(): Promise<FilterStringNodeOutputs>;
200
+ }
201
+ /** Output handles FilterRegexStringNode.process() emits. */
202
+ type FilterRegexStringNodeOutputs = {
203
+ output?: string;
204
+ };
205
+ export declare class FilterRegexStringNode extends BaseNode {
206
+ static readonly nodeType = "nodetool.text.FilterRegexString";
207
+ static readonly retrySafe = true;
208
+ static readonly title = "Filter Regex String";
209
+ static readonly description = "Filters a stream of strings using regular expressions.\n filter, regex, pattern, text, stream";
210
+ static readonly metadataOutputTypes: {
211
+ output: string;
212
+ };
213
+ static readonly outputCorrelation: {
214
+ output: {
215
+ kind: "forward";
216
+ source: string;
217
+ };
218
+ };
219
+ private _pattern;
220
+ private _fullMatch;
221
+ value: string;
222
+ pattern: string;
223
+ full_match: boolean;
224
+ initialize(): Promise<void>;
225
+ process(): Promise<FilterRegexStringNodeOutputs>;
226
+ }
227
+ /** Output handles ConcatTextNode.process() emits. */
228
+ type ConcatTextNodeOutputs = {
229
+ output: string;
230
+ };
231
+ export declare class ConcatTextNode extends BaseNode {
232
+ static readonly nodeType = "nodetool.text.Concat";
233
+ static readonly retrySafe = true;
234
+ static readonly cacheTtl = "forever";
235
+ static readonly body = "content_card";
236
+ static readonly title = "Concat";
237
+ static readonly description = "Concatenates text inputs into a single output. Add inputs dynamically with the \u201Cadd text input\u201D button, or wire a list of strings into a single input.\n +, text, combine, add, concatenate, merge, join, append";
238
+ static readonly metadataOutputTypes: {
239
+ output: string;
240
+ };
241
+ static readonly inlineFields: string[];
242
+ static readonly inputFields: string[];
243
+ static readonly supportsDynamicInputs = true;
244
+ process(): Promise<ConcatTextNodeOutputs>;
245
+ }
246
+ /** Output handles CollectTextNode.process() emits. */
247
+ type CollectTextNodeOutputs = {
248
+ output: string;
249
+ };
250
+ export declare class CollectTextNode extends BaseNode {
251
+ static readonly nodeType = "nodetool.text.Collect";
252
+ static readonly title = "Collect Text";
253
+ static readonly description = "Collects streaming text inputs into a single concatenated string.\n text, collect, stream, aggregate";
254
+ static readonly metadataOutputTypes: {
255
+ output: string;
256
+ };
257
+ private _items;
258
+ input_item: string;
259
+ separator: string;
260
+ initialize(): Promise<void>;
261
+ process(): Promise<CollectTextNodeOutputs>;
262
+ }
263
+ /**
264
+ * Output handles PromptNode.process() emits: the rendered text on `output`,
265
+ * plus one handle per dynamic input carrying its raw wire value. The set is
266
+ * open (`supportsDynamicOutputs`), so the contract is the SDK's own output bag
267
+ * rather than a fixed list of handles.
268
+ */
269
+ type PromptNodeOutputs = Awaited<ReturnType<BaseNode["process"]>>;
270
+ export declare class PromptNode extends BaseNode {
271
+ static readonly nodeType = "nodetool.text.Prompt";
272
+ static readonly cacheTtl = "forever";
273
+ static readonly title = "Prompt";
274
+ static readonly description = "Compose a prompt string with named variables. Add variables via the Add Variable button; reference them in the prompt as {{ variable }} (or {variable}). Supports filters: {{ var|upper }}, {{ var|lower }}, {{ var|capitalize }}, {{ var|title }}, {{ var|trim }}, {{ var|truncate(n) }}, {{ var|default(val) }}.\n prompt, text, template, variable, llm, agent";
275
+ static readonly metadataOutputTypes: {
276
+ output: string;
277
+ };
278
+ static readonly supportsDynamicInputs = true;
279
+ static readonly supportsDynamicOutputs = true;
280
+ static readonly inputFields: string[];
281
+ prompt: string;
282
+ process(context?: ProcessingContext): Promise<PromptNodeOutputs>;
283
+ }
284
+ /** Output handles TemplateTextNode.process() emits. */
285
+ type TemplateTextNodeOutputs = {
286
+ output: string;
287
+ };
288
+ export declare class TemplateTextNode extends BaseNode {
289
+ static readonly nodeType = "nodetool.text.Template";
290
+ static readonly retrySafe = true;
291
+ static readonly cacheTtl = "forever";
292
+ static readonly title = "Template";
293
+ static readonly description = "Uses template syntax to format strings with variables. Supports {{ variable }} and {variable} patterns.\n text, template, formatting, format, combine, concatenate, variable, replace\n\n Use cases:\n - Generating personalized messages\n - Creating parameterized queries\n - Formatting text with variable inputs";
294
+ static readonly metadataOutputTypes: {
295
+ output: string;
296
+ };
297
+ static readonly supportsDynamicInputs = true;
298
+ string: string;
299
+ process(): Promise<TemplateTextNodeOutputs>;
300
+ }
301
+ export declare const TEXT_EXTRA_NODES: (typeof AutomaticSpeechRecognitionNode | typeof EmbeddingTextNode | typeof SaveTextFileNode | typeof SaveTextNode | typeof LoadTextFolderNode | typeof LoadTextAssetsNode | typeof FilterStringNode | typeof FilterRegexStringNode | typeof ConcatTextNode | typeof CollectTextNode | typeof PromptNode | typeof TemplateTextNode)[];
302
+ export {};
303
+ //# sourceMappingURL=text-extra.d.ts.map