@xyne/workflow-sdk 3.2.26 → 3.2.28

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.
Files changed (43) hide show
  1. package/dist/agents/agent-step.d.ts +17 -0
  2. package/dist/agents/agent-step.d.ts.map +1 -1
  3. package/dist/agents/agent-step.js +119 -8
  4. package/dist/agents/agent-step.js.map +1 -1
  5. package/dist/authz/principal-field.d.ts +23 -0
  6. package/dist/authz/principal-field.d.ts.map +1 -0
  7. package/dist/authz/principal-field.js +34 -0
  8. package/dist/authz/principal-field.js.map +1 -0
  9. package/dist/router/workflow-router.d.ts.map +1 -1
  10. package/dist/router/workflow-router.js +1 -4
  11. package/dist/router/workflow-router.js.map +1 -1
  12. package/dist/runtime/workflow-runtime.d.ts.map +1 -1
  13. package/dist/runtime/workflow-runtime.js +7 -1
  14. package/dist/runtime/workflow-runtime.js.map +1 -1
  15. package/dist/steps/builtin/http-request.step.d.ts +342 -4
  16. package/dist/steps/builtin/http-request.step.d.ts.map +1 -1
  17. package/dist/steps/builtin/http-request.step.js +36 -6
  18. package/dist/steps/builtin/http-request.step.js.map +1 -1
  19. package/package.json +1 -1
  20. package/dist/common/expression-eval.d.ts +0 -35
  21. package/dist/common/expression-eval.d.ts.map +0 -1
  22. package/dist/common/expression-eval.js +0 -214
  23. package/dist/common/expression-eval.js.map +0 -1
  24. package/dist/common/principal.d.ts +0 -45
  25. package/dist/common/principal.d.ts.map +0 -1
  26. package/dist/common/principal.js +0 -9
  27. package/dist/common/principal.js.map +0 -1
  28. package/dist/steps/builtin/transform.step.d.ts +0 -247
  29. package/dist/steps/builtin/transform.step.d.ts.map +0 -1
  30. package/dist/steps/builtin/transform.step.js +0 -135
  31. package/dist/steps/builtin/transform.step.js.map +0 -1
  32. package/dist/types/attachment.d.ts +0 -23
  33. package/dist/types/attachment.d.ts.map +0 -1
  34. package/dist/types/attachment.js +0 -2
  35. package/dist/types/attachment.js.map +0 -1
  36. package/dist/types/resume-payload.d.ts +0 -34
  37. package/dist/types/resume-payload.d.ts.map +0 -1
  38. package/dist/types/resume-payload.js +0 -12
  39. package/dist/types/resume-payload.js.map +0 -1
  40. package/dist/util/executable-check.d.ts +0 -42
  41. package/dist/util/executable-check.d.ts.map +0 -1
  42. package/dist/util/executable-check.js +0 -115
  43. package/dist/util/executable-check.js.map +0 -1
