@hienlh/ppm 0.5.21 → 0.6.1

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/bun.lock +45 -0
  3. package/dist/web/assets/{api-client-BxCvlogn.js → api-client-ANLU-Irq.js} +1 -1
  4. package/dist/web/assets/chat-tab-CjKO_uYf.js +7 -0
  5. package/dist/web/assets/code-editor-CCvD-8SS.js +1 -0
  6. package/dist/web/assets/{diff-viewer-CwMGJLkZ.js → diff-viewer-D_bM4Kmw.js} +1 -1
  7. package/dist/web/assets/{git-graph-HUZNEwuR.js → git-graph-zmdDLInW.js} +1 -1
  8. package/dist/web/assets/index-CP_2zE5O.css +2 -0
  9. package/dist/web/assets/index-l7z-nYoz.js +21 -0
  10. package/dist/web/assets/{input-Bzyi1GeB.js → input-DV4tynJq.js} +1 -1
  11. package/dist/web/assets/{jsx-runtime-Bzk8w7Zh.js → jsx-runtime-B4BJKQ1u.js} +1 -1
  12. package/dist/web/assets/{markdown-renderer-DhYu0Drk.js → markdown-renderer-BKfKwtec.js} +2 -2
  13. package/dist/web/assets/react-WvgCEYPV.js +1 -0
  14. package/dist/web/assets/{rotate-ccw-ZqeedZLA.js → rotate-ccw-BesidNnx.js} +1 -1
  15. package/dist/web/assets/settings-store-BGF8--S9.js +1 -0
  16. package/dist/web/assets/settings-tab-CP5UZGRD.js +1 -0
  17. package/dist/web/assets/sqlite-viewer-C1MIuoOX.js +16 -0
  18. package/dist/web/assets/tab-store-L0a7ao4c.js +1 -0
  19. package/dist/web/assets/{terminal-tab-DhPMvT7b.js → terminal-tab-CmdZtyZW.js} +1 -1
  20. package/dist/web/assets/{use-monaco-theme-BFv4d2_j.js → use-monaco-theme-RFoGvnp0.js} +2 -2
  21. package/dist/web/index.html +9 -8
  22. package/dist/web/sw.js +1 -1
  23. package/docs/codebase-summary.md +96 -61
  24. package/docs/deployment-guide.md +16 -14
  25. package/docs/design-guidelines.md +5 -2
  26. package/docs/project-overview-pdr.md +20 -17
  27. package/docs/project-roadmap.md +35 -23
  28. package/docs/system-architecture.md +27 -18
  29. package/package.json +4 -1
  30. package/src/cli/commands/init.ts +7 -2
  31. package/src/cli/commands/restart.ts +6 -0
  32. package/src/index.ts +9 -1
  33. package/src/providers/claude-agent-sdk.ts +59 -28
  34. package/src/server/index.ts +10 -2
  35. package/src/server/routes/chat.ts +19 -0
  36. package/src/server/routes/project-scoped.ts +2 -0
  37. package/src/server/routes/sqlite.ts +75 -0
  38. package/src/server/ws/chat.ts +33 -1
  39. package/src/services/config.service.ts +182 -58
  40. package/src/services/db.service.ts +303 -0
  41. package/src/services/push-notification.service.ts +23 -37
  42. package/src/services/session-log.service.ts +12 -24
  43. package/src/services/sqlite.service.ts +145 -0
  44. package/src/web/components/chat/chat-history-bar.tsx +68 -8
  45. package/src/web/components/chat/chat-tab.tsx +10 -1
  46. package/src/web/components/chat/file-picker.tsx +1 -1
  47. package/src/web/components/chat/slash-command-picker.tsx +1 -1
  48. package/src/web/components/editor/code-editor.tsx +8 -0
  49. package/src/web/components/explorer/file-tree.tsx +3 -1
  50. package/src/web/components/layout/draggable-tab.tsx +50 -4
  51. package/src/web/components/layout/editor-panel.tsx +1 -0
  52. package/src/web/components/layout/mobile-nav.tsx +2 -2
  53. package/src/web/components/layout/tab-bar.tsx +16 -1
  54. package/src/web/components/layout/tab-content.tsx +5 -0
  55. package/src/web/components/sqlite/sqlite-data-grid.tsx +166 -0
  56. package/src/web/components/sqlite/sqlite-query-editor.tsx +97 -0
  57. package/src/web/components/sqlite/sqlite-table-list.tsx +48 -0
  58. package/src/web/components/sqlite/sqlite-viewer.tsx +117 -0
  59. package/src/web/components/sqlite/use-sqlite.ts +97 -0
  60. package/src/web/hooks/use-chat.ts +12 -0
  61. package/src/web/stores/tab-store.ts +1 -0
  62. package/dist/web/assets/chat-tab-ClNqZsi6.js +0 -7
  63. package/dist/web/assets/code-editor-kXJmlnIt.js +0 -1
  64. package/dist/web/assets/index-B1ga7VY4.js +0 -21
  65. package/dist/web/assets/index-c5tJni8Z.css +0 -2
  66. package/dist/web/assets/settings-store-DikslxSJ.js +0 -1
  67. package/dist/web/assets/settings-tab-Dt3jaLUC.js +0 -1
  68. package/dist/web/assets/tab-store-BNgVKR5w.js +0 -1
  69. /package/dist/web/assets/{utils-EM9hC5pN.js → utils-C2KxHr1H.js} +0 -0
