@xyne/workflow-sdk 3.2.29 → 3.2.32

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 (109) hide show
  1. package/dist/agents/agent-step.d.ts +9 -3
  2. package/dist/agents/agent-step.d.ts.map +1 -1
  3. package/dist/agents/agent-step.js +11 -9
  4. package/dist/agents/agent-step.js.map +1 -1
  5. package/dist/agents/citation-resolve.d.ts.map +1 -1
  6. package/dist/agents/citation-resolve.js +2 -2
  7. package/dist/agents/citation-resolve.js.map +1 -1
  8. package/dist/client/index.d.ts +1 -1
  9. package/dist/client/index.d.ts.map +1 -1
  10. package/dist/client/types.d.ts +35 -17
  11. package/dist/client/types.d.ts.map +1 -1
  12. package/dist/client/workflow-client.d.ts.map +1 -1
  13. package/dist/client/workflow-client.js +24 -13
  14. package/dist/client/workflow-client.js.map +1 -1
  15. package/dist/common/citation-ref.d.ts +32 -21
  16. package/dist/common/citation-ref.d.ts.map +1 -1
  17. package/dist/common/citation-ref.js +40 -27
  18. package/dist/common/citation-ref.js.map +1 -1
  19. package/dist/common/credentials.d.ts +258 -0
  20. package/dist/common/credentials.d.ts.map +1 -0
  21. package/dist/common/credentials.js +176 -0
  22. package/dist/common/credentials.js.map +1 -0
  23. package/dist/common/expression-eval.d.ts +35 -0
  24. package/dist/common/expression-eval.d.ts.map +1 -0
  25. package/dist/common/expression-eval.js +214 -0
  26. package/dist/common/expression-eval.js.map +1 -0
  27. package/dist/common/index.d.ts +7 -1
  28. package/dist/common/index.d.ts.map +1 -1
  29. package/dist/common/index.js +19 -1
  30. package/dist/common/index.js.map +1 -1
  31. package/dist/common/principal.d.ts +45 -0
  32. package/dist/common/principal.d.ts.map +1 -0
  33. package/dist/common/principal.js +9 -0
  34. package/dist/common/principal.js.map +1 -0
  35. package/dist/engine/workflow-executor.d.ts.map +1 -1
  36. package/dist/engine/workflow-executor.js +24 -9
  37. package/dist/engine/workflow-executor.js.map +1 -1
  38. package/dist/index.d.ts +4 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/persistence/in-memory-adapter.d.ts +93 -29
  43. package/dist/persistence/in-memory-adapter.d.ts.map +1 -1
  44. package/dist/persistence/in-memory-adapter.js +171 -52
  45. package/dist/persistence/in-memory-adapter.js.map +1 -1
  46. package/dist/persistence/types.d.ts +84 -26
  47. package/dist/persistence/types.d.ts.map +1 -1
  48. package/dist/router/workflow-router.d.ts +3 -1
  49. package/dist/router/workflow-router.d.ts.map +1 -1
  50. package/dist/router/workflow-router.js +218 -40
  51. package/dist/router/workflow-router.js.map +1 -1
  52. package/dist/runtime/workflow-runtime.d.ts +22 -30
  53. package/dist/runtime/workflow-runtime.d.ts.map +1 -1
  54. package/dist/runtime/workflow-runtime.js +46 -54
  55. package/dist/runtime/workflow-runtime.js.map +1 -1
  56. package/dist/steps/base-step.d.ts +12 -26
  57. package/dist/steps/base-step.d.ts.map +1 -1
  58. package/dist/steps/base-step.js +2 -4
  59. package/dist/steps/base-step.js.map +1 -1
  60. package/dist/steps/builtin/code.step.d.ts +7 -3
  61. package/dist/steps/builtin/code.step.d.ts.map +1 -1
  62. package/dist/steps/builtin/code.step.js +77 -47
  63. package/dist/steps/builtin/code.step.js.map +1 -1
  64. package/dist/steps/builtin/http-request.step.d.ts +18 -264
  65. package/dist/steps/builtin/http-request.step.d.ts.map +1 -1
  66. package/dist/steps/builtin/http-request.step.js +48 -157
  67. package/dist/steps/builtin/http-request.step.js.map +1 -1
  68. package/dist/steps/builtin/ssrf-guard.d.ts +9 -0
  69. package/dist/steps/builtin/ssrf-guard.d.ts.map +1 -0
  70. package/dist/steps/builtin/ssrf-guard.js +115 -0
  71. package/dist/steps/builtin/ssrf-guard.js.map +1 -0
  72. package/dist/steps/builtin/switch.step.d.ts +14 -14
  73. package/dist/steps/builtin/transform.step.d.ts +247 -0
  74. package/dist/steps/builtin/transform.step.d.ts.map +1 -0
  75. package/dist/steps/builtin/transform.step.js +135 -0
  76. package/dist/steps/builtin/transform.step.js.map +1 -0
  77. package/dist/steps/builtin/wait.step.d.ts +56 -56
  78. package/dist/steps/step-registry.d.ts +1 -3
  79. package/dist/steps/step-registry.d.ts.map +1 -1
  80. package/dist/steps/step-registry.js +0 -1
  81. package/dist/steps/step-registry.js.map +1 -1
  82. package/dist/testing/index.d.ts +1 -1
  83. package/dist/testing/index.d.ts.map +1 -1
  84. package/dist/testing/index.js +1 -1
  85. package/dist/testing/index.js.map +1 -1
  86. package/dist/testing/mock-step-context.d.ts +7 -2
  87. package/dist/testing/mock-step-context.d.ts.map +1 -1
  88. package/dist/testing/mock-step-context.js +9 -1
  89. package/dist/testing/mock-step-context.js.map +1 -1
  90. package/dist/triggers/webhook-trigger.d.ts +1 -5
  91. package/dist/triggers/webhook-trigger.d.ts.map +1 -1
  92. package/dist/triggers/webhook-trigger.js.map +1 -1
  93. package/dist/types/attachment.d.ts +23 -0
  94. package/dist/types/attachment.d.ts.map +1 -0
  95. package/dist/types/attachment.js +2 -0
  96. package/dist/types/attachment.js.map +1 -0
  97. package/dist/types/resume-payload.d.ts +34 -0
  98. package/dist/types/resume-payload.d.ts.map +1 -0
  99. package/dist/types/resume-payload.js +12 -0
  100. package/dist/types/resume-payload.js.map +1 -0
  101. package/dist/util/executable-check.d.ts +42 -0
  102. package/dist/util/executable-check.d.ts.map +1 -0
  103. package/dist/util/executable-check.js +115 -0
  104. package/dist/util/executable-check.js.map +1 -0
  105. package/package.json +2 -2
  106. package/dist/authz/principal-field.d.ts +0 -23
  107. package/dist/authz/principal-field.d.ts.map +0 -1
  108. package/dist/authz/principal-field.js +0 -34
  109. package/dist/authz/principal-field.js.map +0 -1
