Skip to content
projectakshithPublic

About

agentic harness, i suppose.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

morpheus

agentic harness, i suppose.

a minimal, terminal-first autonomous coding harness. fast, aesthetic, and stays out of your way.

morpheus
M/  ●●  01    MORPHEUS
              agentic harness

quickstart

# install & build
npm install
npm run build
npm link

# launch
morpheus

flags

  • morpheus "task" — jump straight in with an initial prompt
  • morpheus --local — run locally via ollama (qwen2.5-coder:7b)
  • morpheus -v — stream raw reasoning and tool deltas

daemon

morpheus serve runs Morpheus headless: no UI, just a WebSocket API that interfaces like Trinity connect to. Sessions keep running when clients disconnect, and several clients can watch the same session.

morpheus serve                 # ws://127.0.0.1:7878, token in ~/.morpheus/daemon.json
morpheus serve --host 0.0.0.0  # reachable from other devices (phone over LAN/tailscale)

The protocol is documented in docs/daemon-protocol.md.

autopilot

Autopilot is available inside Morpheus:

/autopilot setup             # one-time native power-helper installation
/autopilot on                # arm autopilot, then enter your goal normally
/autopilot Implement the settings page and verify it
/autopilot status            # mode and confirmed macOS power protection
/autopilot off               # cancel work and restore normal sleep

Autopilot activates closed-lid power protection automatically; there is no need to run /awake first. Its automatic protection is released when the work ends. A separate manual /awake setting stays active until its own timer ends or you turn it off.

The header displays autopilot · lid ready only after the power helper confirms macOS has applied the sleep override. While protection is active, the helper observes the lid sensor and explicitly requests display sleep when the lid is closed; an open lid keeps normal display behavior. It leaves display timeout and brightness settings unchanged. You can then close the lid with no external display attached; the display can remain off while shell, file, API, and model work continues. Visual desktop automation can still require an unlocked graphical session.

/autopilot setup builds and tests Morpheus's native Swift helper, then asks macOS for administrator approval to install or update it. Morpheus never receives the administrator password. Only this small root-owned helper runs privileged; the agent and its tools continue running as your user. The helper accepts only power-status, lease, and awake-timer requests from the installing user over a local Unix socket, and can only change the SleepDisabled power setting or request display sleep on lid closure. It cannot run arbitrary commands or grant the agent sudo access.

Autopilot uses full tool access for the current goal and any queued work, continues after step/context limits, and records essential missing information instead of waiting on a question dialog. It streams tools and results into the existing conversation and checkpoints conversation history between cycles. Normal permission settings are unchanged. Defaults are 100 steps per cycle, 12 continuation cycles, one million weighted tokens per goal, and an eight-hour elapsed-time ceiling; /settings step limits apply when explicitly set.

When the work finishes, fails, or is stopped, autopilot turns off and restores the previous sleep setting. The power helper uses 45-second renewable leases: if Morpheus crashes or exits, stale leases expire and sleep is restored. If the helper itself crashes or the Mac restarts, launchd restarts it and it restores the saved setting before accepting new requests. Multiple active sessions share protection without stopping one another. The helper stops protection at 15% battery on battery power or critical thermal pressure; keep the Mac ventilated. /autopilot uninstall removes the helper through macOS administrator authentication after all active sessions have stopped.

The helper's source is native/power-helper/main.swift. Its standalone self-tests use a fake backend and do not change macOS settings. pmset's global sleep override is distinct from ordinary caffeinate idle-sleep assertions; closing the lid needs the helper, not just caffeinate.

For optional background jobs that survive closing Terminal:

morpheus autopilot "Implement the settings page and verify it" --closed-lid
morpheus autopilot status [id]
morpheus autopilot stop [id]

Background jobs save private progress, conversation checkpoints, events, and a final result under ~/.morpheus/autopilot/<id>/. Use --max-steps, --max-cycles, --max-tokens, and --hours to adjust limits. On macOS they activate the same closed-lid helper automatically; --no-keep-awake opts out. Neither in-app nor background jobs automatically resume after logout, reboot, or force quit; inspect saved progress before restarting work.

awake

/awake is an independent, Mac-wide keep-awake control available in every Morpheus session and mode:

