mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 05:30:22 +00:00
refactor: move tasks into bundled plugin
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
registerMemoryPromptSection,
|
||||
registerMemoryRuntime,
|
||||
} from "./memory-state.js";
|
||||
import { registerOperationsRuntimeForOwner } from "./operations-state.js";
|
||||
import { normalizeRegisteredProvider } from "./provider-validation.js";
|
||||
import { createEmptyPluginRegistry } from "./registry-empty.js";
|
||||
import { withPluginRuntimePluginIdScope } from "./runtime/gateway-request-scope.js";
|
||||
@@ -1153,6 +1154,20 @@ export function createPluginRegistry(registryParams: PluginRegistryParams) {
|
||||
ownerPluginId: record.id,
|
||||
});
|
||||
},
|
||||
registerOperationsRuntime: (runtime) => {
|
||||
const result = registerOperationsRuntimeForOwner(runtime, record.id, {
|
||||
allowSameOwnerRefresh: true,
|
||||
});
|
||||
if (!result.ok) {
|
||||
const ownerDetail = result.existingOwner ? ` (${result.existingOwner})` : "";
|
||||
pushDiagnostic({
|
||||
level: "error",
|
||||
pluginId: record.id,
|
||||
source: record.source,
|
||||
message: `operations runtime already registered${ownerDetail}`,
|
||||
});
|
||||
}
|
||||
},
|
||||
on: (hookName, handler, opts) =>
|
||||
registerTypedHook(record, hookName, handler, opts, params.hookPolicy),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user