Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

086_QueuedTurnInputIndex.ts

15 lines557 Bytes

1import * as Effect from "effect/Effect";
2import * as SqlClient from "effect/sql/SqlClient";
3​
4export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6​
7 // Shell counts subtract held input without reading a run's tool history or item payloads.
8 yield* sql`
9 CREATE INDEX orchestration_v2_projection_turn_items_queued_input_idx
10 ON orchestration_v2_projection_turn_items(run_id)
11 WHERE type = 'user_message'
12 AND json_valid(payload_json)
13 AND json_extract(payload_json, '$.inputIntent') = 'queued_turn'
14 `;
15});