@pi-chamber/web 0.9.5 → 0.9.6
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/DiagramView-0Iq1ak1I.js +1 -0
- package/dist/assets/{DiffView-BmIVvheE.js → DiffView-DD1AFRi3.js} +1 -1
- package/dist/assets/FileSaveConflictDialog-CoKwDovb.js +3 -0
- package/dist/assets/FilesView-B_BF39ef.js +6 -0
- package/dist/assets/{GitView-BNkzec7G.js → GitView-LFEpCasf.js} +3 -3
- package/dist/assets/{JsonTreeView-C1Kzaybf.js → JsonTreeView-Cwjgvh4g.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-qmKiFVpO.js → MarkdownRendererImpl-_7kV1yNw.js} +2 -2
- package/dist/assets/{PatchDiff-D9JesZL1.js → PatchDiff-DG43C1HW.js} +1 -1
- package/dist/assets/{SessionSwitcherContent-DplV_ApH.js → SessionSwitcherContent-DCFXPY3d.js} +1 -1
- package/dist/assets/{SessionSwitcherDropdown-DdgDKT6K.js → SessionSwitcherDropdown-QY7FKuEQ.js} +2 -2
- package/dist/assets/{SessionUnreadDot-BdSDgvhC.js → SessionUnreadDot-DGT31A3z.js} +1 -1
- package/dist/assets/{SettingsView-z8uf0XyM.js → SettingsView-eG-wN-yY.js} +2 -2
- package/dist/assets/{SettingsWindow-CPDmgNg2.js → SettingsWindow-Dvnp8YrA.js} +1 -1
- package/dist/assets/{ToolOutputDialog-DaF1xcM0.js → ToolOutputDialog-IlCrS6BR.js} +1 -1
- package/dist/assets/{ToolPartDiffPreview-Di6Uo0Dt.js → ToolPartDiffPreview-D68JV0rR.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-wqcrY0yr.js → VirtualizedFileDiff-Bl-rAYeh.js} +1 -1
- package/dist/assets/{collapsible-DBQnXTNm.js → collapsible-BjniCdZ5.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-Cr3jh0d6.js → computeVirtualFileMetrics-FSOm2VrW.js} +2 -2
- package/dist/assets/{contextFileOpenGuard-C_AOTYQD.js → contextFileOpenGuard-Bxb6AIPa.js} +1 -1
- package/dist/assets/{gitStatusPredicates-BvPOjeOy.js → gitStatusPredicates-DxolDpMd.js} +1 -1
- package/dist/assets/index-BpmGBboM.css +1 -0
- package/dist/assets/index-DZnzXhTs.js +8 -0
- package/dist/assets/{index-B8Wt2aN3.js → index-Dh58uD3I.js} +1 -1
- package/dist/assets/{isDiffPlainText-L9uvgz2F.js → isDiffPlainText-D3_04XCh.js} +1 -1
- package/dist/assets/{isFilePlainText-C4yk5BOo.js → isFilePlainText-CHouYQhH.js} +1 -1
- package/dist/assets/{main-DCK6lLCo.js → main-CH3EqGJI.js} +2 -2
- package/dist/assets/{main-C1OSzD-E.js → main-HzTrVvbB.js} +3 -3
- package/dist/assets/{markdownCore-Czb_lINQ.js → markdownCore-DJU4KvHP.js} +1 -1
- package/dist/assets/{miniChat-CXiSlptL.js → miniChat-Ca3TpaaA.js} +2 -2
- package/dist/assets/{mobile-D0HVxiyJ.js → mobile-lj4gpGsO.js} +2 -2
- package/dist/assets/{renderElectronMiniChatApp-BcG209a4.js → renderElectronMiniChatApp-rUFfaD-T.js} +2 -2
- package/dist/assets/{renderMobileApp-B5x_PWlc.js → renderMobileApp-CcWQ1sCf.js} +3 -3
- package/dist/assets/{runtimeEndpointReset-CUiPe6dQ.js → runtimeEndpointReset-D2MmSbDk.js} +8 -8
- package/dist/assets/{runtimeSurface-vilE4xyj.js → runtimeSurface-CE_VNjdH.js} +1 -1
- package/dist/assets/{useAppFontEffects-BP07Vl6M.js → useAppFontEffects-BvFAP9zG.js} +86 -86
- package/dist/assets/useFilesViewSearch-BD79p3A2.js +7 -0
- package/dist/assets/{usePushVisibilityBeacon-CChMvoTL.js → usePushVisibilityBeacon-CWg0j-Wg.js} +1 -1
- package/dist/assets/{useSwitcherItems-_RSo3F-A.js → useSwitcherItems-CazJ6Yox.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-BJrrV83E.js → vendor-codemirror-language-data-CP3j3-xu.js} +2 -2
- package/dist/assets/{web-components-B5sMa_kC.js → web-components-DWuadqra.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/fs/DOCUMENTATION.md +15 -3
- package/server/lib/fs/routes.js +369 -51
- package/server/lib/fs/routes.test.js +565 -3
- package/server/lib/fs/search.js +74 -29
- package/server/lib/pi/routes.js +56 -3
- package/server/lib/pi/routes.test.js +165 -0
- package/server/lib/pi/session-daemon/DOCUMENTATION.md +3 -2
- package/server/lib/pi/session-daemon/prompt-operations.test.js +9 -3
- package/server/lib/pi/session-daemon/prompt-preflight.test.js +556 -0
- package/server/lib/pi/session-daemon/send-operation-dedup.test.js +331 -0
- package/server/lib/pi/session-daemon/send-operation-registry.js +264 -0
- package/server/lib/pi/session-daemon/send-operation-registry.test.js +205 -0
- package/server/lib/pi/session-daemon/session-daemon-extensions.e2e.test.js +16 -5
- package/server/lib/pi/session-daemon/session-daemon-extensions.test.js +3 -1
- package/server/lib/pi/session-daemon/session-daemon.js +284 -31
- package/server/lib/pi/session-daemon/session-daemon.test.js +37 -13
- package/server/lib/pi/session-daemon/session-idle-residency.test.js +8 -1
- package/server/lib/pi/session-daemon/session-replay.test.js +3 -1
- package/server/lib/server/cors.js +6 -0
- package/server/lib/server/cors.test.js +3 -0
- package/server/lib/workspace/host.js +6 -2
- package/server/lib/workspace/host.test.js +15 -0
- package/dist/assets/DiagramEditor-BPDkGHsj.js +0 -1
- package/dist/assets/DiagramView-D_EfDz2d.js +0 -1
- package/dist/assets/FilesView-CJytSUAX.js +0 -6
- package/dist/assets/index-DIF8b4bh.css +0 -1
- package/dist/assets/index-jrfQYSvP.js +0 -8
- package/dist/assets/useFilesViewSearch-oxIKk-ea.js +0 -7
|
@@ -220,6 +220,27 @@ const registerClone = ({ fsPromises, spawn }) => {
|
|
|
220
220
|
return getRoute('POST', '/api/fs/clone');
|
|
221
221
|
};
|
|
222
222
|
|
|
223
|
+
const registerFind = ({ fsPromises, spawn, resolveProjectDirectory = async () => ({ directory: '/repo' }) }) => {
|
|
224
|
+
const { app, getRoute } = createRouteRegistry();
|
|
225
|
+
registerFsRoutes(app, {
|
|
226
|
+
os: { homedir: () => '/home/user' },
|
|
227
|
+
path: path.posix,
|
|
228
|
+
fsPromises: {
|
|
229
|
+
realpath: async (targetPath) => targetPath,
|
|
230
|
+
stat: async () => ({ isDirectory: () => true }),
|
|
231
|
+
...fsPromises,
|
|
232
|
+
},
|
|
233
|
+
spawn,
|
|
234
|
+
crypto: { randomUUID: () => 'job-0' },
|
|
235
|
+
normalizeDirectoryPath: (p) => p,
|
|
236
|
+
resolveProjectDirectory,
|
|
237
|
+
buildAugmentedPath: () => '/usr/bin',
|
|
238
|
+
resolveGitBinaryForSpawn: () => 'git',
|
|
239
|
+
pichamberUserConfigRoot: '/home/user/.config',
|
|
240
|
+
});
|
|
241
|
+
return getRoute('GET', '/api/fs/find');
|
|
242
|
+
};
|
|
243
|
+
|
|
223
244
|
const registerReveal = ({ fsPromises, spawn, platform = 'linux' }) => {
|
|
224
245
|
const { app, getRoute } = createRouteRegistry();
|
|
225
246
|
registerFsRoutes(app, {
|
|
@@ -286,6 +307,7 @@ const callReveal = async (handler, body) => {
|
|
|
286
307
|
describe('fs write', () => {
|
|
287
308
|
it('does not rewrite a file when content is unchanged', async () => {
|
|
288
309
|
const fsPromises = {
|
|
310
|
+
stat: vi.fn(async () => ({ isFile: () => true, size: 4, mtimeMs: 1000 })),
|
|
289
311
|
readFile: vi.fn(async () => 'same'),
|
|
290
312
|
mkdir: vi.fn(async () => undefined),
|
|
291
313
|
writeFile: vi.fn(async () => undefined),
|
|
@@ -294,12 +316,15 @@ describe('fs write', () => {
|
|
|
294
316
|
|
|
295
317
|
const res = await callWrite(handler, { path: '/repo/file.txt', content: 'same' });
|
|
296
318
|
|
|
297
|
-
expect(res.body).
|
|
319
|
+
expect(res.body).toMatchObject({ success: true, path: '/repo/file.txt', noop: true });
|
|
320
|
+
expect(typeof res.body.revision).toBe('string');
|
|
321
|
+
expect(res.body.revision.startsWith('v1:')).toBe(true);
|
|
298
322
|
expect(fsPromises.writeFile).not.toHaveBeenCalled();
|
|
299
323
|
});
|
|
300
324
|
|
|
301
325
|
it('writes a file when content changed', async () => {
|
|
302
326
|
const fsPromises = {
|
|
327
|
+
stat: vi.fn(async () => ({ isFile: () => true, size: 3, mtimeMs: 1000 })),
|
|
303
328
|
readFile: vi.fn(async () => 'old'),
|
|
304
329
|
mkdir: vi.fn(async () => undefined),
|
|
305
330
|
writeFile: vi.fn(async () => undefined),
|
|
@@ -310,7 +335,8 @@ describe('fs write', () => {
|
|
|
310
335
|
|
|
311
336
|
const res = await callWrite(handler, { path: '/repo/file.txt', content: 'new' });
|
|
312
337
|
|
|
313
|
-
expect(res.body).
|
|
338
|
+
expect(res.body).toMatchObject({ success: true, path: '/repo/file.txt' });
|
|
339
|
+
expect(typeof res.body.revision).toBe('string');
|
|
314
340
|
expect(fsPromises.mkdir).toHaveBeenCalledWith('/repo', { recursive: true });
|
|
315
341
|
const tmp = fsPromises.writeFile.mock.calls[0][0];
|
|
316
342
|
expect(tmp).toMatch(/^\/repo\/file\.txt\.tmp-/);
|
|
@@ -325,6 +351,7 @@ describe('fs write', () => {
|
|
|
325
351
|
if (targetPath === '/repo/link.txt') return '/repo/target.txt';
|
|
326
352
|
return targetPath;
|
|
327
353
|
}),
|
|
354
|
+
stat: vi.fn(async () => ({ isFile: () => true, size: 3, mtimeMs: 1000 })),
|
|
328
355
|
readFile: vi.fn(async () => 'old'),
|
|
329
356
|
mkdir: vi.fn(async () => undefined),
|
|
330
357
|
writeFile: vi.fn(async () => undefined),
|
|
@@ -335,7 +362,7 @@ describe('fs write', () => {
|
|
|
335
362
|
|
|
336
363
|
const res = await callWrite(handler, { path: '/repo/link.txt', content: 'new' });
|
|
337
364
|
|
|
338
|
-
expect(res.body).
|
|
365
|
+
expect(res.body).toMatchObject({ success: true, path: '/repo/link.txt' });
|
|
339
366
|
expect(fsPromises.readFile).toHaveBeenCalledWith('/repo/target.txt', 'utf8');
|
|
340
367
|
const tmp = fsPromises.writeFile.mock.calls[0][0];
|
|
341
368
|
expect(tmp).toMatch(/^\/repo\/target\.txt\.tmp-/);
|
|
@@ -349,6 +376,7 @@ describe('fs write', () => {
|
|
|
349
376
|
if (targetPath === '/repo/link.txt') return '/outside/target.txt';
|
|
350
377
|
return targetPath;
|
|
351
378
|
}),
|
|
379
|
+
stat: vi.fn(async () => ({ isFile: () => true, size: 3, mtimeMs: 1000 })),
|
|
352
380
|
readFile: vi.fn(async () => 'old'),
|
|
353
381
|
mkdir: vi.fn(async () => undefined),
|
|
354
382
|
writeFile: vi.fn(async () => undefined),
|
|
@@ -366,6 +394,336 @@ describe('fs write', () => {
|
|
|
366
394
|
});
|
|
367
395
|
});
|
|
368
396
|
|
|
397
|
+
describe('fs file-save revisions (finding #8)', () => {
|
|
398
|
+
const createMemoryFs = (initial = {}) => {
|
|
399
|
+
const store = new Map(Object.entries(initial));
|
|
400
|
+
let mtimeSeq = 1000;
|
|
401
|
+
const calls = { chmod: [] };
|
|
402
|
+
const enoent = () => Object.assign(new Error('not found'), { code: 'ENOENT' });
|
|
403
|
+
const fsPromises = {
|
|
404
|
+
realpath: vi.fn(async (targetPath) => targetPath),
|
|
405
|
+
stat: vi.fn(async (targetPath) => {
|
|
406
|
+
if (!store.has(targetPath)) throw enoent();
|
|
407
|
+
const content = store.get(targetPath) ?? '';
|
|
408
|
+
return {
|
|
409
|
+
isFile: () => true,
|
|
410
|
+
size: Buffer.byteLength(content, 'utf8'),
|
|
411
|
+
mtimeMs: 1000 + (store.get(`${targetPath}:mtime`) ?? 0),
|
|
412
|
+
mode: 0o100600,
|
|
413
|
+
};
|
|
414
|
+
}),
|
|
415
|
+
readFile: vi.fn(async (targetPath, encoding) => {
|
|
416
|
+
if (!store.has(targetPath)) throw enoent();
|
|
417
|
+
const content = store.get(targetPath) ?? '';
|
|
418
|
+
if (encoding === undefined || Buffer.isBuffer(content)) return Buffer.from(content, 'utf8');
|
|
419
|
+
return content;
|
|
420
|
+
}),
|
|
421
|
+
mkdir: vi.fn(async () => undefined),
|
|
422
|
+
writeFile: vi.fn(async (targetPath, content) => {
|
|
423
|
+
store.set(targetPath, typeof content === 'string' ? content : String(content));
|
|
424
|
+
}),
|
|
425
|
+
chmod: vi.fn(async (targetPath, mode) => {
|
|
426
|
+
calls.chmod.push([targetPath, mode]);
|
|
427
|
+
}),
|
|
428
|
+
rename: vi.fn(async (tmp, dest) => {
|
|
429
|
+
if (!store.has(tmp)) throw enoent();
|
|
430
|
+
store.set(dest, store.get(tmp));
|
|
431
|
+
store.delete(tmp);
|
|
432
|
+
store.set(`${dest}:mtime`, (store.get(`${dest}:mtime`) ?? 0) + 1);
|
|
433
|
+
mtimeSeq += 1;
|
|
434
|
+
}),
|
|
435
|
+
unlink: vi.fn(async (targetPath) => {
|
|
436
|
+
store.delete(targetPath);
|
|
437
|
+
}),
|
|
438
|
+
rm: vi.fn(async (targetPath) => {
|
|
439
|
+
store.delete(targetPath);
|
|
440
|
+
store.delete(`${targetPath}:mtime`);
|
|
441
|
+
}),
|
|
442
|
+
};
|
|
443
|
+
const externalWrite = (targetPath, content) => {
|
|
444
|
+
store.set(targetPath, content);
|
|
445
|
+
store.set(`${targetPath}:mtime`, (store.get(`${targetPath}:mtime`) ?? 0) + 7);
|
|
446
|
+
};
|
|
447
|
+
const externalDelete = (targetPath) => {
|
|
448
|
+
store.delete(targetPath);
|
|
449
|
+
store.delete(`${targetPath}:mtime`);
|
|
450
|
+
};
|
|
451
|
+
return { store, fsPromises, calls, externalWrite, externalDelete };
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
const registerReadWrite = (fsPromises) => {
|
|
455
|
+
const { app, getRoute } = createRouteRegistry();
|
|
456
|
+
registerFsRoutes(app, {
|
|
457
|
+
os: { homedir: () => '/home/user' },
|
|
458
|
+
path: path.posix,
|
|
459
|
+
fsPromises: { realpath: async (p) => p, ...fsPromises },
|
|
460
|
+
spawn: vi.fn(),
|
|
461
|
+
crypto: { randomUUID: () => 'job-0' },
|
|
462
|
+
normalizeDirectoryPath: (p) => p,
|
|
463
|
+
resolveProjectDirectory: async () => ({ directory: '/repo' }),
|
|
464
|
+
buildAugmentedPath: () => '/usr/bin',
|
|
465
|
+
resolveGitBinaryForSpawn: () => 'git',
|
|
466
|
+
pichamberUserConfigRoot: '/home/user/.config',
|
|
467
|
+
});
|
|
468
|
+
return {
|
|
469
|
+
read: getRoute('GET', '/api/fs/read'),
|
|
470
|
+
write: getRoute('POST', '/api/fs/write'),
|
|
471
|
+
stat: getRoute('GET', '/api/fs/stat'),
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
it('two readers observe the same opaque revision', async () => {
|
|
476
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'hello' });
|
|
477
|
+
const { read } = registerReadWrite(mem.fsPromises);
|
|
478
|
+
const first = createMockResponse();
|
|
479
|
+
await read({ query: { path: '/repo/a.txt' } }, first);
|
|
480
|
+
const second = createMockResponse();
|
|
481
|
+
await read({ query: { path: '/repo/a.txt' } }, second);
|
|
482
|
+
expect(first.body).toBe('hello');
|
|
483
|
+
expect(second.body).toBe('hello');
|
|
484
|
+
const revA = first.getHeader('x-pichamber-file-revision');
|
|
485
|
+
const revB = second.getHeader('x-pichamber-file-revision');
|
|
486
|
+
expect(typeof revA).toBe('string');
|
|
487
|
+
expect(revA).toBe(revB);
|
|
488
|
+
expect(revA.startsWith('v1:')).toBe(true);
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
it('serializes simultaneous same-revision writes: first wins, second conflicts', async () => {
|
|
492
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'base' });
|
|
493
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
494
|
+
const readRes = createMockResponse();
|
|
495
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
496
|
+
const baseRev = readRes.getHeader('x-pichamber-file-revision');
|
|
497
|
+
const [firstRes, secondRes] = await Promise.all([
|
|
498
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/a.txt', content: 'writer-one', expectedRevision: baseRev } }, r); return r; })(),
|
|
499
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/a.txt', content: 'writer-two', expectedRevision: baseRev } }, r); return r; })(),
|
|
500
|
+
]);
|
|
501
|
+
const successes = [firstRes, secondRes].filter((r) => r.statusCode === 200);
|
|
502
|
+
const conflicts = [firstRes, secondRes].filter((r) => r.statusCode === 409);
|
|
503
|
+
expect(successes).toHaveLength(1);
|
|
504
|
+
expect(conflicts).toHaveLength(1);
|
|
505
|
+
expect(conflicts[0].body.reason).toBe('file-revision-conflict');
|
|
506
|
+
expect(typeof conflicts[0].body.currentRevision).toBe('string');
|
|
507
|
+
expect(conflicts[0].body.exists).toBe(true);
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
it('rejects stale revisions after an external change with the current revision', async () => {
|
|
511
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'v1' });
|
|
512
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
513
|
+
const readRes = createMockResponse();
|
|
514
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
515
|
+
const stale = readRes.getHeader('x-pichamber-file-revision');
|
|
516
|
+
mem.externalWrite('/repo/a.txt', 'external');
|
|
517
|
+
const writeRes = createMockResponse();
|
|
518
|
+
await write({ body: { path: '/repo/a.txt', content: 'stale-write', expectedRevision: stale } }, writeRes);
|
|
519
|
+
expect(writeRes.statusCode).toBe(409);
|
|
520
|
+
expect(writeRes.body).toMatchObject({ reason: 'file-revision-conflict', exists: true });
|
|
521
|
+
expect(typeof writeRes.body.currentRevision).toBe('string');
|
|
522
|
+
expect(writeRes.body.currentRevision).not.toBe(stale);
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
it('conflicts with exists:false after external delete', async () => {
|
|
526
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'v1' });
|
|
527
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
528
|
+
const readRes = createMockResponse();
|
|
529
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
530
|
+
const stale = readRes.getHeader('x-pichamber-file-revision');
|
|
531
|
+
mem.externalDelete('/repo/a.txt');
|
|
532
|
+
const writeRes = createMockResponse();
|
|
533
|
+
await write({ body: { path: '/repo/a.txt', content: 'resurrect', expectedRevision: stale } }, writeRes);
|
|
534
|
+
expect(writeRes.statusCode).toBe(409);
|
|
535
|
+
expect(writeRes.body).toMatchObject({ reason: 'file-revision-conflict', exists: false, currentRevision: null });
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
it('detects delete+recreate as a conflict for diverging writes', async () => {
|
|
539
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'v1' });
|
|
540
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
541
|
+
const readRes = createMockResponse();
|
|
542
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
543
|
+
const stale = readRes.getHeader('x-pichamber-file-revision');
|
|
544
|
+
mem.externalDelete('/repo/a.txt');
|
|
545
|
+
mem.externalWrite('/repo/a.txt', 'recreated');
|
|
546
|
+
const writeRes = createMockResponse();
|
|
547
|
+
await write({ body: { path: '/repo/a.txt', content: 'diverged', expectedRevision: stale } }, writeRes);
|
|
548
|
+
expect(writeRes.statusCode).toBe(409);
|
|
549
|
+
expect(writeRes.body.exists).toBe(true);
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
it('serializes the new-file race: second create-only writer conflicts', async () => {
|
|
553
|
+
const mem = createMemoryFs({});
|
|
554
|
+
const { write } = registerReadWrite(mem.fsPromises);
|
|
555
|
+
const [firstRes, secondRes] = await Promise.all([
|
|
556
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/new.txt', content: 'first', expectedRevision: null } }, r); return r; })(),
|
|
557
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/new.txt', content: 'second', expectedRevision: null } }, r); return r; })(),
|
|
558
|
+
]);
|
|
559
|
+
const successes = [firstRes, secondRes].filter((r) => r.statusCode === 200);
|
|
560
|
+
const conflicts = [firstRes, secondRes].filter((r) => r.statusCode === 409);
|
|
561
|
+
expect(successes).toHaveLength(1);
|
|
562
|
+
expect(conflicts).toHaveLength(1);
|
|
563
|
+
expect(conflicts[0].body.reason).toBe('file-revision-conflict');
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
it('treats identical-content saves as no-ops without conflict', async () => {
|
|
567
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'same' });
|
|
568
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
569
|
+
const readRes = createMockResponse();
|
|
570
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
571
|
+
const stale = readRes.getHeader('x-pichamber-file-revision');
|
|
572
|
+
mem.externalWrite('/repo/a.txt', 'same');
|
|
573
|
+
const writeRes = createMockResponse();
|
|
574
|
+
await write({ body: { path: '/repo/a.txt', content: 'same', expectedRevision: stale } }, writeRes);
|
|
575
|
+
expect(writeRes.statusCode).toBe(200);
|
|
576
|
+
expect(writeRes.body.success).toBe(true);
|
|
577
|
+
expect(mem.fsPromises.rename).not.toHaveBeenCalled();
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
it('honors explicit overwrite over stale revisions and recreates deleted files', async () => {
|
|
581
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'v1' });
|
|
582
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
583
|
+
const readRes = createMockResponse();
|
|
584
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
585
|
+
const stale = readRes.getHeader('x-pichamber-file-revision');
|
|
586
|
+
mem.externalWrite('/repo/a.txt', 'external');
|
|
587
|
+
const overwriteRes = createMockResponse();
|
|
588
|
+
await write({ body: { path: '/repo/a.txt', content: 'forced', expectedRevision: stale, overwrite: true } }, overwriteRes);
|
|
589
|
+
expect(overwriteRes.statusCode).toBe(200);
|
|
590
|
+
expect(overwriteRes.body.success).toBe(true);
|
|
591
|
+
mem.externalDelete('/repo/a.txt');
|
|
592
|
+
const recreate = createMockResponse();
|
|
593
|
+
await write({ body: { path: '/repo/a.txt', content: 'recreated', expectedRevision: stale, overwrite: true } }, recreate);
|
|
594
|
+
expect(recreate.statusCode).toBe(200);
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
it('preserves CRLF bytes and file mode across atomic replace', async () => {
|
|
598
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'one\r\ntwo\r\n' });
|
|
599
|
+
const { write } = registerReadWrite(mem.fsPromises);
|
|
600
|
+
const writeRes = createMockResponse();
|
|
601
|
+
await write({ body: { path: '/repo/a.txt', content: 'a\r\nb\r\n' } }, writeRes);
|
|
602
|
+
expect(writeRes.statusCode).toBe(200);
|
|
603
|
+
expect(mem.store.get('/repo/a.txt')).toBe('a\r\nb\r\n');
|
|
604
|
+
expect(mem.calls.chmod.length).toBeGreaterThan(0);
|
|
605
|
+
expect(mem.calls.chmod[0][1] & 0o777).toBe(0o600);
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
it('exposes revisions on stat and read for guarded saves', async () => {
|
|
609
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'hello' });
|
|
610
|
+
const { read, stat } = registerReadWrite(mem.fsPromises);
|
|
611
|
+
const readRes = createMockResponse();
|
|
612
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
613
|
+
const statRes = createMockResponse();
|
|
614
|
+
await stat({ query: { path: '/repo/a.txt' } }, statRes);
|
|
615
|
+
expect(typeof readRes.getHeader('x-pichamber-file-revision')).toBe('string');
|
|
616
|
+
expect(typeof statRes.body.revision).toBe('string');
|
|
617
|
+
expect(statRes.body.revision).toBe(readRes.getHeader('x-pichamber-file-revision'));
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
it('serializes concurrent guarded writes through a symlink alias and the canonical path', async () => {
|
|
621
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'base' });
|
|
622
|
+
// /repo/link.txt is a symlink alias of /repo/a.txt: realpath maps it even
|
|
623
|
+
// though the store only knows the canonical entry.
|
|
624
|
+
mem.fsPromises.realpath = vi.fn(async (targetPath) =>
|
|
625
|
+
targetPath === '/repo/link.txt' ? '/repo/a.txt' : targetPath);
|
|
626
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
627
|
+
const readRes = createMockResponse();
|
|
628
|
+
await read({ query: { path: '/repo/link.txt' } }, readRes);
|
|
629
|
+
const baseRev = readRes.getHeader('x-pichamber-file-revision');
|
|
630
|
+
const [viaAlias, viaCanonical] = await Promise.all([
|
|
631
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/link.txt', content: 'alias-writer', expectedRevision: baseRev } }, r); return r; })(),
|
|
632
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/a.txt', content: 'canonical-writer', expectedRevision: baseRev } }, r); return r; })(),
|
|
633
|
+
]);
|
|
634
|
+
const successes = [viaAlias, viaCanonical].filter((r) => r.statusCode === 200);
|
|
635
|
+
const conflicts = [viaAlias, viaCanonical].filter((r) => r.statusCode === 409);
|
|
636
|
+
expect(successes).toHaveLength(1);
|
|
637
|
+
expect(conflicts).toHaveLength(1);
|
|
638
|
+
expect(conflicts[0].body.reason).toBe('file-revision-conflict');
|
|
639
|
+
expect(typeof conflicts[0].body.currentRevision).toBe('string');
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
it('serializes create-only writes through a dangling symlink alias and its target', async () => {
|
|
643
|
+
const mem = createMemoryFs({});
|
|
644
|
+
// Dangling symlink: realpath resolves the alias name to the missing target.
|
|
645
|
+
mem.fsPromises.realpath = vi.fn(async (targetPath) =>
|
|
646
|
+
targetPath === '/repo/link.txt' ? '/repo/a.txt' : targetPath);
|
|
647
|
+
const { write } = registerReadWrite(mem.fsPromises);
|
|
648
|
+
const [viaAlias, viaTarget] = await Promise.all([
|
|
649
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/link.txt', content: 'alias-create', expectedRevision: null } }, r); return r; })(),
|
|
650
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/a.txt', content: 'target-create', expectedRevision: null } }, r); return r; })(),
|
|
651
|
+
]);
|
|
652
|
+
const successes = [viaAlias, viaTarget].filter((r) => r.statusCode === 200);
|
|
653
|
+
const conflicts = [viaAlias, viaTarget].filter((r) => r.statusCode === 409);
|
|
654
|
+
expect(successes).toHaveLength(1);
|
|
655
|
+
expect(conflicts).toHaveLength(1);
|
|
656
|
+
expect(conflicts[0].body.reason).toBe('file-revision-conflict');
|
|
657
|
+
expect(conflicts[0].body.exists).toBe(true);
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
it('skips read+hash on stat when knownRevision still matches', async () => {
|
|
661
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'hello' });
|
|
662
|
+
const { read, stat } = registerReadWrite(mem.fsPromises);
|
|
663
|
+
const readRes = createMockResponse();
|
|
664
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
665
|
+
const baseRev = readRes.getHeader('x-pichamber-file-revision');
|
|
666
|
+
// The initial read consumes one readFile call; stat must add none.
|
|
667
|
+
const readCallsAfterRead = mem.fsPromises.readFile.mock.calls.length;
|
|
668
|
+
const statRes = createMockResponse();
|
|
669
|
+
await stat({ query: { path: '/repo/a.txt', knownRevision: baseRev } }, statRes);
|
|
670
|
+
expect(statRes.statusCode).toBe(200);
|
|
671
|
+
expect(statRes.body.revision).toBe(baseRev);
|
|
672
|
+
expect(statRes.body.exists).toBe(true);
|
|
673
|
+
// The cheap path must not read the file again.
|
|
674
|
+
expect(mem.fsPromises.readFile.mock.calls.length).toBe(readCallsAfterRead);
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
it('recomputes the revision when knownRevision no longer matches', async () => {
|
|
678
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'hello' });
|
|
679
|
+
const { read, stat } = registerReadWrite(mem.fsPromises);
|
|
680
|
+
const readRes = createMockResponse();
|
|
681
|
+
await read({ query: { path: '/repo/a.txt' } }, readRes);
|
|
682
|
+
const baseRev = readRes.getHeader('x-pichamber-file-revision');
|
|
683
|
+
mem.externalWrite('/repo/a.txt', 'changed');
|
|
684
|
+
const statRes = createMockResponse();
|
|
685
|
+
await stat({ query: { path: '/repo/a.txt', knownRevision: baseRev } }, statRes);
|
|
686
|
+
expect(statRes.statusCode).toBe(200);
|
|
687
|
+
expect(statRes.body.revision).not.toBe(baseRev);
|
|
688
|
+
expect(typeof statRes.body.revision).toBe('string');
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
it('does not shortcut a hand-crafted revision whose hash contradicts the ceiling', async () => {
|
|
692
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'tiny' });
|
|
693
|
+
const { stat } = registerReadWrite(mem.fsPromises);
|
|
694
|
+
// A revision claiming a hash for a size above the hash ceiling is
|
|
695
|
+
// inconsistent (clients must only echo server revisions). Size+mtime
|
|
696
|
+
// match, but the server must still recompute instead of echoing it back.
|
|
697
|
+
const fakeHash = 'a'.repeat(64);
|
|
698
|
+
const craftedRevision = `v1:${5 * 1024 * 1024 + 1}:1000:${fakeHash}`;
|
|
699
|
+
const statRes = createMockResponse();
|
|
700
|
+
await stat({ query: { path: '/repo/a.txt', knownRevision: craftedRevision } }, statRes);
|
|
701
|
+
expect(statRes.body.revision).not.toBe(craftedRevision);
|
|
702
|
+
expect(statRes.body.revision).toMatch(/^v1:4:1000:[0-9a-f]{64}$/);
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
it('serializes concurrent guarded writes through two symlink aliases of one file', async () => {
|
|
706
|
+
const mem = createMemoryFs({ '/repo/a.txt': 'base' });
|
|
707
|
+
mem.fsPromises.realpath = vi.fn(async (targetPath) => {
|
|
708
|
+
if (targetPath === '/repo/link-one.txt' || targetPath === '/repo/link-two.txt') return '/repo/a.txt';
|
|
709
|
+
return targetPath;
|
|
710
|
+
});
|
|
711
|
+
const { read, write } = registerReadWrite(mem.fsPromises);
|
|
712
|
+
const readRes = createMockResponse();
|
|
713
|
+
await read({ query: { path: '/repo/link-two.txt' } }, readRes);
|
|
714
|
+
const baseRev = readRes.getHeader('x-pichamber-file-revision');
|
|
715
|
+
const [first, second] = await Promise.all([
|
|
716
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/link-one.txt', content: 'one', expectedRevision: baseRev } }, r); return r; })(),
|
|
717
|
+
(async () => { const r = createMockResponse(); await write({ body: { path: '/repo/link-two.txt', content: 'two', expectedRevision: baseRev } }, r); return r; })(),
|
|
718
|
+
]);
|
|
719
|
+
const successes = [first, second].filter((r) => r.statusCode === 200);
|
|
720
|
+
const conflicts = [first, second].filter((r) => r.statusCode === 409);
|
|
721
|
+
expect(successes).toHaveLength(1);
|
|
722
|
+
expect(conflicts).toHaveLength(1);
|
|
723
|
+
expect(conflicts[0].body.reason).toBe('file-revision-conflict');
|
|
724
|
+
});
|
|
725
|
+
});
|
|
726
|
+
|
|
369
727
|
describe('fs read', () => {
|
|
370
728
|
it('rejects outside workspace reads without a grant', async () => {
|
|
371
729
|
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
@@ -898,6 +1256,210 @@ describe('fs list symlink path space (issue 2627)', () => {
|
|
|
898
1256
|
}
|
|
899
1257
|
});
|
|
900
1258
|
|
|
1259
|
+
describe('/api/fs/find', () => {
|
|
1260
|
+
it('searches the active workspace instead of failing during path resolution', async () => {
|
|
1261
|
+
const handler = registerFind({
|
|
1262
|
+
fsPromises: {
|
|
1263
|
+
readdir: vi.fn(async (directory) => directory === '/repo'
|
|
1264
|
+
? [{ name: 'src', isDirectory: () => true, isFile: () => false }]
|
|
1265
|
+
: [{ name: 'app.ts', isDirectory: () => false, isFile: () => true }]),
|
|
1266
|
+
},
|
|
1267
|
+
spawn: createSpawn().spawn,
|
|
1268
|
+
});
|
|
1269
|
+
const res = createMockResponse();
|
|
1270
|
+
|
|
1271
|
+
await handler({
|
|
1272
|
+
query: {
|
|
1273
|
+
directory: '/repo',
|
|
1274
|
+
query: 'app',
|
|
1275
|
+
limit: '80',
|
|
1276
|
+
includeHidden: 'true',
|
|
1277
|
+
respectGitignore: 'true',
|
|
1278
|
+
type: 'file',
|
|
1279
|
+
},
|
|
1280
|
+
}, res);
|
|
1281
|
+
|
|
1282
|
+
expect(res.statusCode).toBe(200);
|
|
1283
|
+
expect(res.body).toEqual({
|
|
1284
|
+
files: [{
|
|
1285
|
+
name: 'app.ts',
|
|
1286
|
+
path: '/repo/src/app.ts',
|
|
1287
|
+
relativePath: 'src/app.ts',
|
|
1288
|
+
extension: 'ts',
|
|
1289
|
+
}],
|
|
1290
|
+
});
|
|
1291
|
+
});
|
|
1292
|
+
|
|
1293
|
+
it('returns matching directories', async () => {
|
|
1294
|
+
const handler = registerFind({
|
|
1295
|
+
fsPromises: {
|
|
1296
|
+
readdir: vi.fn(async (directory) => directory === '/repo'
|
|
1297
|
+
? [{ name: 'src', isDirectory: () => true, isFile: () => false }]
|
|
1298
|
+
: []),
|
|
1299
|
+
},
|
|
1300
|
+
spawn: createSpawn().spawn,
|
|
1301
|
+
});
|
|
1302
|
+
const res = createMockResponse();
|
|
1303
|
+
|
|
1304
|
+
await handler({
|
|
1305
|
+
query: {
|
|
1306
|
+
directory: '/repo',
|
|
1307
|
+
query: 'src',
|
|
1308
|
+
type: 'directory',
|
|
1309
|
+
respectGitignore: 'true',
|
|
1310
|
+
},
|
|
1311
|
+
}, res);
|
|
1312
|
+
|
|
1313
|
+
expect(res.statusCode).toBe(200);
|
|
1314
|
+
expect(res.body.files).toEqual([{
|
|
1315
|
+
name: 'src',
|
|
1316
|
+
path: '/repo/src',
|
|
1317
|
+
relativePath: 'src',
|
|
1318
|
+
}]);
|
|
1319
|
+
});
|
|
1320
|
+
|
|
1321
|
+
it('does not return gitignored files', async () => {
|
|
1322
|
+
const spawn = vi.fn((_command, _args, options) => {
|
|
1323
|
+
const child = new EventEmitter();
|
|
1324
|
+
child.stdout = new EventEmitter();
|
|
1325
|
+
child.stderr = new EventEmitter();
|
|
1326
|
+
child.kill = () => {};
|
|
1327
|
+
queueMicrotask(() => {
|
|
1328
|
+
if (options.cwd === '/repo') {
|
|
1329
|
+
child.stdout.emit('data', Buffer.from('ignored.ts\n'));
|
|
1330
|
+
}
|
|
1331
|
+
child.emit('close', 0, null);
|
|
1332
|
+
});
|
|
1333
|
+
return child;
|
|
1334
|
+
});
|
|
1335
|
+
const handler = registerFind({
|
|
1336
|
+
fsPromises: {
|
|
1337
|
+
readdir: vi.fn(async () => [
|
|
1338
|
+
{ name: 'ignored.ts', isDirectory: () => false, isFile: () => true },
|
|
1339
|
+
{ name: 'visible.ts', isDirectory: () => false, isFile: () => true },
|
|
1340
|
+
]),
|
|
1341
|
+
},
|
|
1342
|
+
spawn,
|
|
1343
|
+
});
|
|
1344
|
+
const res = createMockResponse();
|
|
1345
|
+
|
|
1346
|
+
await handler({
|
|
1347
|
+
query: {
|
|
1348
|
+
directory: '/repo',
|
|
1349
|
+
query: 'i',
|
|
1350
|
+
type: 'file',
|
|
1351
|
+
respectGitignore: 'true',
|
|
1352
|
+
},
|
|
1353
|
+
}, res);
|
|
1354
|
+
|
|
1355
|
+
expect(res.statusCode).toBe(200);
|
|
1356
|
+
expect(res.body.files.map((file) => file.name)).toEqual(['visible.ts']);
|
|
1357
|
+
expect(spawn).toHaveBeenCalledTimes(1);
|
|
1358
|
+
});
|
|
1359
|
+
|
|
1360
|
+
it('keeps result paths in the requested symlink path space', async () => {
|
|
1361
|
+
const handler = registerFind({
|
|
1362
|
+
fsPromises: {
|
|
1363
|
+
realpath: vi.fn(async (targetPath) => targetPath === '/repo-link' ? '/repo' : targetPath),
|
|
1364
|
+
readdir: vi.fn(async () => [
|
|
1365
|
+
{ name: 'app.ts', isDirectory: () => false, isFile: () => true },
|
|
1366
|
+
]),
|
|
1367
|
+
},
|
|
1368
|
+
spawn: createSpawn().spawn,
|
|
1369
|
+
resolveProjectDirectory: async () => ({ directory: '/repo-link' }),
|
|
1370
|
+
});
|
|
1371
|
+
const res = createMockResponse();
|
|
1372
|
+
|
|
1373
|
+
await handler({
|
|
1374
|
+
query: {
|
|
1375
|
+
directory: '/repo-link',
|
|
1376
|
+
query: 'app',
|
|
1377
|
+
type: 'file',
|
|
1378
|
+
respectGitignore: 'true',
|
|
1379
|
+
},
|
|
1380
|
+
}, res);
|
|
1381
|
+
|
|
1382
|
+
expect(res.statusCode).toBe(200);
|
|
1383
|
+
expect(res.body.files[0]).toMatchObject({
|
|
1384
|
+
path: '/repo-link/app.ts',
|
|
1385
|
+
relativePath: 'app.ts',
|
|
1386
|
+
});
|
|
1387
|
+
});
|
|
1388
|
+
|
|
1389
|
+
it('shares gitignore checks across concurrent file and directory searches', async () => {
|
|
1390
|
+
const deferred = createDeferredSpawn();
|
|
1391
|
+
const handler = registerFind({
|
|
1392
|
+
fsPromises: {
|
|
1393
|
+
readdir: vi.fn(async () => [
|
|
1394
|
+
{ name: 'app.ts', isDirectory: () => false, isFile: () => true },
|
|
1395
|
+
]),
|
|
1396
|
+
},
|
|
1397
|
+
spawn: deferred.spawn,
|
|
1398
|
+
});
|
|
1399
|
+
const fileResponse = createMockResponse();
|
|
1400
|
+
const directoryResponse = createMockResponse();
|
|
1401
|
+
|
|
1402
|
+
const fileSearch = handler({
|
|
1403
|
+
query: { directory: '/repo', query: 'app', type: 'file', respectGitignore: 'true' },
|
|
1404
|
+
}, fileResponse);
|
|
1405
|
+
const directorySearch = handler({
|
|
1406
|
+
query: { directory: '/repo', query: 'app', type: 'directory', respectGitignore: 'true' },
|
|
1407
|
+
}, directoryResponse);
|
|
1408
|
+
|
|
1409
|
+
await vi.waitFor(() => expect(deferred.spawn).toHaveBeenCalledTimes(1));
|
|
1410
|
+
deferred.closeNext();
|
|
1411
|
+
await Promise.all([fileSearch, directorySearch]);
|
|
1412
|
+
|
|
1413
|
+
expect(fileResponse.statusCode).toBe(200);
|
|
1414
|
+
expect(directoryResponse.statusCode).toBe(200);
|
|
1415
|
+
expect(deferred.spawn).toHaveBeenCalledTimes(1);
|
|
1416
|
+
});
|
|
1417
|
+
|
|
1418
|
+
it('bounds a stalled gitignore check instead of returning unfiltered files', async () => {
|
|
1419
|
+
const previousTimeout = process.env.PICHAMBER_GIT_CHECK_IGNORE_TIMEOUT_MS;
|
|
1420
|
+
process.env.PICHAMBER_GIT_CHECK_IGNORE_TIMEOUT_MS = '5';
|
|
1421
|
+
let killed = false;
|
|
1422
|
+
const spawn = vi.fn(() => {
|
|
1423
|
+
const child = new EventEmitter();
|
|
1424
|
+
child.stdout = new EventEmitter();
|
|
1425
|
+
child.stderr = new EventEmitter();
|
|
1426
|
+
child.kill = () => { killed = true; };
|
|
1427
|
+
return child;
|
|
1428
|
+
});
|
|
1429
|
+
|
|
1430
|
+
try {
|
|
1431
|
+
const handler = registerFind({
|
|
1432
|
+
fsPromises: {
|
|
1433
|
+
readdir: vi.fn(async () => [
|
|
1434
|
+
{ name: 'possibly-ignored.ts', isDirectory: () => false, isFile: () => true },
|
|
1435
|
+
]),
|
|
1436
|
+
},
|
|
1437
|
+
spawn,
|
|
1438
|
+
});
|
|
1439
|
+
const res = createMockResponse();
|
|
1440
|
+
|
|
1441
|
+
await handler({
|
|
1442
|
+
query: {
|
|
1443
|
+
directory: '/repo',
|
|
1444
|
+
query: 'ignored',
|
|
1445
|
+
type: 'file',
|
|
1446
|
+
respectGitignore: 'true',
|
|
1447
|
+
},
|
|
1448
|
+
}, res);
|
|
1449
|
+
|
|
1450
|
+
expect(killed).toBe(true);
|
|
1451
|
+
expect(res.statusCode).toBe(500);
|
|
1452
|
+
expect(res.body.files).toBeUndefined();
|
|
1453
|
+
} finally {
|
|
1454
|
+
if (previousTimeout === undefined) {
|
|
1455
|
+
delete process.env.PICHAMBER_GIT_CHECK_IGNORE_TIMEOUT_MS;
|
|
1456
|
+
} else {
|
|
1457
|
+
process.env.PICHAMBER_GIT_CHECK_IGNORE_TIMEOUT_MS = previousTimeout;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
});
|
|
1462
|
+
|
|
901
1463
|
describe('/api/fs/home', () => {
|
|
902
1464
|
const registerHome = ({ env = {}, homedir = () => '/home/user' } = {}) => {
|
|
903
1465
|
const { app, getRoute } = createRouteRegistry();
|