mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 17:00:22 +00:00
Refactor: centralize native approval lifecycle assembly (#62135)
Merged via squash.
Prepared head SHA: b7c20a7398
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
committed by
GitHub
parent
4108901932
commit
d78512b09d
@@ -350,6 +350,17 @@ export function createPluginRuntimeMock(overrides: DeepPartial<PluginRuntime> =
|
||||
setMaxAgeBySessionKey:
|
||||
vi.fn() as unknown as PluginRuntime["channel"]["threadBindings"]["setMaxAgeBySessionKey"],
|
||||
},
|
||||
runtimeContexts: {
|
||||
register: vi.fn(({ abortSignal }: { abortSignal?: AbortSignal }) => {
|
||||
const lease = { dispose: vi.fn() };
|
||||
abortSignal?.addEventListener("abort", lease.dispose, { once: true });
|
||||
return lease;
|
||||
}) as unknown as PluginRuntime["channel"]["runtimeContexts"]["register"],
|
||||
get: vi.fn() as unknown as PluginRuntime["channel"]["runtimeContexts"]["get"],
|
||||
watch: vi.fn(() =>
|
||||
vi.fn(),
|
||||
) as unknown as PluginRuntime["channel"]["runtimeContexts"]["watch"],
|
||||
},
|
||||
activity: {} as PluginRuntime["channel"]["activity"],
|
||||
},
|
||||
events: {
|
||||
|
||||
Reference in New Issue
Block a user