/awake                 # 2 hours by default, then automatically off
/awake on              # also defaults to 2 hours
/awake 30m             # 30 minutes
/awake 1h              # 1 hour
/awake 2h              # 2 hours
/awake 4h              # 4 hours
/awake 8h              # 8 hours
/awake 1h30m           # custom duration
/awake forever         # explicitly stay on until /awake off
/awake status          # check the shared timer from any session
/awake off             # cancel manual protection

The display may sleep and the lid can be closed. A new /awake duration replaces the previous manual timer. This setting lives in the native helper, so it works across other Mac apps and stays active after closing Morpheus or Terminal. Timed protection ends automatically. Stopping autopilot does not stop /awake, and /awake off does not stop an active autopilot job's own protection. The previous sleep setting returns after the last active protection ends.

/awake and /awake on default to two hours. /awake forever (or /awake always) explicitly selects no time limit. Custom durations accept days, hours, minutes, and seconds from one second to 30 days. /awake setup installs or updates the existing helper if needed. Low-battery and thermal protections still apply. A helper restart or Mac reboot clears manual awake and restores the previous sleep setting; manual awake does not automatically resume after reboot.

worker agents

Morpheus can delegate independent research, review, or scoped implementation tasks. Workers receive a separate task and context, run concurrently within limits, and return results to the coordinating agent. Research and review are read-only. Implementation workers must be given exact workspace-relative files; shell commands and commits are disabled, and edits outside that file list are rejected.

By default, a run allows up to 3 concurrent workers, 6 total worker tasks, 20,000 tokens per worker, and 60,000 worker tokens total. All worker usage counts toward the parent run budget. Workers cannot delegate again.

Set role-specific models in /settings under runtime. Choices are saved in ~/.morpheus/config.json; choose “inherit main” to follow the active model. Workers also fall back to the main model until you assign one.

MCP servers

Morpheus can connect to local MCP servers over stdio. Add server definitions to ~/.morpheus/config.json; each server process runs with your user permissions, so only configure commands you trust.

{
  "mcpServers": {
    "cua": {
      "command": "cua-driver",
      "args": ["mcp"]
    }
  }
}

MCP tools are available to the main agent as mcp_<server>_<tool> (for example, mcp_cua_list_apps). Tool names are normalized to lowercase letters, numbers, and underscores. Set "disabled": true on a server entry to skip it. Morpheus starts configured servers for each run and closes them when the run finishes. MCP servers are not exposed to worker agents. Image results from MCP tools are passed to the selected model, so visual computer use requires a model endpoint that accepts images.

For desktop tasks, install Cua Driver and grant its required OS permissions. The computer_use skill guides Morpheus through app discovery, fresh UI snapshots, actions, and verification. Use /cua setup to register Cua Driver in Morpheus, /cua status to check installation and permissions, and /cua enable or /cua disable to control whether Morpheus starts its MCP server.

High impact action approvals

Reads and searches, including outside the active project, and routine desktop interaction run without approval. Morpheus asks before destructive shell commands, writes outside the active project, non-GET HTTP requests, and connected MCP tools whose names indicate they can change external data (such as create, update, delete, or send). In /settings → runtime → access mode, switch to full access to bypass all approval prompts; this is saved in ~/.morpheus/config.json and applies to the CLI and daemon. Full access allows tools to run shell commands, access files, make web requests, and use connected apps without pausing. While an action waits in guarded mode, Morpheus can continue independent work; approval runs only that action in the background. The terminal shows its tool, arguments, and reason; press Ctrl+Y to approve once or Ctrl+N to deny. Daemon clients receive permission.requested events and answer through permission.resolve. Requests time out to deny after five minutes, and missing approval handlers deny protected actions.

controls

Mermaid flowcharts appear as compact, clickable previews in the conversation. Click a preview to open a readable full-width view. Scroll with the touchpad or arrow keys, use s to inspect the original source, and Esc to close. Node references preserve branches and loops without sprawling connector lines.

In /model, press f to add or remove the highlighted model from favorites. The selector opens Favorites by default. Press 1 to return to favorites, use ↑↓ to move, and Enter to select. The model list and its details use two columns. Favorites persist across restarts. Provider shortcuts are 2–7.

  • tab — toggle panel focus (chat / tool calls & telemetry)
  • ↑ / ↓ — scroll focused panel
  • enter — submit prompt
  • esc — abort active execution
  • ctrl+c — exit

"free your mind."

About

agentic harness, i suppose.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages