import "./chunk-4DQMLMGU.mjs";
import {
  capabilities_exports
} from "./chunk-IGRQWMWW.mjs";
import {
  activation_events_exports
} from "./chunk-NPUEVX42.mjs";
import "./chunk-YAFEA4GV.mjs";
import "./chunk-WGWEEBUV.mjs";
import "./chunk-PKQT6C53.mjs";
import {
  plugin_exports
} from "./chunk-KWP6PKIU.mjs";
import {
  capability_exports
} from "./chunk-ZQO3UZ4R.mjs";
import "./chunk-J5LGTIGS.mjs";

// src/plugin-operation/invoker-capability.ts
import * as Effect from "effect/Effect";
import { OperationInvoker } from "@dxos/operation";
var invoker_capability_default = capability_exports.makeModule(Effect.fnUntraced(function* () {
  const capabilityManager = yield* capability_exports.Service;
  const pluginManager = yield* plugin_exports.Service;
  const managedRuntimes = yield* capability_exports.getAll(capabilities_exports.ManagedRuntime);
  const managedRuntime = managedRuntimes.length > 0 ? managedRuntimes[0] : void 0;
  const invoker = OperationInvoker.make(() => Effect.gen(function* () {
    yield* plugin_exports.activate(activation_events_exports.SetupOperationResolver);
    return (yield* capability_exports.getAll(capabilities_exports.OperationResolver)).flat();
  }).pipe(Effect.provideService(capability_exports.Service, capabilityManager), Effect.provideService(plugin_exports.Service, pluginManager)), managedRuntime);
  return capability_exports.contributes(capabilities_exports.OperationInvoker, invoker);
}));
export {
  invoker_capability_default as default
};
//# sourceMappingURL=invoker-capability-7QW56NOM.mjs.map
