@muxoai/platform 1.3.3 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.agents/plugins/marketplace.json +2 -2
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/ARCHITECTURE.md +16 -6
  4. package/README.md +7 -5
  5. package/dist/cli.js +393 -13
  6. package/dist/composio-catalog.d.ts +58 -0
  7. package/dist/composio-catalog.js +474 -0
  8. package/dist/config.d.ts +10 -0
  9. package/dist/config.js +16 -0
  10. package/dist/durable-workflow.d.ts +45 -0
  11. package/dist/durable-workflow.js +90 -0
  12. package/dist/engine.d.ts +276 -5
  13. package/dist/engine.js +1261 -71
  14. package/dist/mcp-schema.d.ts +125 -0
  15. package/dist/mcp-schema.js +1076 -0
  16. package/dist/mcp.d.ts +2 -30
  17. package/dist/mcp.js +505 -539
  18. package/dist/memory-graph.d.ts +21 -0
  19. package/dist/memory-graph.js +173 -0
  20. package/dist/nl.js +155 -0
  21. package/dist/oauth.d.ts +32 -0
  22. package/dist/oauth.js +134 -0
  23. package/dist/policy.d.ts +75 -1
  24. package/dist/policy.js +1119 -0
  25. package/dist/providers/composio-instant.js +225 -5
  26. package/dist/providers/composio-sdk.d.ts +68 -5
  27. package/dist/providers/composio-sdk.js +683 -78
  28. package/dist/providers/microsoft-governance.d.ts +28 -1
  29. package/dist/providers/microsoft-governance.js +224 -11
  30. package/dist/providers/stripe-billing.d.ts +42 -0
  31. package/dist/providers/stripe-billing.js +230 -1
  32. package/dist/providers/stripe-projects.d.ts +451 -3
  33. package/dist/providers/stripe-projects.js +2106 -87
  34. package/dist/providers/supermemory.d.ts +74 -1
  35. package/dist/providers/supermemory.js +426 -0
  36. package/dist/provisioning-managed.d.ts +50 -0
  37. package/dist/provisioning-managed.js +155 -0
  38. package/dist/sdk.d.ts +538 -8
  39. package/dist/sdk.js +377 -10
  40. package/dist/server.js +1841 -232
  41. package/dist/store.d.ts +113 -6
  42. package/dist/store.js +675 -52
  43. package/dist/types.d.ts +212 -5
  44. package/dist/ui/console-html.d.ts +10 -1
  45. package/dist/ui/console-html.js +1188 -462
  46. package/dist/version.d.ts +1 -1
  47. package/dist/version.js +1 -1
  48. package/package.json +2 -2
  49. package/plugins/muxo/.claude-plugin/plugin.json +1 -1
  50. package/plugins/muxo/.codex-plugin/plugin.json +1 -1
  51. package/plugins/muxo/plugin.json +2 -2
  52. package/plugins/muxo/skills/muxo/SKILL.md +42 -1
  53. package/plugins/muxo/skills/muxo/references/mcp.md +3 -2
  54. package/plugins/muxo/skills/setup/SKILL.md +8 -0
package/dist/types.d.ts CHANGED
@@ -1,6 +1,72 @@
1
1
  export type RiskLevel = "read" | "write" | "admin" | "financial" | "provisioning" | "destructive";
2
2
  export type ProviderLane = "composio_sdk" | "composio_instant" | "stripe_projects";
