@workglow/tasks 0.2.8 → 0.2.10

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/common.d.ts CHANGED
@@ -158,5 +158,5 @@ import { VectorNormalizeTask } from "./task/vector/VectorNormalizeTask";
158
158
  import { VectorScaleTask } from "./task/vector/VectorScaleTask";
159
159
  import { VectorSubtractTask } from "./task/vector/VectorSubtractTask";
160
160
  import { VectorSumTask } from "./task/vector/VectorSumTask";
161
- export declare let registerCommonTasks: () => (typeof ScalarAddTask | typeof ScalarDivideTask | typeof ScalarMultiplyTask | typeof ScalarSubtractTask | typeof ScalarSumTask | typeof VectorDivideTask | typeof VectorMultiplyTask | typeof VectorSubtractTask | typeof VectorSumTask | typeof DateFormatTask | typeof DebugLogTask | typeof DelayTask | typeof FetchUrlTask | typeof HumanInputTask | typeof HumanApprovalTask | typeof ImageBlurTask | typeof ImageBorderTask | typeof ImageBrightnessTask | typeof ImageContrastTask | typeof ImageCropTask | typeof ImageFlipTask | typeof ImageGrayscaleTask | typeof ImageInvertTask | typeof ImagePixelateTask | typeof ImagePosterizeTask | typeof ImageResizeTask | typeof ImageRotateTask | typeof ImageSepiaTask | typeof ImageTextTask | typeof ImageThresholdTask | typeof ImageTintTask | typeof ImageTransparencyTask | typeof ImageWatermarkTask | typeof InputTask | typeof JavaScriptTask | typeof JsonPathTask | typeof JsonTask | typeof LambdaTask | typeof McpListTask | typeof McpPromptGetTask | typeof McpResourceReadTask | typeof McpSearchTask | typeof McpToolCallTask | typeof MergeTask | typeof RegexTask | typeof ScalarAbsTask | typeof ScalarCeilTask | typeof ScalarFloorTask | typeof ScalarMaxTask | typeof ScalarMinTask | typeof ScalarRoundTask | typeof ScalarTruncTask | typeof SplitTask | typeof StringConcatTask | typeof StringIncludesTask | typeof StringJoinTask | typeof StringLengthTask | typeof StringLowerCaseTask | typeof StringReplaceTask | typeof StringSliceTask | typeof StringTemplateTask | typeof StringTrimTask | typeof StringUpperCaseTask | typeof TemplateTask | typeof VectorDistanceTask | typeof VectorDotProductTask | typeof VectorNormalizeTask | typeof VectorScaleTask)[];
161
+ export declare let registerCommonTasks: () => (typeof ScalarAddTask | typeof ScalarDivideTask | typeof ScalarMultiplyTask | typeof ScalarSubtractTask | typeof ScalarSumTask | typeof VectorDivideTask | typeof VectorMultiplyTask | typeof VectorSubtractTask | typeof VectorSumTask | typeof DateFormatTask | typeof DebugLogTask | typeof DelayTask | typeof FetchUrlTask | typeof HumanApprovalTask | typeof HumanInputTask | typeof ImageBlurTask | typeof ImageBorderTask | typeof ImageBrightnessTask | typeof ImageContrastTask | typeof ImageCropTask | typeof ImageFlipTask | typeof ImageGrayscaleTask | typeof ImageInvertTask | typeof ImagePixelateTask | typeof ImagePosterizeTask | typeof ImageResizeTask | typeof ImageRotateTask | typeof ImageSepiaTask | typeof ImageTextTask | typeof ImageThresholdTask | typeof ImageTintTask | typeof ImageTransparencyTask | typeof ImageWatermarkTask | typeof InputTask | typeof JavaScriptTask | typeof JsonPathTask | typeof JsonTask | typeof LambdaTask | typeof McpListTask | typeof McpPromptGetTask | typeof McpResourceReadTask | typeof McpSearchTask | typeof McpToolCallTask | typeof MergeTask | typeof RegexTask | typeof ScalarAbsTask | typeof ScalarCeilTask | typeof ScalarFloorTask | typeof ScalarMaxTask | typeof ScalarMinTask | typeof ScalarRoundTask | typeof ScalarTruncTask | typeof SplitTask | typeof StringConcatTask | typeof StringIncludesTask | typeof StringJoinTask | typeof StringLengthTask | typeof StringLowerCaseTask | typeof StringReplaceTask | typeof StringSliceTask | typeof StringTemplateTask | typeof StringTrimTask | typeof StringUpperCaseTask | typeof TemplateTask | typeof VectorDistanceTask | typeof VectorDotProductTask | typeof VectorNormalizeTask | typeof VectorScaleTask)[];
162
162
  //# sourceMappingURL=common.d.ts.map
