@oomol-lab/open-flow 0.1.0-beta.64 → 0.1.0-beta.65
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/flow-authoring.js +21 -2
- package/dist/browser/{flowChanges-BAMkSaKF.js → flowChanges-DkvG5uDq.js} +1774 -1663
- package/dist/browser/{flowWorkspace-DxLc1Ybv.js → flowWorkspace-BEp-lxqF.js} +116 -1
- package/dist/browser/preview.css +8 -0
- package/dist/browser/preview.js +1870 -1663
- package/dist/browser/ui.css +8 -0
- package/dist/browser/workbench.css +8 -0
- package/dist/browser/workbench.js +31 -4
- package/dist/command/index.js +22 -22
- package/dist/common/connectorDecoders.d.ts +2 -1
- package/dist/common/control-api-conformance.js +19 -0
- package/dist/common/control-api.d.ts +7 -0
- package/dist/common/control-api.js +25 -0
- package/dist/common/control-requests.js +45 -5
- package/dist/common/flow-semantics.js +6 -0
- package/dist/common/mcp.js +3310 -3291
- package/dist/common/scheduler.d.ts +1 -0
- package/dist/common/scheduler.js +49 -3
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import type { PreparedFlow } from './flow-semantics.js';
|
|
|
3
3
|
import type { PreviousNode } from '../index.js';
|
|
4
4
|
import type { AgentCheckpoint } from './runtime-contract.js';
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
export declare const withWaitNotificationMessage: (value: JsonValue) => JsonValue;
|
|
6
7
|
export declare const normalizeWaitComment: (value?: string | null) => string | null;
|
|
7
8
|
export interface WaitResolution {
|
|
8
9
|
readonly action: WaitAction;
|
package/dist/common/scheduler.js
CHANGED
|
@@ -10563,6 +10563,12 @@ function resolutionOutputPorts(node) {
|
|
|
10563
10563
|
pending: objectPort({
|
|
10564
10564
|
inputs,
|
|
10565
10565
|
prompt: { type: "string" },
|
|
10566
|
+
pageUrl: { type: "string" },
|
|
10567
|
+
message: {
|
|
10568
|
+
type: "string",
|
|
10569
|
+
minLength: 1,
|
|
10570
|
+
pattern: "\\S"
|
|
10571
|
+
},
|
|
10566
10572
|
...Object.fromEntries(actions.map((action) => [`${action}Url`, { type: "string" }])),
|
|
10567
10573
|
expiresAt: { type: "string" }
|
|
10568
10574
|
}),
|
|
@@ -10875,8 +10881,24 @@ var waitCommentSchema = string().trim().refine((value) => [...value].length <= 2
|
|
|
10875
10881
|
function normalizeWaitComment$1(value) {
|
|
10876
10882
|
return waitCommentSchema.parse(value) || null;
|
|
10877
10883
|
}
|
|
10884
|
+
function withWaitNotificationMessage$1(value) {
|
|
10885
|
+
const source = schemaObject(value);
|
|
10886
|
+
if (source == null || source.pageUrl !== void 0 && source.message !== void 0) return value;
|
|
10887
|
+
const pageUrl = source.pageUrl === void 0 ? source.continueUrl ?? source.approveUrl : source.pageUrl;
|
|
10888
|
+
if (typeof pageUrl != "string" || typeof source.prompt != "string" || typeof source.expiresAt != "string") return value;
|
|
10889
|
+
return {
|
|
10890
|
+
...source,
|
|
10891
|
+
pageUrl,
|
|
10892
|
+
message: source.message === void 0 ? [
|
|
10893
|
+
source.prompt,
|
|
10894
|
+
`Expires at: ${source.expiresAt}`,
|
|
10895
|
+
`Review request: ${pageUrl}`
|
|
10896
|
+
].join("\n\n") : source.message
|
|
10897
|
+
};
|
|
10898
|
+
}
|
|
10878
10899
|
//#endregion
|
|
10879
10900
|
//#region src/execution/common/scheduler.ts
|
|
10901
|
+
var withWaitNotificationMessage = withWaitNotificationMessage$1;
|
|
10880
10902
|
var normalizeWaitComment = normalizeWaitComment$1;
|
|
10881
10903
|
var PortValidationError = class extends Error {};
|
|
10882
10904
|
function usesPending(graph, nodeId) {
|
|
@@ -11349,7 +11371,7 @@ function runGraph(context, target, runId, launchInputs = {}, trigger, resume) {
|
|
|
11349
11371
|
const node = target.graph.nodes[nodeId];
|
|
11350
11372
|
const waitId = nanoid$1();
|
|
11351
11373
|
const notify = isResolutionNode(node) && usesPending(target.graph, nodeId);
|
|
11352
|
-
const
|
|
11374
|
+
const notification = yield* context.waits.create({
|
|
11353
11375
|
jobId,
|
|
11354
11376
|
nodeId,
|
|
11355
11377
|
value,
|
|
@@ -11359,6 +11381,7 @@ function runGraph(context, target, runId, launchInputs = {}, trigger, resume) {
|
|
|
11359
11381
|
prompt: isResolutionNode(node) ? node.prompt : JSON.stringify(value, null, 2),
|
|
11360
11382
|
...isResolutionNode(node) ? {} : { notification: agentNotice(node, agents[jobId].input) }
|
|
11361
11383
|
});
|
|
11384
|
+
const pending = notification == null ? notification : withWaitNotificationMessage(notification);
|
|
11362
11385
|
if (notify) {
|
|
11363
11386
|
validateOutputs(nodeId, node, { pending });
|
|
11364
11387
|
dependencies.release(nodeId, { pending }, ["pending"], false);
|
|
@@ -11553,7 +11576,30 @@ function runFlow(prepared, options) {
|
|
|
11553
11576
|
const emit = options.emit ?? (() => Effect.void);
|
|
11554
11577
|
return Effect.gen(function* () {
|
|
11555
11578
|
if (options.resume != null && (options.inputs != null || options.trigger != null || options.bindingValues != null)) return yield* Effect.fail(/* @__PURE__ */ new Error("A resumed Flow Run cannot accept launch inputs, binding values, or a Trigger seed."));
|
|
11556
|
-
const
|
|
11579
|
+
const decoded = options.resume == null ? void 0 : decodeFlowRunCheckpoint(options.resume.checkpoint);
|
|
11580
|
+
const outputs = (nodeId, value) => isResolutionNode(prepared.graph.nodes[nodeId]) && value.pending != null ? {
|
|
11581
|
+
...value,
|
|
11582
|
+
pending: withWaitNotificationMessage(value.pending)
|
|
11583
|
+
} : value;
|
|
11584
|
+
const checkpoint = decoded == null ? void 0 : {
|
|
11585
|
+
...decoded,
|
|
11586
|
+
results: Object.fromEntries(Object.entries(decoded.results).map(([id, result]) => [id, {
|
|
11587
|
+
...result,
|
|
11588
|
+
outputs: outputs(id, result.outputs)
|
|
11589
|
+
}])),
|
|
11590
|
+
dependencies: {
|
|
11591
|
+
...decoded.dependencies,
|
|
11592
|
+
nodes: Object.fromEntries(Object.entries(decoded.dependencies.nodes).map(([id, state]) => [id, {
|
|
11593
|
+
...state,
|
|
11594
|
+
...state.output == null ? {} : { output: outputs(id, state.output) },
|
|
11595
|
+
input: Object.fromEntries(Object.entries(state.input).map(([source, result]) => [source, {
|
|
11596
|
+
...result,
|
|
11597
|
+
outputs: outputs(source, result.outputs)
|
|
11598
|
+
}]))
|
|
11599
|
+
}]))
|
|
11600
|
+
},
|
|
11601
|
+
waits: decoded.waits.map((wait) => wait.pending == null ? wait : Object.assign({}, wait, { pending: withWaitNotificationMessage(wait.pending) }))
|
|
11602
|
+
};
|
|
11557
11603
|
if (checkpoint != null && new TextEncoder().encode(JSON.stringify(checkpoint)).byteLength > 16777216) return yield* Effect.fail(/* @__PURE__ */ new Error("Flow Run checkpoint exceeds 16 MiB."));
|
|
11558
11604
|
if (checkpoint == null && options.trigger == null) return yield* Effect.fail(/* @__PURE__ */ new Error("A Flow Run requires a Trigger seed."));
|
|
11559
11605
|
const triggerNode = options.trigger == null ? void 0 : prepared.graph.nodes[options.trigger.nodeId];
|
|
@@ -11576,4 +11622,4 @@ function runFlow(prepared, options) {
|
|
|
11576
11622
|
});
|
|
11577
11623
|
}
|
|
11578
11624
|
//#endregion
|
|
11579
|
-
export { PortValidationError, decodeFlowRunCheckpoint, normalizeWaitComment, runFlow, waitRetentionMs };
|
|
11625
|
+
export { PortValidationError, decodeFlowRunCheckpoint, normalizeWaitComment, runFlow, waitRetentionMs, withWaitNotificationMessage };
|