@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.
- package/.agents/plugins/marketplace.json +2 -2
- package/.claude-plugin/marketplace.json +2 -2
- package/ARCHITECTURE.md +16 -6
- package/README.md +7 -5
- package/dist/cli.js +393 -13
- package/dist/composio-catalog.d.ts +58 -0
- package/dist/composio-catalog.js +474 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +16 -0
- package/dist/durable-workflow.d.ts +45 -0
- package/dist/durable-workflow.js +90 -0
- package/dist/engine.d.ts +276 -5
- package/dist/engine.js +1261 -71
- package/dist/mcp-schema.d.ts +125 -0
- package/dist/mcp-schema.js +1076 -0
- package/dist/mcp.d.ts +2 -30
- package/dist/mcp.js +505 -539
- package/dist/memory-graph.d.ts +21 -0
- package/dist/memory-graph.js +173 -0
- package/dist/nl.js +155 -0
- package/dist/oauth.d.ts +32 -0
- package/dist/oauth.js +134 -0
- package/dist/policy.d.ts +75 -1
- package/dist/policy.js +1119 -0
- package/dist/providers/composio-instant.js +225 -5
- package/dist/providers/composio-sdk.d.ts +68 -5
- package/dist/providers/composio-sdk.js +683 -78
- package/dist/providers/microsoft-governance.d.ts +28 -1
- package/dist/providers/microsoft-governance.js +224 -11
- package/dist/providers/stripe-billing.d.ts +42 -0
- package/dist/providers/stripe-billing.js +230 -1
- package/dist/providers/stripe-projects.d.ts +451 -3
- package/dist/providers/stripe-projects.js +2106 -87
- package/dist/providers/supermemory.d.ts +74 -1
- package/dist/providers/supermemory.js +426 -0
- package/dist/provisioning-managed.d.ts +50 -0
- package/dist/provisioning-managed.js +155 -0
- package/dist/sdk.d.ts +538 -8
- package/dist/sdk.js +377 -10
- package/dist/server.js +1841 -232
- package/dist/store.d.ts +113 -6
- package/dist/store.js +675 -52
- package/dist/types.d.ts +212 -5
- package/dist/ui/console-html.d.ts +10 -1
- package/dist/ui/console-html.js +1188 -462
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/plugins/muxo/.claude-plugin/plugin.json +1 -1
- package/plugins/muxo/.codex-plugin/plugin.json +1 -1
- package/plugins/muxo/plugin.json +2 -2
- package/plugins/muxo/skills/muxo/SKILL.md +42 -1
- package/plugins/muxo/skills/muxo/references/mcp.md +3 -2
- package/plugins/muxo/skills/setup/SKILL.md +8 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Muxo-managed stand-ins for Stripe v2 Provisioning objects, returned when no Stripe key is
|
|
3
|
+
* configured so both the Node server and the edge worker answer with the same shapes.
|
|
4
|
+
*/
|
|
5
|
+
function managedId(prefix) {
|
|
6
|
+
const bytes = new Uint8Array(8);
|
|
7
|
+
crypto.getRandomValues(bytes);
|
|
8
|
+
return `${prefix}_muxo_${Array.from(bytes)
|
|
9
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
10
|
+
.join("")}`;
|
|
11
|
+
}
|
|
12
|
+
export function managedProviderConnectionList() {
|
|
13
|
+
return {
|
|
14
|
+
object: "v2.list",
|
|
15
|
+
data: [],
|
|
16
|
+
next_page_url: null,
|
|
17
|
+
previous_page_url: null,
|
|
18
|
+
source: "muxo_managed",
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function managedProviderConnectionUnlink(id) {
|
|
22
|
+
return {
|
|
23
|
+
id,
|
|
24
|
+
object: "v2.provisioning.provider_connection",
|
|
25
|
+
provider: null,
|
|
26
|
+
status: "unlinked",
|
|
27
|
+
livemode: false,
|
|
28
|
+
source: "muxo_managed",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function managedProviderConnectionRequest(params) {
|
|
32
|
+
return {
|
|
33
|
+
id: params.id || managedId("pcr"),
|
|
34
|
+
object: "v2.provisioning.provider_connection_request",
|
|
35
|
+
provider: params.provider || null,
|
|
36
|
+
request_status: params.requestStatus || "requested",
|
|
37
|
+
redirect_url: null,
|
|
38
|
+
needs_information_schema: null,
|
|
39
|
+
provider_connection: null,
|
|
40
|
+
created: new Date().toISOString(),
|
|
41
|
+
livemode: false,
|
|
42
|
+
source: "muxo_managed",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function managedResource(params) {
|
|
46
|
+
return {
|
|
47
|
+
id: params.id || managedId("res"),
|
|
48
|
+
object: "v2.provisioning.resource",
|
|
49
|
+
provider: params.provider || null,
|
|
50
|
+
service_ref: params.serviceRef || null,
|
|
51
|
+
name: params.name ?? null,
|
|
52
|
+
environment: params.environment === "dev" ? "dev" : "prod",
|
|
53
|
+
catalog: params.catalog || "prod",
|
|
54
|
+
status: params.status || "pending",
|
|
55
|
+
pending_action: null,
|
|
56
|
+
created: new Date().toISOString(),
|
|
57
|
+
livemode: false,
|
|
58
|
+
source: "muxo_managed",
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const ACTION_STATUS = {
|
|
62
|
+
remove: "removed",
|
|
63
|
+
unlink: "unlinked",
|
|
64
|
+
rotate_credentials: "active",
|
|
65
|
+
submit_information: "provisioning",
|
|
66
|
+
};
|
|
67
|
+
export function managedResourceAction(id, action) {
|
|
68
|
+
return {
|
|
69
|
+
...managedResource({ id, status: ACTION_STATUS[action] }),
|
|
70
|
+
action,
|
|
71
|
+
...(action === "rotate_credentials" ? { credentials_rotated_at: new Date().toISOString() } : {}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function hexOf(text, length) {
|
|
75
|
+
return Array.from(new TextEncoder().encode(text))
|
|
76
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
77
|
+
.join("")
|
|
78
|
+
.slice(0, length);
|
|
79
|
+
}
|
|
80
|
+
export function managedConnectedAccount(params) {
|
|
81
|
+
return {
|
|
82
|
+
id: params.id || `acct_v2_${hexOf(`${params.contactEmail || ""}:${params.displayName || ""}`, 12)}`,
|
|
83
|
+
object: "v2.core.account",
|
|
84
|
+
...(params.contactEmail ? { contact_email: params.contactEmail } : {}),
|
|
85
|
+
display_name: params.displayName || "Muxo Tenant Account",
|
|
86
|
+
identity: { country: params.country || "US", entity_type: params.entityType || "company" },
|
|
87
|
+
configuration: { developer: { capabilities: { projects: { requested: true, status: "active" } } } },
|
|
88
|
+
requirements: { currently_due: [], eventually_due: [], past_due: [], entries: [] },
|
|
89
|
+
livemode: false,
|
|
90
|
+
source: "muxo_managed",
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export function managedConnectedAccountLink(account) {
|
|
94
|
+
return {
|
|
95
|
+
object: "v2.core.account_link",
|
|
96
|
+
account,
|
|
97
|
+
url: `https://connect.stripe.com/setup/e/${encodeURIComponent(account)}/onboarding`,
|
|
98
|
+
created: new Date().toISOString(),
|
|
99
|
+
expires_at: new Date(Date.now() + 3600_000).toISOString(),
|
|
100
|
+
livemode: false,
|
|
101
|
+
source: "muxo_managed",
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function managedConnectedAccountSession(params) {
|
|
105
|
+
return {
|
|
106
|
+
object: "account_session",
|
|
107
|
+
account: params.account,
|
|
108
|
+
client_secret: `accs_secret_muxo_${hexOf(params.account, 16)}`,
|
|
109
|
+
components: {
|
|
110
|
+
account_onboarding: { enabled: true },
|
|
111
|
+
...(params.enableAccountManagement ? { account_management: { enabled: true } } : {}),
|
|
112
|
+
...(params.enableNotificationBanner !== false ? { notification_banner: { enabled: true } } : {}),
|
|
113
|
+
},
|
|
114
|
+
expires_at: Math.floor(Date.now() / 1000) + 3600,
|
|
115
|
+
livemode: false,
|
|
116
|
+
source: "muxo_managed",
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export function managedPaymentMethodRequest(params) {
|
|
120
|
+
return {
|
|
121
|
+
object: "v2.provisioning.payment_method_request",
|
|
122
|
+
checkout_session_url: `${params.publicWebUrl}/?checkout=payment_method_request`,
|
|
123
|
+
status: "checkout_initiated",
|
|
124
|
+
livemode: params.livemode,
|
|
125
|
+
source: "muxo_managed",
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
export const DEFAULT_PROVISIONING_EVENT_TYPES = [
|
|
129
|
+
"v2.provisioning.resource.completed",
|
|
130
|
+
"v2.provisioning.resource.errored",
|
|
131
|
+
"v2.core.account[requirements].updated",
|
|
132
|
+
];
|
|
133
|
+
export function managedEventDestination(params) {
|
|
134
|
+
return {
|
|
135
|
+
id: `ed_v2_${hexOf(params.url, 12)}`,
|
|
136
|
+
object: "v2.core.event_destination",
|
|
137
|
+
name: params.name || "Muxo Provisioning & Connect v2 Event Stream",
|
|
138
|
+
status: "enabled",
|
|
139
|
+
enabled_events: params.events?.length ? params.events : DEFAULT_PROVISIONING_EVENT_TYPES,
|
|
140
|
+
webhook_endpoint: { url: params.url },
|
|
141
|
+
livemode: false,
|
|
142
|
+
source: "muxo_managed",
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/** What Muxo does with a Stripe v2 thin event, keyed by event type. */
|
|
146
|
+
export function provisioningEventAction(eventType, hasRelatedObject) {
|
|
147
|
+
if (eventType === "v2.provisioning.resource.completed" && hasRelatedObject) {
|
|
148
|
+
return "revealed_access_configuration_and_synced_vault";
|
|
149
|
+
}
|
|
150
|
+
if (eventType === "v2.provisioning.resource.errored")
|
|
151
|
+
return "marked_resource_errored";
|
|
152
|
+
if (eventType === "v2.core.account[requirements].updated")
|
|
153
|
+
return "flagged_connected_account_requirements_due";
|
|
154
|
+
return "recorded_v2_event";
|
|
155
|
+
}
|