# Primus

[![Primus — floating stone hand with waterfalls](https://masidyn.dev/primus-icon.png)](https://masidyn.ai/Primus)

**[MasiDyn.AI/Primus](https://masidyn.ai/Primus)** provides local execution and file tools for your connected workspace.

Primus gives any user on any operating system (Windows, macOS, Linux, WSL, Chromebook Crostini) three clean, user-protected surfaces built on **OAuth 2.1 PKCE S256**, strict multi-tenant isolation, and a **$0.00 default spend cap**.

---

## Surface 1: AI Plugin & Remote MCP (Zero Local Install)

Connect Claude, Antigravity, Cursor, VS Code, Codex, ChatGPT, or GitHub Copilot directly to Primus over Streamable HTTP:

- **Developer Portal Endpoints:**
  - **MCP (`2025-11-25`):** `https://masidyn.dev/mcp/primus`
  - **ACP v1 (Coding Sessions):** `https://masidyn.dev/acp/primus`
  - **Cloud TypeScript/JSON LSP 3.17:** `https://masidyn.dev/lsp/primus`
  - **A2A v1.0 (Task Delegation):** `https://masidyn.dev/a2a/primus`
- **Cloudflare Edge Endpoints:**
  - **MCP:** `https://masidyn.ai/Primus/mcp`
  - **ACP v1:** `https://masidyn.ai/Primus/acp`
  - **LSP 3.17:** `https://masidyn.ai/Primus/lsp`
  - **A2A v1.0:** `https://masidyn.ai/Primus/a2a`

### Netwurkus Protocol Bus Tools Over MCP (`netwurkus_acp`, `netwurkus_lsp`, `netwurkus_a2a` + `primus_*` aliases)

All protocol routing (ACP v1, TypeScript/JSON LSP 3.17, A2A v1.0) is owned by **Netwurkus** (`https://masidyn.dev/mcp/netwurkus`, `/acp/netwurkus`, `/lsp/netwurkus`, `/a2a/netwurkus`) and mounted across `/mcp/netwurkus`, `/mcp`, and `/mcp/primus` (with backwards-compatible `primus_acp`, `primus_lsp`, `primus_a2a` aliases preserved on `/mcp/primus`):

- **`netwurkus_acp`** (alias **`primus_acp`**) — Start and drive ACP v1 coding sessions over MCP (or directly via `/acp/netwurkus` / `/acp/primus` / `/Primus/acp`).
- **`netwurkus_lsp`** (alias **`primus_lsp`**) — Run real Cloud TypeScript/JSON LSP 3.17 diagnostics, hover, document symbols, go-to-definition, references, and completions over MCP (or directly via `/lsp/netwurkus` / `/lsp/primus` / `/Primus/lsp`).
- **`netwurkus_a2a`** (alias **`primus_a2a`**) — Delegate and track structured A2A v1.0 agent tasks over MCP (or directly via `/a2a/netwurkus` / `/a2a/primus` / `/Primus/a2a`).

### Primus Finger Workflow Trees & Canonical Tuple Leaves (`primus_finger_workflows`)

Every Primus finger workflow branches deterministically and terminates in a **content-addressed 6-element Tuple Leaf** (`["leaf", finger, workflow, branchPath, state, action]`) carrying the `veni` / `vidi` / `vici` verification triad and a **SHA-256 receipt**:

- **MCP Tool (`primus_finger_workflows`):** Supports `action: "tree" | "resolve" | "execute"` and `format: "json" | "beamtoon"` so any MCP client can inspect workflow trees, deterministically resolve branch paths to canonical Tuple Leaves, or execute authorized leaves with cryptographic receipts.
- **HTTP Endpoint (`GET /api/primus/workflows`):**
  - JSON: `https://masidyn.dev/api/primus/workflows`
  - BEAMTOON: `https://masidyn.dev/api/primus/workflows?format=beamtoon`

Drop `.mcp.json` into your MCP client configuration:

```json
{
  "mcpServers": {
    "primus": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://masidyn.dev/mcp/primus"]
    }
  }
}
```

Or generate a client-specific config using the local CLI:

```sh
masidyn-primus mcp-config --client cursor
masidyn-primus mcp-config --client vscode
```

---

## Surface 2: Portable Local Primus Agent (Consented Local Exec)

Single-file Python 3.9+ standard-library agent (`masidyn_primus_agent.py`) with **zero pip dependencies** and **zero privileged elevation**.

### 1-Command Install

- **Windows (PowerShell):**
  ```powershell
  irm https://masidyn.dev/install-primus.ps1 | iex
  ```
- **macOS / Linux / WSL / Chromebook Crostini:**
  ```sh
  curl -fsSL https://masidyn.dev/install-primus.sh | sh
  ```

### Sign In & Run (Dual-Key Consent)

Local command execution is **OFF by default**. Both keys are required before any command can execute on your computer:

1. **Read/Write + Task Board Only (No Local Exec):**
   ```sh
   masidyn-primus login
   masidyn-primus start --workspace ./my-project
   ```
2. **Consented Local Execution (Dual-Key Opt-In):**
   ```sh
   masidyn-primus login --allow-exec
   masidyn-primus start --allow-exec --workspace ./my-project
   ```
3. **Self-Test, Status & Instant Revocation:**
   ```sh
   masidyn-primus --selftest
   masidyn-primus doctor
   masidyn-primus logout
   ```

### Built-In Local Protections

- **Workspace Root Fence:** Canonicalizes every `cwd` inside `--workspace` and rejects path traversal (`../`) or protected secret paths (`.env`, `.ssh`, `.aws`, `.kube`, `.gnupg`, SSH keys, `credentials.db`, `oauth_creds.json`, `auth.json`, `primus-agent.json`).
- **Destructive Command Denylist:** Blocks destructive file/disk/system/privilege commands (`rm -rf`, `rmdir /s`, `del /f /s /q`, `format`, `diskpart`, `bcdedit`, `mountvol`, `mkfs`, `dd if=`, `shutdown`, `Stop-Computer`, `Restart-Computer`, `reg delete`, `Disable-NetAdapter`, `sudo`, `chmod 777 /`, `net user`, `icacls`).
- **Secret Redaction & SHA-256 Receipts:** Redacts Bearer tokens, `sk-...`, GitHub tokens, Google API keys, `msdrt_`/`msdsvc_`/`msd_edge_` tokens, and PEM private keys before computing SHA-256 receipts, logging locally to `~/.masidyn/primus-exec-audit.jsonl`, or uploading results.
- **Hidden Subprocess Spawning:** Uses `CREATE_NO_WINDOW` on Windows and bounded timeouts (1–120s) + bounded output (16KB stdout / 8KB stderr).

### Advanced (Developer Full Bypass)

Developers running their own agents inside their own local harness can opt to lift ONLY the local workspace root fence and local command denylist by explicitly passing all three flags together:

```sh
masidyn-primus start --allow-exec --developer-full-bypass --i-accept-full-liability --workspace ./my-project
```

- Passing `--developer-full-bypass` without BOTH `--allow-exec` and `--i-accept-full-liability` fails closed immediately.
- By passing `--i-accept-full-liability`, you acknowledge that you assume sole liability for commands executed in your own local harness and that **Massive Dynamic Labs / MasiDyn is not liable** for actions run under bypass.
- Even in bypass mode, bounded timeouts, secret redaction, local audit logging (recorded with `"bypass_mode": "developer_full_bypass_acknowledged"`), OAuth 2.1 token verification, and cloud multi-tenant isolation are **never bypassed**.

---

## Surface 3: Chrome / Edge Browser Companion Extension (MV3)

The Manifest V3 browser companion (`https://masidyn.dev/primus-extension/manifest.json`) enables user-consented browser workflows without giving an AI unrestricted access to your browser:

- **Dedicated `MasiDyN` Tab-Group Fence:** Automation operates exclusively inside tabs you place in the `MasiDyN` tab group.
- **Explicit Origin Allowlist:** Only user-approved origins are accessible via optional host permissions.
- **Instant Kill Switch:** One click or keyboard shortcut (`Ctrl+Shift+K` / `Command+Shift+K`) immediately halts active automation.
- **Password & Payment Field Refusal:** Never reads, types into, or exfiltrates password inputs, MFA codes, or payment/card fields.