@@ -1,35 +0,0 @@
1
- /**
2
- * Recomputing an agent's arithmetic, safely.
3
- *
4
- * A derived value (a growth rate, a ratio, a total) appears **nowhere** in the
5
- * source, so there is no passage to quote and no page to open — the only honest
6
- * provenance is *these inputs, combined this way*. Given both, the arithmetic
7
- * stops being a claim and becomes checkable: the reader is shown a ✓ when the
8
- * numbers reproduce and a ⚠ when they don't. LLM arithmetic is the least reliable
9
- * step in the pipeline, and this makes it the most verified.
10
- *
11
- * Inputs are referenced **positionally** (`#1`, `#2`) rather than by name or cell.
12
- * That is the security property, not a convenience: the grammar then contains no
13
- * identifiers at all, so an expression *cannot* name anything outside the inputs
14
- * array. No `eval`, no `Function`, no scope to escape into — the worst a
15
- * malformed expression can do is fail to parse.
16
- */
17
- /**
18
- * Evaluate `expr` over `inputs`, or `undefined` when it cannot be evaluated
19
- * with certainty.
20
- *
21
- * `undefined` is deliberately indistinguishable between "malformed" and
22
- * "unsupported": in either case the UI shows the expression without a verdict.
23
- * Showing a wrong ✓ would be worse than showing none.
24
- */
25
- export declare function evaluateExpression(expr: string, inputs: number[]): number | undefined;
26
- /**
27
- * Parse a number out of a cited value as it appears in a document —
28
- * `"₹36,816.00"`, `"1 234,5"`, `"(1,200)"` (accounting negative), `"12%"`.
29
- *
30
- * Needed because an input's value arrives as source text, not a number, and a
31
- * verification that only worked on already-clean numbers would rarely fire on
32
- * real documents. Returns `undefined` when there is no unambiguous number.
33
- */
34
- export declare function parseNumericValue(value: unknown): number | undefined;
35
- //# sourceMappingURL=expression-eval.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expression-eval.d.ts","sourceRoot":"","sources":["../../src/common/expression-eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAwHH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAIrF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAyCpE"}
@@ -1,214 +0,0 @@
1
- /**
2
- * Recomputing an agent's arithmetic, safely.
3
- *
4
- * A derived value (a growth rate, a ratio, a total) appears **nowhere** in the
5
- * source, so there is no passage to quote and no page to open — the only honest
6
- * provenance is *these inputs, combined this way*. Given both, the arithmetic
7
- * stops being a claim and becomes checkable: the reader is shown a ✓ when the
8
- * numbers reproduce and a ⚠ when they don't. LLM arithmetic is the least reliable
9
- * step in the pipeline, and this makes it the most verified.
10
- *
11
- * Inputs are referenced **positionally** (`#1`, `#2`) rather than by name or cell.
12
- * That is the security property, not a convenience: the grammar then contains no
13
- * identifiers at all, so an expression *cannot* name anything outside the inputs
14
- * array. No `eval`, no `Function`, no scope to escape into — the worst a
15
- * malformed expression can do is fail to parse.
16
- */
17
- function tokenize(expr) {
18
- const out = [];
19
- let i = 0;
20
- while (i < expr.length) {
21
- const ch = expr[i];
22
- if (/\s/.test(ch)) {
23
- i++;
24
- continue;
25
- }
26
- if (ch === '#') {
27
- const m = /^#(\d+)/.exec(expr.slice(i));
28
- if (!m)
29
- return null;
30
- const idx = Number(m[1]);
31
- if (!Number.isInteger(idx) || idx < 1)
32
- return null;
33
- out.push({ t: 'ref', i: idx - 1 }); // `#1` is inputs[0] — 1-based reads naturally
34
- i += m[0].length;
35
- continue;
36
- }
37
- if (/[0-9.]/.test(ch)) {
38
- const m = /^\d*\.?\d+/.exec(expr.slice(i));
39
- if (!m)
40
- return null;
41
- out.push({ t: 'num', v: Number(m[0]) });
42
- i += m[0].length;
43
- continue;
44
- }
45
- if (ch === '+' || ch === '-' || ch === '*' || ch === '/') {
46
- out.push({ t: 'op', v: ch });
47
- i++;
48
- continue;
49
- }
50
- if (ch === '(') {
51
- out.push({ t: 'lparen' });
52
- i++;
53
- continue;
54
- }
55
- if (ch === ')') {
56
- out.push({ t: 'rparen' });
57
- i++;
58
- continue;
59
- }
60
- // Anything else — a letter, a call, a property access — is not in the
61
- // language. Refuse rather than try to interpret it.
62
- return null;
63
- }
64
- return out.length > 0 ? out : null;
65
- }
66
- /**
67
- * Recursive-descent over `expr := term (('+'|'-') term)*`,
68
- * `term := factor (('*'|'/') factor)*`, `factor := '-'? (num | ref | '(' expr ')')`.
69
- */
70
- function parseAndEval(tokens, inputs) {
71
- let pos = 0;
72
- let failed = false;
73
- const fail = () => { failed = true; return undefined; };
74
- const factor = () => {
75
- const tok = tokens[pos];
76
- if (!tok)
77
- return fail();
78
- if (tok.t === 'op' && tok.v === '-') { // unary minus
79
- pos++;
80
- const v = factor();
81
- return v === undefined ? undefined : -v;
82
- }
83
- if (tok.t === 'num') {
84
- pos++;
85
- return tok.v;
86
- }
87
- if (tok.t === 'ref') {
88
- pos++;
89
- const v = inputs[tok.i];
90
- // A reference past the inputs it was given is a malformed citation, not a zero.
91
- return v === undefined || !Number.isFinite(v) ? fail() : v;
92
- }
93
- if (tok.t === 'lparen') {
94
- pos++;
95
- const v = expression();
96
- if (failed)
97
- return undefined;
98
- if (tokens[pos]?.t !== 'rparen')
99
- return fail();
100
- pos++;
101
- return v;
102
- }
103
- return fail();
104
- };
105
- const term = () => {
106
- let left = factor();
107
- if (left === undefined)
108
- return undefined;
109
- for (;;) {
110
- const tok = tokens[pos];
111
- if (!tok || tok.t !== 'op' || (tok.v !== '*' && tok.v !== '/'))
112
- return left;
113
- pos++;
114
- const right = factor();
115
- if (right === undefined)
116
- return undefined;
117
- // Division by zero yields Infinity/NaN — not a number a reader can verify.
118
- if (tok.v === '/' && right === 0)
119
- return fail();
120
- left = tok.v === '*' ? left * right : left / right;
121
- }
122
- };
123
- const expression = () => {
124
- let left = term();
125
- if (left === undefined)
126
- return undefined;
127
- for (;;) {
128
- const tok = tokens[pos];
129
- if (!tok || tok.t !== 'op' || (tok.v !== '+' && tok.v !== '-'))
130
- return left;
131
- pos++;
132
- const right = term();
133
- if (right === undefined)
134
- return undefined;
135
- left = tok.v === '+' ? left + right : left - right;
136
- }
137
- };
138
- const result = expression();
139
- // Trailing tokens mean we understood only a prefix — that is a parse failure,
140
- // not a partial answer.
141
- if (failed || pos !== tokens.length || result === undefined)
142
- return undefined;
143
- return Number.isFinite(result) ? result : undefined;
144
- }
145
- /**
146
- * Evaluate `expr` over `inputs`, or `undefined` when it cannot be evaluated
147
- * with certainty.
148
- *
149
- * `undefined` is deliberately indistinguishable between "malformed" and
150
- * "unsupported": in either case the UI shows the expression without a verdict.
151
- * Showing a wrong ✓ would be worse than showing none.
152
- */
153
- export function evaluateExpression(expr, inputs) {
154
- const tokens = tokenize(expr);
155
- if (!tokens)
156
- return undefined;
157
- return parseAndEval(tokens, inputs);
158
- }
159
- /**
160
- * Parse a number out of a cited value as it appears in a document —
161
- * `"₹36,816.00"`, `"1 234,5"`, `"(1,200)"` (accounting negative), `"12%"`.
162
- *
163
- * Needed because an input's value arrives as source text, not a number, and a
164
- * verification that only worked on already-clean numbers would rarely fire on
165
- * real documents. Returns `undefined` when there is no unambiguous number.
166
- */
167
- export function parseNumericValue(value) {
168
- if (typeof value === 'number')
169
- return Number.isFinite(value) ? value : undefined;
170
- if (typeof value !== 'string')
171
- return undefined;
172
- let s = value.trim();
173
- if (!s)
174
- return undefined;
175
- // Accounting negatives: (1,200) === -1200
176
- let negative = false;
177
- if (/^\(.*\)$/.test(s)) {
178
- negative = true;
179
- s = s.slice(1, -1);
180
- }
181
- // Strip currency symbols, spaces and percent — keep digits, separators, sign.
182
- s = s.replace(/[^\d.,\-+]/g, '');
183
- if (!s)
184
- return undefined;
185
- // Which separator is the decimal point?
186
- // both present → the LAST one ("1.234,5" European, "1,234.5" Anglo)
187
- // one, repeated → thousands ("1,234,567")
188
- // one, followed by exactly 3 digits → thousands ("1,200" is twelve hundred,
189
- // not 1.2 — the case that makes a lone
190
- // separator genuinely ambiguous)
191
- // otherwise → decimal ("1,5" European, "1.5" Anglo)
192
- const lastComma = s.lastIndexOf(',');
193
- const lastDot = s.lastIndexOf('.');
194
- if (lastComma !== -1 && lastDot !== -1) {
195
- if (lastComma > lastDot)
196
- s = s.replace(/\./g, '').replace(',', '.');
197
- else
198
- s = s.replace(/,/g, '');
199
- }
200
- else if (lastComma !== -1 || lastDot !== -1) {
201
- const sep = lastComma !== -1 ? ',' : '.';
202
- const occurrences = s.split(sep).length - 1;
203
- const tail = s.slice(s.lastIndexOf(sep) + 1);
204
- const isThousands = occurrences > 1 || /^\d{3}$/.test(tail);
205
- s = isThousands
206
- ? s.split(sep).join('')
207
- : s.replace(sep, '.');
208
- }
209
- const n = Number(s);
210
- if (!Number.isFinite(n))
211
- return undefined;
212
- return negative ? -n : n;
213
- }
214
- //# sourceMappingURL=expression-eval.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expression-eval.js","sourceRoot":"","sources":["../../src/common/expression-eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAUH,SAAS,QAAQ,CAAC,IAAY;IAC5B,MAAM,GAAG,GAAY,EAAE,CAAC;IACxB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACpB,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YAAC,CAAC,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QAErC,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC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,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;;YAC/D,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;SAAM,IAAI,SAAS,KAAK,CAAC,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACzC,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7C,MAAM,WAAW,GAAG,WAAW,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,CAAC,GAAG,WAAW;YACb,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,45 +0,0 @@
1
- /**
2
- * Principal + authorization descriptors — browser-safe shared types.
3
- *
4
- * The host authenticates a request into an {@link AuthContext} (the principal).
5
- * The SDK never interprets `metadata` — it's an opaque claims bag (teamIds,
6
- * roles, deptId, …). Scoping is derived from the principal by host hooks.
7
- */
8
- /** The authenticated principal, produced by the host's `authenticate()` hook. */
9
- export interface AuthContext {
10
- userId: string;
11
- /** Host-defined claims — workspaceId, tenantId, teamIds, roles, etc. Opaque to the SDK. */
12
- metadata: Record<string, unknown>;
13
- }
14
- /** Verbs the scope hooks can differentiate on. Resource types extend this over time. */
15
- export type WorkflowAction = 'workflow.list' | 'workflow.read' | 'workflow.write' | 'workflow.trigger' | 'execution.list' | 'execution.read' | 'execution.write';
16
- /**
17
- * One node in the host's scope hierarchy — what the UI renders in the scope
18
- * navigator. The host (not the SDK) decides what a node represents
19
- * (department, team, project); `kind` is a display label only.
20
- */
21
- export interface ScopeNode {
22
- /** Opaque scope id — matches `WorkflowRecord.scope`. */
23
- id: string;
24
- label: string;
25
- /** Display grouping/icon hint, e.g. 'Department' | 'Team'. Not used for routing. */
26
- kind?: string;
27
- parentId?: string | null;
28
- hasChildren?: boolean;
29
- counts?: {
30
- workflows?: number;
31
- running?: number;
32
- };
33
- }
34
- /**
35
- * What the UI bootstraps from on load. Drives the scope navigator and gates
36
- * cross-scope ("admin") affordances.
37
- */
38
- export interface SessionDescriptor {
39
- userId: string;
40
- /** Top-level scopes the principal can reach. */
41
- scopes: ScopeNode[];
42
- /** Opaque capability flags, e.g. 'workflow.list.crossScope' for an admin view. */
43
- capabilities: string[];
44
- }
45
- //# sourceMappingURL=principal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"principal.d.ts","sourceRoot":"","sources":["../../src/common/principal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,wFAAwF;AACxF,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,kFAAkF;IAClF,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Principal + authorization descriptors — browser-safe shared types.
3
- *
4
- * The host authenticates a request into an {@link AuthContext} (the principal).
5
- * The SDK never interprets `metadata` — it's an opaque claims bag (teamIds,
6
- * roles, deptId, …). Scoping is derived from the principal by host hooks.
7
- */
8
- export {};
9
- //# sourceMappingURL=principal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"principal.js","sourceRoot":"","sources":["../../src/common/principal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -1,247 +0,0 @@
1
- /**
2
- * TRANSFORM step — pure data manipulation.
3
- *
4
- * Applies a sequence of operations to the workflow context:
5
- * - set: write a value at a dotted path
6
- * - rename: move a value from one path to another
7
- * - remove: delete a value at a dotted path
8
- * - copy: copy a value from one path to another
9
- *
10
- * No services, no credentials — pure deterministic logic.
11
- */
12
- import { z } from 'zod';
13
- import { BaseActionStep } from '../base-step.js';
14
- import type { StepExecutionContext } from '../base-step.js';
15
- import { BuiltinStepType } from '../../types/known-types.js';
16
- import type { StepCategory } from '../../types/categories.js';
17
- export declare const TransformOpSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
18
- op: z.ZodLiteral<"set">;
19
- path: z.ZodString;
20
- value: z.ZodUnknown;
21
- }, "strip", z.ZodTypeAny, {
22
- op: "set";
23
- path: string;
24
- value?: unknown;
25
- }, {
26
- op: "set";
27
- path: string;
28
- value?: unknown;
29
- }>, z.ZodObject<{
30
- op: z.ZodLiteral<"rename">;
31
- from: z.ZodString;
32
- to: z.ZodString;
33
- }, "strip", z.ZodTypeAny, {
34
- op: "rename";
35
- from: string;
36
- to: string;
37
- }, {
38
- op: "rename";
39
- from: string;
40
- to: string;
41
- }>, z.ZodObject<{
42
- op: z.ZodLiteral<"remove">;
43
- path: z.ZodString;
44
- }, "strip", z.ZodTypeAny, {
45
- op: "remove";
46
- path: string;
47
- }, {
48
- op: "remove";
49
- path: string;
50
- }>, z.ZodObject<{
51
- op: z.ZodLiteral<"copy">;
52
- from: z.ZodString;
53
- to: z.ZodString;
54
- }, "strip", z.ZodTypeAny, {
55
- op: "copy";
56
- from: string;
57
- to: string;
58
- }, {
59
- op: "copy";
60
- from: string;
61
- to: string;
62
- }>]>;
63
- export type TransformOp = z.infer<typeof TransformOpSchema>;
64
- export declare const TransformStepConfigSchema: z.ZodObject<{
65
- operations: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
66
- op: z.ZodLiteral<"set">;
67
- path: z.ZodString;
68
- value: z.ZodUnknown;
69
- }, "strip", z.ZodTypeAny, {
70
- op: "set";
71
- path: string;
72
- value?: unknown;
73
- }, {
74
- op: "set";
75
- path: string;
76
- value?: unknown;
77
- }>, z.ZodObject<{
78
- op: z.ZodLiteral<"rename">;
79
- from: z.ZodString;
80
- to: z.ZodString;
81
- }, "strip", z.ZodTypeAny, {
82
- op: "rename";
83
- from: string;
84
- to: string;
85
- }, {
86
- op: "rename";
87
- from: string;
88
- to: string;
89
- }>, z.ZodObject<{
90
- op: z.ZodLiteral<"remove">;
91
- path: z.ZodString;
92
- }, "strip", z.ZodTypeAny, {
93
- op: "remove";
94
- path: string;
95
- }, {
96
- op: "remove";
97
- path: string;
98
- }>, z.ZodObject<{
99
- op: z.ZodLiteral<"copy">;
100
- from: z.ZodString;
101
- to: z.ZodString;
102
- }, "strip", z.ZodTypeAny, {
103
- op: "copy";
104
- from: string;
105
- to: string;
106
- }, {
107
- op: "copy";
108
- from: string;
109
- to: string;
110
- }>]>, "many">;
111
- }, "strip", z.ZodTypeAny, {
112
- operations: ({
113
- op: "set";
114
- path: string;
115
- value?: unknown;
116
- } | {
117
- op: "rename";
118
- from: string;
119
- to: string;
120
- } | {
121
- op: "remove";
122
- path: string;
123
- } | {
124
- op: "copy";
125
- from: string;
126
- to: string;
127
- })[];
128
- }, {
129
- operations: ({
130
- op: "set";
131
- path: string;
132
- value?: unknown;
133
- } | {
134
- op: "rename";
135
- from: string;
136
- to: string;
137
- } | {
138
- op: "remove";
139
- path: string;
140
- } | {
141
- op: "copy";
142
- from: string;
143
- to: string;
144
- })[];
145
- }>;
146
- export type TransformStepConfig = z.infer<typeof TransformStepConfigSchema>;
147
- export interface TransformStepOutput extends Record<string, unknown> {
148
- applied: number;
149
- }
150
- export declare class TransformStep extends BaseActionStep<typeof TransformStepConfigSchema, TransformStepOutput> {
151
- readonly type = BuiltinStepType.TRANSFORM;
152
- readonly name = "Transform";
153
- readonly description = "Apply data transformations to the workflow context";
154
- readonly configSchema: z.ZodObject<{
155
- operations: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
156
- op: z.ZodLiteral<"set">;
157
- path: z.ZodString;
158
- value: z.ZodUnknown;
159
- }, "strip", z.ZodTypeAny, {
160
- op: "set";
161
- path: string;
162
- value?: unknown;
163
- }, {
164
- op: "set";
165
- path: string;
166
- value?: unknown;
167
- }>, z.ZodObject<{
168
- op: z.ZodLiteral<"rename">;
169
- from: z.ZodString;
170
- to: z.ZodString;
171
- }, "strip", z.ZodTypeAny, {
172
- op: "rename";
173
- from: string;
174
- to: string;
175
- }, {
176
- op: "rename";
177
- from: string;
178
- to: string;
179
- }>, z.ZodObject<{
180
- op: z.ZodLiteral<"remove">;
181
- path: z.ZodString;
182
- }, "strip", z.ZodTypeAny, {
183
- op: "remove";
184
- path: string;
185
- }, {
186
- op: "remove";
187
- path: string;
188
- }>, z.ZodObject<{
189
- op: z.ZodLiteral<"copy">;
190
- from: z.ZodString;
191
- to: z.ZodString;
192
- }, "strip", z.ZodTypeAny, {
193
- op: "copy";
194
- from: string;
195
- to: string;
196
- }, {
197
- op: "copy";
198
- from: string;
199
- to: string;
200
- }>]>, "many">;
201
- }, "strip", z.ZodTypeAny, {
202
- operations: ({
203
- op: "set";
204
- path: string;
205
- value?: unknown;
206
- } | {
207
- op: "rename";
208
- from: string;
209
- to: string;
210
- } | {
211
- op: "remove";
212
- path: string;
213
- } | {
214
- op: "copy";
215
- from: string;
216
- to: string;
217
- })[];
218
- }, {
219
- operations: ({
220
- op: "set";
221
- path: string;
222
- value?: unknown;
223
- } | {
224
- op: "rename";
225
- from: string;
226
- to: string;
227
- } | {
228
- op: "remove";
229
- path: string;
230
- } | {
231
- op: "copy";
232
- from: string;
233
- to: string;
234
- })[];
235
- }>;
236
- readonly outputSchema: z.ZodObject<{
237
- applied: z.ZodNumber;
238
- }, "strip", z.ZodTypeAny, {
239
- applied: number;
240
- }, {
241
- applied: number;
242
- }>;
243
- readonly category: StepCategory;
244
- readonly icon = "filter";
245
- execute(config: TransformStepConfig, ctx: StepExecutionContext): Promise<TransformStepOutput>;
246
- }
247
- //# sourceMappingURL=transform.step.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.step.d.ts","sourceRoot":"","sources":["../../../src/steps/builtin/transform.step.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO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