@pi-chamber/web 0.5.2 → 0.6.0
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-BMoPmxW5.js → CommitSection-IIhrK4u7.js} +1 -1
- package/dist/assets/{DiagramView-DQqjMY2l.js → DiagramView-BKKPzX5U.js} +1 -1
- package/dist/assets/{DiffView-CA4gogOk.js → DiffView-BZAyvJ3r.js} +1 -1
- package/dist/assets/{FilesView-B6u279g1.js → FilesView-mwjEX08j.js} +1 -1
- package/dist/assets/{GitView-BZVWI9Uo.js → GitView-C1ltD6da.js} +3 -3
- package/dist/assets/{JsonTreeView-Lcl4hDE0.js → JsonTreeView-De-9zk3N.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-Uz4H4e3u.js → MarkdownRendererImpl-BJjIFNhO.js} +1 -1
- package/dist/assets/PatchDiff-DuR1fglg.js +1 -0
- package/dist/assets/{PierreDiffViewer-CODKwHC9.js → PierreDiffViewer-B_1JcH3B.js} +1 -1
- package/dist/assets/{SessionSwitcherContent-Cp2Zm5gn.js → SessionSwitcherContent-DoEWfM8C.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-BdQTFOMs.js → SessionSwitcherDropdown-CJWqyz1O.js} +2 -2
- package/dist/assets/{SessionUnreadDot-CyaUql-t.js → SessionUnreadDot-DB-YvwMh.js} +1 -1
- package/dist/assets/{SettingsView-BtYR1m1l.js → SettingsView-ZwPgZh-7.js} +3 -3
- package/dist/assets/{SettingsWindow-BWemjgov.js → SettingsWindow-nCTzNqyu.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BmSMXqFj.js → ToolOutputDialog-CIzj2Pxu.js} +5 -5
- package/dist/assets/{ToolPartDiffPreview-qaLAaq5N.js → ToolPartDiffPreview-BgewaN20.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-B-r2zJ_k.js → VirtualizedFileDiff-aTd42JT9.js} +3 -3
- package/dist/assets/{WindowsWindowControls-NzKm1MYj.js → WindowsWindowControls-CdHYDpHx.js} +9 -9
- package/dist/assets/{computeVirtualFileMetrics-DOtVuPAu.js → computeVirtualFileMetrics-CcGhkiFO.js} +1 -1
- package/dist/assets/{contextFileOpenGuard-CR2p7-61.js → contextFileOpenGuard-DRkKhovc.js} +1 -1
- package/dist/assets/{index-Z6Hwnczz.js → index-DmJfzwE5.js} +1 -1
- package/dist/assets/{isDiffPlainText-DKfgU8d8.js → isDiffPlainText-DL6dDuVG.js} +1 -1
- package/dist/assets/{isFilePlainText-2ndX4gYw.js → isFilePlainText-nuUWsdc6.js} +1 -1
- package/dist/assets/{main-BfG1ShoJ.js → main-Bajw-SZm.js} +2 -2
- package/dist/assets/{main-CsU2nR8Q.js → main-DIAtlyFC.js} +4 -4
- package/dist/assets/{markdownCore-BaZ2plrB.js → markdownCore-CrfGNEFF.js} +2 -2
- package/dist/assets/{miniChat-BpFgzk2I.js → miniChat-Dfoj435F.js} +2 -2
- package/dist/assets/{mobile-Dh_Vvtjt.js → mobile-DFIt0gxE.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-DNmqLSsJ.js → renderElectronMiniChatApp-DKsf3ft3.js} +2 -2
- package/dist/assets/{renderMobileApp-BZbx_IU1.js → renderMobileApp-iiD58RxE.js} +4 -4
- package/dist/assets/{useInlineCommentController-TZXHonVr.js → useInlineCommentController-5paFhtYM.js} +2 -2
- package/dist/assets/usePanelSlide-D7Cl581q.js +56 -0
- package/dist/assets/{usePushVisibilityBeacon-9FqcXiL9.js → usePushVisibilityBeacon-BOPrDYSe.js} +2 -2
- package/dist/assets/{useSwitcherItems-DZW2vj37.js → useSwitcherItems-DP5ufRVs.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-DXJ_-7WI.js → vendor-codemirror-language-data-B9y74Qvn.js} +2 -2
- package/dist/assets/{web-components-RWdkgqgC.js → web-components-CD0f7QZj.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/mini-chat.html +1 -1
- package/dist/mobile.html +1 -1
- package/package.json +1 -1
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +1 -1
- package/server/lib/pi/session-daemon/session-daemon.js +3 -1
- package/server/lib/pi/session-daemon/session-daemon.test.js +38 -1
- package/dist/assets/PatchDiff-DpAN_LfK.js +0 -1
- package/dist/assets/usePanelSlide-SCy9Q8Wl.js +0 -56
|
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, it } from 'vitest';
|
|
|
2
2
|
import { mkdir, mkdtemp, readFile, stat, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
import { createConnection } from 'node:net';
|
|
5
|
-
import { tmpdir } from 'node:os';
|
|
5
|
+
import { homedir, tmpdir } from 'node:os';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { StringDecoder } from 'node:string_decoder';
|
|
8
8
|
|
|
@@ -631,6 +631,43 @@ describe('Pi session daemon spike', () => {
|
|
|
631
631
|
await client.close();
|
|
632
632
|
});
|
|
633
633
|
|
|
634
|
+
it('creates a global session from the literal home-directory target', async () => {
|
|
635
|
+
const root = await mkdtemp(join(tmpdir(), 'pichamber-pi-daemon-'));
|
|
636
|
+
const endpoint = testDaemonEndpoint(root);
|
|
637
|
+
const agentDir = join(root, 'agent');
|
|
638
|
+
const runtimeCalls = [];
|
|
639
|
+
await mkdir(agentDir, { recursive: true });
|
|
640
|
+
daemon = createSessionDaemon({
|
|
641
|
+
endpoint,
|
|
642
|
+
credential,
|
|
643
|
+
cwd: root,
|
|
644
|
+
agentDir,
|
|
645
|
+
createRuntime: async (options) => {
|
|
646
|
+
runtimeCalls.push(options);
|
|
647
|
+
return new FakeRuntime({ cwd: options.cwd, session: new FakeSession('pi-session-old') });
|
|
648
|
+
},
|
|
649
|
+
listSessions: async ({ cwd: directory }) => [{
|
|
650
|
+
path: join(root, 'new-session.jsonl'),
|
|
651
|
+
id: 'pi-session-new',
|
|
652
|
+
cwd: directory,
|
|
653
|
+
created: new Date('2026-01-01T00:00:00.000Z'),
|
|
654
|
+
modified: new Date('2026-01-01T00:00:01.000Z'),
|
|
655
|
+
messageCount: 0,
|
|
656
|
+
firstMessage: '',
|
|
657
|
+
}],
|
|
658
|
+
});
|
|
659
|
+
await daemon.start();
|
|
660
|
+
|
|
661
|
+
const client = connectClient(endpoint);
|
|
662
|
+
await client.authenticate();
|
|
663
|
+
await expect(client.request('sessions.create', { cwd: '~' })).resolves.toMatchObject({
|
|
664
|
+
result: { session: { id: 'pi-session-new', directory: homedir() } },
|
|
665
|
+
});
|
|
666
|
+
expect(runtimeCalls).toHaveLength(1);
|
|
667
|
+
expect(runtimeCalls[0].cwd).toBe(homedir());
|
|
668
|
+
await client.close();
|
|
669
|
+
});
|
|
670
|
+
|
|
634
671
|
it('creates and selects a persisted Pi session with supported creation metadata', async () => {
|
|
635
672
|
const root = await mkdtemp(join(tmpdir(), 'pichamber-pi-daemon-'));
|
|
636
673
|
const endpoint = testDaemonEndpoint(root);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cV as j,dE as k,dM as y}from"./WindowsWindowControls-NzKm1MYj.js";import{k as D,a as C}from"./web-components-RWdkgqgC.js";import{M as P,G as O,u as L,W as M,a as A,b as R,n as F,t as H}from"./Virtualizer-BxW2CJGB.js";import{j as d,r as w}from"./vendor-react-DYyjh7Q0.js";import{V,F as _}from"./VirtualizedFileDiff-B-r2zJ_k.js";function N({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function T(e,t){const n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:z(n,e.startContentIndex)}}function z(e,t){let n=e.unifiedLineStart;for(let l=0;l<t;l++){const o=e.hunkContent[l];n+=o.type==="context"?o.lines:o.deletions+o.additions}return n}function U(e){const t=j(e);if(t.length!==1)throw console.error(t),new Error("PatchDiff: Provided patch must include only 1 patch, with 1 diff");const{files:n}=t[0];if(n.length!==1)throw console.error(n),new Error("FileDiff: Provided patch must contain exactly 1 file diff");return n[0]}function $({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:l,renderHeaderFilenameSuffix:o,renderHeaderMetadata:x,renderAnnotation:f,renderGutterUtility:u,renderMergeConflictUtility:s,lineAnnotations:a,getHoveredLine:p,getInstance:m}){const g=n?.(e),c=l?.(e),i=o?.(e),v=x?.(e);return d.jsxs(d.Fragment,{children:[g!=null?d.jsx("div",{slot:k,children:g}):d.jsxs(d.Fragment,{children:[c!=null&&d.jsx("div",{slot:"header-prefix",children:c}),i!=null&&d.jsx("div",{slot:"header-filename-suffix",children:i}),v!=null&&d.jsx("div",{slot:"header-metadata",children:v})]}),f!=null&&a?.map((r,h)=>d.jsx("div",{slot:D(r),children:f(r)},h)),t!=null&&s!=null&&m!=null&&t.map(r=>{if(r==null)return;const h=b(r,e);return d.jsx("div",{slot:h,style:P,children:s(r,m)},h)}),u!=null&&d.jsx("div",{slot:"gutter-utility-slot",style:O,children:u(p)})]})}function b(e,t){const n=T(e,t);return n!=null?N({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex}):void 0}const S=typeof window>"u"?w.useEffect:w.useLayoutEffect;function G({fileDiff:e,options:t,lineAnnotations:n,selectedLines:l,prerenderedHTML:o,metrics:x,hasGutterRenderUtility:f,hasCustomHeader:u,disableWorkerPool:s,contentEditable:a}){const p=L(),m=l!==void 0,g=w.useContext(M),c=A(),i=w.useRef(null),v=R(r=>{if(r!=null){if(i.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");p!=null?i.current=new V(I({controlledSelection:m,contentEditable:a,hasCustomHeader:u,hasEditor:c!==void 0,hasGutterRenderUtility:f,options:t}),p,x,s?void 0:g,!0):i.current=new _(I({controlledSelection:m,contentEditable:a,hasCustomHeader:u,hasEditor:c!==void 0,hasGutterRenderUtility:f,options:t}),s?void 0:g,!0),i.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:o})}else{if(i.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");i.current.cleanUp(),i.current=null}});return S(()=>{const{current:r}=i;if(r==null)return;const h=I({controlledSelection:m,contentEditable:a,hasCustomHeader:u,hasEditor:c!==void 0,hasGutterRenderUtility:f,options:t}),E=!C(r.options,h);r.setOptions(h),r.render({forceRender:E,fileDiff:e,lineAnnotations:n}),l!==void 0&&r.setSelectedLines(l)}),S(()=>{if(a&&i.current!=null){if(c===void 0)throw new Error("FileDiff: Editor is not attached");return c.edit(i.current)}},[a,c]),{ref:v,getHoveredLine:w.useCallback(()=>i.current?.getHoveredLine(),[])}}function I({options:e,controlledSelection:t,contentEditable:n,hasCustomHeader:l,hasEditor:o,hasGutterRenderUtility:x}){const f=n&&o,u=t||x||l;if(!u&&!f)return e;let s={...e};return u&&(s={...s,controlledSelection:t,renderCustomHeader:l?F:e?.renderCustomHeader,renderGutterUtility:x?F:e?.renderGutterUtility}),f&&(s={...s,useTokenTransformer:!0,enableGutterUtility:!1,enableLineSelection:!1,expandUnchanged:!0,lineHoverHighlight:"disabled"}),s}function X({patch:e,options:t,metrics:n,lineAnnotations:l,selectedLines:o,className:x,style:f,prerenderedHTML:u,renderAnnotation:s,renderCustomHeader:a,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,renderGutterUtility:c,disableWorkerPool:i=!1,contentEditable:v=!1}){const r=q(e),{ref:h,getHoveredLine:E}=G({fileDiff:r,options:t,metrics:n,lineAnnotations:l,selectedLines:o,prerenderedHTML:u,hasGutterRenderUtility:c!=null,hasCustomHeader:a!=null,disableWorkerPool:i,contentEditable:v});return d.jsx(y,{ref:h,className:x,style:f,children:H($({fileDiff:r,renderCustomHeader:a,renderHeaderPrefix:p,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,renderAnnotation:s,lineAnnotations:l,renderGutterUtility:c,getHoveredLine:E}),u)})}function q(e){return w.useMemo(()=>U(e),[e])}export{X as P};
|