@pithosai/pithosai 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/935.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export const __rspack_esm_id="935";export const __rspack_esm_ids=["935"];export const __webpack_modules__={8498(t,e,i){i.a(t,async function(t,s){try{i.d(e,{showMarkdownInPiTui:()=>a});var l=i(8691),r=i(8285),n=i(4127),h=t([l,r,n]);[l,r,n]=h.then?(await h)():h;let o=!1;class c{constructor(t){let{terminal:e,tui:i,markdown:s,hintText:l,documentTitle:r,onClose:n}=t;this.terminal=e,this.tui=i,this._markdown=s,this.hintText=l,this.documentTitle=r?.trim()||"",this.onClose=n,this.scrollTop=0,this._fullLines=null,this._cachedWidth=null,this._ggAwaitingSecondG=!1,this._ggTimer=null}clearGgPrefixState(){null!=this._ggTimer&&(clearTimeout(this._ggTimer),this._ggTimer=null),this._ggAwaitingSecondG=!1}invalidate(){this._markdown.invalidate(),this._fullLines=null,this._cachedWidth=null}handleInput(t){let e=this.terminal.columns,i=this.terminal.rows,s=+!!this.documentTitle,l=Math.max(1,i-s-1),r=this._getFullLines(e).length,h=Math.max(0,r-l);if((0,n.matchesKey)(t,"escape")||(0,n.matchesKey)(t,"esc")||(0,n.matchesKey)(t,"q")||(0,n.matchesKey)(t,"shift+q")||(0,n.matchesKey)(t,"ctrl+c")){this.clearGgPrefixState(),this.onClose();return}if((0,n.matchesKey)(t,"shift+g")){this.clearGgPrefixState(),this.scrollTop=h;return}if((0,n.matchesKey)(t,"g")){if(this._ggAwaitingSecondG){this.clearGgPrefixState(),this.scrollTop=0;return}this._ggAwaitingSecondG=!0,null!=this._ggTimer&&clearTimeout(this._ggTimer),this._ggTimer=setTimeout(()=>{this._ggTimer=null,this._ggAwaitingSecondG=!1},500);return}if(this.clearGgPrefixState(),(0,n.matchesKey)(t,"up")||(0,n.matchesKey)(t,"k")){this.scrollTop=Math.max(0,this.scrollTop-1);return}if((0,n.matchesKey)(t,"down")||(0,n.matchesKey)(t,"j")){this.scrollTop=Math.min(h,this.scrollTop+1);return}if((0,n.matchesKey)(t,"pageUp")||(0,n.matchesKey)(t,"ctrl+u")){this.scrollTop=Math.max(0,this.scrollTop-l);return}if((0,n.matchesKey)(t,"pageDown")||(0,n.matchesKey)(t,"ctrl+d")){this.scrollTop=Math.min(h,this.scrollTop+l);return}if((0,n.matchesKey)(t,"home")){this.scrollTop=0;return}if((0,n.matchesKey)(t,"end")){this.scrollTop=h;return}}_getFullLines(t){return this._fullLines&&this._cachedWidth===t||(this._cachedWidth=t,this._fullLines=this._markdown.render(t)),this._fullLines}render(t){let e=this.terminal.rows,i=this.documentTitle?[l.m.bold.cyan((0,n.truncateToWidth)(this.documentTitle,t))]:[],s=i.length,r=Math.max(1,e-s-1);null!=this._cachedWidth&&this._cachedWidth!==t&&this.invalidate();let h=this._getFullLines(t),a=Math.max(0,h.length-r);this.scrollTop=Math.min(this.scrollTop,a);let o=h.slice(this.scrollTop,this.scrollTop+r);for(;o.length<r;)o.push("");let c=l.m.dim((0,n.truncateToWidth)(this.hintText,t));return[...i,...o,c]}}async function a(t){let{markdown:e,t:i,documentTitle:s,tuiSession:l=null}=t;if(!e||"string"!=typeof e||!e.trim())return;if(!(process.stdout.isTTY&&process.stdin.isTTY))return void process.stdout.write(`${e}
3
- `);let h=l&&"function"==typeof l.suspendForReadline&&"function"==typeof l.resumeFromReadline;h&&l.suspendForReadline();try{o||((0,r.CK)("dark"),o=!0);let t=(0,r.pd)(),l=new n.Markdown(e,1,1,t),h=i("cli.resultPreviewTerminalHint"),a=new n.ProcessTerminal,m=new n.TUI(a);m.setClearOnShrink(!0),await new Promise(t=>{let e,i=new c({terminal:a,tui:m,markdown:l,hintText:h,documentTitle:s,onClose:()=>{e?.clearGgPrefixState(),m.stop(),t()}});e=i;let r=new n.Container;r.addChild(i),m.addChild(r),m.setFocus(i),m.start(),m.requestRender(!0)})}finally{h&&l.resumeFromReadline()}}s()}catch(t){s(t)}})}};
2
+ export const __rspack_esm_id="935";export const __rspack_esm_ids=["935"];export const __webpack_modules__={8498(t,e,i){i.a(t,async function(t,s){try{i.d(e,{showMarkdownInPiTui:()=>a});var l=i(8691),r=i(2421),n=i(4127),h=t([l,r,n]);[l,r,n]=h.then?(await h)():h;let o=!1;class c{constructor(t){let{terminal:e,tui:i,markdown:s,hintText:l,documentTitle:r,onClose:n}=t;this.terminal=e,this.tui=i,this._markdown=s,this.hintText=l,this.documentTitle=r?.trim()||"",this.onClose=n,this.scrollTop=0,this._fullLines=null,this._cachedWidth=null,this._ggAwaitingSecondG=!1,this._ggTimer=null}clearGgPrefixState(){null!=this._ggTimer&&(clearTimeout(this._ggTimer),this._ggTimer=null),this._ggAwaitingSecondG=!1}invalidate(){this._markdown.invalidate(),this._fullLines=null,this._cachedWidth=null}handleInput(t){let e=this.terminal.columns,i=this.terminal.rows,s=+!!this.documentTitle,l=Math.max(1,i-s-1),r=this._getFullLines(e).length,h=Math.max(0,r-l);if((0,n.matchesKey)(t,"escape")||(0,n.matchesKey)(t,"esc")||(0,n.matchesKey)(t,"q")||(0,n.matchesKey)(t,"shift+q")||(0,n.matchesKey)(t,"ctrl+c")){this.clearGgPrefixState(),this.onClose();return}if((0,n.matchesKey)(t,"shift+g")){this.clearGgPrefixState(),this.scrollTop=h;return}if((0,n.matchesKey)(t,"g")){if(this._ggAwaitingSecondG){this.clearGgPrefixState(),this.scrollTop=0;return}this._ggAwaitingSecondG=!0,null!=this._ggTimer&&clearTimeout(this._ggTimer),this._ggTimer=setTimeout(()=>{this._ggTimer=null,this._ggAwaitingSecondG=!1},500);return}if(this.clearGgPrefixState(),(0,n.matchesKey)(t,"up")||(0,n.matchesKey)(t,"k")){this.scrollTop=Math.max(0,this.scrollTop-1);return}if((0,n.matchesKey)(t,"down")||(0,n.matchesKey)(t,"j")){this.scrollTop=Math.min(h,this.scrollTop+1);return}if((0,n.matchesKey)(t,"pageUp")||(0,n.matchesKey)(t,"ctrl+u")){this.scrollTop=Math.max(0,this.scrollTop-l);return}if((0,n.matchesKey)(t,"pageDown")||(0,n.matchesKey)(t,"ctrl+d")){this.scrollTop=Math.min(h,this.scrollTop+l);return}if((0,n.matchesKey)(t,"home")){this.scrollTop=0;return}if((0,n.matchesKey)(t,"end")){this.scrollTop=h;return}}_getFullLines(t){return this._fullLines&&this._cachedWidth===t||(this._cachedWidth=t,this._fullLines=this._markdown.render(t)),this._fullLines}render(t){let e=this.terminal.rows,i=this.documentTitle?[l.m.bold.cyan((0,n.truncateToWidth)(this.documentTitle,t))]:[],s=i.length,r=Math.max(1,e-s-1);null!=this._cachedWidth&&this._cachedWidth!==t&&this.invalidate();let h=this._getFullLines(t),a=Math.max(0,h.length-r);this.scrollTop=Math.min(this.scrollTop,a);let o=h.slice(this.scrollTop,this.scrollTop+r);for(;o.length<r;)o.push("");let c=l.m.dim((0,n.truncateToWidth)(this.hintText,t));return[...i,...o,c]}}async function a(t){let{markdown:e,t:i,documentTitle:s,tuiSession:l=null}=t;if(!e||"string"!=typeof e||!e.trim())return;if(!(process.stdout.isTTY&&process.stdin.isTTY))return void process.stdout.write(`${e}
3
+ `);let h=l&&"function"==typeof l.suspendForReadline&&"function"==typeof l.resumeFromReadline;h&&l.suspendForReadline();try{o||((0,r.initTheme)("dark"),o=!0);let t=(0,r.getMarkdownTheme)(),l=new n.Markdown(e,1,1,t),h=i("cli.resultPreviewTerminalHint"),a=new n.ProcessTerminal,m=new n.TUI(a);m.setClearOnShrink(!0),await new Promise(t=>{let e,i=new c({terminal:a,tui:m,markdown:l,hintText:h,documentTitle:s,onClose:()=>{e?.clearGgPrefixState(),m.stop(),t()}});e=i;let r=new n.Container;r.addChild(i),m.addChild(r),m.setFocus(i),m.start(),m.requestRender(!0)})}finally{h&&l.resumeFromReadline()}}s()}catch(t){s(t)}})}};