@muxoai/sdk 1.3.0 → 1.4.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.
Files changed (76) 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 +1677 -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 +112 -0
  14. package/dist/durable-workflow.js +284 -0
  15. package/dist/engine.d.ts +377 -6
  16. package/dist/engine.js +1919 -94
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.js +3 -0
  19. package/dist/mcp-schema.d.ts +286 -0
  20. package/dist/mcp-schema.js +2580 -0
  21. package/dist/mcp.d.ts +2 -25
  22. package/dist/mcp.js +1008 -507
  23. package/dist/memory-graph.d.ts +45 -0
  24. package/dist/memory-graph.js +293 -0
  25. package/dist/nl.js +214 -35
  26. package/dist/oauth.d.ts +32 -0
  27. package/dist/oauth.js +134 -0
  28. package/dist/oss-suite.d.ts +217 -0
  29. package/dist/oss-suite.js +836 -0
  30. package/dist/policy.d.ts +190 -0
  31. package/dist/policy.js +1597 -0
  32. package/dist/providers/composio-instant.d.ts +4 -0
  33. package/dist/providers/composio-instant.js +890 -535
  34. package/dist/providers/composio-sdk.d.ts +126 -5
  35. package/dist/providers/composio-sdk.js +902 -79
  36. package/dist/providers/microsoft-governance.d.ts +89 -3
  37. package/dist/providers/microsoft-governance.js +673 -26
  38. package/dist/providers/stripe-billing.d.ts +42 -0
  39. package/dist/providers/stripe-billing.js +244 -5
  40. package/dist/providers/stripe-projects.d.ts +459 -4
  41. package/dist/providers/stripe-projects.js +2674 -122
  42. package/dist/providers/supermemory.d.ts +102 -6
  43. package/dist/providers/supermemory.js +609 -55
  44. package/dist/provisioning-managed.d.ts +50 -0
  45. package/dist/provisioning-managed.js +155 -0
  46. package/dist/sdk.d.ts +728 -7
  47. package/dist/sdk.js +539 -10
  48. package/dist/server.js +2744 -321
  49. package/dist/store.d.ts +138 -6
  50. package/dist/store.js +932 -58
  51. package/dist/types.d.ts +330 -4
  52. package/dist/ui/console-html.d.ts +62 -0
  53. package/dist/ui/console-html.js +3742 -2228
  54. package/dist/ui/design-tokens.d.ts +177 -0
  55. package/dist/ui/design-tokens.js +210 -0
  56. package/dist/version.d.ts +1 -0
  57. package/dist/version.js +1 -0
  58. package/package.json +6 -5
  59. package/plugins/muxo/.app.json +1 -1
  60. package/plugins/muxo/.claude-plugin/plugin.json +3 -3
  61. package/plugins/muxo/.codex-plugin/plugin.json +19 -10
  62. package/plugins/muxo/.cursor-plugin/plugin.json +30 -0
  63. package/plugins/muxo/.mcp.json +1 -33
  64. package/plugins/muxo/assets/logo.png +0 -0
  65. package/plugins/muxo/hooks/session-start.sh +16 -4
  66. package/plugins/muxo/hooks/user-prompt-submit.sh +14 -1
  67. package/plugins/muxo/mcp.json +0 -10
  68. package/plugins/muxo/plugin.json +65 -8
  69. package/plugins/muxo/skills/muxo/SKILL.md +142 -14
  70. package/plugins/muxo/skills/muxo/agents/openai.yaml +12 -0
  71. package/plugins/muxo/skills/muxo/references/cli.md +9 -3
  72. package/plugins/muxo/skills/muxo/references/mcp.md +22 -10
  73. package/plugins/muxo/skills/muxo-activity-summary/SKILL.md +81 -0
  74. package/plugins/muxo/skills/setup/SKILL.md +17 -3
  75. package/plugins/muxo/skills/setup/agents/openai.yaml +12 -0
  76. package/src/catalogues/stripe-projects-catalog.json +140 -0
