@pi-chamber/web 0.6.0 → 0.7.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/dist/assets/{CommitSection-IIhrK4u7.js → CommitSection-DuGkZ_bm.js} +1 -1
- package/dist/assets/{DiagramEditor-DmDE7OFs.js → DiagramEditor-C7xe1Brl.js} +1 -1
- package/dist/assets/{DiagramView-BKKPzX5U.js → DiagramView-BTqROEWP.js} +1 -1
- package/dist/assets/{DiffView-BZAyvJ3r.js → DiffView-hcqXTjEc.js} +3 -3
- package/dist/assets/{FilesView-mwjEX08j.js → FilesView-GadyKxta.js} +4 -4
- package/dist/assets/{GitView-C1ltD6da.js → GitView-BKy-hYUN.js} +3 -3
- package/dist/assets/{JsonTreeView-De-9zk3N.js → JsonTreeView-CGc4eTGI.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-BJjIFNhO.js → MarkdownRendererImpl-CqfEAhPM.js} +1 -1
- package/dist/assets/{PatchDiff-DuR1fglg.js → PatchDiff-P17-Byb8.js} +1 -1
- package/dist/assets/{PierreDiffViewer-B_1JcH3B.js → PierreDiffViewer-BbUCO4IF.js} +1 -1
- package/dist/assets/{SessionSwitcherContent-DoEWfM8C.js → SessionSwitcherContent-j6KFBSe0.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-CJWqyz1O.js → SessionSwitcherDropdown-DSVeuuVL.js} +2 -2
- package/dist/assets/{SessionUnreadDot-DB-YvwMh.js → SessionUnreadDot-BVBBEBTg.js} +1 -1
- package/dist/assets/SettingsView-FnmtcWZc.js +4 -0
- package/dist/assets/{SettingsWindow-nCTzNqyu.js → SettingsWindow-Bascj0V3.js} +1 -1
- package/dist/assets/{ToolOutputDialog-CIzj2Pxu.js → ToolOutputDialog-CPMzJ27S.js} +5 -5
- package/dist/assets/{ToolPartDiffPreview-BgewaN20.js → ToolPartDiffPreview-BZSRKHHM.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-aTd42JT9.js → VirtualizedFileDiff-DFx8xsmh.js} +3 -3
- package/dist/assets/{WindowsWindowControls-CdHYDpHx.js → WindowsWindowControls-DIqnZ2uU.js} +109 -109
- package/dist/assets/{collapsible-IV1T6v7c.js → collapsible-DlqZyxEY.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-CcGhkiFO.js → computeVirtualFileMetrics-elCbdk6U.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-DRkKhovc.js → contextFileOpenGuard-BmQ7Zu-L.js} +1 -1
- package/dist/assets/{index-DmJfzwE5.js → index-BerHSX92.js} +1 -1
- package/dist/assets/index-ChFxkws4.js +8 -0
- package/dist/assets/index-DZ-f_hCQ.css +1 -0
- package/dist/assets/{isDiffPlainText-DL6dDuVG.js → isDiffPlainText-CvfRfc7h.js} +1 -1
- package/dist/assets/{isFilePlainText-nuUWsdc6.js → isFilePlainText-_vq9Ghu3.js} +1 -1
- package/dist/assets/{main-Bajw-SZm.js → main-DTCOwPr3.js} +2 -2
- package/dist/assets/main-DYs-nZO6.js +133 -0
- package/dist/assets/{markdownCore-CrfGNEFF.js → markdownCore-CzWR_p3k.js} +2 -2
- package/dist/assets/{miniChat-Dfoj435F.js → miniChat-C2XxEA3N.js} +2 -2
- package/dist/assets/{mobile-DFIt0gxE.js → mobile-BQhAOqV7.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-DKsf3ft3.js → renderElectronMiniChatApp-M2bY1WKA.js} +2 -2
- package/dist/assets/{renderMobileApp-iiD58RxE.js → renderMobileApp-BnpHUUhY.js} +4 -4
- package/dist/assets/{runtimeSurface-D3p7a-uO.js → runtimeSurface-OhCUGSKg.js} +1 -1
- package/dist/assets/{useInlineCommentController-5paFhtYM.js → useInlineCommentController-DC0iNSYX.js} +2 -2
- package/dist/assets/usePanelSlide-aeAIo1cp.js +56 -0
- package/dist/assets/{usePushVisibilityBeacon-BOPrDYSe.js → usePushVisibilityBeacon-om5Qlrt6.js} +2 -2
- package/dist/assets/{useSwitcherItems-DP5ufRVs.js → useSwitcherItems-Bln2r_Q2.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-B9y74Qvn.js → vendor-codemirror-language-data-Dv4zaHRN.js} +2 -2
- package/dist/assets/{web-components-CD0f7QZj.js → web-components-BOt08OHk.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/lib/inherited-env.js +1 -1
- package/server/lib/pi/routes.js +9 -1
- package/server/lib/pi/routes.test.js +24 -0
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +3 -3
- package/server/lib/pi/session-daemon/session-daemon.js +64 -24
- package/server/lib/pi/session-daemon/session-daemon.test.js +78 -7
- package/server/lib/pi/session-daemon/session-jsonl.js +27 -7
- package/server/lib/pi/session-daemon/session-jsonl.test.js +31 -0
- package/dist/assets/SettingsView-ZwPgZh-7.js +0 -4
- package/dist/assets/index--5Zr-fSk.js +0 -8
- package/dist/assets/index--zDkVFU6.css +0 -1
- package/dist/assets/main-DIAtlyFC.js +0 -133
- package/dist/assets/usePanelSlide-D7Cl581q.js +0 -56
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i,O as s}from"./index
|
|
1
|
+
import{i,O as s}from"./index-ChFxkws4.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{a$ as
|
|
2
|
-
`).length>3;return t.jsxs(oe,{open:k,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(le,{open:m||!i,onOpenChange:j,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(de,{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(w,{name:"arrow-up-s",className:"size-3 mr-1"}),"Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-down-s",className:"size-3 mr-1"}),"Show more"]})})}),t.jsx(me,{})]})]}),t.jsxs(Q,{children:[t.jsx(W,{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(w,{name:"more",className:"size-4"})})}),t.jsxs(Z,{align:"end",children:[t.jsxs(q,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(q,{onClick:r,className:"text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})]})}),t.jsxs(ae,{children:[t.jsxs(
|
|
1
|
+
import{r as N,j as t,R as c}from"./vendor-react-DYyjh7Q0.js";import{a$ as U,B as E,I as w,am as Q,an as W,ao as Z,as as q,aJ as ee,g as K,x as te,aF as R,dR as se,dS as B,t as ne}from"./WindowsWindowControls-DIqnZ2uU.js";import{p as oe,q as re,t as ae,v as Y,O as ie}from"./usePanelSlide-aeAIo1cp.js";import{m as F,a as ce}from"./index-ChFxkws4.js";import{C as le,a as de,b as me}from"./collapsible-DlqZyxEY.js";function Ce({draft:n,onEdit:a,onDelete:r,className:h,maxWidth:d}){const p=U()?.currentTheme,[m,j]=N.useState(!1),[k,f]=N.useState(!1),u=typeof n.text=="string"?n.text:"",i=u.length>150||u.split(`
|
|
2
|
+
`).length>3;return t.jsxs(oe,{open:k,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(le,{open:m||!i,onOpenChange:j,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(de,{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(w,{name:"arrow-up-s",className:"size-3 mr-1"}),"Show less"]}):t.jsxs(t.Fragment,{children:[t.jsx(w,{name:"arrow-down-s",className:"size-3 mr-1"}),"Show more"]})})}),t.jsx(me,{})]})]}),t.jsxs(Q,{children:[t.jsx(W,{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(w,{name:"more",className:"size-4"})})}),t.jsxs(Z,{align:"end",children:[t.jsxs(q,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(q,{onClick:r,className:"text-destructive",children:[t.jsx(w,{name:"delete-bin",className:"size-4 mr-2"}),"Delete comment"]})]})]})]})}),t.jsxs(ae,{children:[t.jsxs(Y,{onClick:a,children:[t.jsx(w,{name:"edit",className:"size-4 mr-2"}),"Edit comment"]}),t.jsxs(Y,{onClick:r,className:"text-destructive focus:text-destructive",children:[t.jsx(w,{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:j}){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,I=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=I):window.scrollTo({top:g,left:I})})},[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:j?`${Math.max(200,Math.floor(j))}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 we(n){const{source:a,fileLabel:r,language:h,getCodeForRange:d,toStoreRange:l,fromDraftRange:p}=n,m=K(s=>s.currentSessionId),j=K(s=>s.newSessionDraft?.open),k=te(),f=K(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??(j?"draft":null),e=f??k,o=c.useMemo(()=>!y||!e?null:{directory:e,sessionKey:y},[e,y]),g=o?se(ce(),o.directory,o.sessionKey):null,I=R(c.useCallback(s=>g?s.drafts[g]??B:B,[g])),z=c.useMemo(()=>!o||!r?[]:I.filter(s=>s.source===a&&s.fileLabel===r),[r,I,a,o]),C=c.useCallback(()=>{M(null),v(""),T(null)},[]),V=c.useCallback(()=>{C()},[C]),X=c.useCallback(s=>{const P=J(p(s));M(P),v(s.text),T(s.id)},[p]),G=c.useCallback(s=>{o&&(b(o,s.id),x===s.id&&C())},[x,b,C,o]),H=c.useCallback((s,P)=>{const $=P??D,O=s.trim();if(!$||!O||!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:O}):u(o,{source:a,fileLabel:r,startLine:S.startLine,endLine:S.endLine,side:S.side,code:_,language:h,text:O}),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:X,deleteDraft:G,saveComment:H,fromDraftRange:p}}export{ve as I,Ce as a,J as n,we as u};
|