skillhub/plugins/dsh/scripts/account-local-core.mjs
dongmucat 3bad5d54e5 refactor(dsh): keep registry authentication inside the plugin
Signed-off-by: dongmucat <1127093059@qq.com>
2026-11-23 09:36:22 +08:00

15 lines
703 B
JavaScript

import { openNativeRuntime as openRuntime } from '../../../cli/src/integrations/local-skills.ts';
import { registryCredentials } from './core-registry-transport.ts';
export * from '../../../cli/src/integrations/local-skills.ts';
/** Each DSH Host supplies its own account resolver without changing the shared core. */
export async function openNativeRuntime(options) {
const runtime = await openRuntime(options);
return new Proxy(runtime, {
get(target, property) {
const value = Reflect.get(target, property);
if (typeof value !== 'function') return value;
return (...args) => registryCredentials.run(options.getRegistryToken, () => value.apply(target, args));
},
});
}