@muxoai/platform 1.4.0 → 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 +1 -1
  5. package/dist/cli.js +317 -10
  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 +440 -3
  39. package/dist/sdk.js +305 -3
  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 +192 -3
  44. package/dist/ui/console-html.d.ts +10 -1
  45. package/dist/ui/console-html.js +1082 -452
  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/store.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DatabaseSync } from "node:sqlite";
2
- import type { ActionPlan, ApiKeyRecord, ByokKeyRecord, ConnectionRecord, ExecutionReceipt, ExecutionRun, GovernanceDecisionRecord, GovernancePolicy, LedgerEntry, MemoryContextSummary, ProviderLane, ProvisionedResource, RiskLevel, SupplierSettlement, SupplierSettlementSummary, TemporalGraphFact, User, Workspace, WorkspaceMemoryRecord } from "./types.js";
2
+ import type { ActionPlan, ApiKeyRecord, ByokKeyRecord, ConnectionRecord, ExecutionReceipt, ExecutionRun, GovernanceDecisionRecord, GovernancePolicy, LedgerEntry, MemoryContextSummary, ProviderLane, ProvisionedResource, RiskLevel, SupplierSettlement, SupplierSettlementSummary, TeamOnboardingKit, TemporalGraphFact, User, Workspace, WorkspaceMembership, WorkspaceMemoryRecord, WorkspaceRole, WorkspaceSummary } from "./types.js";
3
3
  export declare const BYOK_PROVIDER_CATALOG: Record<string, {
4
4
  category: "llm" | "supplier";
5
5
  envVarName: string;
@@ -10,6 +10,11 @@ export declare class MuxoStore {
10
10
  private readonly vaultKey;
11
11
  constructor(dbPath: string, vaultKey: Buffer);
12
12
  private initSchema;
13
+ /**
14
+ * Older databases declared receipts.run_id UNIQUE, which blocks cancellation receipts from
15
+ * superseding a run's original receipt. SQLite cannot drop a constraint, so rebuild the table.
16
+ */
17
+ private migrateReceiptsAllowMultiplePerRun;
13
18
  encryptSecrets(workspaceId: string, secrets: Record<string, string>): string;
14
19
  decryptSecrets(workspaceId: string, payloadHex: string | null): Record<string, string>;
15
20
  ensureDefaultWorkspace(): {
@@ -36,7 +41,7 @@ export declare class MuxoStore {
36
41
  sessionToken: string;
37
42
  } | null;
38
43
  createSession(userId: string, workspaceId: string): string;
39
- resolveAuthToken(token: string): {
44
+ resolveAuthToken(token: string, workspaceOverrideId?: string | null): {
40
45
  user: User;
41
46
  workspace: Workspace;
42
47
  authType: "session" | "api_key";
@@ -44,18 +49,101 @@ export declare class MuxoStore {
44
49
  } | null;
45
50
  getUser(userId: string): User | null;
46
51
  getWorkspace(workspaceId: string): Workspace | null;
52
+ ensureWorkspaceMembership(params: {
53
+ workspaceId: string;
54
+ userId: string;
55
+ role?: WorkspaceRole;
56
+ teamName?: string | null;
57
+ joinedViaKeyId?: string | null;
58
+ }): WorkspaceMembership;
59
+ userCanAccessWorkspace(userId: string, workspaceId: string): boolean;
60
+ listUserWorkspaces(userId: string, activeWorkspaceId?: string): WorkspaceSummary[];
61
+ switchUserWorkspace(userId: string, workspaceId: string): {
62
+ user: User;
63
+ workspace: Workspace;
64
+ } | null;
65
+ createWorkspaceForUser(params: {
66
+ userId: string;
67
+ name: string;
68
+ teamName?: string | null;
69
+ role?: WorkspaceRole;
70
+ switchActive?: boolean;
71
+ }): {
72
+ workspace: Workspace;
73
+ apiKey: string;
74
+ keyRecord: ApiKeyRecord;
75
+ membership: WorkspaceMembership;
76
+ };
77
+ joinWorkspaceWithApiKey(params: {
78
+ apiKey: string;
79
+ userId?: string | null;
80
+ switchActive?: boolean;
81
+ }): {
82
+ workspace: Workspace;
83
+ keyRecord: ApiKeyRecord;
84
+ user: User | null;
85
+ membership: WorkspaceMembership | null;
86
+ } | null;
87
+ onboardTeam(params: {
88
+ currentWorkspaceId: string;
89
+ userId: string;
90
+ userEmail?: string | null;
91
+ teamName: string;
92
+ role?: WorkspaceRole;
93
+ mode?: "shared_workspace" | "dedicated_workspace";
94
+ environment?: "live" | "test";
95
+ scopes?: string[];
96
+ inviteEmail?: string | null;
97
+ baseUrl: string;
98
+ }): TeamOnboardingKit;
47
99
  updateWorkspacePolicy(workspaceId: string, policy: Partial<GovernancePolicy>): Workspace;
48
100
  createApiKey(params: {
49
101
  workspaceId: string;
50
102
  name: string;
51
103
  environment?: "live" | "test";
52
104
  scopes?: string[];
105
+ teamName?: string | null;
106
+ role?: WorkspaceRole;
107
+ createdByEmail?: string | null;
53
108
  }): {
54
109
  record: ApiKeyRecord;
55
110
  secretKey: string;
56
111
  };
57
112
  listApiKeys(workspaceId: string): ApiKeyRecord[];
58
113
  revokeApiKey(workspaceId: string, keyId: string): boolean;
114
+ /** Looks up an active workspace API key by its raw secret. */
115
+ findActiveApiKey(secret: string): {
116
+ id: string;
117
+ workspaceId: string;
118
+ } | null;
119
+ saveOAuthRefreshToken(params: {
120
+ refreshToken: string;
121
+ accessToken: string;
122
+ keyId: string;
123
+ workspaceId: string;
124
+ clientId: string;
125
+ scope: string;
126
+ }): void;
127
+ getOAuthRefreshToken(refreshToken: string): {
128
+ keyId: string;
129
+ workspaceId: string;
130
+ clientId: string;
131
+ scope: string;
132
+ accessToken: string;
133
+ } | null;
134
+ deleteOAuthRefreshToken(refreshToken: string): void;
135
+ /**
136
+ * Maps a verified Clerk session to a local user. Only a verified email can link to an
137
+ * existing account; otherwise a fresh user and workspace are created so an unverified
138
+ * address can never take over someone else's account.
139
+ */
140
+ provisionClerkUser(clerkUserId: string, identity: {
141
+ email: string | null;
142
+ emailVerified: boolean;
143
+ name: string | null;
144
+ }, ownerWorkspaceId: string | null): User;
145
+ getClerkLinkedUser(clerkUserId: string): User | null;
146
+ getUserByEmail(email: string): User | null;
59
147
  upsertConnection(params: {
60
148
  workspaceId: string;
61
149
  lane: ProviderLane;
@@ -81,6 +169,8 @@ export declare class MuxoStore {
81
169
  metadata?: Record<string, unknown>;
82
170
  }): ProvisionedResource;
83
171
  getResource(workspaceId: string, resourceNameOrId: string): ProvisionedResource | null;
172
+ findResourceAnyWorkspace(resourceNameOrId: string): ProvisionedResource | null;
173
+ getDecryptedResourceSecrets(workspaceId: string, resourceNameOrId: string): Record<string, string>;
84
174
  listResources(workspaceId: string): ProvisionedResource[];
85
175
  getDecryptedWorkspaceEnv(workspaceId: string): Record<string, string>;
86
176
  normalizeByokProvider(providerInput: string): {
@@ -108,6 +198,7 @@ export declare class MuxoStore {
108
198
  memoryContext?: MemoryContextSummary | null;
109
199
  }): ActionPlan;
110
200
  getPlan(workspaceId: string, planId: string): ActionPlan | null;
201
+ getPlanById(planId: string): ActionPlan | null;
111
202
  listPlans(workspaceId: string, limit?: number): ActionPlan[];
112
203
  updatePlanApproval(params: {
113
204
  workspaceId: string;
@@ -130,6 +221,15 @@ export declare class MuxoStore {
130
221
  run: ExecutionRun;
131
222
  receipt: ExecutionReceipt;
132
223
  };
224
+ cancelRun(params: {
225
+ workspaceId: string;
226
+ runId: string;
227
+ cancelledBy: string;
228
+ reason?: string;
229
+ }): {
230
+ run: ExecutionRun;
231
+ receipt: ExecutionReceipt;
232
+ };
133
233
  private issueReceipt;
134
234
  verifyReceipt(receipt: ExecutionReceipt): boolean;
135
235
  getRun(workspaceId: string, runId: string): ExecutionRun | null;
@@ -213,9 +313,13 @@ export declare class MuxoStore {
213
313
  claimedAt: string | null;
214
314
  expiresAt: string;
215
315
  } | null;
316
+ /**
317
+ * Creates a claim link for a workspace. A claim minted without an email (at agent signup)
318
+ * stays unusable until the agent names the owner; naming one reuses that same link.
319
+ */
216
320
  createAgentClaim(params: {
217
321
  workspaceId: string;
218
- email: string;
322
+ email: string | null;
219
323
  baseUrl: string;
220
324
  }): {
221
325
  claimSlug: string;
@@ -224,13 +328,16 @@ export declare class MuxoStore {
224
328
  status: "invited" | "claimed";
225
329
  expiresAt: string;
226
330
  };
227
- redeemAgentClaim(claimSlug: string): {
331
+ /** Returns a claim only while it can still be accepted (invited and not expired). */
332
+ getOpenAgentClaim(claimSlug: string): {
228
333
  claimSlug: string;
229
334
  workspace: Workspace;
230
335
  targetEmail: string;
231
- status: "claimed";
232
- claimedAt: string;
336
+ status: "invited";
337
+ expiresAt: string;
233
338
  } | null;
339
+ /** Transfers workspace ownership to the verified claimer and closes the claim. */
340
+ acceptAgentClaim(claimSlug: string, userId: string): Workspace | null;
234
341
  private mapUser;
235
342
  private mapWorkspace;
236
343
  private mapConnection;