@muxoai/sdk 1.3.0 → 1.4.2

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 (72) hide show
  1. package/.agents/plugins/marketplace.json +2 -2
  2. package/.claude-plugin/marketplace.json +19 -4
  3. package/.codex/config.toml +9 -2
  4. package/ARCHITECTURE.md +16 -6
  5. package/README.md +69 -24
  6. package/dist/clerk.d.ts +35 -0
  7. package/dist/clerk.js +201 -0
  8. package/dist/cli.js +1589 -103
  9. package/dist/composio-catalog.d.ts +234 -0
  10. package/dist/composio-catalog.js +1894 -0
  11. package/dist/config.d.ts +16 -0
  12. package/dist/config.js +27 -1
  13. package/dist/durable-workflow.d.ts +45 -0
  14. package/dist/durable-workflow.js +90 -0
  15. package/dist/engine.d.ts +315 -6
  16. package/dist/engine.js +1778 -94
  17. package/dist/mcp-schema.d.ts +286 -0
  18. package/dist/mcp-schema.js +2559 -0
  19. package/dist/mcp.d.ts +2 -25
  20. package/dist/mcp.js +949 -507
  21. package/dist/memory-graph.d.ts +21 -0
  22. package/dist/memory-graph.js +173 -0
  23. package/dist/nl.js +214 -35
  24. package/dist/oauth.d.ts +32 -0
  25. package/dist/oauth.js +134 -0
  26. package/dist/policy.d.ts +190 -0
  27. package/dist/policy.js +1597 -0
  28. package/dist/providers/composio-instant.d.ts +4 -0
  29. package/dist/providers/composio-instant.js +890 -535
  30. package/dist/providers/composio-sdk.d.ts +126 -5
  31. package/dist/providers/composio-sdk.js +902 -79
  32. package/dist/providers/microsoft-governance.d.ts +89 -3
  33. package/dist/providers/microsoft-governance.js +673 -26
  34. package/dist/providers/stripe-billing.d.ts +42 -0
  35. package/dist/providers/stripe-billing.js +244 -5
  36. package/dist/providers/stripe-projects.d.ts +459 -4
  37. package/dist/providers/stripe-projects.js +2674 -122
  38. package/dist/providers/supermemory.d.ts +102 -6
  39. package/dist/providers/supermemory.js +609 -55
  40. package/dist/provisioning-managed.d.ts +50 -0
  41. package/dist/provisioning-managed.js +155 -0
  42. package/dist/sdk.d.ts +705 -7
  43. package/dist/sdk.js +488 -10
  44. package/dist/server.js +2646 -348
  45. package/dist/store.d.ts +138 -6
  46. package/dist/store.js +932 -58
  47. package/dist/types.d.ts +312 -4
  48. package/dist/ui/console-html.d.ts +62 -0
  49. package/dist/ui/console-html.js +3742 -2228
  50. package/dist/ui/design-tokens.d.ts +177 -0
  51. package/dist/ui/design-tokens.js +210 -0
  52. package/dist/version.d.ts +1 -0
  53. package/dist/version.js +1 -0
  54. package/package.json +5 -4
  55. package/plugins/muxo/.app.json +1 -1
  56. package/plugins/muxo/.claude-plugin/plugin.json +3 -3
  57. package/plugins/muxo/.codex-plugin/plugin.json +19 -10
  58. package/plugins/muxo/.cursor-plugin/plugin.json +30 -0
  59. package/plugins/muxo/.mcp.json +1 -33
  60. package/plugins/muxo/assets/logo.png +0 -0
  61. package/plugins/muxo/hooks/session-start.sh +16 -4
  62. package/plugins/muxo/hooks/user-prompt-submit.sh +14 -1
  63. package/plugins/muxo/mcp.json +0 -10
  64. package/plugins/muxo/plugin.json +65 -8
  65. package/plugins/muxo/skills/muxo/SKILL.md +142 -14
  66. package/plugins/muxo/skills/muxo/agents/openai.yaml +12 -0
  67. package/plugins/muxo/skills/muxo/references/cli.md +9 -3
  68. package/plugins/muxo/skills/muxo/references/mcp.md +22 -10
  69. package/plugins/muxo/skills/muxo-activity-summary/SKILL.md +81 -0
  70. package/plugins/muxo/skills/setup/SKILL.md +17 -3
  71. package/plugins/muxo/skills/setup/agents/openai.yaml +12 -0
  72. package/src/catalogues/stripe-projects-catalog.json +140 -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, 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(): {
@@ -28,6 +33,7 @@ export declare class MuxoStore {
28
33
  user: User;
29
34
  workspace: Workspace;
30
35
  sessionToken: string;
36
+ apiKey: string;
31
37
  };
32
38
  loginUser(email: string, password: string): {
33
39
  user: User;
@@ -35,7 +41,7 @@ export declare class MuxoStore {
35
41
  sessionToken: string;
36
42
  } | null;
37
43
  createSession(userId: string, workspaceId: string): string;
38
- resolveAuthToken(token: string): {
44
+ resolveAuthToken(token: string, workspaceOverrideId?: string | null): {
39
45
  user: User;
40
46
  workspace: Workspace;
41
47
  authType: "session" | "api_key";
@@ -43,18 +49,101 @@ export declare class MuxoStore {
43
49
  } | null;
44
50
  getUser(userId: string): User | null;
45
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;
46
99
  updateWorkspacePolicy(workspaceId: string, policy: Partial<GovernancePolicy>): Workspace;
47
100
  createApiKey(params: {
48
101
  workspaceId: string;
49
102
  name: string;
50
103
  environment?: "live" | "test";
51
104
  scopes?: string[];
105
+ teamName?: string | null;
106
+ role?: WorkspaceRole;
107
+ createdByEmail?: string | null;
52
108
  }): {
53
109
  record: ApiKeyRecord;
54
110
  secretKey: string;
55
111
  };
56
112
  listApiKeys(workspaceId: string): ApiKeyRecord[];
57
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;
58
147
  upsertConnection(params: {
59
148
  workspaceId: string;
60
149
  lane: ProviderLane;
@@ -80,6 +169,8 @@ export declare class MuxoStore {
80
169
  metadata?: Record<string, unknown>;
81
170
  }): ProvisionedResource;
82
171
  getResource(workspaceId: string, resourceNameOrId: string): ProvisionedResource | null;
172
+ findResourceAnyWorkspace(resourceNameOrId: string): ProvisionedResource | null;
173
+ getDecryptedResourceSecrets(workspaceId: string, resourceNameOrId: string): Record<string, string>;
83
174
  listResources(workspaceId: string): ProvisionedResource[];
84
175
  getDecryptedWorkspaceEnv(workspaceId: string): Record<string, string>;
85
176
  normalizeByokProvider(providerInput: string): {
@@ -107,6 +198,7 @@ export declare class MuxoStore {
107
198
  memoryContext?: MemoryContextSummary | null;
108
199
  }): ActionPlan;
109
200
  getPlan(workspaceId: string, planId: string): ActionPlan | null;
201
+ getPlanById(planId: string): ActionPlan | null;
110
202
  listPlans(workspaceId: string, limit?: number): ActionPlan[];
111
203
  updatePlanApproval(params: {
112
204
  workspaceId: string;
@@ -129,6 +221,15 @@ export declare class MuxoStore {
129
221
  run: ExecutionRun;
130
222
  receipt: ExecutionReceipt;
131
223
  };
224
+ cancelRun(params: {
225
+ workspaceId: string;
226
+ runId: string;
227
+ cancelledBy: string;
228
+ reason?: string;
229
+ }): {
230
+ run: ExecutionRun;
231
+ receipt: ExecutionReceipt;
232
+ };
132
233
  private issueReceipt;
133
234
  verifyReceipt(receipt: ExecutionReceipt): boolean;
134
235
  getRun(workspaceId: string, runId: string): ExecutionRun | null;
@@ -172,6 +273,30 @@ export declare class MuxoStore {
172
273
  }): WorkspaceMemoryRecord;
173
274
  listMemoryRecords(workspaceId: string, limit?: number): WorkspaceMemoryRecord[];
174
275
  deleteMemoryRecord(workspaceId: string, idOrDocId: string): WorkspaceMemoryRecord | null;
276
+ upsertTemporalFact(params: {
277
+ workspaceId: string;
278
+ subject: string;
279
+ predicate: string;
280
+ object: string;
281
+ summary: string;
282
+ confidence?: number;
283
+ sourceKind?: TemporalGraphFact["sourceKind"];
284
+ sourceReferenceId?: string | null;
285
+ metadata?: Record<string, unknown>;
286
+ supersedeExisting?: boolean;
287
+ }): TemporalGraphFact;
288
+ listTemporalFacts(workspaceId: string, opts?: {
289
+ includeHistorical?: boolean;
290
+ subject?: string;
291
+ predicate?: string;
292
+ query?: string;
293
+ limit?: number;
294
+ }): TemporalGraphFact[];
295
+ forgetMatchingMemoryRecords(workspaceId: string, query: string): {
296
+ deletedMemories: WorkspaceMemoryRecord[];
297
+ invalidatedFacts: TemporalGraphFact[];
298
+ };
299
+ private mapTemporalFact;
175
300
  createAutonomousAgentSignup(params?: {
176
301
  agentName?: string;
177
302
  harness?: string;
@@ -188,9 +313,13 @@ export declare class MuxoStore {
188
313
  claimedAt: string | null;
189
314
  expiresAt: string;
190
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
+ */
191
320
  createAgentClaim(params: {
192
321
  workspaceId: string;
193
- email: string;
322
+ email: string | null;
194
323
  baseUrl: string;
195
324
  }): {
196
325
  claimSlug: string;
@@ -199,13 +328,16 @@ export declare class MuxoStore {
199
328
  status: "invited" | "claimed";
200
329
  expiresAt: string;
201
330
  };
202
- redeemAgentClaim(claimSlug: string): {
331
+ /** Returns a claim only while it can still be accepted (invited and not expired). */
332
+ getOpenAgentClaim(claimSlug: string): {
203
333
  claimSlug: string;
204
334
  workspace: Workspace;
205
335
  targetEmail: string;
206
- status: "claimed";
207
- claimedAt: string;
336
+ status: "invited";
337
+ expiresAt: string;
208
338
  } | null;
339
+ /** Transfers workspace ownership to the verified claimer and closes the claim. */
340
+ acceptAgentClaim(claimSlug: string, userId: string): Workspace | null;
209
341
  private mapUser;
210
342
  private mapWorkspace;
211
343
  private mapConnection;