@muxoai/sdk 1.4.3 → 1.4.4

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/dist/server.js CHANGED
@@ -10,6 +10,7 @@ import { MuxoStore } from "./store.js";
10
10
  import { managedProviderConnectionList, managedProviderConnectionRequest, managedProviderConnectionUnlink, managedResource, managedResourceAction, } from "./provisioning-managed.js";
11
11
  import { DEFAULT_WORKSPACE_POLICY, describePolicyInPlainEnglish, sanitizePolicyPatch, } from "./policy.js";
12
12
  import { parseNaturalLanguageMemoryInstruction } from "./providers/supermemory.js";
13
+ import { getMuxoSkill, listMuxoSkills, renderMuxoSkillMarkdown, } from "./skills-catalog.js";
13
14
  import { MUXO_VERSION } from "./version.js";
14
15
  import { fetchMuxoConnectLinkMetadata, isStripeProjectsExclusiveProvider, normalizeStripeProjectsProviderSlug, parseComposioWebhookEnvelope, submitMuxoConnectLink, verifyComposioWebhookSignature, wrapMuxoConnectUrl, } from "./composio-catalog.js";
15
16
  import { isConsolePath, renderApprovalPageHtml, renderConsoleHtml, renderLandingHtml, renderOAuthCallbackPageHtml, renderOAuthConnectPageHtml, renderOAuthConsentHtml, } from "./ui/console-html.js";
@@ -134,6 +135,16 @@ Teach preferences in plain English and Muxo auto-fills matching tool inputs on e
134
135
  - "What do you remember?"
135
136
 
136
137
  \`plan_action\` recalls workspace memory before governance checks and reports \`memoryContext.autoFilledInput\` plus \`activeDefaults\` so callers can see exactly which parameters were filled from memory.
138
+
139
+ ## Natural-Language Saga Playbooks, Temporal Rollbacks, Cedar, OTel & One-Shot Harness Config
140
+
141
+ Pass plain English to \`POST /api/v1/do\` or MCP \`get_run_context({ prompt: "..." })\`:
142
+ - **Playbooks**: "Run the fullstack cloud bootstrap playbook", "Create playbook daily-seo-slack that runs instant.seo.audit and app.slack.send_message" (\`GET/POST /api/v1/playbooks\`, \`POST /api/v1/playbooks/:slug/run\`)
143
+ - **Temporal Workflows ("latest" supported)**: "Rollback the latest workflow because staging healthcheck failed", "Show Temporal history for latest workflow" (\`POST /api/v1/workflows/latest/rollback\`, \`GET /api/v1/workflows/latest/history\`)
144
+ - **Time-Travel & BFS Memory Graph**: "Show my knowledge graph as of 2026-10-20T00:00:00Z within 2 hops of workspace" (\`GET /api/v1/memory/graph?as_of=...&focal_entity=...&max_hops=2\`)
145
+ - **AWS Cedar 4.0 & OPA Rego v1**: "Compile our guardrails to AWS Cedar", "Evaluate Cedar policy for resource.turso.database with DROP TABLE users" (\`GET /api/v1/governance/cedar\`, \`POST /api/v1/governance/cedar/evaluate\`)
146
+ - **OTel GenAI & FinOps ROI**: "Export OpenTelemetry traces", "What is our ROI and engineering hours saved?" (\`GET /api/v1/telemetry/otlp\`, \`GET /api/v1/analytics/roi\`)
147
+ - **One-Shot Harness Configurator**: "Configure harness preset strict-production" (\`GET/POST /api/v1/harness/configure\`, presets: \`startup-builder\`, \`strict-production\`, \`read-only-auditor\`, \`finops-byok-zero-cost\`).
137
148
  `;
138
149
  }
