import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
import {
  capability_exports
} from "./chunk-64IMLAS2.mjs";
import {
  __export
} from "./chunk-HSLMI22Q.mjs";

// src/common/capabilities.ts
var capabilities_exports = {};
__export(capabilities_exports, {
  AtomRegistry: () => AtomRegistry,
  Command: () => Command,
  HistoryTracker: () => HistoryTracker,
  Layer: () => Layer,
  ManagedRuntime: () => ManagedRuntime,
  Null: () => Null,
  OperationInvoker: () => OperationInvoker,
  OperationResolver: () => OperationResolver,
  PluginManager: () => PluginManager,
  ReactContext: () => ReactContext,
  ReactRoot: () => ReactRoot,
  ReactSurface: () => ReactSurface,
  UndoMapping: () => UndoMapping,
  UndoRegistry: () => UndoRegistry,
  getAtomValue: () => getAtomValue,
  subscribeAtom: () => subscribeAtom,
  updateAtomValue: () => updateAtomValue
});
import * as Effect from "effect/Effect";
var Null = capability_exports.make("dxos.org/app-framework/capability/null");
var PluginManager = capability_exports.make("dxos.org/app-framework/capability/plugin-manager");
var AtomRegistry = capability_exports.make("dxos.org/app-framework/capability/atom-registry");
var ReactContext = capability_exports.make("dxos.org/app-framework/capability/react-context");
var ReactRoot = capability_exports.make("dxos.org/app-framework/capability/react-root");
var ReactSurface = capability_exports.make("dxos.org/app-framework/common/react-surface");
var Command = capability_exports.make("dxos.org/app-framework/capability/command");
var Layer = capability_exports.make("dxos.org/app-framework/capability/layer");
var ManagedRuntime = capability_exports.make("dxos.org/app-framework/capability/managed-runtime");
var OperationResolver = capability_exports.make("dxos.org/app-framework/capability/operation-resolver");
var UndoMapping = capability_exports.make("dxos.org/app-framework/capability/undo-mapping");
var OperationInvoker = capability_exports.make("dxos.org/app-framework/capability/operation-invoker");
var UndoRegistry = capability_exports.make("dxos.org/app-framework/capability/undo-registry");
var HistoryTracker = capability_exports.make("dxos.org/app-framework/capability/history-tracker");
var getAtomValue = (atomCapability) => Effect.gen(function* () {
  const registry = yield* capability_exports.get(AtomRegistry);
  const atom = yield* capability_exports.get(atomCapability);
  return registry.get(atom);
});
var updateAtomValue = (atomCapability, fn) => Effect.gen(function* () {
  const registry = yield* capability_exports.get(AtomRegistry);
  const atom = yield* capability_exports.get(atomCapability);
  registry.set(atom, fn(registry.get(atom)));
});
var subscribeAtom = (atomCapability, callback) => Effect.gen(function* () {
  const registry = yield* capability_exports.get(AtomRegistry);
  const atom = yield* capability_exports.get(atomCapability);
  return registry.subscribe(atom, () => callback(registry.get(atom)));
});

export {
  Null,
  PluginManager,
  AtomRegistry,
  ReactContext,
  ReactRoot,
  ReactSurface,
  Command,
  Layer,
  ManagedRuntime,
  OperationResolver,
  UndoMapping,
  OperationInvoker,
  UndoRegistry,
  HistoryTracker,
  getAtomValue,
  updateAtomValue,
  subscribeAtom,
  capabilities_exports
};
//# sourceMappingURL=chunk-OQYHRZYF.mjs.map
