The best way to control Claude Code, Codex and more from any computer or phone

main
ts 19 lines 775 Bytes
Raw
1 import * as Effect from "effect/Effect";
2 import * as SqlClient from "effect/sql/SqlClient";
3
4 export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6
7 // Recovery and provider-thread reads filter live items by this exact predicate; without
8 // these, each read walked every historical item in the thread.
9 yield* sql`
10 CREATE INDEX orchestration_v2_projection_turn_items_active_ordinal_idx
11 ON orchestration_v2_projection_turn_items(thread_id, ordinal, turn_item_id)
12 WHERE status IN ('pending', 'running', 'waiting')
13 `;
14 yield* sql`
15 CREATE INDEX orchestration_v2_projection_turn_items_active_run_idx
16 ON orchestration_v2_projection_turn_items(thread_id, run_id)
17 WHERE status IN ('pending', 'running', 'waiting')
18 `;
19 });