@@ -2,6 +2,7 @@ import type { StepExecutionContext, ControlFlowExecutionContext } from '../steps
2
2
  import { ServiceRegistry } from '../engine/service-registry.js';
3
3
  import type { WorkflowContext } from '../types/context.js';
4
4
  import type { StepProgressEvent } from '../types/step-events.js';
5
+ import type { ResolvedCredential, AuthSpecificValues, CredentialAuthType, CredentialStatus } from '../common/credentials.js';
5
6
  interface MockStepContextOptions<TServices extends Record<string, unknown> = Record<string, unknown>> {
6
7
  /** Override the full workflow context. */
7
8
  workflow?: WorkflowContext;
@@ -9,8 +10,6 @@ interface MockStepContextOptions<TServices extends Record<string, unknown> = Rec
9
10
  runtime?: Partial<StepExecutionContext['runtime']>;
10
11
  /** Provide a pre-built ServiceRegistry. */
11
12
  services?: ServiceRegistry<TServices>;
12
- /** Pre-resolved credentials. */
13
- credentials?: StepExecutionContext['credentials'];
14
13
  /** Override static data methods. */
15
14
  staticData?: Partial<StepExecutionContext['staticData']>;
16
15
  /** Override logger methods. */
@@ -25,6 +24,8 @@ interface MockStepContextOptions<TServices extends Record<string, unknown> = Rec
25
24
  storage?: StepExecutionContext['storage'];
26
25
  /** Inject a sandbox adapter (code execution). */
27
26
  sandbox?: StepExecutionContext['sandbox'];
27
+ /** Inject credentials already resolved by the executor. */
28
+ credentials?: StepExecutionContext<TServices>['credentials'];
28
29
  }
