@agimon-ai/doompi-domain

Domain selection, resource staging, and MCP scoping for DoomPi sessions.

Packages

Package details

extension

Install @agimon-ai/doompi-domain from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@agimon-ai/doompi-domain
Package
@agimon-ai/doompi-domain
Version
0.0.1-alpha.49
Published
Sep 14, 2026
Downloads
6,149/mo · 1,376/wk
Author
agiflow-ai
License
MIT
Types
extension
Size
495.5 KB
Dependencies
8 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/extensions/pi.mjs"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@agimon-ai/doompi-domain

Domain selection for DoomPi sessions.

Domains are one of the four axes of a DoomPi selection, alongside the major mode, the profile, and the minor modes. Unlike a major mode, domains compose: a session selects a set of them, and the union of what they contribute is what the model sees.

# .doom/domains.yaml
plugins:
  entries:
    frontend: plugins/frontend
    infra: plugins/infra
domains:
  development:
    description: Application code, tests, and review tooling.
    plugins: [frontend]
    mcp:
      servers: [code-intel]
  platform:
    description: Deployment, infrastructure, and incident tooling.
    plugins: [infra]
aliases:
  everything: [development, platform]

What it registers

Surface Behavior
/domains prints the selection, or switches to name[,name...]
/domains with no argument opens a multi-select picker in the TUI
list_domains voice tool returns the active, effective and available domains
switch_domains voice tool validates a selection and queues the switch
autocomplete comma-triggered completion of domain names inside /domains
resources_discover re-answers with the current selection's skills after a reload

When the @agimon-ai/doompi-help minor mode is active, this package contributes the doompi-author-domain skill. It provides package-owned guidance for plugin catalogs, domain filters, aliases, defaults, shared skills, and MCP scopes in domains.yaml. The contribution is registered through the session's doom/help Cordis service and is withdrawn with this package's plugin fiber.

What a switch stages

A domain switch is not just a config write, which is why it does not live in @agimon-ai/doompi-config/selectionSwitch with the major-mode and profile switches. Applying a selection:

  • materializes any remote (Git or npm) plugins the selected domains name into a content-addressed cache guarded by an install marker;
  • discovers the exact SKILL.md files behind the selection, through a manifest cache keyed by worktree so a second session does not rescan the tree;
  • adapts each plugin's Claude-authored agent definitions into the form Pi loads, and stages them privately (0600) beside a dispatcher agent;
  • merges the repository and legacy plugin .mcp.json layers, and validates root mcp.json for schema-gated Agent Plugins v1 (including plugin-relative commands, data directories, and transport normalization);
  • applies the selected domains' MCP allowlists and rewrites the proxy's upstream list into a private per-run config; and
  • atomically stores an immutable MCP projection in harness state, then reloads Pi. The replacement Config factory publishes that snapshot through the session Cordis registry for DoomPi MCP to consume; Domain never reaches into the live MCP runtime.

An allowlist only takes effect once every selected domain declares one. Mixing a scoped domain with a domain that has not opted in leaves the session unfiltered, so an unmigrated domain cannot silently lose its tools.

Switching from voice

The voice tool never applies a switch itself. It plans the transition, parks the validated selection in a TTL-bounded store, and sends /domains --voice-switch-token=… back as a follow-up, so the reload happens inside a command handler where it can be the terminal action. The selection travels in the store rather than in the follow-up text, and the token is bound to the session that minted it.

Installation

DoomPi depends on this package and activates it as fixed host core, so a DoomPi install already has it. It is not selectable from .doom/modes.yaml; it reads .doom/domains.yaml.

License

MIT

Pi, server, and web entries live in src/extensions; the Node entries build directly to /extensions/pi and /extensions/server. Flat public exports expose domain catalogs, resource selection, MCP configuration, and plugin materialization helpers.

The Pi declaration installs optional Config, Transition, and Voice service bindings, then registers command and event declarations. Session startup waits for the runtime bindings before publishing domain status. onStop cancels a pending catalog-settle notification and disposes handoffs; onDispose also handles partial startup cleanup. The heavy picker and domain application modules remain lazy imports.