@oomol-lab/open-flow 0.1.0-beta.61 → 0.1.0-beta.62
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/{createResourceDialog-D71fO68i.js → createResourceDialog-DZgJsr3e.js} +2 -2
- package/dist/browser/{flowChanges-DSA0FxxN.js → flowChanges-CzYIVevI.js} +2244 -2172
- package/dist/browser/{flowWorkspace-0sUJ5JhQ.js → flowWorkspace-BgZaFKZm.js} +179 -57
- package/dist/browser/{icons-DVJvrj1H.js → icons-CajfDpy_.js} +2879 -2879
- package/dist/browser/preview.js +453 -140
- package/dist/browser/workbench.css +4 -20
- package/dist/browser/workbench.js +78 -11
- package/dist/browser/{workbenchSelect-cr4-mKq3.js → workbenchSelect-H9wzEFkH.js} +1 -1
- package/dist/command/index.js +37 -37
- package/dist/common/authoring.d.ts +1 -1
- package/dist/common/control-api-conformance.js +2149 -2084
- package/dist/common/control-api-errors.d.ts +0 -4
- package/dist/common/control-api.d.ts +10 -11
- package/dist/common/control-api.js +2495 -2755
- package/dist/common/control-requests.js +23 -15
- package/dist/common/liveDetails.d.ts +138 -0
- package/dist/common/mcp.d.ts +1 -33
- package/dist/common/mcp.js +287 -238
- package/package.json +1 -1
- package/skills/open-flow/SKILL.md +6 -3
- package/skills/open-flow/references/flow-authoring.md +28 -24
- package/dist/common/publicationResources.d.ts +0 -29
package/dist/common/mcp.js
CHANGED
|
@@ -8776,6 +8776,9 @@ var webhookMethods = [
|
|
|
8776
8776
|
"PATCH",
|
|
8777
8777
|
"DELETE"
|
|
8778
8778
|
];
|
|
8779
|
+
function webhookSupportsBody(method) {
|
|
8780
|
+
return method !== "GET";
|
|
8781
|
+
}
|
|
8779
8782
|
var text = string$1();
|
|
8780
8783
|
var json$3 = json$4();
|
|
8781
8784
|
var strings$1 = array(text);
|
|
@@ -9151,7 +9154,7 @@ var graph = object({
|
|
|
9151
9154
|
nodes: record$2(text, node),
|
|
9152
9155
|
edges: array(edge).default([])
|
|
9153
9156
|
});
|
|
9154
|
-
var binding = object({
|
|
9157
|
+
var binding$1 = object({
|
|
9155
9158
|
kind: literal("variable"),
|
|
9156
9159
|
target: text
|
|
9157
9160
|
});
|
|
@@ -9161,7 +9164,7 @@ var module = object({
|
|
|
9161
9164
|
source: text
|
|
9162
9165
|
});
|
|
9163
9166
|
var document = preprocess(rejectRetiredDefinitions, object({
|
|
9164
|
-
bindings: record$2(text, binding),
|
|
9167
|
+
bindings: record$2(text, binding$1),
|
|
9165
9168
|
graph
|
|
9166
9169
|
}));
|
|
9167
9170
|
var revision = object({
|
|
@@ -9205,7 +9208,7 @@ var shapes = {
|
|
|
9205
9208
|
},
|
|
9206
9209
|
"binding.create": {
|
|
9207
9210
|
bindingId: text,
|
|
9208
|
-
binding
|
|
9211
|
+
binding: binding$1
|
|
9209
9212
|
},
|
|
9210
9213
|
"binding.delete": { bindingId: text },
|
|
9211
9214
|
"binding.target.set": {
|
|
@@ -9406,7 +9409,7 @@ var authenticationSchema = union([
|
|
|
9406
9409
|
in: _enum(["header", "query"])
|
|
9407
9410
|
})
|
|
9408
9411
|
]);
|
|
9409
|
-
strictObject({
|
|
9412
|
+
var authoringOpenApiSchema = strictObject({
|
|
9410
9413
|
sourceUrl: string$1().min(1),
|
|
9411
9414
|
path: string$1().min(1),
|
|
9412
9415
|
method: string$1().min(1),
|
|
@@ -9503,36 +9506,53 @@ var when = union([
|
|
|
9503
9506
|
all,
|
|
9504
9507
|
strictObject({ any: array(union([expression, all])) })
|
|
9505
9508
|
]);
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
})
|
|
9509
|
+
var authoringConfigurations = {
|
|
9510
|
+
manual: strictObject({}),
|
|
9511
|
+
error: strictObject({ sourceFlowIds: array(id$2).optional() }),
|
|
9512
|
+
webhook: authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
|
|
9513
|
+
cron: strictObject({ schedule: authoringDefinitionSchemas.schedule }),
|
|
9514
|
+
poll: strictObject({
|
|
9515
|
+
key: id$2,
|
|
9516
|
+
connectionId: id$2.optional(),
|
|
9517
|
+
schedule: authoringDefinitionSchemas.schedule
|
|
9518
|
+
}),
|
|
9519
|
+
integration: strictObject({
|
|
9520
|
+
key: id$2,
|
|
9521
|
+
connectionId: id$2.optional()
|
|
9522
|
+
}),
|
|
9523
|
+
code: strictObject({
|
|
9524
|
+
inputs: inputFields,
|
|
9525
|
+
outputs: outputFields,
|
|
9526
|
+
capabilities: authoringDefinitionSchemas.capabilities.optional()
|
|
9527
|
+
}),
|
|
9528
|
+
connector: authoringDefinitionSchemas.connector.strict(),
|
|
9529
|
+
openapi: authoringOpenApiSchema,
|
|
9530
|
+
agent: authoringDefinitionSchemas.agent.omit({
|
|
9531
|
+
prompt: true,
|
|
9532
|
+
tools: true
|
|
9533
|
+
}).extend({
|
|
9534
|
+
inputs: inputFields,
|
|
9535
|
+
resultSchema: json$2.describe("JSON schema of the final result. Defaults to text. The tool manages the output definition; references can omit port."),
|
|
9536
|
+
tools: array(agentTool),
|
|
9537
|
+
notification: notification.optional()
|
|
9538
|
+
}).strict(),
|
|
9539
|
+
llm: authoringLlmConfiguration.extend({ inputs: inputFields }),
|
|
9540
|
+
decision: authoringDefinitionSchemas.decision,
|
|
9541
|
+
condition: strictObject({
|
|
9542
|
+
match: _enum(["first", "all"]),
|
|
9543
|
+
branches: array(strictObject({
|
|
9544
|
+
name: id$2,
|
|
9545
|
+
description: string$1().optional(),
|
|
9546
|
+
when
|
|
9547
|
+
}))
|
|
9548
|
+
}),
|
|
9549
|
+
value: strictObject({
|
|
9550
|
+
values: patch,
|
|
9551
|
+
outputs: outputFields
|
|
9552
|
+
}),
|
|
9553
|
+
wait: strictObject({ inputs: inputFields }),
|
|
9554
|
+
approval: strictObject({ inputs: inputFields })
|
|
9555
|
+
};
|
|
9536
9556
|
var updates = strictObject({
|
|
9537
9557
|
name: id$2.optional(),
|
|
9538
9558
|
description: string$1().optional(),
|
|
@@ -9720,7 +9740,6 @@ var controlErrorCode = {
|
|
|
9720
9740
|
publicationConflict: "publication.conflict",
|
|
9721
9741
|
publicationNotFound: "publication.not-found",
|
|
9722
9742
|
publicationUnsupported: "publication.unsupported",
|
|
9723
|
-
resourceNotFound: "resource.not-found",
|
|
9724
9743
|
publishOperationNotFound: "publication.operation-not-found",
|
|
9725
9744
|
routeNotFound: "route.not-found",
|
|
9726
9745
|
runConflict: "run.conflict",
|
|
@@ -9737,7 +9756,7 @@ var controlErrorCode = {
|
|
|
9737
9756
|
variableLimitReached: "variable.limit-reached",
|
|
9738
9757
|
variableNotFound: "variable.not-found"
|
|
9739
9758
|
};
|
|
9740
|
-
controlErrorCode.eventSourceInvalid, controlErrorCode.eventSourceIdentityUnavailable, controlErrorCode.eventSourceNotFound, controlErrorCode.eventSourceConflict, controlErrorCode.authenticationRequired, controlErrorCode.authorizationDenied, controlErrorCode.bindingUnresolved, controlErrorCode.connectorActionNotFound, controlErrorCode.connectorAccessConflict, controlErrorCode.connectorAccessInvalid, controlErrorCode.connectorAccessRequired, controlErrorCode.connectorAccessUnsupported, controlErrorCode.connectorUnconfigured, controlErrorCode.connectorUnavailable, controlErrorCode.connectorConsoleUnconfigured, controlErrorCode.engineUnavailable, controlErrorCode.engineUnsupported, controlErrorCode.flowInvalid, controlErrorCode.flowRepairRequired, controlErrorCode.flowUpgradeRequired, controlErrorCode.flowNotFound, controlErrorCode.flowBusy, controlErrorCode.flowConflict, controlErrorCode.flowPresentationConflict, controlErrorCode.flowRevisionConflict, controlErrorCode.liveConflict, controlErrorCode.liveNotFound, controlErrorCode.pageInvalidCursor, controlErrorCode.publicationConflict, controlErrorCode.publicationNotFound, controlErrorCode.publicationUnsupported, controlErrorCode.
|
|
9759
|
+
controlErrorCode.eventSourceInvalid, controlErrorCode.eventSourceIdentityUnavailable, controlErrorCode.eventSourceNotFound, controlErrorCode.eventSourceConflict, controlErrorCode.authenticationRequired, controlErrorCode.authorizationDenied, controlErrorCode.bindingUnresolved, controlErrorCode.connectorActionNotFound, controlErrorCode.connectorAccessConflict, controlErrorCode.connectorAccessInvalid, controlErrorCode.connectorAccessRequired, controlErrorCode.connectorAccessUnsupported, controlErrorCode.connectorUnconfigured, controlErrorCode.connectorUnavailable, controlErrorCode.connectorConsoleUnconfigured, controlErrorCode.engineUnavailable, controlErrorCode.engineUnsupported, controlErrorCode.flowInvalid, controlErrorCode.flowRepairRequired, controlErrorCode.flowUpgradeRequired, controlErrorCode.flowNotFound, controlErrorCode.flowBusy, controlErrorCode.flowConflict, controlErrorCode.flowPresentationConflict, controlErrorCode.flowRevisionConflict, controlErrorCode.liveConflict, controlErrorCode.liveNotFound, controlErrorCode.pageInvalidCursor, controlErrorCode.publicationConflict, controlErrorCode.publicationNotFound, controlErrorCode.publicationUnsupported, controlErrorCode.publishOperationNotFound, controlErrorCode.routeNotFound, controlErrorCode.runConflict, controlErrorCode.runEventsExpired, controlErrorCode.runInvalid, controlErrorCode.runNotFound, controlErrorCode.runNotTerminal, controlErrorCode.runOverloaded, controlErrorCode.runWaitNotFound, controlErrorCode.triggerKeyInvalid, controlErrorCode.triggerKeyNotFound, controlErrorCode.triggerNotFound, controlErrorCode.variableInvalid, controlErrorCode.variableLimitReached, controlErrorCode.variableNotFound;
|
|
9741
9760
|
var ApiError = class extends Error {
|
|
9742
9761
|
constructor(status, code, message, details) {
|
|
9743
9762
|
super(message);
|
|
@@ -9788,6 +9807,142 @@ function optionalString(value) {
|
|
|
9788
9807
|
return string(value);
|
|
9789
9808
|
}
|
|
9790
9809
|
//#endregion
|
|
9810
|
+
//#region src/control/common/publicationDecoders.ts
|
|
9811
|
+
function publication(value) {
|
|
9812
|
+
const source = record(value);
|
|
9813
|
+
const liveEnd = source.liveEnd == null ? void 0 : record(source.liveEnd);
|
|
9814
|
+
if (liveEnd != null && typeof liveEnd.enabled != "boolean") return invalidResponse();
|
|
9815
|
+
const operation = source.operation;
|
|
9816
|
+
const sourcePublicationId = source.sourcePublicationId;
|
|
9817
|
+
if (source.version != 1) return invalidResponse();
|
|
9818
|
+
if (operation != "publish" && operation != "rollback") return invalidResponse();
|
|
9819
|
+
if (sourcePublicationId != null && typeof sourcePublicationId != "string") return invalidResponse();
|
|
9820
|
+
return {
|
|
9821
|
+
...liveEnd == null ? {} : { liveEnd: {
|
|
9822
|
+
enabled: liveEnd.enabled,
|
|
9823
|
+
endedAt: string(liveEnd.endedAt)
|
|
9824
|
+
} },
|
|
9825
|
+
actorId: string(source.actorId),
|
|
9826
|
+
closureDigest: string(source.closureDigest),
|
|
9827
|
+
createdAt: string(source.createdAt),
|
|
9828
|
+
engineContract: string(source.engineContract),
|
|
9829
|
+
flowId: string(source.flowId),
|
|
9830
|
+
modelVersion: integer(source.modelVersion),
|
|
9831
|
+
operation,
|
|
9832
|
+
publicationId: string(source.publicationId),
|
|
9833
|
+
sharedAccessDigest: string(source.sharedAccessDigest),
|
|
9834
|
+
revisionDigest: string(source.revisionDigest),
|
|
9835
|
+
revisionId: string(source.revisionId),
|
|
9836
|
+
...sourcePublicationId == null ? {} : { sourcePublicationId },
|
|
9837
|
+
version: 1
|
|
9838
|
+
};
|
|
9839
|
+
}
|
|
9840
|
+
function publishOperation(value) {
|
|
9841
|
+
const source = record(value);
|
|
9842
|
+
const status = source.status;
|
|
9843
|
+
const common = {
|
|
9844
|
+
createdAt: string(source.createdAt),
|
|
9845
|
+
flowId: string(source.flowId),
|
|
9846
|
+
operationId: string(source.operationId),
|
|
9847
|
+
revisionId: string(source.revisionId),
|
|
9848
|
+
updatedAt: string(source.updatedAt),
|
|
9849
|
+
version: 1
|
|
9850
|
+
};
|
|
9851
|
+
if (source.version != 1) return invalidResponse();
|
|
9852
|
+
switch (status) {
|
|
9853
|
+
case "pending":
|
|
9854
|
+
exact(source, [
|
|
9855
|
+
"createdAt",
|
|
9856
|
+
"flowId",
|
|
9857
|
+
"operationId",
|
|
9858
|
+
"revisionId",
|
|
9859
|
+
"status",
|
|
9860
|
+
"updatedAt",
|
|
9861
|
+
"version"
|
|
9862
|
+
]);
|
|
9863
|
+
return {
|
|
9864
|
+
...common,
|
|
9865
|
+
status
|
|
9866
|
+
};
|
|
9867
|
+
case "succeeded":
|
|
9868
|
+
exact(source, [
|
|
9869
|
+
"createdAt",
|
|
9870
|
+
"flowId",
|
|
9871
|
+
"operationId",
|
|
9872
|
+
"publicationId",
|
|
9873
|
+
"revisionId",
|
|
9874
|
+
"status",
|
|
9875
|
+
"updatedAt",
|
|
9876
|
+
"version"
|
|
9877
|
+
]);
|
|
9878
|
+
return {
|
|
9879
|
+
...common,
|
|
9880
|
+
publicationId: string(source.publicationId),
|
|
9881
|
+
status
|
|
9882
|
+
};
|
|
9883
|
+
case "failed": {
|
|
9884
|
+
exact(source, [
|
|
9885
|
+
"createdAt",
|
|
9886
|
+
"flowId",
|
|
9887
|
+
"issue",
|
|
9888
|
+
"operationId",
|
|
9889
|
+
"revisionId",
|
|
9890
|
+
"status",
|
|
9891
|
+
"updatedAt",
|
|
9892
|
+
"version"
|
|
9893
|
+
]);
|
|
9894
|
+
const issue = record(source.issue);
|
|
9895
|
+
const nodeId = issue.nodeId;
|
|
9896
|
+
exact(issue, [
|
|
9897
|
+
"code",
|
|
9898
|
+
"message",
|
|
9899
|
+
...nodeId == null ? [] : ["nodeId"]
|
|
9900
|
+
]);
|
|
9901
|
+
return {
|
|
9902
|
+
...common,
|
|
9903
|
+
issue: {
|
|
9904
|
+
code: string(issue.code),
|
|
9905
|
+
message: string(issue.message),
|
|
9906
|
+
...nodeId == null ? {} : { nodeId: string(nodeId) }
|
|
9907
|
+
},
|
|
9908
|
+
status
|
|
9909
|
+
};
|
|
9910
|
+
}
|
|
9911
|
+
default: return invalidResponse();
|
|
9912
|
+
}
|
|
9913
|
+
}
|
|
9914
|
+
function live(value) {
|
|
9915
|
+
const source = record(value);
|
|
9916
|
+
const status = source.status;
|
|
9917
|
+
const candidate = source.publication;
|
|
9918
|
+
if (source.version != 1 || typeof source.hasUnpublishedChanges != "boolean") return invalidResponse();
|
|
9919
|
+
if (status != "not-published" && status != "runnable" && status != "suspended") return invalidResponse();
|
|
9920
|
+
if (status == "not-published" && candidate !== null) return invalidResponse();
|
|
9921
|
+
if (status != "not-published" && candidate === null) return invalidResponse();
|
|
9922
|
+
return {
|
|
9923
|
+
flowId: string(source.flowId),
|
|
9924
|
+
hasUnpublishedChanges: source.hasUnpublishedChanges,
|
|
9925
|
+
publication: candidate === null ? null : publication(candidate),
|
|
9926
|
+
revision: integer(source.revision),
|
|
9927
|
+
status,
|
|
9928
|
+
version: 1
|
|
9929
|
+
};
|
|
9930
|
+
}
|
|
9931
|
+
function publicationPage(value) {
|
|
9932
|
+
const source = record(value);
|
|
9933
|
+
const nextCursor = source.nextCursor;
|
|
9934
|
+
const total = source.total;
|
|
9935
|
+
if (source.version != 1 || !Array.isArray(source.publications)) return invalidResponse();
|
|
9936
|
+
if (nextCursor != null && typeof nextCursor != "string") return invalidResponse();
|
|
9937
|
+
if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
|
|
9938
|
+
return {
|
|
9939
|
+
...nextCursor == null ? {} : { nextCursor },
|
|
9940
|
+
publications: source.publications.map(publication),
|
|
9941
|
+
...total == null ? {} : { total },
|
|
9942
|
+
version: 1
|
|
9943
|
+
};
|
|
9944
|
+
}
|
|
9945
|
+
//#endregion
|
|
9791
9946
|
//#region src/trigger/common/configSchema.ts
|
|
9792
9947
|
var configInputsSchema = array(union([strictObject({
|
|
9793
9948
|
handle: string$1().min(1),
|
|
@@ -9970,54 +10125,99 @@ function pollTriggerTestResult(value) {
|
|
|
9970
10125
|
};
|
|
9971
10126
|
}
|
|
9972
10127
|
//#endregion
|
|
9973
|
-
//#region src/control/common/
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
}
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
}
|
|
10005
|
-
|
|
10128
|
+
//#region src/control/common/liveDetails.ts
|
|
10129
|
+
var metadata = {
|
|
10130
|
+
nodeId: string$1().min(1),
|
|
10131
|
+
name: string$1(),
|
|
10132
|
+
description: string$1().optional()
|
|
10133
|
+
};
|
|
10134
|
+
var binding = unknown().transform(triggerBinding);
|
|
10135
|
+
var provider = {
|
|
10136
|
+
provider: string$1().min(1),
|
|
10137
|
+
inputs: record$2(string$1(), discriminatedUnion("kind", [strictObject({
|
|
10138
|
+
kind: literal("value"),
|
|
10139
|
+
value: json$4()
|
|
10140
|
+
}), strictObject({ kind: literal("unset") })]))
|
|
10141
|
+
};
|
|
10142
|
+
var entrySchema = discriminatedUnion("type", [
|
|
10143
|
+
strictObject({
|
|
10144
|
+
...metadata,
|
|
10145
|
+
type: literal("manual"),
|
|
10146
|
+
config: authoringConfigurations.manual
|
|
10147
|
+
}),
|
|
10148
|
+
strictObject({
|
|
10149
|
+
...metadata,
|
|
10150
|
+
type: literal("webhook"),
|
|
10151
|
+
config: authoringConfigurations.webhook,
|
|
10152
|
+
binding
|
|
10153
|
+
}),
|
|
10154
|
+
strictObject({
|
|
10155
|
+
...metadata,
|
|
10156
|
+
type: literal("cron"),
|
|
10157
|
+
config: authoringConfigurations.cron,
|
|
10158
|
+
binding
|
|
10159
|
+
}),
|
|
10160
|
+
strictObject({
|
|
10161
|
+
...metadata,
|
|
10162
|
+
type: literal("error"),
|
|
10163
|
+
config: authoringConfigurations.error,
|
|
10164
|
+
binding
|
|
10165
|
+
}),
|
|
10166
|
+
strictObject({
|
|
10167
|
+
...metadata,
|
|
10168
|
+
...provider,
|
|
10169
|
+
type: literal("poll"),
|
|
10170
|
+
config: authoringConfigurations.poll,
|
|
10171
|
+
binding
|
|
10172
|
+
}),
|
|
10173
|
+
strictObject({
|
|
10174
|
+
...metadata,
|
|
10175
|
+
...provider,
|
|
10176
|
+
type: literal("integration"),
|
|
10177
|
+
config: authoringConfigurations.integration,
|
|
10178
|
+
binding
|
|
10179
|
+
})
|
|
10180
|
+
]);
|
|
10181
|
+
function decodeLiveDetails(value) {
|
|
10006
10182
|
const source = record(value);
|
|
10007
|
-
const
|
|
10008
|
-
if (!Array.isArray(source.
|
|
10183
|
+
const flowId = string(source.flowId);
|
|
10184
|
+
if (source.version != 1 || !Array.isArray(source.entries)) return invalidResponse();
|
|
10185
|
+
if (source.publication === null) {
|
|
10186
|
+
if (source.status != "not-published" || source.entries.length != 0 || Object.hasOwn(source, "enabled")) return invalidResponse();
|
|
10187
|
+
return {
|
|
10188
|
+
flowId,
|
|
10189
|
+
publication: null,
|
|
10190
|
+
status: "not-published",
|
|
10191
|
+
entries: [],
|
|
10192
|
+
version: 1
|
|
10193
|
+
};
|
|
10194
|
+
}
|
|
10195
|
+
const current = publication(source.publication);
|
|
10196
|
+
const status = source.status;
|
|
10197
|
+
if (current.flowId != flowId || typeof source.enabled != "boolean") return invalidResponse();
|
|
10198
|
+
if (status != "runnable" && status != "suspended") return invalidResponse();
|
|
10199
|
+
if (!source.enabled && source.status == "runnable") return invalidResponse();
|
|
10009
10200
|
return {
|
|
10010
|
-
|
|
10011
|
-
|
|
10201
|
+
flowId,
|
|
10202
|
+
publication: current,
|
|
10203
|
+
status,
|
|
10204
|
+
enabled: source.enabled,
|
|
10205
|
+
entries: decodeEntries(source.entries, current),
|
|
10206
|
+
version: 1
|
|
10012
10207
|
};
|
|
10013
10208
|
}
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
const
|
|
10017
|
-
return
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10209
|
+
/** Both producers and consumers enforce the same published-entry invariants. */
|
|
10210
|
+
function decodeEntries(values, current) {
|
|
10211
|
+
const parsed = array(entrySchema).safeParse(values);
|
|
10212
|
+
if (!parsed.success) return invalidResponse();
|
|
10213
|
+
const ids = /* @__PURE__ */ new Set();
|
|
10214
|
+
for (const entry of parsed.data) {
|
|
10215
|
+
if (ids.has(entry.nodeId)) return invalidResponse();
|
|
10216
|
+
ids.add(entry.nodeId);
|
|
10217
|
+
if (entry.type != "manual" && (entry.binding.flowId != current.flowId || entry.binding.triggerNodeId != entry.nodeId || entry.binding.kind != entry.type || entry.binding.currentPublicationId != current.publicationId || entry.binding.currentRevisionId != current.revisionId)) return invalidResponse();
|
|
10218
|
+
if (entry.type == "webhook" && (!entry.binding.endpointUrl || !webhookSupportsBody(entry.config.method) && Object.keys(entry.config.body).length > 0)) return invalidResponse();
|
|
10219
|
+
}
|
|
10220
|
+
return parsed.data;
|
|
10021
10221
|
}
|
|
10022
10222
|
//#endregion
|
|
10023
10223
|
//#region src/control/common/providerIconSprite.ts
|
|
@@ -10846,142 +11046,6 @@ function variableReferences(input) {
|
|
|
10846
11046
|
};
|
|
10847
11047
|
}
|
|
10848
11048
|
//#endregion
|
|
10849
|
-
//#region src/control/common/publicationDecoders.ts
|
|
10850
|
-
function publication(value) {
|
|
10851
|
-
const source = record(value);
|
|
10852
|
-
const liveEnd = source.liveEnd == null ? void 0 : record(source.liveEnd);
|
|
10853
|
-
if (liveEnd != null && typeof liveEnd.enabled != "boolean") return invalidResponse();
|
|
10854
|
-
const operation = source.operation;
|
|
10855
|
-
const sourcePublicationId = source.sourcePublicationId;
|
|
10856
|
-
if (source.version != 1) return invalidResponse();
|
|
10857
|
-
if (operation != "publish" && operation != "rollback") return invalidResponse();
|
|
10858
|
-
if (sourcePublicationId != null && typeof sourcePublicationId != "string") return invalidResponse();
|
|
10859
|
-
return {
|
|
10860
|
-
...liveEnd == null ? {} : { liveEnd: {
|
|
10861
|
-
enabled: liveEnd.enabled,
|
|
10862
|
-
endedAt: string(liveEnd.endedAt)
|
|
10863
|
-
} },
|
|
10864
|
-
actorId: string(source.actorId),
|
|
10865
|
-
closureDigest: string(source.closureDigest),
|
|
10866
|
-
createdAt: string(source.createdAt),
|
|
10867
|
-
engineContract: string(source.engineContract),
|
|
10868
|
-
flowId: string(source.flowId),
|
|
10869
|
-
modelVersion: integer(source.modelVersion),
|
|
10870
|
-
operation,
|
|
10871
|
-
publicationId: string(source.publicationId),
|
|
10872
|
-
sharedAccessDigest: string(source.sharedAccessDigest),
|
|
10873
|
-
revisionDigest: string(source.revisionDigest),
|
|
10874
|
-
revisionId: string(source.revisionId),
|
|
10875
|
-
...sourcePublicationId == null ? {} : { sourcePublicationId },
|
|
10876
|
-
version: 1
|
|
10877
|
-
};
|
|
10878
|
-
}
|
|
10879
|
-
function publishOperation(value) {
|
|
10880
|
-
const source = record(value);
|
|
10881
|
-
const status = source.status;
|
|
10882
|
-
const common = {
|
|
10883
|
-
createdAt: string(source.createdAt),
|
|
10884
|
-
flowId: string(source.flowId),
|
|
10885
|
-
operationId: string(source.operationId),
|
|
10886
|
-
revisionId: string(source.revisionId),
|
|
10887
|
-
updatedAt: string(source.updatedAt),
|
|
10888
|
-
version: 1
|
|
10889
|
-
};
|
|
10890
|
-
if (source.version != 1) return invalidResponse();
|
|
10891
|
-
switch (status) {
|
|
10892
|
-
case "pending":
|
|
10893
|
-
exact(source, [
|
|
10894
|
-
"createdAt",
|
|
10895
|
-
"flowId",
|
|
10896
|
-
"operationId",
|
|
10897
|
-
"revisionId",
|
|
10898
|
-
"status",
|
|
10899
|
-
"updatedAt",
|
|
10900
|
-
"version"
|
|
10901
|
-
]);
|
|
10902
|
-
return {
|
|
10903
|
-
...common,
|
|
10904
|
-
status
|
|
10905
|
-
};
|
|
10906
|
-
case "succeeded":
|
|
10907
|
-
exact(source, [
|
|
10908
|
-
"createdAt",
|
|
10909
|
-
"flowId",
|
|
10910
|
-
"operationId",
|
|
10911
|
-
"publicationId",
|
|
10912
|
-
"revisionId",
|
|
10913
|
-
"status",
|
|
10914
|
-
"updatedAt",
|
|
10915
|
-
"version"
|
|
10916
|
-
]);
|
|
10917
|
-
return {
|
|
10918
|
-
...common,
|
|
10919
|
-
publicationId: string(source.publicationId),
|
|
10920
|
-
status
|
|
10921
|
-
};
|
|
10922
|
-
case "failed": {
|
|
10923
|
-
exact(source, [
|
|
10924
|
-
"createdAt",
|
|
10925
|
-
"flowId",
|
|
10926
|
-
"issue",
|
|
10927
|
-
"operationId",
|
|
10928
|
-
"revisionId",
|
|
10929
|
-
"status",
|
|
10930
|
-
"updatedAt",
|
|
10931
|
-
"version"
|
|
10932
|
-
]);
|
|
10933
|
-
const issue = record(source.issue);
|
|
10934
|
-
const nodeId = issue.nodeId;
|
|
10935
|
-
exact(issue, [
|
|
10936
|
-
"code",
|
|
10937
|
-
"message",
|
|
10938
|
-
...nodeId == null ? [] : ["nodeId"]
|
|
10939
|
-
]);
|
|
10940
|
-
return {
|
|
10941
|
-
...common,
|
|
10942
|
-
issue: {
|
|
10943
|
-
code: string(issue.code),
|
|
10944
|
-
message: string(issue.message),
|
|
10945
|
-
...nodeId == null ? {} : { nodeId: string(nodeId) }
|
|
10946
|
-
},
|
|
10947
|
-
status
|
|
10948
|
-
};
|
|
10949
|
-
}
|
|
10950
|
-
default: return invalidResponse();
|
|
10951
|
-
}
|
|
10952
|
-
}
|
|
10953
|
-
function live(value) {
|
|
10954
|
-
const source = record(value);
|
|
10955
|
-
const status = source.status;
|
|
10956
|
-
const candidate = source.publication;
|
|
10957
|
-
if (source.version != 1 || typeof source.hasUnpublishedChanges != "boolean") return invalidResponse();
|
|
10958
|
-
if (status != "not-published" && status != "runnable" && status != "suspended") return invalidResponse();
|
|
10959
|
-
if (status == "not-published" && candidate !== null) return invalidResponse();
|
|
10960
|
-
if (status != "not-published" && candidate === null) return invalidResponse();
|
|
10961
|
-
return {
|
|
10962
|
-
flowId: string(source.flowId),
|
|
10963
|
-
hasUnpublishedChanges: source.hasUnpublishedChanges,
|
|
10964
|
-
publication: candidate === null ? null : publication(candidate),
|
|
10965
|
-
revision: integer(source.revision),
|
|
10966
|
-
status,
|
|
10967
|
-
version: 1
|
|
10968
|
-
};
|
|
10969
|
-
}
|
|
10970
|
-
function publicationPage(value) {
|
|
10971
|
-
const source = record(value);
|
|
10972
|
-
const nextCursor = source.nextCursor;
|
|
10973
|
-
const total = source.total;
|
|
10974
|
-
if (source.version != 1 || !Array.isArray(source.publications)) return invalidResponse();
|
|
10975
|
-
if (nextCursor != null && typeof nextCursor != "string") return invalidResponse();
|
|
10976
|
-
if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
|
|
10977
|
-
return {
|
|
10978
|
-
...nextCursor == null ? {} : { nextCursor },
|
|
10979
|
-
publications: source.publications.map(publication),
|
|
10980
|
-
...total == null ? {} : { total },
|
|
10981
|
-
version: 1
|
|
10982
|
-
};
|
|
10983
|
-
}
|
|
10984
|
-
//#endregion
|
|
10985
11049
|
//#region src/control/common/revisionDecoders.ts
|
|
10986
11050
|
function revisionMetadata(value) {
|
|
10987
11051
|
const source = record(value);
|
|
@@ -11909,21 +11973,14 @@ var ControlClient = class {
|
|
|
11909
11973
|
method: "POST"
|
|
11910
11974
|
}));
|
|
11911
11975
|
}
|
|
11976
|
+
async getLiveDetails(flowId, signal) {
|
|
11977
|
+
const details = decodeLiveDetails(await this.request(`/v1/flows/${segment(flowId)}/live/details`, { signal }));
|
|
11978
|
+
if (details.flowId != flowId) return invalidResponse();
|
|
11979
|
+
return details;
|
|
11980
|
+
}
|
|
11912
11981
|
async getLive(flowId, signal) {
|
|
11913
11982
|
return live(await this.request(`/v1/flows/${segment(flowId)}/live`, { signal }));
|
|
11914
11983
|
}
|
|
11915
|
-
async listPublicationResources(flowId, publicationId) {
|
|
11916
|
-
const query = publicationId == null ? "" : `?publicationId=${encodeURIComponent(publicationId)}`;
|
|
11917
|
-
const result = decodePublicationResources(await this.request(`/v1/flows/${segment(flowId)}/resources${query}`));
|
|
11918
|
-
if (result.flowId != flowId || publicationId != null && result.publicationId != publicationId) return invalidResponse();
|
|
11919
|
-
return result;
|
|
11920
|
-
}
|
|
11921
|
-
async getPublicationResource(flowId, resourceId, publicationId) {
|
|
11922
|
-
const query = publicationId == null ? "" : `?publicationId=${encodeURIComponent(publicationId)}`;
|
|
11923
|
-
const result = decodePublicationResource(await this.request(`/v1/flows/${segment(flowId)}/resources/${segment(resourceId)}${query}`));
|
|
11924
|
-
if (result.flowId != flowId || result.resource.resourceId != resourceId || publicationId != null && result.publicationId != publicationId) return invalidResponse();
|
|
11925
|
-
return result;
|
|
11926
|
-
}
|
|
11927
11984
|
async listPublications(flowId, options = {}, signal) {
|
|
11928
11985
|
const parameters = new URLSearchParams();
|
|
11929
11986
|
if (options.cursor != null) parameters.set("cursor", options.cursor);
|
|
@@ -12257,7 +12314,7 @@ var mutationKey = id.max(256).describe("Stable identity for this mutation. Retry
|
|
|
12257
12314
|
var pageLimit = int().min(1).max(100).default(50);
|
|
12258
12315
|
var flow = id.describe("Exact Flow ID returned by flow_list or flow_create.");
|
|
12259
12316
|
var run = id.describe("Exact Run ID returned by flow_run or run_list.");
|
|
12260
|
-
var mcpInstructions = "Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Before adding a Feishu Trigger, use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_edit with identical arguments and the same requestId. Retry flow_create, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
|
|
12317
|
+
var mcpInstructions = "Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Before adding a Feishu Trigger, use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_live to inspect current online entries after publication. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_edit with identical arguments and the same requestId. Retry flow_create, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
|
|
12261
12318
|
function tool(description, schema, readOnly) {
|
|
12262
12319
|
return {
|
|
12263
12320
|
description,
|
|
@@ -12285,15 +12342,7 @@ function tool(description, schema, readOnly) {
|
|
|
12285
12342
|
};
|
|
12286
12343
|
}
|
|
12287
12344
|
var mcpTools = {
|
|
12288
|
-
|
|
12289
|
-
flowId: flow,
|
|
12290
|
-
publicationId: id.optional()
|
|
12291
|
-
}), true),
|
|
12292
|
-
flow_resource_get: tool("Read a published resource by resourceId from flow_resources. Defaults to current Live; supply publicationId to keep the publication fixed. Historical resources have no current runtime state or callable URL.", strictObject({
|
|
12293
|
-
flowId: flow,
|
|
12294
|
-
resourceId: id,
|
|
12295
|
-
publicationId: id.optional()
|
|
12296
|
-
}), true),
|
|
12345
|
+
flow_live: tool("Read the current published Flow, enablement and online entries, including Webhook URLs and request fields. Draft changes do not affect this view. An unpublished Flow returns not-published with no entries.", strictObject({ flowId: flow }), true),
|
|
12297
12346
|
flow_list: tool("List Flows in this deployment. Continue with nextCursor; cursors are compatible with the Control API.", strictObject({
|
|
12298
12347
|
cursor: id.optional(),
|
|
12299
12348
|
limit: pageLimit
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ Use `<!-- agentic:var flowCommand -->` to operate the selected deployment.
|
|
|
9
9
|
Consult the references relevant to the task:
|
|
10
10
|
|
|
11
11
|
- [Flow capabilities and examples](references/flow-authoring.md): inspect, edit,
|
|
12
|
-
connect, validate, run and publish;
|
|
12
|
+
connect, validate, run and publish; online entries and Flow enable/disable;
|
|
13
13
|
concurrency and Run diagnostics.
|
|
14
14
|
- [n8n conversion](references/flow-n8n-conversion.md): represent collections,
|
|
15
15
|
branches, provider operations and state while preserving source behavior.
|
|
@@ -29,5 +29,8 @@ Server; do not duplicate them in the CLI.
|
|
|
29
29
|
<!-- agentic:endif -->
|
|
30
30
|
|
|
31
31
|
Keep the requested boundary: editing a Draft does not authorize a Run,
|
|
32
|
-
publication, or enabling automatic execution.
|
|
33
|
-
|
|
32
|
+
publication, or enabling automatic execution. Inspecting an entry does not
|
|
33
|
+
by itself authorize invoking it. For edits, report the Flow and Revision,
|
|
34
|
+
verification result, and unresolved configuration. For a publication, report
|
|
35
|
+
the Publication and available online entries. For a query, report the observed
|
|
36
|
+
online state.
|