29
30
  /**
30
31
  * Create a mock StepExecutionContext for testing action steps.
@@ -49,5 +50,9 @@ export declare function createMockControlFlowContext<TServices extends Record<st
49
50
  branchKey: string | undefined;
50
51
  }>;
51
52
  };
53
+ export declare function mockResolvedCredential(authType: CredentialAuthType, values: AuthSpecificValues, opts?: {
54
+ name?: string;
55
+ status?: CredentialStatus;
56
+ }): ResolvedCredential;
52
57
  export {};
53
58
  //# sourceMappingURL=mock-step-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock-step-context.d.ts","sourceRoot":"","sources":["../../src/testing/mock-step-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE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,CAAC;CACxD,GACA,2BAA2B,CAAC,SAAS,CAAC,GAAG;IAC1C,iDAAiD;IACjD,eAAe,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAAC,OAAO,EAAE,eAAe,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;CACvG,CAaA;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE,GAClD,kBAAkB,CAMpB"}
@@ -1,6 +1,7 @@
1
1
  import { createPauseFunction } from '../steps/base-step.js';
2
2
  import { ServiceRegistry } from '../engine/service-registry.js';
3
3
  import { createMockContext } from './mock-context.js';
4
+ import { validateCredentialAuth } from '../common/credentials.js';
4
5
  /**
5
6
  * Create a mock StepExecutionContext for testing action steps.
6
7
  *
@@ -26,9 +27,9 @@ export function createMockStepContext(options) {
26
27
  ...(options?.rawConfig ? { rawConfig: options.rawConfig } : {}),
27
28
  ...(options?.storage ? { storage: options.storage } : {}),
28
29
  ...(options?.sandbox ? { sandbox: options.sandbox } : {}),
30
+ credentials: options?.credentials ?? {},
29
31
  services: options?.services ??
30
32
  new ServiceRegistry(),
31
- credentials: options?.credentials ?? {},
32
33
  staticData: {
33
34
  get: options?.staticData?.get ?? (() => Promise.resolve(undefined)),
34
35
  set: options?.staticData?.set ?? noopAsync,
@@ -60,4 +61,11 @@ export function createMockControlFlowContext(options) {
60
61
  walkBranchCalls: calls,
61
62
  };
62
63
  }
64
+ export function mockResolvedCredential(authType, values, opts) {
65
+ return {
66
+ name: opts?.name ?? `mock_${authType}`,
67
+ status: opts?.status ?? 'ACTIVE',
68
+ ...validateCredentialAuth(authType, values),
69
+ };
70
+ }
63
71
  //# sourceMappingURL=mock-step-context.js.map
@@ -1 +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ChC,GAAG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC5C,CAAC;AACJ,CAAC"}
@@ -20,11 +20,7 @@ export interface WebhookHandleResult {
20
20
  export interface WebhookActivationContext {
21
21
  /** The full URL the webhook will be reachable at. */
22
22
  webhookUrl: string;
23
- /** Resolved credentials if the trigger declares credentialSlots. */
24
- credentials: Record<string, {
25
- type: string;
26
- data: Record<string, unknown>;
27
- }>;
23
+ credentials: Record<string, never>;
28
24
  }
