refactor: move tasks into bundled plugin

This commit is contained in:
Peter Steinberger
2026-03-31 14:48:22 +01:00
parent 584db0aff2
commit c75f4695b7
39 changed files with 2492 additions and 736 deletions

View File

@@ -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),
}