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

main
ts 30 lines 1.05 KB
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 yield* sql`
8 CREATE INDEX orchestration_events_v2_created_threads_idx
9 ON orchestration_events(stream_id)
10 WHERE application_event_version = 2
11 AND aggregate_kind = 'thread'
12 AND event_type = 'thread.created'
13 `;
14 yield* sql`
15 CREATE INDEX orchestration_v2_projection_runs_recovery_idx
16 ON orchestration_v2_projection_runs(status, thread_id)
17 WHERE status IN ('queued', 'preparing', 'starting', 'running', 'waiting')
18 `;
19 yield* sql`
20 CREATE INDEX orchestration_v2_projection_requests_recovery_idx
21 ON orchestration_v2_projection_runtime_requests(thread_id)
22 WHERE status = 'pending'
23 `;
24 yield* sql`
25 CREATE INDEX orchestration_v2_projection_turn_items_recovery_idx
26 ON orchestration_v2_projection_turn_items(thread_id)
27 WHERE type IN ('command_execution', 'dynamic_tool', 'subagent')
28 AND status IN ('pending', 'running', 'waiting')
29 `;
30 });