29
25
  /**
30
26
  * Webhook trigger — fires when an external HTTP request hits the webhook URL.
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-trigger.d.ts","sourceRoot":"","sources":["../../src/triggers/webhook-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACvD,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,qDAAqD;IACrD,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,WAA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,"file":"webhook-trigger.js","sourceRoot":"","sources":["../../src/triggers/webhook-trigger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA8BhD,yBAAyB;AAEzB;;;;;;;GAOG;AACH,MAAM,OAAgB,cAEpB,SAAQ,WAAoB;CA2B7B"}
@@ -0,0 +1,23 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.js","sourceRoot":"","sources":["../../src/types/attachment.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume-payload.js","sourceRoot":"","sources":["../../src/types/resume-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,42 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,115 @@
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
@@ -0,0 +1 @@
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,wDAAwD;IACxD,qDAAqD;CACtD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAwB,IAAI,GAAG,CAAC;IACxE,UAAU;IACV,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;IACvD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IAC/C,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IAC1B,eAAe;IACf,KAAK,EAAE,KAAK,EAAE,KAAK;IACnB,IAAI,EAAE,MAAM,EAAE,KAAK,EAA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name": "@xyne/workflow-sdk",
3
- "version": "3.2.29",
3
+ "version": "3.2.32",
4
4
  "description": "Workflow engine SDK — steps, triggers, executor, agents, and a framework-agnostic HTTP router.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -90,7 +90,7 @@
90
90
  "test": "vitest run",
91
91
  "test:watch": "vitest",
92
92
  "test:coverage": "vitest run --coverage",
93
- "prepublishOnly": "npm run typecheck && npm run build && npm test"
93
+ "prepublishOnly": "npm run typecheck && npm run build"
94
94
  },
95
95
  "dependencies": {
96
96
  "zod": "^3.25.76",
@@ -1,23 +0,0 @@
1
- /**
2
- * Schema-authoring helpers for principal-reference fields (approval `assignee`,
3
- * access grants). A field marked with one of these formats is rendered by the
4
- * UI's host-supplied `PrincipalPicker` slot; the stored value is an opaque
5
- * `{ kind, id }` reference the authorizer resolves. The SDK never interprets it.
6
- */
7
- /**
8
- * JSON Schema `format` marker for a principal reference. Whether the field holds
9
- * one principal or a list is the field's own `type` (`object` vs `array`) — the
10
- * builder derives multi-select from that, so a single format marker suffices.
11
- */
12
- export declare const PRINCIPAL_FORMAT = "principal";
13
- /**
14
- * Stamp `format: 'principal'` onto the named properties of a config JSON Schema,
15
- * so the builder renders the host's `PrincipalPicker` for them. Works for both
16
- * single (`type: 'object'`) and list (`type: 'array'`) fields — the author
17
- * declares the type; this only adds the marker.
18
- *
19
- * Mirrors {@link markAttachmentFields}. Use it in a step's
20
- * `decorateConfigSchema` for its `assignee`-style fields.
21
- */
22
- export declare function markPrincipalFields(jsonSchema: Record<string, unknown>, fields: readonly string[]): Record<string, unknown>;
23
- //# sourceMappingURL=principal-field.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"principal-field.d.ts","sourceRoot":"","sources":["../../src/authz/principal-field.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzB"}
@@ -1,34 +0,0 @@
1
- /**
2
- * Schema-authoring helpers for principal-reference fields (approval `assignee`,
3
- * access grants). A field marked with one of these formats is rendered by the
4
- * UI's host-supplied `PrincipalPicker` slot; the stored value is an opaque
5
- * `{ kind, id }` reference the authorizer resolves. The SDK never interprets it.
6
- */
7
- /**
8
- * JSON Schema `format` marker for a principal reference. Whether the field holds
9
- * one principal or a list is the field's own `type` (`object` vs `array`) — the
10
- * builder derives multi-select from that, so a single format marker suffices.
11
- */
12
- export const PRINCIPAL_FORMAT = 'principal';
13
- /**
14
- * Stamp `format: 'principal'` onto the named properties of a config JSON Schema,
15
- * so the builder renders the host's `PrincipalPicker` for them. Works for both
16
- * single (`type: 'object'`) and list (`type: 'array'`) fields — the author
17
- * declares the type; this only adds the marker.
18
- *
19
- * Mirrors {@link markAttachmentFields}. Use it in a step's
20
- * `decorateConfigSchema` for its `assignee`-style fields.
21
- */
22
- export function markPrincipalFields(jsonSchema, fields) {
23
- const props = jsonSchema['properties'];
24
- if (!props)
25
- return jsonSchema;
26
- for (const field of fields) {
27
- const prop = props[field];
28
- if (!prop)
29
- continue;
30
- props[field] = { ...prop, format: PRINCIPAL_FORMAT };
31
- }
32
- return jsonSchema;
33
- }
34
- //# sourceMappingURL=principal-field.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"principal-field.js","sourceRoot":"","sources":["../../src/authz/principal-field.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAmC,EACnC,MAAyB;IAEzB,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAExB,CAAC;IACd,IAAI,CAAC,KAAK;QAAE,OAAO,UAAU,CAAC;IAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IACvD,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}