panopticon-cli 0.4.26 → 0.4.27
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.
|
@@ -610,7 +610,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
610
610
|
`))+1))}const o="#".repeat(s),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
611
611
|
`,...i.current()});return/^[\t ]/.test(u)&&(u=oc(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}Z2.peek=E7;function Z2(e){return e.value||""}function E7(){return"<"}eN.peek=j7;function eN(e,t,n,r){const s=Cx(n),i=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),l()),u+=c.move(")"),o(),u}function j7(){return"!"}tN.peek=R7;function tN(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,i(),s==="full"||!u||u!==h?c+=l.move(h+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function R7(){return"!"}nN.peek=P7;function nN(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const o=n.unsafe[i],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return s+r+s}function P7(){return"`"}function rN(e,t){const n=ux(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}sN.peek=T7;function sN(e,t,n,r){const s=Cx(n),i=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(rN(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let h=o.move("<");return h+=o.move(n.containerPhrasing(e,{before:h,after:">",...o.current()})),h+=o.move(">"),l(),n.stack=d,h}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${i}`),u+=o.move(" "+s),u+=o.move(n.safe(e.title,{before:u,after:s,...o.current()})),u+=o.move(s),c()),u+=o.move(")"),l(),u}function T7(e,t,n){return rN(e,n)?"<":"["}iN.peek=D7;function iN(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,i(),s==="full"||!u||u!==h?c+=l.move(h+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function D7(){return"["}function Nx(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function M7(e){const t=Nx(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function A7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function oN(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function L7(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let o=e.ordered?A7(n):Nx(n);const l=e.ordered?o==="."?")":".":M7(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),oN(n)===o&&d){let h=-1;for(;++h<e.children.length;){const p=e.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=i,s(),u}function O7(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function I7(e,t,n,r){const s=O7(n);let i=n.bulletCurrent||Nx(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let o=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(o-i.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(h,p,f){return p?(f?"":" ".repeat(o))+h:(f?i:i+" ".repeat(o-i.length))+h}}function B7(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),o=n.containerPhrasing(e,r);return i(),s(),o}const F7=wd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function z7(e,t,n,r){return(e.children.some(function(o){return F7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function $7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}aN.peek=H7;function aN(e,t,n,r){const s=$7(n),i=n.enter("strong"),o=n.createTracker(r),l=o.move(s+s);let c=o.move(n.containerPhrasing(e,{after:s,before:l,...o.current()}));const u=c.charCodeAt(0),d=zh(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=oc(u)+c.slice(1));const h=c.charCodeAt(c.length-1),p=zh(r.after.charCodeAt(0),h,s);p.inside&&(c=c.slice(0,-1)+oc(h));const f=o.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},l+c+f}function H7(e,t,n){return n.options.strong||"*"}function W7(e,t,n,r){return n.safe(e.value,r)}function U7(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function q7(e,t,n){const r=(oN(n)+(n.options.ruleSpaces?" ":"")).repeat(U7(n));return n.options.ruleSpaces?r.slice(0,-1):r}const lN={blockquote:p7,break:Wb,code:_7,definition:w7,emphasis:J2,hardBreak:Wb,heading:N7,html:Z2,image:eN,imageReference:tN,inlineCode:nN,link:sN,linkReference:iN,list:L7,listItem:I7,paragraph:B7,root:z7,strong:aN,text:W7,thematicBreak:q7};function K7(){return{enter:{table:V7,tableData:Ub,tableHeader:Ub,tableRow:Q7},exit:{codeText:X7,table:Y7,tableData:ep,tableHeader:ep,tableRow:ep}}}function V7(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Y7(e){this.exit(e),this.data.inTable=void 0}function Q7(e){this.enter({type:"tableRow",children:[]},e)}function ep(e){this.exit(e)}function Ub(e){this.enter({type:"tableCell",children:[]},e)}function X7(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,G7));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function G7(e,t){return t==="|"?t:e}function J7(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
612
612
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:c,tableRow:l}};function o(f,m,g,w){return u(d(f,g,w),f.align)}function l(f,m,g,w){const x=h(f,g,w),b=u([x]);return b.slice(0,b.indexOf(`
|
|
613
|
-
`))}function c(f,m,g,w){const x=g.enter("tableCell"),b=g.enter("phrasing"),v=g.containerPhrasing(f,{...w,before:i,after:i});return b(),x(),v}function u(f,m){return d7(f,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(f,m,g){const w=f.children;let x=-1;const b=[],v=m.enter("table");for(;++x<w.length;)b[x]=h(w[x],m,g);return v(),b}function h(f,m,g){const w=f.children;let x=-1;const b=[],v=m.enter("tableRow");for(;++x<w.length;)b[x]=c(w[x],f,m,g);return v(),b}function p(f,m,g){let w=lN.inlineCode(f,m,g);return g.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function Z7(){return{exit:{taskListCheckValueChecked:qb,taskListCheckValueUnchecked:qb,paragraph:tH}}}function eH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nH}}}function qb(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tH(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let i=-1,o;for(;++i<s.length;){const l=s[i];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function nH(e,t,n,r){const s=e.children[0],i=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);i&&l.move(o);let c=lN.listItem(e,t,n,{...r,...l.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function rH(){return[L9(),n7(),o7(),K7(),Z7()]}function sH(e){return{extensions:[O9(),r7(e),a7(),J7(e),eH()]}}const iH={tokenize:hH,partial:!0},cN={tokenize:dH,partial:!0},uN={tokenize:fH,partial:!0},hN={tokenize:pH,partial:!0},oH={tokenize:mH,partial:!0},dN={name:"wwwAutolink",tokenize:cH,previous:pN},fN={name:"protocolAutolink",tokenize:uH,previous:mN},xs={name:"emailAutolink",tokenize:lH,previous:gN},qr={};function aH(){return{text:qr}}let Si=48;for(;Si<123;)qr[Si]=xs,Si++,Si===58?Si=65:Si===91&&(Si=97);qr[43]=xs;qr[45]=xs;qr[46]=xs;qr[95]=xs;qr[72]=[xs,fN];qr[104]=[xs,fN];qr[87]=[xs,dN];qr[119]=[xs,dN];function lH(e,t,n){const r=this;let s,i;return o;function o(h){return!_g(h)||!gN.call(r,r.previous)||Ex(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(h))}function l(h){return _g(h)?(e.consume(h),l):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(oH,d,u)(h):h===45||h===95||Xt(h)?(i=!0,e.consume(h),c):d(h)}function u(h){return e.consume(h),s=!0,c}function d(h){return i&&s&&sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function cH(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!pN.call(r,r.previous)||Ex(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(iH,e.attempt(cN,e.attempt(uN,i),n),n)(o))}function i(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function uH(e,t,n){const r=this;let s="",i=!1;return o;function o(h){return(h===72||h===104)&&mN.call(r,r.previous)&&!Ex(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(h),e.consume(h),l):n(h)}function l(h){if(sn(h)&&s.length<5)return s+=String.fromCodePoint(h),e.consume(h),l;if(h===58){const p=s.toLowerCase();if(p==="http"||p==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),i?u:(i=!0,c)):n(h)}function u(h){return h===null||Lh(h)||Ie(h)||oo(h)||yd(h)?n(h):e.attempt(cN,e.attempt(uN,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function hH(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),i):n(o)}function i(o){return o===null?n(o):t(o)}}function dH(e,t,n){let r,s,i;return o;function o(u){return u===46||u===95?e.check(hN,c,l)(u):u===null||Ie(u)||oo(u)||u!==45&&yd(u)?c(u):(i=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(s=r,r=void 0),e.consume(u),o}function c(u){return s||r||!i?n(u):t(u)}}function fH(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?i(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(hN,t,i)(o):o===null||Ie(o)||oo(o)?t(o):(e.consume(o),s)}function i(o){return o===41&&r++,e.consume(o),s}}function pH(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),i):l===93?(e.consume(l),s):l===60||l===null||Ie(l)||oo(l)?t(l):n(l)}function s(l){return l===null||l===40||l===91||Ie(l)||oo(l)?t(l):r(l)}function i(l){return sn(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):sn(l)?(e.consume(l),o):n(l)}}function mH(e,t,n){return r;function r(i){return e.consume(i),s}function s(i){return Xt(i)?n(i):t(i)}}function pN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function mN(e){return!sn(e)}function gN(e){return!(e===47||_g(e))}function _g(e){return e===43||e===45||e===46||e===95||Xt(e)}function Ex(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const gH={tokenize:kH,partial:!0};function vH(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:bH,continuation:{tokenize:wH},exit:SH}},text:{91:{name:"gfmFootnoteCall",tokenize:_H},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xH,resolveTo:yH}}}}function xH(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=vr(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function yH(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function _H(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,o;return l;function l(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(i>999||h===93&&!o||h===null||h===91||Ie(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(vr(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Ie(h)||(o=!0),i++,e.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(e.consume(h),i++,u):u(h)}}function bH(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,o=0,l;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!l||m===null||m===91||Ie(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=vr(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ie(m)||(l=!0),o++,e.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),Pe(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function wH(e,t,n){return e.check(Ec,t,e.attempt(gH,t,n))}function SH(e){e.exit("gfmFootnoteDefinition")}function kH(e,t,n){const r=this;return Pe(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(i):n(i)}}function CH(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},h={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},p=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",h,l]],f=l.parser.constructs.insideSpan.null;f&&On(p,p.length,0,_d(f,o.slice(u+1,c),l)),On(p,p.length,0,[["exit",h,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),On(o,u-1,c-u+3,p),c=u+p.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function i(o,l,c){const u=this.previous,d=this.events;let h=0;return p;function p(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(m):(o.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const g=_a(u);if(m===126)return h>1?c(m):(o.consume(m),h++,f);if(h<2&&!n)return c(m);const w=o.exit("strikethroughSequenceTemporary"),x=_a(m);return w._open=!x||x===2&&!!g,w._close=!g||g===2&&!!x,l(m)}}}class NH{constructor(){this.map=[]}add(t,n,r){EH(this,t,n,r)}consume(t){if(this.map.sort(function(i,o){return i[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function EH(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function jH(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function RH(){return{flow:{null:{name:"table",tokenize:PH,resolveAll:TH}}}}function PH(e,t,n){const r=this;let s=0,i=0,o;return l;function l(j){let O=r.events.length-1;for(;O>-1;){const M=r.events[O][1].type;if(M==="lineEnding"||M==="linePrefix")O--;else break}const P=O>-1?r.events[O][1].type:null,R=P==="tableHead"||P==="tableRow"?k:c;return R===k&&r.parser.lazy[r.now().line]?n(j):R(j)}function c(j){return e.enter("tableHead"),e.enter("tableRow"),u(j)}function u(j){return j===124||(o=!0,i+=1),d(j)}function d(j){return j===null?n(j):ue(j)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),f):n(j):Ce(j)?Pe(e,d,"whitespace")(j):(i+=1,o&&(o=!1,s+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),h(j)))}function h(j){return j===null||j===124||Ie(j)?(e.exit("data"),d(j)):(e.consume(j),j===92?p:h)}function p(j){return j===92||j===124?(e.consume(j),h):h(j)}function f(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),o=!1,Ce(j)?Pe(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):m(j))}function m(j){return j===45||j===58?w(j):j===124?(o=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),g):N(j)}function g(j){return Ce(j)?Pe(e,w,"whitespace")(j):w(j)}function w(j){return j===58?(i+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),x):j===45?(i+=1,x(j)):j===null||ue(j)?_(j):N(j)}function x(j){return j===45?(e.enter("tableDelimiterFiller"),b(j)):N(j)}function b(j){return j===45?(e.consume(j),b):j===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(j))}function v(j){return Ce(j)?Pe(e,_,"whitespace")(j):_(j)}function _(j){return j===124?m(j):j===null||ue(j)?!o||s!==i?N(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):N(j)}function N(j){return n(j)}function k(j){return e.enter("tableRow"),E(j)}function E(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),E):j===null||ue(j)?(e.exit("tableRow"),t(j)):Ce(j)?Pe(e,E,"whitespace")(j):(e.enter("data"),T(j))}function T(j){return j===null||j===124||Ie(j)?(e.exit("data"),E(j)):(e.consume(j),j===92?I:T)}function I(j){return j===92||j===124?(e.consume(j),T):T(j)}}function TH(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,h;const p=new NH;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(l=!1,c!==0&&(Kb(p,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,h=void 0,i=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",d,t]])),s=m.type==="tableDelimiterRow"?2:d?3:1):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(i[1]!==0&&(o[0]=o[1],h=xu(p,t,i,s,void 0,h),i=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(o[0]=o[1],h=xu(p,t,i,s,void 0,h)),i=o,o=[i[1],n,0,0])):m.type==="tableHead"?(l=!0,c=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(c=n,i[1]!==0?(o[0]=o[1],h=xu(p,t,i,s,n,h)):o[1]!==0&&(h=xu(p,t,o,s,n,h)),s=0):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&Kb(p,t,c,u,d),p.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=jH(t.events,n))}return e}function xu(e,t,n,r,s,i){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},jo(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const c=jo(t.events,n[1]);if(i={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=jo(t.events,n[2]),d=jo(t.events,n[3]),h={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],f=t.events[n[3]];if(p[1].end=Object.assign({},f[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return s!==void 0&&(i.end=Object.assign({},jo(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function Kb(e,t,n,r,s){const i=[],o=jo(t.events,n);s&&(s.end=Object.assign({},o),i.push(["exit",s,t])),r.end=Object.assign({},o),i.push(["exit",r,t]),e.add(n+1,0,i)}function jo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const DH={name:"tasklistCheck",tokenize:AH};function MH(){return{text:{91:DH}}}function AH(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Ie(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return ue(c)?t(c):Ce(c)?e.check({tokenize:LH},t,n)(c):n(c)}}function LH(e,t,n){return Pe(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function OH(e){return FC([aH(),vH(),CH(e),RH(),MH()])}const IH={};function BH(e){const t=this,n=e||IH,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(OH(n)),i.push(rH()),o.push(sH(n))}function FH({title:e,content:t,onClose:n}){return y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[n]),a.jsx("div",{className:Q.modalOverlay,onClick:n,children:a.jsxs("div",{className:Q.modalContent,onClick:r=>r.stopPropagation(),children:[a.jsxs("div",{className:Q.modalHeader,children:[a.jsx("h2",{className:Q.modalTitle,children:e}),a.jsx("button",{className:Q.modalClose,onClick:n,children:a.jsx(St,{size:18})})]}),a.jsx("div",{className:Q.modalBody,children:a.jsx("div",{className:Q.markdownContent,children:a.jsx(a2,{remarkPlugins:[BH],children:t})})})]})})}function zH({issueId:e,onClose:t}){const[n,r]=y.useState(!1),[s,i]=y.useState("transcript"),[o,l]=y.useState(!1),[c,u]=y.useState(null),d=y.useRef(null),h=y.useCallback(async w=>{if(!w.name.endsWith(".md")&&!w.name.endsWith(".txt")){u("Only .md and .txt files are supported");return}l(!0),u(null);try{const x=await w.text(),b=await fetch(`/api/mission-control/planning/${e}/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:s,filename:w.name,content:x})});if(!b.ok){const v=await b.json();throw new Error(v.error||"Upload failed")}u(`Uploaded ${w.name} as ${s}`),setTimeout(()=>t(),1500)}catch(x){u(`Error: ${x.message}`)}finally{l(!1)}},[e,s,t]),p=y.useCallback(w=>{w.preventDefault(),r(!1);const x=w.dataTransfer.files[0];x&&h(x)},[h]),f=y.useCallback(w=>{w.preventDefault(),r(!0)},[]),m=y.useCallback(()=>{r(!1)},[]),g=y.useCallback(w=>{var b;const x=(b=w.target.files)==null?void 0:b[0];x&&h(x)},[h]);return a.jsx("div",{className:Q.modalOverlay,onClick:t,children:a.jsxs("div",{className:Q.modalContent,onClick:w=>w.stopPropagation(),style:{maxWidth:500},children:[a.jsxs("div",{className:Q.modalHeader,children:[a.jsx("h2",{className:Q.modalTitle,children:"Upload Artifact"}),a.jsx("button",{className:Q.modalClose,onClick:t,children:a.jsx(St,{size:18})})]}),a.jsxs("div",{className:Q.modalBody,children:[a.jsxs("div",{style:{display:"flex",gap:"var(--mc-space-2)",marginBottom:"var(--mc-space-4)"},children:[a.jsx("button",{className:Q.badge,style:s==="transcript"?{borderColor:"var(--mc-accent)",color:"var(--mc-accent)"}:{},onClick:()=>i("transcript"),children:"Transcript"}),a.jsx("button",{className:Q.badge,style:s==="note"?{borderColor:"var(--mc-accent)",color:"var(--mc-accent)"}:{},onClick:()=>i("note"),children:"Note"})]}),a.jsxs("div",{className:`${Q.uploadZone} ${n?Q.uploadZoneActive:""}`,onDrop:p,onDragOver:f,onDragLeave:m,onClick:()=>{var w;return(w=d.current)==null?void 0:w.click()},children:[a.jsx("div",{className:Q.uploadIcon,children:o?a.jsx(Vi,{size:32,className:Q.spinning}):a.jsx(xk,{size:32})}),a.jsx("p",{className:Q.uploadText,children:o?"Uploading...":"Drop a file here or click to browse"}),a.jsx("p",{className:Q.uploadHint,children:"Accepts .md and .txt files"})]}),a.jsx("input",{ref:d,type:"file",accept:".md,.txt",onChange:g,style:{display:"none"}}),c&&a.jsx("p",{style:{fontSize:"var(--mc-font-size-sm)",marginTop:"var(--mc-space-3)",color:c.startsWith("Error")?"var(--mc-error)":"var(--mc-success)"},children:c})]})]})})}async function $H(e){const t=await fetch(`/api/mission-control/planning/${e}`);if(!t.ok)throw new Error("Failed to fetch planning");return t.json()}function HH({issueId:e,source:t,onOpenBeads:n}){var w,x;const[r,s]=y.useState(null),[i,o]=y.useState(!1),[l,c]=y.useState(!1),[u,d]=y.useState(null),[h,p]=y.useState(!1),{data:f,refetch:m}=fe({queryKey:["mission-control-planning",e],queryFn:()=>$H(e),refetchInterval:3e4}),g=async()=>{c(!0),d(null);try{const b=t?[t]:["github","linear","rally"];let v=0,_=null;for(const N of b)try{const k=await fetch(`/api/mission-control/planning/${e}/sync-discussions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tracker:N})});if(k.ok){const E=await k.json();v+=E.synced||0}else t&&(_=(await k.json().catch(()=>({error:"Sync failed"}))).error||`HTTP ${k.status}`)}catch{t&&(_="Network error")}m(),_&&v===0?d({message:_,isError:!0}):v>0?d({message:`Synced ${v} file${v>1?"s":""}`,isError:!1}):d({message:"No new discussions",isError:!1})}catch(b){console.error("Sync failed:",b),d({message:"Sync failed",isError:!0})}finally{c(!1),setTimeout(()=>d(null),4e3)}};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:Q.badgeBar,children:[a.jsxs("button",{className:Q.badge,onClick:n,title:"View beads tasks",children:[a.jsx(WR,{size:12}),"Tasks"]}),a.jsxs("button",{className:`${Q.badge} ${f!=null&&f.state?"":Q.badgeDisabled}`,onClick:()=>(f==null?void 0:f.state)&&s({title:"STATE.md",content:f.state}),title:f!=null&&f.state?"View STATE.md":"No STATE.md available",children:[a.jsx(Vi,{size:12}),"STATE"]}),a.jsxs("button",{className:`${Q.badge} ${f!=null&&f.prd?"":Q.badgeDisabled}`,onClick:()=>(f==null?void 0:f.prd)&&s({title:"PRD",content:f.prd}),title:f!=null&&f.prd?"View PRD":"No PRD available",children:[a.jsx(Vi,{size:12}),"PRD"]}),a.jsxs("button",{className:`${Q.badge} ${!(f!=null&&f.statusReview)&&!h?Q.badgeDisabled:""}`,onClick:async()=>{if(f!=null&&f.statusReview)s({title:`Status Review${f.statusReviewedAt?` (${new Date(f.statusReviewedAt).toLocaleString()})`:""}`,content:f.statusReview});else{p(!0);try{const b=await fetch(`/api/mission-control/planning/${e}/status-review`,{method:"POST"});if(b.ok){const v=await b.json();s({title:"Status Review",content:v.statusReview}),m()}}catch(b){console.error("Failed to generate status review:",b)}finally{p(!1)}}},title:f!=null&&f.statusReview?"View status review (click to refresh)":"Generate status review",children:[a.jsx(BR,{size:12,className:h?Q.spinning:""}),h?"Reviewing...":"Status"]}),(f==null?void 0:f.inference)&&a.jsxs("button",{className:Q.badge,onClick:()=>s({title:"INFERENCE.md",content:`*The Inference Document is a Shadow Engineering artifact. It analyzes how AI would approach this work — identifying gaps in requirements, risks, and potential implementation strategies — without making any changes. Use it to evaluate readiness before transitioning to AI-driven development.*
|
|
613
|
+
`))}function c(f,m,g,w){const x=g.enter("tableCell"),b=g.enter("phrasing"),v=g.containerPhrasing(f,{...w,before:i,after:i});return b(),x(),v}function u(f,m){return d7(f,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function d(f,m,g){const w=f.children;let x=-1;const b=[],v=m.enter("table");for(;++x<w.length;)b[x]=h(w[x],m,g);return v(),b}function h(f,m,g){const w=f.children;let x=-1;const b=[],v=m.enter("tableRow");for(;++x<w.length;)b[x]=c(w[x],f,m,g);return v(),b}function p(f,m,g){let w=lN.inlineCode(f,m,g);return g.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function Z7(){return{exit:{taskListCheckValueChecked:qb,taskListCheckValueUnchecked:qb,paragraph:tH}}}function eH(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nH}}}function qb(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tH(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let i=-1,o;for(;++i<s.length;){const l=s[i];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function nH(e,t,n,r){const s=e.children[0],i=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);i&&l.move(o);let c=lN.listItem(e,t,n,{...r,...l.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function rH(){return[L9(),n7(),o7(),K7(),Z7()]}function sH(e){return{extensions:[O9(),r7(e),a7(),J7(e),eH()]}}const iH={tokenize:hH,partial:!0},cN={tokenize:dH,partial:!0},uN={tokenize:fH,partial:!0},hN={tokenize:pH,partial:!0},oH={tokenize:mH,partial:!0},dN={name:"wwwAutolink",tokenize:cH,previous:pN},fN={name:"protocolAutolink",tokenize:uH,previous:mN},xs={name:"emailAutolink",tokenize:lH,previous:gN},qr={};function aH(){return{text:qr}}let Si=48;for(;Si<123;)qr[Si]=xs,Si++,Si===58?Si=65:Si===91&&(Si=97);qr[43]=xs;qr[45]=xs;qr[46]=xs;qr[95]=xs;qr[72]=[xs,fN];qr[104]=[xs,fN];qr[87]=[xs,dN];qr[119]=[xs,dN];function lH(e,t,n){const r=this;let s,i;return o;function o(h){return!_g(h)||!gN.call(r,r.previous)||Ex(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(h))}function l(h){return _g(h)?(e.consume(h),l):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(oH,d,u)(h):h===45||h===95||Xt(h)?(i=!0,e.consume(h),c):d(h)}function u(h){return e.consume(h),s=!0,c}function d(h){return i&&s&&sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function cH(e,t,n){const r=this;return s;function s(o){return o!==87&&o!==119||!pN.call(r,r.previous)||Ex(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(iH,e.attempt(cN,e.attempt(uN,i),n),n)(o))}function i(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function uH(e,t,n){const r=this;let s="",i=!1;return o;function o(h){return(h===72||h===104)&&mN.call(r,r.previous)&&!Ex(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(h),e.consume(h),l):n(h)}function l(h){if(sn(h)&&s.length<5)return s+=String.fromCodePoint(h),e.consume(h),l;if(h===58){const p=s.toLowerCase();if(p==="http"||p==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),i?u:(i=!0,c)):n(h)}function u(h){return h===null||Lh(h)||Ie(h)||oo(h)||yd(h)?n(h):e.attempt(cN,e.attempt(uN,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function hH(e,t,n){let r=0;return s;function s(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),s):o===46&&r===3?(e.consume(o),i):n(o)}function i(o){return o===null?n(o):t(o)}}function dH(e,t,n){let r,s,i;return o;function o(u){return u===46||u===95?e.check(hN,c,l)(u):u===null||Ie(u)||oo(u)||u!==45&&yd(u)?c(u):(i=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(s=r,r=void 0),e.consume(u),o}function c(u){return s||r||!i?n(u):t(u)}}function fH(e,t){let n=0,r=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&r<n?i(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(hN,t,i)(o):o===null||Ie(o)||oo(o)?t(o):(e.consume(o),s)}function i(o){return o===41&&r++,e.consume(o),s}}function pH(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),i):l===93?(e.consume(l),s):l===60||l===null||Ie(l)||oo(l)?t(l):n(l)}function s(l){return l===null||l===40||l===91||Ie(l)||oo(l)?t(l):r(l)}function i(l){return sn(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):sn(l)?(e.consume(l),o):n(l)}}function mH(e,t,n){return r;function r(i){return e.consume(i),s}function s(i){return Xt(i)?n(i):t(i)}}function pN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ie(e)}function mN(e){return!sn(e)}function gN(e){return!(e===47||_g(e))}function _g(e){return e===43||e===45||e===46||e===95||Xt(e)}function Ex(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const gH={tokenize:kH,partial:!0};function vH(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:bH,continuation:{tokenize:wH},exit:SH}},text:{91:{name:"gfmFootnoteCall",tokenize:_H},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xH,resolveTo:yH}}}}function xH(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=vr(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function yH(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function _H(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,o;return l;function l(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(i>999||h===93&&!o||h===null||h===91||Ie(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(vr(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Ie(h)||(o=!0),i++,e.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(e.consume(h),i++,u):u(h)}}function bH(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,o=0,l;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!l||m===null||m===91||Ie(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=vr(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ie(m)||(l=!0),o++,e.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),Pe(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function wH(e,t,n){return e.check(Ec,t,e.attempt(gH,t,n))}function SH(e){e.exit("gfmFootnoteDefinition")}function kH(e,t,n){const r=this;return Pe(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(i):n(i)}}function CH(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},h={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},p=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",h,l]],f=l.parser.constructs.insideSpan.null;f&&On(p,p.length,0,_d(f,o.slice(u+1,c),l)),On(p,p.length,0,[["exit",h,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),On(o,u-1,c-u+3,p),c=u+p.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function i(o,l,c){const u=this.previous,d=this.events;let h=0;return p;function p(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(m):(o.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const g=_a(u);if(m===126)return h>1?c(m):(o.consume(m),h++,f);if(h<2&&!n)return c(m);const w=o.exit("strikethroughSequenceTemporary"),x=_a(m);return w._open=!x||x===2&&!!g,w._close=!g||g===2&&!!x,l(m)}}}class NH{constructor(){this.map=[]}add(t,n,r){EH(this,t,n,r)}consume(t){if(this.map.sort(function(i,o){return i[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function EH(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function jH(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function RH(){return{flow:{null:{name:"table",tokenize:PH,resolveAll:TH}}}}function PH(e,t,n){const r=this;let s=0,i=0,o;return l;function l(j){let O=r.events.length-1;for(;O>-1;){const M=r.events[O][1].type;if(M==="lineEnding"||M==="linePrefix")O--;else break}const P=O>-1?r.events[O][1].type:null,R=P==="tableHead"||P==="tableRow"?k:c;return R===k&&r.parser.lazy[r.now().line]?n(j):R(j)}function c(j){return e.enter("tableHead"),e.enter("tableRow"),u(j)}function u(j){return j===124||(o=!0,i+=1),d(j)}function d(j){return j===null?n(j):ue(j)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),f):n(j):Ce(j)?Pe(e,d,"whitespace")(j):(i+=1,o&&(o=!1,s+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),h(j)))}function h(j){return j===null||j===124||Ie(j)?(e.exit("data"),d(j)):(e.consume(j),j===92?p:h)}function p(j){return j===92||j===124?(e.consume(j),h):h(j)}function f(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),o=!1,Ce(j)?Pe(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):m(j))}function m(j){return j===45||j===58?w(j):j===124?(o=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),g):N(j)}function g(j){return Ce(j)?Pe(e,w,"whitespace")(j):w(j)}function w(j){return j===58?(i+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),x):j===45?(i+=1,x(j)):j===null||ue(j)?_(j):N(j)}function x(j){return j===45?(e.enter("tableDelimiterFiller"),b(j)):N(j)}function b(j){return j===45?(e.consume(j),b):j===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(j))}function v(j){return Ce(j)?Pe(e,_,"whitespace")(j):_(j)}function _(j){return j===124?m(j):j===null||ue(j)?!o||s!==i?N(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):N(j)}function N(j){return n(j)}function k(j){return e.enter("tableRow"),E(j)}function E(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),E):j===null||ue(j)?(e.exit("tableRow"),t(j)):Ce(j)?Pe(e,E,"whitespace")(j):(e.enter("data"),T(j))}function T(j){return j===null||j===124||Ie(j)?(e.exit("data"),E(j)):(e.consume(j),j===92?I:T)}function I(j){return j===92||j===124?(e.consume(j),T):T(j)}}function TH(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,h;const p=new NH;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(l=!1,c!==0&&(Kb(p,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,h=void 0,i=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",d,t]])),s=m.type==="tableDelimiterRow"?2:d?3:1):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(i[1]!==0&&(o[0]=o[1],h=xu(p,t,i,s,void 0,h),i=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(o[0]=o[1],h=xu(p,t,i,s,void 0,h)),i=o,o=[i[1],n,0,0])):m.type==="tableHead"?(l=!0,c=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(c=n,i[1]!==0?(o[0]=o[1],h=xu(p,t,i,s,n,h)):o[1]!==0&&(h=xu(p,t,o,s,n,h)),s=0):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&Kb(p,t,c,u,d),p.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=jH(t.events,n))}return e}function xu(e,t,n,r,s,i){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},jo(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const c=jo(t.events,n[1]);if(i={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=jo(t.events,n[2]),d=jo(t.events,n[3]),h={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],f=t.events[n[3]];if(p[1].end=Object.assign({},f[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return s!==void 0&&(i.end=Object.assign({},jo(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function Kb(e,t,n,r,s){const i=[],o=jo(t.events,n);s&&(s.end=Object.assign({},o),i.push(["exit",s,t])),r.end=Object.assign({},o),i.push(["exit",r,t]),e.add(n+1,0,i)}function jo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const DH={name:"tasklistCheck",tokenize:AH};function MH(){return{text:{91:DH}}}function AH(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Ie(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return ue(c)?t(c):Ce(c)?e.check({tokenize:LH},t,n)(c):n(c)}}function LH(e,t,n){return Pe(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function OH(e){return FC([aH(),vH(),CH(e),RH(),MH()])}const IH={};function BH(e){const t=this,n=e||IH,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(OH(n)),i.push(rH()),o.push(sH(n))}function FH({title:e,content:t,onClose:n}){return y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[n]),a.jsx("div",{className:Q.modalOverlay,onClick:n,children:a.jsxs("div",{className:Q.modalContent,onClick:r=>r.stopPropagation(),children:[a.jsxs("div",{className:Q.modalHeader,children:[a.jsx("h2",{className:Q.modalTitle,children:e}),a.jsx("button",{className:Q.modalClose,onClick:n,children:a.jsx(St,{size:18})})]}),a.jsx("div",{className:Q.modalBody,children:a.jsx("div",{className:Q.markdownContent,children:a.jsx(a2,{remarkPlugins:[BH],children:t})})})]})})}function zH({issueId:e,onClose:t}){const[n,r]=y.useState(!1),[s,i]=y.useState("transcript"),[o,l]=y.useState(!1),[c,u]=y.useState(null),d=y.useRef(null),h=y.useCallback(async w=>{if(!w.name.endsWith(".md")&&!w.name.endsWith(".txt")){u("Only .md and .txt files are supported");return}l(!0),u(null);try{const x=await w.text(),b=await fetch(`/api/mission-control/planning/${e}/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:s,filename:w.name,content:x})});if(!b.ok){const v=await b.json();throw new Error(v.error||"Upload failed")}u(`Uploaded ${w.name} as ${s}`),setTimeout(()=>t(),1500)}catch(x){u(`Error: ${x.message}`)}finally{l(!1)}},[e,s,t]),p=y.useCallback(w=>{w.preventDefault(),r(!1);const x=w.dataTransfer.files[0];x&&h(x)},[h]),f=y.useCallback(w=>{w.preventDefault(),r(!0)},[]),m=y.useCallback(()=>{r(!1)},[]),g=y.useCallback(w=>{var b;const x=(b=w.target.files)==null?void 0:b[0];x&&h(x)},[h]);return a.jsx("div",{className:Q.modalOverlay,onClick:t,children:a.jsxs("div",{className:Q.modalContent,onClick:w=>w.stopPropagation(),style:{maxWidth:500},children:[a.jsxs("div",{className:Q.modalHeader,children:[a.jsx("h2",{className:Q.modalTitle,children:"Upload Artifact"}),a.jsx("button",{className:Q.modalClose,onClick:t,children:a.jsx(St,{size:18})})]}),a.jsxs("div",{className:Q.modalBody,children:[a.jsxs("div",{style:{display:"flex",gap:"var(--mc-space-2)",marginBottom:"var(--mc-space-4)"},children:[a.jsx("button",{className:Q.badge,style:s==="transcript"?{borderColor:"var(--mc-accent)",color:"var(--mc-accent)"}:{},onClick:()=>i("transcript"),children:"Transcript"}),a.jsx("button",{className:Q.badge,style:s==="note"?{borderColor:"var(--mc-accent)",color:"var(--mc-accent)"}:{},onClick:()=>i("note"),children:"Note"})]}),a.jsxs("div",{className:`${Q.uploadZone} ${n?Q.uploadZoneActive:""}`,onDrop:p,onDragOver:f,onDragLeave:m,onClick:()=>{var w;return(w=d.current)==null?void 0:w.click()},children:[a.jsx("div",{className:Q.uploadIcon,children:o?a.jsx(Vi,{size:32,className:Q.spinning}):a.jsx(xk,{size:32})}),a.jsx("p",{className:Q.uploadText,children:o?"Uploading...":"Drop a file here or click to browse"}),a.jsx("p",{className:Q.uploadHint,children:"Accepts .md and .txt files"})]}),a.jsx("input",{ref:d,type:"file",accept:".md,.txt",onChange:g,style:{display:"none"}}),c&&a.jsx("p",{style:{fontSize:"var(--mc-font-size-sm)",marginTop:"var(--mc-space-3)",color:c.startsWith("Error")?"var(--mc-error)":"var(--mc-success)"},children:c})]})]})})}async function $H(e){const t=await fetch(`/api/mission-control/planning/${e}`);if(!t.ok)throw new Error("Failed to fetch planning");return t.json()}function HH({issueId:e,source:t,onOpenBeads:n}){var w,x;const[r,s]=y.useState(null),[i,o]=y.useState(!1),[l,c]=y.useState(!1),[u,d]=y.useState(null),[h,p]=y.useState(!1),{data:f,refetch:m}=fe({queryKey:["mission-control-planning",e],queryFn:()=>$H(e),refetchInterval:3e4}),g=async()=>{c(!0),d(null);try{const b=t?[t]:["github","linear","rally"];let v=0,_=null;for(const N of b)try{const k=await fetch(`/api/mission-control/planning/${e}/sync-discussions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tracker:N})});if(k.ok){const E=await k.json();v+=E.synced||0}else t&&(_=(await k.json().catch(()=>({error:"Sync failed"}))).error||`HTTP ${k.status}`)}catch{t&&(_="Network error")}_&&v===0?d({message:_,isError:!0}):v>0?d({message:`Synced ${v} — generating status...`,isError:!1}):d({message:"No new discussions",isError:!1}),p(!0);try{const N=await fetch(`/api/mission-control/planning/${e}/status-review`,{method:"POST"});if(N.ok){const k=await N.json();v>0?d({message:`Synced ${v} + status updated`,isError:!1}):d({message:"Status updated",isError:!1}),s({title:`Status Review (${new Date().toLocaleString()})`,content:k.statusReview})}}catch(N){console.error("Status review generation failed:",N)}finally{p(!1)}m()}catch(b){console.error("Sync failed:",b),d({message:"Sync failed",isError:!0})}finally{c(!1),setTimeout(()=>d(null),6e3)}};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:Q.badgeBar,children:[a.jsxs("button",{className:Q.badge,onClick:n,title:"View beads tasks",children:[a.jsx(WR,{size:12}),"Tasks"]}),a.jsxs("button",{className:`${Q.badge} ${f!=null&&f.state?"":Q.badgeDisabled}`,onClick:()=>(f==null?void 0:f.state)&&s({title:"STATE.md",content:f.state}),title:f!=null&&f.state?"View STATE.md":"No STATE.md available",children:[a.jsx(Vi,{size:12}),"STATE"]}),a.jsxs("button",{className:`${Q.badge} ${f!=null&&f.prd?"":Q.badgeDisabled}`,onClick:()=>(f==null?void 0:f.prd)&&s({title:"PRD",content:f.prd}),title:f!=null&&f.prd?"View PRD":"No PRD available",children:[a.jsx(Vi,{size:12}),"PRD"]}),a.jsxs("button",{className:`${Q.badge} ${!(f!=null&&f.statusReview)&&!h?Q.badgeDisabled:""}`,onClick:async()=>{if(f!=null&&f.statusReview)s({title:`Status Review${f.statusReviewedAt?` (${new Date(f.statusReviewedAt).toLocaleString()})`:""}`,content:f.statusReview});else{p(!0);try{const b=await fetch(`/api/mission-control/planning/${e}/status-review`,{method:"POST"});if(b.ok){const v=await b.json();s({title:"Status Review",content:v.statusReview}),m()}}catch(b){console.error("Failed to generate status review:",b)}finally{p(!1)}}},title:f!=null&&f.statusReview?"View status review (click to refresh)":"Generate status review",children:[a.jsx(BR,{size:12,className:h?Q.spinning:""}),h?"Reviewing...":"Status"]}),(f==null?void 0:f.inference)&&a.jsxs("button",{className:Q.badge,onClick:()=>s({title:"INFERENCE.md",content:`*The Inference Document is a Shadow Engineering artifact. It analyzes how AI would approach this work — identifying gaps in requirements, risks, and potential implementation strategies — without making any changes. Use it to evaluate readiness before transitioning to AI-driven development.*
|
|
614
614
|
|
|
615
615
|
---
|
|
616
616
|
|
|
@@ -626,7 +626,7 @@ ${v.content}`).join(`
|
|
|
626
626
|
|
|
627
627
|
---
|
|
628
628
|
|
|
629
|
-
`);s({title:"Transcripts",content:b})},children:["Transcripts (",f.transcripts.length,")"]}),a.jsxs("button",{className:Q.badge,onClick:()=>o(!0),title:"Upload transcript or note",children:[a.jsx(xk,{size:12}),"Upload"]}),a.jsxs("button",{className:`${Q.syncButton} `,onClick:g,disabled:l,title:"Sync discussions
|
|
629
|
+
`);s({title:"Transcripts",content:b})},children:["Transcripts (",f.transcripts.length,")"]}),a.jsxs("button",{className:Q.badge,onClick:()=>o(!0),title:"Upload transcript or note",children:[a.jsx(xk,{size:12}),"Upload"]}),a.jsxs("button",{className:`${Q.syncButton} `,onClick:g,disabled:l||h,title:"Sync discussions and generate AI status review",children:[a.jsx(Xs,{size:12,className:l||h?Q.spinning:""}),h?"Reviewing...":l?"Syncing...":"Sync"]}),u&&a.jsx("span",{className:Q.badge,style:{color:u.isError?"var(--mc-error, #ef4444)":"var(--mc-success, #22c55e)",fontSize:"0.7rem",opacity:.9},children:u.message})]}),r&&a.jsx(FH,{title:r.title,content:r.content,onClose:()=>s(null)}),i&&a.jsx(zH,{issueId:e,onClose:()=>{o(!1),m()}})]})}async function WH(){const e=await fetch("/api/mission-control/projects");if(!e.ok)throw new Error("Failed to fetch projects");return e.json()}async function UH(){const e=await fetch("/api/costs/by-issue");if(!e.ok)throw new Error("Failed to fetch costs");return e.json()}function qH({issues:e=[]}){var v;const[t,n]=y.useState(null),[r,s]=y.useState(!1),[i,o]=y.useState(340),l=y.useRef(!1),c=y.useRef(0),u=y.useRef(0),{data:d=[],isLoading:h}=fe({queryKey:["mission-control-projects"],queryFn:WH,refetchInterval:1e4}),{data:p}=fe({queryKey:["costs-by-issue"],queryFn:UH,refetchInterval:15e3}),f={},m={};for(const _ of e)f[_.identifier.toLowerCase()]=_.title,f[_.identifier]=_.title;for(const _ of(p==null?void 0:p.issues)||[])m[_.issueId]=_.totalCost,m[_.issueId.toLowerCase()]=_.totalCost;const g=y.useCallback(_=>{n(_)},[]),w=y.useCallback(_=>{l.current=!0,c.current=_.clientX,u.current=i,document.body.style.cursor="col-resize",document.body.style.userSelect="none",_.preventDefault()},[i]);y.useEffect(()=>{const _=k=>{if(!l.current)return;const E=k.clientX-c.current,T=Math.max(240,Math.min(600,u.current+E));o(T)},N=()=>{l.current=!1,document.body.style.cursor="",document.body.style.userSelect=""};return document.addEventListener("mousemove",_),document.addEventListener("mouseup",N),()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",N)}},[]);const x=t?d.flatMap(_=>_.features).find(_=>_.issueId===t):null,b=t?f[t.toLowerCase()]||f[t]||t:"";return a.jsxs("div",{className:Q.missionControl,children:[a.jsxs("div",{className:Q.layout,children:[a.jsxs("div",{className:Q.sidebar,style:{width:i,minWidth:i},children:[a.jsxs("div",{className:Q.sidebarHeader,children:[a.jsx("h2",{className:Q.sidebarTitle,children:"Mission Control"}),a.jsx("p",{className:Q.sidebarSubtitle,children:"Active features across projects"})]}),a.jsx("div",{className:Q.projectTree,children:h&&d.length===0?a.jsx("div",{className:Q.emptyProject,children:"Loading projects..."}):d.length===0?a.jsx("div",{className:Q.emptyProject,children:"No projects configured"}):d.map(_=>a.jsx(x9,{name:_.name,features:_.features,selectedFeature:t,onSelectFeature:g,issueTitles:f,issueCosts:m},_.path))})]}),a.jsx("div",{className:Q.resizeHandle,onMouseDown:w}),a.jsx("div",{className:Q.content,children:t?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:Q.featureHeader,children:[a.jsx("h1",{className:Q.featureTitle,children:b}),a.jsx("span",{className:Q.featureId,children:t}),(x==null?void 0:x.isShadow)&&a.jsx("span",{className:Q.badge,style:{borderColor:"var(--mc-accent)",color:"var(--mc-accent)"},children:"Shadow"})]}),a.jsx(HH,{issueId:t,source:(v=e.find(_=>_.identifier===t))==null?void 0:v.source,onOpenBeads:()=>s(!0)}),a.jsx(R9,{issueId:t,issues:e,featureData:x})]}):a.jsx("div",{className:Q.contentEmpty,children:a.jsxs("div",{style:{textAlign:"center"},children:[a.jsx(ck,{size:48,style:{marginBottom:"var(--mc-space-4)",opacity:.3}}),a.jsx("p",{children:"Select a feature to view activity"})]})})})]}),r&&t&&a.jsx(kC,{issueId:t,isOpen:r,onClose:()=>s(!1)})]})}const KH={},Vb=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const f=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,f))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(KH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,s,c);return c},VH=e=>e?Vb(e):Vb;var vN={exports:{}},xN={},yN={exports:{}},_N={};/**
|
|
630
630
|
* @license React
|
|
631
631
|
* use-sync-external-store-shim.production.js
|
|
632
632
|
*
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
})();
|
|
19
19
|
</script>
|
|
20
|
-
<script type="module" crossorigin src="/assets/index-
|
|
20
|
+
<script type="module" crossorigin src="/assets/index-C8Vc3yIh.js"></script>
|
|
21
21
|
<link rel="stylesheet" crossorigin href="/assets/index--VPaQ2VU.css">
|
|
22
22
|
</head>
|
|
23
23
|
<body class="bg-surface text-content transition-colors duration-150">
|
package/dist/dashboard/server.js
CHANGED
|
@@ -99636,8 +99636,20 @@ app.post("/api/mission-control/planning/:issueId/status-review", async (req, res
|
|
|
99636
99636
|
const statePath = join43(planningDir, "STATE.md");
|
|
99637
99637
|
const prd = existsSync44(prdPath) ? readFileSync37(prdPath, "utf-8") : null;
|
|
99638
99638
|
const state = existsSync44(statePath) ? readFileSync37(statePath, "utf-8") : null;
|
|
99639
|
-
|
|
99640
|
-
|
|
99639
|
+
const discussionsDir = join43(planningDir, "discussions");
|
|
99640
|
+
let discussionsContent = "";
|
|
99641
|
+
if (existsSync44(discussionsDir)) {
|
|
99642
|
+
const discussionFiles = readdirSync17(discussionsDir).filter((f) => f.endsWith(".md") || f.endsWith(".txt"));
|
|
99643
|
+
for (const file of discussionFiles.slice(0, 5)) {
|
|
99644
|
+
const content = readFileSync37(join43(discussionsDir, file), "utf-8");
|
|
99645
|
+
discussionsContent += `
|
|
99646
|
+
### ${file}
|
|
99647
|
+
${content.slice(0, 2e3)}
|
|
99648
|
+
`;
|
|
99649
|
+
}
|
|
99650
|
+
}
|
|
99651
|
+
if (!prd && !state && !discussionsContent) {
|
|
99652
|
+
return res.status(400).json({ error: "No PRD, STATE.md, or discussions to review against" });
|
|
99641
99653
|
}
|
|
99642
99654
|
let gitDiff = "";
|
|
99643
99655
|
let gitLog = "";
|
|
@@ -99695,16 +99707,19 @@ ${gitDiff || "No diff available"}
|
|
|
99695
99707
|
## Recent Commits
|
|
99696
99708
|
${gitLog || "No commits yet"}
|
|
99697
99709
|
|
|
99710
|
+
## Discussions & Comments
|
|
99711
|
+
${discussionsContent || "(No discussions synced)"}
|
|
99712
|
+
|
|
99698
99713
|
---
|
|
99699
99714
|
|
|
99700
99715
|
Based on the above, produce a concise status review in markdown format with these sections:
|
|
99701
99716
|
|
|
99702
99717
|
1. **Summary** (2-3 sentences: overall progress, what's done, what's remaining)
|
|
99703
|
-
2. **PRD Coverage** (which requirements are met, partially met, or not yet started \u2014 use a table)
|
|
99718
|
+
2. **PRD Coverage** (which requirements are met, partially met, or not yet started \u2014 use a table. If no PRD, summarize based on available context)
|
|
99704
99719
|
3. **Risk Assessment** (any concerns about code quality, missing tests, incomplete features)
|
|
99705
99720
|
4. **Recommendation** (next steps, whether it's ready for review/merge, or what needs attention)
|
|
99706
99721
|
|
|
99707
|
-
Be specific and reference actual file names and
|
|
99722
|
+
Be specific and reference actual file names, requirements, and discussion points. Keep it under 500 words.`;
|
|
99708
99723
|
const aiReview = await callLLM(analysisPrompt);
|
|
99709
99724
|
review = `# Status Review - ${issueId}
|
|
99710
99725
|
|
|
@@ -99743,6 +99758,9 @@ ${filesChanged || "No changes detected"}
|
|
|
99743
99758
|
${gitLog || "No commits yet"}
|
|
99744
99759
|
\`\`\`
|
|
99745
99760
|
|
|
99761
|
+
## Discussions
|
|
99762
|
+
${discussionsContent || "(No discussions synced)"}
|
|
99763
|
+
|
|
99746
99764
|
---
|
|
99747
99765
|
*Review by Panopticon Mission Control (static fallback)*
|
|
99748
99766
|
`;
|