@muxoai/platform 0.0.0-stage → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +111 -0
- package/README.md +53 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +527 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.js +89 -0
- package/dist/engine.d.ts +128 -0
- package/dist/engine.js +709 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/mcp.d.ts +9 -0
- package/dist/mcp.js +401 -0
- package/dist/providers/composio-instant.d.ts +14 -0
- package/dist/providers/composio-instant.js +372 -0
- package/dist/providers/composio-sdk.d.ts +41 -0
- package/dist/providers/composio-sdk.js +514 -0
- package/dist/providers/microsoft-governance.d.ts +66 -0
- package/dist/providers/microsoft-governance.js +415 -0
- package/dist/providers/stripe-billing.d.ts +31 -0
- package/dist/providers/stripe-billing.js +168 -0
- package/dist/providers/stripe-projects.d.ts +53 -0
- package/dist/providers/stripe-projects.js +607 -0
- package/dist/providers/supermemory.d.ts +64 -0
- package/dist/providers/supermemory.js +224 -0
- package/dist/sdk.d.ts +115 -0
- package/dist/sdk.js +117 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.js +816 -0
- package/dist/store.d.ts +200 -0
- package/dist/store.js +1260 -0
- package/dist/types.d.ts +273 -0
- package/dist/types.js +1 -0
- package/dist/ui/console-html.d.ts +2 -0
- package/dist/ui/console-html.js +2153 -0
- package/package.json +75 -4
- package/plugins/muxo/.app.json +8 -0
- package/plugins/muxo/.claude-plugin/plugin.json +16 -0
- package/plugins/muxo/.codex-plugin/plugin.json +51 -0
- package/plugins/muxo/.mcp.json +8 -0
- package/plugins/muxo/assets/logo.png +0 -0
- package/plugins/muxo/assets/logo.svg +6 -0
- package/plugins/muxo/hooks/hooks.json +27 -0
- package/plugins/muxo/hooks/session-start.sh +85 -0
- package/plugins/muxo/hooks/user-prompt-submit.sh +45 -0
- package/plugins/muxo/skills/muxo/SKILL.md +25 -0
- package/plugins/muxo/skills/muxo/references/cli.md +57 -0
- package/plugins/muxo/skills/muxo/references/mcp.md +25 -0
- package/src/catalogues/stripe-projects-catalog.json +9832 -0
- package/vendor/microsoft-governance/README.md +363 -0
- package/vendor/microsoft-governance/dist/audit.d.ts +26 -0
- package/vendor/microsoft-governance/dist/audit.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/audit.js +107 -0
- package/vendor/microsoft-governance/dist/audit.js.map +1 -0
- package/vendor/microsoft-governance/dist/cascade-containment.d.ts +84 -0
- package/vendor/microsoft-governance/dist/cascade-containment.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/cascade-containment.js +387 -0
- package/vendor/microsoft-governance/dist/cascade-containment.js.map +1 -0
- package/vendor/microsoft-governance/dist/client.d.ts +34 -0
- package/vendor/microsoft-governance/dist/client.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/client.js +112 -0
- package/vendor/microsoft-governance/dist/client.js.map +1 -0
- package/vendor/microsoft-governance/dist/context-poisoning.d.ts +58 -0
- package/vendor/microsoft-governance/dist/context-poisoning.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/context-poisoning.js +410 -0
- package/vendor/microsoft-governance/dist/context-poisoning.js.map +1 -0
- package/vendor/microsoft-governance/dist/credential-vault.d.ts +213 -0
- package/vendor/microsoft-governance/dist/credential-vault.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/credential-vault.js +567 -0
- package/vendor/microsoft-governance/dist/credential-vault.js.map +1 -0
- package/vendor/microsoft-governance/dist/discovery.d.ts +80 -0
- package/vendor/microsoft-governance/dist/discovery.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/discovery.js +404 -0
- package/vendor/microsoft-governance/dist/discovery.js.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/channel.d.ts +29 -0
- package/vendor/microsoft-governance/dist/encryption/channel.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/channel.js +78 -0
- package/vendor/microsoft-governance/dist/encryption/channel.js.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/index.d.ts +9 -0
- package/vendor/microsoft-governance/dist/encryption/index.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/index.js +23 -0
- package/vendor/microsoft-governance/dist/encryption/index.js.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/mesh-client.d.ts +267 -0
- package/vendor/microsoft-governance/dist/encryption/mesh-client.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/mesh-client.js +1001 -0
- package/vendor/microsoft-governance/dist/encryption/mesh-client.js.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/ratchet.d.ts +38 -0
- package/vendor/microsoft-governance/dist/encryption/ratchet.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/ratchet.js +223 -0
- package/vendor/microsoft-governance/dist/encryption/ratchet.js.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/registry-client.d.ts +136 -0
- package/vendor/microsoft-governance/dist/encryption/registry-client.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/registry-client.js +369 -0
- package/vendor/microsoft-governance/dist/encryption/registry-client.js.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/x3dh.d.ts +80 -0
- package/vendor/microsoft-governance/dist/encryption/x3dh.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/encryption/x3dh.js +238 -0
- package/vendor/microsoft-governance/dist/encryption/x3dh.js.map +1 -0
- package/vendor/microsoft-governance/dist/framework-adapter.d.ts +63 -0
- package/vendor/microsoft-governance/dist/framework-adapter.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/framework-adapter.js +253 -0
- package/vendor/microsoft-governance/dist/framework-adapter.js.map +1 -0
- package/vendor/microsoft-governance/dist/identity.d.ts +124 -0
- package/vendor/microsoft-governance/dist/identity.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/identity.js +446 -0
- package/vendor/microsoft-governance/dist/identity.js.map +1 -0
- package/vendor/microsoft-governance/dist/index.d.ts +39 -0
- package/vendor/microsoft-governance/dist/index.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/index.js +95 -0
- package/vendor/microsoft-governance/dist/index.js.map +1 -0
- package/vendor/microsoft-governance/dist/kill-switch.d.ts +22 -0
- package/vendor/microsoft-governance/dist/kill-switch.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/kill-switch.js +60 -0
- package/vendor/microsoft-governance/dist/kill-switch.js.map +1 -0
- package/vendor/microsoft-governance/dist/lifecycle.d.ts +50 -0
- package/vendor/microsoft-governance/dist/lifecycle.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/lifecycle.js +113 -0
- package/vendor/microsoft-governance/dist/lifecycle.js.map +1 -0
- package/vendor/microsoft-governance/dist/mcp.d.ts +41 -0
- package/vendor/microsoft-governance/dist/mcp.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/mcp.js +233 -0
- package/vendor/microsoft-governance/dist/mcp.js.map +1 -0
- package/vendor/microsoft-governance/dist/metrics.d.ts +123 -0
- package/vendor/microsoft-governance/dist/metrics.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/metrics.js +289 -0
- package/vendor/microsoft-governance/dist/metrics.js.map +1 -0
- package/vendor/microsoft-governance/dist/oci-manifest.d.ts +49 -0
- package/vendor/microsoft-governance/dist/oci-manifest.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/oci-manifest.js +182 -0
- package/vendor/microsoft-governance/dist/oci-manifest.js.map +1 -0
- package/vendor/microsoft-governance/dist/policy-backends/cedar.d.ts +15 -0
- package/vendor/microsoft-governance/dist/policy-backends/cedar.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/policy-backends/cedar.js +88 -0
- package/vendor/microsoft-governance/dist/policy-backends/cedar.js.map +1 -0
- package/vendor/microsoft-governance/dist/policy-backends/opa.d.ts +17 -0
- package/vendor/microsoft-governance/dist/policy-backends/opa.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/policy-backends/opa.js +74 -0
- package/vendor/microsoft-governance/dist/policy-backends/opa.js.map +1 -0
- package/vendor/microsoft-governance/dist/policy.d.ts +77 -0
- package/vendor/microsoft-governance/dist/policy.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/policy.js +760 -0
- package/vendor/microsoft-governance/dist/policy.js.map +1 -0
- package/vendor/microsoft-governance/dist/prompt-defense.d.ts +37 -0
- package/vendor/microsoft-governance/dist/prompt-defense.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/prompt-defense.js +229 -0
- package/vendor/microsoft-governance/dist/prompt-defense.js.map +1 -0
- package/vendor/microsoft-governance/dist/protocol-facets.d.ts +87 -0
- package/vendor/microsoft-governance/dist/protocol-facets.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/protocol-facets.js +728 -0
- package/vendor/microsoft-governance/dist/protocol-facets.js.map +1 -0
- package/vendor/microsoft-governance/dist/rings.d.ts +17 -0
- package/vendor/microsoft-governance/dist/rings.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/rings.js +61 -0
- package/vendor/microsoft-governance/dist/rings.js.map +1 -0
- package/vendor/microsoft-governance/dist/sandbox.d.ts +61 -0
- package/vendor/microsoft-governance/dist/sandbox.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/sandbox.js +199 -0
- package/vendor/microsoft-governance/dist/sandbox.js.map +1 -0
- package/vendor/microsoft-governance/dist/surface-parity.d.ts +45 -0
- package/vendor/microsoft-governance/dist/surface-parity.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/surface-parity.js +216 -0
- package/vendor/microsoft-governance/dist/surface-parity.js.map +1 -0
- package/vendor/microsoft-governance/dist/trust.d.ts +28 -0
- package/vendor/microsoft-governance/dist/trust.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/trust.js +209 -0
- package/vendor/microsoft-governance/dist/trust.js.map +1 -0
- package/vendor/microsoft-governance/dist/types.d.ts +422 -0
- package/vendor/microsoft-governance/dist/types.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/types.js +29 -0
- package/vendor/microsoft-governance/dist/types.js.map +1 -0
- package/vendor/microsoft-governance/dist/verify.d.ts +135 -0
- package/vendor/microsoft-governance/dist/verify.d.ts.map +1 -0
- package/vendor/microsoft-governance/dist/verify.js +356 -0
- package/vendor/microsoft-governance/dist/verify.js.map +1 -0
- package/vendor/microsoft-governance/package.json +64 -0
package/ARCHITECTURE.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Muxo Internal Architecture & Open-Source Ecosystem Blueprint
|
|
2
|
+
|
|
3
|
+
> **Purpose:** Definitive internal engineering guide on how to build Muxo cleanly, what external/open-source infrastructure to leverage, what legacy complexity from `muxoai` and `muxo2` to permanently drop, and how our four pillars (**Composio**, **Stripe Projects**, **Microsoft Agent Governance Toolkit**, and **Supermemory v5**) fit together.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Core Thesis: What Muxo Actually Is
|
|
8
|
+
|
|
9
|
+
Developers already have an agent harness (**Claude Code, Cursor, Factory Droid, OpenCode, Pi, Mastra, Vercel AI SDK, or Google ADK**). They do **not** want another mandatory chat window or proprietary agent framework.
|
|
10
|
+
|
|
11
|
+
**Muxo is the Unified Execution, Infrastructure, Memory, and Governance Boundary for existing agents.**
|
|
12
|
+
|
|
13
|
+
A customer connects their agent to **one Muxo MCP endpoint (`/mcp`)** with **one Muxo key (`mk_live_...`)**, and Muxo handles:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Agent (Claude / Cursor / Droid / Mastra / Pi / AI SDK)
|
|
17
|
+
│
|
|
18
|
+
▼
|
|
19
|
+
Muxo Gateway (app.muxo.ai / api.muxo.ai)
|
|
20
|
+
├─► 1. Microsoft Agent Governance Toolkit (@microsoft/agent-governance-sdk)
|
|
21
|
+
│ McpSecurityScanner ──► PolicyEngine ──► AgentIdentity (Ed25519 DID) ──► AuditLogger ──► DecisionRecord
|
|
22
|
+
│
|
|
23
|
+
├─► 2. Supermemory v5 Contextual Brain (supermemory SDK v5)
|
|
24
|
+
│ Workspace Profile (/ns/{ws}/profile) + Hybrid Recall (/ns/{ws}/search) + Post-Run Memory (/ns/{ws}/document)
|
|
25
|
+
│
|
|
26
|
+
├─► 3. Execution & Provisioning Lanes
|
|
27
|
+
│ ├─► Lane A: Composio Instant (instant.*) ──► Zero-OAuth tools (search, scrape, repo intel, HN, DNS)
|
|
28
|
+
│ ├─► Lane B: Composio SDK (app.*) ──► 500+ Managed OAuth SaaS tools (GitHub, Slack, Gmail, Linear...)
|
|
29
|
+
│ └─► Lane C: Stripe Projects (resource.*) ──► Live Cloud Infrastructure Provisioning + AES-256-GCM Secret Vault
|
|
30
|
+
│
|
|
31
|
+
└─► 4. Cryptographic Receipt & Prepaid Ledger
|
|
32
|
+
HMAC-SHA256 + Ed25519 Signed Receipt Chain + Stripe Checkout Credit Fulfillment
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 2. Ecosystem Evaluation: What to Use vs. What to Drop
|
|
38
|
+
|
|
39
|
+
Across `muxoai` (gen 1) and `muxo2` (gen 2, 203,443 LOC), the biggest mistake was rebuilding infrastructure that best-in-class open-source packages and managed APIs already solve. Here is our strict **Keep / Adopt / Drop** decision matrix:
|
|
40
|
+
|
|
41
|
+
| Layer / Candidate | Verdict | Why & How Muxo Uses It | What It Replaces from `muxoai` / `muxo2` |
|
|
42
|
+
| :--- | :--- | :--- | :--- |
|
|
43
|
+
| **Composio SDK & Tool Router** (`backend.composio.dev/api/v3`) | **ADOPT (Core Lane)** | Provides 500+ managed OAuth integrations (`app.*`), user-scoped Connect Links, and schema discovery without Muxo maintaining custom OAuth apps for every SaaS provider. | Replaces custom per-provider OAuth brokers and bespoke SaaS connectors. |
|
|
44
|
+
| **Composio Instant & `agents.composio.dev` Pattern** | **ADOPT (Core Lane + Onboarding)** | 1) Zero-setup `instant.*` tools work immediately on workspace creation.<br>2) We adopt the **`agents.composio.dev` 2-call autonomous signup pattern** (`POST /api/v1/agents/signup` + `POST /api/v1/agents/claim`) so an agent can self-provision a Muxo workspace in one HTTP call and later hand ownership over to its human via a claim slug. | Replaces complex multi-step human-only bootstrap ceremonies for CLI/agent onboarding. |
|
|
45
|
+
| **Stripe Projects CLI** (`stripe projects` v0.50.0) | **ADOPT (Core Lane — Node Runtime)** | Provisions real databases, caches, and cloud services (`neon/postgres`, `upstash/redis`, `turso`, `supabase`, `supermemory/memory`, etc.) and pulls credentials (`stripe projects env --pull`) into Muxo's AES-256-GCM vault. | Replaces `muxo2`'s broken 4-worker Cloudflare Container + mTLS bridge (`projects-gateway` + `projects-executor`). See Section 3 below. |
|
|
46
|
+
| **Microsoft Agent Governance Toolkit** (`@microsoft/agent-governance-sdk` v5.0.0) | **ADOPT (Core Governance)** | A 40 KB, zero-dependency, MIT-licensed SDK providing `McpSecurityScanner` (prompt-injection & exfiltration detection), `PolicyEngine` (YAML/JSON rules + risk gates), `AgentIdentity` (Ed25519 DIDs), and `AuditLogger` (SHA-256 tamper-evident hash chain). | Replaces **~18,000 LOC** of custom authority seals, custom policy DSLs, and hand-rolled audit chains in `muxo2`. |
|
|
47
|
+
| **Supermemory v5** (`supermemory` `^5.0.1`) | **ADOPT (Fail-Open Contextual Brain)** | Gives every Muxo workspace an isolated `/ns/muxo-v5-{hash}` brain with automatic `static` + `dynamic` profiles (`client.profile`), sub-50ms hybrid search (`client.search`), and governed post-run memory (`client.add`). Also natively deployable via Stripe Projects (`supermemory/memory`)! | Replaces **~25,000 LOC** of `muxoai/packages/brain` + Python `context-engine` (Graphiti + Neo4j + Vectorize + D1). |
|
|
48
|
+
| **Mastra (`@mastra/mcp`), Pi (`pi`), Vercel AI SDK (`ai`), Google ADK** | **CLIENT ECOSYSTEM (Do Not Bundle Inside Server)** | These are **agent harnesses** that *consume* Muxo over `/mcp` and `/skill.md`. Bundling an agent framework inside the Muxo server violates "Existing-Agent First" and bloats the runtime. Instead, `app.muxo.ai` and `muxo mcp-config` generate instant copy-paste connectors for Mastra, Pi, Vercel AI SDK, Claude Code, Cursor, and Factory Droid. | Drops `muxoai/packages/harness` (`@cloudflare/think` + custom chat UI) from the core execution server. |
|
|
49
|
+
| **Open-Source Monid** (`monid-upstream`) | **OPTIONAL / DEFER** | `muxoai` imported 413 Monid definitions, but 408 were unquoted and 69 had broken request/output hooks (`LEARNING.md` F10/F11). Composio Instant + Composio SDK + Stripe Projects already cover >95% of real developer tasks with live execution. | Drops 400+ unverified/quarantined static connector stubs and the Deno fixture bridge. |
|
|
50
|
+
| **Web Surfaces (`muxo.ai`, `docs.muxo.ai`, `app.muxo.ai`)** | **KEEP & UNIFY** | • **`muxo.ai`**: Existing Astro interactive provider-grid canvas (`web/`).<br>• **`docs.muxo.ai`**: Existing Mintlify deployment (`subdomain: muxo-ai`).<br>• **`app.muxo.ai`**: Built-in operator console in `muxo3` sharing the exact `muxo.ai` design tokens and navigation links. | Replaces 60,000+ LOC of duplicate SSR rendering in `muxo2/apps/console` and `muxo2/apps/web`. |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 3. Why Stripe Projects Provisioning Failed in `muxo2` — And Why It Works Live in `muxo3`
|
|
55
|
+
|
|
56
|
+
### Why `muxo2` Disabled Stripe Projects Provisioning
|
|
57
|
+
In `muxo2` (`projects-production-completion-plan.md`), the runtime was built on **Cloudflare Workers (V8 isolates)**. Because V8 isolates cannot spawn OS processes or run the native Go `stripe` CLI and `~/.stripe/plugins/apps/projects/0.50.0/stripe-projects-cli` binary:
|
|
58
|
+
1. `muxo2` tried to wrap the Stripe CLI inside a separate **Cloudflare Container (`apps/projects-executor`)** behind a second **Cloudflare Worker (`apps/projects-gateway`)** with custom CA fingerprint pinning, UID=0 root directory checks, and 55-second container cold-start budgets.
|
|
59
|
+
2. Inside the container, the `stripe-projects-cli` plugin was invoked directly without `PROJECTS_STANDALONE=1` or exceeded container memory/startup deadlines, resulting in `SIGKILL` and 9 consumed diagnostic attempts.
|
|
60
|
+
|
|
61
|
+
### Why It Works 100% Live in `muxo3`
|
|
62
|
+
In `muxo3` (`src/providers/stripe-projects.ts`):
|
|
63
|
+
1. **Native Node.js 22 Runtime:** `muxo3` runs as a standard Node.js 22 process (locally or in a standard persistent Linux container on Railway/Fly.io/Render) and invokes `/Users/test/.local/bin/stripe projects ... --json` directly via `node:child_process`.
|
|
64
|
+
2. **Automatic Companion Plan Resolution:** When a deployable service (like `neon/postgres`) returns `PLAN_REQUIRED`, `StripeProjectsAdapter.provisionResource()` automatically inspects the provider catalog, provisions the free/default plan (`neon/free`), and completes `neon/postgres` provisioning in one seamless transaction.
|
|
65
|
+
3. **Encrypted Vault Custody:** Immediately after provisioning, `StripeProjectsAdapter` runs `stripe projects env --pull`, captures the real credentials (e.g., `NEON_POSTGRES_CONNECTION_STRING`), encrypts them with **AES-256-GCM** using a per-workspace HKDF-derived key in `MuxoStore` (`src/store.ts`), and exposes them only via explicit owner-authenticated `muxo env pull` or `GET /api/v1/resources/env`.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 4. Detailed Architecture of the 4 Core Pillars in `muxo3`
|
|
70
|
+
|
|
71
|
+
### Pillar 1: Microsoft Agent Governance Toolkit (`src/providers/microsoft-governance.ts`)
|
|
72
|
+
|
|
73
|
+
Every call to `plan_action` and `execute_<risk>` passes through the Microsoft Agent Governance pipeline:
|
|
74
|
+
|
|
75
|
+
```mermaid
|
|
76
|
+
flowchart LR
|
|
77
|
+
A[Agent Tool Call] --> B[McpSecurityScanner]
|
|
78
|
+
B --> C[PolicyEngine]
|
|
79
|
+
C --> D[AgentIdentity Ed25519]
|
|
80
|
+
D --> E[AuditLogger Hash Chain]
|
|
81
|
+
E --> F[Signed DecisionRecord]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
1. **`McpSecurityScanner`:** Scans tool inputs and schemas for prompt injection (`ignore previous instructions`), shell injection, path traversal (`../`), and credential leaks before a plan is created.
|
|
85
|
+
2. **`PolicyEngine`:** Loads workspace governance rules (`allow` / `deny`, blocked tool patterns, risk-level approval gates, and `monitor` vs. `enforce` mode).
|
|
86
|
+
3. **`AgentIdentity`:** Mints a persistent Ed25519 cryptographic Decentralized Identifier (`did:agent:muxo:<workspaceSlug>`) per workspace and signs the canonical decision payload.
|
|
87
|
+
4. **`AuditLogger`:** Appends the decision to a SHA-256 hash chain (`previousHash ──► hash`), verifies chain integrity (`audit.verify()`), and embeds the resulting **`DecisionRecord`** inside the `ActionPlan` and `ExecutionReceipt`.
|
|
88
|
+
|
|
89
|
+
### Pillar 2: Supermemory v5 Contextual Brain (`src/providers/supermemory.ts`)
|
|
90
|
+
|
|
91
|
+
Supermemory v5 provides context-aware tool execution without turning Muxo into a heavyweight LLM host:
|
|
92
|
+
1. **Strict Namespace Isolation:** Every workspace maps to `muxo-v5-<sha256(workspaceId).slice(0, 24)>` (matching Supermemory v5's `^[a-zA-Z0-9_:-]+$` regex).
|
|
93
|
+
2. **Secret Redaction Guard:** Before any content is sent to `client.add()`, `SupermemoryAdapter.sanitizeContent()` strips bearer tokens, API keys (`sk_live_`, `mk_live_`, `sm_`, `ak_`), connection strings (`postgres://`, `redis://`), and `.env` assignments so secrets **never** leave the local AES-256-GCM vault.
|
|
94
|
+
3. **Context-Aware `plan_action` & `get_run_context`:**
|
|
95
|
+
- When an agent calls `get_run_context`, Muxo fetches `client.profile(namespace)` (returning `static` workspace facts and `dynamic` recent context) alongside active Stripe Projects resources.
|
|
96
|
+
- When an agent calls `plan_action({ toolSlug, input, reason })`, Muxo runs `client.search(namespace, { query: "${toolSlug} ${reason}", searchMode: "hybrid" })` and attaches top relevant workspace memories (`memoryContext`) to the plan response.
|
|
97
|
+
4. **Automatic Post-Execution Learning:** When a governed run finishes (`execute_<risk>`), Muxo records a sanitized execution summary (`taskType: "memory"`, `dreaming: true`) into the workspace's Supermemory namespace so future runs remember what infrastructure was provisioned and what actions succeeded.
|
|
98
|
+
|
|
99
|
+
### Pillar 3: Agent-First Autonomous Onboarding (`POST /api/v1/agents/signup`)
|
|
100
|
+
|
|
101
|
+
Inspired directly by `https://agents.composio.dev/`:
|
|
102
|
+
- **Call 1 (`POST /api/v1/agents/signup`):** An autonomous agent calls `/api/v1/agents/signup` with zero human interaction required. Muxo mints an isolated workspace (`amber-cedar-otter`), an Ed25519 Agent DID (`did:agent:muxo:amber-cedar-otter`), a scoped API key (`mk_live_...`), and a Supermemory v5 namespace, returning ready-to-use MCP configuration immediately.
|
|
103
|
+
- **Call 2 (`POST /api/v1/agents/claim` — Optional):** When the agent wants a human owner to take over the workspace (to approve `provisioning` / `financial` actions or top up Stripe credits), it calls `/api/v1/agents/claim` with `{ email }` and receives a single-use `claim_slug` URL for the human operator.
|
|
104
|
+
|
|
105
|
+
### Pillar 4: Unified Web Surfaces (`muxo.ai`, `docs.muxo.ai`, `app.muxo.ai`)
|
|
106
|
+
|
|
107
|
+
| Surface | Domain | Source Location | Role |
|
|
108
|
+
| :--- | :--- | :--- | :--- |
|
|
109
|
+
| **Marketing & Interactive Provider Canvas** | `muxo.ai` | `/Users/test/muxo3/web` (Astro) & built-in `GET /landing` | Interactive draggable grid of 60+ app & cloud providers with keyboard/search navigation (`Catalog.astro`). |
|
|
110
|
+
| **Documentation** | `docs.muxo.ai` | Mintlify (`subdomain: muxo-ai`) | Guides, 18 MCP operation reference, CLI & SDK quickstarts, and governance documentation. |
|
|
111
|
+
| **Operator Console & Runtime** | `app.muxo.ai` | `/Users/test/muxo3/src/ui/console-html.ts` (`GET /`) | Live workspace console for Catalog & Instant Try, Connected Apps, Stripe Projects Vault, Approvals & Receipts, **Supermemory Brain**, **Microsoft Agent Governance**, and **Stripe Billing**. |
|
package/README.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Muxo (`@muxoai/platform`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Muxo is a unified execution, cloud infrastructure provisioning, contextual memory, and cryptographic governance platform for AI agents and applications. Customers and their agents interact exclusively with **Muxo** — never with underlying tool or cloud infrastructure providers directly.
|
|
4
|
+
|
|
5
|
+
See [`ARCHITECTURE.md`](./ARCHITECTURE.md) for the complete internal engineering blueprint, open-source ecosystem Keep/Adopt/Drop matrix, and root-cause analysis of how `muxo3` resolves `muxo2`'s Cloudflare isolate/container failure modes.
|
|
6
|
+
|
|
7
|
+
Under the hood, Muxo unifies **four core pillars** behind one 18-operation MCP contract, REST API, CLI, and Web Console:
|
|
8
|
+
|
|
9
|
+
1. **Composio Connected Apps (`app.*`) & Instant (`instant.*`)** — Managed OAuth SaaS integrations (`app.github.*`, `app.gmail.*`, `app.slack.*`, `app.notion.*`, `app.linear.*`), zero-OAuth instant capabilities (`instant.web.search`, `instant.web.scrape`, `instant.hackernews.top_stories`, `instant.github.repo_intel`, `instant.dns.lookup`), plus **Autonomous 2-Call Agent Signup & Claim** (`POST /api/v1/agents/signup` + `POST /api/v1/agents/claim`).
|
|
10
|
+
2. **Stripe Projects Cloud Infrastructure (`resource.*`) + Stripe Billing** — Governed cloud resource provisioning across 60+ providers (`Neon`, `Supabase`, `Turso`, `Cloudflare`, `Vercel`, `Railway`, `Render`, `Prisma`, `PostHog`, etc.) with automatic `PLAN_REQUIRED` companion plan resolution, AES-256-GCM encrypted secret custody (`muxo env pull`), and live Stripe Checkout (`$29/mo Starter` & `$10 / +1,000 Credits`).
|
|
11
|
+
3. **Supermemory v5 Contextual Brain (`/ns/muxo-v5-*`)** — Isolated per-workspace long-term static facts, dynamic session context, and hybrid semantic search recalled before every tool plan (`plan_action` & `get_run_context`), with strict secret redaction before memory ingestion.
|
|
12
|
+
4. **Microsoft Agent Governance Toolkit (`@microsoft/agent-governance-sdk` v5.0.0)** — Every planned and executed operation passes through `Agent ──► McpSecurityScanner ──► PolicyEngine ──► AgentIdentity (Ed25519 DID) ──► AuditLogger (SHA-256 chain) ──► DecisionRecord`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Quickstart
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# 1. Build TypeScript
|
|
20
|
+
npm run build
|
|
21
|
+
|
|
22
|
+
# 2. Run the 9-Suite Live E2E Verification
|
|
23
|
+
npm test
|
|
24
|
+
|
|
25
|
+
# 3. Start the Muxo Server + app.muxo.ai Console (/) + muxo.ai Canvas (/landing) + MCP (/mcp)
|
|
26
|
+
npm start
|
|
27
|
+
|
|
28
|
+
# 4. Use the Muxo CLI
|
|
29
|
+
npm run cli -- whoami
|
|
30
|
+
npm run cli -- search postgres
|
|
31
|
+
npm run cli -- exec instant.hackernews.top_stories --input '{"limit":3}'
|
|
32
|
+
npm run cli -- env pull --out .env.muxo
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Architecture & Source Layout
|
|
36
|
+
|
|
37
|
+
| File / Directory | Responsibility |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `ARCHITECTURE.md` | Internal engineering blueprint, Keep/Adopt/Drop ecosystem matrix, and Stripe Projects analysis |
|
|
40
|
+
| `src/config.ts` | Environment & AES-256-GCM vault key derivation |
|
|
41
|
+
| `src/types.ts` | Core domain, Governance `DecisionRecord`, Supermemory `MemoryContextSummary`, & 18-tool MCP types |
|
|
42
|
+
| `src/store.ts` | SQLite (`node:sqlite`) store, AES-256-GCM secret vault, credit ledger, memories, agent claims, and HMAC-SHA256 receipt chain |
|
|
43
|
+
| `src/providers/composio-sdk.ts` | Live Composio v3 Connected Apps adapter (catalog search, OAuth sessions/links, tool execution) |
|
|
44
|
+
| `src/providers/composio-instant.ts` | Live Composio Instant zero-setup adapter |
|
|
45
|
+
| `src/providers/stripe-projects.ts` | Live Stripe Projects CLI bridge (`status`, `catalog`, `add`, `rotate`, `remove`, `env --pull`) |
|
|
46
|
+
| `src/providers/stripe-billing.ts` | Live Stripe Checkout billing (`$29/mo Starter Plan` & `$10 / +1,000 Credits Pack`) |
|
|
47
|
+
| `src/providers/microsoft-governance.ts` | Microsoft Agent Governance Toolkit v5.0.0 (`McpSecurityScanner`, `PolicyEngine`, `AgentIdentity` Ed25519 DID, `AuditLogger`) |
|
|
48
|
+
| `src/providers/supermemory.ts` | Supermemory v5 Contextual Brain (`profile`, hybrid `search`, secret-redacted `add`, `delete`) |
|
|
49
|
+
| `src/engine.ts` | Unified Governance, Memory & Execution Engine implementing all 18 canonical MCP operations |
|
|
50
|
+
| `src/mcp.ts` | JSON-RPC 2.0 MCP Server (Streamable HTTP `/mcp` + stdio `muxo mcp`) |
|
|
51
|
+
| `src/server.ts` | HTTP Gateway (`/api/v1/*`, `/mcp`, `/skill.md`, `/llms.txt`, `/landing`, `/claim/:slug`, `/health`, and `/`) |
|
|
52
|
+
| `src/ui/console-html.ts` | `app.muxo.ai` Operator Console UI + `/landing` (`muxo.ai` Provider Canvas) |
|
|
53
|
+
| `web/` | Standalone `muxo.ai` Astro marketing & interactive provider catalog site |
|
|
54
|
+
| `vendor/microsoft-governance/` | Vendored `@microsoft/agent-governance-sdk` v5.0.0 |
|
package/dist/cli.d.ts
ADDED