- Add `thread.proposed-plan-upserted` orchestration flow from ingestion through decider/projector - Store proposed plans in a dedicated projection table and include them in snapshot queries - Update provider runtime/web handling and tests to use proposed plans instead of assistant message wrappers
23 lines
628 B
TypeScript
23 lines
628 B
TypeScript
import * as Effect from "effect/Effect";
|
|
import * as SqlClient from "effect/unstable/sql/SqlClient";
|
|
|
|
export default Effect.gen(function* () {
|
|
const sql = yield* SqlClient.SqlClient;
|
|
|
|
yield* sql`
|
|
CREATE TABLE IF NOT EXISTS projection_thread_proposed_plans (
|
|
plan_id TEXT PRIMARY KEY,
|
|
thread_id TEXT NOT NULL,
|
|
turn_id TEXT,
|
|
plan_markdown TEXT NOT NULL,
|
|
created_at TEXT NOT NULL,
|
|
updated_at TEXT NOT NULL
|
|
)
|
|
`;
|
|
|
|
yield* sql`
|
|
CREATE INDEX IF NOT EXISTS idx_projection_thread_proposed_plans_thread_created
|
|
ON projection_thread_proposed_plans(thread_id, created_at)
|
|
`;
|
|
});
|