Revert "refactor: move tasks into bundled plugin"

This reverts commit c75f4695b7.
This commit is contained in:
Peter Steinberger
2026-04-01 01:28:18 +09:00
parent 759d37635d
commit 8bf8baef87
25 changed files with 10 additions and 1400 deletions

View File

@@ -215,20 +215,6 @@ describe("plugin runtime command execution", () => {
]);
},
},
{
name: "exposes runtime.operations helpers",
assert: (runtime: ReturnType<typeof createPluginRuntime>) => {
expect(runtime.operations).toBeDefined();
expectFunctionKeys(runtime.operations as Record<string, unknown>, [
"dispatch",
"getById",
"findByRunId",
"list",
"summarize",
"cancel",
]);
},
},
] as const)("$name", ({ assert }) => {
expectRuntimeShape(assert);
});

View File

@@ -6,10 +6,8 @@ import {
createLazyRuntimeMethodBinder,
createLazyRuntimeModule,
} from "../../shared/lazy-runtime.js";
import { defaultTaskOperationsRuntime } from "../../tasks/operations-runtime.js";
import { VERSION } from "../../version.js";
import { listWebSearchProviders, runWebSearch } from "../../web-search/runtime.js";
import { getRegisteredOperationsRuntime } from "../operations-state.js";
import { createRuntimeAgent } from "./runtime-agent.js";
import { defineCachedValue } from "./runtime-cache.js";
import { createRuntimeChannel } from "./runtime-channel.js";
@@ -98,20 +96,6 @@ function createRuntimeModelAuth(): PluginRuntime["modelAuth"] {
};
}
function createRuntimeOperations(): PluginRuntime["operations"] {
const resolveRuntime = () => getRegisteredOperationsRuntime() ?? defaultTaskOperationsRuntime;
return {
dispatch: (event) => resolveRuntime().dispatch(event),
getById: (operationId) => resolveRuntime().getById(operationId),
findByRunId: (runId) => resolveRuntime().findByRunId(runId),
list: (query) => resolveRuntime().list(query),
summarize: (query) => resolveRuntime().summarize(query),
audit: (query) => resolveRuntime().audit(query),
maintenance: (query) => resolveRuntime().maintenance(query),
cancel: (params) => resolveRuntime().cancel(params),
};
}
function createUnavailableSubagentRuntime(): PluginRuntime["subagent"] {
const unavailable = () => {
throw new Error("Plugin runtime subagent methods are only available during a gateway request.");
@@ -219,7 +203,6 @@ export function createPluginRuntime(_options: CreatePluginRuntimeOptions = {}):
events: createRuntimeEvents(),
logging: createRuntimeLogging(),
state: { resolveStateDir },
operations: createRuntimeOperations(),
} satisfies Omit<
PluginRuntime,
"tts" | "mediaUnderstanding" | "stt" | "modelAuth" | "imageGeneration"

View File

@@ -1,17 +1,5 @@
import type { HeartbeatRunResult } from "../../infra/heartbeat-wake.js";
import type { LogLevel } from "../../logging/levels.js";
import type {
PluginOperationAuditFinding,
PluginOperationAuditQuery,
PluginOperationDispatchEvent,
PluginOperationDispatchResult,
PluginOperationListQuery,
PluginOperationMaintenanceQuery,
PluginOperationMaintenanceSummary,
PluginOperationRecord,
PluginOperationSummary,
PluginOperationsCancelResult,
} from "../operations-state.js";
export type { HeartbeatRunResult };
@@ -127,19 +115,4 @@ export type PluginRuntimeCore = {
cfg?: import("../../config/config.js").OpenClawConfig;
}) => Promise<import("../../agents/model-auth.js").ResolvedProviderAuth>;
};
operations: {
dispatch: (event: PluginOperationDispatchEvent) => Promise<PluginOperationDispatchResult>;
getById: (operationId: string) => Promise<PluginOperationRecord | null>;
findByRunId: (runId: string) => Promise<PluginOperationRecord | null>;
list: (query?: PluginOperationListQuery) => Promise<PluginOperationRecord[]>;
summarize: (query?: PluginOperationListQuery) => Promise<PluginOperationSummary>;
audit: (query?: PluginOperationAuditQuery) => Promise<PluginOperationAuditFinding[]>;
maintenance: (
query?: PluginOperationMaintenanceQuery,
) => Promise<PluginOperationMaintenanceSummary>;
cancel: (params: {
cfg: import("../../config/config.js").OpenClawConfig;
operationId: string;
}) => Promise<PluginOperationsCancelResult>;
};
};