@muxoai/platform 1.4.1 → 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 (43) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/README.md +1 -1
  4. package/dist/cli.js +6 -3
  5. package/dist/composio-catalog.d.ts +177 -1
  6. package/dist/composio-catalog.js +1427 -7
  7. package/dist/config.d.ts +6 -0
  8. package/dist/config.js +11 -1
  9. package/dist/engine.d.ts +18 -1
  10. package/dist/engine.js +259 -35
  11. package/dist/mcp-schema.d.ts +162 -1
  12. package/dist/mcp-schema.js +1523 -40
  13. package/dist/mcp.d.ts +2 -2
  14. package/dist/mcp.js +412 -23
  15. package/dist/policy.d.ts +108 -1
  16. package/dist/policy.js +406 -1
  17. package/dist/providers/composio-instant.js +38 -3
  18. package/dist/providers/composio-sdk.d.ts +59 -2
  19. package/dist/providers/composio-sdk.js +273 -59
  20. package/dist/providers/stripe-projects.d.ts +4 -0
  21. package/dist/providers/stripe-projects.js +548 -126
  22. package/dist/server.js +531 -61
  23. package/dist/store.js +2 -0
  24. package/dist/types.d.ts +15 -0
  25. package/dist/ui/console-html.d.ts +31 -1
  26. package/dist/ui/console-html.js +922 -368
  27. package/dist/ui/design-tokens.js +1 -1
  28. package/dist/version.d.ts +1 -1
  29. package/dist/version.js +1 -1
  30. package/package.json +3 -2
  31. package/plugins/muxo/.claude-plugin/plugin.json +2 -2
  32. package/plugins/muxo/.codex-plugin/plugin.json +15 -8
  33. package/plugins/muxo/.cursor-plugin/plugin.json +30 -0
  34. package/plugins/muxo/hooks/session-start.sh +15 -3
  35. package/plugins/muxo/hooks/user-prompt-submit.sh +14 -1
  36. package/plugins/muxo/mcp.json +0 -10
  37. package/plugins/muxo/plugin.json +4 -4
  38. package/plugins/muxo/skills/muxo/SKILL.md +25 -16
  39. package/plugins/muxo/skills/muxo/references/cli.md +5 -1
  40. package/plugins/muxo/skills/muxo/references/mcp.md +11 -6
  41. package/plugins/muxo/skills/muxo-activity-summary/SKILL.md +81 -0
  42. package/plugins/muxo/skills/setup/SKILL.md +1 -1
  43. package/src/catalogues/stripe-projects-catalog.json +140 -0
@@ -1,8 +1,81 @@
1
+ import type { HumanHandoff } from "./types.js";
1
2
  export interface McpToolAnnotations {
3
+ title?: string;
2
4
  readOnlyHint: boolean;
3
5
  destructiveHint: boolean;
6
+ idempotentHint?: boolean;
4
7
  openWorldHint: boolean;
5
8
  }
