MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / loadLocalPlugins

Function loadLocalPlugins

apps/local/src/executor.ts:60–89  ·  view source on GitHub ↗
(options: LocalExecutorOptions = {})

Source from the content-addressed store, hash-verified

58}
59
60const loadLocalPlugins = (options: LocalExecutorOptions = {}) =>
61 Effect.gen(function* () {
62 const cwd = process.env.EXECUTOR_SCOPE_DIR || process.cwd();
63 const staticPlugins = executorConfig.plugins({
64 activeToolkitSlug: options.activeToolkitSlug,
65 });
66 const dynamicPlugins =
67 (yield* Effect.promise(() => loadPluginsFromJsonc({ path: resolvePluginConfigPath(cwd) }))) ??
68 [];
69
70 const staticPackageNames = new Set(
71 staticPlugins.map((plugin) => plugin.packageName).filter((name): name is string => !!name),
72 );
73 const dedupedDynamic = dynamicPlugins.filter((plugin) => {
74 if (plugin.packageName && staticPackageNames.has(plugin.packageName)) {
75 console.warn(
76 `[executor] plugin "${plugin.packageName}" appears in both ` +
77 `executor.config.ts and executor.jsonc#plugins. The static ` +
78 `entry wins; the jsonc entry is ignored.`,
79 );
80 return false;
81 }
82 return true;
83 });
84
85 return {
86 cwd,
87 plugins: [...staticPlugins, ...dedupedDynamic] as LocalPlugins,
88 };
89 });
90
91interface LocalExecutorBundle {
92 readonly executor: Executor<LocalPlugins>;

Callers 1

createLocalExecutorLayerFunction · 0.85

Calls 3

loadPluginsFromJsoncFunction · 0.90
resolvePluginConfigPathFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected