@workglow/tasks 0.2.8 → 0.2.9
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/browser.d.ts +1 -1
- package/dist/browser.js +162 -173
- package/dist/browser.js.map +5 -5
- package/dist/bun.d.ts +1 -1
- package/dist/bun.js +162 -173
- package/dist/bun.js.map +5 -5
- package/dist/common.d.ts +1 -1
- package/dist/electron.d.ts +1 -1
- package/dist/electron.js +162 -173
- package/dist/electron.js.map +5 -5
- package/dist/node.d.ts +1 -1
- package/dist/node.js +162 -173
- package/dist/node.js.map +5 -5
- package/dist/task/HumanApprovalTask.d.ts +1 -1
- package/dist/task/HumanApprovalTask.d.ts.map +1 -1
- package/dist/task/HumanInputTask.d.ts +1 -100
- package/dist/task/HumanInputTask.d.ts.map +1 -1
- package/dist/task/McpElicitationConnector.d.ts +3 -2
- package/dist/task/McpElicitationConnector.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/node.d.ts
CHANGED
|
@@ -14,5 +14,5 @@ export * from "./util/McpAuthTypes";
|
|
|
14
14
|
export * from "./util/McpClientUtil";
|
|
15
15
|
export * from "./util/McpTaskDeps";
|
|
16
16
|
import { FileLoaderTask } from "./task/FileLoaderTask.server";
|
|
17
|
-
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").
|
|
17
|
+
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)[];
|
|
18
18
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/node.js
CHANGED
|
@@ -5534,30 +5534,170 @@ 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 CreateWorkflow14,
|
|
5539
|
+
Task as Task40,
|
|
5540
|
+
TaskAbortedError as TaskAbortedError2,
|
|
5541
|
+
TaskConfigSchema as TaskConfigSchema30,
|
|
5542
|
+
Workflow as Workflow15
|
|
5543
|
+
} from "@workglow/task-graph";
|
|
5544
|
+
import { uuid4 as uuid43, resolveHumanConnector } from "@workglow/util";
|
|
5545
|
+
var humanApprovalConfigSchema = {
|
|
5546
|
+
type: "object",
|
|
5547
|
+
properties: {
|
|
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
|
|
5537
5687
|
import {
|
|
5538
5688
|
CreateWorkflow as CreateWorkflow15,
|
|
5539
5689
|
Task as Task41,
|
|
5540
5690
|
TaskAbortedError as TaskAbortedError3,
|
|
5541
5691
|
TaskConfigSchema as TaskConfigSchema31,
|
|
5692
|
+
TaskConfigurationError as TaskConfigurationError2,
|
|
5542
5693
|
Workflow as Workflow16
|
|
5543
5694
|
} from "@workglow/task-graph";
|
|
5544
5695
|
import { uuid4 as uuid44 } from "@workglow/util";
|
|
5545
|
-
|
|
5546
|
-
// src/task/HumanInputTask.ts
|
|
5547
|
-
import {
|
|
5548
|
-
CreateWorkflow as CreateWorkflow14,
|
|
5549
|
-
Task as Task40,
|
|
5550
|
-
TaskAbortedError as TaskAbortedError2,
|
|
5551
|
-
TaskConfigSchema as TaskConfigSchema30,
|
|
5552
|
-
TaskConfigurationError as TaskConfigurationError2,
|
|
5553
|
-
Workflow as Workflow15
|
|
5554
|
-
} from "@workglow/task-graph";
|
|
5555
|
-
import { createServiceToken as createServiceToken5, uuid4 as uuid43 } from "@workglow/util";
|
|
5556
|
-
var HUMAN_CONNECTOR = createServiceToken5("HUMAN_CONNECTOR");
|
|
5696
|
+
import { resolveHumanConnector as resolveHumanConnector2 } from "@workglow/util";
|
|
5557
5697
|
var humanInputTaskConfigSchema = {
|
|
5558
5698
|
type: "object",
|
|
5559
5699
|
properties: {
|
|
5560
|
-
...
|
|
5700
|
+
...TaskConfigSchema31["properties"],
|
|
5561
5701
|
targetHumanId: {
|
|
5562
5702
|
type: "string",
|
|
5563
5703
|
title: "Target Human",
|
|
@@ -5638,7 +5778,7 @@ var defaultOutputSchema = {
|
|
|
5638
5778
|
additionalProperties: true
|
|
5639
5779
|
};
|
|
5640
5780
|
|
|
5641
|
-
class HumanInputTask extends
|
|
5781
|
+
class HumanInputTask extends Task41 {
|
|
5642
5782
|
static type = "HumanInputTask";
|
|
5643
5783
|
static category = "Flow Control";
|
|
5644
5784
|
static title = "Human Input";
|
|
@@ -5676,10 +5816,10 @@ class HumanInputTask extends Task40 {
|
|
|
5676
5816
|
return this.constructor.outputSchema();
|
|
5677
5817
|
}
|
|
5678
5818
|
async execute(input, context) {
|
|
5679
|
-
const connector =
|
|
5819
|
+
const connector = resolveHumanConnector2(context);
|
|
5680
5820
|
const kind = this.config.kind ?? "elicit";
|
|
5681
5821
|
const mode = this.config.mode ?? "single";
|
|
5682
|
-
const requestId =
|
|
5822
|
+
const requestId = uuid44();
|
|
5683
5823
|
const message = input.prompt ? this.config.message ? `${this.config.message}
|
|
5684
5824
|
|
|
5685
5825
|
${input.prompt}` : input.prompt : this.config.message ?? "";
|
|
@@ -5700,14 +5840,14 @@ ${input.prompt}` : input.prompt : this.config.message ?? "";
|
|
|
5700
5840
|
metadata: input.context ? { ...this.config.metadata, ...input.context } : this.config.metadata
|
|
5701
5841
|
};
|
|
5702
5842
|
if (context.signal.aborted) {
|
|
5703
|
-
throw new
|
|
5843
|
+
throw new TaskAbortedError3("Task aborted before sending human interaction");
|
|
5704
5844
|
}
|
|
5705
5845
|
let response;
|
|
5706
5846
|
try {
|
|
5707
5847
|
response = await connector.send(request, context.signal);
|
|
5708
5848
|
} catch (err) {
|
|
5709
5849
|
if (context.signal.aborted) {
|
|
5710
|
-
throw new
|
|
5850
|
+
throw new TaskAbortedError3("Task aborted during human interaction");
|
|
5711
5851
|
}
|
|
5712
5852
|
throw err;
|
|
5713
5853
|
}
|
|
@@ -5717,13 +5857,13 @@ ${input.prompt}` : input.prompt : this.config.message ?? "";
|
|
|
5717
5857
|
}
|
|
5718
5858
|
while (!response.done) {
|
|
5719
5859
|
if (context.signal.aborted) {
|
|
5720
|
-
throw new
|
|
5860
|
+
throw new TaskAbortedError3("Task aborted during multi-turn conversation");
|
|
5721
5861
|
}
|
|
5722
5862
|
try {
|
|
5723
5863
|
response = await connector.followUp(request, response, context.signal);
|
|
5724
5864
|
} catch (err) {
|
|
5725
5865
|
if (context.signal.aborted) {
|
|
5726
|
-
throw new
|
|
5866
|
+
throw new TaskAbortedError3("Task aborted during multi-turn conversation");
|
|
5727
5867
|
}
|
|
5728
5868
|
throw err;
|
|
5729
5869
|
}
|
|
@@ -5732,156 +5872,7 @@ ${input.prompt}` : input.prompt : this.config.message ?? "";
|
|
|
5732
5872
|
return { ...response.content, action: response.action };
|
|
5733
5873
|
}
|
|
5734
5874
|
}
|
|
5735
|
-
|
|
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);
|
|
5875
|
+
Workflow16.prototype.humanInput = CreateWorkflow15(HumanInputTask);
|
|
5885
5876
|
// src/task/image/ImageBlurTask.ts
|
|
5886
5877
|
import {
|
|
5887
5878
|
CreateWorkflow as CreateWorkflow16,
|
|
@@ -16128,7 +16119,6 @@ export {
|
|
|
16128
16119
|
searchMcpRegistry,
|
|
16129
16120
|
safeFetch,
|
|
16130
16121
|
resolveImageInput,
|
|
16131
|
-
resolveHumanConnector,
|
|
16132
16122
|
resolveAuthSecrets,
|
|
16133
16123
|
resetSafeFetch,
|
|
16134
16124
|
registerSafeFetch,
|
|
@@ -16262,7 +16252,6 @@ export {
|
|
|
16262
16252
|
ImageBinaryOrDataUriSchema,
|
|
16263
16253
|
HumanInputTask,
|
|
16264
16254
|
HumanApprovalTask,
|
|
16265
|
-
HUMAN_CONNECTOR,
|
|
16266
16255
|
FileLoaderTask2 as FileLoaderTask,
|
|
16267
16256
|
FetchUrlTask,
|
|
16268
16257
|
FetchUrlJob,
|
|
@@ -16304,4 +16293,4 @@ export {
|
|
|
16304
16293
|
ArrayTask
|
|
16305
16294
|
};
|
|
16306
16295
|
|
|
16307
|
-
//# debugId=
|
|
16296
|
+
//# debugId=7DA82D3DD7A53BC864756E2164756E21
|