9
+ export declare const LATEST_MCP_PROTOCOL_VERSION = "2026-07-28";
10
+ export declare const DEFAULT_LEGACY_MCP_PROTOCOL_VERSION = "2025-06-18";
11
+ /**
12
+ * Dual-era MCP protocol versions supported by Muxo:
13
+ * - Modern stateless era: 2026-07-28 (SEP-2575 server/discover, SEP-2549 caching, MRTR resultType)
14
+ * - Legacy session era: 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05
15
+ */
16
+ export declare const SUPPORTED_MCP_PROTOCOL_VERSIONS: readonly ["2026-07-28", "2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"];
17
+ export declare const MCP_ERR_HEADER_MISMATCH = -32020;
18
+ export declare const MCP_ERR_MISSING_REQUIRED_CLIENT_CAPABILITY = -32021;
19
+ export declare const MCP_ERR_UNSUPPORTED_PROTOCOL_VERSION = -32022;
20
+ export declare function isSupportedMcpProtocolVersion(version: unknown): boolean;
21
+ /**
22
+ * Decodes an MCP Streamable HTTP header value (`Mcp-Name`, `Mcp-Param-*`),
23
+ * supporting plain ASCII as well as the 2026-07-28 Base64 sentinel format (`=:base64:...:`)
24
+ * and RFC 2047 `=?utf-8?B?...?=`.
25
+ */
26
+ export declare function decodeMcpHeaderValue(raw: string): string;
27
+ export interface McpHttpHeaderValidationInput {
28
+ protocolVersion?: string | null;
29
+ method?: string | null;
30
+ name?: string | null;
31
+ }
32
+ export interface McpJsonRpcErrorObject {
33
+ code: number;
34
+ message: string;
35
+ data?: Record<string, unknown>;
36
+ }
37
+ /**
38
+ * Validates MCP 2026-07-28 Streamable HTTP headers (`MCP-Protocol-Version`, `Mcp-Method`,
39
+ * `Mcp-Name`) and per-request `params._meta["io.modelcontextprotocol/protocolVersion"]`
40
+ * against the JSON-RPC request body.
41
+ *
42
+ * Returns `-32020 HeaderMismatch` when `Mcp-Method` or `Mcp-Name` conflicts with the body,
43
+ * and `-32022 UnsupportedProtocolVersion` when an unsupported protocol version is requested.
44
+ */
45
+ export declare function validateMcpHttpHeadersAndMeta(headers: McpHttpHeaderValidationInput, rpc: unknown): {
46
+ ok: true;
47
+ protocolVersion: string;
48
+ } | {
49
+ ok: false;
50
+ id: unknown;
51
+ error: McpJsonRpcErrorObject;
52
+ };
53
+ /**
54
+ * Builds the canonical MCP 2026-07-28 `server/discover` response (SEP-2575 + SEP-2549).
55
+ * Includes both top-level `serverInfo`/`instructions` and `_meta["io.modelcontextprotocol/*"]`
56
+ * so both strict 2026-07-28 validators and dual-era clients succeed.
57
+ */
58
+ export declare function buildMcpDiscoverResult(serverVersion: string): Record<string, unknown>;
59
+ /**
60
+ * Canonical MCP Resource Templates (`resources/templates/list`) for parameterized
61
+ * governance, tool catalog, and skill inspection.
62
+ */
63
+ export interface McpResourceTemplate {
64
+ uriTemplate: string;
65
+ name: string;
66
+ title: string;
67
+ description: string;
68
+ mimeType: string;
69
+ }
70
+ export declare const MUXO_MCP_RESOURCE_TEMPLATES: McpResourceTemplate[];
71
+ /**
72
+ * Evaluates MCP `completion/complete` requests for prompt arguments and resource templates.
73
+ */
74
+ export declare function completeMcpArgument(params: Record<string, unknown> | undefined, toolSlugs?: string[]): {
75
+ values: string[];
76
+ total: number;
77
+ hasMore: boolean;
78
+ };
6
79
  export interface McpToolSecurityScheme {
7
80
  type: "noauth" | "oauth2";
8
81
  scopes?: string[];
@@ -23,6 +96,55 @@ export declare const DEFAULT_TOOL_SECURITY_SCHEMES: McpToolSecurityScheme[];
23
96
  /** Catalog discovery tools work anonymously and also accept OAuth. */
24
97
  export declare const PUBLIC_TOOL_SECURITY_SCHEMES: McpToolSecurityScheme[];
25
98
  export declare const PUBLIC_MCP_TOOL_NAMES: ReadonlySet<string>;
99
+ export declare const MUXO_UI_WIDGET_URI = "ui://widget/muxo-card.html";
100
+ export declare const MUXO_UI_MCP_APP_URI = "ui://widget/muxo-app.html";
101
+ /**
102
+ * Tools whose results represent interactive user-facing milestones (catalog carousel,
103
+ * OAuth handoff, action plan review/edit, execution receipt, or workspace summary).
104
+ * Pure data/inspection helpers remain usable without forcing unnecessary widget remounts.
105
+ */
106
+ export declare const UI_RENDERED_MCP_TOOL_NAMES: ReadonlySet<string>;
107
+ export declare function mcpToolUiMeta(invoking: string, invoked: string, extra?: Record<string, unknown>): Record<string, unknown>;
108
+ export interface OpenAiClientRequestMeta {
109
+ locale?: string;
110
+ userAgent?: string;
111
+ userLocation?: {
112
+ city?: string;
113
+ region?: string;
114
+ country?: string;
115
+ timezone?: string;
116
+ longitude?: number;
117
+ latitude?: number;
118
+ };
119
+ subject?: string;
120
+ session?: string;
121
+ organization?: string;
122
+ widgetSessionId?: string;
123
+ }
124
+ /**
125
+ * Extracts optional OpenAI / MCP Apps client hints from JSON-RPC `params._meta`
126
+ * (`openai/locale`, `openai/userAgent`, `openai/userLocation`, `openai/subject`,
127
+ * `openai/session`, `openai/organization`, `openai/widgetSessionId`).
128
+ * These are best-effort hints and must never be used for authorization decisions.
129
+ */
130
+ export declare function extractOpenAiClientMeta(params?: Record<string, unknown> | null): OpenAiClientRequestMeta;
131
+ /**
132
+ * Enriches a tool descriptor for `tools/list` with both top-level `securitySchemes`
133
+ * and `_meta.securitySchemes` back-compat mirror per the OpenAI Plugin UI reference,
134
+ * as well as all four standard MCP tool annotations (`readOnlyHint`, `destructiveHint`,
135
+ * `idempotentHint`, `openWorldHint`).
136
+ */
137
+ export declare function buildMcpToolDescriptor(tool: McpToolDefinition): McpToolDefinition;
138
+ /**
139
+ * Builds the `_meta` object returned on `tools/call` results. Delivers widget-only
140
+ * metadata (`_meta`) without bloating the model-visible conversation transcript.
141
+ */
142
+ export declare function buildMcpToolResultMeta(toolName: string, params?: Record<string, unknown> | null): Record<string, unknown>;
143
+ /**
144
+ * Builds the `_meta` object for error tool results, including RFC 7235
145
+ * `_meta["mcp/www_authenticate"]` when an authentication challenge is required.
146
+ */
147
+ export declare function buildMcpErrorResultMeta(err: unknown, baseUrl?: string): Record<string, unknown> | undefined;
26
148
  /** Stable per-workspace agent identity returned at agent signup on both runtimes. */
27
149
  export declare function workspaceAgentDid(workspaceId: string): string;
28
150
  /** JSON-RPC methods that anonymous MCP clients may call for discovery. */
@@ -62,7 +184,7 @@ export declare function findMcpSkill<T extends {
62
184
  requested: string;
63
185
  };
64
186
  export declare const APPROVED_PLAN_STATUSES: ReadonlySet<string>;
65
- export declare const GET_RUN_CONTEXT_ACTIONS: readonly ["inspect", "remember", "recall", "forget", "memory_graph", "set_guardrail", "governance_status", "scan_context", "list_workspaces", "switch_workspace", "onboard_team"];
187
+ export declare const GET_RUN_CONTEXT_ACTIONS: readonly ["inspect", "remember", "recall", "forget", "memory_graph", "set_guardrail", "reset_guardrails", "check_policy", "kill_switch", "governance_status", "scan_context", "list_workspaces", "switch_workspace", "onboard_team"];
66
188
  /** Error carrying a structured MCP/REST payload (merged into structuredContent / JSON body). */
67
189
  export declare class MuxoToolError extends Error {
68
190
  readonly code: string;
@@ -82,6 +204,13 @@ export interface ApprovalGatePlan {
82
204
  approvalStatus: string;
83
205
  }
84
206
  export declare function buildApprovalUrl(baseUrl: string, planId: string): string;
207
+ export declare function buildApprovalHumanHandoff(baseUrl: string, plan: ApprovalGatePlan): HumanHandoff;
208
+ export declare function buildOAuthHumanHandoff(params: {
209
+ providerSlug: string;
210
+ providerName?: string;
211
+ redirectUrl: string | null;
212
+ instructions?: string;
213
+ }): HumanHandoff;
85
214
  /** Structured response returned when execute_<risk> is called on a plan still awaiting approval. */
86
215
  export declare function buildApprovalRequiredPayload(baseUrl: string, plan: ApprovalGatePlan): Record<string, unknown>;
87
216
  export declare function approvalRequiredError(baseUrl: string, plan: ApprovalGatePlan): MuxoToolError;
@@ -123,3 +252,35 @@ export interface McpHarnessGuidance {
123
252
  * (Claude Code, Cursor, Codex, OpenAI MCP, Windsurf) always know the exact next tool call.
124
253
  */
125
254
  export declare function attachMcpHarnessGuidance<T>(toolName: string, toolArgs: Record<string, unknown>, output: T): T;
255
+ export interface McpUiResourceDescriptor {
256
+ uri: string;
257
+ name: string;
258
+ title: string;
259
+ description: string;
260
+ mimeType: string;
261
+ _meta: Record<string, unknown>;
262
+ }
263
+ /**
264
+ * Canonical OpenAI Plugin UI (`text/html+skybridge`) & MCP Apps (`text/html;profile=mcp-app`)
265
+ * widget resource descriptors exposed by `resources/list` and `resources/read`.
266
+ * Follows:
267
+ * - https://developers.openai.com/plugins/reference
268
+ * - https://developers.openai.com/plugins/build/chatgpt-ui
269
+ * - https://developers.openai.com/plugins/concepts/ui-guidelines
270
+ */
271
+ export declare const MUXO_UI_CSP_DOMAINS: readonly ["https://api.muxo.ai", "https://muxo.ai", "https://app.muxo.ai"];
272
+ export declare const MUXO_UI_REDIRECT_DOMAINS: readonly ["https://api.muxo.ai", "https://muxo.ai", "https://app.muxo.ai", "https://connect.composio.dev", "https://backend.composio.dev"];
273
+ export declare const MUXO_UI_RESOURCES: McpUiResourceDescriptor[];
274
+ /**
275
+ * Renders the self-contained OpenAI Plugin UI / MCP App widget HTML (`ui://widget/muxo-card.html`).
276
+ * Strictly adheres to https://developers.openai.com/plugins/concepts/ui-guidelines:
277
+ * - System font stack (`-apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif`)
278
+ * - Light & dark mode CSS variables (`window.openai.theme` + `prefers-color-scheme`)
279
+ * - Brand accent (`#6366F1` light / `#818CF8` dark) only on primary buttons & badges (WCAG AA)
280
+ * - Monochromatic outlined SVG icons; no duplicate app logo header
281
+ * - Auto-fitting inline card with no nested scrollbars (`notifyIntrinsicHeight`), max 2 bottom CTAs
282
+ * - Inline 3–8 card carousel for `search_tools` catalog results
283
+ * - Inline editable parameter controls for `plan_action` before clicking Execute
284
+ * - Expand to fullscreen (`requestDisplayMode({ mode: "fullscreen" })`) for rich inspection
285
+ */
286
+ export declare function renderMuxoUiWidgetHtml(baseUrl?: string): string;