@@ -0,0 +1 @@
1
+ import{n as e}from"./jsx-runtime-B4BJKQ1u.js";import{t}from"./react-WvgCEYPV.js";import{r as n}from"./utils-C2KxHr1H.js";var r=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);function i(){return`panel-${n()}`}function a(e=[],t=null){return{id:i(),tabs:e,activeTabId:t,tabHistory:t?[t]:[]}}function o(e){return e?1:3}function s(e,t){return e.map(e=>e.filter(e=>e!==t)).filter(e=>e.length>0)}function c(e,t){for(let n=0;n<e.length;n++){let r=e[n].indexOf(t);if(r!==-1)return{row:n,col:r}}return null}var l=`ppm-panels-`,u=`ppm-tabs-`;function d(e){return`${l}${e}`}function f(e,t){try{localStorage.setItem(d(e),JSON.stringify(t))}catch{}}function p(e){try{let t=localStorage.getItem(d(e));if(t)return JSON.parse(t)}catch{}return m(e)}function m(e){try{let t=localStorage.getItem(`${u}${e}`);if(!t)return null;let n=JSON.parse(t);if(!n.tabs?.length)return null;let r=a(n.tabs,n.activeTabId),i={panels:{[r.id]:r},grid:[[r.id]],focusedPanelId:r.id};return f(e,i),localStorage.removeItem(`${u}${e}`),i}catch{return null}}var h=new Set([`git-graph`]),g=new Set([`projects`,`git-status`]);function _(){return`tab-${n()}`}function v(e,t){let n=e.filter(e=>e!==t);return n.push(t),n.length>50&&n.shift(),n}function y(){let e=a();return{panels:{[e.id]:e},grid:[[e.id]],focusedPanelId:e.id}}var b=t()((e,t)=>{function n(){let{currentProject:e,panels:n,grid:r,focusedPanelId:i}=t();if(!e)return;let a=new Set(r.flat()),o={};for(let[e,t]of Object.entries(n))a.has(e)&&(o[e]=t);f(e,{panels:o,grid:r,focusedPanelId:i})}function r(e){return Object.values(t().panels).find(t=>t.tabs.some(t=>t.id===e))}function i(e){return e??t().focusedPanelId}return{...y(),currentProject:null,projectGrids:{},projectFocused:{},switchProject:n=>{let{currentProject:r,panels:i,grid:o,focusedPanelId:s,projectGrids:c,projectFocused:l}=t();if(r===n)return;let u={...c},d={...l};if(r){u[r]=o,d[r]=s;let e=new Set(o.flat()),t={};for(let[n,r]of Object.entries(i))e.has(n)&&(t[n]=r);f(r,{panels:t,grid:o,focusedPanelId:s})}if(u[n]){let t=u[n];e({currentProject:n,grid:t,focusedPanelId:d[n]??t[0]?.[0]??``,projectGrids:u,projectFocused:d});return}let m=p(n);if(m&&Object.keys(m.panels).length>0){let t={};for(let[e,n]of Object.entries(m.panels)){let r=n.tabs.filter(e=>!g.has(e.type)),i=n.tabHistory.filter(e=>r.some(t=>t.id===e)),a=n.activeTabId&&r.some(e=>e.id===n.activeTabId)?n.activeTabId:i[i.length-1]??r[0]?.id??null;t[e]={...n,tabs:r,tabHistory:i,activeTabId:a}}let r={...i,...t};u[n]=m.grid,d[n]=m.focusedPanelId,e({currentProject:n,panels:r,grid:m.grid,focusedPanelId:m.focusedPanelId,projectGrids:u,projectFocused:d})}else{let t=a(),r=[[t.id]],o={...i,[t.id]:t};u[n]=r,d[n]=t.id,f(n,{panels:{[t.id]:t},grid:r,focusedPanelId:t.id}),e({currentProject:n,panels:o,grid:r,focusedPanelId:t.id,projectGrids:u,projectFocused:d})}},setFocusedPanel:n=>{t().panels[n]&&e({focusedPanelId:n})},openTab:(r,a)=>{let o=i(a);if(!t().panels[o])return``;if(h.has(r.type))for(let i of Object.values(t().panels)){let t=i.tabs.find(e=>e.type===r.type&&e.projectId===r.projectId);if(t)return e(e=>({focusedPanelId:i.id,panels:{...e.panels,[i.id]:{...i,activeTabId:t.id,tabHistory:v(i.tabHistory,t.id)}}})),n(),t.id}let s=_(),c={...r,id:s};return e(e=>{let t=e.panels[o];return{focusedPanelId:o,panels:{...e.panels,[o]:{...t,tabs:[...t.tabs,c],activeTabId:s,tabHistory:v(t.tabHistory,s)}}}}),n(),s},closeTab:(i,a)=>{let o=a?t().panels[a]:r(i);if(!o)return;let c=o.id;e(e=>{let t=e.panels[c],n=t.tabs.filter(e=>e.id!==i),r=t.tabHistory.filter(e=>e!==i),a=t.activeTabId;if(t.activeTabId===i){let e=r.length>0?r[r.length-1]:null;a=e&&n.some(t=>t.id===e)?e:n[n.length-1]?.id??null}let o=Object.keys(e.panels);if(n.length===0&&o.length>1){let{[c]:t,...n}=e.panels;return{panels:n,grid:s(e.grid,c),focusedPanelId:e.focusedPanelId===c?Object.keys(n)[0]:e.focusedPanelId}}return{panels:{...e.panels,[c]:{...t,tabs:n,activeTabId:a,tabHistory:r}}}}),n()},setActiveTab:(i,a)=>{let o=a?t().panels[a]:r(i);if(!o)return;let s=o.id;e(e=>{let t=e.panels[s];return{focusedPanelId:s,panels:{...e.panels,[s]:{...t,activeTabId:i,tabHistory:v(t.tabHistory,i)}}}}),n()},updateTab:(t,i)=>{let a=r(t);a&&(e(e=>({panels:{...e.panels,[a.id]:{...a,tabs:a.tabs.map(e=>e.id===t?{...e,...i}:e)}}})),n())},reorderTab:(r,i,a)=>{let o=t().panels[i];if(!o)return;let s=o.tabs.findIndex(e=>e.id===r);if(s===-1||s===a)return;let c=[...o.tabs],[l]=c.splice(s,1);c.splice(a,0,l),e(e=>({panels:{...e.panels,[i]:{...o,tabs:c}}})),n()},moveTab:(r,i,a,o)=>{if(i===a)return;let c=t().panels[i],l=t().panels[a];if(!c||!l)return;let u=c.tabs.find(e=>e.id===r);if(!u)return;let d=c.tabs.filter(e=>e.id!==r),f=c.tabHistory.filter(e=>e!==r),p=c.activeTabId===r?f[f.length-1]??d[d.length-1]?.id??null:c.activeTabId,m=[...l.tabs];o===void 0?m.push(u):m.splice(o,0,u),e(e=>{let t=Object.keys(e.panels);if(d.length===0&&t.length>1){let{[i]:t,...n}=e.panels;return{panels:{...n,[a]:{...l,tabs:m,activeTabId:r,tabHistory:v(l.tabHistory,r)}},grid:s(e.grid,i),focusedPanelId:a}}return{focusedPanelId:a,panels:{...e.panels,[i]:{...c,tabs:d,activeTabId:p,tabHistory:f},[a]:{...l,tabs:m,activeTabId:r,tabHistory:v(l.tabHistory,r)}}}}),n()},splitPanel:(r,i,l,u)=>{let{grid:d,panels:f}=t(),p=t().isMobile(),m=f[l];if(!m)return!1;let h=m.tabs.find(e=>e.id===i);if(!h)return!1;let g=c(d,u??l);if(!g)return!1;let _=r===`left`||r===`right`,v=r===`up`||r===`down`;if(_&&(d[g.row]?.length??0)>=o(p)||v&&d.length>=3)return!1;let y=a([h],h.id);y.tabHistory=[h.id];let b=m.tabs.filter(e=>e.id!==i),x=m.tabHistory.filter(e=>e!==i),S=m.activeTabId===i?x[x.length-1]??b[b.length-1]?.id??null:m.activeTabId,C;if(_)C=d.map((e,t)=>{if(t!==g.row)return e;let n=[...e],i=r===`right`?g.col+1:g.col;return n.splice(i,0,y.id),n});else{C=[...d];let e=r===`down`?g.row+1:g.row;C.splice(e,0,[y.id])}return e(e=>{let t=Object.keys(e.panels),n={...e.panels,[y.id]:y};if(b.length===0&&t.length>1){let{[l]:e,...t}=n;n=t,C=s(C,l)}else n[l]={...m,tabs:b,activeTabId:S,tabHistory:x};return{panels:n,grid:C,focusedPanelId:y.id}}),n(),!0},closePanel:r=>{let{panels:i,grid:a}=t();if(Object.keys(i).length<=1)return;let o=i[r];if(!o)return;c(a,r);let l=a.flat(),u=l.indexOf(r),d=u>0?l[u-1]:l[1],f=i[d];f&&(e(e=>{let{[r]:t,...n}=e.panels,i=[...f.tabs,...o.tabs],a=f.activeTabId??o.activeTabId;return{panels:{...n,[d]:{...f,tabs:i,activeTabId:a,tabHistory:[...f.tabHistory,...o.tabHistory]}},grid:s(e.grid,r),focusedPanelId:d}}),n())},getPanelForTab:e=>r(e),isMobile:()=>typeof window<`u`&&window.innerWidth<768}}),x=t()(()=>({tabs:[],activeTabId:null,tabHistory:[],currentProject:null,switchProject:e=>{b.getState().switchProject(e),S()},openTab:e=>{let t=b.getState().openTab(e);return S(),t},closeTab:e=>{b.getState().closeTab(e),S()},setActiveTab:e=>{b.getState().setActiveTab(e),S()},updateTab:(e,t)=>{b.getState().updateTab(e,t),S()}}));function S(){let e=b.getState(),t=e.panels[e.focusedPanelId];x.setState({tabs:t?.tabs??[],activeTabId:t?.activeTabId??null,tabHistory:t?.tabHistory??[],currentProject:e.currentProject})}b.subscribe(()=>S());export{r as a,o as i,b as n,c as r,x as t};
@@ -1,4 +1,4 @@
1
- import{i as e,r as t,s as n,t as r}from"./jsx-runtime-Bzk8w7Zh.js";import{n as i}from"./settings-store-DikslxSJ.js";import{n as a}from"./utils-EM9hC5pN.js";import{j as o}from"./index-B1ga7VY4.js";var s=t(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]),c=n(e(),1),l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,r)=>{for(var i=r>1?void 0:r?u(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&l(t,n,i),i},p=(e,t)=>(n,r)=>t(n,r,e),m=`Terminal input`,h={get:()=>m,set:e=>m=e},g=`Too much output to announce, navigate to rows manually to read`,_={get:()=>g,set:e=>g=e};function v(e){return e.replace(/\r?\n/g,`\r`)}function ee(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function te(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function ne(e,t,n,r){e.stopPropagation(),e.clipboardData&&re(e.clipboardData.getData(`text/plain`),t,n,r)}function re(e,t,n,r){e=v(e),e=ee(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function ie(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ae(e,t,n,r,i){ie(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function y(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function oe(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var b=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},se=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},x=``,ce=` `,le=class e{constructor(){this.fg=0,this.bg=0,this.extended=new ue}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ue=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},S=class e extends le{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ue,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?y(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},de=`di$target`,C=`di$dependencies`,fe=new Map;function pe(e){return e[C]||[]}function w(e){if(fe.has(e))return fe.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);me(t,e,r)};return t._id=e,fe.set(e,t),t}function me(e,t,n){t[de]===t?t[C].push({id:e,index:n}):(t[C]=[{id:e,index:n}],t[de]=t)}var T=w(`BufferService`),E=w(`CoreMouseService`),he=w(`CoreService`),ge=w(`CharsetService`),_e=w(`InstantiationService`),ve=w(`LogService`),D=w(`OptionsService`),ye=w(`OscLinkService`),be=w(`UnicodeService`),O=w(`DecorationService`),xe=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new S,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+(!l&&t===o-1?1:0),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Se(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};xe=f([p(0,T),p(1,D),p(2,ye)],xe);function Se(e,t){if(confirm(`Do you want to navigate to ${t}?
1
+ import{n as e,o as t,r as n,t as r}from"./jsx-runtime-B4BJKQ1u.js";import{n as i}from"./settings-store-BGF8--S9.js";import{n as a}from"./utils-C2KxHr1H.js";import{N as o}from"./index-l7z-nYoz.js";var s=e(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]),c=t(n(),1),l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,r)=>{for(var i=r>1?void 0:r?u(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&l(t,n,i),i},p=(e,t)=>(n,r)=>t(n,r,e),m=`Terminal input`,h={get:()=>m,set:e=>m=e},g=`Too much output to announce, navigate to rows manually to read`,_={get:()=>g,set:e=>g=e};function v(e){return e.replace(/\r?\n/g,`\r`)}function ee(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function te(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function ne(e,t,n,r){e.stopPropagation(),e.clipboardData&&re(e.clipboardData.getData(`text/plain`),t,n,r)}function re(e,t,n,r){e=v(e),e=ee(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function ie(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ae(e,t,n,r,i){ie(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function y(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function oe(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var b=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},se=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},x=``,ce=` `,le=class e{constructor(){this.fg=0,this.bg=0,this.extended=new ue}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ue=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},S=class e extends le{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ue,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?y(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},de=`di$target`,C=`di$dependencies`,fe=new Map;function pe(e){return e[C]||[]}function w(e){if(fe.has(e))return fe.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);me(t,e,r)};return t._id=e,fe.set(e,t),t}function me(e,t,n){t[de]===t?t[C].push({id:e,index:n}):(t[C]=[{id:e,index:n}],t[de]=t)}var T=w(`BufferService`),E=w(`CoreMouseService`),he=w(`CoreService`),ge=w(`CharsetService`),_e=w(`InstantiationService`),ve=w(`LogService`),D=w(`OptionsService`),ye=w(`OscLinkService`),be=w(`UnicodeService`),O=w(`DecorationService`),xe=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new S,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+(!l&&t===o-1?1:0),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Se(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};xe=f([p(0,T),p(1,D),p(2,ye)],xe);function Se(e,t){if(confirm(`Do you want to navigate to ${t}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Ce=w(`CharSizeService`),we=w(`CoreBrowserService`),Te=w(`MouseService`),Ee=w(`RenderService`),De=w(`SelectionService`),Oe=w(`CharacterJoinerService`),ke=w(`ThemeService`),Ae=w(`LinkProviderService`),je=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Le.isErrorNoTelemetry(e)?new Le(e.message+`
4
4
 
@@ -1,4 +1,4 @@
1
- import{i as e,s as t}from"./jsx-runtime-Bzk8w7Zh.js";import{n}from"./settings-store-DikslxSJ.js";function r(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e){if(Array.isArray(e))return e}function a(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{o as e,r as t}from"./jsx-runtime-B4BJKQ1u.js";import{n}from"./settings-store-BGF8--S9.js";function r(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e){if(Array.isArray(e))return e}function a(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){if(e==null)return{};var n,r,i=d(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function f(e,t){return i(e)||o(e,t)||h(e,t)||s()}function p(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function m(e){var t=p(e,`string`);return typeof t==`symbol`?t:t+``}function h(e,t){if(e){if(typeof e==`string`)return r(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function b(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function x(e){return{}.toString.call(e).includes(`Object`)}function S(e){return!Object.keys(e).length}function C(e){return typeof e==`function`}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function T(e,t){return x(t)||A(`changeType`),Object.keys(t).some(function(t){return!w(e,t)})&&A(`changeField`),t}function E(e){C(e)||A(`selectorType`)}function D(e){C(e)||x(e)||A(`handlerType`),x(e)&&Object.values(e).some(function(e){return!C(e)})&&A(`handlersType`)}function O(e){e||A(`initialIsRequired`),x(e)||A(`initialType`),S(e)&&A(`initialContent`)}function k(e,t){throw Error(e[t]||e.default)}var A=b(k)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),j={changes:T,selector:E,handler:D,initial:O};function ee(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j.initial(e),j.handler(t);var n={current:e},r=b(P)(n,t),i=b(N)(n),a=b(j.changes)(e),o=b(M)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return j.selector(e),e(n.current)}function c(e){y(r,i,a,o)(e)}return[s,c]}function M(e,t){return C(t)?t(e.current):t}function N(e,t){return e.current=v(v({},e.current),t),t}function P(e,t,n){return C(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var F={create:ee},te={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function ne(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function re(e){return{}.toString.call(e).includes(`Object`)}function ie(e){return e||L(`configIsRequired`),re(e)||L(`configType`),e.urls?(ae(),{paths:{vs:e.urls.monacoBase}}):e}function ae(){console.warn(I.deprecation)}function oe(e,t){throw Error(e[t]||e.default)}var I={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
3
  You are using deprecated way of configuration.
4
4
 
@@ -8,4 +8,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8
8
  monaco.config({ paths: { vs: '...' } })
9
9
 
10
10
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
11
- `},L=ne(oe)(I),se={config:ie},ce=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function R(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],R(e[n],t[n]))}),l(l({},e),t)}var le={type:`cancelation`,msg:`operation is manually canceled`};function z(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(le):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var ue=[`monaco`],B=f(F.create({config:te,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),V=B[0],H=B[1];function de(e){var t=se.config(e),n=t.monaco,r=u(t,ue);H(function(e){return{config:R(e.config,r),monaco:n}})}function fe(){var e=V(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(H({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),z(W);if(window.monaco&&window.monaco.editor)return U(window.monaco),e.resolve(window.monaco),z(W);ce(pe,he)(ge)}return z(W)}function pe(e){return document.body.appendChild(e)}function me(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function he(e){var t=V(function(e){return{config:e.config,reject:e.reject}}),n=me(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function ge(){var e=V(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;U(n),e.resolve(n)},function(t){e.reject(t)})}function U(e){V().monaco||H({monaco:e})}function _e(){return V(function(e){return e.monaco})}var W=new Promise(function(e,t){return H({resolve:e,reject:t})}),G={config:de,init:fe,__getMonacoInstance:_e},K=t(e(),1),q={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},ve={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function ye({children:e}){return K.createElement(`div`,{style:ve.container},e)}var be=ye;function xe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return K.createElement(`section`,{style:{...q.wrapper,width:e,height:t},...o},!n&&K.createElement(be,null,r),K.createElement(`div`,{ref:i,style:{...q.fullWidth,...!n&&q.hide},className:a}))}var J=(0,K.memo)(xe);function Se(e){(0,K.useEffect)(e,[])}var Y=Se;function Ce(e,t,n=!0){let r=(0,K.useRef)(!0);(0,K.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var X=Ce;function Z(){}function Q(e,t,n,r){return we(e,r)||Te(e,t,n,r)}function we(e,t){return e.editor.getModel(Ee(e,t))}function Te(e,t,n,r){return e.editor.createModel(t,n,r?Ee(e,r):void 0)}function Ee(e,t){return e.Uri.parse(t)}function De({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:f=`100%`,width:p=`100%`,className:m,wrapperProps:h={},beforeMount:g=Z,onMount:_=Z}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useRef)(null),C=(0,K.useRef)(null),w=(0,K.useRef)(null),T=(0,K.useRef)(_),E=(0,K.useRef)(g),D=(0,K.useRef)(!1);Y(()=>{let e=G.init();return e.then(e=>(C.current=e)&&x(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>S.current?A():e.cancel()}),X(()=>{if(S.current&&C.current){let t=S.current.getOriginalEditor(),i=Q(C.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),X(()=>{if(S.current&&C.current){let e=S.current.getModifiedEditor(),r=Q(C.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),X(()=>{let e=S.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),X(()=>{S.current?.getModel()?.original.setValue(e||``)},[e],v),X(()=>{let{original:e,modified:t}=S.current.getModel();C.current.editor.setModelLanguage(e,r||n||`text`),C.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),X(()=>{C.current?.editor.setTheme(l)},[l],v),X(()=>{S.current?.updateOptions(d)},[d],v);let O=(0,K.useCallback)(()=>{if(!C.current)return;E.current(C.current);let s=Q(C.current,e||``,r||n||`text`,a||``),c=Q(C.current,t||``,i||n||`text`,o||``);S.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),k=(0,K.useCallback)(()=>{!D.current&&w.current&&(S.current=C.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...d}),O(),C.current?.editor.setTheme(l),y(!0),D.current=!0)},[d,l,O]);(0,K.useEffect)(()=>{v&&T.current(S.current,C.current)},[v]),(0,K.useEffect)(()=>{!b&&!v&&k()},[b,v,k]);function A(){let e=S.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}return K.createElement(J,{width:p,height:f,isEditorReady:v,loading:u,_ref:w,className:m,wrapperProps:h})}var Oe=(0,K.memo)(De);function ke(e){let t=(0,K.useRef)();return(0,K.useEffect)(()=>{t.current=e},[e]),t.current}var Ae=ke,$=new Map;function je({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p=`100%`,height:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=Z,onMount:v=Z,onChange:y,onValidate:b=Z}){let[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!0),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D=(0,K.useRef)(null),O=(0,K.useRef)(v),k=(0,K.useRef)(_),A=(0,K.useRef)(),j=(0,K.useRef)(r),ee=Ae(a),M=(0,K.useRef)(!1),N=(0,K.useRef)(!1);Y(()=>{let e=G.init();return e.then(e=>(T.current=e)&&w(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>E.current?F():e.cancel()}),X(()=>{let o=Q(T.current,e||r||``,t||i||``,a||n||``);o!==E.current?.getModel()&&(d&&$.set(ee,E.current?.saveViewState()),E.current?.setModel(o),d&&E.current?.restoreViewState($.get(a)))},[a],x),X(()=>{E.current?.updateOptions(l)},[l],x),X(()=>{!E.current||r===void 0||(E.current.getOption(T.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(N.current=!0,E.current.executeEdits(``,[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),N.current=!1))},[r],x),X(()=>{let e=E.current?.getModel();e&&i&&T.current?.editor.setModelLanguage(e,i)},[i],x),X(()=>{s!==void 0&&E.current?.revealLine(s)},[s],x),X(()=>{T.current?.editor.setTheme(o)},[o],x);let P=(0,K.useCallback)(()=>{if(!(!D.current||!T.current)&&!M.current){k.current(T.current);let c=a||n,f=Q(T.current,r||e||``,t||i||``,c||``);E.current=T.current?.editor.create(D.current,{model:f,automaticLayout:!0,...l},u),d&&E.current.restoreViewState($.get(c)),T.current.editor.setTheme(o),s!==void 0&&E.current.revealLine(s),S(!0),M.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,K.useEffect)(()=>{x&&O.current(E.current,T.current)},[x]),(0,K.useEffect)(()=>{!C&&!x&&P()},[C,x,P]),j.current=r,(0,K.useEffect)(()=>{x&&y&&(A.current?.dispose(),A.current=E.current?.onDidChangeModelContent(e=>{N.current||y(E.current.getValue(),e)}))},[x,y]),(0,K.useEffect)(()=>{if(x){let e=T.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,b]);function F(){A.current?.dispose(),f?d&&$.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return K.createElement(J,{width:p,height:m,isEditorReady:x,loading:c,_ref:D,className:h,wrapperProps:g})}var Me=(0,K.memo)(je);function Ne(){let e=n(e=>e.theme),t=()=>e===`dark`?`vs-dark`:e===`light`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`vs-dark`:`light`,[r,i]=(0,K.useState)(t);return(0,K.useEffect)(()=>{if(i(t()),e===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>i(e.matches?`vs-dark`:`light`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e]),r}export{Me as n,Oe as r,Ne as t};
11
+ `},L=ne(oe)(I),se={config:ie},ce=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function R(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],R(e[n],t[n]))}),l(l({},e),t)}var le={type:`cancelation`,msg:`operation is manually canceled`};function z(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(le):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var ue=[`monaco`],B=f(F.create({config:te,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),V=B[0],H=B[1];function de(e){var t=se.config(e),n=t.monaco,r=u(t,ue);H(function(e){return{config:R(e.config,r),monaco:n}})}function fe(){var e=V(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(H({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),z(W);if(window.monaco&&window.monaco.editor)return U(window.monaco),e.resolve(window.monaco),z(W);ce(pe,he)(ge)}return z(W)}function pe(e){return document.body.appendChild(e)}function me(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function he(e){var t=V(function(e){return{config:e.config,reject:e.reject}}),n=me(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function ge(){var e=V(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;U(n),e.resolve(n)},function(t){e.reject(t)})}function U(e){V().monaco||H({monaco:e})}function _e(){return V(function(e){return e.monaco})}var W=new Promise(function(e,t){return H({resolve:e,reject:t})}),G={config:de,init:fe,__getMonacoInstance:_e},K=e(t(),1),q={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},ve={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function ye({children:e}){return K.createElement(`div`,{style:ve.container},e)}var be=ye;function xe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return K.createElement(`section`,{style:{...q.wrapper,width:e,height:t},...o},!n&&K.createElement(be,null,r),K.createElement(`div`,{ref:i,style:{...q.fullWidth,...!n&&q.hide},className:a}))}var J=(0,K.memo)(xe);function Se(e){(0,K.useEffect)(e,[])}var Y=Se;function Ce(e,t,n=!0){let r=(0,K.useRef)(!0);(0,K.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var X=Ce;function Z(){}function Q(e,t,n,r){return we(e,r)||Te(e,t,n,r)}function we(e,t){return e.editor.getModel(Ee(e,t))}function Te(e,t,n,r){return e.editor.createModel(t,n,r?Ee(e,r):void 0)}function Ee(e,t){return e.Uri.parse(t)}function De({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:f=`100%`,width:p=`100%`,className:m,wrapperProps:h={},beforeMount:g=Z,onMount:_=Z}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useRef)(null),C=(0,K.useRef)(null),w=(0,K.useRef)(null),T=(0,K.useRef)(_),E=(0,K.useRef)(g),D=(0,K.useRef)(!1);Y(()=>{let e=G.init();return e.then(e=>(C.current=e)&&x(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>S.current?A():e.cancel()}),X(()=>{if(S.current&&C.current){let t=S.current.getOriginalEditor(),i=Q(C.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),X(()=>{if(S.current&&C.current){let e=S.current.getModifiedEditor(),r=Q(C.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),X(()=>{let e=S.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),X(()=>{S.current?.getModel()?.original.setValue(e||``)},[e],v),X(()=>{let{original:e,modified:t}=S.current.getModel();C.current.editor.setModelLanguage(e,r||n||`text`),C.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),X(()=>{C.current?.editor.setTheme(l)},[l],v),X(()=>{S.current?.updateOptions(d)},[d],v);let O=(0,K.useCallback)(()=>{if(!C.current)return;E.current(C.current);let s=Q(C.current,e||``,r||n||`text`,a||``),c=Q(C.current,t||``,i||n||`text`,o||``);S.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),k=(0,K.useCallback)(()=>{!D.current&&w.current&&(S.current=C.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...d}),O(),C.current?.editor.setTheme(l),y(!0),D.current=!0)},[d,l,O]);(0,K.useEffect)(()=>{v&&T.current(S.current,C.current)},[v]),(0,K.useEffect)(()=>{!b&&!v&&k()},[b,v,k]);function A(){let e=S.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}return K.createElement(J,{width:p,height:f,isEditorReady:v,loading:u,_ref:w,className:m,wrapperProps:h})}var Oe=(0,K.memo)(De);function ke(e){let t=(0,K.useRef)();return(0,K.useEffect)(()=>{t.current=e},[e]),t.current}var Ae=ke,$=new Map;function je({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p=`100%`,height:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=Z,onMount:v=Z,onChange:y,onValidate:b=Z}){let[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!0),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D=(0,K.useRef)(null),O=(0,K.useRef)(v),k=(0,K.useRef)(_),A=(0,K.useRef)(),j=(0,K.useRef)(r),ee=Ae(a),M=(0,K.useRef)(!1),N=(0,K.useRef)(!1);Y(()=>{let e=G.init();return e.then(e=>(T.current=e)&&w(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>E.current?F():e.cancel()}),X(()=>{let o=Q(T.current,e||r||``,t||i||``,a||n||``);o!==E.current?.getModel()&&(d&&$.set(ee,E.current?.saveViewState()),E.current?.setModel(o),d&&E.current?.restoreViewState($.get(a)))},[a],x),X(()=>{E.current?.updateOptions(l)},[l],x),X(()=>{!E.current||r===void 0||(E.current.getOption(T.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(N.current=!0,E.current.executeEdits(``,[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),N.current=!1))},[r],x),X(()=>{let e=E.current?.getModel();e&&i&&T.current?.editor.setModelLanguage(e,i)},[i],x),X(()=>{s!==void 0&&E.current?.revealLine(s)},[s],x),X(()=>{T.current?.editor.setTheme(o)},[o],x);let P=(0,K.useCallback)(()=>{if(!(!D.current||!T.current)&&!M.current){k.current(T.current);let c=a||n,f=Q(T.current,r||e||``,t||i||``,c||``);E.current=T.current?.editor.create(D.current,{model:f,automaticLayout:!0,...l},u),d&&E.current.restoreViewState($.get(c)),T.current.editor.setTheme(o),s!==void 0&&E.current.revealLine(s),S(!0),M.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,K.useEffect)(()=>{x&&O.current(E.current,T.current)},[x]),(0,K.useEffect)(()=>{!C&&!x&&P()},[C,x,P]),j.current=r,(0,K.useEffect)(()=>{x&&y&&(A.current?.dispose(),A.current=E.current?.onDidChangeModelContent(e=>{N.current||y(E.current.getValue(),e)}))},[x,y]),(0,K.useEffect)(()=>{if(x){let e=T.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,b]);function F(){A.current?.dispose(),f?d&&$.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return K.createElement(J,{width:p,height:m,isEditorReady:x,loading:c,_ref:D,className:h,wrapperProps:g})}var Me=(0,K.memo)(je);function Ne(){let e=n(e=>e.theme),t=()=>e===`dark`?`vs-dark`:e===`light`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`vs-dark`:`light`,[r,i]=(0,K.useState)(t);return(0,K.useEffect)(()=>{if(i(t()),e===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>i(e.matches?`vs-dark`:`light`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e]),r}export{Me as n,Oe as r,Ne as t};
@@ -38,14 +38,15 @@
38
38
  <link rel="preconnect" href="https://fonts.googleapis.com" />
39
39
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
40
40
  <link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&family=Geist:wght@400;500;600;700&display=swap" rel="stylesheet" />
41
- <script type="module" crossorigin src="/assets/index-B1ga7VY4.js"></script>
42
- <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-Bzk8w7Zh.js">
43
- <link rel="modulepreload" crossorigin href="/assets/utils-EM9hC5pN.js">
44
- <link rel="modulepreload" crossorigin href="/assets/input-Bzyi1GeB.js">
45
- <link rel="modulepreload" crossorigin href="/assets/tab-store-BNgVKR5w.js">
46
- <link rel="modulepreload" crossorigin href="/assets/api-client-BxCvlogn.js">
47
- <link rel="modulepreload" crossorigin href="/assets/settings-store-DikslxSJ.js">
48
- <link rel="stylesheet" crossorigin href="/assets/index-c5tJni8Z.css">
41
+ <script type="module" crossorigin src="/assets/index-l7z-nYoz.js"></script>
42
+ <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-B4BJKQ1u.js">
43
+ <link rel="modulepreload" crossorigin href="/assets/utils-C2KxHr1H.js">
44
+ <link rel="modulepreload" crossorigin href="/assets/input-DV4tynJq.js">
45
+ <link rel="modulepreload" crossorigin href="/assets/react-WvgCEYPV.js">
46
+ <link rel="modulepreload" crossorigin href="/assets/tab-store-L0a7ao4c.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/api-client-ANLU-Irq.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/settings-store-BGF8--S9.js">
49
+ <link rel="stylesheet" crossorigin href="/assets/index-CP_2zE5O.css">
49
50
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
50
51
  <body class="bg-[#0f1419] text-[#e5e7eb] font-sans antialiased">
51
52
  <div id="root"></div>
package/dist/web/sw.js CHANGED
@@ -1 +1 @@
1
- try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}function B(e){O().precache(e)}function V(e,t){B(e),z(t)}V([{"revision":"1872c500de691dce40960bb85481de07","url":"registerSW.js"},{"revision":"6f1c6a81228da2e54aa445bd60c22d8c","url":"index.html"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"eb9818b9094675c0c5d303168f273345","url":"monacoeditorwork/ts.worker.bundle.js"},{"revision":"9af0be92dcefdc1f1290441cb5ff5d9b","url":"monacoeditorwork/json.worker.bundle.js"},{"revision":"a261b429c39dbb75ae97972d7d005e6d","url":"monacoeditorwork/html.worker.bundle.js"},{"revision":"79953d804e1bbacecfd79b85fd679016","url":"monacoeditorwork/editor.worker.bundle.js"},{"revision":"fdcba0d09aac31df7a0bc652f6e739bd","url":"monacoeditorwork/css.worker.bundle.js"},{"revision":null,"url":"assets/utils-EM9hC5pN.js"},{"revision":null,"url":"assets/use-monaco-theme-BFv4d2_j.js"},{"revision":null,"url":"assets/terminal-tab-DhPMvT7b.js"},{"revision":null,"url":"assets/terminal-tab-BrP-ENHg.css"},{"revision":null,"url":"assets/tab-store-BNgVKR5w.js"},{"revision":null,"url":"assets/settings-tab-Dt3jaLUC.js"},{"revision":null,"url":"assets/settings-store-DikslxSJ.js"},{"revision":null,"url":"assets/rotate-ccw-ZqeedZLA.js"},{"revision":null,"url":"assets/markdown-renderer-DhYu0Drk.js"},{"revision":null,"url":"assets/jsx-runtime-Bzk8w7Zh.js"},{"revision":null,"url":"assets/input-Bzyi1GeB.js"},{"revision":null,"url":"assets/index-c5tJni8Z.css"},{"revision":null,"url":"assets/index-B1ga7VY4.js"},{"revision":null,"url":"assets/git-graph-HUZNEwuR.js"},{"revision":null,"url":"assets/diff-viewer-CwMGJLkZ.js"},{"revision":null,"url":"assets/code-editor-kXJmlnIt.js"},{"revision":null,"url":"assets/chat-tab-ClNqZsi6.js"},{"revision":null,"url":"assets/api-client-BxCvlogn.js"},{"revision":"79c8870653c8f419f2e3323085e1f4be","url":"manifest.webmanifest"}]),self.addEventListener(`push`,e=>{e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{if(t.some(e=>e.visibilityState===`visible`))return;let n=e.data?.json()??{title:`PPM`,body:`Chat completed`};return self.registration.showNotification(n.title,{body:n.body,icon:`/icon-192.png`,badge:`/icon-192.png`,tag:`ppm-chat-done`,silent:!1,data:{url:self.location.origin}})}))}),self.addEventListener(`notificationclick`,e=>{e.notification.close(),e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{for(let e of t)if(e.url.includes(self.location.origin)&&`focus`in e)return e.focus();return self.clients.openWindow(e.notification.data?.url||`/`)}))});
1
+ try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}function B(e){O().precache(e)}function V(e,t){B(e),z(t)}V([{"revision":"1872c500de691dce40960bb85481de07","url":"registerSW.js"},{"revision":"a539d645996c9217e052befe7cdb6b66","url":"index.html"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"eb9818b9094675c0c5d303168f273345","url":"monacoeditorwork/ts.worker.bundle.js"},{"revision":"9af0be92dcefdc1f1290441cb5ff5d9b","url":"monacoeditorwork/json.worker.bundle.js"},{"revision":"a261b429c39dbb75ae97972d7d005e6d","url":"monacoeditorwork/html.worker.bundle.js"},{"revision":"79953d804e1bbacecfd79b85fd679016","url":"monacoeditorwork/editor.worker.bundle.js"},{"revision":"fdcba0d09aac31df7a0bc652f6e739bd","url":"monacoeditorwork/css.worker.bundle.js"},{"revision":null,"url":"assets/utils-C2KxHr1H.js"},{"revision":null,"url":"assets/use-monaco-theme-RFoGvnp0.js"},{"revision":null,"url":"assets/terminal-tab-CmdZtyZW.js"},{"revision":null,"url":"assets/terminal-tab-BrP-ENHg.css"},{"revision":null,"url":"assets/tab-store-L0a7ao4c.js"},{"revision":null,"url":"assets/sqlite-viewer-C1MIuoOX.js"},{"revision":null,"url":"assets/settings-tab-CP5UZGRD.js"},{"revision":null,"url":"assets/settings-store-BGF8--S9.js"},{"revision":null,"url":"assets/rotate-ccw-BesidNnx.js"},{"revision":null,"url":"assets/react-WvgCEYPV.js"},{"revision":null,"url":"assets/markdown-renderer-BKfKwtec.js"},{"revision":null,"url":"assets/jsx-runtime-B4BJKQ1u.js"},{"revision":null,"url":"assets/input-DV4tynJq.js"},{"revision":null,"url":"assets/index-l7z-nYoz.js"},{"revision":null,"url":"assets/index-CP_2zE5O.css"},{"revision":null,"url":"assets/git-graph-zmdDLInW.js"},{"revision":null,"url":"assets/diff-viewer-D_bM4Kmw.js"},{"revision":null,"url":"assets/code-editor-CCvD-8SS.js"},{"revision":null,"url":"assets/chat-tab-CjKO_uYf.js"},{"revision":null,"url":"assets/api-client-ANLU-Irq.js"},{"revision":"79c8870653c8f419f2e3323085e1f4be","url":"manifest.webmanifest"}]),self.addEventListener(`push`,e=>{e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{if(t.some(e=>e.visibilityState===`visible`))return;let n=e.data?.json()??{title:`PPM`,body:`Chat completed`};return self.registration.showNotification(n.title,{body:n.body,icon:`/icon-192.png`,badge:`/icon-192.png`,tag:`ppm-chat-done`,silent:!1,data:{url:self.location.origin}})}))}),self.addEventListener(`notificationclick`,e=>{e.notification.close(),e.waitUntil(self.clients.matchAll({type:`window`,includeUncontrolled:!0}).then(t=>{for(let e of t)if(e.url.includes(self.location.origin)&&`focus`in e)return e.focus();return self.clients.openWindow(e.notification.data?.url||`/`)}))});
@@ -1,6 +1,6 @@
1
1
  # PPM Codebase Summary
2
2
 
3
- Generated from repomix analysis of 96 TypeScript files, 14K LOC, 194K tokens.
3
+ Generated from codebase analysis of 133 TypeScript files, ~22K LOC.
4
4
 
5
5
  ## Directory Structure
6
6
 
@@ -9,12 +9,16 @@ ppm/
9
9
  ├── src/
10
10
  │ ├── index.ts # CLI entry point (Commander.js program)
11
11
  │ ├── cli/
12
- │ │ ├── commands/ # CLI command implementations (8 files, 907 LOC)
12
+ │ │ ├── commands/ # CLI command implementations (13 files, 1541 LOC)
13
13
  │ │ │ ├── start.ts # Start server (background by default, --foreground/-f, --share/-s for tunnel)
14
14
  │ │ │ ├── stop.ts # Stop daemon (reads status.json or ppm.pid, graceful shutdown)
15
+ │ │ │ ├── restart.ts # Restart daemon (keeps tunnel alive)
16
+ │ │ │ ├── status.ts # Show daemon status
15
17
  │ │ │ ├── open.ts # Open browser to http://localhost:PORT
16
- │ │ │ ├── init.ts # Initialize ppm.yaml config (scan git repos)
17
- │ │ │ ├── projects.ts # Add/remove/list projects
18
+ │ │ │ ├── logs.ts # Tail daemon logs
19
+ │ │ │ ├── report.ts # File bug report on GitHub
20
+ │ │ │ ├── init.ts # Initialize config (scan git repos, DB profile support)
21
+ │ │ │ ├── projects.ts # Add/remove/list/scan projects
18
22
  │ │ │ ├── config-cmd.ts # View/set config values
19
23
  │ │ │ ├── git-cmd.ts # Git operations (status, diff, log, commit)
20
24
  │ │ │ └── chat-cmd.ts # Chat CLI (send messages, manage sessions)
@@ -37,24 +41,27 @@ ppm/
37
41
  │ │ └── ws/
38
42
  │ │ ├── chat.ts # WebSocket chat streaming (220 LOC)
39
43
  │ │ └── terminal.ts # WebSocket terminal I/O (terminal.service.ts integration)
40
- │ ├── providers/ # AI Provider adapters (3 files, 574 LOC)
44
+ │ ├── providers/ # AI Provider adapters (4 files, 1190 LOC)
41
45
  │ │ ├── provider.interface.ts # AIProvider interface (createSession, sendMessage, onToolApproval)
42
- │ │ ├── claude-agent-sdk.ts # Primary: @anthropic-ai/claude-agent-sdk. Reads config from configService.
46
+ │ │ ├── claude-agent-sdk.ts # Primary: SDK integration, tool approval, Windows CLI fallback, .env poisoning mitigation
43
47
  │ │ ├── mock-provider.ts # Test provider (ignores config)
44
48
  │ │ └── registry.ts # ProviderRegistry (singleton, router to active provider)
45
- │ ├── services/ # Business logic (11 files, 1761 LOC)
46
- │ │ ├── chat.service.ts # Session lifecycle, message streaming, streaming to clients
47
- │ │ ├── git.service.ts # Git operations (372 LOC): status, diff, log, graph, branches
48
- │ │ ├── file.service.ts # File ops (261 LOC): tree, read, write, delete, mkdir, path validation
49
- │ │ ├── project.service.ts # YAML project registry (108 LOC)
50
- │ │ ├── terminal.service.ts # PTY management (200+ LOC), Bun.spawn native shell
51
- │ │ ├── config.service.ts # YAML config loading (91 LOC)
49
+ │ ├── services/ # Business logic (14 files, 2502 LOC)
50
+ │ │ ├── chat.service.ts # Session lifecycle, message streaming
51
+ │ │ ├── config.service.ts # Config loading (YAML→SQLite migration)
52
+ │ │ ├── db.service.ts # SQLite persistence (schema v1, WAL mode, 6 tables)
53
+ │ │ ├── project.service.ts # Project CRUD, scanning, resolution
54
+ │ │ ├── file.service.ts # File ops with path validation
55
+ │ │ ├── git.service.ts # Git operations (status, diff, log, graph)
56
+ │ │ ├── terminal.service.ts # PTY management, Bun.spawn native shell
57
+ │ │ ├── claude-usage.service.ts # Token tracking, cost calculation
58
+ │ │ ├── push-notification.service.ts # Web push subscriptions
59
+ │ │ ├── session-log.service.ts # Session audit logs with redaction
52
60
  │ │ ├── slash-items.service.ts # /slash command detection & completion
53
- │ │ ├── claude-usage.service.ts # Token usage via ccburn library
54
61
  │ │ ├── git-dirs.service.ts # Cached git directory discovery
55
- │ │ ├── cloudflared.service.ts # Download cloudflared binary from GitHub (platform-specific)
56
- │ │ └── tunnel.service.ts # Cloudflare Quick Tunnel lifecycle (spawn, capture URL, cleanup)
57
- │ ├── types/ # TypeScript interfaces (6 files, 258 LOC)
62
+ │ │ ├── cloudflared.service.ts # Download cloudflared binary (platform-specific)
63
+ │ │ └── tunnel.service.ts # Cloudflare Quick Tunnel lifecycle
64
+ │ ├── types/ # TypeScript interfaces (6 files, 357 LOC)
58
65
  │ │ ├── api.ts # ApiResponse envelope, WebSocket message types
59
66
  │ │ ├── chat.ts # Session, Message, ChatEvent types
60
67
  │ │ ├── config.ts # Config schema
@@ -64,36 +71,49 @@ ppm/
64
71
  │ └── web/ # React frontend (Vite)
65
72
  │ ├── main.tsx # React mount (<App> into #root)
66
73
  │ ├── app.tsx # Root component (auth check, project load, theme)
67
- │ ├── stores/ # Zustand state stores (4 files, 383 LOC)
68
- │ │ ├── project-store.ts # Active project, projects list
69
- │ │ ├── tab-store.ts # Open tabs (chat, editor, git, terminal)
70
- │ │ ├── file-store.ts # Open files, selections
71
- │ │ └── settings-store.ts # Theme, auth token
72
- │ ├── hooks/ # Custom React hooks (4 files, 716 LOC)
73
- │ │ ├── use-chat.ts # Chat streaming, WebSocket, message history (420 LOC)
74
- ├── use-websocket.ts # Generic WebSocket adapter
75
- │ │ ├── use-terminal.ts # Terminal I/O over WebSocket
76
- │ │ └── use-url-sync.ts # Sync state to URL (project, tab, file selections)
77
- │ ├── lib/ # Utilities (7 files, 340 LOC)
78
- │ │ ├── api-client.ts # Fetch wrapper with auth token
74
+ │ ├── stores/ # Zustand state stores (6 files)
75
+ │ │ ├── project-store.ts # Active project, projects list, localStorage persistence
76
+ │ │ ├── tab-store.ts # Tab facade, delegates to panel-store
77
+ │ │ ├── panel-store.ts # Grid layout, panel creation/movement, keep-alive snapshots
78
+ │ │ ├── panel-utils.ts # Layout algorithm helpers, grid manipulation
79
+ ├── file-store.ts # File cache
80
+ │ │ └── settings-store.ts # Theme, sidebar state, git view mode, device name
81
+ │ ├── hooks/ # Custom React hooks (9 files)
82
+ │ │ ├── use-chat.ts # Chat streaming, messages, approvals, context window tracking
83
+ │ │ ├── use-websocket.ts # WebSocket connection with auto-reconnect
84
+ ├── use-terminal.ts # Terminal connection and streaming
85
+ │ │ ├── use-url-sync.ts # Sync browser URL with active project/tab state
86
+ │ │ ├── use-tab-drag.ts # Tab drag-and-drop logic
87
+ │ │ ├── use-global-keybindings.ts # Global shortcuts (Shift+Shift palette, Alt+[/] tab cycling)
88
+ │ │ ├── use-health-check.ts # Detect server crashes/restarts via health endpoint
89
+ │ │ ├── use-usage.ts # Fetch token usage from backend
90
+ │ │ └── use-push-notification.ts # Web push notifications via Service Worker
91
+ │ ├── lib/ # Utilities (10 files)
92
+ │ │ ├── api-client.ts # Fetch wrapper with auth token, envelope unwrapping
79
93
  │ │ ├── api-settings.ts # AI settings API client (GET/PUT /api/settings/ai)
80
- │ │ ├── ws-client.ts # WebSocket wrapper
81
- │ │ ├── file-support.ts # File type detection (language -> icon)
82
- │ │ ├── project-avatar.ts # Smart project initials (collision resolution) (v2.0+)
83
- │ │ ├── project-palette.ts # 12-color palette for project avatars (v2.0+)
84
- │ │ └── utils.ts # Utility functions (clsx, classname merging)
94
+ │ │ ├── ws-client.ts # WebSocket with exponential backoff + Cloudflare handshake
95
+ │ │ ├── file-support.ts # File type detection (language, icons, preview)
96
+ │ │ ├── project-avatar.ts # Smart project initials (collision resolution)
97
+ │ │ ├── project-palette.ts # 12-color palette for project avatars
98
+ │ │ ├── use-monaco-theme.ts # Sync Monaco Editor theme with app theme
99
+ │ │ └── utils.ts # Helpers (cn, randomId, basename, etc.)
85
100
  │ ├── styles/
86
101
  │ │ └── globals.css # Tailwind directives, custom CSS
87
102
  │ └── components/ # React components (organized by feature)
88
103
  │ ├── auth/ # Login screen (88 LOC)
89
- │ ├── chat/ # Chat UI (2300+ LOC, 10 files)
90
- │ │ ├── chat-tab.tsx # Main chat interface
91
- │ │ ├── chat-history-panel.tsx # History tab showing chat sessions (v2.0+)
92
- │ │ ├── message-list.tsx # Scrollable messages with tool display
93
- │ │ ├── message-input.tsx # Input with file attach, slash command picker
94
- │ │ ├── session-picker.tsx # Switch between sessions
104
+ │ ├── chat/ # Chat UI (12 files)
105
+ │ │ ├── chat-tab.tsx # Main chat container, session picker, streaming
106
+ │ │ ├── chat-history-bar.tsx # Session history sidebar, inline rename
107
+ │ │ ├── chat-history-panel.tsx # Full session list modal
108
+ │ │ ├── message-list.tsx # Scrolling message view with tool results
109
+ │ │ ├── message-input.tsx # Textarea with attachments, @ slash commands
110
+ │ │ ├── session-picker.tsx # Dropdown to select/create session
111
+ │ │ ├── file-picker.tsx # Filterable file tree picker
112
+ │ │ ├── slash-command-picker.tsx # Command palette for / prefix
113
+ │ │ ├── tool-cards.tsx # Render SDK tool results/approvals
95
114
  │ │ ├── usage-badge.tsx # Token usage display
96
- │ │ └── ... 4 more
115
+ │ │ ├── attachment-chips.tsx # Display attached files
116
+ │ │ └── chat-placeholder.tsx # Empty state
97
117
  │ ├── editor/ # Code editor (650+ LOC, 3 files)
98
118
  │ │ ├── code-editor.tsx # Monaco Editor integration (@monaco-editor/react, v2.0+)
99
119
  │ │ ├── diff-viewer.tsx # Monaco diff viewer for git diffs (v2.0+)
@@ -105,26 +125,36 @@ ppm/
105
125
  │ │ ├── git-status-panel.tsx # Status, staging UI
106
126
  │ │ ├── git-graph.tsx # Mermaid-based commit graph
107
127
  │ │ └── git-placeholder.tsx
108
- │ ├── layout/ # Layout components (750+ LOC, 7 files)
109
- │ │ ├── project-bar.tsx # Narrow 52px sidebar with project avatars, context menus
110
- │ │ ├── project-bottom-sheet.tsx # Mobile project switcher (bottom sheet)
111
- │ │ ├── sidebar.tsx # Left sidebar (Explorer/Git/History tabs, file tree)
112
- │ │ ├── tab-bar.tsx # Top tab bar (chat, editor, git, terminal)
113
- │ │ ├── tab-content.tsx # Router for tab content
114
- │ │ ├── mobile-nav.tsx # Mobile hamburger navigation
115
- │ │ └── mobile-drawer.tsx # Offcanvas drawer
128
+ │ ├── layout/ # Layout components (13 files)
129
+ │ │ ├── panel-layout.tsx # Main grid layout (react-resizable-panels)
130
+ │ │ ├── editor-panel.tsx # Wrapper for tab content within a panel
131
+ │ │ ├── project-bar.tsx # 52px sidebar with project avatars, share popover
132
+ │ │ ├── project-bottom-sheet.tsx # Mobile project switcher
133
+ │ │ ├── sidebar.tsx # Left sidebar (Explorer/Git/Settings tabs)
134
+ │ │ ├── tab-bar.tsx # Tab bar with icons
135
+ │ │ ├── draggable-tab.tsx # Draggable tab with context menu, rename
136
+ │ │ ├── tab-content.tsx # Router for tab content
137
+ │ │ ├── split-drop-overlay.tsx # Drop zone for tab splitting
138
+ │ │ ├── command-palette.tsx # Global command palette (Shift+Shift)
139
+ │ │ ├── add-project-form.tsx # Modal form to add projects
140
+ │ │ ├── mobile-nav.tsx # Bottom navigation for mobile
141
+ │ │ └── mobile-drawer.tsx # Mobile overlay drawer
116
142
  │ ├── projects/ # Project management (339 LOC, 2 files)
117
143
  │ ├── settings/ # Settings panel (theme + AI provider config UI)
118
144
  │ ├── terminal/ # xterm.js wrapper (143 LOC, 2 files)
119
- └── ui/ # Radix + shadcn primitives (1018 LOC, 10 files)
120
- └── button.tsx, dialog.tsx, dropdown-menu.tsx, ... (base components)
145
+ ├── shared/ # Shared components (2 files)
146
+ │ ├── markdown-renderer.tsx # Render Markdown with syntax highlighting
147
+ │ │ └── bug-report-popup.tsx # Global bug report popup
148
+ │ └── ui/ # Radix + shadcn primitives (14 files)
149
+ │ └── button, input, label, dialog, dropdown-menu, select, tabs, tooltip, etc.
121
150
  ├── tests/
122
151
  │ ├── test-setup.ts # Disable auth for tests
123
152
  │ ├── unit/
124
153
  │ │ ├── providers/ # Mock provider, SDK tests
125
- │ │ └── services/ # Chat service tests
154
+ │ │ └── services/ # Chat, config, db, session-log, push-notification tests
126
155
  │ └── integration/
127
156
  │ ├── claude-agent-sdk-integration.test.ts
157
+ │ ├── sqlite-migration.test.ts # SQLite migration validation
128
158
  │ ├── api/ # Chat route tests
129
159
  │ └── ws/ # WebSocket tests
130
160
  ├── scripts/
@@ -174,13 +204,17 @@ ppm/
174
204
  - **Responsibility:** Business logic, data operations, infrastructure (tunneling)
175
205
  - **Services:**
176
206
  - **ChatService** — Session lifecycle, message queueing, streaming
207
+ - **ConfigService** — Config loading (YAML→SQLite migration)
208
+ - **DbService** — SQLite persistence (6 tables, WAL mode, schema migrations)
177
209
  - **GitService** — Git commands via simple-git
178
210
  - **FileService** — File ops with path validation
179
- - **ProjectService** — YAML registry management
211
+ - **ProjectService** — Project CRUD, scanning, resolution
180
212
  - **TerminalService** — PTY lifecycle, shell spawning
181
- - **ConfigService** — Config file loading
182
- - **CloudflaredService** — Download/cache cloudflared binary (platform-aware, shows progress)
183
- - **TunnelService** — Spawn tunnel, extract URL from stderr, cleanup on exit
213
+ - **ClaudeUsageService** — Token tracking, cost calculation
214
+ - **PushNotificationService** — Web push subscriptions
215
+ - **SessionLogService** — Audit logs with sensitive data redaction
216
+ - **CloudflaredService** — Download/cache cloudflared binary (platform-aware)
217
+ - **TunnelService** — Spawn tunnel, extract URL, cleanup on exit
184
218
  - **Pattern:** Singleton services, dependency injection via imports
185
219
 
186
220
  ### Provider Layer (src/providers/)
@@ -194,10 +228,11 @@ ppm/
194
228
  ### Frontend Layer (src/web/)
195
229
  - **Responsibility:** React UI for project management, chat, terminal, editor
196
230
  - **Key Stores:**
197
- - **ProjectStore** — Active project, project list
198
- - **TabStore** — Open tabs per project
199
- - **FileStore** — File selections
200
- - **SettingsStore** — Auth, theme
231
+ - **ProjectStore** — Active project, project list, localStorage persistence
232
+ - **TabStore** — Tab facade, delegates to panel-store
233
+ - **PanelStore** — Grid layout, panel creation, keep-alive snapshots
234
+ - **FileStore** — File cache
235
+ - **SettingsStore** — Theme, sidebar, git view, device name
201
236
  - **Pattern:** Zustand for state, React.lazy() for tab content splitting
202
237
 
203
238
  ## Data Flow Diagrams
@@ -270,7 +305,7 @@ UI updates staged/unstaged lists
270
305
  |---------|---------|---------|
271
306
  | hono | HTTP framework | 4.12.8 |
272
307
  | simple-git | Git CLI wrapper | 3.33 |
273
- | @monaco-editor/react | Code editor (v2.0+) | Latest |
308
+ | @monaco-editor/react | Code editor | 4.7.0 |
274
309
  | xterm | Terminal emulator | 6.0 |
275
310
  | zustand | State management | 5.0.11 |
276
311
  | @anthropic-ai/claude-agent-sdk | AI provider | 0.2.76 |
@@ -87,11 +87,18 @@ ppm --version
87
87
  # Generate config and scan for git repositories
88
88
  ppm init
89
89
 
90
- # Output: ~/.config/ppm/ppm.yaml (or current directory)
90
+ # Output: ~/.ppm/config.yaml
91
91
  # Auto-generates auth token
92
92
  ```
93
93
 
94
- ### Config File Structure (ppm.yaml)
94
+ ### Dev vs Production Config
95
+
96
+ - **Production:** `~/.ppm/config.yaml` — port **8080** (default)
97
+ - **Development:** `~/.ppm/config.dev.yaml` — port **8081**
98
+
99
+ `bun dev:server` automatically passes `-c ~/.ppm/config.dev.yaml`. Create dev config by copying `ppm.example.yaml` and setting `port: 8081`.
100
+
101
+ ### Config File Structure (config.yaml)
95
102
 
96
103
  ```yaml
97
104
  port: 8080
@@ -105,7 +112,7 @@ projects:
105
112
  - name: project-b
106
113
  path: /path/to/project-b
107
114
  providers:
108
- default: claude-agent-sdk # or claude-code-cli for fallback
115
+ default: claude-agent-sdk # or mock for testing
109
116
  ```
110
117
 
111
118
  ### Customize Configuration
@@ -133,8 +140,8 @@ ppm projects remove my-project
133
140
 
134
141
  #### Set AI Provider
135
142
  ```bash
136
- # Use Claude Code CLI fallback (for offline environments)
137
- ppm config set providers.default claude-code-cli
143
+ # Use mock provider (for testing)
144
+ ppm config set providers.default mock
138
145
 
139
146
  # Switch back to SDK (default)
140
147
  ppm config set providers.default claude-agent-sdk
@@ -337,12 +344,7 @@ export ANTHROPIC_API_KEY="sk-ant-..." # Your Anthropic API key
337
344
  ppm start
338
345
  ```
339
346
 
340
- If using Claude CLI fallback:
341
- ```bash
342
- export CLAUDE_API_KEY="sk-ant-..."
343
- # Ensure `claude` CLI is installed and in PATH
344
- which claude # Should find the binary
345
- ```
347
+ **Note:** On Windows, SDK uses CLI fallback (`claude` binary) for Bun subprocess pipe buffering issues. Ensure `claude` is in PATH.
346
348
 
347
349
  ---
348
350
 
@@ -526,7 +528,7 @@ ppm start
526
528
 
527
529
  - [ ] Change default auth token: `ppm config set auth.token "$(openssl rand -hex 32)"`
528
530
  - [ ] Verify only necessary projects are in `ppm.yaml`
529
- - [ ] Set appropriate file permissions: `chmod 600 ~/.config/ppm/ppm.yaml`
531
+ - [ ] Set appropriate file permissions: `chmod 600 ~/.ppm/config.yaml ~/.ppm/ppm.db`
530
532
  - [ ] Keep Bun updated: `bun upgrade`
531
533
  - [ ] Keep dependencies updated: `bun update`
532
534
  - [ ] Review firewall rules (localhost only recommended)
@@ -572,7 +574,7 @@ Then access via `https://ppm.example.com` with SSL certificate.
572
574
 
573
575
  ```bash
574
576
  # 1. Backup existing config
575
- cp ~/.config/ppm/ppm.yaml ~/.config/ppm/ppm.yaml.backup
577
+ cp ~/.ppm/config.yaml ~/.ppm/config.yaml.backup
576
578
 
577
579
  # 2. Stop running server
578
580
  ppm stop
@@ -603,7 +605,7 @@ ppm stop
603
605
  # ./ppm-v1 start
604
606
 
605
607
  # 3. Restore backup if config changed
606
- # cp ~/.config/ppm/ppm.yaml.backup ~/.config/ppm/ppm.yaml
608
+ # cp ~/.ppm/config.yaml.backup ~/.ppm/config.yaml
607
609
  ```
608
610
 
609
611
  ---