139
150
  async function readBody(req) {
@@ -825,6 +836,22 @@ Users purchase Muxo Credits (\`POST /api/v1/billing/topup\` or \`muxo billing to
825
836
  res.end(renderSkillMarkdown(config.baseUrl));
826
837
  return;
827
838
  }
839
+ const publicSkillMatch = pathname.match(/^\/skills\/([^/]+?)(?:\/SKILL\.md|\.md)$/i);
840
+ if (publicSkillMatch && req.method === "GET") {
841
+ const slug = decodeURIComponent(publicSkillMatch[1]);
842
+ const md = renderMuxoSkillMarkdown(slug, config.baseUrl);
843
+ if (!md) {
844
+ sendJson(res, 404, {
845
+ ok: false,
846
+ code: "SKILL_NOT_FOUND",
847
+ error: `Skill not found: ${slug}`,
848
+ });
849
+ return;
850
+ }
851
+ res.writeHead(200, { "Content-Type": "text/markdown; charset=utf-8" });
852
+ res.end(md);
853
+ return;
854
+ }
828
855
  if (pathname === "/llms.txt" && req.method === "GET") {
829
856
  res.writeHead(200, { "Content-Type": "text/plain; charset=utf-8" });
830
857
  res.end(`# Muxo\n> Unified agent execution across Connected Apps, Instant Tools, Cloud Infrastructure, Workspace Memory, and Safety Guardrails.\n\n- Skill Document: ${config.baseUrl}/skill.md\n- Auth Guide: ${config.baseUrl}/auth.md\n- OpenAPI 3.1 Spec: ${config.baseUrl}/api/openapi.json\n- MCP Endpoint: ${config.baseUrl}/mcp\n- OAuth Callback Handoff: ${config.baseUrl}/oauth/callback\n- Plugin Marketplace (Codex/OpenAI): ${config.baseUrl}/.agents/plugins/marketplace.json\n- Plugin Marketplace (Claude/Droid): ${config.baseUrl}/.claude-plugin/marketplace.json\n- Console (app.muxo.ai): ${config.baseUrl}/\n- Landing & Provider Canvas (muxo.ai): ${config.baseUrl}/landing\n- Documentation (docs.muxo.ai): ${config.docsUrl}\n\n## Agent-Native Policy, Context & Governance Interface\n- MCP Control Plane (\`get_run_context\`): \`action: "recall" | "remember" | "forget" | "set_guardrail" | "reset_guardrails" | "check_policy" | "governance_status" | "kill_switch" | "scan_context"\`\n- Strict /v1 Organization Brief: \`get_organization({ company_context: { required: false } })\` returns accepted workspace policy facts + learned defaults in \`company_context.packet\`\n- Dry-Run Policy Simulator: \`POST ${config.baseUrl}/api/v1/guardrails/check\` (\`{ "tool_slug": "...", "input": { ... } }\`) or MCP \`get_run_context({ action: "check_policy", tool_slug, input })\`\n- Guardrails & Policy Brief: \`GET/POST ${config.baseUrl}/api/v1/guardrails\`, \`POST ${config.baseUrl}/api/v1/guardrails/reset\`, \`GET ${config.baseUrl}/api/v1/governance\` (includes \`llmPolicyBrief\`)\n- MCP Resources: \`muxo://policy/brief\`, \`muxo://governance/policy\`, \`muxo://context\`, \`muxo://memory/graph\`\n- MCP Prompts: \`context\`, \`policy_guardrails\`, \`governed_execution\`, \`security_audit\`\n`);
@@ -3014,6 +3041,13 @@ Users purchase Muxo Credits (\`POST /api/v1/billing/topup\` or \`muxo billing to
3014
3041
  sendJson(res, 200, cancelled);
3015
3042
  return;
3016
3043
  }
3044
+ const runReconcileMatch = pathname.match(/^\/api\/v1\/runs\/([^/]+)\/reconcile$/);
3045
+ if (runReconcileMatch && (req.method === "GET" || req.method === "POST")) {
3046
+ const runOrPlanId = decodeURIComponent(runReconcileMatch[1]);
3047
+ const report = engine.reconcileRun(ctx, runOrPlanId);
3048
+ sendJson(res, 200, report);
3049
+ return;
3050
+ }
3017
3051
  const runGetMatch = pathname.match(/^\/api\/v1\/runs\/([^/]+)$/);
3018
3052
  if (runGetMatch && req.method === "GET") {
3019
3053
  const runId = decodeURIComponent(runGetMatch[1]);
@@ -3636,8 +3670,44 @@ Users purchase Muxo Credits (\`POST /api/v1/billing/topup\` or \`muxo billing to
3636
3670
  sendJson(res, 200, { ok: true, ...otel });
3637
3671
  return;
3638
3672
  }
3673
+ if (pathname === "/api/v1/skills" && req.method === "GET") {
3674
+ const category = url.searchParams.get("category") || undefined;
3675
+ const provider = url.searchParams.get("provider") || undefined;
3676
+ const query = url.searchParams.get("q") ||
3677
+ url.searchParams.get("query") ||
3678
+ undefined;
3679
+ const skills = listMuxoSkills({ category, provider, query }, config.baseUrl);
3680
+ sendJson(res, 200, {
3681
+ ok: true,
3682
+ count: skills.length,
3683
+ skills,
3684
+ });
3685
+ return;
3686
+ }
3687
+ const apiSkillMatch = pathname.match(/^\/api\/v1\/skills\/([^/]+)$/);
3688
+ if (apiSkillMatch && req.method === "GET") {
3689
+ const slug = decodeURIComponent(apiSkillMatch[1]).replace(/\.md$/i, "");
3690
+ const skill = getMuxoSkill(slug, config.baseUrl);
3691
+ const markdown = renderMuxoSkillMarkdown(slug, config.baseUrl);
3692
+ if (!skill || !markdown) {
3693
+ sendJson(res, 404, {
3694
+ ok: false,
3695
+ code: "SKILL_NOT_FOUND",
3696
+ error: `Skill not found: ${slug}`,
3697
+ });
3698
+ return;
3699
+ }
3700
+ sendJson(res, 200, {
3701
+ ok: true,
3702
+ skill,
3703
+ markdown,
3704
+ skillUrl: `${config.baseUrl}/skills/${skill.slug}/SKILL.md`,
3705
+ mcpResourceUri: `muxo://skills/${skill.slug}`,
3706
+ });
3707
+ return;
3708
+ }
3639
3709
  if (pathname === "/api/v1/playbooks" && req.method === "GET") {
3640
- const playbooks = engine.listCommercialPlaybooks();
3710
+ const playbooks = engine.listCommercialPlaybooks(ctx);
3641
3711
  sendJson(res, 200, {
3642
3712
  ok: true,
3643
3713
  count: playbooks.length,
@@ -3645,13 +3715,22 @@ Users purchase Muxo Credits (\`POST /api/v1/billing/topup\` or \`muxo billing to
3645
3715
  });
3646
3716
  return;
3647
3717
  }
3718
+ if (pathname === "/api/v1/playbooks" && req.method === "POST") {
3719
+ const body = JSON.parse((await readBody(req)) || "{}");
3720
+ const created = engine.createCustomPlaybook(ctx, {
3721
+ prompt: body.prompt || body.instruction || body.description || "",
3722
+ input: body,
3723
+ });
3724
+ sendJson(res, 201, created);
3725
+ return;
3726
+ }
3648
3727
  const playbookRunMatch = pathname.match(/^\/api\/v1\/playbooks\/([^/]+)\/run$/);
3649
3728
  if ((playbookRunMatch || pathname === "/api/v1/playbooks/run") &&
3650
3729
  req.method === "POST") {
3651
3730
  const body = JSON.parse((await readBody(req)) || "{}");
3652
3731
  const slug = playbookRunMatch
3653
3732
  ? decodeURIComponent(playbookRunMatch[1])
3654
- : String(body.slug || body.playbook || "");
3733
+ : String(body.slug || body.playbook || body.prompt || "");
3655
3734
  const result = engine.runCommercialPlaybook(ctx, {
3656
3735
  slug,
3657
3736
  input: body.input && typeof body.input === "object"
@@ -3661,6 +3740,30 @@ Users purchase Muxo Credits (\`POST /api/v1/billing/topup\` or \`muxo billing to
3661
3740
  sendJson(res, 201, result);
3662
3741
  return;
3663
3742
  }
3743
+ if ((pathname === "/api/v1/harness/configure" ||
3744
+ pathname === "/api/v1/harness/presets") &&
3745
+ (req.method === "GET" || req.method === "POST")) {
3746
+ const body = req.method === "POST"
3747
+ ? JSON.parse((await readBody(req)) || "{}")
3748
+ : {};
3749
+ const preset = body.preset ||
3750
+ url.searchParams.get("preset") ||
3751
+ null;
3752
+ const harness = body.harness ||
3753
+ url.searchParams.get("harness") ||
3754
+ null;
3755
+ const prompt = body.prompt ||
3756
+ body.instruction ||
3757
+ url.searchParams.get("prompt") ||
3758
+ null;
3759
+ const configured = await engine.configureHarness(ctx, {
3760
+ preset: preset ? String(preset) : null,
3761
+ harness: harness ? String(harness) : null,
3762
+ prompt: prompt ? String(prompt) : null,
3763
+ });
3764
+ sendJson(res, 200, configured);
3765
+ return;
3766
+ }
3664
3767
  if ((pathname === "/api/v1/analytics/roi" ||
3665
3768
  pathname === "/api/v1/billing/roi") &&
3666
3769
  req.method === "GET") {
@@ -0,0 +1,66 @@
1
+ export type MuxoSkillCategory = "governance" | "app_automation" | "cloud_infrastructure" | "workflow";
2
+ export interface MuxoSkillDefinition {
3
+ slug: string;
4
+ name: string;
5
+ title: string;
6
+ description: string;
7
+ category: MuxoSkillCategory;
8
+ lane: "composio_sdk" | "stripe_projects" | "composio_instant" | "hybrid";
9
+ providerSlug: string;
10
+ providerName: string;
11
+ requiresMcp: string[];
12
+ mcpServerUrl: string;
13
+ recommendedTools: string[];
14
+ workflowSteps: string[];
15
+ pitfalls: string[];
16
+ stripeProjectsOverride?: {
17
+ enforced: boolean;
18
+ canonicalToolSlug: string;
19
+ reason: string;
20
+ };
21
+ sourceRepo: string;
22
+ }
23
+ export interface MuxoMcpSkillBundle {
24
+ name: string;
25
+ description: string;
26
+ version: string;
27
+ uri: string;
28
+ frontmatter: {
29
+ name: string;
30
+ description: string;
31
+ };
32
+ content: string;
33
+ files: Array<{
34
+ path: string;
35
+ uri: string;
36
+ mimeType: string;
37
+ content: string;
38
+ }>;
39
+ }
40
+ export declare function transpileAwesomeClaudeSkillToMuxo(rawMarkdown: string, baseUrl?: string): string;
41
+ export declare function listMuxoSkills(filter?: {
42
+ category?: string;
43
+ provider?: string;
44
+ query?: string;
45
+ }, baseUrl?: string): MuxoSkillDefinition[];
46
+ export declare function getMuxoSkill(slug: string, baseUrl?: string): MuxoSkillDefinition | null;
47
+ export declare function renderMuxoSkillMarkdown(slug: string, baseUrl?: string): string | null;
48
+ export interface MuxoDomainSkillHint {
49
+ slug: string;
50
+ title: string;
51
+ category: MuxoSkillCategory;
52
+ lane: string;
53
+ mcpResourceUri: string;
54
+ skillUrl: string;
55
+ recommendedTools: string[];
56
+ pitfalls: string[];
57
+ stripeProjectsOverride?: {
58
+ enforced: boolean;
59
+ canonicalToolSlug: string;
60
+ reason: string;
61
+ };
62
+ }
63
+ export declare function getProviderSkillHint(toolOrProviderSlug: string, baseUrl?: string): MuxoDomainSkillHint | null;
64
+ export declare function buildMuxoMcpSkillBundles(baseUrl?: string, options?: {
65
+ includeAll?: boolean;
66
+ }): MuxoMcpSkillBundle[];