feat(pi-workflow): improve workflow usability and recovery
This commit is contained in:
@@ -24,6 +24,10 @@ import {
|
||||
import { runScriptSandbox } from "./script-runtime.ts";
|
||||
import { WorkflowStore } from "./store.ts";
|
||||
import { registerPiWorkflowTool } from "./tool.ts";
|
||||
import {
|
||||
refreshWorkflowProgress,
|
||||
registerWorkflowProgress,
|
||||
} from "./progress.ts";
|
||||
import {
|
||||
ApprovedHostCommandExecutor,
|
||||
FilesystemPrototypeValidator,
|
||||
@@ -111,7 +115,10 @@ export default function piWorkflowExtension(pi: ExtensionAPI) {
|
||||
let runtime: ContextTransitionRuntime;
|
||||
runtime = createWorkflowRuntime({
|
||||
afterRunPersist: async (ctx) => {
|
||||
await reconcileWorkflowDeliveries(pi, runtime, ctx);
|
||||
await Promise.all([
|
||||
reconcileWorkflowDeliveries(pi, runtime, ctx),
|
||||
refreshWorkflowProgress(runtime, ctx),
|
||||
]);
|
||||
},
|
||||
});
|
||||
registerWorkflowContextTransitions(pi, runtime, (args, ctx) =>
|
||||
@@ -120,4 +127,5 @@ export default function piWorkflowExtension(pi: ExtensionAPI) {
|
||||
registerPiWorkflowTool(pi, runtime);
|
||||
registerWorkflowRecovery(pi, runtime);
|
||||
registerWorkflowNotifications(pi, runtime);
|
||||
registerWorkflowProgress(pi, runtime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user