@nodetool-ai/node-sdk 0.7.0-rc.23 → 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 +34 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/base-node.d.ts +253 -13
- package/dist/base-node.d.ts.map +1 -1
- package/dist/base-node.js +337 -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 +222 -0
- package/dist/code-analysis.d.ts.map +1 -0
- package/dist/code-analysis.js +803 -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 +636 -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 +1165 -0
- package/dist/graph-validation.js.map +1 -0
- package/dist/index.d.ts +27 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- 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 +73 -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 +58 -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/package-registry-client.d.ts.map +1 -1
- package/dist/package-registry-client.js +15 -6
- package/dist/package-registry-client.js.map +1 -1
- 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 +393 -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 +34 -0
- package/dist/workflow-document-tools.d.ts.map +1 -0
- package/dist/workflow-document-tools.js +357 -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/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,209 @@ 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
|
+
* Marks a trigger node. Triggers compile to `trigger_registrations` on
|
|
115
|
+
* workflow activation, and when a run starts because of a delivered event
|
|
116
|
+
* (`RunJobRequest.trigger_event` targeting this node) the kernel calls
|
|
117
|
+
* {@link emitTriggerEvent} instead of the live-listening `genProcess`
|
|
118
|
+
* loop. Runs without a trigger event keep today's streaming behavior
|
|
119
|
+
* (in-editor live test). See
|
|
120
|
+
* docs/superpowers/specs/2026-07-10-trigger-wakeup-redesign.md.
|
|
121
|
+
*/
|
|
122
|
+
static isTrigger = false;
|
|
123
|
+
/**
|
|
124
|
+
* Emit output_update for this node's handles even when they are connected
|
|
125
|
+
* onward. The runner suppresses output_update for connected handles by
|
|
126
|
+
* default; nodes whose updates feed a UI surface regardless of patching
|
|
127
|
+
* (e.g. the realtime audio monitor) opt in.
|
|
128
|
+
*/
|
|
129
|
+
static alwaysEmitOutputUpdates = false;
|
|
130
|
+
static inputMode = undefined;
|
|
131
|
+
static outputCorrelation = undefined;
|
|
132
|
+
static supportsDynamicInputs = false;
|
|
133
|
+
/**
|
|
134
|
+
* Restricts the types a user may pick when declaring a dynamic input slot on
|
|
135
|
+
* this node (see `Node.dynamic_inputs`). Unset means the full type palette.
|
|
136
|
+
* Emitted as `allowed_dynamic_slot_types` in node metadata.
|
|
137
|
+
*/
|
|
138
|
+
static allowedDynamicSlotTypes = undefined;
|
|
34
139
|
static isControlled = false;
|
|
35
|
-
|
|
140
|
+
/**
|
|
141
|
+
* `Zip` and `Cross` set this to true so static correlation analysis allows
|
|
142
|
+
* incomparable input scopes on these nodes only. See
|
|
143
|
+
* docs/correlation-design.md §7.
|
|
144
|
+
*/
|
|
145
|
+
static isJoinNode = false;
|
|
36
146
|
static supportsDynamicOutputs = undefined;
|
|
37
147
|
static autoSaveAsset = false;
|
|
148
|
+
/**
|
|
149
|
+
* Whether re-running this node with identical inputs is safe. An opt-in:
|
|
150
|
+
* unknown means unsafe. Cost tracking cannot see external writes — a
|
|
151
|
+
* Publish/Upsert/Notify node can complete its side effect and then throw,
|
|
152
|
+
* recording nothing — so a node nobody classified loses a safe retry rather
|
|
153
|
+
* than gaining an unsafe one. The workflow supervisor offers `retry` only
|
|
154
|
+
* for a node that declares this. See docs/workflow-supervisor-design.md §5.3.
|
|
155
|
+
*/
|
|
156
|
+
static retrySafe = false;
|
|
157
|
+
/**
|
|
158
|
+
* Per-type cache lifetime for partial runs ("Run Node", "Run from here", "Run
|
|
159
|
+
* selected"). Only consulted for Computed nodes (Constants are always live;
|
|
160
|
+
* Generatives reuse generation history). `"forever"` = pure deterministic
|
|
161
|
+
* (reuse while inputs match); a finite number = seconds the cached result
|
|
162
|
+
* stays fresh before re-running (time-sensitive, e.g. a web fetch);
|
|
163
|
+
* unset / `0` = never reuse. `"forever"` is a string sentinel — never
|
|
164
|
+
* `Infinity`, which JSON-serializes to `null` and would silently flip a pure
|
|
165
|
+
* node to never-cache. See docs/superpowers/specs/2026-06-27-run-subgraph-caching.md §4.
|
|
166
|
+
*/
|
|
167
|
+
static cacheTtl = undefined;
|
|
168
|
+
/**
|
|
169
|
+
* What running this node does to the world, which decides whether a reactive
|
|
170
|
+
* run (a slider drag, an input change in a mini app) may execute it without
|
|
171
|
+
* an explicit action:
|
|
172
|
+
* "pure" — output depends only on inputs; safe to re-run at any rate
|
|
173
|
+
* "read" — reads external state but changes nothing
|
|
174
|
+
* "write" — mutates state the user can observe (a file, a document)
|
|
175
|
+
* "external" — leaves the system (sends mail, calls a paid API)
|
|
176
|
+
* Reactive runs traverse "pure" and "read" only. The default is the
|
|
177
|
+
* conservative "external", so a node nobody has classified never fires off a
|
|
178
|
+
* slider drag. `cacheTtl: "forever"` implies "pure".
|
|
179
|
+
*/
|
|
180
|
+
static effect = "external";
|
|
181
|
+
/**
|
|
182
|
+
* Names the output slot that carries this node's "primary" generation — the
|
|
183
|
+
* value persisted as its saved generation and previewed by the content card.
|
|
184
|
+
* Unset falls back to the first declared output. See `auto_save_asset` and the
|
|
185
|
+
* autosave path in the websocket runner.
|
|
186
|
+
*/
|
|
187
|
+
static primaryOutput = undefined;
|
|
38
188
|
static modelPacks = undefined;
|
|
189
|
+
/**
|
|
190
|
+
* Deployment platforms this node supports. Defaults to ["node"]; nodes
|
|
191
|
+
* that work in V8 isolates should claim "workers" and/or "edge"
|
|
192
|
+
* explicitly. See `@nodetool-ai/protocol`'s Platform type.
|
|
193
|
+
*/
|
|
194
|
+
static platforms = undefined;
|
|
195
|
+
/**
|
|
196
|
+
* Requires a WebGPU device in the browser (set via `tagAsBrowserGpu`). The
|
|
197
|
+
* in-browser runner routes graphs with these nodes to the server when
|
|
198
|
+
* `navigator.gpu` is unavailable. Unset/undefined means no GPU requirement.
|
|
199
|
+
*/
|
|
200
|
+
static requiresGpu = undefined;
|
|
201
|
+
static deprecated = false;
|
|
202
|
+
/**
|
|
203
|
+
* Hidden from node-discovery UIs but still registered/runnable (see the
|
|
204
|
+
* `hidden` field on NodeClass). Unset/false means normally discoverable.
|
|
205
|
+
*/
|
|
206
|
+
static hidden = undefined;
|
|
207
|
+
static replacedBy = undefined;
|
|
39
208
|
static metadataOutputTypes = undefined;
|
|
40
209
|
static outputTypes = {};
|
|
41
210
|
__node_id = "";
|
|
42
211
|
__node_name = "";
|
|
43
212
|
dynamicProps = new Map();
|
|
213
|
+
/**
|
|
214
|
+
* Typed declarations for the dynamic slots of this node instance, injected by
|
|
215
|
+
* the registry as the `_dynamic_inputs` framework property. `dynamicProps`
|
|
216
|
+
* holds the values; this holds the types. A slot missing here is an untyped
|
|
217
|
+
* legacy slot and behaves exactly as before typed slots existed.
|
|
218
|
+
*/
|
|
219
|
+
dynamicSlotMeta = new Map();
|
|
220
|
+
/**
|
|
221
|
+
* Framework-injected internals (resolved `_secrets`, the `_control_context`,
|
|
222
|
+
* …). Kept separate from `dynamicProps` so reserved `_`-prefixed values never
|
|
223
|
+
* leak into user-facing dynamic-input iteration (prompt template vars, API
|
|
224
|
+
* args) or into `serialize()`. Read/written through getDynamic/setDynamic,
|
|
225
|
+
* which route `_`-prefixed keys here.
|
|
226
|
+
*/
|
|
227
|
+
_internalProps = new Map();
|
|
44
228
|
constructor(properties = {}) {
|
|
45
229
|
this.assign(properties);
|
|
46
230
|
}
|
|
@@ -65,11 +249,26 @@ export class BaseNode {
|
|
|
65
249
|
* need to: declarative `@prop` metadata is enough.
|
|
66
250
|
*/
|
|
67
251
|
static validateProperties(properties, options = {}) {
|
|
68
|
-
const
|
|
69
|
-
|
|
252
|
+
const declared = this.getDeclaredProperties();
|
|
253
|
+
const dynamicSlots = options.dynamicSlots;
|
|
254
|
+
let dynamicValues = options.dynamicValues;
|
|
255
|
+
if (dynamicSlots && !dynamicValues) {
|
|
256
|
+
// No explicit value bag — dynamic values ride along in `properties`.
|
|
257
|
+
const declaredNames = new Set(declared.map((p) => p.name));
|
|
258
|
+
const collected = {};
|
|
259
|
+
for (const key of Object.keys(dynamicSlots)) {
|
|
260
|
+
if (declaredNames.has(key))
|
|
261
|
+
continue;
|
|
262
|
+
collected[key] = properties[key];
|
|
263
|
+
}
|
|
264
|
+
dynamicValues = collected;
|
|
265
|
+
}
|
|
266
|
+
return validateNodeProperties(declared, properties, {
|
|
70
267
|
connectedHandles: options.connectedHandles,
|
|
71
268
|
nodeId: options.nodeId,
|
|
72
|
-
nodeType:
|
|
269
|
+
nodeType: this.nodeType,
|
|
270
|
+
dynamicSlots,
|
|
271
|
+
dynamicValues
|
|
73
272
|
});
|
|
74
273
|
}
|
|
75
274
|
assign(properties) {
|
|
@@ -83,7 +282,10 @@ export class BaseNode {
|
|
|
83
282
|
}
|
|
84
283
|
const declaredNames = new Set(declared.map((p) => p.name));
|
|
85
284
|
for (const { name, options } of declared) {
|
|
86
|
-
if (Object.prototype.hasOwnProperty.call(properties, name)
|
|
285
|
+
if (Object.prototype.hasOwnProperty.call(properties, name) &&
|
|
286
|
+
// An explicit `undefined` means "absent", same as omitting the key —
|
|
287
|
+
// it must not suppress the declared default below.
|
|
288
|
+
properties[name] !== undefined) {
|
|
87
289
|
// Explicit value provided — use it (auto-wrap scalars into list[T]).
|
|
88
290
|
this[name] = coerceToDeclaredType(properties[name], options.type);
|
|
89
291
|
}
|
|
@@ -93,17 +295,34 @@ export class BaseNode {
|
|
|
93
295
|
// Deep-copy mutable defaults so instances don't share references.
|
|
94
296
|
const def = options.default;
|
|
95
297
|
this[name] =
|
|
96
|
-
|
|
298
|
+
// 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).
|
|
299
|
+
isObjectLike(def)
|
|
97
300
|
? JSON.parse(JSON.stringify(def))
|
|
98
301
|
: def;
|
|
99
302
|
}
|
|
100
303
|
}
|
|
101
|
-
// For dynamic nodes, store undeclared properties
|
|
102
|
-
|
|
103
|
-
|
|
304
|
+
// For dynamic nodes, store undeclared properties. Reserved, framework-
|
|
305
|
+
// injected keys (anything `_`-prefixed, e.g. `_secrets`, `_control_context`)
|
|
306
|
+
// are routed to `_internalProps` instead of `dynamicProps` so they never
|
|
307
|
+
// leak into user-facing dynamic-input iteration or `serialize()`.
|
|
308
|
+
if (ctor.supportsDynamicInputs) {
|
|
309
|
+
// Slot declarations arrive before the values are stored so the values can
|
|
310
|
+
// be coerced against their declared type in the same pass.
|
|
311
|
+
const slots = parseDynamicSlots(properties._dynamic_inputs);
|
|
312
|
+
if (slots) {
|
|
313
|
+
this.dynamicSlotMeta = slots;
|
|
314
|
+
}
|
|
104
315
|
for (const [key, value] of Object.entries(properties)) {
|
|
105
|
-
if (
|
|
106
|
-
|
|
316
|
+
if (declaredNames.has(key))
|
|
317
|
+
continue;
|
|
318
|
+
// 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).
|
|
319
|
+
if (key === "__node_id" || key === "__node_name")
|
|
320
|
+
continue;
|
|
321
|
+
if (key.startsWith("_")) {
|
|
322
|
+
this._internalProps.set(key, value);
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
this.dynamicProps.set(key, coerceToSlotType(value, this.dynamicSlotMeta.get(key)));
|
|
107
326
|
}
|
|
108
327
|
}
|
|
109
328
|
}
|
|
@@ -115,7 +334,7 @@ export class BaseNode {
|
|
|
115
334
|
result[name] = this[name];
|
|
116
335
|
}
|
|
117
336
|
// Include dynamic properties so round-trip serialization is lossless
|
|
118
|
-
if (ctor.
|
|
337
|
+
if (ctor.supportsDynamicInputs) {
|
|
119
338
|
for (const [key, value] of this.dynamicProps) {
|
|
120
339
|
result[key] = value;
|
|
121
340
|
}
|
|
@@ -126,10 +345,20 @@ export class BaseNode {
|
|
|
126
345
|
this.assign(data);
|
|
127
346
|
}
|
|
128
347
|
setDynamic(key, value) {
|
|
129
|
-
|
|
348
|
+
if (key.startsWith("_")) {
|
|
349
|
+
this._internalProps.set(key, value);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
this.dynamicProps.set(key, coerceToSlotType(value, this.dynamicSlotMeta.get(key)));
|
|
353
|
+
}
|
|
130
354
|
}
|
|
131
355
|
getDynamic(key) {
|
|
132
|
-
|
|
356
|
+
const store = key.startsWith("_") ? this._internalProps : this.dynamicProps;
|
|
357
|
+
return store.get(key);
|
|
358
|
+
}
|
|
359
|
+
/** Declared types of this instance's dynamic slots, keyed by slot name. */
|
|
360
|
+
getDynamicSlots() {
|
|
361
|
+
return this.dynamicSlotMeta;
|
|
133
362
|
}
|
|
134
363
|
async initialize() { }
|
|
135
364
|
async preProcess() { }
|
|
@@ -145,25 +374,54 @@ export class BaseNode {
|
|
|
145
374
|
const ctor = this.constructor;
|
|
146
375
|
return ctor.validateProperties(this.serialize(), {
|
|
147
376
|
connectedHandles: options.connectedHandles,
|
|
148
|
-
nodeId: options.nodeId ?? (this.__node_id || undefined)
|
|
377
|
+
nodeId: options.nodeId ?? (this.__node_id || undefined),
|
|
378
|
+
dynamicSlots: options.dynamicSlots ??
|
|
379
|
+
(this.dynamicSlotMeta.size > 0
|
|
380
|
+
? Object.fromEntries(this.dynamicSlotMeta)
|
|
381
|
+
: undefined),
|
|
382
|
+
dynamicValues: options.dynamicValues ?? Object.fromEntries(this.dynamicProps)
|
|
149
383
|
});
|
|
150
384
|
}
|
|
151
385
|
async *genProcess(context) {
|
|
152
386
|
yield await this.process(context);
|
|
153
387
|
}
|
|
154
388
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
389
|
+
* Trigger entry point — called instead of `genProcess()` when the run
|
|
390
|
+
* carries a `trigger_event` for this node (see the `isTrigger` static).
|
|
391
|
+
* The default maps the keys of an object payload onto this node's
|
|
392
|
+
* declared output slots and drops everything else. Trigger subclasses
|
|
393
|
+
* override this to shape their adapter payloads (webhook envelope,
|
|
394
|
+
* synthesized tick, file-watch event) onto their specific slots.
|
|
157
395
|
*/
|
|
158
|
-
async
|
|
396
|
+
async emitTriggerEvent(event, outputs) {
|
|
397
|
+
const ctor = this.constructor;
|
|
398
|
+
const declared = ctor.metadataOutputTypes ?? ctor.getDeclaredOutputs();
|
|
399
|
+
const payload = event.payload;
|
|
400
|
+
if (!isRecord(payload)) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
404
|
+
if (key in declared) {
|
|
405
|
+
await outputs.emit(key, value);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Resolve requiredSettings from the context's secret store. Returns an
|
|
411
|
+
* empty record when nothing is required or nothing resolves.
|
|
412
|
+
*/
|
|
413
|
+
async _resolveSecrets(context) {
|
|
159
414
|
const ctor = this.constructor;
|
|
160
415
|
const required = ctor.requiredSettings;
|
|
416
|
+
// 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
417
|
if (!required || required.length === 0) {
|
|
162
|
-
return
|
|
418
|
+
return {};
|
|
163
419
|
}
|
|
164
420
|
if (!context) {
|
|
165
|
-
console.warn(
|
|
166
|
-
|
|
421
|
+
console.warn(
|
|
422
|
+
// Stryker disable next-line StringLiteral: operator diagnostic text only.
|
|
423
|
+
`[_resolveSecrets] No context for ${ctor.nodeType}, required: ${required.join(", ")}`);
|
|
424
|
+
return {};
|
|
167
425
|
}
|
|
168
426
|
const secrets = {};
|
|
169
427
|
for (const key of required) {
|
|
@@ -172,9 +430,20 @@ export class BaseNode {
|
|
|
172
430
|
secrets[key] = value;
|
|
173
431
|
}
|
|
174
432
|
else {
|
|
175
|
-
console.warn(
|
|
433
|
+
console.warn(
|
|
434
|
+
// Stryker disable next-line StringLiteral: operator diagnostic text only.
|
|
435
|
+
`[_resolveSecrets] Secret "${key}" not found for ${ctor.nodeType}`);
|
|
176
436
|
}
|
|
177
437
|
}
|
|
438
|
+
return secrets;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Resolve requiredSettings from the context's secret store and inject
|
|
442
|
+
* them as `inputs._secrets` so node process() can access API keys.
|
|
443
|
+
*/
|
|
444
|
+
async _injectSecrets(inputs, context) {
|
|
445
|
+
const secrets = await this._resolveSecrets(context);
|
|
446
|
+
// 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
447
|
if (Object.keys(secrets).length === 0)
|
|
179
448
|
return inputs;
|
|
180
449
|
return {
|
|
@@ -194,8 +463,10 @@ export class BaseNode {
|
|
|
194
463
|
process: async (inputs, context) => {
|
|
195
464
|
const merged = await this._injectSecrets(inputs, context);
|
|
196
465
|
const { _secrets, _control_context, ...props } = merged;
|
|
466
|
+
// 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
467
|
if (_secrets)
|
|
198
468
|
this.setDynamic("_secrets", _secrets);
|
|
469
|
+
// Stryker disable next-line ConditionalExpression: storing an undefined internal is indistinguishable from not storing it (equivalent).
|
|
199
470
|
if (_control_context)
|
|
200
471
|
this.setDynamic("_control_context", _control_context);
|
|
201
472
|
this.assign(props);
|
|
@@ -204,40 +475,57 @@ export class BaseNode {
|
|
|
204
475
|
genProcess: async function* (inputs, context) {
|
|
205
476
|
const merged = await this._injectSecrets(inputs, context);
|
|
206
477
|
const { _secrets, _control_context, ...props } = merged;
|
|
478
|
+
// 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
479
|
if (_secrets)
|
|
208
480
|
this.setDynamic("_secrets", _secrets);
|
|
481
|
+
// Stryker disable next-line ConditionalExpression: storing an undefined internal is indistinguishable from not storing it (equivalent).
|
|
209
482
|
if (_control_context)
|
|
210
483
|
this.setDynamic("_control_context", _control_context);
|
|
211
484
|
this.assign(props);
|
|
212
485
|
yield* this.genProcess(context);
|
|
213
486
|
}.bind(this),
|
|
487
|
+
// Live parameter path: assign() only touches the supplied declared
|
|
488
|
+
// properties, so a running run() loop that reads `this.<prop>` per
|
|
489
|
+
// chunk sees the new value on its next chunk.
|
|
490
|
+
applyProperties: (properties) => this.assign(properties),
|
|
214
491
|
preProcess: () => this.preProcess(),
|
|
215
492
|
finalize: () => this.finalize(),
|
|
216
|
-
initialize: () => this.initialize()
|
|
493
|
+
initialize: () => this.initialize(),
|
|
494
|
+
emitTriggerEvent: (event, outputs) => this.emitTriggerEvent(event, outputs)
|
|
217
495
|
};
|
|
218
496
|
if (this.run) {
|
|
219
|
-
executor.run = async (inputs, outputs, context) =>
|
|
497
|
+
executor.run = async (inputs, outputs, context) => {
|
|
498
|
+
// run() receives StreamingInputs rather than a property bag, so
|
|
499
|
+
// secrets can't ride along on the inputs — store them on the
|
|
500
|
+
// instance so this._secrets works inside run() like in process().
|
|
501
|
+
// Always overwrite so secrets from a previous execution can't leak into
|
|
502
|
+
// a later run() call on the same instance.
|
|
503
|
+
this.setDynamic("_secrets", await this._resolveSecrets(context));
|
|
504
|
+
return this.run(inputs, outputs, context);
|
|
505
|
+
};
|
|
220
506
|
}
|
|
221
507
|
return executor;
|
|
222
508
|
}
|
|
223
509
|
static toDescriptor(id) {
|
|
224
|
-
const
|
|
225
|
-
const propertyTypes = Object.fromEntries(cls
|
|
226
|
-
.getDeclaredProperties()
|
|
510
|
+
const propertyTypes = Object.fromEntries(this.getDeclaredProperties()
|
|
227
511
|
.map((entry) => [entry.name, entry.options.type]));
|
|
228
512
|
const desc = {
|
|
229
|
-
id: id ??
|
|
230
|
-
type:
|
|
231
|
-
name:
|
|
232
|
-
is_streaming_input:
|
|
233
|
-
is_streaming_output:
|
|
234
|
-
|
|
235
|
-
|
|
513
|
+
id: id ?? this.nodeType,
|
|
514
|
+
type: this.nodeType,
|
|
515
|
+
name: this.title,
|
|
516
|
+
is_streaming_input: this.isStreamingInput,
|
|
517
|
+
is_streaming_output: hasStreamingOutput(this),
|
|
518
|
+
input_mode: this.inputMode,
|
|
519
|
+
output_correlation: this.outputCorrelation,
|
|
520
|
+
is_controlled: this.isControlled,
|
|
521
|
+
is_join_node: this.isJoinNode || undefined,
|
|
522
|
+
is_trigger: this.isTrigger || undefined,
|
|
523
|
+
retry_safe: this.retrySafe || undefined
|
|
236
524
|
};
|
|
237
525
|
if (Object.keys(propertyTypes).length > 0) {
|
|
238
526
|
desc.propertyTypes = propertyTypes;
|
|
239
527
|
}
|
|
240
|
-
const outputs =
|
|
528
|
+
const outputs = this.getDeclaredOutputs();
|
|
241
529
|
if (Object.keys(outputs).length > 0) {
|
|
242
530
|
desc.outputs = outputs;
|
|
243
531
|
}
|
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,SAAS;QACnB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,EAChC,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AA6ED,MAAM,OAAgB,QAAQ;IAC5B,MAAM,CAAU,QAAQ,GAAW,EAAE,CAAC;IACtC,MAAM,CAAU,KAAK,GAAW,EAAE,CAAC;IACnC,MAAM,CAAU,WAAW,GAAW,EAAE,CAAC;IACzC,MAAM,CAAU,MAAM,GAAuB,SAAS,CAAC;IAEvD,MAAM,CAAU,iBAAiB,GAA0B,SAAS,CAAC;IACrE,MAAM,CAAU,WAAW,GAAyB,SAAS,CAAC;IAC9D,MAAM,CAAU,gBAAgB,GAAyB,SAAS,CAAC;IACnE,MAAM,CAAU,gBAAgB,GAAyB,SAAS,CAAC;IACnE,MAAM,CAAU,gBAAgB,GAAY,KAAK,CAAC;IAClD,MAAM,CAAU,iBAAiB,GAAY,KAAK,CAAC;IACnD,MAAM,CAAU,SAAS,GAAY,KAAK,CAAC;IAC3C,MAAM,CA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D,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"}
|