@xyne/workflow-sdk 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/agents/agent-step.d.ts.map +1 -1
  2. package/dist/agents/agent-step.js +10 -8
  3. package/dist/agents/agent-step.js.map +1 -1
  4. package/dist/ai-builder/client.d.ts +21 -0
  5. package/dist/ai-builder/client.d.ts.map +1 -0
  6. package/dist/ai-builder/client.js +29 -0
  7. package/dist/ai-builder/client.js.map +1 -0
  8. package/dist/ai-builder/index.d.ts +4 -0
  9. package/dist/ai-builder/index.d.ts.map +1 -0
  10. package/dist/ai-builder/index.js +3 -0
  11. package/dist/ai-builder/index.js.map +1 -0
  12. package/dist/ai-builder/types.d.ts +19 -0
  13. package/dist/ai-builder/types.d.ts.map +1 -0
  14. package/dist/ai-builder/types.js +2 -0
  15. package/dist/ai-builder/types.js.map +1 -0
  16. package/dist/client/index.d.ts +1 -1
  17. package/dist/client/index.d.ts.map +1 -1
  18. package/dist/client/types.d.ts +30 -3
  19. package/dist/client/types.d.ts.map +1 -1
  20. package/dist/client/workflow-client.d.ts.map +1 -1
  21. package/dist/client/workflow-client.js +33 -0
  22. package/dist/client/workflow-client.js.map +1 -1
  23. package/dist/persistence/in-memory-adapter.d.ts +23 -1
  24. package/dist/persistence/in-memory-adapter.d.ts.map +1 -1
  25. package/dist/persistence/in-memory-adapter.js +150 -1
  26. package/dist/persistence/in-memory-adapter.js.map +1 -1
  27. package/dist/persistence/types.d.ts +53 -1
  28. package/dist/persistence/types.d.ts.map +1 -1
  29. package/dist/router/workflow-router.d.ts.map +1 -1
  30. package/dist/router/workflow-router.js +236 -0
  31. package/dist/router/workflow-router.js.map +1 -1
  32. package/dist/runtime/types.d.ts +15 -0
  33. package/dist/runtime/types.d.ts.map +1 -1
  34. package/dist/runtime/workflow-runtime.d.ts +32 -2
  35. package/dist/runtime/workflow-runtime.d.ts.map +1 -1
  36. package/dist/runtime/workflow-runtime.js +36 -9
  37. package/dist/runtime/workflow-runtime.js.map +1 -1
  38. package/package.json +9 -1
  39. package/dist/common/principal.d.ts +0 -45
  40. package/dist/common/principal.d.ts.map +0 -1
  41. package/dist/common/principal.js +0 -9
  42. package/dist/common/principal.js.map +0 -1
  43. package/dist/steps/builtin/transform.step.d.ts +0 -247
  44. package/dist/steps/builtin/transform.step.d.ts.map +0 -1
  45. package/dist/steps/builtin/transform.step.js +0 -135
  46. package/dist/steps/builtin/transform.step.js.map +0 -1
  47. package/dist/types/attachment.d.ts +0 -23
  48. package/dist/types/attachment.d.ts.map +0 -1
  49. package/dist/types/attachment.js +0 -2
  50. package/dist/types/attachment.js.map +0 -1
  51. package/dist/types/resume-payload.d.ts +0 -34
  52. package/dist/types/resume-payload.d.ts.map +0 -1
  53. package/dist/types/resume-payload.js +0 -12
  54. package/dist/types/resume-payload.js.map +0 -1
  55. package/dist/util/executable-check.d.ts +0 -42
  56. package/dist/util/executable-check.d.ts.map +0 -1
  57. package/dist/util/executable-check.js +0 -115
  58. package/dist/util/executable-check.js.map +0 -1
