{
  "version": 3,
  "sources": ["../../../src/plugin-intent/intent-dispatcher.ts", "../../../src/plugin-intent/actions.ts", "../../../src/plugin-intent/intent.ts", "../../../src/plugin-intent/errors.ts", "../../../src/core/capabilities.ts", "../../../src/core/events.ts", "../../../src/core/manager.ts", "../../../src/core/plugin.ts", "../../../src/common/capabilities.ts", "../../../src/common/collaboration.ts", "../../../src/common/events.ts", "../../../src/common/file.ts", "../../../src/common/layout.ts", "../../../src/plugin-intent/IntentPlugin.ts", "../../../src/common/surface.ts", "../../../src/common/translations.ts"],
  "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Effect, Option, pipe, Ref } from 'effect';\nimport { type Simplify } from 'effect/Types';\n\nimport { live } from '@dxos/live-object';\nimport { log } from '@dxos/log';\nimport { byPosition, type MaybePromise, type Position, type GuardedType } from '@dxos/util';\n\nimport { IntentAction } from './actions';\nimport { CycleDetectedError, NoResolversError } from './errors';\nimport {\n  createIntent,\n  type AnyIntent,\n  type AnyIntentChain,\n  type Intent,\n  type IntentChain,\n  type IntentData,\n  type IntentParams,\n  type IntentResultData,\n  type IntentSchema,\n  type Label,\n} from './intent';\nimport { Events, Capabilities } from '../common';\nimport { contributes, type PluginContext } from '../core';\n\nconst EXECUTION_LIMIT = 100;\nconst HISTORY_LIMIT = 100;\n\n/**\n * The return value of an intent effect.\n */\nexport type IntentEffectResult<Input, Output> = {\n  /**\n   * The output of the action that was performed.\n   *\n   * If the intent is apart of a chain of intents, the data will be passed to the next intent.\n   */\n  data?: Output;\n\n  /**\n   * If provided, the action will be undoable.\n   */\n  undoable?: {\n    /**\n     * Message to display to the user when indicating that the action can be undone.\n     */\n    message: Label;\n\n    /**\n     * Will be merged with the original intent data when firing the undo intent.\n     */\n    data?: Partial<Input>;\n  };\n\n  /**\n   * An error that occurred while performing the action.\n   *\n   * If the intent is apart of a chain of intents and an error occurs, the chain will be aborted.\n   *\n   * Return caught error instead of throwing to trigger other intent to be triggered prior to returning the error.\n   */\n  error?: Error;\n\n  /**\n   * Other intent chains to be triggered.\n   */\n  intents?: AnyIntentChain[];\n};\n\nexport type AnyIntentEffectResult = IntentEffectResult<any, any>;\n\n/**\n * The result of an intent dispatcher.\n */\nexport type IntentDispatcherResult<Input, Output> = Pick<IntentEffectResult<Input, Output>, 'data' | 'error'>;\n\n/**\n * The implementation of an intent effect.\n */\nexport type IntentEffectDefinition<Input, Output> = (\n  data: Input,\n  undo: boolean,\n) =>\n  | MaybePromise<IntentEffectResult<Input, Output> | void>\n  | Effect.Effect<IntentEffectResult<Input, Output> | void, Error>;\n\n/**\n * Intent resolver to match intents to their effects.\n */\nexport type IntentResolver<Tag extends string, Fields extends IntentParams, Data = IntentData<Fields>> = Readonly<{\n  /**\n   * The schema of the intent to be resolved.\n   */\n  intent: IntentSchema<Tag, Fields>;\n\n  /**\n   * Hint to determine the order the resolvers are processed if multiple resolvers are defined for the same intent.\n   * Only one resolver will be used.\n   */\n  position?: Position;\n\n  /**\n   * Optional filter to determine if the resolver should be used.\n   */\n  filter?: (data: IntentData<Fields>) => data is Data;\n\n  /**\n   * The effect to be performed when the intent is resolved.\n   */\n  resolve: IntentEffectDefinition<GuardedType<IntentResolver<Tag, Fields, Data>['filter']>, IntentResultData<Fields>>;\n}>;\n\nexport type AnyIntentResolver = IntentResolver<any, any, any>;\n\n/**\n * Creates an intent resolver to match intents to their effects.\n * @param schema Schema of the intent. Must be a tagged class with input and output schemas.\n * @param effect Effect to be performed when the intent is resolved.\n * @param params.disposition Determines the priority of the resolver when multiple are resolved.\n * @param params.filter Optional filter to determine if the resolver should be used.\n */\nexport const createResolver = <Tag extends string, Fields extends IntentParams, Data = IntentData<Fields>>(\n  resolver: IntentResolver<Tag, Fields, Data>,\n) => resolver;\n\n/**\n * Invokes intents and returns the result.\n */\nexport type PromiseIntentDispatcher = <Fields extends IntentParams>(\n  intent: IntentChain<any, any, any, Fields>,\n) => Promise<Simplify<IntentDispatcherResult<IntentData<Fields>, IntentResultData<Fields>>>>;\n\n/**\n * Creates an effect for intents.\n */\nexport type IntentDispatcher = <Fields extends IntentParams>(\n  intent: IntentChain<any, any, any, Fields>,\n  depth?: number,\n) => Effect.Effect<\n  Simplify<Required<IntentDispatcherResult<IntentData<Fields>, IntentResultData<Fields>>>['data']>,\n  Error\n>;\n\ntype IntentResult<Tag extends string, Fields extends IntentParams> = IntentEffectResult<\n  IntentData<Fields>,\n  IntentResultData<Fields>\n> & {\n  _intent: Intent<Tag, Fields>;\n};\n\nexport type AnyIntentResult = IntentResult<any, any>;\n\n/**\n * Invokes the most recent undoable intent with undo flags.\n */\nexport type PromiseIntentUndo = () => Promise<IntentDispatcherResult<any, any>>;\n\n/**\n * Creates an effect which undoes the last intent.\n */\nexport type IntentUndo = () => Effect.Effect<any, Error>;\n\n/**\n * Check if a chain of results is undoable.\n */\nconst isUndoable = (historyEntry: AnyIntentResult[]): boolean =>\n  historyEntry.length > 0 && historyEntry.every(({ undoable }) => !!undoable);\n\nexport type IntentContext = {\n  dispatch: IntentDispatcher;\n  dispatchPromise: PromiseIntentDispatcher;\n  undo: IntentUndo;\n  undoPromise: PromiseIntentUndo;\n};\n\n/**\n * Sets of an intent dispatcher.\n *\n * @param getResolvers A function that returns an array of available intent resolvers.\n * @param params.historyLimit The maximum number of intent results to keep in history.\n * @param params.executionLimit The maximum recursion depth of intent chains.\n */\nexport const createDispatcher = (\n  getResolvers: () => AnyIntentResolver[],\n  { executionLimit = EXECUTION_LIMIT, historyLimit = HISTORY_LIMIT } = {},\n): IntentContext => {\n  const historyRef = Effect.runSync(Ref.make<AnyIntentResult[][]>([]));\n\n  const handleIntent = (intent: AnyIntent) =>\n    Effect.gen(function* () {\n      const candidates = getResolvers()\n        .filter((resolver) => resolver.intent._tag === intent.id)\n        .filter((resolver) => !resolver.filter || resolver.filter(intent.data))\n        .toSorted(byPosition);\n      if (candidates.length === 0) {\n        yield* Effect.fail(new NoResolversError(intent.id));\n      }\n\n      const effect = candidates[0].resolve(intent.data, intent.undo ?? false);\n      const result = Effect.isEffect(effect) ? yield* effect : yield* Effect.promise(async () => effect);\n      return { _intent: intent, ...result } as AnyIntentResult;\n    });\n\n  const dispatch: IntentDispatcher = (intentChain, depth = 0) => {\n    return Effect.gen(function* () {\n      if (depth > executionLimit) {\n        yield* Effect.fail(new CycleDetectedError());\n      }\n\n      const resultsRef = yield* Ref.make<AnyIntentResult[]>([]);\n      for (const intent of intentChain.all) {\n        const { data: prev } = (yield* resultsRef.get)[0] ?? {};\n        const result = yield* handleIntent({ ...intent, data: { ...intent.data, ...prev } });\n        yield* Ref.update(resultsRef, (results) => [result, ...results]);\n        if (result.intents) {\n          for (const intent of result.intents) {\n            // Returned intents are dispatched but not yielded into results, as such they cannot be undone.\n            // TODO(wittjosiah): Use higher execution concurrency?\n            yield* dispatch(intent, depth + 1);\n          }\n        }\n\n        if (result.error) {\n          // yield* dispatch(\n          //   createIntent(IntentAction.Track, {\n          //     intents: intentChain.all.map((i) => i.id),\n          //     error: result.error.message,\n          //   }),\n          // );\n          yield* Effect.fail(result.error);\n        }\n      }\n\n      // Track the intent chain.\n      // if (intentChain.all.some((intent) => intent.id !== IntentAction.Track._tag)) {\n      //   yield* dispatch(createIntent(IntentAction.Track, { intents: intentChain.all.map((i) => i.id) }));\n      // }\n\n      const results = yield* resultsRef.get;\n      const result = results[0];\n      yield* Ref.update(historyRef, (history) => {\n        const next = [...history, results];\n        if (next.length > historyLimit) {\n          next.splice(0, next.length - historyLimit);\n        }\n        return next;\n      });\n\n      if (result.undoable && isUndoable(results)) {\n        // TODO(wittjosiah): Is there a better way to handle showing undo for chains?\n        yield* pipe(\n          dispatch(createIntent(IntentAction.ShowUndo, { message: result.undoable.message })),\n          Effect.catchSome((err) =>\n            err instanceof NoResolversError ? Option.some(Effect.succeed(undefined)) : Option.none(),\n          ),\n        );\n      }\n\n      return result.data;\n    });\n  };\n\n  const dispatchPromise: PromiseIntentDispatcher = (intentChain) => {\n    return Effect.runPromise(dispatch(intentChain))\n      .then((data) => ({ data }))\n      .catch((error) => {\n        log.catch(error);\n        return { error };\n      });\n  };\n\n  const undo: IntentUndo = () => {\n    return Effect.gen(function* () {\n      const history = yield* historyRef.get;\n      const last = history.findLastIndex(isUndoable);\n      const result = last !== -1 ? history[last] : undefined;\n      if (result) {\n        const all = result.map(({ _intent, undoable }): AnyIntent => {\n          const data = _intent.data;\n          const undoData = undoable?.data ?? {};\n          return { ..._intent, data: { ...data, ...undoData }, undo: true } satisfies AnyIntent;\n        });\n        const intent = { first: all[0], last: all.at(-1)!, all } satisfies AnyIntentChain;\n        yield* Ref.update(historyRef, (h) => h.filter((_, index) => index !== last));\n        return yield* dispatch(intent);\n      }\n    });\n  };\n\n  const undoPromise: PromiseIntentUndo = () => {\n    return Effect.runPromise(undo())\n      .then((data) => ({ data }))\n      .catch((error) => ({ error }));\n  };\n\n  return { dispatch, dispatchPromise, undo, undoPromise };\n};\n\nconst defaultEffect = () => Effect.fail(new Error('Intent runtime not ready'));\nconst defaultPromise = () => Effect.runPromise(defaultEffect());\n\nexport default (context: PluginContext) => {\n  const state = live<IntentContext>({\n    dispatch: defaultEffect,\n    dispatchPromise: defaultPromise,\n    undo: defaultEffect,\n    undoPromise: defaultPromise,\n  });\n\n  // TODO(wittjosiah): Make getResolver callback async and allow resolvers to be requested on demand.\n  const { dispatch, dispatchPromise, undo, undoPromise } = createDispatcher(() =>\n    context.getCapabilities(Capabilities.IntentResolver).flat(),\n  );\n\n  const manager = context.getCapability(Capabilities.PluginManager);\n  state.dispatch = (intentChain, depth) => {\n    return Effect.gen(function* () {\n      yield* manager._activate(Events.SetupIntentResolver);\n      return yield* dispatch(intentChain, depth);\n    });\n  };\n  state.dispatchPromise = async (intentChain) => {\n    await manager.activate(Events.SetupIntentResolver);\n    return await dispatchPromise(intentChain);\n  };\n  state.undo = undo;\n  state.undoPromise = undoPromise;\n\n  return contributes(Capabilities.IntentDispatcher, state);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Label } from './intent';\n\nexport const INTENT_PLUGIN = 'dxos.org/plugin/intent';\nexport const INTENT_ACTION = `${INTENT_PLUGIN}/action`;\n\nexport namespace IntentAction {\n  /**\n   * Log an intent.\n   */\n  export class Track extends Schema.TaggedClass<Track>()(`${INTENT_ACTION}/track`, {\n    input: Schema.Struct({\n      intents: Schema.Array(Schema.String),\n      error: Schema.optional(Schema.String),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  /**\n   * Fired after an intent is dispatched if the intent is undoable.\n   */\n  export class ShowUndo extends Schema.TaggedClass<ShowUndo>()(`${INTENT_ACTION}/show-undo`, {\n    input: Schema.Struct({\n      message: Label,\n    }),\n    output: Schema.Void,\n  }) {}\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nexport type IntentParams = {\n  readonly input: Schema.Schema.All;\n  readonly output: Schema.Schema.All;\n};\n\nexport type IntentData<Fields extends IntentParams> =\n  Schema.Schema.Type<Schema.Struct<Fields>> extends { readonly input: any }\n    ? Schema.Schema.Type<Schema.Struct<Fields>>['input']\n    : any;\n\nexport type IntentResultData<Fields extends IntentParams> =\n  Schema.Schema.Type<Schema.Struct<Fields>> extends { readonly output: any }\n    ? Schema.Schema.Type<Schema.Struct<Fields>>['output']\n    : any;\n\nexport type IntentSchema<Tag extends string, Fields extends IntentParams> = Schema.TaggedClass<any, Tag, Fields>;\n\n/**\n * An intent is an abstract description of an operation to be performed.\n * Intents allow actions to be performed across plugins.\n */\nexport type Intent<Tag extends string, Fields extends IntentParams> = {\n  _schema: IntentSchema<Tag, Fields>;\n\n  /**\n   * The id of the intent.\n   */\n  id: Tag;\n\n  /**\n   * Any data needed to perform the desired action.\n   */\n  data: IntentData<Fields>;\n\n  /**\n   * Whether or not the intent is being undone.\n   */\n  undo?: boolean;\n};\n\nexport type AnyIntent = Intent<any, any>;\n\n/**\n * Chain of intents to be executed together.\n * The result of each intent is merged into the next intent's input data.\n */\nexport type IntentChain<\n  FirstTag extends string,\n  LastTag extends string,\n  FirstFields extends IntentParams,\n  LastFields extends IntentParams,\n> = {\n  first: Intent<FirstTag, FirstFields>;\n  last: Intent<LastTag, LastFields>;\n  all: AnyIntent[];\n};\n\nexport type AnyIntentChain = IntentChain<any, any, any, any>;\n\n/**\n * Creates a typed intent.\n * @param schema Schema of the intent. Must be a tagged class with input and output schemas.\n * @param data Data fulfilling the input schema of the intent.\n * @param params.plugin Optional plugin ID to send the intent to.\n * @param params.undo Optional flag to indicate that the intent is being undone. Generally not set manually.\n */\nexport const createIntent = <Tag extends string, Fields extends IntentParams>(\n  schema: IntentSchema<Tag, Fields>,\n  data: IntentData<Fields> = {},\n  params: Pick<AnyIntent, 'undo'> = {},\n): IntentChain<Tag, Tag, Fields, Fields> => {\n  // The output of validateSync breaks proxy objects so this is just used for validation.\n  // TODO(wittjosiah): Is there a better way to make theses types align?\n  const _ = Schema.validateSync(schema.fields.input as Schema.Schema<any, any, unknown>)(data);\n  const intent = {\n    ...params,\n    _schema: schema,\n    id: schema._tag,\n    data,\n  } satisfies Intent<Tag, Fields>;\n\n  return {\n    first: intent,\n    last: intent,\n    all: [intent],\n  };\n};\n\n// TODO(wittjosiah): Add a function for mapping the output of one intent to the input of another.\n\n/**\n * Chain two intents together.\n *\n * NOTE: Chaining of intents depends on the data inputs and outputs being structs.\n */\nexport const chain =\n  <\n    FirstTag extends string,\n    NextTag extends string,\n    FirstFields extends IntentParams,\n    LastFields extends IntentParams,\n    NextFields extends IntentParams,\n  >(\n    schema: IntentSchema<NextTag, NextFields>,\n    data: Omit<IntentData<NextFields>, keyof IntentResultData<LastFields>> = {},\n    params: Pick<AnyIntent, 'undo'> = {},\n  ) =>\n  (\n    intent: IntentChain<FirstTag, any, FirstFields, LastFields>,\n  ): IntentChain<FirstTag, NextTag, FirstFields, NextFields> => {\n    const intents = 'all' in intent ? intent.all : [intent];\n    const first = intents[0];\n    const last = {\n      ...params,\n      _schema: schema,\n      id: schema._tag,\n      data,\n    } satisfies Intent<NextTag, NextFields>;\n\n    return {\n      first,\n      last,\n      all: [...intents, last],\n    };\n  };\n\n//\n// Intents\n//\n\n// NOTE: Should maintain compatibility with `i18next` (and @dxos/react-ui).\n// TODO(wittjosiah): Making this immutable breaks type compatibility.\nexport const Label = Schema.Union(\n  Schema.String,\n  Schema.mutable(\n    Schema.Tuple(\n      Schema.String,\n      Schema.mutable(\n        Schema.Struct({\n          ns: Schema.String,\n          count: Schema.optional(Schema.Number),\n          defaultValue: Schema.optional(Schema.String),\n        }),\n      ),\n    ),\n  ),\n);\nexport type Label = Schema.Schema.Type<typeof Label>;\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// TODO(wittjosiah): Reconcile with @dxos/protocols. Factor out errors.\n\n/**\n * NOTE: Messages should be sentences (Start with a capital letter and end with a period).\n * Errors can optionally include a JSON context object.\n */\nexport class BaseError extends Error {\n  constructor(\n    readonly code: string,\n    message?: string,\n    readonly context?: Record<string, any>,\n  ) {\n    // TODO(dmaretskyi): Error.cause.\n    super(message ?? code, { cause: context });\n    this.name = code;\n    // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n    Object.setPrototypeOf(this, new.target.prototype);\n  }\n}\n\nexport class NoResolversError extends BaseError {\n  constructor(action: string) {\n    super('NO_RESOLVERS', 'No resolvers were found for the action', { action });\n  }\n}\n\nexport class CycleDetectedError extends BaseError {\n  constructor(context?: Record<string, any>) {\n    super(\n      'CYCLE_DETECTED',\n      'Intent execution limit exceeded. This is likely due to an infinite loop within intent resolvers.',\n      context,\n    );\n  }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Registry, Rx } from '@effect-rx/rx-react';\nimport { Effect } from 'effect';\n\nimport { Trigger } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { type ActivationEvent } from './events';\n\nconst InterfaceDefTypeId: unique symbol = Symbol.for('InterfaceDefTypeId');\n\n/**\n * The interface definition of a capability.\n */\nexport type InterfaceDef<T> = {\n  [InterfaceDefTypeId]: T;\n  identifier: string;\n};\n\n/**\n * Helper to define the interface of a capability.\n */\nexport const defineCapability = <T>(identifier: string) => {\n  return { identifier } as InterfaceDef<T>;\n};\n\n/**\n * A unique string identifier with a Typescript type associated with it.\n * When a capability is contributed to the application an implementation of the interface is provided.\n */\nexport type Capability<T> = {\n  /**\n   * The interface definition of the capability.\n   */\n  interface: InterfaceDef<T>;\n\n  /**\n   * The implementation of the capability.\n   */\n  implementation: T;\n\n  /**\n   * Called when the capability is deactivated.\n   */\n  deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;\n};\n\nexport type AnyCapability = Capability<any>;\n\ntype PluginsContextOptions = {\n  registry: Registry.Registry;\n  activate: (event: ActivationEvent) => Effect.Effect<boolean, Error>;\n  reset: (event: ActivationEvent) => Effect.Effect<boolean, Error>;\n};\n\n// NOTE: This is implemented as a class to prevent it from being proxied by PluginManager state.\nclass CapabilityImpl<T> {\n  constructor(\n    readonly moduleId: string,\n    readonly implementation: T,\n  ) {}\n}\n\n/**\n * Helper to define the implementation of a capability.\n */\nexport const contributes = <T>(\n  interfaceDef: Capability<T>['interface'],\n  implementation: Capability<T>['implementation'],\n  deactivate?: Capability<T>['deactivate'],\n): Capability<T> => {\n  return { interface: interfaceDef, implementation, deactivate } satisfies Capability<T>;\n};\n\ntype LoadCapability<T, U> = () => Promise<{ default: (props: T) => MaybePromise<Capability<U>> }>;\ntype LoadCapabilities<T> = () => Promise<{ default: (props: T) => MaybePromise<AnyCapability[]> }>;\n// TODO(wittjosiah): Not having the array be `any` causes type errors when using the lazy capability.\ntype LazyCapability<T, U> = (props?: T) => Promise<() => Promise<Capability<U> | AnyCapability[]>>;\n\n/**\n * Helper to define a lazily loaded implementation of a capability.\n */\nexport const lazy =\n  <T, U>(c: LoadCapability<T, U> | LoadCapabilities<T>): LazyCapability<T, U> =>\n  async (props?: T) => {\n    const { default: getCapability } = await c();\n    return async () => getCapability(props as T);\n  };\n\n/**\n * Facilitates the dependency injection between [plugin modules](#pluginmodule) by allowing them contribute and request capabilities from each other.\n * It tracks the capabilities that are contributed in an in-memory live object.\n * This allows the application to subscribe to this state and incorporate plugins which are added dynamically.\n */\nexport class PluginContext {\n  private readonly _registry: Registry.Registry;\n\n  private readonly _capabilityImpls = Rx.family<string, Rx.Writable<CapabilityImpl<unknown>[]>>(() => {\n    return Rx.make<CapabilityImpl<unknown>[]>([]).pipe(Rx.keepAlive);\n  });\n\n  readonly _capabilities = Rx.family<string, Rx.Rx<unknown[]>>((id: string) => {\n    return Rx.make((get) => {\n      const current = get(this._capabilityImpls(id));\n      return current.map((c) => c.implementation);\n    });\n  });\n\n  readonly _capability = Rx.family<string, Rx.Rx<unknown>>((id: string) => {\n    return Rx.make((get) => {\n      const current = get(this._capabilities(id));\n      invariant(current.length > 0, `No capability found for ${id}`);\n      return current[0];\n    });\n  });\n\n  /**\n   * Activates plugins based on the activation event.\n   * @param event The activation event.\n   * @returns Whether the activation was successful.\n   */\n  readonly activate: PluginsContextOptions['activate'];\n\n  /**\n   * Re-activates the modules that were activated by the event.\n   * @param event The activation event.\n   * @returns Whether the reset was successful.\n   */\n  readonly reset: PluginsContextOptions['reset'];\n\n  constructor({ registry, activate, reset }: PluginsContextOptions) {\n    this._registry = registry;\n    this.activate = activate;\n    this.reset = reset;\n  }\n\n  /**\n   * @internal\n   */\n  contributeCapability<T>({\n    module: moduleId,\n    interface: interfaceDef,\n    implementation,\n  }: {\n    module: string;\n    interface: InterfaceDef<T>;\n    implementation: T;\n  }): void {\n    const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));\n    const capability = new CapabilityImpl(moduleId, implementation);\n    if (current.includes(capability)) {\n      return;\n    }\n\n    this._registry.set(this._capabilityImpls(interfaceDef.identifier), [...current, capability]);\n    log('capability contributed', {\n      id: interfaceDef.identifier,\n      moduleId,\n      count: current.length,\n    });\n  }\n\n  /**\n   * @internal\n   */\n  removeCapability<T>(interfaceDef: InterfaceDef<T>, implementation: T): void {\n    const current = this._registry.get(this._capabilityImpls(interfaceDef.identifier));\n    if (current.length === 0) {\n      return;\n    }\n\n    const next = current.filter((c) => c.implementation !== implementation);\n    if (next.length !== current.length) {\n      this._registry.set(this._capabilityImpls(interfaceDef.identifier), next);\n      log('capability removed', { id: interfaceDef.identifier, count: current.length });\n    } else {\n      log.warn('capability not removed', { id: interfaceDef.identifier });\n    }\n  }\n\n  /**\n   * Get the Rx reference to the available capabilities for a given interface.\n   * Primarily useful for deriving other Rx values based on the capabilities or\n   * for subscribing to changes in the capabilities.\n   * @returns An Rx reference to the available capabilities.\n   */\n  capabilities<T>(interfaceDef: InterfaceDef<T>): Rx.Rx<T[]> {\n    // NOTE: This the type-checking for capabilities is done at the time of contribution.\n    return this._capabilities(interfaceDef.identifier) as Rx.Rx<T[]>;\n  }\n\n  /**\n   * Get the Rx reference to the available capabilities for a given interface.\n   * Primarily useful for deriving other Rx values based on the capability or\n   * for subscribing to changes in the capability.\n   * @returns An Rx reference to the available capability.\n   * @throws If no capability is found.\n   */\n  capability<T>(interfaceDef: InterfaceDef<T>): Rx.Rx<T> {\n    // NOTE: This the type-checking for capabilities is done at the time of contribution.\n    return this._capability(interfaceDef.identifier) as Rx.Rx<T>;\n  }\n\n  /**\n   * Get capabilities from the plugin context.\n   * @returns An array of capabilities.\n   */\n  getCapabilities<T>(interfaceDef: InterfaceDef<T>): T[] {\n    return this._registry.get(this.capabilities(interfaceDef));\n  }\n\n  /**\n   * Requests a single capability from the plugin context.\n   * @returns The capability.\n   * @throws If no capability is found.\n   */\n  getCapability<T>(interfaceDef: InterfaceDef<T>): T {\n    return this._registry.get(this.capability(interfaceDef));\n  }\n\n  /**\n   * Waits for a capability to be available.\n   * @returns The capability.\n   */\n  async waitForCapability<T>(interfaceDef: InterfaceDef<T>): Promise<T> {\n    const [capability] = this.getCapabilities(interfaceDef);\n    if (capability) {\n      return capability;\n    }\n\n    const trigger = new Trigger<T>();\n    const cancel = this._registry.subscribe(this.capabilities(interfaceDef), (capabilities) => {\n      if (capabilities.length > 0) {\n        trigger.wake(capabilities[0]);\n      }\n    });\n    const result = await trigger.wait();\n    cancel();\n    return result;\n  }\n\n  async activatePromise(event: ActivationEvent): Promise<boolean> {\n    return this.activate(event).pipe(Effect.runPromise);\n  }\n\n  async resetPromise(event: ActivationEvent): Promise<boolean> {\n    return this.reset(event).pipe(Effect.runPromise);\n  }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * A unique string identifier representing an event.\n * This is expected to be a URI, where initial parts are often the id of the plugin whose package defines the event.\n *\n * @example dxos.org/plugin/example/event/ready\n */\nexport type ActivationEvent = {\n  id: string;\n  specifier?: string;\n};\n\n/**\n * An activation event that can be a single event, or a combination of events.\n */\nexport type ActivationEvents =\n  | ActivationEvent\n  | { type: 'one-of'; events: ActivationEvent[] }\n  | { type: 'all-of'; events: ActivationEvent[] };\n\n/**\n * Helper to define an activation event.\n */\nexport const defineEvent = (id: string, specifier?: string) => {\n  return { id, specifier } as ActivationEvent;\n};\n\n/**\n * Helper to create an activation event key.\n */\nexport const eventKey = (event: ActivationEvent) => (event.specifier ? `${event.id}:${event.specifier}` : event.id);\n\n/**\n * Helper to create an activation event that triggers when any of the given events are activated.\n */\nexport const oneOf = (...events: ActivationEvent[]) => ({ type: 'one-of' as const, events });\n\n/**\n * Helper to create an activation event that triggers when all of the given events are activated.\n */\nexport const allOf = (...events: ActivationEvent[]) => ({ type: 'all-of' as const, events });\n\n/**\n * Helper to check if an activation event is a one-of event.\n */\nexport const isOneOf = (events: ActivationEvents): events is { type: 'one-of'; events: ActivationEvent[] } =>\n  'type' in events && events.type === 'one-of';\n\n/**\n * Helper to check if an activation event is an all-of event.\n */\nexport const isAllOf = (events: ActivationEvents): events is { type: 'all-of'; events: ActivationEvent[] } =>\n  'type' in events && events.type === 'all-of';\n\n/**\n * Helper to get the events from an activation event.\n */\nexport const getEvents = (events: ActivationEvents) => ('type' in events ? events.events : [events]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Registry } from '@effect-rx/rx-react';\nimport { untracked } from '@preact/signals-core';\nimport { Array as A, Effect, Either, Match, pipe } from 'effect';\n\nimport { Event } from '@dxos/async';\nimport { live, type Live } from '@dxos/live-object';\nimport { log } from '@dxos/log';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { type AnyCapability, PluginContext } from './capabilities';\nimport { type ActivationEvent, eventKey, getEvents, isAllOf } from './events';\nimport { type PluginModule, type Plugin } from './plugin';\n\n// TODO(wittjosiah): Factor out?\nconst isPromise = (value: unknown): value is Promise<unknown> => {\n  return value !== null && typeof value === 'object' && 'then' in value;\n};\n\nexport type PluginManagerOptions = {\n  pluginLoader: (id: string) => MaybePromise<Plugin>;\n  plugins?: Plugin[];\n  core?: string[];\n  enabled?: string[];\n  registry?: Registry.Registry;\n};\n\ntype PluginManagerState = {\n  // Plugins\n  plugins: Plugin[];\n  core: string[];\n  enabled: string[];\n\n  // Modules\n  modules: PluginModule[];\n  active: string[];\n\n  // Events\n  eventsFired: string[];\n  pendingReset: string[];\n};\n\nexport class PluginManager {\n  readonly activation = new Event<{ event: string; state: 'activating' | 'activated' | 'error'; error?: any }>();\n  readonly context: PluginContext;\n  readonly registry: Registry.Registry;\n\n  // TODO(wittjosiah): Replace with Rx.\n  private readonly _state: Live<PluginManagerState>;\n  private readonly _pluginLoader: PluginManagerOptions['pluginLoader'];\n  private readonly _capabilities = new Map<string, AnyCapability[]>();\n\n  constructor({\n    pluginLoader,\n    plugins = [],\n    core = plugins.map(({ meta }) => meta.id),\n    enabled = [],\n    registry,\n  }: PluginManagerOptions) {\n    this.registry = registry ?? Registry.make();\n    this.context = new PluginContext({\n      registry: this.registry,\n      activate: (event) => this._activate(event),\n      reset: (id) => this._reset(id),\n    });\n\n    this._pluginLoader = pluginLoader;\n    this._state = live({\n      plugins,\n      core,\n      enabled,\n      modules: [],\n      active: [],\n      pendingReset: [],\n      eventsFired: [],\n    });\n    plugins.forEach((plugin) => this._addPlugin(plugin));\n    core.forEach((id) => this.enable(id));\n    enabled.forEach((id) => this.enable(id));\n  }\n\n  /**\n   * Plugins that are currently registered.\n   *\n   * @reactive\n   */\n  get plugins(): Live<readonly Plugin[]> {\n    return this._state.plugins;\n  }\n\n  /**\n   * Ids of plugins that are core and cannot be removed.\n   *\n   * @reactive\n   */\n  get core(): Live<readonly string[]> {\n    return this._state.core;\n  }\n\n  /**\n   * Ids of plugins that are currently enabled.\n   *\n   * @reactive\n   */\n  get enabled(): Live<readonly string[]> {\n    return this._state.enabled;\n  }\n\n  /**\n   * Modules of plugins which are currently enabled.\n   *\n   * @reactive\n   */\n  get modules(): Live<readonly PluginModule[]> {\n    return this._state.modules;\n  }\n\n  /**\n   * Ids of modules which are currently active.\n   *\n   * @reactive\n   */\n  get active(): Live<readonly string[]> {\n    return this._state.active;\n  }\n\n  /**\n   * Ids of events which have been fired.\n   *\n   * @reactive\n   */\n  get eventsFired(): Live<readonly string[]> {\n    return this._state.eventsFired;\n  }\n\n  /**\n   * Ids of modules which are pending reset.\n   *\n   * @reactive\n   */\n  get pendingReset(): Live<readonly string[]> {\n    return this._state.pendingReset;\n  }\n\n  /**\n   * Adds a plugin to the manager via the plugin loader.\n   * @param id The id of the plugin.\n   */\n  async add(id: string): Promise<boolean> {\n    return untracked(async () => {\n      log('add plugin', { id });\n      const plugin = await this._pluginLoader(id);\n      this._addPlugin(plugin);\n      return this.enable(id);\n    });\n  }\n\n  /**\n   * Enables a plugin.\n   * @param id The id of the plugin.\n   */\n  enable(id: string): Promise<boolean> {\n    return untracked(async () => {\n      log('enable plugin', { id });\n      const plugin = this._getPlugin(id);\n      if (!plugin) {\n        return false;\n      }\n\n      if (!this._state.enabled.includes(id)) {\n        this._state.enabled.push(id);\n      }\n\n      plugin.modules.forEach((module) => {\n        this._addModule(module);\n        this._setPendingResetByModule(module);\n      });\n\n      log('pending reset', { events: [...this.pendingReset] });\n      await Effect.runPromise(\n        Effect.all(\n          this.pendingReset.map((event) => this._activate(event)),\n          { concurrency: 'unbounded' },\n        ),\n      );\n\n      return true;\n    });\n  }\n\n  /**\n   * Removes a plugin from the manager.\n   * @param id The id of the plugin.\n   */\n  remove(id: string): boolean {\n    return untracked(() => {\n      log('remove plugin', { id });\n      const result = this.disable(id);\n      if (!result) {\n        return false;\n      }\n\n      this._removePlugin(id);\n      return true;\n    });\n  }\n\n  /**\n   * Disables a plugin.\n   * @param id The id of the plugin.\n   */\n  disable(id: string): Promise<boolean> {\n    return untracked(async () => {\n      log('disable plugin', { id });\n      if (this._state.core.includes(id)) {\n        return false;\n      }\n\n      const plugin = this._getPlugin(id);\n      if (!plugin) {\n        return false;\n      }\n\n      const enabledIndex = this._state.enabled.findIndex((enabled) => enabled === id);\n      if (enabledIndex !== -1) {\n        this._state.enabled.splice(enabledIndex, 1);\n        await Effect.runPromise(this._deactivate(id));\n\n        plugin.modules.forEach((module) => {\n          this._removeModule(module.id);\n        });\n      }\n\n      return true;\n    });\n  }\n\n  /**\n   * Activates plugins based on the activation event.\n   * @param event The activation event.\n   * @returns Whether the activation was successful.\n   */\n  activate(event: ActivationEvent | string): Promise<boolean> {\n    return untracked(() => Effect.runPromise(this._activate(event)));\n  }\n\n  /**\n   * Deactivates all of the modules for a plugin.\n   * @param id The id of the plugin.\n   * @returns Whether the deactivation was successful.\n   */\n  deactivate(id: string): Promise<boolean> {\n    return untracked(() => Effect.runPromise(this._deactivate(id)));\n  }\n\n  /**\n   * Re-activates the modules that were activated by the event.\n   * @param event The activation event.\n   * @returns Whether the reset was successful.\n   */\n  reset(event: ActivationEvent | string): Promise<boolean> {\n    return untracked(() => Effect.runPromise(this._reset(event)));\n  }\n\n  private _addPlugin(plugin: Plugin): void {\n    untracked(() => {\n      log('add plugin', { id: plugin.meta.id });\n      if (!this._state.plugins.includes(plugin)) {\n        this._state.plugins.push(plugin);\n      }\n    });\n  }\n\n  private _removePlugin(id: string): void {\n    untracked(() => {\n      log('remove plugin', { id });\n      const pluginIndex = this._state.plugins.findIndex((plugin) => plugin.meta.id === id);\n      if (pluginIndex !== -1) {\n        this._state.plugins.splice(pluginIndex, 1);\n      }\n    });\n  }\n\n  private _addModule(module: PluginModule): void {\n    untracked(() => {\n      log('add module', { id: module.id });\n      if (!this._state.modules.includes(module)) {\n        this._state.modules.push(module);\n      }\n    });\n  }\n\n  private _removeModule(id: string): void {\n    untracked(() => {\n      log('remove module', { id });\n      const moduleIndex = this._state.modules.findIndex((module) => module.id === id);\n      if (moduleIndex !== -1) {\n        this._state.modules.splice(moduleIndex, 1);\n      }\n    });\n  }\n\n  private _getPlugin(id: string): Plugin | undefined {\n    return this._state.plugins.find((plugin) => plugin.meta.id === id);\n  }\n\n  private _getActiveModules(): PluginModule[] {\n    return this._state.modules.filter((module) => this._state.active.includes(module.id));\n  }\n\n  private _getInactiveModules(): PluginModule[] {\n    return this._state.modules.filter((module) => !this._state.active.includes(module.id));\n  }\n\n  private _getActiveModulesByEvent(key: string): PluginModule[] {\n    return this._getActiveModules().filter((module) => getEvents(module.activatesOn).map(eventKey).includes(key));\n  }\n\n  private _getInactiveModulesByEvent(key: string): PluginModule[] {\n    return this._getInactiveModules().filter((module) => getEvents(module.activatesOn).map(eventKey).includes(key));\n  }\n\n  private _setPendingResetByModule(module: PluginModule): void {\n    return untracked(() => {\n      const activationEvents = getEvents(module.activatesOn)\n        .map(eventKey)\n        .filter((key) => this._state.eventsFired.includes(key));\n\n      const pendingReset = Array.from(new Set(activationEvents)).filter(\n        (event) => !this._state.pendingReset.includes(event),\n      );\n      if (pendingReset.length > 0) {\n        log('pending reset', { events: pendingReset });\n        this._state.pendingReset.push(...pendingReset);\n      }\n    });\n  }\n\n  /**\n   * @internal\n   */\n  // TODO(wittjosiah): Improve error typing.\n  _activate(event: ActivationEvent | string): Effect.Effect<boolean, Error> {\n    return Effect.gen(this, function* () {\n      const key = typeof event === 'string' ? event : eventKey(event);\n      log('activating', { key });\n      const pendingIndex = this._state.pendingReset.findIndex((event) => event === key);\n      if (pendingIndex !== -1) {\n        this._state.pendingReset.splice(pendingIndex, 1);\n      }\n\n      const modules = this._getInactiveModulesByEvent(key).filter((module) => {\n        const allOf = isAllOf(module.activatesOn);\n        if (!allOf) {\n          return true;\n        }\n\n        const events = module.activatesOn.events.filter((event) => eventKey(event) !== key);\n        return events.every((event) => this._state.eventsFired.includes(eventKey(event)));\n      });\n      if (modules.length === 0) {\n        log('no modules to activate', { key });\n        if (!this._state.eventsFired.includes(key)) {\n          this._state.eventsFired.push(key);\n        }\n        return false;\n      }\n\n      log('activating modules', { key, modules: modules.map((module) => module.id) });\n      this.activation.emit({ event: key, state: 'activating' });\n\n      // Concurrently triggers loading of lazy capabilities.\n      const getCapabilities = yield* Effect.all(\n        modules.map(({ activate }) =>\n          Effect.tryPromise({\n            try: async () => activate(this.context),\n            catch: (error) => error as Error,\n          }),\n        ),\n        { concurrency: 'unbounded' },\n      );\n\n      const result = yield* pipe(\n        modules,\n        A.zip(getCapabilities),\n        A.map(([module, getCapabilities]) => this._activateModule(module, getCapabilities)),\n        // TODO(wittjosiah): This currently can't be run in parallel.\n        //   Running this with concurrency causes races with `allOf` activation events.\n        Effect.all,\n        Effect.either,\n      );\n\n      if (Either.isLeft(result)) {\n        this.activation.emit({ event: key, state: 'error', error: result.left });\n        yield* Effect.fail(result.left);\n      }\n\n      if (!this._state.eventsFired.includes(key)) {\n        this._state.eventsFired.push(key);\n      }\n\n      this.activation.emit({ event: key, state: 'activated' });\n      log('activated', { key });\n\n      return true;\n    });\n  }\n\n  private _activateModule(\n    module: PluginModule,\n    getCapabilities: AnyCapability | AnyCapability[] | (() => Promise<AnyCapability | AnyCapability[]>),\n  ): Effect.Effect<void, Error> {\n    return Effect.gen(this, function* () {\n      yield* Effect.all(module.activatesBefore?.map((event) => this._activate(event)) ?? [], {\n        concurrency: 'unbounded',\n      });\n\n      log('activating module...', { module: module.id });\n      // TODO(wittjosiah): This is not handling errors thrown if this is synchronous.\n      const maybeCapabilities = typeof getCapabilities === 'function' ? getCapabilities() : getCapabilities;\n      const resolvedCapabilities = yield* Match.value(maybeCapabilities).pipe(\n        // TODO(wittjosiah): Activate with an effect?\n        // Match.when(Effect.isEffect, (effect) => effect),\n        Match.when(isPromise, (promise) =>\n          Effect.tryPromise({\n            try: () => promise,\n            catch: (error) => error as Error,\n          }),\n        ),\n        Match.orElse((program) => Effect.succeed(program)),\n      );\n      const capabilities = Match.value(resolvedCapabilities).pipe(\n        Match.when(Array.isArray, (array) => array),\n        Match.orElse((value) => [value]),\n      );\n      capabilities.forEach((capability) => {\n        this.context.contributeCapability({ module: module.id, ...capability });\n      });\n      this._state.active.push(module.id);\n      this._capabilities.set(module.id, capabilities);\n      log('activated module', { module: module.id });\n\n      yield* Effect.all(module.activatesAfter?.map((event) => this._activate(event)) ?? [], {\n        concurrency: 'unbounded',\n      });\n    });\n  }\n\n  private _deactivate(id: string): Effect.Effect<boolean, Error> {\n    return Effect.gen(this, function* () {\n      const plugin = this._getPlugin(id);\n      if (!plugin) {\n        return false;\n      }\n\n      const modules = plugin.modules;\n      const results = yield* Effect.all(\n        modules.map((module) => this._deactivateModule(module)),\n        { concurrency: 'unbounded' },\n      );\n      return results.every((result) => result);\n    });\n  }\n\n  private _deactivateModule(module: PluginModule): Effect.Effect<boolean, Error> {\n    return Effect.gen(this, function* () {\n      const id = module.id;\n      log('deactivating', { id });\n\n      const capabilities = this._capabilities.get(id);\n      if (capabilities) {\n        for (const capability of capabilities) {\n          this.context.removeCapability(capability.interface, capability.implementation);\n          const program = capability.deactivate?.();\n          yield* Match.value(program).pipe(\n            Match.when(Effect.isEffect, (effect) => effect),\n            Match.when(isPromise, (promise) =>\n              Effect.tryPromise({\n                try: () => promise,\n                catch: (error) => error as Error,\n              }),\n            ),\n            Match.orElse((program) => Effect.succeed(program)),\n          );\n        }\n        this._capabilities.delete(id);\n      }\n\n      const activeIndex = this._state.active.findIndex((event) => event === id);\n      if (activeIndex !== -1) {\n        this._state.active.splice(activeIndex, 1);\n      }\n\n      log('deactivated', { id });\n      return true;\n    });\n  }\n\n  private _reset(event: ActivationEvent | string): Effect.Effect<boolean, Error> {\n    return Effect.gen(this, function* () {\n      const key = typeof event === 'string' ? event : eventKey(event);\n      log('reset', { key });\n      const modules = this._getActiveModulesByEvent(key);\n      const results = yield* Effect.all(\n        modules.map((module) => this._deactivateModule(module)),\n        { concurrency: 'unbounded' },\n      );\n\n      if (results.every((result) => result)) {\n        return yield* this._activate(key);\n      } else {\n        return false;\n      }\n    });\n  }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type MaybePromise } from '@dxos/util';\n\nimport { type AnyCapability, type PluginContext } from './capabilities';\nimport { type ActivationEvent, type ActivationEvents } from './events';\n\ninterface PluginModuleInterface {\n  /**\n   * Unique id of the module.\n   */\n  id: string;\n\n  /**\n   * Events for which the module will be activated.\n   */\n  activatesOn: ActivationEvents;\n\n  /**\n   * Events which the plugin depends on being activated.\n   * Plugin is marked as needing reset a plugin activated by a dependent event is removed.\n   * Events are automatically activated before activation of the plugin.\n   */\n  activatesBefore?: ActivationEvent[];\n\n  /**\n   * Events which this plugin triggers upon activation.\n   */\n  activatesAfter?: ActivationEvent[];\n\n  /**\n   * Called when the module is activated.\n   * @param context The plugin context.\n   * @returns The capabilities of the module.\n   */\n  activate: (\n    context: PluginContext,\n  ) => MaybePromise<AnyCapability | AnyCapability[]> | Promise<() => Promise<AnyCapability | AnyCapability[]>>;\n}\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Activation of a module is async allowing for code to split and loaded lazily.\n */\n// NOTE: This is implemented as a class to prevent it from being proxied by PluginManager state.\nexport class PluginModule implements PluginModuleInterface {\n  readonly id: PluginModuleInterface['id'];\n  readonly activatesOn: PluginModuleInterface['activatesOn'];\n  readonly activatesBefore?: PluginModuleInterface['activatesBefore'];\n  readonly activatesAfter?: PluginModuleInterface['activatesAfter'];\n  readonly activate: PluginModuleInterface['activate'];\n\n  constructor(options: PluginModuleInterface) {\n    this.id = options.id;\n    this.activatesOn = options.activatesOn;\n    this.activatesBefore = options.activatesBefore;\n    this.activatesAfter = options.activatesAfter;\n    this.activate = options.activate;\n  }\n}\n\n/**\n * Helper to define a module.\n */\nexport const defineModule = (options: PluginModuleInterface) => new PluginModule(options);\n\nexport type PluginMeta = {\n  /**\n   * Globally unique ID.\n   *\n   * Expected to be in the form of a valid URL.\n   *\n   * @example dxos.org/plugin/example\n   */\n  id: string;\n\n  /**\n   * Human-readable name.\n   */\n  name: string;\n\n  /**\n   * Short description of plugin functionality.\n   */\n  description?: string;\n\n  /**\n   * URL of home page.\n   */\n  homePage?: string;\n\n  /**\n   * URL of source code.\n   */\n  source?: string;\n\n  /**\n   * URL of screenshot.\n   */\n  screenshots?: string[];\n\n  /**\n   * Tags to help categorize the plugin.\n   */\n  tags?: string[];\n\n  /**\n   * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.\n   */\n  icon?: string;\n};\n\n/**\n * A collection of modules that are be enabled/disabled as a unit.\n * Plugins provide things such as components, state, actions, etc. to the application.\n */\n// NOTE: This is implemented as a class to prevent it from being proxied by PluginManager state.\nexport class Plugin {\n  constructor(\n    readonly meta: PluginMeta,\n    readonly modules: PluginModule[],\n  ) {}\n}\n\n/**\n * Helper to define a plugin.\n */\nexport const definePlugin = (meta: PluginMeta, modules: PluginModule[]) => {\n  return new Plugin(meta, modules);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Registry } from '@effect-rx/rx-react';\nimport { type Schema } from 'effect';\nimport { type FC, type PropsWithChildren } from 'react';\n\nimport { type ExecutableTool } from '@dxos/ai';\nimport { type GraphBuilder, type BuilderExtensions } from '@dxos/app-graph';\nimport { type ArtifactDefinition } from '@dxos/artifact';\nimport { type Space } from '@dxos/client-protocol';\nimport { type RootSettingsStore } from '@dxos/local-storage';\nimport { type AnchoredTo } from '@dxos/schema';\n\nimport { type FileInfo } from './file';\nimport { type NodeSerializer } from './graph';\nimport { type SurfaceDefinition } from './surface';\nimport { type Resource } from './translations';\nimport { type PluginManager, defineCapability } from '../core';\nimport { type AnyIntentResolver, type IntentContext } from '../plugin-intent';\n\nexport namespace Capabilities {\n  export const PluginManager = defineCapability<PluginManager>('dxos.org/app-framework/capability/plugin-manager');\n\n  export const Null = defineCapability<null>('dxos.org/app-framework/capability/null');\n\n  export const RxRegistry = defineCapability<Registry.Registry>('dxos.org/app-framework/capability/rx-registry');\n\n  export type ReactContext = Readonly<{ id: string; dependsOn?: string[]; context: FC<PropsWithChildren> }>;\n  export const ReactContext = defineCapability<ReactContext>('dxos.org/app-framework/capability/react-context');\n\n  export type ReactRoot = Readonly<{ id: string; root: FC<PropsWithChildren> }>;\n  export const ReactRoot = defineCapability<ReactRoot>('dxos.org/app-framework/capability/react-root');\n\n  export type ReactSurface = SurfaceDefinition | readonly SurfaceDefinition[];\n  export const ReactSurface = defineCapability<ReactSurface>('dxos.org/app-framework/common/react-surface');\n\n  export type IntentResolver = AnyIntentResolver | readonly AnyIntentResolver[];\n  export const IntentResolver = defineCapability<IntentResolver>('dxos.org/app-framework/capability/intent-resolver');\n\n  export const IntentDispatcher = defineCapability<IntentContext>(\n    'dxos.org/app-framework/capability/intent-dispatcher',\n  );\n\n  export type Layout = Readonly<{\n    mode: string;\n    dialogOpen: boolean;\n    sidebarOpen: boolean;\n    complementarySidebarOpen: boolean;\n    /**\n     * The id of the active workspace, where a workspace is a set of active items.\n     */\n    workspace: string;\n    /**\n     * Identifiers of items which are currently active in the application.\n     */\n    active: string[];\n    /**\n     * Identifiers of items which were previously active in the application.\n     */\n    inactive: string[];\n    /**\n     * Identifier of the item which should be scrolled into view.\n     */\n    scrollIntoView: string | undefined;\n  }>;\n  export const Layout = defineCapability<Layout>('dxos.org/app-framework/capability/layout');\n\n  export const Translations = defineCapability<Readonly<Resource[]>>('dxos.org/app-framework/capability/translations');\n\n  export const AppGraph = defineCapability<Readonly<Pick<GraphBuilder, 'graph' | 'explore'>>>(\n    'dxos.org/app-framework/capability/app-graph',\n  );\n\n  export const AppGraphBuilder = defineCapability<BuilderExtensions>(\n    'dxos.org/app-framework/capability/app-graph-builder',\n  );\n\n  export const AppGraphSerializer = defineCapability<NodeSerializer[]>(\n    'dxos.org/app-framework/capability/app-graph-serializer',\n  );\n\n  export const SettingsStore = defineCapability<RootSettingsStore>('dxos.org/app-framework/capability/settings-store');\n\n  // TODO(wittjosiah): The generics caused type inference issues for schemas when contributing settings.\n  // export type Settings = Parameters<RootSettingsStore['createStore']>[0];\n  // export type Settings<T extends SettingsValue = SettingsValue> = SettingsProps<T>;\n  export type Settings = {\n    prefix: string;\n    schema: Schema.Schema.All;\n    value?: Record<string, any>;\n  };\n  export const Settings = defineCapability<Settings>('dxos.org/app-framework/capability/settings');\n\n  export type Metadata = Readonly<{ id: string; metadata: Record<string, any> }>;\n  export const Metadata = defineCapability<Metadata>('dxos.org/app-framework/capability/metadata');\n\n  export const Tools = defineCapability<ExecutableTool[]>('dxos.org/app-framework/capability/tools');\n  export const ArtifactDefinition = defineCapability<ArtifactDefinition>(\n    'dxos.org/app-framework/capability/artifact-definition',\n  );\n\n  export type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;\n  export const FileUploader = defineCapability<FileUploader>('dxos.org/app-framework/capability/file-uploader');\n\n  type AnchorSort = {\n    key: string;\n    sort: (anchorA: AnchoredTo, anchorB: AnchoredTo) => number;\n  };\n  export const AnchorSort = defineCapability<AnchorSort>('dxos.org/app-framework/capability/anchor-sort');\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Expando, Ref } from '@dxos/echo-schema';\n\nexport namespace CollaborationActions {\n  export class InsertContent extends Schema.TaggedClass<InsertContent>()('assistant/intent-content', {\n    input: Schema.Struct({\n      target: Expando,\n      object: Ref(Expando),\n      at: Schema.optional(Schema.String),\n      label: Schema.String.pipe(Schema.optional),\n    }).annotations({\n      description: 'Enables plugins to inject content blocks or references into a related entity.',\n    }),\n    output: Schema.Void,\n  }) {}\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities } from './capabilities';\nimport { defineEvent } from '../core';\n\nexport namespace Events {\n  /**\n   * Fired when the app is started.\n   */\n  export const Startup = defineEvent('dxos.org/app-framework/event/startup');\n\n  //\n  // Dependent Events\n  //\n\n  /**\n   * Fired to load any newly available surfaces.\n   */\n  export const SetupReactSurface = defineEvent('dxos.org/app-framework/event/setup-react-surface');\n\n  /**\n   * Fired to load any newly available metadata.\n   */\n  export const SetupMetadata = defineEvent('dxos.org/app-framework/event/setup-metadata');\n\n  /**\n   * Fired before the intent dispatcher is activated.\n   */\n  export const SetupIntentResolver = defineEvent('dxos.org/app-framework/event/setup-intent-resolver');\n\n  /**\n   * Fired before the settings store is activated.\n   */\n  export const SetupSettings = defineEvent('dxos.org/app-framework/event/setup-settings');\n\n  /**\n   * Fired before the graph is created.\n   */\n  export const SetupAppGraph = defineEvent('dxos.org/app-framework/event/setup-graph');\n\n  /**\n   * Fired before the translations provider is created.\n   */\n  export const SetupTranslations = defineEvent('dxos.org/app-framework/event/setup-translations');\n\n  /**\n   * Fired to load any newly available artifacts definitions.\n   */\n  export const SetupArtifactDefinition = defineEvent('dxos.org/app-framework/event/setup-artifact-definition');\n\n  //\n  // Triggered Events\n  //\n\n  /**\n   * Fired after the intent dispatcher is ready.\n   */\n  export const DispatcherReady = defineEvent('dxos.org/app-framework/event/dispatcher-ready');\n\n  /**\n   * Fired after the settings store is ready.\n   */\n  export const SettingsReady = defineEvent('dxos.org/app-framework/event/settings-ready');\n\n  /**\n   * Fired when the graph is ready.\n   */\n  export const AppGraphReady = defineEvent('dxos.org/app-framework/event/graph-ready');\n\n  /**\n   * Fired when plugin state is ready.\n   */\n  export const createStateEvent = (specifier: string) => defineEvent('dxos.org/app-framework/event/state', specifier);\n  export const LayoutReady = createStateEvent(Capabilities.Layout.identifier);\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\n// TODO(burdon): See Accept attribute (uses MIME types).\n// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],\nexport const defaultFileTypes = {\n  images: ['png', 'jpg', 'jpeg', 'gif'],\n  media: ['mp3', 'mp4', 'mov', 'avi'],\n  text: ['pdf', 'txt', 'md'],\n};\n\nexport const FileInfoSchema = Schema.Struct({\n  name: Schema.String,\n  type: Schema.String,\n  url: Schema.optional(Schema.String),\n  cid: Schema.optional(Schema.String), // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).\n});\n\nexport type FileInfo = Schema.Schema.Type<typeof FileInfoSchema>;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Label } from '../plugin-intent';\n\nexport const LAYOUT_PLUGIN = 'dxos.org/plugin/layout';\nexport const LAYOUT_ACTION = `${LAYOUT_PLUGIN}/action`;\n\n/**\n * Expected payload for layout actions.\n */\nexport namespace LayoutAction {\n  export const UPDATE_LAYOUT = `${LAYOUT_ACTION}/update-layout`;\n\n  /**\n   * Generic layout action.\n   */\n  export class UpdateLayout extends Schema.TaggedClass<UpdateLayout>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.String.annotations({ description: 'The part of the layout to mutate.' }),\n      subject: Schema.optional(Schema.Any.annotations({ description: 'The subject of the layout update.' })),\n      options: Schema.optional(\n        Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({\n          description: 'Additional options for the layout action.',\n        }),\n      ),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  //\n  // Common layout actions.\n  //\n\n  // NOTE: These are layout actions which are currently in common use.\n  //  They constrain the generic layout action types to provide additional type safety.\n  //  However, they all follow the same generic structure and intent id.\n  //  This allows for plugins to update the layout without depending on a specific layout plugin.\n  //  The expectation is that other norms other than these will emerge over time.\n\n  export class SetLayoutMode extends Schema.TaggedClass<SetLayoutMode>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('mode').annotations({ description: 'Setting the layout mode.' }),\n      subject: Schema.optional(\n        Schema.String.annotations({ description: 'Item which is the subject of the new layout mode.' }),\n      ),\n      options: Schema.Union(\n        Schema.Struct({ mode: Schema.String.annotations({ description: 'The new layout mode.' }) }),\n        Schema.Struct({ revert: Schema.Boolean.annotations({ description: 'Revert to the previous layout mode.' }) }),\n      ),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class UpdateSidebar extends Schema.TaggedClass<UpdateSidebar>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('sidebar').annotations({ description: 'Updating the sidebar.' }),\n      subject: Schema.optional(\n        Schema.String.annotations({ description: 'URI of the component to display in the sidebar.' }),\n      ),\n      options: Schema.optional(\n        Schema.Struct({\n          state: Schema.Literal('closed', 'collapsed', 'expanded').annotations({\n            description: 'Whether the sidebar is closed, collapsed, or expanded.',\n          }),\n        }),\n      ),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class UpdateComplementary extends Schema.TaggedClass<UpdateComplementary>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('complementary').annotations({ description: 'Updating the complementary sidebar.' }),\n      subject: Schema.optional(\n        Schema.String.annotations({ description: 'URI of the component to display in the complementary area.' }),\n      ),\n      options: Schema.optional(\n        Schema.Struct({\n          state: Schema.Literal('closed', 'collapsed', 'expanded').annotations({\n            description: 'Whether the complementary sidebar is closed, collapsed, or expanded.',\n          }),\n        }),\n      ),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class UpdateDialog extends Schema.TaggedClass<UpdateDialog>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('dialog').annotations({ description: 'Updating the dialog.' }),\n      subject: Schema.optional(\n        Schema.String.annotations({ description: 'URI of the component to display in the dialog.' }),\n      ),\n      options: Schema.Struct({\n        state: Schema.optional(Schema.Boolean.annotations({ description: 'Whether the dialog is open or closed.' })),\n        type: Schema.optional(Schema.Literal('default', 'alert').annotations({ description: 'The type of dialog.' })),\n        blockAlign: Schema.optional(\n          Schema.Literal('start', 'center', 'end').annotations({ description: 'The alignment of the dialog.' }),\n        ),\n        overlayClasses: Schema.optional(\n          Schema.String.annotations({ description: 'Additional classes for the dialog overlay.' }),\n        ),\n        overlayStyle: Schema.optional(\n          Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({\n            description: 'Additional styles for the dialog overlay.',\n          }),\n        ),\n        props: Schema.optional(\n          Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({\n            description: 'Additional props for the dialog.',\n          }),\n        ),\n      }),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class UpdatePopover extends Schema.TaggedClass<UpdatePopover>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('popover').annotations({ description: 'Updating the popover.' }),\n      subject: Schema.optional(\n        Schema.Any.annotations({\n          description: 'URI of the component to display in the popover or data to pass to the popover.',\n        }),\n      ),\n      options: Schema.Struct({\n        side: Schema.optional(\n          Schema.Literal('top', 'right', 'bottom', 'left').annotations({ description: 'The side of the anchor.' }),\n        ),\n        state: Schema.optional(Schema.Boolean.annotations({ description: 'Whether the popover is open or closed.' })),\n        props: Schema.optional(\n          Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({\n            description: 'Additional props for the popover.',\n          }),\n        ),\n      }).pipe(\n        Schema.extend(\n          Schema.Union(\n            Schema.Struct({\n              variant: Schema.Literal('virtual'),\n              anchor: Schema.Any.annotations({ description: 'The DOM element to anchor the popover to.' }),\n            }),\n            Schema.Struct({\n              variant: Schema.optional(Schema.Literal('react')),\n              anchorId: Schema.String.annotations({\n                description: 'An id that can be used to determine whether to render the anchor subcomponent.',\n              }),\n            }),\n          ),\n        ),\n      ),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export const Toast = Schema.Struct({\n    id: Schema.String.annotations({ description: 'The id of the toast.' }),\n    title: Schema.optional(Label.annotations({ description: 'The title of the toast.' })),\n    description: Schema.optional(Label.annotations({ description: 'The description of the toast.' })),\n    icon: Schema.optional(Schema.String.annotations({ description: 'The icon of the toast.' })),\n    duration: Schema.optional(Schema.Number.annotations({ description: 'The duration of the toast.' })),\n    closeLabel: Schema.optional(Label.annotations({ description: 'The label of the close button.' })),\n    actionLabel: Schema.optional(Label.annotations({ description: 'The label of the action button.' })),\n    actionAlt: Schema.optional(Label.annotations({ description: 'The alt text of the action button.' })),\n    onAction: Schema.optional(\n      Schema.Any.annotations({ description: 'The action to perform when the action button is clicked.' }),\n    ),\n  });\n\n  export interface Toast extends Omit<Schema.Schema.Type<typeof Toast>, 'onAction'> {\n    onAction?: () => void;\n  }\n\n  export class AddToast extends Schema.TaggedClass<AddToast>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('toast').annotations({ description: 'Adding a toast.' }),\n      subject: Toast.annotations({ description: 'The toast to add.' }),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class SwitchWorkspace extends Schema.TaggedClass<SwitchWorkspace>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('workspace').annotations({ description: 'Switching the workspace.' }),\n      subject: Schema.String.annotations({ description: 'The id of the workspace to switch to.' }),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class RevertWorkspace extends Schema.TaggedClass<RevertWorkspace>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('workspace').annotations({ description: 'Switching the workspace.' }),\n      options: Schema.Struct({\n        revert: Schema.Literal(true).annotations({ description: 'Revert to the previous workspace.' }),\n      }),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class Open extends Schema.TaggedClass<Open>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('main').annotations({ description: 'Opening an item in the main content area.' }),\n      subject: Schema.Array(Schema.String.annotations({ description: 'Ids of the items to open.' })),\n      options: Schema.optional(\n        Schema.Struct({\n          state: Schema.optional(Schema.Literal(true).annotations({ description: 'The items are being added.' })),\n          variant: Schema.optional(Schema.String.annotations({ description: 'The variant of the item to open.' })),\n          key: Schema.optional(\n            Schema.String.annotations({\n              description: 'If provided, will replace item with a matching key (id prefix).',\n            }),\n          ),\n          workspace: Schema.optional(Schema.String.annotations({ description: 'The workspace to open the items in.' })),\n          scrollIntoView: Schema.optional(Schema.Boolean.annotations({ description: 'Scroll the items into view.' })),\n          pivotId: Schema.optional(\n            Schema.String.annotations({ description: 'The id of the item to place new items next to.' }),\n          ),\n          positioning: Schema.optional(\n            Schema.Union(\n              Schema.Literal('start').annotations({ description: 'The items are being added before the pivot item.' }),\n              Schema.Literal('end').annotations({ description: 'The items are being added after the pivot item.' }),\n            ),\n          ),\n        }),\n      ),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class Set extends Schema.TaggedClass<Set>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('main').annotations({ description: 'Setting items in the main content area.' }),\n      subject: Schema.Array(Schema.String.annotations({ description: 'Ids of the items to set.' })),\n      options: Schema.Struct({\n        override: Schema.Literal(true).annotations({\n          description: 'Override the current items in the main content area.',\n        }),\n      }),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class Close extends Schema.TaggedClass<Close>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('main').annotations({ description: 'Closing items in the main content area.' }),\n      subject: Schema.Array(Schema.String.annotations({ description: 'Ids of the items to close.' })),\n      options: Schema.Struct({\n        state: Schema.Literal(false).annotations({ description: 'The items are being removed.' }),\n      }),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class ScrollIntoView extends Schema.TaggedClass<ScrollIntoView>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('current').annotations({ description: 'Setting the current item' }),\n      subject: Schema.optional(Schema.String.annotations({ description: 'The id of the item to set as current.' })),\n      options: Schema.optional(\n        Schema.Record({ key: Schema.String, value: Schema.Any }).annotations({\n          description: 'Additional options for the scroll into view.',\n        }),\n      ),\n    }),\n    output: Schema.Void,\n  }) {}\n\n  export class Expose extends Schema.TaggedClass<Expose>()(UPDATE_LAYOUT, {\n    input: Schema.Struct({\n      part: Schema.Literal('navigation').annotations({ description: 'Exposing an item in the navigation area.' }),\n      subject: Schema.String.annotations({ description: 'The id of the item to expose.' }),\n    }),\n    output: Schema.Void,\n  }) {}\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { INTENT_PLUGIN } from './actions';\nimport { Events } from '../common';\nimport { defineModule, definePlugin, lazy } from '../core';\n\nexport const IntentPlugin = () =>\n  definePlugin({ id: INTENT_PLUGIN, name: 'Intent' }, [\n    defineModule({\n      id: `${INTENT_PLUGIN}/module/dispatcher`,\n      // TODO(wittjosiah): This will mean that startup needs to be reset when intents are added or removed.\n      //   This is fine for now because it's how it worked prior to capabilities api anyways.\n      //   In the future, the intent dispatcher should be able to be reset without resetting the entire app.\n      activatesOn: Events.Startup,\n      activatesAfter: [Events.DispatcherReady],\n      activate: lazy(() => import('./intent-dispatcher')),\n    }),\n  ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type JSX, type ForwardedRef, type PropsWithChildren, type ReactNode } from 'react';\n\nimport { type GuardedType, type MakeOptional, type Position } from '@dxos/util';\n\nimport { type ErrorBoundary } from '../react';\n\n/**\n * SurfaceProps are the props that are passed to the Surface component.\n */\nexport type SurfaceProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{\n  /**\n   * If specified, the Surface will be wrapped in an error boundary.\n   * The fallback component will be rendered if an error occurs.\n   */\n  fallback?: ErrorBoundary['props']['fallback'];\n\n  /**\n   * If specified, the Surface will be wrapped in a suspense boundary.\n   * The placeholder component will be rendered while the surface component is loading.\n   */\n  placeholder?: ReactNode;\n}> &\n  MakeOptional<CoreSurfaceProps<T>, 'id' | 'data'> & {\n    /**\n     * Additional props to pass to the component.\n     * These props are not used by Surface itself but may be used by components which resolve the surface.\n     */\n    [key: string]: unknown;\n  };\n\n// NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.\ntype CoreSurfaceProps<T extends Record<string, any> = Record<string, unknown>> = {\n  /**\n   * ID for debugging.\n   */\n  id: string;\n\n  /**\n   * Role defines how the data should be rendered.\n   */\n  role: string;\n\n  /**\n   * The data to be rendered by the surface.\n   */\n  data: T;\n\n  /**\n   * If more than one component is resolved, the limit determines how many are rendered.\n   */\n  limit?: number | undefined;\n};\n\ntype SurfaceComponentProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<\n  CoreSurfaceProps<T> & { [key: string]: unknown }\n>;\n\n/**\n * React component used to render a surface once is has matched.\n */\nexport type SurfaceComponent<T extends Record<string, any> = Record<string, unknown>> = (\n  props: SurfaceComponentProps<T>,\n  forwardedRef: ForwardedRef<HTMLElement>,\n) => JSX.Element | null;\n\n/**\n * Definition of when a SurfaceComponent should be rendered.\n */\nexport type SurfaceDefinition<T extends Record<string, any> = any> = Readonly<{\n  id: string;\n  role: string | string[];\n  position?: Position;\n  filter?: (data: Record<string, unknown>) => data is T;\n  component: SurfaceComponent<GuardedType<SurfaceDefinition<T>['filter']>>;\n}>;\n\n/**\n * Creates a surface definition.\n */\nexport const createSurface = <T extends Record<string, any> = any>(\n  definition: SurfaceDefinition<T>,\n): SurfaceDefinition<T> => definition;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nexport const ResourceKey = Schema.Union(Schema.String, Schema.Record({ key: Schema.String, value: Schema.Any }));\nexport type ResourceKey = Schema.Schema.Type<typeof ResourceKey>;\n\nexport const ResourceLanguage = Schema.Record({ key: Schema.String, value: ResourceKey });\nexport type ResourceLanguage = Schema.Schema.Type<typeof ResourceLanguage>;\n\n/**\n * A resource is a collection of translations for a language.\n */\nexport const Resource = Schema.Record({ key: Schema.String, value: ResourceLanguage });\nexport type Resource = Schema.Schema.Type<typeof Resource>;\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAA0C;AAG1C,yBAAqB;AACrB,iBAAoB;AACpB,kBAA+E;ACL/E,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AAA,EACvBmL,MAAM,CAAClJ,WAAW;MAAEA;IAAM,EAAA;EAC/B;AAEA,SAAO;IAAE6S;IAAUa;IAAiBf;IAAMqB;EAAY;AACxD;AAEA,IAAMC,gBAAgB,MAAMvP,cAAAA,OAAOgF,KAAK,IAAIpJ,MAAM,0BAAA,CAAA;AAClD,IAAM4T,iBAAiB,MAAMxP,cAAAA,OAAOC,WAAWsP,cAAAA,CAAAA;AAE/C,IAAA,4BAAe,CAACzT,YAAAA;AACd,QAAMuI,YAAQxC,mBAAAA,MAAoB;IAChCsM,UAAUoB;IACVP,iBAAiBQ;IACjBvB,MAAMsB;IACND,aAAaE;EACf,CAAA;AAGA,QAAM,EAAErB,UAAUa,iBAAiBf,MAAMqB,YAAW,IAAKhC,iBAAiB,MACxExR,QAAQuD,gBAAgBmH,aAAaM,cAAc,EAAE2I,KAAI,CAAA;AAG3D,QAAMC,UAAU5T,QAAQyB,cAAciJ,aAAazF,aAAa;AAChEsD,QAAM8J,WAAW,CAACC,aAAaC,UAAAA;AAC7B,WAAOrO,cAAAA,OAAOiE,IAAI,aAAA;AAChB,aAAOyL,QAAQjO,UAAU6G,OAAOI,mBAAmB;AACnD,aAAO,OAAOyF,SAASC,aAAaC,KAAAA;IACtC,CAAA;EACF;AACAhK,QAAM2K,kBAAkB,OAAOZ,gBAAAA;AAC7B,UAAMsB,QAAQhS,SAAS4K,OAAOI,mBAAmB;AACjD,WAAO,MAAMsG,gBAAgBZ,WAAAA;EAC/B;AACA/J,QAAM4J,OAAOA;AACb5J,QAAMiL,cAAcA;AAEpB,SAAOvS,YAAYyJ,aAAaO,kBAAkB1C,KAAAA;AACpD;",
  "names": ["import_effect", "import_log", "import_rx_react", "import_async", "import_live_object", "createIntent", "schema", "data", "params", "_", "Schema", "validateSync", "fields", "input", "intent", "_schema", "id", "_tag", "first", "last", "all", "chain", "intents", "Label", "Union", "String", "mutable", "Tuple", "Struct", "ns", "count", "optional", "Number", "defaultValue", "INTENT_PLUGIN", "INTENT_ACTION", "IntentAction", "Track", "TaggedClass", "Array", "error", "output", "Void", "ShowUndo", "message", "BaseError", "Error", "code", "context", "cause", "name", "Object", "setPrototypeOf", "prototype", "NoResolversError", "action", "CycleDetectedError", "InterfaceDefTypeId", "Symbol", "for", "defineCapability", "identifier", "CapabilityImpl", "moduleId", "implementation", "contributes", "interfaceDef", "deactivate", "interface", "lazy", "c", "props", "default", "getCapability", "PluginContext", "registry", "activate", "reset", "_capabilityImpls", "Rx", "family", "make", "pipe", "keepAlive", "_capabilities", "get", "current", "map", "_capability", "invariant", "length", "_registry", "contributeCapability", "module", "capability", "includes", "set", "log", "removeCapability", "next", "filter", "warn", "capabilities", "getCapabilities", "waitForCapability", "trigger", "Trigger", "cancel", "subscribe", "wake", "result", "wait", "activatePromise", "event", "Effect", "runPromise", "resetPromise", "defineEvent", "specifier", "eventKey", "oneOf", "events", "type", "allOf", "isOneOf", "isAllOf", "getEvents", "isPromise", "value", "PluginManager", "pluginLoader", "plugins", "core", "meta", "enabled", "activation", "Event", "Map", "Registry", "_activate", "_reset", "_pluginLoader", "_state", "live", "modules", "active", "pendingReset", "eventsFired", "forEach", "plugin", "_addPlugin", "enable", "add", "untracked", "_getPlugin", "push", "_addModule", "_setPendingResetByModule", "concurrency", "remove", "disable", "_removePlugin", "enabledIndex", "findIndex", "splice", "_deactivate", "_removeModule", "pluginIndex", "moduleIndex", "find", "_getActiveModules", "_getInactiveModules", "_getActiveModulesByEvent", "key", "activatesOn", "_getInactiveModulesByEvent", "activationEvents", "from", "Set", "gen", "pendingIndex", "every", "emit", "state", "tryPromise", "try", "catch", "A", "zip", "_activateModule", "either", "Either", "isLeft", "left", "fail", "activatesBefore", "maybeCapabilities", "resolvedCapabilities", "Match", "when", "promise", "orElse", "program", "succeed", "isArray", "array", "activatesAfter", "results", "_deactivateModule", "isEffect", "effect", "delete", "activeIndex", "PluginModule", "options", "defineModule", "Plugin", "definePlugin", "Capabilities", "Null", "RxRegistry", "ReactContext", "ReactRoot", "ReactSurface", "IntentResolver", "IntentDispatcher", "Layout", "Translations", "AppGraph", "AppGraphBuilder", "AppGraphSerializer", "SettingsStore", "Settings", "Metadata", "Tools", "ArtifactDefinition", "FileUploader", "AnchorSort", "CollaborationActions", "InsertContent", "target", "Expando", "object", "Ref", "at", "label", "annotations", "description", "Events", "Startup", "SetupReactSurface", "SetupMetadata", "SetupIntentResolver", "SetupSettings", "SetupAppGraph", "SetupTranslations", "SetupArtifactDefinition", "DispatcherReady", "SettingsReady", "AppGraphReady", "createStateEvent", "LayoutReady", "defaultFileTypes", "images", "media", "text", "FileInfoSchema", "url", "cid", "IntentPlugin", "LAYOUT_PLUGIN", "LAYOUT_ACTION", "LayoutAction", "UPDATE_LAYOUT", "UpdateLayout", "part", "subject", "Any", "Record", "SetLayoutMode", "Literal", "mode", "revert", "Boolean", "UpdateSidebar", "UpdateComplementary", "UpdateDialog", "blockAlign", "overlayClasses", "overlayStyle", "UpdatePopover", "side", "extend", "variant", "anchor", "anchorId", "Toast", "title", "icon", "duration", "closeLabel", "actionLabel", "actionAlt", "onAction", "AddToast", "SwitchWorkspace", "RevertWorkspace", "Open", "workspace", "scrollIntoView", "pivotId", "positioning", "override", "Close", "ScrollIntoView", "Expose", "createSurface", "definition", "ResourceKey", "ResourceLanguage", "Resource", "EXECUTION_LIMIT", "HISTORY_LIMIT", "createResolver", "resolver", "isUndoable", "historyEntry", "undoable", "createDispatcher", "getResolvers", "executionLimit", "historyLimit", "historyRef", "runSync", "handleIntent", "candidates", "toSorted", "byPosition", "resolve", "undo", "_intent", "dispatch", "intentChain", "depth", "resultsRef", "prev", "update", "history", "catchSome", "err", "Option", "some", "undefined", "none", "dispatchPromise", "then", "findLastIndex", "undoData", "h", "index", "undoPromise", "defaultEffect", "defaultPromise", "flat", "manager"]
}
