@code0-tech/triangulum 0.40.0 → 0.40.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.
@@ -21,7 +21,8 @@ export type SchematizedSubFlowValue = SubFlowValue & SignatureSchemas;
21
21
  /**
22
22
  * A {@link Flow} enriched with the input/output schemas of its own signature.
23
23
  * Every {@link SubFlowValue} nested in a node parameter is additionally enriched
24
- * in place (see {@link SchematizedSubFlowValue}).
24
+ * in place (see {@link SchematizedSubFlowValue}) — both a parameter that is a
25
+ * sub-flow itself and an inline sub-flow sitting in a literal's `references`.
25
26
  */
26
27
  export type SchematizedFlow = Flow & SignatureSchemas;
27
28
  /**
@@ -29,7 +30,8 @@ export type SchematizedFlow = Flow & SignatureSchemas;
29
30
  * every sub-flow it contains.
30
31
  *
31
32
  * The same flow is returned back, but with two additional fields on the flow
32
- * itself and on every {@link SubFlowValue} that appears as a node parameter:
33
+ * itself and on every {@link SubFlowValue} it contains — whether it fills a node
34
+ * parameter directly or is an inline reference of a literal parameter:
33
35
  * - `inputSchema` — an `object` JSON schema keyed by the signature's parameter names
34
36
  * - `outputSchema` — the JSON schema of the signature's return type
35
37
  *
@@ -47,6 +49,11 @@ export type SchematizedFlow = Flow & SignatureSchemas;
47
49
  * instantiated) argument types the lambda receives, and the output is what the
48
50
  * sub-flow body actually returns (e.g. via a `std::control::return` node),
49
51
  * rather than the `void` the surrounding function merely expects.
52
+ * - An inline sub-flow — one addressed via `${signature}` from a literal value's
53
+ * `references`, the only way to fill e.g. a `LIST` of sub-flows — is treated
54
+ * the same way: its schemas come from the expression generated at its position
55
+ * inside the literal, so it is contextually typed by the surrounding slot just
56
+ * like a sub-flow parameter. Nested literals are followed.
50
57
  *
51
58
  * The actual JSON Schema generation is delegated to `ts-json-schema-generator`
52
59
  * (see {@link generateJsonSchemas}); this function only resolves the real
package/dist/server.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./utils-DXrZOjPR.cjs");let t=require("typescript");t=e.b(t,1);let n=require("ts-json-schema-generator");var r={...n.DEFAULT_CONFIG,expose:`none`,topRef:!1,jsDoc:`none`,skipTypeCheck:!0},i=(e,t)=>{let n=Object.keys(e);if(n.length===0)return{};let r=o(a(e,t)),i={};for(let e of n)try{i[e]=s(r.createSchema(e))}catch{i[e]={}}return i},a=(t,n)=>{let r=Object.entries(t).map(([e,t])=>`export type ${e} = ${t};`).join(`
2
- `);return`${e.r(n)}\n${r}`},o=t=>{let i=e.t(`index.ts`,t).languageService.getProgram();return new n.SchemaGenerator(i,(0,n.createParser)(i,r),(0,n.createFormatter)(r),r)},s=e=>{let{$schema:t,definitions:n,...r}=e,i=n&&Object.keys(n).length>0?{...r,definitions:n}:r;return JSON.parse(JSON.stringify(i))},c=(t,n,r)=>{if(!t)return;let a=`index.ts`,o=e.n(t,n,r),s=e.t(a,o),c=s.getSourceFile(a),d=s.languageService.getProgram().getTypeChecker(),p=i({...f(d,c),...m(d,c,t)},r),h=(t.nodes?.nodes??[]).map(e=>e&&x(e,p));return{...t,inputSchema:p[l]??y(),outputSchema:p[u]??b(),nodes:{...t.nodes,nodes:h}}},l=`Flow_input`,u=`Flow_output`,d=(t,n,r)=>`Node_${e.i(t)}_${n}_${r}`,f=(e,n)=>{let r=n.statements.filter(t.default.isFunctionDeclaration).find(e=>e.name?.getText()===`flow`);if(!r)return{};let i=p(n),a=(i?e.getResolvedSignature(i):void 0)??e.getSignatureFromDeclaration(r);if(!a)return{};let{input:o,output:s}=v(e,a,i??r);return{[l]:o,[u]:s}},p=e=>{let n;return e.forEachChild(function e(r){if(!n){if(t.default.isCallExpression(r)&&t.default.isIdentifier(r.expression)&&r.expression.text===`flow`){n=r;return}r.forEachChild(e)}}),n},m=(e,t,n)=>{let r=T(t),i={};for(let t of n.nodes?.nodes??[]){if(!t?.id)continue;let n=t.parameters?.nodes;if(!n?.some(S))continue;let a=w(r,t);a&&n.forEach((n,r)=>{if(!S(n))return;let o=a.arguments[r],s=o?e.getTypeAtLocation(o).getCallSignatures()[0]:void 0;if(!s)return;let{input:c,output:l}=h(e,s,o);i[d(t.id,r,`input`)]=c,i[d(t.id,r,`output`)]=l})}return i},h=(e,n,r)=>({input:`{ ${g(e,n,r).join(`; `)} }`,output:(n=>e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation))(e.getReturnTypeOfSignature(n))}),g=(e,n,r)=>{let i=n=>e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation),a=n.getParameters();if(a.length===1){let t=_(e,e.getTypeOfSymbolAtLocation(a[0],a[0].valueDeclaration??r),r);if(t)return t}return a.map(t=>{let n=e.getTypeOfSymbolAtLocation(t,t.valueDeclaration??r),a=C(t)?`?`:``;return`${t.getName()}${a}: ${i(n)}`})},_=(e,n,r)=>{let i=n,a=i.target;if(a&&(a.objectFlags&t.default.ObjectFlags.Tuple)!==0)return e.getTypeArguments(i).map((n,i)=>{let o=a.labeledElementDeclarations?.[i];return`${o?.name&&t.default.isIdentifier(o.name)?o.name.text:`arg${i}`}${(a.elementFlags[i]&t.default.ElementFlags.Optional)===0?``:`?`}: ${e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation)}`})},v=(e,n,r)=>{let i=n=>e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation);return{input:`{ ${n.parameters.map(t=>{let n=e.getTypeOfSymbolAtLocation(t,t.valueDeclaration??r),a=C(t)?`?`:``;return`${t.getName()}${a}: ${i(n)}`}).join(`; `)} }`,output:i(e.getReturnTypeOfSignature(n))}},y=()=>({type:`object`}),b=()=>({}),x=(e,t)=>{let n=e.parameters?.nodes;if(!n?.some(S))return e;let r=n.map((n,r)=>{if(!S(n))return n;let i={...n.value,inputSchema:t[d(e.id,r,`input`)]??y(),outputSchema:t[d(e.id,r,`output`)]??b()};return{...n,value:i}});return{...e,parameters:{...e.parameters,nodes:r}}},S=e=>e?.value?.__typename===`SubFlowValue`,C=e=>{let n=e.valueDeclaration;return!!n&&t.default.isParameter(n)&&(!!n.questionToken||!!n.initializer||!!n.dotDotDotToken)},w=(n,r)=>{let i=n.get(`node_${e.i(r.id)}`)?.initializer;return i&&t.default.isCallExpression(i)?i:void 0},T=e=>{let n=new Map;return e.statements.forEach(e=>{e.forEachChild(function e(r){t.default.isVariableDeclaration(r)&&(r.parent.flags&t.default.NodeFlags.Const)!==0&&n.set(r.name.getText(),r),r.forEachChild(e)})}),n};exports.getFlowSchemas=c;
2
+ `);return`${e.r(n)}\n${r}`},o=t=>{let i=e.t(`index.ts`,t).languageService.getProgram();return new n.SchemaGenerator(i,(0,n.createParser)(i,r),(0,n.createFormatter)(r),r)},s=e=>{let{$schema:t,definitions:n,...r}=e,i=n&&Object.keys(n).length>0?{...r,definitions:n}:r;return JSON.parse(JSON.stringify(i))},c=(t,n,r)=>{if(!t)return;let a=`index.ts`,o=e.n(t,n,r),s=e.t(a,o),c=s.getSourceFile(a),d=s.languageService.getProgram().getTypeChecker(),f=i({...p(d,c),...h(d,c,t)},r),m=(t.nodes?.nodes??[]).map(e=>e&&D(e,f));return{...t,inputSchema:f[l]??T(),outputSchema:f[u]??E(),nodes:{...t.nodes,nodes:m}}},l=`Flow_input`,u=`Flow_output`,d=(t,n,r)=>`Node_${e.i(t)}_${n}_${r}`,f=(t,n,r,i)=>`Node_${e.i(t)}_${n}_ref_${r.map(e.i).join(`_`)}_${i}`,p=(e,n)=>{let r=n.statements.filter(t.default.isFunctionDeclaration).find(e=>e.name?.getText()===`flow`);if(!r)return{};let i=m(n),a=(i?e.getResolvedSignature(i):void 0)??e.getSignatureFromDeclaration(r);if(!a)return{};let{input:o,output:s}=w(e,a,i??r);return{[l]:o,[u]:s}},m=e=>{let n;return e.forEachChild(function e(r){if(!n){if(t.default.isCallExpression(r)&&t.default.isIdentifier(r.expression)&&r.expression.text===`flow`){n=r;return}r.forEachChild(e)}}),n},h=(e,t,n)=>{let r=P(t),i={};for(let t of n.nodes?.nodes??[]){if(!t?.id)continue;let n=t.parameters?.nodes;if(!n?.some(j))continue;let a=N(r,t);a&&n.forEach((n,r)=>{let o=a.arguments[r];if(!o)return;if(k(n)){let n=g(e,o);if(!n)return;i[d(t.id,r,`input`)]=n.input,i[d(t.id,r,`output`)]=n.output;return}let s=y(n);if(s.length===0)return;let c=_(o);s.forEach((n,a)=>{let o=c[a];if(!o)return;let s=g(e,o);s&&(i[f(t.id,r,n,`input`)]=s.input,i[f(t.id,r,n,`output`)]=s.output)})})}return i},g=(e,t)=>{let n=e.getTypeAtLocation(t).getCallSignatures()[0];if(n)return x(e,n,t)},_=e=>{let n=[],r=e=>{if(t.default.isArrowFunction(e)){n.push(e);return}if(t.default.isIdentifier(e)&&e.text.startsWith(`fn_`)){let r=e.parent;if(!(r&&t.default.isCallExpression(r)&&r.expression===e)){n.push(e);return}}e.forEachChild(r)};return r(e),n},v=/\$\{([^}]+)\}/g,y=e=>{if(!A(e))return[];let t=[];return b(e.value.value,e.value.references,[],t),t},b=(e,t,n,r)=>{let i=new Map;for(let e of t??[])e?.signature&&i.set(e.signature,e);if(i.size===0)return;let a=e=>{if(typeof e==`string`){for(let t of e.matchAll(v)){let e=i.get(t[1])?.value;e&&(e.__typename===`SubFlowValue`?r.push([...n,t[1]]):e.__typename===`LiteralValue`&&b(e.value,e.references,[...n,t[1]],r))}return}if(Array.isArray(e)){e.forEach(e=>a(e));return}typeof e==`object`&&e&&Object.values(e).forEach(e=>a(e))};a(e)},x=(e,n,r)=>({input:`{ ${S(e,n,r).join(`; `)} }`,output:(n=>e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation))(e.getReturnTypeOfSignature(n))}),S=(e,n,r)=>{let i=n=>e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation),a=n.getParameters();if(a.length===1){let t=C(e,e.getTypeOfSymbolAtLocation(a[0],a[0].valueDeclaration??r),r);if(t)return t}return a.map(t=>{let n=e.getTypeOfSymbolAtLocation(t,t.valueDeclaration??r),a=M(t)?`?`:``;return`${t.getName()}${a}: ${i(n)}`})},C=(e,n,r)=>{let i=n,a=i.target;if(a&&(a.objectFlags&t.default.ObjectFlags.Tuple)!==0)return e.getTypeArguments(i).map((n,i)=>{let o=a.labeledElementDeclarations?.[i];return`${o?.name&&t.default.isIdentifier(o.name)?o.name.text:`arg${i}`}${(a.elementFlags[i]&t.default.ElementFlags.Optional)===0?``:`?`}: ${e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation)}`})},w=(e,n,r)=>{let i=n=>e.typeToString(n,r,t.default.TypeFormatFlags.NoTruncation);return{input:`{ ${n.parameters.map(t=>{let n=e.getTypeOfSymbolAtLocation(t,t.valueDeclaration??r),a=M(t)?`?`:``;return`${t.getName()}${a}: ${i(n)}`}).join(`; `)} }`,output:i(e.getReturnTypeOfSignature(n))}},T=()=>({type:`object`}),E=()=>({}),D=(e,t)=>{let n=e.parameters?.nodes;if(!n?.some(j))return e;let r=n.map((n,r)=>{if(k(n)){let i={...n.value,inputSchema:t[d(e.id,r,`input`)]??T(),outputSchema:t[d(e.id,r,`output`)]??E()};return{...n,value:i}}if(!A(n)||!n.value.references?.length)return n;let i=O(n.value.references,e.id,r,[],t);return{...n,value:{...n.value,references:i}}});return{...e,parameters:{...e.parameters,nodes:r}}},O=(e,t,n,r,i)=>e.map(e=>{let a=e?.value;if(!e?.signature||!a)return e;let o=[...r,e.signature];if(a.__typename===`SubFlowValue`){let r={...a,inputSchema:i[f(t,n,o,`input`)]??T(),outputSchema:i[f(t,n,o,`output`)]??E()};return{...e,value:r}}return a.__typename===`LiteralValue`&&a.references?.length?{...e,value:{...a,references:O(a.references,t,n,o,i)}}:e}),k=e=>e?.value?.__typename===`SubFlowValue`,A=e=>e?.value?.__typename===`LiteralValue`,j=e=>k(e)||y(e).length>0,M=e=>{let n=e.valueDeclaration;return!!n&&t.default.isParameter(n)&&(!!n.questionToken||!!n.initializer||!!n.dotDotDotToken)},N=(n,r)=>{let i=n.get(`node_${e.i(r.id)}`)?.initializer;return i&&t.default.isCallExpression(i)?i:void 0},P=e=>{let n=new Map;return e.statements.forEach(e=>{e.forEachChild(function e(r){t.default.isVariableDeclaration(r)&&(r.parent.flags&t.default.NodeFlags.Const)!==0&&n.set(r.name.getText(),r),r.forEachChild(e)})}),n};exports.getFlowSchemas=c;
package/dist/server.js CHANGED
@@ -33,29 +33,29 @@ var l = {
33
33
  }, m = (e, n, i) => {
34
34
  if (!e) return;
35
35
  let a = "index.ts", o = t(e, n, i), s = r(a, o), c = s.getSourceFile(a), l = s.languageService.getProgram().getTypeChecker(), d = u({
36
- ...v(l, c),
37
- ...b(l, c, e)
38
- }, i), f = (e.nodes?.nodes ?? []).map((e) => e && D(e, d));
36
+ ...y(l, c),
37
+ ...x(l, c, e)
38
+ }, i), f = (e.nodes?.nodes ?? []).map((e) => e && N(e, d));
39
39
  return {
40
40
  ...e,
41
- inputSchema: d[h] ?? T(),
42
- outputSchema: d[g] ?? E(),
41
+ inputSchema: d[h] ?? j(),
42
+ outputSchema: d[g] ?? M(),
43
43
  nodes: {
44
44
  ...e.nodes,
45
45
  nodes: f
46
46
  }
47
47
  };
48
- }, h = "Flow_input", g = "Flow_output", _ = (t, n, r) => `Node_${e(t)}_${n}_${r}`, v = (e, t) => {
48
+ }, h = "Flow_input", g = "Flow_output", _ = (t, n, r) => `Node_${e(t)}_${n}_${r}`, v = (t, n, r, i) => `Node_${e(t)}_${n}_ref_${r.map(e).join("_")}_${i}`, y = (e, t) => {
49
49
  let n = t.statements.filter(i.isFunctionDeclaration).find((e) => e.name?.getText() === "flow");
50
50
  if (!n) return {};
51
- let r = y(t), a = (r ? e.getResolvedSignature(r) : void 0) ?? e.getSignatureFromDeclaration(n);
51
+ let r = b(t), a = (r ? e.getResolvedSignature(r) : void 0) ?? e.getSignatureFromDeclaration(n);
52
52
  if (!a) return {};
53
- let { input: o, output: s } = w(e, a, r ?? n);
53
+ let { input: o, output: s } = A(e, a, r ?? n);
54
54
  return {
55
55
  [h]: o,
56
56
  [g]: s
57
57
  };
58
- }, y = (e) => {
58
+ }, b = (e) => {
59
59
  let t;
60
60
  return e.forEachChild(function e(n) {
61
61
  if (!t) {
@@ -66,63 +66,127 @@ var l = {
66
66
  n.forEachChild(e);
67
67
  }
68
68
  }), t;
69
- }, b = (e, t, n) => {
70
- let r = j(t), i = {};
69
+ }, x = (e, t, n) => {
70
+ let r = B(t), i = {};
71
71
  for (let t of n.nodes?.nodes ?? []) {
72
72
  if (!t?.id) continue;
73
73
  let n = t.parameters?.nodes;
74
- if (!n?.some(O)) continue;
75
- let a = A(r, t);
74
+ if (!n?.some(L)) continue;
75
+ let a = z(r, t);
76
76
  a && n.forEach((n, r) => {
77
- if (!O(n)) return;
78
- let o = a.arguments[r], s = o ? e.getTypeAtLocation(o).getCallSignatures()[0] : void 0;
79
- if (!s) return;
80
- let { input: c, output: l } = x(e, s, o);
81
- i[_(t.id, r, "input")] = c, i[_(t.id, r, "output")] = l;
77
+ let o = a.arguments[r];
78
+ if (!o) return;
79
+ if (F(n)) {
80
+ let n = S(e, o);
81
+ if (!n) return;
82
+ i[_(t.id, r, "input")] = n.input, i[_(t.id, r, "output")] = n.output;
83
+ return;
84
+ }
85
+ let s = T(n);
86
+ if (s.length === 0) return;
87
+ let c = C(o);
88
+ s.forEach((n, a) => {
89
+ let o = c[a];
90
+ if (!o) return;
91
+ let s = S(e, o);
92
+ s && (i[v(t.id, r, n, "input")] = s.input, i[v(t.id, r, n, "output")] = s.output);
93
+ });
82
94
  });
83
95
  }
84
96
  return i;
85
- }, x = (e, t, n) => ({
86
- input: `{ ${S(e, t, n).join("; ")} }`,
97
+ }, S = (e, t) => {
98
+ let n = e.getTypeAtLocation(t).getCallSignatures()[0];
99
+ if (n) return D(e, n, t);
100
+ }, C = (e) => {
101
+ let t = [], n = (e) => {
102
+ if (i.isArrowFunction(e)) {
103
+ t.push(e);
104
+ return;
105
+ }
106
+ if (i.isIdentifier(e) && e.text.startsWith("fn_")) {
107
+ let n = e.parent;
108
+ if (!(n && i.isCallExpression(n) && n.expression === e)) {
109
+ t.push(e);
110
+ return;
111
+ }
112
+ }
113
+ e.forEachChild(n);
114
+ };
115
+ return n(e), t;
116
+ }, w = /\$\{([^}]+)\}/g, T = (e) => {
117
+ if (!I(e)) return [];
118
+ let t = [];
119
+ return E(e.value.value, e.value.references, [], t), t;
120
+ }, E = (e, t, n, r) => {
121
+ let i = /* @__PURE__ */ new Map();
122
+ for (let e of t ?? []) e?.signature && i.set(e.signature, e);
123
+ if (i.size === 0) return;
124
+ let a = (e) => {
125
+ if (typeof e == "string") {
126
+ for (let t of e.matchAll(w)) {
127
+ let e = i.get(t[1])?.value;
128
+ e && (e.__typename === "SubFlowValue" ? r.push([...n, t[1]]) : e.__typename === "LiteralValue" && E(e.value, e.references, [...n, t[1]], r));
129
+ }
130
+ return;
131
+ }
132
+ if (Array.isArray(e)) {
133
+ e.forEach((e) => a(e));
134
+ return;
135
+ }
136
+ typeof e == "object" && e && Object.values(e).forEach((e) => a(e));
137
+ };
138
+ a(e);
139
+ }, D = (e, t, n) => ({
140
+ input: `{ ${O(e, t, n).join("; ")} }`,
87
141
  output: ((t) => e.typeToString(t, n, i.TypeFormatFlags.NoTruncation))(e.getReturnTypeOfSignature(t))
88
- }), S = (e, t, n) => {
142
+ }), O = (e, t, n) => {
89
143
  let r = (t) => e.typeToString(t, n, i.TypeFormatFlags.NoTruncation), a = t.getParameters();
90
144
  if (a.length === 1) {
91
- let t = C(e, e.getTypeOfSymbolAtLocation(a[0], a[0].valueDeclaration ?? n), n);
145
+ let t = k(e, e.getTypeOfSymbolAtLocation(a[0], a[0].valueDeclaration ?? n), n);
92
146
  if (t) return t;
93
147
  }
94
148
  return a.map((t) => {
95
- let i = e.getTypeOfSymbolAtLocation(t, t.valueDeclaration ?? n), a = k(t) ? "?" : "";
149
+ let i = e.getTypeOfSymbolAtLocation(t, t.valueDeclaration ?? n), a = R(t) ? "?" : "";
96
150
  return `${t.getName()}${a}: ${r(i)}`;
97
151
  });
98
- }, C = (e, t, n) => {
152
+ }, k = (e, t, n) => {
99
153
  let r = t, a = r.target;
100
154
  if (a && (a.objectFlags & i.ObjectFlags.Tuple) !== 0) return e.getTypeArguments(r).map((t, r) => {
101
155
  let o = a.labeledElementDeclarations?.[r];
102
156
  return `${o?.name && i.isIdentifier(o.name) ? o.name.text : `arg${r}`}${(a.elementFlags[r] & i.ElementFlags.Optional) === 0 ? "" : "?"}: ${e.typeToString(t, n, i.TypeFormatFlags.NoTruncation)}`;
103
157
  });
104
- }, w = (e, t, n) => {
158
+ }, A = (e, t, n) => {
105
159
  let r = (t) => e.typeToString(t, n, i.TypeFormatFlags.NoTruncation);
106
160
  return {
107
161
  input: `{ ${t.parameters.map((t) => {
108
- let i = e.getTypeOfSymbolAtLocation(t, t.valueDeclaration ?? n), a = k(t) ? "?" : "";
162
+ let i = e.getTypeOfSymbolAtLocation(t, t.valueDeclaration ?? n), a = R(t) ? "?" : "";
109
163
  return `${t.getName()}${a}: ${r(i)}`;
110
164
  }).join("; ")} }`,
111
165
  output: r(e.getReturnTypeOfSignature(t))
112
166
  };
113
- }, T = () => ({ type: "object" }), E = () => ({}), D = (e, t) => {
167
+ }, j = () => ({ type: "object" }), M = () => ({}), N = (e, t) => {
114
168
  let n = e.parameters?.nodes;
115
- if (!n?.some(O)) return e;
169
+ if (!n?.some(L)) return e;
116
170
  let r = n.map((n, r) => {
117
- if (!O(n)) return n;
118
- let i = {
119
- ...n.value,
120
- inputSchema: t[_(e.id, r, "input")] ?? T(),
121
- outputSchema: t[_(e.id, r, "output")] ?? E()
122
- };
171
+ if (F(n)) {
172
+ let i = {
173
+ ...n.value,
174
+ inputSchema: t[_(e.id, r, "input")] ?? j(),
175
+ outputSchema: t[_(e.id, r, "output")] ?? M()
176
+ };
177
+ return {
178
+ ...n,
179
+ value: i
180
+ };
181
+ }
182
+ if (!I(n) || !n.value.references?.length) return n;
183
+ let i = P(n.value.references, e.id, r, [], t);
123
184
  return {
124
185
  ...n,
125
- value: i
186
+ value: {
187
+ ...n.value,
188
+ references: i
189
+ }
126
190
  };
127
191
  });
128
192
  return {
@@ -132,13 +196,35 @@ var l = {
132
196
  nodes: r
133
197
  }
134
198
  };
135
- }, O = (e) => e?.value?.__typename === "SubFlowValue", k = (e) => {
199
+ }, P = (e, t, n, r, i) => e.map((e) => {
200
+ let a = e?.value;
201
+ if (!e?.signature || !a) return e;
202
+ let o = [...r, e.signature];
203
+ if (a.__typename === "SubFlowValue") {
204
+ let r = {
205
+ ...a,
206
+ inputSchema: i[v(t, n, o, "input")] ?? j(),
207
+ outputSchema: i[v(t, n, o, "output")] ?? M()
208
+ };
209
+ return {
210
+ ...e,
211
+ value: r
212
+ };
213
+ }
214
+ return a.__typename === "LiteralValue" && a.references?.length ? {
215
+ ...e,
216
+ value: {
217
+ ...a,
218
+ references: P(a.references, t, n, o, i)
219
+ }
220
+ } : e;
221
+ }), F = (e) => e?.value?.__typename === "SubFlowValue", I = (e) => e?.value?.__typename === "LiteralValue", L = (e) => F(e) || T(e).length > 0, R = (e) => {
136
222
  let t = e.valueDeclaration;
137
223
  return !!t && i.isParameter(t) && (!!t.questionToken || !!t.initializer || !!t.dotDotDotToken);
138
- }, A = (t, n) => {
224
+ }, z = (t, n) => {
139
225
  let r = t.get(`node_${e(n.id)}`)?.initializer;
140
226
  return r && i.isCallExpression(r) ? r : void 0;
141
- }, j = (e) => {
227
+ }, B = (e) => {
142
228
  let t = /* @__PURE__ */ new Map();
143
229
  return e.statements.forEach((e) => {
144
230
  e.forEachChild(function e(n) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/triangulum",
3
- "version": "0.40.0",
3
+ "version": "0.40.1",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/code0-tech/triangulum#readme",
6
6
  "bugs": {