mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 23:01:08 +00:00
fix(plugin-sdk): lazy acp runtime testing merge
This commit is contained in:
@@ -26,7 +26,29 @@ export type {
|
||||
export { readAcpSessionEntry } from "../acp/runtime/session-meta.js";
|
||||
export type { AcpSessionStoreEntry } from "../acp/runtime/session-meta.js";
|
||||
|
||||
export const __testing = {
|
||||
...managerTesting,
|
||||
...registryTesting,
|
||||
};
|
||||
// Keep test helpers off the hot init path. Eagerly merging them here can
|
||||
// create a back-edge through the bundled ACP runtime chunk before the imported
|
||||
// testing bindings finish initialization.
|
||||
export const __testing = new Proxy({} as typeof managerTesting & typeof registryTesting, {
|
||||
get(_target, prop, receiver) {
|
||||
if (Reflect.has(managerTesting, prop)) {
|
||||
return Reflect.get(managerTesting, prop, receiver);
|
||||
}
|
||||
return Reflect.get(registryTesting, prop, receiver);
|
||||
},
|
||||
has(_target, prop) {
|
||||
return Reflect.has(managerTesting, prop) || Reflect.has(registryTesting, prop);
|
||||
},
|
||||
ownKeys() {
|
||||
return Array.from(new Set([...Reflect.ownKeys(managerTesting), ...Reflect.ownKeys(registryTesting)]));
|
||||
},
|
||||
getOwnPropertyDescriptor(_target, prop) {
|
||||
if (Reflect.has(managerTesting, prop) || Reflect.has(registryTesting, prop)) {
|
||||
return {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user