@muxoai/sdk 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/README.md CHANGED
@@ -1,54 +1,74 @@
1
- # Muxo (`@muxoai/platform`)
1
+ # Muxo (`@muxoai/platform` / `@muxoai/cli` / `@muxoai/sdk`)
2
2
 
3
- Muxo is a unified execution, cloud infrastructure provisioning, contextual memory, and cryptographic governance platform for AI agents and applications. Customers and their agents interact exclusively with **Muxo** — never with underlying tool or cloud infrastructure providers directly.
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 root-cause analysis of how `muxo3` resolves `muxo2`'s Cloudflare isolate/container failure modes.
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 18-operation MCP contract, REST API, CLI, and Web Console:
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.*`) + Stripe Billing** — Governed cloud resource provisioning across 60+ providers (`Neon`, `Supabase`, `Turso`, `Cloudflare`, `Vercel`, `Railway`, `Render`, `Prisma`, `PostHog`, etc.) with automatic `PLAN_REQUIRED` companion plan resolution, AES-256-GCM encrypted secret custody (`muxo env pull`), and live Stripe Checkout (`$29/mo Starter` & `$10 / +1,000 Credits`).
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. Build TypeScript
20
- npm run build
19
+ # 1. Install the Muxo CLI or run directly via npx
20
+ npm install -g @muxoai/cli@latest
21
21
 
22
- # 2. Run the 9-Suite Live E2E Verification
23
- npm test
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. Start the Muxo Server + app.muxo.ai Console (/) + muxo.ai Canvas (/landing) + MCP (/mcp)
26
- npm start
25
+ # 3. Verify workspace, governance DID, and credit balance
26
+ muxo whoami
27
27
 
28
- # 4. Use the Muxo CLI
29
- npm run cli -- whoami
30
- npm run cli -- search postgres
31
- npm run cli -- exec instant.hackernews.top_stories --input '{"limit":3}'
32
- npm run cli -- env pull --out .env.muxo
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`, & 18-tool MCP types |
42
- | `src/store.ts` | SQLite (`node:sqlite`) store, AES-256-GCM secret vault, credit ledger, memories, agent claims, and HMAC-SHA256 receipt chain |
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 zero-setup adapter |
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 18 canonical MCP operations |
50
- | `src/mcp.ts` | JSON-RPC 2.0 MCP Server (Streamable HTTP `/mcp` + stdio `muxo mcp`) |
51
- | `src/server.ts` | HTTP Gateway (`/api/v1/*`, `/mcp`, `/skill.md`, `/llms.txt`, `/landing`, `/claim/:slug`, `/health`, and `/`) |
52
- | `src/ui/console-html.ts` | `app.muxo.ai` Operator Console UI + `/landing` (`muxo.ai` Provider Canvas) |
53
- | `web/` | Standalone `muxo.ai` Astro marketing & interactive provider catalog site |
54
- | `vendor/microsoft-governance/` | Vendored `@microsoft/agent-governance-sdk` v5.0.0 |
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 |
@@ -12,6 +12,22 @@ export declare class MuxoClient {
12
12
  private readonly timeoutMs;
13
13
  constructor(options?: MuxoClientOptions);
14
14
  private request;
15
+ static signup(params?: {
16
+ workspaceName?: string;
17
+ ownerEmail?: string;
18
+ agentName?: string;
19
+ harness?: string;
20
+ }, baseUrl?: string): Promise<{
21
+ ok: true;
22
+ agentId: string;
23
+ workspace: Pick<Workspace, "id" | "name" | "slug" | "tier" | "creditsBalance">;
24
+ apiKey: string;
25
+ mcpEndpoint: string;
26
+ skillUrl: string;
27
+ claimEndpoint: string;
28
+ governanceDid: string;
29
+ supermemoryNamespace: string;
30
+ }>;
15
31
  signupAgent(params: {
16
32
  agentName?: string;
17
33
  harness?: string;
@@ -26,6 +42,14 @@ export declare class MuxoClient {
26
42
  governanceDid: string;
27
43
  supermemoryNamespace: string;
28
44
  }>;
45
+ whoami(): Promise<{
46
+ ok: true;
47
+ workspace: Workspace;
48
+ organization?: Workspace;
49
+ user?: Record<string, unknown>;
50
+ settlementSummary?: SupplierSettlementSummary;
51
+ }>;
52
+ mcpCall<T = Record<string, unknown>>(name: string, args?: Record<string, unknown>): Promise<T>;
29
53
  searchTools(params?: {
30
54
  query?: string;
31
55
  lane?: ProviderLane | "all";
@@ -64,7 +88,23 @@ export declare class MuxoClient {
64
88
  run: ExecutionRun;
65
89
  receipt: ExecutionReceipt;
66
90
  }>;
67
- startConnection(params: {
91
+ exec(toolSlug: string, input?: Record<string, unknown>, options?: {
92
+ reason?: string;
93
+ approve?: boolean;
94
+ }): Promise<{
95
+ ok: true;
96
+ plan: ActionPlan;
97
+ run: ExecutionRun;
98
+ receipt: ExecutionReceipt;
99
+ settlement?: Record<string, unknown> | null;
100
+ }>;
101
+ verifyReceipt(receiptId: string): Promise<{
102
+ ok: true;
103
+ valid: boolean;
104
+ verified: boolean;
105
+ receipt: ExecutionReceipt;
106
+ }>;
107
+ startConnection(paramsOrProvider: string | {
68
108
  provider: string;
69
109
  lane?: ProviderLane;
70
110
  callbackUrl?: string;
@@ -72,12 +112,17 @@ export declare class MuxoClient {
72
112
  ok: true;
73
113
  connection: ConnectionRecord;
74
114
  }>;
75
- waitForConnection(params: {
115
+ waitForConnection(paramsOrProvider: string | {
76
116
  provider: string;
77
117
  timeoutSeconds?: number;
118
+ simulateCallback?: boolean;
119
+ }, options?: {
120
+ timeoutSeconds?: number;
121
+ simulateCallback?: boolean;
78
122
  }): Promise<{
79
123
  ok: true;
80
124
  connection: ConnectionRecord;
125
+ status: ConnectionRecord["status"];
81
126
  ready: boolean;
82
127
  polledAttempts: number;
83
128
  elapsedMs: number;
@@ -92,20 +137,37 @@ export declare class MuxoClient {
92
137
  workspaceId: string;
93
138
  variables: Record<string, string>;
94
139
  dotenv: string;
140
+ includes: (substr: string) => boolean;
95
141
  }>;
96
- topupCredits(params: {
142
+ topupCredits(paramsOrCredits: number | {
97
143
  credits: number;
98
144
  description?: string;
99
- }): Promise<{
145
+ }, description?: string): Promise<{
100
146
  ok: true;
101
147
  creditsAdded: number;
148
+ creditBalance: number;
102
149
  usdPaid: number;
103
150
  workspace: Workspace;
104
151
  settlementSummary: SupplierSettlementSummary;
105
152
  }>;
153
+ getBillingStatus(): Promise<{
154
+ ok: true;
155
+ settlementSummary: SupplierSettlementSummary & {
156
+ totalCustomerChargedCredits?: number;
157
+ };
158
+ }>;
159
+ settlements(): Promise<{
160
+ ok: true;
161
+ settlementSummary: SupplierSettlementSummary & {
162
+ totalCustomerChargedCredits?: number;
163
+ };
164
+ summary?: SupplierSettlementSummary;
165
+ }>;
106
166
  getSettlements(): Promise<{
107
167
  ok: true;
108
- settlementSummary: SupplierSettlementSummary;
168
+ settlementSummary: SupplierSettlementSummary & {
169
+ totalCustomerChargedCredits?: number;
170
+ };
109
171
  }>;
110
172
  recallMemory(query?: string): Promise<{
111
173
  ok: true;
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@muxoai/platform";
package/package.json CHANGED
@@ -1,40 +1,20 @@
1
1
  {
2
2
  "name": "@muxoai/sdk",
3
- "version": "1.2.1",
4
- "description": "Muxo TypeScript/JavaScript SDK — Typed client for governed agent actions, OAuth handoffs, infrastructure provisioning, and receipts",
3
+ "version": "1.2.3",
4
+ "description": "Muxo TypeScript & Node.js SDK — Governed Agent Execution, OAuth Handoff, Cloud Provisioning & Cryptographic Receipts",
5
5
  "license": "MIT",
6
6
  "homepage": "https://muxo.ai",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/muxoai/muxo.git"
10
10
  },
11
- "keywords": [
12
- "muxo",
13
- "sdk",
14
- "agents",
15
- "mcp",
16
- "composio",
17
- "stripe",
18
- "governance",
19
- "supermemory"
20
- ],
21
11
  "publishConfig": {
22
12
  "access": "public"
23
13
  },
24
14
  "type": "module",
25
- "main": "./dist/sdk.js",
26
- "types": "./dist/sdk.d.ts",
27
- "exports": {
28
- ".": {
29
- "types": "./dist/sdk.d.ts",
30
- "default": "./dist/sdk.js"
31
- }
32
- },
33
- "files": [
34
- "dist",
35
- "README.md"
36
- ],
37
- "engines": {
38
- "node": ">=18.0.0"
15
+ "main": "./index.js",
16
+ "types": "./index.d.ts",
17
+ "dependencies": {
18
+ "@muxoai/platform": "1.2.3"
39
19
  }
40
- }
20
+ }
package/dist/sdk.js DELETED
@@ -1,117 +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
- async signupAgent(params) {
49
- return this.request("/api/v1/agents/signup", {
50
- method: "POST",
51
- body: params,
52
- });
53
- }
54
- async searchTools(params) {
55
- const qs = new URLSearchParams();
56
- if (params?.query)
57
- qs.set("query", params.query);
58
- if (params?.lane)
59
- qs.set("lane", params.lane);
60
- if (params?.riskLevel)
61
- qs.set("risk_level", params.riskLevel);
62
- if (params?.limit)
63
- qs.set("limit", String(params.limit));
64
- const suffix = qs.toString() ? `?${qs.toString()}` : "";
65
- return this.request(`/api/v1/tools${suffix}`);
66
- }
67
- async inspectTool(slug) {
68
- return this.request(`/api/v1/tools/${encodeURIComponent(slug)}`);
69
- }
70
- async planAction(params) {
71
- return this.request("/api/v1/plans", {
72
- method: "POST",
73
- body: params,
74
- });
75
- }
76
- async approvePlan(planId) {
77
- return this.request(`/api/v1/plans/${encodeURIComponent(planId)}/approve`, {
78
- method: "POST",
79
- });
80
- }
81
- async executePlan(planId) {
82
- return this.request(`/api/v1/plans/${encodeURIComponent(planId)}/execute`, {
83
- method: "POST",
84
- });
85
- }
86
- async startConnection(params) {
87
- return this.request("/api/v1/connections", {
88
- method: "POST",
89
- body: params,
90
- });
91
- }
92
- async waitForConnection(params) {
93
- return this.request("/api/v1/connections/wait", {
94
- method: "POST",
95
- body: params,
96
- });
97
- }
98
- async listResources() {
99
- return this.request("/api/v1/resources");
100
- }
101
- async pullEnv() {
102
- return this.request("/api/v1/resources/env");
103
- }
104
- async topupCredits(params) {
105
- return this.request("/api/v1/billing/topup", {
106
- method: "POST",
107
- body: params,
108
- });
109
- }
110
- async getSettlements() {
111
- return this.request("/api/v1/billing/settlements");
112
- }
113
- async recallMemory(query) {
114
- const suffix = query ? `?query=${encodeURIComponent(query)}` : "";
115
- return this.request(`/api/v1/memory${suffix}`);
116
- }
117
- }
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 {};