@@ -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,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA4B9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB;AA+DD,qBAAa,aAAc,SAAQ,cAAc,CAC/C,OAAO,yBAAyB,EAChC,mBAAmB,CACpB;IACC,SAAkB,IAAI,6BAA6B;IACnD,SAAkB,IAAI,eAAe;IACrC,SAAkB,WAAW,wDAAwD;IACrF,SAAkB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA6B;IAC3D,SAAkB,YAAY;;;;;;OAA6B;IAC3D,SAAkB,QAAQ,EAAE,YAAY,CAAU;IAClD,SAAkB,IAAI,YAAY;IAEnB,OAAO,CACpB,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,oBAAoB,GACxB,OAAO,CAAC,mBAAmB,CAAC;CAyChC"}
@@ -1,135 +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 { BuiltinStepType } from '../../types/known-types.js';
15
- import { resolvePath } from '../../engine/variable-resolver.js';
16
- // ─── Config ───
17
- const SetOpSchema = z.object({
18
- op: z.literal('set'),
19
- path: z.string().min(1).describe('Dotted path where the value will be written'),
20
- value: z.unknown().describe('Value to set at the path'),
21
- });
22
- const RenameOpSchema = z.object({
23
- op: z.literal('rename'),
24
- from: z.string().min(1).describe('Source dotted path'),
25
- to: z.string().min(1).describe('Destination dotted path'),
26
- });
27
- const RemoveOpSchema = z.object({
28
- op: z.literal('remove'),
29
- path: z.string().min(1).describe('Dotted path to delete'),
30
- });
31
- const CopyOpSchema = z.object({
32
- op: z.literal('copy'),
33
- from: z.string().min(1).describe('Source dotted path'),
34
- to: z.string().min(1).describe('Destination dotted path'),
35
- });
36
- export const TransformOpSchema = z.discriminatedUnion('op', [
37
- SetOpSchema,
38
- RenameOpSchema,
39
- RemoveOpSchema,
40
- CopyOpSchema,
41
- ]);
42
- export const TransformStepConfigSchema = z.object({
43
- operations: z.array(TransformOpSchema).min(1).describe('Sequence of data transformation operations to apply'),
44
- });
45
- const TransformStepOutputSchema = z.object({
46
- applied: z.number(),
47
- });
48
- // ─── Helpers ───
49
- /**
50
- * Set a value at a dotted path on a target object.
51
- * Creates intermediate objects as needed.
52
- */
53
- function setAtPath(target, path, value) {
54
- const parts = path.split('.');
55
- let current = target;
56
- for (let i = 0; i < parts.length - 1; i++) {
57
- const key = parts[i];
58
- if (current[key] === undefined ||
59
- current[key] === null ||
60
- typeof current[key] !== 'object') {
61
- current[key] = {};
62
- }
63
- current = current[key];
64
- }
65
- current[parts[parts.length - 1]] = value;
66
- }
67
- /**
68
- * Delete a value at a dotted path.
69
- */
70
- function deleteAtPath(target, path) {
71
- const parts = path.split('.');
72
- let current = target;
73
- for (let i = 0; i < parts.length - 1; i++) {
74
- const key = parts[i];
75
- if (current[key] === undefined ||
76
- current[key] === null ||
77
- typeof current[key] !== 'object') {
78
- return false;
79
- }
80
- current = current[key];
81
- }
82
- const lastKey = parts[parts.length - 1];
83
- if (lastKey in current) {
84
- delete current[lastKey];
85
- return true;
86
- }
87
- return false;
88
- }
89
- // ─── Step ───
90
- export class TransformStep extends BaseActionStep {
91
- type = BuiltinStepType.TRANSFORM;
92
- name = 'Transform';
93
- description = 'Apply data transformations to the workflow context';
94
- configSchema = TransformStepConfigSchema;
95
- outputSchema = TransformStepOutputSchema;
96
- category = 'data';
97
- icon = 'filter';
98
- async execute(config, ctx) {
99
- let applied = 0;
100
- // Operate on the steps record
101
- const data = ctx.workflow.steps;
102
- for (const op of config.operations) {
103
- switch (op.op) {
104
- case 'set':
105
- setAtPath(data, op.path, op.value);
106
- applied++;
107
- break;
108
- case 'rename': {
109
- const value = resolvePath(ctx.workflow, op.from);
110
- if (value !== undefined) {
111
- setAtPath(data, op.to, value);
112
- deleteAtPath(data, op.from);
113
- applied++;
114
- }
115
- break;
116
- }
117
- case 'remove':
118
- if (deleteAtPath(data, op.path)) {
119
- applied++;
120
- }
121
- break;
122
- case 'copy': {
123
- const val = resolvePath(ctx.workflow, op.from);
124
- if (val !== undefined) {
125
- setAtPath(data, op.to, val);
126
- applied++;
127
- }
128
- break;
129
- }
130
- }
131
- }
132
- return { applied };
133
- }
134
- }
135
- //# sourceMappingURL=transform.step.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.step.js","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;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,iBAAiB;AAEjB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,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O,EAAE,CAAC;oBACV,MAAM;gBAER,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACd,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;oBACjD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBACxB,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;wBAC9B,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;wBAC5B,OAAO,EAAE,CAAC;oBACZ,CAAC;oBACD,MAAM;gBACR,CAAC;gBAED,KAAK,QAAQ;oBACX,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;wBAChC,OAAO,EAAE,CAAC;oBACZ,CAAC;oBACD,MAAM;gBAER,KAAK,MAAM,CAAC,CAAC,CAAC;oBACZ,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;oBAC/C,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;wBACtB,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;wBAC5B,OAAO,EAAE,CAAC;oBACZ,CAAC;oBACD,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Attachment — opaque reference to a file managed by the host's StorageAdapter.
3
- *
4
- * Used everywhere the framework carries a file:
5
- * - Trigger inputs (uploaded via `POST /uploads`, attached to `context.trigger.attachments`)
6
- * - Resume payloads (uploaded with feedback in a review-gate retry)
7
- * - Step inputs (rerunFromStep with attachments in configOverrides)
8
- *
9
- * The framework never opens `data` — it's a host-defined reference (URL,
10
- * blob ID, signed token, `mem://uuid`). Steps that need the bytes call
11
- * `StorageAdapter.read()` via a service the host registers.
12
- */
13
- export interface Attachment {
14
- /** Original filename — e.g. "contract.pdf". */
15
- name: string;
16
- /** MIME type — e.g. "application/pdf", "image/png". */
17
- mimeType: string;
18
- /** Opaque host reference. Framework treats this as a string. */
19
- data: string;
20
- /** Size in bytes — set by storage after upload. Useful for UI display + size budgets. */
21
- size?: number;
22
- }
23
- //# sourceMappingURL=attachment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/types/attachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=attachment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attachment.js","sourceRoot":"","sources":["../../src/types/attachment.ts"],"names":[],"mappings":""}
@@ -1,34 +0,0 @@
1
- /**
2
- * ResumePayload — the unified shape for resuming a paused execution.
3
- *
4
- * One contract for every pause type:
5
- * - Mid-execution agent pauses (tool approval, input required, user interrupted)
6
- * - Review gates (`onComplete: 'review'`)
7
- *
8
- * The router validates incoming bodies into this shape; persistence stores it
9
- * verbatim; the executor and step `onResume` handlers consume it.
10
- */
11
- import type { Attachment } from './attachment.js';
12
- /**
13
- * Alias for {@link Attachment} kept for clarity at call sites that historically
14
- * said "resume attachment". The shape is shared across the framework.
15
- */
16
- export type ResumeAttachment = Attachment;
17
- /**
18
- * What the user decided.
19
- * - `approve`: continue from a mid-pause OR advance past a review gate
20
- * - `retry`: re-execute the current step with `priorState` + `feedback` (review gate)
21
- * - `abort`: cancel the execution
22
- */
23
- export type ResumeAction = 'approve' | 'retry' | 'abort';
24
- /** Payload from the host when resuming a paused execution. */
25
- export interface ResumePayload {
26
- action: ResumeAction;
27
- /** User-provided text input (form feedback, instruction, additional context). */
28
- feedback?: string;
29
- /** Files uploaded alongside the feedback. Opaque references — host resolves. */
30
- attachments?: ResumeAttachment[];
31
- /** Step-specific extras from custom form fields. Opaque to the framework. */
32
- data?: Record<string, unknown>;
33
- }
34
- //# sourceMappingURL=resume-payload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resume-payload.d.ts","sourceRoot":"","sources":["../../src/types/resume-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzD,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * ResumePayload — the unified shape for resuming a paused execution.
3
- *
4
- * One contract for every pause type:
5
- * - Mid-execution agent pauses (tool approval, input required, user interrupted)
6
- * - Review gates (`onComplete: 'review'`)
7
- *
8
- * The router validates incoming bodies into this shape; persistence stores it
9
- * verbatim; the executor and step `onResume` handlers consume it.
10
- */
11
- export {};
12
- //# sourceMappingURL=resume-payload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resume-payload.js","sourceRoot":"","sources":["../../src/types/resume-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -1,42 +0,0 @@
1
- /**
2
- * Executable upload safety check.
3
- *
4
- * Allow-by-default with a deny-list of known dangerous types — covers the
5
- * common attack surface (native binaries, scripts that auto-run, installers,
6
- * macro-enabled Office docs) without forcing workflow authors to enumerate
7
- * every safe MIME type.
8
- *
9
- * Two checks run in parallel so spoofed MIME types alone can't bypass:
10
- * 1. MIME type matches the deny-list
11
- * 2. Filename extension matches the deny-list
12
- *
13
- * Either match blocks the upload. To accept executables (e.g. a security-
14
- * analysis workflow that intentionally examines binaries), the host opts
15
- * in via `RuntimeOptions.allowExecutableUploads = true`.
16
- */
17
- /**
18
- * MIME types treated as executable / unsafe (lowercase — input is also
19
- * lowercased before comparison).
20
- */
21
- export declare const BLOCKED_EXECUTABLE_MIME_TYPES: ReadonlySet<string>;
22
- /**
23
- * File extensions treated as executable / unsafe (case-insensitive, no dot).
24
- * The check uses the LAST extension so `report.exe.txt` is treated as text
25
- * (Windows shows the trailing extension, which is what the user actually sees).
26
- */
27
- export declare const BLOCKED_EXECUTABLE_EXTENSIONS: ReadonlySet<string>;
28
- /**
29
- * Extract the lowercase extension (no dot) from a filename, or '' if none.
30
- * A leading dot doesn't count — `.bashrc` has no extension, not "bashrc".
31
- */
32
- export declare function extensionOf(name: string): string;
33
- /**
34
- * Returns a human-readable reason if the file should be blocked as
35
- * executable, or `null` if it's safe.
36
- *
37
- * Always check both the MIME type and the filename — clients can spoof one
38
- * but rarely both. This is defense-in-depth, not authoritative malware
39
- * detection (run real AV at the storage layer for that).
40
- */
41
- export declare function isExecutable(mimeType: string, name: string): string | null;
42
- //# sourceMappingURL=executable-check.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executable-check.d.ts","sourceRoot":"","sources":["../../src/util/executable-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,MAAM,CAwC5D,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,MAAM,CAmB5D,CAAC;AAEH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS1E"}
@@ -1,115 +0,0 @@
1
- /**
2
- * Executable upload safety check.
3
- *
4
- * Allow-by-default with a deny-list of known dangerous types — covers the
5
- * common attack surface (native binaries, scripts that auto-run, installers,
6
- * macro-enabled Office docs) without forcing workflow authors to enumerate
7
- * every safe MIME type.
8
- *
9
- * Two checks run in parallel so spoofed MIME types alone can't bypass:
10
- * 1. MIME type matches the deny-list
11
- * 2. Filename extension matches the deny-list
12
- *
13
- * Either match blocks the upload. To accept executables (e.g. a security-
14
- * analysis workflow that intentionally examines binaries), the host opts
15
- * in via `RuntimeOptions.allowExecutableUploads = true`.
16
- */
17
- /**
18
- * MIME types treated as executable / unsafe (lowercase — input is also
19
- * lowercased before comparison).
20
- */
21
- export const BLOCKED_EXECUTABLE_MIME_TYPES = new Set([
22
- // Native binaries
23
- 'application/x-msdownload',
24
- 'application/x-msdos-program',
25
- 'application/x-executable',
26
- 'application/x-mach-binary',
27
- 'application/vnd.microsoft.portable-executable',
28
- 'application/x-msi',
29
- 'application/x-ms-installer',
30
- // Shell + Windows scripts
31
- 'application/x-sh',
32
- 'application/x-shellscript',
33
- 'application/x-bat',
34
- 'application/x-csh',
35
- 'application/x-cmd',
36
- 'application/x-msmetafile',
37
- // JavaScript / ECMAScript
38
- 'text/javascript',
39
- 'application/javascript',
40
- 'application/ecmascript',
41
- 'application/x-javascript',
42
- // Java / Flash
43
- 'application/java-archive',
44
- 'application/x-java-archive',
45
- 'application/x-java-jnlp-file',
46
- 'application/x-shockwave-flash',
47
- // Installer / package formats that bundle executables
48
- 'application/vnd.android.package-archive',
49
- 'application/x-debian-package',
50
- 'application/x-rpm',
51
- // Macro-enabled Office documents (lowercased — IANA tokens are case-insensitive)
52
- 'application/vnd.ms-word.document.macroenabled.12',
53
- 'application/vnd.ms-word.template.macroenabled.12',
54
- 'application/vnd.ms-excel.sheet.macroenabled.12',
55
- 'application/vnd.ms-excel.template.macroenabled.12',
56
- 'application/vnd.ms-excel.addin.macroenabled.12',
57
- 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
58
- 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
59
- 'application/vnd.ms-powerpoint.template.macroenabled.12',
60
- 'application/vnd.ms-powerpoint.addin.macroenabled.12',
61
- ]);
62
- /**
63
- * File extensions treated as executable / unsafe (case-insensitive, no dot).
64
- * The check uses the LAST extension so `report.exe.txt` is treated as text
65
- * (Windows shows the trailing extension, which is what the user actually sees).
66
- */
67
- export const BLOCKED_EXECUTABLE_EXTENSIONS = new Set([
68
- // Windows
69
- 'exe', 'msi', 'com', 'scr', 'cmd', 'bat', 'ps1', 'psm1',
70
- 'vbs', 'vbe', 'wsf', 'wsh', 'hta', 'cpl', 'lnk',
71
- 'dll', 'sys', 'drv', 'ocx',
72
- // macOS / Unix
73
- 'app', 'dmg', 'pkg',
74
- 'sh', 'bash', 'zsh', 'fish', 'csh', 'ksh', 'command', 'tool',
75
- // Java / Flash
76
- 'jar', 'war', 'jnlp', 'swf',
77
- // Mobile installers
78
- 'apk', 'ipa', 'xap',
79
- // Linux installers
80
- 'deb', 'rpm', 'run', 'bin',
81
- // JavaScript (auto-executes in browser / Node contexts)
82
- 'js', 'mjs', 'cjs',
83
- // Macro-enabled Office
84
- 'docm', 'dotm', 'xlsm', 'xltm', 'xlam', 'xlsb',
85
- 'pptm', 'potm', 'ppam', 'ppsm', 'sldm',
86
- ]);
87
- /**
88
- * Extract the lowercase extension (no dot) from a filename, or '' if none.
89
- * A leading dot doesn't count — `.bashrc` has no extension, not "bashrc".
90
- */
91
- export function extensionOf(name) {
92
- const dot = name.lastIndexOf('.');
93
- if (dot <= 0 || dot === name.length - 1)
94
- return '';
95
- return name.slice(dot + 1).toLowerCase();
96
- }
97
- /**
98
- * Returns a human-readable reason if the file should be blocked as
99
- * executable, or `null` if it's safe.
100
- *
101
- * Always check both the MIME type and the filename — clients can spoof one
102
- * but rarely both. This is defense-in-depth, not authoritative malware
103
- * detection (run real AV at the storage layer for that).
104
- */
105
- export function isExecutable(mimeType, name) {
106
- if (BLOCKED_EXECUTABLE_MIME_TYPES.has(mimeType.toLowerCase())) {
107
- return `Executable MIME type "${mimeType}" is not allowed.`;
108
- }
109
- const ext = extensionOf(name);
110
- if (ext && BLOCKED_EXECUTABLE_EXTENSIONS.has(ext)) {
111
- return `Files with .${ext} extension are not allowed.`;
112
- }
113
- return null;
114
- }
115
- //# sourceMappingURL=executable-check.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executable-check.js","sourceRoot":"","sources":["../../src/util/executable-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAwB,IAAI,GAAG,CAAC;IACxE,kBAAkB;IAClB,0BAA0B;IAC1B,6BAA6B;IAC7B,0BAA0B;IAC1B,2BAA2B;IAC3B,+CAA+C;IAC/C,mBAAmB;IACnB,4BAA4B;IAC5B,0BAA0B;IAC1B,kBAAkB;IAClB,2BAA2B;IAC3B,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,0BAA0B;IAC1B,0BAA0B;IAC1B,iBAAiB;IACjB,wBAAwB;IACxB,wBAAwB;IACxB,0BAA0B;IAC1B,eAAe;IACf,0BAA0B;IAC1B,4BAA4B;IAC5B,8BAA8B;IAC9B,+BAA+B;IAC/B,sDAAsD;IACtD,yCAAyC;IACzC,8BAA8B;IAC9B,mBAAmB;IACnB,iFAAiF;IACjF,kDAAkD;IAClD,kDAAkD;IAClD,gDAAgD;IAChD,mDAAmD;IACnD,gDAAgD;IAChD,uDAAuD;IACvD,4DAA4D;IAC5D,wDAA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