Skip to content

wuxxin/omp-mypai

v0.1.0MIT

Core agent plugin for MyPAI and Oh-my-PI (omp): provides per-project cron scheduling, Signal messaging channel bridge, inbox audio/file ingestion spooler, Whisper STT & neural TTS speech synthesis, multi-bank Hindsight long-term vector memory integration, arbor AST code intelligence, and specialized multi-agent profiles.

omp-mypai Agent Plugin

Personal Artificial Intelligence (PAI) agent plugin based on Oh-my-PI and Hindsight adding Cron, Signal Chat, Inbound Spooler, and WebUI tools.


Repository Structure

  • Makefile — Buildenv, virtualenv, testing, and linting targets
  • plugin.json — Plugin root manifest
  • package.json — Compatibility manifest
  • mcp.json — MCP server registry configuration
  • skills/ — Portable skills definitions & modular references
  • tools/mypai_tools/ — Python package (mypai_tools), mypai_daemon, FastMCP servers, and sidecars
  • agents/ — Custom subagent prompt profiles
  • rules/ — Execution policies and guidelines
  • config/ — Hindsight bank configurations and templates

Development & Testing (Makefile)

The plugin includes a dedicated Makefile for virtualenv management, testing, and linting:

make buildenv  # Create .venv and install mypai_tools & dependencies
make test      # Run hermetic unit tests inside .venv (auto-builds .venv if missing)
make lint      # Run ruff check inside .venv
make check     # Run linter and execute unit tests
make clean     # Clean up test caches and Python bytecode
make cleanenv  # Remove .venv directory

Sandbox Launcher & Service Configuration (omp.env)

The plugin environment launcher configuration is defined in omp.env:

  • Default Headless Service: Keeps systemd sandbox service unit active while persistent sidecars run:
    LAUNCHER_SERVICE_ENABLED="true"
    LAUNCHER_SERVICE_CMD="sleep"
    LAUNCHER_SERVICE_ARGS="infinity"
    
  • Sidecars Project Binding (sandbox-ctl spec): mypai_daemon and input_spooler daemons are launched as background sidecars bound to the target project workspace:
    LAUNCHER_SIDECARS="mypai_daemon input_spooler"
    
    LAUNCHER_SIDECAR_MYPAI_DAEMON_CMD="python3"
    LAUNCHER_SIDECAR_MYPAI_DAEMON_ARGS="-m mypai_tools.daemon serve --project-dir $MYPAI_PROJECT_DIR --session-name $MYPAI_SESSION_NAME"
    
    LAUNCHER_SIDECAR_INPUT_SPOOLER_CMD="python3"
    LAUNCHER_SIDECAR_INPUT_SPOOLER_ARGS="-m mypai_tools.input_spooler daemon --project-dir $MYPAI_PROJECT_DIR"
    

Configured MCP Servers (mcp.json)

All MCP servers comply with Agent Plugins 1.0.0 Standard (https://agent-plugins.org/schemas/1.0.0/mcp.schema.json) and are declared in mcp.json:

  • chat-channel: Signal messaging interface (mypai_tools.chat_mcp).
  • cron-scheduler: Task & cron job scheduler backed by SQLite and mypai_daemon REST API (mypai_tools.cron_mcp).

Background Daemons & Services

Each daemon maintains detailed architectural specifications under skills/mypai_tools/references/:

  • mypai_daemon (python3 -m mypai_tools.daemon serve --project-dir "$MYPAI_PROJECT_DIR" --session-name "$MYPAI_SESSION_NAME")
    • Spec: daemon-spec.md | daemon-api-spec.md | web-ui-spec.md
    • Function: Central coordinator, fixed OMP RPC session manager (MYPAI_SESSION_NAME), MPSC turn serializer (prompt, steer, followup, abort_and_prompt), FastAPI REST server (Port 52080), Signal webhook whitelist filter, and embedded Glassmorphism SPA WebUI.
  • input_spooler (python3 -m mypai_tools.input_spooler daemon --project-dir "$MYPAI_PROJECT_DIR")
    • Spec: input_spooler.md
    • Function: Asynchronous sidecar daemon watching inbox folder (~/Recordings/Inbox), SHA256 hashing, sidecar parsing, STT transcription, Hindsight memory bank retention, and mypai_daemon REST notification.

Agent Skills

All skills conform to the closed 6-field frontmatter schema (agentskills.io):

  • mypai_tools: SKILL.md — Complete agent guide for mypai_tools MCP servers, mypai_daemon, and references.
  • arbor: SKILL.md — Graph-native AST code intelligence and workspace navigation.
  • openadapt: SKILL.md — Browser capture and UI automation.
  • hindsight-api: SKILL.md — REST API guide for Hindsight memory bank management.