@@ -0,0 +1,190 @@
1
+ import type { GovernancePolicy, HumanFriendlyExplanation, LanguageMode, ParameterPolicyRule, RiskLevel } from "./types.js";
2
+ export declare function sanitizeParameterPolicyRule(r: Record<string, unknown>, idx?: number): ParameterPolicyRule;
3
+ export declare class PolicyValidationError extends Error {
4
+ }
5
+ export declare function formatHumanFriendlyExplanation(params: {
6
+ headline: string;
7
+ nonTechnical: string;
8
+ technical: string;
9
+ policy?: Partial<GovernancePolicy> | null;
10
+ languageMode?: LanguageMode;
11
+ }): HumanFriendlyExplanation;
12
+ /**
13
+ * Validates a client-supplied policy patch. Kill-switch fields are rejected so
14
+ * that pausing and resuming always goes through /api/v1/governance/kill-switch,
15
+ * which records the trust-score penalty and audit entry.
16
+ */
17
+ export declare function sanitizePolicyPatch(body: unknown): Partial<GovernancePolicy>;
18
+ export declare const DEFAULT_WORKSPACE_POLICY: GovernancePolicy;
19
+ export interface ParsedNaturalLanguageGuardrail {
20
+ isGuardrail: boolean;
21
+ patch: Partial<GovernancePolicy>;
22
+ ruleText: string;
23
+ summary: string;
24
+ humanRules: string[];
25
+ compiledBy?: "deterministic" | "llm" | "mcp_harness";
26
+ memoryFact: {
27
+ title: string;
28
+ content: string;
29
+ subject: string;
30
+ predicate: string;
31
+ object: string;
32
+ tags: string[];
33
+ };
34
+ }
35
+ export interface GuardrailCompileOptions {
36
+ parameterRules?: Array<Record<string, unknown> | ParameterPolicyRule>;
37
+ policyPatch?: Partial<GovernancePolicy>;
38
+ source?: ParameterPolicyRule["source"];
39
+ llmApiKey?: string | null;
40
+ llmProvider?: "openai" | "anthropic";
41
+ }
42
+ /**
43
+ * Compiles plain-English user guardrails (e.g. "Hey Muxo, don't go over 25 credits",
44
+ * "Only allow sending emails to @muxo.ai", or "Require approval for Stripe refunds over $50,
45
+ * auto-approve under $50") and/or structured MCP harness parameter rules into enforced
46
+ * GovernancePolicy fields while keeping human-readable rule descriptions.
47
+ */
48
+ export declare function parseNaturalLanguageGuardrail(prompt: string, currentPolicy?: GovernancePolicy, options?: GuardrailCompileOptions): ParsedNaturalLanguageGuardrail;
49
+ /**
50
+ * Async LLM-assisted policy compiler: first runs deterministic semantic compilation
51
+ * (plus any structured `parameterRules` supplied by an MCP LLM harness), and when an
52
+ * OpenAI or Anthropic key is available and a complex natural-language rule produced no
53
+ * structured patch fields, invokes the LLM to synthesize validated `ParameterPolicyRule[]`.
54
+ */
55
+ export declare function compileNaturalLanguageGuardrailWithLlm(prompt: string, currentPolicy?: GovernancePolicy, options?: GuardrailCompileOptions): Promise<ParsedNaturalLanguageGuardrail>;
56
+ export declare function describePolicyInPlainEnglish(policy?: GovernancePolicy): {
57
+ headline: string;
58
+ rules: string[];
59
+ activeCustomRules: string[];
60
+ badges: Array<{
61
+ label: string;
62
+ tone: "safe" | "warn" | "strict";
63
+ }>;
64
+ languageMode: LanguageMode;
65
+ customInstructions: string[];
66
+ nonTechnical: string;
67
+ technical: string;
68
+ preferred: string;
69
+ explanation: HumanFriendlyExplanation;
70
+ };
71
+ export declare function evaluateParameterPolicyRules(paramsOrToolSlug: {
72
+ policy?: Partial<GovernancePolicy> | null;
73
+ toolSlug: string;
74
+ input: Record<string, unknown>;
75
+ } | string, maybeInput?: Record<string, unknown>, maybePolicy?: Partial<GovernancePolicy> | null): {
76
+ violated: boolean;
77
+ allowed: boolean;
78
+ explicitAllow: boolean;
79
+ action: "allow" | "auto_approve" | "block" | "deny" | "require_approval";
80
+ matchedRule: ParameterPolicyRule | null;
81
+ violatedRule: ParameterPolicyRule | null;
82
+ reason: string | null;
83
+ };
84
+ export declare function describeParameterRuleCompliance(rule: ParameterPolicyRule): string;
85
+ export interface LlmRiskLaneRule {
86
+ riskLevel: RiskLevel;
87
+ status: "auto_approved" | "requires_approval" | "blocked";
88
+ executeTool: string;
89
+ reason: string;
90
+ }
91
+ export interface LlmPolicyAndGovernanceBrief {
92
+ workspaceId?: string;
93
+ posture: "paused" | "read_only_sandbox" | "ask_every_time" | "safe_default" | "hands_off" | "monitor";
94
+ mode: "enforce" | "monitor";
95
+ executionRing: 0 | 1 | 2 | 3;
96
+ headline: string;
97
+ preferredExplanation: string;
98
+ plainEnglish: ReturnType<typeof describePolicyInPlainEnglish>;
99
+ languageMode: LanguageMode;
100
+ customInstructions: string[];
101
+ killSwitch: {
102
+ active: boolean;
103
+ reason: string | null;
104
+ howToToggleMcp: {
105
+ pause: {
106
+ tool: "get_run_context";
107
+ arguments: Record<string, unknown>;
108
+ };
109
+ resume: {
110
+ tool: "get_run_context";
111
+ arguments: Record<string, unknown>;
112
+ };
113
+ };
114
+ };
115
+ budgetGuardrail: {
116
+ maxCreditsPerRun: number;
117
+ maxUsdPerRun: number;
118
+ allowInstantWallet: boolean;
119
+ allowProvisioning: boolean;
120
+ blockDestructiveSql: boolean;
121
+ };
122
+ riskLaneMatrix: Record<RiskLevel, LlmRiskLaneRule>;
123
+ autoApproveRiskLevels: RiskLevel[];
124
+ requireApprovalRiskLevels: RiskLevel[];
125
+ blockedRiskLevels: RiskLevel[];
126
+ blockedToolSlugs: string[];
127
+ parameterRules: Array<ParameterPolicyRule & {
128
+ howToComply: string;
129
+ }>;
130
+ naturalLanguageRules: string[];
131
+ activeDefaults: Record<string, unknown>;
132
+ trustScore?: {
133
+ overall: number;
134
+ tier: string;
135
+ };
136
+ agentDid?: string;
137
+ llmSystemDirective: string;
138
+ agentControlCheatsheet: Array<{
139
+ intent: string;
140
+ mcpTool: string;
141
+ arguments: Record<string, unknown>;
142
+ }>;
143
+ }
144
+ export declare function buildLlmPolicyAndGovernanceBrief(policy?: GovernancePolicy, options?: {
145
+ workspaceId?: string;
146
+ workspaceName?: string;
147
+ workspaceSlug?: string;
148
+ activeDefaults?: Record<string, unknown>;
149
+ trustScore?: {
150
+ overall: number;
151
+ tier: string;
152
+ };
153
+ agentDid?: string;
154
+ }): LlmPolicyAndGovernanceBrief;
155
+ export interface PolicySimulationResult {
156
+ ok: true;
157
+ action: "check_policy";
158
+ toolSlug: string;
159
+ toolName?: string;
160
+ riskLevel: RiskLevel;
161
+ creditCost: number;
162
+ decision: "auto_approved" | "pending_approval" | "blocked";
163
+ approvalStatus: "auto_approved" | "pending_approval" | "blocked";
164
+ allowed: boolean;
165
+ requiresApproval: boolean;
166
+ blocked: boolean;
167
+ executeTool: string;
168
+ effectiveInput: Record<string, unknown>;
169
+ autoFilledInput: Record<string, unknown>;
170
+ reasons: string[];
171
+ matchedParameterRule: ParameterPolicyRule | null;
172
+ violatedParameterRule: ParameterPolicyRule | null;
173
+ remediationForLlm: string;
174
+ nextToolCalls: Array<{
175
+ tool: string;
176
+ input: Record<string, unknown>;
177
+ when: string;
178
+ }>;
179
+ }
180
+ export declare function simulatePolicyEvaluation(params: {
181
+ policy?: GovernancePolicy | null;
182
+ toolSlug: string;
183
+ toolName?: string;
184
+ riskLevel?: RiskLevel;
185
+ creditCost?: number;
186
+ creditsBalance?: number;
187
+ lane?: string;
188
+ input?: Record<string, unknown>;
189
+ activeDefaults?: Record<string, unknown>;
190
+ }): PolicySimulationResult;