maxsimcli 3.10.2 → 3.10.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.
@@ -1,3 +1,10 @@
1
+ ## [3.10.2](https://github.com/maystudios/maxsimcli/compare/v3.10.1...v3.10.2) (2026-02-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **dashboard:** use \r for PTY and queue command if terminal not ready ([e140d2c](https://github.com/maystudios/maxsimcli/commit/e140d2c2321617083a1191aebeaf78d61f42d98c))
7
+
1
8
  ## [3.10.1](https://github.com/maystudios/maxsimcli/compare/v3.10.0...v3.10.1) (2026-02-28)
2
9
 
3
10
 
@@ -228,4 +228,4 @@ void main() {
228
228
  `}),i.push(t[n]);return e&&t.length>0&&i.push({type:"text",value:`
229
229
  `}),i}function jQ(t){let e=0,i=t.charCodeAt(e);for(;i===9||i===32;)e++,i=t.charCodeAt(e);return t.slice(e)}function IQ(t,e){const i=Eue(t,e),n=i.one(t,void 0),r=vue(i),s=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
230
230
  `},r),s}function Lue(t,e){return t&&"run"in t?async function(i,n){const r=IQ(i,{file:n,...e});await t.run(r,n)}:function(i,n){return IQ(i,{file:n,...t||e})}}function VQ(t){if(t)throw t}var h1,XQ;function Due(){if(XQ)return h1;XQ=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},s=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var d=t.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!p)return!1;var g;for(g in u);return typeof g>"u"||t.call(u,g)},o=function(u,d){i&&d.name==="__proto__"?i(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},l=function(u,d){if(d==="__proto__")if(t.call(u,d)){if(n)return n(u,d).value}else return;return u[d]};return h1=function c(){var u,d,p,g,O,_,b=arguments[0],x=1,w=arguments.length,k=!1;for(typeof b=="boolean"&&(k=b,b=arguments[1]||{},x=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});x<w;++x)if(u=arguments[x],u!=null)for(d in u)p=l(b,d),g=l(u,d),b!==g&&(k&&g&&(s(g)||(O=r(g)))?(O?(O=!1,_=p&&r(p)?p:[]):_=p&&s(p)?p:{},o(b,{name:d,newValue:c(k,_,g)})):typeof g<"u"&&o(b,{name:d,newValue:g}));return b},h1}var Bue=Due();const u1=WS(Bue);function ZS(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function $ue(){const t=[],e={run:i,use:n};return e;function i(...r){let s=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...r);function l(c,...u){const d=t[++s];let p=-1;if(c){o(c);return}for(;++p<r.length;)(u[p]===null||u[p]===void 0)&&(u[p]=r[p]);r=u,d?zue(d,l)(...u):o(null,...u)}}function n(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function zue(t,e){let i;return n;function n(...o){const l=t.length>o.length;let c;l&&o.push(r);try{c=t.apply(this,o)}catch(u){const d=u;if(l&&i)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(o,...l){i||(i=!0,e(o,...l))}function s(o){r(null,o)}}const ps={basename:Nue,dirname:jue,extname:Iue,join:Vue,sep:"/"};function Nue(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');kd(t);let i=0,n=-1,r=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(s){i=r+1;break}}else n<0&&(s=!0,n=r+1);return n<0?"":t.slice(i,n)}if(e===t)return"";let o=-1,l=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(s){i=r+1;break}}else o<0&&(s=!0,o=r+1),l>-1&&(t.codePointAt(r)===e.codePointAt(l--)?l<0&&(n=r):(l=-1,n=o));return i===n?n=o:n<0&&(n=t.length),t.slice(i,n)}function jue(t){if(kd(t),t.length===0)return".";let e=-1,i=t.length,n;for(;--i;)if(t.codePointAt(i)===47){if(n){e=i;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Iue(t){kd(t);let e=t.length,i=-1,n=0,r=-1,s=0,o;for(;e--;){const l=t.codePointAt(e);if(l===47){if(o){n=e+1;break}continue}i<0&&(o=!0,i=e+1),l===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||i<0||s===0||s===1&&r===i-1&&r===n+1?"":t.slice(r,i)}function Vue(...t){let e=-1,i;for(;++e<t.length;)kd(t[e]),t[e]&&(i=i===void 0?t[e]:i+"/"+t[e]);return i===void 0?".":Xue(i)}function Xue(t){kd(t);const e=t.codePointAt(0)===47;let i=Zue(t,!e);return i.length===0&&!e&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),e?"/"+i:i}function Zue(t,e){let i="",n=0,r=-1,s=0,o=-1,l,c;for(;++o<=t.length;){if(o<t.length)l=t.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(r===o-1||s===1))if(r!==o-1&&s===2){if(i.length<2||n!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=o,s=0;continue}}else if(i.length>0){i="",n=0,r=o,s=0;continue}}e&&(i=i.length>0?i+"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,o):i=t.slice(r+1,o),n=o-r-1;r=o,s=0}else l===46&&s>-1?s++:s=-1}return i}function kd(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const que={cwd:Wue};function Wue(){return"/"}function qS(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Uue(t){if(typeof t=="string")t=new URL(t);else if(!qS(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Yue(t)}function Yue(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let i=-1;for(;++i<e.length;)if(e.codePointAt(i)===37&&e.codePointAt(i+1)===50){const n=e.codePointAt(i+2);if(n===70||n===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const f1=["history","path","basename","stem","extname","dirname"];class xN{constructor(e){let i;e?qS(e)?i={path:e}:typeof e=="string"||Hue(e)?i={value:e}:i=e:i={},this.cwd="cwd"in i?"":que.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<f1.length;){const s=f1[n];s in i&&i[s]!==void 0&&i[s]!==null&&(this[s]=s==="history"?[...i[s]]:i[s])}let r;for(r in i)f1.includes(r)||(this[r]=i[r])}get basename(){return typeof this.path=="string"?ps.basename(this.path):void 0}set basename(e){p1(e,"basename"),d1(e,"basename"),this.path=ps.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?ps.dirname(this.path):void 0}set dirname(e){ZQ(this.basename,"dirname"),this.path=ps.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?ps.extname(this.path):void 0}set extname(e){if(d1(e,"extname"),ZQ(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ps.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){qS(e)&&(e=Uue(e)),p1(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?ps.basename(this.path,this.extname):void 0}set stem(e){p1(e,"stem"),d1(e,"stem"),this.path=ps.join(this.dirname||"",e+(this.extname||""))}fail(e,i,n){const r=this.message(e,i,n);throw r.fatal=!0,r}info(e,i,n){const r=this.message(e,i,n);return r.fatal=void 0,r}message(e,i,n){const r=new ln(e,i,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function d1(t,e){if(t&&t.includes(ps.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+ps.sep+"`")}function p1(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ZQ(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Hue(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Fue=(function(t){const n=this.constructor.prototype,r=n[t],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,n),s}),Gue={}.hasOwnProperty;class tC extends Fue{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$ue()}copy(){const e=new tC;let i=-1;for(;++i<this.attachers.length;){const n=this.attachers[i];e.use(...n)}return e.data(u1(!0,{},this.namespace)),e}data(e,i){return typeof e=="string"?arguments.length===2?(O1("data",this.frozen),this.namespace[e]=i,this):Gue.call(this.namespace,e)&&this.namespace[e]||void 0:e?(O1("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const r=i.call(e,...n);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const i=Lm(e),n=this.parser||this.Parser;return m1("parse",n),n(String(i),i)}process(e,i){const n=this;return this.freeze(),m1("process",this.parser||this.Parser),g1("process",this.compiler||this.Compiler),i?r(void 0,i):new Promise(r);function r(s,o){const l=Lm(e),c=n.parse(l);n.run(c,l,function(d,p,g){if(d||!p||!g)return u(d);const O=p,_=n.stringify(O,g);efe(_)?g.value=_:g.result=_,u(d,g)});function u(d,p){d||!p?o(d):s?s(p):i(void 0,p)}}}processSync(e){let i=!1,n;return this.freeze(),m1("processSync",this.parser||this.Parser),g1("processSync",this.compiler||this.Compiler),this.process(e,r),WQ("processSync","process",i),n;function r(s,o){i=!0,VQ(s),n=o}}run(e,i,n){qQ(e),this.freeze();const r=this.transformers;return!n&&typeof i=="function"&&(n=i,i=void 0),n?s(void 0,n):new Promise(s);function s(o,l){const c=Lm(i);r.run(e,c,u);function u(d,p,g){const O=p||e;d?l(d):o?o(O):n(void 0,O,g)}}}runSync(e,i){let n=!1,r;return this.run(e,i,s),WQ("runSync","run",n),r;function s(o,l){VQ(o),r=l,n=!0}}stringify(e,i){this.freeze();const n=Lm(i),r=this.compiler||this.Compiler;return g1("stringify",r),qQ(e),r(e,n)}use(e,...i){const n=this.attachers,r=this.namespace;if(O1("use",this.frozen),e!=null)if(typeof e=="function")c(e,i);else if(typeof e=="object")Array.isArray(e)?l(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...p]=u;c(d,p)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(r.settings=u1(!0,r.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const p=u[d];s(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let p=-1,g=-1;for(;++p<n.length;)if(n[p][0]===u){g=p;break}if(g===-1)n.push([u,...d]);else if(d.length>0){let[O,..._]=d;const b=n[g][1];ZS(b)&&ZS(O)&&(O=u1(!0,b,O)),n[g]=[u,O,..._]}}}}const Kue=new tC().freeze();function m1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function g1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function O1(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qQ(t){if(!ZS(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function WQ(t,e,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Lm(t){return Jue(t)?t:new xN(t)}function Jue(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function efe(t){return typeof t=="string"||tfe(t)}function tfe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ife="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UQ=[],YQ={allowDangerousHtml:!0},nfe=/^(https?|ircs?|mailto|xmpp)$/i,rfe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wN(t){const e=sfe(t),i=ofe(t);return afe(e.runSync(e.parse(i),i),t)}function sfe(t){const e=t.rehypePlugins||UQ,i=t.remarkPlugins||UQ,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...YQ}:YQ;return Kue().use(Nhe).use(i).use(Lue,n).use(e)}function ofe(t){const e=t.children||"",i=new xN;return typeof e=="string"&&(i.value=e),i}function afe(t,e){const i=e.allowedElements,n=e.allowElement,r=e.components,s=e.disallowedElements,o=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||lfe;for(const d of rfe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ife+d.id,void 0);return SN(t,u),vle(t,{Fragment:S.Fragment,components:r,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function u(d,p,g){if(d.type==="raw"&&g&&typeof p=="number")return o?g.children.splice(p,1):g.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let O;for(O in a1)if(Object.hasOwn(a1,O)&&Object.hasOwn(d.properties,O)){const _=d.properties[O],b=a1[O];(b===null||b.includes(d.tagName))&&(d.properties[O]=c(String(_||""),O,d))}}if(d.type==="element"){let O=i?!i.includes(d.tagName):s?s.includes(d.tagName):!1;if(!O&&n&&typeof p=="number"&&(O=!n(d,p,g)),O&&g&&typeof p=="number")return l&&d.children?g.children.splice(p,1,...d.children):g.children.splice(p,1),p}}}function lfe(t){const e=t.indexOf(":"),i=t.indexOf("?"),n=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||i!==-1&&e>i||n!==-1&&e>n||nfe.test(t.slice(0,e))?t:""}function cfe({option:t,selected:e,variant:i,onSelect:n,onFocus:r,onBlur:s}){var p;const[o,l]=Z.useState(!1),c=t.description.split(`
231
- `),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return S.jsxs("button",{type:"button",onClick:n,onMouseEnter:r,onMouseLeave:s,onFocus:r,onBlur:s,className:Fe("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[S.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&S.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&S.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),S.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&S.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function hfe({markdown:t,visible:e}){return e?S.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:S.jsx(wN,{children:t})}):null}function ufe({question:t,onSubmit:e}){const[i,n]=Z.useState(null),[r,s]=Z.useState(new Set),[o,l]=Z.useState(""),[c,u]=Z.useState(null),d=Z.useRef(null);Z.useEffect(()=>{const k=d.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[o]),Z.useEffect(()=>{n(null),s(new Set),l(""),u(null)},[t.id]);function p(k){t.multiSelect?s(T=>{const A=new Set(T);return A.has(k)?A.delete(k):A.add(k),A}):n(k)}function g(k){l(k),!t.multiSelect&&k.length>0&&n(null)}function O(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const k=t.options.filter(T=>r.has(T.id)).map(T=>T.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(r),selectedLabels:k,freeText:o.trim()})}else if(i){const k=t.options.find(T=>T.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:k?[k.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?r.size>0||o.trim().length>0:i!==null||o.trim().length>0,x=c?t.options.find(k=>k.id===c):null,w=(x==null?void 0:x.markdown)??"";return S.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[S.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),S.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:S.jsx(wN,{children:t.question})}),t.options.length>0&&S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(k=>{const T=t.multiSelect?r.has(k.id):i===k.id;return S.jsx(cfe,{option:k,selected:T,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(k.id),onFocus:()=>u(k.id),onBlur:()=>u(null)},k.id)})}),S.jsx(hfe,{markdown:w,visible:!!w})]}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:S.jsx("textarea",{ref:d,value:o,onChange:k=>g(k.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),S.jsx("button",{type:"button",onClick:_,disabled:!b,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function ffe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return S.jsx(vo.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),S.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),S.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function dfe(){return S.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[S.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),S.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("div",{className:"h-10 flex-1 bg-muted"}),S.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),S.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function pfe({onAskMore:t,onDoneExecute:e,disabled:i}){return S.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[S.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),S.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function mfe({open:t,onConfirm:e,onCancel:i}){return S.jsx(xx,{children:t&&S.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:S.jsxs(vo.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[S.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),S.jsxs("div",{className:"flex items-center justify-end gap-3",children:[S.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),S.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function gfe({answerCount:t}){return S.jsxs(vo.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[S.jsx("div",{className:"flex justify-center mb-3",children:S.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),S.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),S.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Ofe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:r,askMore:s,doneExecute:o,receiveQuestions:l}=oL(),{onQuestionReceivedRef:c}=Ea();Z.useEffect(()=>(c.current=x=>{l(x)},()=>{c.current=null}),[l,c]);const[u,d]=Z.useState(!1),p=Z.useRef(null);Z.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:S.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),S.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:S.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(x=>S.jsx(ffe,{answer:x},x.questionId)),t==="active"&&e&&S.jsx("div",{ref:p,children:S.jsx(ufe,{question:e,onSubmit:r})}),t==="loading"&&S.jsx(dfe,{}),t==="complete"&&S.jsx(gfe,{answerCount:n})]})}),t!=="complete"&&S.jsx(pfe,{onAskMore:s,onDoneExecute:g,disabled:b}),S.jsx(mfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Ea();return!t&&e===0?null:S.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&S.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&S.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function vfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=oL(),{pendingQuestionCount:r}=Ea(),s=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return s?S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),r>0&&S.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:r})]}),S.jsx("div",{className:"flex-1 min-h-0",children:S.jsx(Ofe,{})})]}):S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:S.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[S.jsx(jae,{}),S.jsx(Xae,{onExecute:o})]})})]})}function _fe(){return S.jsxs("div",{className:"flex flex-col gap-6",children:[S.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[S.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),S.jsxs("div",{className:"flex gap-10",children:[S.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),S.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),S.jsxs("div",{className:"ml-auto flex gap-8",children:[S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[S.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[S.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function yfe({message:t,onRetry:e}){return S.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[S.jsx("p",{className:"font-mono text-sm text-danger",children:t}),S.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function bfe(){const{roadmap:t,state:e,todos:i,loading:n,error:r}=Rl(),{mode:s,setMode:o,initialized:l}=r7(),[c,u]=Z.useState("overview"),[d,p]=Z.useState(null),[g,O]=Z.useState(!1),{splitMode:_,toggleSplit:b}=Bae(),x=Z.useRef(null),w=Z.useCallback(()=>{o(s==="simple"?"advanced":"simple")},[s,o]),k=l?S.jsx(zae,{mode:s,onToggle:w}):null,T=Z.useRef({view:"overview",phaseId:null}),A=Z.useCallback(($,D)=>{$!=="terminal"&&(T.current={view:$,phaseId:$==="phase"&&D?D:null}),u($),$==="phase"&&D&&p(D),O(!1)},[]),Q=Z.useRef(null),E=Z.useCallback($=>{x.current?x.current($+"\r"):Q.current=$,A("terminal")},[A]);useEffect(()=>{const $=setInterval(()=>{Q.current&&x.current&&(x.current(Q.current+"\r"),Q.current=null,clearInterval($))},100);return()=>clearInterval($)},[]);const z=Z.useCallback($=>{u("phase"),p($)},[]),N=Z.useCallback(()=>{u("overview"),p(null)},[]),q=Z.useCallback(async($,D)=>{try{const X=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:$,checked:D})});X.ok||console.error("[toggle-phase]",await X.text())}catch(X){console.error("[toggle-phase]",X)}},[]),J=((t==null?void 0:t.phases)??[]).map($=>({number:$.number,name:$.name,goal:$.goal??"",dependsOn:$.depends_on?[$.depends_on]:[],planCount:$.plan_count,summaryCount:$.summary_count,diskStatus:$.disk_status,roadmapComplete:$.roadmap_complete,hasContext:$.has_context,hasResearch:$.has_research})),U=(t==null?void 0:t.current_phase)??null;function R(){if(n)return S.jsx(_fe,{});if(r)return S.jsx(yfe,{message:r,onRetry:()=>window.location.reload()});switch(c){case"overview":return S.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[S.jsx(K9,{roadmap:t,state:e,todos:i}),S.jsx(iZ,{phases:J,currentPhase:U,onPhaseClick:z,onToggleComplete:q})]});case"phase":return d?S.jsx("div",{className:"mx-auto max-w-4xl",children:S.jsx(Ute,{phaseId:d,onBack:N})}):null;case"todos":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Yte,{})});case"blockers":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Gte,{})});case"terminal":return null;default:return null}}const B=c==="terminal",j=s==="simple";return S.jsxs(Kte,{mobileMenuOpen:g,onMobileMenuToggle:()=>O($=>!$),onMobileMenuClose:()=>O(!1),headerRight:k,simpleMode:j,sidebar:S.jsx("div",{style:{display:j?"none":"contents"},children:S.jsx(wie,{activeView:c,activePhaseId:d,onNavigate:A,logoAction:k})}),children:[l&&s===null&&S.jsx(Nae,{onChoose:o}),j&&l&&S.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:S.jsx(vfe,{onExecute:E})}),S.jsxs("div",{style:{display:j?"none":"contents"},children:[S.jsx("div",{style:{display:B&&!_?"none":"block"},className:B&&_?"h-1/2 min-h-0 overflow-auto border-b border-border p-4 sm:p-6":"flex-1 overflow-y-auto p-4 sm:p-6",children:R()}),S.jsxs("div",{style:{display:B?"flex":"none"},className:`relative min-h-0 flex-col overflow-hidden ${B&&_?"h-1/2":"flex-1"}`,children:[S.jsx($ae,{splitMode:_,onToggle:b}),S.jsx(Dae,{writeInputRef:x})]})]})]})}function Sfe(){return S.jsx(Kj,{children:S.jsx(t7,{children:S.jsx(n7,{children:S.jsx(bfe,{})})})})}const CN=document.getElementById("root");if(!CN)throw new Error("Root element not found");Hj.createRoot(CN).render(S.jsx(Z.StrictMode,{children:S.jsx(Sfe,{})}));
231
+ `),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return S.jsxs("button",{type:"button",onClick:n,onMouseEnter:r,onMouseLeave:s,onFocus:r,onBlur:s,className:Fe("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[S.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&S.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&S.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),S.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&S.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function hfe({markdown:t,visible:e}){return e?S.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:S.jsx(wN,{children:t})}):null}function ufe({question:t,onSubmit:e}){const[i,n]=Z.useState(null),[r,s]=Z.useState(new Set),[o,l]=Z.useState(""),[c,u]=Z.useState(null),d=Z.useRef(null);Z.useEffect(()=>{const k=d.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[o]),Z.useEffect(()=>{n(null),s(new Set),l(""),u(null)},[t.id]);function p(k){t.multiSelect?s(T=>{const A=new Set(T);return A.has(k)?A.delete(k):A.add(k),A}):n(k)}function g(k){l(k),!t.multiSelect&&k.length>0&&n(null)}function O(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const k=t.options.filter(T=>r.has(T.id)).map(T=>T.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(r),selectedLabels:k,freeText:o.trim()})}else if(i){const k=t.options.find(T=>T.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:k?[k.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?r.size>0||o.trim().length>0:i!==null||o.trim().length>0,x=c?t.options.find(k=>k.id===c):null,w=(x==null?void 0:x.markdown)??"";return S.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[S.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),S.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:S.jsx(wN,{children:t.question})}),t.options.length>0&&S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(k=>{const T=t.multiSelect?r.has(k.id):i===k.id;return S.jsx(cfe,{option:k,selected:T,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(k.id),onFocus:()=>u(k.id),onBlur:()=>u(null)},k.id)})}),S.jsx(hfe,{markdown:w,visible:!!w})]}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:S.jsx("textarea",{ref:d,value:o,onChange:k=>g(k.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),S.jsx("button",{type:"button",onClick:_,disabled:!b,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function ffe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return S.jsx(vo.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),S.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),S.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function dfe(){return S.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[S.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),S.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("div",{className:"h-10 flex-1 bg-muted"}),S.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),S.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function pfe({onAskMore:t,onDoneExecute:e,disabled:i}){return S.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[S.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),S.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function mfe({open:t,onConfirm:e,onCancel:i}){return S.jsx(xx,{children:t&&S.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:S.jsxs(vo.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[S.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),S.jsxs("div",{className:"flex items-center justify-end gap-3",children:[S.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),S.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function gfe({answerCount:t}){return S.jsxs(vo.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[S.jsx("div",{className:"flex justify-center mb-3",children:S.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),S.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),S.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Ofe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:r,askMore:s,doneExecute:o,receiveQuestions:l}=oL(),{onQuestionReceivedRef:c}=Ea();Z.useEffect(()=>(c.current=x=>{l(x)},()=>{c.current=null}),[l,c]);const[u,d]=Z.useState(!1),p=Z.useRef(null);Z.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:S.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),S.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:S.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(x=>S.jsx(ffe,{answer:x},x.questionId)),t==="active"&&e&&S.jsx("div",{ref:p,children:S.jsx(ufe,{question:e,onSubmit:r})}),t==="loading"&&S.jsx(dfe,{}),t==="complete"&&S.jsx(gfe,{answerCount:n})]})}),t!=="complete"&&S.jsx(pfe,{onAskMore:s,onDoneExecute:g,disabled:b}),S.jsx(mfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Ea();return!t&&e===0?null:S.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&S.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&S.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function vfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=oL(),{pendingQuestionCount:r}=Ea(),s=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return s?S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),r>0&&S.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:r})]}),S.jsx("div",{className:"flex-1 min-h-0",children:S.jsx(Ofe,{})})]}):S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:S.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[S.jsx(jae,{}),S.jsx(Xae,{onExecute:o})]})})]})}function _fe(){return S.jsxs("div",{className:"flex flex-col gap-6",children:[S.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[S.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),S.jsxs("div",{className:"flex gap-10",children:[S.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),S.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),S.jsxs("div",{className:"ml-auto flex gap-8",children:[S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[S.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[S.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function yfe({message:t,onRetry:e}){return S.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[S.jsx("p",{className:"font-mono text-sm text-danger",children:t}),S.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function bfe(){const{roadmap:t,state:e,todos:i,loading:n,error:r}=Rl(),{mode:s,setMode:o,initialized:l}=r7(),[c,u]=Z.useState("overview"),[d,p]=Z.useState(null),[g,O]=Z.useState(!1),{splitMode:_,toggleSplit:b}=Bae(),x=Z.useRef(null),w=Z.useCallback(()=>{o(s==="simple"?"advanced":"simple")},[s,o]),k=l?S.jsx(zae,{mode:s,onToggle:w}):null,T=Z.useRef({view:"overview",phaseId:null}),A=Z.useCallback(($,D)=>{$!=="terminal"&&(T.current={view:$,phaseId:$==="phase"&&D?D:null}),u($),$==="phase"&&D&&p(D),O(!1)},[]),Q=Z.useRef(null),E=Z.useCallback($=>{x.current?x.current($+"\r"):Q.current=$,A("terminal")},[A]);Z.useEffect(()=>{const $=setInterval(()=>{Q.current&&x.current&&(x.current(Q.current+"\r"),Q.current=null,clearInterval($))},100);return()=>clearInterval($)},[]);const z=Z.useCallback($=>{u("phase"),p($)},[]),N=Z.useCallback(()=>{u("overview"),p(null)},[]),q=Z.useCallback(async($,D)=>{try{const X=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:$,checked:D})});X.ok||console.error("[toggle-phase]",await X.text())}catch(X){console.error("[toggle-phase]",X)}},[]),J=((t==null?void 0:t.phases)??[]).map($=>({number:$.number,name:$.name,goal:$.goal??"",dependsOn:$.depends_on?[$.depends_on]:[],planCount:$.plan_count,summaryCount:$.summary_count,diskStatus:$.disk_status,roadmapComplete:$.roadmap_complete,hasContext:$.has_context,hasResearch:$.has_research})),U=(t==null?void 0:t.current_phase)??null;function R(){if(n)return S.jsx(_fe,{});if(r)return S.jsx(yfe,{message:r,onRetry:()=>window.location.reload()});switch(c){case"overview":return S.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[S.jsx(K9,{roadmap:t,state:e,todos:i}),S.jsx(iZ,{phases:J,currentPhase:U,onPhaseClick:z,onToggleComplete:q})]});case"phase":return d?S.jsx("div",{className:"mx-auto max-w-4xl",children:S.jsx(Ute,{phaseId:d,onBack:N})}):null;case"todos":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Yte,{})});case"blockers":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Gte,{})});case"terminal":return null;default:return null}}const B=c==="terminal",j=s==="simple";return S.jsxs(Kte,{mobileMenuOpen:g,onMobileMenuToggle:()=>O($=>!$),onMobileMenuClose:()=>O(!1),headerRight:k,simpleMode:j,sidebar:S.jsx("div",{style:{display:j?"none":"contents"},children:S.jsx(wie,{activeView:c,activePhaseId:d,onNavigate:A,logoAction:k})}),children:[l&&s===null&&S.jsx(Nae,{onChoose:o}),j&&l&&S.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:S.jsx(vfe,{onExecute:E})}),S.jsxs("div",{style:{display:j?"none":"contents"},children:[S.jsx("div",{style:{display:B&&!_?"none":"block"},className:B&&_?"h-1/2 min-h-0 overflow-auto border-b border-border p-4 sm:p-6":"flex-1 overflow-y-auto p-4 sm:p-6",children:R()}),S.jsxs("div",{style:{display:B?"flex":"none"},className:`relative min-h-0 flex-col overflow-hidden ${B&&_?"h-1/2":"flex-1"}`,children:[S.jsx($ae,{splitMode:_,onToggle:b}),S.jsx(Dae,{writeInputRef:x})]})]})]})}function Sfe(){return S.jsx(Kj,{children:S.jsx(t7,{children:S.jsx(n7,{children:S.jsx(bfe,{})})})})}const CN=document.getElementById("root");if(!CN)throw new Error("Root element not found");Hj.createRoot(CN).render(S.jsx(Z.StrictMode,{children:S.jsx(Sfe,{})}));
@@ -10,7 +10,7 @@
10
10
  href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800;900&family=Geist+Mono:wght@400;500;600;700&display=swap"
11
11
  rel="stylesheet"
12
12
  />
13
- <script type="module" crossorigin src="/assets/index-Cg9pB7ZW.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-CZ8WC97G.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/assets/index-DzJChB-D.css">
15
15
  </head>
16
16
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maxsimcli",
3
- "version": "3.10.2",
3
+ "version": "3.10.3",
4
4
  "private": false,
5
5
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code, OpenCode, Gemini and Codex by MayStudios.",
6
6
  "bin": {