@muxoai/sdk 1.2.2 → 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/README.md +48 -28
- package/{dist/sdk.d.ts → index.d.ts} +7 -0
- package/index.js +1 -0
- package/package.json +16 -27
- package/dist/sdk.js +0 -217
- package/dist/types.d.ts +0 -273
- package/dist/types.js +0 -1
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 |
|
|
@@ -156,6 +156,13 @@ export declare class MuxoClient {
|
|
|
156
156
|
totalCustomerChargedCredits?: number;
|
|
157
157
|
};
|
|
158
158
|
}>;
|
|
159
|
+
settlements(): Promise<{
|
|
160
|
+
ok: true;
|
|
161
|
+
settlementSummary: SupplierSettlementSummary & {
|
|
162
|
+
totalCustomerChargedCredits?: number;
|
|
163
|
+
};
|
|
164
|
+
summary?: SupplierSettlementSummary;
|
|
165
|
+
}>;
|
|
159
166
|
getSettlements(): Promise<{
|
|
160
167
|
ok: true;
|
|
161
168
|
settlementSummary: SupplierSettlementSummary & {
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@muxoai/platform";
|
package/package.json
CHANGED
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muxoai/sdk",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Muxo TypeScript
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/sdk.js",
|
|
7
|
-
"types": "./dist/sdk.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/sdk.d.ts",
|
|
11
|
-
"import": "./dist/sdk.js"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist",
|
|
16
|
-
"README.md"
|
|
17
|
-
],
|
|
18
|
-
"keywords": [
|
|
19
|
-
"muxo",
|
|
20
|
-
"ai-agents",
|
|
21
|
-
"mcp",
|
|
22
|
-
"composio",
|
|
23
|
-
"stripe-projects",
|
|
24
|
-
"supermemory",
|
|
25
|
-
"microsoft-agent-governance"
|
|
26
|
-
],
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "Muxo TypeScript & Node.js SDK — Governed Agent Execution, OAuth Handoff, Cloud Provisioning & Cryptographic Receipts",
|
|
27
5
|
"license": "MIT",
|
|
28
|
-
"
|
|
29
|
-
|
|
6
|
+
"homepage": "https://muxo.ai",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/muxoai/muxo.git"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./index.js",
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@muxoai/platform": "1.2.3"
|
|
30
19
|
}
|
|
31
|
-
}
|
|
20
|
+
}
|
package/dist/sdk.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
export class MuxoClient {
|
|
2
|
-
baseUrl;
|
|
3
|
-
apiKeyResolver;
|
|
4
|
-
fetchImpl;
|
|
5
|
-
timeoutMs;
|
|
6
|
-
constructor(options = {}) {
|
|
7
|
-
this.baseUrl = (options.baseUrl ||
|
|
8
|
-
process.env.MUXO_BASE_URL ||
|
|
9
|
-
"https://app.muxo.ai").replace(/\/+$/, "");
|
|
10
|
-
if (typeof options.apiKey === "function") {
|
|
11
|
-
this.apiKeyResolver = options.apiKey;
|
|
12
|
-
}
|
|
13
|
-
else if (typeof options.apiKey === "string") {
|
|
14
|
-
const key = options.apiKey;
|
|
15
|
-
this.apiKeyResolver = () => key;
|
|
16
|
-
}
|
|
17
|
-
else if (process.env.MUXO_API_KEY) {
|
|
18
|
-
const key = process.env.MUXO_API_KEY;
|
|
19
|
-
this.apiKeyResolver = () => key;
|
|
20
|
-
}
|
|
21
|
-
this.fetchImpl = options.fetch || fetch;
|
|
22
|
-
this.timeoutMs = options.timeoutMs ?? 30000;
|
|
23
|
-
}
|
|
24
|
-
async request(path, init = {}) {
|
|
25
|
-
const headers = {
|
|
26
|
-
Accept: "application/json",
|
|
27
|
-
};
|
|
28
|
-
if (this.apiKeyResolver) {
|
|
29
|
-
const token = await this.apiKeyResolver();
|
|
30
|
-
if (token)
|
|
31
|
-
headers.Authorization = `Bearer ${token}`;
|
|
32
|
-
}
|
|
33
|
-
if (init.body !== undefined) {
|
|
34
|
-
headers["Content-Type"] = "application/json";
|
|
35
|
-
}
|
|
36
|
-
const res = await this.fetchImpl(`${this.baseUrl}${path}`, {
|
|
37
|
-
method: init.method || "GET",
|
|
38
|
-
headers,
|
|
39
|
-
body: init.body !== undefined ? JSON.stringify(init.body) : undefined,
|
|
40
|
-
signal: AbortSignal.timeout(this.timeoutMs),
|
|
41
|
-
});
|
|
42
|
-
const payload = (await res.json());
|
|
43
|
-
if (!res.ok || payload.ok === false) {
|
|
44
|
-
throw new Error(String(payload.error || `Muxo request failed with HTTP ${res.status}`));
|
|
45
|
-
}
|
|
46
|
-
return payload;
|
|
47
|
-
}
|
|
48
|
-
static async signup(params = {}, baseUrl = "https://app.muxo.ai") {
|
|
49
|
-
const client = new MuxoClient({ baseUrl });
|
|
50
|
-
return client.signupAgent({
|
|
51
|
-
agentName: params.agentName || params.workspaceName || "muxo-sdk-agent",
|
|
52
|
-
harness: params.harness || "muxo-sdk",
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
async signupAgent(params) {
|
|
56
|
-
return this.request("/api/v1/agents/signup", {
|
|
57
|
-
method: "POST",
|
|
58
|
-
body: params,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
async whoami() {
|
|
62
|
-
const res = await this.mcpCall("get_organization", {});
|
|
63
|
-
const workspace = (res.workspace || res.organization);
|
|
64
|
-
return {
|
|
65
|
-
ok: true,
|
|
66
|
-
...res,
|
|
67
|
-
workspace,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
async mcpCall(name, args = {}) {
|
|
71
|
-
const rpcRes = await this.request("/mcp", {
|
|
72
|
-
method: "POST",
|
|
73
|
-
body: {
|
|
74
|
-
jsonrpc: "2.0",
|
|
75
|
-
id: Date.now(),
|
|
76
|
-
method: "tools/call",
|
|
77
|
-
params: { name, arguments: args },
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
if (rpcRes.error) {
|
|
81
|
-
throw new Error(rpcRes.error.message || "MCP call failed");
|
|
82
|
-
}
|
|
83
|
-
if (rpcRes.result?.structuredContent) {
|
|
84
|
-
return rpcRes.result.structuredContent;
|
|
85
|
-
}
|
|
86
|
-
const text = rpcRes.result?.content?.[0]?.text;
|
|
87
|
-
if (text) {
|
|
88
|
-
return JSON.parse(text);
|
|
89
|
-
}
|
|
90
|
-
return (rpcRes.result || {});
|
|
91
|
-
}
|
|
92
|
-
async searchTools(params) {
|
|
93
|
-
const qs = new URLSearchParams();
|
|
94
|
-
if (params?.query)
|
|
95
|
-
qs.set("query", params.query);
|
|
96
|
-
if (params?.lane)
|
|
97
|
-
qs.set("lane", params.lane);
|
|
98
|
-
if (params?.riskLevel)
|
|
99
|
-
qs.set("risk_level", params.riskLevel);
|
|
100
|
-
if (params?.limit)
|
|
101
|
-
qs.set("limit", String(params.limit));
|
|
102
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
103
|
-
return this.request(`/api/v1/tools${suffix}`);
|
|
104
|
-
}
|
|
105
|
-
async inspectTool(slug) {
|
|
106
|
-
return this.request(`/api/v1/tools/${encodeURIComponent(slug)}`);
|
|
107
|
-
}
|
|
108
|
-
async planAction(params) {
|
|
109
|
-
return this.request("/api/v1/plans", {
|
|
110
|
-
method: "POST",
|
|
111
|
-
body: params,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
async approvePlan(planId) {
|
|
115
|
-
return this.request(`/api/v1/plans/${encodeURIComponent(planId)}/approve`, {
|
|
116
|
-
method: "POST",
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
async executePlan(planId) {
|
|
120
|
-
return this.request(`/api/v1/plans/${encodeURIComponent(planId)}/execute`, {
|
|
121
|
-
method: "POST",
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
async exec(toolSlug, input = {}, options = {}) {
|
|
125
|
-
const planned = await this.planAction({
|
|
126
|
-
toolSlug,
|
|
127
|
-
input,
|
|
128
|
-
reason: options.reason,
|
|
129
|
-
});
|
|
130
|
-
let plan = planned.plan;
|
|
131
|
-
if (plan.approvalStatus === "pending_approval" && options.approve) {
|
|
132
|
-
const approved = await this.approvePlan(plan.id);
|
|
133
|
-
plan = approved.plan;
|
|
134
|
-
}
|
|
135
|
-
const executed = await this.executePlan(plan.id);
|
|
136
|
-
return {
|
|
137
|
-
ok: true,
|
|
138
|
-
plan,
|
|
139
|
-
run: executed.run,
|
|
140
|
-
receipt: executed.receipt,
|
|
141
|
-
settlement: executed.settlement ||
|
|
142
|
-
executed.receipt?.supplierSettlement ||
|
|
143
|
-
null,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
async verifyReceipt(receiptId) {
|
|
147
|
-
const res = await this.request(`/api/v1/receipts/${encodeURIComponent(receiptId)}`);
|
|
148
|
-
const isOk = Boolean(res.valid ?? res.verified ?? true);
|
|
149
|
-
return {
|
|
150
|
-
ok: true,
|
|
151
|
-
valid: isOk,
|
|
152
|
-
verified: isOk,
|
|
153
|
-
receipt: res.receipt,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
async startConnection(paramsOrProvider) {
|
|
157
|
-
const body = typeof paramsOrProvider === "string"
|
|
158
|
-
? { provider: paramsOrProvider }
|
|
159
|
-
: paramsOrProvider;
|
|
160
|
-
return this.request("/api/v1/connections", {
|
|
161
|
-
method: "POST",
|
|
162
|
-
body,
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
async waitForConnection(paramsOrProvider, options) {
|
|
166
|
-
const body = typeof paramsOrProvider === "string"
|
|
167
|
-
? { provider: paramsOrProvider, ...options }
|
|
168
|
-
: paramsOrProvider;
|
|
169
|
-
const res = await this.request("/api/v1/connections/wait", {
|
|
170
|
-
method: "POST",
|
|
171
|
-
body,
|
|
172
|
-
});
|
|
173
|
-
return {
|
|
174
|
-
...res,
|
|
175
|
-
status: res.status || res.connection?.status || "pending",
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
async listResources() {
|
|
179
|
-
return this.request("/api/v1/resources");
|
|
180
|
-
}
|
|
181
|
-
async pullEnv() {
|
|
182
|
-
const res = await this.request("/api/v1/resources/env");
|
|
183
|
-
return Object.assign(res, {
|
|
184
|
-
includes: (substr) => String(res.dotenv || "").includes(substr),
|
|
185
|
-
toString: () => String(res.dotenv || ""),
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
async topupCredits(paramsOrCredits, description) {
|
|
189
|
-
const body = typeof paramsOrCredits === "number"
|
|
190
|
-
? { credits: paramsOrCredits, description }
|
|
191
|
-
: paramsOrCredits;
|
|
192
|
-
const res = await this.request("/api/v1/billing/topup", {
|
|
193
|
-
method: "POST",
|
|
194
|
-
body,
|
|
195
|
-
});
|
|
196
|
-
return {
|
|
197
|
-
...res,
|
|
198
|
-
creditBalance: res.creditBalance ?? res.workspace?.creditsBalance ?? 0,
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
async getBillingStatus() {
|
|
202
|
-
return this.getSettlements();
|
|
203
|
-
}
|
|
204
|
-
async getSettlements() {
|
|
205
|
-
const res = await this.request("/api/v1/billing/settlements");
|
|
206
|
-
if (res.settlementSummary &&
|
|
207
|
-
res.settlementSummary.totalCustomerChargedCredits === undefined) {
|
|
208
|
-
res.settlementSummary.totalCustomerChargedCredits =
|
|
209
|
-
res.settlementSummary.totalCreditsConsumed;
|
|
210
|
-
}
|
|
211
|
-
return res;
|
|
212
|
-
}
|
|
213
|
-
async recallMemory(query) {
|
|
214
|
-
const suffix = query ? `?query=${encodeURIComponent(query)}` : "";
|
|
215
|
-
return this.request(`/api/v1/memory${suffix}`);
|
|
216
|
-
}
|
|
217
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
export type RiskLevel = "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
|
|
2
|
-
export type ProviderLane = "composio_sdk" | "composio_instant" | "stripe_projects";
|
|
3
|
-
export type SubscriptionTier = "free" | "starter";
|
|
4
|
-
export interface GovernancePolicy {
|
|
5
|
-
mode: "monitor" | "enforce";
|
|
6
|
-
requireApprovalFor: RiskLevel[];
|
|
7
|
-
allowInstantWallet: boolean;
|
|
8
|
-
allowProvisioning: boolean;
|
|
9
|
-
maxCreditsPerRun: number;
|
|
10
|
-
blockedToolSlugs?: string[];
|
|
11
|
-
}
|
|
12
|
-
export interface User {
|
|
13
|
-
id: string;
|
|
14
|
-
email: string;
|
|
15
|
-
name: string;
|
|
16
|
-
workspaceId: string;
|
|
17
|
-
role: "owner" | "admin" | "member";
|
|
18
|
-
createdAt: string;
|
|
19
|
-
}
|
|
20
|
-
export interface Workspace {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
slug: string;
|
|
24
|
-
ownerUserId: string;
|
|
25
|
-
tier: SubscriptionTier;
|
|
26
|
-
monthlyActionsLimit: number;
|
|
27
|
-
monthlyActionsUsed: number;
|
|
28
|
-
creditsBalance: number;
|
|
29
|
-
stripeCustomerId: string | null;
|
|
30
|
-
stripeSubscriptionId: string | null;
|
|
31
|
-
projectsEnvName: string;
|
|
32
|
-
policy: GovernancePolicy;
|
|
33
|
-
createdAt: string;
|
|
34
|
-
updatedAt: string;
|
|
35
|
-
}
|
|
36
|
-
export interface ApiKeyRecord {
|
|
37
|
-
id: string;
|
|
38
|
-
workspaceId: string;
|
|
39
|
-
name: string;
|
|
40
|
-
keyPrefix: string;
|
|
41
|
-
environment: "live" | "test";
|
|
42
|
-
scopes: string[];
|
|
43
|
-
lastUsedAt: string | null;
|
|
44
|
-
revokedAt: string | null;
|
|
45
|
-
createdAt: string;
|
|
46
|
-
}
|
|
47
|
-
export interface MuxoTool {
|
|
48
|
-
slug: string;
|
|
49
|
-
upstreamSlug: string;
|
|
50
|
-
name: string;
|
|
51
|
-
description: string;
|
|
52
|
-
lane: ProviderLane;
|
|
53
|
-
providerSlug: string;
|
|
54
|
-
providerName: string;
|
|
55
|
-
categories: string[];
|
|
56
|
-
riskLevel: RiskLevel;
|
|
57
|
-
requiresAuth: boolean;
|
|
58
|
-
creditCost: number;
|
|
59
|
-
billingMode: "customer_oauth" | "provider_wallet" | "resource_provisioning";
|
|
60
|
-
inputSchema: Record<string, unknown>;
|
|
61
|
-
llmContextUrl?: string;
|
|
62
|
-
providerUrl?: string;
|
|
63
|
-
metadata?: Record<string, unknown>;
|
|
64
|
-
}
|
|
65
|
-
export interface ConnectionRecord {
|
|
66
|
-
id: string;
|
|
67
|
-
workspaceId: string;
|
|
68
|
-
lane: ProviderLane;
|
|
69
|
-
providerSlug: string;
|
|
70
|
-
providerName: string;
|
|
71
|
-
status: "active" | "pending" | "expired" | "disconnected";
|
|
72
|
-
externalAccountId: string | null;
|
|
73
|
-
redirectUrl: string | null;
|
|
74
|
-
metadata: Record<string, unknown>;
|
|
75
|
-
updatedAt: string;
|
|
76
|
-
createdAt: string;
|
|
77
|
-
}
|
|
78
|
-
export interface ProvisionedResource {
|
|
79
|
-
id: string;
|
|
80
|
-
workspaceId: string;
|
|
81
|
-
resourceName: string;
|
|
82
|
-
providerSlug: string;
|
|
83
|
-
providerName: string;
|
|
84
|
-
serviceSlug: string;
|
|
85
|
-
planSlug: string | null;
|
|
86
|
-
status: "active" | "provisioning" | "failed" | "removed";
|
|
87
|
-
envVarKeys: string[];
|
|
88
|
-
externalResourceId: string | null;
|
|
89
|
-
metadata: Record<string, unknown>;
|
|
90
|
-
createdAt: string;
|
|
91
|
-
updatedAt: string;
|
|
92
|
-
}
|
|
93
|
-
export interface GovernanceDecisionRecord {
|
|
94
|
-
id: string;
|
|
95
|
-
sdk: "@microsoft/agent-governance-sdk";
|
|
96
|
-
sdkVersion: string;
|
|
97
|
-
policyId: string;
|
|
98
|
-
mode: "monitor" | "enforce";
|
|
99
|
-
agentDid: string;
|
|
100
|
-
agentPublicKey: string;
|
|
101
|
-
actorId: string;
|
|
102
|
-
workspaceId: string;
|
|
103
|
-
action: string;
|
|
104
|
-
riskLevel: RiskLevel;
|
|
105
|
-
decision: "allow" | "deny" | "require_approval";
|
|
106
|
-
verdict: "allow" | "deny" | "escalate";
|
|
107
|
-
reason: string;
|
|
108
|
-
matchedRule: string | null;
|
|
109
|
-
securityScan: {
|
|
110
|
-
safe: boolean;
|
|
111
|
-
riskLevel: string;
|
|
112
|
-
findingsCount: number;
|
|
113
|
-
findings: Array<{
|
|
114
|
-
category: string;
|
|
115
|
-
severity: string;
|
|
116
|
-
description: string;
|
|
117
|
-
}>;
|
|
118
|
-
};
|
|
119
|
-
auditEntry: {
|
|
120
|
-
timestamp: string;
|
|
121
|
-
agentId: string;
|
|
122
|
-
action: string;
|
|
123
|
-
decision: "allow" | "deny";
|
|
124
|
-
hash: string;
|
|
125
|
-
previousHash: string;
|
|
126
|
-
chainVerified: boolean;
|
|
127
|
-
};
|
|
128
|
-
ed25519Signature: string;
|
|
129
|
-
signature: string;
|
|
130
|
-
bindingHash: string;
|
|
131
|
-
decidedAt: string;
|
|
132
|
-
}
|
|
133
|
-
export type MemoryRecordKind = "fact" | "preference" | "resource_note" | "operator_note" | "execution_outcome" | "resource_topology" | "policy_decision";
|
|
134
|
-
export interface MemoryContextSummary {
|
|
135
|
-
enabled: boolean;
|
|
136
|
-
namespace: string;
|
|
137
|
-
staticFacts: string[];
|
|
138
|
-
dynamicContext: string[];
|
|
139
|
-
recalledMemories: Array<{
|
|
140
|
-
documentId: string;
|
|
141
|
-
title: string;
|
|
142
|
-
snippet: string;
|
|
143
|
-
similarity: number;
|
|
144
|
-
createdAt?: string;
|
|
145
|
-
}>;
|
|
146
|
-
formattedPromptContext: string;
|
|
147
|
-
profile: {
|
|
148
|
-
static: string[];
|
|
149
|
-
dynamic: string[];
|
|
150
|
-
preferences: string[];
|
|
151
|
-
};
|
|
152
|
-
relevantMemories: Array<{
|
|
153
|
-
documentId: string;
|
|
154
|
-
title: string;
|
|
155
|
-
snippet: string;
|
|
156
|
-
similarity: number;
|
|
157
|
-
createdAt?: string;
|
|
158
|
-
}>;
|
|
159
|
-
}
|
|
160
|
-
export interface WorkspaceMemoryRecord {
|
|
161
|
-
id: string;
|
|
162
|
-
workspaceId: string;
|
|
163
|
-
namespace: string;
|
|
164
|
-
documentId: string;
|
|
165
|
-
title: string;
|
|
166
|
-
content: string;
|
|
167
|
-
kind: MemoryRecordKind;
|
|
168
|
-
metadata: Record<string, unknown>;
|
|
169
|
-
createdAt: string;
|
|
170
|
-
}
|
|
171
|
-
export interface SupplierSettlement {
|
|
172
|
-
fundingMode: "muxo_funded";
|
|
173
|
-
supplier: ProviderLane;
|
|
174
|
-
supplierName: string;
|
|
175
|
-
upstreamProvider: string;
|
|
176
|
-
userChargeCredits: number;
|
|
177
|
-
userRetailChargeCents: number;
|
|
178
|
-
supplierWholesalePayableCents: number;
|
|
179
|
-
muxoNetMarginCents: number;
|
|
180
|
-
settlementStatus: "settled_by_muxo_master_wallet" | "planned_muxo_master_wallet";
|
|
181
|
-
masterAccountRef: string;
|
|
182
|
-
}
|
|
183
|
-
export interface SupplierSettlementSummary {
|
|
184
|
-
workspaceId: string;
|
|
185
|
-
fundingModel: "user_pays_muxo_muxo_pays_suppliers";
|
|
186
|
-
creditPriceCents: number;
|
|
187
|
-
totalCreditsPurchasedOrGranted: number;
|
|
188
|
-
totalCreditsConsumed: number;
|
|
189
|
-
currentCreditsBalance: number;
|
|
190
|
-
totalUserRetailSpendCents: number;
|
|
191
|
-
totalSupplierWholesalePaidCents: number;
|
|
192
|
-
totalMuxoNetMarginCents: number;
|
|
193
|
-
bySupplier: Record<ProviderLane, {
|
|
194
|
-
runsCount: number;
|
|
195
|
-
creditsConsumed: number;
|
|
196
|
-
userRetailSpendCents: number;
|
|
197
|
-
supplierWholesalePaidCents: number;
|
|
198
|
-
muxoNetMarginCents: number;
|
|
199
|
-
}>;
|
|
200
|
-
}
|
|
201
|
-
export interface ActionPlan {
|
|
202
|
-
id: string;
|
|
203
|
-
workspaceId: string;
|
|
204
|
-
actorId: string;
|
|
205
|
-
toolSlug: string;
|
|
206
|
-
upstreamSlug: string;
|
|
207
|
-
lane: ProviderLane;
|
|
208
|
-
riskLevel: RiskLevel;
|
|
209
|
-
input: Record<string, unknown>;
|
|
210
|
-
reason: string;
|
|
211
|
-
creditCost: number;
|
|
212
|
-
approvalStatus: "auto_approved" | "pending_approval" | "approved" | "rejected" | "executed";
|
|
213
|
-
approvedBy: string | null;
|
|
214
|
-
approvedAt: string | null;
|
|
215
|
-
runId: string | null;
|
|
216
|
-
decisionRecord?: GovernanceDecisionRecord | null;
|
|
217
|
-
memoryContext?: MemoryContextSummary | null;
|
|
218
|
-
supplierSettlement?: SupplierSettlement | null;
|
|
219
|
-
createdAt: string;
|
|
220
|
-
expiresAt: string;
|
|
221
|
-
}
|
|
222
|
-
export interface ExecutionRun {
|
|
223
|
-
id: string;
|
|
224
|
-
planId: string;
|
|
225
|
-
workspaceId: string;
|
|
226
|
-
actorId: string;
|
|
227
|
-
toolSlug: string;
|
|
228
|
-
lane: ProviderLane;
|
|
229
|
-
riskLevel: RiskLevel;
|
|
230
|
-
status: "queued" | "running" | "succeeded" | "failed" | "cancelled";
|
|
231
|
-
input: Record<string, unknown>;
|
|
232
|
-
output: Record<string, unknown> | null;
|
|
233
|
-
error: string | null;
|
|
234
|
-
actionsMetered: number;
|
|
235
|
-
creditsMetered: number;
|
|
236
|
-
durationMs: number | null;
|
|
237
|
-
receiptId: string | null;
|
|
238
|
-
startedAt: string;
|
|
239
|
-
completedAt: string | null;
|
|
240
|
-
}
|
|
241
|
-
export interface ExecutionReceipt {
|
|
242
|
-
id: string;
|
|
243
|
-
runId: string;
|
|
244
|
-
planId: string;
|
|
245
|
-
workspaceId: string;
|
|
246
|
-
actorId: string;
|
|
247
|
-
toolSlug: string;
|
|
248
|
-
lane: ProviderLane;
|
|
249
|
-
riskLevel: RiskLevel;
|
|
250
|
-
status: "succeeded" | "failed" | "cancelled";
|
|
251
|
-
actionsMetered: number;
|
|
252
|
-
creditsMetered: number;
|
|
253
|
-
inputHash: string;
|
|
254
|
-
outputHash: string;
|
|
255
|
-
prevReceiptHash: string;
|
|
256
|
-
receiptHash: string;
|
|
257
|
-
signature: string;
|
|
258
|
-
decisionRecord?: GovernanceDecisionRecord | null;
|
|
259
|
-
supplierSettlement?: SupplierSettlement | null;
|
|
260
|
-
issuedAt: string;
|
|
261
|
-
}
|
|
262
|
-
export interface LedgerEntry {
|
|
263
|
-
id: string;
|
|
264
|
-
workspaceId: string;
|
|
265
|
-
kind: "plan_grant" | "credit_topup" | "run_deduction" | "subscription_upgrade" | "manual_adjustment";
|
|
266
|
-
actionsDelta: number;
|
|
267
|
-
creditsDelta: number;
|
|
268
|
-
balanceAfter: number;
|
|
269
|
-
referenceId: string | null;
|
|
270
|
-
description: string;
|
|
271
|
-
supplierSettlement?: SupplierSettlement | null;
|
|
272
|
-
createdAt: string;
|
|
273
|
-
}
|
package/dist/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|