@mistflow-ai/mcp 0.2.0 → 0.4.0

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.
@@ -1 +1 @@
1
- import{c as m,d as y}from"./chunk-3BQGCB7F.js";import{h as f,j as u,n as p,u as g}from"./chunk-MAAENV5J.js";import{existsSync as h,readFileSync as w,writeFileSync as b}from"fs";import{join as l}from"path";import{spawn as j}from"child_process";function C(r,t,e,s,o){return new Promise(n=>{let a=j(r,t,{cwd:e,stdio:["pipe","pipe","pipe"],timeout:s,...o?{env:{...process.env,...o}}:{}}),c="",d="";a.stdout?.on("data",i=>{c+=i.toString()}),a.stderr?.on("data",i=>{d+=i.toString()}),a.on("close",i=>n({success:i===0,stdout:c,stderr:d})),a.on("error",i=>n({success:!1,stdout:c,stderr:d+i.message}))})}function P(r){let t=l(r,"mistflow.json");if(!h(t))return null;try{return JSON.parse(w(t,"utf-8"))}catch{return null}}function k(r,t){b(l(r,"mistflow.json"),JSON.stringify(t,null,2))}async function S(r,t){try{let e=t.features,s=t.steps,o={plan:t};Array.isArray(e)&&e.length>0&&(o.features=e.map(n=>n.name)),Array.isArray(s)&&s.length>0&&(o.provenance=s.map(n=>({feature:n.name??n.title??`Step ${n.number??"?"}`,user_intent:(n.description??"").slice(0,500),decisions:"Seeded from plan",tradeoffs:"",files_affected:[]}))),await fetch(`${u()}/api/projects/${encodeURIComponent(r)}/state`,{method:"PUT",headers:{...p(),"Content-Type":"application/json"},body:JSON.stringify(o)})}catch(e){console.error("[self-heal] state sync failed:",e instanceof Error?e.message:String(e))}}async function x(r,t={}){let e=P(r);if(e){if(!f())return e.projectId;if(!e.projectId)try{let o=e.plan?.requestedSubdomain,n=await g(e.name,void 0,e.dbProvider??"neon",o);return e.projectId=n.id,k(r,e),m(r,y(n.id,e.name)),e.plan&&await S(n.id,e.plan),console.error(`[self-heal] registered project ${n.id.slice(0,8)} with backend`),n.id}catch(s){console.error("[self-heal] createProject failed:",s instanceof Error?s.message:String(s));return}return t.forceSync&&e.plan&&e.projectId&&await S(e.projectId,e.plan),e.projectId}}async function N(r,t){let e=["button","card","input","label","form","dialog","table","dropdown-menu","badge","separator","skeleton","sheet","tabs","avatar","select","textarea","checkbox","switch","tooltip","popover","sonner"],s=t&&t.length>0?t:e,o=l(r,"components","ui"),n=[],a=[];for(let i of s)h(l(o,`${i}.tsx`))?n.push(i):a.push(i);if(a.length===0)return{installed:[],alreadyPresent:n};let c={NPM_CONFIG_LEGACY_PEER_DEPS:"true"},d=await C("npx",["--yes","shadcn@latest","add","-y","-o",...a],r,18e4,c);return d.success?{installed:a,alreadyPresent:n}:{installed:[],alreadyPresent:n,failed:`shadcn add failed for: ${a.join(", ")}. ${d.stderr.slice(-300)}`.trim()}}export{x as ensureBackendRegistered,N as ensureShadcnComponents};
1
+ import{c as m,d as y}from"./chunk-POG2UHKW.js";import{h as f,j as u,n as p,u as g}from"./chunk-Y3F6QWAR.js";import{existsSync as h,readFileSync as w,writeFileSync as b}from"fs";import{join as l}from"path";import{spawn as j}from"child_process";function C(r,t,e,s,o){return new Promise(n=>{let a=j(r,t,{cwd:e,stdio:["pipe","pipe","pipe"],timeout:s,...o?{env:{...process.env,...o}}:{}}),c="",d="";a.stdout?.on("data",i=>{c+=i.toString()}),a.stderr?.on("data",i=>{d+=i.toString()}),a.on("close",i=>n({success:i===0,stdout:c,stderr:d})),a.on("error",i=>n({success:!1,stdout:c,stderr:d+i.message}))})}function P(r){let t=l(r,"mistflow.json");if(!h(t))return null;try{return JSON.parse(w(t,"utf-8"))}catch{return null}}function k(r,t){b(l(r,"mistflow.json"),JSON.stringify(t,null,2))}async function S(r,t){try{let e=t.features,s=t.steps,o={plan:t};Array.isArray(e)&&e.length>0&&(o.features=e.map(n=>n.name)),Array.isArray(s)&&s.length>0&&(o.provenance=s.map(n=>({feature:n.name??n.title??`Step ${n.number??"?"}`,user_intent:(n.description??"").slice(0,500),decisions:"Seeded from plan",tradeoffs:"",files_affected:[]}))),await fetch(`${u()}/api/projects/${encodeURIComponent(r)}/state`,{method:"PUT",headers:{...p(),"Content-Type":"application/json"},body:JSON.stringify(o)})}catch(e){console.error("[self-heal] state sync failed:",e instanceof Error?e.message:String(e))}}async function x(r,t={}){let e=P(r);if(e){if(!f())return e.projectId;if(!e.projectId)try{let o=e.plan?.requestedSubdomain,n=await g(e.name,void 0,e.dbProvider??"neon",o);return e.projectId=n.id,k(r,e),m(r,y(n.id,e.name)),e.plan&&await S(n.id,e.plan),console.error(`[self-heal] registered project ${n.id.slice(0,8)} with backend`),n.id}catch(s){console.error("[self-heal] createProject failed:",s instanceof Error?s.message:String(s));return}return t.forceSync&&e.plan&&e.projectId&&await S(e.projectId,e.plan),e.projectId}}async function N(r,t){let e=["button","card","input","label","form","dialog","table","dropdown-menu","badge","separator","skeleton","sheet","tabs","avatar","select","textarea","checkbox","switch","tooltip","popover","sonner"],s=t&&t.length>0?t:e,o=l(r,"components","ui"),n=[],a=[];for(let i of s)h(l(o,`${i}.tsx`))?n.push(i):a.push(i);if(a.length===0)return{installed:[],alreadyPresent:n};let c={NPM_CONFIG_LEGACY_PEER_DEPS:"true"},d=await C("npx",["--yes","shadcn@latest","add","-y","-o",...a],r,18e4,c);return d.success?{installed:a,alreadyPresent:n}:{installed:[],alreadyPresent:n,failed:`shadcn add failed for: ${a.join(", ")}. ${d.stderr.slice(-300)}`.trim()}}export{x as ensureBackendRegistered,N as ensureShadcnComponents};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g}from"./chunk-POG2UHKW.js";import"./chunk-Y3F6QWAR.js";export{d as emptyState,e as fetchRemoteState,g as fuzzyMatch,a as getLocalStatePath,b as readLocalState,f as syncRemoteState,c as writeLocalState};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistflow-ai/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Mistflow MCP server for AI coding editors. Installed into Claude Code, Cursor, Codex CLI, and VS Code Copilot by the mistflow-ai installer.",
5
5
  "license": "Elastic-2.0",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g}from"./chunk-3BQGCB7F.js";import"./chunk-MAAENV5J.js";export{d as emptyState,e as fetchRemoteState,g as fuzzyMatch,a as getLocalStatePath,b as readLocalState,f as syncRemoteState,c as writeLocalState};