@@ -15,5 +15,5 @@ export * from "./util/McpAuthTypes";
15
15
  export * from "./util/McpClientUtil";
16
16
  export * from "./util/McpTaskDeps";
17
17
  import { FileLoaderTask } from "./task/FileLoaderTask.server";
18
- export declare const registerCommonTasks: () => (typeof import("./common").ScalarAddTask | typeof import("./common").ScalarDivideTask | typeof import("./common").ScalarMultiplyTask | typeof import("./common").ScalarSubtractTask | typeof import("./common").ScalarSumTask | typeof import("./common").VectorDivideTask | typeof import("./common").VectorMultiplyTask | typeof import("./common").VectorSubtractTask | typeof import("./common").VectorSumTask | typeof import("./common").DateFormatTask | typeof import("./common").DebugLogTask | typeof import("./common").DelayTask | typeof import("./common").FetchUrlTask | typeof import("./common").HumanInputTask | typeof import("./common").HumanApprovalTask | typeof import("./common").ImageBlurTask | typeof import("./common").ImageBorderTask | typeof import("./common").ImageBrightnessTask | typeof import("./common").ImageContrastTask | typeof import("./common").ImageCropTask | typeof import("./common").ImageFlipTask | typeof import("./common").ImageGrayscaleTask | typeof import("./common").ImageInvertTask | typeof import("./common").ImagePixelateTask | typeof import("./common").ImagePosterizeTask | typeof import("./common").ImageResizeTask | typeof import("./common").ImageRotateTask | typeof import("./common").ImageSepiaTask | typeof import("./common").ImageTextTask | typeof import("./common").ImageThresholdTask | typeof import("./common").ImageTintTask | typeof import("./common").ImageTransparencyTask | typeof import("./common").ImageWatermarkTask | typeof import("./common").InputTask | typeof import("./common").JavaScriptTask | typeof import("./common").JsonPathTask | typeof import("./common").JsonTask | typeof import("./common").LambdaTask | typeof import("./common").McpListTask | typeof import("./common").McpPromptGetTask | typeof import("./common").McpResourceReadTask | typeof import("./common").McpSearchTask | typeof import("./common").McpToolCallTask | typeof import("./common").MergeTask | typeof import("./common").RegexTask | typeof import("./common").ScalarAbsTask | typeof import("./common").ScalarCeilTask | typeof import("./common").ScalarFloorTask | typeof import("./common").ScalarMaxTask | typeof import("./common").ScalarMinTask | typeof import("./common").ScalarRoundTask | typeof import("./common").ScalarTruncTask | typeof import("./common").SplitTask | typeof import("./common").StringConcatTask | typeof import("./common").StringIncludesTask | typeof import("./common").StringJoinTask | typeof import("./common").StringLengthTask | typeof import("./common").StringLowerCaseTask | typeof import("./common").StringReplaceTask | typeof import("./common").StringSliceTask | typeof import("./common").StringTemplateTask | typeof import("./common").StringTrimTask | typeof import("./common").StringUpperCaseTask | typeof import("./common").TemplateTask | typeof import("./common").VectorDistanceTask | typeof import("./common").VectorDotProductTask | typeof import("./common").VectorNormalizeTask | typeof import("./common").VectorScaleTask | typeof FileLoaderTask)[];
18
+ export declare const registerCommonTasks: () => (typeof import("./common").ScalarAddTask | typeof import("./common").ScalarDivideTask | typeof import("./common").ScalarMultiplyTask | typeof import("./common").ScalarSubtractTask | typeof import("./common").ScalarSumTask | typeof import("./common").VectorDivideTask | typeof import("./common").VectorMultiplyTask | typeof import("./common").VectorSubtractTask | typeof import("./common").VectorSumTask | typeof import("./common").DateFormatTask | typeof import("./common").DebugLogTask | typeof import("./common").DelayTask | typeof import("./common").FetchUrlTask | typeof import("./common").HumanApprovalTask | typeof import("./common").HumanInputTask | typeof import("./common").ImageBlurTask | typeof import("./common").ImageBorderTask | typeof import("./common").ImageBrightnessTask | typeof import("./common").ImageContrastTask | typeof import("./common").ImageCropTask | typeof import("./common").ImageFlipTask | typeof import("./common").ImageGrayscaleTask | typeof import("./common").ImageInvertTask | typeof import("./common").ImagePixelateTask | typeof import("./common").ImagePosterizeTask | typeof import("./common").ImageResizeTask | typeof import("./common").ImageRotateTask | typeof import("./common").ImageSepiaTask | typeof import("./common").ImageTextTask | typeof import("./common").ImageThresholdTask | typeof import("./common").ImageTintTask | typeof import("./common").ImageTransparencyTask | typeof import("./common").ImageWatermarkTask | typeof import("./common").InputTask | typeof import("./common").JavaScriptTask | typeof import("./common").JsonPathTask | typeof import("./common").JsonTask | typeof import("./common").LambdaTask | typeof import("./common").McpListTask | typeof import("./common").McpPromptGetTask | typeof import("./common").McpResourceReadTask | typeof import("./common").McpSearchTask | typeof import("./common").McpToolCallTask | typeof import("./common").MergeTask | typeof import("./common").RegexTask | typeof import("./common").ScalarAbsTask | typeof import("./common").ScalarCeilTask | typeof import("./common").ScalarFloorTask | typeof import("./common").ScalarMaxTask | typeof import("./common").ScalarMinTask | typeof import("./common").ScalarRoundTask | typeof import("./common").ScalarTruncTask | typeof import("./common").SplitTask | typeof import("./common").StringConcatTask | typeof import("./common").StringIncludesTask | typeof import("./common").StringJoinTask | typeof import("./common").StringLengthTask | typeof import("./common").StringLowerCaseTask | typeof import("./common").StringReplaceTask | typeof import("./common").StringSliceTask | typeof import("./common").StringTemplateTask | typeof import("./common").StringTrimTask | typeof import("./common").StringUpperCaseTask | typeof import("./common").TemplateTask | typeof import("./common").VectorDistanceTask | typeof import("./common").VectorDotProductTask | typeof import("./common").VectorNormalizeTask | typeof import("./common").VectorScaleTask | typeof FileLoaderTask)[];
19
19
  //# sourceMappingURL=electron.d.ts.map
