mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 04:40:42 +00:00
refactor(plugin-sdk): add managed task flow runtime
This commit is contained in:
@@ -191,7 +191,7 @@ describe("plugin runtime command execution", () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "exposes canonical runtime.tasks.runs and runtime.tasks.flows while keeping legacy TaskFlow aliases",
|
||||
name: "exposes canonical runtime.tasks task runtimes while keeping legacy TaskFlow aliases",
|
||||
assert: (runtime: ReturnType<typeof createPluginRuntime>) => {
|
||||
expectFunctionKeys(runtime.tasks.runs as Record<string, unknown>, [
|
||||
"bindSession",
|
||||
@@ -201,11 +201,16 @@ describe("plugin runtime command execution", () => {
|
||||
"bindSession",
|
||||
"fromToolContext",
|
||||
]);
|
||||
expectFunctionKeys(runtime.tasks.managedFlows as Record<string, unknown>, [
|
||||
"bindSession",
|
||||
"fromToolContext",
|
||||
]);
|
||||
expectFunctionKeys(runtime.tasks.flow as Record<string, unknown>, [
|
||||
"bindSession",
|
||||
"fromToolContext",
|
||||
]);
|
||||
expect(runtime.taskFlow).toBe(runtime.tasks.flow);
|
||||
expect(runtime.tasks.managedFlows).toBe(runtime.tasks.flow);
|
||||
expect(runtime.taskFlow).toBe(runtime.tasks.managedFlows);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -217,6 +217,7 @@ export function createRuntimeTasks(params: {
|
||||
return {
|
||||
runs: createRuntimeTaskRuns(),
|
||||
flows: createRuntimeTaskFlows(),
|
||||
managedFlows: params.legacyTaskFlow,
|
||||
flow: params.legacyTaskFlow,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ export type PluginRuntimeTaskFlows = {
|
||||
export type PluginRuntimeTasks = {
|
||||
runs: PluginRuntimeTaskRuns;
|
||||
flows: PluginRuntimeTaskFlows;
|
||||
managedFlows: PluginRuntimeTaskFlow;
|
||||
/** @deprecated Use runtime.tasks.flows for DTO-based TaskFlow access. */
|
||||
flow: PluginRuntimeTaskFlow;
|
||||
};
|
||||
|
||||
@@ -231,6 +231,7 @@ export type PluginRuntimeCore = {
|
||||
tasks: {
|
||||
runs: PluginRuntimeTaskRuns;
|
||||
flows: PluginRuntimeTaskFlows;
|
||||
managedFlows: import("./runtime-taskflow.types.js").PluginRuntimeTaskFlow;
|
||||
/** @deprecated Use runtime.tasks.flows for DTO-based TaskFlow access. */
|
||||
flow: import("./runtime-taskflow.types.js").PluginRuntimeTaskFlow;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user