@xyne/workflow-sdk 2.5.0 → 2.7.0
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/dist/agents/builtin/chat-tools.d.ts +24 -0
- package/dist/agents/builtin/chat-tools.d.ts.map +1 -0
- package/dist/agents/builtin/chat-tools.js +49 -0
- package/dist/agents/builtin/chat-tools.js.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/ai-builder/client.d.ts +5 -2
- package/dist/ai-builder/client.d.ts.map +1 -1
- package/dist/ai-builder/client.js +7 -0
- package/dist/ai-builder/client.js.map +1 -1
- package/dist/ai-builder/index.d.ts +1 -1
- package/dist/ai-builder/index.d.ts.map +1 -1
- package/dist/ai-builder/index.js.map +1 -1
- package/dist/ai-builder/types.d.ts +19 -6
- package/dist/ai-builder/types.d.ts.map +1 -1
- package/dist/builder/index.d.ts +6 -3
- package/dist/builder/index.d.ts.map +1 -1
- package/dist/builder/index.js +4 -1
- package/dist/builder/index.js.map +1 -1
- package/dist/engine/config-validator.d.ts +8 -0
- package/dist/engine/config-validator.d.ts.map +1 -1
- package/dist/engine/config-validator.js +38 -15
- package/dist/engine/config-validator.js.map +1 -1
- package/dist/engine/variable-resolver.d.ts +9 -0
- package/dist/engine/variable-resolver.d.ts.map +1 -1
- package/dist/engine/variable-resolver.js +76 -0
- package/dist/engine/variable-resolver.js.map +1 -1
- package/dist/engine/workflow-executor.d.ts.map +1 -1
- package/dist/engine/workflow-executor.js +3 -3
- package/dist/engine/workflow-executor.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/router/workflow-router.d.ts.map +1 -1
- package/dist/router/workflow-router.js +132 -6
- package/dist/router/workflow-router.js.map +1 -1
- package/dist/steps/builtin/wait.step.d.ts +11 -0
- package/dist/steps/builtin/wait.step.d.ts.map +1 -1
- package/dist/steps/builtin/wait.step.js +31 -0
- package/dist/steps/builtin/wait.step.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/workflow-config.d.ts +20 -0
- package/dist/types/workflow-config.d.ts.map +1 -1
- package/dist/types/workflow-config.js.map +1 -1
- package/dist/util/citation-path.d.ts +39 -0
- package/dist/util/citation-path.d.ts.map +1 -0
- package/dist/util/citation-path.js +133 -0
- package/dist/util/citation-path.js.map +1 -0
- package/dist/util/pause-form-schema.d.ts +20 -0
- package/dist/util/pause-form-schema.d.ts.map +1 -0
- package/dist/util/pause-form-schema.js +25 -0
- package/dist/util/pause-form-schema.js.map +1 -0
- package/dist/util/type-compat.d.ts +35 -0
- package/dist/util/type-compat.d.ts.map +1 -0
- package/dist/util/type-compat.js +54 -0
- package/dist/util/type-compat.js.map +1 -0
- package/dist/util/variable-ref.d.ts +22 -0
- package/dist/util/variable-ref.d.ts.map +1 -1
- package/dist/util/variable-ref.js +23 -4
- package/dist/util/variable-ref.js.map +1 -1
- package/package.json +1 -1
- package/dist/common/principal.d.ts +0 -45
- package/dist/common/principal.d.ts.map +0 -1
- package/dist/common/principal.js +0 -9
- package/dist/common/principal.js.map +0 -1
- package/dist/steps/builtin/transform.step.d.ts +0 -247
- package/dist/steps/builtin/transform.step.d.ts.map +0 -1
- package/dist/steps/builtin/transform.step.js +0 -135
- package/dist/steps/builtin/transform.step.js.map +0 -1
- package/dist/types/attachment.d.ts +0 -23
- package/dist/types/attachment.d.ts.map +0 -1
- package/dist/types/attachment.js +0 -2
- package/dist/types/attachment.js.map +0 -1
- package/dist/types/resume-payload.d.ts +0 -34
- package/dist/types/resume-payload.d.ts.map +0 -1
- package/dist/types/resume-payload.js +0 -12
- package/dist/types/resume-payload.js.map +0 -1
- package/dist/util/executable-check.d.ts +0 -42
- package/dist/util/executable-check.d.ts.map +0 -1
- package/dist/util/executable-check.js +0 -115
- package/dist/util/executable-check.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pause-form-schema — derive a JSON Schema from a pause/approval form.
|
|
3
|
+
*
|
|
4
|
+
* The SDK owns both the `PauseForm` shape and the `ResumePayload` it produces,
|
|
5
|
+
* so the mapping from "the form the user fills in" to "the type of the submitted
|
|
6
|
+
* values" lives here once, reusable by any step that surfaces a `PauseForm`
|
|
7
|
+
* (today the WAIT step, via its `resolveOutputJsonSchema`). Form values are
|
|
8
|
+
* submitted under `ResumePayload.data` keyed by each field's `name`, so the
|
|
9
|
+
* returned schema is the shape of that `data` object.
|
|
10
|
+
*/
|
|
11
|
+
import type { PauseForm, PauseFormField } from '../types/pause-state.js';
|
|
12
|
+
/** Map a pause-form field type to the JSON Schema scalar kind of its value. */
|
|
13
|
+
export declare function jsonTypeForFormField(type: PauseFormField['type']): string;
|
|
14
|
+
/**
|
|
15
|
+
* JSON Schema for the values submitted by a `PauseForm` — an object keyed by
|
|
16
|
+
* each field's `name`. Left open (`additionalProperties: true`) since a host
|
|
17
|
+
* may include extra keys beyond the declared fields.
|
|
18
|
+
*/
|
|
19
|
+
export declare function pauseFormToJsonSchema(form: PauseForm): Record<string, unknown>;
|
|
20
|
+
//# sourceMappingURL=pause-form-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pause-form-schema.d.ts","sourceRoot":"","sources":["../../src/util/pause-form-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzE,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAUzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAM9E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Map a pause-form field type to the JSON Schema scalar kind of its value. */
|
|
2
|
+
export function jsonTypeForFormField(type) {
|
|
3
|
+
switch (type) {
|
|
4
|
+
case 'number':
|
|
5
|
+
return 'number';
|
|
6
|
+
case 'checkbox':
|
|
7
|
+
return 'boolean';
|
|
8
|
+
// text / textarea / select all submit string values
|
|
9
|
+
default:
|
|
10
|
+
return 'string';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* JSON Schema for the values submitted by a `PauseForm` — an object keyed by
|
|
15
|
+
* each field's `name`. Left open (`additionalProperties: true`) since a host
|
|
16
|
+
* may include extra keys beyond the declared fields.
|
|
17
|
+
*/
|
|
18
|
+
export function pauseFormToJsonSchema(form) {
|
|
19
|
+
const properties = {};
|
|
20
|
+
for (const field of form.fields) {
|
|
21
|
+
properties[field.name] = { type: jsonTypeForFormField(field.type), title: field.name };
|
|
22
|
+
}
|
|
23
|
+
return { type: 'object', properties, additionalProperties: true };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=pause-form-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pause-form-schema.js","sourceRoot":"","sources":["../../src/util/pause-form-schema.ts"],"names":[],"mappings":"AAYA,+EAA+E;AAC/E,MAAM,UAAU,oBAAoB,CAAC,IAA4B;IAC/D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,UAAU;YACb,OAAO,SAAS,CAAC;QACnB,oDAAoD;QACpD;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAe;IACnD,MAAM,UAAU,GAA4B,EAAE,CAAC;IAC/C,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IACzF,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* type-compat — the single source of truth for "can a `{{ref}}` of one type be
|
|
3
|
+
* bound into a field of another type?"
|
|
4
|
+
*
|
|
5
|
+
* This rule is enforced in three layers that must never drift:
|
|
6
|
+
* - the builder's variable picker (UI, JSON-Schema side) — which refs to offer;
|
|
7
|
+
* - the config validator (`TYPE_MISMATCH`, JSON-Schema source vs Zod consumer);
|
|
8
|
+
* - the runtime (coercion before `safeParse`).
|
|
9
|
+
*
|
|
10
|
+
* It is expressed over a **neutral** `TypeKind`, NOT Zod or JSON-Schema types,
|
|
11
|
+
* because it straddles both worlds: the consumer side is Zod, but the source
|
|
12
|
+
* side is JSON Schema that crosses the wire to the browser (no Zod instance
|
|
13
|
+
* there). Each world maps *into* `TypeKind` via its own adapter
|
|
14
|
+
* (`jsonSchemaKind` / `zodConsumerKind` in the validator); this module never
|
|
15
|
+
* touches a schema object. This is a deliberate anti-corruption boundary, and
|
|
16
|
+
* keeps the predicate serializable and Zod-version-agnostic.
|
|
17
|
+
*/
|
|
18
|
+
/** The neutral, coarse type vocabulary both schema worlds normalize into. */
|
|
19
|
+
export declare const TYPE_KINDS: readonly ["string", "number", "boolean", "array", "object", "scalar", "unknown"];
|
|
20
|
+
export type TypeKind = (typeof TYPE_KINDS)[number];
|
|
21
|
+
/**
|
|
22
|
+
* Can a value of `source` kind be bound into a `target` (consumer) kind field?
|
|
23
|
+
*
|
|
24
|
+
* Loose by design (matches the validator's long-standing rule):
|
|
25
|
+
* - `unknown`/freeform on either side is always compatible (can't be checked);
|
|
26
|
+
* - any source coerces into a `string` target — string is the universal sink
|
|
27
|
+
* (templates stringify, and the runtime stringifies pure refs too);
|
|
28
|
+
* - equal kinds are compatible;
|
|
29
|
+
* - scalar↔scalar is compatible (number↔enum, etc.).
|
|
30
|
+
*
|
|
31
|
+
* Notably strict: `array`/`object` only accept their own kind (or a `string`
|
|
32
|
+
* target, or an `unknown` either side).
|
|
33
|
+
*/
|
|
34
|
+
export declare function kindsCompatible(source: TypeKind, target: TypeKind): boolean;
|
|
35
|
+
//# sourceMappingURL=type-compat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-compat.d.ts","sourceRoot":"","sources":["../../src/util/type-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,UAAU,kFAWb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAInD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAK3E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* type-compat — the single source of truth for "can a `{{ref}}` of one type be
|
|
3
|
+
* bound into a field of another type?"
|
|
4
|
+
*
|
|
5
|
+
* This rule is enforced in three layers that must never drift:
|
|
6
|
+
* - the builder's variable picker (UI, JSON-Schema side) — which refs to offer;
|
|
7
|
+
* - the config validator (`TYPE_MISMATCH`, JSON-Schema source vs Zod consumer);
|
|
8
|
+
* - the runtime (coercion before `safeParse`).
|
|
9
|
+
*
|
|
10
|
+
* It is expressed over a **neutral** `TypeKind`, NOT Zod or JSON-Schema types,
|
|
11
|
+
* because it straddles both worlds: the consumer side is Zod, but the source
|
|
12
|
+
* side is JSON Schema that crosses the wire to the browser (no Zod instance
|
|
13
|
+
* there). Each world maps *into* `TypeKind` via its own adapter
|
|
14
|
+
* (`jsonSchemaKind` / `zodConsumerKind` in the validator); this module never
|
|
15
|
+
* touches a schema object. This is a deliberate anti-corruption boundary, and
|
|
16
|
+
* keeps the predicate serializable and Zod-version-agnostic.
|
|
17
|
+
*/
|
|
18
|
+
/** The neutral, coarse type vocabulary both schema worlds normalize into. */
|
|
19
|
+
export const TYPE_KINDS = [
|
|
20
|
+
'string',
|
|
21
|
+
'number',
|
|
22
|
+
'boolean',
|
|
23
|
+
'array',
|
|
24
|
+
'object',
|
|
25
|
+
// `scalar` is an intentional coarsening bucket (enum / literal / date) so the
|
|
26
|
+
// loose scalar↔scalar rule below has a single home.
|
|
27
|
+
'scalar',
|
|
28
|
+
// `unknown` = freeform / no declared type / union — unverifiable, so wildcard.
|
|
29
|
+
'unknown',
|
|
30
|
+
];
|
|
31
|
+
const SCALAR_KINDS = new Set(['string', 'number', 'boolean', 'scalar']);
|
|
32
|
+
/**
|
|
33
|
+
* Can a value of `source` kind be bound into a `target` (consumer) kind field?
|
|
34
|
+
*
|
|
35
|
+
* Loose by design (matches the validator's long-standing rule):
|
|
36
|
+
* - `unknown`/freeform on either side is always compatible (can't be checked);
|
|
37
|
+
* - any source coerces into a `string` target — string is the universal sink
|
|
38
|
+
* (templates stringify, and the runtime stringifies pure refs too);
|
|
39
|
+
* - equal kinds are compatible;
|
|
40
|
+
* - scalar↔scalar is compatible (number↔enum, etc.).
|
|
41
|
+
*
|
|
42
|
+
* Notably strict: `array`/`object` only accept their own kind (or a `string`
|
|
43
|
+
* target, or an `unknown` either side).
|
|
44
|
+
*/
|
|
45
|
+
export function kindsCompatible(source, target) {
|
|
46
|
+
if (source === 'unknown' || target === 'unknown')
|
|
47
|
+
return true;
|
|
48
|
+
if (target === 'string')
|
|
49
|
+
return true;
|
|
50
|
+
if (source === target)
|
|
51
|
+
return true;
|
|
52
|
+
return SCALAR_KINDS.has(source) && SCALAR_KINDS.has(target);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=type-compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-compat.js","sourceRoot":"","sources":["../../src/util/type-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,8EAA8E;IAC9E,oDAAoD;IACpD,QAAQ;IACR,+EAA+E;IAC/E,SAAS;CACD,CAAC;AAIX,MAAM,YAAY,GAAG,IAAI,GAAG,CAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,MAAgB,EAAE,MAAgB;IAChE,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC9D,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -50,6 +50,28 @@ export interface FoundRef {
|
|
|
50
50
|
* (strings, arrays, objects). Used by the config validator to flag unresolvable refs.
|
|
51
51
|
*/
|
|
52
52
|
export declare function collectRefs(value: unknown, prefix: string): FoundRef[];
|
|
53
|
+
/**
|
|
54
|
+
* Parsed view of a ref path's head. Mirrors the branching in
|
|
55
|
+
* `resolvePath` (engine/variable-resolver.ts) — the single rule for how a
|
|
56
|
+
* dotted ref maps to a source:
|
|
57
|
+
*
|
|
58
|
+
* trigger.x.y → { source: 'trigger', path: 'x.y' }
|
|
59
|
+
* workflow.id → { source: 'workflow', path: 'id' }
|
|
60
|
+
* steps.stepId.output.field → { source: 'step', stepId, path: 'output.field' }
|
|
61
|
+
* stepId.output.field → { source: 'step', stepId, path: 'output.field' } (shorthand)
|
|
62
|
+
*
|
|
63
|
+
* Transient/derived — never persisted. `path` is the remainder after the head
|
|
64
|
+
* (and stepId for step refs), e.g. `output.body.status`.
|
|
65
|
+
*/
|
|
66
|
+
export interface ParsedRef {
|
|
67
|
+
source: 'step' | 'trigger' | 'workflow';
|
|
68
|
+
/** Producing step id — present iff `source === 'step'`. */
|
|
69
|
+
stepId?: string | undefined;
|
|
70
|
+
/** Sub-path after the head/stepId, e.g. `output.body.status` or `rrn`. */
|
|
71
|
+
path?: string | undefined;
|
|
72
|
+
}
|
|
73
|
+
/** Parse a dotted ref path into its source/stepId/path. Pure; no context. */
|
|
74
|
+
export declare function parseRef(refPath: string): ParsedRef;
|
|
53
75
|
/**
|
|
54
76
|
* Find the ids of every step whose config references `stepId`'s output
|
|
55
77
|
* (e.g. `{{stepId.output.x}}`). Used to warn before deleting a referenced step.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-ref.d.ts","sourceRoot":"","sources":["../../src/util/variable-ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,6BAA6B,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAkC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,+BAA+B,oBAAoB,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAK/C;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAoB1D;AAED,0EAA0E;AAC1E,wBAAgB,SAA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ACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAItE;AA0BD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IACxC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAoBnD;AAkED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAWrF"}
|
|
@@ -86,6 +86,27 @@ function walk(value, prefix, out) {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
/** Parse a dotted ref path into its source/stepId/path. Pure; no context. */
|
|
90
|
+
export function parseRef(refPath) {
|
|
91
|
+
const segments = refPath.split('.').filter((s) => s.length > 0);
|
|
92
|
+
const head = segments[0];
|
|
93
|
+
if (head === 'trigger' || head === 'workflow') {
|
|
94
|
+
return { source: head, path: segments.slice(1).join('.') || undefined };
|
|
95
|
+
}
|
|
96
|
+
if (head === 'steps') {
|
|
97
|
+
return {
|
|
98
|
+
source: 'step',
|
|
99
|
+
stepId: segments[1],
|
|
100
|
+
path: segments.slice(2).join('.') || undefined,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// Shorthand: bare step id → context.steps[id]
|
|
104
|
+
return {
|
|
105
|
+
source: 'step',
|
|
106
|
+
stepId: head,
|
|
107
|
+
path: segments.slice(1).join('.') || undefined,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
89
110
|
// ─── Reference integrity (who points at a given step) ───
|
|
90
111
|
function isStepLike(v) {
|
|
91
112
|
return (!!v &&
|
|
@@ -95,10 +116,8 @@ function isStepLike(v) {
|
|
|
95
116
|
}
|
|
96
117
|
/** True if a ref path targets `stepId` (`stepId.…` shorthand or `steps.stepId.…`). */
|
|
97
118
|
function refTargetsStep(refPath, stepId) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
refPath === `steps.${stepId}` ||
|
|
101
|
-
refPath.startsWith(`steps.${stepId}.`));
|
|
119
|
+
const parsed = parseRef(refPath);
|
|
120
|
+
return parsed.source === 'step' && parsed.stepId === stepId;
|
|
102
121
|
}
|
|
103
122
|
/**
|
|
104
123
|
* Collect ref paths from a step's OWN config, NOT descending into nested step
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-ref.js","sourceRoot":"","sources":["../../src/util/variable-ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAElE;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,iBAAiB,CAAC;AAMjE,gEAAgE;AAChE,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,MAAM,MAAM,GAAuB,EAAE,CAAC;IACtC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,SAAS,GAAG,CAAC,CAAC;IAE1B,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAClD,IAAI,KAAK,CAAC,KAAK,GAAG,SAAS,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC;aAC1C,CAAC,CAAC;QACL,CAAC;QACD,MAAM,C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,EAAE,CAAC;YACzB,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC,CAAC;gBACZ,SAAS,CAAE,IAA6B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAC1D,CAAC;iBAAM,CAAC;gBACN,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;QACD,OAAO;IACT,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC,EAAE,CAAC;YAChE,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAsB,EAAE,MAAc;IACzE,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;QAC/B,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM;YAAE,OAAO;QAC/B,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,kBAAkB,CAAE,IAA6B,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAChE,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -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"}
|
package/dist/common/principal.js
DELETED
|
@@ -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":"","s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