package/dist/electron.js CHANGED
@@ -5534,30 +5534,169 @@ var fetchUrl = async (input, config = {}) => {
5534
5534
  };
5535
5535
  Workflow14.prototype.fetch = CreateWorkflow13(FetchUrlTask);
5536
5536
  // src/task/HumanApprovalTask.ts
5537
- import {
5538
- CreateWorkflow as CreateWorkflow15,
5539
- Task as Task41,
5540
- TaskAbortedError as TaskAbortedError3,
5541
- TaskConfigSchema as TaskConfigSchema31,
5542
- Workflow as Workflow16
5543
- } from "@workglow/task-graph";
5544
- import { uuid4 as uuid44 } from "@workglow/util";
5545
-
5546
- // src/task/HumanInputTask.ts
5547
5537
  import {
5548
5538
  CreateWorkflow as CreateWorkflow14,
5549
5539
  Task as Task40,
5550
5540
  TaskAbortedError as TaskAbortedError2,
5551
5541
  TaskConfigSchema as TaskConfigSchema30,
5552
- TaskConfigurationError as TaskConfigurationError2,
5553
5542
  Workflow as Workflow15
5554
5543
  } from "@workglow/task-graph";
5555
- import { createServiceToken as createServiceToken5, uuid4 as uuid43 } from "@workglow/util";
5556
- var HUMAN_CONNECTOR = createServiceToken5("HUMAN_CONNECTOR");
5557
- var humanInputTaskConfigSchema = {
5544
+ import { uuid4 as uuid43, resolveHumanConnector } from "@workglow/util";
5545
+ var humanApprovalConfigSchema = {
5558
5546
  type: "object",
5559
5547
  properties: {
5560
5548
  ...TaskConfigSchema30["properties"],
5549
+ targetHumanId: {
5550
+ type: "string",
5551
+ title: "Target Human",
5552
+ description: "Identifier of the human to ask for approval",
5553
+ default: "default"
5554
+ },
5555
+ message: {
5556
+ type: "string",
5557
+ title: "Message",
5558
+ description: "Explanatory message shown to the approver",
5559
+ "x-ui-editor": "textarea"
5560
+ },
5561
+ metadata: {
5562
+ type: "object",
5563
+ additionalProperties: true,
5564
+ "x-ui-hidden": true
5565
+ }
5566
+ },
5567
+ additionalProperties: false
5568
+ };
5569
+ var inputSchema40 = {
5570
+ type: "object",
5571
+ properties: {
5572
+ prompt: {
5573
+ type: "string",
5574
+ title: "Prompt",
5575
+ description: "Dynamic prompt text merged into the approval message"
5576
+ },
5577
+ context: {
5578
+ type: "object",
5579
+ additionalProperties: true,
5580
+ title: "Context",
5581
+ description: "Dynamic context data merged into the request metadata",
5582
+ "x-ui-hidden": true
5583
+ }
5584
+ },
5585
+ additionalProperties: false
5586
+ };
5587
+ var approvalRequestedSchema = {
5588
+ type: "object",
5589
+ properties: {
5590
+ approved: {
5591
+ type: "boolean",
5592
+ title: "Approved",
5593
+ description: "Whether the request is approved"
5594
+ },
5595
+ reason: {
5596
+ type: "string",
5597
+ title: "Reason",
5598
+ description: "Optional explanation for the decision"
5599
+ }
5600
+ },
5601
+ required: ["approved"]
5602
+ };
5603
+ var approvalOutputSchema = {
5604
+ type: "object",
5605
+ properties: {
5606
+ action: {
5607
+ type: "string",
5608
+ title: "Action",
5609
+ description: "The human's action: accept, decline, or cancel",
5610
+ enum: ["accept", "decline", "cancel"]
5611
+ },
5612
+ approved: {
5613
+ type: "boolean",
5614
+ title: "Approved",
5615
+ description: "Whether the human approved the request"
5616
+ },
5617
+ reason: {
5618
+ type: "string",
5619
+ title: "Reason",
5620
+ description: "Optional explanation for the decision"
5621
+ }
5622
+ },
5623
+ required: ["action", "approved"],
5624
+ additionalProperties: false
5625
+ };
5626
+
5627
+ class HumanApprovalTask extends Task40 {
5628
+ static type = "HumanApprovalTask";
5629
+ static category = "Flow Control";
5630
+ static title = "Human Approval";
5631
+ static description = "Pauses execution to request approval from a human (approve/deny) via MCP elicitation";
5632
+ static cacheable = false;
5633
+ static configSchema() {
5634
+ return humanApprovalConfigSchema;
5635
+ }
5636
+ static inputSchema() {
5637
+ return inputSchema40;
5638
+ }
5639
+ static outputSchema() {
5640
+ return approvalOutputSchema;
5641
+ }
5642
+ async execute(input, context) {
5643
+ const connector = resolveHumanConnector(context);
5644
+ const requestId = uuid43();
5645
+ const message = input.prompt ? this.config.message ? `${this.config.message}
5646
+
5647
+ ${input.prompt}` : input.prompt : this.config.message ?? "";
5648
+ const request = {
5649
+ requestId,
5650
+ targetHumanId: this.config.targetHumanId ?? "default",
5651
+ kind: "elicit",
5652
+ message,
5653
+ contentSchema: approvalRequestedSchema,
5654
+ contentData: undefined,
5655
+ expectsResponse: true,
5656
+ mode: "single",
5657
+ metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
5658
+ };
5659
+ if (context.signal.aborted) {
5660
+ throw new TaskAbortedError2("Task aborted before requesting human approval");
5661
+ }
5662
+ let response;
5663
+ try {
5664
+ response = await connector.send(request, context.signal);
5665
+ } catch (err) {
5666
+ if (context.signal.aborted) {
5667
+ throw new TaskAbortedError2("Task aborted during human approval");
5668
+ }
5669
+ throw err;
5670
+ }
5671
+ if (response.action === "accept" && response.content) {
5672
+ return {
5673
+ action: response.action,
5674
+ approved: response.content.approved === true,
5675
+ reason: response.content.reason
5676
+ };
5677
+ }
5678
+ return {
5679
+ action: response.action,
5680
+ approved: false,
5681
+ ...response.content?.reason !== undefined ? { reason: response.content.reason } : {}
5682
+ };
5683
+ }
5684
+ }
5685
+ Workflow15.prototype.humanApproval = CreateWorkflow14(HumanApprovalTask);
5686
+ // src/task/HumanInputTask.ts
5687
+ import {
5688
+ CreateWorkflow as CreateWorkflow15,
5689
+ Task as Task41,
5690
+ TaskAbortedError as TaskAbortedError3,
5691
+ TaskConfigSchema as TaskConfigSchema31,
5692
+ TaskConfigurationError as TaskConfigurationError2,
5693
+ Workflow as Workflow16
5694
+ } from "@workglow/task-graph";
5695
+ import { resolveHumanConnector as resolveHumanConnector2, uuid4 as uuid44 } from "@workglow/util";
5696
+ var humanInputTaskConfigSchema = {
5697
+ type: "object",
5698
+ properties: {
5699
+ ...TaskConfigSchema31["properties"],
5561
5700
  targetHumanId: {
5562
5701
  type: "string",
5563
5702
  title: "Target Human",
@@ -5638,7 +5777,7 @@ var defaultOutputSchema = {
5638
5777
  additionalProperties: true
5639
5778
  };
5640
5779
 
5641
- class HumanInputTask extends Task40 {
5780
+ class HumanInputTask extends Task41 {
5642
5781
  static type = "HumanInputTask";
5643
5782
  static category = "Flow Control";
5644
5783
  static title = "Human Input";
@@ -5676,10 +5815,10 @@ class HumanInputTask extends Task40 {
5676
5815
  return this.constructor.outputSchema();
5677
5816
  }
5678
5817
  async execute(input, context) {
5679
- const connector = resolveHumanConnector(context);
5818
+ const connector = resolveHumanConnector2(context);
5680
5819
  const kind = this.config.kind ?? "elicit";
5681
5820
  const mode = this.config.mode ?? "single";
5682
- const requestId = uuid43();
5821
+ const requestId = uuid44();
5683
5822
  const message = input.prompt ? this.config.message ? `${this.config.message}
5684
5823
 
5685
5824
  ${input.prompt}` : input.prompt : this.config.message ?? "";
@@ -5700,14 +5839,14 @@ ${input.prompt}` : input.prompt : this.config.message ?? "";
5700
5839
  metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
5701
5840
  };
5702
5841
  if (context.signal.aborted) {
5703
- throw new TaskAbortedError2("Task aborted before sending human interaction");
5842
+ throw new TaskAbortedError3("Task aborted before sending human interaction");
5704
5843
  }
5705
5844
  let response;
5706
5845
  try {
5707
5846
  response = await connector.send(request, context.signal);
5708
5847
  } catch (err) {
5709
5848
  if (context.signal.aborted) {
5710
- throw new TaskAbortedError2("Task aborted during human interaction");
5849
+ throw new TaskAbortedError3("Task aborted during human interaction");
5711
5850
  }
5712
5851
  throw err;
5713
5852
  }
@@ -5717,13 +5856,13 @@ ${input.prompt}` : input.prompt : this.config.message ?? "";
5717
5856
  }
5718
5857
  while (!response.done) {
5719
5858
  if (context.signal.aborted) {
5720
- throw new TaskAbortedError2("Task aborted during multi-turn conversation");
5859
+ throw new TaskAbortedError3("Task aborted during multi-turn conversation");
5721
5860
  }
5722
5861
  try {
5723
5862
  response = await connector.followUp(request, response, context.signal);
5724
5863
  } catch (err) {
5725
5864
  if (context.signal.aborted) {
5726
- throw new TaskAbortedError2("Task aborted during multi-turn conversation");
5865
+ throw new TaskAbortedError3("Task aborted during multi-turn conversation");
5727
5866
  }
5728
5867
  throw err;
5729
5868
  }
@@ -5732,156 +5871,7 @@ ${input.prompt}` : input.prompt : this.config.message ?? "";
5732
5871
  return { ...response.content, action: response.action };
5733
5872
  }
5734
5873
  }
5735
- function resolveHumanConnector(context) {
5736
- if (!context.registry.has(HUMAN_CONNECTOR)) {
5737
- throw new TaskConfigurationError2("No IHumanConnector registered. Register one via " + "registry.registerInstance(HUMAN_CONNECTOR, connector) before running a human-in-the-loop task.");
5738
- }
5739
- return context.registry.get(HUMAN_CONNECTOR);
5740
- }
5741
- Workflow15.prototype.humanInput = CreateWorkflow14(HumanInputTask);
5742
-
5743
- // src/task/HumanApprovalTask.ts
5744
- var humanApprovalConfigSchema = {
5745
- type: "object",
5746
- properties: {
5747
- ...TaskConfigSchema31["properties"],
5748
- targetHumanId: {
5749
- type: "string",
5750
- title: "Target Human",
5751
- description: "Identifier of the human to ask for approval",
5752
- default: "default"
5753
- },
5754
- message: {
5755
- type: "string",
5756
- title: "Message",
5757
- description: "Explanatory message shown to the approver",
5758
- "x-ui-editor": "textarea"
5759
- },
5760
- metadata: {
5761
- type: "object",
5762
- additionalProperties: true,
5763
- "x-ui-hidden": true
5764
- }
5765
- },
5766
- additionalProperties: false
5767
- };
5768
- var inputSchema40 = {
5769
- type: "object",
5770
- properties: {
5771
- prompt: {
5772
- type: "string",
5773
- title: "Prompt",
5774
- description: "Dynamic prompt text merged into the approval message"
5775
- },
5776
- context: {
5777
- type: "object",
5778
- additionalProperties: true,
5779
- title: "Context",
5780
- description: "Dynamic context data merged into the request metadata",
5781
- "x-ui-hidden": true
5782
- }
5783
- },
5784
- additionalProperties: false
5785
- };
5786
- var approvalRequestedSchema = {
5787
- type: "object",
5788
- properties: {
5789
- approved: {
5790
- type: "boolean",
5791
- title: "Approved",
5792
- description: "Whether the request is approved"
5793
- },
5794
- reason: {
5795
- type: "string",
5796
- title: "Reason",
5797
- description: "Optional explanation for the decision"
5798
- }
5799
- },
5800
- required: ["approved"]
5801
- };
5802
- var approvalOutputSchema = {
5803
- type: "object",
5804
- properties: {
5805
- action: {
5806
- type: "string",
5807
- title: "Action",
5808
- description: "The human's action: accept, decline, or cancel",
5809
- enum: ["accept", "decline", "cancel"]
5810
- },
5811
- approved: {
5812
- type: "boolean",
5813
- title: "Approved",
5814
- description: "Whether the human approved the request"
5815
- },
5816
- reason: {
5817
- type: "string",
5818
- title: "Reason",
5819
- description: "Optional explanation for the decision"
5820
- }
5821
- },
5822
- required: ["action", "approved"],
5823
- additionalProperties: false
5824
- };
5825
-
5826
- class HumanApprovalTask extends Task41 {
5827
- static type = "HumanApprovalTask";
5828
- static category = "Flow Control";
5829
- static title = "Human Approval";
5830
- static description = "Pauses execution to request approval from a human (approve/deny) via MCP elicitation";
5831
- static cacheable = false;
5832
- static configSchema() {
5833
- return humanApprovalConfigSchema;
5834
- }
5835
- static inputSchema() {
5836
- return inputSchema40;
5837
- }
5838
- static outputSchema() {
5839
- return approvalOutputSchema;
5840
- }
5841
- async execute(input, context) {
5842
- const connector = resolveHumanConnector(context);
5843
- const requestId = uuid44();
5844
- const message = input.prompt ? this.config.message ? `${this.config.message}
5845
-
5846
- ${input.prompt}` : input.prompt : this.config.message ?? "";
5847
- const request = {
5848
- requestId,
5849
- targetHumanId: this.config.targetHumanId ?? "default",
5850
- kind: "elicit",
5851
- message,
5852
- contentSchema: approvalRequestedSchema,
5853
- contentData: undefined,
5854
- expectsResponse: true,
5855
- mode: "single",
5856
- metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
5857
- };
5858
- if (context.signal.aborted) {
5859
- throw new TaskAbortedError3("Task aborted before requesting human approval");
5860
- }
5861
- let response;
5862
- try {
5863
- response = await connector.send(request, context.signal);
5864
- } catch (err) {
5865
- if (context.signal.aborted) {
5866
- throw new TaskAbortedError3("Task aborted during human approval");
5867
- }
5868
- throw err;
5869
- }
5870
- if (response.action === "accept" && response.content) {
5871
- return {
5872
- action: response.action,
5873
- approved: response.content.approved === true,
5874
- reason: response.content.reason
5875
- };
5876
- }
5877
- return {
5878
- action: response.action,
5879
- approved: false,
5880
- ...response.content?.reason !== undefined ? { reason: response.content.reason } : {}
5881
- };
5882
- }
5883
- }
5884
- Workflow16.prototype.humanApproval = CreateWorkflow15(HumanApprovalTask);
5874
+ Workflow16.prototype.humanInput = CreateWorkflow15(HumanInputTask);
5885
5875
  // src/task/image/ImageBlurTask.ts
5886
5876
  import {
5887
5877
  CreateWorkflow as CreateWorkflow16,
@@ -16346,7 +16336,6 @@ export {
16346
16336
  searchMcpRegistry,
16347
16337
  safeFetch,
16348
16338
  resolveImageInput,
16349
- resolveHumanConnector,
16350
16339
  resolveAuthSecrets,
16351
16340
  resetSafeFetch,
16352
16341
  registerSafeFetch,
@@ -16480,7 +16469,6 @@ export {
16480
16469
  ImageBinaryOrDataUriSchema,
16481
16470
  HumanInputTask,
16482
16471
  HumanApprovalTask,
16483
- HUMAN_CONNECTOR,
16484
16472
  FileLoaderTask2 as FileLoaderTask,
16485
16473
  FetchUrlTask,
16486
16474
  FetchUrlJob,
@@ -16523,4 +16511,4 @@ export {
16523
16511
  ArrayTask
16524
16512
  };
16525
16513
 
16526
- //# debugId=67FC6BB4A55AE97C64756E2164756E21
16514
+ //# debugId=9928B5703DF16BD064756E2164756E21