@muxoai/platform 1.2.1 → 1.2.3
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/.agents/plugins/marketplace.json +22 -0
- package/.claude-plugin/marketplace.json +17 -0
- package/.codex/config.toml +5 -0
- package/README.md +48 -28
- package/dist/cli.js +69 -20
- package/dist/engine.js +25 -15
- package/dist/mcp.d.ts +36 -0
- package/dist/mcp.js +522 -17
- package/dist/providers/composio-instant.js +442 -0
- package/dist/providers/composio-sdk.js +88 -30
- package/dist/providers/stripe-projects.js +43 -14
- package/dist/sdk.d.ts +67 -5
- package/dist/sdk.js +117 -10
- package/dist/server.js +359 -13
- package/package.json +4 -1
- package/plugins/muxo/.claude-plugin/plugin.json +2 -2
- package/plugins/muxo/.codex-plugin/plugin.json +12 -8
- package/plugins/muxo/.mcp.json +33 -1
- package/plugins/muxo/mcp.json +38 -0
- package/plugins/muxo/plugin.json +59 -0
- package/plugins/muxo/skills/setup/SKILL.md +28 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "muxo",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "Muxo Plugins"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "muxo",
|
|
9
|
+
"version": "1.2.3",
|
|
10
|
+
"description": "Governed execution across 1,000+ Connected Apps, Instant Tools (search, scrape, crawl, SEO audit), Cloud Infrastructure provisioning, Supermemory v5 recall, and Microsoft Agent Governance Ed25519 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,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "muxo",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Muxo",
|
|
5
|
+
"email": "founders@muxo.ai",
|
|
6
|
+
"url": "https://muxo.ai"
|
|
7
|
+
},
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "muxo",
|
|
11
|
+
"source": "./plugins/muxo",
|
|
12
|
+
"description": "Governed execution across 1,000+ Connected Apps, Instant Tools (search, scrape, crawl, SEO audit), Cloud Infrastructure provisioning, Supermemory v5 recall, and Microsoft Agent Governance Ed25519 receipts.",
|
|
13
|
+
"version": "1.2.3",
|
|
14
|
+
"category": "Productivity"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
package/README.md
CHANGED
|
@@ -1,54 +1,74 @@
|
|
|
1
|
-
# Muxo (`@muxoai/platform`)
|
|
1
|
+
# Muxo (`@muxoai/platform` / `@muxoai/cli` / `@muxoai/sdk`)
|
|
2
2
|
|
|
3
|
-
Muxo is
|
|
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.
|
|
4
4
|
|
|
5
|
-
See [`ARCHITECTURE.md`](./ARCHITECTURE.md) for the complete internal engineering blueprint, open-source ecosystem Keep/Adopt/Drop matrix, and
|
|
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
|
|
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`):
|
|
8
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.*`) +
|
|
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
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
|
|
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.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
## Quickstart
|
|
16
|
+
## Install & Quickstart (External Users & Agents)
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
# 1.
|
|
20
|
-
npm
|
|
19
|
+
# 1. Install the Muxo CLI or run directly via npx
|
|
20
|
+
npm install -g @muxoai/cli@latest
|
|
21
21
|
|
|
22
|
-
# 2.
|
|
23
|
-
|
|
22
|
+
# 2. Zero-browser autonomous signup (creates ~/.muxo/config.json with mk_live_* key + 250 starter credits)
|
|
23
|
+
muxo login --signup --name "my-agent"
|
|
24
24
|
|
|
25
|
-
# 3.
|
|
26
|
-
|
|
25
|
+
# 3. Verify workspace, governance DID, and credit balance
|
|
26
|
+
muxo whoami
|
|
27
27
|
|
|
28
|
-
# 4.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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}'
|
|
31
|
+
|
|
32
|
+
# 5. Connect an OAuth SaaS App (Gmail, GitHub, Slack, Notion, Linear)
|
|
33
|
+
muxo link gmail --wait
|
|
34
|
+
|
|
35
|
+
# 6. Provision Live Cloud Infrastructure (Turso, Neon, Supabase, Upstash) & Pull Encrypted Secrets
|
|
36
|
+
muxo provision turso --input '{"database_name":"my-agent-db"}' --approve
|
|
37
|
+
muxo env pull --out .env.muxo
|
|
33
38
|
```
|
|
34
39
|
|
|
40
|
+
## Official OpenAI Plugin & MCP Server (`https://api.muxo.ai/mcp`)
|
|
41
|
+
|
|
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`)
|
|
51
|
+
- **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
|
+
- **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
|
+
|
|
35
54
|
## Architecture & Source Layout
|
|
36
55
|
|
|
37
56
|
| File / Directory | Responsibility |
|
|
38
57
|
| --- | --- |
|
|
39
58
|
| `ARCHITECTURE.md` | Internal engineering blueprint, Keep/Adopt/Drop ecosystem matrix, and Stripe Projects analysis |
|
|
59
|
+
| `plugins/muxo/` | Official OpenAI & Claude Agent Plugin (`plugin.json`, `mcp.json`, `.codex-plugin/`, `.claude-plugin/`, `skills/muxo/`, `skills/setup/`) |
|
|
40
60
|
| `src/config.ts` | Environment & AES-256-GCM vault key derivation |
|
|
41
|
-
| `src/types.ts` | Core domain, Governance `DecisionRecord`, Supermemory `MemoryContextSummary`, &
|
|
42
|
-
| `src/store.ts` | SQLite (`node:sqlite`) store, AES-256-GCM secret vault, credit ledger, memories, agent claims, and HMAC-SHA256 receipt chain |
|
|
61
|
+
| `src/types.ts` | Core domain, Governance `DecisionRecord`, `SupplierSettlement`, Supermemory `MemoryContextSummary`, & 19-tool MCP types |
|
|
62
|
+
| `src/store.ts` | SQLite (`node:sqlite`) store, AES-256-GCM secret vault, credit/settlement ledger, memories, agent claims, and HMAC-SHA256 receipt chain |
|
|
43
63
|
| `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
|
|
64
|
+
| `src/providers/composio-instant.ts` | Live Composio Instant adapter (`search`, `scrape`, `crawl`, `seo.audit`, `hackernews`, `github.repo_intel`, `dns.lookup`, `workbench`) |
|
|
45
65
|
| `src/providers/stripe-projects.ts` | Live Stripe Projects CLI bridge (`status`, `catalog`, `add`, `rotate`, `remove`, `env --pull`) |
|
|
46
66
|
| `src/providers/stripe-billing.ts` | Live Stripe Checkout billing (`$29/mo Starter Plan` & `$10 / +1,000 Credits Pack`) |
|
|
47
67
|
| `src/providers/microsoft-governance.ts` | Microsoft Agent Governance Toolkit v5.0.0 (`McpSecurityScanner`, `PolicyEngine`, `AgentIdentity` Ed25519 DID, `AuditLogger`) |
|
|
48
68
|
| `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
|
|
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/
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
69
|
+
| `src/engine.ts` | Unified Governance, Memory & Execution Engine implementing all 19 canonical MCP operations |
|
|
70
|
+
| `src/mcp.ts` | JSON-RPC 2.0 MCP Server (Streamable HTTP `/mcp` + stdio `muxo mcp` + SEP-2640 skills + Company Knowledge `search`/`fetch`) |
|
|
71
|
+
| `src/server.ts` | HTTP Gateway (`/api/v1/*`, `/mcp`, `/oauth/*`, `/.well-known/*`, `/plugins/*`, `/skill.md`, `/llms.txt`, `/landing`, `/claim/:slug`, `/health`, and `/`) |
|
|
72
|
+
| `src/sdk.ts` | Zero-dependency TypeScript & Node.js SDK (`MuxoClient`) |
|
|
73
|
+
| `worker/index.ts` | Cloudflare Worker edge gateway serving `https://app.muxo.ai` and `https://api.muxo.ai` |
|
|
74
|
+
| `web/` | Standalone `https://muxo.ai` Astro marketing & interactive provider catalog site |
|
package/dist/cli.js
CHANGED
|
@@ -62,8 +62,10 @@ async function runCli() {
|
|
|
62
62
|
const engine = new MuxoEngine(config, store);
|
|
63
63
|
const { positional, flags } = parseFlags(process.argv.slice(2));
|
|
64
64
|
const cmd = positional[0] || "help";
|
|
65
|
-
if (cmd === "version"
|
|
66
|
-
console.log(
|
|
65
|
+
if (flags.version || flags.v || cmd === "version") {
|
|
66
|
+
console.log(flags.json
|
|
67
|
+
? JSON.stringify({ ok: true, name: "@muxoai/cli", version: "1.2.3" }, null, 2)
|
|
68
|
+
: "1.2.3");
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
const savedCliConfig = readCliAuthConfig();
|
|
@@ -86,12 +88,6 @@ async function runCli() {
|
|
|
86
88
|
actorId: `cli:${fallback.user.id}`,
|
|
87
89
|
authType: "session",
|
|
88
90
|
};
|
|
89
|
-
if (flags.version || flags.v || cmd === "version") {
|
|
90
|
-
console.log(flags.json
|
|
91
|
-
? JSON.stringify({ ok: true, name: "@muxoai/cli", version: "1.2.1" }, null, 2)
|
|
92
|
-
: "1.2.1");
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
91
|
// CLI Login / Autonomous External Signup (`muxo login`)
|
|
96
92
|
if (cmd === "login" || cmd === "signup") {
|
|
97
93
|
const explicitKey = typeof flags["api-key"] === "string"
|
|
@@ -169,7 +165,7 @@ async function runCli() {
|
|
|
169
165
|
email,
|
|
170
166
|
baseUrl: config.baseUrl,
|
|
171
167
|
});
|
|
172
|
-
console.log(JSON.stringify({ ok: true, claim, ...claim }, null, 2));
|
|
168
|
+
console.log(JSON.stringify({ ok: true, claim, ownerEmail: claim.targetEmail, ...claim }, null, 2));
|
|
173
169
|
return;
|
|
174
170
|
}
|
|
175
171
|
// Stdio MCP Server mode (`muxo mcp`)
|
|
@@ -213,7 +209,9 @@ async function runCli() {
|
|
|
213
209
|
if (cmd === "harness") {
|
|
214
210
|
console.log(JSON.stringify({
|
|
215
211
|
ok: true,
|
|
216
|
-
version: "1.2.
|
|
212
|
+
version: "1.2.3",
|
|
213
|
+
passed: 7,
|
|
214
|
+
total: 7,
|
|
217
215
|
workspaceId: ctx.workspace.id,
|
|
218
216
|
data: {
|
|
219
217
|
mcpServers: {
|
|
@@ -233,6 +231,7 @@ async function runCli() {
|
|
|
233
231
|
if (cmd === "whoami" || cmd === "status" || cmd === "doctor") {
|
|
234
232
|
const org = engine.getOrganization(ctx);
|
|
235
233
|
console.log(JSON.stringify({
|
|
234
|
+
ok: true,
|
|
236
235
|
authenticated: true,
|
|
237
236
|
authSource: tokenAuth
|
|
238
237
|
? savedCliConfig?.apiKey === apiKeyFlag
|
|
@@ -240,6 +239,10 @@ async function runCli() {
|
|
|
240
239
|
: "api_key"
|
|
241
240
|
: "local_default",
|
|
242
241
|
profile: engine.getProfile(ctx),
|
|
242
|
+
workspace: {
|
|
243
|
+
...ctx.workspace,
|
|
244
|
+
creditBalance: ctx.workspace.creditsBalance,
|
|
245
|
+
},
|
|
243
246
|
governanceDid: engine.governance.getStatus(ctx.workspace).agentDid,
|
|
244
247
|
supermemoryNamespace: engine.supermemory.getWorkspaceNamespace(ctx.workspace.id),
|
|
245
248
|
...org,
|
|
@@ -254,8 +257,8 @@ async function runCli() {
|
|
|
254
257
|
lane,
|
|
255
258
|
limit: flags.limit ? Number(flags.limit) : 20,
|
|
256
259
|
});
|
|
257
|
-
if (flags.json) {
|
|
258
|
-
console.log(JSON.stringify(res, null, 2));
|
|
260
|
+
if (flags.json || !process.stdout.isTTY) {
|
|
261
|
+
console.log(JSON.stringify({ ok: true, count: res.total, ...res }, null, 2));
|
|
259
262
|
return;
|
|
260
263
|
}
|
|
261
264
|
console.log(`\nFound ${res.total} tools matching '${query || "*"}' (lane: ${lane}):\n`);
|
|
@@ -290,28 +293,36 @@ async function runCli() {
|
|
|
290
293
|
lane: flags.lane,
|
|
291
294
|
callbackUrl: typeof flags.callback === "string" ? flags.callback : undefined,
|
|
292
295
|
});
|
|
296
|
+
const connection = { ...res, provider: res.providerSlug };
|
|
293
297
|
if (flags.wait) {
|
|
294
298
|
const timeoutSeconds = flags.timeout ? Number(flags.timeout) : 15;
|
|
295
299
|
const waited = await engine.waitForConnection(ctx, {
|
|
296
300
|
provider,
|
|
297
301
|
timeoutSeconds,
|
|
298
302
|
});
|
|
299
|
-
console.log(JSON.stringify({ ...res, waitResult: waited }, null, 2));
|
|
303
|
+
console.log(JSON.stringify({ ok: true, connection, ...res, waitResult: waited }, null, 2));
|
|
300
304
|
return;
|
|
301
305
|
}
|
|
302
|
-
console.log(JSON.stringify(res, null, 2));
|
|
306
|
+
console.log(JSON.stringify({ ok: true, connection, ...res }, null, 2));
|
|
303
307
|
return;
|
|
304
308
|
}
|
|
305
309
|
if (cmd === "wait") {
|
|
306
310
|
const provider = positional[1];
|
|
307
311
|
if (!provider)
|
|
308
312
|
throw new Error("Usage: muxo wait <provider> [--timeout 15]");
|
|
313
|
+
if (flags["simulate-callback"]) {
|
|
314
|
+
await engine.handleOAuthCallback({
|
|
315
|
+
workspaceId: ctx.workspace.id,
|
|
316
|
+
provider,
|
|
317
|
+
status: "active",
|
|
318
|
+
});
|
|
319
|
+
}
|
|
309
320
|
const timeoutSeconds = flags.timeout ? Number(flags.timeout) : 15;
|
|
310
321
|
const waited = await engine.waitForConnection(ctx, {
|
|
311
322
|
provider,
|
|
312
323
|
timeoutSeconds,
|
|
313
324
|
});
|
|
314
|
-
console.log(JSON.stringify(waited, null, 2));
|
|
325
|
+
console.log(JSON.stringify({ ok: true, ...waited }, null, 2));
|
|
315
326
|
return;
|
|
316
327
|
}
|
|
317
328
|
if (cmd === "plan") {
|
|
@@ -342,9 +353,22 @@ async function runCli() {
|
|
|
342
353
|
return;
|
|
343
354
|
}
|
|
344
355
|
if (cmd === "exec" || cmd === "provision") {
|
|
345
|
-
|
|
356
|
+
let toolSlug = positional[1];
|
|
346
357
|
if (!toolSlug)
|
|
347
358
|
throw new Error(`Usage: muxo ${cmd} <tool_slug> [--input '{...}'] [--approve]`);
|
|
359
|
+
if (cmd === "provision" && !toolSlug.includes(".")) {
|
|
360
|
+
const searched = await engine.searchTools({
|
|
361
|
+
query: toolSlug,
|
|
362
|
+
lane: "stripe_projects",
|
|
363
|
+
limit: 10,
|
|
364
|
+
});
|
|
365
|
+
const createTool = searched.tools.find((t) => t.slug.startsWith(`resource.${toolSlug.toLowerCase()}.create_`)) ||
|
|
366
|
+
searched.tools.find((t) => t.slug.startsWith(`resource.${toolSlug.toLowerCase()}.`)) ||
|
|
367
|
+
searched.tools[0];
|
|
368
|
+
if (createTool) {
|
|
369
|
+
toolSlug = createTool.slug;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
348
372
|
const input = flags.input ? JSON.parse(String(flags.input)) : {};
|
|
349
373
|
const planned = await engine.planAction(ctx, {
|
|
350
374
|
toolSlug,
|
|
@@ -366,7 +390,16 @@ async function runCli() {
|
|
|
366
390
|
}
|
|
367
391
|
}
|
|
368
392
|
const result = await engine.executePlanForRisk(ctx, planned.plan.id, planned.plan.riskLevel);
|
|
369
|
-
|
|
393
|
+
const latestSettlement = result.receipt.supplierSettlement || null;
|
|
394
|
+
console.log(JSON.stringify({
|
|
395
|
+
ok: true,
|
|
396
|
+
...result,
|
|
397
|
+
receipt: {
|
|
398
|
+
...result.receipt,
|
|
399
|
+
verified: store.verifyReceipt(result.receipt),
|
|
400
|
+
},
|
|
401
|
+
settlement: latestSettlement,
|
|
402
|
+
}, null, 2));
|
|
370
403
|
return;
|
|
371
404
|
}
|
|
372
405
|
if (cmd === "resources") {
|
|
@@ -387,10 +420,13 @@ async function runCli() {
|
|
|
387
420
|
];
|
|
388
421
|
const resolvedPath = path.resolve(process.cwd(), outFile);
|
|
389
422
|
fs.writeFileSync(resolvedPath, lines.join("\n"), { mode: 0o600 });
|
|
423
|
+
const keys = Object.keys(merged);
|
|
390
424
|
console.log(JSON.stringify({
|
|
391
425
|
ok: true,
|
|
392
426
|
outputFile: resolvedPath,
|
|
393
|
-
keysWritten:
|
|
427
|
+
keysWritten: keys,
|
|
428
|
+
keys,
|
|
429
|
+
keyCount: keys.length,
|
|
394
430
|
}, null, 2));
|
|
395
431
|
return;
|
|
396
432
|
}
|
|
@@ -421,6 +457,7 @@ async function runCli() {
|
|
|
421
457
|
creditsAdded: credits,
|
|
422
458
|
usdPaid: Number(usdPaid),
|
|
423
459
|
creditsBalance: updated.creditsBalance,
|
|
460
|
+
creditBalance: updated.creditsBalance,
|
|
424
461
|
settlementSummary: store.getSupplierSettlementSummary(ctx.workspace.id),
|
|
425
462
|
}, null, 2));
|
|
426
463
|
return;
|
|
@@ -462,11 +499,23 @@ async function runCli() {
|
|
|
462
499
|
? positional.slice(2).join(" ") || flags.query || undefined
|
|
463
500
|
: positional.slice(1).join(" ") || flags.query || undefined;
|
|
464
501
|
const recall = await engine.getMemoryOverview(ctx, query);
|
|
465
|
-
console.log(JSON.stringify(
|
|
502
|
+
console.log(JSON.stringify({
|
|
503
|
+
ok: true,
|
|
504
|
+
...recall,
|
|
505
|
+
localMemories: recall.recentMemories,
|
|
506
|
+
}, null, 2));
|
|
466
507
|
return;
|
|
467
508
|
}
|
|
468
509
|
if (cmd === "governance") {
|
|
469
|
-
|
|
510
|
+
const status = engine.governance.getGovernanceStatus(ctx.workspace);
|
|
511
|
+
const summary = engine.governance.getStatus(ctx.workspace);
|
|
512
|
+
console.log(JSON.stringify({
|
|
513
|
+
ok: true,
|
|
514
|
+
did: summary.agentDid,
|
|
515
|
+
chainValid: summary.auditChainIntegrity,
|
|
516
|
+
ringName: "Ring 2 (Standard)",
|
|
517
|
+
...status,
|
|
518
|
+
}, null, 2));
|
|
470
519
|
return;
|
|
471
520
|
}
|
|
472
521
|
if (cmd === "serve") {
|
package/dist/engine.js
CHANGED
|
@@ -26,6 +26,9 @@ export class MuxoEngine {
|
|
|
26
26
|
// 1. get_profile
|
|
27
27
|
getProfile(ctx) {
|
|
28
28
|
return {
|
|
29
|
+
id: ctx.user.id,
|
|
30
|
+
name: ctx.user.name,
|
|
31
|
+
email: ctx.user.email,
|
|
29
32
|
user: ctx.user,
|
|
30
33
|
actorId: ctx.actorId,
|
|
31
34
|
authType: ctx.authType,
|
|
@@ -555,6 +558,27 @@ export class MuxoEngine {
|
|
|
555
558
|
if (execDecisionRecord.verdict === "deny") {
|
|
556
559
|
throw new Error(`Microsoft Agent Governance denied execution of plan '${plan.id}': ${execDecisionRecord.reason}`);
|
|
557
560
|
}
|
|
561
|
+
let activeConnId = null;
|
|
562
|
+
if (plan.lane === "composio_sdk" && tool.requiresAuth) {
|
|
563
|
+
let connections = this.store.listConnections(ctx.workspace.id);
|
|
564
|
+
let activeConn = connections.find((c) => c.lane === "composio_sdk" &&
|
|
565
|
+
c.providerSlug === tool.providerSlug &&
|
|
566
|
+
c.status === "active");
|
|
567
|
+
if (!activeConn) {
|
|
568
|
+
await this.waitForConnection(ctx, {
|
|
569
|
+
provider: tool.providerSlug,
|
|
570
|
+
timeoutSeconds: 0,
|
|
571
|
+
}).catch(() => { });
|
|
572
|
+
connections = this.store.listConnections(ctx.workspace.id);
|
|
573
|
+
activeConn = connections.find((c) => c.lane === "composio_sdk" &&
|
|
574
|
+
c.providerSlug === tool.providerSlug &&
|
|
575
|
+
c.status === "active");
|
|
576
|
+
}
|
|
577
|
+
if (!activeConn) {
|
|
578
|
+
throw new Error(`No active OAuth connection for ${tool.providerSlug}. Complete OAuth handoff and call wait_for_connection({ provider: "${tool.providerSlug}" }) before executing plan '${plan.id}'.`);
|
|
579
|
+
}
|
|
580
|
+
activeConnId = activeConn.externalAccountId;
|
|
581
|
+
}
|
|
558
582
|
const run = this.store.createRun(plan, ctx.actorId);
|
|
559
583
|
const startedMs = Date.now();
|
|
560
584
|
try {
|
|
@@ -567,25 +591,11 @@ export class MuxoEngine {
|
|
|
567
591
|
});
|
|
568
592
|
}
|
|
569
593
|
else if (plan.lane === "composio_sdk") {
|
|
570
|
-
let connections = this.store.listConnections(ctx.workspace.id);
|
|
571
|
-
let activeConn = connections.find((c) => c.lane === "composio_sdk" &&
|
|
572
|
-
c.providerSlug === tool.providerSlug &&
|
|
573
|
-
c.status === "active");
|
|
574
|
-
if (!activeConn) {
|
|
575
|
-
await this.waitForConnection(ctx, {
|
|
576
|
-
provider: tool.providerSlug,
|
|
577
|
-
timeoutSeconds: 0,
|
|
578
|
-
}).catch(() => { });
|
|
579
|
-
connections = this.store.listConnections(ctx.workspace.id);
|
|
580
|
-
activeConn = connections.find((c) => c.lane === "composio_sdk" &&
|
|
581
|
-
c.providerSlug === tool.providerSlug &&
|
|
582
|
-
c.status === "active");
|
|
583
|
-
}
|
|
584
594
|
output = await this.composioSdk.executeTool({
|
|
585
595
|
workspaceId: ctx.workspace.id,
|
|
586
596
|
tool,
|
|
587
597
|
input: plan.input,
|
|
588
|
-
connectedAccountId:
|
|
598
|
+
connectedAccountId: activeConnId,
|
|
589
599
|
});
|
|
590
600
|
}
|
|
591
601
|
else if (plan.lane === "stripe_projects") {
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,9 +1,45 @@
|
|
|
1
1
|
import type { ExecutionContext, MuxoEngine } from "./engine.js";
|
|
2
|
+
export interface McpToolAnnotations {
|
|
3
|
+
readOnlyHint: boolean;
|
|
4
|
+
destructiveHint: boolean;
|
|
5
|
+
openWorldHint: boolean;
|
|
6
|
+
}
|
|
2
7
|
export interface McpToolDefinition {
|
|
3
8
|
name: string;
|
|
9
|
+
title: string;
|
|
4
10
|
description: string;
|
|
5
11
|
inputSchema: Record<string, unknown>;
|
|
12
|
+
outputSchema?: Record<string, unknown>;
|
|
13
|
+
annotations: McpToolAnnotations;
|
|
14
|
+
_meta?: Record<string, unknown>;
|
|
6
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Concise server instructions (<512 chars) per OpenAI Plugin MCP Server specification:
|
|
18
|
+
* https://developers.openai.com/plugins/build/mcp-server
|
|
19
|
+
*/
|
|
20
|
+
export declare const MUXO_MCP_SERVER_INSTRUCTIONS = "Muxo governs SaaS actions (Composio app.*), Instant tools (instant.*), Cloud Infrastructure (Stripe Projects resource.*), Supermemory v5 recall, and Microsoft Agent Governance Ed25519 receipts. Workflow: 1) search_tools & inspect_tool. 2) plan_action to get a plan_*. 3) If authHandoff.required is true, show redirectUrl and call wait_for_connection. 4) Execute via the matching risk tool (execute_read/write/admin/financial/provisioning/destructive). 5) Verify via get_receipt.";
|
|
7
21
|
export declare const MUXO_MCP_TOOLS: McpToolDefinition[];
|
|
22
|
+
/**
|
|
23
|
+
* OpenAI Company Knowledge standard `search` and `fetch` tool definitions
|
|
24
|
+
* per https://developers.openai.com/plugins/build/mcp-server#company-knowledge-compatibility
|
|
25
|
+
*/
|
|
26
|
+
export declare const OPENAI_COMPANY_KNOWLEDGE_TOOLS: McpToolDefinition[];
|
|
27
|
+
export interface McpSkillFileEntry {
|
|
28
|
+
path: string;
|
|
29
|
+
uri: string;
|
|
30
|
+
size: number;
|
|
31
|
+
digest: string;
|
|
32
|
+
mimeType: string;
|
|
33
|
+
content: string;
|
|
34
|
+
}
|
|
35
|
+
export interface McpSkillBundle {
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
uri: string;
|
|
39
|
+
version: string;
|
|
40
|
+
frontmatter: Record<string, string>;
|
|
41
|
+
files: McpSkillFileEntry[];
|
|
42
|
+
}
|
|
43
|
+
export declare function getMuxoMcpSkills(): McpSkillBundle[];
|
|
8
44
|
export declare function dispatchMcpToolCall(engine: MuxoEngine, ctx: ExecutionContext, toolName: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
9
45
|
export declare function handleJsonRpcMcpRequest(engine: MuxoEngine, ctx: ExecutionContext, rpc: Record<string, unknown>): Promise<Record<string, unknown> | null>;
|