MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / writeIncrementalJsonl

Function writeIncrementalJsonl

apps/cli/src/import/stream-import.test.ts:37–56  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

35}
36
37function writeIncrementalJsonl(filePath: string): void {
38 const rows = [
39 {
40 _type: 'header',
41 chatlab: { version: '1.0.0', exportedAt: 1780830000 },
42 meta: { name: 'Incremental Chat', platform: 'qq', type: 'group' },
43 },
44 { _type: 'member', platformId: 'u1', accountName: 'Alice' },
45 {
46 _type: 'message',
47 sender: 'u1',
48 accountName: 'Alice',
49 timestamp: 2000,
50 type: 0,
51 content: 'new incremental message',
52 platformMessageId: 'm1',
53 },
54 ]
55 fs.writeFileSync(filePath, rows.map((row) => JSON.stringify(row)).join('\n'), 'utf-8')
56}
57
58test('incrementalImport raises the data directory gate after successful writes', async () => {
59 const root = makeTempDir()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected