mirror of
https://github.com/iflytek/skillhub.git
synced 2026-12-03 00:47:22 +00:00
15 lines
703 B
JavaScript
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));
|
|
},
|
|
});
|
|
}
|