| 5 | const first = 'rows: 1 (cols: n.name)\n first\nreturned: 1\ntotal: 2\ntotal_relation: eq\nhas_more: true\ntruncated: true\ntruncation_reason: output_budget\nnext_cursor: q1.next\nnext_offset: 1\n'; |
| 6 | const last = 'rows: 1 (cols: n.name)\n last\nreturned: 1\ntotal: 2\noffset: 1\ntotal_relation: eq\nhas_more: false\ntruncated: false\n'; |
| 7 | function client(end = last) { |
| 8 | const rpc = new FakeRpc([ |
| 9 | { tool: 'query_graph', when: args => args.cursor === 'q1.next', text: end }, |
| 10 | { tool: 'query_graph', text: first }, |
| 11 | ]); |
| 12 | return { rpc, client: new RpcIntelligenceClient({ fetch: rpc.fetch }) }; |
| 13 | } |
| 14 | |
| 15 | it('reads cursor pages without losing the project, query or row order', async () => { |
| 16 | const { client: c, rpc } = client(); |