@muxoai/sdk 1.2.3 → 1.4.2

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.
Files changed (208) hide show
  1. package/.agents/plugins/marketplace.json +22 -0
  2. package/.claude-plugin/marketplace.json +32 -0
  3. package/.codex/config.toml +12 -0
  4. package/ARCHITECTURE.md +121 -0
  5. package/README.md +85 -31
  6. package/dist/clerk.d.ts +35 -0
  7. package/dist/clerk.js +201 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +2380 -0
  10. package/dist/composio-catalog.d.ts +234 -0
  11. package/dist/composio-catalog.js +1894 -0
  12. package/dist/config.d.ts +36 -0
  13. package/dist/config.js +115 -0
  14. package/dist/durable-workflow.d.ts +45 -0
  15. package/dist/durable-workflow.js +90 -0
  16. package/dist/engine.d.ts +465 -0
  17. package/dist/engine.js +2560 -0
  18. package/dist/index.d.ts +7 -0
  19. package/dist/index.js +7 -0
  20. package/dist/mcp-schema.d.ts +286 -0
  21. package/dist/mcp-schema.js +2559 -0
  22. package/dist/mcp.d.ts +22 -0
  23. package/dist/mcp.js +1356 -0
  24. package/dist/memory-graph.d.ts +21 -0
  25. package/dist/memory-graph.js +173 -0
  26. package/dist/nl.d.ts +34 -0
  27. package/dist/nl.js +756 -0
  28. package/dist/oauth.d.ts +32 -0
  29. package/dist/oauth.js +134 -0
  30. package/dist/policy.d.ts +190 -0
  31. package/dist/policy.js +1597 -0
  32. package/dist/providers/composio-instant.d.ts +18 -0
  33. package/dist/providers/composio-instant.js +1169 -0
  34. package/dist/providers/composio-sdk.d.ts +162 -0
  35. package/dist/providers/composio-sdk.js +1395 -0
  36. package/dist/providers/microsoft-governance.d.ts +152 -0
  37. package/dist/providers/microsoft-governance.js +1062 -0
  38. package/dist/providers/stripe-billing.d.ts +83 -0
  39. package/dist/providers/stripe-billing.js +611 -0
  40. package/dist/providers/stripe-projects.d.ts +508 -0
  41. package/dist/providers/stripe-projects.js +3188 -0
  42. package/dist/providers/supermemory.d.ts +160 -0
  43. package/dist/providers/supermemory.js +778 -0
  44. package/dist/provisioning-managed.d.ts +50 -0
  45. package/dist/provisioning-managed.js +155 -0
  46. package/dist/sdk.d.ts +951 -0
  47. package/dist/sdk.js +748 -0
  48. package/dist/server.d.ts +10 -0
  49. package/dist/server.js +3575 -0
  50. package/dist/store.d.ts +348 -0
  51. package/dist/store.js +2323 -0
  52. package/dist/types.d.ts +593 -0
  53. package/dist/types.js +1 -0
  54. package/dist/ui/console-html.d.ts +64 -0
  55. package/dist/ui/console-html.js +3857 -0
  56. package/dist/ui/design-tokens.d.ts +177 -0
  57. package/dist/ui/design-tokens.js +210 -0
  58. package/dist/version.d.ts +1 -0
  59. package/dist/version.js +1 -0
  60. package/package.json +68 -7
  61. package/plugins/muxo/.app.json +8 -0
  62. package/plugins/muxo/.claude-plugin/plugin.json +16 -0
  63. package/plugins/muxo/.codex-plugin/plugin.json +64 -0
  64. package/plugins/muxo/.cursor-plugin/plugin.json +30 -0
  65. package/plugins/muxo/.mcp.json +8 -0
  66. package/plugins/muxo/assets/logo.png +0 -0
  67. package/plugins/muxo/assets/logo.svg +6 -0
  68. package/plugins/muxo/hooks/hooks.json +27 -0
  69. package/plugins/muxo/hooks/session-start.sh +97 -0
  70. package/plugins/muxo/hooks/user-prompt-submit.sh +58 -0
  71. package/plugins/muxo/mcp.json +28 -0
  72. package/plugins/muxo/plugin.json +116 -0
  73. package/plugins/muxo/skills/muxo/SKILL.md +153 -0
  74. package/plugins/muxo/skills/muxo/agents/openai.yaml +12 -0
  75. package/plugins/muxo/skills/muxo/references/cli.md +63 -0
  76. package/plugins/muxo/skills/muxo/references/mcp.md +37 -0
  77. package/plugins/muxo/skills/muxo-activity-summary/SKILL.md +81 -0
  78. package/plugins/muxo/skills/setup/SKILL.md +42 -0
  79. package/plugins/muxo/skills/setup/agents/openai.yaml +12 -0
  80. package/src/catalogues/stripe-projects-catalog.json +9972 -0
  81. package/vendor/microsoft-governance/README.md +363 -0
  82. package/vendor/microsoft-governance/dist/audit.d.ts +26 -0
  83. package/vendor/microsoft-governance/dist/audit.d.ts.map +1 -0
  84. package/vendor/microsoft-governance/dist/audit.js +107 -0
  85. package/vendor/microsoft-governance/dist/audit.js.map +1 -0
  86. package/vendor/microsoft-governance/dist/cascade-containment.d.ts +84 -0
  87. package/vendor/microsoft-governance/dist/cascade-containment.d.ts.map +1 -0
  88. package/vendor/microsoft-governance/dist/cascade-containment.js +387 -0
  89. package/vendor/microsoft-governance/dist/cascade-containment.js.map +1 -0
  90. package/vendor/microsoft-governance/dist/client.d.ts +34 -0
  91. package/vendor/microsoft-governance/dist/client.d.ts.map +1 -0
  92. package/vendor/microsoft-governance/dist/client.js +112 -0
  93. package/vendor/microsoft-governance/dist/client.js.map +1 -0
  94. package/vendor/microsoft-governance/dist/context-poisoning.d.ts +58 -0
  95. package/vendor/microsoft-governance/dist/context-poisoning.d.ts.map +1 -0
  96. package/vendor/microsoft-governance/dist/context-poisoning.js +410 -0
  97. package/vendor/microsoft-governance/dist/context-poisoning.js.map +1 -0
  98. package/vendor/microsoft-governance/dist/credential-vault.d.ts +213 -0
  99. package/vendor/microsoft-governance/dist/credential-vault.d.ts.map +1 -0
  100. package/vendor/microsoft-governance/dist/credential-vault.js +567 -0
  101. package/vendor/microsoft-governance/dist/credential-vault.js.map +1 -0
  102. package/vendor/microsoft-governance/dist/discovery.d.ts +80 -0
  103. package/vendor/microsoft-governance/dist/discovery.d.ts.map +1 -0
  104. package/vendor/microsoft-governance/dist/discovery.js +404 -0
  105. package/vendor/microsoft-governance/dist/discovery.js.map +1 -0
  106. package/vendor/microsoft-governance/dist/encryption/channel.d.ts +29 -0
  107. package/vendor/microsoft-governance/dist/encryption/channel.d.ts.map +1 -0
  108. package/vendor/microsoft-governance/dist/encryption/channel.js +78 -0
  109. package/vendor/microsoft-governance/dist/encryption/channel.js.map +1 -0
  110. package/vendor/microsoft-governance/dist/encryption/index.d.ts +9 -0
  111. package/vendor/microsoft-governance/dist/encryption/index.d.ts.map +1 -0
  112. package/vendor/microsoft-governance/dist/encryption/index.js +23 -0
  113. package/vendor/microsoft-governance/dist/encryption/index.js.map +1 -0
  114. package/vendor/microsoft-governance/dist/encryption/mesh-client.d.ts +267 -0
  115. package/vendor/microsoft-governance/dist/encryption/mesh-client.d.ts.map +1 -0
  116. package/vendor/microsoft-governance/dist/encryption/mesh-client.js +1001 -0
  117. package/vendor/microsoft-governance/dist/encryption/mesh-client.js.map +1 -0
  118. package/vendor/microsoft-governance/dist/encryption/ratchet.d.ts +38 -0
  119. package/vendor/microsoft-governance/dist/encryption/ratchet.d.ts.map +1 -0
  120. package/vendor/microsoft-governance/dist/encryption/ratchet.js +223 -0
  121. package/vendor/microsoft-governance/dist/encryption/ratchet.js.map +1 -0
  122. package/vendor/microsoft-governance/dist/encryption/registry-client.d.ts +136 -0
  123. package/vendor/microsoft-governance/dist/encryption/registry-client.d.ts.map +1 -0
  124. package/vendor/microsoft-governance/dist/encryption/registry-client.js +369 -0
  125. package/vendor/microsoft-governance/dist/encryption/registry-client.js.map +1 -0
  126. package/vendor/microsoft-governance/dist/encryption/x3dh.d.ts +80 -0
  127. package/vendor/microsoft-governance/dist/encryption/x3dh.d.ts.map +1 -0
  128. package/vendor/microsoft-governance/dist/encryption/x3dh.js +238 -0
  129. package/vendor/microsoft-governance/dist/encryption/x3dh.js.map +1 -0
  130. package/vendor/microsoft-governance/dist/framework-adapter.d.ts +63 -0
  131. package/vendor/microsoft-governance/dist/framework-adapter.d.ts.map +1 -0
  132. package/vendor/microsoft-governance/dist/framework-adapter.js +253 -0
  133. package/vendor/microsoft-governance/dist/framework-adapter.js.map +1 -0
  134. package/vendor/microsoft-governance/dist/identity.d.ts +124 -0
  135. package/vendor/microsoft-governance/dist/identity.d.ts.map +1 -0
  136. package/vendor/microsoft-governance/dist/identity.js +446 -0
  137. package/vendor/microsoft-governance/dist/identity.js.map +1 -0
  138. package/vendor/microsoft-governance/dist/index.d.ts +39 -0
  139. package/vendor/microsoft-governance/dist/index.d.ts.map +1 -0
  140. package/vendor/microsoft-governance/dist/index.js +95 -0
  141. package/vendor/microsoft-governance/dist/index.js.map +1 -0
  142. package/vendor/microsoft-governance/dist/kill-switch.d.ts +22 -0
  143. package/vendor/microsoft-governance/dist/kill-switch.d.ts.map +1 -0
  144. package/vendor/microsoft-governance/dist/kill-switch.js +60 -0
  145. package/vendor/microsoft-governance/dist/kill-switch.js.map +1 -0
  146. package/vendor/microsoft-governance/dist/lifecycle.d.ts +50 -0
  147. package/vendor/microsoft-governance/dist/lifecycle.d.ts.map +1 -0
  148. package/vendor/microsoft-governance/dist/lifecycle.js +113 -0
  149. package/vendor/microsoft-governance/dist/lifecycle.js.map +1 -0
  150. package/vendor/microsoft-governance/dist/mcp.d.ts +41 -0
  151. package/vendor/microsoft-governance/dist/mcp.d.ts.map +1 -0
  152. package/vendor/microsoft-governance/dist/mcp.js +233 -0
  153. package/vendor/microsoft-governance/dist/mcp.js.map +1 -0
  154. package/vendor/microsoft-governance/dist/metrics.d.ts +123 -0
  155. package/vendor/microsoft-governance/dist/metrics.d.ts.map +1 -0
  156. package/vendor/microsoft-governance/dist/metrics.js +289 -0
  157. package/vendor/microsoft-governance/dist/metrics.js.map +1 -0
  158. package/vendor/microsoft-governance/dist/oci-manifest.d.ts +49 -0
  159. package/vendor/microsoft-governance/dist/oci-manifest.d.ts.map +1 -0
  160. package/vendor/microsoft-governance/dist/oci-manifest.js +182 -0
  161. package/vendor/microsoft-governance/dist/oci-manifest.js.map +1 -0
  162. package/vendor/microsoft-governance/dist/policy-backends/cedar.d.ts +15 -0
  163. package/vendor/microsoft-governance/dist/policy-backends/cedar.d.ts.map +1 -0
  164. package/vendor/microsoft-governance/dist/policy-backends/cedar.js +88 -0
  165. package/vendor/microsoft-governance/dist/policy-backends/cedar.js.map +1 -0
  166. package/vendor/microsoft-governance/dist/policy-backends/opa.d.ts +17 -0
  167. package/vendor/microsoft-governance/dist/policy-backends/opa.d.ts.map +1 -0
  168. package/vendor/microsoft-governance/dist/policy-backends/opa.js +74 -0
  169. package/vendor/microsoft-governance/dist/policy-backends/opa.js.map +1 -0
  170. package/vendor/microsoft-governance/dist/policy.d.ts +77 -0
  171. package/vendor/microsoft-governance/dist/policy.d.ts.map +1 -0
  172. package/vendor/microsoft-governance/dist/policy.js +760 -0
  173. package/vendor/microsoft-governance/dist/policy.js.map +1 -0
  174. package/vendor/microsoft-governance/dist/prompt-defense.d.ts +37 -0
  175. package/vendor/microsoft-governance/dist/prompt-defense.d.ts.map +1 -0
  176. package/vendor/microsoft-governance/dist/prompt-defense.js +229 -0
  177. package/vendor/microsoft-governance/dist/prompt-defense.js.map +1 -0
  178. package/vendor/microsoft-governance/dist/protocol-facets.d.ts +87 -0
  179. package/vendor/microsoft-governance/dist/protocol-facets.d.ts.map +1 -0
  180. package/vendor/microsoft-governance/dist/protocol-facets.js +728 -0
  181. package/vendor/microsoft-governance/dist/protocol-facets.js.map +1 -0
  182. package/vendor/microsoft-governance/dist/rings.d.ts +17 -0
  183. package/vendor/microsoft-governance/dist/rings.d.ts.map +1 -0
  184. package/vendor/microsoft-governance/dist/rings.js +61 -0
  185. package/vendor/microsoft-governance/dist/rings.js.map +1 -0
  186. package/vendor/microsoft-governance/dist/sandbox.d.ts +61 -0
  187. package/vendor/microsoft-governance/dist/sandbox.d.ts.map +1 -0
  188. package/vendor/microsoft-governance/dist/sandbox.js +199 -0
  189. package/vendor/microsoft-governance/dist/sandbox.js.map +1 -0
  190. package/vendor/microsoft-governance/dist/surface-parity.d.ts +45 -0
  191. package/vendor/microsoft-governance/dist/surface-parity.d.ts.map +1 -0
  192. package/vendor/microsoft-governance/dist/surface-parity.js +216 -0
  193. package/vendor/microsoft-governance/dist/surface-parity.js.map +1 -0
  194. package/vendor/microsoft-governance/dist/trust.d.ts +28 -0
  195. package/vendor/microsoft-governance/dist/trust.d.ts.map +1 -0
  196. package/vendor/microsoft-governance/dist/trust.js +209 -0
  197. package/vendor/microsoft-governance/dist/trust.js.map +1 -0
  198. package/vendor/microsoft-governance/dist/types.d.ts +422 -0
  199. package/vendor/microsoft-governance/dist/types.d.ts.map +1 -0
  200. package/vendor/microsoft-governance/dist/types.js +29 -0
  201. package/vendor/microsoft-governance/dist/types.js.map +1 -0
  202. package/vendor/microsoft-governance/dist/verify.d.ts +135 -0
  203. package/vendor/microsoft-governance/dist/verify.d.ts.map +1 -0
  204. package/vendor/microsoft-governance/dist/verify.js +356 -0
  205. package/vendor/microsoft-governance/dist/verify.js.map +1 -0
  206. package/vendor/microsoft-governance/package.json +64 -0
  207. package/index.d.ts +0 -177
  208. package/index.js +0 -1
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "muxo",
3
+ "interface": {
4
+ "displayName": "Muxo Plugins"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "muxo",
9
+ "version": "1.4.2",
10
+ "description": "Governed execution across 1,000+ Connected Apps, Instant Tools (search, scrape, crawl, SEO audit), Cloud Infrastructure provisioning, Workspace Memory recall, and cryptographic execution receipts.",
11
+ "source": {
12
+ "source": "local",
13
+ "path": "./plugins/muxo"
14
+ },
15
+ "policy": {
16
+ "installation": "AVAILABLE",
17
+ "authentication": "ON_USE"
18
+ },
19
+ "category": "Productivity"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "muxo",
3
+ "description": "Official Muxo plugin marketplace for governed execution across Connected Apps, Instant Tools, Cloud Infrastructure, and Workspace Memory.",
4
+ "owner": {
5
+ "name": "Muxo",
6
+ "email": "founders@muxo.ai",
7
+ "url": "https://muxo.ai"
8
+ },
9
+ "metadata": {
10
+ "description": "Official Muxo plugin marketplace for governed execution across Connected Apps, Instant Tools, Cloud Infrastructure, and Workspace Memory.",
11
+ "version": "1.4.2"
12
+ },
13
+ "plugins": [
14
+ {
15
+ "name": "muxo",
16
+ "source": {
17
+ "source": "npm",
18
+ "package": "@muxoai/cli"
19
+ },
20
+ "strict": false,
21
+ "description": "Governed execution across 1,000+ Connected Apps, Instant Tools (search, scrape, crawl, SEO audit), Cloud Infrastructure provisioning, Workspace Memory recall, and verifiable audit records.",
22
+ "version": "1.4.2",
23
+ "category": "Productivity",
24
+ "skills": [
25
+ "./plugins/muxo/skills/muxo",
26
+ "./plugins/muxo/skills/setup"
27
+ ],
28
+ "hooks": "./plugins/muxo/hooks/hooks.json",
29
+ "mcpServers": "./plugins/muxo/.mcp.json"
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,12 @@
1
+ # OpenAI Codex Configuration for Muxo
2
+ # Reference: https://developers.openai.com/codex/plugins
3
+
4
+ [plugins."muxo@muxo"]
5
+ enabled = true
6
+
7
+ # TOML MCP Alternative (~/.codex/config.toml):
8
+ [mcp_servers.muxo]
9
+ url = "https://api.muxo.ai/mcp"
10
+ # Or for local stdio proxy (requires Node.js 22+):
11
+ # command = "npx"
12
+ # args = ["-y", "@muxoai/cli@latest", "mcp"]
@@ -0,0 +1,121 @@
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 v2 Provisioning REST API & CLI** (`https://api.stripe.com/v2/provisioning/*`, `Stripe-Version: 2026-09-30.preview` + `stripe projects` v0.50.0) | **ADOPT (Core Lane — HTTP v2 + Node Runtime)** | Provisions real databases, caches, and cloud services (`neon/postgres`, `upstash/redis`, `turso`, `supabase`, `supermemory/memory`, etc.) directly over HTTP via `POST /v2/provisioning/resources` and reveals secrets via `POST /v2/provisioning/resources/:id/reveal_access_configuration` (with automatic CLI/managed fallback) into Muxo's AES-256-GCM vault. Works natively in both Node.js and Cloudflare Workers V8 isolates! | 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` (Native Stripe v2 Provisioning HTTP API + CLI)
62
+ In `muxo3` (`src/providers/stripe-projects.ts` and `worker/index.ts`), we integrate Stripe's gated **v2 Provisioning REST API** (`https://api.stripe.com/v2/provisioning/*` with header `Stripe-Version: 2026-09-30.preview`) alongside the local CLI:
63
+ 1. **Direct Stripe v2 Provisioning HTTP REST Client (Zero Container Required, V8 Isolate Ready):** Both `StripeProjectsAdapter` (Node.js) and `worker/index.ts` (Cloudflare Workers) call Stripe's `/v2/provisioning/*` REST endpoints directly over HTTPS using `Authorization: Bearer <sk_live_...|rk_live_...>` and `Stripe-Version: 2026-09-30.preview`:
64
+ - **Eligibilities:** `GET /v2/provisioning/eligibility` (`v2.provisioning.eligibility`)
65
+ - **Catalog Providers:** `GET /v2/provisioning/catalog/providers` (`v2.provisioning.provider`)
66
+ - **Catalog Service Details:** `GET /v2/provisioning/catalog/services` (`v2.provisioning.provider_service_detail`)
67
+ - **Payment Profiles & Spend Limits:** `GET /v2/provisioning/payment_profile` & `POST /v2/provisioning/payment_profile/update_limit` (`v2.provisioning.payment_profile`)
68
+ - **Payment Method Requests:** `POST /v2/provisioning/payment_method_requests` (`v2.provisioning.payment_method_request`)
69
+ - **Projects:** `POST /v2/provisioning/projects` (`v2.provisioning.project`)
70
+ - **Provider Connections:** `GET /v2/provisioning/provider_connections` & `POST /v2/provisioning/provider_connections/:id/unlink` (`v2.provisioning.provider_connection`)
71
+ - **Provider Connection Requests:** `POST /v2/provisioning/provider_connection_requests`, `GET /v2/provisioning/provider_connection_requests/:id`, & `POST /v2/provisioning/provider_connection_requests/:id/submit_information` (`v2.provisioning.provider_connection_request`)
72
+ - **Resources:** `POST /v2/provisioning/resources`, `POST /v2/provisioning/resources/link`, `GET /v2/provisioning/resources/:id`, `POST /v2/provisioning/resources/:id`, `POST /v2/provisioning/resources/:id/remove`, `POST /v2/provisioning/resources/:id/unlink`, `POST /v2/provisioning/resources/:id/rotate_credentials`, & `POST /v2/provisioning/resources/:id/submit_information` (`v2.provisioning.resource`)
73
+ - **Access Configurations (Secret Reveal):** `POST /v2/provisioning/resources/:id/reveal_access_configuration` (`v2.provisioning.resource.access_configuration` returning `{ configuration: Record<string, string>, expires_at }`)
74
+ 2. **Automatic Multi-Tier Fallback:** If the Stripe key does not yet have the `2026-09-30.preview` gate enabled, `StripeProjectsAdapter` transparently falls back to the local `stripe projects` CLI (when a `.projects` directory is present) or Muxo Cloud Managed Infrastructure.
75
+ 3. **Encrypted Vault Custody:** Immediately after `POST /v2/provisioning/resources` and `POST /v2/provisioning/resources/:id/reveal_access_configuration` (or `stripe projects env --pull`), `StripeProjectsAdapter` encrypts the returned credentials with **AES-256-GCM** using a per-workspace HKDF-derived key in `MuxoStore` (`src/store.ts`), exposing them only via owner-authenticated `muxo env pull`, `GET /api/v1/resources/env`, or `POST /api/v1/provisioning/resources/:id/reveal_access_configuration`.
76
+
77
+ ---
78
+
79
+ ## 4. Detailed Architecture of the 4 Core Pillars in `muxo3`
80
+
81
+ ### Pillar 1: Microsoft Agent Governance Toolkit (`src/providers/microsoft-governance.ts`)
82
+
83
+ Every call to `plan_action` and `execute_<risk>` passes through the Microsoft Agent Governance pipeline:
84
+
85
+ ```mermaid
86
+ flowchart LR
87
+ A[Agent Tool Call] --> B[McpSecurityScanner]
88
+ B --> C[PolicyEngine]
89
+ C --> D[AgentIdentity Ed25519]
90
+ D --> E[AuditLogger Hash Chain]
91
+ E --> F[Signed DecisionRecord]
92
+ ```
93
+
94
+ 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.
95
+ 2. **`PolicyEngine`:** Loads workspace governance rules (`allow` / `deny`, blocked tool patterns, risk-level approval gates, and `monitor` vs. `enforce` mode).
96
+ 3. **`AgentIdentity`:** Mints a persistent Ed25519 cryptographic Decentralized Identifier (`did:agent:muxo:<workspaceSlug>`) per workspace and signs the canonical decision payload.
97
+ 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`.
98
+
99
+ ### Pillar 2: Supermemory v5 Contextual Brain (`src/providers/supermemory.ts`)
100
+
101
+ Supermemory v5 provides context-aware tool execution without turning Muxo into a heavyweight LLM host:
102
+ 1. **Strict Namespace Isolation:** Every workspace maps to `muxo-v5-<sha256(workspaceId).slice(0, 24)>` (matching Supermemory v5's `^[a-zA-Z0-9_:-]+$` regex).
103
+ 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.
104
+ 3. **Context-Aware `plan_action` & `get_run_context`:**
105
+ - 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.
106
+ - 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.
107
+ 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.
108
+
109
+ ### Pillar 3: Agent-First Autonomous Onboarding (`POST /api/v1/agents/signup`)
110
+
111
+ Inspired directly by `https://agents.composio.dev/`:
112
+ - **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.
113
+ - **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.
114
+
115
+ ### Pillar 4: Unified Web Surfaces (`muxo.ai`, `docs.muxo.ai`, `app.muxo.ai`)
116
+
117
+ | Surface | Domain | Source Location | Role |
118
+ | :--- | :--- | :--- | :--- |
119
+ | **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`). |
120
+ | **Documentation** | `docs.muxo.ai` | Mintlify (`subdomain: muxo-ai`) | Guides, 18 MCP operation reference, CLI & SDK quickstarts, and governance documentation. |
121
+ | **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,53 +1,107 @@
1
1
  # Muxo (`@muxoai/platform` / `@muxoai/cli` / `@muxoai/sdk`)
2
2
 
3
- Muxo (`v1.2.3`) is the 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.
3
+ Muxo (`v1.4.2`) is the unified execution, cloud infrastructure provisioning, contextual memory, and cryptographic governance platform for AI agents and applications. Customers and their agents interact exclusively with **Muxo** — either via structured tool slugs or free-form **Natural Language** (`muxo do`, `POST /api/v1/do`, `client.do()`, and MCP `plan_action`).
4
4
 
5
5
  See [`ARCHITECTURE.md`](./ARCHITECTURE.md) for the complete internal engineering blueprint, open-source ecosystem Keep/Adopt/Drop matrix, and 4-pillar architecture.
6
6
 
7
- Under the hood, Muxo unifies **four core pillars** behind one **19-operation MCP contract**, OpenAI Plugin (`agent-plugins.org/1.0.0`), REST API, CLI (`@muxoai/cli`), TypeScript SDK (`@muxoai/sdk`), and Web Console (`https://app.muxo.ai`):
7
+ Under the hood, Muxo unifies **four core pillars** plus **Natural Language Routing** and **BYOK (Bring Your Own Key) 0-Credit Execution** behind one **19-operation MCP contract**, OpenAI Plugin (`agent-plugins.org/1.0.0`), REST API, Interactive CLI/TUI (`@muxoai/cli`), TypeScript SDK (`@muxoai/sdk`), and Web Console (`https://app.muxo.ai`):
8
8
 
9
- 1. **Composio Connected Apps (`app.*`) & Instant (`instant.*`)** — Managed OAuth SaaS integrations (`app.github.*`, `app.gmail.*`, `app.slack.*`, `app.notion.*`, `app.linear.*`) with live browser OAuth handoff (`wait_for_connection`), zero-OAuth instant capabilities (`instant.web.search`, `instant.web.scrape`, `instant.web.crawl`, `instant.seo.audit`, `instant.hackernews.top_stories`, `instant.github.repo_intel`, `instant.dns.lookup`, `instant.composio.workbench`), plus **Autonomous 2-Call Agent Signup & Claim** (`POST /api/v1/agents/signup` + `POST /api/v1/agents/claim`).
10
- 2. **Stripe Projects Cloud Infrastructure (`resource.*`) + Merchant-of-Record Billing (`muxo_funded`)** — Governed cloud resource provisioning across 60+ providers (`Turso`, `Neon`, `Supabase`, `Cloudflare`, `Vercel`, `Upstash`, `Resend`, `Railway`, `Render`, etc.) with automatic companion plan resolution, AES-256-GCM encrypted secret custody (`muxo env pull`), and unified credit settlement where users purchase Muxo credits and Muxo settles supplier costs from its master accounts.
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` and produces an HMAC-SHA256 verifiable receipt.
9
+ 1. **Connected Apps (`app.*`) & Instant Tools (`instant.*`)** — Managed OAuth SaaS integrations (`app.github.*`, `app.gmail.*`, `app.slack.*`, `app.notion.*`, `app.linear.*`) with live browser OAuth handoff (`wait_for_connection`), zero-OAuth instant capabilities (`instant.web.search`, `instant.web.scrape`, `instant.web.crawl`, `instant.seo.audit`, `instant.hackernews.top_stories`, `instant.github.repo_intel`, `instant.dns.lookup`, `instant.composio.workbench`), plus **CLI-first Autonomous 2-Call Agent Signup & Claim** (`POST /api/v1/agents/signup` + `POST /api/v1/agents/claim`).
10
+ 2. **Cloud Infrastructure (`resource.*`) + Unified Credit Billing (`muxo_funded`) & BYOK (`byok`)** — Governed cloud resource provisioning across 60+ providers (`Turso`, `Neon`, `Supabase`, `Cloudflare`, `Vercel`, `Upstash`, `Resend`, `Railway`, `Render`, etc.) with automatic companion plan resolution, AES-256-GCM encrypted secret custody (`muxo env pull`), unified credit settlement (`muxo_funded`), and **0-credit BYOK mode** (`muxo byok set <provider>`) when you bring your own supplier or LLM API keys.
11
+ 3. **Workspace Memory (`/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. **Safety & Approvals (Muxo Guardrails)** — Every planned and executed operation passes through prompt-injection security scanning, workspace policy evaluation, cryptographic agent identity (`did:agent:muxo:*`), and produces a verifiable execution audit record.
13
13
 
14
14
  ---
15
15
 
16
- ## Install & Quickstart (External Users & Agents)
16
+ ## Install & Quickstart (Humans, Harnesses & Agents)
17
+
18
+ > **Requirement:** `@muxoai/cli` requires **Node.js 22+** (`node >= 22.0.0`).
17
19
 
18
20
  ```bash
19
- # 1. Install the Muxo CLI or run directly via npx
21
+ # 1. Install the Muxo CLI or run directly via npx (requires Node.js 22+)
20
22
  npm install -g @muxoai/cli@latest
21
23
 
22
- # 2. Zero-browser autonomous signup (creates ~/.muxo/config.json with mk_live_* key + 250 starter credits)
24
+ # 2. CLI-first autonomous signup against the hosted workspace (creates ~/.muxo/config.json with mk_live_* key + 250 starter credits)
23
25
  muxo login --signup --name "my-agent"
24
26
 
25
- # 3. Verify workspace, governance DID, and credit balance
26
- muxo whoami
27
+ # 3. Launch the Interactive Terminal TUI (Natural Language bar, BYOK Vault, Billing & Status)
28
+ muxo tui
27
29
 
28
- # 4. Run zero-OAuth Instant Tools (Crawl, SEO Audit, DNS, Web Search)
29
- muxo exec instant.seo.audit --input '{"url":"https://muxo.ai","keywords":["muxo","agent","governance"]}'
30
- muxo exec instant.web.crawl --input '{"url":"https://muxo.ai","maxPages":3}'
30
+ # 4. Run tools in plain English via the Natural Language Router
31
+ muxo do "check dns A records for muxo.ai"
32
+ muxo do "get top 5 hacker news stories"
33
+ muxo do "audit seo for https://muxo.ai"
31
34
 
32
- # 5. Connect an OAuth SaaS App (Gmail, GitHub, Slack, Notion, Linear)
33
- muxo link gmail --wait
35
+ # 5. Bring Your Own Key (BYOK) for LLM routing or 0-credit supplier execution
36
+ muxo byok set openai # Interactive hidden/line prompt if key omitted
37
+ muxo byok set composio # Executes app.* and instant.* tools at 0 Muxo credit cost
38
+ muxo byok list
34
39
 
35
- # 6. Provision Live Cloud Infrastructure (Turso, Neon, Supabase, Upstash) & Pull Encrypted Secrets
40
+ # 6. Manage Billing, Credits & Plans (Starter $29/mo, Pro $99/mo, yearly 2 months free)
41
+ muxo billing status
42
+ muxo billing plans
43
+ muxo billing topup 1000
44
+ muxo billing upgrade --plan pro --yearly
45
+ muxo billing portal
46
+
47
+ # 7. Connect an OAuth SaaS App (browser consent handoff) & Provision Live Cloud Infrastructure
48
+ muxo link gmail --wait
36
49
  muxo provision turso --input '{"database_name":"my-agent-db"}' --approve
37
50
  muxo env pull --out .env.muxo
38
- ```
39
-
40
- ## Official OpenAI Plugin & MCP Server (`https://api.muxo.ai/mcp`)
41
51
 
42
- Muxo ships a portable OpenAI Plugin (`plugins/muxo/plugin.json` & `plugins/muxo/mcp.json`) and Streamable HTTP MCP Server compliant with [OpenAI Plugins](https://developers.openai.com/plugins/build/plugins) and [OpenAI MCP Server](https://developers.openai.com/plugins/build/mcp-server) specifications:
43
-
44
- - **Streamable HTTP MCP Endpoint**: `https://api.muxo.ai/mcp` (and `https://app.muxo.ai/mcp`)
45
- - **Local Stdio MCP Command**: `npx -y @muxoai/cli@latest mcp`
46
- - **OAuth 2.1 Discovery & DCR/PKCE**:
47
- - `https://api.muxo.ai/.well-known/oauth-protected-resource/mcp` (RFC 9728)
48
- - `https://api.muxo.ai/.well-known/oauth-authorization-server` (RFC 8414)
49
- - `POST https://api.muxo.ai/oauth/register` (Dynamic Client Registration)
50
- - `GET https://api.muxo.ai/oauth/authorize` & `POST https://api.muxo.ai/oauth/token` (PKCE `S256`)
52
+ # 8. Check your setup, memory, and safety controls
53
+ muxo harness # API, MCP, auth, kill switch, audit chain, catalog (exit 1 on failure)
54
+ muxo memory facts # Facts with history; add --current for current facts only
55
+ muxo memory forget "old staging database" # Delete matching memories and retire their facts
56
+ muxo governance scan "text to check" # Prompt-injection check before storing or forwarding text
57
+ muxo governance pause "incident review" # Kill switch: stop all agent actions in the workspace
58
+ muxo governance resume
59
+ muxo governance policy --ring 2 --block-destructive-sql true --require-approval financial,destructive
60
+ ```
61
+ ## Official Plugins, Marketplaces & MCP Setup (`https://api.muxo.ai/mcp`)
62
+
63
+ Muxo ships a portable OpenAI Plugin (`plugins/muxo/plugin.json` & `plugins/muxo/mcp.json`), Claude Code Plugin (`plugins/muxo/.claude-plugin/plugin.json`), and Streamable HTTP MCP Server:
64
+
65
+ - **Streamable HTTP MCP Endpoints**: `https://api.muxo.ai/mcp` and `https://app.muxo.ai/mcp`
66
+ - **Local Stdio MCP Command** (requires Node.js 22+, proxies to hosted workspace): `npx -y @muxoai/cli@latest mcp`
67
+ - **Claude Code Marketplace (`muxo@muxo`)**:
68
+ ```bash
69
+ claude plugin marketplace add https://api.muxo.ai/.claude-plugin/marketplace.json
70
+ claude plugin install muxo@muxo
71
+ ```
72
+ - **OpenAI Codex Marketplace & TOML MCP Alternative**:
73
+ - **Marketplace (Git Repository or Local Directory)**: Add a Git repository or local directory containing `.agents/plugins/marketplace.json`, then enable `[plugins."muxo@muxo"]` in `.codex/config.toml`.
74
+ - **TOML MCP Alternative (`~/.codex/config.toml`)**:
75
+ ```toml
76
+ [mcp_servers.muxo]
77
+ url = "https://api.muxo.ai/mcp"
78
+ ```
79
+ Or for local stdio proxy (requires Node.js 22+):
80
+ ```toml
81
+ [mcp_servers.muxo]
82
+ command = "npx"
83
+ args = ["-y", "@muxoai/cli@latest", "mcp"]
84
+ ```
85
+ - **Claude Desktop**:
86
+ - **Hosted MCP (Custom Connectors)**: Open **Settings → Connectors → Add custom connector** and enter `https://api.muxo.ai/mcp`.
87
+ - **Local Stdio Server (`claude_desktop_config.json`, requires Node.js 22+)**:
88
+ ```json
89
+ {
90
+ "mcpServers": {
91
+ "muxo": {
92
+ "command": "npx",
93
+ "args": ["-y", "@muxoai/cli@latest", "mcp"]
94
+ }
95
+ }
96
+ }
97
+ ```
98
+ - **ChatGPT**:
99
+ - Open **Plugins → + → Add custom MCP server** (at `https://chatgpt.com/plugins`) and enter `https://api.muxo.ai/mcp`.
100
+ - **OAuth 2.1 Discovery (CIMD or DCR + PKCE)**:
101
+ - `https://api.muxo.ai/.well-known/oauth-protected-resource/mcp` (RFC 9728)
102
+ - `https://api.muxo.ai/.well-known/oauth-authorization-server` (RFC 8414)
103
+ - Client registration can use **Client ID Metadata Documents (CIMD)** or **Dynamic Client Registration (DCR)** (`POST https://api.muxo.ai/oauth/register`); `/oauth/register` is supported when a client uses DCR rather than running on every flow.
104
+ - `GET https://api.muxo.ai/oauth/authorize` & `POST https://api.muxo.ai/oauth/token` (PKCE `S256`)
51
105
  - **SEP-2640 Skills Import Extension (`io.modelcontextprotocol/skills`)**: `skills/list`, `skills/get`, and `resources/read` serving `skill://muxo/muxo/SKILL.md` and `skill://muxo/setup/SKILL.md` with `sha256` integrity digests.
52
106
  - **Tool Annotations & Multi-Account Profile**: All 19 tools include `title` and `annotations` (`readOnlyHint`, `destructiveHint`, `openWorldHint`), plus `_meta["openai/profile"]: true` on `get_profile` and Company Knowledge `search`/`fetch` compatibility.
53
107
 
@@ -62,8 +116,8 @@ Muxo ships a portable OpenAI Plugin (`plugins/muxo/plugin.json` & `plugins/muxo/
62
116
  | `src/store.ts` | SQLite (`node:sqlite`) store, AES-256-GCM secret vault, credit/settlement ledger, memories, agent claims, and HMAC-SHA256 receipt chain |
63
117
  | `src/providers/composio-sdk.ts` | Live Composio v3 Connected Apps adapter (catalog search, OAuth sessions/links, tool execution) |
64
118
  | `src/providers/composio-instant.ts` | Live Composio Instant adapter (`search`, `scrape`, `crawl`, `seo.audit`, `hackernews`, `github.repo_intel`, `dns.lookup`, `workbench`) |
65
- | `src/providers/stripe-projects.ts` | Live Stripe Projects CLI bridge (`status`, `catalog`, `add`, `rotate`, `remove`, `env --pull`) |
66
- | `src/providers/stripe-billing.ts` | Live Stripe Checkout billing (`$29/mo Starter Plan` & `$10 / +1,000 Credits Pack`) |
119
+ | `src/providers/stripe-projects.ts` | Live Stripe v2 Provisioning REST API (`2026-09-30.preview`) & Stripe Projects CLI bridge (`eligibility`, `catalog`, `payment_profile`, `provider_connections`, `resources`, `reveal_access_configuration`, `rotate`, `remove`, `env --pull`) |
120
+ | `src/providers/stripe-billing.ts` | Live Stripe Checkout billing (Starter `$29/mo`, Pro `$99/mo`, yearly billing & credit packs with volume discounts) |
67
121
  | `src/providers/microsoft-governance.ts` | Microsoft Agent Governance Toolkit v5.0.0 (`McpSecurityScanner`, `PolicyEngine`, `AgentIdentity` Ed25519 DID, `AuditLogger`) |
68
122
  | `src/providers/supermemory.ts` | Supermemory v5 Contextual Brain (`profile`, hybrid `search`, secret-redacted `add`, `delete`) |
69
123
  | `src/engine.ts` | Unified Governance, Memory & Execution Engine implementing all 19 canonical MCP operations |
@@ -0,0 +1,35 @@
1
+ export interface ClerkConfig {
2
+ publishableKey: string;
3
+ frontendApi: string;
4
+ authorizedParties: string[];
5
+ jwtKey?: string;
6
+ secretKey?: string;
7
+ }
8
+ export interface ClerkSession {
9
+ userId: string;
10
+ sessionId: string;
11
+ email?: string;
12
+ emailVerified?: boolean;
13
+ }
14
+ export interface ClerkProfile {
15
+ email: string | null;
16
+ emailVerified: boolean;
17
+ name: string | null;
18
+ /** Every verified address on the account, lowercased, primary included. */
19
+ verifiedEmails: string[];
20
+ }
21
+ export interface ClerkEnv {
22
+ CLERK_PUBLISHABLE_KEY?: string;
23
+ CLERK_SECRET_KEY?: string;
24
+ CLERK_JWT_KEY?: string;
25
+ CLERK_AUTHORIZED_PARTIES?: string;
26
+ }
27
+ /** Derives the Clerk Frontend API origin encoded in a publishable key (pk_live_/pk_test_). */
28
+ export declare function clerkFrontendApi(publishableKey: string): string | null;
29
+ export declare function readClerkConfig(env: ClerkEnv, fallbackAuthorizedParty?: string): ClerkConfig | null;
30
+ export declare function looksLikeJwt(token: string): boolean;
31
+ /** Verifies a Clerk session JWT (RS256) and returns the session identity, or null if invalid. */
32
+ export declare function verifyClerkSessionToken(token: string, config: ClerkConfig, nowSeconds?: number): Promise<ClerkSession | null>;
33
+ /** Reads the primary email and name for a Clerk user through the Backend API. */
34
+ export declare function fetchClerkProfile(userId: string, secretKey: string): Promise<ClerkProfile | null>;
35
+ export declare function clerkBrowserScriptUrl(frontendApi: string): string;
package/dist/clerk.js ADDED
@@ -0,0 +1,201 @@
1
+ const RS256 = { name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" };
2
+ const JWKS_TTL_MS = 10 * 60 * 1000;
3
+ const JWKS_RETRY_MS = 30 * 1000;
4
+ const CLOCK_SKEW_SECONDS = 5;
5
+ function base64UrlToBytes(input) {
6
+ const normalized = input.replace(/-/g, "+").replace(/_/g, "/");
7
+ const padded = normalized + "=".repeat((4 - (normalized.length % 4)) % 4);
8
+ const binary = atob(padded);
9
+ const bytes = new Uint8Array(new ArrayBuffer(binary.length));
10
+ for (let i = 0; i < binary.length; i++)
11
+ bytes[i] = binary.charCodeAt(i);
12
+ return bytes;
13
+ }
14
+ function decodeJsonSegment(segment) {
15
+ try {
16
+ const parsed = JSON.parse(new TextDecoder().decode(base64UrlToBytes(segment)));
17
+ return parsed && typeof parsed === "object" ? parsed : null;
18
+ }
19
+ catch {
20
+ return null;
21
+ }
22
+ }
23
+ /** Derives the Clerk Frontend API origin encoded in a publishable key (pk_live_/pk_test_). */
24
+ export function clerkFrontendApi(publishableKey) {
25
+ const match = /^pk_(?:live|test)_([A-Za-z0-9+/=_-]{4,512})$/.exec(publishableKey.trim());
26
+ if (!match)
27
+ return null;
28
+ let decoded;
29
+ try {
30
+ decoded = new TextDecoder().decode(base64UrlToBytes(match[1]));
31
+ }
32
+ catch {
33
+ return null;
34
+ }
35
+ if (!decoded.endsWith("$"))
36
+ return null;
37
+ const host = decoded.slice(0, -1);
38
+ if (!/^(?=.{4,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/i.test(host))
39
+ return null;
40
+ return `https://${host.toLowerCase()}`;
41
+ }
42
+ export function readClerkConfig(env, fallbackAuthorizedParty) {
43
+ const publishableKey = (env.CLERK_PUBLISHABLE_KEY || "").trim();
44
+ if (!publishableKey)
45
+ return null;
46
+ const frontendApi = clerkFrontendApi(publishableKey);
47
+ if (!frontendApi)
48
+ return null;
49
+ const configured = (env.CLERK_AUTHORIZED_PARTIES || "")
50
+ .split(",")
51
+ .map((s) => s.trim().replace(/\/+$/, ""))
52
+ .filter(Boolean);
53
+ const authorizedParties = configured.length
54
+ ? configured
55
+ : fallbackAuthorizedParty
56
+ ? [fallbackAuthorizedParty.replace(/\/+$/, "")]
57
+ : [];
58
+ return {
59
+ publishableKey,
60
+ frontendApi,
61
+ authorizedParties,
62
+ jwtKey: (env.CLERK_JWT_KEY || "").trim() || undefined,
63
+ secretKey: (env.CLERK_SECRET_KEY || "").trim() || undefined,
64
+ };
65
+ }
66
+ export function looksLikeJwt(token) {
67
+ return /^eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(token);
68
+ }
69
+ async function importPemKey(pem) {
70
+ const body = pem
71
+ .replace(/\\n/g, "\n")
72
+ .replace(/-----BEGIN PUBLIC KEY-----/, "")
73
+ .replace(/-----END PUBLIC KEY-----/, "")
74
+ .replace(/\s+/g, "");
75
+ return crypto.subtle.importKey("spki", base64UrlToBytes(body), RS256, false, ["verify"]);
76
+ }
77
+ // Only public verification keys are cached; never tokens or user data.
78
+ const jwksCache = new Map();
79
+ const pemCache = new Map();
80
+ async function loadJwks(frontendApi) {
81
+ const res = await fetch(`${frontendApi}/.well-known/jwks.json`, {
82
+ headers: { Accept: "application/json" },
83
+ redirect: "manual",
84
+ });
85
+ if (res.status !== 200)
86
+ throw new Error(`Clerk JWKS unavailable (HTTP ${res.status})`);
87
+ const doc = (await res.json());
88
+ const keys = new Map();
89
+ for (const jwk of doc.keys || []) {
90
+ if (jwk.kty !== "RSA" || typeof jwk.kid !== "string")
91
+ continue;
92
+ if (jwk.use && jwk.use !== "sig")
93
+ continue;
94
+ const key = await crypto.subtle.importKey("jwk", { kty: "RSA", n: String(jwk.n), e: String(jwk.e), alg: "RS256", ext: true }, RS256, false, ["verify"]);
95
+ keys.set(jwk.kid, key);
96
+ }
97
+ return keys;
98
+ }
99
+ async function verificationKey(config, kid) {
100
+ if (config.jwtKey) {
101
+ let key = pemCache.get(config.jwtKey);
102
+ if (!key) {
103
+ key = await importPemKey(config.jwtKey);
104
+ pemCache.set(config.jwtKey, key);
105
+ }
106
+ return key;
107
+ }
108
+ if (!kid)
109
+ return null;
110
+ const now = Date.now();
111
+ const cached = jwksCache.get(config.frontendApi);
112
+ const fresh = cached && now - cached.fetchedAt < JWKS_TTL_MS;
113
+ if (cached?.keys.has(kid) && fresh)
114
+ return cached.keys.get(kid);
115
+ // Refetch for unknown kids (key rotation), but not more than once per retry window.
116
+ if (!cached || !fresh || now - cached.fetchedAt > JWKS_RETRY_MS) {
117
+ const keys = await loadJwks(config.frontendApi);
118
+ jwksCache.set(config.frontendApi, { keys, fetchedAt: now });
119
+ return keys.get(kid) || null;
120
+ }
121
+ return cached.keys.get(kid) || null;
122
+ }
123
+ /** Verifies a Clerk session JWT (RS256) and returns the session identity, or null if invalid. */
124
+ export async function verifyClerkSessionToken(token, config, nowSeconds = Math.floor(Date.now() / 1000)) {
125
+ if (!looksLikeJwt(token) || token.length > 16_384)
126
+ return null;
127
+ const [headerPart, payloadPart, signaturePart] = token.split(".");
128
+ const header = decodeJsonSegment(headerPart);
129
+ const payload = decodeJsonSegment(payloadPart);
130
+ if (!header || !payload || header.alg !== "RS256")
131
+ return null;
132
+ let key;
133
+ try {
134
+ key = await verificationKey(config, typeof header.kid === "string" ? header.kid : undefined);
135
+ }
136
+ catch {
137
+ return null;
138
+ }
139
+ if (!key)
140
+ return null;
141
+ let valid = false;
142
+ try {
143
+ valid = await crypto.subtle.verify(RS256, key, base64UrlToBytes(signaturePart), new TextEncoder().encode(`${headerPart}.${payloadPart}`));
144
+ }
145
+ catch {
146
+ return null;
147
+ }
148
+ if (!valid)
149
+ return null;
150
+ if (payload.iss !== config.frontendApi)
151
+ return null;
152
+ if (typeof payload.exp !== "number" || payload.exp + CLOCK_SKEW_SECONDS < nowSeconds)
153
+ return null;
154
+ if (typeof payload.nbf === "number" && payload.nbf - CLOCK_SKEW_SECONDS > nowSeconds)
155
+ return null;
156
+ if (typeof payload.iat === "number" && payload.iat - CLOCK_SKEW_SECONDS > nowSeconds)
157
+ return null;
158
+ if (typeof payload.azp === "string" &&
159
+ config.authorizedParties.length > 0 &&
160
+ !config.authorizedParties.includes(payload.azp.replace(/\/+$/, ""))) {
161
+ return null;
162
+ }
163
+ if (payload.sts !== undefined && payload.sts !== "active")
164
+ return null;
165
+ if (typeof payload.sub !== "string" || !/^user_[A-Za-z0-9]{1,128}$/.test(payload.sub))
166
+ return null;
167
+ return {
168
+ userId: payload.sub,
169
+ sessionId: typeof payload.sid === "string" ? payload.sid : "",
170
+ email: typeof payload.email === "string" ? payload.email.toLowerCase() : undefined,
171
+ emailVerified: payload.email_verified === true,
172
+ };
173
+ }
174
+ /** Reads the primary email and name for a Clerk user through the Backend API. */
175
+ export async function fetchClerkProfile(userId, secretKey) {
176
+ try {
177
+ const res = await fetch(`https://api.clerk.com/v1/users/${encodeURIComponent(userId)}`, {
178
+ headers: { Authorization: `Bearer ${secretKey}`, Accept: "application/json" },
179
+ });
180
+ if (!res.ok)
181
+ return null;
182
+ const user = (await res.json());
183
+ const addresses = user.email_addresses || [];
184
+ const primary = addresses.find((e) => e.id === user.primary_email_address_id) || addresses[0];
185
+ const name = [user.first_name, user.last_name].filter(Boolean).join(" ").trim() || user.username || null;
186
+ return {
187
+ email: primary?.email_address ? primary.email_address.toLowerCase() : null,
188
+ emailVerified: primary?.verification?.status === "verified",
189
+ name,
190
+ verifiedEmails: addresses
191
+ .filter((e) => e.email_address && e.verification?.status === "verified")
192
+ .map((e) => e.email_address.toLowerCase()),
193
+ };
194
+ }
195
+ catch {
196
+ return null;
197
+ }
198
+ }
199
+ export function clerkBrowserScriptUrl(frontendApi) {
200
+ return `${frontendApi}/npm/@clerk/clerk-js@5/dist/clerk.browser.js`;
201
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};