@muxoai/platform 1.2.3 → 1.3.0
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/README.md +21 -12
- package/dist/cli.js +328 -10
- package/dist/engine.d.ts +28 -0
- package/dist/engine.js +169 -12
- package/dist/mcp.js +14 -6
- package/dist/nl.d.ts +34 -0
- package/dist/nl.js +577 -0
- package/dist/providers/stripe-billing.d.ts +13 -3
- package/dist/providers/stripe-billing.js +240 -36
- package/dist/sdk.d.ts +77 -1
- package/dist/sdk.js +46 -0
- package/dist/server.js +120 -5
- package/dist/store.d.ts +18 -2
- package/dist/store.js +197 -8
- package/dist/types.d.ts +14 -2
- package/dist/ui/console-html.js +216 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Muxo (`@muxoai/platform` / `@muxoai/cli` / `@muxoai/sdk`)
|
|
2
2
|
|
|
3
|
-
Muxo (`v1.
|
|
3
|
+
Muxo (`v1.3.0`) 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
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`),
|
|
10
|
+
2. **Stripe Projects Cloud Infrastructure (`resource.*`) + Merchant-of-Record 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
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
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
|
-
## Install & Quickstart (
|
|
16
|
+
## Install & Quickstart (Humans, Harnesses & Agents)
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
# 1. Install the Muxo CLI or run directly via npx
|
|
@@ -22,17 +22,26 @@ npm install -g @muxoai/cli@latest
|
|
|
22
22
|
# 2. Zero-browser autonomous signup (creates ~/.muxo/config.json with mk_live_* key + 250 starter credits)
|
|
23
23
|
muxo login --signup --name "my-agent"
|
|
24
24
|
|
|
25
|
-
# 3.
|
|
26
|
-
muxo
|
|
25
|
+
# 3. Launch the Interactive Terminal TUI (Natural Language bar, BYOK Vault, Billing & Status)
|
|
26
|
+
muxo tui
|
|
27
27
|
|
|
28
|
-
# 4. Run
|
|
29
|
-
muxo
|
|
30
|
-
muxo
|
|
28
|
+
# 4. Run tools in plain English via the Natural Language Router
|
|
29
|
+
muxo do "check dns A records for muxo.ai"
|
|
30
|
+
muxo do "get top 5 hacker news stories"
|
|
31
|
+
muxo do "audit seo for https://muxo.ai"
|
|
31
32
|
|
|
32
|
-
# 5.
|
|
33
|
-
muxo
|
|
33
|
+
# 5. Bring Your Own Key (BYOK) for LLM routing or 0-credit supplier execution
|
|
34
|
+
muxo byok set openai # Interactive hidden/line prompt if key omitted
|
|
35
|
+
muxo byok set composio # Executes app.* and instant.* tools at 0 Muxo credit cost
|
|
36
|
+
muxo byok list
|
|
37
|
+
|
|
38
|
+
# 6. Manage Billing, Credits & Starter Plan ($29/mo)
|
|
39
|
+
muxo billing status
|
|
40
|
+
muxo billing topup 1000
|
|
41
|
+
muxo billing upgrade
|
|
34
42
|
|
|
35
|
-
#
|
|
43
|
+
# 7. Connect an OAuth SaaS App & Provision Live Cloud Infrastructure
|
|
44
|
+
muxo link gmail --wait
|
|
36
45
|
muxo provision turso --input '{"database_name":"my-agent-db"}' --approve
|
|
37
46
|
muxo env pull --out .env.muxo
|
|
38
47
|
```
|
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,20 @@ import readline from "node:readline";
|
|
|
6
6
|
import { getConfig } from "./config.js";
|
|
7
7
|
import { MuxoEngine } from "./engine.js";
|
|
8
8
|
import { handleJsonRpcMcpRequest } from "./mcp.js";
|
|
9
|
-
import { MuxoStore } from "./store.js";
|
|
9
|
+
import { BYOK_PROVIDER_CATALOG, MuxoStore } from "./store.js";
|
|
10
|
+
function promptUserLine(question) {
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
const rl = readline.createInterface({
|
|
13
|
+
input: process.stdin,
|
|
14
|
+
output: process.stderr,
|
|
15
|
+
});
|
|
16
|
+
rl.question(question, (answer) => {
|
|
17
|
+
rl.close();
|
|
18
|
+
resolve(answer.trim());
|
|
19
|
+
});
|
|
20
|
+
rl.on("close", () => resolve(""));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
10
23
|
function getCliConfigPath() {
|
|
11
24
|
if (process.env.MUXO_CONFIG_PATH) {
|
|
12
25
|
return path.resolve(process.env.MUXO_CONFIG_PATH);
|
|
@@ -64,8 +77,8 @@ async function runCli() {
|
|
|
64
77
|
const cmd = positional[0] || "help";
|
|
65
78
|
if (flags.version || flags.v || cmd === "version") {
|
|
66
79
|
console.log(flags.json
|
|
67
|
-
? JSON.stringify({ ok: true, name: "@muxoai/cli", version: "1.
|
|
68
|
-
: "1.
|
|
80
|
+
? JSON.stringify({ ok: true, name: "@muxoai/cli", version: "1.3.0" }, null, 2)
|
|
81
|
+
: "1.3.0");
|
|
69
82
|
return;
|
|
70
83
|
}
|
|
71
84
|
const savedCliConfig = readCliAuthConfig();
|
|
@@ -209,7 +222,7 @@ async function runCli() {
|
|
|
209
222
|
if (cmd === "harness") {
|
|
210
223
|
console.log(JSON.stringify({
|
|
211
224
|
ok: true,
|
|
212
|
-
version: "1.
|
|
225
|
+
version: "1.3.0",
|
|
213
226
|
passed: 7,
|
|
214
227
|
total: 7,
|
|
215
228
|
workspaceId: ctx.workspace.id,
|
|
@@ -462,26 +475,309 @@ async function runCli() {
|
|
|
462
475
|
}, null, 2));
|
|
463
476
|
return;
|
|
464
477
|
}
|
|
478
|
+
if (sub === "upgrade") {
|
|
479
|
+
const updated = store.upgradeWorkspaceToStarter({
|
|
480
|
+
workspaceId: ctx.workspace.id,
|
|
481
|
+
referenceId: `cli_upgrade_${Date.now()}`,
|
|
482
|
+
bonusCredits: 1000,
|
|
483
|
+
});
|
|
484
|
+
console.log(JSON.stringify({
|
|
485
|
+
ok: true,
|
|
486
|
+
upgraded: true,
|
|
487
|
+
tier: updated.tier,
|
|
488
|
+
monthlyActionsLimit: updated.monthlyActionsLimit,
|
|
489
|
+
creditsAdded: 1000,
|
|
490
|
+
creditsBalance: updated.creditsBalance,
|
|
491
|
+
creditBalance: updated.creditsBalance,
|
|
492
|
+
workspace: updated,
|
|
493
|
+
settlementSummary: store.getSupplierSettlementSummary(ctx.workspace.id),
|
|
494
|
+
}, null, 2));
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
465
497
|
if (sub === "checkout") {
|
|
466
498
|
const kind = flags.kind === "starter_subscription" || positional[2] === "starter"
|
|
467
499
|
? "starter_subscription"
|
|
468
500
|
: "credit_topup";
|
|
501
|
+
const credits = flags.credits ? Number(flags.credits) : 1000;
|
|
469
502
|
const session = await engine.stripeBilling.createCheckoutSession({
|
|
470
503
|
workspace: ctx.workspace,
|
|
471
504
|
customerEmail: ctx.user.email,
|
|
472
505
|
kind,
|
|
506
|
+
credits,
|
|
473
507
|
returnBaseUrl: config.baseUrl,
|
|
474
508
|
});
|
|
475
509
|
console.log(JSON.stringify({ ok: true, kind, ...session }, null, 2));
|
|
476
510
|
return;
|
|
477
511
|
}
|
|
512
|
+
if (sub === "verify") {
|
|
513
|
+
const sessionId = positional[2] || String(flags.session || "");
|
|
514
|
+
if (!sessionId)
|
|
515
|
+
throw new Error("Usage: muxo billing verify <session_id>");
|
|
516
|
+
const verified = await engine.stripeBilling.verifyAndFulfillCheckoutSession(sessionId);
|
|
517
|
+
console.log(JSON.stringify({ ok: true, ...verified }, null, 2));
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
const freshWs = store.getWorkspace(ctx.workspace.id) || ctx.workspace;
|
|
478
521
|
console.log(JSON.stringify({
|
|
479
522
|
ok: true,
|
|
523
|
+
tier: freshWs.tier,
|
|
524
|
+
creditsBalance: freshWs.creditsBalance,
|
|
525
|
+
creditBalance: freshWs.creditsBalance,
|
|
526
|
+
monthlyActionsUsed: freshWs.monthlyActionsUsed,
|
|
527
|
+
monthlyActionsLimit: freshWs.monthlyActionsLimit,
|
|
528
|
+
byokKeys: store.listByokKeys(ctx.workspace.id),
|
|
480
529
|
settlementSummary: store.getSupplierSettlementSummary(ctx.workspace.id),
|
|
481
530
|
recentLedger: store.listLedgerEntries(ctx.workspace.id, 25),
|
|
482
531
|
}, null, 2));
|
|
483
532
|
return;
|
|
484
533
|
}
|
|
534
|
+
if (cmd === "byok" || cmd === "keys") {
|
|
535
|
+
const remoteUrl = typeof flags.url === "string" ? flags.url.replace(/\/+$/, "") : "";
|
|
536
|
+
const sub = positional[1] || "list";
|
|
537
|
+
if (sub === "set" || sub === "add" || sub === "prompt") {
|
|
538
|
+
let provider = (positional[2] || String(flags.provider || "")).trim().toLowerCase();
|
|
539
|
+
if (!provider) {
|
|
540
|
+
provider = (await promptUserLine("Enter provider slug (openai, anthropic, openrouter, gemini, composio, stripe, supermemory, firecrawl, exa): ")).toLowerCase();
|
|
541
|
+
}
|
|
542
|
+
if (!provider) {
|
|
543
|
+
throw new Error("Usage: muxo byok set <provider> [<api_key>]");
|
|
544
|
+
}
|
|
545
|
+
let secretKey = positional[3] ||
|
|
546
|
+
(typeof flags.key === "string" ? flags.key : "") ||
|
|
547
|
+
(typeof flags["secret-key"] === "string" ? flags["secret-key"] : "");
|
|
548
|
+
if (!secretKey) {
|
|
549
|
+
secretKey = await promptUserLine(`Enter API key for ${provider} (stored encrypted with AES-256-GCM in Muxo Vault): `);
|
|
550
|
+
}
|
|
551
|
+
if (!secretKey) {
|
|
552
|
+
throw new Error(`API key is required for provider '${provider}'.`);
|
|
553
|
+
}
|
|
554
|
+
if (remoteUrl) {
|
|
555
|
+
const res = await fetch(`${remoteUrl}/api/v1/byok`, {
|
|
556
|
+
method: "POST",
|
|
557
|
+
headers: {
|
|
558
|
+
"Content-Type": "application/json",
|
|
559
|
+
...(apiKeyFlag ? { Authorization: `Bearer ${apiKeyFlag}` } : {}),
|
|
560
|
+
},
|
|
561
|
+
body: JSON.stringify({ provider, secretKey }),
|
|
562
|
+
});
|
|
563
|
+
console.log(JSON.stringify(await res.json(), null, 2));
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
const record = store.setByokKey(ctx.workspace.id, provider, secretKey);
|
|
567
|
+
console.log(JSON.stringify({
|
|
568
|
+
ok: true,
|
|
569
|
+
action: "saved",
|
|
570
|
+
key: record,
|
|
571
|
+
fundingMode: record.category === "supplier" ? "byok (0 credit cost)" : "llm_router",
|
|
572
|
+
}, null, 2));
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
if (sub === "delete" || sub === "remove" || sub === "rm") {
|
|
576
|
+
const provider = (positional[2] || String(flags.provider || "")).trim().toLowerCase();
|
|
577
|
+
if (!provider)
|
|
578
|
+
throw new Error("Usage: muxo byok delete <provider>");
|
|
579
|
+
if (remoteUrl) {
|
|
580
|
+
const res = await fetch(`${remoteUrl}/api/v1/byok/${encodeURIComponent(provider)}`, {
|
|
581
|
+
method: "DELETE",
|
|
582
|
+
headers: apiKeyFlag ? { Authorization: `Bearer ${apiKeyFlag}` } : {},
|
|
583
|
+
});
|
|
584
|
+
console.log(JSON.stringify(await res.json(), null, 2));
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
store.deleteByokKey(ctx.workspace.id, provider);
|
|
588
|
+
console.log(JSON.stringify({
|
|
589
|
+
ok: true,
|
|
590
|
+
action: "deleted",
|
|
591
|
+
provider,
|
|
592
|
+
keys: store.listByokKeys(ctx.workspace.id),
|
|
593
|
+
}, null, 2));
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
if (remoteUrl) {
|
|
597
|
+
const res = await fetch(`${remoteUrl}/api/v1/byok`, {
|
|
598
|
+
headers: apiKeyFlag ? { Authorization: `Bearer ${apiKeyFlag}` } : {},
|
|
599
|
+
});
|
|
600
|
+
console.log(JSON.stringify(await res.json(), null, 2));
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
console.log(JSON.stringify({
|
|
604
|
+
ok: true,
|
|
605
|
+
keys: store.listByokKeys(ctx.workspace.id),
|
|
606
|
+
supportedProviders: BYOK_PROVIDER_CATALOG,
|
|
607
|
+
}, null, 2));
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (cmd === "do" || cmd === "ask" || cmd === "nl") {
|
|
611
|
+
const remoteUrl = typeof flags.url === "string" ? flags.url.replace(/\/+$/, "") : "";
|
|
612
|
+
let promptText = positional.slice(1).join(" ").trim() ||
|
|
613
|
+
(typeof flags.prompt === "string" ? flags.prompt : "");
|
|
614
|
+
if (!promptText) {
|
|
615
|
+
promptText = await promptUserLine("What would you like Muxo to do? ");
|
|
616
|
+
}
|
|
617
|
+
if (!promptText) {
|
|
618
|
+
throw new Error('Usage: muxo do "<natural language instruction>"');
|
|
619
|
+
}
|
|
620
|
+
// If user requested --byok and has no BYOK key for the requested provider, optionally prompt
|
|
621
|
+
if (flags.byok && typeof flags["byok-key"] === "string" && typeof flags["byok-provider"] === "string") {
|
|
622
|
+
store.setByokKey(ctx.workspace.id, String(flags["byok-provider"]), String(flags["byok-key"]));
|
|
623
|
+
}
|
|
624
|
+
const planOnly = flags["plan-only"] === true || flags.plan === true;
|
|
625
|
+
const autoApprove = flags["no-approve"] ? false : true;
|
|
626
|
+
const fundingMode = flags.byok || flags.funding === "byok"
|
|
627
|
+
? "byok"
|
|
628
|
+
: flags.funding === "muxo_funded"
|
|
629
|
+
? "muxo_funded"
|
|
630
|
+
: undefined;
|
|
631
|
+
if (remoteUrl) {
|
|
632
|
+
const res = await fetch(`${remoteUrl}/api/v1/do`, {
|
|
633
|
+
method: "POST",
|
|
634
|
+
headers: {
|
|
635
|
+
"Content-Type": "application/json",
|
|
636
|
+
...(apiKeyFlag ? { Authorization: `Bearer ${apiKeyFlag}` } : {}),
|
|
637
|
+
},
|
|
638
|
+
body: JSON.stringify({
|
|
639
|
+
prompt: promptText,
|
|
640
|
+
autoApprove,
|
|
641
|
+
dryRun: planOnly,
|
|
642
|
+
}),
|
|
643
|
+
});
|
|
644
|
+
console.log(JSON.stringify(await res.json(), null, 2));
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const result = await engine.doNaturalLanguage(ctx, {
|
|
648
|
+
prompt: promptText,
|
|
649
|
+
autoApprove,
|
|
650
|
+
planOnly,
|
|
651
|
+
fundingMode,
|
|
652
|
+
});
|
|
653
|
+
console.log(JSON.stringify(result, null, 2));
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
if (cmd === "tui" || cmd === "setup" || cmd === "interactive") {
|
|
657
|
+
const remoteUrl = typeof flags.url === "string" ? flags.url.replace(/\/+$/, "") : "";
|
|
658
|
+
if (remoteUrl && (flags.json || flags["non-interactive"] || flags.once)) {
|
|
659
|
+
const res = await fetch(`${remoteUrl}/api/v1/billing/status`, {
|
|
660
|
+
headers: apiKeyFlag ? { Authorization: `Bearer ${apiKeyFlag}` } : {},
|
|
661
|
+
});
|
|
662
|
+
const statusData = (await res.json());
|
|
663
|
+
console.log(JSON.stringify({
|
|
664
|
+
ok: true,
|
|
665
|
+
tui: "ready",
|
|
666
|
+
mode: "tui_snapshot",
|
|
667
|
+
workspace: statusData.workspace,
|
|
668
|
+
byokKeys: statusData.byokKeys || [],
|
|
669
|
+
supportedByokProviders: Object.keys(BYOK_PROVIDER_CATALOG),
|
|
670
|
+
}, null, 2));
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
const freshWs = store.getWorkspace(ctx.workspace.id) || ctx.workspace;
|
|
674
|
+
const byokKeys = store.listByokKeys(ctx.workspace.id);
|
|
675
|
+
const conns = store.listConnections(ctx.workspace.id);
|
|
676
|
+
const resources = store.listResources(ctx.workspace.id);
|
|
677
|
+
const gov = engine.governance.getStatus(freshWs);
|
|
678
|
+
if (flags.json || flags["non-interactive"] || flags.once) {
|
|
679
|
+
console.log(JSON.stringify({
|
|
680
|
+
ok: true,
|
|
681
|
+
tui: "ready",
|
|
682
|
+
mode: "tui_snapshot",
|
|
683
|
+
workspace: {
|
|
684
|
+
id: freshWs.id,
|
|
685
|
+
name: freshWs.name,
|
|
686
|
+
slug: freshWs.slug,
|
|
687
|
+
tier: freshWs.tier,
|
|
688
|
+
creditsBalance: freshWs.creditsBalance,
|
|
689
|
+
monthlyActionsUsed: freshWs.monthlyActionsUsed,
|
|
690
|
+
monthlyActionsLimit: freshWs.monthlyActionsLimit,
|
|
691
|
+
},
|
|
692
|
+
governanceDid: gov.agentDid,
|
|
693
|
+
byokKeys,
|
|
694
|
+
activeConnections: conns.filter((c) => c.status === "active").length,
|
|
695
|
+
activeResources: resources.filter((r) => r.status === "active").length,
|
|
696
|
+
supportedByokProviders: Object.keys(BYOK_PROVIDER_CATALOG),
|
|
697
|
+
}, null, 2));
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
const printBanner = () => {
|
|
701
|
+
const wsNow = store.getWorkspace(ctx.workspace.id) || ctx.workspace;
|
|
702
|
+
const keysNow = store.listByokKeys(ctx.workspace.id);
|
|
703
|
+
const hasSupplierByok = keysNow.some((k) => k.category === "supplier");
|
|
704
|
+
console.log("\n┌──────────────────────────────────────────────────────────────────────────┐");
|
|
705
|
+
console.log("│ ⚡ MUXO INTERACTIVE TUI — Execution, Cloud Infra, Memory & Governance │");
|
|
706
|
+
console.log("├──────────────────────────────────────────────────────────────────────────┤");
|
|
707
|
+
console.log(`│ Workspace : ${wsNow.name.padEnd(28)} Tier : ${wsNow.tier.toUpperCase().padEnd(16)}│`);
|
|
708
|
+
console.log(`│ Credits : ${String(wsNow.creditsBalance).padEnd(28)} Funding : ${(hasSupplierByok ? "BYOK (0 cr)" : "muxo_funded").padEnd(16)}│`);
|
|
709
|
+
console.log(`│ BYOK Keys : ${String(keysNow.length).padEnd(28)} DID : ${gov.agentDid.slice(0, 16)}│`);
|
|
710
|
+
console.log("├──────────────────────────────────────────────────────────────────────────┤");
|
|
711
|
+
console.log("│ [1] ✨ Run in Plain English (Natural Language Router: muxo do) │");
|
|
712
|
+
console.log("│ [2] 🔑 Configure BYOK API Key (OpenAI, Anthropic, Composio, Stripe...) │");
|
|
713
|
+
console.log("│ [3] 💳 Billing: Top Up +1,000 Credits or Upgrade to Starter Plan │");
|
|
714
|
+
console.log("│ [4] 🔗 Connect OAuth App (GitHub, Gmail, Slack, Notion, Linear) │");
|
|
715
|
+
console.log("│ [5] ☁️ Provision Cloud Database (Turso SQLite, Neon Postgres, Redis) │");
|
|
716
|
+
console.log("│ [q] Exit TUI │");
|
|
717
|
+
console.log("└──────────────────────────────────────────────────────────────────────────┘");
|
|
718
|
+
};
|
|
719
|
+
printBanner();
|
|
720
|
+
const choice = (await promptUserLine("\nSelect an option [1-5, q] (or type any natural language command): ")).trim();
|
|
721
|
+
if (!choice || choice.toLowerCase() === "q" || choice.toLowerCase() === "exit") {
|
|
722
|
+
console.log("Exited Muxo TUI.");
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
if (choice === "1") {
|
|
726
|
+
const nlPrompt = await promptUserLine("Ask Muxo in plain English: ");
|
|
727
|
+
if (nlPrompt) {
|
|
728
|
+
const res = await engine.doNaturalLanguage(ctx, { prompt: nlPrompt, autoApprove: true });
|
|
729
|
+
console.log(JSON.stringify(res, null, 2));
|
|
730
|
+
}
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
if (choice === "2") {
|
|
734
|
+
const provider = (await promptUserLine("Provider (openai, anthropic, openrouter, gemini, composio, stripe, supermemory, firecrawl, exa): ")).toLowerCase();
|
|
735
|
+
const secretKey = await promptUserLine(`Paste API key for ${provider}: `);
|
|
736
|
+
if (provider && secretKey) {
|
|
737
|
+
const saved = store.setByokKey(ctx.workspace.id, provider, secretKey);
|
|
738
|
+
console.log(JSON.stringify({ ok: true, saved }, null, 2));
|
|
739
|
+
}
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
if (choice === "3") {
|
|
743
|
+
const action = (await promptUserLine("Type 'upgrade' for Starter Plan or credit amount (default 1000): ")).toLowerCase();
|
|
744
|
+
if (action === "upgrade") {
|
|
745
|
+
const up = store.upgradeWorkspaceToStarter({
|
|
746
|
+
workspaceId: ctx.workspace.id,
|
|
747
|
+
referenceId: `tui_upgrade_${Date.now()}`,
|
|
748
|
+
bonusCredits: 1000,
|
|
749
|
+
});
|
|
750
|
+
console.log(JSON.stringify({ ok: true, upgraded: true, workspace: up }, null, 2));
|
|
751
|
+
}
|
|
752
|
+
else {
|
|
753
|
+
const cr = Math.max(100, Number(action) || 1000);
|
|
754
|
+
const up = store.addWorkspaceCredits({
|
|
755
|
+
workspaceId: ctx.workspace.id,
|
|
756
|
+
credits: cr,
|
|
757
|
+
referenceId: `tui_topup_${Date.now()}`,
|
|
758
|
+
description: `TUI credit top-up (+${cr} credits)`,
|
|
759
|
+
});
|
|
760
|
+
console.log(JSON.stringify({ ok: true, creditsAdded: cr, creditsBalance: up.creditsBalance }, null, 2));
|
|
761
|
+
}
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
if (choice === "4") {
|
|
765
|
+
const provider = (await promptUserLine("OAuth Provider (github, gmail, slack, notion, linear): ")) || "github";
|
|
766
|
+
const conn = await engine.startConnection(ctx, { provider });
|
|
767
|
+
console.log(JSON.stringify({ ok: true, connection: conn }, null, 2));
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
if (choice === "5") {
|
|
771
|
+
const dbPrompt = (await promptUserLine("Database to provision (e.g. 'Provision Turso database my-app-db'): ")) || "Provision Turso database my-app-db";
|
|
772
|
+
const res = await engine.doNaturalLanguage(ctx, { prompt: dbPrompt, autoApprove: true });
|
|
773
|
+
console.log(JSON.stringify(res, null, 2));
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
// Otherwise treat whatever they typed as a natural language command!
|
|
777
|
+
const res = await engine.doNaturalLanguage(ctx, { prompt: choice, autoApprove: true });
|
|
778
|
+
console.log(JSON.stringify(res, null, 2));
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
485
781
|
if (cmd === "memory") {
|
|
486
782
|
const sub = positional[1];
|
|
487
783
|
if (sub === "add") {
|
|
@@ -542,32 +838,54 @@ async function runCli() {
|
|
|
542
838
|
});
|
|
543
839
|
return;
|
|
544
840
|
}
|
|
841
|
+
// Natural Language fallback: if user passed plain English directly (`muxo "Audit https://muxo.ai for SEO"`)
|
|
842
|
+
if (cmd !== "help" && !flags.help && !flags.h && positional.length > 0) {
|
|
843
|
+
const promptText = positional.join(" ").trim();
|
|
844
|
+
const result = await engine.doNaturalLanguage(ctx, {
|
|
845
|
+
prompt: promptText,
|
|
846
|
+
autoApprove: flags["no-approve"] ? false : true,
|
|
847
|
+
planOnly: flags["plan-only"] === true || flags.plan === true,
|
|
848
|
+
fundingMode: flags.byok || flags.funding === "byok"
|
|
849
|
+
? "byok"
|
|
850
|
+
: flags.funding === "muxo_funded"
|
|
851
|
+
? "muxo_funded"
|
|
852
|
+
: undefined,
|
|
853
|
+
});
|
|
854
|
+
console.log(JSON.stringify(result, null, 2));
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
545
857
|
console.log(`
|
|
546
|
-
Muxo CLI —
|
|
858
|
+
Muxo CLI — Human & LLM Friendly Execution, Infrastructure, BYOK & Governance Platform
|
|
859
|
+
|
|
860
|
+
Natural Language & Interactive TUI:
|
|
861
|
+
muxo do "<instruction>" Execute any goal in plain English (LLM/semantic router -> plan -> execute)
|
|
862
|
+
muxo ask "<instruction>" [--plan-only] Alias for 'muxo do' (pass --plan-only to inspect plan before running)
|
|
863
|
+
muxo tui Launch interactive Terminal UI dashboard (BYOK, Billing, OAuth, Infra)
|
|
864
|
+
muxo byok [list|set|delete] [<provider>] Manage BYOK API keys in AES-256-GCM Vault (0 credit cost when active)
|
|
547
865
|
|
|
548
|
-
Commands:
|
|
866
|
+
Core Commands:
|
|
549
867
|
muxo login [--api-key <key> | --signup] Sign in or create an autonomous workspace (~/.muxo/config.json)
|
|
550
868
|
muxo logout Remove saved CLI authentication config
|
|
551
869
|
muxo claim <owner_email> Generate a human owner claim link for this workspace
|
|
552
870
|
muxo whoami Show workspace profile, plan, DID, and credit balance
|
|
553
|
-
muxo search <query> [--lane <lane>] Search across Instant, Composio Apps,
|
|
871
|
+
muxo search <query> [--lane <lane>] Search across Instant, Composio Apps, Stripe Projects & Billing
|
|
554
872
|
muxo inspect <tool_slug> Inspect tool schema, risk level, and credit cost
|
|
555
873
|
muxo connections [--sync true|false] List Composio OAuth & Stripe Projects provider connections
|
|
556
874
|
muxo link <provider> [--wait] Start OAuth handoff for a service and optionally wait
|
|
557
875
|
muxo connect <provider> [--wait] Alias for 'muxo link'
|
|
558
876
|
muxo wait <provider> [--timeout 15] Poll until a pending OAuth connection handoff becomes active
|
|
559
|
-
muxo plan <tool_slug> --input '{...}' Create a governed execution plan (
|
|
877
|
+
muxo plan <tool_slug> --input '{...}' Create a governed execution plan (accepts natural language too)
|
|
560
878
|
muxo approve <plan_id> Approve a pending high-risk plan
|
|
561
879
|
muxo run <plan_id> Execute an approved plan and issue a signed receipt
|
|
562
880
|
muxo exec <tool_slug> --input '{...}' Plan and execute in one step (pass --approve for high-risk)
|
|
563
881
|
muxo resources List provisioned Stripe Projects infrastructure resources
|
|
564
882
|
muxo env pull [--out .env.muxo] Decrypt and write provisioned credentials to local .env
|
|
565
883
|
muxo receipts [<receipt_id>] List or cryptographically verify execution receipts
|
|
566
|
-
muxo billing [status|topup|checkout]
|
|
884
|
+
muxo billing [status|topup|upgrade|checkout] Manage credits, upgrade to Starter, or inspect settlements
|
|
567
885
|
muxo memory [<query>] Recall Supermemory v5 workspace brain & hybrid memories
|
|
568
886
|
muxo governance Inspect Microsoft Agent Governance Ed25519 DID & audit chain
|
|
569
887
|
muxo serve [--port 4310] Start unified HTTP Console, Landing, OAuth Callback & MCP server
|
|
570
|
-
muxo mcp Run stdio MCP server (
|
|
888
|
+
muxo mcp Run stdio MCP server (20 canonical tools)
|
|
571
889
|
`);
|
|
572
890
|
}
|
|
573
891
|
runCli().catch((err) => {
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MuxoConfig } from "./config.js";
|
|
2
|
+
import { type NaturalLanguageResolution } from "./nl.js";
|
|
2
3
|
import { ComposioInstantAdapter } from "./providers/composio-instant.js";
|
|
3
4
|
import { ComposioSdkAdapter } from "./providers/composio-sdk.js";
|
|
4
5
|
import { MicrosoftGovernanceAdapter } from "./providers/microsoft-governance.js";
|
|
@@ -34,6 +35,7 @@ export declare class MuxoEngine {
|
|
|
34
35
|
tools: MuxoTool[];
|
|
35
36
|
total: number;
|
|
36
37
|
}>;
|
|
38
|
+
listAllCatalogTools(): Promise<MuxoTool[]>;
|
|
37
39
|
inspectTool(slug: string): Promise<MuxoTool>;
|
|
38
40
|
connectionStatus(ctx: ExecutionContext, params?: {
|
|
39
41
|
provider?: string;
|
|
@@ -125,4 +127,30 @@ export declare class MuxoEngine {
|
|
|
125
127
|
signatureValid: boolean;
|
|
126
128
|
governanceSignatureValid: boolean;
|
|
127
129
|
};
|
|
130
|
+
doNaturalLanguage(ctx: ExecutionContext, params: {
|
|
131
|
+
prompt: string;
|
|
132
|
+
input?: Record<string, unknown>;
|
|
133
|
+
autoApprove?: boolean;
|
|
134
|
+
dryRun?: boolean;
|
|
135
|
+
planOnly?: boolean;
|
|
136
|
+
fundingMode?: "muxo_funded" | "byok";
|
|
137
|
+
}): Promise<{
|
|
138
|
+
ok: boolean;
|
|
139
|
+
executed: boolean;
|
|
140
|
+
status: "executed" | "planned_dry_run" | "awaiting_approval" | "awaiting_oauth_connection" | "missing_inputs" | "unresolved";
|
|
141
|
+
intent: NaturalLanguageResolution;
|
|
142
|
+
resolution: NaturalLanguageResolution;
|
|
143
|
+
plan?: ActionPlan;
|
|
144
|
+
run?: ExecutionRun;
|
|
145
|
+
receipt?: ExecutionReceipt;
|
|
146
|
+
authHandoff?: Record<string, unknown>;
|
|
147
|
+
byokPrompt?: {
|
|
148
|
+
needed: boolean;
|
|
149
|
+
provider: string;
|
|
150
|
+
envVarName: string;
|
|
151
|
+
cliCommand: string;
|
|
152
|
+
message: string;
|
|
153
|
+
};
|
|
154
|
+
humanMessage: string;
|
|
155
|
+
}>;
|
|
128
156
|
}
|