infra-kit 0.11.0 → 0.11.10
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/{chunk-2H6VQIGT.js → chunk-ATGBWGER.js} +2 -2
- package/dist/{chunk-R2SZWOPC.js → chunk-GBPW4ERM.js} +2 -2
- package/dist/{chunk-F656FWV5.js → chunk-J6BHN362.js} +2 -2
- package/dist/{chunk-AG7XWZNT.js → chunk-KPRFMZCX.js} +2 -2
- package/dist/chunk-LAHHNH3T.js +2 -0
- package/dist/chunk-LAHHNH3T.js.map +7 -0
- package/dist/{chunk-OWX4O3IS.js → chunk-SREJWU57.js} +2 -2
- package/dist/chunk-ZZ7HCY2S.js +4 -0
- package/dist/{chunk-RZF36IGQ.js.map → chunk-ZZ7HCY2S.js.map} +2 -2
- package/dist/cli.js +96 -118
- package/dist/cli.js.map +4 -4
- package/dist/dev-server.js +2 -2
- package/dist/{dev-wizard-run-J5WSWCZT.js → dev-wizard-run-NQM3VPQA.js} +2 -2
- package/dist/mcp-proxy.js +1 -1
- package/dist/update-check.js +1 -1
- package/package.json +3 -3
- package/readme.md +32 -30
- package/dist/chunk-6UJQB36N.js +0 -2
- package/dist/chunk-6UJQB36N.js.map +0 -7
- package/dist/chunk-RZF36IGQ.js +0 -4
- /package/dist/{chunk-2H6VQIGT.js.map → chunk-ATGBWGER.js.map} +0 -0
- /package/dist/{chunk-R2SZWOPC.js.map → chunk-GBPW4ERM.js.map} +0 -0
- /package/dist/{chunk-F656FWV5.js.map → chunk-J6BHN362.js.map} +0 -0
- /package/dist/{chunk-AG7XWZNT.js.map → chunk-KPRFMZCX.js.map} +0 -0
- /package/dist/{chunk-OWX4O3IS.js.map → chunk-SREJWU57.js.map} +0 -0
- /package/dist/{dev-wizard-run-J5WSWCZT.js.map → dev-wizard-run-NQM3VPQA.js.map} +0 -0
package/dist/dev-server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as He,c as C,d as Be,h as je,j as We,n as I,o as H,p as Ge,q as B,r as Ve}from"./chunk-
|
|
1
|
+
import{a as He,c as C,d as Be,h as je,j as We,n as I,o as H,p as Ge,q as B,r as Ve}from"./chunk-SREJWU57.js";import{c as re,k as ne,o as Re,u as Ee}from"./chunk-KPRFMZCX.js";import"./chunk-AWFGP6GY.js";import{a as L,b as Ke}from"./chunk-VDBJ73LS.js";import{N as E,T as Te,_ as ie,ba as $,ca as F,da as $e,ea as Oe,fa as M,ga as Ce,ha as O,ia as Ie,ja as Le,ka as Ne,la as _e,ma as Ue,na as Fe,oa as Me,x as xe}from"./chunk-J6BHN362.js";import"./chunk-MFAFQVTW.js";import"./chunk-LAHHNH3T.js";import{c as ke,e as te,m as Ae}from"./chunk-ZZ7HCY2S.js";import{Command as Wn}from"commander";import P from"node:process";import{pathToFileURL as Gn}from"node:url";import se from"node:process";var oe=r=>{try{se.stderr.write(r)}catch{}},N=(r,e,t=!0)=>{let n=e instanceof Error?`${e.message}
|
|
2
2
|
${e.stack??"(no stack)"}`:String(e);return`
|
|
3
3
|
\u26A0\uFE0F ${r}: ${n}
|
|
4
4
|
${t?` dev-server kept alive (likely a bug in a handler's async path); restart if it misbehaves.
|
|
@@ -34,5 +34,5 @@ Received ${t}, closing Orca tab "${e}"...`),await Wt(r)}})},Gt=async r=>{let e=$
|
|
|
34
34
|
`);let l=n(()=>{e(),t(Se)},i);a.shutdown().finally(()=>{l(),t(Se)}).catch(()=>{})}},Yn=["SIGINT","SIGTERM"],Xn=({forceReap:r=I,exit:e=i=>{P.exit(i)},register:t=(i,s)=>{P.on(i,s)},unregister:n=(i,s)=>{P.off(i,s)}}={})=>{let i=new Map;for(let s of Yn){let o=()=>{qt(r,e,Ge(s))};i.set(s,o),t(s,o)}return{remove:()=>{for(let[s,o]of i)n(s,o)}}},Pe=async r=>{let e=Jn(r);if(e.orca){let l=await Gt(e);if(l==="ran")return;P.stdout.write(`Orca: ${l.fallback}; falling back to single-terminal dev
|
|
35
35
|
`)}let t=null,n=qn(),i=zn({getRunner:()=>t,setTimer:n}),s=ot({onDeath:(l,u)=>{i(`stdio unwritable: ${l} ${u.code}`)}}),o=Xn();try{t=await Bt({...e,onExitRequest:l=>{P.exit(l)}})}finally{o.remove()}let a=t;Je({onFault:(l,u)=>{a.reportFault(N(l,u))},isTerminalDead:s.isDead,fileFault:(l,u)=>{a.fileFault(N(l,u,!1))},onFatal:i}),B({onSignal:async l=>{le(`
|
|
36
36
|
Received ${l}, shutting down dev-server...
|
|
37
|
-
`),await a.shutdown()},describeStall:()=>a.shutdownStage,fileReport:l=>{a.fileFault(l)},setTimer:n})},Qn=(r,e,t)=>!r.preset&&!r.app&&!r.self&&!r.orca&&!r.watch&&!r.verbose&&!r.routes&&e&&!t,Zn=(r,e)=>({watch:r.watch,orca:r.orca,include:r.include??null,preset:r.preset,presetDef:r.presetDef,self:!1,verbose:!1,routes:!1,uiHealth:e.uiHealth??!0}),Ms=async(r,e,t)=>{if(Qn(r,e,t)){let{runDevWizard:n}=await import("./dev-wizard-run-
|
|
37
|
+
`),await a.shutdown()},describeStall:()=>a.shutdownStage,fileReport:l=>{a.fileFault(l)},setTimer:n})},Qn=(r,e,t)=>!r.preset&&!r.app&&!r.self&&!r.orca&&!r.watch&&!r.verbose&&!r.routes&&e&&!t,Zn=(r,e)=>({watch:r.watch,orca:r.orca,include:r.include??null,preset:r.preset,presetDef:r.presetDef,self:!1,verbose:!1,routes:!1,uiHealth:e.uiHealth??!0}),Ms=async(r,e,t)=>{if(Qn(r,e,t)){let{runDevWizard:n}=await import("./dev-wizard-run-NQM3VPQA.js"),i=Promise.all([import("./persistent-ink-dev-ui-P65EJCC6.js"),import("./safe-stderr-ECYA6DRR.js")]).catch(()=>{}),s;try{s=await n()}catch(o){if(Ve(o))return;throw o}if(s==null)return;await i,await Pe({...Zn(s,r),tty:e,json:t});return}await Pe({...Kt(r),tty:e,json:t})},ei=async r=>{let e=new Wn;e.name("infra-kit-dev-server").description("Run local dev servers for the apps in a named devServersPresets preset (or all apps)").argument("[preset]","Named preset from devServersPresets (omit to run every app)").option("-w, --watch","Rebuild and restart on file save").option("--app <names>","Further narrow to these app folder names (comma-separated)").option("--orca","Run each app in its own Orca pane (one tab, N panes; falls back to single terminal when Orca is not running)").option("--self","Run only the app of the current directory (infer from cwd; use inside apps/<app>/\u2026)").option("-V, --verbose","Print full boot narration (default: quiet; full detail always in the session log)").option("--routes","Print each app\u2019s registered METHOD /path routes at startup (default: off)"),e.parse(r),await Pe(Kt({...e.opts(),preset:e.args[0]}))};import.meta.url===Gn(P.argv[1]??"").href&&ei(P.argv).catch(r=>{console.error(r instanceof Error?r.message:String(r)),P.exit(1)});export{zn as createFatalHandler,qn as createSharedDeadlineTimer,Xn as installBootSignalGuard,Pe as runDevServer,Ms as runDevServerCli,Qn as shouldRunWizard,Kt as toDevServerOptions};
|
|
38
38
|
//# sourceMappingURL=dev-server.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as x,g as f,j as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=dev-wizard-run-
|
|
1
|
+
import{c as x,g as f,j as g}from"./chunk-ATGBWGER.js";import{N as u,_ as y,ba as k,ca as v,ea as w,oa as C}from"./chunk-J6BHN362.js";import"./chunk-MFAFQVTW.js";import"./chunk-LAHHNH3T.js";import{e as b}from"./chunk-ZZ7HCY2S.js";import"./chunk-QWVLAZ6N.js";import B from"@inquirer/checkbox";import _ from"@inquirer/confirm";import j,{Separator as I}from"@inquirer/select";import{loadDev as K}from"@slip-stream-kit/config/internal";import q from"node:path";import m from"node:process";var W=e=>e.split("/")[0],A=e=>new Map(e.apps.map(r=>[r.name,r])),D=e=>e.localCapable&&e.cloudCapable,N=(e,r,a)=>D(r)?a[`${e} ${r.path}`]??(r.cloudCapable?"cloud":"local"):r.localCapable?"local":"cloud",$=(e,r,a)=>{let t=new Set,o=new Map;for(let n of e){let s=r.get(W(n));for(let c of s?.backends??[]){o.set(c.packageName,c.ownerApp);for(let l of c.routes)N(n,l,a)==="local"&&t.add(c.packageName)}}return{localPkgs:t,ownerByPkg:o}},O=(e,r)=>{let a={},t=!1;for(let o of e?.backends??[]){let n=r.has(o.packageName);for(let s of o.routes){let c=s.localCapable&&n?"local":"cloud";a[s.path]=c,c==="cloud"&&(t=!0)}}return{overrides:a,anyCloud:t}},z=(e,r)=>{let a=A(r),t=e.targets.filter(p=>p.endsWith("/ui")),o=e.targets.filter(p=>p.endsWith("/api")),{localPkgs:n,ownerByPkg:s}=$(t,a,e.sources),c={},l=!1;for(let p of t){let{overrides:d,anyCloud:i}=O(a.get(W(p)),n);i&&(l=!0),c[p]=Object.keys(d).length>0?{proxy:d}:{}}for(let p of o)c[p]??={};for(let p of n){let d=s.get(p);d!=null&&(c[`${d}/api`]??={})}return{presetDef:{apps:c,orca:e.orca},anyCloudRoute:l,targetKeys:Object.keys(c).sort()}},R=(e,r)=>{let a=[`--target=${e.targetKeys.join(",")}`];return r.watch&&a.push("--watch"),r.orca&&a.push("--orca"),{flags:a.join(" ")}};var h={output:m.stderr,clearPromptOnDone:!0},E={select:e=>g(r=>j({message:e.message,choices:e.choices,default:e.default},r),{...h,whenHeadless:"refuse"}),checkbox:e=>g(r=>B({message:e.message,choices:e.choices},r),{...h,whenHeadless:"refuse"}),confirm:e=>g(r=>_({message:e.message,default:e.default},r),{...h,whenHeadless:"refuse"})},T=(e,r)=>{let a=new Map;for(let[t,o]of Object.entries(e)){let n={path:t,localCapable:o.from.includes("local"),cloudCapable:o.from.includes("cloud"),default:o.default},s=a.get(o.packageName);s?(s.routes.push(n),s.localCapable=s.localCapable||n.localCapable,s.cloudCapable=s.cloudCapable||n.cloudCapable):a.set(o.packageName,{packageName:o.packageName,routes:[n],localCapable:n.localCapable,cloudCapable:n.cloudCapable,ownerApp:r.get(o.packageName)})}return[...a.values()]},U=async(e,r,a)=>{try{let t=(await K(e))?.proxy?.routes;return t?T(t,a):[]}catch(t){return u.warn(`\u26A0\uFE0F Skipping ${r}: its dev config failed to load \u2014 ${t instanceof Error?t.message:String(t)}`),[]}},H=async e=>{let r=v(e),a=w(e),t=await y(),o=new Map(r.map(i=>[i.packageName,i.name])),n=new Map(r.map(i=>[i.name,i.packageName])),s=new Set(a.map(i=>i.name)),c=new Set(r.map(i=>i.name)),l=[...new Set([...c,...s])].sort(),p=await Promise.all(l.map(async i=>{let P=s.has(i);return{name:i,hasApi:c.has(i),hasUi:P,apiPackage:n.get(i),backends:P?await U(q.join(e,"apps",i,"ui"),i,o):[]}})),d=await x();return{apps:p,presets:Object.keys(t.devServersPresets??{}),environments:Object.keys(d?.envs??{}).sort()}},V=e=>{let r=[];for(let a of e.apps){if(a.hasUi){let t=a.backends.flatMap(n=>n.routes.map(s=>s.path)),o=t.length>0?`frontend \u2014 proxies ${[...t].sort().join(", ")}`:"frontend";r.push({name:`${a.name}/ui`,value:`${a.name}/ui`,description:o})}a.hasApi&&!a.hasUi&&r.push({name:`${a.name}/api`,value:`${a.name}/api`,description:"backend"})}return r},F=e=>{let r={api:e.apps.filter(o=>o.hasApi).map(o=>o.name),ui:e.apps.filter(o=>o.hasUi).map(o=>o.name)},a={},t=new Map;for(let o of e.apps){o.apiPackage!=null&&(a[o.name]=o.apiPackage);for(let n of o.backends)for(let s of n.routes)t.set(`${o.name} ${s.path}`,n.packageName)}return{discovered:r,apiPkgByApp:a,routePkg:(o,n)=>t.get(`${o} ${n}`)}},L=(e,r)=>C({__wizard__:e},F(r)).map(a=>a.message),Z="INFRA_KIT_DEV_WIZARD_ORCA",G=()=>m.env[Z]==="1",J=async(e,r,a)=>{let t=new Map(r.apps.map(n=>[n.name,n])),o={};for(let n of a){let s=t.get(n.split("/")[0]);for(let c of s?.backends??[])for(let l of c.routes){if(!l.localCapable||!l.cloudCapable)continue;let p=await e.select({message:`\u{1F500} ${n} ${l.path} \u2192 local or cloud?`,choices:[{name:"local (this machine)",value:"local"},{name:"cloud",value:"cloud"}],default:l.default??"local"});o[`${n} ${l.path}`]=p}}return o},Q=(e,r,a)=>e.apps.find(t=>t.name===r)?.backends.flatMap(t=>t.routes).find(t=>t.path===a),X=(e,r)=>{let a=[];for(let[t,o]of Object.entries(e.presetDef.apps??{})){if(!t.endsWith("/ui")||!o.proxy)continue;let n=t.split("/")[0];for(let[s,c]of Object.entries(o.proxy)){let l=Q(r,n,s),p=l&&l.localCapable&&l.cloudCapable?"":" (only option)";a.push(` ${t} ${s} \u2192 ${c}${p}`)}}if(a.length!==0){u.info("Resolved routes:");for(let t of[...a].sort())u.info(t)}},M=async(e,r)=>{if(r.apps.length===0)return u.warn("No apps discovered to run."),null;let a=await e.checkbox({message:"\u{1F4E6} Which packages?",choices:V(r)});if(a.length===0)return u.warn("No packages selected."),null;let t=a.filter(i=>i.endsWith("/ui")),o=await J(e,r,t),n=await e.confirm({message:"\u{1F440} Rebuild & restart on save (watch)?",default:!1}),s=G()?await e.confirm({message:"\u{1F9E9} Run each app in its own Orca pane?",default:!1}):!1,c={targets:a,sources:o,watch:n,orca:s},l=z(c,r);if(l.anyCloudRoute){if(r.environments.length===0)return u.warn("\u2601\uFE0F This selection routes to a cloud environment, but no environment token is loaded."),u.warn(" Run `infra-kit env-load` to add one, then re-run the wizard."),null;c.env=await e.select({message:"\u2601\uFE0F Point cloud routes at which environment?",choices:r.environments.map(i=>({name:i,value:i}))}),m.env[b]=c.env}let p=L(l.presetDef,r);if(p.length>0){u.warn("\u26A0\uFE0F Proxy audit found issues with this selection:");for(let i of p)u.warn(` \u2022 ${i}`);return null}X(l,r),Y(l,c);let d=l.targetKeys.filter(i=>i.endsWith("/api")).map(i=>i.split("/")[0]);return s&&d.length>0?{include:d,presetDef:l.presetDef,watch:n,orca:!0}:(s&&u.info("\u2139\uFE0F Orca needs at least one local backend (panes are backend-only) \u2014 running in-process instead."),{presetDef:l.presetDef,watch:n,orca:!1})},Y=(e,r)=>{f.setInteractive();let a=R(e,r);f.addOption(a.flags,!0),f.print(),u.info("\u2139\uFE0F Prefer a short name? Save this selection as a devPreset and run `infra-kit dev <name>`.")},ee=async(e,r)=>{let a=await e.confirm({message:"\u{1F440} Rebuild & restart on save (watch)?",default:!1});return f.setInteractive(),f.addOption(r,!0),a&&f.addOption("--watch",!0),f.print(),{preset:r,watch:a,orca:!1}},S=" manual",re=async(e,r)=>{if(r.presets.length===0)return M(e,r);let a=await e.select({message:"\u{1F680} Start from a preset, or configure manually?",choices:[...r.presets.map(t=>({name:t,value:t})),new I(" "),{name:"Manual (custom)\u2026",value:S}]});return a===S?M(e,r):ee(e,a)},be=async(e=E,r=k(m.cwd()))=>re(e,await H(r));export{S as MANUAL_CHOICE,Z as WIZARD_ORCA_VAR,L as auditManualPlan,E as defaultPrompts,H as gatherWizardModel,U as loadBackends,be as runDevWizard,re as runWizardFlow};
|
|
2
|
+
//# sourceMappingURL=dev-wizard-run-NQM3VPQA.js.map
|
package/dist/mcp-proxy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{x as G}from"./chunk-
|
|
2
|
+
import{x as G}from"./chunk-KPRFMZCX.js";import"./chunk-AWFGP6GY.js";import{a as M}from"./chunk-MFAFQVTW.js";import{a as W,c as H,k as T,m as E,o as K}from"./chunk-ZZ7HCY2S.js";import p from"node:process";var ve=/^[a-z][a-z0-9-]*$/,ye=/^[A-Z_]\w*$/i,Pe=(e,r,n)=>r==="--name"?e.name!==null?"--name given twice":ve.test(n)?(e.name=n,null):`--name "${n}" must be lowercase letters, digits and hyphens`:r==="--env"||r==="--unset"?ye.test(n)?M.has(n)?`${r} "${n}" is process plumbing, not a credential`:(r==="--env"?e.env.push(n):e.unset.push(n),null):`${r} "${n}" is not an environment-variable name`:`unknown flag ${r}`,Se=(e,r)=>{let n=0;for(;n<e.length;){let o=e[n];if(o==="--")return{separator:n};if(!o.startsWith("--"))return{problem:`missing "--" before the upstream command (saw "${o}")`};let a=e[n+1];if(a===void 0||a.startsWith("--"))return{problem:`${o} needs a value`};let m=Pe(r,o,a);if(m!==null)return{problem:m};n+=2}return{problem:'missing "--" before the upstream command'}},Q=e=>{let r={name:null,env:[],unset:[]},n=Se(e,r);if("problem"in n)return{ok:!1,problem:n.problem};if(r.name===null)return{ok:!1,problem:"missing --name"};if(r.env.length===0)return{ok:!1,problem:"missing --env (at least one variable to read)"};let o=e[n.separator+1];return o===void 0||o.length===0?{ok:!1,problem:'missing upstream command after "--"'}:{ok:!0,spec:{name:r.name,command:o,args:e.slice(n.separator+2),env:r.env,unset:r.unset}}};import{spawnSync as xe}from"node:child_process";import C from"node:fs";import x from"node:path";import O from"node:process";var Y=e=>x.join(E(),"mcp-proxy",e),be=e=>e.replaceAll(/[^\w.-]/g,"_").slice(0,64),Z=(e,r)=>x.join(r,`profile-${be(e)}.json`),A=(e,r)=>{let n=x.isAbsolute(e)?[e]:(r??O.env.PATH??"").split(x.delimiter).map(o=>x.join(o,e));for(let o of n)try{let a=C.statSync(o);return`stat-${a.size}-${Math.trunc(a.mtimeMs)}`}catch{}return"unknown"},X=(e,r=["--version"],n)=>{try{let o=xe(e,[...r],{encoding:"utf8",timeout:5e3,env:n==null?O.env:{...O.env,PATH:n}});if(o.status!==0)return A(e,n);let a=`${o.stdout}`.trim().split(`
|
|
3
3
|
`)[0]?.trim()??"";return a.length>0?a:A(e,n)}catch{return A(e,n)}},ee=(e,r)=>{try{let n=JSON.parse(C.readFileSync(Z(e,r),"utf8"));return n.version!==e||!Array.isArray(n.tools)?null:{version:e,protocolVersion:typeof n.protocolVersion=="string"?n.protocolVersion:"",capabilities:n.capabilities??{},tools:n.tools}}catch{return null}},ne=(e,r)=>{try{return C.mkdirSync(r,{recursive:!0}),K(Z(e.version,r),`${JSON.stringify(e)}
|
|
4
4
|
`,384),!0}catch{return!1}};import we from"node:path";import L from"node:process";var Ee="no-session",Me="IK_MCP_ENV_FILE",Re=()=>{let e=L.env[H];return e!=null&&e.length>0?e:Ee},R=()=>{let e=L.env[Me];return e!=null&&e.length>0?e:we.join(E(),Re(),W)},$e=(e,r)=>{let n=e[r];if(n!=null&&n.length>0)return n;let o=L.env[r];return o!=null&&o.length>0?o:""},re=(e,r=R())=>{let n=T(r),o={};for(let a of e){let m=$e(n,a);if(m.length===0)return null;o[a]=m}return o},te=(e,r=R())=>{let n=new Set(e);return Object.keys(T(r)).filter(o=>!n.has(o))};var $=(e,r)=>{let n="";e.setEncoding("utf8"),e.on("data",o=>{n+=o;let a=n.indexOf(`
|
|
5
5
|
`);for(;a!==-1;){let m=n.slice(0,a);n=n.slice(a+1);let f=m.endsWith("\r")?m.slice(0,-1):m;f.trim().length>0&&r(f),a=n.indexOf(`
|
package/dist/update-check.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as i}from"./chunk-
|
|
1
|
+
import{p as i}from"./chunk-GBPW4ERM.js";import"./chunk-AWFGP6GY.js";import{a as t}from"./chunk-LAHHNH3T.js";import"./chunk-ZZ7HCY2S.js";import a from"node:fs";import o from"node:process";import{fileURLToPath as s}from"node:url";var m=r=>{let n=r.indexOf("--parent-pid");if(n===-1)return;let e=Number(r[n+1]);return Number.isInteger(e)&&e>0?e:void 0},p=()=>a.realpathSync(s(new URL("./cli.js",import.meta.url))),d=async()=>{await i(t.version,{selfRealPath:p(),parentPid:m(o.argv)})};d().catch(()=>{o.exitCode=0});
|
|
2
2
|
//# sourceMappingURL=update-check.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "infra-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.10",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@inquirer/input": "^5.1.6",
|
|
22
22
|
"@inquirer/password": "^5.2.2",
|
|
23
23
|
"@inquirer/select": "^5.2.5",
|
|
24
|
-
"@slip-stream-kit/config": "^0.11.
|
|
24
|
+
"@slip-stream-kit/config": "^0.11.10",
|
|
25
25
|
"chalk": "^6.0.0",
|
|
26
26
|
"chokidar": "^5.0.0",
|
|
27
27
|
"commander": "^15.0.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"zx": "^8.8.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@slip-stream-kit/eslint-plugin": "0.11.
|
|
39
|
+
"@slip-stream-kit/eslint-plugin": "0.11.10",
|
|
40
40
|
"@types/aws-lambda": "^8.10.163",
|
|
41
41
|
"@types/react": "19.3.0",
|
|
42
42
|
"@wl/eslint-config": "0.1.0",
|
package/readme.md
CHANGED
|
@@ -48,38 +48,40 @@ Defines dev server ports, environment providers (e.g., Doppler), and preset prox
|
|
|
48
48
|
**infra-kit.config.ts** (audit)
|
|
49
49
|
Strict schema file that declares audit rules (`requiredScripts`, `requiredFiles`) and an optional `type` override (`frontend` | `backend` | `lib` | `e2e` | `mobile`) used by the `agent-guidance` check. Validated by `infra-kit audit`. No runtime behavior.
|
|
50
50
|
|
|
51
|
+
An `e2e` package (declared, or inferred from `apps/<app>/tests` / a `@playwright/test` dependency) is additionally held to the shared Playwright convention, which no config key can switch off: the `e2e-test*` / `playwright-install` scripts must carry their canonical values (`e2e-script:*` checks), and `playwright.config.ts` must read `E2E_SLOW_MO`, pass it to `launchOptions.slowMo`, add it to `timeout`, and keep traces on local failures (`e2e-config:*` checks). Each failure prints the expected line.
|
|
52
|
+
|
|
51
53
|
## Commands
|
|
52
54
|
|
|
53
|
-
| Group | Command | Purpose
|
|
54
|
-
| ----------------- | ----------------------------------------------------------------------- |
|
|
55
|
-
| **Develop** | `dev` | Start local dev server with portless proxy (interactive wizard, long-running)
|
|
56
|
-
| | `dev-status` | Report what `infra-kit dev` currently has running (read-only; finds the fragment dir by searching upward, so it works from any subdirectory)
|
|
57
|
-
| **Release** | `release merge-dev` | Merge `origin/dev` into open regular release branches in a scratch worktree, then push atomically (`--dry-run`, `--versions`). Hotfixes (PRs to `main`), title/base mismatches and heads with PRs to both bases are listed as `skipped` with a reason
|
|
58
|
-
| | `release list` | List available releases
|
|
59
|
-
| | `release create` | Create a new release; `-r <token>[@yyyy-mm-dd][:type[:description]]` — the `@date` is the Jira fix version’s planned release date
|
|
60
|
-
| | `release edit` | Edit a release’s Jira description and/or planned release date (`--description`, `--release-date`)
|
|
61
|
-
| | `release deploy-all --from <ci\|local>` | Deploy every service — in CI, or from this machine
|
|
62
|
-
| | `release deploy-selected --from <ci\|local>` | Deploy chosen services — in CI, or from this machine
|
|
63
|
-
| | `release deliver` | Deliver to prod (CLI-only, irreversible)
|
|
64
|
-
| | `release remove` | Tear down one release — worktree, IDE folders, PR, local and remote branches, then the Jira fix version last. Refuses a merged PR, a released fix version, or one with issues attached (`--move-issues-to` is the opt-in). Resumable: a partially-removed release re-runs cleanly. Over MCP the Jira step is never attempted (`jira: 'manual'`)
|
|
65
|
-
| **Worktrees** | `worktrees add` | Create a new git worktree
|
|
66
|
-
| | `worktrees list` | List all worktrees
|
|
67
|
-
| | `worktrees remove` | Remove a worktree (no `--force`; a branch git refuses is reported and the command exits non-zero; a leftover git already unregistered that holds only `.omc/state`, `.omc/sessions` or `.DS_Store` is swept automatically)
|
|
68
|
-
| | `worktrees sync` | Sync worktree state (same removal and failure reporting as `worktrees remove`)
|
|
69
|
-
| **Environment** | `env-status` | Show Doppler env status
|
|
70
|
-
| | `env-list` | List secrets in current env
|
|
71
|
-
| | `env-load` | Load env secrets into shell
|
|
72
|
-
| | `env-clear` | Clear loaded secrets
|
|
73
|
-
| | `env-token-list` | List redacted service tokens
|
|
74
|
-
| **Configuration** | `config-get` | Print the fully merged infra-kit config (read-only)
|
|
75
|
-
| | `config path` | Print config file locations
|
|
76
|
-
| | `config edit` | Edit infra-kit.json in `$EDITOR`
|
|
77
|
-
| **Vendor** | `vendor check` | Validate vendor mirrors
|
|
78
|
-
| | `vendor config` | Show vendor manifest
|
|
79
|
-
| **Setup** | `infra-kit setup [--tools <ids...>] [--update [ids...]] [--skip-tools]` | Set up infra-kit on this machine: shell integration, the Claude Code plugin, the `.mcp.json` key, then install or update the external CLIs (brew, aws, gh, doppler, portless). `--tools` / `--update` narrow the converge; `--skip-tools` writes only, reporting what is missing without installing it. Written binary-qualified here because `pnpm setup` and `pnpm run setup` both exist in every consumer and both mutate |
|
|
80
|
-
| | `audit [--fix] [--design]` | Check repo against config rules, including the per-package `agent-guidance` `CLAUDE.md` check; `--fix` writes guidance blocks (CLI-only, not in MCP), `--design` also scaffolds `DESIGN.md`
|
|
81
|
-
| | `doctor [--fix]` | Diagnose this machine: infra-kit install, tool auth, and repo wiring; `--fix` repairs what it safely can (CLI-only — the MCP tool is read-only)
|
|
82
|
-
| | `version` | Show installed version
|
|
55
|
+
| Group | Command | Purpose |
|
|
56
|
+
| ----------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
57
|
+
| **Develop** | `dev` | Start local dev server with portless proxy (interactive wizard, long-running) |
|
|
58
|
+
| | `dev-status` | Report what `infra-kit dev` currently has running (read-only; finds the fragment dir by searching upward, so it works from any subdirectory) |
|
|
59
|
+
| **Release** | `release merge-dev` | Merge `origin/dev` into open regular release branches in a scratch worktree, then push atomically (`--dry-run`, `--versions`). Hotfixes (PRs to `main`), title/base mismatches and heads with PRs to both bases are listed as `skipped` with a reason |
|
|
60
|
+
| | `release list` | List available releases |
|
|
61
|
+
| | `release create` | Create a new release; `-r <token>[@yyyy-mm-dd][:type[:description]]` — the `@date` is the Jira fix version’s planned release date |
|
|
62
|
+
| | `release edit` | Edit a release’s Jira description and/or planned release date (`--description`, `--release-date`) |
|
|
63
|
+
| | `release deploy-all --from <ci\|local>` | Deploy every service — in CI, or from this machine |
|
|
64
|
+
| | `release deploy-selected --from <ci\|local>` | Deploy chosen services — in CI, or from this machine |
|
|
65
|
+
| | `release deliver` | Deliver to prod (CLI-only, irreversible) |
|
|
66
|
+
| | `release remove` | Tear down one release — worktree, IDE folders, PR, local and remote branches, then the Jira fix version last. Refuses a merged PR, a released fix version, or one with issues attached (`--move-issues-to` is the opt-in). Resumable: a partially-removed release re-runs cleanly. Over MCP the Jira step is never attempted (`jira: 'manual'`) |
|
|
67
|
+
| **Worktrees** | `worktrees add` | Create a new git worktree |
|
|
68
|
+
| | `worktrees list` | List all worktrees |
|
|
69
|
+
| | `worktrees remove` | Remove a worktree (no `--force`; a branch git refuses is reported and the command exits non-zero; a leftover git already unregistered that holds only `.omc/state`, `.omc/sessions` or `.DS_Store` is swept automatically) |
|
|
70
|
+
| | `worktrees sync` | Sync worktree state (same removal and failure reporting as `worktrees remove`) |
|
|
71
|
+
| **Environment** | `env-status` | Show Doppler env status |
|
|
72
|
+
| | `env-list` | List secrets in current env |
|
|
73
|
+
| | `env-load` | Load env secrets into shell |
|
|
74
|
+
| | `env-clear` | Clear loaded secrets |
|
|
75
|
+
| | `env-token-list` | List redacted service tokens |
|
|
76
|
+
| **Configuration** | `config-get` | Print the fully merged infra-kit config (read-only) |
|
|
77
|
+
| | `config path` | Print config file locations |
|
|
78
|
+
| | `config edit` | Edit infra-kit.json in `$EDITOR` |
|
|
79
|
+
| **Vendor** | `vendor check` | Validate vendor mirrors |
|
|
80
|
+
| | `vendor config` | Show vendor manifest |
|
|
81
|
+
| **Setup** | `infra-kit setup [--tools <ids...>] [--update [ids...]] [--skip-tools]` | Set up infra-kit on this machine: shell integration, the Claude Code plugin, the `.mcp.json` key, then install or update the external CLIs (brew, git, aws, gh, doppler, portless). `--tools` / `--update` narrow the converge; `--skip-tools` writes only, reporting what is missing without installing it. Written binary-qualified here because `pnpm setup` and `pnpm run setup` both exist in every consumer and both mutate |
|
|
82
|
+
| | `audit [--fix] [--design]` | Check repo against config rules, including the per-package `agent-guidance` `CLAUDE.md` check; `--fix` writes guidance blocks (CLI-only, not in MCP), `--design` also scaffolds `DESIGN.md` |
|
|
83
|
+
| | `doctor [--fix]` | Diagnose this machine: infra-kit install, tool auth, and repo wiring; `--fix` repairs what it safely can (CLI-only — the MCP tool is read-only) |
|
|
84
|
+
| | `version` | Show installed version |
|
|
83
85
|
|
|
84
86
|
## Agent guidance blocks (CLAUDE.md)
|
|
85
87
|
|
package/dist/chunk-6UJQB36N.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var i={name:"infra-kit",type:"module",version:"0.11.0",files:["dist"],description:"infra-kit",bin:{"infra-kit":"dist/cli.js",ik:"dist/cli.js","ik-mcp":"dist/mcp-proxy.js"},engines:{node:">=24.x"},scripts:{build:"pnpm run clean-artifacts && node ./scripts/build.js",prepack:"pnpm run build","infra-kit-check":"pnpm exec infra-kit audit","clean-artifacts":"rm -rf dist","clean-cache":"rm -rf node_modules/.cache .eslintcache tsconfig.tsbuildinfo .turbo .swc","prettier-fix":"pnpm exec prettier **/* --write --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore","prettier-check":"pnpm exec prettier **/* --check --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore","eslint-check":"pnpm exec eslint --cache --report-unused-disable-directives ./src","eslint-fix":"pnpm exec eslint --cache --quiet --report-unused-disable-directives ./src --fix","ts-check":"tsc --noEmit",test:"pnpm exec vitest run --reporter=minimal","test-watch":"pnpm exec vitest --watch --silent passed-only","test-ui":"pnpm exec vitest --ui --silent passed-only","test-report":"pnpm exec vitest run --coverage --silent passed-only","qa:pty":"INFRA_KIT_REQUIRE_PTY=1 pnpm exec vitest run --reporter=minimal src/tui/__tests__/stdin-pause-pty.test.ts src/entry/__tests__/quit-keys-pty.test.ts src/entry/__tests__/post-run-pause-pty.test.ts",qa:"pnpm run prettier-check && pnpm run eslint-check && pnpm run ts-check && pnpm run test && echo \u2705 Success",fix:"pnpm run prettier-fix && pnpm run eslint-fix && pnpm run qa"},dependencies:{"@aws-lambda-powertools/logger":"^2.35.0","@inquirer/checkbox":"^5.2.5","@inquirer/confirm":"^6.3.2","@inquirer/input":"^5.1.6","@inquirer/password":"^5.2.2","@inquirer/select":"^5.2.5","@slip-stream-kit/config":"^0.11.0",chalk:"^6.0.0",chokidar:"^5.0.0",commander:"^15.0.0",fastify:"^5.12.4",ink:"^7.1.1",pino:"^10.3.1","pino-pretty":"^13.1.3",portless:"^0.15.6",react:"19.3.0",yaml:"^2.9.1",zod:"^4.6.2",zx:"^8.8.5"},devDependencies:{"@slip-stream-kit/eslint-plugin":"workspace:*","@types/aws-lambda":"catalog:","@types/react":"catalog:","@wl/eslint-config":"workspace:*","@wl/vitest-config":"workspace:*",esbuild:"^0.28.2","ink-testing-library":"^4.0.0",typescript:"^6.0.3"}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-6UJQB36N.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../package.json"],
|
|
4
|
-
"sourcesContent": ["{\n \"name\": \"infra-kit\",\n \"type\": \"module\",\n \"version\": \"0.11.0\",\n \"files\": [\n \"dist\"\n ],\n \"description\": \"infra-kit\",\n \"bin\": {\n \"infra-kit\": \"dist/cli.js\",\n \"ik\": \"dist/cli.js\",\n \"ik-mcp\": \"dist/mcp-proxy.js\"\n },\n \"engines\": {\n \"node\": \">=24.x\"\n },\n \"scripts\": {\n \"build\": \"pnpm run clean-artifacts && node ./scripts/build.js\",\n \"prepack\": \"pnpm run build\",\n \"infra-kit-check\": \"pnpm exec infra-kit audit\",\n \"clean-artifacts\": \"rm -rf dist\",\n \"clean-cache\": \"rm -rf node_modules/.cache .eslintcache tsconfig.tsbuildinfo .turbo .swc\",\n \"prettier-fix\": \"pnpm exec prettier **/* --write --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore\",\n \"prettier-check\": \"pnpm exec prettier **/* --check --no-error-on-unmatched-pattern --log-level silent --ignore-path ../../../.prettierignore\",\n \"eslint-check\": \"pnpm exec eslint --cache --report-unused-disable-directives ./src\",\n \"eslint-fix\": \"pnpm exec eslint --cache --quiet --report-unused-disable-directives ./src --fix\",\n \"ts-check\": \"tsc --noEmit\",\n \"test\": \"pnpm exec vitest run --reporter=minimal\",\n \"test-watch\": \"pnpm exec vitest --watch --silent passed-only\",\n \"test-ui\": \"pnpm exec vitest --ui --silent passed-only\",\n \"test-report\": \"pnpm exec vitest run --coverage --silent passed-only\",\n \"qa:pty\": \"INFRA_KIT_REQUIRE_PTY=1 pnpm exec vitest run --reporter=minimal src/tui/__tests__/stdin-pause-pty.test.ts src/entry/__tests__/quit-keys-pty.test.ts src/entry/__tests__/post-run-pause-pty.test.ts\",\n \"qa\": \"pnpm run prettier-check && pnpm run eslint-check && pnpm run ts-check && pnpm run test && echo \u2705 Success\",\n \"fix\": \"pnpm run prettier-fix && pnpm run eslint-fix && pnpm run qa\"\n },\n \"dependencies\": {\n \"@aws-lambda-powertools/logger\": \"^2.35.0\",\n \"@inquirer/checkbox\": \"^5.2.5\",\n \"@inquirer/confirm\": \"^6.3.2\",\n \"@inquirer/input\": \"^5.1.6\",\n \"@inquirer/password\": \"^5.2.2\",\n \"@inquirer/select\": \"^5.2.5\",\n \"@slip-stream-kit/config\": \"^0.11.0\",\n \"chalk\": \"^6.0.0\",\n \"chokidar\": \"^5.0.0\",\n \"commander\": \"^15.0.0\",\n \"fastify\": \"^5.12.4\",\n \"ink\": \"^7.1.1\",\n \"pino\": \"^10.3.1\",\n \"pino-pretty\": \"^13.1.3\",\n \"portless\": \"^0.15.6\",\n \"react\": \"19.3.0\",\n \"yaml\": \"^2.9.1\",\n \"zod\": \"^4.6.2\",\n \"zx\": \"^8.8.5\"\n },\n \"devDependencies\": {\n \"@slip-stream-kit/eslint-plugin\": \"workspace:*\",\n \"@types/aws-lambda\": \"catalog:\",\n \"@types/react\": \"catalog:\",\n \"@wl/eslint-config\": \"workspace:*\",\n \"@wl/vitest-config\": \"workspace:*\",\n \"esbuild\": \"^0.28.2\",\n \"ink-testing-library\": \"^4.0.0\",\n \"typescript\": \"^6.0.3\"\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,IAAAA,EAAA,CACE,KAAQ,YACR,KAAQ,SACR,QAAW,SACX,MAAS,CACP,MACF,EACA,YAAe,YACf,IAAO,CACL,YAAa,cACb,GAAM,cACN,SAAU,mBACZ,EACA,QAAW,CACT,KAAQ,QACV,EACA,QAAW,CACT,MAAS,sDACT,QAAW,iBACX,kBAAmB,4BACnB,kBAAmB,cACnB,cAAe,2EACf,eAAgB,4HAChB,iBAAkB,4HAClB,eAAgB,oEAChB,aAAc,kFACd,WAAY,eACZ,KAAQ,0CACR,aAAc,gDACd,UAAW,6CACX,cAAe,uDACf,SAAU,qMACV,GAAM,gHACN,IAAO,6DACT,EACA,aAAgB,CACd,gCAAiC,UACjC,qBAAsB,SACtB,oBAAqB,SACrB,kBAAmB,SACnB,qBAAsB,SACtB,mBAAoB,SACpB,0BAA2B,UAC3B,MAAS,SACT,SAAY,SACZ,UAAa,UACb,QAAW,UACX,IAAO,SACP,KAAQ,UACR,cAAe,UACf,SAAY,UACZ,MAAS,SACT,KAAQ,SACR,IAAO,SACP,GAAM,QACR,EACA,gBAAmB,CACjB,iCAAkC,cAClC,oBAAqB,WACrB,eAAgB,WAChB,oBAAqB,cACrB,oBAAqB,cACrB,QAAW,UACX,sBAAuB,SACvB,WAAc,QAChB,CACF",
|
|
6
|
-
"names": ["package_default"]
|
|
7
|
-
}
|
package/dist/chunk-RZF36IGQ.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import R from"node:fs";import u from"node:os";import I from"node:path";import F from"node:process";var h="env-load.sh",O="env-clear.sh",A="INFRA_KIT_SESSION",S=".infra-kit",f="INFRA_KIT_ENV",x="INFRA_KIT_ENV_CONFIG",d="INFRA_KIT_ENV_PROJECT",v="INFRA_KIT_ENV_PROJECT_ROOT",C="INFRA_KIT_ENV_LOADED_AT",l=/^([A-Z_]\w*)=/i,K=/^unset ([A-Z_]\w*)$/i,c=(t,n)=>{let s=n;for(let e=0;e<t.length;e++){if(!s&&t[e]==="\\"){e++;continue}t[e]==="'"&&(s=!s)}return s},D=t=>{let n=t.startsWith("'")?t.slice(1):t;return(n.endsWith("'")?n.slice(0,-1):n).split("'\\''").join("'")},T=t=>{try{return R.readFileSync(t,"utf-8")}catch{return""}},V=(t,n,s)=>{let e=t.split(`
|
|
2
|
-
`).map(o=>o.endsWith("\r")?o.slice(0,-1):o),r=0,i=!1;for(;r<e.length;){let o=e[r];if(i){i=c(o,i),r+=1;continue}let N=l.exec(o);if(!N){let _=K.exec(o);_&&s?.(_[1]),i=c(o,!1),r+=1;continue}let p=N[1],E=o.slice(N[0].length);if(!E.startsWith("'")){n({name:p,value:E}),i=c(o,!1),r+=1;continue}let g=[E],a=c(E,!1);for(;a&&r+1<e.length;){r+=1;let _=e[r];g.push(_),a=c(_,!0)}n({name:p,value:D(g.join(`
|
|
3
|
-
`))}),i=a,r+=1}},L=t=>{let n=[];return V(T(t),({name:s})=>{n.push(s)}),n},y=t=>{let n={};return V(T(t),({name:s,value:e})=>{n[s]=e}),n};var m=()=>{let t=F.env.XDG_CACHE_HOME,n=t&&t.length>0?t:I.join(u.homedir(),".cache");return I.join(n,"infra-kit")},P=()=>{let t=F.env[A];if(!t)throw new Error(`${A} is not set. Run \`infra-kit setup --skip-tools\` then \`source ~/.zshrc\`.`);return I.join(m(),t)},w=(t,n,s)=>{let e=`${t}.tmp.${F.pid}`;R.writeFileSync(e,n,{mode:s});try{R.renameSync(e,t)}catch(r){throw R.rmSync(e,{force:!0}),r}},W="-worktrees";export{h as a,O as b,A as c,S as d,f as e,x as f,d as g,v as h,C as i,L as j,y as k,m as l,P as m,w as n,W as o};
|
|
4
|
-
//# sourceMappingURL=chunk-RZF36IGQ.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|