@pi-chamber/web 0.2.0 → 0.2.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.
- package/README.md +1 -1
- package/dist/assets/{CommitSection-LewzHfDH.js → CommitSection-BQBmpPVE.js} +1 -1
- package/dist/assets/{DiagramEditor-BOIJVnh3.js → DiagramEditor-Cp22TGpq.js} +1 -1
- package/dist/assets/{DiagramView-CdNHezna.js → DiagramView-E4HJ4ZPU.js} +1 -1
- package/dist/assets/{DiffView-Cmw-RHIH.js → DiffView-d23o9CKP.js} +1 -1
- package/dist/assets/{FilesView-BODbL0Xm.js → FilesView-DIDB-xK7.js} +1 -1
- package/dist/assets/{GitView-DqYF-n_h.js → GitView-CkUONO1-.js} +3 -3
- package/dist/assets/{JsonTreeView-DzEjA1ht.js → JsonTreeView-By2oGMNK.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-Bfq0bOSM.js → MarkdownRendererImpl-DUghE55t.js} +1 -1
- package/dist/assets/{PatchDiff-CtVByTC4.js → PatchDiff-BjN6zMtK.js} +1 -1
- package/dist/assets/{PierreDiffViewer-Cwoewmiu.js → PierreDiffViewer-B38_7NnU.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-DNjCJjzF.js → SessionSwitcherDropdown-NbVfnqQQ.js} +102 -102
- package/dist/assets/{SettingsView-BtLvHlj4.js → SettingsView-C2dCv0r7.js} +1 -1
- package/dist/assets/{SettingsWindow-CPd7JmJs.js → SettingsWindow-DsMhdX5H.js} +1 -1
- package/dist/assets/{ToolOutputDialog-CFFC5eI-.js → ToolOutputDialog-DVesARmI.js} +1 -1
- package/dist/assets/{ToolPartDiffPreview-yFq1DKSA.js → ToolPartDiffPreview-C2N_oIO-.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-CC5lTPJS.js → VirtualizedFileDiff-B7eVR6Pt.js} +1 -1
- package/dist/assets/{collapsible-D_555Hw_.js → collapsible-CPkWB1VR.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-BcVuV0Ic.js → computeVirtualFileMetrics-BsZulefS.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-BygvjHuE.js → contextFileOpenGuard-BmmlK5E3.js} +1 -1
- package/dist/assets/{index-DYrJXRkU.css → index-BZXqJcua.css} +1 -1
- package/dist/assets/{index-C9CLY-is.js → index-C84KrQoy.js} +1 -1
- package/dist/assets/{isDiffPlainText-Bher0UxW.js → isDiffPlainText-DsuyxFXo.js} +1 -1
- package/dist/assets/{isFilePlainText-EIViqOlI.js → isFilePlainText-CCYoe7us.js} +1 -1
- package/dist/assets/{main-1bIgjP48.js → main-ClYgYVm1.js} +2 -2
- package/dist/assets/{main-JDtt2bQS.js → main-CmrF_CaW.js} +4 -4
- package/dist/assets/{markdownCore-Bm4FxtK1.js → markdownCore-D2uqals1.js} +1 -1
- package/dist/assets/{miniChat-B7kKqKHH.js → miniChat-DmX9SjxM.js} +2 -2
- package/dist/assets/{mobile-DZPRce5z.js → mobile-C-PCxN62.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-Dq0GdThJ.js → renderElectronMiniChatApp-BhXZtZlU.js} +1 -1
- package/dist/assets/{renderMobileApp-DlKnjObC.js → renderMobileApp-DUSTAPWw.js} +4 -4
- package/dist/assets/{runtimeSurface-B6sKTjo7.js → runtimeSurface-CouGjZ3A.js} +1 -1
- package/dist/assets/{useInlineCommentController-CSR_Ju0a.js → useInlineCommentController-buNJ3xB4.js} +1 -1
- package/dist/assets/{usePanelSlide-BkonU4LS.js → usePanelSlide-BRwyEEzi.js} +9 -9
- package/dist/assets/{useWindowTitle-rt_8xbd9.js → useWindowTitle-CnF4pKz0.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-Be-zDX0u.js → vendor-codemirror-language-data-qBLdzwMc.js} +2 -2
- package/dist/assets/{web-components-DgFD1Jms.js → web-components-BhO08KaW.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +1 -1
- package/server/index.js +6 -1
- package/server/lib/pi/routes.js +13 -1
- package/server/lib/pi/routes.test.js +4 -0
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +6 -5
- package/server/lib/pi/session-daemon/daemon-process.js +4 -1
- package/server/lib/pi/session-daemon/session-daemon.js +138 -20
- package/server/lib/pi/session-daemon/session-daemon.test.js +208 -0
- package/server/lib/pi/session-daemon/session-jsonl.js +258 -6
- package/server/lib/pi/session-daemon/session-jsonl.test.js +69 -1
- package/server/lib/pi/session-daemon/supervisor.js +41 -21
- package/server/lib/pi/session-daemon/supervisor.test.js +28 -0
- /package/dist/assets/{index-DQr8-8RF.js → index-BhXma4dv.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i,K as s}from"./index-
|
|
1
|
+
import{i,K as s}from"./index-BhXma4dv.js";const n="pichamber-mobile-layout",a=e=>e==="default"?"default":"new",c=()=>{if(typeof window>"u")return"new";try{return a(window.localStorage.getItem(n))}catch{return"new"}},l=e=>{if(typeof window>"u")return!1;try{return window.localStorage.setItem(n,e),!0}catch{return!1}},d=768,u=()=>{if(typeof window>"u")return!1;const e=typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches:!1,t=typeof navigator<"u"?navigator.maxTouchPoints??0:0;return e||t>0},r=()=>{if(typeof window>"u")return"desktop";const e=window.__PICHAMBER_SURFACE__;if(e==="mobile"||e==="desktop")return e;const t=new URLSearchParams(window.location.search).get("surface");if(t==="mobile"||t==="desktop")return t;if(i())return"mobile";if(s())return"desktop";const o=Math.min(window.innerWidth||Number.POSITIVE_INFINITY,window.screen?.width||Number.POSITIVE_INFINITY);return Number.isFinite(o)&&o<=d&&u()&&c()==="new"?"mobile":"desktop"},m=()=>{const e=r();return typeof window<"u"&&(window.__PICHAMBER_SURFACE__=e),e},h=()=>r()==="mobile";export{c as g,h as i,m as r,l as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as N,j as t,R as c}from"./vendor-react-DYyjh7Q0.js";import{bj as U,f as F,B as E,I as j,aw as H,ax as Q,ay as Z,aD as B,aW as ee,m as O,L as te,aR as R,eJ as se,eK as Y,t as ne}from"./SessionSwitcherDropdown-
|
|
1
|
+
import{r as N,j as t,R as c}from"./vendor-react-DYyjh7Q0.js";import{bj as U,f as F,B as E,I as j,aw as H,ax as Q,ay as Z,aD as B,aW as ee,m as O,L as te,aR as R,eJ as se,eK as Y,t as ne}from"./SessionSwitcherDropdown-NbVfnqQQ.js";import{h as oe,i as re,j as ae,k as q,y as ie}from"./usePanelSlide-BRwyEEzi.js";import{C as ce,a as le,b as de}from"./collapsible-CPkWB1VR.js";import{a as me}from"./index-BhXma4dv.js";function Ce({draft:n,onEdit:a,onDelete:r,className:h,maxWidth:d}){const p=U()?.currentTheme,[m,w]=N.useState(!1),[I,f]=N.useState(!1),u=typeof n.text=="string"?n.text:"",i=u.length>150||u.split(`
|
|
2
2
|
`).length>3;return t.jsxs(oe,{open:I,onOpenChange:f,children:[t.jsx(re,{render:t.jsx("div",{className:F("rounded-lg border shadow-none w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden transition-all duration-200",h),style:{backgroundColor:p?.colors?.surface?.elevated,borderColor:p?.colors?.interactive?.border,maxWidth:d?`${Math.max(200,Math.floor(d))}px`:void 0},"data-comment-card":"true",onContextMenu:b=>{b.preventDefault(),f(!0)}}),children:t.jsxs("div",{className:"flex items-start justify-between gap-2 p-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground mb-1.5",children:[t.jsx("span",{className:"truncate max-w-[200px]",title:n.fileLabel,children:n.fileLabel}),t.jsx("span",{children:"•"}),t.jsx("span",{children:`Lines ${n.startLine}-${n.endLine}`}),n.side&&t.jsxs("span",{children:["(",n.side,")"]})]}),t.jsxs(ce,{open:m||!i,onOpenChange:w,children:[t.jsx("div",{className:F("text-sm whitespace-pre-wrap break-words leading-relaxed",!m&&i&&"line-clamp-3"),children:u}),i&&t.jsx(le,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-6 px-0 mt-1 text-xs text-muted-foreground hover:text-foreground w-full justify-start",children:m?t.jsxs(t.Fragment,{children:[t.jsx(j,{name:"arrow-up-s",className:"size-3 mr-1"}),"Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(j,{name:"arrow-down-s",className:"size-3 mr-1"}),"Show more"]})})}),t.jsx(de,{})]})]}),t.jsxs(H,{children:[t.jsx(Q,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"h-6 w-6 -mr-1 text-muted-foreground hover:text-foreground",children:t.jsx(j,{name:"more",className:"size-4"})})}),t.jsxs(Z,{align:"end",children:[t.jsxs(B,{onClick:a,children:[t.jsx(j,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(B,{onClick:r,className:"text-destructive",children:[t.jsx(j,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})]})}),t.jsxs(ae,{children:[t.jsxs(q,{onClick:a,children:[t.jsx(j,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(q,{onClick:r,className:"text-destructive focus:text-destructive",children:[t.jsx(j,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})}function ve({initialText:n="",onTextChange:a,onSave:r,onCancel:h,fileLabel:d,lineRange:l,isEditing:p=!1,className:m,maxWidth:w}){const f=U()?.currentTheme,{isMobile:u}=ee(),[i,b]=c.useState(n),D=N.useRef(null),M=e=>{b(e),a?.(e)},L=N.useRef(l);N.useEffect(()=>{l&&(L.current=l)},[l]);const v=e=>{if(!e)return;const o=Math.min(e.start,e.end),g=Math.max(e.start,e.end);return{...e,start:o,end:g}},x=v(l);N.useEffect(()=>{const e=D.current;if(!e)return;const o=e.closest(".overlay-scrollbar-container"),g=o?.scrollTop??window.scrollY,k=o?.scrollLeft??window.scrollX;if(u){e.scrollIntoView({behavior:"auto",block:"nearest"});try{e.focus({preventScroll:!0})}catch{e.focus()}return}try{e.focus({preventScroll:!0})}catch{e.focus()}const z=e.value.length;try{e.setSelectionRange(z,z)}catch{}requestAnimationFrame(()=>{o?(o.scrollTop=g,o.scrollLeft=k):window.scrollTo({top:g,left:k})})},[u]);const T=e=>{(e.metaKey||e.ctrlKey)&&e.key==="Enter"?(e.preventDefault(),i.trim()&&r(i,v(L.current))):e.key==="Escape"&&(e.preventDefault(),h())},y=e=>{e.stopPropagation(),i.trim()&&r(i,v(L.current))};return t.jsx("div",{className:F("rounded-lg border shadow-none w-full max-w-[min(100%,calc(var(--oc-context-panel-width,100vw)-var(--oc-editor-gutter-width,0px)))] overflow-hidden animate-in fade-in zoom-in-95 duration-200",m),style:{backgroundColor:f?.colors?.surface?.elevated,borderColor:f?.colors?.interactive?.border,maxWidth:w?`${Math.max(200,Math.floor(w))}px`:void 0},"data-comment-input":"true",onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:t.jsxs("div",{className:"p-3",children:[(d||l)&&t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground mb-2",children:[d&&t.jsx("span",{className:"truncate max-w-[200px]",children:d}),d&&l&&t.jsx("span",{children:"•"}),x&&t.jsx("span",{children:`Lines ${x.start}-${x.end}`})]}),t.jsx(ie,{simple:!0,ref:D,value:i,onChange:e=>M(e.target.value),onKeyDown:T,placeholder:u?"Add a comment...":"Add a comment... (Cmd+Enter to save)",outerClassName:"rounded-[var(--radius-xl)] bg-[var(--surface-subtle)] ring-1 ring-inset ring-border/60 focus-within:ring-2 focus-within:ring-[var(--interactive-focus-ring)]",className:"min-h-[80px] px-3 py-2.5 text-sm resize-y"}),t.jsxs("div",{className:"flex items-center justify-end gap-2 mt-3",children:[t.jsx(E,{variant:"ghost",size:"sm",onClick:h,onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),className:"h-8 text-muted-foreground hover:text-foreground",children:"Cancel"}),t.jsx(E,{size:"sm",onClick:y,onPointerDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),disabled:!i.trim(),className:"h-8 min-w-[80px]",style:{backgroundColor:f?.colors?.status?.success,color:f?.colors?.status?.successForeground},children:p?"Save":"Comment"})]})]})})}const ue=n=>{const a=Math.min(n.startLine,n.endLine),r=Math.max(n.startLine,n.endLine);return{...n,startLine:a,endLine:r}},J=n=>{const a=Math.min(n.start,n.end),r=Math.max(n.start,n.end);return{...n,start:a,end:r}};function je(n){const{source:a,fileLabel:r,language:h,getCodeForRange:d,toStoreRange:l,fromDraftRange:p}=n,m=O(s=>s.currentSessionId),w=O(s=>s.newSessionDraft?.open),I=te(),f=O(c.useCallback(s=>m?s.getDirectoryForSession(m):null,[m])),u=R(s=>s.addDraft),i=R(s=>s.updateDraft),b=R(s=>s.removeDraft),[D,M]=c.useState(null),[L,v]=c.useState(""),[x,T]=c.useState(null),y=m??(w?"draft":null),e=f??I,o=c.useMemo(()=>!y||!e?null:{directory:e,sessionKey:y},[e,y]),g=o?se(me(),o.directory,o.sessionKey):null,k=R(c.useCallback(s=>g?s.drafts[g]??Y:Y,[g])),z=c.useMemo(()=>!o||!r?[]:k.filter(s=>s.source===a&&s.fileLabel===r),[r,k,a,o]),C=c.useCallback(()=>{M(null),v(""),T(null)},[]),V=c.useCallback(()=>{C()},[C]),W=c.useCallback(s=>{const P=J(p(s));M(P),v(s.text),T(s.id)},[p]),X=c.useCallback(s=>{o&&(b(o,s.id),x===s.id&&C())},[x,b,C,o]),G=c.useCallback((s,P)=>{const $=P??D,K=s.trim();if(!$||!K||!r)return;if(!o){ne.error("Select a session to save comment");return}const A=J($),S=ue(l(A)),_=d(A);x?i(o,x,{fileLabel:r,startLine:S.startLine,endLine:S.endLine,side:S.side,code:_,language:h,text:K}):u(o,{source:a,fileLabel:r,startLine:S.startLine,endLine:S.endLine,side:S.side,code:_,language:h,text:K}),C()},[u,x,r,d,h,C,D,a,o,l,i]);return{sessionKey:y,drafts:z,selection:D,setSelection:M,commentText:L,setCommentText:v,editingDraftId:x,setEditingDraftId:T,reset:C,cancel:V,startEdit:W,deleteDraft:X,saveComment:G,fromDraftRange:p}}export{ve as I,Ce as a,J as n,je as u};
|