@nodetool-ai/node-sdk 0.7.0-rc.23 → 0.8.2
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 +34 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/base-node.d.ts +285 -14
- package/dist/base-node.d.ts.map +1 -1
- package/dist/base-node.js +359 -49
- package/dist/base-node.js.map +1 -1
- package/dist/class-name-to-title.d.ts +26 -0
- package/dist/class-name-to-title.d.ts.map +1 -0
- package/dist/class-name-to-title.js +59 -0
- package/dist/class-name-to-title.js.map +1 -0
- package/dist/code-analysis.d.ts +234 -0
- package/dist/code-analysis.d.ts.map +1 -0
- package/dist/code-analysis.js +919 -0
- package/dist/code-analysis.js.map +1 -0
- package/dist/code-body.d.ts +61 -0
- package/dist/code-body.d.ts.map +1 -0
- package/dist/code-body.js +288 -0
- package/dist/code-body.js.map +1 -0
- package/dist/code-node-validation.d.ts +67 -0
- package/dist/code-node-validation.d.ts.map +1 -0
- package/dist/code-node-validation.js +540 -0
- package/dist/code-node-validation.js.map +1 -0
- package/dist/content-card.d.ts +30 -0
- package/dist/content-card.d.ts.map +1 -0
- package/dist/content-card.js +68 -0
- package/dist/content-card.js.map +1 -0
- package/dist/correlation-validation.d.ts +19 -0
- package/dist/correlation-validation.d.ts.map +1 -0
- package/dist/correlation-validation.js +101 -0
- package/dist/correlation-validation.js.map +1 -0
- package/dist/cost-estimate.d.ts +244 -0
- package/dist/cost-estimate.d.ts.map +1 -0
- package/dist/cost-estimate.js +637 -0
- package/dist/cost-estimate.js.map +1 -0
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +4 -1
- package/dist/decorators.js.map +1 -1
- package/dist/docs/nodes.d.ts.map +1 -1
- package/dist/docs/nodes.js +3 -2
- package/dist/docs/nodes.js.map +1 -1
- package/dist/docs/overview.d.ts.map +1 -1
- package/dist/docs/overview.js +4 -3
- package/dist/docs/overview.js.map +1 -1
- package/dist/docs/workflows.d.ts.map +1 -1
- package/dist/docs/workflows.js +10 -9
- package/dist/docs/workflows.js.map +1 -1
- package/dist/field-classification.d.ts +31 -0
- package/dist/field-classification.d.ts.map +1 -0
- package/dist/field-classification.js +58 -0
- package/dist/field-classification.js.map +1 -0
- package/dist/graph-validation.d.ts +239 -0
- package/dist/graph-validation.d.ts.map +1 -0
- package/dist/graph-validation.js +1174 -0
- package/dist/graph-validation.js.map +1 -0
- package/dist/index.d.ts +27 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/js-script-link.d.ts +53 -0
- package/dist/js-script-link.d.ts.map +1 -0
- package/dist/js-script-link.js +58 -0
- package/dist/js-script-link.js.map +1 -0
- package/dist/js-script-materialize.d.ts +52 -0
- package/dist/js-script-materialize.d.ts.map +1 -0
- package/dist/js-script-materialize.js +24 -0
- package/dist/js-script-materialize.js.map +1 -0
- package/dist/manifest-node-values.d.ts +106 -0
- package/dist/manifest-node-values.d.ts.map +1 -0
- package/dist/manifest-node-values.js +195 -0
- package/dist/manifest-node-values.js.map +1 -0
- package/dist/metadata.d.ts +75 -3
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +132 -49
- package/dist/metadata.js.map +1 -1
- package/dist/node-metadata.d.ts.map +1 -1
- package/dist/node-metadata.js +61 -56
- package/dist/node-metadata.js.map +1 -1
- package/dist/node-type-inventory.d.ts +51 -0
- package/dist/node-type-inventory.d.ts.map +1 -0
- package/dist/node-type-inventory.js +121 -0
- package/dist/node-type-inventory.js.map +1 -0
- package/dist/nodes/test-nodes.d.ts +77 -30
- package/dist/nodes/test-nodes.d.ts.map +1 -1
- package/dist/nodes/test-nodes.js +2 -34
- package/dist/nodes/test-nodes.js.map +1 -1
- package/dist/pack-loader.d.ts +202 -0
- package/dist/pack-loader.d.ts.map +1 -0
- package/dist/pack-loader.js +529 -0
- package/dist/pack-loader.js.map +1 -0
- package/dist/port-types.d.ts +15 -0
- package/dist/port-types.d.ts.map +1 -0
- package/dist/port-types.js +72 -0
- package/dist/port-types.js.map +1 -0
- package/dist/pricing-bundle.d.ts +83 -0
- package/dist/pricing-bundle.d.ts.map +1 -0
- package/dist/pricing-bundle.js +82 -0
- package/dist/pricing-bundle.js.map +1 -0
- package/dist/pricing-params.d.ts +59 -0
- package/dist/pricing-params.d.ts.map +1 -0
- package/dist/pricing-params.js +282 -0
- package/dist/pricing-params.js.map +1 -0
- package/dist/python-package-scan.d.ts +8 -0
- package/dist/python-package-scan.d.ts.map +1 -1
- package/dist/python-package-scan.js +21 -8
- package/dist/python-package-scan.js.map +1 -1
- package/dist/registry.d.ts +105 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +403 -30
- package/dist/registry.js.map +1 -1
- package/dist/sandbox-bridge-packs.d.ts +39 -0
- package/dist/sandbox-bridge-packs.d.ts.map +1 -0
- package/dist/sandbox-bridge-packs.js +249 -0
- package/dist/sandbox-bridge-packs.js.map +1 -0
- package/dist/sandbox-catalog-host.d.ts +31 -0
- package/dist/sandbox-catalog-host.d.ts.map +1 -0
- package/dist/sandbox-catalog-host.js +78 -0
- package/dist/sandbox-catalog-host.js.map +1 -0
- package/dist/sandbox-module-catalog.d.ts +14 -0
- package/dist/sandbox-module-catalog.d.ts.map +1 -0
- package/dist/sandbox-module-catalog.js +402 -0
- package/dist/sandbox-module-catalog.js.map +1 -0
- package/dist/sandbox-npm-artifacts.d.ts +56 -0
- package/dist/sandbox-npm-artifacts.d.ts.map +1 -0
- package/dist/sandbox-npm-artifacts.js +17 -0
- package/dist/sandbox-npm-artifacts.js.map +1 -0
- package/dist/sandbox-pack-discovery.d.ts +93 -0
- package/dist/sandbox-pack-discovery.d.ts.map +1 -0
- package/dist/sandbox-pack-discovery.js +807 -0
- package/dist/sandbox-pack-discovery.js.map +1 -0
- package/dist/search.d.ts +29 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +136 -9
- package/dist/search.js.map +1 -1
- package/dist/type-compat.d.ts +36 -0
- package/dist/type-compat.d.ts.map +1 -0
- package/dist/type-compat.js +98 -0
- package/dist/type-compat.js.map +1 -0
- package/dist/type-predicates.d.ts +25 -0
- package/dist/type-predicates.d.ts.map +1 -0
- package/dist/type-predicates.js +31 -0
- package/dist/type-predicates.js.map +1 -0
- package/dist/validation.d.ts +18 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +70 -11
- package/dist/validation.js.map +1 -1
- package/dist/workflow-document-tools.d.ts +35 -0
- package/dist/workflow-document-tools.d.ts.map +1 -0
- package/dist/workflow-document-tools.js +402 -0
- package/dist/workflow-document-tools.js.map +1 -0
- package/dist/workflow-interface.d.ts +62 -0
- package/dist/workflow-interface.d.ts.map +1 -0
- package/dist/workflow-interface.js +351 -0
- package/dist/workflow-interface.js.map +1 -0
- package/package.json +67 -10
- package/dist/package-registry-client.d.ts +0 -12
- package/dist/package-registry-client.d.ts.map +0 -1
- package/dist/package-registry-client.js +0 -40
- package/dist/package-registry-client.js.map +0 -1
package/dist/base-node.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { getDeclaredPropertiesForClass } from "./decorators.js";
|
|
2
|
+
import { slotTypeToString } from "./type-compat.js";
|
|
3
|
+
import { isObjectLike, isRecord, isString } from "./type-predicates.js";
|
|
2
4
|
import { validateNodeProperties } from "./validation.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
export function coerceToDeclaredType(value, declaredType) {
|
|
6
|
+
// A URI string standing in for an asset ref. Callers reach for the plain
|
|
7
|
+
// string — `--params '{"clip":"file:///clip.mp4"}'`, a REST body, a webhook
|
|
8
|
+
// payload — and without this the ref stays empty, the node reads no bytes,
|
|
9
|
+
// and the run reports success carrying a zero-valued result. Only strings
|
|
10
|
+
// with a scheme convert, so a prompt or a caption is never mistaken for a
|
|
11
|
+
// location.
|
|
12
|
+
if (isString(value) &&
|
|
13
|
+
ASSET_REF_TYPES.has(declaredType) &&
|
|
14
|
+
URI_WITH_SCHEME.test(value)) {
|
|
15
|
+
return { type: declaredType, uri: value };
|
|
16
|
+
}
|
|
13
17
|
if (value !== null &&
|
|
14
18
|
value !== undefined &&
|
|
15
19
|
!Array.isArray(value) &&
|
|
@@ -18,29 +22,229 @@ function coerceToDeclaredType(value, declaredType) {
|
|
|
18
22
|
}
|
|
19
23
|
return value;
|
|
20
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Declared types whose runtime value is an asset reference — a tagged object
|
|
27
|
+
* carrying `uri`/`asset_id`/`data` rather than a bare scalar.
|
|
28
|
+
*/
|
|
29
|
+
const ASSET_REF_TYPES = new Set([
|
|
30
|
+
"image",
|
|
31
|
+
"video",
|
|
32
|
+
"audio",
|
|
33
|
+
"document",
|
|
34
|
+
"folder",
|
|
35
|
+
"model_3d"
|
|
36
|
+
]);
|
|
37
|
+
/** `file://`, `https://`, `asset://`, `data:` and the like. */
|
|
38
|
+
const URI_WITH_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
39
|
+
/**
|
|
40
|
+
* Coerce a value against a typed dynamic slot's declared type. Slots with no
|
|
41
|
+
* resolvable type string pass the value through untouched (legacy `any` slot).
|
|
42
|
+
*/
|
|
43
|
+
export function coerceToSlotType(value, slot) {
|
|
44
|
+
const declaredType = slotTypeToString(slot);
|
|
45
|
+
return declaredType ? coerceToDeclaredType(value, declaredType) : value;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Read the `_dynamic_inputs` framework property injected by the registry into
|
|
49
|
+
* a slot-declaration map. Malformed entries are dropped rather than thrown on:
|
|
50
|
+
* the map is user/graph data and a bad slot must never break node construction.
|
|
51
|
+
*/
|
|
52
|
+
function parseDynamicSlots(raw) {
|
|
53
|
+
if (!isRecord(raw)) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const slots = new Map();
|
|
57
|
+
for (const [name, meta] of Object.entries(raw)) {
|
|
58
|
+
if (!isRecord(meta)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
slots.set(name, meta);
|
|
62
|
+
}
|
|
63
|
+
return slots;
|
|
64
|
+
}
|
|
65
|
+
export const hasStreamingOutput = (cls) => {
|
|
66
|
+
const proto = cls.prototype;
|
|
67
|
+
if (
|
|
68
|
+
// Stryker disable next-line OptionalChaining: a class constructor always has a .prototype, so proto is never nullish here (equivalent).
|
|
69
|
+
!!proto?.genProcess &&
|
|
70
|
+
proto.genProcess !== BaseNode.prototype.genProcess) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
const corr = cls.outputCorrelation;
|
|
74
|
+
if (corr) {
|
|
75
|
+
for (const c of Object.values(corr)) {
|
|
76
|
+
if (c.kind === "forward" || c.kind === "iteration" || c.kind === "chunk") {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
};
|
|
21
83
|
export class BaseNode {
|
|
22
84
|
static nodeType = "";
|
|
23
85
|
static title = "";
|
|
24
86
|
static description = "";
|
|
25
87
|
static layout = undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Node body renderer key. Set to "content_card" to render a media/text-forward
|
|
90
|
+
* content card instead of the generic input/output body. Generator packages
|
|
91
|
+
* typically derive this from the primary output type on a shared base class
|
|
92
|
+
* (mirrors the Python `_body`/`body()` convention).
|
|
93
|
+
*/
|
|
94
|
+
static body = undefined;
|
|
26
95
|
static recommendedModels = undefined;
|
|
27
|
-
static
|
|
96
|
+
static inlineFields = undefined;
|
|
97
|
+
static inputFields = undefined;
|
|
28
98
|
static requiredSettings = undefined;
|
|
29
99
|
static requiredRuntimes = undefined;
|
|
30
100
|
static isStreamingInput = false;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Decide {@link isStreamingInput} per node instance, from its saved
|
|
103
|
+
* properties. Unset on every node whose mode is a property of the type;
|
|
104
|
+
* declared only where one type covers both modes — the Code node, where the
|
|
105
|
+
* body decides (`usesStreamInputContract(node.properties.code)`).
|
|
106
|
+
*
|
|
107
|
+
* Both hydration paths consult it ahead of the static
|
|
108
|
+
* (`hydrateGraphNodeFlags`, and `Graph.loadFromDict` via the resolver's
|
|
109
|
+
* `resolveInstanceFlags`), and re-read it on every hydration, so editing the
|
|
110
|
+
* body flips the mode with no saved flag involved.
|
|
111
|
+
*/
|
|
112
|
+
static resolveStreamingInput = undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Derive dynamic input and output slots from a node's saved properties.
|
|
115
|
+
* Unset on nodes whose slots are declared only by the editor or the author;
|
|
116
|
+
* declared where the slots follow from a property, as on the Comfy runners,
|
|
117
|
+
* whose Save nodes in `workflow` become output slots.
|
|
118
|
+
*
|
|
119
|
+
* Both hydration paths merge the result under the slots saved on the node
|
|
120
|
+
* (`hydrateGraphNodeFlags`, and `Graph.loadFromDict` via the resolver's
|
|
121
|
+
* `resolveInstanceSlots`), so a graph built over the API, where nothing
|
|
122
|
+
* declared the slots, can still wire them.
|
|
123
|
+
*/
|
|
124
|
+
static resolveDynamicSlots = undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Marks a trigger node. Triggers compile to `trigger_registrations` on
|
|
127
|
+
* workflow activation, and when a run starts because of a delivered event
|
|
128
|
+
* (`RunJobRequest.trigger_event` targeting this node) the kernel calls
|
|
129
|
+
* {@link emitTriggerEvent} instead of the live-listening `genProcess`
|
|
130
|
+
* loop. Runs without a trigger event keep today's streaming behavior
|
|
131
|
+
* (in-editor live test). See
|
|
132
|
+
* docs/superpowers/specs/2026-07-10-trigger-wakeup-redesign.md.
|
|
133
|
+
*/
|
|
134
|
+
static isTrigger = false;
|
|
135
|
+
/**
|
|
136
|
+
* Emit output_update for this node's handles even when they are connected
|
|
137
|
+
* onward. The runner suppresses output_update for connected handles by
|
|
138
|
+
* default; nodes whose updates feed a UI surface regardless of patching
|
|
139
|
+
* (e.g. the realtime audio monitor) opt in.
|
|
140
|
+
*/
|
|
141
|
+
static alwaysEmitOutputUpdates = false;
|
|
142
|
+
static inputMode = undefined;
|
|
143
|
+
static outputCorrelation = undefined;
|
|
144
|
+
static supportsDynamicInputs = false;
|
|
145
|
+
/**
|
|
146
|
+
* Restricts the types a user may pick when declaring a dynamic input slot on
|
|
147
|
+
* this node (see `Node.dynamic_inputs`). Unset means the full type palette.
|
|
148
|
+
* Emitted as `allowed_dynamic_slot_types` in node metadata.
|
|
149
|
+
*/
|
|
150
|
+
static allowedDynamicSlotTypes = undefined;
|
|
34
151
|
static isControlled = false;
|
|
35
|
-
|
|
152
|
+
/**
|
|
153
|
+
* `Zip` and `Cross` set this to true so static correlation analysis allows
|
|
154
|
+
* incomparable input scopes on these nodes only. See
|
|
155
|
+
* docs/correlation-design.md §7.
|
|
156
|
+
*/
|
|
157
|
+
static isJoinNode = false;
|
|
36
158
|
static supportsDynamicOutputs = undefined;
|
|
37
159
|
static autoSaveAsset = false;
|
|
160
|
+
/**
|
|
161
|
+
* Whether re-running this node with identical inputs is safe. An opt-in:
|
|
162
|
+
* unknown means unsafe. Cost tracking cannot see external writes — a
|
|
163
|
+
* Publish/Upsert/Notify node can complete its side effect and then throw,
|
|
164
|
+
* recording nothing — so a node nobody classified loses a safe retry rather
|
|
165
|
+
* than gaining an unsafe one. The workflow supervisor offers `retry` only
|
|
166
|
+
* for a node that declares this. See docs/workflow-supervisor-design.md §5.3.
|
|
167
|
+
*/
|
|
168
|
+
static retrySafe = false;
|
|
169
|
+
/**
|
|
170
|
+
* List properties whose static items are kept when an edge feeds the same
|
|
171
|
+
* handle. The node receives the connected items followed by its own static
|
|
172
|
+
* items, instead of the edge value replacing them. Used by the list
|
|
173
|
+
* constants, so a connected Image List adds its own images to the incoming
|
|
174
|
+
* ones.
|
|
175
|
+
*/
|
|
176
|
+
static appendStaticInputs = [];
|
|
177
|
+
/**
|
|
178
|
+
* Per-type cache lifetime for partial runs ("Run Node", "Run from here", "Run
|
|
179
|
+
* selected"). Only consulted for Computed nodes (Constants are always live;
|
|
180
|
+
* Generatives reuse generation history). `"forever"` = pure deterministic
|
|
181
|
+
* (reuse while inputs match); a finite number = seconds the cached result
|
|
182
|
+
* stays fresh before re-running (time-sensitive, e.g. a web fetch);
|
|
183
|
+
* unset / `0` = never reuse. `"forever"` is a string sentinel — never
|
|
184
|
+
* `Infinity`, which JSON-serializes to `null` and would silently flip a pure
|
|
185
|
+
* node to never-cache. See docs/superpowers/specs/2026-06-27-run-subgraph-caching.md §4.
|
|
186
|
+
*/
|
|
187
|
+
static cacheTtl = undefined;
|
|
188
|
+
/**
|
|
189
|
+
* What running this node does to the world, which decides whether a reactive
|
|
190
|
+
* run (a slider drag, an input change in a mini app) may execute it without
|
|
191
|
+
* an explicit action:
|
|
192
|
+
* "pure" — output depends only on inputs; safe to re-run at any rate
|
|
193
|
+
* "read" — reads external state but changes nothing
|
|
194
|
+
* "write" — mutates state the user can observe (a file, a document)
|
|
195
|
+
* "external" — leaves the system (sends mail, calls a paid API)
|
|
196
|
+
* Reactive runs traverse "pure" and "read" only. The default is the
|
|
197
|
+
* conservative "external", so a node nobody has classified never fires off a
|
|
198
|
+
* slider drag. `cacheTtl: "forever"` implies "pure".
|
|
199
|
+
*/
|
|
200
|
+
static effect = "external";
|
|
201
|
+
/**
|
|
202
|
+
* Names the output slot that carries this node's "primary" generation — the
|
|
203
|
+
* value persisted as its saved generation and previewed by the content card.
|
|
204
|
+
* Unset falls back to the first declared output. See `auto_save_asset` and the
|
|
205
|
+
* autosave path in the websocket runner.
|
|
206
|
+
*/
|
|
207
|
+
static primaryOutput = undefined;
|
|
38
208
|
static modelPacks = undefined;
|
|
209
|
+
/**
|
|
210
|
+
* Deployment platforms this node supports. Defaults to ["node"]; nodes
|
|
211
|
+
* that work in V8 isolates should claim "workers" and/or "edge"
|
|
212
|
+
* explicitly. See `@nodetool-ai/protocol`'s Platform type.
|
|
213
|
+
*/
|
|
214
|
+
static platforms = undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Requires a WebGPU device in the browser (set via `tagAsBrowserGpu`). The
|
|
217
|
+
* in-browser runner routes graphs with these nodes to the server when
|
|
218
|
+
* `navigator.gpu` is unavailable. Unset/undefined means no GPU requirement.
|
|
219
|
+
*/
|
|
220
|
+
static requiresGpu = undefined;
|
|
221
|
+
static deprecated = false;
|
|
222
|
+
/**
|
|
223
|
+
* Hidden from node-discovery UIs but still registered/runnable (see the
|
|
224
|
+
* `hidden` field on NodeClass). Unset/false means normally discoverable.
|
|
225
|
+
*/
|
|
226
|
+
static hidden = undefined;
|
|
227
|
+
static replacedBy = undefined;
|
|
39
228
|
static metadataOutputTypes = undefined;
|
|
40
229
|
static outputTypes = {};
|
|
41
230
|
__node_id = "";
|
|
42
231
|
__node_name = "";
|
|
43
232
|
dynamicProps = new Map();
|
|
233
|
+
/**
|
|
234
|
+
* Typed declarations for the dynamic slots of this node instance, injected by
|
|
235
|
+
* the registry as the `_dynamic_inputs` framework property. `dynamicProps`
|
|
236
|
+
* holds the values; this holds the types. A slot missing here is an untyped
|
|
237
|
+
* legacy slot and behaves exactly as before typed slots existed.
|
|
238
|
+
*/
|
|
239
|
+
dynamicSlotMeta = new Map();
|
|
240
|
+
/**
|
|
241
|
+
* Framework-injected internals (resolved `_secrets`, the `_control_context`,
|
|
242
|
+
* …). Kept separate from `dynamicProps` so reserved `_`-prefixed values never
|
|
243
|
+
* leak into user-facing dynamic-input iteration (prompt template vars, API
|
|
244
|
+
* args) or into `serialize()`. Read/written through getDynamic/setDynamic,
|
|
245
|
+
* which route `_`-prefixed keys here.
|
|
246
|
+
*/
|
|
247
|
+
_internalProps = new Map();
|
|
44
248
|
constructor(properties = {}) {
|
|
45
249
|
this.assign(properties);
|
|
46
250
|
}
|
|
@@ -65,11 +269,26 @@ export class BaseNode {
|
|
|
65
269
|
* need to: declarative `@prop` metadata is enough.
|
|
66
270
|
*/
|
|
67
271
|
static validateProperties(properties, options = {}) {
|
|
68
|
-
const
|
|
69
|
-
|
|
272
|
+
const declared = this.getDeclaredProperties();
|
|
273
|
+
const dynamicSlots = options.dynamicSlots;
|
|
274
|
+
let dynamicValues = options.dynamicValues;
|
|
275
|
+
if (dynamicSlots && !dynamicValues) {
|
|
276
|
+
// No explicit value bag — dynamic values ride along in `properties`.
|
|
277
|
+
const declaredNames = new Set(declared.map((p) => p.name));
|
|
278
|
+
const collected = {};
|
|
279
|
+
for (const key of Object.keys(dynamicSlots)) {
|
|
280
|
+
if (declaredNames.has(key))
|
|
281
|
+
continue;
|
|
282
|
+
collected[key] = properties[key];
|
|
283
|
+
}
|
|
284
|
+
dynamicValues = collected;
|
|
285
|
+
}
|
|
286
|
+
return validateNodeProperties(declared, properties, {
|
|
70
287
|
connectedHandles: options.connectedHandles,
|
|
71
288
|
nodeId: options.nodeId,
|
|
72
|
-
nodeType:
|
|
289
|
+
nodeType: this.nodeType,
|
|
290
|
+
dynamicSlots,
|
|
291
|
+
dynamicValues
|
|
73
292
|
});
|
|
74
293
|
}
|
|
75
294
|
assign(properties) {
|
|
@@ -83,7 +302,10 @@ export class BaseNode {
|
|
|
83
302
|
}
|
|
84
303
|
const declaredNames = new Set(declared.map((p) => p.name));
|
|
85
304
|
for (const { name, options } of declared) {
|
|
86
|
-
if (Object.prototype.hasOwnProperty.call(properties, name)
|
|
305
|
+
if (Object.prototype.hasOwnProperty.call(properties, name) &&
|
|
306
|
+
// An explicit `undefined` means "absent", same as omitting the key —
|
|
307
|
+
// it must not suppress the declared default below.
|
|
308
|
+
properties[name] !== undefined) {
|
|
87
309
|
// Explicit value provided — use it (auto-wrap scalars into list[T]).
|
|
88
310
|
this[name] = coerceToDeclaredType(properties[name], options.type);
|
|
89
311
|
}
|
|
@@ -93,17 +315,34 @@ export class BaseNode {
|
|
|
93
315
|
// Deep-copy mutable defaults so instances don't share references.
|
|
94
316
|
const def = options.default;
|
|
95
317
|
this[name] =
|
|
96
|
-
|
|
318
|
+
// Stryker disable next-line ConditionalExpression,LogicalOperator: the guard only matters for object defaults (covered by the deep-copy test); for scalars the JSON round-trip is identity, so every variant still deep-copies objects and passes scalars through (equivalent).
|
|
319
|
+
isObjectLike(def)
|
|
97
320
|
? JSON.parse(JSON.stringify(def))
|
|
98
321
|
: def;
|
|
99
322
|
}
|
|
100
323
|
}
|
|
101
|
-
// For dynamic nodes, store undeclared properties
|
|
102
|
-
|
|
103
|
-
|
|
324
|
+
// For dynamic nodes, store undeclared properties. Reserved, framework-
|
|
325
|
+
// injected keys (anything `_`-prefixed, e.g. `_secrets`, `_control_context`)
|
|
326
|
+
// are routed to `_internalProps` instead of `dynamicProps` so they never
|
|
327
|
+
// leak into user-facing dynamic-input iteration or `serialize()`.
|
|
328
|
+
if (ctor.supportsDynamicInputs) {
|
|
329
|
+
// Slot declarations arrive before the values are stored so the values can
|
|
330
|
+
// be coerced against their declared type in the same pass.
|
|
331
|
+
const slots = parseDynamicSlots(properties._dynamic_inputs);
|
|
332
|
+
if (slots) {
|
|
333
|
+
this.dynamicSlotMeta = slots;
|
|
334
|
+
}
|
|
104
335
|
for (const [key, value] of Object.entries(properties)) {
|
|
105
|
-
if (
|
|
106
|
-
|
|
336
|
+
if (declaredNames.has(key))
|
|
337
|
+
continue;
|
|
338
|
+
// Stryker disable next-line ConditionalExpression,LogicalOperator,StringLiteral: __node_id/__node_name are "_"-prefixed, so removing this explicit skip routes them to _internalProps anyway — never into dynamicProps or serialize() (equivalent).
|
|
339
|
+
if (key === "__node_id" || key === "__node_name")
|
|
340
|
+
continue;
|
|
341
|
+
if (key.startsWith("_")) {
|
|
342
|
+
this._internalProps.set(key, value);
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
this.dynamicProps.set(key, coerceToSlotType(value, this.dynamicSlotMeta.get(key)));
|
|
107
346
|
}
|
|
108
347
|
}
|
|
109
348
|
}
|
|
@@ -115,7 +354,7 @@ export class BaseNode {
|
|
|
115
354
|
result[name] = this[name];
|
|
116
355
|
}
|
|
117
356
|
// Include dynamic properties so round-trip serialization is lossless
|
|
118
|
-
if (ctor.
|
|
357
|
+
if (ctor.supportsDynamicInputs) {
|
|
119
358
|
for (const [key, value] of this.dynamicProps) {
|
|
120
359
|
result[key] = value;
|
|
121
360
|
}
|
|
@@ -126,10 +365,20 @@ export class BaseNode {
|
|
|
126
365
|
this.assign(data);
|
|
127
366
|
}
|
|
128
367
|
setDynamic(key, value) {
|
|
129
|
-
|
|
368
|
+
if (key.startsWith("_")) {
|
|
369
|
+
this._internalProps.set(key, value);
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
this.dynamicProps.set(key, coerceToSlotType(value, this.dynamicSlotMeta.get(key)));
|
|
373
|
+
}
|
|
130
374
|
}
|
|
131
375
|
getDynamic(key) {
|
|
132
|
-
|
|
376
|
+
const store = key.startsWith("_") ? this._internalProps : this.dynamicProps;
|
|
377
|
+
return store.get(key);
|
|
378
|
+
}
|
|
379
|
+
/** Declared types of this instance's dynamic slots, keyed by slot name. */
|
|
380
|
+
getDynamicSlots() {
|
|
381
|
+
return this.dynamicSlotMeta;
|
|
133
382
|
}
|
|
134
383
|
async initialize() { }
|
|
135
384
|
async preProcess() { }
|
|
@@ -145,25 +394,54 @@ export class BaseNode {
|
|
|
145
394
|
const ctor = this.constructor;
|
|
146
395
|
return ctor.validateProperties(this.serialize(), {
|
|
147
396
|
connectedHandles: options.connectedHandles,
|
|
148
|
-
nodeId: options.nodeId ?? (this.__node_id || undefined)
|
|
397
|
+
nodeId: options.nodeId ?? (this.__node_id || undefined),
|
|
398
|
+
dynamicSlots: options.dynamicSlots ??
|
|
399
|
+
(this.dynamicSlotMeta.size > 0
|
|
400
|
+
? Object.fromEntries(this.dynamicSlotMeta)
|
|
401
|
+
: undefined),
|
|
402
|
+
dynamicValues: options.dynamicValues ?? Object.fromEntries(this.dynamicProps)
|
|
149
403
|
});
|
|
150
404
|
}
|
|
151
405
|
async *genProcess(context) {
|
|
152
406
|
yield await this.process(context);
|
|
153
407
|
}
|
|
154
408
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
409
|
+
* Trigger entry point — called instead of `genProcess()` when the run
|
|
410
|
+
* carries a `trigger_event` for this node (see the `isTrigger` static).
|
|
411
|
+
* The default maps the keys of an object payload onto this node's
|
|
412
|
+
* declared output slots and drops everything else. Trigger subclasses
|
|
413
|
+
* override this to shape their adapter payloads (webhook envelope,
|
|
414
|
+
* synthesized tick, file-watch event) onto their specific slots.
|
|
157
415
|
*/
|
|
158
|
-
async
|
|
416
|
+
async emitTriggerEvent(event, outputs) {
|
|
417
|
+
const ctor = this.constructor;
|
|
418
|
+
const declared = ctor.metadataOutputTypes ?? ctor.getDeclaredOutputs();
|
|
419
|
+
const payload = event.payload;
|
|
420
|
+
if (!isRecord(payload)) {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
424
|
+
if (key in declared) {
|
|
425
|
+
await outputs.emit(key, value);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Resolve requiredSettings from the context's secret store. Returns an
|
|
431
|
+
* empty record when nothing is required or nothing resolves.
|
|
432
|
+
*/
|
|
433
|
+
async _resolveSecrets(context) {
|
|
159
434
|
const ctor = this.constructor;
|
|
160
435
|
const required = ctor.requiredSettings;
|
|
436
|
+
// Stryker disable next-line EqualityOperator,ConditionalExpression: the `required.length === 0` arm is a redundant fast-path — an empty requiredSettings list runs the loop zero times and returns an empty map, so mutating this comparison is equivalent (the `!required` arm is covered by the no-requiredSettings test).
|
|
161
437
|
if (!required || required.length === 0) {
|
|
162
|
-
return
|
|
438
|
+
return {};
|
|
163
439
|
}
|
|
164
440
|
if (!context) {
|
|
165
|
-
console.warn(
|
|
166
|
-
|
|
441
|
+
console.warn(
|
|
442
|
+
// Stryker disable next-line StringLiteral: operator diagnostic text only.
|
|
443
|
+
`[_resolveSecrets] No context for ${ctor.nodeType}, required: ${required.join(", ")}`);
|
|
444
|
+
return {};
|
|
167
445
|
}
|
|
168
446
|
const secrets = {};
|
|
169
447
|
for (const key of required) {
|
|
@@ -172,9 +450,20 @@ export class BaseNode {
|
|
|
172
450
|
secrets[key] = value;
|
|
173
451
|
}
|
|
174
452
|
else {
|
|
175
|
-
console.warn(
|
|
453
|
+
console.warn(
|
|
454
|
+
// Stryker disable next-line StringLiteral: operator diagnostic text only.
|
|
455
|
+
`[_resolveSecrets] Secret "${key}" not found for ${ctor.nodeType}`);
|
|
176
456
|
}
|
|
177
457
|
}
|
|
458
|
+
return secrets;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Resolve requiredSettings from the context's secret store and inject
|
|
462
|
+
* them as `inputs._secrets` so node process() can access API keys.
|
|
463
|
+
*/
|
|
464
|
+
async _injectSecrets(inputs, context) {
|
|
465
|
+
const secrets = await this._resolveSecrets(context);
|
|
466
|
+
// Stryker disable next-line ConditionalExpression: short-circuits an empty secrets map; emitting `_secrets: {}` instead is indistinguishable through the _secrets getter, which coalesces undefined and {} alike (equivalent).
|
|
178
467
|
if (Object.keys(secrets).length === 0)
|
|
179
468
|
return inputs;
|
|
180
469
|
return {
|
|
@@ -194,8 +483,10 @@ export class BaseNode {
|
|
|
194
483
|
process: async (inputs, context) => {
|
|
195
484
|
const merged = await this._injectSecrets(inputs, context);
|
|
196
485
|
const { _secrets, _control_context, ...props } = merged;
|
|
486
|
+
// Stryker disable next-line ConditionalExpression: storing an undefined internal is indistinguishable from not storing it — getDynamic returns undefined either way and the getters coalesce to {} (equivalent).
|
|
197
487
|
if (_secrets)
|
|
198
488
|
this.setDynamic("_secrets", _secrets);
|
|
489
|
+
// Stryker disable next-line ConditionalExpression: storing an undefined internal is indistinguishable from not storing it (equivalent).
|
|
199
490
|
if (_control_context)
|
|
200
491
|
this.setDynamic("_control_context", _control_context);
|
|
201
492
|
this.assign(props);
|
|
@@ -204,40 +495,59 @@ export class BaseNode {
|
|
|
204
495
|
genProcess: async function* (inputs, context) {
|
|
205
496
|
const merged = await this._injectSecrets(inputs, context);
|
|
206
497
|
const { _secrets, _control_context, ...props } = merged;
|
|
498
|
+
// Stryker disable next-line ConditionalExpression: storing an undefined internal is indistinguishable from not storing it — getDynamic returns undefined either way and the getters coalesce to {} (equivalent).
|
|
207
499
|
if (_secrets)
|
|
208
500
|
this.setDynamic("_secrets", _secrets);
|
|
501
|
+
// Stryker disable next-line ConditionalExpression: storing an undefined internal is indistinguishable from not storing it (equivalent).
|
|
209
502
|
if (_control_context)
|
|
210
503
|
this.setDynamic("_control_context", _control_context);
|
|
211
504
|
this.assign(props);
|
|
212
505
|
yield* this.genProcess(context);
|
|
213
506
|
}.bind(this),
|
|
507
|
+
// Live parameter path: assign() only touches the supplied declared
|
|
508
|
+
// properties, so a running run() loop that reads `this.<prop>` per
|
|
509
|
+
// chunk sees the new value on its next chunk.
|
|
510
|
+
applyProperties: (properties) => this.assign(properties),
|
|
511
|
+
appendStaticInputs: this.constructor
|
|
512
|
+
.appendStaticInputs,
|
|
214
513
|
preProcess: () => this.preProcess(),
|
|
215
514
|
finalize: () => this.finalize(),
|
|
216
|
-
initialize: () => this.initialize()
|
|
515
|
+
initialize: () => this.initialize(),
|
|
516
|
+
emitTriggerEvent: (event, outputs) => this.emitTriggerEvent(event, outputs)
|
|
217
517
|
};
|
|
218
518
|
if (this.run) {
|
|
219
|
-
executor.run = async (inputs, outputs, context) =>
|
|
519
|
+
executor.run = async (inputs, outputs, context) => {
|
|
520
|
+
// run() receives StreamingInputs rather than a property bag, so
|
|
521
|
+
// secrets can't ride along on the inputs — store them on the
|
|
522
|
+
// instance so this._secrets works inside run() like in process().
|
|
523
|
+
// Always overwrite so secrets from a previous execution can't leak into
|
|
524
|
+
// a later run() call on the same instance.
|
|
525
|
+
this.setDynamic("_secrets", await this._resolveSecrets(context));
|
|
526
|
+
return this.run(inputs, outputs, context);
|
|
527
|
+
};
|
|
220
528
|
}
|
|
221
529
|
return executor;
|
|
222
530
|
}
|
|
223
531
|
static toDescriptor(id) {
|
|
224
|
-
const
|
|
225
|
-
const propertyTypes = Object.fromEntries(cls
|
|
226
|
-
.getDeclaredProperties()
|
|
532
|
+
const propertyTypes = Object.fromEntries(this.getDeclaredProperties()
|
|
227
533
|
.map((entry) => [entry.name, entry.options.type]));
|
|
228
534
|
const desc = {
|
|
229
|
-
id: id ??
|
|
230
|
-
type:
|
|
231
|
-
name:
|
|
232
|
-
is_streaming_input:
|
|
233
|
-
is_streaming_output:
|
|
234
|
-
|
|
235
|
-
|
|
535
|
+
id: id ?? this.nodeType,
|
|
536
|
+
type: this.nodeType,
|
|
537
|
+
name: this.title,
|
|
538
|
+
is_streaming_input: this.isStreamingInput,
|
|
539
|
+
is_streaming_output: hasStreamingOutput(this),
|
|
540
|
+
input_mode: this.inputMode,
|
|
541
|
+
output_correlation: this.outputCorrelation,
|
|
542
|
+
is_controlled: this.isControlled,
|
|
543
|
+
is_join_node: this.isJoinNode || undefined,
|
|
544
|
+
is_trigger: this.isTrigger || undefined,
|
|
545
|
+
retry_safe: this.retrySafe || undefined
|
|
236
546
|
};
|
|
237
547
|
if (Object.keys(propertyTypes).length > 0) {
|
|
238
548
|
desc.propertyTypes = propertyTypes;
|
|
239
549
|
}
|
|
240
|
-
const outputs =
|
|
550
|
+
const outputs = this.getDeclaredOutputs();
|
|
241
551
|
if (Object.keys(outputs).length > 0) {
|
|
242
552
|
desc.outputs = outputs;
|
|
243
553
|
}
|
package/dist/base-node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-node.js","sourceRoot":"","sources":["../src/base-node.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,KAAc,EAAE,YAAoB;IAChE,IACE,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,SA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E,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CACpD,CAAC;QACF,MAAM,IAAI,GAAmB;YAC3B,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,QAAQ;YACvB,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,kBAAkB,EAAE,IAAI,CAAC,gBAAgB;YACzC,mBAAmB,EAAE,kBAAkB,CAAC,IAAI,CAAC;YAC7C,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,kBAAkB,EAAE,IAAI,CAAC,iBAAiB;YAC1C,aAAa,EAAE,IAAI,CAAC,YAAY;YAChC,YAAY,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS;YAC1C,UAAU,EAAE,IAAI,CAAC,SAAS,IAAI,SAAS;YACvC,UAAU,EAAE,IAAI,CAAC,SAAS,IAAI,SAAS;SACxC,CAAC;QACF,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACrC,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1C,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a node className (e.g. "GPT_4_1_Nano", "StableDiffusionXL",
|
|
3
|
+
* "Ideogram_V3_Balanced") into a human-readable title shown in the node
|
|
4
|
+
* menu.
|
|
5
|
+
*
|
|
6
|
+
* Rules:
|
|
7
|
+
* - "_" is treated as a word separator (so "Imagen_4_Ultra" yields three
|
|
8
|
+
* chunks: "Imagen", "4", "Ultra").
|
|
9
|
+
* - camelCase / PascalCase boundaries are split, while uppercase runs are
|
|
10
|
+
* kept together — so "StableDiffusionXL" becomes "Stable Diffusion XL"
|
|
11
|
+
* rather than "Stable Diffusion X L", and "SDXL_Ad_Inpaint" stays as
|
|
12
|
+
* "SDXL Ad Inpaint" rather than "S D X L Ad Inpaint".
|
|
13
|
+
* - Consecutive purely-numeric tokens are joined with a "." — this
|
|
14
|
+
* reconstructs the version numbers in the original model slugs (so
|
|
15
|
+
* "GPT_4_1_Nano" → "GPT 4.1 Nano", "Flux_1_1_Pro_Ultra" →
|
|
16
|
+
* "Flux 1.1 Pro Ultra", "Veo_3_1_Lite" → "Veo 3.1 Lite").
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* classNameToTitle("GPT_4_1_Nano") // "GPT 4.1 Nano"
|
|
20
|
+
* classNameToTitle("Imagen_4_Ultra") // "Imagen 4 Ultra"
|
|
21
|
+
* classNameToTitle("Ideogram_V3_Balanced") // "Ideogram V3 Balanced"
|
|
22
|
+
* classNameToTitle("StableDiffusionXL") // "Stable Diffusion XL"
|
|
23
|
+
* classNameToTitle("Recraft_20B_SVG") // "Recraft 20B SVG"
|
|
24
|
+
*/
|
|
25
|
+
export declare function classNameToTitle(className: string): string;
|
|
26
|
+
//# sourceMappingURL=class-name-to-title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-name-to-title.d.ts","sourceRoot":"","sources":["../src/class-name-to-title.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAmC1D"}
|