3
- export type SubscriptionTier = "free" | "starter";
3
+ export type SubscriptionTier = "free" | "starter" | "pro";
4
+ export type SubscriptionStatus = "none" | "active" | "trialing" | "past_due" | "unpaid" | "canceled" | "incomplete" | "comped";
5
+ export interface WorkspaceBilling {
6
+ interval: "month" | "year" | null;
7
+ status: SubscriptionStatus;
8
+ cancelAtPeriodEnd: boolean;
9
+ /** When Stripe next renews or ends the subscription. */
10
+ currentPeriodEnd: string | null;
11
+ /** Monthly usage periods are counted from this moment. */
12
+ usagePeriodAnchor: string;
13
+ usagePeriodStart: string;
14
+ usagePeriodEnd: string;
15
+ /** usagePeriodStart of the last period whose plan credits were granted. */
16
+ creditsGrantedFor: string | null;
17
+ paymentFailedAt?: string | null;
18
+ /** Subscription whose start (fresh usage period and first credits) was already applied. */
19
+ startedSubscriptionId?: string | null;
20
+ }
21
+ export type LanguageMode = "non_technical" | "technical" | "hybrid";
22
+ export interface HumanFriendlyExplanation {
23
+ headline: string;
24
+ preferred: string;
25
+ nonTechnical: string;
26
+ technical: string;
27
+ languageMode: LanguageMode;
28
+ customInstructions?: string[];
29
+ }
30
+ /**
31
+ * A structured handoff telling the caller (LLM or human) that a person must
32
+ * complete a step in the browser before the plan can proceed.
33
+ */
34
+ export interface HumanHandoff {
35
+ kind: "approval" | "oauth" | "byok";
36
+ url: string | null;
37
+ ctaLabel: string;
38
+ headline: string;
39
+ instructions: string;
40
+ planId?: string;
41
+ provider?: string;
42
+ }
43
+ /**
44
+ * Machine-readable guidance for LLM harnesses on exactly which Muxo tool to
45
+ * call next once a handoff or gate clears.
46
+ */
47
+ export interface LlmGuidance {
48
+ summary: string;
49
+ nextToolCalls: Array<{
50
+ tool: string;
51
+ input: Record<string, unknown>;
52
+ when: string;
53
+ }>;
54
+ }
55
+ export type WorkspaceRole = "owner" | "admin" | "operator" | "member";
56
+ export type ParameterRuleOperator = "equals" | "must_equal" | "not_equals" | "contains" | "not_contains" | "starts_with" | "must_start_with" | "ends_with" | "must_end_with" | "domain_in" | "domain_not_in" | "max_number" | "min_number" | "gt" | "gte" | "lt" | "lte" | "in" | "not_in" | "regex";
57
+ export type ParameterRuleAction = "block" | "require_approval" | "allow" | "auto_approve";
58
+ export interface ParameterPolicyRule {
59
+ id: string;
60
+ toolPattern?: string;
61
+ parameter: string;
62
+ operator: ParameterRuleOperator;
63
+ value: string | number | string[];
64
+ unit?: "usd" | "cents" | "credits" | "raw";
65
+ action: ParameterRuleAction;
66
+ elseAction?: ParameterRuleAction;
67
+ description: string;
68
+ source?: "deterministic" | "llm" | "mcp_harness" | "user";
69
+ }
4
70
  export interface GovernancePolicy {
5
71
  mode: "monitor" | "enforce";
6
72
  requireApprovalFor: RiskLevel[];
@@ -8,19 +74,65 @@ export interface GovernancePolicy {
8
74
  allowProvisioning: boolean;
9
75
  maxCreditsPerRun: number;
10
76
  blockedToolSlugs?: string[];
77
+ parameterRules?: ParameterPolicyRule[];
11
78
  executionRing?: 0 | 1 | 2 | 3;
12
79
  killSwitchActive?: boolean;
13
80
  killSwitchReason?: string | null;
14
81
  blockDestructiveSql?: boolean;
82
+ naturalLanguageRules?: string[];
83
+ languageMode?: LanguageMode;
84
+ customInstructions?: string[];
15
85
  }
16
86
  export interface User {
17
87
  id: string;
18
88
  email: string;
19
89
  name: string;
20
90
  workspaceId: string;
21
- role: "owner" | "admin" | "member";
91
+ role: WorkspaceRole;
22
92
  createdAt: string;
23
93
  }
94
+ export interface WorkspaceMembership {
95
+ id: string;
96
+ workspaceId: string;
97
+ userId: string;
98
+ role: WorkspaceRole;
99
+ teamName: string | null;
100
+ joinedViaKeyId?: string | null;
101
+ joinedVia?: "owner" | "created" | "api_key" | "team_key" | "invite" | "claim" | string;
102
+ apiKeyId?: string | null;
103
+ createdAt: string;
104
+ }
105
+ export interface WorkspaceSummary {
106
+ id: string;
107
+ name: string;
108
+ slug: string;
109
+ tier: SubscriptionTier;
110
+ creditsBalance: number;
111
+ monthlyActionsUsed: number;
112
+ monthlyActionsLimit: number;
113
+ role: WorkspaceRole;
114
+ teamName: string | null;
115
+ joinedVia?: "owner" | "created" | "api_key" | "team_key" | "invite" | "claim" | string;
116
+ isCurrent: boolean;
117
+ createdAt: string;
118
+ }
119
+ export interface TeamOnboardingKit {
120
+ ok?: boolean;
121
+ mode: "shared_workspace" | "dedicated_workspace";
122
+ workspace: Workspace | Pick<Workspace, "id" | "name" | "slug" | "tier" | "creditsBalance">;
123
+ teamName: string;
124
+ role: WorkspaceRole;
125
+ apiKey: string;
126
+ keyRecord: ApiKeyRecord;
127
+ claimUrl?: string | null;
128
+ consoleUrl?: string;
129
+ consoleJoinUrl?: string;
130
+ mcpEndpoint?: string;
131
+ cliSetupCommand: string;
132
+ mcpConfig?: Record<string, unknown>;
133
+ mcpConfigSnippet?: string;
134
+ instructions: string[];
135
+ }
24
136
  export interface Workspace {
25
137
  id: string;
26
138
  name: string;
@@ -32,6 +144,8 @@ export interface Workspace {
32
144
  creditsBalance: number;
33
145
  stripeCustomerId: string | null;
34
146
  stripeSubscriptionId: string | null;
147
+ stripeConnectedAccountId?: string | null;
148
+ billing?: WorkspaceBilling;
35
149
  projectsEnvName: string;
36
150
  policy: GovernancePolicy;
37
151
  createdAt: string;
@@ -44,6 +158,9 @@ export interface ApiKeyRecord {
44
158
  keyPrefix: string;
45
159
  environment: "live" | "test";
46
160
  scopes: string[];
161
+ teamName?: string | null;
162
+ role?: WorkspaceRole;
163
+ createdByEmail?: string | null;
47
164
  lastUsedAt: string | null;
48
165
  revokedAt: string | null;
49
166
  createdAt: string;
@@ -60,7 +177,7 @@ export interface MuxoTool {
60
177
  riskLevel: RiskLevel;
61
178
  requiresAuth: boolean;
62
179
  creditCost: number;
63
- billingMode: "customer_oauth" | "provider_wallet" | "resource_provisioning";
180
+ billingMode: "customer_oauth" | "customer_byok" | "provider_wallet" | "resource_provisioning";
64
181
  inputSchema: Record<string, unknown>;
65
182
  llmContextUrl?: string;
66
183
  providerUrl?: string;
@@ -184,6 +301,7 @@ export interface GovernanceDecisionRecord {
184
301
  signature: string;
185
302
  bindingHash: string;
186
303
  decidedAt: string;
304
+ explanation?: HumanFriendlyExplanation;
187
305
  }
188
306
  export type MemoryRecordKind = "fact" | "preference" | "resource_note" | "operator_note" | "execution_outcome" | "resource_topology" | "policy_decision";
189
307
  export interface TemporalGraphFact {
@@ -197,11 +315,56 @@ export interface TemporalGraphFact {
197
315
  validFrom: string;
198
316
  validTo: string | null;
199
317
  supersededById?: string | null;
200
- sourceKind: MemoryRecordKind | "system";
318
+ sourceKind: MemoryRecordKind | "system" | "manual";
201
319
  sourceReferenceId?: string | null;
202
320
  metadata: Record<string, unknown>;
203
321
  createdAt: string;
204
322
  }
323
+ export interface MemoryGraphNode {
324
+ id: string;
325
+ kind: "workspace" | "entity" | "preference" | "guardrail" | "connection" | "resource" | "tool" | "memory";
326
+ label: string;
327
+ summary: string;
328
+ status: "active" | "historical";
329
+ metadata?: Record<string, unknown>;
330
+ }
331
+ export interface MemoryGraphEdge {
332
+ id: string;
333
+ source: string;
334
+ target: string;
335
+ subject?: string;
336
+ object?: string;
337
+ predicate: string;
338
+ summary: string;
339
+ confidence: number;
340
+ status: "active" | "historical";
341
+ validFrom: string;
342
+ validTo: string | null;
343
+ supersededById: string | null;
344
+ sourceKind: TemporalGraphFact["sourceKind"];
345
+ sourceReferenceId: string | null;
346
+ }
347
+ export interface MemoryKnowledgeGraph {
348
+ workspaceId: string;
349
+ workspaceSlug: string;
350
+ namespace: string;
351
+ generatedAt: string;
352
+ query: string | null;
353
+ nodes: MemoryGraphNode[];
354
+ edges: MemoryGraphEdge[];
355
+ activeEdges: MemoryGraphEdge[];
356
+ historicalEdges: MemoryGraphEdge[];
357
+ stats: {
358
+ nodesCount: number;
359
+ activeEdgesCount: number;
360
+ historicalEdgesCount: number;
361
+ memoriesCount: number;
362
+ resourcesCount: number;
363
+ connectionsCount: number;
364
+ };
365
+ mermaid: string;
366
+ explanation: HumanFriendlyExplanation;
367
+ }
205
368
  export interface MemoryContextSummary {
206
369
  enabled: boolean;
207
370
  namespace: string;
@@ -230,11 +393,15 @@ export interface MemoryContextSummary {
230
393
  createdAt?: string;
231
394
  }>;
232
395
  temporalFacts?: TemporalGraphFact[];
396
+ activeDefaults?: Record<string, unknown>;
397
+ autoFilledInput?: Record<string, unknown>;
398
+ activeGuardrails?: string[];
233
399
  contextPoisoningScan?: {
234
400
  safe: boolean;
235
401
  riskLevel: "none" | "low" | "medium" | "high" | "critical";
236
402
  findingsCount: number;
237
403
  };
404
+ explanation?: HumanFriendlyExplanation;
238
405
  }
239
406
  export interface WorkspaceMemoryRecord {
240
407
  id: string;
@@ -245,6 +412,7 @@ export interface WorkspaceMemoryRecord {
245
412
  content: string;
246
413
  kind: MemoryRecordKind;
247
414
  metadata: Record<string, unknown>;
415
+ fundingSource?: string;
248
416
  createdAt: string;
249
417
  }
250
418
  export interface ByokKeyRecord {
@@ -295,6 +463,22 @@ export interface SupplierSettlementSummary {
295
463
  retailToWholesaleCoverageRatio: number;
296
464
  };
297
465
  }
466
+ export interface HumanHandoffDescriptor {
467
+ required: boolean;
468
+ kind: "none" | "oauth_connection" | "human_approval" | "oauth_and_approval";
469
+ status: "ready" | "awaiting_oauth" | "awaiting_approval" | "awaiting_oauth_and_approval" | "connected" | "approved" | "rejected";
470
+ headline: string;
471
+ markdownForUser: string;
472
+ agentNextToolCall: {
473
+ tool: string;
474
+ arguments: Record<string, unknown>;
475
+ description: string;
476
+ };
477
+ actionUrl: string | null;
478
+ approvalUrl: string | null;
479
+ oauthRedirectUrl: string | null;
480
+ consoleUrl: string;
481
+ }
298
482
  export interface ActionPlan {
299
483
  id: string;
300
484
  workspaceId: string;
@@ -336,6 +520,27 @@ export interface ExecutionRun {
336
520
  startedAt: string;
337
521
  completedAt: string | null;
338
522
  }
523
+ export type AgenticReceiptActionType = "ToolCall" | "ModelInference" | "GpuWorkload" | "RagRetrieval" | "ApiCall" | "DistributedJob";
524
+ export interface PortableAgenticReceipt {
525
+ version: string;
526
+ receipt_id: string;
527
+ agent_id: string;
528
+ task_id: string;
529
+ action_type: AgenticReceiptActionType;
530
+ tool_name: string | null;
531
+ model_id: string | null;
532
+ input_hash: string;
533
+ output_hash: string;
534
+ started_at: string;
535
+ completed_at: string;
536
+ latency_ms: number;
537
+ nonce: string;
538
+ previous_receipt_hash: string | null;
539
+ receipt_hash: string;
540
+ signature_algorithm: "Ed25519";
541
+ public_key_hex: string;
542
+ signature_hex: string;
543
+ }
339
544
  export interface ExecutionReceipt {
340
545
  id: string;
341
546
  runId: string;
@@ -354,13 +559,15 @@ export interface ExecutionReceipt {
354
559
  receiptHash: string;
355
560
  signature: string;
356
561
  decisionRecord?: GovernanceDecisionRecord | null;
562
+ agenticReceipt?: PortableAgenticReceipt | null;
357
563
  supplierSettlement?: SupplierSettlement | null;
358
564
  issuedAt: string;
565
+ explanation?: HumanFriendlyExplanation;
359
566
  }
360
567
  export interface LedgerEntry {
361
568
  id: string;
362
569
  workspaceId: string;
363
- kind: "plan_grant" | "credit_topup" | "run_deduction" | "subscription_upgrade" | "manual_adjustment";
570
+ kind: "plan_grant" | "credit_topup" | "run_deduction" | "subscription_upgrade" | "plan_change" | "refund" | "manual_adjustment";
364
571
  actionsDelta: number;
365
572
  creditsDelta: number;
366
573
  balanceAfter: number;
@@ -1,4 +1,4 @@
1
- export type ConsoleView = "overview" | "setup" | "catalog" | "connections" | "infrastructure" | "memory" | "governance" | "activity" | "billing" | "login" | "signup";
1
+ export type ConsoleView = "overview" | "setup" | "activity" | "billing" | "login" | "signup";
2
2
  /** Every path that serves the console shell, mapped to the view it opens. */
3
3
  export declare const CONSOLE_ROUTES: Readonly<Record<string, ConsoleView>>;
4
4
  export declare function isConsolePath(pathname: string): boolean;
@@ -23,3 +23,12 @@ export interface OAuthConsentOptions {
23
23
  }
24
24
  /** Consent screen for MCP clients (ChatGPT, Claude, CLIs) asking to use a Muxo workspace. */
25
25
  export declare function renderOAuthConsentHtml(opts: OAuthConsentOptions): string;
26
+ export interface ApprovalPageOptions {
27
+ planId: string;
28
+ clerk?: {
29
+ publishableKey: string;
30
+ frontendApi: string;
31
+ } | null;
32
+ }
33
+ /** One-click approval screen for plans held by workspace guardrails (`/approve/:planId`). */
34
+ export declare function renderApprovalPageHtml(opts: ApprovalPageOptions): string;