openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2,916 lines • 590 kB
JavaScript
import{A as e,D as t,J as n,K as r,N as i,U as a,W as o,a as s,d as c,et as l,i as u,k as d,n as f,t as p,vt as m}from"./read-only.worker-subsystem-UGB_-INE.mjs";import{$ as h,$t as g,A as ee,At as _,B as te,C as ne,Ct as re,Dt as ie,E as ae,Et as oe,F as se,Ft as ce,G as le,H as ue,Ht as de,J as fe,K as pe,Kt as me,Lt as he,M as v,Mt as ge,Nt as _e,Ot as ve,P as ye,Pt as be,Q as xe,Qt as Se,R as Ce,St as we,T as Te,Tt as Ee,U as De,Ut as Oe,V as ke,W as Ae,X as je,Z as Me,Zt as Ne,_ as Pe,a as Fe,at as Ie,b as Le,bt as y,c as Re,ct as ze,d as Be,dt as Ve,et as He,f as Ue,h as We,i as Ge,it as Ke,j as qe,jt as Je,k as Ye,kt as Xe,l as Ze,lt as Qe,m as $e,n as et,nt as tt,o as nt,ot as rt,p as it,pt as at,q as ot,r as st,rt as ct,s as b,st as lt,t as ut,tt as x,u as dt,ut as ft,v as pt,vt as mt,w as ht,wt as gt,x as _t,xt as vt,z as yt}from"./read-only.worker-openclaw-state-worker-error-Dcs7kbI9.mjs";import{c as bt}from"./read-only.worker-pid-alive-CSQiuG7z.mjs";import{r as xt,t as St}from"./read-only.worker-deferred-mULUX_rS.mjs";import"./read-only.worker-openclaw-root-bzhbMXdO.mjs";import{An as Ct,At as S,Bn as wt,Bt as C,Cn as Tt,Fr as Et,Ft as Dt,Gn as Ot,Gr as kt,Hn as At,Ht as jt,It as Mt,Jn as Nt,Kn as Pt,Lr as w,Lt as Ft,Nr as It,Nt as Lt,On as Rt,Or as zt,Pn as Bt,Pr as T,Qn as Vt,Qt as Ht,Ur as E,Ut,Vt as Wt,Wn as D,Wt as Gt,Xt as Kt,Zt as qt,bn as Jt,ct as Yt,dt as Xt,fn as Zt,ft as Qt,gr as $t,gt as en,h as tn,kt as nn,ln as rn,lr as an,mn as on,mt as sn,pr as cn,pt as ln,qn as O,qt as un,un as dn,ur as fn,ut as k,vn as pn,w as mn,xn as hn,z as gn,zr as A}from"./read-only.worker-sqlite-worker-operation-settlement-OlWrPoba.mjs";import"./read-only.worker-errors-B4_gOnq5.mjs";import{r as _n}from"./read-only.worker-path-existence-D3jH5IBa.mjs";import{i as vn,l as yn,n as bn}from"./read-only.worker-worker-task-pool-OfYLVPLI.mjs";import{$ as xn,B as j,F as M,G as Sn,H as Cn,K as wn,L as N,N as Tn,P as En,Q as Dn,R as On,S as kn,U as An,V as P,W as jn,Y as Mn,Z as Nn,_ as Pn,a as Fn,at as F,ct as In,d as Ln,et as Rn,f as zn,h as Bn,i as Vn,it as Hn,m as Un,n as Wn,nt as Gn,o as Kn,ot as I,p as qn,q as Jn,rt as L,st as R,t as Yn,tt as Xn,u as Zn,v as Qn,x as $n,y as er,z as tr}from"./read-only.worker.js";import{createRequire as nr}from"node:module";import{createHash as rr,randomUUID as ir}from"node:crypto";import"node:util";import z,{existsSync as ar,realpathSync as or}from"node:fs";import"node:fs/promises";import B from"node:path";import{fileURLToPath as sr}from"node:url";import{AsyncLocalStorage as V}from"node:async_hooks";import{createDirectorySync as cr}from"@openclaw/fs-safe/advanced";import{FsSafeError as lr}from"@openclaw/fs-safe/errors";import"node:perf_hooks";import{MessageChannel as ur,isMainThread as dr,receiveMessageOnPort as fr}from"node:worker_threads";import"semver";import"json5";var pr=Object.defineProperty,__exportAll=(e,t)=>{let n={};for(var r in e)pr(n,r,{get:e[r],enumerable:!0});return t||pr(n,Symbol.toStringTag,{value:`Module`}),n};function finiteNonNegativeNumber(e){let t=Number(e);return Number.isFinite(t)&&t>=0?t:null}function findExistingDiskSpacePath(e){let t=B.resolve(e);for(;;)try{return z.statSync(t).isDirectory()?t:B.dirname(t)}catch{let e=B.dirname(t);if(e===t)return null;t=e}}function tryReadDiskSpace(e){let t=findExistingDiskSpacePath(e);if(!t)return null;try{let n=z.statfsSync(t),r=finiteNonNegativeNumber(n.bsize),i=finiteNonNegativeNumber(n.bavail);if(r===null||i===null)return null;let a=finiteNonNegativeNumber(n.blocks);return{targetPath:e,checkedPath:t,availableBytes:r*i,totalBytes:a===null?null:r*a}}catch{return null}}function formatDiskSpaceBytes(e){let t=e/1048576,n=Math.max(0,Math.round(t));if(n<1024)return`${n} MiB`;let r=t/1024;return`${r.toFixed(+(r<10))} GiB`}const mr=[[`acp_parent_stream_events`,[`idx_agent_acp_parent_stream_run`]],[`agent_tool_usage`,[]],[`auth_profile_state`,[]],[`auth_profile_store`,[]],[`board_tabs`,[]],[`board_widgets`,[`idx_agent_board_widgets_tab_position`]],[`cache_entries`,[`idx_agent_cache_expiry`,`idx_agent_cache_updated`,`idx_agent_voice_session_open_scope`,`idx_agent_voice_session_open_updated`]],[`context_engine_turn_outbox`,[`idx_agent_context_engine_turn_outbox_engine`]],[`conversation_deliveries`,[`idx_agent_conversation_deliveries_reply`,`idx_agent_conversation_deliveries_source_session`,`idx_agent_conversation_deliveries_updated`]],[`conversations`,[`idx_agent_conversations_identity`,`idx_agent_conversations_lookup`,`idx_agent_conversations_updated`]],[`heartbeat_outcomes`,[]],[`memory_embedding_cache`,[`idx_memory_embedding_cache_updated_at`]],[`memory_entry_origins`,[]],[`memory_index_chunk_provenance`,[]],[`memory_index_chunk_recall_metadata`,[]],[`memory_index_chunks`,[`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_meta`,[]],[`memory_index_sources`,[`idx_memory_index_sources_source`]],[`memory_index_state`,[]],[`memory_session_tombstones`,[]],[`message_tool_run_outcomes`,[`idx_agent_message_tool_run_outcomes_occurred`]],[`schema_meta`,[]],[`session_canonical_validation_pending`,[]],[`session_conversations`,[`idx_agent_session_conversations_conversation`,`idx_agent_session_conversations_primary`]],[`session_creation_operations`,[`idx_agent_session_creation_operations_expiry`]],[`session_entry_snapshots`,[]],[`session_goal_operations`,[`idx_agent_session_goal_operations_expiry`]],[`session_input_completions`,[`idx_agent_session_input_completions_session_key`]],[`session_key_contract`,[]],[`session_members`,[`idx_agent_session_members_identity`]],[`session_nodes`,[`idx_agent_session_nodes_active`,`idx_agent_session_nodes_archived_at`,`idx_agent_session_nodes_current_session_id`,`idx_agent_session_nodes_entry_not_valid`,`idx_agent_session_nodes_entry_valid_pending`,`idx_agent_session_nodes_label`,`idx_agent_session_nodes_parent_session_key`,`idx_agent_session_nodes_spawned_by`,`idx_agent_session_nodes_status`,`idx_agent_session_nodes_updated_at`]],[`session_participants`,[]],[`session_pending_inputs`,[`idx_agent_session_pending_inputs_session`]],[`session_progress_cards`,[]],[`session_reactions`,[]],[`session_suggestions`,[`idx_agent_session_suggestions_author_created`,`idx_agent_session_suggestions_session_state_created`]],[`session_transcript_active_event_facts`,[]],[`session_transcript_active_events`,[`idx_agent_transcript_active_event_seq`,`idx_agent_transcript_active_messages`,`idx_agent_transcript_context_pending`]],[`session_transcript_archives`,[`idx_agent_session_transcript_archives_pending`,`idx_agent_session_transcript_archives_retention`]],[`session_transcript_cold_archive_chunks`,[]],[`session_transcript_cold_archives`,[]],[`session_transcript_fts`,[]],[`session_transcript_fts_config`,[]],[`session_transcript_fts_content`,[]],[`session_transcript_fts_data`,[]],[`session_transcript_fts_docsize`,[]],[`session_transcript_fts_idx`,[]],[`session_transcript_fts_rows`,[`idx_session_transcript_fts_rows_session_message`]],[`session_transcript_index_state`,[]],[`session_windows`,[`idx_agent_session_windows_conversation`,`idx_agent_session_windows_created_at`,`idx_agent_session_windows_session_key`,`idx_agent_session_windows_updated_at`]],[`standing_intents`,[`idx_standing_intents_lifecycle`,`idx_standing_intents_scope`]],[`standing_intents_fts`,[]],[`standing_intents_fts_config`,[]],[`standing_intents_fts_data`,[]],[`standing_intents_fts_docsize`,[]],[`standing_intents_fts_idx`,[]],[`trajectory_runtime_events`,[`idx_agent_trajectory_runtime_run`]],[`transcript_event_identities`,[`idx_agent_transcript_event_identity_sequence`,`idx_agent_transcript_event_sequence`,`idx_agent_transcript_message_idempotency`]],[`transcript_events`,[]],[`transcript_rewrite_watermarks`,[]],[`context_engine_turn_outbox`,[`idx_agent_context_engine_turn_outbox_engine`]],[`conversation_deliveries`,[`idx_agent_conversation_deliveries_reply`,`idx_agent_conversation_deliveries_updated`]],[`memory_embedding_cache`,[`idx_memory_embedding_cache_updated_at`]],[`memory_entry_origins`,[]],[`memory_index_chunks`,[`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_sources`,[`idx_memory_index_sources_source`]],[`session_input_completions`,[]],[`session_nodes`,[`idx_agent_session_nodes_active`,`idx_agent_session_nodes_archived_at`,`idx_agent_session_nodes_current_session_id`,`idx_agent_session_nodes_entry_not_valid`,`idx_agent_session_nodes_entry_valid_pending`,`idx_agent_session_nodes_label`,`idx_agent_session_nodes_last_interaction_at`,`idx_agent_session_nodes_parent_session_key`,`idx_agent_session_nodes_spawned_by`,`idx_agent_session_nodes_status`,`idx_agent_session_nodes_updated_at`]],[`session_participants`,[]],[`session_reactions`,[`idx_agent_session_reactions_message`]],[`session_windows`,[`idx_agent_session_windows_conversation`,`idx_agent_session_windows_created_at`,`idx_agent_session_windows_session_key`,`idx_agent_session_windows_updated_at`]],[`trajectory_runtime_events`,[`idx_agent_trajectory_runtime_run`]],[`transcript_event_identities`,[`idx_agent_transcript_event_identity_sequence`,`idx_agent_transcript_event_parent`,`idx_agent_transcript_event_sequence`,`idx_agent_transcript_message_idempotency`]],[`transcript_events`,[]],[`session_key_contract`,[]],[`session_nodes`,[`idx_agent_session_nodes_active`,`idx_agent_session_nodes_archived_at`,`idx_agent_session_nodes_current_session_id`,`idx_agent_session_nodes_entry_not_valid`,`idx_agent_session_nodes_entry_valid_pending`,`idx_agent_session_nodes_label`,`idx_agent_session_nodes_last_interaction_at`,`idx_agent_session_nodes_parent_session_key`,`idx_agent_session_nodes_spawned_by`,`idx_agent_session_nodes_status`,`idx_agent_session_nodes_updated_at`]],[`session_windows`,[`idx_agent_session_windows_conversation`,`idx_agent_session_windows_created_at`,`idx_agent_session_windows_session_key`,`idx_agent_session_windows_updated_at`]],[`session_transcript_fts_rows`,[`idx_agent_transcript_fts_rows_session`]],[`session_transcript_index_state`,[]],[`memory_index_chunks`,[`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`transcript_events`,[]],[`session_nodes`,[`idx_agent_session_nodes_active`,`idx_agent_session_nodes_archived_at`,`idx_agent_session_nodes_current_session_id`,`idx_agent_session_nodes_entry_not_valid`,`idx_agent_session_nodes_entry_valid_pending`,`idx_agent_session_nodes_label`,`idx_agent_session_nodes_last_interaction_at`,`idx_agent_session_nodes_parent_session_key`,`idx_agent_session_nodes_spawned_by`,`idx_agent_session_nodes_status`,`idx_agent_session_nodes_updated_at`]],[`session_nodes`,[`idx_agent_session_nodes_active`,`idx_agent_session_nodes_archived_at`,`idx_agent_session_nodes_current_session_id`,`idx_agent_session_nodes_entry_not_valid`,`idx_agent_session_nodes_entry_valid_pending`,`idx_agent_session_nodes_label`,`idx_agent_session_nodes_last_interaction_at`,`idx_agent_session_nodes_parent_session_key`,`idx_agent_session_nodes_spawned_by`,`idx_agent_session_nodes_status`,`idx_agent_session_nodes_updated_at`]],[`context_engine_turn_outbox`,[`idx_agent_context_engine_turn_outbox_engine`]],[`session_nodes`,[`idx_agent_session_nodes_active`,`idx_agent_session_nodes_archived_at`,`idx_agent_session_nodes_current_session_id`,`idx_agent_session_nodes_entry_not_valid`,`idx_agent_session_nodes_entry_valid_pending`,`idx_agent_session_nodes_label`,`idx_agent_session_nodes_last_interaction_at`,`idx_agent_session_nodes_parent_session_key`,`idx_agent_session_nodes_spawned_by`,`idx_agent_session_nodes_status`,`idx_agent_session_nodes_updated_at`]],[`transcript_events`,[]],[`state_leases`,[]]],hr={afcfcf93ca60eab84c0b9c33cd6d8d342d42ad526e10371f9f43a3d201a5a28e:[`agent`,`8e70873f6fddd58ffc765c3786c293164dfe8ad7754ae73272875acbae360fc7`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],[]],"0d8863d033ed867b9e5410fbf5653fff5668cde5bc9933efdc54a948ef28b3a7":[`agent-version-1`,`0ac0c6eca2bd401dba88942343f73a31b0c1fa320b4ef72672a421775667f341`,[0,2,3,4,5,6,60,61,9,10,62,63,13,14,64,16,65,18,19,20,21,23,26,66,28,29,67,68,32,33,69,35,37,38,40,41,42,43,44,45,46,48,70,50,51,52,53,54,55,71,72,73,59],[]],"987c7895f0acfaa27bdd4af5532a6a9d7364cbbefe8fe63fa9775b9520b25f85":[`agent-version-18`,`516c6a0cbc9a63134e84a65c3af806fbc6b526292c614c84109f4a2b2c106afc`,[0,2,3,4,5,6,60,61,9,10,62,63,13,14,64,16,65,18,19,20,21,23,26,66,28,29,67,31,32,33,69,35,37,38,40,41,42,43,44,45,46,48,70,50,51,52,53,54,55,71,72,73,59],[]],"7a92498057481f996a0c0716dd078ea69694645fbdb3a011dadaee411478b7ad":[`agent-version-21`,`fd83bd56e757e27046bc16f16e0dfd056a4bdb4c187672807f9286089fd4c130`,[0,2,3,4,5,6,60,61,9,10,62,63,13,14,64,16,65,18,19,20,21,22,23,26,66,74,29,75,31,32,33,69,35,37,38,40,41,42,43,44,45,46,48,76,50,51,52,53,54,55,71,72,73,59],[]],"789a67b22bc47d0b58acb19a6041b3ba55bd68c7e7271a4043573739edae02d1":[`agent-version-22`,`1571750d60d036d5b09e53c9d062396551d72f79642ee52ae104e9213da8592c`,[0,2,3,4,5,6,60,61,9,10,62,63,13,14,64,16,65,18,19,20,21,22,23,26,66,74,29,75,31,32,33,69,35,37,38,40,41,42,43,44,45,46,77,78,76,50,51,52,53,54,55,71,72,73,59],[]],dd91f9df477a6b80f156003269b951f0d4e55d62e6dec37ad23dc909ed61f71f:[`agent-version-23`,`4cd5cf45ce55fd199d3025021381ad10187c3a5db5340aec56aa108c5a315611`,[0,2,3,4,5,6,60,61,9,10,11,63,13,14,79,16,65,18,19,20,21,22,23,26,66,74,29,75,31,32,33,69,35,37,38,40,41,42,43,44,45,46,47,48,76,50,51,52,53,54,55,71,72,80,59],[]],"9b51fb6f3b7692ed5b1d114c9123184aacb35d5c8450f896b5d289fd46f0ae60":[`agent-version-24`,`7ba969c7ed61eb3596c809150d7c46676bfb3d8310052ca5f07141762b345e9b`,[0,2,3,4,5,6,60,61,9,10,11,63,13,14,79,16,65,18,19,20,21,22,23,25,26,66,74,29,81,31,32,33,69,35,37,38,40,41,42,43,44,45,46,47,48,76,50,51,52,53,54,55,71,72,80,59],[]],"17cbb50319db12e22248e0397cb068ce670687a96328f502ce3577e4798ae299":[`agent-version-25`,`f4118fc6b09e2d36542335eec66c82e9846b7f50e69e56076814dea6e1244aeb`,[0,2,3,4,5,6,60,61,9,10,11,63,13,14,79,16,65,18,19,20,21,22,23,25,26,66,28,29,82,31,32,33,69,35,37,38,40,41,42,43,44,45,46,47,48,70,50,51,52,53,54,55,71,72,80,59],[]],ff21eb3fb5a5836d520af3ea0777944cbcfa61aff52a64d0726a4d6b527823c3:[`agent-version-26`,`86dbc086643d83045d9397da12e5e7a5d197b08a10a8aea4942ee7473f03d9ee`,[0,2,3,4,5,6,83,61,9,10,11,63,13,14,79,16,65,18,19,20,21,22,23,25,26,66,28,29,84,31,32,33,69,35,37,38,40,41,42,43,44,45,46,47,48,70,50,51,52,53,54,55,71,72,85,59],[]],"227fcd299f5dfd3012abd0f110cd028ba6add9155bc74e2e558aadeae2761349":[`agent-version-27`,`40d0b84e2467b65ff57c4e8171af1a6b0cc54e0e1b5602b6abbe53fc8c10e151`,[0,2,3,4,5,6,7,61,9,10,11,63,13,14,79,16,65,18,19,20,21,22,23,25,26,66,28,29,84,31,32,33,69,35,37,38,40,41,42,43,44,45,46,47,48,70,50,51,52,53,54,55,71,72,85,59],[]],b2e17ebad450773253e5dddaeb87e6baef26b1c20a48982ed9df7ffea4210511:[`agent-version-28`,`a48c6c4d7bc63bb0c14eb2010893f31aa216e4a0ee135e40c81598a39c64b61f`,[0,2,3,4,5,6,7,61,9,10,11,12,13,14,79,16,65,18,19,20,21,22,23,25,26,66,28,29,84,31,32,33,69,35,37,38,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,71,57,85,59],[]],abf65b8c18ccb84f0e65b8e4faa6fef6abc23b6bab5e93086339f640d2146082:[`agent-version-29`,`ede47c9558c7c22dfd89ed56f0bc28a9d22e512aa69af0ae3acacc989337dc0e`,[0,2,3,4,5,6,7,61,9,10,11,12,13,14,79,16,65,18,19,20,21,22,23,25,26,66,28,29,30,31,32,33,34,35,37,38,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,71,57,85,59],[]],dbab54723ad6be5e0146085df0789ef92d03b867c53bed915d804fb4c60b3068:[`agent-version-30`,`afa4044fdeabdb3042002c27a39be73d1f2edf8c4135515266cf6613adc7f0ba`,[0,2,3,4,5,6,7,61,9,10,11,12,13,14,79,16,65,18,19,20,21,22,23,25,26,66,28,29,30,31,32,33,34,35,37,38,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,85,59],[]],"57f4523156caf6b8446afbd95e0fede01f1c917771242cd05c61c1b48b7e157e":[`agent-version-31`,`4ac0d88399760668d6021213299ff6897bcfd672d2373d5c47b6f0afa31e04a1`,[0,2,3,4,5,6,7,61,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,66,28,29,30,31,32,33,34,35,37,38,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,85,59],[]],"9ffa671518cafee606f88dd17bfdfa9792d9deece5f6773e3cae4de2c10fc84b":[`agent-version-37`,`08f828422ad38a4ad92a46abdd793fd45ce6c9e09e72d83177130079588ea41e`,[0,2,3,4,5,6,7,61,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,66,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,85,59],[]],a67326c9ddb50583c3b76b9854324d6a42a4d94b87b6aa2285cefb42a9ff1f27:[`agent-version-39`,`4a73468ea8dc4b374449c5a8455df0b5b161d9028d4e8a925763d6805dee8664`,[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],[]],"4000b93c887a95d954a139e5d78b74e06586e65f8e9dda9d8ffab73b61ee5568":[`agent-version-40`,`d84ecca0d1e44048fac7058389b356bb26e83c05c99631f5f2cbf5d442cf04f4`,[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],[]],"91916d079ab20e9e5fd2380d0ec99561d144fed2d0eeca7324d370f295a7205a":[`agent-version-41`,`6b80dff64cad8216687329ec4a9685348b511986ca622623406f44a8164b118b`,[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59],[]],"067f95cffb76737d9084b726b640bc79b266b19279e6b1a3d2322d0e298c6ab6":[`agent-v14-core`,`14b30834a4c01ee92da4b3390aebbd49d9a8f4d0fb3a40fb517b8093ffb11c76`,[0,2,3,6,60,61,9,10,62,63,13,14,64,16,65,18,19,20,21,23,26,66,28,67,68,32,37,38,40,41,42,43,44,45,46,48,70,50,51,52,53,54,55,71,72,73,59],[]],aca181a3ea4d5a94d263653e1b75d2327bd449673d631e9d22c6cb9fe25e40ea:[`agent-v14-session-sharing`,`dcd6c30e5c80fa6647cf4b3257fc0c5a6e3440c20333797263b813add4f43fa2`,[29],[]],be5d39d4389597fcfe2942f51a97d5b1f4e0aa1d6b184677e6abcedc162a2cf0:[`agent-v14-additive`,`08e596f53eef1390bb3048a8c3807ea2413fde157899e0feb314aeebeb26e132`,[69,35],[]],"9b07b30dc725415736f5873babff2b98a1e8bf40e0afbf4eb8cf3d3cf700dc0b":[`agent-v14-board`,`535e952ff0024800a42260733be4f1ab5095d5f7578d78555e351c3c336b4f5a`,[4,5],[]],"83673559dc6bba9fdf13d5a9131b030103935b04d7c81620b0a67f43cb49f970":[`agent-progress-card`,`cbda56cf07f5a79268f761f3c0478fd5c3a6ddefde2cb72a933d9eef110a17a1`,[33],[]],fdc21b6dc361c491311c11d91fbda296535a9c34dd20f0ab03b949b8a698ded0:[`agent-retired-state-leases`,`6117e088b6b48fe1007de8ef29868981f820404cc3be99040c2bcd899902b7cc`,[86],[]],c45b82b3c3aa8ecc3b2cc09dcf38bd568edfa8305f54b5bb959c975a55571ece:[`agent-legacy-participants`,`30851780a54c5bd9b7bd3be1f420fc2b3e61839901e1a726e6cb24a10f8d4276`,[68],[]],"6ce6f0ae658b1b77759d335e07e75d9371e27363c998bbf9b0e5fc5a132bc4cb":[`agent-deployed-fts-rows`,`81df0b00eeb5ae756a6acce81b099c432f6127233d47582dd60ca32eed304768`,[77],[]],"0e9e5f47efa71d187ed505aee8d1e423865a5de8df5387a15759194561307e72":[`agent-legacy-transcript-events`,`6e5d060cc60439ef893bf9bcf395552be213733a1021f82d9ea1173e6103ed2e`,[73],[]]};let gr;function readSqliteAgentFingerprint(e){let t=hr[e];if(!t)return;let[n,r,i,a]=t;return{id:n,fingerprint:r,viewNames:a,tableNames:i.map(e=>mr[e][0]),indexNames:i.flatMap(e=>mr[e][1])}}function readSqliteAgentCatalog(e){if(!hr[e])return;gr??=nr(import.meta.url)(sr(new URL(`../../assets/sqlite-schema/sqlite-agent-catalogs.json`,import.meta.url).href));let t=gr.catalogs[e];return{tables:t.tables.map(e=>gr.tables[e]),views:t.views}}const _r=[[`client_credential_migration`,[]],[`device_auth_tokens`,[`idx_device_auth_tokens_updated`]],[`device_identities`,[`idx_device_identities_device`]],[`gateway_origin_device_tokens`,[]],[`native_exec_socket_credentials`,[]]],vr={"8e4004e9307fcb7ad18d0b12c076f008afd89a8dcacff53e9d40a3b7881acab9":[`client-credentials-v1`,`a00fccb1a356c0d0f77c40341f320602e4f73396bd88865a238b7f4187edd949`,[0,1,2,3,4],[]]};let yr;function readSqliteClientFingerprint(e){let t=vr[e];if(!t)return;let[n,r,i,a]=t;return{id:n,fingerprint:r,viewNames:a,tableNames:i.map(e=>_r[e][0]),indexNames:i.flatMap(e=>_r[e][1])}}function readSqliteClientCatalog(e){if(!vr[e])return;yr??=nr(import.meta.url)(sr(new URL(`../../assets/sqlite-schema/sqlite-client-catalogs.json`,import.meta.url).href));let t=yr.catalogs[e];return{tables:t.tables.map(e=>yr.tables[e]),views:t.views}}const br=[[`daemon_runtime_pin_migration`,[]],[`daemon_runtime_pins`,[]]],xr={"2da8e5914c65eb868e035a1ebbab7a104fceca3c4b4c1e44dccd14c3387c3376":[`daemon-runtime-pins-v1`,`126cb31aa1921bcac9c54618fdbb59cc157d4d86a456508eea2879db32a716e0`,[0,1],[]]};let Sr;function readSqliteDaemonFingerprint(e){let t=xr[e];if(!t)return;let[n,r,i,a]=t;return{id:n,fingerprint:r,viewNames:a,tableNames:i.map(e=>br[e][0]),indexNames:i.flatMap(e=>br[e][1])}}function readSqliteDaemonCatalog(e){if(!xr[e])return;Sr??=nr(import.meta.url)(sr(new URL(`../../assets/sqlite-schema/sqlite-daemon-catalogs.json`,import.meta.url).href));let t=Sr.catalogs[e];return{tables:t.tables.map(e=>Sr.tables[e]),views:t.views}}const Cr=[[`memory_index_chunk_provenance`,[]],[`memory_index_chunk_recall_metadata`,[]],[`memory_index_chunks`,[]],[`memory_index_meta`,[]],[`memory_index_sources`,[]],[`memory_index_state`,[]],[`memory_embedding_cache`,[]],[`memory_embedding_cache`,[`idx_memory_embedding_cache_updated_at`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_embedding_cache`,[`idx_memory_embedding_cache_updated_at`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_embedding_cache`,[`idx_memory_embedding_cache_updated_at`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks`,[`idx_memory_index_chunks_path`,`idx_memory_index_chunks_path_source`,`idx_memory_index_chunks_source`]],[`memory_index_chunks_fts`,[]],[`memory_index_chunks_fts_config`,[]],[`memory_index_chunks_fts_content`,[]],[`memory_index_chunks_fts_data`,[]],[`memory_index_chunks_fts_docsize`,[]],[`memory_index_chunks_fts_idx`,[]],[`memory_index_paths_fts`,[]],[`memory_index_paths_fts_config`,[]],[`memory_index_paths_fts_content`,[]],[`memory_index_paths_fts_data`,[]],[`memory_index_paths_fts_docsize`,[]],[`memory_index_paths_fts_idx`,[]],[`memory_index_chunks_fts`,[]],[`memory_index_paths_fts`,[]],[`memory_index_chunks_vec`,[]],[`memory_index_chunks_vec_chunks`,[]],[`memory_index_chunks_vec_info`,[]],[`memory_index_chunks_vec_rowids`,[]],[`memory_index_chunks_vec_vector_chunks00`,[]]],wr={"27ef93ea7e9facb77b3eead587fd5cb7647bade7c4a0dbc8b03c8f34ba64386c":[`memory-index-v1-cache-0`,`59289b93110d1d3eaf27f0e6d5bef8bc45987a70842597a67302ace145717ec9`,[0,1,2,3,4,5],[]],"93a3fb3dfbcf93f896dd17b298be4c18d2b6d6ee8ab14e46872ecbeadd557654":[`memory-index-v1-cache-1`,`a2cc43111506fdc355121bec101f93d7035cdd20d870dfc5fc5c75ce36eddee8`,[6,0,1,2,3,4,5],[]],b53e7fcdaab29e825534bce175eef96cff2c705bc465308f369f67627a5b53bb:[`memory-cache-binary-strict-1`,`43fea47c3ea00e8ff457540564e0915cb72e75b8f14b119ece1bd74746425ff8`,[7],[]],ac226e0f177ccc01aa1d3df066f10277676100bd8cd01588b860c5d89e8e2269:[`memory-chunks-binary-strict-1-recall-0`,`0e8704d882f34e24b97613115d6552258400608839065e8da56df4b336cfca51`,[8],[]],"257f0fa39f94ca852ed0887002bd286e34727ff73b4825ac5b53cafcb174f453":[`memory-chunks-binary-strict-1-recall-1`,`ed5c454b17073742bf3343b99baec45c854a0927ccd95ab1131ec6856ef08d60`,[9],[]],de46110eea2bb88cd753b7c0efa7aa1becddcb90b1a4b5c9502d5acc41d50939:[`memory-chunks-binary-strict-1-recall-2`,`7c8785c42572cc6669a29704d2079f13a47479484250495898dc3b82e2b8f169`,[10],[]],cc79633111488622f8cf8d50157280d4f9ce002ddf8b731ea7bfce3c1acbc7e9:[`memory-chunks-binary-strict-1-recall-3`,`37b37df7f7ec34ba7fb38ea652c85d9db954b648b3b8b0f2cee1136ace8c4d52`,[11],[]],b12e9eee6fc308eb0d125008d0f4a8a6a7921f87cb0ad03c0dcbabc0f4c9e30b:[`memory-chunks-binary-strict-1-recall-4`,`ded3749dc75f0b9853570d3a29f52e3296835f164d7c7e1471a368e2d79523d3`,[12],[]],b74546436177f3480bbfd0ca7d6f7558e50671a41041aa3b02a4a1d70d4e0124:[`memory-chunks-binary-strict-1-recall-5`,`596ee273523cdc7922a0718a926cff468a4e740a8c653a3e0bebe601037eee7f`,[13],[]],"7b8739ff03a7dabf85ff3846c7cb172a402613024754e064cfd775441b037d2e":[`memory-chunks-binary-strict-1-recall-6`,`126e55c1ce40d42ccb97cdf3f4e35497cf712948f36d794dca163e6a8e0559c4`,[14],[]],"6055ec94ab523719e18078aee8fa973f92d8ba968ecb104f0d61bee314739152":[`memory-chunks-binary-strict-1-recall-7`,`05b66c0fd58af7228e74cb7e881a9ddfe4bc77445ae6215ebf1c38463155d430`,[15],[]],f8f4dda5eccd6ef9b6e82a2187a7dfad76ae3783a0fcfe9623eadc18eecf44b0:[`memory-cache-text-strict-0`,`ca38a58fc93a8fb71370dae23cb0ef9b9d7376b6d48b0cef0b28a1bd9433e8fe`,[16],[]],b9b96c68cff42faadc99ad35ff55d2df4e432e87adf8d5d512c4f2d8e01477e6:[`memory-chunks-text-strict-0-recall-0`,`f62e05b1dac229e56f6bd08d3115e2ea93aec01aa558b17d94ea5bc47cc76cc4`,[17],[]],"572644cd115904fabec76e50a6d81b73b5a738b11e879a1c07bc7f83b12fac8f":[`memory-chunks-text-strict-0-recall-1`,`557db378be09c17e06988bb635f5c1eeac94a0780251f379ca0636c6f955befd`,[18],[]],dc69ef337a630e1c40398b494826d3ef6d8ca67e8a42d5f5b40142cd00e51012:[`memory-chunks-text-strict-0-recall-2`,`f6dea371a0755a537b45176e3219b0fb5123d9bda94527e1e967a63ff1678cfa`,[19],[]],d3e0bbf0a82ae4ca0ae435e0a9943fa32a48ac8d37421809d9fd36d4c0680b13:[`memory-chunks-text-strict-0-recall-3`,`60c4185a64288b050f8ddc89727ff13a6103baeda976c67c791e3c7f7b3e6c95`,[20],[]],f1dbb03304f512a8a7a0e1606d23e7ff1c97223599d3a889850ad0ed69299af3:[`memory-chunks-text-strict-0-recall-4`,`f0061cf0170bf18527093f950d0496fd4601058bc99e9c29dafd6b305dd87296`,[21],[]],"454eb2147f9c1adc93e9210a7aabc5c1fc6a4f937f9e712d632f1b7c76b28b7c":[`memory-chunks-text-strict-0-recall-5`,`2f9c2c14d4995f96d632ba23438b90a607c6345080b59c06fa6fe18fbc1ef789`,[22],[]],"2b12ceffe3ff69a67629d2e195143f53fe0d7f947108f4ee7ce068fa7b288dcf":[`memory-chunks-text-strict-0-recall-6`,`9e7d3aa7fbfd911601a9c372bca6099062bef2a24e26a5d08c21db34abb3e937`,[23],[]],"39602ef462e71c3c485358a1572c7c3f82cda5fe147dbbca5ecf601f72009238":[`memory-chunks-text-strict-0-recall-7`,`5764f18a476a4e6a6aa6f40f9538ac70e10fe5344309dd245d0db339913fbc5d`,[24],[]],"16de82c2873083fc417acc8e09140fd32cbdfb1a6633a82e8746cfe9650c18db":[`memory-cache-text-strict-1`,`aacfccd3fbb3a171753d866a2dbcac2e6ab0cf26d94fa2fa8bd17f7b555c8857`,[25],[]],"50709191e29c47d2702efd82ba0b62cdd7f1b027d532848c2cb08c77b69fa679":[`memory-chunks-text-strict-1-recall-0`,`3477ae66bf655ea65812a5e2dcedeae255314ba79214740c03c2a7fab99e1daa`,[26],[]],bbc96ed43fce73bc3051d0c510bdc3fbfec16c6dd4fa557bd349ac7b60d325f7:[`memory-chunks-text-strict-1-recall-1`,`c672e90a018dba96b0d27706a9aeacc809781009464fcb767a9c4304ae6494b0`,[27],[]],"14b7b7910dc0afdcc0bdd78b889d487bd4281ba57342ba21fbc17e2ac4ab7a5c":[`memory-chunks-text-strict-1-recall-2`,`6070f3ccf01a8815f7cb924aff58ce3ec1a215cb01782915a93b6dc2c334991d`,[28],[]],"671a11689fc7970d79b4be242cf747d6831e32ae4adf3d0cde360d0c43427e2c":[`memory-chunks-text-strict-1-recall-3`,`455f88a45ca48ac0a6a4233d483731d0b0960d2d3610db7f298c39da1c568ae4`,[29],[]],"11a2dca1aa8a69e4db87d79208841dff4abd20d943a3910afc8cc80d92912e9a":[`memory-chunks-text-strict-1-recall-4`,`abcc7d9bd0fb27f1b592b729a59c6a81fbd352917b0996f472ea42bac6dfeef2`,[30],[]],cb98ad487e0d9599983c000d5bdf096ee1f323b982e4afc44229111e5aef2cd1:[`memory-chunks-text-strict-1-recall-5`,`cb12b76fbe6f986bd1f4e7f727731515068c6a6b83d8fb0def4d041f404830c5`,[31],[]],"4a5393a69f56db40e0ada5dc8577a88c91c44f65900e234d46d487d0b5294781":[`memory-chunks-text-strict-1-recall-6`,`64fbd15911fb40635818b4f3397e0749b0b62b92b87fc6c0d067079125ce8f8a`,[32],[]],"05e8eaf13a81810f99cc62d7d25a202c115743c80ebd80c625a0beab0960b892":[`memory-chunks-text-strict-1-recall-7`,`8422ba9c6185a2156a9345807b90032db6858b2f5a12541268d9f4c7967d32e9`,[33],[]],"0ab7773eb3198fc86adb541fe032581ce24b93cd39b7aa229fdf50c8b3f9fe6c":[`memory-body-fts-v1-unicode61`,`c16bed5072a5a006ca243b73fefb1fc86bce894f87a6c8713e87dced77493eb2`,[34,35,36,37,38,39],[]],"315cb6d0263f5aff152863d03d253f867104d86d5028ad2c51e348d10fba2f1a":[`memory-path-fts-v1-unicode61`,`b18b06cf6a1ea0655eeff9c0451fae13336f2ac280468680e7d91370016cf23b`,[40,41,42,43,44,45],[]],"32a102b66f747e2fb75d4b23b2a83928c69d086604e997a29a713eac7a62ec46":[`memory-body-fts-v1-trigram`,`15c47771111fc5beb3af779b2f20333755c0069b7bb113ac6aac160f6aabef7f`,[46,35,36,37,38,39],[]],"02ae4f88ed6c87a22d6eaeb0e4e0a4ececc8d7dd37017aa04659494fd8481ccd":[`memory-path-fts-v1-trigram`,`e2b47e11cf4fa6228471d8f6be5654a6d35ec80d5e0c9e7fd5d6654f47ac200e`,[47,41,42,43,44,45],[]],"8a70e5b7bb1c8163cf6d4f38a6a69165a01f3f44204bbd910428f371ebc376c7":[`memory-vector-v1`,`ebe6798602214794cd87d21d200eaa88c4864fcb30bf8fc0b902246a7fce5023`,[48,49,50,51,52],[]]};let Tr;function readSqliteMemoryFingerprint(e){let t=wr[e];if(!t)return;let[n,r,i,a]=t;return{id:n,fingerprint:r,viewNames:a,tableNames:i.map(e=>Cr[e][0]),indexNames:i.flatMap(e=>Cr[e][1])}}function readSqliteMemoryCatalog(e){if(!wr[e])return;Tr??=nr(import.meta.url)(sr(new URL(`../../assets/sqlite-schema/sqlite-memory-catalogs.json`,import.meta.url).href));let t=Tr.catalogs[e];return{tables:t.tables.map(e=>Tr.tables[e]),views:t.views}}const Er=[[`acp_replay_events`,[]],[`acp_replay_sessions`,[`idx_acp_replay_sessions_key_updated`,`idx_acp_replay_sessions_updated`]],[`acp_sessions`,[`idx_acp_sessions_agent_activity`,`idx_acp_sessions_resume_acpx`,`idx_acp_sessions_resume_agent`,`idx_acp_sessions_state_activity`]],[`agent_database_leases`,[]],[`agent_databases`,[]],[`agent_deletion_journal`,[]],[`agent_provenance`,[]],[`apns_registration_tombstones`,[]],[`apns_registrations`,[`idx_apns_registrations_updated`]],[`audit_events`,[`idx_audit_events_agent_sequence`,`idx_audit_events_channel_sequence`,`idx_audit_events_direction_sequence`,`idx_audit_events_kind_sequence`,`idx_audit_events_run_sequence`,`idx_audit_events_session_sequence`,`idx_audit_events_status_sequence`,`idx_audit_events_time`]],[`audit_identity_keys`,[]],[`backup_runs`,[`idx_backup_runs_created`]],[`capture_blobs`,[]],[`capture_events`,[`capture_events_flow_idx`,`capture_events_session_ts_idx`]],[`capture_sessions`,[]],[`channel_ingress_events`,[`idx_channel_ingress_claims`,`idx_channel_ingress_lane`,`idx_channel_ingress_pending`]],[`channel_pairing_allow_entries`,[`idx_channel_pairing_allow_account`]],[`channel_pairing_requests`,[`idx_channel_pairing_requests_code`,`idx_channel_pairing_requests_created`]],[`clawhub_promotion_claims`,[]],[`config_health_entries`,[]],[`config_machine_state`,[]],[`config_revision_keys`,[]],[`cron_job_runtime_authorities`,[]],[`cron_job_scratch`,[`idx_cron_job_scratch_store_updated`]],[`cron_jobs`,[`idx_cron_jobs_store_order`]],[`cron_run_receipts`,[`cron_run_receipts_cursor_id_idx`,`idx_cron_run_receipts_active_job`,`idx_cron_run_receipts_job_history`]],[`cron_run_trigger_state_retirements`,[]],[`current_conversation_bindings`,[`idx_current_conversation_bindings_conversation`,`idx_current_conversation_bindings_expires`,`idx_current_conversation_bindings_target`]],[`delivery_queue_entries`,[`idx_delivery_queue_bounded_retention`,`idx_delivery_queue_failed`,`idx_delivery_queue_pending`,`idx_delivery_queue_session`,`idx_delivery_queue_target`]],[`device_bootstrap_tokens`,[`idx_device_bootstrap_tokens_ts`]],[`device_pair_setup_completions`,[]],[`device_pairing_browser_requests`,[]],[`device_pairing_join_codes`,[]],[`device_pairing_paired`,[`idx_device_pairing_paired_approved`]],[`device_pairing_pending`,[`idx_device_pairing_pending_device`]],[`diagnostic_events`,[`idx_diagnostic_events_scope_sequence`]],[`durable_background_processes`,[]],[`exec_approvals_config`,[]],[`execution_decision_facts`,[`execution_decision_facts_context_occurred_idx`,`execution_decision_facts_cursor_id_idx`,`execution_decision_facts_run_occurred_idx`]],[`execution_identity_contexts`,[`execution_identity_contexts_run_created_idx`]],[`execution_owner_lifecycle_bindings`,[]],[`flow_runs`,[`idx_flow_runs_owner_key`,`idx_flow_runs_status`,`idx_flow_runs_updated_at`]],[`gateway_boot_lifecycle`,[`idx_gateway_boot_lifecycle_started`]],[`gateway_restart_handoff`,[`idx_gateway_restart_handoff_expiry`]],[`gateway_restart_intent`,[]],[`gateway_restart_sentinel`,[`idx_gateway_restart_sentinel_ts`]],[`github_personal_publication_requests`,[`idx_github_personal_publication_owner_session`,`idx_github_personal_publication_pending`]],[`github_publication_requests`,[`idx_github_publication_requests_pending`]],[`github_publication_session_lifecycles`,[]],[`github_repository_publication_requests`,[`idx_github_repository_publication_personal_request`,`idx_github_repository_publication_shared_request`]],[`local_workspace_manifest_nodes`,[]],[`local_workspace_projections`,[]],[`local_workspace_source_path_sets`,[]],[`local_workspace_tree_packs`,[]],[`macos_port_guardian_records`,[`idx_macos_port_guardian_records_port`]],[`managed_outgoing_image_records`,[`idx_managed_outgoing_images_agent_message`,`idx_managed_outgoing_images_agent_session`,`idx_managed_outgoing_images_message`,`idx_managed_outgoing_images_session`]],[`mcp_oauth_pending_authorizations`,[]],[`mcp_oauth_stores`,[]],[`meeting_transcript_sessions`,[`idx_meeting_transcript_sessions_account`,`idx_meeting_transcript_sessions_agent`,`idx_meeting_transcript_sessions_chronology`,`idx_meeting_transcript_sessions_export_key`,`idx_meeting_transcript_sessions_id`,`idx_meeting_transcript_sessions_slug`,`idx_meeting_transcript_sessions_source`,`idx_meeting_transcript_sessions_started`]],[`meeting_transcript_summaries`,[]],[`meeting_transcript_utterances`,[`idx_meeting_transcript_utterances_id`]],[`migration_runs`,[`idx_migration_runs_started`]],[`migration_sources`,[`idx_migration_sources_path`,`idx_migration_sources_run`]],[`native_hook_relay_bridges`,[`idx_native_hook_relay_bridges_expires`]],[`node_worker_launch_boots`,[]],[`node_worker_launch_cleanup`,[]],[`node_worker_launch_containers`,[]],[`node_worker_launch_process_scopes`,[]],[`node_worker_launches`,[`idx_node_worker_launches_terminal_completed`]],[`node_worker_prepared_workspaces`,[]],[`node_worker_turns`,[`idx_node_worker_turns_active_owner`,`idx_node_worker_turns_terminal_completed`]],[`official_external_plugin_catalog_snapshots`,[`idx_official_external_plugin_catalog_snapshots_updated`]],[`operator_approval_execution_identities`,[]],[`operator_approval_standing_grant_generations`,[]],[`operator_approval_standing_grants`,[`idx_operator_approval_standing_grants_binding`]],[`operator_approvals`,[`idx_operator_approvals_cursor_id`,`idx_operator_approvals_resolution_ref`,`idx_operator_approvals_resolved`,`idx_operator_approvals_runtime_pending`,`idx_operator_approvals_source_run_resolved`,`idx_operator_approvals_source_session_created`,`idx_operator_approvals_status_expiry`]],[`outbound_media_provenance`,[]],[`outbound_message_execution_bindings`,[`outbound_message_execution_bindings_execution_event_idx`]],[`outbound_message_progress`,[`outbound_message_progress_occurred_idx`,`outbound_message_progress_run_occurred_idx`]],[`plugin_binding_approvals`,[`idx_plugin_binding_approvals_plugin`]],[`plugin_blob_entries`,[`idx_plugin_blob_expiry`,`idx_plugin_blob_listing`]],[`plugin_state_entries`,[`idx_plugin_state_expiry`,`idx_plugin_state_listing`]],[`projects`,[]],[`sandbox_persistent_execs`,[`idx_sandbox_persistent_execs_container`,`idx_sandbox_persistent_execs_container_name`,`idx_sandbox_persistent_execs_source`]],[`sandbox_registry_entries`,[`idx_sandbox_registry_last_used`,`idx_sandbox_registry_session`,`idx_sandbox_registry_updated`]],[`schema_meta`,[]],[`secret_store_entries`,[`secret_store_entries_live_idx`]],[`session_groups`,[]],[`session_repository_workspaces`,[]],[`session_state_events`,[`idx_session_state_events_session_sequence`,`idx_session_state_events_time`]],[`session_state_heads`,[]],[`session_upstream_links`,[`idx_session_upstream_links_catalog_id`]],[`session_watch_cursors`,[`idx_session_watch_cursors_target`]],[`skill_library_entries`,[]],[`skill_library_events`,[]],[`skill_library_revisions`,[]],[`skill_library_uploads`,[]],[`skill_upload_chunks`,[]],[`skill_uploads`,[`idx_skill_uploads_expiry`,`idx_skill_uploads_idempotency`]],[`skill_usage`,[]],[`skill_workshop_changes`,[`idx_skill_workshop_changes_agent_time`,`skill_workshop_changes_cursor_id_idx`]],[`state_leases`,[`idx_state_leases_expiry`,`idx_state_leases_owner`]],[`subagent_runs`,[`idx_subagent_runs_child_session_key`,`idx_subagent_runs_controller_session_key`,`idx_subagent_runs_requester_session_key`]],[`task_delivery_state`,[]],[`task_runs`,[`idx_task_runs_cron_runtime_order`,`idx_task_runs_cron_source_order`,`idx_task_runs_runtime_run`]],[`template_cron_refs`,[]],[`template_installs`,[]],[`template_mcp_server_refs`,[]],[`template_package_refs`,[]],[`template_workspace_files`,[]],[`update_runs`,[`idx_update_runs_active`,`idx_update_runs_created`]],[`user_background_images`,[]],[`user_preferences`,[]],[`user_profile_identities`,[`idx_user_profile_identities_authorization`,`idx_user_profile_identities_profile_id`]],[`web_push_approval_deliveries`,[`idx_web_push_approval_deliveries_subscription`]],[`web_push_subscriptions`,[`idx_web_push_subscriptions_updated`]],[`worker_environment_credentials`,[]],[`worker_environment_ssh_fallback_ports`,[]],[`worker_environments`,[`idx_worker_environments_provider_lease`,`idx_worker_environments_terminal_changed`]],[`worker_inference_turns`,[`idx_worker_inference_turns_pending_run`]],[`worker_session_placement_moves`,[]],[`worker_session_placements`,[`idx_worker_session_placements_environment`,`idx_worker_session_placements_reconcile`,`idx_worker_session_placements_session_key`]],[`worker_session_tool_operations`,[]],[`worker_transcript_commit_heads`,[]],[`worker_transcript_commits`,[]],[`worker_turn_tool_authorities`,[]],[`worker_workspace_pending_results`,[]],[`worker_workspace_reconciliations`,[]],[`workspace_generated_bootstrap_hashes`,[]],[`workspace_path_aliases`,[`idx_workspace_path_aliases_workspace`]],[`workspace_setup_state`,[`idx_workspace_setup_state_path`]],[`worktree_provisioned_file_chunks`,[]],[`worktree_templates`,[]],[`worktrees`,[`idx_worktrees_removed_at`,`idx_worktrees_repo_fingerprint`]],[`worker_environments`,[`idx_worker_environments_provider_lease`,`idx_worker_environments_terminal_changed`]],[`workspace_setup_state`,[`idx_workspace_setup_state_path`]],[`worker_environments`,[`idx_worker_environments_provider_lease`,`idx_worker_environments_terminal_changed`]],[`session_repository_workspaces`,[]],[`worker_workspace_pending_results`,[]],[`worker_environments`,[`idx_worker_environments_provider_lease`,`idx_worker_environments_terminal_changed`]],[`agent_provenance`,[]],[`claw_cron_refs`,[]],[`claw_installs`,[]],[`claw_mcp_server_refs`,[]],[`claw_package_refs`,[]],[`claw_workspace_files`,[]],[`local_workspace_projections`,[]],[`local_workspace_projections`,[]],[`acp_replay_events`,[`idx_acp_replay_events_session_seq`]],[`skill_usage`,[`idx_skill_usage_key`]],[`state_leases`,[`idx_state_leases_expiry`,`idx_state_leases_owner`]],[`session_state_heads`,[]],[`user_profile_emails`,[`idx_user_profile_emails_profile_id`]],[`user_profiles`,[]],[`user_profile_identities`,[]],[`user_profile_emails`,[]],[`worker_environment_session_attachments`,[`worker_environment_session_attachments_session_key`]],[`sandbox_persistent_execs`,[]],[`update_runs`,[]],[`github_repository_publication_requests`,[]],[`github_personal_publication_requests`,[]],[`execution_identity_contexts`,[]],[`node_worker_launches`,[]],[`node_worker_turns`,[]],[`web_push_approval_deliveries`,[]],[`execution_decision_facts`,[]],[`outbound_message_execution_bindings`,[]],[`outbound_message_progress`,[]],[`cron_run_receipts`,[]],[`secret_store_entries`,[]],[`github_publication_requests`,[]],[`skill_workshop_changes`,[]],[`state_leases`,[]],[`migration_runs`,[]],[`commitments`,[`idx_commitments_agent_due`,`idx_commitments_agent_sent`,`idx_commitments_scope_dedupe`,`idx_commitments_scope_due`,`idx_commitments_status_due`]],[`commitments`,[`idx_commitments_scope_dedupe`,`idx_commitments_scope_due`,`idx_commitments_status_due`]]],Dr={fcbb00212b86de19fc5fa0f04654883e4714871ea6417f63645a97c1c9e9457f:[`state`,`685cc87a6a367954ee95acecd4646d346e35f2b1048e55de7b66d4dc700f1e5b`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[]],"1afe9a93ab5ff5ecdd8a5ef89f60ed9cf1246b4ffb6dd3b31bd782ca5e44ab9d":[`state-before-v40`,`716519c2f5c5484e7061362cd55dc40f25c44fc55598446763c74152b11e4fc6`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,135,131,132,133],[]],"20652e186439d870636fc9def6e16d67f0bc25efbc56bcbd190ab3711c594f0b":[`state-before-v39`,`5e03dab2bf0ab007cdf397cb1e498ff89deb3dbb1bb0429acbe9a45b6e22e509`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,136,119,120,121,122,123,124,125,126,127,128,129,135,131,132,133],[]],"6d3d5985c28174dffe934265721644dda70fb01ad73d03514d35e2ee70a97adc":[`state-before-v38`,`a06d8d965a4799d247b9237439e304fb41eb841ca4ab48c5f347e242e979daa4`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,137,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,136,119,120,121,122,123,124,125,138,127,128,129,135,131,132,133],[]],fe1706f4d38001b97405908240370830f5acfba944ab99d2aaf3b9f4d919424e:[`state-before-v37`,`02c02530dcbfa94282fc7513c2035c144e1da111c571bd677c3fad2feac6aaf5`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,137,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,139,119,120,121,122,123,124,125,138,127,128,129,135,131,132,133],[]],d0cd137b7efd6db59ab303c883f1f8dac6cb8b1f1acd8d8627ada7e06e394071:[`state-before-v36`,`220f897975cabddbbcb199e7cb86bc899e9edb48336439031012ce40d5766b9f`,[0,1,2,3,4,5,140,7,8,9,10,11,12,13,14,15,16,17,141,142,143,144,145,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,137,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,110,111,112,113,114,115,116,117,139,119,120,121,122,123,124,125,138,127,128,129,135,131,132,133],[]],"7ed795835c94f05c1ef977fc923efe5546e8ffdba490daf0830f187f1dfb1d80":[`state-before-v35`,`be6695458a7627c186add059bcf2639b5e9e9ddcd8dc53746b440f1ba77a5780`,[0,1,2,3,4,5,140,7,8,9,10,11,12,13,14,15,16,17,141,142,143,144,145,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,146,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,137,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,110,111,112,113,114,115,116,117,139,119,120,121,122,123,124,125,138,127,128,129,135,131,132,133],[]],a6d49bc647cab1d6e70a56501e06debe8568094726782bd2d2b9ab3efecadff6:[`state-before-v31`,`89d5364b8c63458f600bdc0b7b30e85eefbcdc71ba09a388dc475bb5ffd404be`,[0,1,2,3,4,5,140,7,8,9,10,11,12,13,14,15,16,17,141,142,143,144,145,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,147,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,137,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,110,111,112,113,114,115,116,117,139,119,120,121,122,123,124,125,138,127,128,129,135,131,132,133],[]],d1d0b50ac838dfa09897431b3e3f0f74bd5de636b7a17c7569422cc4e32d419c:[`state-before-v27`,`4d4752c9096151b2d9ac9f843259470d34109ec410b962b9203c5d5192f0abbe`,[148,1,2,3,4,5,140,7,8,9,10,11,12,13,14,15,16,17,141,142,143,144,145,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,147,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,137,89,90,91,92,93,94,95,96,97,98,149,100,150,102,103,104,110,111,112,113,114,115,116,117,139,119,120,121,122,123,124,125,138,127,128,129,135,131,132,133],[]],e31a36c4865b72d72a5f7ff8068639e5284f12abe8e58623cbe4bb6907c09c1d:[`state-before-v26`,`153fc4e2e4248b6fb0b9f0d1a936730da53b1ac5f80bfda2d5d4978382cf87ad`,[148,1,2,3,4,5,140,7,8,9,10,11,12,13,14,15,16,17,141,142,143,144,145,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,147,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,137,89,151,91,92,93,94,95,96,97,98,149,100,150,102,103,104,110,111,112,113,114,115,116,117,139,119,120,121,122,123,124,125,138,127,128,129,135,131,132,133],[]],f32dcffad8239a4de64de63074202b82a2a8b8671148ade2a5bf66a296a24c94:[`state-before-provision-source`,`65ab29899ed0d4d821be154749cbf12b3deb5fda9006742dcc8513fc24e8726e`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[]],"5bde97da769150d9e0cc19830a835a11599f82cf51c544e629e9d7f5f205b3d5":[`state-before-bootstrap-deferred`,`70b4fd11db71810de8ee5166356977770b88edce037b477b3795972a1af93209`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,135,131,132,133],[]],"54911300fd4efbb44a652d781badc61c60be05619fba7bd6a64b1d1bc2121a81":[`fragment-local_workspace_projections`,`39ab9e54cafe71df0cfcd6b83585693118657dd954cce42b24093e1c4779b497`,[50,51,52,53],[]],f0e11a6fff0a4b79b69a28a0f2ec4694fa1ee88672cac3b7338bc0a3bb9f8d19:[`state-feature-local_workspace_projections`,`39ab9e54cafe71df0cfcd6b83585693118657dd954cce42b24093e1c4779b497`,[50,51,52,53],[]],e119e5203e18e9fba13d43368408775eca1d809807579a697482ab2b7011e840:[`state-feature-local_workspace_manifest_nodes`,`8db5abfb2c2f4c380c80647305b1e4bb5e6af7ac2fec71205a52a97d86835291`,[50],[]],"3142caa54d9bd7d285b37ed3338ed9f4307ad3b32469bd88deecb8725301861e":[`state-feature-local_workspace_tree_packs`,`a63984593fd118417812466c9ee0c189fd7d819401af1943a6f9c11730c47d87`,[53],[]],e95059f2306c8231ee92ef3d76dfcb434a80885f08cbf39380f88a287f98bade:[`state-feature-local_workspace_source_path_sets`,`ead9623df4d41d649f8e4af2351694db5bc8c4e70edb7d2322ba76c11d0dfddb`,[52],[]],bc86e378ea153c42527b6106b01ba4cb8285cca40378ffa0142656577309723e:[`fragment-user_profiles`,`268e6f3b53eb2048a3edf527da424f8df229a01166befc8137ea94dbb560227e`,[152,113,153],[]],f5b54f0fedd88d94c24add8a1fd987ac8592b05d4615424bab9dbc0d19c9cd4a:[`state-feature-user_profiles`,`2c2611b7d0c64f467494ae3922f763dee7fc023a5ee6b92d5821639b18e825aa`,[152,154,153],[]],"9eaae0feb245733106045a2c6766d2a2a729a9bdb22b98ec4434c09d76663264":[`state-feature-user_profile_emails`,`202fadb0df4fc5da385edddbda27e96126d0d7a2db6a63375fa506221163a4fb`,[155],[]],"45451969c6ea5bebf37bbfba310467e482af74731a7cb0f2affb316059e21528":[`state-feature-user_profile_identities`,`3a24e89bd446dffbef50b7bd4b87288abc6eb470c290eaabcb1761fbe5244c06`,[154],[]],"561e14603e294368a12a2b5f6ecb0cc509d0b8847a93817286bd5a14d076ad0f":[`fragment-skill_library_entries`,`c04324d292a056ed135e3b5fad5ddf61bd7fa1bfc44ec905aa32cc220956bf8d`,[93,94,95,96],[]],"6b07280274e87ca0fa5bbc1887818497375298fa700b24852dc981f3da1da555":[`state-feature-skill_library_entries`,`c04324d292a056ed135e3b5fad5ddf61bd7fa1bfc44ec905aa32cc220956bf8d`,[93,94,95,96],[]],"43645abd05379894c2982bcd88b8dff0cd6c9802e5bf2ab6cc54af87a7e6a37d":[`state-feature-skill_library_revisions`,`533218405c3e483d687da824cf15f9ebcb76ba69675946e95c134702dc199890`,[95],[]],ea1b1fb7d6d8256ec58bc7c28541312c1a543e88bf9ed7e4366791ea243d8ec0:[`state-feature-skill_library_events`,`e5269a0f2846007c0b3eef62963979fa7a2cdd01ced20906ec4ac407ace66c03`,[94],[]],"31318a62bdb75dccad514a02adde07df11d26b756f51d1d50d0e6b19d399b26e":[`state-feature-skill_library_uploads`,`ba066e91b42e768b5f705703783cce87eb90fac71a37cad9dfdf308a19ccceb6`,[96],[]],ed3d9e7b13809b3a9b91d48d63816b26354681d727b96e39496d02c775343e1f:[`fragment-operator_approval_standing_grants`,`9d40e9ae6add075aa675521e2664951448cb3c7f360694614c0e39db256ed7fa`,[73,74],[]],be37db3a4634164c401b2d8e5ac3c2d712cd9eb973e3f2b39daa578adedff0ae:[`state-feature-operator_approval_standing_grants`,`9d40e9ae6add075aa675521e2664951448cb3c7f360694614c0e39db256ed7fa`,[73,74],[]],e23a5880a289da464471db5cfff10b9a6962b4d52c99260a3e366746c023de76:[`state-feature-operator_approval_standing_grant_generations`,`0d525f0400a30f0582698e91e78f63063c08a8c06b3bcfe624dbd2f2fbe7834c`,[73],[]],"7b8bf2fd3ae786c589bf138b32270450c1a2582bcb9a825c1eaf7fb3a7bcea06":[`fragment-worker_environment_session_attachments`,`b95d7054311f0f2d1e0885104c66ff243dfe4f68b84ed2d814ae68e748574417`,[156],[]],"32cc45ee15a4c4dd21d3ebeb9c259fe465085ed35ee781e611f293af5bbda189":[`fragment-durable_background_processes`,`a12b3e39e6d9ed28b9aea95a15a7a60f4c9615ad48d323de7a52560475c62ea4`,[36],[]],"6496f80e29da252472af802873996fc3cd761f245f4dcf6fefb1c7aee38e720b":[`fragment-sandbox_persistent_execs`,`f885f117e199277aa5c23a9095f55e742797249d13e2f4e4df8fbef1daba399d`,[83],[]],"156673e9396f27223073abdbbd2e13269bd7f45f577ed6aff00e017ab232d940":[`state-feature-sandbox_persistent_execs`,`026ac7355b83187c8f7eef5cbd48ab36ba7de1b4fe40413ee1168ebff6c2d67a`,[157],[]],"61e308c5a715e5ee5ff29b65a31d2e7ccd039498494d9afe120129f62f86b764":[`fragment-user_background_images`,`1da03995969350f59b3f8a64d9144b781d467e6ea75f70d5abcd6e18734678e1`,[111],[]],b36f4fc0be0d53e48e207f50a3cba34df76c4028a2d85201f7b262b1c7a4c2ab:[`fragment-update_runs`,`7a03cbf22978be3aa41cb030aadff21440667a0035fd3a9795492c10f89b1a55`,[110],[]],c3db4ffcf4092146e5d923b60516a00a8db41825f8bffb138b848195576b987b:[`state-feature-update_runs`,`4caad814f837565106a1a17b982bf4ff004bbdba00a6ff05a3b9c5ef2e5a5945`,[158],[]],a0323917d8786f2e6cbc3470d86c2a4e123103b84a5dc95d59bbf20759b8ab4c:[`fragment-session_repository_workspaces`,`51ee403217b5a9bff65b4d3b93a571f8fbeb60a7b2935860db7e21e7959e7833`,[88],[]],d62b52a34e2626a7983ae5c48268f04567e93170457e63502b7096486a6ce9f7:[`fragment-github_repository_publication_requests`,`1ae034bde6e00a9b919bcbb987df8aebc5856ab6f4c979743355ecb682418a99`,[49],[]],"6d205ed705fcf89e34e2679f192b2dd50e4cbcb9b06b473c3e81dd48c8811102":[`state-feature-github_repository_publication_requests`,`bc5c46f3cc22c0572b25d10344108465509d7189e1d51b0f6fa335b1d86497cf`,[159],[]],"079ee34fc1ed4ca27e807b01c7456deceacc57fead388917ff1b275b5047ab06":[`fragment-github_publication_session_lifecycles`,`755e9a26722c11b5edd9d4f6bf270bfdc706428593de4216c311f85fad0a8e69`,[48],[]],fc4d434c6c76c4e5c5b1fb9c54ebe7e98a395fea6370ada7ac4767ad755051ac:[`fragment-github_personal_publication_requests`,`eda486fc6d1c12adfe86012cfa6d0f6afb64906b1d4c75e3785bda082281a4e1`,[46],[]],"8a4a42e9e8549a0f2e73b33b4031673e2e939624d95586693bc2ac43742bf30f":[`state-feature-github_personal_publication_requests`,`aeb05b8ff41f64e5bab165feac6f1abcdb6dfefc2a5bfbbe88e34861cc40922e`,[160],[]],"0f3d662483be17f95f492157a8ba28b163afab9c52429ab6ff277ebe8b0a27fd":[`fragment-cron_job_runtime_authorities`,`ebce08da69716c0011c0db38decb38e5eaa0069c6f8360e85afdec8c624a360e`,[22],[]],e16c741ca5371718cf7d95114ee1043ad33db04c470f268ccbe3130f699998d9:[`fragment-cron_run_trigger_state_retirements`,`0e85a9fecddeef5129569f503fb32cc0d94e9c98877286be10e15eb657e682bb`,[26],[]],"632466e72325a428d8b4c4dfa1b7a14be9f57236bee791e9412ea07b24fca254":[`fragment-execution_identity_contexts`,`15be6a7de30d2ecb9b15fed1eb13dd65da858f1eb378e95f737f14241c11b3d9`,[39],[]],"7683ab1fd0bccb8e29499c3b6df0070d9cc7cd6249c8c103d654b015ce309417":[`state-feature-execution_identity_contexts`,`2dc283d04b315fd0199a9e13653edb03c8614d12be2ca6f005c7e110aab62d2a`,[161],[]],b796607c50ccb0e85abdec5d76b88b8076596077afe71e238b7831edd061f9e8:[`fragment-mcp_oauth_pending_authorizations`,`39eae7dacb98a3cc36bd7598c4e416fc3f180c95aa78b7fd5a1f11afecf2d5b9`,[56],[]],"15f660904a6ff5b2e08b57e7e1979ae85d7476426da0e6aa8fc35a013d557501":[`fragment-node_worker_launch_containers`,`bae513184057ef120b3b7ff1f08fc0affa1293461353ac060f1c0148346225f5`,[66],[]],"2703e870e99174d91597e44b5619574373f3da7030c4cd9907a8ac341f00802f":[`fragment-node_worker_launch_boots`,`ce110d8dd52daad838b24137dc43979dafe784dd08348e09482093f47dd5d98b`,[64],[]],"7c1c6d4fbba2f48e6ad4003bbc7d22b3b543034a8c2456fc542d2dac90c46aad":[`fragment-node_worker_launch_cleanup`,`d45196104873c5924d0fddabdce7a4f08b8fab2c68880492de968c978ef031c8`,[65],[]],"16bb8bbf8eb97d4a3895c031f758ca37106c072cd78e18b99e4f68463679c153":[`fragment-node_worker_launch_process_scopes`,`d9ce1d80156505cb99854d410b48f37b0cf82d0259417bd3c64e1ff91d5b05b2`,[67],[]],b6d0283d081e77179a54f4e54847168156095e3ec4a487d17feea8dfe26a1626:[`fragment-node_worker_launches`,`cac88014114f03cee09470505617bc58f893efc072306d0b4c6fb48e259fb17c`,[68],[]],"5dc1cf9bb59834e9497e191514c7bfb850e062f7744047c7a4289516b4b0e214":[`state-feature-node_worker_launches`,`f07514c3996f79e89f46d771b58859826342f72a12f024b29726a82f6481d6f9`,[162],[]],"5e238c5c57f8e1bfc2d5fc91ad2a4ad3ae421ca1f36a84f973a8299f99ee7015":[`fragment-node_worker_prepared_workspaces`,`1ab2c378547ad29580b84dcebbc4ed9c99008c8a242446cdad0553a24bf06eec`,[69],[]],"865397a51b0e47eda5349293c3fc590226718cdad61afe420c578ab3ec786732":[`fragment-node_worker_turns`,`cb3eaac1dc2492905a55c037ba7c09748bbdbc9c6a13cbb92e3cbec80c94f5d6`,[70],[]],"64cf0d044c7dede24d58a370a2f52cf19616efc9523343a698f7127c4d187f1d":[`state-feature-node_worker_turns`,`d1d9be01c96d9dd47e4e23d0099074f561aedb976de062622daffd173443c17d`,[163],[]],eee176fa30fb315a218b50f12be8d9e4e5561441d59250cf7029aac4edd9eb38:[`fragment-operator_approval_execution_identities`,`0f2bc5e4d656eda1ad36b778905e7e55f8685c0b41a68883f6e9fb1b838a874c`,[72],[]],"57562a3e6f834f876e5c03711f50dc514c8bdd432a87f1f54cbac2901642d5d4":[`fragment-web_push_approval_deliveries`,`f11526f4044590884acc313f8a8fb921ce93fb2372e2e64a635989af93d3012e`,[114],[]],"74b05c720f6b4a8ff88824c9843816992d5233b93ccd85bea66c2fbd2a3480c5":[`state-feature-web_push_approval_deliveries`,`92bd2e9265be63167980a22960aa201502864ec59e283821ad3eab6e765744ce`,[164],[]],"0b710f9ea230c2d23182de151edebc06dfb2800ad6207647d27ccb2c900b5d6a":[`fragment-execution_decision_facts`,`251fe6aa9c0c1ef726ab36810df59e644d472757b269b7e6ac36a5b7b1864ccc`,[38],[]],"9cd9f63b1002094a7e0538c52b75f2c8d26664937ff5559f64a004feabe47816":[`state-feature-execution_decision_facts`,`8235ed3d9eb951894768fa49670db7390f7950e96618daded2851a55c2e827ed`,[165],[]],"49e2b7094b1bf25586bc63b3ce3e971873c26584de40bd96654a31b945b3881f":[`fragment-execution_owner_lifecycle_bindings`,`83228457b7900a349a7a60693f5be9fe5ce2b86f8ea3be6bd1b3bcbae9381c73`,[40],[]],c222191b2157eb84fae227b67417210870ff546ce38b799805cd32e63e198bcd:[`fragment-outbound_message_execution_bindings`,`90715ffad8419a713baa7a63aa0d15038b16391bba0c3739bdae7c3196cc5fe5`,[77],[]],f782e56e1dca81426ff88a94a9702580d0c6bdd1a420e8c1741fef3aa7c18b81:[`state-feature-outbound_message_execution_bindings`,`c29af535c3d6cf16bb31a085c7b68d150c132921b51f560495e75dd1f5451f2d`,[166],[]],"733bbcfcce8373ce968a993fc1f4d3f911d0011c8a60833f613f9cdb7de22d9e":[`fragment-outbound_message_progress`,`07938ecb7fa35203a80bf93cb28900b5eb0c35dcf47bfa476b436fd39d881135`,[78],[]],"6e2c6c197a77c179716d6ddead9a7226c49db5e8b69c1775ea8808e5e24cf271":[`state-feature-outbound_message_progress`,`b1fdd16f1d29ceeed6d32e873b0ef54831ad693b4e910c1fe55bc59aa60c4709`,[167],[]],ab3748daca8019e0908cc9906304f50a26cffd9d5e9ea3ba1ea3a759315737cb:[`fragment-agent_provenance`,`da5d017b6840d65ebd1bc234ae3fdf4540bd00256bfc50c599a4195d15066c17`,[6],[]],be11d3e5a672ca34875c1f06cfc6d5d5a1293a7077302a759c12c2c17b2cdcb6:[`fragment-cron_run_receipts`,`593a0b293257e23cf22f14e308c7f75a7032d5f0bdbba0fa3d307f3382e3bd4c`,[25],[]],"41824738e9d17ef8abfa9bda96824ab259ca9e81d3ad647b16b407a6bc4dc28f":[`state-feature-cron_run_receipts`,`1c1c9f4b60d18e51e0db6940a6813c5a7a1a14dffbe38921318e61c295597112`,[168],[]],"8b28fd18dffd5b09fb5a09d8e0d04b2dbf1372081b356131f1df2f4c41895745":[`fragment-config_revision_keys`,`8b416bf248c7702519e58249d29725d42d52a95d8a22084964637f3ed57cae9d`,[21],[]],"443ee39ca023c21d0234f2897e3790e8e9757daf427989b731f97074c5bf28fe":[`fragment-secret_store_entries`,`45f2e66f10baf9470316cb216a91ef6ffa865a2c2f25b181e37f20171348576b`,[86],[]],"10e3ba9552ac35206e3f3d467a44f71602f4b1d3404204836f72106155b5fe6d":[`state-feature-secret_store_entries`,`1eefc2ba0eecf91c8fd96442e750b4e555fb97485569f3bd2bf7205c02466cee`,[169],[]],ecb98cd64bfc2fc0828eaaac59c122a4a9381d752dfdc4166d1fe287e9f1cecb:[`fragment-projects`,`9ac5c2cc1d8a72b975287fe40d1f9cf5929671ee033dd68538315e9770df9f36`,[82],[]],"7b5e9bd4ec7f91f71f2fcea1deaa9058d06f907e460e2d1a2a8fa333bf6942c0":[`fragment-worktree_templates`,`a9481ceaf044b2db824f5df1823d0619c7b9e53310b83a32c4399421cc6a7e18`,[132],[]],"85b0f3fbf9815fa0125a5a823eacebc68306ac4864d89047bb2699611b0044c5":[`fragment-user_preferences`,`24c5cd67b1014eb8ca50a492d93a9b9ec5e5a3b936722c35c7b0768a8b1823e2`,[112],[]],"1f164add8aeb9d28f7c779f88fe40dc7a344e14479fe9a017181151330bca6fd":[`fragment-device_pair_setup_completions`,`3400a6259bccdb3546a778b36215284bd14c9613a1ece543e9deaf3539e3b288`,[30],[]],"54a593978142e9fdd957d9aff2368fd3b9d26702968b4ede856df3a933023139":[`fragment-github_publication_requests`,`81c333517fb89efb345896c6452909c6963d2a049bb8b76a8d8adcb626ad592e`,[47],[]],"4c1eb061476b0ecbfc022fb1bd4c927c7c4b3868f40702507c9911ccd3504b2f":[`state-feature-github_publication_requests`,`0375d1a5a88363e5cd216f3addbf170f8be1098ea8626e0e0f95ebb91768588d`,[170],[]],"1f844843f7e4c042331e07eb663873d85bfb1291db181f98c0834a0d01bbf2e2":[`fragment-device_pairing_join_codes`,`4ada0f17fe210baff80cc7da940a58ef4bd27911312469dd15a3473ef1119ad0`,[32],[]],"5ac69298f3597ee21ed377f802610edbd4e638bc0d0cd5be7b2066f5c9104b1e":[`fragment-device_pairing_browser_requests`,`c65ddfeaf2ea8a7653a6e2d374d86422deb3fccbb4424f456bd8d0901c69b4c7`,[31],[]],ddfc4231357afb56d903eca77fbfebf817ffafa47d491193e6948b5032ccfefe:[`fragment-skill_workshop_changes`,`993cb9d62f11305ca322f0c76e895a37604132572f2f651c635d0d72eb416b85`,[100],[]],d3bf805006eb83550c1d4a662610e8897cd41ce52de6e370424d3f3ed26e3d80:[`state-feature-skill_workshop_changes`,`01b83680a33b4f2e7d46a70f3e122ebe40044b44ff733891a29a340bdcbba3fb`,[171],[]],"59c7fa24ee5aa93144f936173f6efde68e9d2af33d074d5e208f971d500ac5d3":[`fragment-worker_environment_ssh_fallback_ports`,`18ead5da9eec5f58b75326fdaf9ed55a3d0433facc14dad465add6bd80dff080`,[117],[]],"62bf1862f7ce3c0abcaaf4cc070834c5f402e1696b78d22e7ca7bd23b0fec36d":[`fragment-worker_session_placement_moves`,`8188e7a581a51d08faad38cdf6b07041e2b2e760d17bcfa109df49ec0c83c430`,[120],[]],f01d4e41642436ccdf0ba63450989879b094bd74a7a97cd98b2ec0c4accd4ad4:[`state-runtime-0-0`,`cf307d842aa556e9f0bbaae9cf448744d4991310b34333f0fbf8c7e894c1a86a`,[0,1,2,3,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,118,119,121,122,123,124,125,126,127,128,129,130,131,133],[]],"1e2662ff71a59cc056f70d661bddb4c6c0e86b36c4151490343ffd787b15891a":[`state-runtime-before-provision-source-0-0`,`16da1fa5ae0e4e4c25f75803a1b39c8971b93c0a0a311edf4fbdefd50f33d0a2`,[0,1,2,3,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,134,119,121,122,123,124,125,126,127,128,129,130,131,133],[]],"0c3068a4622b9151d2321f80af94861f162d8288b6391c38d89822e20f856639":[`state-runtime-before-bootstrap-deferred-0-0`,`0d8a0829977f7e6ec02a3fa9febb23562a521779369ad959613d26c4a96d72fe`,[0,1,2,3,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,134,119,121,122,123,124,125,126,127,128,129,135,131,133],[]],"40222aeec53b8897045719a8d38a4b0658ffd1d21d4fd0fef11458c48ed5625b":[`state-runtime-before-v40-0-0`,`0d8a0829977f7e6ec02a3fa9febb23562a521779369ad959613d26c4a96d72fe`,[0,1,2,3,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,134,119,121,122,123,124,125,126,127,128,129,135,131,133],[]],a45a311ca45ef1a2814feada0479c1f948470534ccb4bd6b10cf41f2a4ab6d57:[`state-runtime-0-1`,`c913a89e38b081c27405542ec53903e985f81b91564d3f87c237818c1bca9e34`,[0,1,2,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,118,119,121,122,123,124,125,126,127,128,129,130,131,133],[]],a65a121da4de231f2d96dcf4503136c5f7cc2f80e54aa9d630fb2e5a9de9a97a:[`state-runtime-before-provision-source-0-1`,`350780aa0d95ca738450fff1e3479414d25bc3dca09cbe9741d6e52fb03879f4`,[0,1,2,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,134,119,121,122,123,124,125,126,127,128,129,130,131,133],[]],"3075984cf7583cf173b40648a7b27d0cf683b2c9d38d218e6584da4efd0ef951":[`state-runtime-before-bootstrap-deferred-0-1`,`b866dbf70f630e748a46d2ad5a2c48c5d95bd4070784a9f7fcec3dc349d28af1`,[0,1,2,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,134,119,121,122,123,124,125,126,127,128,129,135,131,133],[]],"5ed7c4627eed8b68ddfcf5b4ffbd98c2085cc17c1ab55a1d69f07aee108f202d":[`state-runtime-before-v40-0-1`,`b866dbf70f630e748a46d2ad5a2c48c5d95bd4070784a9f7fcec3dc349d28af1`,[0,1,2,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28,29,33,34,35,37,41,42,43,44,45,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,84,85,87,89,90,91,92,97,98,99,101,102,103,104,105,106,107,108,109,115,116,134,119,121,122,123,124,125,126,127,128,129,135,131,133],[]],"381aa534d8d5eb4bec164b7e73e83221d4d78bd8058c425a554dcb91c0e34c58":[`state-runtime-1-0`,`0c8dde495615c5c2a57ec8598ca9ece53f0ea5e72e963b92f1716a5e961106da`,[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,31,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[]],a99f466c73b07f39b54a6711d7e5df7767e45c7c9b2a45943ed96726ba8f4608:[`state-runtime-before-provision-source-1-0`,`77e32f62ae9edd8ad44e5c9995e71e6c19d5ce8c55f468b0b202379b7e27dc54`,[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,31,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[]],"90569dbff4f9ac27a68a4c13ddd2baaeb92962f32e1a58a6790eb5baeeb453fc":[`state-runtime-before-bootstrap-deferred-1-0`,`0fc6212e574b5022f924a9ed41c6ffadb979ca10c37deb9fc7f3ecd8af9c03f8`,[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,31,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,135,131,132,133],[]],"41b7ccaf89f2ce0b2e8898c714693b62ccdeba93e7eea48612a2783d77a97f28":[`state-runtime-before-v40-1-0`,`c070d1efc0b3e1f67ac4d5d5cc01bb5d57a7ddbf6f72b67da1888dd8a1cb4144`,[0,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,135,131,132,133],[]],cc59fb921d6be3730c729838875b379b1aec8edb9acd5e2ed09ea41f9b9ace33:[`state-runtime-1-1`,`26adf2401aaa91b57cac91157367732c55e904f417428fed0a8f7d01510e55fc`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,31,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[]],"269874b20b213faf7f8c8ecb6cc4c759853ffd1d63b5f6a395180667ffb2a9b3":[`state-runtime-before-provision-source-1-1`,`8060a02d609b6c8fe37e25568727275eaa76fb8908a93581083675afbdf3bd80`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,31,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133],[]],d99906589af97e0bc4e77af6f5e155e6eb689abfde8ef42d8534862f0c0f4d7d:[`state-runtime-before-bootstrap-deferred-1-1`,`288cbad6e819ed548b3fc769bc808be2a06f2b837db943abf969ff334872d540`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,31,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,135,131,132,133],[]],"126f5f0137d7c19fb0907ad7f763a83d4b675d38190526623081dff1dad6ab99":[`state-runtime-before-v40-1-1`,`8a47e464e648029da13f34055cf04b4337e35a37bfc83f8ff130959ecfeb29cc`,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,30,32,33,34,35,37,41,42,43,44,45,47,54,55,57,58,59,60,61,62,63,71,75,76,79,80,81,82,84,85,86,87,89,90,91,92,97,98,99,100,101,102,103,104,105,106,107,108,109,112,115,116,117,134,119,120,121,122,123,124,125,126,127,128,129,135,131,132,133],[]],d285aca718d789bb5f8799fd148a30792ae63c7ce10fa0f0c757391806d83cac:[`state-table-agent_database_leases`,`fed699717b3ff6f0f406750e7ef2e57c0e047f4a8aa9669855cd001f4eecb4b9`,[3],[]],cac005273b1563f1269aa41ff5cc8a4d7b94a4cb7d9f82be2917853a736168de:[`state-table-agent_deletion_journal`,`6c66fbe42d4b3d671ea3212b0024f65af05cbf9ea67dc8ce1763542f2ce245f2`,[5],[]],dc1f04127c4146d414429aba7f0f055680178ac035c1566f8202cb8ba6ba2575:[`state-table-config_machine_state`,`21025ec6d7ee6da8951d3f519c48e44744b0392597ce821984dd3a9e5abb1787`,[20],[]],"246e73f17e8b92383ee8d6dfe4b657ee3dc3040e8c6398ff36c17ee14222eb37":[`state-table-gateway_restart_intent`,`91a30a8d1423b5d855a975ceb40e2ef07bdfa21f284c59bee6d189679ca8dba9`,[44],[]],df93d6687254de2f31ff263b2dafdd67656caa6ac10180f95801bde2dce8f7f0:[`state-table-schema_meta`,`df4efc2e7d50f8bde377f55f5a020ae5ba98cfda938879054cf02d9b4905b793`,[85],[]],cb1f3279e7e3b90290d5ab10856edf532f9c69f278116dd1a8002a4b050f2c1c:[`state-table-state_leases`,`6117e088b6b48fe1007de8ef29868981f820404cc3be99040c2bcd899902b7cc`,[172],[]],a503e610cfb224030ab2473b374631cefa4972377d9d04e07b5d5efb07cee14c:[`state-table-worker_session_tool_operations`,`a146f78ad23ec99bfcb50819c65478b5e94c4a8e4159086ef5073fc76e26cc2d`,[122],[]],"4f45746754bef21a88b4fdfc0932df58b22bf31590a961e4a53957cce7ccd873":[`state-table-worker_turn_tool_authorities`,`fef54ec7cc72bf3869c78b67f31ce96ed842a1ba872f7090e52feff5f547560c`,[125],[]],"8cbef48665eec155650765377478b38fde1c87ef57fadb423438f85f8c91ad66":[`state-indexed-github_publication_requests`,`81c333517fb89efb345896c6452909c6963d2a049bb8b76a8d8adcb626ad592e`,[47],[]],c7c1408a52e8649cf030b636ee3d984e969c5fdb96f6834634e7cb4807e624f2:[`state-indexed-update_runs`,`7a03cbf22978be3aa41cb030aadff21440667a0035fd3a9795492c10f89b1a55`,[110],[]],d40fd26bedb861443248d33289dc8d89a1750f3631730dfde2ae285f2c7988ca:[`state-existing-state_leases`,`4289076cebb114b14ac96672941b2be0679f1033e23fe059eedce8dc2b1eea57`,[85,172],[]],"13150d745ef24ab5e6aafe0b365af15d6c5d471a659e5eb2a1c38e359984a47f":[`state-existing-agent_database_leases`,`9fe50268db674b01265b7e77701aedcfffe36567086fc763de8b89f87f4cb67d`,[3,85,172],[]],cc6464642f0f115776287e4d0966e2fc564b8e62db519c2bfad7a25c9e67de51:[`state-existing-migration_runs`,`c8d7a60b14124212b817fab783e7e9e97253d27ae97c14dd6107ba9f1ad727f1`,[173,85],[]],"789bdcc904f4b35b57f9cb829909f2c9cda541c86179beb6904977146665c0c9":[`state-node-worker-lineage`,`f235501e3f5767c362c7aebce3e678d33cdb45e3b776391980019cdf7cc0f37d`,[65,162],[]],"7c5c2640b3ec45cbac611c07c67f478f0ddc85a4bbfceb9c3576f0d7aa3bd14a":[`state-node-worker-descendants`,`0991532bbc3ca042fc5c1c2026b8aa8d50b24a5bccf26e53675340a4853a665e`,[65,67,162],[]],"72c354791974ce88794c96c16135a89f07b48b9b03542f968beadf05b76aae1e":[`state-retired-commitments`,`19bef9367d336bb367e75740610741cb67deeef86a7f54065758609d67ae8a38`,[174],[]],"2309aff06f4bac77072697764926a0042e6b6069c9504d5bb8c6a0601e9d1314":[`state-retired-commitments-shipped`,`f4d088664f133eea8b1e83fd342d1effaa86d836f8593e02778531468372a303`,[175],[]]};let Or;function readSqliteStateFingerprint(e){let t=Dr[e];if(!t)return;let[n,r,i,a]=t;return{id:n,fingerprint:r,viewNames:a,tableNames:i.map(e=>Er[e][0]),indexNames:i.flatMap(e=>Er[e][1])}}function readSqliteStateCatalog(e){if(!Dr[e])return;Or??=nr(import.meta.url)(sr(new URL(`../../assets/sqlite-schema/sqlite-state-catalogs.json`,import.meta.url).href));let t=Or.catalogs[e];return{tables:t.tables.map(e=>Or.tables[e]),views:t.views}}function readGeneratedSqliteFingerprint(e){let t=rr(`sha256`).update(e).digest(`hex`);return readSqliteStateFingerprint(t)??readSqliteAgentFingerprint(t)??readSqliteDaemonFingerprint(t)??readSqliteClientFingerprint(t)??readSqliteMemoryFingerprint(t)}function readGeneratedSqliteCatalog(e){let t=rr(`sha256`).update(e).digest(`hex`);return readSqliteStateCatalog(t)??readSqliteAgentCatalog(t)??readSqliteDaemonCatalog(t)??readSqliteClientCatalog(t)??readSqliteMemoryCatalog(t)}function fingerprintSqliteSchemaCatalog(e,t){let n=t&&new Set(t.tableNames),r=t&&new Set(t.viewNames),i=t&&new Set(t.indexNames),triggers=e=>e.map(({name:e,sql:t})=>({name:e,sql:D(t)})).toSorted(byName),columns=e=>e.map(({cid:e,name:t,type:n,notnull:r,dflt_value:i,pk:a,hidden:o})=>({cid:e,name:t,type:n,notnull:r,dflt_value:i,pk:a,hidden:o})).toSorted((e,t)=>e.cid-t.cid),a={tables:e.tables.filter(e=>!n||n.has(e.name)).map(e=>({name:e.name,sql:D(e.sql),strict:e.strict,withoutRowid:e.withoutRowid,columns:columns(e.columns),foreignKeys:e.foreignKeys.map(({id:e,seq:t,table:n,from:r,to:i,on_update:a,on_delete:o,match:s})=>({id:e,seq:t,table:n,from:r,to:i,on_update:a,on_delete:o,match:s})).toSorted((e,t)=>e.id-t.id||e.seq-t.seq),indexes:e.indexes.filter(e=>!i||e.unique===1||i.has(e.name)).map(e=>({name:e.name,origin:e.origin,partial:e.partial,unique:e.unique,sql:D(e.sql),terms:e.terms.map(({seqno:e,cid:t,name:n,desc:r,coll:i,key:a})=>({seqno:e,cid:t,name:n,desc:r,coll:i,key:a})).toSorted((e,t)=>e.seqno-t.seqno)})).toSorted(byName),triggers:triggers(e.triggers)})).toSorted(byName),views:e.views.filter(e=>!r||r.has(e.name)).map(e=>({name:e.name,sql:D(e.sql),columns:columns(e.columns),triggers:triggers(e.triggers)})).toSorted(byName)};return Nn(JSON.stringify(a))}function byName(e,t){return e.name<t.name?-1:+(e.name>t.name)}function createSqliteReadOnlyNativeResourceConnection(e){let{port1:t,port2:n}=new ur,r=!1,receive=n=>{let r;try{e.receive(n),r={id:n.id,ok:!0}}catch(e){let t=ut(e,{includeOrdinary:!0});if(!t)throw e;r={id:n.id,ok:!1,error:t}}t.postMessage(r)},fail=n=>{e.onFailure(n),t.close()};return t.on(`message`,e=>{try{receive(e)}catch(e){fail(e)}}),t.on(`messageerror`,fail),{port:n,service(){if(!r)for(;;){let e=fr(t);if(!e)return;try{receive(e.message)}catch(e){throw fail(e),e}}},decodeCloseError(e){let t=/* @__PURE__ */ Error(`SQLite snapshot staging failed`);st(t,e);let n=et(t,{includeOrdinary:!0});return n instanceof AggregateError?n:new T(n.message,{cause:n})},dispose(){r=!0,t.removeAllListeners(),t.close(),n.close()}}}function decodeSqliteSnapshotStagingError(e){let t=/* @__PURE__ */ Error(`SQLite snapshot staging failed`);st(t,e);let n=et(t,{includeOrdinary:!0});return n.name===`SqliteSnapshotDirectoryBusyError`?new Et(n.message,{cause:n.cause}):n}function completed$2(){let e=k(()=>{});return e.resolve(void 0),e.operation}function createStagingOwner(e,t){let n=t.captureResource(en(`sqliteReadOnlyNativeResource`),`sqliteSnapshotNativeResource`,void 0,connectNativeResource),r=bn({workerUrl:e,workerClass:`writer`,idleTimeoutMs:0,maxPendingTasks:128,maxPendingBytes:Yt},{retainedTransport:!0,nativeSource:t,nativeResource:n,databaseAccess:`read-only`,decodeResourceError:e=>decodeSqliteSnapshotStagingError(e)}),i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Map,o=0,s=/* @__PURE__ */ new Set,c=!1,l=0,u=!1,d,f;function connectNativeResource(){return createSqliteReadOnlyNativeResourceConnection({receive(e){let t=e.directory;if(e.type===`allocated`){let n=a.get(e.preparationId);if(!n)throw new T(`SQLite snapshot preparation custody is unavailable`);n.directories.add(t),retainDirectory(t,e.preparationId)}else if(e.type===`retire`){if(!i.has(t))throw new T(`SQLite snapshot native custody is unavailable`);fe(t,{requireRequested:!0})}},onFailure(e){f??={error:e}}})}let serviceRequests=()=>{if(!c){c=!0;try{for(let e of s)e.service();for(let e of Array.from(a.values()))e.serviceClose()}finally{c=!1}}},closeWhenIdle=()=>d?.read().status===`pending`?d:l>0||i.size>0?completed$2():d=ln(Qt(r.startCloseResources(),()=>l>0||i.size>0?completed$2():r.startRotate()),()=>{f=void 0}),retainDirectory=(e,t)=>{let n=i.get(e);if(n)return n;let o,startRetire=()=>{if(o&&o.read().status!==`rejected`)return o;try{fe(e)}catch(e){let t=k(()=>{});return t.reject(e),t.operation}return o=Qt(r.startCloseResources(e),()=>{if(i.delete(e),t!==void 0){let n=a.get(t);n?.directories.delete(e),n?.releaseIfComplete()}return closeWhenIdle()})},s={directory:e,startRetire};return i.set(e,s),ue(e,startRetire),s},p={start:(e,t)=>{if(u)throw Error(`SQLite snapshot staging owner is closing`);let n=++o,i=Buffer.byteLength(JSON.stringify({...e,preparationId:n})),c=e.type===`prepare`?new ur:void 0,abort=()=>{c&&(c.port1.postMessage({type:`abort`}),mn(`resource`,`to_worker`))},d=e.type===`prepare`&&c?{...e,preparationId:n,abortPort:c.port2}:{...e,preparationId:n};l++;let p,m={directories:/* @__PURE__ */ new Set,abort(){h.read().status===`pending`&&abort()},startClose,serviceClose:()=>p?.service(),releaseIfComplete(){_?.read().status!==`pending`&&m.directories.size===0&&a.delete(n)}};a.set(n,m);let h=r.startTask(()=>{if(f!==void 0)throw f.error;return t?.throwIfAborted(),t?.addEventListener(`abort`,abort,{once:!0}),d},{inputBytes:i,transferList:()=>c?[c.port2]:[]}),g,ee=ln(h,e=>{if(e.type===`failed`){let t=decodeSqliteSnapshotStagingError(e.error);throw e.cleanupFailure&&!(t instanceof AggregateError)?new T(String(t),{cause:t}):t}return e}),_=Xt(ee,()=>g=Xt(h.release(),()=>(t?.removeEventListener(`abort`,abort),c?.port1.close(),c?.port2.close(),l--,closeWhenIdle())),(e,t)=>w([e,t],`SQLite snapshot staging failed`,e));function startClose(){if(p?.read().status===`pending`)return p;let e,t=!1,n=k(()=>{if(!(t||n.operation.read().status!==`pending`)){t=!0;try{if(serviceRequests(),_.service(),_.read().status===`pending`)return;e??=[...m.directories].map(e=>{let t={},r=je(e,e=>{t.cause=e});return r.result.then(()=>n.operation.service(),()=>n.operation.service()),[e,r,t]});for(let[t,n,r]of e){n.service();let e=n.read();if(e.status===`pending`)return;if(e.status===`rejected`)throw e.error;if(!e.value)throw new T(`SQLite staging preparation cleanup failed: ${t}`,r)}let t=g?.read();if(t?.status===`rejected`)throw t.error;m.releaseIfComplete(),n.resolve(void 0)}catch(e){n.reject(e)}finally{t=!1}}});return p=n.operation,_.result.then(()=>n.operation.service(),()=>n.operation.service()),n.operation.service(),n.operation}let finish=()=>{s.delete(_),m.releaseIfComplete()};return _.result.then(finish,finish),_.read().status===`pending`?s.add(_):finish(),{..._,service:serviceRequests,startClose}},retainDirectory};return t.retain(p,async()=>{u=!0;for(let e of a.values())e.abort();await Promise.allSettled([...s].map(e=>e.result));let e=Array.from(a.values()).map(e=>e.startClose()),t=(await Promise.allSettled(e.map(e=>e.result))).flatMap(e=>e.status===`rejected`?[e.reason]:[]);if(t.length)throw w(t,`SQLite snapshot generation cleanup failed`,t[0]);await closeWhenIdle().result,await r.close()}),p}function captureSqliteSnapshotStagingOwner(){let{moduleUrl:e,runtimeGeneration:t}=sn(en(`sqliteSnapshotStaging`)),r=yn({runtimeGeneration:t}),i=n(Symbol.for(`openclaw.sqliteSnapshotStagingOwner`),()=>/* @__PURE__ */ new WeakMap),o=i.get(r);return o||(o=a(()=>createStagingOwner(e,r)),i.set(r,o)),o}function createSqliteTerminalOpenLatch(e){let t=/* @__PURE__ */ new Map;return{peek:e=>t.get(B.resolve(e)),get:e=>t.get(B.resolve(e)),record:(n,r)=>{let i=B.resolve(n);xt(r),t.set(i,r),e.closeByPath(i,r)},clear:e=>{t.delete(B.resolve(e))},clearAll:e=>{for(let n of t.keys())(e===void 0||i(e,n))&&t.delete(n)}}}function sameFileFingerprint(e,t){return e.dev===t.dev&&e.ino===t.ino&&h(e,t)&&e.sha256===t.sha256}function sameOptionalFileFingerprint(e,t){return e===void 0?t===void 0:t!==void 0&&sameFileFingerprint(e,t)}function sameSqliteFileGeneration(e,t){return sameFileFingerprint(e.database,t.database)&&sameOptionalFileFingerprint(e.journal,t.journal)&&sameOptionalFileFingerprint(e.wal?.size===0n?void 0:e.wal,t.wal?.size===0n?void 0:t.wal)}function parseFileFingerprint(e){if(!m(e))throw Error(`SQLite file fingerprint must be an object`);for(let t of[`birthtimeNs`,`ctimeNs`,`dev`,`ino`,`mtimeNs`,`size`])if(typeof e[t]!=`string`||!/^-?\d+$/u.test(e[t]))throw Error(`SQLite file fingerprint ${t} is invalid`);if(typeof e.sha256!=`string`||!/^[a-f0-9]{64}$/u.test(e.sha256))throw Error(`SQLite file fingerprint sha256 is invalid`);return{birthtimeNs:BigInt(e.birthtimeNs),ctimeNs:BigInt(e.ctimeNs),dev:BigInt(e.dev),ino:BigInt(e.ino),mtimeNs:BigInt(e.mtimeNs),sha256:e.sha256,size:BigInt(e.size)}}function parseSqliteFileGeneration(e){let t=JSON.parse(e);if(!m(t))throw Error(`SQLite file generation must be an object`);return{database:parseFileFingerprint(t.database),...t.journal===void 0?{}:{journal:parseFileFingerprint(t.journal)},...t.wal===void 0?{}:{wal:parseFileFingerprint(t.wal)}}}function readSqliteFileGenerationSync(e){return parseSqliteFileGeneration(_t(e,void 0,`file-generation`))}async function backupNodeSqliteDatabase(e,t,n){let r=setInterval(()=>{},100);try{let r=await Ct().backup(e,at(t),{progress:n});return n?.({totalPages:r,remainingPages:0}),r}finally{clearInterval(r)}}function createPrivateWindowsDirectory(e){let t=!1;try{cr(B.resolve(e),{private:!0,assertBeforeMutation(){t=!0}})}catch(e){throw!t||e instanceof lr&&e.code===`already-exists`?ae(e):e}}function resolvePrivateSqliteSnapshotStagingRoot(e=process.env){try{return resolveSnapshotStagingRoot(e)}catch(e){throw e instanceof Error&&ht(e)?new ne(`SQLite snapshot staging root is unavailable: ${e.message}; free disk space/quota`,{cause:e}):e}}function resolveSnapshotStagingRoot(t){let n=t.OPENCLAW_UPDATE_IN_PROGRESS===`1`?t.TMPDIR?.trim():void 0;if(n&&B.isAbsolute(n))return s({preferredDir:B.join(n,`openclaw`),tmpdir:()=>n});let r=process.platform===`win32`?t.LOCALAPPDATA?.trim():void 0,i=process.platform===`win32`?`AppData/Local`:`.cache`,a=process.platform===`darwin`?`Library/Caches`:i,c=[t.XDG_CACHE_HOME?.trim(),r].find(e=>e&&B.isAbsolute(e))??B.join(o(t),a),l=e(t),u=rr(`sha256`).update(l).digest(`hex`).slice(0,24);z.mkdirSync(c,{recursive:!0,mode:448});let d=s({preferredDir:B.join(c,`openclaw`),tmpdir:()=>c}),[f=``,...p]=B.relative(d,l).split(B.sep),m=p.length>0&&/^sqlite-[a-f0-9]{24}$/u.test(f)?f:`sqlite-${u}`,h=B.join(d,m);z.mkdirSync(h,{recursive:!0,mode:448});let g=z.lstatSync(h);if(!g.isDirectory()||process.getuid&&g.uid!==process.getuid()||process.platform!==`win32`&&g.mode&63)throw Error(`SQLite snapshot namespace must be a private user-owned directory`);return h}function createPrivateSqliteTempDirectorySync(e,t){if(process.platform!==`win32`)try{return z.mkdtempSync(B.join(e,t))}catch(e){throw ae(e)}let n=B.join(e,`${t}${ir()}`);return createPrivateWindowsDirectory(n),n}function sqliteSnapshotSourceFileSize(e){try{let t=z.statSync(e);return t.isFile()?t.size:0}catch(e){if(c(e,`ENOENT`))return 0;throw e}}function assertSqliteSnapshotSpace(e,t){let n=typeof e==`string`?[``,`-wal`,`-journal`].reduce((t,n)=>t+sqliteSnapshotSourceFileSize(e+n),0):Fn(e),r=tryReadDiskSpace(t);if(r&&r.availableBytes<n)throw Object.assign(/* @__PURE__ */ Error(`SQLite read-only snapshot needs ${formatDiskSpaceBytes(n)} (${n} bytes) near ${t}, but only ${formatDiskSpaceBytes(r.availableBytes)} (${r.availableBytes} bytes) is available. Free disk space before retrying.`),{code:`ENOSPC`})}function acquireSqliteSnapshotReadToken(e){return xe(e,`read`)}function sqliteSnapshotStagingError(e,t,n=!1,r){Zt(t,`snapshot`);let i=n,a=!1,o=!1,s;for(let n=0,r=t;n<8&&r instanceof Error;n+=1){o||=r instanceof AggregateError||r instanceof T;let{errcode:t,path:n}=r;a||=ht(r),(a||typeof t==`number`&&[13,778,1034,1290].includes(t)||`${n??``}${B.sep}`.startsWith(`${e}${B.sep}`))&&(i=!0,typeof t==`number`&&(s=t)),r=r.cause}if(!i)return t;let c=a?`free disk space/quota`:`check filesystem health and write permissions`,l=``;if(a&&r)try{let t=sqliteSnapshotSourceFileSize(r)+sqliteSnapshotSourceFileSize(`${r}-wal`)+sqliteSnapshotSourceFileSize(`${r}-journal`),n=tryReadDiskSpace(e)?.availableBytes,i=z.existsSync(`${r}-wal`)&&z.existsSync(`${r}-shm`);l=`; estimated ${t} bytes needed; ${n===void 0?`available bytes unknown`:`${n} bytes available`}; source ${i?`has live WAL sidecars`:`has no live WAL sidecars`}`}catch{}let u=process.env.OPENCLAW_UPDATE_IN_PROGRESS===`1`?`TMPDIR`:`XDG_CACHE_HOME`,d=`${t instanceof Error?t.message:String(t)}${s===void 0?``:` (SQLite errcode=${s})`}; snapshot staging root ${n?e:B.dirname(e)}${l}: ${c} or set ${u} to a writable filesystem`,f=a&&!o&&on(t)!==`source`?new ne(d,{cause:t}):Error(d,{cause:t});return Te(t)?ae(f):f}async function createSqliteSnapshotStagingDirectory(e=resolvePrivateSqliteSnapshotStagingRoot(),t=!1,n,r=!1){n?.throwIfAborted();try{return await allocateSqliteSnapshotStagingDirectory(e,t,n,r)}catch(e){throw e instanceof T||r&&e instanceof AggregateError||(n?.throwIfAborted(),Zt(e,`snapshot`)),e}}async function allocateSqliteSnapshotStagingDirectory(e=resolvePrivateSqliteSnapshotStagingRoot(),t=!1,n,r=!1){if(n?.throwIfAborted(),r){let r=new AbortController;return ot((async()=>{let{allocateWorkerOwnedSqliteSnapshotDirectory:i}=await import(`./read-only.worker-sqlite-snapshot-staging-allocation-D9lucsXN.mjs`);n?.throwIfAborted(),r.signal.throwIfAborted();let a=await i(e,t,n?AbortSignal.any([n,r.signal]):r.signal);if(De(a.directory),n?.aborted||r.signal.aborted){if(!await le(a.directory))throw new T(`SQLite snapshot cleanup failed: ${a.directory}`);n?.throwIfAborted(),r.signal.throwIfAborted()}return a.directory})(),()=>r.abort(/* @__PURE__ */ Error(`SQLite snapshot allocation stopped`)))}return createSqliteSnapshotStagingDirectorySync(e,t)}function createSqliteSnapshotStagingDirectorySync(e=resolvePrivateSqliteSnapshotStagingRoot(),t=!1){let n=createSqliteSnapshotStagingTokenSync(e,t);return De(n.directory,n.release),n.directory}function createSqliteSnapshotStagingTokenSync(e=resolvePrivateSqliteSnapshotStagingRoot(),t=!1){let n;try{try{n=createPrivateSqliteTempDirectorySync(e,t?`openclaw-sqlite-readonly-${process.pid}-`:Me)}catch(t){throw sqliteSnapshotStagingError(e,t,!0)}return{directory:n,release:xe(n,`create`)}}catch(e){throw n&&Ae(n),e}}Buffer.from([217,213,5,249,32,161,99,215]);async function prepareSqliteReadOnlyLocationFromOwnedDatabase(e,t,n,r){let assertReady=()=>{if(n?.throwIfAborted(),t(),!e.isOpen||e.isTransaction)throw Error(`SQLite inspection requires an open owner outside a transaction`)};assertReady();let i=await createSqliteSnapshotStagingDirectory(void 0,!1,n,r===`async`);try{assertReady(),assertSqliteSnapshotSpace(e,i);let r=B.join(i,`database.sqlite.partial`);return await ot(backupNodeSqliteDatabase(e,r)),n?.throwIfAborted(),t(),ke(i)}catch(e){let t=[e];throw!await le(i,e=>t.push(e))&&r===`async`?te(t,`Owned SQLite snapshot preparation`):e}}const kr=n(Symbol.for(`openclaw.sqliteSnapshotFlights`),()=>({unscoped:/* @__PURE__ */ new Map,scoped:/* @__PURE__ */ new WeakMap}));function completed$1(e){let t=k(()=>{});return t.resolve(e),t.operation}function serviceWhenSettled(e,t){e.result.then(t,t)}function createFlight(e,t,n){let r,i=!1,a=!1,o,s,c,l=k(()=>{if(!(a||l.operation.read().status!==`pending`)){a=!0;try{i||(i=!0,r=n(d.controller.signal,e=>c=e),serviceWhenSettled(r.operation,serviceFlight)),r.operation.service();let e=r.operation.read();e.status===`fulfilled`?l.resolve(e.value):e.status===`rejected`&&l.reject(e.error)}catch(e){l.reject(e)}finally{a=!1}}}),u=k(()=>{l.operation.service();let n=l.operation.read();if(n.status!==`pending`&&u.operation.read().status===`pending`){if(e.get(t)===d&&e.delete(t),n.status===`rejected`)u.reject(c??n.error);else if(d.references>0)u.resolve(n.value);else{o||(o=releaseSnapshot(d,n.value),serviceWhenSettled(o,()=>u.operation.service())),o.service();let e=o.read();e.status===`fulfilled`?e.value?u.resolve(n.value):u.reject(new T(`SQLite orphan snapshot cleanup did not complete`)):e.status===`rejected`&&u.reject(e.error)}}});function serviceFlight(){l.operation.service();for(let e of d.listeners)e();u.operation.service()}let d={controller:new AbortController,references:0,listeners:/* @__PURE__ */ new Set,production:l.operation,settled:u.operation,closeProducer(){return s??=r?.startClose?.()??completed$1(void 0),s}};return ot(u.operation.result,()=>{d.controller.abort(/* @__PURE__ */ Error(`SQLite snapshot owner stopped`)),serviceFlight()}),d}function releaseSnapshot(e,t){return Qt(t.startCleanup(),t=>t?ln(e.closeProducer(),()=>!0):completed$1(!1))}function leaseFlight(e,t){let n=!1,r,releaseReference=()=>(n||(n=!0,e.references--),e.references===0),startCleanup=()=>(r??=!n&&releaseReference()?releaseSnapshot(e,t):completed$1(!0),r);return{location:t.location,cleanupRoot:t.cleanupRoot,privateFamily:t.privateFamily,cleanup(){if(n){let e=r?.read();return!e||e.status===`fulfilled`&&e.value}if(e.references>1)return releaseReference(),!0;let i=t.cleanup();return i&&releaseReference(),i},cleanupAsync:()=>startCleanup().result,startCleanup}}function startSnapshotFlight(e,t,n,r,i){r?.throwIfAborted();let a=`${$t(e).key}:${t}`,o=kr.unscoped;if(i?.scope){let e=kr.scoped.get(i.scope);e||(e=/* @__PURE__ */ new Map,kr.scoped.set(i.scope,e)),o=e}let s=o.get(a);s||(s=createFlight(o,a,n),o.set(a,s));let c=s;c.references++;let l=!1,u=!1,d,f=k(()=>{if(f.operation.read().status===`pending`){if(l||r?.aborted){if(u||(u=!0,c.references--),c.references===0&&(c.controller.abort(r?.reason),o.get(a)===c&&o.delete(a),c.settled.service(),c.settled.read().status===`pending`))return;f.reject(r?.reason??/* @__PURE__ */ Error(`SQLite snapshot preparation closed`))}else{c.production.service();let e=c.production.read();if(e.status===`pending`)return;e.status===`fulfilled`?f.resolve(leaseFlight(c,e.value)):(c.references--,f.reject(e.error))}r?.removeEventListener(`abort`,service),c.listeners.delete(service),c.settled.service()}}),service=()=>f.operation.service();return serviceWhenSettled(c.settled,service),c.listeners.add(service),r?.addEventListener(`abort`,service,{once:!0}),queueMicrotask(service),{...f.operation,startClose(){l=!0,f.operation.service();let e=f.operation.read();return d??=e.status===`fulfilled`?ln(e.value.startCleanup(),e=>{if(!e)throw new T(`SQLite snapshot lease cleanup did not complete`)}):c.references===0?c.closeProducer():completed$1(void 0),d}}}function startAwaitedSnapshotWork(e){let t=k(()=>{});return Promise.resolve().then(e).then(t.resolve,t.reject),t.operation}async function prepareSingleFlightSqliteSnapshot(e,t,n,r,i){return startSnapshotFlight(e,t,(e,t)=>({operation:startAwaitedSnapshotWork(async()=>{let r=await n(e,t);return{...r,startCleanup:()=>startAwaitedSnapshotWork(()=>r.cleanupAsync())}})}),r,i).result}const Ar=n(Symbol.for(`openclaw.sqliteLiveSnapshotOwners`),()=>/* @__PURE__ */ new Map);function registerLiveSqliteSnapshotOwner(e){let t=$t(e.databasePath),n={assertCurrent:e.assertCurrent,database:e.database};return Ar.set(t.key,n),()=>{Ar.get(t.key)===n&&Ar.delete(t.key)}}function prepareSqliteSnapshotFromLiveOwner(e,t){t?.throwIfAborted();let n=$t(e),r=Ar.get(n.key);if(r)return r.assertCurrent(),prepareSingleFlightSqliteSnapshot(n.canonicalPath,`live-owner:openclaw-state`,e=>prepareSqliteReadOnlyLocationFromOwnedDatabase(r.database,r.assertCurrent,e),t)}function fingerprint(e){return[e.dev,e.ino,e.birthtimeNs,e.ctimeNs,e.mtimeNs,e.size].join(`:`)}function walFingerprint(e){return[e.dev,e.ino,e.mtimeNs,e.size].join(`:`)}function readFile$1(e){let t=z.lstatSync(e,{bigint:!0,throwIfNoEntry:!1});if(t){if(!t.isFile()||t.nlink!==1n)throw Error(`Private SQLite snapshot must be an independent regular file: ${e}`);return t}}function captureSqlitePrivateSnapshotFamily(e,t){if(z.lstatSync(`${e}-journal`,{throwIfNoEntry:!1}))return;let n=readFile$1(e),r=readFile$1(`${e}-wal`);return n?{root:t,main:fingerprint(n),wal:r&&r.size>32n?walFingerprint(r):null}:void 0}const H=n(Symbol.for(`openclaw.sqliteReusableSnapshots`),()=>/* @__PURE__ */ new Map),jr=n(Symbol.for(`openclaw.sqliteReusableSnapshotScopes`),()=>({depth:0,retiring:/* @__PURE__ */ new Set}));function completed(e){let t=k(()=>{});return t.resolve(e),t.operation}function readSource(e){try{let t=z.statSync(e,{bigint:!0,throwIfNoEntry:!1});if(!t?.isFile()||z.statSync(`${e}-journal`,{throwIfNoEntry:!1}))return;let n=z.statSync(`${e}-wal`,{bigint:!0,throwIfNoEntry:!1}),r=n&&n.size>0n?n:void 0;return{fingerprint:[`${t.dev}:${t.ino}:${t.size}:${t.mtimeNs}:${t.ctimeNs}`,r?`${r.dev}:${r.ino}:${r.size}:${r.mtimeNs}`:`none`].join(`|`),main:t,newestMs:Math.max(Number(t.mtimeMs),Number(r?.mtimeMs??0)),quiescentMs:[t,r].some(e=>e&&e.mtimeNs%1000000000n==0n)?2e3:50}}catch{return}}function canonicalKey(e){try{return z.realpathSync.native(e)}catch{return}}function retire(e,t){H.get(e)===t&&H.delete(e),t.retired=!0,t.leases===0&&settleRetirement(t.retire)}function settleRetirement(e){let t=new Promise(t=>{t(e())}).catch(reportRetirementFailure).finally(()=>jr.retiring.delete(t));jr.retiring.add(t)}function reportRetirementFailure(e){f({subsystem:`infra/sqlite-snapshot`}).warn({error:String(e)},`Retiring a reusable SQLite snapshot failed.`)}function lend(e,t){t.leases+=1;let n=!1,release=()=>(n||(n=!0,--t.leases,t.leases===0&&t.retired&&retire(e,t)),!0);return{location:t.location,cleanupRoot:t.cleanupRoot,privateFamily:t.privateFamily,cleanup:release,cleanupAsync:async()=>release(),startCleanup:()=>completed(release())}}function leaseReusableSqliteSnapshot(e,t,n={}){let r=canonicalKey(e),i=r?H.get(r):void 0;if(r&&i){if(readSource(r)?.fingerprint!==i.fingerprint||!z.existsSync(i.location))retire(r,i);else if(!i.logicalOnly||n.logicalReader){if(t)try{an(i.main,t)}catch{return}return lend(r,i)}}}function captureReusableSqliteSource(e){let t=jr.depth>0?canonicalKey(e):void 0,n=t?readSource(t):void 0;return n&&Date.now()-n.newestMs>=n.quiescentMs?n:void 0}function captureFamily(e){try{return captureSqlitePrivateSnapshotFamily(e.location,e.cleanupRoot??B.dirname(e.location))}catch{return}}const Mr=n(Symbol.for(`openclaw.sqliteReusableSnapshotSources`),()=>/* @__PURE__ */ new Map);function bindReusableSqliteSource(e,t){t&&Mr.set(e,t)}function publishBoundReusableSqliteSnapshot(e,t,n){let r=canonicalKey(e)??B.resolve(e),i=H.get(r),a=Mr.get(t.location)??(i?.location===t.location?i:void 0);return Mr.delete(t.location),a?publishReusableSqliteSnapshot(e,a,t,n):t}function publishReusableSqliteSnapshot(e,t,n,r,i={}){let a=canonicalKey(e)??B.resolve(e),o=H.get(a);if(o?.location===n.location&&o.fingerprint===t.fingerprint)return settleRetirement(r),lend(a,o);o&&retire(a,o);let s={...t,logicalOnly:i.logicalOnly===!0,location:n.location,cleanupRoot:n.cleanupRoot,privateFamily:n.privateFamily??captureFamily(n),leases:0,retired:!1,retire:r};return H.set(a,s),lend(a,s)}const Nr=[``,`-wal`,`-shm`,`-journal`];Nr.slice(1),Buffer.from([0,5,22,7]),p(`state/sqlite`);function resolveSqliteDatabaseFilePaths(e){return Nr.map(t=>`${e}${t}`)}function buildUpdateRehearsalPathEnv(e){return{HOME:e,USERPROFILE:e,TMPDIR:e,TMP:e,TEMP:e,XDG_CONFIG_HOME:B.join(e,`config`),XDG_CACHE_HOME:B.join(e,`cache`),XDG_DATA_HOME:B.join(e,`data`),XDG_STATE_HOME:B.join(e,`state`),OPENCLAW_HOME:e,OPENCLAW_STATE_DIR:e,OPENCLAW_CONFIG_PATH:B.join(e,`openclaw.json`),OPENCLAW_WORKSPACE_DIR:B.join(e,`workspace`),OPENCLAW_SKIP_CHANNELS:`1`,OPENCLAW_SKIP_PROVIDERS:`1`,OPENCLAW_SKIP_CRON:`1`,OPENCLAW_SKIP_GMAIL_WATCHER:`1`,OPENCLAW_SKIP_CANVAS_HOST:`1`,OPENCLAW_SKIP_BROWSER_CONTROL_SERVER:`1`,OPENCLAW_SKIP_STARTUP_MODEL_PREWARM:`1`,OPENCLAW_NO_AUTO_UPDATE:`1`,NODE_DISABLE_COMPILE_CACHE:`1`}}function resolveUpdateRehearsalRoot(e){let t=e.OPENCLAW_STATE_DIR;if(t&&B.isAbsolute(t)&&[`0`,`1`].includes(e.OPENCLAW_UPDATE_IN_PROGRESS??``)&&!Object.entries(buildUpdateRehearsalPathEnv(t)).some(([t,n])=>e[t]!==n)&&e.OPENCLAW_SERVICE_REPAIR_POLICY===`external`&&e.OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_SERVICE_REPAIR===`0`&&e.OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_ACTIVATION===`0`&&!e.OPENCLAW_COMPATIBILITY_HOST_VERSION)return B.resolve(t)}function isUpdateRehearsalReadOnlyPath(e,t){let n=resolveUpdateRehearsalRoot(t);if(!n)return!1;let r=B.resolve(e);return!i(n,r)||!i(_n(n),_n(r))}function isUpdateRehearsalPrivateDatabase(e,t){return resolveUpdateRehearsalRoot(t)!==void 0&&resolveSqliteDatabaseFilePaths(e).every(e=>!isUpdateRehearsalReadOnlyPath(e,t))}function findArtifactSnapshot(e,t){let n=e.snapshots.get(t.canonicalPath);if(n&&(n.sourceIdentity.key!==t.key||n.sourceIdentity.birthtime!==t.birthtime))throw Error(`SQLite database file identity changed during inspection`);return n}function retainArtifactSnapshot(e,t,n){let r=pe(t.cleanupRoot??B.dirname(t.location));e.privateRoots.add(t.cleanupRoot??B.dirname(t.location));let i={...t,sourceIdentity:n,cleanup:()=>(r(),t.cleanup()),cleanupAsync:()=>(r(),t.cleanupAsync())};return e.snapshots.set(n.canonicalPath,i),i}function assertCustodiedSourceUnchanged(e,t){let n=z.statSync(e,{bigint:!0,throwIfNoEntry:!1});if(!n||n.ino!==t.ino||n.size!==t.size||n.mtimeNs!==t.mtimeNs||Ie(e)===void 0)throw Error(`SQLite source changed during in-place inspection: ${e}`)}function openSqliteReadOnlyDatabase(e,t={}){let n=rt.getStore();if(!n||!lt(`agent`,e))return Qe(e,{...t,readOnly:!0});let r=$t(e),i=findArtifactSnapshot(n,r),a=i?void 0:Ie(r.canonicalPath);i||a||isUpdateRehearsalPrivateDatabase(e,process.env)||(i=retainArtifactSnapshot(n,prepareSqliteReadOnlyLocationSync(e),r));let o=i?pe(i.cleanupRoot??B.dirname(i.location)):void 0,s={},close=()=>{s.close?.(),o?.(),n.readers.delete(close)};n.readers.add(close);let c=i?.location??(a?Ve(r.canonicalPath):e),l=Qe(c,{...t,readOnly:!0}),u=l.close.bind(l);return s.close=()=>{l.isOpen&&(u(),a&&assertCustodiedSourceUnchanged(r.canonicalPath,a))},l.close=close,l}async function prepareSqliteReadOnlyLocation(e,t={}){let n=Ce(t.signal),r=t.preserveSourceArtifacts===!0||lt(`agent`,e);try{if(n?.throwIfAborted(),!r&&t.allowLiveOwner!==!1){let t=prepareSqliteSnapshotFromLiveOwner(e,n);if(t)return await t}n?.throwIfAborted();let i=t.reuse===!0&&r,a=i?leaseReusableSqliteSnapshot(e,t.expectedSourceIdentity):void 0;if(a)return a;let o=t.requireCleanup??t.signal!==void 0,s=prepareSingleFlightSqliteSnapshot(e,`${r?`worker-sync`:`worker-async`}:${o?`strict`:`best-effort`}:sync-token${t.expectedSourceIdentity?`:${JSON.stringify(t.expectedSourceIdentity)}`:``}`,async(n,a)=>{let s,c=i?captureReusableSqliteSource(e):void 0;try{n.throwIfAborted(),s=await createSqliteSnapshotStagingDirectory(void 0,!1,n),n.throwIfAborted();let a=await Le(e,{mode:r?`sync`:`async`,signal:n,stagingRoot:s,expectedSourceIdentity:t.expectedSourceIdentity});n.throwIfAborted(),bindReusableSqliteSource(a,c);let l=yt(a,s,o);return i&&(l.privateFamily=captureFamily(l)),l}catch(e){if(s&&!await le(s)){let t=new T(`${l(e)}; SQLite snapshot cleanup failed: ${s}`,{cause:e});throw a?.(t),t}throw e instanceof T?(a(e),e):(n.throwIfAborted(),e)}},n,t.shared===!1?{scope:{}}:void 0);return i?s.then(t=>publishBoundReusableSqliteSnapshot(e,t,()=>t.cleanup())):s}catch(e){throw n?.throwIfAborted(),e}}function prepareSqliteReadOnlyLocationSync(e,t,n={}){let r=n.reuse?leaseReusableSqliteSnapshot(e,t):void 0;if(r)return r;let i=n.reuse?captureReusableSqliteSource(e):void 0,a=createSqliteSnapshotStagingDirectorySync();try{let n=yt(_t(e,a,`sync`,t),a);return i?publishReusableSqliteSnapshot(e,i,n,()=>n.cleanup()):n}catch(e){throw Ae(a)?e:new T(`${l(e)}; SQLite snapshot cleanup failed: ${a}`,{cause:e})}}const Pr={name:`openclaw.quarantine.schema`,lifetime:`process`,schemaDependent:!0,read(e){if(typeof e==`object`&&e&&`version`in e&&typeof e.version==`number`)return{version:e.version}}};function quarantineDecisionAdmission(e){return{name:`openclaw.quarantine.decision:${B.resolve(e)}`,lifetime:`process`,read:e=>e===null||isQuarantineDecision(e)?e:void 0}}function isQuarantineDecision(e){return m(e)&&(e.kind===`agent`||e.kind===`state`)&&typeof e.reason==`string`&&typeof e.quarantinedAt==`number`&&(e.verifiedGenerationJson===null||typeof e.verifiedGenerationJson==`string`)}function readQuarantineSchemaVersion(e,t,n=!1){let r=n?void 0:S(e,Pr);if(r)return r.version;let i=e.prepare(`PRAGMA user_version`).get()?.user_version;if(typeof i!=`number`||!Number.isInteger(i))throw Error(`OpenClaw quarantine store ${t} has an invalid schema version.`);if(i>2)throw Error(`OpenClaw quarantine store ${t} uses newer schema version ${i}.`);return i!==0&&C(e,Pr,{version:i}),i}function readOpenClawDatabaseQuarantine(e,t={}){let n=se(t.env??process.env);t.refreshIdentity&&Ft(n);let load=()=>readPersistedQuarantineDecision(e,n,t.fresh)??null,r=t.fresh?load():nn(n,quarantineDecisionAdmission(e),load);return r?resolveQuarantineDecision(r,e,n):void 0}function readPersistedQuarantineDecision(e,t,n=!1){if(!ar(t))return;let r=openSqliteReadOnlyDatabase(t,{timeout:5e3}),i;try{i={value:readQuarantineDecision(r,e,t,n)}}catch(e){i={error:e}}try{r.close()}catch(n){let r,a=`error`in i?i.error:void 0;if(`value`in i&&i.value)try{r=resolveQuarantineDecision(i.value,e,t)}catch(e){a=e}throw new pt(a===void 0?[n]:[a,n],r)}if(`error`in i)throw i.error;return i.value}function readQuarantineDecision(e,t,n,r=!1){let i=readQuarantineSchemaVersion(e,n,r);if(i===0)return;let a=i>=2?`, verified_generation`:``,o=e.prepare(`SELECT kind, reason, quarantined_at${a} FROM quarantined_databases WHERE path = ? LIMIT 1`).get(B.resolve(t));if(!o)return;let s=i>=2?o.verified_generation:void 0;if(o.kind!==`agent`&&o.kind!==`state`||typeof o.reason!=`string`||typeof o.quarantined_at!=`number`||!Number.isInteger(o.quarantined_at)||s!=null&&typeof s!=`string`)throw Error(`OpenClaw quarantine store ${n} contains an invalid row.`);return{kind:o.kind,quarantinedAt:o.quarantined_at,reason:o.reason,verifiedGenerationJson:typeof s==`string`?s:null}}function resolveQuarantineDecision(e,t,n){if(e.verifiedGenerationJson!==null){let r;try{r=parseSqliteFileGeneration(e.verifiedGenerationJson)}catch{throw Error(`OpenClaw quarantine store ${n} contains an invalid row.`)}try{let e=readSqliteFileGenerationSync(B.resolve(t));if(!sameSqliteFileGeneration(r,e))return}catch{return}}return{kind:e.kind,quarantinedAt:e.quarantinedAt,reason:e.reason}}function readOpenClawDatabaseQuarantineFailure(e,t,n={}){let r,i;try{r=readOpenClawDatabaseQuarantine(t,n)}catch(e){if(!(e instanceof pt))return;if(!e.quarantine)throw e;r=e.quarantine,i=e}if(!r)return;let a=/* @__PURE__ */ Error(`OpenClaw ${e} database ${t} is quarantined after integrity verification failed: ${r.reason??`unknown integrity error`}. Restore the database from a backup or repair it, then run openclaw doctor --fix to clear the quarantine. See ${Ue}.`);return a.name=`SqliteIntegrityError`,i&&(a.cause=i),a}const Fr=new V;function getProcessCleanupBudget(){return Fr.getStore()}function createStateDatabaseRetainer(e,t){let admit=(e,n,r)=>{let i=x();return n===`cached-read`?i?.assertReadAdmission():i?.assertAdmission(),t.assertOpen(e,n,r),i},retain=(n,r,i=!1)=>{if(t.capture(n.path).assertCurrent(),e.cachedDatabases.get(n.path)!==n||!n.db.isOpen)throw Error(`OpenClaw state database borrow requires its current canonical handle`);let a=e.borrowers.get(n.db)??{references:/* @__PURE__ */ new Set,retiring:!1,cleanupComplete:!1};if(a.retiring)throw Error(`OpenClaw state database native owner is retiring`);i||Ke(n.db),e.borrowers.set(n.db,a);let isCurrent=()=>!r||ct(n.db,r),o=i?void 0:{ordinary:r===void 0,isCurrent,retire:()=>{isCurrent()?t.retire(n,r===void 0):a.retiring=!1}};function createAsyncStateDatabaseRetirement(){let e={},r,i,finish=r=>{a.references.delete(e),a.releaseJoin?a.releaseJoin.resolve():r?.isCurrent()?r.retire():a.retiring=!1,a.retirement=void 0,a.asyncRetirement=void 0,i?.(),i=void 0,a.releaseJoin||t.touch(n)},run=()=>r||(a.cleanupComplete||a.references.size>+!!a.references.has(e)?Promise.resolve():a.retirement?.isCurrent()?(a.retiring=!0,a.references.add(e),i??=t.ownRetirement(n,close),r=Promise.resolve().then(async()=>{await n.walMaintenance.stop(),finish(a.retirement)}).catch(r=>{throw a.references.add(e),t.retainFailed(n),a.releaseJoin?.reject(r),a.releaseJoin=void 0,r}),r.catch(()=>{}),r):(finish(),Promise.resolve()));function close(){let e=run();return e.catch(t=>{throw r===e&&(r=void 0),t})}return{start:()=>void run(),close}}let s={};a.references.add(s);let c=!1,release=()=>{if(c||a.cleanupComplete)c=!0;else if(c=!0,a.references.delete(s),a.releaseJoin)a.references.size===0&&a.releaseJoin.resolve();else if(a.retirement&&!a.retirement.isCurrent()&&(a.retirement=void 0,a.asyncRetirement=void 0,a.retiring=!1),o?.isCurrent()&&!a.retirement?.ordinary&&(a.retirement=o),!(a.references.size>0)){if(!a.retirement)t.touch(n);else if(a.retiring=!0,a.asyncRetirement)a.asyncRetirement.start();else{try{a.retirement.retire()}catch(e){throw c=!1,t.retainFailed(n),e}a.retirement=void 0,t.touch(n)}}},l={release,async releaseAsync(){a.cleanupComplete||(a.releaseJoin?release():((o?.isCurrent()&&!a.retirement?.ordinary?o:a.retirement)?.isCurrent()&&(a.asyncRetirement??=createAsyncStateDatabaseRetirement()),release(),await a.asyncRetirement?.close()))}};return r?.own(l,`shared-references`,()=>l.releaseAsync()),l},findReadDatabase=(t,n,r)=>{let i=v({path:t}),a=e.cachedDatabases.get(i);return a?.db.isOpen?{database:a,scope:admit(i,n,r)}:{database:void 0,scope:void 0}},retainReadReference=(t,n)=>{let r=retain(t,n,!0),assertCurrent=()=>{if(e.cachedDatabases.get(t.path)!==t||!t.db.isOpen)throw Error(`Shared-state read lost its original native owner`)};return{assertCurrent,observe(){assertCurrent(),Ke(t.db)},release:()=>r.release()}};return{retain:e=>retain(e,admit(e.path)),retainForIndependentRead(e,t,n){let{database:r,scope:i}=findReadDatabase(e,t,n);return r?retainReadReference(r,i):void 0},borrowForRead(e,t,n){let{database:r,scope:i}=findReadDatabase(e,t,n);if(r){if(r.db.isTransaction)throw Error(`Asynchronous shared-state reads cannot run inside a native transaction`);return{database:r,...retainReadReference(r,i)}}}}}async function joinStateDatabaseBorrowersReleased(e,t){e&&!e.cleanupComplete&&(e.retiring=!0,e.references.size!==0&&(e.releaseJoin||(e.releaseJoin=St(),getProcessCleanupBudget()?.warn(`Waiting for ${e.references.size} active native borrower(s) before retiring OpenClaw state database: ${t}`)),await e.releaseJoin.promise))}function assertStateDatabaseBorrowersReleased(e,t){if(e?.references.size)throw Error(`OpenClaw state database still has active native borrowers (${e.references.size}): ${t}`)}function createStateDatabaseCacheAdmission(e){return{closeTerminalFailure(t,n){Pe(n,t),Ht(t),e.invalidate(t);let r=e.cachedDatabases.get(t),i=[];try{r&&e.evict(r)}catch(e){i.push(e)}try{e.notifyTerminalFailure(t,n)}catch(e){i.push(e)}A(i,`Terminal shared-state failure cleanup failed`)},read(t,n){if(!t.db.isOpen)return n(t);let r=!1;try{return gt(t.db,()=>(r=!0,n(t)))}catch(n){if(r)throw n;let i=n instanceof Error?n:Error(String(n));if(rn(i)){e.evict(t);return}throw i}}}}const Ir=p(`state/db`);function createStateDatabaseIdleRetirement({cachedDatabases:e,retainedDatabaseHandles:t,idleTimers:n,idleReferences:r,borrowers:i},o){let touch=s=>{if(!(e.get(s.path)===s&&s.db.isOpen)&&t.get(s.db)!==s)return;let c=n.get(s.db);if(c){c.refresh();return}let l=a(()=>setTimeout(()=>{n.delete(s.db);try{s.db.isOpen&&s.db.isTransaction?touch(s):!i.get(s.db)?.references.size&&!r.get(s.db)?.size&&o(s,!1,{busyTimeoutMs:0,checkpointMode:`PASSIVE`})}catch(e){Ir.warn(`Idle shared-state database cleanup failed`,{path:s.path,error:e}),touch(s)}},Wn));l.unref(),n.set(s.db,l)};return{touch,retain(t){if(e.get(t.path)!==t||!t.db.isOpen||i.get(t.db)?.retiring)throw Error(`OpenClaw state database idle retention requires its current canonical handle`);let n=r.get(t.db)??/* @__PURE__ */ new Set,a={};return n.add(a),r.set(t.db,n),()=>{n.delete(a)&&e.get(t.path)===t&&t.db.isOpen&&touch(t)}}}}const Lr=n(Symbol.for(`openclaw.gatewayServiceInstallation`),()=>new V);function getGatewayServiceInstallation(){return Lr.getStore()?.installation}function isGatewayExternallySupervised(e=process.env){return e.OPENCLAW_SUPERVISOR_MODE?.trim().toLowerCase()===`external`}const U=n(Symbol.for(`openclaw.stateDatabaseSchemaPolicies`),()=>({scopes:new V,existingDatabases:/* @__PURE__ */ new WeakMap,hasAdmittedExistingDatabase:!1}));function canonicalPath(e){let t=v({path:e});try{return cn(or.native(t))}catch(e){if(c(e,`ENOENT`))return t;throw e}}function assertSchemaScopeActive(e){if(e&&!e.active)throw Error(`Existing shared-state schema admission has ended.`)}function getExistingOpenClawStateSchemaPath(){let e=U.scopes.getStore();return assertSchemaScopeActive(e),e?.path}function captureOpenClawStateSchemaReadAdmission(e){let t=U.scopes.getStore();if(t)return isExistingOpenClawStateSchema(e),{path:t.path,assertCurrent:()=>assertSchemaScopeActive(t)}}function isExistingOpenClawStateSchema(e,t){let n=getExistingOpenClawStateSchemaPath(),r=U.scopes.getStore(),i=t&&U.existingDatabases.get(t);if(!r&&!i)return!1;let a=v({path:e}),o=n!==void 0&&(n===a||r?.canonicalPath===a||r?.canonicalPath===canonicalPath(a));if(n&&!o)throw Error(`Existing shared-state schema admission is bound to ${n}, not ${e}.`);if(i&&(!o||i!==r?.canonicalPath))throw Error(`Shared-state database ${e} was admitted without schema repair; close its existing handle before ordinary admission.`);return o}function assertExistingOpenClawStateSchemaCacheAdmission(e,t){let n=getExistingOpenClawStateSchemaPath();if(!U.hasAdmittedExistingDatabase)return;let r=U.scopes.getStore(),i=r?v({path:e}):void 0,a=r&&(n===i||r.canonicalPath===i)?r.canonicalPath:void 0;for(let n of[t.cachedDatabases,t.retainedDatabaseHandles])for(let{db:t}of n.values()){let n=U.existingDatabases.get(t);n&&t.isOpen&&(a??=canonicalPath(e),n===a&&isExistingOpenClawStateSchema(e,t))}}function captureSqliteWorkerStateContext(e){return{databaseEngineSelection:e.databaseEngineSelection??gn(),environment:{...e.environment},initializationCronDefaultStoreKey:e.initializationCronDefaultStoreKey,...e.initializationEnvironment?{initializationEnvironment:{...e.initializationEnvironment}}:{},...e.initializationAgentPaths?{initializationAgentPaths:[...e.initializationAgentPaths]}:{},existingSchemaPath:e.existingSchemaPath,gatewayServiceInstallation:e.gatewayServiceInstallation,...e.stateIntegrity?{stateIntegrity:e.stateIntegrity}:{},artifactPreservingReads:e.artifactPreservingReads,liveStateReads:e.liveStateReads,...e.scheduledMaintenanceSuspension?{scheduledMaintenanceSuspension:e.scheduledMaintenanceSuspension}:{}}}function sqliteWorkerRequestBytes(e,t,n){let r=t?.initializationAgentPaths?.reduce((e,t)=>e+Buffer.byteLength(t,`utf8`),0)??0;return[t?.environment,t?.initializationEnvironment].reduce((e,t)=>Object.entries(t??{}).reduce((e,[t,n])=>e+Buffer.byteLength(t,`utf8`)+Buffer.byteLength(n??``,`utf8`),e),e.byteLength+Buffer.byteLength(JSON.stringify(t?.databaseEngineSelection)??``,`utf8`)+Buffer.byteLength(JSON.stringify(t?.gatewayServiceInstallation)??``,`utf8`)+(n?.byteLength??0)+r+Buffer.byteLength(t?.initializationCronDefaultStoreKey??``,`utf8`)+(t?.scheduledMaintenanceSuspension?.byteLength??0))}const Rr=n(Symbol.for(`openclaw.sqliteWorkerStateContext`),()=>new V);function getSqliteWorkerStateIntegrityAdmission(){return Rr.getStore()?.stateIntegrity}function resolveLegacyCronDefaultStoreKey(e){return B.resolve(d(e),`cron`,`jobs.json`)}function captureOpenClawStateReadContextWithAdmission(e,t,n,r){let i=captureOpenClawStateSchemaReadAdmission(e),a=t(e,r),o=getGatewayServiceInstallation(),s=a.captureIntegrity?.(),c=a.assertCurrent,l=a,runInCapturedSchemaScope;if(i){let e=V.snapshot();l={databasePath:a.databasePath,coordinationKey:a.coordinationKey,get identity(){return a.identity},captureIntegrity:a.captureIntegrity,assertCurrent(){a.assertCurrent(),i.assertCurrent()}},runInCapturedSchemaScope=t=>e(()=>(l.assertCurrent(),t()))}return{databaseEngineSelection:gn(),maintenanceScope:x(),admission:l,assertPublicationCurrent:c,existingSchemaPath:i?.path,gatewayServiceInstallation:o&&n(o.databasePath)?.key===a.identity.key?o:void 0,stateIntegrity:s,runInCapturedSchemaScope,artifactPreservingReads:lt(`agent`,e)||void 0,liveStateReads:ze()||void 0}}function captureOpenClawStateReadWorkerContextWithAdmission(t,n,r){let i=t.env??process.env,a=process.platform===`win32`?Dn(i):i,o={OPENCLAW_STATE_DIR:e(a),...isGatewayExternallySupervised(a)?{OPENCLAW_SUPERVISOR_MODE:`external`}:{}};return{...captureOpenClawStateReadContextWithAdmission(t.path??ye(o),n,r),environment:o}}function captureOpenClawStateWorkerContextWithAdmission(e,t,n){let r=captureOpenClawStateReadWorkerContextWithAdmission(e,t,n);return{...r,initializationCronDefaultStoreKey:resolveLegacyCronDefaultStoreKey(e.env??process.env),initializationEnvironment:bt([e.env??process.env,{OPENCLAW_STATE_DIR:void 0,OPENCLAW_SUPERVISOR_MODE:void 0},r.environment]),...e.initializationAgentPaths?{initializationAgentPaths:e.initializationAgentPaths.map(e=>B.resolve(e))}:{}}}function createStateDatabaseWalOwner({cachedDatabases:e,retainedDatabaseHandles:n,databaseIdentities:r,asyncResources:i},a,o){return{ownRetirement(e,t){let n={admission:{identity:o(e)},close:t},r=i.register(n);return He(e.db)?.own(n,`shared-references`,()=>n.close()),r},async stop(t,i){let a=/* @__PURE__ */ new Set([...n.values(),...e.values()]);await Promise.all([...a].filter(e=>t===void 0||e.path===t||i!==void 0&&r.get(e.db)?.key===i.key).flatMap(({walMaintenance:e})=>e?[e.stop()]:[]))},register(n,r,o,s){if(!dr||E(n.db))return;let c=captureOpenClawStateWorkerContextWithAdmission({path:n.path,env:s},()=>o,i.knownIdentity),l=new AbortController,u,cancel=()=>{if(l.abort(),!u)f();else return u.then(()=>void 0,()=>void 0)},d={admission:{identity:r},async close(){cancel(),await n.walMaintenance.stop(),f()}},f=i.register(d),run=async i=>{let o=He(n.db),s={...c,maintenanceScope:o},assertCurrent=()=>{if(l.signal.throwIfAborted(),s.admission.assertCurrent(),o?.assertAdmission(),He(n.db)!==o||e.get(n.path)!==n||!n.db.isOpen)throw new Ye(`Shared-state WAL maintenance owner changed`)},u,d=!1;try{assertCurrent(),u=a(n);let{runOpenClawStateWorkerOperation:e}=await import(`./read-only.worker-openclaw-state-worker-store-51VBBmgf.mjs`);return assertCurrent(),await e(s,e=>e.execute({type:`database.walMaintenance`,input:i},{signal:l.signal}),{existingOnly:!0,assertCurrent,createAdmission:()=>({nativeLocations:[n.path,r.canonicalPath],databaseIdentity:{databasePath:n.path,key:r.key,birthtime:r.birthtime},admission:vn((e,t)=>{if(assertCurrent(),!t())throw new Ye(`Shared-state WAL maintenance authority expired`);d=!0})})})}catch(e){if(!d&&(qe(e)||l.signal.aborted&&t(e)))return;throw e}finally{u?.()}};Un(n.db,e=>{if(l.signal.aborted)return Promise.resolve(void 0);let t=run(e);return u=t,t.finally(()=>{u===t&&(u=void 0),l.signal.aborted&&f()})},cancel)},readHealth(){let t=e.get(B.resolve(ye()));return t?.db.isOpen?t.walMaintenance.health:void 0}}}const zr=/* @__PURE__ */ new WeakMap;function getMaintenanceSqliteTableChecks(e){let t=x();if(!t?.ownsSchemaMaintenance||t.sqliteIntegrityCheck!==`quick`)return;let n=we(e),r=e.location();if(n===void 0||!r||jt(e)===void 0)return;let i=Ut(r);if(i===void 0)return;let a=zr.get(t);if(a||(a={committed:/* @__PURE__ */ new Map,transactions:/* @__PURE__ */ new WeakMap},zr.set(t,a)),!e.isTransaction){let e=a.committed.get(i);return e||(e=/* @__PURE__ */ new Set,a.committed.set(i,e)),e}let o=`${i}:${n}`,s=a.transactions.get(e);if(s)s.token!==o&&(s.token=o,s.tables.clear());else{let n=/* @__PURE__ */ new Set;s={token:o,tables:n},a.transactions.set(e,s),t.own(s,`shared-resources`,re(e,()=>n.clear()))}return s.tables}var SqliteRepairableForeignKeyError=class extends Error{constructor(e,t){super(`SQLite foreign_key_check failed for ${e}: repairable task_delivery_state.task_id references task_runs.task_id cascade-owned orphans (${t} rows). Run openclaw doctor --fix to migrate this legacy state before retrying.`),this.name=`SqliteRepairableForeignKeyError`,this.repair={kind:`task-delivery-orphans`,relation:`task_delivery_state.task_id`,parentTable:`task_runs`,orphanCount:t}}};function assertSqliteIntegrity(e,t,n={}){if(n.check===`quick`&&n.schemaOnly)return runSqliteCheck(e,t,`quick_check`,`schema_meta`),{integrityCheck:`ok`};let r=n.check===`quick`?`quick_check`:`integrity_check`,i=!1;try{runSqliteCheck(e,t,r,void 0,n.allFindings||n.ftsSchemas!==void 0)}catch(a){if(!n.ftsSchemas||!(a instanceof SqliteIntegrityError)||!a.findings||!classifySqliteFtsIntegrityFindings(e,a.findings,n.ftsSchemas))throw a;if(r===`quick_check`)return assertSqliteIntegrity(e,t,{check:`full`,ftsSchemas:n.ftsSchemas});i=!0}if(r===`quick_check`&&n.tables?.length){let r=new Set(oe(e).filter(e=>e.type===`table`).map(e=>e.name));for(let i of n.tables)r.has(i)&&assertSqliteTableIntegrity(e,t,i)}return runSqliteForeignKeyCheck(e,t),r===`integrity_check`&&!i&&Gt(e),i?{integrityCheck:`ok`,staleFts:!0}:{integrityCheck:`ok`}}function classifySqliteFtsIntegrityFindings(e,t,n){let r=/* @__PURE__ */ new Set;for(let e of t){if(e===`ok`)continue;let t=typeof e==`string`?/^malformed inverted index for FTS5 table main\.([A-Za-z_][A-Za-z0-9_]*)$/u.exec(e):null;if(!t?.[1])return;r.add(t[1])}if(r.size===0)return;let i=/* @__PURE__ */ new Map;for(let e of n)for(let t of e.matchAll(/CREATE VIRTUAL TABLE (?:IF NOT EXISTS )?([A-Za-z_][A-Za-z0-9_]*) USING fts5\s*\(/gu)){let n=t[1],r=At(e,t.index+t[0].length-1),a=i.get(n)??/* @__PURE__ */ new Set;a.add(D(e.slice(t.index,r+1))),i.set(n,a)}let a=oe(e).filter(e=>e.type===`table`);for(let e of r){let t=a.find(t=>t.name===e)?.sql;if(typeof t!=`string`||!i.get(e)?.has(D(t)))return}return[...r].toSorted()}function assertSqliteTableIntegrity(e,t,n){let r=getMaintenanceSqliteTableChecks(e);r?.has(n)||(runSqliteCheck(e,`${t} table ${n}`,`integrity_check`,n),r?.add(n))}function readSqliteCheckFindings(e,t,n,r=!1){let i=n?`('${n.replaceAll(`'`,`''`)}')`:r?`(2147483647)`:``;return e.prepare(`PRAGMA ${t}${i};`).all().map(e=>e[t]??Object.values(e)[0])}function runSqliteCheck(e,t,n,r,i=!1){let a;try{a=readSqliteCheckFindings(e,n,r,i)}catch(e){throw new SqliteIntegrityError(`SQLite ${n} failed for ${t}: ${e instanceof Error?e.message:String(e)}`,e)}if(a.length===1&&a[0]===`ok`)return`ok`;throw new SqliteIntegrityError(`SQLite ${n} failed for ${t}: ${a.map(e=>String(e)).join(`; `)||`no result`}`,void 0,a)}function runSqliteForeignKeyCheck(e,t){let n=0,r=!0,i,a=[];try{let t=e.prepare(`PRAGMA foreign_key_check;`);t.setReadBigInts(!0);for(let o of t.iterate())n+=1,retainSortedForeignKeyViolation(a,o),r&&(o.table===`task_delivery_state`&&o.parent===`task_runs`?(i??=readTaskDeliveryCascadeForeignKeyId(e),r=o.fkid===i):r=!1)}catch(e){throw new SqliteIntegrityError(`SQLite foreign_key_check failed for ${t}: ${e instanceof Error?e.message:String(e)}`,e)}if(a.length===0)return;if(r)throw new SqliteRepairableForeignKeyError(t,n);let o=a.map(formatSqliteForeignKeyViolation);throw n>5&&o.push(`additional violations omitted`),new SqliteIntegrityError(`SQLite foreign_key_check failed for ${t}: ${o.join(`; `)}`)}function readTaskDeliveryCascadeForeignKeyId(e){let t=e.prepare(`PRAGMA foreign_key_list(task_delivery_state);`);t.setReadBigInts(!0);let n=t.all(),r=n.find(e=>e.table===`task_runs`&&e.from===`task_id`&&e.to===`task_id`&&e.on_delete===`CASCADE`);return r&&typeof r.id==`bigint`&&n.filter(e=>e.id===r.id).length===1?r.id:void 0}var SqliteIntegrityError=class extends Error{constructor(e,t,n){super(t===void 0?`${e}. Stop the Gateway, run "openclaw doctor --fix" to inspect and repair this database, and restart. Only if Doctor still cannot repair the offline database, preserve the database and WAL and restore a verified backup.`:e,t===void 0?void 0:{cause:t}),this.findings=n,this.name=`SqliteIntegrityError`}};function retainSortedForeignKeyViolation(e,t){e.push(t),e.sort(compareSqliteForeignKeyViolations),e.length>5&&e.pop()}function compareSqliteForeignKeyViolations(e,t){let n=Buffer.compare(Buffer.from(e.table),Buffer.from(t.table));if(n!==0)return n;if(e.rowid===null||t.rowid===null){if(e.rowid!==t.rowid)return e.rowid===null?-1:1}else if(e.rowid!==t.rowid)return e.rowid<t.rowid?-1:1;let r=Buffer.compare(Buffer.from(e.parent),Buffer.from(t.parent));return r===0?e.fkid===t.fkid?0:e.fkid<t.fkid?-1:1:r}function formatSqliteForeignKeyViolation(e){let t=e.rowid===null?`row without rowid`:`row ${e.rowid.toString()}`;return`${e.table} ${t} references ${e.parent} (foreign key ${e.fkid.toString()})`}function getStateSchemaFacts(e){return E(e)?Je(e):y(e)}const Br={name:`state.schema-version`,lifetime:`process`,schemaDependent:!0,read(e){if(typeof e==`object`&&e&&`userVersion`in e&&typeof e.userVersion==`number`&&`contentVersion`in e&&typeof e.contentVersion==`number`)return{userVersion:e.userVersion,contentVersion:e.contentVersion}}};function createStateSchemaAdmission(e,t,n){let r={name:e,lifetime:n,schemaDependent:!0,read(e){if(typeof e!=`object`||!e||!(`value`in e)||!(`admissionId`in e)||typeof e.admissionId!=`string`)return;let n=t(e.value);return n===void 0?void 0:{value:n,admissionId:e.admissionId}}};return{get(e){if(Lt(e))return;let t=S(e,r);if(!t)return;let n=getStateSchemaFacts(e);return t.admissionId===n?.admissionId?t.value:void 0},publish(e,t){!E(e)&&vt(e)&&mt(e);let n=getStateSchemaFacts(e);if(!n||!E(e)&&S(e,ie)?.admissionId!==n.admissionId)return;getStateSchemaVersionAdmission(e);let i={value:t,admissionId:n.admissionId};C(e,r,i)}}}const Vr=createStateSchemaAdmission(`state.runtime-schema`,e=>typeof e==`object`&&e&&`startupReady`in e&&typeof e.startupReady==`boolean`?{startupReady:e.startupReady}:void 0,`process`),Hr=/* @__PURE__ */ new WeakMap;function rememberConnectionVersion(e,t){let n=Hr.get(e),install=t=>{t?Hr.set(e,t):Hr.delete(e)};zt(e,{stage:()=>install(t),commit:()=>{},rollback:()=>install(n)})||install(t)}function schemaVersionKey(e){return{name:`state.schema-version:${e}`,read:Br.read}}function getStateSchemaVersionAdmission(e){let t=getStateSchemaFacts(e);if(!t)return;let n=Hr.get(e);if(n?.schema===t)return n.facts;let r=S(e,schemaVersionKey(t.admissionId)),i=r?void 0:S(e,ie);if(!r&&!E(e)&&i?.admissionId!==t.admissionId)return;let a=r??S(e,Br);return a&&(rememberConnectionVersion(e,{schema:t,facts:a}),r||C(e,schemaVersionKey(t.admissionId),a)),a}function rememberStateSchemaVersionAdmission(e,t){let n=getStateSchemaFacts(e);if(!n)return;rememberConnectionVersion(e,{schema:n,facts:t});let r=S(e,ie);(E(e)||r?.admissionId===n.admissionId)&&(C(e,schemaVersionKey(n.admissionId),t),C(e,Br,t))}function publishStateSchemaVersionAdmission(e,t){C(e,Br,t);let n=getStateSchemaFacts(e);n?(rememberConnectionVersion(e,{schema:n,facts:t}),C(e,schemaVersionKey(n.admissionId),t)):rememberConnectionVersion(e)}function adoptPeerPublishedStateSchemaVersion(e,t){return t?.schema_version!==40||b(e)!==40?!1:(publishStateSchemaVersionAdmission(e,{userVersion:40,contentVersion:40}),!0)}function getStateRuntimeSchemaAdmission(e){return Vr.get(e)}function publishStateRuntimeSchemaAdmission(e,t){Vr.publish(e,{startupReady:t})}const Ur=n(Symbol.for(`openclaw.stateIntegrityBindings`),()=>/* @__PURE__ */ new WeakMap),Wr={name:`state.integrity`,lifetime:`process`,read:e=>e===!0||void 0};function hasStateDatabaseIntegrityAdmission(e){return!!(getStateRuntimeSchemaAdmission(e)||S(e,Wr))}function assertStateDatabaseIntegrityOnce(e,t){hasStateDatabaseIntegrityAdmission(e)||(assertSqliteIntegrity(e,t),C(e,Wr,!0))}function invalidate(e){let t=Atomics.load(e,0);for(;t>=0n;){let n=Atomics.compareExchange(e,0,t,t+1n);if(n===t)return;t=n}}function invalidateOpenClawStateRuntimeIntegrity(e){qt(e);let t=Ur.get(e);t&&(invalidate(new BigInt64Array(t.revision)),invalidate(new BigInt64Array(t.lifetimeRevision)))}function bind(e,t){if(Ur.get(e)?.revision===t.revision)return;Ur.get(e)?.release();let n=new BigInt64Array(t.revision),r=re(e,()=>invalidate(n)),release=()=>{r(),i()},i=Ne(e,e=>{e===`replace`&&(invalidate(n),invalidate(new BigInt64Array(t.lifetime.revision))),release()});Ur.set(e,{revision:t.revision,lifetimeRevision:t.lifetime.revision,release})}function assertOpenClawStateRuntimeIntegrity(e,t,n,r,i=`verify`){let a=r&&qn(e);if(!r||!a||!a.key.startsWith(`file:`)||a.key!==r.identity.key||a.birthtime!==r.identity.birthtime){if(i===`require-proof`)throw Error(`Shared-state reader requires current worker integrity proof`);assertStateDatabaseIntegrityOnce(e,t);return}bind(e,r);let o=new BigInt64Array(r.revision),s=new BigInt64Array(r.proof),c=BigInt.asIntN(64,BigInt(n.userVersion>>>0)<<32n|BigInt(n.schemaVersion>>>0)),l=Atomics.load(s,0);if(Atomics.load(o,0)===r.epoch&&l!==-1n){if(l===c&&Atomics.load(o,0)===r.epoch&&hasStateDatabaseIntegrityAdmission(e))return;invalidate(o)}if(i===`require-proof`)throw Error(`Shared-state reader requires current worker integrity proof`);assertStateDatabaseIntegrityOnce(e,t);let publish=()=>{Atomics.load(o,0)===r.epoch&&Atomics.store(s,0,c)};return()=>{e.isTransaction?zt(e,{commit:publish}):publish()}}function retainSqliteDatabaseRemovalExclusion(e,t){if(!ar(e))return;let n=Qe(ft(e)),close=()=>{if(!n.isOpen)return;let e=[];try{n.isTransaction&&n.exec(`ROLLBACK`)}catch(t){e.push(t)}try{n.close()}catch(t){e.push(t)}A(e,`SQLite state removal exclusion cleanup failed.`)};try{t.own(n,`shared-handles`,close),n.exec(`PRAGMA busy_timeout = 0; PRAGMA locking_mode = EXCLUSIVE; BEGIN EXCLUSIVE;`)}catch(e){try{close()}catch(t){throw w([e,t],`SQLite state removal admission and cleanup both failed.`,e)}if(dn(e))throw Error(`Cannot remove OpenClaw state directory while another SQLite connection is active`,{cause:e});let t=pn(e);if(t!==11&&t!==26)throw e;return}process.platform===`win32`&&close()}function createOpenClawStateSnapshotOwnerRegistry(){let e=/* @__PURE__ */ new WeakMap;return{register(t,n){E(t.db)||e.set(t.db,registerLiveSqliteSnapshotOwner({database:t.db,databasePath:t.path,assertCurrent:()=>{if(n()!==t||!t.db.isOpen)throw Error(`OpenClaw state snapshot owner is no longer current`)}}))},release(t){E(t)||(e.get(t)?.(),e.delete(t))}}}const Gr=n(Symbol.for(`openclaw.stateSnapshotOwners`),createOpenClawStateSnapshotOwnerRegistry),W=n($e,()=>({cachedDatabases:/* @__PURE__ */ new Map,retainedDatabaseHandles:/* @__PURE__ */ new Map,idleTimers:/* @__PURE__ */ new WeakMap,idleReferences:/* @__PURE__ */ new WeakMap,unregisterRetainedExitClose:void 0,databaseIdentities:/* @__PURE__ */ new WeakMap,borrowers:/* @__PURE__ */ new WeakMap,databaseLifecycleListeners:/* @__PURE__ */ new Set,terminalOpenLatch:createSqliteTerminalOpenLatch({closeByPath:(e,t)=>ni.closeTerminalFailure(e,t)}),asyncResources:ee()}),()=>closeOpenClawStateDatabaseAsync(),`shared-state`),{cachedDatabases:G,retainedDatabaseHandles:K,idleTimers:Kr,idleReferences:qr,databaseIdentities:Jr,borrowers:q,databaseLifecycleListeners:Yr,terminalOpenLatch:J,asyncResources:Y}=W,{touch:Xr,retain:Zr}=createStateDatabaseIdleRetirement(W,retireOpenClawStateDatabaseHandle),{register:Qr,readHealth:$r,ownRetirement:ei,stop:ti}=createStateDatabaseWalOwner(W,Zr,requireOpenClawStateDatabaseIdentity);function notifyOpenClawStateDatabaseLifecycle(e){let t=e.kind===`open-error`?{...e,identity:e.identity??Y.knownIdentity(e.path)}:e;for(let e of Yr)e(t)}function notifyOpenClawStateDatabaseClosed(e){notifyOpenClawStateDatabaseLifecycle({kind:`closed`,path:e.path,identity:requireOpenClawStateDatabaseIdentity(e)})}function requireOpenClawStateDatabaseIdentity(e){let t=Jr.get(e.db);if(!t)throw Error(`Published shared-state owner has no recorded database identity`);return t}const ni=createStateDatabaseCacheAdmission({cachedDatabases:G,evict:evictCachedOpenClawStateDatabase,invalidate:e=>Y.invalidate(e),notifyTerminalFailure:(e,t)=>notifyOpenClawStateDatabaseLifecycle({kind:`terminal-failure`,path:e,error:t,identity:Y.knownIdentity(e)})});function registerOpenClawStateDatabaseLifecycleListener(e){Yr.add(e);for(let t of G.values())t.db.isOpen&&e({kind:`opened`,database:t,identity:requireOpenClawStateDatabaseIdentity(t)});return()=>Yr.delete(e)}function registerOpenClawStatePathCacheInvalidation(e){return registerOpenClawStateDatabaseLifecycleListener(t=>{if(t.kind!==`opened`)for(let[n,r]of e)r.path===(t.identity?.canonicalPath??t.path)&&e.delete(n)})}function retainStateDatabaseClose(e){K.set(e.db,e),W.unregisterRetainedExitClose??=u(closeOpenClawStateDatabase)}function ownMaintenanceStateDatabaseHandle(e){x()?.own(e.db,`shared-handles`,async()=>{let t=x();t&&ct(e.db,t)&&(G.get(e.path)===e||K.get(e.db)===e)&&(await e.walMaintenance?.stop(),ct(e.db,t)&&(G.get(e.path)===e||K.get(e.db)===e)&&retireOpenClawStateDatabaseHandle(e,!1))})}function closeUnpublishedOpenClawStateDatabaseHandle(e){let t=closeOpenClawStateDatabaseHandle(e);return K.get(e.db)===e&&ownMaintenanceStateDatabaseHandle(e),t}const{retain:ri,borrowForRead:ii,retainForIndependentRead:ai}=createStateDatabaseRetainer(W,{assertOpen(e,t,n){assertOpenClawStateDatabaseOpenAllowed(e,t,n),assertExistingOpenClawStateSchemaCacheAdmission(e,W)},capture:e=>Y.capture(e),retire:retireOpenClawStateDatabaseHandle,retainFailed:retainStateDatabaseClose,ownRetirement:ei,touch:Xr});function closeOpenClawStateDatabaseHandle(e,t){clearTimeout(Kr.get(e.db)),Kr.delete(e.db);try{assertStateDatabaseBorrowersReleased(q.get(e.db),e.path)}catch(n){let r=q.get(e.db);return r&&(r.retiring=!0,r.retirement={ordinary:!0,isCurrent:()=>!0,retire:()=>{A(closeOpenClawStateDatabaseHandle(e,t),`OpenClaw state database cleanup failed for ${e.path}.`),r.cleanupComplete=!0,q.delete(e.db)}}),retainStateDatabaseClose(e),[n]}qr.delete(e.db),Gr.release(e.db);let{errors:n,cleanupPending:r}=Zn(e,t);return e.db.isOpen||r?retainStateDatabaseClose(e):K.delete(e.db),G.get(e.path)?.db===e.db&&G.delete(e.path),K.size===0&&(W.unregisterRetainedExitClose?.(),W.unregisterRetainedExitClose=void 0),n}function evictCachedOpenClawStateDatabase(e){return E(e.db)||invalidateOpenClawStateRuntimeIntegrity(e.db),G.get(e.path)===e&&(Y.invalidate(e.path),G.delete(e.path),notifyOpenClawStateDatabaseClosed(e),closeOpenClawStateDatabaseHandle(e,{checkpointMode:`PASSIVE`}),!0)}function evictOpenClawStateDatabaseAfterCorruption(e,t){return rn(t)&&evictCachedOpenClawStateDatabase(e)}function publishOpenClawStateDatabase(e,t){let{db:n,path:r}=e,{identity:i,admission:a}=Y.publish(r);return Jr.set(n,qn(n)??i),G.set(r,e),Qr(e,i,a,t),Xr(e),Gr.register(e,()=>G.get(r)),ownMaintenanceStateDatabaseHandle(e),notifyOpenClawStateDatabaseLifecycle({kind:`opened`,database:e,identity:i}),E(n)||Se(n,t=>{!n.isTransaction&&rn(t)&&evictCachedOpenClawStateDatabase(e)}),J.clear(r),e}function getCachedOpenClawStateDatabase(e,t){let n=v({path:e}),r=J.get(n);if(r)throw r;let i=readCachedOpenClawStateDatabase(n,t?.readOnly===!0);return i&&Xr(i),i}function readCachedOpenClawStateDatabase(e,t){let n=x();t?n?.assertReadAdmission():n?.assertAdmission(),assertExistingOpenClawStateSchemaCacheAdmission(e,W);let r=G.get(e);if(r&&q.get(r.db)?.retiring)throw Error(`OpenClaw state database native borrower cleanup is pending: ${e}`);return r}function prepareOpenClawStateCachedRead(e){let t=v({path:e});getCachedOpenClawStateDatabase(t,{readOnly:!0});let n=Y.capture(t);return()=>(n.assertCurrent(),readCachedOpenClawStateDatabase(t,!0))}function withCachedOpenClawStateDatabase(e,t,n){let r=getCachedOpenClawStateDatabase(e,t);return r&&ni.read(r,n)}function getOpenClawStateDatabaseIfOpenAtPath(e){let t=getCachedOpenClawStateDatabase(e);return Ke(t?.db.isOpen?t.db:void 0),t?.db.isOpen?t:void 0}function closeStaleCachedOpenClawStateDatabase(e){if(G.get(e.path)!==e)return;Y.invalidate(e.path);let t=closeOpenClawStateDatabaseHandle(e);notifyOpenClawStateDatabaseClosed(e),A(t,`Stale OpenClaw state database cleanup failed for ${e.path}.`)}function recordOpenClawStateDatabaseOpenFailure(e,t){J.record(v({path:e}),t)}function clearOpenClawStateDatabaseOpenFailure(e){let t=v({path:e});J.clear(t),Y.invalidate(t),notifyOpenClawStateDatabaseLifecycle({kind:`failure-cleared`,path:t,identity:Y.knownIdentity(t)})}async function getOpenClawStateDatabaseTerminalFailureAsync(e,t){return e.admission.assertCurrent(),t?.throwIfAborted(),J.get(e.admission.databasePath)}function assertOpenClawStateDatabaseOpenAllowed(e,t,n){let r=v({path:e});t===`cached-read`&&n?n.assertReadAllowed():(t===`cached-read`?kn:$n)(e);let{identity:i}=Y.capture(r),a=J.get(r);if(a)throw a;for(let t of K.values())if(q.get(t.db)?.retiring&&(t.path===r||Jr.get(t.db)?.key===i.key))throw Error(`OpenClaw state database native borrower cleanup is pending: ${e}`)}function recordOpenClawStateDatabaseLifecycleOpenError(e,t){notifyOpenClawStateDatabaseLifecycle({kind:`open-error`,path:v({path:e}),error:t})}function assertOpenClawStateDatabaseFreshOpenAllowedAtPath(e,t,n,r){assertOpenClawStateDatabaseOpenAllowed(e);let i;try{i=readOpenClawDatabaseQuarantineFailure(`state`,e,{env:t,refreshIdentity:r})}catch(e){if(!(e instanceof pt))throw e;n?.(e)}if(i?.cause instanceof pt&&n?.(i.cause),i)throw ni.closeTerminalFailure(e,i),i}function retireOpenClawStateDatabaseHandle(e,t=!0,n){assertStateDatabaseBorrowersReleased(q.get(e.db),e.path);let r=q.get(e.db);try{let r=G.get(e.path)?.db===e.db;t&&Y.invalidate(e.path);let i=closeOpenClawStateDatabaseHandle(e,n);if(r&&t)try{notifyOpenClawStateDatabaseClosed(e)}catch(e){i.push(e)}A(i,`OpenClaw state database cleanup failed for ${e.path}.`)}catch(t){throw r&&retainStateDatabaseClose(e),t}r&&(r.cleanupComplete=!0,q.delete(e.db))}function stateDatabaseHandlesAt(e,t){return[.../* @__PURE__ */ new Set([...K.values(),...G.values()])].filter(n=>e===void 0||n.path===e||t!==void 0&&Jr.get(n.db)?.key===t.key)}function retireOpenClawStateDatabaseHandles(e,t,n){let r=stateDatabaseHandlesAt(e,n),i=[];for(let e of r)try{retireOpenClawStateDatabaseHandle(e,!0,t)}catch(e){i.push(e)}return A(i,`OpenClaw state database cleanup failed.`),r.length>0}function closeOpenClawStateDatabaseByPath(e,t){return retireOpenClawStateDatabaseHandles(v({path:e}),t,Y.identity(e))}function sealOpenClawStateDatabaseByPath(e){let t=v({path:e}),n=Y.identity(e);return!stateDatabaseHandlesAt(t,n).some(e=>q.get(e.db)?.references.size)&&retireOpenClawStateDatabaseHandles(t,void 0,n)}function closeOpenClawStateDatabase(e){retireOpenClawStateDatabaseHandles(void 0,e)}const oi=Y.register;function registerOpenClawStatePathAsyncResource(e,t){return oi({close(n){return!n||n.key===e.identity.key||n.canonicalPath===e.identity.canonicalPath?t():Promise.resolve()}})}const si=Y.capture,ci=Y.integrity;function publishOpenClawStateDatabaseWorkerAdmission(e,t){t&&e.assertCurrent(),Y.publish(e.databasePath,t),e.assertCurrent(),Mt(e.databasePath,e.identity)}function closeOpenClawStateDatabaseByPathAsync(e,t){let n=v({path:e});return Y.close(n,async e=>(await ti(n,e),retireOpenClawStateDatabaseHandles(n,t,e)))}function closeOpenClawStateDatabaseWorkersByPathAsync(e){return Y.close(v({path:e}),()=>!1)}async function closeOpenClawStateDatabaseAsync(e){await Y.close(void 0,async()=>(await ti(),retireOpenClawStateDatabaseHandles(void 0,e)))}async function joinOpenClawStateDatabaseBorrowers(){await Promise.all(stateDatabaseHandlesAt().map(e=>joinStateDatabaseBorrowersReleased(q.get(e.db),e.path)))}async function releaseOpenClawStateDatabaseCustody(){await closeOpenClawStateDatabaseAsync(),Kt()}function isOpenClawStateDatabaseOpen(e){return e===void 0?Array.from(G.values()).some(e=>e.db.isOpen):G.get(v({path:e}))?.db.isOpen===!0}function closeOpenClawStateDatabaseForTest(){closeOpenClawStateDatabase(),J.clearAll()}function assertPublishedOpenClawStateDatabaseLifecycle(){if(r($e)!==W)throw Error(`OpenClaw state database lifecycle is retired; its owners cannot serve the published lifecycle`)}const li={assertOpenClawStateDatabaseFreshOpenAllowedAtPath,assertOpenClawStateDatabaseOpenAllowed,clearOpenClawStateDatabaseOpenFailure,closeOpenClawStateDatabase,closeOpenClawStateDatabaseByPath,sealOpenClawStateDatabaseByPath,closeOpenClawStateDatabaseForTest,closeOpenClawStateDatabaseHandle,closeUnpublishedOpenClawStateDatabaseHandle,closeStaleCachedOpenClawStateDatabase,evictCachedOpenClawStateDatabase,evictOpenClawStateDatabaseAfterCorruption,getCachedOpenClawStateDatabase,peekOpenClawStateDatabaseConnection:e=>G.get(v({path:e}))?.db,withCachedOpenClawStateDatabase,getOpenClawStateDatabaseRecordedFailure:J.peek,getOpenClawStateDatabaseIfOpenAtPath,getKnownOpenClawStateDatabaseIdentity:Y.knownIdentity,isOpenClawStateDatabaseOpen,isOpenClawStateDatabaseSchemaReady:e=>G.get(e.path)===e&&e.db.isOpen,publishOpenClawStateDatabase,recordOpenClawStateDatabaseOpenFailure,recordOpenClawStateDatabaseLifecycleOpenError,async reconcileFailedWorkerAdmission(e){await Y.retireChangedAdmission(e),e.assertCurrent()},touchStateDatabase:Xr};async function prepareOpenClawStateDatabaseRemoval(e,t){let n=v({path:e}),r=x();if(!r?.ownsSchemaMaintenance)throw Error(`State removal requires the installation's maintenance owner`);r.assertAdmission();let i=Y.holdExclusion(n);try{await closeOpenClawStateDatabaseByPathAsync(n),r.assertOwnerCurrent(),retainSqliteDatabaseRemovalExclusion(n,r),r.assertOwnerCurrent()}catch(e){throw i(),e}let a=!0;return{assertCurrent(){if(!a)throw Error(`State removal admission has been released`);t()},release(){a&&(a=!1,i())}}}function createSqliteWalReclamationResult(){return{checkpointCompleted:!1,freePagesBefore:null,remainingFreePages:null,checkpointCalls:0,checkpointIncomplete:0,checkpointMs:0,checkpointMaxMs:0,queryMs:0,vacuumMs:0,vacuumPasses:0,vacuumPagesRequested:0}}const ui=new V;function hasUpdateDoctorMigrationCapture(){return ui.getStore()?.capture!==void 0}function capturedAttribution(){if(hasUpdateDoctorMigrationCapture())throw Error(`Update migration capture is active without its attribution owner.`)}function beginUpdatePostgresMigration(e,t){return capturedAttribution()?.beginPostgres(e,t)}const di={name:`database.engine`};function readEngineAnchor(e,t=`identity`,n=!1){try{return t===`schema`?[e.prepare(`SELECT schema FROM openclaw_engine_anchor LIMIT 1`).get()]:e.prepare(`SELECT store_id, engine, schema FROM openclaw_engine_anchor`).all()}catch(e){if(n||!(e instanceof Error)||e.message!==`no such table: openclaw_engine_anchor`)throw e;return}}function familySetting(e){return`database.families.${e.id===`team_reports`?`team-reports`:e.id}.engine`}function refusePostgresAnchor(e,t){let n=readEngineAnchor(e,`schema`);if(n)throw Error(`This store lives in PostgreSQL schema ${String(n[0]?.schema??`unknown`)}; set ${familySetting(t)} to postgres and configure database.postgres.connection.`)}function openEngineStore(e){let{anchor:t}=e,n=e.schema;er(t);let r=e.input!==void 0&&n.postgres!==void 0,i=S(t,di);if(!r){if(i?.engine===`postgres`)throw Error(`This store lives in PostgreSQL schema ${i.namespace}; set ${familySetting(n)} to postgres and configure database.postgres.connection.`);return!i&&e.inspectSqlite().hasEngineAnchor&&refusePostgresAnchor(t,n),e.prepareAnchor(),Yn.sqlite.schema.bootstrap({...e,input:e.input},t),C(t,di,{engine:`sqlite`}),Yn.sqlite.openConnection({...e,input:e.input})}if(i?.engine===`sqlite`)throw Error(`Existing SQLite ${n.id} data cannot switch engines; stop the Gateway and use openclaw database port for a supported store family before changing ${familySetting(n)}.`);let a=e.input?.readOnly===!0;a||e.prepareAnchor();let readOrCreateAnchor=()=>{let r=e.inspectSqlite();if(r.hasExistingData)throw Error(`Existing SQLite ${n.id} data cannot switch engines; stop the Gateway and use openclaw database port for a supported store family before changing ${familySetting(n)}.`);if(!r.hasEngineAnchor&&(e.existingOnly||a))throw Error(`Missing PostgreSQL anchor; restore the matching PostgreSQL schema and anchor.`);r.hasEngineAnchor||t.exec(`CREATE TABLE IF NOT EXISTS openclaw_engine_anchor (store_id TEXT NOT NULL, engine TEXT NOT NULL CHECK (engine = 'postgres'), schema TEXT NOT NULL)`);let i=readEngineAnchor(t,`identity`,!0)??[];if(i.length>1||r.hasEngineAnchor&&i.length===0)throw Error(`Invalid engine anchor: expected exactly one identity. Restore a matching backup.`);let o=i[0];if(o){if(typeof o.store_id!=`string`||o.engine!==`postgres`||typeof o.schema!=`string`)throw Error(`Invalid PostgreSQL anchor identity. Restore a matching backup.`);return{storeId:o.store_id,namespace:o.schema}}let s=ir(),c=he(e.input.schemaPrefix,n.id,s);return t.prepare(`INSERT INTO openclaw_engine_anchor (store_id, engine, schema) VALUES (?, 'postgres', ?)`).run(s,c),e.onFreshAnchor?.(t),{storeId:s,namespace:c}},o=i?.engine===`postgres`?i:e.existingOnly||a?readOrCreateAnchor():Pn(t,readOrCreateAnchor),s={...e,input:e.input,...o},c=Yn.postgres,l=c.openConnection(s),admit=t=>{_({db:l,namespace:o.namespace,storeId:o.storeId,store:n.id,version:n.version,schema:n,recordSchema:t,preserveSchemaSeal:e.existingVersion,requireSealedSchema:a}),e.admitPostgres?.(l,t)};try{let r=n.search?de(l,n.search,o.namespace,e.existingVersion?1:n.postgresVectorSearchVersion):void 0;if(a)l.runTransaction(()=>admit(!1),void 0,!0);else if(!i||i.engine===`postgres`&&i.version!==n.version){_e(l);let t,r;l.runTransaction(()=>{let i=!l.prepare(`SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname = ?`).get(o.namespace);i&&!e.existingOnly&&(l.exec(`CREATE SCHEMA IF NOT EXISTS "${o.namespace.replaceAll(`"`,`""`)}"`),l.exec(ce));let a;try{a=l.prepare(`SELECT version, store_id FROM openclaw_schema_meta WHERE store = ?`).get(n.id)}catch(e){throw Error(`Missing PostgreSQL metadata; use the matching OpenClaw version or restore the matching PostgreSQL schema and anchor.`,{cause:e})}if(a){if(a.store_id!==o.storeId)throw Error(`PostgreSQL database identity mismatch: expected ${o.storeId}, found ${String(a.store_id)}. Restore the matching anchor and PostgreSQL backup.`);if(a.version!==n.version){if(e.existingVersion){let e=n.postgresMigrations?.find(e=>e.version===Number(a.version)+1)?.fromSchema;if(!e)throw Error(`Missing PostgreSQL source schema for inspection`);n={...n,...e,postgresVectorDecoderVersion:e.postgresVectorDecoderVersion,postgresVectorSearchVersion:e.postgresVectorSearchVersion,postgresTextSearchVersion:e.postgresTextSearchVersion,version:Number(a.version)}}else{r=e.assertMigrationCurrent,r?.(),t=beginUpdatePostgresMigration(l,r),Dt(l),zt(l,{stage:()=>{},rollback:()=>{},commit:()=>Wt(l),invalidate:()=>Wt(l)});let migrate=()=>c.schema.migrate(s,Number(a.version),l);t?t.run(migrate):migrate()}}}else{if(e.existingOnly||!i)throw Error(`Missing PostgreSQL metadata; restore the matching PostgreSQL schema and anchor.`);c.schema.bootstrap(s,l)}admit(!a)},{maintenance:!0,withCommit(e){r?.(),t?.beforeCommit(),e()}},!1),t?.committed()}else admit(!1);(!i||i.engine===`postgres`&&i.version!==n.version)&&C(t,di,{engine:`postgres`,...o,version:n.version}),r?.();for(let e of Object.values(be(l)?.searchExtensions??{}))de(l,e,o.namespace,n.postgresVectorSearchVersion)?.();return l}catch(t){if(e.closeOnFailure)return e.closeOnFailure(l,t);throw l.close(),t}}const fi=/CREATE (?:UNIQUE )?INDEX ("(?:[^"]|"")+") ON ("(?:[^"]|"")+") (?:'(?:[^']|'')*'|"(?:[^"]|"")*"|[^;'"])*;/g,pi=/'(?:[^']|'')*'|"(?:[^"]|"")*"|\) (ASC|DESC)(?=,|\))/g;function withLegacyPostgresIndexOrdering(e,t=`sqlite`,n=e){let r=/* @__PURE__ */ new Map;if(t===`schema-nullability`)for(let[,e,t]of n.matchAll(/CREATE TABLE ("(?:[^"]|"")+") \(\n([\s\S]*?)\n\);/g))r.set(e,new Set([...t.matchAll(/^ {2}("(?:[^"]|"")+") (?:text|bigint|bytea|double precision)([^\n]*)/gm)].filter(e=>!/\bNOT NULL\b/.test(e[2].replace(`GENERATED BY DEFAULT AS IDENTITY`,``).split(/\bDEFAULT\b/)[0])).map(([,e])=>e)));return e.replace(fi,(e,n,i)=>t===`schema-nullability`?e.replace(/'(?:[^']|'')*'|"(?:[^"]|"")*"|\(("(?:[^"]|"")+")\) (ASC|DESC)(?=,|\))/g,(e,t,n)=>t&&r.get(i)?.has(t)?`${e} NULLS ${n===`DESC`?`LAST`:`FIRST`}`:e):e.replace(pi,(e,t)=>t?`${e} NULLS ${t===`DESC`?`LAST`:`FIRST`}`:e))}function postgresIndexOrderingMigration(e,t=`sqlite`){let n=withLegacyPostgresIndexOrdering(e,t),r=new Map([...n.matchAll(fi)].map(([e,t])=>[t,e]));return[...e.matchAll(fi)].filter(([e,t])=>r.get(t)!==e).map(([e,t,n])=>`DO $index_order$
BEGIN
IF to_regclass('${n.replaceAll(`'`,`''`)}') IS NOT NULL THEN
DROP INDEX ${t};
${e}
END IF;
END $index_order$;`).join(`
`)}[`github_publication_requests`,`github_personal_publication_requests`,`github_repository_publication_requests`].map(e=>`${e}.draft`);function withLegacyPublicationDraft(e){return e.replace(/(CREATE TABLE(?: IF NOT EXISTS)? "?github_(?:personal_|repository_)?publication_requests"? \([\s\S]*?)\n {2}(?:"draft" bigint|draft INTEGER),/gu,`$1`)}const mi=[`local_workspace_tree_packs`,`local_workspace_source_path_sets`],hi=[`tree_root_digest`,`source_paths_digest`,`canonical_fingerprints`,`projection_fingerprints`];[...mi],hi.map(e=>`local_workspace_projections.${e}`);function withLegacyLocalWorkspaceCas(e){return e.replace(/\n {2}(?:tree_root_digest|source_paths_digest|canonical_fingerprints|projection_fingerprints) BLOB,/gu,``).replace(/\n {2}"(?:tree_root_digest|source_paths_digest|canonical_fingerprints|projection_fingerprints)" bytea,/gu,``).replace(/CREATE TABLE(?: IF NOT EXISTS)? "?local_workspace_(?:tree_packs|source_path_sets)"? \([\s\S]*?\n\)(?: STRICT(?:, WITHOUT ROWID)?)?;\n?/gu,``)}function withLegacyLocalWorkspaceManifests(e){return withLegacyLocalWorkspaceCas(e).replace(/\n {2}(?:checkpoint_json TEXT|"checkpoint_json" text COLLATE "C"),/gu,``).replace(/^ {2}CHECK \([^\n]*baseline_json[^\n]*baseline_ref[^\n]*\),$/gmu,e=>e.includes(`"`)?` CHECK ((("baseline_json" IS NULL) = ("baseline_ref" IS NULL))),`:` CHECK ((baseline_json IS NULL) = (baseline_ref IS NULL)),`).replace(/CREATE TABLE(?: IF NOT EXISTS)? "?local_workspace_manifest_nodes"? \([\s\S]*?\n\)(?: STRICT)?;\n?/gu,``).replace(/ALTER TABLE "local_workspace_manifest_nodes" ADD FOREIGN KEY[^;]*;\n?/gu,``)}const gi=[[`workspace_setup_state`,`bootstrap_deferred`,`INTEGER`,!0],[`agent_deletion_journal`,`phase`,`TEXT`,!0],[`agent_database_leases`,`provenance`,`TEXT`,!0],[`user_profile_identities`,`canonical_login`,`TEXT`],[`user_profile_identities`,`authorization_id`,`TEXT`],[`user_profile_identities`,`authorization_basis_json`,`TEXT`],[`user_profile_identities`,`verified_email_json`,`TEXT`,!0],[`template_installs`,`bootstrap_content_digest`,`TEXT`],[`template_installs`,`bootstrap_source_path`,`TEXT`],[`worker_environments`,`desktop_json`,`TEXT`],[`worker_environments`,`bootstrap_install_kind`,`TEXT`],[`worker_environments`,`preparation_purpose`,`TEXT`],[`template_package_refs`,`extension_adapter_identity`,`TEXT`],[`template_package_refs`,`extension_detected_format`,`TEXT`],[`template_package_refs`,`extension_format`,`TEXT`],[`template_package_refs`,`extension_id`,`TEXT`],[`template_package_refs`,`extension_mapped_json`,`TEXT`],[`template_package_refs`,`extension_unavailable_json`,`TEXT`],[`worker_environments`,`shared_host`,`INTEGER`],[`worker_environments`,`node_setup_id`,`TEXT`],[`worker_environments`,`node_device_id`,`TEXT`],[`worker_session_placements`,`terminal_reason`,`TEXT`],[`worker_session_placements`,`terminal_at_ms`,`INTEGER`],[`worker_workspace_pending_results`,`repository_workspace_id`,`TEXT`,!0],[`worker_session_placement_moves`,`abandon_source`,`INTEGER`,!0],[`worker_session_placement_moves`,`target_machine_class`,`TEXT`,!0],[`worker_session_placement_moves`,`target_os`,`TEXT`,!0],[`worktrees`,`run_end_cleanup_json`,`TEXT`],[`worktrees`,`gc_protection_json`,`TEXT`],[`device_bootstrap_tokens`,`setup_id`,`TEXT`,!0],[`session_groups`,`cwd`,`TEXT`,!0],[`session_groups`,`worktree`,`INTEGER`,!0],[`secret_store_entries`,`allowed_hosts`,`TEXT`],[`web_push_subscriptions`,`device_id`,`TEXT`,!0],[`web_push_subscriptions`,`user_profile_id`,`TEXT`,!0],[`web_push_subscriptions`,`preferences_json`,`TEXT`,!0],[`task_runs`,`execution_owner_host`,`TEXT`,!0],[`task_runs`,`execution_owner_pid`,`INTEGER`,!0],[`task_runs`,`execution_owner_start_identity`,`INTEGER`,!0],[`session_watch_cursors`,`watcher_store_path`,`TEXT`,!0],[`subagent_runs`,`requester_store_path`,`TEXT`,!0],[`subagent_runs`,`controller_store_path`,`TEXT`,!0],[`cron_jobs`,`grant_definition_revision`,`TEXT`],[`cron_jobs`,`grant_definition_generation`,`INTEGER`],[`cron_jobs`,`grant_definition_updated_at`,`INTEGER`]];function lazyColumnDefinitions(e){return gi.filter(t=>e===void 0||!!t[3]===e).map(([e,t,n])=>({columnName:t,dataType:n,tableName:e}))}const _i=lazyColumnDefinitions(),vi=lazyColumnDefinitions(!1),yi=lazyColumnDefinitions(!0),bi={packageUpdatedAt:[[`template_package_refs`,`updated_at_ms INTEGER NOT NULL DEFAULT 0`]],packageIntegrity:[[`template_package_refs`,`package_integrity TEXT NOT NULL DEFAULT 'sha256:0000000000000000000000000000000000000000000000000000000000000000'`]],diagnosticSequence:[[`diagnostic_events`,`sequence INTEGER NOT NULL DEFAULT 0`]],cronRunLogs:[[`worktrees`,`provisioned_paths_json TEXT`],[`apns_registrations`,`relay_origin TEXT`],[`device_pairing_pending`,`refreshed_at_ms INTEGER`],[`device_pairing_pending`,`browser_origin TEXT`],[`device_pairing_paired`,`approved_via TEXT`],[`device_pairing_paired`,`browser_origin TEXT`],[`device_pairing_paired`,`operator_label TEXT`],[`device_pairing_paired`,`node_surface_json TEXT`],[`device_pairing_paired`,`pending_node_surface_json TEXT`],[`cron_run_logs`,`status TEXT`],[`cron_run_logs`,`error TEXT`],[`cron_run_logs`,`summary TEXT`],[`cron_run_logs`,`diagnostics_summary TEXT`],[`cron_run_logs`,`delivery_status TEXT`],[`cron_run_logs`,`delivery_error TEXT`],[`cron_run_logs`,`delivered INTEGER`],[`cron_run_logs`,`session_id TEXT`],[`cron_run_logs`,`session_key TEXT`],[`cron_run_logs`,`run_id TEXT`],[`cron_run_logs`,`run_at_ms INTEGER`],[`cron_run_logs`,`duration_ms INTEGER`],[`cron_run_logs`,`next_run_at_ms INTEGER`],[`cron_run_logs`,`model TEXT`],[`cron_run_logs`,`provider TEXT`],[`cron_run_logs`,`total_tokens INTEGER`],[`cron_run_logs`,`entry_json TEXT NOT NULL DEFAULT '{}'`],[`cron_run_logs`,`created_at INTEGER NOT NULL DEFAULT 0`]],acpReplay:[[`acp_replay_events`,`estimated_bytes INTEGER NOT NULL DEFAULT 0`],[`acp_replay_sessions`,`estimated_bytes INTEGER NOT NULL DEFAULT 0`]],cronJobs:[[`cron_jobs`,`description TEXT`],[`cron_jobs`,`declaration_key TEXT`],[`cron_jobs`,`owner_agent_id TEXT`],[`cron_jobs`,`name TEXT NOT NULL DEFAULT ''`],[`cron_jobs`,`enabled INTEGER NOT NULL DEFAULT 1`],[`cron_jobs`,`agent_id TEXT`],[`cron_jobs`,`payload_kind TEXT NOT NULL DEFAULT 'message'`],[`cron_jobs`,`state_json TEXT NOT NULL DEFAULT '{}'`],[`cron_jobs`,`runtime_updated_at_ms INTEGER`],[`cron_jobs`,`schedule_identity TEXT`],[`cron_jobs`,`sort_order INTEGER NOT NULL DEFAULT 0`]],deliveryQueue:[[`sandbox_registry_entries`,`session_key TEXT`],[`sandbox_registry_entries`,`backend_id TEXT`],[`sandbox_registry_entries`,`runtime_label TEXT`],[`sandbox_registry_entries`,`image TEXT`],[`sandbox_registry_entries`,`created_at_ms INTEGER`],[`sandbox_registry_entries`,`last_used_at_ms INTEGER`],[`sandbox_registry_entries`,`config_label_kind TEXT`],[`sandbox_registry_entries`,`config_hash TEXT`],[`sandbox_registry_entries`,`cdp_port INTEGER`],[`sandbox_registry_entries`,`no_vnc_port INTEGER`],[`delivery_queue_entries`,`entry_kind TEXT`],[`delivery_queue_entries`,`session_key TEXT`],[`delivery_queue_entries`,`channel TEXT`],[`delivery_queue_entries`,`target TEXT`],[`delivery_queue_entries`,`account_id TEXT`],[`delivery_queue_entries`,`retry_count INTEGER NOT NULL DEFAULT 0`],[`delivery_queue_entries`,`last_attempt_at INTEGER`],[`delivery_queue_entries`,`last_error TEXT`],[`delivery_queue_entries`,`recovery_state TEXT`],[`delivery_queue_entries`,`platform_send_started_at INTEGER`]],originalMediaRoot:[[`managed_outgoing_image_records`,`original_media_root TEXT NOT NULL DEFAULT ''`]],beforeTaskAttribution:[[`managed_outgoing_image_records`,`agent_id TEXT`],[`managed_outgoing_image_records`,`cleanup_pending INTEGER NOT NULL DEFAULT 0 CHECK (cleanup_pending IN (0, 1))`],[`current_conversation_bindings`,`conversation_kind TEXT NOT NULL DEFAULT 'channel'`],[`device_bootstrap_tokens`,`pending_profile_json TEXT`],[`gateway_restart_handoff`,`restart_trace_started_at INTEGER`],[`gateway_restart_handoff`,`restart_trace_last_at INTEGER`],[`gateway_restart_intent`,`reason TEXT`],[`gateway_restart_sentinel`,`delivery_channel TEXT`],[`gateway_restart_sentinel`,`delivery_to TEXT`],[`gateway_restart_sentinel`,`delivery_account_id TEXT`],[`gateway_restart_sentinel`,`message TEXT`],[`gateway_restart_sentinel`,`continuation_json TEXT`],[`gateway_restart_sentinel`,`doctor_hint TEXT`],[`gateway_restart_sentinel`,`stats_json TEXT`],[`gateway_boot_lifecycle`,`startup_reason TEXT`],[`official_external_plugin_catalog_snapshots`,`trust_mode TEXT`],[`official_external_plugin_catalog_snapshots`,`trust_key_id TEXT`],[`official_external_plugin_catalog_snapshots`,`trust_signature_count INTEGER`],[`official_external_plugin_catalog_snapshots`,`trust_threshold INTEGER`],[`official_external_plugin_catalog_snapshots`,`trust_verified_at TEXT`]],taskRequester:[[`task_runs`,`requester_agent_id TEXT`]],taskRunDetails:[[`task_runs`,`tool_use_count INTEGER`],[`task_runs`,`last_tool_name TEXT`],[`task_runs`,`detail_json TEXT`]],workerEnvironments:[[`worker_environments`,`bootstrap_bundle_hash TEXT`],[`worker_environments`,`bootstrap_openclaw_version TEXT`],[`worker_environments`,`bootstrap_protocol_features_json TEXT`],[`worker_environments`,`bootstrap_install_kind TEXT`],[`worker_environments`,`owner_epoch INTEGER NOT NULL DEFAULT 0 CHECK (owner_epoch >= 0)`],[`worker_environments`,`ssh_host_key TEXT`],[`worker_workspace_pending_results`,`staged_result_ref TEXT`],[`worker_environments`,`teardown_terminal_state TEXT CHECK (teardown_terminal_state IN ('destroyed', 'failed'))`]]},xi=[[`claw_installs`,`template_installs`],[`claw_workspace_files`,`template_workspace_files`],[`claw_package_refs`,`template_package_refs`],[`claw_cron_refs`,`template_cron_refs`],[`claw_mcp_server_refs`,`template_mcp_server_refs`]],Si=[[`template_installs`,`claw_name`,`template_name`],[`template_installs`,`claw_version`,`template_version`],[`template_package_refs`,`claw_name`,`template_name`]],Ci=new Set(xi.map(([,e])=>e)),wi=vi.filter(({tableName:e})=>Ci.has(e)),Ti=[...bi.packageUpdatedAt,...bi.packageIntegrity],Ei=[[`template_installs`,[1,2,3].map(e=>[`openclaw.clawInstallRecord.v${e}`,`openclaw.templateInstallRecord.v${e}`])],[`template_workspace_files`,[[`openclaw.clawWorkspaceFileRecord.v1`,`openclaw.templateWorkspaceFileRecord.v1`]]],[`template_package_refs`,[[`openclaw.clawPackageRef.v1`,`openclaw.templatePackageRef.v1`]]],[`template_cron_refs`,[[`openclaw.clawCronRef.v1`,`openclaw.templateCronRef.v1`]]],[`template_mcp_server_refs`,[[`openclaw.clawMcpServerRef.v1`,`openclaw.templateMcpServerRef.v1`]]]],literal=e=>`'${e.replaceAll(`'`,`''`)}'`;function legacyTemplateStateIdentifier(e){for(let[t,n]of[...xi,...Si.map(([,e,t])=>[e,t])])if(e===n)return t;return e}function withLegacyTemplateStateSchema(e){return e.replace(/\btemplate_(?:installs|workspace_files|package_refs|cron_refs|mcp_server_refs|name|version)\b/gu,legacyTemplateStateIdentifier).replaceAll(`'template-introduced'`,`'claw-introduced'`).replaceAll(`'template'`,`'claw'`)}function versionUpdates(e,t){return`UPDATE ${O(e)} SET schema_version = CASE schema_version
${t.map(([e,t])=>`WHEN ${literal(e)} THEN ${literal(t)}`).join(`
`)}
ELSE schema_version END WHERE schema_version IN (${t.map(([e])=>literal(e)).join(`, `)});`}[...xi.flat()],[...wi.map(({tableName:e,columnName:t})=>`${e}.${t}`),...Ti.map(([e,t])=>`${e}.${t.split(` `,1)[0]}`)];const Di=`DO $template_names_v36$
DECLARE item record; column_item record; constraint_name text; next_constraint_name text;
BEGIN
FOR item IN SELECT * FROM (VALUES
${xi.map(([e,t])=>`(${literal(e)}, ${literal(t)})`).join(`,
`)}
) AS names(old_name, new_name) LOOP
EXECUTE format('ALTER TABLE %I RENAME TO %I', item.old_name, item.new_name);
FOR column_item IN SELECT * FROM (VALUES
${Si.map(([e,t,n])=>`(${literal(e)}, ${literal(t)}, ${literal(n)})`).join(`,
`)}
) AS columns(table_name, old_name, new_name) WHERE table_name = item.new_name LOOP
EXECUTE format('ALTER TABLE %I RENAME COLUMN %I TO %I', item.new_name, column_item.old_name, column_item.new_name);
END LOOP;
FOR constraint_name IN SELECT conname FROM pg_constraint
WHERE conrelid = to_regclass(item.new_name) LOOP
next_constraint_name := constraint_name;
IF left(constraint_name, length(item.old_name) + 1) = item.old_name || '_' THEN
next_constraint_name := item.new_name || substr(constraint_name, length(item.old_name) + 1);
END IF;
next_constraint_name := replace(replace(next_constraint_name, '_claw_name_', '_template_name_'), '_claw_version_', '_template_version_');
IF next_constraint_name <> constraint_name THEN
EXECUTE format('ALTER TABLE %I RENAME CONSTRAINT %I TO %I', item.new_name, constraint_name, next_constraint_name);
END IF;
END LOOP;
END LOOP;
${[`template_package_refs`,`template_mcp_server_refs`].map(e=>`
ALTER TABLE ${O(e)} DROP CONSTRAINT ${O(`${e}_origin_check`)};
UPDATE ${O(e)} SET origin = 'template-introduced' WHERE origin = 'claw-introduced';
ALTER TABLE ${O(e)} ADD CONSTRAINT ${O(`${e}_origin_check`)}
CHECK (origin IN ('template-introduced', 'pre-existing'));`).join(`
`)}
IF to_regclass('agent_provenance') IS NOT NULL THEN
ALTER TABLE agent_provenance DROP CONSTRAINT agent_provenance_created_via_check;
UPDATE agent_provenance SET created_via = 'template' WHERE created_via = 'claw';
ALTER TABLE agent_provenance ADD CONSTRAINT agent_provenance_created_via_check
CHECK (created_via IN ('operator', 'agent', 'template'));
END IF;
${Ei.map(([e,t])=>versionUpdates(e,t)).join(`
`)}
END $template_names_v36$;`,Oi={version:37,tables:[`worker_environments`],columns:[`worker_environments.resource_receipt_json`],migrate(e,t){return t>=37?!1:M(e,`worker_environments`,`resource_receipt_json TEXT`)},applied:`Retained immutable worker provider resource receipts (v37)`};function withLegacyWorkerResourceReceipts(e){return e.replace(/,\n {2}resource_receipt_json TEXT(?=\n\))|\n {2}"resource_receipt_json" text COLLATE "C",/gu,``)}const ki=[Oi,{version:38,tables:[`session_repository_workspaces`,`worker_workspace_pending_results`],columns:[`session_repository_workspaces.disk_authority_json`,`worker_workspace_pending_results.repository_disk_authority_json`],migrate(e,t){if(t>=38)return!1;let n=M(e,`session_repository_workspaces`,`disk_authority_json TEXT`),r=M(e,`worker_workspace_pending_results`,`repository_disk_authority_json TEXT`);return n||r},applied:`Retained repository disk authority and original pending-result authority (v38)`}];function withLegacyRepositoryDiskAuthority(e){return e.replace(/\n {2}(?:(?:disk_authority_json|repository_disk_authority_json) TEXT|"(?:disk_authority_json|repository_disk_authority_json)" text COLLATE "C"),/gu,``)}function withLegacyWorkerRetention(e){return e.replace(/,\n {2}retention_json TEXT(?=\n\))|\n {2}"retention_json" text COLLATE "C",/gu,``)}function withLegacyWorkspaceBootstrapDeferred(e){return e.replace(` bootstrap_deferred INTEGER,
`,``).replace(` "bootstrap_deferred" bigint,
`,``)}function withLegacyStateV40Additions(e){return withLegacyWorkspaceBootstrapDeferred(e).replace(/CREATE TABLE IF NOT EXISTS device_pairing_browser_requests \([\s\S]*?\) STRICT;\n\n/u,``)}function withLegacyWorkerProvisionSource(e){return e.replace(/,\n {2}provision_source_json TEXT(?=\n\))|\n {2}"provision_source_json" text COLLATE "C",/gu,``)}const Ai=`state.schema.contentVersion`;var PostgresSchemaAdmissionUnavailableError=class extends Error{};function requireStatePostgresPhysicalFacts(e){let t=Je(e);if(!t)throw new PostgresSchemaAdmissionUnavailableError(`Missing PostgreSQL physical schema admission`);return t}const ji=jn(e=>Mn(e,()=>Jn(e).selectFrom(`config_machine_state`).select(`value_json`).where(`state_key`,`=`,Ai)));function readStateSchemaContentVersion(e,t,n=readStateSchemaContentVersionRow,r){if(E(e)){let n=getStateSchemaVersionAdmission(e);if(!n)throw new PostgresSchemaAdmissionUnavailableError(`Missing PostgreSQL state schema admission; use the matching OpenClaw version or restore the matching PostgreSQL schema and anchor.`);return Math.max(t??n.userVersion,n.contentVersion)}let i=getStateSchemaVersionAdmission(e);if(i)return Math.max(t??i.userVersion,i.contentVersion);let a=r??y(e)?.userVersion??b(e),o=parseStateSchemaContentVersion(N(e,`config_machine_state`)?n(e)?.value_json:void 0);return rememberStateSchemaVersionAdmission(e,{userVersion:a,contentVersion:o}),Math.max(t??a,o)}function readStateSchemaContentVersionRow(e){return ji(e)().rows[0]}function parseStateSchemaContentVersion(e){if(e===void 0)return 0;let t;try{t=e===null?null:JSON.parse(e)}catch(e){throw new j(`Invalid shared state schema content version in ${Ai}.`,{cause:e})}if(typeof t!=`number`||!Number.isSafeInteger(t)||t<0)throw new j(`Invalid shared state schema content version in ${Ai}.`);return t}function admitStateSchemaFacts(e,t,n=`runtime`){if(E(e))requireStatePostgresPhysicalFacts(e);else try{mt(e,r=>assertSupportedStateSchemaVersion(e,t,{userVersion:r,contentVersion:r},void 0,n))}catch(r){let i;try{i=b(e)}catch{throw Fe(r,t)}throw i>40?nt(`OpenClaw state database`,t,i,40,Re(e),n):Fe(r,t)}}function assertSupportedStateSchemaVersion(e,t,n,r,i=`runtime`){if(E(e))return readStateSchemaContentVersion(e);try{let a=n?.userVersion??getStateSchemaVersionAdmission(e)?.userVersion??y(e)?.userVersion??b(e),o=n?.contentVersion??(a>40?a:readStateSchemaContentVersion(e,a,r,a));if(o>40)throw nt(`OpenClaw state database`,t,o,40,Re(e),i);return a}catch(e){throw Fe(e,t)}}function withPostgresSchemaAdmissionRetry(e,t,n){try{return t()}catch(r){if(!(r instanceof PostgresSchemaAdmissionUnavailableError)||!E(e)||n?.()===!1||!e.isOpen||e.isTransaction)throw r;let i=Math.min(Date.now()+1e3,hn()??1/0),a=performance.now()+Math.max(0,i-Date.now()),o=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));return Tt({deadlineAtMs:i},()=>{for(let s=10;;s=Math.min(s*2,100)){Jt();let c=Math.min(a-performance.now(),i-Date.now());if(c<=0||(Atomics.wait(o,0,0,Math.min(s,c)),Jt(),performance.now()>=a||Date.now()>=i)||n?.()===!1||!e.isOpen||e.isTransaction)throw r;try{if(!Je(e,{refresh:!0}))continue;return t()}catch(t){if(t instanceof tn&&(performance.now()>=a||Date.now()>=i))throw r;if(!(t instanceof PostgresSchemaAdmissionUnavailableError)||n?.()===!1||!e.isOpen||e.isTransaction)throw t}}})}}function writeStateSchemaContentVersion(e){Sn(e,Jn(e).insertInto(`config_machine_state`).values({state_key:Ai,value_json:`40`,updated_at_ms:Date.now()}).onConflict(e=>e.column(`state_key`).doUpdateSet({value_json:`40`,updated_at_ms:Date.now()}).where(`config_machine_state.value_json`,`!=`,`40`)))}const X={get eagerSql(){let e=`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "acp_replay_events" (
"session_id" text COLLATE "C" NOT NULL,
"seq" bigint NOT NULL,
"at" bigint NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"run_id" text COLLATE "C",
"update_json" text COLLATE "C" NOT NULL,
"estimated_bytes" bigint NOT NULL DEFAULT 0,
PRIMARY KEY ("session_id", "seq")
);
CREATE TABLE "acp_replay_sessions" (
"session_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"cwd" text COLLATE "C" NOT NULL,
"complete" bigint NOT NULL,
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
"next_seq" bigint NOT NULL,
"estimated_bytes" bigint NOT NULL DEFAULT 0,
PRIMARY KEY ("session_id")
);
CREATE TABLE "acp_sessions" (
"session_key" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C",
"backend" text COLLATE "C" NOT NULL,
"agent" text COLLATE "C" NOT NULL,
"runtime_session_name" text COLLATE "C" NOT NULL,
"identity_json" text COLLATE "C",
"resume_agent_session_id" text COLLATE "C",
"resume_acpx_session_id" text COLLATE "C",
"mode" text COLLATE "C" NOT NULL,
"runtime_options_json" text COLLATE "C",
"cwd" text COLLATE "C",
"state" text COLLATE "C" NOT NULL,
"last_activity_at" bigint NOT NULL,
"last_error" text COLLATE "C",
"updated_at" bigint NOT NULL,
PRIMARY KEY ("session_key")
);
CREATE TABLE "agent_database_leases" (
"lease_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"path" text COLLATE "C" NOT NULL,
"owner_pid" bigint NOT NULL,
"owner_start_time" bigint,
"opened_at" bigint NOT NULL,
"provenance" text COLLATE "C",
PRIMARY KEY ("lease_id")
);
CREATE TABLE "agent_databases" (
"agent_id" text COLLATE "C" NOT NULL,
"path" text COLLATE "C" NOT NULL,
"schema_version" bigint NOT NULL,
"last_seen_at" bigint NOT NULL,
"size_bytes" bigint,
PRIMARY KEY ("agent_id", "path")
);
CREATE TABLE "apns_registration_tombstones" (
"node_id" text COLLATE "C" NOT NULL,
"deleted_at_ms" bigint NOT NULL,
PRIMARY KEY ("node_id")
);
CREATE TABLE "apns_registrations" (
"node_id" text COLLATE "C" NOT NULL,
"transport" text COLLATE "C" NOT NULL,
"token" text COLLATE "C",
"relay_handle" text COLLATE "C",
"send_grant" text COLLATE "C",
"installation_id" text COLLATE "C",
"relay_origin" text COLLATE "C",
"topic" text COLLATE "C" NOT NULL,
"environment" text COLLATE "C" NOT NULL,
"distribution" text COLLATE "C",
"token_debug_suffix" text COLLATE "C",
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("node_id")
);
CREATE TABLE "audit_events" (
"sequence" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"event_id" text COLLATE "C" NOT NULL,
"source_id" text COLLATE "C" NOT NULL,
"schema_version" bigint NOT NULL DEFAULT 1,
"source_sequence" bigint NOT NULL,
"occurred_at" bigint NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"action" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"error_code" text COLLATE "C",
"actor_type" text COLLATE "C" NOT NULL,
"actor_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C",
"session_key" text COLLATE "C",
"session_id" text COLLATE "C",
"run_id" text COLLATE "C",
"tool_call_id" text COLLATE "C",
"tool_name" text COLLATE "C",
"direction" text COLLATE "C",
"channel" text COLLATE "C",
"conversation_kind" text COLLATE "C",
"message_outcome" text COLLATE "C",
"reason_code" text COLLATE "C",
"delivery_kind" text COLLATE "C",
"failure_stage" text COLLATE "C",
"duration_ms" bigint,
"result_count" bigint,
"account_ref" text COLLATE "C",
"conversation_ref" text COLLATE "C",
"message_ref" text COLLATE "C",
"target_ref" text COLLATE "C",
PRIMARY KEY ("sequence"),
UNIQUE ("event_id"),
UNIQUE ("source_id")
);
CREATE TABLE "audit_identity_keys" (
"id" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"key_id" text COLLATE "C" NOT NULL,
"key" bytea NOT NULL,
"created_at" bigint NOT NULL,
PRIMARY KEY ("id"),
CHECK (("id" = 1))
);
CREATE TABLE "backup_runs" (
"id" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
"archive_path" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"manifest_json" text COLLATE "C" NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "capture_blobs" (
"blob_id" text COLLATE "C" NOT NULL,
"content_type" text COLLATE "C",
"encoding" text COLLATE "C" NOT NULL,
"size_bytes" bigint NOT NULL,
"sha256" text COLLATE "C" NOT NULL,
"data" bytea NOT NULL,
"created_at" bigint NOT NULL,
PRIMARY KEY ("blob_id")
);
CREATE TABLE "capture_events" (
"id" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"session_id" text COLLATE "C" NOT NULL,
"ts" bigint NOT NULL,
"source_scope" text COLLATE "C" NOT NULL,
"source_process" text COLLATE "C" NOT NULL,
"protocol" text COLLATE "C" NOT NULL,
"direction" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"flow_id" text COLLATE "C" NOT NULL,
"method" text COLLATE "C",
"host" text COLLATE "C",
"path" text COLLATE "C",
"status" bigint,
"close_code" bigint,
"content_type" text COLLATE "C",
"headers_json" text COLLATE "C",
"data_text" text COLLATE "C",
"data_blob_id" text COLLATE "C",
"data_sha256" text COLLATE "C",
"error_text" text COLLATE "C",
"meta_json" text COLLATE "C",
PRIMARY KEY ("id")
);
CREATE TABLE "capture_sessions" (
"id" text COLLATE "C" NOT NULL,
"started_at" bigint NOT NULL,
"ended_at" bigint,
"mode" text COLLATE "C" NOT NULL,
"source_scope" text COLLATE "C" NOT NULL,
"source_process" text COLLATE "C" NOT NULL,
"proxy_url" text COLLATE "C",
PRIMARY KEY ("id")
);
CREATE TABLE "channel_ingress_events" (
"queue_name" text COLLATE "C" NOT NULL,
"event_id" text COLLATE "C" NOT NULL,
"channel_id" text COLLATE "C" NOT NULL,
"account_id" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"lane_key" text COLLATE "C",
"payload_json" text COLLATE "C" NOT NULL,
"metadata_json" text COLLATE "C",
"received_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
"claim_token" text COLLATE "C",
"claim_owner" text COLLATE "C",
"claimed_at" bigint,
"attempts" bigint NOT NULL DEFAULT 0,
"last_attempt_at" bigint,
"last_error" text COLLATE "C",
"failed_reason" text COLLATE "C",
"failed_at" bigint,
"completed_at" bigint,
"completed_metadata_json" text COLLATE "C",
PRIMARY KEY ("queue_name", "event_id")
);
CREATE TABLE "channel_pairing_allow_entries" (
"channel_key" text COLLATE "C" NOT NULL,
"account_id" text COLLATE "C" NOT NULL,
"entry" text COLLATE "C" NOT NULL,
"sort_order" bigint NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("channel_key", "account_id", "entry")
);
CREATE TABLE "channel_pairing_requests" (
"channel_key" text COLLATE "C" NOT NULL,
"account_id" text COLLATE "C" NOT NULL,
"request_id" text COLLATE "C" NOT NULL,
"code" text COLLATE "C" NOT NULL,
"created_at" text COLLATE "C" NOT NULL,
"last_seen_at" text COLLATE "C" NOT NULL,
"meta_json" text COLLATE "C",
PRIMARY KEY ("channel_key", "account_id", "request_id")
);
CREATE TABLE "clawhub_promotion_claims" (
"slug" text COLLATE "C" NOT NULL,
"provider" text COLLATE "C",
"model_keys_json" text COLLATE "C" NOT NULL,
"ends_at_ms" bigint NOT NULL,
"claimed_at_ms" bigint NOT NULL,
PRIMARY KEY ("slug")
);
CREATE TABLE "config_health_entries" (
"config_path" text COLLATE "C" NOT NULL,
"last_known_good_json" text COLLATE "C",
"last_promoted_good_json" text COLLATE "C",
"last_observed_suspicious_signature" text COLLATE "C",
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("config_path")
);
CREATE TABLE "config_machine_state" (
"state_key" text COLLATE "C" NOT NULL,
"value_json" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("state_key")
);
CREATE TABLE "cron_job_scratch" (
"store_key" text COLLATE "C" NOT NULL,
"job_id" text COLLATE "C" NOT NULL,
"content" text COLLATE "C",
"revision" bigint NOT NULL,
"source_sha256" text COLLATE "C",
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("store_key", "job_id"),
CHECK (("revision" >= 1)),
CHECK ("content" IS NULL OR (octet_length(convert_to("content", 'UTF8')) <= 262144))
);
CREATE TABLE "cron_jobs" (
"store_key" text COLLATE "C" NOT NULL,
"job_id" text COLLATE "C" NOT NULL,
"declaration_key" text COLLATE "C",
"owner_agent_id" text COLLATE "C",
"name" text COLLATE "C" NOT NULL,
"description" text COLLATE "C",
"enabled" bigint NOT NULL,
"agent_id" text COLLATE "C",
"payload_kind" text COLLATE "C" NOT NULL,
"job_json" text COLLATE "C" NOT NULL,
"grant_definition_revision" text COLLATE "C",
"grant_definition_generation" bigint,
"grant_definition_updated_at" bigint,
"state_json" text COLLATE "C" NOT NULL DEFAULT '{}',
"runtime_updated_at_ms" bigint,
"schedule_identity" text COLLATE "C",
"sort_order" bigint NOT NULL DEFAULT 0,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("store_key", "job_id")
);
CREATE TABLE "current_conversation_bindings" (
"binding_key" text COLLATE "C" NOT NULL,
"binding_id" text COLLATE "C" NOT NULL,
"target_session_key" text COLLATE "C" NOT NULL,
"channel" text COLLATE "C" NOT NULL,
"account_id" text COLLATE "C" NOT NULL,
"conversation_kind" text COLLATE "C" NOT NULL,
"parent_conversation_id" text COLLATE "C",
"conversation_id" text COLLATE "C" NOT NULL,
"target_kind" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"bound_at" bigint NOT NULL,
"expires_at" bigint,
"metadata_json" text COLLATE "C",
"record_json" text COLLATE "C" NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("binding_key")
);
CREATE TABLE "delivery_queue_entries" (
"queue_name" text COLLATE "C" NOT NULL,
"id" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"entry_kind" text COLLATE "C",
"session_key" text COLLATE "C",
"channel" text COLLATE "C",
"target" text COLLATE "C",
"account_id" text COLLATE "C",
"retry_count" bigint NOT NULL DEFAULT 0,
"last_attempt_at" bigint,
"last_error" text COLLATE "C",
"recovery_state" text COLLATE "C",
"platform_send_started_at" bigint,
"entry_json" text COLLATE "C" NOT NULL,
"retention_id_prefix" text COLLATE "C",
"retention_max_age_ms" bigint,
"retention_max_entries" bigint,
"enqueued_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
"failed_at" bigint,
PRIMARY KEY ("queue_name", "id")
);
CREATE TABLE "device_bootstrap_tokens" (
"token_key" text COLLATE "C" NOT NULL,
"token" text COLLATE "C" NOT NULL,
"setup_id" text COLLATE "C",
"ts" bigint NOT NULL,
"device_id" text COLLATE "C",
"public_key" text COLLATE "C",
"profile_json" text COLLATE "C",
"redeemed_profile_json" text COLLATE "C",
"pending_profile_json" text COLLATE "C",
"issued_at_ms" bigint NOT NULL,
"last_used_at_ms" bigint,
PRIMARY KEY ("token_key")
);
CREATE TABLE "device_pairing_paired" (
"device_id" text COLLATE "C" NOT NULL,
"public_key" text COLLATE "C" NOT NULL,
"display_name" text COLLATE "C",
"operator_label" text COLLATE "C",
"platform" text COLLATE "C",
"device_family" text COLLATE "C",
"client_id" text COLLATE "C",
"client_mode" text COLLATE "C",
"browser_origin" text COLLATE "C",
"role" text COLLATE "C",
"roles_json" text COLLATE "C",
"scopes_json" text COLLATE "C",
"approved_scopes_json" text COLLATE "C",
"remote_ip" text COLLATE "C",
"tokens_json" text COLLATE "C",
"approved_via" text COLLATE "C",
"node_surface_json" text COLLATE "C",
"pending_node_surface_json" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"approved_at_ms" bigint NOT NULL,
"last_seen_at_ms" bigint,
"last_seen_reason" text COLLATE "C",
PRIMARY KEY ("device_id")
);
CREATE TABLE "device_pairing_pending" (
"request_id" text COLLATE "C" NOT NULL,
"device_id" text COLLATE "C" NOT NULL,
"public_key" text COLLATE "C" NOT NULL,
"display_name" text COLLATE "C",
"platform" text COLLATE "C",
"device_family" text COLLATE "C",
"client_id" text COLLATE "C",
"client_mode" text COLLATE "C",
"browser_origin" text COLLATE "C",
"role" text COLLATE "C",
"roles_json" text COLLATE "C",
"scopes_json" text COLLATE "C",
"remote_ip" text COLLATE "C",
"silent" bigint,
"is_repair" bigint,
"ts" bigint NOT NULL,
"refreshed_at_ms" bigint,
PRIMARY KEY ("request_id")
);
CREATE TABLE "diagnostic_events" (
"scope" text COLLATE "C" NOT NULL,
"event_key" text COLLATE "C" NOT NULL,
"payload_json" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
"sequence" bigint NOT NULL DEFAULT 0,
PRIMARY KEY ("scope", "event_key")
);
CREATE TABLE "exec_approvals_config" (
"config_key" text COLLATE "C" NOT NULL,
"raw_json" text COLLATE "C" NOT NULL,
"socket_path" text COLLATE "C",
"has_socket_token" bigint NOT NULL,
"default_security" text COLLATE "C",
"default_ask" text COLLATE "C",
"default_ask_fallback" text COLLATE "C",
"auto_allow_skills" bigint,
"agent_count" bigint NOT NULL,
"allowlist_count" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("config_key")
);
CREATE TABLE "flow_runs" (
"flow_id" text COLLATE "C" NOT NULL,
"shape" text COLLATE "C",
"sync_mode" text COLLATE "C" NOT NULL DEFAULT 'managed',
"owner_key" text COLLATE "C" NOT NULL,
"requester_origin_json" text COLLATE "C",
"controller_id" text COLLATE "C",
"revision" bigint NOT NULL DEFAULT 0,
"status" text COLLATE "C" NOT NULL,
"notify_policy" text COLLATE "C" NOT NULL,
"goal" text COLLATE "C" NOT NULL,
"current_step" text COLLATE "C",
"blocked_task_id" text COLLATE "C",
"blocked_summary" text COLLATE "C",
"state_json" text COLLATE "C",
"wait_json" text COLLATE "C",
"cancel_requested_at" bigint,
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
"ended_at" bigint,
PRIMARY KEY ("flow_id")
);
CREATE TABLE "gateway_boot_lifecycle" (
"boot_id" text COLLATE "C" NOT NULL,
"pid" bigint NOT NULL,
"started_at_ms" bigint NOT NULL,
"completed_at_ms" bigint,
"outcome" text COLLATE "C",
"startup_reason" text COLLATE "C",
"reason" text COLLATE "C",
PRIMARY KEY ("boot_id")
);
CREATE TABLE "gateway_restart_handoff" (
"handoff_key" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"version" bigint NOT NULL,
"intent_id" text COLLATE "C" NOT NULL,
"pid" bigint NOT NULL,
"process_instance_id" text COLLATE "C",
"created_at" bigint NOT NULL,
"expires_at" bigint NOT NULL,
"reason" text COLLATE "C",
"restart_trace_started_at" bigint,
"restart_trace_last_at" bigint,
"source" text COLLATE "C" NOT NULL,
"restart_kind" text COLLATE "C" NOT NULL,
"supervisor_mode" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("handoff_key")
);
CREATE TABLE "gateway_restart_intent" (
"intent_key" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"pid" bigint NOT NULL,
"created_at" bigint NOT NULL,
"reason" text COLLATE "C",
"force" bigint,
"wait_ms" bigint,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("intent_key")
);
CREATE TABLE "gateway_restart_sentinel" (
"sentinel_key" text COLLATE "C" NOT NULL,
"version" bigint NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"ts" bigint NOT NULL,
"session_key" text COLLATE "C",
"thread_id" text COLLATE "C",
"delivery_channel" text COLLATE "C",
"delivery_to" text COLLATE "C",
"delivery_account_id" text COLLATE "C",
"message" text COLLATE "C",
"continuation_json" text COLLATE "C",
"doctor_hint" text COLLATE "C",
"stats_json" text COLLATE "C",
"payload_json" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("sentinel_key")
);
CREATE TABLE "macos_port_guardian_records" (
"pid" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"port" bigint NOT NULL,
"command" text COLLATE "C" NOT NULL,
"mode" text COLLATE "C" NOT NULL,
"timestamp" double precision NOT NULL,
PRIMARY KEY ("pid")
);
CREATE TABLE "managed_outgoing_image_records" (
"attachment_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C",
"message_id" text COLLATE "C",
"created_at" text COLLATE "C" NOT NULL,
"updated_at" text COLLATE "C",
"retention_class" text COLLATE "C",
"alt" text COLLATE "C" NOT NULL,
"original_media_root" text COLLATE "C" NOT NULL,
"original_media_id" text COLLATE "C" NOT NULL,
"original_media_subdir" text COLLATE "C" NOT NULL,
"original_content_type" text COLLATE "C" NOT NULL,
"original_width" bigint,
"original_height" bigint,
"original_size_bytes" bigint,
"original_filename" text COLLATE "C",
"record_json" text COLLATE "C" NOT NULL,
"cleanup_pending" bigint NOT NULL DEFAULT 0,
PRIMARY KEY ("attachment_id"),
CHECK (("cleanup_pending" IN (0, 1)))
);
CREATE TABLE "mcp_oauth_stores" (
"store_key" text COLLATE "C" NOT NULL,
"format_version" bigint NOT NULL,
"store_json" text COLLATE "C" NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("store_key"),
CHECK (("format_version" = 1))
);
CREATE TABLE "meeting_transcript_sessions" (
"started_at_ms" bigint,
"session_id" text COLLATE "C" NOT NULL,
"started_at" text COLLATE "C" NOT NULL,
"selector" text COLLATE "C" NOT NULL,
"export_key" text COLLATE "C" NOT NULL,
"session_slug" text COLLATE "C" NOT NULL,
"provider_id" text COLLATE "C" NOT NULL,
"title" text COLLATE "C",
"source_json" text COLLATE "C" NOT NULL,
"source_account_id" text COLLATE "C",
"source_guild_id" text COLLATE "C",
"source_channel_id" text COLLATE "C",
"source_meeting_url" text COLLATE "C",
"source_thread_ts" text COLLATE "C",
"source_file_id" text COLLATE "C",
"stopped_at" text COLLATE "C",
"metadata_json" text COLLATE "C",
"metadata_agent_id" text COLLATE "C",
"export_manifest_json" text COLLATE "C" NOT NULL DEFAULT '{}',
"export_pending_json" text COLLATE "C" NOT NULL DEFAULT '[]',
"next_utterance_seq" bigint NOT NULL DEFAULT 0,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("session_id", "started_at"),
CHECK (("next_utterance_seq" >= 0)),
CHECK (("created_at_ms" >= 0)),
CHECK (("updated_at_ms" >= 0)),
UNIQUE ("selector")
);
CREATE TABLE "meeting_transcript_summaries" (
"session_id" text COLLATE "C" NOT NULL,
"session_started_at" text COLLATE "C" NOT NULL,
"generated_at" text COLLATE "C",
"summary_json" text COLLATE "C",
"overview" text COLLATE "C",
"markdown" text COLLATE "C",
"utterance_count" bigint NOT NULL,
PRIMARY KEY ("session_id", "session_started_at"),
CHECK (("utterance_count" >= 0)),
CHECK ("summary_json" IS NOT NULL OR "markdown" IS NOT NULL)
);
CREATE TABLE "meeting_transcript_utterances" (
"session_id" text COLLATE "C" NOT NULL,
"session_started_at" text COLLATE "C" NOT NULL,
"sequence" bigint NOT NULL,
"utterance_id" text COLLATE "C",
"started_at" text COLLATE "C",
"ended_at" text COLLATE "C",
"speaker_id" text COLLATE "C",
"speaker_label" text COLLATE "C",
"text" text COLLATE "C" NOT NULL,
"final" bigint,
"metadata_json" text COLLATE "C",
PRIMARY KEY ("session_id", "session_started_at", "sequence"),
CHECK (("sequence" >= 0)),
CHECK (("final" IN (0, 1)))
);
CREATE TABLE "migration_runs" (
"id" text COLLATE "C" NOT NULL,
"started_at" bigint NOT NULL,
"finished_at" bigint,
"status" text COLLATE "C" NOT NULL,
"report_json" text COLLATE "C" NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "migration_sources" (
"source_key" text COLLATE "C" NOT NULL,
"migration_kind" text COLLATE "C" NOT NULL,
"source_path" text COLLATE "C" NOT NULL,
"target_table" text COLLATE "C" NOT NULL,
"source_sha256" text COLLATE "C",
"source_size_bytes" bigint,
"source_record_count" bigint,
"last_run_id" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"imported_at" bigint NOT NULL,
"removed_source" bigint NOT NULL DEFAULT 0,
"report_json" text COLLATE "C" NOT NULL,
PRIMARY KEY ("source_key")
);
CREATE TABLE "native_hook_relay_bridges" (
"relay_id" text COLLATE "C" NOT NULL,
"pid" bigint NOT NULL,
"hostname" text COLLATE "C" NOT NULL,
"port" bigint NOT NULL,
"token" text COLLATE "C" NOT NULL,
"expires_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("relay_id")
);
CREATE TABLE "official_external_plugin_catalog_snapshots" (
"feed_url" text COLLATE "C" NOT NULL,
"body" text COLLATE "C" NOT NULL,
"status" bigint NOT NULL,
"etag" text COLLATE "C",
"last_modified" text COLLATE "C",
"checksum" text COLLATE "C" NOT NULL,
"saved_at" text COLLATE "C" NOT NULL,
"trust_mode" text COLLATE "C",
"trust_key_id" text COLLATE "C",
"trust_signature_count" bigint,
"trust_threshold" bigint,
"trust_verified_at" text COLLATE "C",
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("feed_url")
);
CREATE TABLE "operator_approvals" (
"cursor_id" bigint NOT NULL,
"approval_id" text COLLATE "C" NOT NULL,
"resolution_ref" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"presentation_json" text COLLATE "C" NOT NULL,
"requested_by_device_id" text COLLATE "C",
"requested_by_client_id" text COLLATE "C",
"requested_by_device_token_auth" bigint NOT NULL DEFAULT 0,
"reviewer_device_ids_json" text COLLATE "C" NOT NULL,
"source_agent_id" text COLLATE "C",
"source_session_key" text COLLATE "C",
"source_session_id" text COLLATE "C",
"source_run_id" text COLLATE "C",
"source_tool_call_id" text COLLATE "C",
"source_tool_name" text COLLATE "C",
"audience_session_keys_json" text COLLATE "C" NOT NULL,
"runtime_epoch" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"expires_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"decision" text COLLATE "C",
"terminal_reason" text COLLATE "C",
"resolved_at_ms" bigint,
"resolver_kind" text COLLATE "C",
"resolver_id" text COLLATE "C",
"consumed_at_ms" bigint,
"consumed_by" text COLLATE "C",
PRIMARY KEY ("approval_id"),
CHECK ((char_length("approval_id") > 0) AND ("approval_id" NOT IN ('.', '..'))),
CHECK ((char_length("resolution_ref") = 43) AND ("resolution_ref" COLLATE "C" !~ '\\A.*[^A-Za-z0-9_-].*\\Z')),
CHECK (("kind" IN ('exec', 'plugin', 'system-agent'))),
CHECK (("status" IN ('pending', 'allowed', 'denied', 'expired', 'cancelled'))),
CHECK (("decision" IN ('allow-once', 'allow-always', 'deny'))),
CHECK (("terminal_reason" IN ('user', 'timeout', 'malformed-verdict', 'no-route', 'run-aborted', 'gateway-restart', 'storage-corrupt'))),
CHECK (("resolver_kind" IN ('device', 'channel', 'runtime', 'system'))),
CHECK (("expires_at_ms" >= "created_at_ms")),
CHECK (("updated_at_ms" >= "created_at_ms")),
CHECK ("resolved_at_ms" IS NULL OR ("resolved_at_ms" >= "created_at_ms")),
CHECK ("resolved_at_ms" IS NULL OR ("resolved_at_ms" <= "updated_at_ms")),
CHECK ("consumed_at_ms" IS NULL OR ("consumed_at_ms" >= "resolved_at_ms")),
CHECK ("consumed_at_ms" IS NULL OR ("consumed_at_ms" <= "updated_at_ms")),
CHECK (("requested_by_device_token_auth" IN (0, 1))),
CHECK ((("status" = 'pending') AND "decision" IS NULL AND "terminal_reason" IS NULL AND "resolved_at_ms" IS NULL AND "resolver_kind" IS NULL AND "resolver_id" IS NULL AND "consumed_at_ms" IS NULL AND "consumed_by" IS NULL) OR (("status" = 'allowed') AND ("decision" IN ('allow-once', 'allow-always')) AND ("terminal_reason" = 'user') AND "resolved_at_ms" IS NOT NULL AND "resolver_kind" IS NOT NULL) OR (("status" = 'denied') AND ("decision" = 'deny') AND ("terminal_reason" IN ('user', 'malformed-verdict', 'no-route', 'storage-corrupt')) AND "resolved_at_ms" IS NOT NULL AND "resolver_kind" IS NOT NULL AND "consumed_at_ms" IS NULL AND "consumed_by" IS NULL) OR (("status" = 'expired') AND ("decision" = 'deny') AND ("terminal_reason" = 'timeout') AND "resolved_at_ms" IS NOT NULL AND "resolver_kind" IS NOT NULL AND "consumed_at_ms" IS NULL AND "consumed_by" IS NULL) OR (("status" = 'cancelled') AND ("decision" = 'deny') AND ("terminal_reason" IN ('run-aborted', 'gateway-restart')) AND "resolved_at_ms" IS NOT NULL AND "resolver_kind" IS NOT NULL AND "consumed_at_ms" IS NULL AND "consumed_by" IS NULL)),
CHECK (("consumed_at_ms" IS NULL AND "consumed_by" IS NULL) OR (("status" = 'allowed') AND ("decision" = 'allow-once') AND "consumed_at_ms" IS NOT NULL AND "consumed_by" IS NOT NULL))
);
CREATE TABLE "outbound_media_provenance" (
"realpath" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"version" bigint NOT NULL,
"sha256" text COLLATE "C" NOT NULL,
"size_bytes" bigint NOT NULL,
"created_at_ms" bigint NOT NULL,
PRIMARY KEY ("realpath")
);
CREATE TABLE "plugin_binding_approvals" (
"plugin_root" text COLLATE "C" NOT NULL,
"channel" text COLLATE "C" NOT NULL,
"account_id" text COLLATE "C" NOT NULL,
"plugin_id" text COLLATE "C" NOT NULL,
"plugin_name" text COLLATE "C",
"approved_at" bigint NOT NULL,
PRIMARY KEY ("plugin_root", "channel", "account_id")
);
CREATE TABLE "plugin_blob_entries" (
"plugin_id" text COLLATE "C" NOT NULL,
"namespace" text COLLATE "C" NOT NULL,
"entry_key" text COLLATE "C" NOT NULL,
"metadata_json" text COLLATE "C" NOT NULL,
"blob" bytea NOT NULL,
"created_at" bigint NOT NULL,
"expires_at" bigint,
PRIMARY KEY ("plugin_id", "namespace", "entry_key")
);
CREATE TABLE "plugin_state_entries" (
"plugin_id" text COLLATE "C" NOT NULL,
"namespace" text COLLATE "C" NOT NULL,
"entry_key" text COLLATE "C" NOT NULL,
"value_json" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
"expires_at" bigint,
PRIMARY KEY ("plugin_id", "namespace", "entry_key")
);
CREATE TABLE "sandbox_registry_entries" (
"registry_kind" text COLLATE "C" NOT NULL,
"container_name" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C",
"backend_id" text COLLATE "C",
"runtime_label" text COLLATE "C",
"image" text COLLATE "C",
"created_at_ms" bigint,
"last_used_at_ms" bigint,
"config_label_kind" text COLLATE "C",
"config_hash" text COLLATE "C",
"cdp_port" bigint,
"no_vnc_port" bigint,
"entry_json" text COLLATE "C" NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("registry_kind", "container_name")
);
CREATE TABLE "schema_meta" (
"meta_key" text COLLATE "C" NOT NULL,
"role" text COLLATE "C" NOT NULL,
"schema_version" bigint NOT NULL,
"agent_id" text COLLATE "C",
"app_version" text COLLATE "C",
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("meta_key")
);
CREATE TABLE "session_groups" (
"name" text COLLATE "C" NOT NULL,
"position" bigint NOT NULL,
"created_at" bigint NOT NULL,
"cwd" text COLLATE "C",
"worktree" bigint,
PRIMARY KEY ("name")
);
CREATE TABLE "session_state_events" (
"sequence" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"dedupe_key" text COLLATE "C",
"session_key" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C",
"agent_id" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"actor_type" text COLLATE "C" NOT NULL,
"actor_id" text COLLATE "C",
"run_id" text COLLATE "C",
"occurred_at" bigint NOT NULL,
"summary" text COLLATE "C" NOT NULL,
"payload_json" text COLLATE "C",
PRIMARY KEY ("sequence"),
UNIQUE ("dedupe_key")
);
CREATE TABLE "session_state_heads" (
"session_key" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"last_sequence" bigint NOT NULL,
"pruned_max_sequence" bigint NOT NULL DEFAULT 0,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("session_key", "agent_id")
);
CREATE TABLE "session_upstream_links" (
"session_key" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"catalog_id" text COLLATE "C" NOT NULL,
"host_id" text COLLATE "C" NOT NULL,
"thread_id" text COLLATE "C" NOT NULL,
"upstream_kind" text COLLATE "C" NOT NULL,
"upstream_ref_json" text COLLATE "C",
"last_marker_json" text COLLATE "C",
"last_scanned_at" bigint,
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("session_key", "agent_id")
);
CREATE TABLE "session_watch_cursors" (
"watcher_session_key" text COLLATE "C" NOT NULL,
"watcher_store_path" text COLLATE "C",
"target_session_key" text COLLATE "C" NOT NULL,
"last_seen_sequence" bigint NOT NULL DEFAULT 0,
"notified_sequence" bigint NOT NULL DEFAULT 0,
"material_sequence" bigint NOT NULL DEFAULT 0,
"provenance" text COLLATE "C" NOT NULL DEFAULT 'explicit',
"updated_at" bigint NOT NULL,
PRIMARY KEY ("watcher_session_key", "target_session_key"),
CHECK (("provenance" IN ('explicit', 'ambient-group')))
);
CREATE TABLE "skill_upload_chunks" (
"upload_id" text COLLATE "C" NOT NULL,
"byte_offset" bigint NOT NULL,
"size_bytes" bigint NOT NULL,
"chunk_blob" bytea NOT NULL,
PRIMARY KEY ("upload_id", "byte_offset"),
CHECK (("byte_offset" >= 0)),
CHECK (("size_bytes" > 0)),
CHECK ((octet_length("chunk_blob") = "size_bytes"))
);
CREATE TABLE "skill_uploads" (
"upload_id" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"slug" text COLLATE "C" NOT NULL,
"force" bigint NOT NULL,
"size_bytes" bigint NOT NULL,
"sha256" text COLLATE "C",
"actual_sha256" text COLLATE "C",
"received_bytes" bigint NOT NULL,
"archive_blob" bytea NOT NULL,
"created_at" bigint NOT NULL,
"expires_at" bigint NOT NULL,
"committed" bigint NOT NULL,
"committed_at" bigint,
"idempotency_key_hash" text COLLATE "C",
PRIMARY KEY ("upload_id"),
UNIQUE ("idempotency_key_hash")
);
CREATE TABLE "skill_usage" (
"skill_file" text COLLATE "C" NOT NULL,
"skill_key" text COLLATE "C" NOT NULL,
"skill_name" text COLLATE "C" NOT NULL,
"skill_source" text COLLATE "C" NOT NULL,
"first_used_at_ms" bigint NOT NULL,
"last_used_at_ms" bigint NOT NULL,
"use_count" bigint NOT NULL,
"last_agent_id" text COLLATE "C",
PRIMARY KEY ("skill_file")
);
CREATE TABLE "state_leases" (
"scope" text COLLATE "C" NOT NULL,
"lease_key" text COLLATE "C" NOT NULL,
"owner" text COLLATE "C" NOT NULL,
"expires_at" bigint,
"heartbeat_at" bigint,
"payload_json" text COLLATE "C",
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("scope", "lease_key")
);
CREATE TABLE "subagent_runs" (
"run_id" text COLLATE "C" NOT NULL,
"child_session_key" text COLLATE "C" NOT NULL,
"controller_session_key" text COLLATE "C",
"controller_store_path" text COLLATE "C",
"requester_session_key" text COLLATE "C" NOT NULL,
"requester_store_path" text COLLATE "C",
"created_at" bigint NOT NULL,
"payload_json" text COLLATE "C" NOT NULL DEFAULT '{}',
PRIMARY KEY ("run_id")
);
CREATE TABLE "task_delivery_state" (
"task_id" text COLLATE "C" NOT NULL,
"requester_origin_json" text COLLATE "C",
"last_notified_event_at" bigint,
PRIMARY KEY ("task_id")
);
CREATE TABLE "task_runs" (
"task_id" text COLLATE "C" NOT NULL,
"runtime" text COLLATE "C" NOT NULL,
"task_kind" text COLLATE "C",
"source_id" text COLLATE "C",
"requester_session_key" text COLLATE "C",
"owner_key" text COLLATE "C" NOT NULL,
"scope_kind" text COLLATE "C" NOT NULL,
"child_session_key" text COLLATE "C",
"parent_flow_id" text COLLATE "C",
"parent_task_id" text COLLATE "C",
"agent_id" text COLLATE "C",
"requester_agent_id" text COLLATE "C",
"run_id" text COLLATE "C",
"execution_owner_host" text COLLATE "C",
"execution_owner_pid" bigint,
"execution_owner_start_identity" bigint,
"label" text COLLATE "C",
"task" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"delivery_status" text COLLATE "C" NOT NULL,
"notify_policy" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
"started_at" bigint,
"ended_at" bigint,
"last_event_at" bigint,
"cleanup_after" bigint,
"tool_use_count" bigint,
"last_tool_name" text COLLATE "C",
"error" text COLLATE "C",
"progress_summary" text COLLATE "C",
"terminal_summary" text COLLATE "C",
"terminal_outcome" text COLLATE "C",
"detail_json" text COLLATE "C",
PRIMARY KEY ("task_id")
);
CREATE TABLE "template_cron_refs" (
"agent_id" text COLLATE "C" NOT NULL,
"manifest_id" text COLLATE "C" NOT NULL,
"schema_version" text COLLATE "C" NOT NULL,
"declaration_key" text COLLATE "C" NOT NULL,
"scheduler_job_id" text COLLATE "C",
"status" text COLLATE "C" NOT NULL,
"job_json" text COLLATE "C" NOT NULL,
"error" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("agent_id", "manifest_id"),
UNIQUE ("declaration_key"),
UNIQUE ("scheduler_job_id")
);
CREATE TABLE "template_installs" (
"agent_id" text COLLATE "C" NOT NULL,
"schema_version" text COLLATE "C" NOT NULL,
"source_kind" text COLLATE "C" NOT NULL,
"template_name" text COLLATE "C" NOT NULL,
"template_version" text COLLATE "C" NOT NULL,
"package_root" text COLLATE "C" NOT NULL,
"manifest_path" text COLLATE "C" NOT NULL,
"integrity_kind" text COLLATE "C" NOT NULL,
"integrity" text COLLATE "C" NOT NULL,
"source_byte_length" bigint NOT NULL,
"manifest_schema_version" bigint NOT NULL,
"plan_integrity" text COLLATE "C" NOT NULL,
"workspace" text COLLATE "C" NOT NULL,
"agent_config_digest" text COLLATE "C" NOT NULL,
"agent_owned_paths_json" text COLLATE "C" NOT NULL,
"bootstrap_source_path" text COLLATE "C",
"bootstrap_content_digest" text COLLATE "C",
"status" text COLLATE "C" NOT NULL,
"added_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("agent_id"),
CHECK (("status" IN ('pending', 'workspace_ready', 'config_committed', 'complete', 'partial'))),
UNIQUE ("workspace")
);
CREATE TABLE "template_mcp_server_refs" (
"agent_id" text COLLATE "C" NOT NULL,
"name" text COLLATE "C" NOT NULL,
"schema_version" text COLLATE "C" NOT NULL,
"config_digest" text COLLATE "C" NOT NULL,
"relationship" text COLLATE "C" NOT NULL,
"origin" text COLLATE "C" NOT NULL,
"independent_owner" bigint NOT NULL DEFAULT 0,
"status" text COLLATE "C" NOT NULL,
"error" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("agent_id", "name"),
CHECK (("relationship" IN ('managed', 'referenced'))),
CHECK (("origin" IN ('template-introduced', 'pre-existing'))),
CHECK (("independent_owner" IN (0, 1)))
);
CREATE TABLE "template_package_refs" (
"agent_id" text COLLATE "C" NOT NULL,
"package_kind" text COLLATE "C" NOT NULL,
"package_source" text COLLATE "C" NOT NULL,
"package_ref" text COLLATE "C" NOT NULL,
"package_version" text COLLATE "C" NOT NULL,
"package_integrity" text COLLATE "C" NOT NULL,
"schema_version" text COLLATE "C" NOT NULL,
"template_name" text COLLATE "C" NOT NULL,
"package_status" text COLLATE "C" NOT NULL,
"relationship" text COLLATE "C" NOT NULL,
"origin" text COLLATE "C" NOT NULL,
"independent_owner" bigint NOT NULL,
"extension_id" text COLLATE "C",
"extension_format" text COLLATE "C",
"extension_detected_format" text COLLATE "C",
"extension_mapped_json" text COLLATE "C",
"extension_unavailable_json" text COLLATE "C",
"extension_adapter_identity" text COLLATE "C",
"installed_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("agent_id", "package_kind", "package_source", "package_ref", "package_version"),
CHECK (("relationship" IN ('managed', 'referenced'))),
CHECK (("origin" IN ('template-introduced', 'pre-existing'))),
CHECK (("independent_owner" IN (0, 1)))
);
CREATE TABLE "template_workspace_files" (
"agent_id" text COLLATE "C" NOT NULL,
"target_path" text COLLATE "C" NOT NULL,
"schema_version" text COLLATE "C" NOT NULL,
"workspace" text COLLATE "C" NOT NULL,
"source_path" text COLLATE "C" NOT NULL,
"content_digest" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("agent_id", "target_path")
);
CREATE TABLE "web_push_subscriptions" (
"endpoint_hash" text COLLATE "C" NOT NULL,
"subscription_id" text COLLATE "C" NOT NULL,
"endpoint" text COLLATE "C" NOT NULL,
"p256dh" text COLLATE "C" NOT NULL,
"auth" text COLLATE "C" NOT NULL,
"device_id" text COLLATE "C",
"user_profile_id" text COLLATE "C",
"preferences_json" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("endpoint_hash"),
UNIQUE ("subscription_id")
);
CREATE TABLE "worker_environment_credentials" (
"environment_id" text COLLATE "C" NOT NULL,
"credential_hash" text COLLATE "C" NOT NULL,
"bundle_hash" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C",
"rpc_set_version" bigint NOT NULL,
"owner_epoch" bigint NOT NULL,
"expires_at_ms" bigint NOT NULL,
"delivered_at_ms" bigint,
PRIMARY KEY ("environment_id"),
CHECK (("rpc_set_version" >= 1)),
CHECK (("owner_epoch" >= 0)),
CHECK (("expires_at_ms" >= 0)),
CHECK (("delivered_at_ms" >= 0)),
UNIQUE ("credential_hash")
);
CREATE TABLE "worker_environments" (
"environment_id" text COLLATE "C" NOT NULL,
"provider_id" text COLLATE "C" NOT NULL,
"profile_id" text COLLATE "C" NOT NULL,
"profile_snapshot_json" text COLLATE "C" NOT NULL,
"last_activated_at_ms" bigint,
"preparation_key" text COLLATE "C",
"preparation_purpose" text COLLATE "C",
"preparation_demand_at_ms" bigint,
"preparation_expires_at_ms" bigint,
"preparation_consumed_at_ms" bigint,
"provision_operation_id" text COLLATE "C" NOT NULL,
"lease_id" text COLLATE "C",
"node_setup_id" text COLLATE "C",
"node_device_id" text COLLATE "C",
"ssh_host" text COLLATE "C",
"ssh_port" bigint,
"ssh_user" text COLLATE "C",
"ssh_host_key" text COLLATE "C",
"ssh_key_ref_json" text COLLATE "C",
"desktop_json" text COLLATE "C",
"state" text COLLATE "C" NOT NULL,
"bootstrap_bundle_hash" text COLLATE "C",
"bootstrap_openclaw_version" text COLLATE "C",
"bootstrap_protocol_features_json" text COLLATE "C",
"bootstrap_install_kind" text COLLATE "C",
"owner_epoch" bigint NOT NULL DEFAULT 0,
"teardown_terminal_state" text COLLATE "C",
"attached_session_ids_json" text COLLATE "C" NOT NULL DEFAULT '[]',
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"state_changed_at_ms" bigint NOT NULL,
"idle_since_at_ms" bigint,
"destroy_requested_at_ms" bigint,
"last_error" text COLLATE "C",
"shared_host" bigint,
"resource_receipt_json" text COLLATE "C",
"retention_json" text COLLATE "C",
"provision_source_json" text COLLATE "C",
PRIMARY KEY ("environment_id"),
CHECK (("preparation_key" IS NULL AND "preparation_demand_at_ms" IS NULL AND "preparation_expires_at_ms" IS NULL AND "preparation_consumed_at_ms" IS NULL) OR ("preparation_key" IS NOT NULL AND (char_length("preparation_key") = 64) AND ("preparation_key" COLLATE "C" !~ '\\A.*[^0-9a-f].*\\Z') AND "preparation_demand_at_ms" IS NOT NULL AND ("preparation_demand_at_ms" BETWEEN 0 AND 9007199254740991) AND "preparation_expires_at_ms" IS NOT NULL AND ("preparation_expires_at_ms" > "preparation_demand_at_ms") AND ("preparation_expires_at_ms" <= 9007199254740991) AND ("preparation_consumed_at_ms" IS NULL OR (("preparation_consumed_at_ms" >= "preparation_demand_at_ms") AND ("preparation_consumed_at_ms" < "preparation_expires_at_ms"))))),
CHECK ("ssh_port" IS NULL OR (("ssh_port" >= 1) AND ("ssh_port" <= 65535))),
CHECK (("state" IN ('requested', 'provisioning', 'bootstrapping', 'ready', 'attached', 'idle', 'draining', 'destroying', 'destroyed', 'failed', 'orphaned'))),
CHECK (("owner_epoch" >= 0)),
CHECK (("teardown_terminal_state" IN ('destroyed', 'failed'))),
UNIQUE ("provision_operation_id")
);
CREATE TABLE "worker_inference_turns" (
"session_id" text COLLATE "C" NOT NULL,
"run_epoch" bigint NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
"turn_id" text COLLATE "C" NOT NULL,
"environment_id" text COLLATE "C" NOT NULL,
"request_hash" text COLLATE "C" NOT NULL,
"state" text COLLATE "C" NOT NULL,
"terminal_json" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("session_id", "run_epoch", "run_id", "turn_id"),
CHECK (("run_epoch" >= 0)),
CHECK (("state" IN ('pending', 'terminal'))),
CHECK (("created_at_ms" >= 0)),
CHECK (("updated_at_ms" >= 0)),
CHECK ((("state" = 'pending') AND "terminal_json" IS NULL) OR (("state" = 'terminal') AND "terminal_json" IS NOT NULL))
);
CREATE TABLE "worker_session_placements" (
"session_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"execution_mode" text COLLATE "C",
"state" text COLLATE "C" NOT NULL,
"environment_id" text COLLATE "C",
"transition_generation" bigint NOT NULL DEFAULT 0,
"active_owner_epoch" bigint,
"workspace_base_manifest_ref" text COLLATE "C",
"remote_workspace_dir" text COLLATE "C",
"worker_bundle_hash" text COLLATE "C",
"last_transcript_ack_cursor" bigint,
"last_live_event_ack_cursor" bigint,
"recovery_error" text COLLATE "C",
"turn_claim_owner" text COLLATE "C",
"turn_claim_id" text COLLATE "C",
"turn_claim_run_id" text COLLATE "C",
"turn_claim_generation" bigint,
"turn_claim_owner_epoch" bigint,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"state_changed_at_ms" bigint NOT NULL,
"terminal_reason" text COLLATE "C",
"terminal_at_ms" bigint,
PRIMARY KEY ("session_id"),
CHECK (("execution_mode" IN ('worker-turn', 'remote-exec'))),
CHECK (("state" IN ('local', 'requested', 'provisioning', 'syncing', 'starting', 'active', 'draining', 'reconciling', 'reclaimed', 'failed'))),
CHECK (("transition_generation" >= 0)),
CHECK ("active_owner_epoch" IS NULL OR ("active_owner_epoch" >= 1)),
CHECK ("last_transcript_ack_cursor" IS NULL OR ("last_transcript_ack_cursor" >= 0)),
CHECK ("last_live_event_ack_cursor" IS NULL OR ("last_live_event_ack_cursor" >= 0)),
CHECK (("turn_claim_owner" IN ('local', 'worker'))),
CHECK ("turn_claim_generation" IS NULL OR ("turn_claim_generation" >= 0)),
CHECK ("turn_claim_owner_epoch" IS NULL OR ("turn_claim_owner_epoch" >= 1)),
CHECK ((("state" IN ('local', 'requested')) AND "environment_id" IS NULL AND "active_owner_epoch" IS NULL AND "workspace_base_manifest_ref" IS NULL AND "remote_workspace_dir" IS NULL AND "worker_bundle_hash" IS NULL AND "last_transcript_ack_cursor" IS NULL AND "last_live_event_ack_cursor" IS NULL AND "recovery_error" IS NULL) OR ("state" IS NOT DISTINCT FROM 'provisioning' AND "active_owner_epoch" IS NULL AND "workspace_base_manifest_ref" IS NULL AND "remote_workspace_dir" IS NULL AND "worker_bundle_hash" IS NULL AND "last_transcript_ack_cursor" IS NULL AND "last_live_event_ack_cursor" IS NULL AND "recovery_error" IS NULL) OR ("state" IS NOT DISTINCT FROM 'syncing' AND "environment_id" IS NOT NULL AND "active_owner_epoch" IS NULL AND "workspace_base_manifest_ref" IS NULL AND "remote_workspace_dir" IS NULL AND "worker_bundle_hash" IS NOT NULL AND "last_transcript_ack_cursor" IS NULL AND "last_live_event_ack_cursor" IS NULL AND "recovery_error" IS NULL) OR ("state" IS NOT DISTINCT FROM 'starting' AND "environment_id" IS NOT NULL AND "active_owner_epoch" IS NULL AND "workspace_base_manifest_ref" IS NOT NULL AND "remote_workspace_dir" IS NOT NULL AND "worker_bundle_hash" IS NOT NULL AND "last_transcript_ack_cursor" IS NULL AND "last_live_event_ack_cursor" IS NULL AND "recovery_error" IS NULL) OR (("state" IN ('active', 'draining', 'reconciling')) AND "environment_id" IS NOT NULL AND "active_owner_epoch" IS NOT NULL AND "workspace_base_manifest_ref" IS NOT NULL AND "remote_workspace_dir" IS NOT NULL AND "worker_bundle_hash" IS NOT NULL AND "recovery_error" IS NULL) OR ("state" IS NOT DISTINCT FROM 'reclaimed' AND "environment_id" IS NOT NULL AND "active_owner_epoch" IS NOT NULL AND "workspace_base_manifest_ref" IS NOT NULL AND "remote_workspace_dir" IS NOT NULL AND "worker_bundle_hash" IS NOT NULL AND "recovery_error" IS NULL AND "turn_claim_owner" IS NULL AND "turn_claim_id" IS NULL AND "turn_claim_run_id" IS NULL AND "turn_claim_generation" IS NULL AND "turn_claim_owner_epoch" IS NULL) OR ("state" IS NOT DISTINCT FROM 'failed' AND "recovery_error" IS NOT NULL)),
CHECK (("turn_claim_owner" IS NULL AND "turn_claim_id" IS NULL AND "turn_claim_run_id" IS NULL AND "turn_claim_generation" IS NULL AND "turn_claim_owner_epoch" IS NULL) OR ("turn_claim_owner" IS NOT DISTINCT FROM 'local' AND "turn_claim_id" IS NOT NULL AND "turn_claim_run_id" IS NOT NULL AND "turn_claim_generation" IS NOT NULL AND "turn_claim_owner_epoch" IS NULL) OR ("turn_claim_owner" IS NOT DISTINCT FROM 'worker' AND "turn_claim_id" IS NOT NULL AND "turn_claim_run_id" IS NOT NULL AND "turn_claim_generation" IS NOT NULL AND "turn_claim_owner_epoch" IS NOT NULL)),
CHECK ("turn_claim_owner" IS NULL OR ("turn_claim_owner" IS NOT DISTINCT FROM 'local' AND (("state" IN ('local', 'requested', 'failed')) OR (("state" IN ('active', 'draining')) AND "execution_mode" IS NOT DISTINCT FROM 'remote-exec'))) OR ("turn_claim_owner" IS NOT DISTINCT FROM 'worker' AND ("state" IN ('active', 'draining')) AND ("execution_mode" IS NULL OR "execution_mode" IS NOT DISTINCT FROM 'worker-turn') AND "turn_claim_owner_epoch" IS NOT DISTINCT FROM "active_owner_epoch"))
);
CREATE TABLE "worker_session_tool_operations" (
"source_session_id" text COLLATE "C" NOT NULL,
"source_claim_id" text COLLATE "C" NOT NULL,
"tool_call_id" text COLLATE "C" NOT NULL,
"tool_name" text COLLATE "C" NOT NULL,
"request_digest" text COLLATE "C" NOT NULL,
"operation_seed" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"child_session_key" text COLLATE "C",
"result_json" text COLLATE "C",
"gateway_instance_id" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("source_session_id", "source_claim_id", "tool_call_id"),
CHECK (("tool_name" IN ('sessions_spawn', 'sessions_send'))),
CHECK (("status" IN ('running', 'succeeded', 'failed', 'unknown')))
);
CREATE TABLE "worker_transcript_commit_heads" (
"session_id" text COLLATE "C" NOT NULL,
"run_epoch" bigint NOT NULL,
"environment_id" text COLLATE "C" NOT NULL,
"next_seq" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("session_id", "run_epoch"),
CHECK (("run_epoch" >= 0)),
CHECK (("next_seq" >= 1)),
CHECK (("updated_at_ms" >= 0))
);
CREATE TABLE "worker_transcript_commits" (
"session_id" text COLLATE "C" NOT NULL,
"run_epoch" bigint NOT NULL,
"seq" bigint NOT NULL,
"request_hash" text COLLATE "C" NOT NULL,
"state" text COLLATE "C" NOT NULL,
"result_json" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("session_id", "run_epoch", "seq"),
CHECK (("run_epoch" >= 0)),
CHECK (("seq" >= 1)),
CHECK (("state" IN ('pending', 'terminal'))),
CHECK (("created_at_ms" >= 0)),
CHECK (("updated_at_ms" >= 0)),
CHECK ((("state" = 'pending') AND "result_json" IS NULL) OR (("state" = 'terminal') AND "result_json" IS NOT NULL))
);
CREATE TABLE "worker_turn_tool_authorities" (
"session_id" text COLLATE "C" NOT NULL,
"environment_id" text COLLATE "C" NOT NULL,
"owner_epoch" bigint NOT NULL,
"placement_generation" bigint NOT NULL,
"claim_id" text COLLATE "C" NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
"tool_names_json" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("session_id"),
CHECK (("owner_epoch" >= 1)),
CHECK (("placement_generation" >= 0))
);
CREATE TABLE "worker_workspace_pending_results" (
"session_id" text COLLATE "C" NOT NULL,
"environment_id" text COLLATE "C" NOT NULL,
"owner_epoch" bigint NOT NULL,
"placement_generation" bigint NOT NULL,
"claim_id" text COLLATE "C" NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
"gateway_instance_id" text COLLATE "C" NOT NULL,
"recovery_requested_at_ms" bigint,
"workspace_accepted_at_ms" bigint,
"staged_result_ref" text COLLATE "C",
"repository_workspace_id" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"repository_disk_authority_json" text COLLATE "C",
PRIMARY KEY ("session_id"),
CHECK (("owner_epoch" >= 1)),
CHECK (("placement_generation" >= 0))
);
CREATE TABLE "worker_workspace_reconciliations" (
"session_id" text COLLATE "C" NOT NULL,
"environment_id" text COLLATE "C" NOT NULL,
"owner_epoch" bigint NOT NULL,
"placement_generation" bigint NOT NULL,
"base_manifest_ref" text COLLATE "C" NOT NULL,
"current_manifest_ref" text COLLATE "C" NOT NULL,
"plan_json" text COLLATE "C" NOT NULL,
"base_pack" bytea NOT NULL,
"created_at_ms" bigint NOT NULL,
PRIMARY KEY ("session_id"),
CHECK (("owner_epoch" >= 1)),
CHECK (("placement_generation" >= 0)),
CHECK ((octet_length("base_pack") <= 268435456))
);
CREATE TABLE "workspace_generated_bootstrap_hashes" (
"workspace_key" text COLLATE "C" NOT NULL,
"filename" text COLLATE "C" NOT NULL,
"sha256" text COLLATE "C" NOT NULL,
PRIMARY KEY ("workspace_key", "filename")
);
CREATE TABLE "workspace_path_aliases" (
"alias_key" text COLLATE "C" NOT NULL,
"alias_path" text COLLATE "C" NOT NULL,
"workspace_key" text COLLATE "C" NOT NULL,
"workspace_path" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("alias_key")
);
CREATE TABLE "workspace_setup_state" (
"workspace_key" text COLLATE "C" NOT NULL,
"workspace_path" text COLLATE "C",
"version" bigint,
"bootstrap_seeded_at" text COLLATE "C",
"setup_completed_at" text COLLATE "C",
"updated_at" bigint,
"attested_at_ms" bigint,
"attestation_updated_at_ms" bigint,
"bootstrap_deferred" bigint,
PRIMARY KEY ("workspace_key"),
CHECK ("version" IS NULL OR "workspace_path" IS NOT NULL)
);
CREATE TABLE "worktree_provisioned_file_chunks" (
"worktree_id" text COLLATE "C" NOT NULL,
"path" text COLLATE "C" NOT NULL,
"chunk_index" bigint NOT NULL,
"data" bytea NOT NULL,
PRIMARY KEY ("worktree_id", "path", "chunk_index"),
CHECK (("chunk_index" >= 0))
);
CREATE TABLE "worktrees" (
"id" text COLLATE "C" NOT NULL,
"repo_fingerprint" text COLLATE "C" NOT NULL,
"repo_root" text COLLATE "C" NOT NULL,
"path" text COLLATE "C" NOT NULL,
"branch" text COLLATE "C" NOT NULL,
"base_ref" text COLLATE "C" NOT NULL,
"owner_kind" text COLLATE "C" NOT NULL,
"owner_id" text COLLATE "C",
"snapshot_ref" text COLLATE "C",
"provisioned_paths_json" text COLLATE "C",
"created_at" bigint NOT NULL,
"last_active_at" bigint NOT NULL,
"removed_at" bigint,
"run_end_cleanup_json" text COLLATE "C",
"gc_protection_json" text COLLATE "C",
PRIMARY KEY ("id"),
CHECK (("owner_kind" IN ('manual', 'workboard', 'session')))
);
CREATE INDEX "idx_acp_replay_sessions_key_updated" ON "acp_replay_sessions" (("session_key") ASC, ("complete") ASC, ("updated_at") DESC, ("session_id") ASC);
CREATE INDEX "idx_acp_replay_sessions_updated" ON "acp_replay_sessions" (("updated_at") DESC, ("session_id") ASC);
CREATE INDEX "idx_acp_sessions_agent_activity" ON "acp_sessions" (("agent") ASC, ("last_activity_at") DESC, ("session_key") ASC);
CREATE INDEX "idx_acp_sessions_resume_acpx" ON "acp_sessions" (("resume_acpx_session_id") ASC NULLS FIRST);
CREATE INDEX "idx_acp_sessions_resume_agent" ON "acp_sessions" (("resume_agent_session_id") ASC NULLS FIRST);
CREATE INDEX "idx_acp_sessions_state_activity" ON "acp_sessions" (("state") ASC, ("last_activity_at") DESC, ("session_key") ASC);
CREATE INDEX "idx_apns_registrations_updated" ON "apns_registrations" (("updated_at_ms") DESC, ("node_id") ASC);
CREATE INDEX "idx_audit_events_agent_sequence" ON "audit_events" (("agent_id") ASC NULLS FIRST, ("sequence") DESC);
CREATE INDEX "idx_audit_events_channel_sequence" ON "audit_events" (("channel") ASC NULLS FIRST, ("sequence") DESC);
CREATE INDEX "idx_audit_events_direction_sequence" ON "audit_events" (("direction") ASC NULLS FIRST, ("sequence") DESC);
CREATE INDEX "idx_audit_events_kind_sequence" ON "audit_events" (("kind") ASC, ("sequence") DESC);
CREATE INDEX "idx_audit_events_run_sequence" ON "audit_events" (("run_id") ASC NULLS FIRST, ("sequence") DESC);
CREATE INDEX "idx_audit_events_session_sequence" ON "audit_events" (("session_key") ASC NULLS FIRST, ("sequence") DESC);
CREATE INDEX "idx_audit_events_status_sequence" ON "audit_events" (("status") ASC, ("sequence") DESC);
CREATE INDEX "idx_audit_events_time" ON "audit_events" (("occurred_at") DESC, ("sequence") DESC);
CREATE INDEX "idx_backup_runs_created" ON "backup_runs" (("created_at") DESC, ("id") ASC);
CREATE INDEX "capture_events_flow_idx" ON "capture_events" (("flow_id") ASC, ("ts") ASC);
CREATE INDEX "capture_events_session_ts_idx" ON "capture_events" (("session_id") ASC, ("ts") ASC);
CREATE INDEX "idx_channel_ingress_claims" ON "channel_ingress_events" (("queue_name") ASC, ("status") ASC, ("claimed_at") ASC NULLS FIRST);
CREATE INDEX "idx_channel_ingress_lane" ON "channel_ingress_events" (("queue_name") ASC, ("status") ASC, ("lane_key") ASC NULLS FIRST);
CREATE INDEX "idx_channel_ingress_pending" ON "channel_ingress_events" (("queue_name") ASC, ("status") ASC, ("received_at") ASC, ("event_id") ASC);
CREATE INDEX "idx_channel_pairing_allow_account" ON "channel_pairing_allow_entries" (("channel_key") ASC, ("account_id") ASC, ("sort_order") ASC, ("entry") ASC);
CREATE INDEX "idx_channel_pairing_requests_code" ON "channel_pairing_requests" (("channel_key") ASC, ("code") ASC);
CREATE INDEX "idx_channel_pairing_requests_created" ON "channel_pairing_requests" (("channel_key") ASC, ("created_at") ASC, ("request_id") ASC);
CREATE INDEX "idx_cron_job_scratch_store_updated" ON "cron_job_scratch" (("store_key") ASC, ("updated_at_ms") DESC, ("job_id") ASC);
CREATE INDEX "idx_cron_jobs_store_order" ON "cron_jobs" (("store_key") ASC, ("sort_order") ASC, ("updated_at") ASC, ("job_id") ASC);
CREATE INDEX "idx_current_conversation_bindings_conversation" ON "current_conversation_bindings" (("channel") ASC, ("account_id") ASC, ("conversation_kind") ASC, ("conversation_id") ASC);
CREATE INDEX "idx_current_conversation_bindings_expires" ON "current_conversation_bindings" (("expires_at") ASC NULLS FIRST, ("binding_key") ASC);
CREATE INDEX "idx_current_conversation_bindings_target" ON "current_conversation_bindings" (("target_session_key") ASC, ("updated_at") DESC, ("binding_key") ASC);
CREATE INDEX "idx_delivery_queue_bounded_retention" ON "delivery_queue_entries" (("queue_name") ASC, ("retention_id_prefix") ASC, ("enqueued_at") DESC, ("id") DESC) WHERE ("status" IN ('completed', 'failed')) AND ("recovery_state" = 'completed_bounded') AND "retention_id_prefix" IS NOT NULL;
CREATE INDEX "idx_delivery_queue_failed" ON "delivery_queue_entries" (("status") ASC, ("queue_name") ASC, ("failed_at") ASC NULLS FIRST, ("id") ASC);
CREATE INDEX "idx_delivery_queue_pending" ON "delivery_queue_entries" (("queue_name") ASC, ("status") ASC, ("enqueued_at") ASC, ("id") ASC);
CREATE INDEX "idx_delivery_queue_session" ON "delivery_queue_entries" (("queue_name") ASC, ("status") ASC, ("session_key") ASC, ("enqueued_at") ASC, ("id") ASC) WHERE "session_key" IS NOT NULL;
CREATE INDEX "idx_delivery_queue_target" ON "delivery_queue_entries" (("queue_name") ASC, ("status") ASC, ("channel") ASC, ("target") ASC, ("enqueued_at") ASC, ("id") ASC) WHERE "channel" IS NOT NULL AND "target" IS NOT NULL;
CREATE INDEX "idx_device_bootstrap_tokens_ts" ON "device_bootstrap_tokens" (("ts") ASC);
CREATE INDEX "idx_device_pairing_paired_approved" ON "device_pairing_paired" (("approved_at_ms") DESC, ("device_id") ASC);
CREATE INDEX "idx_device_pairing_pending_device" ON "device_pairing_pending" (("device_id") ASC, ("ts") DESC);
CREATE INDEX "idx_diagnostic_events_scope_sequence" ON "diagnostic_events" (("scope") ASC, ("sequence") ASC, ("event_key") ASC);
CREATE INDEX "idx_flow_runs_owner_key" ON "flow_runs" (("owner_key") ASC);
CREATE INDEX "idx_flow_runs_status" ON "flow_runs" (("status") ASC);
CREATE INDEX "idx_flow_runs_updated_at" ON "flow_runs" (("updated_at") ASC);
CREATE INDEX "idx_gateway_boot_lifecycle_started" ON "gateway_boot_lifecycle" (("started_at_ms") ASC);
CREATE INDEX "idx_gateway_restart_handoff_expiry" ON "gateway_restart_handoff" (("expires_at") ASC, ("pid") ASC);
CREATE INDEX "idx_gateway_restart_sentinel_ts" ON "gateway_restart_sentinel" (("ts") DESC, ("sentinel_key") ASC);
CREATE INDEX "idx_macos_port_guardian_records_port" ON "macos_port_guardian_records" (("port") ASC, ("timestamp") DESC);
CREATE INDEX "idx_managed_outgoing_images_agent_message" ON "managed_outgoing_image_records" (("session_key") ASC, ("agent_id") ASC NULLS FIRST, ("message_id") ASC, ("attachment_id") ASC) WHERE "message_id" IS NOT NULL;
CREATE INDEX "idx_managed_outgoing_images_agent_session" ON "managed_outgoing_image_records" (("session_key") ASC, ("agent_id") ASC NULLS FIRST, ("created_at") DESC, ("attachment_id") ASC);
CREATE INDEX "idx_managed_outgoing_images_message" ON "managed_outgoing_image_records" (("session_key") ASC, ("message_id") ASC, ("attachment_id") ASC) WHERE "message_id" IS NOT NULL;
CREATE INDEX "idx_managed_outgoing_images_session" ON "managed_outgoing_image_records" (("session_key") ASC, ("created_at") DESC, ("attachment_id") ASC);
CREATE INDEX "idx_meeting_transcript_sessions_account" ON "meeting_transcript_sessions" (("source_account_id") ASC NULLS FIRST);
CREATE INDEX "idx_meeting_transcript_sessions_agent" ON "meeting_transcript_sessions" (("metadata_agent_id") ASC NULLS FIRST);
CREATE INDEX "idx_meeting_transcript_sessions_chronology" ON "meeting_transcript_sessions" (("started_at_ms") DESC NULLS LAST, ("session_id") ASC, ("started_at") ASC);
CREATE INDEX "idx_meeting_transcript_sessions_export_key" ON "meeting_transcript_sessions" (("export_key") ASC);
CREATE INDEX "idx_meeting_transcript_sessions_id" ON "meeting_transcript_sessions" (("session_id") ASC, ("started_at") DESC);
CREATE INDEX "idx_meeting_transcript_sessions_slug" ON "meeting_transcript_sessions" (("session_slug") ASC, ("started_at") DESC);
CREATE INDEX "idx_meeting_transcript_sessions_source" ON "meeting_transcript_sessions" (("provider_id") ASC, ("source_account_id") ASC NULLS FIRST, ("source_guild_id") ASC NULLS FIRST, ("source_channel_id") ASC NULLS FIRST, ("source_meeting_url") ASC NULLS FIRST, ("source_thread_ts") ASC NULLS FIRST, ("source_file_id") ASC NULLS FIRST, ("stopped_at") DESC NULLS LAST, ("started_at") DESC, ("session_id") ASC);
CREATE INDEX "idx_meeting_transcript_sessions_started" ON "meeting_transcript_sessions" (("started_at") DESC, ("session_id") ASC);
CREATE INDEX "idx_meeting_transcript_utterances_id" ON "meeting_transcript_utterances" (("session_id") ASC, ("session_started_at") ASC, ("utterance_id") ASC) WHERE "utterance_id" IS NOT NULL;
CREATE INDEX "idx_migration_runs_started" ON "migration_runs" (("started_at") DESC, ("id") ASC);
CREATE INDEX "idx_migration_sources_path" ON "migration_sources" (("source_path") ASC, ("migration_kind") ASC, ("target_table") ASC);
CREATE INDEX "idx_migration_sources_run" ON "migration_sources" (("last_run_id") ASC, ("source_path") ASC);
CREATE INDEX "idx_native_hook_relay_bridges_expires" ON "native_hook_relay_bridges" (("expires_at_ms") ASC, ("relay_id") ASC);
CREATE INDEX "idx_official_external_plugin_catalog_snapshots_updated" ON "official_external_plugin_catalog_snapshots" (("updated_at_ms") DESC, ("feed_url") ASC);
CREATE UNIQUE INDEX "idx_operator_approvals_cursor_id" ON "operator_approvals" (("cursor_id") ASC);
CREATE UNIQUE INDEX "idx_operator_approvals_resolution_ref" ON "operator_approvals" (("resolution_ref") ASC);
CREATE INDEX "idx_operator_approvals_resolved" ON "operator_approvals" (("resolved_at_ms") ASC, ("approval_id") ASC) WHERE "resolved_at_ms" IS NOT NULL;
CREATE INDEX "idx_operator_approvals_runtime_pending" ON "operator_approvals" (("runtime_epoch") ASC, ("approval_id") ASC) WHERE ("status" = 'pending');
CREATE INDEX "idx_operator_approvals_source_run_resolved" ON "operator_approvals" (("source_run_id") ASC, ("resolved_at_ms") ASC, ("approval_id") ASC) WHERE "source_run_id" IS NOT NULL AND "resolved_at_ms" IS NOT NULL;
CREATE INDEX "idx_operator_approvals_source_session_created" ON "operator_approvals" (("source_session_key") ASC NULLS FIRST, ("created_at_ms") DESC, ("approval_id") ASC);
CREATE INDEX "idx_operator_approvals_status_expiry" ON "operator_approvals" (("status") ASC, ("expires_at_ms") ASC, ("approval_id") ASC);
CREATE INDEX "idx_plugin_binding_approvals_plugin" ON "plugin_binding_approvals" (("plugin_id") ASC, ("approved_at") DESC);
CREATE INDEX "idx_plugin_blob_expiry" ON "plugin_blob_entries" (("expires_at") ASC) WHERE "expires_at" IS NOT NULL;
CREATE INDEX "idx_plugin_blob_listing" ON "plugin_blob_entries" (("plugin_id") ASC, ("namespace") ASC, ("created_at") ASC, ("entry_key") ASC);
CREATE INDEX "idx_plugin_state_expiry" ON "plugin_state_entries" (("expires_at") ASC) WHERE "expires_at" IS NOT NULL;
CREATE INDEX "idx_plugin_state_listing" ON "plugin_state_entries" (("plugin_id") ASC, ("namespace") ASC, ("created_at") ASC, ("entry_key") ASC, ("expires_at") ASC NULLS FIRST);
CREATE INDEX "idx_sandbox_registry_last_used" ON "sandbox_registry_entries" (("registry_kind") ASC, ("last_used_at_ms") DESC, ("container_name") ASC) WHERE "last_used_at_ms" IS NOT NULL;
CREATE INDEX "idx_sandbox_registry_session" ON "sandbox_registry_entries" (("registry_kind") ASC, ("session_key") ASC, ("last_used_at_ms") DESC NULLS LAST, ("container_name") ASC) WHERE "session_key" IS NOT NULL;
CREATE INDEX "idx_sandbox_registry_updated" ON "sandbox_registry_entries" (("registry_kind") ASC, ("updated_at") DESC, ("container_name") ASC);
CREATE INDEX "idx_session_state_events_session_sequence" ON "session_state_events" (("session_key") ASC, ("sequence") DESC);
CREATE INDEX "idx_session_state_events_time" ON "session_state_events" (("occurred_at") DESC, ("sequence") DESC);
CREATE INDEX "idx_session_upstream_links_catalog_id" ON "session_upstream_links" (("catalog_id") ASC);
CREATE INDEX "idx_session_watch_cursors_target" ON "session_watch_cursors" (("target_session_key") ASC);
CREATE INDEX "idx_skill_uploads_expiry" ON "skill_uploads" (("expires_at") ASC);
CREATE INDEX "idx_skill_uploads_idempotency" ON "skill_uploads" (("idempotency_key_hash") ASC) WHERE "idempotency_key_hash" IS NOT NULL;
CREATE INDEX "idx_state_leases_expiry" ON "state_leases" (("expires_at") ASC, ("scope") ASC, ("lease_key") ASC) WHERE "expires_at" IS NOT NULL;
CREATE INDEX "idx_state_leases_owner" ON "state_leases" (("owner") ASC);
CREATE INDEX "idx_subagent_runs_child_session_key" ON "subagent_runs" (("child_session_key") ASC, ("created_at") DESC, ("run_id") ASC);
CREATE INDEX "idx_subagent_runs_controller_session_key" ON "subagent_runs" (("controller_session_key") ASC NULLS FIRST, ("created_at") DESC, ("run_id") ASC);
CREATE INDEX "idx_subagent_runs_requester_session_key" ON "subagent_runs" (("requester_session_key") ASC, ("created_at") DESC, ("run_id") ASC);
CREATE INDEX "idx_task_runs_cron_runtime_order" ON "task_runs" (("runtime") ASC, ("created_at") ASC, ("task_id") ASC) WHERE ("runtime" = 'cron');
CREATE INDEX "idx_task_runs_cron_source_order" ON "task_runs" (("source_id") ASC NULLS FIRST, ("created_at") ASC, ("task_id") ASC) WHERE ("runtime" = 'cron');
CREATE INDEX "idx_task_runs_runtime_run" ON "task_runs" (("runtime") ASC, ("run_id") ASC NULLS FIRST, ("source_id") ASC NULLS FIRST, ("created_at") ASC, ("task_id") ASC);
CREATE INDEX "idx_web_push_subscriptions_updated" ON "web_push_subscriptions" (("updated_at_ms") DESC, ("subscription_id") ASC);
CREATE UNIQUE INDEX "idx_worker_environments_provider_lease" ON "worker_environments" (("provider_id") ASC, ("lease_id") ASC) WHERE "lease_id" IS NOT NULL;
CREATE INDEX "idx_worker_environments_terminal_changed" ON "worker_environments" (("state_changed_at_ms") ASC, ("environment_id") ASC);
CREATE UNIQUE INDEX "idx_worker_inference_turns_pending_run" ON "worker_inference_turns" (("session_id") ASC, ("run_epoch") ASC, ("run_id") ASC) WHERE ("state" = 'pending');
CREATE INDEX "idx_worker_session_placements_environment" ON "worker_session_placements" (("environment_id") ASC) WHERE "environment_id" IS NOT NULL;
CREATE INDEX "idx_worker_session_placements_reconcile" ON "worker_session_placements" (("updated_at_ms") ASC, ("session_id") ASC);
CREATE INDEX "idx_worker_session_placements_session_key" ON "worker_session_placements" (("agent_id") ASC, ("session_key") ASC);
CREATE INDEX "idx_workspace_path_aliases_workspace" ON "workspace_path_aliases" (("workspace_key") ASC);
CREATE INDEX "idx_workspace_setup_state_path" ON "workspace_setup_state" (("workspace_path") ASC NULLS FIRST);
CREATE INDEX "idx_worktrees_removed_at" ON "worktrees" (("removed_at") ASC NULLS FIRST);
CREATE INDEX "idx_worktrees_repo_fingerprint" ON "worktrees" (("repo_fingerprint") ASC);
ALTER TABLE "acp_replay_events" ADD FOREIGN KEY ("session_id") REFERENCES "acp_replay_sessions" ("session_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "capture_events" ADD FOREIGN KEY ("data_blob_id") REFERENCES "capture_blobs" ("blob_id") ON UPDATE NO ACTION ON DELETE SET NULL NOT DEFERRABLE;
ALTER TABLE "capture_events" ADD FOREIGN KEY ("session_id") REFERENCES "capture_sessions" ("id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "meeting_transcript_summaries" ADD FOREIGN KEY ("session_id", "session_started_at") REFERENCES "meeting_transcript_sessions" ("session_id", "started_at") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "meeting_transcript_utterances" ADD FOREIGN KEY ("session_id", "session_started_at") REFERENCES "meeting_transcript_sessions" ("session_id", "started_at") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "migration_sources" ADD FOREIGN KEY ("last_run_id") REFERENCES "migration_runs" ("id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "skill_upload_chunks" ADD FOREIGN KEY ("upload_id") REFERENCES "skill_uploads" ("upload_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "task_delivery_state" ADD FOREIGN KEY ("task_id") REFERENCES "task_runs" ("task_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "worker_environment_credentials" ADD FOREIGN KEY ("environment_id") REFERENCES "worker_environments" ("environment_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "worker_inference_turns" ADD FOREIGN KEY ("environment_id") REFERENCES "worker_environments" ("environment_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "worker_session_tool_operations" ADD FOREIGN KEY ("source_session_id") REFERENCES "worker_session_placements" ("session_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "worker_transcript_commits" ADD FOREIGN KEY ("session_id", "run_epoch") REFERENCES "worker_transcript_commit_heads" ("session_id", "run_epoch") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "worker_turn_tool_authorities" ADD FOREIGN KEY ("session_id") REFERENCES "worker_session_placements" ("session_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "worker_workspace_pending_results" ADD FOREIGN KEY ("session_id") REFERENCES "worker_session_placements" ("session_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "worker_workspace_reconciliations" ADD FOREIGN KEY ("session_id") REFERENCES "worker_session_placements" ("session_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "workspace_generated_bootstrap_hashes" ADD FOREIGN KEY ("workspace_key") REFERENCES "workspace_setup_state" ("workspace_key") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`;return Object.defineProperty(this,"eagerSql",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get operatorRecoveryV25Sql(){let e=`-- Generated v24-to-v25 metadata-only transition; the engine owner publishes openclaw_schema_meta.
-- Subagent operator recovery requires the new reader; catalog and retained rows are unchanged.
UPDATE schema_meta SET schema_version = 25 WHERE meta_key = 'primary' AND schema_version = 24;
UPDATE config_machine_state SET value_json = '25' WHERE state_key = 'state.schema.contentVersion' AND value_json = '24';
`;return Object.defineProperty(this,"operatorRecoveryV25Sql",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get preWriteIndexesV27Sql(){let e={acp_replay_events:`CREATE INDEX "idx_acp_replay_events_session_seq" ON "acp_replay_events" (("session_id") ASC NULLS FIRST, ("seq") ASC NULLS FIRST);`,skill_usage:`CREATE INDEX "idx_skill_usage_key" ON "skill_usage" (("skill_key") ASC NULLS FIRST, ("skill_file") ASC NULLS FIRST);`,state_leases:`CREATE INDEX "idx_state_leases_owner" ON "state_leases" (("owner") ASC NULLS FIRST, ("updated_at") DESC NULLS LAST);`};return Object.defineProperty(this,"preWriteIndexesV27Sql",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get writeIndexesV27Sql(){let e=`
DROP INDEX IF EXISTS idx_acp_replay_events_session_seq;
DROP INDEX IF EXISTS idx_skill_usage_key;
DROP INDEX IF EXISTS idx_state_leases_owner;
CREATE INDEX "idx_state_leases_owner" ON "state_leases" (("owner") ASC NULLS FIRST);`;return Object.defineProperty(this,"writeIndexesV27Sql",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get clientCredentialV29Sql(){let e=`-- Generated v28-to-v29 publication after the local credential owner has verified and retired source rows.
UPDATE schema_meta SET schema_version = 29 WHERE meta_key = 'primary' AND schema_version = 28;
`;return Object.defineProperty(this,"clientCredentialV29Sql",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get workspaceCasV35Sql(){let e=`-- Generated DDL-only v34-to-v35 transition; reconciliation converts retained rows online.
DO $workspace_cas$ BEGIN
IF to_regclass('local_workspace_projections') IS NOT NULL THEN
ALTER TABLE "local_workspace_projections" ADD COLUMN "tree_root_digest" bytea;
ALTER TABLE "local_workspace_projections" ADD COLUMN "source_paths_digest" bytea;
ALTER TABLE "local_workspace_projections" ADD COLUMN "canonical_fingerprints" bytea;
ALTER TABLE "local_workspace_projections" ADD COLUMN "projection_fingerprints" bytea;
CREATE TABLE "local_workspace_source_path_sets" (
"path_digest" bytea NOT NULL,
"paths_zstd" bytea NOT NULL,
"sweep_epoch" bigint NOT NULL,
PRIMARY KEY ("path_digest"),
CHECK ((octet_length("path_digest") = 32))
);
CREATE TABLE "local_workspace_tree_packs" (
"tree_digest" bytea NOT NULL,
"records_json" text COLLATE "C" NOT NULL,
"children_json" text COLLATE "C" NOT NULL,
"sweep_epoch" bigint NOT NULL,
PRIMARY KEY ("tree_digest"),
CHECK ((octet_length("tree_digest") = 32))
);
END IF; END $workspace_cas$;
`;return Object.defineProperty(this,"workspaceCasV35Sql",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get clientCredentialSource(){let e={sql:`CREATE TABLE "device_auth_tokens" (
"device_id" text COLLATE "C" NOT NULL,
"role" text COLLATE "C" NOT NULL,
"token" text COLLATE "C" NOT NULL,
"scopes_json" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("device_id", "role")
);
CREATE TABLE "device_identities" (
"identity_key" text COLLATE "C" NOT NULL,
"device_id" text COLLATE "C" NOT NULL,
"public_key_pem" text COLLATE "C" NOT NULL,
"private_key_pem" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("identity_key")
);
CREATE TABLE "gateway_origin_device_tokens" (
"gateway_scope" text COLLATE "C" NOT NULL,
"device_id" text COLLATE "C" NOT NULL,
"role" text COLLATE "C" NOT NULL,
"token" text COLLATE "C" NOT NULL,
"scopes_json" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("gateway_scope", "device_id", "role")
);
CREATE INDEX "idx_device_auth_tokens_updated" ON "device_auth_tokens" (("updated_at_ms") DESC NULLS LAST, ("device_id") ASC NULLS FIRST, ("role") ASC NULLS FIRST);
CREATE INDEX "idx_device_identities_device" ON "device_identities" (("device_id") ASC NULLS FIRST, ("updated_at_ms") DESC NULLS LAST);`,preData:[0,926],postData:[926,1225],tables:[{name:`device_auth_tokens`,identities:[]},{name:`device_identities`,identities:[]},{name:`gateway_origin_device_tokens`,identities:[]}],expectedCatalog:[{table:`device_auth_tokens`,kind:`table`,value:null},{table:`device_auth_tokens`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`device_auth_tokens`,kind:`column`,value:{name:`role`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`device_auth_tokens`,kind:`column`,value:{name:`token`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`device_auth_tokens`,kind:`column`,value:{name:`scopes_json`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`device_auth_tokens`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`device_auth_tokens`,kind:`primaryKey`,value:[`device_id`,`role`]},{table:`device_auth_tokens`,kind:`indexes`,value:2},{table:`device_auth_tokens`,kind:`checks`,value:0},{table:`device_identities`,kind:`table`,value:null},{table:`device_identities`,kind:`column`,value:{name:`identity_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`device_identities`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`device_identities`,kind:`column`,value:{name:`public_key_pem`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`device_identities`,kind:`column`,value:{name:`private_key_pem`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`device_identities`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`device_identities`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`device_identities`,kind:`primaryKey`,value:[`identity_key`]},{table:`device_identities`,kind:`indexes`,value:2},{table:`device_identities`,kind:`checks`,value:0},{table:`gateway_origin_device_tokens`,kind:`table`,value:null},{table:`gateway_origin_device_tokens`,kind:`column`,value:{name:`gateway_scope`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`gateway_origin_device_tokens`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`gateway_origin_device_tokens`,kind:`column`,value:{name:`role`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`gateway_origin_device_tokens`,kind:`column`,value:{name:`token`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`gateway_origin_device_tokens`,kind:`column`,value:{name:`scopes_json`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`gateway_origin_device_tokens`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`gateway_origin_device_tokens`,kind:`primaryKey`,value:[`gateway_scope`,`device_id`,`role`]},{table:`gateway_origin_device_tokens`,kind:`indexes`,value:1},{table:`gateway_origin_device_tokens`,kind:`checks`,value:0}]};return Object.defineProperty(this,"clientCredentialSource",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get fragments(){let e=[{id:`local_workspace_projections`,tables:[`local_workspace_projections`,`local_workspace_manifest_nodes`,`local_workspace_tree_packs`,`local_workspace_source_path_sets`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "local_workspace_manifest_nodes" (
"worktree_id" text COLLATE "C" NOT NULL,
"path" text COLLATE "C" NOT NULL,
"node_json" text COLLATE "C" NOT NULL,
PRIMARY KEY ("worktree_id", "path")
);
CREATE TABLE "local_workspace_projections" (
"worktree_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C" NOT NULL,
"lifecycle_revision" text COLLATE "C",
"projection_path" text COLLATE "C" NOT NULL,
"base_commit" text COLLATE "C" NOT NULL,
"source_paths_json" text COLLATE "C" NOT NULL,
"baseline_json" text COLLATE "C",
"baseline_ref" text COLLATE "C",
"pending_ref" text COLLATE "C",
"pending_target" text COLLATE "C",
"paused_runtimes_json" text COLLATE "C",
"journal_json" text COLLATE "C",
"journal_pack" bytea,
"revision" bigint NOT NULL DEFAULT 0,
"created_at_ms" bigint NOT NULL,
"checkpoint_json" text COLLATE "C",
"tree_root_digest" bytea,
"source_paths_digest" bytea,
"canonical_fingerprints" bytea,
"projection_fingerprints" bytea,
PRIMARY KEY ("worktree_id"),
CHECK (("pending_target" IN ('canonical', 'projection'))),
CHECK ("journal_pack" IS NULL OR (octet_length("journal_pack") <= 268435456)),
CHECK (("revision" >= 0)),
CHECK ("baseline_json" IS NULL OR "baseline_ref" IS NOT NULL),
CHECK ((("journal_json" IS NULL) = ("journal_pack" IS NULL))),
UNIQUE ("projection_path")
);
CREATE TABLE "local_workspace_source_path_sets" (
"path_digest" bytea NOT NULL,
"paths_zstd" bytea NOT NULL,
"sweep_epoch" bigint NOT NULL,
PRIMARY KEY ("path_digest"),
CHECK ((octet_length("path_digest") = 32))
);
CREATE TABLE "local_workspace_tree_packs" (
"tree_digest" bytea NOT NULL,
"records_json" text COLLATE "C" NOT NULL,
"children_json" text COLLATE "C" NOT NULL,
"sweep_epoch" bigint NOT NULL,
PRIMARY KEY ("tree_digest"),
CHECK ((octet_length("tree_digest") = 32))
);
ALTER TABLE "local_workspace_manifest_nodes" ADD FOREIGN KEY ("worktree_id") REFERENCES "local_workspace_projections" ("worktree_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`user_profiles`,tables:[`user_profiles`,`user_profile_emails`,`user_profile_identities`],indexes:[`idx_user_profile_emails_profile_id`,`idx_user_profile_identities_profile_id`,`idx_user_profile_identities_authorization`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "user_profile_emails" (
"email" text COLLATE "C" NOT NULL,
"profile_id" text COLLATE "C" NOT NULL,
"binding_id" text COLLATE "C",
"created_at" bigint NOT NULL,
PRIMARY KEY ("email")
);
CREATE TABLE "user_profile_identities" (
"provider" text COLLATE "C" NOT NULL,
"subject" text COLLATE "C" NOT NULL,
"profile_id" text COLLATE "C" NOT NULL,
"canonical_login" text COLLATE "C",
"verified_email_json" text COLLATE "C",
"created_at" bigint NOT NULL,
"authorization_id" text COLLATE "C",
"authorization_basis_json" text COLLATE "C",
PRIMARY KEY ("provider", "subject")
);
CREATE TABLE "user_profiles" (
"id" text COLLATE "C" NOT NULL,
"display_name" text COLLATE "C",
"primary_github_account_id" bigint,
"avatar" bytea,
"avatar_mime" text COLLATE "C",
"avatar_sha256" text COLLATE "C",
"merged_into" text COLLATE "C",
"role" text COLLATE "C",
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX "idx_user_profile_emails_profile_id" ON "user_profile_emails" (("profile_id") ASC);
CREATE UNIQUE INDEX "idx_user_profile_identities_authorization" ON "user_profile_identities" (("authorization_id") ASC NULLS FIRST);
CREATE INDEX "idx_user_profile_identities_profile_id" ON "user_profile_identities" (("profile_id") ASC);
`},{id:`skill_library_entries`,tables:[`skill_library_entries`,`skill_library_revisions`,`skill_library_events`,`skill_library_uploads`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "skill_library_entries" (
"skill_id" text COLLATE "C" NOT NULL,
"owner_profile_id" text COLLATE "C",
"author_profile_id" text COLLATE "C" NOT NULL,
"slug" text COLLATE "C" NOT NULL,
"current_revision" text COLLATE "C" NOT NULL,
"shared" bigint NOT NULL,
"enabled" bigint NOT NULL,
"removed" bigint NOT NULL,
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL,
PRIMARY KEY ("skill_id")
);
CREATE TABLE "skill_library_events" (
"event_id" text COLLATE "C" NOT NULL,
"skill_id" text COLLATE "C" NOT NULL,
"revision" text COLLATE "C" NOT NULL,
"action" text COLLATE "C" NOT NULL,
"actor_profile_id" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
PRIMARY KEY ("event_id")
);
CREATE TABLE "skill_library_revisions" (
"skill_id" text COLLATE "C" NOT NULL,
"revision" text COLLATE "C" NOT NULL,
"description" text COLLATE "C" NOT NULL,
"files_json" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
PRIMARY KEY ("skill_id", "revision")
);
CREATE TABLE "skill_library_uploads" (
"upload_id" text COLLATE "C" NOT NULL,
"owner_profile_id" text COLLATE "C" NOT NULL,
"slug" text COLLATE "C" NOT NULL,
"size_bytes" bigint NOT NULL,
"sha256" text COLLATE "C" NOT NULL,
"archive_blob" bytea NOT NULL,
"expires_at" bigint NOT NULL,
"published_skill_id" text COLLATE "C",
PRIMARY KEY ("upload_id")
);
`},{id:`operator_approval_standing_grants`,tables:[`operator_approval_standing_grants`,`operator_approval_standing_grant_generations`],indexes:[`idx_operator_approval_standing_grants_binding`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "operator_approval_standing_grant_generations" (
"grant_id" text COLLATE "C" NOT NULL,
"job_definition_generation" bigint NOT NULL,
PRIMARY KEY ("grant_id"),
CHECK (("job_definition_generation" >= 1))
);
CREATE TABLE "operator_approval_standing_grants" (
"grant_id" text COLLATE "C" NOT NULL,
"minted_by_approval_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"cron_job_id" text COLLATE "C" NOT NULL,
"job_config_revision" text COLLATE "C" NOT NULL,
"operation_binding" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"expires_at_ms" bigint,
"revoked_at_ms" bigint,
"revoked_by" text COLLATE "C",
"last_used_at_ms" bigint,
"use_count" bigint NOT NULL DEFAULT 0,
PRIMARY KEY ("grant_id"),
CHECK ((char_length("grant_id") > 0)),
CHECK ((char_length("agent_id") > 0)),
CHECK ((char_length("cron_job_id") > 0)),
CHECK ((char_length("job_config_revision") > 0)),
CHECK ((char_length("operation_binding") > 0)),
CHECK ("expires_at_ms" IS NULL OR ("expires_at_ms" >= "created_at_ms"))
);
CREATE INDEX "idx_operator_approval_standing_grants_binding" ON "operator_approval_standing_grants" (("agent_id") ASC, ("cron_job_id") ASC, ("operation_binding") ASC, ("created_at_ms") DESC);
ALTER TABLE "operator_approval_standing_grant_generations" ADD FOREIGN KEY ("grant_id") REFERENCES "operator_approval_standing_grants" ("grant_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "operator_approval_standing_grants" ADD FOREIGN KEY ("minted_by_approval_id") REFERENCES "operator_approvals" ("approval_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`worker_environment_session_attachments`,tables:[`worker_environment_session_attachments`],indexes:[`worker_environment_session_attachments_session_key`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "worker_environment_session_attachments" (
"session_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"session_lifecycle_revision" text COLLATE "C",
"environment_id" text COLLATE "C" NOT NULL,
"generation" bigint NOT NULL,
"created_at_ms" bigint NOT NULL,
"last_used_at_ms" bigint NOT NULL,
"closed_at_ms" bigint,
PRIMARY KEY ("session_id"),
CHECK (("generation" >= 1)),
UNIQUE ("environment_id")
);
CREATE INDEX "worker_environment_session_attachments_session_key" ON "worker_environment_session_attachments" (("agent_id") ASC, ("session_key") ASC);
ALTER TABLE "worker_environment_session_attachments" ADD FOREIGN KEY ("environment_id") REFERENCES "worker_environments" ("environment_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`durable_background_processes`,tables:[`durable_background_processes`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "durable_background_processes" (
"id" text COLLATE "C" NOT NULL,
"record_json" text COLLATE "C" NOT NULL,
PRIMARY KEY ("id")
);
`},{id:`sandbox_persistent_execs`,tables:[`sandbox_persistent_execs`],indexes:[`idx_sandbox_persistent_execs_container`,`idx_sandbox_persistent_execs_container_name`,`idx_sandbox_persistent_execs_source`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "sandbox_persistent_execs" (
"owner_key" text COLLATE "C" NOT NULL,
"source_identity" text COLLATE "C" NOT NULL,
"attempt_id" text COLLATE "C" NOT NULL,
"owner_json" text COLLATE "C" NOT NULL,
"backend_id" text COLLATE "C" NOT NULL,
"backend_target_json" text COLLATE "C" NOT NULL,
"workspace_binding_json" text COLLATE "C" NOT NULL,
"container_id" text COLLATE "C" NOT NULL,
"container_name" text COLLATE "C" NOT NULL,
"container_started_at" text COLLATE "C" NOT NULL,
"revision" bigint NOT NULL,
"phase" text COLLATE "C" NOT NULL,
"receipt_json" text COLLATE "C",
"error" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("owner_key"),
CHECK (("backend_id" = 'docker')),
CHECK (("revision" > 0)),
CHECK (("phase" IN ('reserved', 'prepared', 'running', 'stopping', 'uncertain', 'stopped'))),
CHECK (("phase" NOT IN ('prepared', 'running')) OR "receipt_json" IS NOT NULL),
UNIQUE ("attempt_id")
);
CREATE INDEX "idx_sandbox_persistent_execs_container" ON "sandbox_persistent_execs" (("container_id") ASC, ("owner_key") ASC);
CREATE INDEX "idx_sandbox_persistent_execs_container_name" ON "sandbox_persistent_execs" (("container_name") ASC, ("owner_key") ASC);
CREATE INDEX "idx_sandbox_persistent_execs_source" ON "sandbox_persistent_execs" (("source_identity") ASC, ("owner_key") ASC);
`},{id:`user_background_images`,tables:[`user_background_images`],indexes:[],dependencies:[`user_profiles`],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "user_background_images" (
"profile_id" text COLLATE "C" NOT NULL,
"asset_id" text COLLATE "C" NOT NULL,
"image" bytea NOT NULL,
"width" bigint NOT NULL,
"height" bigint NOT NULL,
PRIMARY KEY ("profile_id"),
CHECK ((octet_length("image") BETWEEN 1 AND 2097152)),
CHECK (("width" BETWEEN 1 AND 2560)),
CHECK (("height" BETWEEN 1 AND 2560)),
UNIQUE ("asset_id")
);
ALTER TABLE "user_background_images" ADD FOREIGN KEY ("profile_id") REFERENCES "user_profiles" ("id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`update_runs`,tables:[`update_runs`],indexes:[`idx_update_runs_created`,`idx_update_runs_active`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "update_runs" (
"run_id" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"trigger" text COLLATE "C" NOT NULL,
"phase" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"reason" text COLLATE "C",
"origin_json" text COLLATE "C" NOT NULL,
"target_json" text COLLATE "C" NOT NULL,
"before_json" text COLLATE "C" NOT NULL,
"after_json" text COLLATE "C" NOT NULL,
"steps_json" text COLLATE "C" NOT NULL,
"verification_json" text COLLATE "C" NOT NULL,
"repair_json" text COLLATE "C" NOT NULL,
"confirmed_at_ms" bigint,
"finished_at_ms" bigint,
"downtime_ms" bigint,
PRIMARY KEY ("run_id"),
CHECK (("trigger" IN ('chat', 'control-ui', 'cli', 'campaign', 'mac-app', 'api'))),
CHECK (("phase" IN ('requested', 'staging', 'validating', 'repairing', 'activating', 'restarting', 'verifying', 'finished'))),
CHECK (("status" IN ('running', 'succeeded', 'failed', 'rolled-back', 'skipped'))),
CHECK ((octet_length(convert_to("origin_json", 'UTF8')) <= 16384)),
CHECK ((octet_length(convert_to("target_json", 'UTF8')) <= 16384)),
CHECK ((octet_length(convert_to("before_json", 'UTF8')) <= 16384)),
CHECK ((octet_length(convert_to("after_json", 'UTF8')) <= 16384)),
CHECK ((octet_length(convert_to("steps_json", 'UTF8')) <= 16384)),
CHECK ((octet_length(convert_to("verification_json", 'UTF8')) <= 16384)),
CHECK ((octet_length(convert_to("repair_json", 'UTF8')) <= 16384)),
CHECK ((("status" = 'running') AND ("phase" != 'finished') AND "finished_at_ms" IS NULL) OR (("status" != 'running') AND ("phase" = 'finished') AND "finished_at_ms" IS NOT NULL))
);
CREATE INDEX "idx_update_runs_active" ON "update_runs" (("status") ASC, ("created_at_ms") DESC, ("run_id") ASC);
CREATE INDEX "idx_update_runs_created" ON "update_runs" (("created_at_ms") DESC, ("run_id") ASC);
`},{id:`session_repository_workspaces`,tables:[`session_repository_workspaces`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "session_repository_workspaces" (
"workspace_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"url" text COLLATE "C" NOT NULL,
"requested_ref" text COLLATE "C",
"run_setup_script" bigint NOT NULL DEFAULT 0,
"base_commit" text COLLATE "C",
"base_manifest_hash" text COLLATE "C",
"branch" text COLLATE "C" NOT NULL,
"checkpoint_ref" text COLLATE "C",
"manifest_hash" text COLLATE "C",
"revision" bigint NOT NULL,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"disk_authority_json" text COLLATE "C",
PRIMARY KEY ("workspace_id"),
CHECK ((char_length("workspace_id") = 36)),
CHECK ((char_length("agent_id") BETWEEN 1 AND 128)),
CHECK ((char_length("session_key") BETWEEN 1 AND 1024)),
CHECK ((char_length("url") BETWEEN 1 AND 4096)),
CHECK ("requested_ref" IS NULL OR (char_length("requested_ref") BETWEEN 1 AND 1024)),
CHECK (("run_setup_script" IN (0, 1))),
CHECK ("base_commit" IS NULL OR (char_length("base_commit") IN (40, 64))),
CHECK ((char_length("branch") BETWEEN 1 AND 256)),
CHECK (("revision" >= 0)),
CHECK ("base_manifest_hash" IS NULL OR "base_commit" IS NOT NULL),
CHECK (("checkpoint_ref" IS NULL AND "manifest_hash" IS NULL) OR ("checkpoint_ref" IS NOT NULL AND "manifest_hash" IS NOT NULL AND "base_manifest_hash" IS NOT NULL)),
UNIQUE ("agent_id", "session_key")
);
`},{id:`github_repository_publication_requests`,tables:[`github_repository_publication_requests`],indexes:[`idx_github_repository_publication_shared_request`,`idx_github_repository_publication_personal_request`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "github_repository_publication_requests" (
"request_id" text COLLATE "C" NOT NULL,
"owner_profile_id" text COLLATE "C",
"connection_generation" text COLLATE "C",
"idempotency_key" text COLLATE "C" NOT NULL,
"request_digest" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C" NOT NULL,
"session_lifecycle_revision" text COLLATE "C",
"requester_authority_json" text COLLATE "C",
"session_key" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"workspace_id" text COLLATE "C" NOT NULL,
"checkpoint_ref" text COLLATE "C",
"checkpoint_digest" text COLLATE "C",
"claim_id" text COLLATE "C",
"run_id" text COLLATE "C",
"environment_id" text COLLATE "C",
"owner_epoch" bigint,
"placement_generation" bigint,
"identity_source" text COLLATE "C" NOT NULL,
"identity_profile_id" text COLLATE "C",
"identity_account_id" bigint NOT NULL,
"identity_login" text COLLATE "C" NOT NULL,
"title" text COLLATE "C",
"body" text COLLATE "C",
"status" text COLLATE "C" NOT NULL,
"gateway_instance_id" text COLLATE "C",
"execution_id" text COLLATE "C",
"last_effect" text COLLATE "C",
"effect_state" text COLLATE "C",
"push_repository" text COLLATE "C",
"repository" text COLLATE "C",
"branch" text COLLATE "C" NOT NULL,
"base_branch" text COLLATE "C",
"source_head_commit" text COLLATE "C",
"source_index_tree" text COLLATE "C",
"workspace_tree" text COLLATE "C",
"previous_head_commit" text COLLATE "C",
"pushed_head_commit" text COLLATE "C",
"head_commit" text COLLATE "C",
"pull_request_url" text COLLATE "C",
"error_code" text COLLATE "C",
"next_action" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"reported_at_ms" bigint,
"draft" bigint,
PRIMARY KEY ("request_id"),
CHECK (("identity_source" IN ('system-detected', 'system-configured', 'agent-override', 'personal'))),
CHECK (("status" IN ('requested', 'publishing', 'needs_confirmation', 'published', 'failed'))),
CHECK (("last_effect" IN ('push', 'pull_request'))),
CHECK (("effect_state" IN ('dispatched', 'observed'))),
CHECK ((("identity_source" = 'personal') AND "owner_profile_id" IS NOT NULL AND "connection_generation" IS NOT NULL) OR (("identity_source" <> 'personal') AND "owner_profile_id" IS NULL AND "connection_generation" IS NULL)),
CHECK (("checkpoint_ref" IS NULL AND "checkpoint_digest" IS NULL) OR ("checkpoint_ref" IS NOT NULL AND "checkpoint_digest" IS NOT NULL)),
CHECK (("last_effect" IS NULL AND "effect_state" IS NULL) OR ("last_effect" IS NOT NULL AND "effect_state" IS NOT NULL))
);
CREATE UNIQUE INDEX "idx_github_repository_publication_personal_request" ON "github_repository_publication_requests" (("owner_profile_id") ASC, ("session_id") ASC, ("idempotency_key") ASC) WHERE "owner_profile_id" IS NOT NULL;
CREATE UNIQUE INDEX "idx_github_repository_publication_shared_request" ON "github_repository_publication_requests" (("session_id") ASC, ("idempotency_key") ASC) WHERE "owner_profile_id" IS NULL;
`},{id:`github_publication_session_lifecycles`,tables:[`github_publication_session_lifecycles`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "github_publication_session_lifecycles" (
"publication_kind" text COLLATE "C" NOT NULL,
"request_id" text COLLATE "C" NOT NULL,
"lifecycle_revision" text COLLATE "C",
"requester_authority_json" text COLLATE "C",
PRIMARY KEY ("publication_kind", "request_id"),
CHECK (("publication_kind" IN ('shared', 'personal')))
);
`},{id:`github_personal_publication_requests`,tables:[`github_personal_publication_requests`],indexes:[`idx_github_personal_publication_owner_session`,`idx_github_personal_publication_pending`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "github_personal_publication_requests" (
"request_id" text COLLATE "C" NOT NULL,
"owner_profile_id" text COLLATE "C" NOT NULL,
"connection_generation" text COLLATE "C" NOT NULL,
"idempotency_key" text COLLATE "C" NOT NULL,
"request_digest" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"worktree_id" text COLLATE "C" NOT NULL,
"repository_fingerprint" text COLLATE "C" NOT NULL,
"identity_source" text COLLATE "C" NOT NULL,
"identity_profile_id" text COLLATE "C" NOT NULL,
"identity_account_id" bigint NOT NULL,
"identity_login" text COLLATE "C" NOT NULL,
"title" text COLLATE "C",
"body" text COLLATE "C",
"status" text COLLATE "C" NOT NULL,
"gateway_instance_id" text COLLATE "C",
"execution_id" text COLLATE "C",
"last_effect" text COLLATE "C",
"effect_state" text COLLATE "C",
"push_repository" text COLLATE "C" NOT NULL,
"repository" text COLLATE "C" NOT NULL,
"branch" text COLLATE "C" NOT NULL,
"base_branch" text COLLATE "C" NOT NULL,
"source_head_commit" text COLLATE "C" NOT NULL,
"source_index_tree" text COLLATE "C" NOT NULL,
"workspace_tree" text COLLATE "C" NOT NULL,
"head_commit" text COLLATE "C",
"pull_request_url" text COLLATE "C",
"error_code" text COLLATE "C",
"next_action" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"reported_at_ms" bigint,
"draft" bigint,
PRIMARY KEY ("request_id"),
CHECK ((char_length("request_id") = 36)),
CHECK ((char_length("owner_profile_id") BETWEEN 1 AND 128)),
CHECK ((char_length("connection_generation") = 36)),
CHECK ((char_length("idempotency_key") BETWEEN 1 AND 128)),
CHECK ((char_length("request_digest") = 64)),
CHECK ((char_length("session_id") BETWEEN 1 AND 128)),
CHECK ((char_length("session_key") BETWEEN 1 AND 1024)),
CHECK ((char_length("agent_id") BETWEEN 1 AND 128)),
CHECK ((char_length("worktree_id") BETWEEN 1 AND 128)),
CHECK ((char_length("repository_fingerprint") BETWEEN 1 AND 256)),
CHECK (("identity_source" = 'personal')),
CHECK ((char_length("identity_profile_id") = 36)),
CHECK (("identity_account_id" >= 1)),
CHECK ((char_length("identity_login") BETWEEN 1 AND 39)),
CHECK ("title" IS NULL OR (char_length("title") BETWEEN 1 AND 256)),
CHECK ("body" IS NULL OR (char_length("body") BETWEEN 1 AND 8192)),
CHECK (("status" IN ('requested', 'publishing', 'needs_confirmation', 'published', 'failed'))),
CHECK ("gateway_instance_id" IS NULL OR (char_length("gateway_instance_id") BETWEEN 1 AND 128)),
CHECK ("execution_id" IS NULL OR (char_length("execution_id") = 36)),
CHECK ("last_effect" IS NULL OR ("last_effect" IN ('push', 'pull_request'))),
CHECK ("effect_state" IS NULL OR ("effect_state" IN ('dispatched', 'observed'))),
CHECK ((char_length("push_repository") BETWEEN 3 AND 256)),
CHECK ((char_length("repository") BETWEEN 3 AND 256)),
CHECK ((char_length("branch") BETWEEN 1 AND 256)),
CHECK ((char_length("base_branch") BETWEEN 1 AND 256)),
CHECK ((char_length("source_head_commit") IN (40, 64))),
CHECK ((char_length("source_index_tree") IN (40, 64))),
CHECK ((char_length("workspace_tree") IN (40, 64))),
CHECK ("head_commit" IS NULL OR (char_length("head_commit") IN (40, 64))),
CHECK ("pull_request_url" IS NULL OR (char_length("pull_request_url") BETWEEN 1 AND 2048)),
CHECK ("error_code" IS NULL OR (char_length("error_code") BETWEEN 1 AND 64)),
CHECK ("next_action" IS NULL OR (char_length("next_action") BETWEEN 1 AND 1024)),
CHECK (("created_at_ms" >= 0)),
CHECK (("updated_at_ms" >= "created_at_ms")),
CHECK ((("status" = 'publishing') AND "gateway_instance_id" IS NOT NULL AND "execution_id" IS NOT NULL) OR ("status" <> 'publishing')),
CHECK (("last_effect" IS NULL AND "effect_state" IS NULL) OR ("last_effect" IS NOT NULL AND "effect_state" IS NOT NULL)),
CHECK ((("status" = 'published') AND "pull_request_url" IS NOT NULL AND "head_commit" IS NOT NULL AND "error_code" IS NULL AND "next_action" IS NULL) OR (("status" = 'failed') AND "error_code" IS NOT NULL AND "next_action" IS NOT NULL) OR (("status" IN ('requested', 'publishing', 'needs_confirmation')) AND "error_code" IS NULL AND "next_action" IS NULL)),
UNIQUE ("owner_profile_id", "session_id", "idempotency_key")
);
CREATE INDEX "idx_github_personal_publication_owner_session" ON "github_personal_publication_requests" (("owner_profile_id") ASC, ("session_id") ASC, ("created_at_ms") ASC);
CREATE INDEX "idx_github_personal_publication_pending" ON "github_personal_publication_requests" (("status") ASC, ("updated_at_ms") ASC, ("request_id") ASC);
`},{id:`cron_job_runtime_authorities`,tables:[`cron_job_runtime_authorities`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "cron_job_runtime_authorities" (
"store_key" text COLLATE "C" NOT NULL,
"job_id" text COLLATE "C" NOT NULL,
"authority_json" text COLLATE "C",
"authority_input_fingerprint" text COLLATE "C",
"recovery_required" bigint NOT NULL,
PRIMARY KEY ("store_key", "job_id"),
CHECK (("recovery_required" IN (0, 1))),
CHECK ((("recovery_required" = 0) AND "authority_json" IS NOT NULL AND "authority_input_fingerprint" IS NOT NULL) OR (("recovery_required" = 1) AND "authority_json" IS NULL AND "authority_input_fingerprint" IS NULL))
);
ALTER TABLE "cron_job_runtime_authorities" ADD FOREIGN KEY ("store_key", "job_id") REFERENCES "cron_jobs" ("store_key", "job_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`cron_run_trigger_state_retirements`,tables:[`cron_run_trigger_state_retirements`],indexes:[],dependencies:[`cron_run_receipts`],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "cron_run_trigger_state_retirements" (
"receipt_id" text COLLATE "C" NOT NULL,
PRIMARY KEY ("receipt_id")
);
ALTER TABLE "cron_run_trigger_state_retirements" ADD FOREIGN KEY ("receipt_id") REFERENCES "cron_run_receipts" ("receipt_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`execution_identity_contexts`,tables:[`execution_identity_contexts`],indexes:[`execution_identity_contexts_run_created_idx`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "execution_identity_contexts" (
"context_id" text COLLATE "C" NOT NULL,
"execution_id" text COLLATE "C" NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
"coverage_state" text COLLATE "C" NOT NULL,
"context_bytes" bigint NOT NULL,
"context_json" text COLLATE "C" NOT NULL,
PRIMARY KEY ("context_id"),
CHECK ((char_length("context_id") BETWEEN 1 AND 256)),
CHECK ((char_length("execution_id") BETWEEN 1 AND 256)),
CHECK ((char_length("run_id") BETWEEN 1 AND 256)),
CHECK (("created_at" >= 0)),
CHECK (("coverage_state" IN ('attribution-only', 'unattributed', 'unknown', 'unsupported'))),
CHECK (("context_bytes" BETWEEN 1 AND 16384)),
CHECK ((char_length("context_json") > 0)),
UNIQUE ("execution_id"),
UNIQUE ("created_at", "context_id")
);
CREATE INDEX "execution_identity_contexts_run_created_idx" ON "execution_identity_contexts" (("run_id") ASC, ("created_at") ASC, ("execution_id") ASC);
`},{id:`mcp_oauth_pending_authorizations`,tables:[`mcp_oauth_pending_authorizations`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "mcp_oauth_pending_authorizations" (
"state" text COLLATE "C" NOT NULL,
"store_key" text COLLATE "C" NOT NULL,
"create_time" bigint NOT NULL,
PRIMARY KEY ("state")
);
`},{id:`node_worker_launch_containers`,tables:[`node_worker_launch_containers`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "node_worker_launch_containers" (
"launch_id" text COLLATE "C" NOT NULL,
"container_json" text COLLATE "C",
PRIMARY KEY ("launch_id")
);
`},{id:`node_worker_launch_boots`,tables:[`node_worker_launch_boots`],indexes:[],dependencies:[`node_worker_launches`],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "node_worker_launch_boots" (
"launch_id" text COLLATE "C" NOT NULL,
"boot_id" text COLLATE "C",
PRIMARY KEY ("launch_id"),
CHECK ("boot_id" IS NULL OR (char_length("boot_id") BETWEEN 1 AND 128))
);
ALTER TABLE "node_worker_launch_boots" ADD FOREIGN KEY ("launch_id") REFERENCES "node_worker_launches" ("launch_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`node_worker_launch_cleanup`,tables:[`node_worker_launch_cleanup`],indexes:[],dependencies:[`node_worker_launches`],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "node_worker_launch_cleanup" (
"launch_id" text COLLATE "C" NOT NULL,
"cleanup_mode" text COLLATE "C" NOT NULL,
"lineage_settled" bigint,
PRIMARY KEY ("launch_id"),
CHECK (("cleanup_mode" IN ('process-group', 'owned-anchor'))),
CHECK ("lineage_settled" IS NULL OR ("lineage_settled" = 1))
);
ALTER TABLE "node_worker_launch_cleanup" ADD FOREIGN KEY ("launch_id") REFERENCES "node_worker_launches" ("launch_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`node_worker_launch_process_scopes`,tables:[`node_worker_launch_process_scopes`],indexes:[],dependencies:[`node_worker_launches`],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "node_worker_launch_process_scopes" (
"launch_id" text COLLATE "C" NOT NULL,
"scope_kind" text COLLATE "C" NOT NULL,
"descendants_reaped" bigint,
PRIMARY KEY ("launch_id"),
CHECK (("scope_kind" = 'linux-subreaper')),
CHECK ("descendants_reaped" IS NULL OR ("descendants_reaped" = 1))
);
ALTER TABLE "node_worker_launch_process_scopes" ADD FOREIGN KEY ("launch_id") REFERENCES "node_worker_launches" ("launch_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`node_worker_launches`,tables:[`node_worker_launches`],indexes:[`idx_node_worker_launches_terminal_completed`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "node_worker_launches" (
"launch_id" text COLLATE "C" NOT NULL,
"plan_hash" text COLLATE "C" NOT NULL,
"gateway_namespace" text COLLATE "C" NOT NULL,
"environment_id" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C" NOT NULL,
"owner_epoch" bigint NOT NULL,
"placement_generation" bigint NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
"state" text COLLATE "C" NOT NULL,
"supervisor_pid" bigint NOT NULL,
"supervisor_start_time" bigint NOT NULL,
"worker_pid" bigint,
"worker_start_time" bigint,
"result_json" text COLLATE "C",
"error_text" text COLLATE "C",
"completed_at_ms" bigint,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("launch_id"),
CHECK ((char_length("launch_id") BETWEEN 1 AND 256) AND ("launch_id" IS NOT NULL OR NULL)),
CHECK ((char_length("plan_hash") = 64) AND ("plan_hash" COLLATE "C" !~ '\\A.*[^0-9a-f].*\\Z')),
CHECK ((char_length("gateway_namespace") BETWEEN 1 AND 128) AND ("gateway_namespace" COLLATE "C" !~ '\\A.*[^A-Za-z0-9._-].*\\Z') AND ("gateway_namespace" COLLATE "C" ~ '\\A[A-Za-z0-9].*\\Z')),
CHECK ((char_length("environment_id") BETWEEN 1 AND 256) AND ("environment_id" IS NOT NULL OR NULL)),
CHECK ((char_length("session_id") BETWEEN 1 AND 256) AND ("session_id" IS NOT NULL OR NULL)),
CHECK (("owner_epoch" BETWEEN 1 AND 9007199254740991)),
CHECK (("placement_generation" BETWEEN 0 AND 9007199254740991)),
CHECK ((char_length("run_id") BETWEEN 1 AND 256) AND ("run_id" IS NOT NULL OR NULL)),
CHECK (("state" IN ('pending', 'running', 'completed', 'failed', 'interrupted', 'cancelled'))),
CHECK (("supervisor_pid" BETWEEN 1 AND 2147483647)),
CHECK (("supervisor_start_time" BETWEEN 0 AND 9007199254740991)),
CHECK ("worker_pid" IS NULL OR ("worker_pid" BETWEEN 1 AND 2147483647)),
CHECK ("worker_start_time" IS NULL OR ("worker_start_time" BETWEEN 0 AND 9007199254740991)),
CHECK ("result_json" IS NULL OR ((octet_length(convert_to("result_json", 'UTF8')) BETWEEN 1 AND 65536) AND ("result_json" IS NOT NULL OR NULL) AND ("result_json" IS JSON))),
CHECK ("error_text" IS NULL OR ((octet_length(convert_to("error_text", 'UTF8')) BETWEEN 1 AND 4096) AND ("error_text" IS NOT NULL OR NULL) AND (strpos("error_text", '
') = 0) AND (strpos("error_text", '\r') = 0))),
CHECK ("completed_at_ms" IS NULL OR ("completed_at_ms" BETWEEN 0 AND 9007199254740991)),
CHECK (("created_at_ms" BETWEEN 0 AND 9007199254740991)),
CHECK (("updated_at_ms" BETWEEN "created_at_ms" AND 9007199254740991)),
CHECK ((("worker_pid" IS NULL) = ("worker_start_time" IS NULL))),
CHECK ((("state" = 'pending') AND "worker_pid" IS NULL AND "result_json" IS NULL AND "error_text" IS NULL AND "completed_at_ms" IS NULL) OR (("state" = 'running') AND "worker_pid" IS NOT NULL AND "result_json" IS NULL AND "error_text" IS NULL AND "completed_at_ms" IS NULL) OR (("state" = 'completed') AND "result_json" IS NOT NULL AND "error_text" IS NULL AND ("completed_at_ms" BETWEEN "created_at_ms" AND "updated_at_ms")) OR (("state" IN ('failed', 'interrupted', 'cancelled')) AND "result_json" IS NULL AND "error_text" IS NOT NULL AND ("completed_at_ms" BETWEEN "created_at_ms" AND "updated_at_ms")))
);
CREATE INDEX "idx_node_worker_launches_terminal_completed" ON "node_worker_launches" (("completed_at_ms") ASC, ("launch_id") ASC) WHERE "completed_at_ms" IS NOT NULL;
`},{id:`node_worker_prepared_workspaces`,tables:[`node_worker_prepared_workspaces`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "node_worker_prepared_workspaces" (
"preparation_key" text COLLATE "C" NOT NULL,
"cache_key" text COLLATE "C" NOT NULL,
"gateway_namespace" text COLLATE "C" NOT NULL,
"workspace_dir" text COLLATE "C" NOT NULL,
"home_dir" text COLLATE "C" NOT NULL,
"source_manifest_ref" text COLLATE "C" NOT NULL,
"prepared_manifest_ref" text COLLATE "C" NOT NULL,
"state" text COLLATE "C" NOT NULL,
"environment_id" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C",
"session_key" text COLLATE "C",
"owner_epoch" bigint,
"created_at_ms" bigint NOT NULL,
"bound_at_ms" bigint,
"retired_at_ms" bigint,
PRIMARY KEY ("preparation_key"),
CHECK ((char_length("preparation_key") = 64) AND ("preparation_key" COLLATE "C" !~ '\\A.*[^0-9a-f].*\\Z')),
CHECK ((char_length("cache_key") = 64) AND ("cache_key" COLLATE "C" !~ '\\A.*[^0-9a-f].*\\Z')),
CHECK ((char_length("gateway_namespace") > 0)),
CHECK ((char_length("workspace_dir") > 0)),
CHECK ((char_length("home_dir") > 0)),
CHECK ((char_length("source_manifest_ref") = 71) AND (substr("source_manifest_ref", 1, 7) = 'sha256:') AND (substr("source_manifest_ref", 8) COLLATE "C" !~ '\\A.*[^0-9a-f].*\\Z')),
CHECK ((char_length("prepared_manifest_ref") = 71) AND (substr("prepared_manifest_ref", 1, 7) = 'sha256:') AND (substr("prepared_manifest_ref", 8) COLLATE "C" !~ '\\A.*[^0-9a-f].*\\Z')),
CHECK (("state" IN ('available', 'bound', 'retiring', 'retired'))),
CHECK ((char_length("environment_id") > 0)),
CHECK (("owner_epoch" BETWEEN 1 AND 9007199254740991)),
CHECK (("created_at_ms" BETWEEN 0 AND 9007199254740991)),
CHECK (("bound_at_ms" BETWEEN "created_at_ms" AND 9007199254740991)),
CHECK (("retired_at_ms" BETWEEN coalesce("bound_at_ms", "created_at_ms") AND 9007199254740991)),
CHECK (("session_id" IS NULL AND "session_key" IS NULL AND "owner_epoch" IS NULL AND "bound_at_ms" IS NULL) OR ("session_id" IS NOT NULL AND (char_length("session_id") > 0) AND "session_key" IS NOT NULL AND (char_length("session_key") > 0) AND "owner_epoch" IS NOT NULL AND "bound_at_ms" IS NOT NULL)),
CHECK ((("state" = 'available') AND "bound_at_ms" IS NULL AND "retired_at_ms" IS NULL) OR (("state" = 'bound') AND "bound_at_ms" IS NOT NULL AND "retired_at_ms" IS NULL) OR (("state" = 'retiring') AND "retired_at_ms" IS NULL) OR (("state" = 'retired') AND "retired_at_ms" IS NOT NULL)),
UNIQUE ("workspace_dir")
);
`},{id:`node_worker_turns`,tables:[`node_worker_turns`],indexes:[`idx_node_worker_turns_terminal_completed`,`idx_node_worker_turns_active_owner`],dependencies:[`node_worker_launches`],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "node_worker_turns" (
"turn_id" text COLLATE "C" NOT NULL,
"owner_launch_id" text COLLATE "C" NOT NULL,
"plan_hash" text COLLATE "C" NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
"state" text COLLATE "C" NOT NULL,
"result_json" text COLLATE "C",
"error_text" text COLLATE "C",
"completed_at_ms" bigint,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("turn_id"),
CHECK ((char_length("turn_id") BETWEEN 1 AND 256) AND ("turn_id" IS NOT NULL OR NULL)),
CHECK ((char_length("plan_hash") = 64) AND ("plan_hash" COLLATE "C" !~ '\\A.*[^0-9a-f].*\\Z')),
CHECK ((char_length("run_id") BETWEEN 1 AND 256) AND ("run_id" IS NOT NULL OR NULL)),
CHECK (("state" IN ('running', 'completed', 'failed', 'interrupted', 'cancelled'))),
CHECK ("result_json" IS NULL OR ((octet_length(convert_to("result_json", 'UTF8')) BETWEEN 1 AND 65536) AND ("result_json" IS NOT NULL OR NULL) AND ("result_json" IS JSON))),
CHECK ("error_text" IS NULL OR ((octet_length(convert_to("error_text", 'UTF8')) BETWEEN 1 AND 4096) AND ("error_text" IS NOT NULL OR NULL) AND (strpos("error_text", '
') = 0) AND (strpos("error_text", '\r') = 0))),
CHECK ("completed_at_ms" IS NULL OR ("completed_at_ms" BETWEEN 0 AND 9007199254740991)),
CHECK (("created_at_ms" BETWEEN 0 AND 9007199254740991)),
CHECK (("updated_at_ms" BETWEEN "created_at_ms" AND 9007199254740991)),
CHECK ((("state" = 'running') AND "result_json" IS NULL AND "error_text" IS NULL AND "completed_at_ms" IS NULL) OR (("state" = 'completed') AND "result_json" IS NOT NULL AND "error_text" IS NULL AND ("completed_at_ms" BETWEEN "created_at_ms" AND "updated_at_ms")) OR (("state" IN ('failed', 'interrupted', 'cancelled')) AND "result_json" IS NULL AND "error_text" IS NOT NULL AND ("completed_at_ms" BETWEEN "created_at_ms" AND "updated_at_ms")))
);
CREATE UNIQUE INDEX "idx_node_worker_turns_active_owner" ON "node_worker_turns" (("owner_launch_id") ASC) WHERE ("state" = 'running');
CREATE INDEX "idx_node_worker_turns_terminal_completed" ON "node_worker_turns" (("completed_at_ms") ASC, ("turn_id") ASC) WHERE "completed_at_ms" IS NOT NULL;
ALTER TABLE "node_worker_turns" ADD FOREIGN KEY ("owner_launch_id") REFERENCES "node_worker_launches" ("launch_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`operator_approval_execution_identities`,tables:[`operator_approval_execution_identities`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "operator_approval_execution_identities" (
"approval_id" text COLLATE "C" NOT NULL,
"source_context_id" text COLLATE "C" NOT NULL,
"source_execution_id" text COLLATE "C" NOT NULL,
PRIMARY KEY ("approval_id"),
CHECK ((char_length("source_context_id") BETWEEN 1 AND 256) AND ("source_context_id" = btrim("source_context_id"))),
CHECK ((char_length("source_execution_id") BETWEEN 1 AND 256) AND ("source_execution_id" = btrim("source_execution_id")))
);
ALTER TABLE "operator_approval_execution_identities" ADD FOREIGN KEY ("approval_id") REFERENCES "operator_approvals" ("approval_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`web_push_approval_deliveries`,tables:[`web_push_approval_deliveries`],indexes:[`idx_web_push_approval_deliveries_subscription`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "web_push_approval_deliveries" (
"approval_id" text COLLATE "C" NOT NULL,
"subscription_id" text COLLATE "C" NOT NULL,
"device_id" text COLLATE "C" NOT NULL,
"user_profile_id" text COLLATE "C",
"prepared_at_ms" bigint NOT NULL,
PRIMARY KEY ("approval_id", "subscription_id")
);
CREATE INDEX "idx_web_push_approval_deliveries_subscription" ON "web_push_approval_deliveries" (("subscription_id") ASC, ("approval_id") ASC);
ALTER TABLE "web_push_approval_deliveries" ADD FOREIGN KEY ("subscription_id") REFERENCES "web_push_subscriptions" ("subscription_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
ALTER TABLE "web_push_approval_deliveries" ADD FOREIGN KEY ("approval_id") REFERENCES "operator_approvals" ("approval_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`execution_decision_facts`,tables:[`execution_decision_facts`],indexes:[`execution_decision_facts_cursor_id_idx`,`execution_decision_facts_context_occurred_idx`,`execution_decision_facts_run_occurred_idx`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "execution_decision_facts" (
"cursor_id" bigint NOT NULL,
"receipt_id" text COLLATE "C" NOT NULL,
"context_id" text COLLATE "C" NOT NULL,
"execution_id" text COLLATE "C" NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
"action_id" text COLLATE "C",
"action_family" text COLLATE "C" NOT NULL,
"decision_outcome" text COLLATE "C" NOT NULL,
"coverage_state" text COLLATE "C" NOT NULL,
"reason_code" text COLLATE "C" NOT NULL,
"owner" text COLLATE "C" NOT NULL,
"source_ref" text COLLATE "C" NOT NULL,
"occurred_at" bigint NOT NULL,
"receipt_bytes" bigint NOT NULL,
"receipt_json" text COLLATE "C" NOT NULL,
PRIMARY KEY ("receipt_id"),
CHECK ((char_length("receipt_id") BETWEEN 1 AND 256)),
CHECK ((char_length("context_id") BETWEEN 1 AND 256)),
CHECK ((char_length("execution_id") BETWEEN 1 AND 256)),
CHECK ((char_length("run_id") BETWEEN 1 AND 256)),
CHECK ("action_id" IS NULL OR (char_length("action_id") BETWEEN 1 AND 256)),
CHECK ((char_length("action_family") BETWEEN 1 AND 256)),
CHECK (("decision_outcome" IN ('allowed', 'denied', 'not-applicable', 'unknown'))),
CHECK (("coverage_state" IN ('enforced', 'attribution-only', 'unattributed', 'unknown', 'unsupported'))),
CHECK ((char_length("reason_code") BETWEEN 1 AND 256)),
CHECK ((char_length("owner") BETWEEN 1 AND 256)),
CHECK ((char_length("source_ref") BETWEEN 1 AND 256)),
CHECK (("occurred_at" >= 0)),
CHECK (("receipt_bytes" BETWEEN 1 AND 16384)),
CHECK ((char_length("receipt_json") > 0)),
UNIQUE ("occurred_at", "receipt_id")
);
CREATE INDEX "execution_decision_facts_context_occurred_idx" ON "execution_decision_facts" (("context_id") ASC, ("occurred_at") ASC, ("receipt_id") ASC);
CREATE UNIQUE INDEX "execution_decision_facts_cursor_id_idx" ON "execution_decision_facts" (("cursor_id") ASC);
CREATE INDEX "execution_decision_facts_run_occurred_idx" ON "execution_decision_facts" (("run_id") ASC, ("occurred_at") ASC, ("receipt_id") ASC);
`},{id:`execution_owner_lifecycle_bindings`,tables:[`execution_owner_lifecycle_bindings`],indexes:[],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "execution_owner_lifecycle_bindings" (
"owner_kind" text COLLATE "C" NOT NULL,
"owner_id" text COLLATE "C" NOT NULL,
"context_id" text COLLATE "C" NOT NULL,
"execution_id" text COLLATE "C" NOT NULL,
PRIMARY KEY ("owner_kind", "owner_id")
);
`},{id:`outbound_message_execution_bindings`,tables:[`outbound_message_execution_bindings`],indexes:[`outbound_message_execution_bindings_execution_event_idx`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "outbound_message_execution_bindings" (
"event_id" text COLLATE "C" NOT NULL,
"context_id" text COLLATE "C" NOT NULL,
"execution_id" text COLLATE "C" NOT NULL,
"run_id" text COLLATE "C" NOT NULL,
PRIMARY KEY ("event_id"),
CHECK ((char_length("context_id") BETWEEN 1 AND 256)),
CHECK ((char_length("execution_id") BETWEEN 1 AND 256)),
CHECK ((char_length("run_id") BETWEEN 1 AND 256))
);
CREATE INDEX "outbound_message_execution_bindings_execution_event_idx" ON "outbound_message_execution_bindings" (("context_id") ASC, ("execution_id") ASC, ("run_id") ASC, ("event_id") ASC);
ALTER TABLE "outbound_message_execution_bindings" ADD FOREIGN KEY ("event_id") REFERENCES "audit_events" ("event_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`outbound_message_progress`,tables:[`outbound_message_progress`],indexes:[`outbound_message_progress_occurred_idx`,`outbound_message_progress_run_occurred_idx`],dependencies:[],activation:`first-use`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "outbound_message_progress" (
"sequence" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"progress_id" text COLLATE "C" NOT NULL,
"source_id" text COLLATE "C" NOT NULL,
"source_sequence" bigint NOT NULL,
"schema_version" bigint NOT NULL,
"occurred_at" bigint NOT NULL,
"action" text COLLATE "C" NOT NULL,
"outcome" text COLLATE "C" NOT NULL,
"actor_type" text COLLATE "C" NOT NULL,
"actor_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C",
"run_id" text COLLATE "C",
"context_id" text COLLATE "C",
"execution_id" text COLLATE "C",
"channel" text COLLATE "C" NOT NULL,
"conversation_kind" text COLLATE "C" NOT NULL,
"duration_ms" bigint,
"account_ref" text COLLATE "C",
"conversation_ref" text COLLATE "C",
"target_ref" text COLLATE "C",
PRIMARY KEY ("sequence"),
CHECK ((char_length("progress_id") BETWEEN 1 AND 256)),
CHECK ((char_length("source_id") BETWEEN 1 AND 512)),
CHECK (("source_sequence" >= 1)),
CHECK (("schema_version" = 1)),
CHECK (("occurred_at" >= 0)),
CHECK (("action" IN ('message.outbound.queued', 'message.outbound.platform-started'))),
CHECK (("outcome" IN ('queued', 'platform_started'))),
CHECK (("actor_type" IN ('agent', 'system'))),
CHECK ((char_length("actor_id") BETWEEN 1 AND 256)),
CHECK ("agent_id" IS NULL OR (char_length("agent_id") BETWEEN 1 AND 256)),
CHECK ("run_id" IS NULL OR (char_length("run_id") BETWEEN 1 AND 256)),
CHECK ((char_length("channel") BETWEEN 1 AND 256)),
CHECK (("conversation_kind" IN ('direct', 'group', 'channel', 'unknown'))),
CHECK ("duration_ms" IS NULL OR ("duration_ms" >= 0)),
UNIQUE ("progress_id"),
UNIQUE ("source_id"),
UNIQUE ("occurred_at", "progress_id")
);
CREATE INDEX "outbound_message_progress_occurred_idx" ON "outbound_message_progress" (("occurred_at") ASC, ("sequence") ASC);
CREATE INDEX "outbound_message_progress_run_occurred_idx" ON "outbound_message_progress" (("run_id") ASC NULLS FIRST, ("occurred_at") ASC, ("sequence") ASC);
`},{id:`agent_provenance`,tables:[`agent_provenance`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "agent_provenance" (
"agent_id" text COLLATE "C" NOT NULL,
"created_via" text COLLATE "C" NOT NULL,
"creator_agent_id" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
PRIMARY KEY ("agent_id"),
CHECK (("created_via" IN ('operator', 'agent', 'template')))
);
`},{id:`cron_run_receipts`,tables:[`cron_run_receipts`],indexes:[`cron_run_receipts_cursor_id_idx`,`idx_cron_run_receipts_active_job`,`idx_cron_run_receipts_job_history`],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "cron_run_receipts" (
"cursor_id" bigint NOT NULL,
"receipt_id" text COLLATE "C" NOT NULL,
"store_key" text COLLATE "C" NOT NULL,
"job_id" text COLLATE "C" NOT NULL,
"config_revision" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"request_run_id" text COLLATE "C",
"delivery_attempt_state" text COLLATE "C" NOT NULL DEFAULT 'unknown',
"status" text COLLATE "C" NOT NULL,
"owner_pid" bigint NOT NULL,
"owner_start_time" bigint,
"started_at_ms" bigint NOT NULL,
"finished_at_ms" bigint,
"error_text" text COLLATE "C",
PRIMARY KEY ("receipt_id"),
CHECK (("delivery_attempt_state" IN ('unknown', 'not-started', 'started'))),
CHECK (("status" IN ('running', 'ok', 'error', 'skipped', 'interrupted', 'superseded'))),
CHECK ((("status" = 'running') AND "finished_at_ms" IS NULL) OR (("status" != 'running') AND "finished_at_ms" IS NOT NULL))
);
CREATE UNIQUE INDEX "cron_run_receipts_cursor_id_idx" ON "cron_run_receipts" (("cursor_id") ASC);
CREATE UNIQUE INDEX "idx_cron_run_receipts_active_job" ON "cron_run_receipts" (("store_key") ASC, ("job_id") ASC) WHERE ("status" = 'running');
CREATE INDEX "idx_cron_run_receipts_job_history" ON "cron_run_receipts" (("store_key") ASC, ("job_id") ASC, ("started_at_ms") DESC, ("receipt_id") DESC);
`},{id:`config_revision_keys`,tables:[`config_revision_keys`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "config_revision_keys" (
"id" bigint GENERATED BY DEFAULT AS IDENTITY NOT NULL,
"hmac_key" bytea NOT NULL,
PRIMARY KEY ("id"),
CHECK (("id" = 1)),
CHECK ((octet_length("hmac_key") = 32))
);
`},{id:`secret_store_entries`,tables:[`secret_store_entries`],indexes:[`secret_store_entries_live_idx`],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "secret_store_entries" (
"scope_kind" text COLLATE "C" NOT NULL,
"scope_id" text COLLATE "C" NOT NULL,
"name" text COLLATE "C" NOT NULL,
"value" text COLLATE "C" NOT NULL,
"kind" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"updated_by" text COLLATE "C",
"deleted_at_ms" bigint,
"allowed_hosts" text COLLATE "C",
PRIMARY KEY ("scope_kind", "scope_id", "name"),
CHECK (("scope_kind" IN ('team', 'identity'))),
CHECK (("kind" IN ('secret', 'env'))),
CHECK (("created_at_ms" >= 0)),
CHECK (("updated_at_ms" >= 0)),
CHECK ((("scope_kind" = 'team') AND ("scope_id" = '')) OR (("scope_kind" = 'identity') AND (char_length("scope_id") > 0)))
);
CREATE INDEX "secret_store_entries_live_idx" ON "secret_store_entries" (("scope_kind") ASC, ("scope_id") ASC, ("name") ASC) WHERE "deleted_at_ms" IS NULL;
`},{id:`projects`,tables:[`projects`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "projects" (
"id" text COLLATE "C" NOT NULL,
"display_name" text COLLATE "C" NOT NULL,
"repo_root" text COLLATE "C" NOT NULL,
"origin_url" text COLLATE "C",
"source" text COLLATE "C" NOT NULL,
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("id"),
CHECK (("source" IN ('registered', 'cloned')))
);
`},{id:`worktree_templates`,tables:[`worktree_templates`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "worktree_templates" (
"cache_key" text COLLATE "C" NOT NULL,
"id" text COLLATE "C" NOT NULL,
"repo_root" text COLLATE "C" NOT NULL,
"common_dir" text COLLATE "C" NOT NULL,
"worktree_root" text COLLATE "C" NOT NULL,
"path" text COLLATE "C" NOT NULL,
"backend" text COLLATE "C" NOT NULL,
"source_commit" text COLLATE "C" NOT NULL,
"content_key" text COLLATE "C" NOT NULL,
"status" text COLLATE "C" NOT NULL,
"created_at" bigint NOT NULL,
"last_used_at" bigint NOT NULL,
PRIMARY KEY ("cache_key"),
CHECK (("status" IN ('preparing', 'ready'))),
UNIQUE ("id")
);
`},{id:`user_preferences`,tables:[`user_preferences`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "user_preferences" (
"profile_id" text COLLATE "C" NOT NULL,
"pref_key" text COLLATE "C" NOT NULL,
"value_json" text COLLATE "C" NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("profile_id", "pref_key")
);
`},{id:`device_pair_setup_completions`,tables:[`device_pair_setup_completions`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "device_pair_setup_completions" (
"setup_id" text COLLATE "C" NOT NULL,
"device_id" text COLLATE "C" NOT NULL,
"device_name" text COLLATE "C",
"access" text COLLATE "C" NOT NULL,
"completed_at_ms" bigint NOT NULL,
"delivery_state" text COLLATE "C" NOT NULL,
"retain_until_ms" bigint NOT NULL,
PRIMARY KEY ("setup_id"),
CHECK (("delivery_state" IN ('uncertain', 'confirmed')))
);
`},{id:`github_publication_requests`,tables:[`github_publication_requests`],indexes:[`idx_github_publication_requests_pending`],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "github_publication_requests" (
"request_id" text COLLATE "C" NOT NULL,
"idempotency_key" text COLLATE "C" NOT NULL,
"request_digest" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C" NOT NULL,
"session_key" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"worktree_id" text COLLATE "C" NOT NULL,
"repository_fingerprint" text COLLATE "C" NOT NULL,
"claim_id" text COLLATE "C",
"run_id" text COLLATE "C",
"environment_id" text COLLATE "C",
"owner_epoch" bigint,
"placement_generation" bigint,
"identity_source" text COLLATE "C" NOT NULL,
"identity_profile_id" text COLLATE "C",
"identity_account_id" bigint NOT NULL,
"identity_login" text COLLATE "C" NOT NULL,
"title" text COLLATE "C",
"body" text COLLATE "C",
"status" text COLLATE "C" NOT NULL,
"gateway_instance_id" text COLLATE "C",
"repository" text COLLATE "C",
"branch" text COLLATE "C" NOT NULL,
"base_branch" text COLLATE "C",
"source_head_commit" text COLLATE "C",
"source_index_tree" text COLLATE "C",
"workspace_tree" text COLLATE "C",
"head_commit" text COLLATE "C",
"pull_request_url" text COLLATE "C",
"error_code" text COLLATE "C",
"next_action" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
"reported_at_ms" bigint,
"draft" bigint,
PRIMARY KEY ("request_id"),
CHECK ("owner_epoch" IS NULL OR ("owner_epoch" >= 1)),
CHECK ("placement_generation" IS NULL OR ("placement_generation" >= 0)),
CHECK (("identity_source" IN ('system-detected', 'system-configured', 'agent-override'))),
CHECK (("identity_account_id" >= 1)),
CHECK (("status" IN ('requested', 'publishing', 'published', 'failed'))),
CHECK (("claim_id" IS NULL AND "run_id" IS NULL AND "environment_id" IS NULL AND "owner_epoch" IS NULL AND "placement_generation" IS NULL) OR ("claim_id" IS NOT NULL AND "run_id" IS NOT NULL AND "placement_generation" IS NOT NULL AND (("environment_id" IS NULL AND "owner_epoch" IS NULL) OR ("environment_id" IS NOT NULL AND "owner_epoch" IS NOT NULL)))),
CHECK (("identity_source" IS NOT DISTINCT FROM 'system-detected' AND "identity_profile_id" IS NULL) OR (("identity_source" IN ('system-configured', 'agent-override')) AND "identity_profile_id" IS NOT NULL)),
CHECK (("source_head_commit" IS NULL AND "source_index_tree" IS NULL AND "workspace_tree" IS NULL) OR ("source_head_commit" IS NOT NULL AND "workspace_tree" IS NOT NULL)),
CHECK (("status" IS NOT DISTINCT FROM 'published' AND "pull_request_url" IS NOT NULL AND "error_code" IS NULL AND "next_action" IS NULL) OR ("status" IS NOT DISTINCT FROM 'failed' AND "pull_request_url" IS NULL AND "error_code" IS NOT NULL AND "next_action" IS NOT NULL) OR (("status" IN ('requested', 'publishing')) AND "pull_request_url" IS NULL AND "error_code" IS NULL AND "next_action" IS NULL)),
UNIQUE ("session_id", "idempotency_key")
);
CREATE INDEX "idx_github_publication_requests_pending" ON "github_publication_requests" (("status") ASC, ("updated_at_ms") ASC, ("request_id") ASC);
`},{id:`device_pairing_join_codes`,tables:[`device_pairing_join_codes`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "device_pairing_join_codes" (
"shortcode" text COLLATE "C",
"payload_json" text COLLATE "C",
"created_at_ms" bigint,
"expires_at_ms" bigint
);
`},{id:`device_pairing_browser_requests`,tables:[`device_pairing_browser_requests`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "device_pairing_browser_requests" (
"request_id" text COLLATE "C" NOT NULL,
"code" text COLLATE "C" NOT NULL,
"device_id" text COLLATE "C" NOT NULL,
"public_key" text COLLATE "C" NOT NULL,
"remote_ip" text COLLATE "C",
"user_agent" text COLLATE "C",
"origin" text COLLATE "C",
"status" text COLLATE "C" NOT NULL,
"approved_token_sha256" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"expires_at_ms" bigint NOT NULL,
PRIMARY KEY ("request_id"),
CHECK (("status" IN ('pending', 'approved', 'rejected'))),
UNIQUE ("code"),
UNIQUE ("device_id")
);
`},{id:`skill_workshop_changes`,tables:[`skill_workshop_changes`],indexes:[`skill_workshop_changes_cursor_id_idx`,`idx_skill_workshop_changes_agent_time`],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "skill_workshop_changes" (
"cursor_id" bigint NOT NULL,
"change_id" text COLLATE "C" NOT NULL,
"agent_id" text COLLATE "C" NOT NULL,
"skill_name" text COLLATE "C" NOT NULL,
"action" text COLLATE "C" NOT NULL,
"actor" text COLLATE "C" NOT NULL,
"summary" text COLLATE "C" NOT NULL,
"version_id" text COLLATE "C",
"session_key" text COLLATE "C",
"run_id" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
PRIMARY KEY ("change_id"),
CHECK (("action" IN ('create', 'patch', 'write_file', 'remove_file', 'archive', 'restore'))),
CHECK (("actor" IN ('agent', 'review', 'curator', 'user')))
);
CREATE INDEX "idx_skill_workshop_changes_agent_time" ON "skill_workshop_changes" (("agent_id") ASC, ("created_at_ms") ASC);
CREATE UNIQUE INDEX "skill_workshop_changes_cursor_id_idx" ON "skill_workshop_changes" (("cursor_id") ASC);
`},{id:`worker_environment_ssh_fallback_ports`,tables:[`worker_environment_ssh_fallback_ports`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "worker_environment_ssh_fallback_ports" (
"environment_id" text COLLATE "C" NOT NULL,
"position" bigint NOT NULL,
"port" bigint NOT NULL,
PRIMARY KEY ("environment_id", "position"),
CHECK (("position" >= 0) AND ("position" <= 9)),
CHECK (("port" >= 1) AND ("port" <= 65535)),
UNIQUE ("environment_id", "port")
);
ALTER TABLE "worker_environment_ssh_fallback_ports" ADD FOREIGN KEY ("environment_id") REFERENCES "worker_environments" ("environment_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`worker_session_placement_moves`,tables:[`worker_session_placement_moves`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "worker_session_placement_moves" (
"operation_id" text COLLATE "C" NOT NULL,
"session_id" text COLLATE "C" NOT NULL,
"source_generation" bigint NOT NULL,
"source_environment_id" text COLLATE "C" NOT NULL,
"source_owner_epoch" bigint NOT NULL,
"target_kind" text COLLATE "C" NOT NULL,
"target_id" text COLLATE "C",
"target_machine_class" text COLLATE "C",
"target_os" text COLLATE "C",
"abandon_source" bigint,
"last_error" text COLLATE "C",
"created_at_ms" bigint NOT NULL,
"updated_at_ms" bigint NOT NULL,
PRIMARY KEY ("operation_id"),
CHECK (("source_generation" >= 0)),
CHECK ((char_length("source_environment_id") BETWEEN 1 AND 256) AND ("source_environment_id" = btrim("source_environment_id"))),
CHECK (("source_owner_epoch" >= 1)),
CHECK (("target_kind" IN ('gateway', 'profile', 'device'))),
CHECK (("target_kind" IS NOT DISTINCT FROM 'gateway' AND "target_id" IS NULL) OR (("target_kind" IN ('profile', 'device')) AND "target_id" IS NOT NULL AND (char_length("target_id") BETWEEN 1 AND 256) AND ("target_id" = btrim("target_id")))),
UNIQUE ("session_id")
);
ALTER TABLE "worker_session_placement_moves" ADD FOREIGN KEY ("session_id") REFERENCES "worker_session_placements" ("session_id") ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE;
`},{id:`agent_deletion_journal`,tables:[`agent_deletion_journal`],indexes:[],dependencies:[],activation:`version-additive`,sql:`-- Generated runtime DDL; the owner supplies search_path and the transaction.
CREATE TABLE "agent_deletion_journal" (
"agent_id" text COLLATE "C" NOT NULL,
"operation_id" text COLLATE "C" NOT NULL DEFAULT '',
"phase" text COLLATE "C",
"agent_dir" text COLLATE "C" NOT NULL,
"workspace_dir" text COLLATE "C" NOT NULL,
"sessions_dir" text COLLATE "C" NOT NULL,
"database_paths_json" text COLLATE "C" NOT NULL DEFAULT '[]',
"cleanup_paths_json" text COLLATE "C" NOT NULL DEFAULT '[]',
"created_at" bigint NOT NULL,
"cleanup_completed" bigint NOT NULL DEFAULT 0,
"delete_files" bigint NOT NULL DEFAULT 1,
PRIMARY KEY ("agent_id")
);
`}];return Object.defineProperty(this,"fragments",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get expectedCatalog(){let e=[{table:`acp_replay_events`,kind:`table`,value:null},{table:`acp_replay_events`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`acp_replay_events`,kind:`column`,value:{name:`seq`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`acp_replay_events`,kind:`column`,value:{name:`at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`acp_replay_events`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`acp_replay_events`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`acp_replay_events`,kind:`column`,value:{name:`update_json`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`acp_replay_events`,kind:`column`,value:{name:`estimated_bytes`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:7}},{table:`acp_replay_events`,kind:`primaryKey`,value:[`session_id`,`seq`]},{table:`acp_replay_events`,kind:`foreignKey`,value:{columns:[`session_id`],target:`acp_replay_sessions`,targetColumns:[`session_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`acp_replay_events`,kind:`indexes`,value:1},{table:`acp_replay_events`,kind:`checks`,value:0},{table:`acp_replay_sessions`,kind:`table`,value:null},{table:`acp_replay_sessions`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`acp_replay_sessions`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`acp_replay_sessions`,kind:`column`,value:{name:`cwd`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`acp_replay_sessions`,kind:`column`,value:{name:`complete`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`acp_replay_sessions`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`acp_replay_sessions`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`acp_replay_sessions`,kind:`column`,value:{name:`next_seq`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`acp_replay_sessions`,kind:`column`,value:{name:`estimated_bytes`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:8}},{table:`acp_replay_sessions`,kind:`primaryKey`,value:[`session_id`]},{table:`acp_replay_sessions`,kind:`indexes`,value:3},{table:`acp_replay_sessions`,kind:`checks`,value:0},{table:`acp_sessions`,kind:`table`,value:null},{table:`acp_sessions`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`acp_sessions`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`acp_sessions`,kind:`column`,value:{name:`backend`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`acp_sessions`,kind:`column`,value:{name:`agent`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`acp_sessions`,kind:`column`,value:{name:`runtime_session_name`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`acp_sessions`,kind:`column`,value:{name:`identity_json`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`acp_sessions`,kind:`column`,value:{name:`resume_agent_session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`acp_sessions`,kind:`column`,value:{name:`resume_acpx_session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`acp_sessions`,kind:`column`,value:{name:`mode`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`acp_sessions`,kind:`column`,value:{name:`runtime_options_json`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`acp_sessions`,kind:`column`,value:{name:`cwd`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`acp_sessions`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`acp_sessions`,kind:`column`,value:{name:`last_activity_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:13}},{table:`acp_sessions`,kind:`column`,value:{name:`last_error`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`acp_sessions`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:15}},{table:`acp_sessions`,kind:`primaryKey`,value:[`session_key`]},{table:`acp_sessions`,kind:`indexes`,value:5},{table:`acp_sessions`,kind:`checks`,value:0},{table:`agent_database_leases`,kind:`table`,value:null},{table:`agent_database_leases`,kind:`column`,value:{name:`lease_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`agent_database_leases`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`agent_database_leases`,kind:`column`,value:{name:`path`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`agent_database_leases`,kind:`column`,value:{name:`owner_pid`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`agent_database_leases`,kind:`column`,value:{name:`owner_start_time`,type:`bigint`,nullable:!0,identity:!1,default:null,position:5}},{table:`agent_database_leases`,kind:`column`,value:{name:`opened_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`agent_database_leases`,kind:`column`,value:{name:`provenance`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`agent_database_leases`,kind:`primaryKey`,value:[`lease_id`]},{table:`agent_database_leases`,kind:`indexes`,value:1},{table:`agent_database_leases`,kind:`checks`,value:0},{table:`agent_databases`,kind:`table`,value:null},{table:`agent_databases`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`agent_databases`,kind:`column`,value:{name:`path`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`agent_databases`,kind:`column`,value:{name:`schema_version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`agent_databases`,kind:`column`,value:{name:`last_seen_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`agent_databases`,kind:`column`,value:{name:`size_bytes`,type:`bigint`,nullable:!0,identity:!1,default:null,position:5}},{table:`agent_databases`,kind:`primaryKey`,value:[`agent_id`,`path`]},{table:`agent_databases`,kind:`indexes`,value:1},{table:`agent_databases`,kind:`checks`,value:0},{table:`agent_deletion_journal`,kind:`table`,value:null},{table:`agent_deletion_journal`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`operation_id`,type:`text`,nullable:!1,identity:!1,default:`''`,position:2}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`phase`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`agent_dir`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`workspace_dir`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`sessions_dir`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`database_paths_json`,type:`text`,nullable:!1,identity:!1,default:`'[]'`,position:7}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`cleanup_paths_json`,type:`text`,nullable:!1,identity:!1,default:`'[]'`,position:8}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`cleanup_completed`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:10}},{table:`agent_deletion_journal`,kind:`column`,value:{name:`delete_files`,type:`bigint`,nullable:!1,identity:!1,default:`1`,position:11}},{table:`agent_deletion_journal`,kind:`primaryKey`,value:[`agent_id`]},{table:`agent_deletion_journal`,kind:`indexes`,value:1},{table:`agent_deletion_journal`,kind:`checks`,value:0},{table:`agent_provenance`,kind:`table`,value:null},{table:`agent_provenance`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`agent_provenance`,kind:`column`,value:{name:`created_via`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`agent_provenance`,kind:`column`,value:{name:`creator_agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`agent_provenance`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`agent_provenance`,kind:`primaryKey`,value:[`agent_id`]},{table:`agent_provenance`,kind:`indexes`,value:1},{table:`agent_provenance`,kind:`checks`,value:1},{table:`apns_registration_tombstones`,kind:`table`,value:null},{table:`apns_registration_tombstones`,kind:`column`,value:{name:`node_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`apns_registration_tombstones`,kind:`column`,value:{name:`deleted_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`apns_registration_tombstones`,kind:`primaryKey`,value:[`node_id`]},{table:`apns_registration_tombstones`,kind:`indexes`,value:1},{table:`apns_registration_tombstones`,kind:`checks`,value:0},{table:`apns_registrations`,kind:`table`,value:null},{table:`apns_registrations`,kind:`column`,value:{name:`node_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`apns_registrations`,kind:`column`,value:{name:`transport`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`apns_registrations`,kind:`column`,value:{name:`token`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`apns_registrations`,kind:`column`,value:{name:`relay_handle`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`apns_registrations`,kind:`column`,value:{name:`send_grant`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`apns_registrations`,kind:`column`,value:{name:`installation_id`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`apns_registrations`,kind:`column`,value:{name:`relay_origin`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`apns_registrations`,kind:`column`,value:{name:`topic`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`apns_registrations`,kind:`column`,value:{name:`environment`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`apns_registrations`,kind:`column`,value:{name:`distribution`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`apns_registrations`,kind:`column`,value:{name:`token_debug_suffix`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`apns_registrations`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`apns_registrations`,kind:`primaryKey`,value:[`node_id`]},{table:`apns_registrations`,kind:`indexes`,value:2},{table:`apns_registrations`,kind:`checks`,value:0},{table:`audit_events`,kind:`table`,value:null},{table:`audit_events`,kind:`column`,value:{name:`sequence`,type:`bigint`,nullable:!1,identity:!0,default:null,position:1}},{table:`audit_events`,kind:`column`,value:{name:`event_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`audit_events`,kind:`column`,value:{name:`source_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`audit_events`,kind:`column`,value:{name:`schema_version`,type:`bigint`,nullable:!1,identity:!1,default:`1`,position:4}},{table:`audit_events`,kind:`column`,value:{name:`source_sequence`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`audit_events`,kind:`column`,value:{name:`occurred_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`audit_events`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`audit_events`,kind:`column`,value:{name:`action`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`audit_events`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`audit_events`,kind:`column`,value:{name:`error_code`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`audit_events`,kind:`column`,value:{name:`actor_type`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`audit_events`,kind:`column`,value:{name:`actor_id`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`audit_events`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`audit_events`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`audit_events`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`audit_events`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`audit_events`,kind:`column`,value:{name:`tool_call_id`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`audit_events`,kind:`column`,value:{name:`tool_name`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`audit_events`,kind:`column`,value:{name:`direction`,type:`text`,nullable:!0,identity:!1,default:null,position:19}},{table:`audit_events`,kind:`column`,value:{name:`channel`,type:`text`,nullable:!0,identity:!1,default:null,position:20}},{table:`audit_events`,kind:`column`,value:{name:`conversation_kind`,type:`text`,nullable:!0,identity:!1,default:null,position:21}},{table:`audit_events`,kind:`column`,value:{name:`message_outcome`,type:`text`,nullable:!0,identity:!1,default:null,position:22}},{table:`audit_events`,kind:`column`,value:{name:`reason_code`,type:`text`,nullable:!0,identity:!1,default:null,position:23}},{table:`audit_events`,kind:`column`,value:{name:`delivery_kind`,type:`text`,nullable:!0,identity:!1,default:null,position:24}},{table:`audit_events`,kind:`column`,value:{name:`failure_stage`,type:`text`,nullable:!0,identity:!1,default:null,position:25}},{table:`audit_events`,kind:`column`,value:{name:`duration_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:26}},{table:`audit_events`,kind:`column`,value:{name:`result_count`,type:`bigint`,nullable:!0,identity:!1,default:null,position:27}},{table:`audit_events`,kind:`column`,value:{name:`account_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:28}},{table:`audit_events`,kind:`column`,value:{name:`conversation_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:29}},{table:`audit_events`,kind:`column`,value:{name:`message_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:30}},{table:`audit_events`,kind:`column`,value:{name:`target_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:31}},{table:`audit_events`,kind:`primaryKey`,value:[`sequence`]},{table:`audit_events`,kind:`unique`,value:[`event_id`]},{table:`audit_events`,kind:`unique`,value:[`source_id`]},{table:`audit_events`,kind:`indexes`,value:11},{table:`audit_events`,kind:`checks`,value:0},{table:`audit_identity_keys`,kind:`table`,value:null},{table:`audit_identity_keys`,kind:`column`,value:{name:`id`,type:`bigint`,nullable:!1,identity:!0,default:null,position:1}},{table:`audit_identity_keys`,kind:`column`,value:{name:`key_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`audit_identity_keys`,kind:`column`,value:{name:`key`,type:`bytea`,nullable:!1,identity:!1,default:null,position:3}},{table:`audit_identity_keys`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`audit_identity_keys`,kind:`primaryKey`,value:[`id`]},{table:`audit_identity_keys`,kind:`indexes`,value:1},{table:`audit_identity_keys`,kind:`checks`,value:1},{table:`backup_runs`,kind:`table`,value:null},{table:`backup_runs`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`backup_runs`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`backup_runs`,kind:`column`,value:{name:`archive_path`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`backup_runs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`backup_runs`,kind:`column`,value:{name:`manifest_json`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`backup_runs`,kind:`primaryKey`,value:[`id`]},{table:`backup_runs`,kind:`indexes`,value:2},{table:`backup_runs`,kind:`checks`,value:0},{table:`capture_blobs`,kind:`table`,value:null},{table:`capture_blobs`,kind:`column`,value:{name:`blob_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`capture_blobs`,kind:`column`,value:{name:`content_type`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`capture_blobs`,kind:`column`,value:{name:`encoding`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`capture_blobs`,kind:`column`,value:{name:`size_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`capture_blobs`,kind:`column`,value:{name:`sha256`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`capture_blobs`,kind:`column`,value:{name:`data`,type:`bytea`,nullable:!1,identity:!1,default:null,position:6}},{table:`capture_blobs`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`capture_blobs`,kind:`primaryKey`,value:[`blob_id`]},{table:`capture_blobs`,kind:`indexes`,value:1},{table:`capture_blobs`,kind:`checks`,value:0},{table:`capture_events`,kind:`table`,value:null},{table:`capture_events`,kind:`column`,value:{name:`id`,type:`bigint`,nullable:!1,identity:!0,default:null,position:1}},{table:`capture_events`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`capture_events`,kind:`column`,value:{name:`ts`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`capture_events`,kind:`column`,value:{name:`source_scope`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`capture_events`,kind:`column`,value:{name:`source_process`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`capture_events`,kind:`column`,value:{name:`protocol`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`capture_events`,kind:`column`,value:{name:`direction`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`capture_events`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`capture_events`,kind:`column`,value:{name:`flow_id`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`capture_events`,kind:`column`,value:{name:`method`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`capture_events`,kind:`column`,value:{name:`host`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`capture_events`,kind:`column`,value:{name:`path`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`capture_events`,kind:`column`,value:{name:`status`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`capture_events`,kind:`column`,value:{name:`close_code`,type:`bigint`,nullable:!0,identity:!1,default:null,position:14}},{table:`capture_events`,kind:`column`,value:{name:`content_type`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`capture_events`,kind:`column`,value:{name:`headers_json`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`capture_events`,kind:`column`,value:{name:`data_text`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`capture_events`,kind:`column`,value:{name:`data_blob_id`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`capture_events`,kind:`column`,value:{name:`data_sha256`,type:`text`,nullable:!0,identity:!1,default:null,position:19}},{table:`capture_events`,kind:`column`,value:{name:`error_text`,type:`text`,nullable:!0,identity:!1,default:null,position:20}},{table:`capture_events`,kind:`column`,value:{name:`meta_json`,type:`text`,nullable:!0,identity:!1,default:null,position:21}},{table:`capture_events`,kind:`primaryKey`,value:[`id`]},{table:`capture_events`,kind:`foreignKey`,value:{columns:[`data_blob_id`],target:`capture_blobs`,targetColumns:[`blob_id`],onUpdate:`NO ACTION`,onDelete:`SET NULL`,deferrable:!1,deferred:!1}},{table:`capture_events`,kind:`foreignKey`,value:{columns:[`session_id`],target:`capture_sessions`,targetColumns:[`id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`capture_events`,kind:`indexes`,value:3},{table:`capture_events`,kind:`checks`,value:0},{table:`capture_sessions`,kind:`table`,value:null},{table:`capture_sessions`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`capture_sessions`,kind:`column`,value:{name:`started_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`capture_sessions`,kind:`column`,value:{name:`ended_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`capture_sessions`,kind:`column`,value:{name:`mode`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`capture_sessions`,kind:`column`,value:{name:`source_scope`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`capture_sessions`,kind:`column`,value:{name:`source_process`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`capture_sessions`,kind:`column`,value:{name:`proxy_url`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`capture_sessions`,kind:`primaryKey`,value:[`id`]},{table:`capture_sessions`,kind:`indexes`,value:1},{table:`capture_sessions`,kind:`checks`,value:0},{table:`channel_ingress_events`,kind:`table`,value:null},{table:`channel_ingress_events`,kind:`column`,value:{name:`queue_name`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`channel_ingress_events`,kind:`column`,value:{name:`event_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`channel_ingress_events`,kind:`column`,value:{name:`channel_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`channel_ingress_events`,kind:`column`,value:{name:`account_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`channel_ingress_events`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`channel_ingress_events`,kind:`column`,value:{name:`lane_key`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`channel_ingress_events`,kind:`column`,value:{name:`payload_json`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`channel_ingress_events`,kind:`column`,value:{name:`metadata_json`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`channel_ingress_events`,kind:`column`,value:{name:`received_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`channel_ingress_events`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`channel_ingress_events`,kind:`column`,value:{name:`claim_token`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`channel_ingress_events`,kind:`column`,value:{name:`claim_owner`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`channel_ingress_events`,kind:`column`,value:{name:`claimed_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`channel_ingress_events`,kind:`column`,value:{name:`attempts`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:14}},{table:`channel_ingress_events`,kind:`column`,value:{name:`last_attempt_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:15}},{table:`channel_ingress_events`,kind:`column`,value:{name:`last_error`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`channel_ingress_events`,kind:`column`,value:{name:`failed_reason`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`channel_ingress_events`,kind:`column`,value:{name:`failed_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:18}},{table:`channel_ingress_events`,kind:`column`,value:{name:`completed_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:19}},{table:`channel_ingress_events`,kind:`column`,value:{name:`completed_metadata_json`,type:`text`,nullable:!0,identity:!1,default:null,position:20}},{table:`channel_ingress_events`,kind:`primaryKey`,value:[`queue_name`,`event_id`]},{table:`channel_ingress_events`,kind:`indexes`,value:4},{table:`channel_ingress_events`,kind:`checks`,value:0},{table:`channel_pairing_allow_entries`,kind:`table`,value:null},{table:`channel_pairing_allow_entries`,kind:`column`,value:{name:`channel_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`channel_pairing_allow_entries`,kind:`column`,value:{name:`account_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`channel_pairing_allow_entries`,kind:`column`,value:{name:`entry`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`channel_pairing_allow_entries`,kind:`column`,value:{name:`sort_order`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`channel_pairing_allow_entries`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`channel_pairing_allow_entries`,kind:`primaryKey`,value:[`channel_key`,`account_id`,`entry`]},{table:`channel_pairing_allow_entries`,kind:`indexes`,value:2},{table:`channel_pairing_allow_entries`,kind:`checks`,value:0},{table:`channel_pairing_requests`,kind:`table`,value:null},{table:`channel_pairing_requests`,kind:`column`,value:{name:`channel_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`channel_pairing_requests`,kind:`column`,value:{name:`account_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`channel_pairing_requests`,kind:`column`,value:{name:`request_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`channel_pairing_requests`,kind:`column`,value:{name:`code`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`channel_pairing_requests`,kind:`column`,value:{name:`created_at`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`channel_pairing_requests`,kind:`column`,value:{name:`last_seen_at`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`channel_pairing_requests`,kind:`column`,value:{name:`meta_json`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`channel_pairing_requests`,kind:`primaryKey`,value:[`channel_key`,`account_id`,`request_id`]},{table:`channel_pairing_requests`,kind:`indexes`,value:3},{table:`channel_pairing_requests`,kind:`checks`,value:0},{table:`clawhub_promotion_claims`,kind:`table`,value:null},{table:`clawhub_promotion_claims`,kind:`column`,value:{name:`slug`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`clawhub_promotion_claims`,kind:`column`,value:{name:`provider`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`clawhub_promotion_claims`,kind:`column`,value:{name:`model_keys_json`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`clawhub_promotion_claims`,kind:`column`,value:{name:`ends_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`clawhub_promotion_claims`,kind:`column`,value:{name:`claimed_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`clawhub_promotion_claims`,kind:`primaryKey`,value:[`slug`]},{table:`clawhub_promotion_claims`,kind:`indexes`,value:1},{table:`clawhub_promotion_claims`,kind:`checks`,value:0},{table:`config_health_entries`,kind:`table`,value:null},{table:`config_health_entries`,kind:`column`,value:{name:`config_path`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`config_health_entries`,kind:`column`,value:{name:`last_known_good_json`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`config_health_entries`,kind:`column`,value:{name:`last_promoted_good_json`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`config_health_entries`,kind:`column`,value:{name:`last_observed_suspicious_signature`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`config_health_entries`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`config_health_entries`,kind:`primaryKey`,value:[`config_path`]},{table:`config_health_entries`,kind:`indexes`,value:1},{table:`config_health_entries`,kind:`checks`,value:0},{table:`config_machine_state`,kind:`table`,value:null},{table:`config_machine_state`,kind:`column`,value:{name:`state_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`config_machine_state`,kind:`column`,value:{name:`value_json`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`config_machine_state`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`config_machine_state`,kind:`primaryKey`,value:[`state_key`]},{table:`config_machine_state`,kind:`indexes`,value:1},{table:`config_machine_state`,kind:`checks`,value:0},{table:`config_revision_keys`,kind:`table`,value:null},{table:`config_revision_keys`,kind:`column`,value:{name:`id`,type:`bigint`,nullable:!1,identity:!0,default:null,position:1}},{table:`config_revision_keys`,kind:`column`,value:{name:`hmac_key`,type:`bytea`,nullable:!1,identity:!1,default:null,position:2}},{table:`config_revision_keys`,kind:`primaryKey`,value:[`id`]},{table:`config_revision_keys`,kind:`indexes`,value:1},{table:`config_revision_keys`,kind:`checks`,value:2},{table:`cron_job_runtime_authorities`,kind:`table`,value:null},{table:`cron_job_runtime_authorities`,kind:`column`,value:{name:`store_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`cron_job_runtime_authorities`,kind:`column`,value:{name:`job_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`cron_job_runtime_authorities`,kind:`column`,value:{name:`authority_json`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`cron_job_runtime_authorities`,kind:`column`,value:{name:`authority_input_fingerprint`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`cron_job_runtime_authorities`,kind:`column`,value:{name:`recovery_required`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`cron_job_runtime_authorities`,kind:`primaryKey`,value:[`store_key`,`job_id`]},{table:`cron_job_runtime_authorities`,kind:`foreignKey`,value:{columns:[`store_key`,`job_id`],target:`cron_jobs`,targetColumns:[`store_key`,`job_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`cron_job_runtime_authorities`,kind:`indexes`,value:1},{table:`cron_job_runtime_authorities`,kind:`checks`,value:2},{table:`cron_job_scratch`,kind:`table`,value:null},{table:`cron_job_scratch`,kind:`column`,value:{name:`store_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`cron_job_scratch`,kind:`column`,value:{name:`job_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`cron_job_scratch`,kind:`column`,value:{name:`content`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`cron_job_scratch`,kind:`column`,value:{name:`revision`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`cron_job_scratch`,kind:`column`,value:{name:`source_sha256`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`cron_job_scratch`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`cron_job_scratch`,kind:`primaryKey`,value:[`store_key`,`job_id`]},{table:`cron_job_scratch`,kind:`indexes`,value:2},{table:`cron_job_scratch`,kind:`checks`,value:2},{table:`cron_jobs`,kind:`table`,value:null},{table:`cron_jobs`,kind:`column`,value:{name:`store_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`cron_jobs`,kind:`column`,value:{name:`job_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`cron_jobs`,kind:`column`,value:{name:`declaration_key`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`cron_jobs`,kind:`column`,value:{name:`owner_agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`cron_jobs`,kind:`column`,value:{name:`name`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`cron_jobs`,kind:`column`,value:{name:`description`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`cron_jobs`,kind:`column`,value:{name:`enabled`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`cron_jobs`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`cron_jobs`,kind:`column`,value:{name:`payload_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`cron_jobs`,kind:`column`,value:{name:`job_json`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`cron_jobs`,kind:`column`,value:{name:`grant_definition_revision`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`cron_jobs`,kind:`column`,value:{name:`grant_definition_generation`,type:`bigint`,nullable:!0,identity:!1,default:null,position:12}},{table:`cron_jobs`,kind:`column`,value:{name:`grant_definition_updated_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`cron_jobs`,kind:`column`,value:{name:`state_json`,type:`text`,nullable:!1,identity:!1,default:`'{}'`,position:14}},{table:`cron_jobs`,kind:`column`,value:{name:`runtime_updated_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:15}},{table:`cron_jobs`,kind:`column`,value:{name:`schedule_identity`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`cron_jobs`,kind:`column`,value:{name:`sort_order`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:17}},{table:`cron_jobs`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:18}},{table:`cron_jobs`,kind:`primaryKey`,value:[`store_key`,`job_id`]},{table:`cron_jobs`,kind:`indexes`,value:2},{table:`cron_jobs`,kind:`checks`,value:0},{table:`cron_run_receipts`,kind:`table`,value:null},{table:`cron_run_receipts`,kind:`column`,value:{name:`cursor_id`,type:`bigint`,nullable:!1,identity:!1,default:null,position:1}},{table:`cron_run_receipts`,kind:`column`,value:{name:`receipt_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`cron_run_receipts`,kind:`column`,value:{name:`store_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`cron_run_receipts`,kind:`column`,value:{name:`job_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`cron_run_receipts`,kind:`column`,value:{name:`config_revision`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`cron_run_receipts`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`cron_run_receipts`,kind:`column`,value:{name:`request_run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`cron_run_receipts`,kind:`column`,value:{name:`delivery_attempt_state`,type:`text`,nullable:!1,identity:!1,default:`'unknown'`,position:8}},{table:`cron_run_receipts`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`cron_run_receipts`,kind:`column`,value:{name:`owner_pid`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`cron_run_receipts`,kind:`column`,value:{name:`owner_start_time`,type:`bigint`,nullable:!0,identity:!1,default:null,position:11}},{table:`cron_run_receipts`,kind:`column`,value:{name:`started_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`cron_run_receipts`,kind:`column`,value:{name:`finished_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`cron_run_receipts`,kind:`column`,value:{name:`error_text`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`cron_run_receipts`,kind:`primaryKey`,value:[`receipt_id`]},{table:`cron_run_receipts`,kind:`indexes`,value:4},{table:`cron_run_receipts`,kind:`checks`,value:3},{table:`cron_run_trigger_state_retirements`,kind:`table`,value:null},{table:`cron_run_trigger_state_retirements`,kind:`column`,value:{name:`receipt_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`cron_run_trigger_state_retirements`,kind:`primaryKey`,value:[`receipt_id`]},{table:`cron_run_trigger_state_retirements`,kind:`foreignKey`,value:{columns:[`receipt_id`],target:`cron_run_receipts`,targetColumns:[`receipt_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`cron_run_trigger_state_retirements`,kind:`indexes`,value:1},{table:`cron_run_trigger_state_retirements`,kind:`checks`,value:0},{table:`current_conversation_bindings`,kind:`table`,value:null},{table:`current_conversation_bindings`,kind:`column`,value:{name:`binding_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`binding_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`target_session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`channel`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`account_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`conversation_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`parent_conversation_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`conversation_id`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`target_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`bound_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`expires_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:12}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`metadata_json`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`record_json`,type:`text`,nullable:!1,identity:!1,default:null,position:14}},{table:`current_conversation_bindings`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:15}},{table:`current_conversation_bindings`,kind:`primaryKey`,value:[`binding_key`]},{table:`current_conversation_bindings`,kind:`indexes`,value:4},{table:`current_conversation_bindings`,kind:`checks`,value:0},{table:`delivery_queue_entries`,kind:`table`,value:null},{table:`delivery_queue_entries`,kind:`column`,value:{name:`queue_name`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`entry_kind`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`channel`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`target`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`account_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`retry_count`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:9}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`last_attempt_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:10}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`last_error`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`recovery_state`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`platform_send_started_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`entry_json`,type:`text`,nullable:!1,identity:!1,default:null,position:14}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`retention_id_prefix`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`retention_max_age_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:16}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`retention_max_entries`,type:`bigint`,nullable:!0,identity:!1,default:null,position:17}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`enqueued_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:18}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:19}},{table:`delivery_queue_entries`,kind:`column`,value:{name:`failed_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:20}},{table:`delivery_queue_entries`,kind:`primaryKey`,value:[`queue_name`,`id`]},{table:`delivery_queue_entries`,kind:`indexes`,value:6},{table:`delivery_queue_entries`,kind:`checks`,value:0},{table:`device_bootstrap_tokens`,kind:`table`,value:null},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`token_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`token`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`setup_id`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`ts`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`public_key`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`profile_json`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`redeemed_profile_json`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`pending_profile_json`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`issued_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`device_bootstrap_tokens`,kind:`column`,value:{name:`last_used_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:11}},{table:`device_bootstrap_tokens`,kind:`primaryKey`,value:[`token_key`]},{table:`device_bootstrap_tokens`,kind:`indexes`,value:2},{table:`device_bootstrap_tokens`,kind:`checks`,value:0},{table:`device_pair_setup_completions`,kind:`table`,value:null},{table:`device_pair_setup_completions`,kind:`column`,value:{name:`setup_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`device_pair_setup_completions`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`device_pair_setup_completions`,kind:`column`,value:{name:`device_name`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`device_pair_setup_completions`,kind:`column`,value:{name:`access`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`device_pair_setup_completions`,kind:`column`,value:{name:`completed_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`device_pair_setup_completions`,kind:`column`,value:{name:`delivery_state`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`device_pair_setup_completions`,kind:`column`,value:{name:`retain_until_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`device_pair_setup_completions`,kind:`primaryKey`,value:[`setup_id`]},{table:`device_pair_setup_completions`,kind:`indexes`,value:1},{table:`device_pair_setup_completions`,kind:`checks`,value:1},{table:`device_pairing_browser_requests`,kind:`table`,value:null},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`request_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`code`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`public_key`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`remote_ip`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`user_agent`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`origin`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`approved_token_sha256`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`device_pairing_browser_requests`,kind:`column`,value:{name:`expires_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`device_pairing_browser_requests`,kind:`primaryKey`,value:[`request_id`]},{table:`device_pairing_browser_requests`,kind:`unique`,value:[`code`]},{table:`device_pairing_browser_requests`,kind:`unique`,value:[`device_id`]},{table:`device_pairing_browser_requests`,kind:`indexes`,value:3},{table:`device_pairing_browser_requests`,kind:`checks`,value:1},{table:`device_pairing_join_codes`,kind:`table`,value:null},{table:`device_pairing_join_codes`,kind:`column`,value:{name:`shortcode`,type:`text`,nullable:!0,identity:!1,default:null,position:1}},{table:`device_pairing_join_codes`,kind:`column`,value:{name:`payload_json`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`device_pairing_join_codes`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`device_pairing_join_codes`,kind:`column`,value:{name:`expires_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:4}},{table:`device_pairing_join_codes`,kind:`indexes`,value:0},{table:`device_pairing_join_codes`,kind:`checks`,value:0},{table:`device_pairing_paired`,kind:`table`,value:null},{table:`device_pairing_paired`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`device_pairing_paired`,kind:`column`,value:{name:`public_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`device_pairing_paired`,kind:`column`,value:{name:`display_name`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`device_pairing_paired`,kind:`column`,value:{name:`operator_label`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`device_pairing_paired`,kind:`column`,value:{name:`platform`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`device_pairing_paired`,kind:`column`,value:{name:`device_family`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`device_pairing_paired`,kind:`column`,value:{name:`client_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`device_pairing_paired`,kind:`column`,value:{name:`client_mode`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`device_pairing_paired`,kind:`column`,value:{name:`browser_origin`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`device_pairing_paired`,kind:`column`,value:{name:`role`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`device_pairing_paired`,kind:`column`,value:{name:`roles_json`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`device_pairing_paired`,kind:`column`,value:{name:`scopes_json`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`device_pairing_paired`,kind:`column`,value:{name:`approved_scopes_json`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`device_pairing_paired`,kind:`column`,value:{name:`remote_ip`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`device_pairing_paired`,kind:`column`,value:{name:`tokens_json`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`device_pairing_paired`,kind:`column`,value:{name:`approved_via`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`device_pairing_paired`,kind:`column`,value:{name:`node_surface_json`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`device_pairing_paired`,kind:`column`,value:{name:`pending_node_surface_json`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`device_pairing_paired`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:19}},{table:`device_pairing_paired`,kind:`column`,value:{name:`approved_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:20}},{table:`device_pairing_paired`,kind:`column`,value:{name:`last_seen_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:21}},{table:`device_pairing_paired`,kind:`column`,value:{name:`last_seen_reason`,type:`text`,nullable:!0,identity:!1,default:null,position:22}},{table:`device_pairing_paired`,kind:`primaryKey`,value:[`device_id`]},{table:`device_pairing_paired`,kind:`indexes`,value:2},{table:`device_pairing_paired`,kind:`checks`,value:0},{table:`device_pairing_pending`,kind:`table`,value:null},{table:`device_pairing_pending`,kind:`column`,value:{name:`request_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`device_pairing_pending`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`device_pairing_pending`,kind:`column`,value:{name:`public_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`device_pairing_pending`,kind:`column`,value:{name:`display_name`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`device_pairing_pending`,kind:`column`,value:{name:`platform`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`device_pairing_pending`,kind:`column`,value:{name:`device_family`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`device_pairing_pending`,kind:`column`,value:{name:`client_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`device_pairing_pending`,kind:`column`,value:{name:`client_mode`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`device_pairing_pending`,kind:`column`,value:{name:`browser_origin`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`device_pairing_pending`,kind:`column`,value:{name:`role`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`device_pairing_pending`,kind:`column`,value:{name:`roles_json`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`device_pairing_pending`,kind:`column`,value:{name:`scopes_json`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`device_pairing_pending`,kind:`column`,value:{name:`remote_ip`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`device_pairing_pending`,kind:`column`,value:{name:`silent`,type:`bigint`,nullable:!0,identity:!1,default:null,position:14}},{table:`device_pairing_pending`,kind:`column`,value:{name:`is_repair`,type:`bigint`,nullable:!0,identity:!1,default:null,position:15}},{table:`device_pairing_pending`,kind:`column`,value:{name:`ts`,type:`bigint`,nullable:!1,identity:!1,default:null,position:16}},{table:`device_pairing_pending`,kind:`column`,value:{name:`refreshed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:17}},{table:`device_pairing_pending`,kind:`primaryKey`,value:[`request_id`]},{table:`device_pairing_pending`,kind:`indexes`,value:2},{table:`device_pairing_pending`,kind:`checks`,value:0},{table:`diagnostic_events`,kind:`table`,value:null},{table:`diagnostic_events`,kind:`column`,value:{name:`scope`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`diagnostic_events`,kind:`column`,value:{name:`event_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`diagnostic_events`,kind:`column`,value:{name:`payload_json`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`diagnostic_events`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`diagnostic_events`,kind:`column`,value:{name:`sequence`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:5}},{table:`diagnostic_events`,kind:`primaryKey`,value:[`scope`,`event_key`]},{table:`diagnostic_events`,kind:`indexes`,value:2},{table:`diagnostic_events`,kind:`checks`,value:0},{table:`durable_background_processes`,kind:`table`,value:null},{table:`durable_background_processes`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`durable_background_processes`,kind:`column`,value:{name:`record_json`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`durable_background_processes`,kind:`primaryKey`,value:[`id`]},{table:`durable_background_processes`,kind:`indexes`,value:1},{table:`durable_background_processes`,kind:`checks`,value:0},{table:`exec_approvals_config`,kind:`table`,value:null},{table:`exec_approvals_config`,kind:`column`,value:{name:`config_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`exec_approvals_config`,kind:`column`,value:{name:`raw_json`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`exec_approvals_config`,kind:`column`,value:{name:`socket_path`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`exec_approvals_config`,kind:`column`,value:{name:`has_socket_token`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`exec_approvals_config`,kind:`column`,value:{name:`default_security`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`exec_approvals_config`,kind:`column`,value:{name:`default_ask`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`exec_approvals_config`,kind:`column`,value:{name:`default_ask_fallback`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`exec_approvals_config`,kind:`column`,value:{name:`auto_allow_skills`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`exec_approvals_config`,kind:`column`,value:{name:`agent_count`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`exec_approvals_config`,kind:`column`,value:{name:`allowlist_count`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`exec_approvals_config`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`exec_approvals_config`,kind:`primaryKey`,value:[`config_key`]},{table:`exec_approvals_config`,kind:`indexes`,value:1},{table:`exec_approvals_config`,kind:`checks`,value:0},{table:`execution_decision_facts`,kind:`table`,value:null},{table:`execution_decision_facts`,kind:`column`,value:{name:`cursor_id`,type:`bigint`,nullable:!1,identity:!1,default:null,position:1}},{table:`execution_decision_facts`,kind:`column`,value:{name:`receipt_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`execution_decision_facts`,kind:`column`,value:{name:`context_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`execution_decision_facts`,kind:`column`,value:{name:`execution_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`execution_decision_facts`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`execution_decision_facts`,kind:`column`,value:{name:`action_id`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`execution_decision_facts`,kind:`column`,value:{name:`action_family`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`execution_decision_facts`,kind:`column`,value:{name:`decision_outcome`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`execution_decision_facts`,kind:`column`,value:{name:`coverage_state`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`execution_decision_facts`,kind:`column`,value:{name:`reason_code`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`execution_decision_facts`,kind:`column`,value:{name:`owner`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`execution_decision_facts`,kind:`column`,value:{name:`source_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`execution_decision_facts`,kind:`column`,value:{name:`occurred_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:13}},{table:`execution_decision_facts`,kind:`column`,value:{name:`receipt_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:14}},{table:`execution_decision_facts`,kind:`column`,value:{name:`receipt_json`,type:`text`,nullable:!1,identity:!1,default:null,position:15}},{table:`execution_decision_facts`,kind:`primaryKey`,value:[`receipt_id`]},{table:`execution_decision_facts`,kind:`unique`,value:[`occurred_at`,`receipt_id`]},{table:`execution_decision_facts`,kind:`indexes`,value:5},{table:`execution_decision_facts`,kind:`checks`,value:14},{table:`execution_identity_contexts`,kind:`table`,value:null},{table:`execution_identity_contexts`,kind:`column`,value:{name:`context_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`execution_identity_contexts`,kind:`column`,value:{name:`execution_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`execution_identity_contexts`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`execution_identity_contexts`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`execution_identity_contexts`,kind:`column`,value:{name:`coverage_state`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`execution_identity_contexts`,kind:`column`,value:{name:`context_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`execution_identity_contexts`,kind:`column`,value:{name:`context_json`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`execution_identity_contexts`,kind:`primaryKey`,value:[`context_id`]},{table:`execution_identity_contexts`,kind:`unique`,value:[`execution_id`]},{table:`execution_identity_contexts`,kind:`unique`,value:[`created_at`,`context_id`]},{table:`execution_identity_contexts`,kind:`indexes`,value:4},{table:`execution_identity_contexts`,kind:`checks`,value:7},{table:`execution_owner_lifecycle_bindings`,kind:`table`,value:null},{table:`execution_owner_lifecycle_bindings`,kind:`column`,value:{name:`owner_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`execution_owner_lifecycle_bindings`,kind:`column`,value:{name:`owner_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`execution_owner_lifecycle_bindings`,kind:`column`,value:{name:`context_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`execution_owner_lifecycle_bindings`,kind:`column`,value:{name:`execution_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`execution_owner_lifecycle_bindings`,kind:`primaryKey`,value:[`owner_kind`,`owner_id`]},{table:`execution_owner_lifecycle_bindings`,kind:`indexes`,value:1},{table:`execution_owner_lifecycle_bindings`,kind:`checks`,value:0},{table:`flow_runs`,kind:`table`,value:null},{table:`flow_runs`,kind:`column`,value:{name:`flow_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`flow_runs`,kind:`column`,value:{name:`shape`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`flow_runs`,kind:`column`,value:{name:`sync_mode`,type:`text`,nullable:!1,identity:!1,default:`'managed'`,position:3}},{table:`flow_runs`,kind:`column`,value:{name:`owner_key`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`flow_runs`,kind:`column`,value:{name:`requester_origin_json`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`flow_runs`,kind:`column`,value:{name:`controller_id`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`flow_runs`,kind:`column`,value:{name:`revision`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:7}},{table:`flow_runs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`flow_runs`,kind:`column`,value:{name:`notify_policy`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`flow_runs`,kind:`column`,value:{name:`goal`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`flow_runs`,kind:`column`,value:{name:`current_step`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`flow_runs`,kind:`column`,value:{name:`blocked_task_id`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`flow_runs`,kind:`column`,value:{name:`blocked_summary`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`flow_runs`,kind:`column`,value:{name:`state_json`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`flow_runs`,kind:`column`,value:{name:`wait_json`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`flow_runs`,kind:`column`,value:{name:`cancel_requested_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:16}},{table:`flow_runs`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:17}},{table:`flow_runs`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:18}},{table:`flow_runs`,kind:`column`,value:{name:`ended_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:19}},{table:`flow_runs`,kind:`primaryKey`,value:[`flow_id`]},{table:`flow_runs`,kind:`indexes`,value:4},{table:`flow_runs`,kind:`checks`,value:0},{table:`gateway_boot_lifecycle`,kind:`table`,value:null},{table:`gateway_boot_lifecycle`,kind:`column`,value:{name:`boot_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`gateway_boot_lifecycle`,kind:`column`,value:{name:`pid`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`gateway_boot_lifecycle`,kind:`column`,value:{name:`started_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`gateway_boot_lifecycle`,kind:`column`,value:{name:`completed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:4}},{table:`gateway_boot_lifecycle`,kind:`column`,value:{name:`outcome`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`gateway_boot_lifecycle`,kind:`column`,value:{name:`startup_reason`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`gateway_boot_lifecycle`,kind:`column`,value:{name:`reason`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`gateway_boot_lifecycle`,kind:`primaryKey`,value:[`boot_id`]},{table:`gateway_boot_lifecycle`,kind:`indexes`,value:2},{table:`gateway_boot_lifecycle`,kind:`checks`,value:0},{table:`gateway_restart_handoff`,kind:`table`,value:null},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`handoff_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`intent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`pid`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`process_instance_id`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`expires_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`reason`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`restart_trace_started_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:10}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`restart_trace_last_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:11}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`source`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`restart_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:13}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`supervisor_mode`,type:`text`,nullable:!1,identity:!1,default:null,position:14}},{table:`gateway_restart_handoff`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:15}},{table:`gateway_restart_handoff`,kind:`primaryKey`,value:[`handoff_key`]},{table:`gateway_restart_handoff`,kind:`indexes`,value:2},{table:`gateway_restart_handoff`,kind:`checks`,value:0},{table:`gateway_restart_intent`,kind:`table`,value:null},{table:`gateway_restart_intent`,kind:`column`,value:{name:`intent_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`gateway_restart_intent`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`gateway_restart_intent`,kind:`column`,value:{name:`pid`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`gateway_restart_intent`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`gateway_restart_intent`,kind:`column`,value:{name:`reason`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`gateway_restart_intent`,kind:`column`,value:{name:`force`,type:`bigint`,nullable:!0,identity:!1,default:null,position:6}},{table:`gateway_restart_intent`,kind:`column`,value:{name:`wait_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:7}},{table:`gateway_restart_intent`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`gateway_restart_intent`,kind:`primaryKey`,value:[`intent_key`]},{table:`gateway_restart_intent`,kind:`indexes`,value:1},{table:`gateway_restart_intent`,kind:`checks`,value:0},{table:`gateway_restart_sentinel`,kind:`table`,value:null},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`sentinel_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`ts`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`thread_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`delivery_channel`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`delivery_to`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`delivery_account_id`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`message`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`continuation_json`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`doctor_hint`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`stats_json`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`payload_json`,type:`text`,nullable:!1,identity:!1,default:null,position:15}},{table:`gateway_restart_sentinel`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:16}},{table:`gateway_restart_sentinel`,kind:`primaryKey`,value:[`sentinel_key`]},{table:`gateway_restart_sentinel`,kind:`indexes`,value:2},{table:`gateway_restart_sentinel`,kind:`checks`,value:0},{table:`github_personal_publication_requests`,kind:`table`,value:null},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`request_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`owner_profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`connection_generation`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`idempotency_key`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`request_digest`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`worktree_id`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`repository_fingerprint`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`identity_source`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`identity_profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`identity_account_id`,type:`bigint`,nullable:!1,identity:!1,default:null,position:13}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`identity_login`,type:`text`,nullable:!1,identity:!1,default:null,position:14}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`title`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`body`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:17}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`gateway_instance_id`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`execution_id`,type:`text`,nullable:!0,identity:!1,default:null,position:19}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`last_effect`,type:`text`,nullable:!0,identity:!1,default:null,position:20}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`effect_state`,type:`text`,nullable:!0,identity:!1,default:null,position:21}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`push_repository`,type:`text`,nullable:!1,identity:!1,default:null,position:22}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`repository`,type:`text`,nullable:!1,identity:!1,default:null,position:23}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`branch`,type:`text`,nullable:!1,identity:!1,default:null,position:24}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`base_branch`,type:`text`,nullable:!1,identity:!1,default:null,position:25}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`source_head_commit`,type:`text`,nullable:!1,identity:!1,default:null,position:26}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`source_index_tree`,type:`text`,nullable:!1,identity:!1,default:null,position:27}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`workspace_tree`,type:`text`,nullable:!1,identity:!1,default:null,position:28}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`head_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:29}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`pull_request_url`,type:`text`,nullable:!0,identity:!1,default:null,position:30}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`error_code`,type:`text`,nullable:!0,identity:!1,default:null,position:31}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`next_action`,type:`text`,nullable:!0,identity:!1,default:null,position:32}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:33}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:34}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`reported_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:35}},{table:`github_personal_publication_requests`,kind:`column`,value:{name:`draft`,type:`bigint`,nullable:!0,identity:!1,default:null,position:36}},{table:`github_personal_publication_requests`,kind:`primaryKey`,value:[`request_id`]},{table:`github_personal_publication_requests`,kind:`unique`,value:[`owner_profile_id`,`session_id`,`idempotency_key`]},{table:`github_personal_publication_requests`,kind:`indexes`,value:4},{table:`github_personal_publication_requests`,kind:`checks`,value:37},{table:`github_publication_requests`,kind:`table`,value:null},{table:`github_publication_requests`,kind:`column`,value:{name:`request_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`github_publication_requests`,kind:`column`,value:{name:`idempotency_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`github_publication_requests`,kind:`column`,value:{name:`request_digest`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`github_publication_requests`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`github_publication_requests`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`github_publication_requests`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`github_publication_requests`,kind:`column`,value:{name:`worktree_id`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`github_publication_requests`,kind:`column`,value:{name:`repository_fingerprint`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`github_publication_requests`,kind:`column`,value:{name:`claim_id`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`github_publication_requests`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`github_publication_requests`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`github_publication_requests`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!0,identity:!1,default:null,position:12}},{table:`github_publication_requests`,kind:`column`,value:{name:`placement_generation`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`github_publication_requests`,kind:`column`,value:{name:`identity_source`,type:`text`,nullable:!1,identity:!1,default:null,position:14}},{table:`github_publication_requests`,kind:`column`,value:{name:`identity_profile_id`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`github_publication_requests`,kind:`column`,value:{name:`identity_account_id`,type:`bigint`,nullable:!1,identity:!1,default:null,position:16}},{table:`github_publication_requests`,kind:`column`,value:{name:`identity_login`,type:`text`,nullable:!1,identity:!1,default:null,position:17}},{table:`github_publication_requests`,kind:`column`,value:{name:`title`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`github_publication_requests`,kind:`column`,value:{name:`body`,type:`text`,nullable:!0,identity:!1,default:null,position:19}},{table:`github_publication_requests`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:20}},{table:`github_publication_requests`,kind:`column`,value:{name:`gateway_instance_id`,type:`text`,nullable:!0,identity:!1,default:null,position:21}},{table:`github_publication_requests`,kind:`column`,value:{name:`repository`,type:`text`,nullable:!0,identity:!1,default:null,position:22}},{table:`github_publication_requests`,kind:`column`,value:{name:`branch`,type:`text`,nullable:!1,identity:!1,default:null,position:23}},{table:`github_publication_requests`,kind:`column`,value:{name:`base_branch`,type:`text`,nullable:!0,identity:!1,default:null,position:24}},{table:`github_publication_requests`,kind:`column`,value:{name:`source_head_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:25}},{table:`github_publication_requests`,kind:`column`,value:{name:`source_index_tree`,type:`text`,nullable:!0,identity:!1,default:null,position:26}},{table:`github_publication_requests`,kind:`column`,value:{name:`workspace_tree`,type:`text`,nullable:!0,identity:!1,default:null,position:27}},{table:`github_publication_requests`,kind:`column`,value:{name:`head_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:28}},{table:`github_publication_requests`,kind:`column`,value:{name:`pull_request_url`,type:`text`,nullable:!0,identity:!1,default:null,position:29}},{table:`github_publication_requests`,kind:`column`,value:{name:`error_code`,type:`text`,nullable:!0,identity:!1,default:null,position:30}},{table:`github_publication_requests`,kind:`column`,value:{name:`next_action`,type:`text`,nullable:!0,identity:!1,default:null,position:31}},{table:`github_publication_requests`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:32}},{table:`github_publication_requests`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:33}},{table:`github_publication_requests`,kind:`column`,value:{name:`reported_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:34}},{table:`github_publication_requests`,kind:`column`,value:{name:`draft`,type:`bigint`,nullable:!0,identity:!1,default:null,position:35}},{table:`github_publication_requests`,kind:`primaryKey`,value:[`request_id`]},{table:`github_publication_requests`,kind:`unique`,value:[`session_id`,`idempotency_key`]},{table:`github_publication_requests`,kind:`indexes`,value:3},{table:`github_publication_requests`,kind:`checks`,value:9},{table:`github_publication_session_lifecycles`,kind:`table`,value:null},{table:`github_publication_session_lifecycles`,kind:`column`,value:{name:`publication_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`github_publication_session_lifecycles`,kind:`column`,value:{name:`request_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`github_publication_session_lifecycles`,kind:`column`,value:{name:`lifecycle_revision`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`github_publication_session_lifecycles`,kind:`column`,value:{name:`requester_authority_json`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`github_publication_session_lifecycles`,kind:`primaryKey`,value:[`publication_kind`,`request_id`]},{table:`github_publication_session_lifecycles`,kind:`indexes`,value:1},{table:`github_publication_session_lifecycles`,kind:`checks`,value:1},{table:`github_repository_publication_requests`,kind:`table`,value:null},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`request_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`owner_profile_id`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`connection_generation`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`idempotency_key`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`request_digest`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`session_lifecycle_revision`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`requester_authority_json`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`workspace_id`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`checkpoint_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`checkpoint_digest`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`claim_id`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!0,identity:!1,default:null,position:17}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`placement_generation`,type:`bigint`,nullable:!0,identity:!1,default:null,position:18}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`identity_source`,type:`text`,nullable:!1,identity:!1,default:null,position:19}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`identity_profile_id`,type:`text`,nullable:!0,identity:!1,default:null,position:20}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`identity_account_id`,type:`bigint`,nullable:!1,identity:!1,default:null,position:21}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`identity_login`,type:`text`,nullable:!1,identity:!1,default:null,position:22}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`title`,type:`text`,nullable:!0,identity:!1,default:null,position:23}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`body`,type:`text`,nullable:!0,identity:!1,default:null,position:24}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:25}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`gateway_instance_id`,type:`text`,nullable:!0,identity:!1,default:null,position:26}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`execution_id`,type:`text`,nullable:!0,identity:!1,default:null,position:27}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`last_effect`,type:`text`,nullable:!0,identity:!1,default:null,position:28}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`effect_state`,type:`text`,nullable:!0,identity:!1,default:null,position:29}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`push_repository`,type:`text`,nullable:!0,identity:!1,default:null,position:30}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`repository`,type:`text`,nullable:!0,identity:!1,default:null,position:31}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`branch`,type:`text`,nullable:!1,identity:!1,default:null,position:32}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`base_branch`,type:`text`,nullable:!0,identity:!1,default:null,position:33}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`source_head_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:34}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`source_index_tree`,type:`text`,nullable:!0,identity:!1,default:null,position:35}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`workspace_tree`,type:`text`,nullable:!0,identity:!1,default:null,position:36}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`previous_head_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:37}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`pushed_head_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:38}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`head_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:39}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`pull_request_url`,type:`text`,nullable:!0,identity:!1,default:null,position:40}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`error_code`,type:`text`,nullable:!0,identity:!1,default:null,position:41}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`next_action`,type:`text`,nullable:!0,identity:!1,default:null,position:42}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:43}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:44}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`reported_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:45}},{table:`github_repository_publication_requests`,kind:`column`,value:{name:`draft`,type:`bigint`,nullable:!0,identity:!1,default:null,position:46}},{table:`github_repository_publication_requests`,kind:`primaryKey`,value:[`request_id`]},{table:`github_repository_publication_requests`,kind:`indexes`,value:3},{table:`github_repository_publication_requests`,kind:`checks`,value:7},{table:`local_workspace_manifest_nodes`,kind:`table`,value:null},{table:`local_workspace_manifest_nodes`,kind:`column`,value:{name:`worktree_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`local_workspace_manifest_nodes`,kind:`column`,value:{name:`path`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`local_workspace_manifest_nodes`,kind:`column`,value:{name:`node_json`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`local_workspace_manifest_nodes`,kind:`primaryKey`,value:[`worktree_id`,`path`]},{table:`local_workspace_manifest_nodes`,kind:`foreignKey`,value:{columns:[`worktree_id`],target:`local_workspace_projections`,targetColumns:[`worktree_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`local_workspace_manifest_nodes`,kind:`indexes`,value:1},{table:`local_workspace_manifest_nodes`,kind:`checks`,value:0},{table:`local_workspace_projections`,kind:`table`,value:null},{table:`local_workspace_projections`,kind:`column`,value:{name:`worktree_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`local_workspace_projections`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`local_workspace_projections`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`local_workspace_projections`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`local_workspace_projections`,kind:`column`,value:{name:`lifecycle_revision`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`local_workspace_projections`,kind:`column`,value:{name:`projection_path`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`local_workspace_projections`,kind:`column`,value:{name:`base_commit`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`local_workspace_projections`,kind:`column`,value:{name:`source_paths_json`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`local_workspace_projections`,kind:`column`,value:{name:`baseline_json`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`local_workspace_projections`,kind:`column`,value:{name:`baseline_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`local_workspace_projections`,kind:`column`,value:{name:`pending_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`local_workspace_projections`,kind:`column`,value:{name:`pending_target`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`local_workspace_projections`,kind:`column`,value:{name:`paused_runtimes_json`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`local_workspace_projections`,kind:`column`,value:{name:`journal_json`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`local_workspace_projections`,kind:`column`,value:{name:`journal_pack`,type:`bytea`,nullable:!0,identity:!1,default:null,position:15}},{table:`local_workspace_projections`,kind:`column`,value:{name:`revision`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:16}},{table:`local_workspace_projections`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:17}},{table:`local_workspace_projections`,kind:`column`,value:{name:`checkpoint_json`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`local_workspace_projections`,kind:`column`,value:{name:`tree_root_digest`,type:`bytea`,nullable:!0,identity:!1,default:null,position:19}},{table:`local_workspace_projections`,kind:`column`,value:{name:`source_paths_digest`,type:`bytea`,nullable:!0,identity:!1,default:null,position:20}},{table:`local_workspace_projections`,kind:`column`,value:{name:`canonical_fingerprints`,type:`bytea`,nullable:!0,identity:!1,default:null,position:21}},{table:`local_workspace_projections`,kind:`column`,value:{name:`projection_fingerprints`,type:`bytea`,nullable:!0,identity:!1,default:null,position:22}},{table:`local_workspace_projections`,kind:`primaryKey`,value:[`worktree_id`]},{table:`local_workspace_projections`,kind:`unique`,value:[`projection_path`]},{table:`local_workspace_projections`,kind:`indexes`,value:2},{table:`local_workspace_projections`,kind:`checks`,value:5},{table:`local_workspace_source_path_sets`,kind:`table`,value:null},{table:`local_workspace_source_path_sets`,kind:`column`,value:{name:`path_digest`,type:`bytea`,nullable:!1,identity:!1,default:null,position:1}},{table:`local_workspace_source_path_sets`,kind:`column`,value:{name:`paths_zstd`,type:`bytea`,nullable:!1,identity:!1,default:null,position:2}},{table:`local_workspace_source_path_sets`,kind:`column`,value:{name:`sweep_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`local_workspace_source_path_sets`,kind:`primaryKey`,value:[`path_digest`]},{table:`local_workspace_source_path_sets`,kind:`indexes`,value:1},{table:`local_workspace_source_path_sets`,kind:`checks`,value:1},{table:`local_workspace_tree_packs`,kind:`table`,value:null},{table:`local_workspace_tree_packs`,kind:`column`,value:{name:`tree_digest`,type:`bytea`,nullable:!1,identity:!1,default:null,position:1}},{table:`local_workspace_tree_packs`,kind:`column`,value:{name:`records_json`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`local_workspace_tree_packs`,kind:`column`,value:{name:`children_json`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`local_workspace_tree_packs`,kind:`column`,value:{name:`sweep_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`local_workspace_tree_packs`,kind:`primaryKey`,value:[`tree_digest`]},{table:`local_workspace_tree_packs`,kind:`indexes`,value:1},{table:`local_workspace_tree_packs`,kind:`checks`,value:1},{table:`macos_port_guardian_records`,kind:`table`,value:null},{table:`macos_port_guardian_records`,kind:`column`,value:{name:`pid`,type:`bigint`,nullable:!1,identity:!0,default:null,position:1}},{table:`macos_port_guardian_records`,kind:`column`,value:{name:`port`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`macos_port_guardian_records`,kind:`column`,value:{name:`command`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`macos_port_guardian_records`,kind:`column`,value:{name:`mode`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`macos_port_guardian_records`,kind:`column`,value:{name:`timestamp`,type:`double precision`,nullable:!1,identity:!1,default:null,position:5}},{table:`macos_port_guardian_records`,kind:`primaryKey`,value:[`pid`]},{table:`macos_port_guardian_records`,kind:`indexes`,value:2},{table:`macos_port_guardian_records`,kind:`checks`,value:0},{table:`managed_outgoing_image_records`,kind:`table`,value:null},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`attachment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`message_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`created_at`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`updated_at`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`retention_class`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`alt`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_media_root`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_media_id`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_media_subdir`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_content_type`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_width`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_height`,type:`bigint`,nullable:!0,identity:!1,default:null,position:14}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_size_bytes`,type:`bigint`,nullable:!0,identity:!1,default:null,position:15}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`original_filename`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`record_json`,type:`text`,nullable:!1,identity:!1,default:null,position:17}},{table:`managed_outgoing_image_records`,kind:`column`,value:{name:`cleanup_pending`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:18}},{table:`managed_outgoing_image_records`,kind:`primaryKey`,value:[`attachment_id`]},{table:`managed_outgoing_image_records`,kind:`indexes`,value:5},{table:`managed_outgoing_image_records`,kind:`checks`,value:1},{table:`mcp_oauth_pending_authorizations`,kind:`table`,value:null},{table:`mcp_oauth_pending_authorizations`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`mcp_oauth_pending_authorizations`,kind:`column`,value:{name:`store_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`mcp_oauth_pending_authorizations`,kind:`column`,value:{name:`create_time`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`mcp_oauth_pending_authorizations`,kind:`primaryKey`,value:[`state`]},{table:`mcp_oauth_pending_authorizations`,kind:`indexes`,value:1},{table:`mcp_oauth_pending_authorizations`,kind:`checks`,value:0},{table:`mcp_oauth_stores`,kind:`table`,value:null},{table:`mcp_oauth_stores`,kind:`column`,value:{name:`store_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`mcp_oauth_stores`,kind:`column`,value:{name:`format_version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`mcp_oauth_stores`,kind:`column`,value:{name:`store_json`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`mcp_oauth_stores`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`mcp_oauth_stores`,kind:`primaryKey`,value:[`store_key`]},{table:`mcp_oauth_stores`,kind:`indexes`,value:1},{table:`mcp_oauth_stores`,kind:`checks`,value:1},{table:`meeting_transcript_sessions`,kind:`table`,value:null},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`started_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:1}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`started_at`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`selector`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`export_key`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`session_slug`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`provider_id`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`title`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`source_json`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`source_account_id`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`source_guild_id`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`source_channel_id`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`source_meeting_url`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`source_thread_ts`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`source_file_id`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`stopped_at`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`metadata_json`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`metadata_agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`export_manifest_json`,type:`text`,nullable:!1,identity:!1,default:`'{}'`,position:19}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`export_pending_json`,type:`text`,nullable:!1,identity:!1,default:`'[]'`,position:20}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`next_utterance_seq`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:21}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:22}},{table:`meeting_transcript_sessions`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:23}},{table:`meeting_transcript_sessions`,kind:`primaryKey`,value:[`session_id`,`started_at`]},{table:`meeting_transcript_sessions`,kind:`unique`,value:[`selector`]},{table:`meeting_transcript_sessions`,kind:`indexes`,value:10},{table:`meeting_transcript_sessions`,kind:`checks`,value:3},{table:`meeting_transcript_summaries`,kind:`table`,value:null},{table:`meeting_transcript_summaries`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`meeting_transcript_summaries`,kind:`column`,value:{name:`session_started_at`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`meeting_transcript_summaries`,kind:`column`,value:{name:`generated_at`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`meeting_transcript_summaries`,kind:`column`,value:{name:`summary_json`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`meeting_transcript_summaries`,kind:`column`,value:{name:`overview`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`meeting_transcript_summaries`,kind:`column`,value:{name:`markdown`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`meeting_transcript_summaries`,kind:`column`,value:{name:`utterance_count`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`meeting_transcript_summaries`,kind:`primaryKey`,value:[`session_id`,`session_started_at`]},{table:`meeting_transcript_summaries`,kind:`foreignKey`,value:{columns:[`session_id`,`session_started_at`],target:`meeting_transcript_sessions`,targetColumns:[`session_id`,`started_at`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`meeting_transcript_summaries`,kind:`indexes`,value:1},{table:`meeting_transcript_summaries`,kind:`checks`,value:2},{table:`meeting_transcript_utterances`,kind:`table`,value:null},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`session_started_at`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`sequence`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`utterance_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`started_at`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`ended_at`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`speaker_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`speaker_label`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`text`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`final`,type:`bigint`,nullable:!0,identity:!1,default:null,position:10}},{table:`meeting_transcript_utterances`,kind:`column`,value:{name:`metadata_json`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`meeting_transcript_utterances`,kind:`primaryKey`,value:[`session_id`,`session_started_at`,`sequence`]},{table:`meeting_transcript_utterances`,kind:`foreignKey`,value:{columns:[`session_id`,`session_started_at`],target:`meeting_transcript_sessions`,targetColumns:[`session_id`,`started_at`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`meeting_transcript_utterances`,kind:`indexes`,value:2},{table:`meeting_transcript_utterances`,kind:`checks`,value:2},{table:`migration_runs`,kind:`table`,value:null},{table:`migration_runs`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`migration_runs`,kind:`column`,value:{name:`started_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`migration_runs`,kind:`column`,value:{name:`finished_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`migration_runs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`migration_runs`,kind:`column`,value:{name:`report_json`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`migration_runs`,kind:`primaryKey`,value:[`id`]},{table:`migration_runs`,kind:`indexes`,value:2},{table:`migration_runs`,kind:`checks`,value:0},{table:`migration_sources`,kind:`table`,value:null},{table:`migration_sources`,kind:`column`,value:{name:`source_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`migration_sources`,kind:`column`,value:{name:`migration_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`migration_sources`,kind:`column`,value:{name:`source_path`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`migration_sources`,kind:`column`,value:{name:`target_table`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`migration_sources`,kind:`column`,value:{name:`source_sha256`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`migration_sources`,kind:`column`,value:{name:`source_size_bytes`,type:`bigint`,nullable:!0,identity:!1,default:null,position:6}},{table:`migration_sources`,kind:`column`,value:{name:`source_record_count`,type:`bigint`,nullable:!0,identity:!1,default:null,position:7}},{table:`migration_sources`,kind:`column`,value:{name:`last_run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`migration_sources`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`migration_sources`,kind:`column`,value:{name:`imported_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`migration_sources`,kind:`column`,value:{name:`removed_source`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:11}},{table:`migration_sources`,kind:`column`,value:{name:`report_json`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`migration_sources`,kind:`primaryKey`,value:[`source_key`]},{table:`migration_sources`,kind:`foreignKey`,value:{columns:[`last_run_id`],target:`migration_runs`,targetColumns:[`id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`migration_sources`,kind:`indexes`,value:3},{table:`migration_sources`,kind:`checks`,value:0},{table:`native_hook_relay_bridges`,kind:`table`,value:null},{table:`native_hook_relay_bridges`,kind:`column`,value:{name:`relay_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`native_hook_relay_bridges`,kind:`column`,value:{name:`pid`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`native_hook_relay_bridges`,kind:`column`,value:{name:`hostname`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`native_hook_relay_bridges`,kind:`column`,value:{name:`port`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`native_hook_relay_bridges`,kind:`column`,value:{name:`token`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`native_hook_relay_bridges`,kind:`column`,value:{name:`expires_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`native_hook_relay_bridges`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`native_hook_relay_bridges`,kind:`primaryKey`,value:[`relay_id`]},{table:`native_hook_relay_bridges`,kind:`indexes`,value:2},{table:`native_hook_relay_bridges`,kind:`checks`,value:0},{table:`node_worker_launch_boots`,kind:`table`,value:null},{table:`node_worker_launch_boots`,kind:`column`,value:{name:`launch_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`node_worker_launch_boots`,kind:`column`,value:{name:`boot_id`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`node_worker_launch_boots`,kind:`primaryKey`,value:[`launch_id`]},{table:`node_worker_launch_boots`,kind:`foreignKey`,value:{columns:[`launch_id`],target:`node_worker_launches`,targetColumns:[`launch_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`node_worker_launch_boots`,kind:`indexes`,value:1},{table:`node_worker_launch_boots`,kind:`checks`,value:1},{table:`node_worker_launch_cleanup`,kind:`table`,value:null},{table:`node_worker_launch_cleanup`,kind:`column`,value:{name:`launch_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`node_worker_launch_cleanup`,kind:`column`,value:{name:`cleanup_mode`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`node_worker_launch_cleanup`,kind:`column`,value:{name:`lineage_settled`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`node_worker_launch_cleanup`,kind:`primaryKey`,value:[`launch_id`]},{table:`node_worker_launch_cleanup`,kind:`foreignKey`,value:{columns:[`launch_id`],target:`node_worker_launches`,targetColumns:[`launch_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`node_worker_launch_cleanup`,kind:`indexes`,value:1},{table:`node_worker_launch_cleanup`,kind:`checks`,value:2},{table:`node_worker_launch_containers`,kind:`table`,value:null},{table:`node_worker_launch_containers`,kind:`column`,value:{name:`launch_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`node_worker_launch_containers`,kind:`column`,value:{name:`container_json`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`node_worker_launch_containers`,kind:`primaryKey`,value:[`launch_id`]},{table:`node_worker_launch_containers`,kind:`indexes`,value:1},{table:`node_worker_launch_containers`,kind:`checks`,value:0},{table:`node_worker_launch_process_scopes`,kind:`table`,value:null},{table:`node_worker_launch_process_scopes`,kind:`column`,value:{name:`launch_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`node_worker_launch_process_scopes`,kind:`column`,value:{name:`scope_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`node_worker_launch_process_scopes`,kind:`column`,value:{name:`descendants_reaped`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`node_worker_launch_process_scopes`,kind:`primaryKey`,value:[`launch_id`]},{table:`node_worker_launch_process_scopes`,kind:`foreignKey`,value:{columns:[`launch_id`],target:`node_worker_launches`,targetColumns:[`launch_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`node_worker_launch_process_scopes`,kind:`indexes`,value:1},{table:`node_worker_launch_process_scopes`,kind:`checks`,value:2},{table:`node_worker_launches`,kind:`table`,value:null},{table:`node_worker_launches`,kind:`column`,value:{name:`launch_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`node_worker_launches`,kind:`column`,value:{name:`plan_hash`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`node_worker_launches`,kind:`column`,value:{name:`gateway_namespace`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`node_worker_launches`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`node_worker_launches`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`node_worker_launches`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`node_worker_launches`,kind:`column`,value:{name:`placement_generation`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`node_worker_launches`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`node_worker_launches`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`node_worker_launches`,kind:`column`,value:{name:`supervisor_pid`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`node_worker_launches`,kind:`column`,value:{name:`supervisor_start_time`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`node_worker_launches`,kind:`column`,value:{name:`worker_pid`,type:`bigint`,nullable:!0,identity:!1,default:null,position:12}},{table:`node_worker_launches`,kind:`column`,value:{name:`worker_start_time`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`node_worker_launches`,kind:`column`,value:{name:`result_json`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`node_worker_launches`,kind:`column`,value:{name:`error_text`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`node_worker_launches`,kind:`column`,value:{name:`completed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:16}},{table:`node_worker_launches`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:17}},{table:`node_worker_launches`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:18}},{table:`node_worker_launches`,kind:`primaryKey`,value:[`launch_id`]},{table:`node_worker_launches`,kind:`indexes`,value:2},{table:`node_worker_launches`,kind:`checks`,value:20},{table:`node_worker_prepared_workspaces`,kind:`table`,value:null},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`preparation_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`cache_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`gateway_namespace`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`workspace_dir`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`home_dir`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`source_manifest_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`prepared_manifest_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!0,identity:!1,default:null,position:12}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:13}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`bound_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:14}},{table:`node_worker_prepared_workspaces`,kind:`column`,value:{name:`retired_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:15}},{table:`node_worker_prepared_workspaces`,kind:`primaryKey`,value:[`preparation_key`]},{table:`node_worker_prepared_workspaces`,kind:`unique`,value:[`workspace_dir`]},{table:`node_worker_prepared_workspaces`,kind:`indexes`,value:2},{table:`node_worker_prepared_workspaces`,kind:`checks`,value:15},{table:`node_worker_turns`,kind:`table`,value:null},{table:`node_worker_turns`,kind:`column`,value:{name:`turn_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`node_worker_turns`,kind:`column`,value:{name:`owner_launch_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`node_worker_turns`,kind:`column`,value:{name:`plan_hash`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`node_worker_turns`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`node_worker_turns`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`node_worker_turns`,kind:`column`,value:{name:`result_json`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`node_worker_turns`,kind:`column`,value:{name:`error_text`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`node_worker_turns`,kind:`column`,value:{name:`completed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`node_worker_turns`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`node_worker_turns`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`node_worker_turns`,kind:`primaryKey`,value:[`turn_id`]},{table:`node_worker_turns`,kind:`foreignKey`,value:{columns:[`owner_launch_id`],target:`node_worker_launches`,targetColumns:[`launch_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`node_worker_turns`,kind:`indexes`,value:3},{table:`node_worker_turns`,kind:`checks`,value:10},{table:`official_external_plugin_catalog_snapshots`,kind:`table`,value:null},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`feed_url`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`body`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`status`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`etag`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`last_modified`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`checksum`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`saved_at`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`trust_mode`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`trust_key_id`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`trust_signature_count`,type:`bigint`,nullable:!0,identity:!1,default:null,position:10}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`trust_threshold`,type:`bigint`,nullable:!0,identity:!1,default:null,position:11}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`trust_verified_at`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`official_external_plugin_catalog_snapshots`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:13}},{table:`official_external_plugin_catalog_snapshots`,kind:`primaryKey`,value:[`feed_url`]},{table:`official_external_plugin_catalog_snapshots`,kind:`indexes`,value:2},{table:`official_external_plugin_catalog_snapshots`,kind:`checks`,value:0},{table:`operator_approval_execution_identities`,kind:`table`,value:null},{table:`operator_approval_execution_identities`,kind:`column`,value:{name:`approval_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`operator_approval_execution_identities`,kind:`column`,value:{name:`source_context_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`operator_approval_execution_identities`,kind:`column`,value:{name:`source_execution_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`operator_approval_execution_identities`,kind:`primaryKey`,value:[`approval_id`]},{table:`operator_approval_execution_identities`,kind:`foreignKey`,value:{columns:[`approval_id`],target:`operator_approvals`,targetColumns:[`approval_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`operator_approval_execution_identities`,kind:`indexes`,value:1},{table:`operator_approval_execution_identities`,kind:`checks`,value:2},{table:`operator_approval_standing_grant_generations`,kind:`table`,value:null},{table:`operator_approval_standing_grant_generations`,kind:`column`,value:{name:`grant_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`operator_approval_standing_grant_generations`,kind:`column`,value:{name:`job_definition_generation`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`operator_approval_standing_grant_generations`,kind:`primaryKey`,value:[`grant_id`]},{table:`operator_approval_standing_grant_generations`,kind:`foreignKey`,value:{columns:[`grant_id`],target:`operator_approval_standing_grants`,targetColumns:[`grant_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`operator_approval_standing_grant_generations`,kind:`indexes`,value:1},{table:`operator_approval_standing_grant_generations`,kind:`checks`,value:1},{table:`operator_approval_standing_grants`,kind:`table`,value:null},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`grant_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`minted_by_approval_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`cron_job_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`job_config_revision`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`operation_binding`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`expires_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`revoked_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:9}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`revoked_by`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`last_used_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:11}},{table:`operator_approval_standing_grants`,kind:`column`,value:{name:`use_count`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:12}},{table:`operator_approval_standing_grants`,kind:`primaryKey`,value:[`grant_id`]},{table:`operator_approval_standing_grants`,kind:`foreignKey`,value:{columns:[`minted_by_approval_id`],target:`operator_approvals`,targetColumns:[`approval_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`operator_approval_standing_grants`,kind:`indexes`,value:2},{table:`operator_approval_standing_grants`,kind:`checks`,value:6},{table:`operator_approvals`,kind:`table`,value:null},{table:`operator_approvals`,kind:`column`,value:{name:`cursor_id`,type:`bigint`,nullable:!1,identity:!1,default:null,position:1}},{table:`operator_approvals`,kind:`column`,value:{name:`approval_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`operator_approvals`,kind:`column`,value:{name:`resolution_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`operator_approvals`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`operator_approvals`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`operator_approvals`,kind:`column`,value:{name:`presentation_json`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`operator_approvals`,kind:`column`,value:{name:`requested_by_device_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`operator_approvals`,kind:`column`,value:{name:`requested_by_client_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`operator_approvals`,kind:`column`,value:{name:`requested_by_device_token_auth`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:9}},{table:`operator_approvals`,kind:`column`,value:{name:`reviewer_device_ids_json`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`operator_approvals`,kind:`column`,value:{name:`source_agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`operator_approvals`,kind:`column`,value:{name:`source_session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`operator_approvals`,kind:`column`,value:{name:`source_session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`operator_approvals`,kind:`column`,value:{name:`source_run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`operator_approvals`,kind:`column`,value:{name:`source_tool_call_id`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`operator_approvals`,kind:`column`,value:{name:`source_tool_name`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`operator_approvals`,kind:`column`,value:{name:`audience_session_keys_json`,type:`text`,nullable:!1,identity:!1,default:null,position:17}},{table:`operator_approvals`,kind:`column`,value:{name:`runtime_epoch`,type:`text`,nullable:!1,identity:!1,default:null,position:18}},{table:`operator_approvals`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:19}},{table:`operator_approvals`,kind:`column`,value:{name:`expires_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:20}},{table:`operator_approvals`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:21}},{table:`operator_approvals`,kind:`column`,value:{name:`decision`,type:`text`,nullable:!0,identity:!1,default:null,position:22}},{table:`operator_approvals`,kind:`column`,value:{name:`terminal_reason`,type:`text`,nullable:!0,identity:!1,default:null,position:23}},{table:`operator_approvals`,kind:`column`,value:{name:`resolved_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:24}},{table:`operator_approvals`,kind:`column`,value:{name:`resolver_kind`,type:`text`,nullable:!0,identity:!1,default:null,position:25}},{table:`operator_approvals`,kind:`column`,value:{name:`resolver_id`,type:`text`,nullable:!0,identity:!1,default:null,position:26}},{table:`operator_approvals`,kind:`column`,value:{name:`consumed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:27}},{table:`operator_approvals`,kind:`column`,value:{name:`consumed_by`,type:`text`,nullable:!0,identity:!1,default:null,position:28}},{table:`operator_approvals`,kind:`primaryKey`,value:[`approval_id`]},{table:`operator_approvals`,kind:`indexes`,value:8},{table:`operator_approvals`,kind:`checks`,value:16},{table:`outbound_media_provenance`,kind:`table`,value:null},{table:`outbound_media_provenance`,kind:`column`,value:{name:`realpath`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`outbound_media_provenance`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`outbound_media_provenance`,kind:`column`,value:{name:`version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`outbound_media_provenance`,kind:`column`,value:{name:`sha256`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`outbound_media_provenance`,kind:`column`,value:{name:`size_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`outbound_media_provenance`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`outbound_media_provenance`,kind:`primaryKey`,value:[`realpath`]},{table:`outbound_media_provenance`,kind:`indexes`,value:1},{table:`outbound_media_provenance`,kind:`checks`,value:0},{table:`outbound_message_execution_bindings`,kind:`table`,value:null},{table:`outbound_message_execution_bindings`,kind:`column`,value:{name:`event_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`outbound_message_execution_bindings`,kind:`column`,value:{name:`context_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`outbound_message_execution_bindings`,kind:`column`,value:{name:`execution_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`outbound_message_execution_bindings`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`outbound_message_execution_bindings`,kind:`primaryKey`,value:[`event_id`]},{table:`outbound_message_execution_bindings`,kind:`foreignKey`,value:{columns:[`event_id`],target:`audit_events`,targetColumns:[`event_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`outbound_message_execution_bindings`,kind:`indexes`,value:2},{table:`outbound_message_execution_bindings`,kind:`checks`,value:3},{table:`outbound_message_progress`,kind:`table`,value:null},{table:`outbound_message_progress`,kind:`column`,value:{name:`sequence`,type:`bigint`,nullable:!1,identity:!0,default:null,position:1}},{table:`outbound_message_progress`,kind:`column`,value:{name:`progress_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`outbound_message_progress`,kind:`column`,value:{name:`source_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`outbound_message_progress`,kind:`column`,value:{name:`source_sequence`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`outbound_message_progress`,kind:`column`,value:{name:`schema_version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`outbound_message_progress`,kind:`column`,value:{name:`occurred_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`outbound_message_progress`,kind:`column`,value:{name:`action`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`outbound_message_progress`,kind:`column`,value:{name:`outcome`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`outbound_message_progress`,kind:`column`,value:{name:`actor_type`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`outbound_message_progress`,kind:`column`,value:{name:`actor_id`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`outbound_message_progress`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`outbound_message_progress`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`outbound_message_progress`,kind:`column`,value:{name:`context_id`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`outbound_message_progress`,kind:`column`,value:{name:`execution_id`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`outbound_message_progress`,kind:`column`,value:{name:`channel`,type:`text`,nullable:!1,identity:!1,default:null,position:15}},{table:`outbound_message_progress`,kind:`column`,value:{name:`conversation_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:16}},{table:`outbound_message_progress`,kind:`column`,value:{name:`duration_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:17}},{table:`outbound_message_progress`,kind:`column`,value:{name:`account_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`outbound_message_progress`,kind:`column`,value:{name:`conversation_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:19}},{table:`outbound_message_progress`,kind:`column`,value:{name:`target_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:20}},{table:`outbound_message_progress`,kind:`primaryKey`,value:[`sequence`]},{table:`outbound_message_progress`,kind:`unique`,value:[`progress_id`]},{table:`outbound_message_progress`,kind:`unique`,value:[`source_id`]},{table:`outbound_message_progress`,kind:`unique`,value:[`occurred_at`,`progress_id`]},{table:`outbound_message_progress`,kind:`indexes`,value:6},{table:`outbound_message_progress`,kind:`checks`,value:14},{table:`plugin_binding_approvals`,kind:`table`,value:null},{table:`plugin_binding_approvals`,kind:`column`,value:{name:`plugin_root`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`plugin_binding_approvals`,kind:`column`,value:{name:`channel`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`plugin_binding_approvals`,kind:`column`,value:{name:`account_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`plugin_binding_approvals`,kind:`column`,value:{name:`plugin_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`plugin_binding_approvals`,kind:`column`,value:{name:`plugin_name`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`plugin_binding_approvals`,kind:`column`,value:{name:`approved_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`plugin_binding_approvals`,kind:`primaryKey`,value:[`plugin_root`,`channel`,`account_id`]},{table:`plugin_binding_approvals`,kind:`indexes`,value:2},{table:`plugin_binding_approvals`,kind:`checks`,value:0},{table:`plugin_blob_entries`,kind:`table`,value:null},{table:`plugin_blob_entries`,kind:`column`,value:{name:`plugin_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`plugin_blob_entries`,kind:`column`,value:{name:`namespace`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`plugin_blob_entries`,kind:`column`,value:{name:`entry_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`plugin_blob_entries`,kind:`column`,value:{name:`metadata_json`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`plugin_blob_entries`,kind:`column`,value:{name:`blob`,type:`bytea`,nullable:!1,identity:!1,default:null,position:5}},{table:`plugin_blob_entries`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`plugin_blob_entries`,kind:`column`,value:{name:`expires_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:7}},{table:`plugin_blob_entries`,kind:`primaryKey`,value:[`plugin_id`,`namespace`,`entry_key`]},{table:`plugin_blob_entries`,kind:`indexes`,value:3},{table:`plugin_blob_entries`,kind:`checks`,value:0},{table:`plugin_state_entries`,kind:`table`,value:null},{table:`plugin_state_entries`,kind:`column`,value:{name:`plugin_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`plugin_state_entries`,kind:`column`,value:{name:`namespace`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`plugin_state_entries`,kind:`column`,value:{name:`entry_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`plugin_state_entries`,kind:`column`,value:{name:`value_json`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`plugin_state_entries`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`plugin_state_entries`,kind:`column`,value:{name:`expires_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:6}},{table:`plugin_state_entries`,kind:`primaryKey`,value:[`plugin_id`,`namespace`,`entry_key`]},{table:`plugin_state_entries`,kind:`indexes`,value:3},{table:`plugin_state_entries`,kind:`checks`,value:0},{table:`projects`,kind:`table`,value:null},{table:`projects`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`projects`,kind:`column`,value:{name:`display_name`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`projects`,kind:`column`,value:{name:`repo_root`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`projects`,kind:`column`,value:{name:`origin_url`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`projects`,kind:`column`,value:{name:`source`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`projects`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`projects`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`projects`,kind:`primaryKey`,value:[`id`]},{table:`projects`,kind:`indexes`,value:1},{table:`projects`,kind:`checks`,value:1},{table:`sandbox_persistent_execs`,kind:`table`,value:null},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`owner_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`source_identity`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`attempt_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`owner_json`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`backend_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`backend_target_json`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`workspace_binding_json`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`container_id`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`container_name`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`container_started_at`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`revision`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`phase`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`receipt_json`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`error`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:15}},{table:`sandbox_persistent_execs`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:16}},{table:`sandbox_persistent_execs`,kind:`primaryKey`,value:[`owner_key`]},{table:`sandbox_persistent_execs`,kind:`unique`,value:[`attempt_id`]},{table:`sandbox_persistent_execs`,kind:`indexes`,value:5},{table:`sandbox_persistent_execs`,kind:`checks`,value:4},{table:`sandbox_registry_entries`,kind:`table`,value:null},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`registry_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`container_name`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`backend_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`runtime_label`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`image`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:7}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`last_used_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`config_label_kind`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`config_hash`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`cdp_port`,type:`bigint`,nullable:!0,identity:!1,default:null,position:11}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`no_vnc_port`,type:`bigint`,nullable:!0,identity:!1,default:null,position:12}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`entry_json`,type:`text`,nullable:!1,identity:!1,default:null,position:13}},{table:`sandbox_registry_entries`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:14}},{table:`sandbox_registry_entries`,kind:`primaryKey`,value:[`registry_kind`,`container_name`]},{table:`sandbox_registry_entries`,kind:`indexes`,value:4},{table:`sandbox_registry_entries`,kind:`checks`,value:0},{table:`schema_meta`,kind:`table`,value:null},{table:`schema_meta`,kind:`column`,value:{name:`meta_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`schema_meta`,kind:`column`,value:{name:`role`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`schema_meta`,kind:`column`,value:{name:`schema_version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`schema_meta`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`schema_meta`,kind:`column`,value:{name:`app_version`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`schema_meta`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`schema_meta`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`schema_meta`,kind:`primaryKey`,value:[`meta_key`]},{table:`schema_meta`,kind:`indexes`,value:1},{table:`schema_meta`,kind:`checks`,value:0},{table:`secret_store_entries`,kind:`table`,value:null},{table:`secret_store_entries`,kind:`column`,value:{name:`scope_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`secret_store_entries`,kind:`column`,value:{name:`scope_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`secret_store_entries`,kind:`column`,value:{name:`name`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`secret_store_entries`,kind:`column`,value:{name:`value`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`secret_store_entries`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`secret_store_entries`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`secret_store_entries`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`secret_store_entries`,kind:`column`,value:{name:`updated_by`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`secret_store_entries`,kind:`column`,value:{name:`deleted_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:9}},{table:`secret_store_entries`,kind:`column`,value:{name:`allowed_hosts`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`secret_store_entries`,kind:`primaryKey`,value:[`scope_kind`,`scope_id`,`name`]},{table:`secret_store_entries`,kind:`indexes`,value:2},{table:`secret_store_entries`,kind:`checks`,value:5},{table:`session_groups`,kind:`table`,value:null},{table:`session_groups`,kind:`column`,value:{name:`name`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`session_groups`,kind:`column`,value:{name:`position`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`session_groups`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`session_groups`,kind:`column`,value:{name:`cwd`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`session_groups`,kind:`column`,value:{name:`worktree`,type:`bigint`,nullable:!0,identity:!1,default:null,position:5}},{table:`session_groups`,kind:`primaryKey`,value:[`name`]},{table:`session_groups`,kind:`indexes`,value:1},{table:`session_groups`,kind:`checks`,value:0},{table:`session_repository_workspaces`,kind:`table`,value:null},{table:`session_repository_workspaces`,kind:`column`,value:{name:`workspace_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`url`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`requested_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`run_setup_script`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:6}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`base_commit`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`base_manifest_hash`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`branch`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`checkpoint_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`manifest_hash`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`revision`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:13}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:14}},{table:`session_repository_workspaces`,kind:`column`,value:{name:`disk_authority_json`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`session_repository_workspaces`,kind:`primaryKey`,value:[`workspace_id`]},{table:`session_repository_workspaces`,kind:`unique`,value:[`agent_id`,`session_key`]},{table:`session_repository_workspaces`,kind:`indexes`,value:2},{table:`session_repository_workspaces`,kind:`checks`,value:11},{table:`session_state_events`,kind:`table`,value:null},{table:`session_state_events`,kind:`column`,value:{name:`sequence`,type:`bigint`,nullable:!1,identity:!0,default:null,position:1}},{table:`session_state_events`,kind:`column`,value:{name:`dedupe_key`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`session_state_events`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`session_state_events`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`session_state_events`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`session_state_events`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`session_state_events`,kind:`column`,value:{name:`actor_type`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`session_state_events`,kind:`column`,value:{name:`actor_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`session_state_events`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`session_state_events`,kind:`column`,value:{name:`occurred_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`session_state_events`,kind:`column`,value:{name:`summary`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`session_state_events`,kind:`column`,value:{name:`payload_json`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`session_state_events`,kind:`primaryKey`,value:[`sequence`]},{table:`session_state_events`,kind:`unique`,value:[`dedupe_key`]},{table:`session_state_events`,kind:`indexes`,value:4},{table:`session_state_events`,kind:`checks`,value:0},{table:`session_state_heads`,kind:`table`,value:null},{table:`session_state_heads`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`session_state_heads`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`session_state_heads`,kind:`column`,value:{name:`last_sequence`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`session_state_heads`,kind:`column`,value:{name:`pruned_max_sequence`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:4}},{table:`session_state_heads`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`session_state_heads`,kind:`primaryKey`,value:[`session_key`,`agent_id`]},{table:`session_state_heads`,kind:`indexes`,value:1},{table:`session_state_heads`,kind:`checks`,value:0},{table:`session_upstream_links`,kind:`table`,value:null},{table:`session_upstream_links`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`session_upstream_links`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`session_upstream_links`,kind:`column`,value:{name:`catalog_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`session_upstream_links`,kind:`column`,value:{name:`host_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`session_upstream_links`,kind:`column`,value:{name:`thread_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`session_upstream_links`,kind:`column`,value:{name:`upstream_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`session_upstream_links`,kind:`column`,value:{name:`upstream_ref_json`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`session_upstream_links`,kind:`column`,value:{name:`last_marker_json`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`session_upstream_links`,kind:`column`,value:{name:`last_scanned_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:9}},{table:`session_upstream_links`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`session_upstream_links`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`session_upstream_links`,kind:`primaryKey`,value:[`session_key`,`agent_id`]},{table:`session_upstream_links`,kind:`indexes`,value:2},{table:`session_upstream_links`,kind:`checks`,value:0},{table:`session_watch_cursors`,kind:`table`,value:null},{table:`session_watch_cursors`,kind:`column`,value:{name:`watcher_session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`session_watch_cursors`,kind:`column`,value:{name:`watcher_store_path`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`session_watch_cursors`,kind:`column`,value:{name:`target_session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`session_watch_cursors`,kind:`column`,value:{name:`last_seen_sequence`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:4}},{table:`session_watch_cursors`,kind:`column`,value:{name:`notified_sequence`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:5}},{table:`session_watch_cursors`,kind:`column`,value:{name:`material_sequence`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:6}},{table:`session_watch_cursors`,kind:`column`,value:{name:`provenance`,type:`text`,nullable:!1,identity:!1,default:`'explicit'`,position:7}},{table:`session_watch_cursors`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`session_watch_cursors`,kind:`primaryKey`,value:[`watcher_session_key`,`target_session_key`]},{table:`session_watch_cursors`,kind:`indexes`,value:2},{table:`session_watch_cursors`,kind:`checks`,value:1},{table:`skill_library_entries`,kind:`table`,value:null},{table:`skill_library_entries`,kind:`column`,value:{name:`skill_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_library_entries`,kind:`column`,value:{name:`owner_profile_id`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`skill_library_entries`,kind:`column`,value:{name:`author_profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_library_entries`,kind:`column`,value:{name:`slug`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_library_entries`,kind:`column`,value:{name:`current_revision`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`skill_library_entries`,kind:`column`,value:{name:`shared`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`skill_library_entries`,kind:`column`,value:{name:`enabled`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`skill_library_entries`,kind:`column`,value:{name:`removed`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`skill_library_entries`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`skill_library_entries`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`skill_library_entries`,kind:`primaryKey`,value:[`skill_id`]},{table:`skill_library_entries`,kind:`indexes`,value:1},{table:`skill_library_entries`,kind:`checks`,value:0},{table:`skill_library_events`,kind:`table`,value:null},{table:`skill_library_events`,kind:`column`,value:{name:`event_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_library_events`,kind:`column`,value:{name:`skill_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`skill_library_events`,kind:`column`,value:{name:`revision`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_library_events`,kind:`column`,value:{name:`action`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_library_events`,kind:`column`,value:{name:`actor_profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`skill_library_events`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`skill_library_events`,kind:`primaryKey`,value:[`event_id`]},{table:`skill_library_events`,kind:`indexes`,value:1},{table:`skill_library_events`,kind:`checks`,value:0},{table:`skill_library_revisions`,kind:`table`,value:null},{table:`skill_library_revisions`,kind:`column`,value:{name:`skill_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_library_revisions`,kind:`column`,value:{name:`revision`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`skill_library_revisions`,kind:`column`,value:{name:`description`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_library_revisions`,kind:`column`,value:{name:`files_json`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_library_revisions`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`skill_library_revisions`,kind:`primaryKey`,value:[`skill_id`,`revision`]},{table:`skill_library_revisions`,kind:`indexes`,value:1},{table:`skill_library_revisions`,kind:`checks`,value:0},{table:`skill_library_uploads`,kind:`table`,value:null},{table:`skill_library_uploads`,kind:`column`,value:{name:`upload_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_library_uploads`,kind:`column`,value:{name:`owner_profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`skill_library_uploads`,kind:`column`,value:{name:`slug`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_library_uploads`,kind:`column`,value:{name:`size_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_library_uploads`,kind:`column`,value:{name:`sha256`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`skill_library_uploads`,kind:`column`,value:{name:`archive_blob`,type:`bytea`,nullable:!1,identity:!1,default:null,position:6}},{table:`skill_library_uploads`,kind:`column`,value:{name:`expires_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`skill_library_uploads`,kind:`column`,value:{name:`published_skill_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`skill_library_uploads`,kind:`primaryKey`,value:[`upload_id`]},{table:`skill_library_uploads`,kind:`indexes`,value:1},{table:`skill_library_uploads`,kind:`checks`,value:0},{table:`skill_upload_chunks`,kind:`table`,value:null},{table:`skill_upload_chunks`,kind:`column`,value:{name:`upload_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_upload_chunks`,kind:`column`,value:{name:`byte_offset`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`skill_upload_chunks`,kind:`column`,value:{name:`size_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_upload_chunks`,kind:`column`,value:{name:`chunk_blob`,type:`bytea`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_upload_chunks`,kind:`primaryKey`,value:[`upload_id`,`byte_offset`]},{table:`skill_upload_chunks`,kind:`foreignKey`,value:{columns:[`upload_id`],target:`skill_uploads`,targetColumns:[`upload_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`skill_upload_chunks`,kind:`indexes`,value:1},{table:`skill_upload_chunks`,kind:`checks`,value:3},{table:`skill_uploads`,kind:`table`,value:null},{table:`skill_uploads`,kind:`column`,value:{name:`upload_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_uploads`,kind:`column`,value:{name:`kind`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`skill_uploads`,kind:`column`,value:{name:`slug`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_uploads`,kind:`column`,value:{name:`force`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_uploads`,kind:`column`,value:{name:`size_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`skill_uploads`,kind:`column`,value:{name:`sha256`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`skill_uploads`,kind:`column`,value:{name:`actual_sha256`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`skill_uploads`,kind:`column`,value:{name:`received_bytes`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`skill_uploads`,kind:`column`,value:{name:`archive_blob`,type:`bytea`,nullable:!1,identity:!1,default:null,position:9}},{table:`skill_uploads`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`skill_uploads`,kind:`column`,value:{name:`expires_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`skill_uploads`,kind:`column`,value:{name:`committed`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`skill_uploads`,kind:`column`,value:{name:`committed_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`skill_uploads`,kind:`column`,value:{name:`idempotency_key_hash`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`skill_uploads`,kind:`primaryKey`,value:[`upload_id`]},{table:`skill_uploads`,kind:`unique`,value:[`idempotency_key_hash`]},{table:`skill_uploads`,kind:`indexes`,value:4},{table:`skill_uploads`,kind:`checks`,value:0},{table:`skill_usage`,kind:`table`,value:null},{table:`skill_usage`,kind:`column`,value:{name:`skill_file`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_usage`,kind:`column`,value:{name:`skill_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`skill_usage`,kind:`column`,value:{name:`skill_name`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_usage`,kind:`column`,value:{name:`skill_source`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_usage`,kind:`column`,value:{name:`first_used_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`skill_usage`,kind:`column`,value:{name:`last_used_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`skill_usage`,kind:`column`,value:{name:`use_count`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`skill_usage`,kind:`column`,value:{name:`last_agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`skill_usage`,kind:`primaryKey`,value:[`skill_file`]},{table:`skill_usage`,kind:`indexes`,value:1},{table:`skill_usage`,kind:`checks`,value:0},{table:`skill_workshop_changes`,kind:`table`,value:null},{table:`skill_workshop_changes`,kind:`column`,value:{name:`cursor_id`,type:`bigint`,nullable:!1,identity:!1,default:null,position:1}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`change_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`skill_name`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`action`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`actor`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`summary`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`version_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`skill_workshop_changes`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`skill_workshop_changes`,kind:`primaryKey`,value:[`change_id`]},{table:`skill_workshop_changes`,kind:`indexes`,value:3},{table:`skill_workshop_changes`,kind:`checks`,value:2},{table:`state_leases`,kind:`table`,value:null},{table:`state_leases`,kind:`column`,value:{name:`scope`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`state_leases`,kind:`column`,value:{name:`lease_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`state_leases`,kind:`column`,value:{name:`owner`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`state_leases`,kind:`column`,value:{name:`expires_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:4}},{table:`state_leases`,kind:`column`,value:{name:`heartbeat_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:5}},{table:`state_leases`,kind:`column`,value:{name:`payload_json`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`state_leases`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`state_leases`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`state_leases`,kind:`primaryKey`,value:[`scope`,`lease_key`]},{table:`state_leases`,kind:`indexes`,value:3},{table:`state_leases`,kind:`checks`,value:0},{table:`subagent_runs`,kind:`table`,value:null},{table:`subagent_runs`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`subagent_runs`,kind:`column`,value:{name:`child_session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`subagent_runs`,kind:`column`,value:{name:`controller_session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`subagent_runs`,kind:`column`,value:{name:`controller_store_path`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`subagent_runs`,kind:`column`,value:{name:`requester_session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`subagent_runs`,kind:`column`,value:{name:`requester_store_path`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`subagent_runs`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`subagent_runs`,kind:`column`,value:{name:`payload_json`,type:`text`,nullable:!1,identity:!1,default:`'{}'`,position:8}},{table:`subagent_runs`,kind:`primaryKey`,value:[`run_id`]},{table:`subagent_runs`,kind:`indexes`,value:4},{table:`subagent_runs`,kind:`checks`,value:0},{table:`task_delivery_state`,kind:`table`,value:null},{table:`task_delivery_state`,kind:`column`,value:{name:`task_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`task_delivery_state`,kind:`column`,value:{name:`requester_origin_json`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`task_delivery_state`,kind:`column`,value:{name:`last_notified_event_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`task_delivery_state`,kind:`primaryKey`,value:[`task_id`]},{table:`task_delivery_state`,kind:`foreignKey`,value:{columns:[`task_id`],target:`task_runs`,targetColumns:[`task_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`task_delivery_state`,kind:`indexes`,value:1},{table:`task_delivery_state`,kind:`checks`,value:0},{table:`task_runs`,kind:`table`,value:null},{table:`task_runs`,kind:`column`,value:{name:`task_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`task_runs`,kind:`column`,value:{name:`runtime`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`task_runs`,kind:`column`,value:{name:`task_kind`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`task_runs`,kind:`column`,value:{name:`source_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`task_runs`,kind:`column`,value:{name:`requester_session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`task_runs`,kind:`column`,value:{name:`owner_key`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`task_runs`,kind:`column`,value:{name:`scope_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`task_runs`,kind:`column`,value:{name:`child_session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`task_runs`,kind:`column`,value:{name:`parent_flow_id`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`task_runs`,kind:`column`,value:{name:`parent_task_id`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`task_runs`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`task_runs`,kind:`column`,value:{name:`requester_agent_id`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`task_runs`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`task_runs`,kind:`column`,value:{name:`execution_owner_host`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`task_runs`,kind:`column`,value:{name:`execution_owner_pid`,type:`bigint`,nullable:!0,identity:!1,default:null,position:15}},{table:`task_runs`,kind:`column`,value:{name:`execution_owner_start_identity`,type:`bigint`,nullable:!0,identity:!1,default:null,position:16}},{table:`task_runs`,kind:`column`,value:{name:`label`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`task_runs`,kind:`column`,value:{name:`task`,type:`text`,nullable:!1,identity:!1,default:null,position:18}},{table:`task_runs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:19}},{table:`task_runs`,kind:`column`,value:{name:`delivery_status`,type:`text`,nullable:!1,identity:!1,default:null,position:20}},{table:`task_runs`,kind:`column`,value:{name:`notify_policy`,type:`text`,nullable:!1,identity:!1,default:null,position:21}},{table:`task_runs`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:22}},{table:`task_runs`,kind:`column`,value:{name:`started_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:23}},{table:`task_runs`,kind:`column`,value:{name:`ended_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:24}},{table:`task_runs`,kind:`column`,value:{name:`last_event_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:25}},{table:`task_runs`,kind:`column`,value:{name:`cleanup_after`,type:`bigint`,nullable:!0,identity:!1,default:null,position:26}},{table:`task_runs`,kind:`column`,value:{name:`tool_use_count`,type:`bigint`,nullable:!0,identity:!1,default:null,position:27}},{table:`task_runs`,kind:`column`,value:{name:`last_tool_name`,type:`text`,nullable:!0,identity:!1,default:null,position:28}},{table:`task_runs`,kind:`column`,value:{name:`error`,type:`text`,nullable:!0,identity:!1,default:null,position:29}},{table:`task_runs`,kind:`column`,value:{name:`progress_summary`,type:`text`,nullable:!0,identity:!1,default:null,position:30}},{table:`task_runs`,kind:`column`,value:{name:`terminal_summary`,type:`text`,nullable:!0,identity:!1,default:null,position:31}},{table:`task_runs`,kind:`column`,value:{name:`terminal_outcome`,type:`text`,nullable:!0,identity:!1,default:null,position:32}},{table:`task_runs`,kind:`column`,value:{name:`detail_json`,type:`text`,nullable:!0,identity:!1,default:null,position:33}},{table:`task_runs`,kind:`primaryKey`,value:[`task_id`]},{table:`task_runs`,kind:`indexes`,value:4},{table:`task_runs`,kind:`checks`,value:0},{table:`template_cron_refs`,kind:`table`,value:null},{table:`template_cron_refs`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`template_cron_refs`,kind:`column`,value:{name:`manifest_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`template_cron_refs`,kind:`column`,value:{name:`schema_version`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`template_cron_refs`,kind:`column`,value:{name:`declaration_key`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`template_cron_refs`,kind:`column`,value:{name:`scheduler_job_id`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`template_cron_refs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`template_cron_refs`,kind:`column`,value:{name:`job_json`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`template_cron_refs`,kind:`column`,value:{name:`error`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`template_cron_refs`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`template_cron_refs`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`template_cron_refs`,kind:`primaryKey`,value:[`agent_id`,`manifest_id`]},{table:`template_cron_refs`,kind:`unique`,value:[`declaration_key`]},{table:`template_cron_refs`,kind:`unique`,value:[`scheduler_job_id`]},{table:`template_cron_refs`,kind:`indexes`,value:3},{table:`template_cron_refs`,kind:`checks`,value:0},{table:`template_installs`,kind:`table`,value:null},{table:`template_installs`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`template_installs`,kind:`column`,value:{name:`schema_version`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`template_installs`,kind:`column`,value:{name:`source_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`template_installs`,kind:`column`,value:{name:`template_name`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`template_installs`,kind:`column`,value:{name:`template_version`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`template_installs`,kind:`column`,value:{name:`package_root`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`template_installs`,kind:`column`,value:{name:`manifest_path`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`template_installs`,kind:`column`,value:{name:`integrity_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`template_installs`,kind:`column`,value:{name:`integrity`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`template_installs`,kind:`column`,value:{name:`source_byte_length`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`template_installs`,kind:`column`,value:{name:`manifest_schema_version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`template_installs`,kind:`column`,value:{name:`plan_integrity`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`template_installs`,kind:`column`,value:{name:`workspace`,type:`text`,nullable:!1,identity:!1,default:null,position:13}},{table:`template_installs`,kind:`column`,value:{name:`agent_config_digest`,type:`text`,nullable:!1,identity:!1,default:null,position:14}},{table:`template_installs`,kind:`column`,value:{name:`agent_owned_paths_json`,type:`text`,nullable:!1,identity:!1,default:null,position:15}},{table:`template_installs`,kind:`column`,value:{name:`bootstrap_source_path`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`template_installs`,kind:`column`,value:{name:`bootstrap_content_digest`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`template_installs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:18}},{table:`template_installs`,kind:`column`,value:{name:`added_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:19}},{table:`template_installs`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:20}},{table:`template_installs`,kind:`primaryKey`,value:[`agent_id`]},{table:`template_installs`,kind:`unique`,value:[`workspace`]},{table:`template_installs`,kind:`indexes`,value:2},{table:`template_installs`,kind:`checks`,value:1},{table:`template_mcp_server_refs`,kind:`table`,value:null},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`name`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`schema_version`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`config_digest`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`relationship`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`origin`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`independent_owner`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:7}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`error`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`template_mcp_server_refs`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`template_mcp_server_refs`,kind:`primaryKey`,value:[`agent_id`,`name`]},{table:`template_mcp_server_refs`,kind:`indexes`,value:1},{table:`template_mcp_server_refs`,kind:`checks`,value:3},{table:`template_package_refs`,kind:`table`,value:null},{table:`template_package_refs`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`template_package_refs`,kind:`column`,value:{name:`package_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`template_package_refs`,kind:`column`,value:{name:`package_source`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`template_package_refs`,kind:`column`,value:{name:`package_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`template_package_refs`,kind:`column`,value:{name:`package_version`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`template_package_refs`,kind:`column`,value:{name:`package_integrity`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`template_package_refs`,kind:`column`,value:{name:`schema_version`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`template_package_refs`,kind:`column`,value:{name:`template_name`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`template_package_refs`,kind:`column`,value:{name:`package_status`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`template_package_refs`,kind:`column`,value:{name:`relationship`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`template_package_refs`,kind:`column`,value:{name:`origin`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`template_package_refs`,kind:`column`,value:{name:`independent_owner`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`template_package_refs`,kind:`column`,value:{name:`extension_id`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`template_package_refs`,kind:`column`,value:{name:`extension_format`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`template_package_refs`,kind:`column`,value:{name:`extension_detected_format`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`template_package_refs`,kind:`column`,value:{name:`extension_mapped_json`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`template_package_refs`,kind:`column`,value:{name:`extension_unavailable_json`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`template_package_refs`,kind:`column`,value:{name:`extension_adapter_identity`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`template_package_refs`,kind:`column`,value:{name:`installed_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:19}},{table:`template_package_refs`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:20}},{table:`template_package_refs`,kind:`primaryKey`,value:[`agent_id`,`package_kind`,`package_source`,`package_ref`,`package_version`]},{table:`template_package_refs`,kind:`indexes`,value:1},{table:`template_package_refs`,kind:`checks`,value:3},{table:`template_workspace_files`,kind:`table`,value:null},{table:`template_workspace_files`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`template_workspace_files`,kind:`column`,value:{name:`target_path`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`template_workspace_files`,kind:`column`,value:{name:`schema_version`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`template_workspace_files`,kind:`column`,value:{name:`workspace`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`template_workspace_files`,kind:`column`,value:{name:`source_path`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`template_workspace_files`,kind:`column`,value:{name:`content_digest`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`template_workspace_files`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`template_workspace_files`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`template_workspace_files`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`template_workspace_files`,kind:`primaryKey`,value:[`agent_id`,`target_path`]},{table:`template_workspace_files`,kind:`indexes`,value:1},{table:`template_workspace_files`,kind:`checks`,value:0},{table:`update_runs`,kind:`table`,value:null},{table:`update_runs`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`update_runs`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`update_runs`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`update_runs`,kind:`column`,value:{name:`trigger`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`update_runs`,kind:`column`,value:{name:`phase`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`update_runs`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`update_runs`,kind:`column`,value:{name:`reason`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`update_runs`,kind:`column`,value:{name:`origin_json`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`update_runs`,kind:`column`,value:{name:`target_json`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`update_runs`,kind:`column`,value:{name:`before_json`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`update_runs`,kind:`column`,value:{name:`after_json`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`update_runs`,kind:`column`,value:{name:`steps_json`,type:`text`,nullable:!1,identity:!1,default:null,position:12}},{table:`update_runs`,kind:`column`,value:{name:`verification_json`,type:`text`,nullable:!1,identity:!1,default:null,position:13}},{table:`update_runs`,kind:`column`,value:{name:`repair_json`,type:`text`,nullable:!1,identity:!1,default:null,position:14}},{table:`update_runs`,kind:`column`,value:{name:`confirmed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:15}},{table:`update_runs`,kind:`column`,value:{name:`finished_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:16}},{table:`update_runs`,kind:`column`,value:{name:`downtime_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:17}},{table:`update_runs`,kind:`primaryKey`,value:[`run_id`]},{table:`update_runs`,kind:`indexes`,value:3},{table:`update_runs`,kind:`checks`,value:11},{table:`user_background_images`,kind:`table`,value:null},{table:`user_background_images`,kind:`column`,value:{name:`profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`user_background_images`,kind:`column`,value:{name:`asset_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`user_background_images`,kind:`column`,value:{name:`image`,type:`bytea`,nullable:!1,identity:!1,default:null,position:3}},{table:`user_background_images`,kind:`column`,value:{name:`width`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`user_background_images`,kind:`column`,value:{name:`height`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`user_background_images`,kind:`primaryKey`,value:[`profile_id`]},{table:`user_background_images`,kind:`unique`,value:[`asset_id`]},{table:`user_background_images`,kind:`foreignKey`,value:{columns:[`profile_id`],target:`user_profiles`,targetColumns:[`id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`user_background_images`,kind:`indexes`,value:2},{table:`user_background_images`,kind:`checks`,value:3},{table:`user_preferences`,kind:`table`,value:null},{table:`user_preferences`,kind:`column`,value:{name:`profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`user_preferences`,kind:`column`,value:{name:`pref_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`user_preferences`,kind:`column`,value:{name:`value_json`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`user_preferences`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`user_preferences`,kind:`primaryKey`,value:[`profile_id`,`pref_key`]},{table:`user_preferences`,kind:`indexes`,value:1},{table:`user_preferences`,kind:`checks`,value:0},{table:`user_profile_emails`,kind:`table`,value:null},{table:`user_profile_emails`,kind:`column`,value:{name:`email`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`user_profile_emails`,kind:`column`,value:{name:`profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`user_profile_emails`,kind:`column`,value:{name:`binding_id`,type:`text`,nullable:!0,identity:!1,default:null,position:3}},{table:`user_profile_emails`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`user_profile_emails`,kind:`primaryKey`,value:[`email`]},{table:`user_profile_emails`,kind:`indexes`,value:2},{table:`user_profile_emails`,kind:`checks`,value:0},{table:`user_profile_identities`,kind:`table`,value:null},{table:`user_profile_identities`,kind:`column`,value:{name:`provider`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`user_profile_identities`,kind:`column`,value:{name:`subject`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`user_profile_identities`,kind:`column`,value:{name:`profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`user_profile_identities`,kind:`column`,value:{name:`canonical_login`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`user_profile_identities`,kind:`column`,value:{name:`verified_email_json`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`user_profile_identities`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`user_profile_identities`,kind:`column`,value:{name:`authorization_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`user_profile_identities`,kind:`column`,value:{name:`authorization_basis_json`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`user_profile_identities`,kind:`primaryKey`,value:[`provider`,`subject`]},{table:`user_profile_identities`,kind:`indexes`,value:3},{table:`user_profile_identities`,kind:`checks`,value:0},{table:`user_profiles`,kind:`table`,value:null},{table:`user_profiles`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`user_profiles`,kind:`column`,value:{name:`display_name`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`user_profiles`,kind:`column`,value:{name:`primary_github_account_id`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`user_profiles`,kind:`column`,value:{name:`avatar`,type:`bytea`,nullable:!0,identity:!1,default:null,position:4}},{table:`user_profiles`,kind:`column`,value:{name:`avatar_mime`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`user_profiles`,kind:`column`,value:{name:`avatar_sha256`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`user_profiles`,kind:`column`,value:{name:`merged_into`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`user_profiles`,kind:`column`,value:{name:`role`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`user_profiles`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`user_profiles`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`user_profiles`,kind:`primaryKey`,value:[`id`]},{table:`user_profiles`,kind:`indexes`,value:1},{table:`user_profiles`,kind:`checks`,value:0},{table:`web_push_approval_deliveries`,kind:`table`,value:null},{table:`web_push_approval_deliveries`,kind:`column`,value:{name:`approval_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`web_push_approval_deliveries`,kind:`column`,value:{name:`subscription_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`web_push_approval_deliveries`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`web_push_approval_deliveries`,kind:`column`,value:{name:`user_profile_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`web_push_approval_deliveries`,kind:`column`,value:{name:`prepared_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`web_push_approval_deliveries`,kind:`primaryKey`,value:[`approval_id`,`subscription_id`]},{table:`web_push_approval_deliveries`,kind:`foreignKey`,value:{columns:[`subscription_id`],target:`web_push_subscriptions`,targetColumns:[`subscription_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`web_push_approval_deliveries`,kind:`foreignKey`,value:{columns:[`approval_id`],target:`operator_approvals`,targetColumns:[`approval_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`web_push_approval_deliveries`,kind:`indexes`,value:2},{table:`web_push_approval_deliveries`,kind:`checks`,value:0},{table:`web_push_subscriptions`,kind:`table`,value:null},{table:`web_push_subscriptions`,kind:`column`,value:{name:`endpoint_hash`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`subscription_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`endpoint`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`p256dh`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`auth`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`device_id`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`user_profile_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`preferences_json`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`web_push_subscriptions`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`web_push_subscriptions`,kind:`primaryKey`,value:[`endpoint_hash`]},{table:`web_push_subscriptions`,kind:`unique`,value:[`subscription_id`]},{table:`web_push_subscriptions`,kind:`indexes`,value:3},{table:`web_push_subscriptions`,kind:`checks`,value:0},{table:`worker_environment_credentials`,kind:`table`,value:null},{table:`worker_environment_credentials`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_environment_credentials`,kind:`column`,value:{name:`credential_hash`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_environment_credentials`,kind:`column`,value:{name:`bundle_hash`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_environment_credentials`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`worker_environment_credentials`,kind:`column`,value:{name:`rpc_set_version`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_environment_credentials`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_environment_credentials`,kind:`column`,value:{name:`expires_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_environment_credentials`,kind:`column`,value:{name:`delivered_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`worker_environment_credentials`,kind:`primaryKey`,value:[`environment_id`]},{table:`worker_environment_credentials`,kind:`unique`,value:[`credential_hash`]},{table:`worker_environment_credentials`,kind:`foreignKey`,value:{columns:[`environment_id`],target:`worker_environments`,targetColumns:[`environment_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_environment_credentials`,kind:`indexes`,value:2},{table:`worker_environment_credentials`,kind:`checks`,value:4},{table:`worker_environment_session_attachments`,kind:`table`,value:null},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`session_lifecycle_revision`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`generation`,type:`bigint`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`last_used_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`worker_environment_session_attachments`,kind:`column`,value:{name:`closed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:9}},{table:`worker_environment_session_attachments`,kind:`primaryKey`,value:[`session_id`]},{table:`worker_environment_session_attachments`,kind:`unique`,value:[`environment_id`]},{table:`worker_environment_session_attachments`,kind:`foreignKey`,value:{columns:[`environment_id`],target:`worker_environments`,targetColumns:[`environment_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_environment_session_attachments`,kind:`indexes`,value:3},{table:`worker_environment_session_attachments`,kind:`checks`,value:1},{table:`worker_environment_ssh_fallback_ports`,kind:`table`,value:null},{table:`worker_environment_ssh_fallback_ports`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_environment_ssh_fallback_ports`,kind:`column`,value:{name:`position`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_environment_ssh_fallback_ports`,kind:`column`,value:{name:`port`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_environment_ssh_fallback_ports`,kind:`primaryKey`,value:[`environment_id`,`position`]},{table:`worker_environment_ssh_fallback_ports`,kind:`unique`,value:[`environment_id`,`port`]},{table:`worker_environment_ssh_fallback_ports`,kind:`foreignKey`,value:{columns:[`environment_id`],target:`worker_environments`,targetColumns:[`environment_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_environment_ssh_fallback_ports`,kind:`indexes`,value:2},{table:`worker_environment_ssh_fallback_ports`,kind:`checks`,value:2},{table:`worker_environments`,kind:`table`,value:null},{table:`worker_environments`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_environments`,kind:`column`,value:{name:`provider_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_environments`,kind:`column`,value:{name:`profile_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_environments`,kind:`column`,value:{name:`profile_snapshot_json`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_environments`,kind:`column`,value:{name:`last_activated_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:5}},{table:`worker_environments`,kind:`column`,value:{name:`preparation_key`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`worker_environments`,kind:`column`,value:{name:`preparation_purpose`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`worker_environments`,kind:`column`,value:{name:`preparation_demand_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`worker_environments`,kind:`column`,value:{name:`preparation_expires_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:9}},{table:`worker_environments`,kind:`column`,value:{name:`preparation_consumed_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:10}},{table:`worker_environments`,kind:`column`,value:{name:`provision_operation_id`,type:`text`,nullable:!1,identity:!1,default:null,position:11}},{table:`worker_environments`,kind:`column`,value:{name:`lease_id`,type:`text`,nullable:!0,identity:!1,default:null,position:12}},{table:`worker_environments`,kind:`column`,value:{name:`node_setup_id`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`worker_environments`,kind:`column`,value:{name:`node_device_id`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`worker_environments`,kind:`column`,value:{name:`ssh_host`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`worker_environments`,kind:`column`,value:{name:`ssh_port`,type:`bigint`,nullable:!0,identity:!1,default:null,position:16}},{table:`worker_environments`,kind:`column`,value:{name:`ssh_user`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`worker_environments`,kind:`column`,value:{name:`ssh_host_key`,type:`text`,nullable:!0,identity:!1,default:null,position:18}},{table:`worker_environments`,kind:`column`,value:{name:`ssh_key_ref_json`,type:`text`,nullable:!0,identity:!1,default:null,position:19}},{table:`worker_environments`,kind:`column`,value:{name:`desktop_json`,type:`text`,nullable:!0,identity:!1,default:null,position:20}},{table:`worker_environments`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:21}},{table:`worker_environments`,kind:`column`,value:{name:`bootstrap_bundle_hash`,type:`text`,nullable:!0,identity:!1,default:null,position:22}},{table:`worker_environments`,kind:`column`,value:{name:`bootstrap_openclaw_version`,type:`text`,nullable:!0,identity:!1,default:null,position:23}},{table:`worker_environments`,kind:`column`,value:{name:`bootstrap_protocol_features_json`,type:`text`,nullable:!0,identity:!1,default:null,position:24}},{table:`worker_environments`,kind:`column`,value:{name:`bootstrap_install_kind`,type:`text`,nullable:!0,identity:!1,default:null,position:25}},{table:`worker_environments`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:26}},{table:`worker_environments`,kind:`column`,value:{name:`teardown_terminal_state`,type:`text`,nullable:!0,identity:!1,default:null,position:27}},{table:`worker_environments`,kind:`column`,value:{name:`attached_session_ids_json`,type:`text`,nullable:!1,identity:!1,default:`'[]'`,position:28}},{table:`worker_environments`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:29}},{table:`worker_environments`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:30}},{table:`worker_environments`,kind:`column`,value:{name:`state_changed_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:31}},{table:`worker_environments`,kind:`column`,value:{name:`idle_since_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:32}},{table:`worker_environments`,kind:`column`,value:{name:`destroy_requested_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:33}},{table:`worker_environments`,kind:`column`,value:{name:`last_error`,type:`text`,nullable:!0,identity:!1,default:null,position:34}},{table:`worker_environments`,kind:`column`,value:{name:`shared_host`,type:`bigint`,nullable:!0,identity:!1,default:null,position:35}},{table:`worker_environments`,kind:`column`,value:{name:`resource_receipt_json`,type:`text`,nullable:!0,identity:!1,default:null,position:36}},{table:`worker_environments`,kind:`column`,value:{name:`retention_json`,type:`text`,nullable:!0,identity:!1,default:null,position:37}},{table:`worker_environments`,kind:`column`,value:{name:`provision_source_json`,type:`text`,nullable:!0,identity:!1,default:null,position:38}},{table:`worker_environments`,kind:`primaryKey`,value:[`environment_id`]},{table:`worker_environments`,kind:`unique`,value:[`provision_operation_id`]},{table:`worker_environments`,kind:`indexes`,value:4},{table:`worker_environments`,kind:`checks`,value:5},{table:`worker_inference_turns`,kind:`table`,value:null},{table:`worker_inference_turns`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_inference_turns`,kind:`column`,value:{name:`run_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_inference_turns`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_inference_turns`,kind:`column`,value:{name:`turn_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_inference_turns`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_inference_turns`,kind:`column`,value:{name:`request_hash`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_inference_turns`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_inference_turns`,kind:`column`,value:{name:`terminal_json`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`worker_inference_turns`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`worker_inference_turns`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:10}},{table:`worker_inference_turns`,kind:`primaryKey`,value:[`session_id`,`run_epoch`,`run_id`,`turn_id`]},{table:`worker_inference_turns`,kind:`foreignKey`,value:{columns:[`environment_id`],target:`worker_environments`,targetColumns:[`environment_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_inference_turns`,kind:`indexes`,value:2},{table:`worker_inference_turns`,kind:`checks`,value:5},{table:`worker_session_placement_moves`,kind:`table`,value:null},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`operation_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`source_generation`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`source_environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`source_owner_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`target_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`target_id`,type:`text`,nullable:!0,identity:!1,default:null,position:7}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`target_machine_class`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`target_os`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`abandon_source`,type:`bigint`,nullable:!0,identity:!1,default:null,position:10}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`last_error`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`worker_session_placement_moves`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:13}},{table:`worker_session_placement_moves`,kind:`primaryKey`,value:[`operation_id`]},{table:`worker_session_placement_moves`,kind:`unique`,value:[`session_id`]},{table:`worker_session_placement_moves`,kind:`foreignKey`,value:{columns:[`session_id`],target:`worker_session_placements`,targetColumns:[`session_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_session_placement_moves`,kind:`indexes`,value:2},{table:`worker_session_placement_moves`,kind:`checks`,value:5},{table:`worker_session_placements`,kind:`table`,value:null},{table:`worker_session_placements`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_session_placements`,kind:`column`,value:{name:`agent_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_session_placements`,kind:`column`,value:{name:`session_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_session_placements`,kind:`column`,value:{name:`execution_mode`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`worker_session_placements`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_session_placements`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`worker_session_placements`,kind:`column`,value:{name:`transition_generation`,type:`bigint`,nullable:!1,identity:!1,default:`0`,position:7}},{table:`worker_session_placements`,kind:`column`,value:{name:`active_owner_epoch`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`worker_session_placements`,kind:`column`,value:{name:`workspace_base_manifest_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`worker_session_placements`,kind:`column`,value:{name:`remote_workspace_dir`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`worker_session_placements`,kind:`column`,value:{name:`worker_bundle_hash`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`worker_session_placements`,kind:`column`,value:{name:`last_transcript_ack_cursor`,type:`bigint`,nullable:!0,identity:!1,default:null,position:12}},{table:`worker_session_placements`,kind:`column`,value:{name:`last_live_event_ack_cursor`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`worker_session_placements`,kind:`column`,value:{name:`recovery_error`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`worker_session_placements`,kind:`column`,value:{name:`turn_claim_owner`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`worker_session_placements`,kind:`column`,value:{name:`turn_claim_id`,type:`text`,nullable:!0,identity:!1,default:null,position:16}},{table:`worker_session_placements`,kind:`column`,value:{name:`turn_claim_run_id`,type:`text`,nullable:!0,identity:!1,default:null,position:17}},{table:`worker_session_placements`,kind:`column`,value:{name:`turn_claim_generation`,type:`bigint`,nullable:!0,identity:!1,default:null,position:18}},{table:`worker_session_placements`,kind:`column`,value:{name:`turn_claim_owner_epoch`,type:`bigint`,nullable:!0,identity:!1,default:null,position:19}},{table:`worker_session_placements`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:20}},{table:`worker_session_placements`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:21}},{table:`worker_session_placements`,kind:`column`,value:{name:`state_changed_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:22}},{table:`worker_session_placements`,kind:`column`,value:{name:`terminal_reason`,type:`text`,nullable:!0,identity:!1,default:null,position:23}},{table:`worker_session_placements`,kind:`column`,value:{name:`terminal_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:24}},{table:`worker_session_placements`,kind:`primaryKey`,value:[`session_id`]},{table:`worker_session_placements`,kind:`indexes`,value:4},{table:`worker_session_placements`,kind:`checks`,value:12},{table:`worker_session_tool_operations`,kind:`table`,value:null},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`source_session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`source_claim_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`tool_call_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`tool_name`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`request_digest`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`operation_seed`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`child_session_key`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`result_json`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`gateway_instance_id`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`worker_session_tool_operations`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`worker_session_tool_operations`,kind:`primaryKey`,value:[`source_session_id`,`source_claim_id`,`tool_call_id`]},{table:`worker_session_tool_operations`,kind:`foreignKey`,value:{columns:[`source_session_id`],target:`worker_session_placements`,targetColumns:[`session_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_session_tool_operations`,kind:`indexes`,value:1},{table:`worker_session_tool_operations`,kind:`checks`,value:2},{table:`worker_transcript_commit_heads`,kind:`table`,value:null},{table:`worker_transcript_commit_heads`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_transcript_commit_heads`,kind:`column`,value:{name:`run_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_transcript_commit_heads`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_transcript_commit_heads`,kind:`column`,value:{name:`next_seq`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_transcript_commit_heads`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_transcript_commit_heads`,kind:`primaryKey`,value:[`session_id`,`run_epoch`]},{table:`worker_transcript_commit_heads`,kind:`indexes`,value:1},{table:`worker_transcript_commit_heads`,kind:`checks`,value:3},{table:`worker_transcript_commits`,kind:`table`,value:null},{table:`worker_transcript_commits`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_transcript_commits`,kind:`column`,value:{name:`run_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_transcript_commits`,kind:`column`,value:{name:`seq`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_transcript_commits`,kind:`column`,value:{name:`request_hash`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_transcript_commits`,kind:`column`,value:{name:`state`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_transcript_commits`,kind:`column`,value:{name:`result_json`,type:`text`,nullable:!0,identity:!1,default:null,position:6}},{table:`worker_transcript_commits`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_transcript_commits`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`worker_transcript_commits`,kind:`primaryKey`,value:[`session_id`,`run_epoch`,`seq`]},{table:`worker_transcript_commits`,kind:`foreignKey`,value:{columns:[`session_id`,`run_epoch`],target:`worker_transcript_commit_heads`,targetColumns:[`session_id`,`run_epoch`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_transcript_commits`,kind:`indexes`,value:1},{table:`worker_transcript_commits`,kind:`checks`,value:6},{table:`worker_turn_tool_authorities`,kind:`table`,value:null},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`placement_generation`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`claim_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`tool_names_json`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_turn_tool_authorities`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:8}},{table:`worker_turn_tool_authorities`,kind:`primaryKey`,value:[`session_id`]},{table:`worker_turn_tool_authorities`,kind:`foreignKey`,value:{columns:[`session_id`],target:`worker_session_placements`,targetColumns:[`session_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_turn_tool_authorities`,kind:`indexes`,value:1},{table:`worker_turn_tool_authorities`,kind:`checks`,value:2},{table:`worker_workspace_pending_results`,kind:`table`,value:null},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`placement_generation`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`claim_id`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`run_id`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`gateway_instance_id`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`recovery_requested_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`workspace_accepted_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:9}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`staged_result_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`repository_workspace_id`,type:`text`,nullable:!0,identity:!1,default:null,position:11}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`worker_workspace_pending_results`,kind:`column`,value:{name:`repository_disk_authority_json`,type:`text`,nullable:!0,identity:!1,default:null,position:13}},{table:`worker_workspace_pending_results`,kind:`primaryKey`,value:[`session_id`]},{table:`worker_workspace_pending_results`,kind:`foreignKey`,value:{columns:[`session_id`],target:`worker_session_placements`,targetColumns:[`session_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_workspace_pending_results`,kind:`indexes`,value:1},{table:`worker_workspace_pending_results`,kind:`checks`,value:2},{table:`worker_workspace_reconciliations`,kind:`table`,value:null},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`session_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`environment_id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`owner_epoch`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`placement_generation`,type:`bigint`,nullable:!1,identity:!1,default:null,position:4}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`base_manifest_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`current_manifest_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`plan_json`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`base_pack`,type:`bytea`,nullable:!1,identity:!1,default:null,position:8}},{table:`worker_workspace_reconciliations`,kind:`column`,value:{name:`created_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:9}},{table:`worker_workspace_reconciliations`,kind:`primaryKey`,value:[`session_id`]},{table:`worker_workspace_reconciliations`,kind:`foreignKey`,value:{columns:[`session_id`],target:`worker_session_placements`,targetColumns:[`session_id`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`worker_workspace_reconciliations`,kind:`indexes`,value:1},{table:`worker_workspace_reconciliations`,kind:`checks`,value:3},{table:`workspace_generated_bootstrap_hashes`,kind:`table`,value:null},{table:`workspace_generated_bootstrap_hashes`,kind:`column`,value:{name:`workspace_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`workspace_generated_bootstrap_hashes`,kind:`column`,value:{name:`filename`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`workspace_generated_bootstrap_hashes`,kind:`column`,value:{name:`sha256`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`workspace_generated_bootstrap_hashes`,kind:`primaryKey`,value:[`workspace_key`,`filename`]},{table:`workspace_generated_bootstrap_hashes`,kind:`foreignKey`,value:{columns:[`workspace_key`],target:`workspace_setup_state`,targetColumns:[`workspace_key`],onUpdate:`NO ACTION`,onDelete:`CASCADE`,deferrable:!1,deferred:!1}},{table:`workspace_generated_bootstrap_hashes`,kind:`indexes`,value:1},{table:`workspace_generated_bootstrap_hashes`,kind:`checks`,value:0},{table:`workspace_path_aliases`,kind:`table`,value:null},{table:`workspace_path_aliases`,kind:`column`,value:{name:`alias_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`workspace_path_aliases`,kind:`column`,value:{name:`alias_path`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`workspace_path_aliases`,kind:`column`,value:{name:`workspace_key`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`workspace_path_aliases`,kind:`column`,value:{name:`workspace_path`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`workspace_path_aliases`,kind:`column`,value:{name:`updated_at_ms`,type:`bigint`,nullable:!1,identity:!1,default:null,position:5}},{table:`workspace_path_aliases`,kind:`primaryKey`,value:[`alias_key`]},{table:`workspace_path_aliases`,kind:`indexes`,value:2},{table:`workspace_path_aliases`,kind:`checks`,value:0},{table:`workspace_setup_state`,kind:`table`,value:null},{table:`workspace_setup_state`,kind:`column`,value:{name:`workspace_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`workspace_setup_state`,kind:`column`,value:{name:`workspace_path`,type:`text`,nullable:!0,identity:!1,default:null,position:2}},{table:`workspace_setup_state`,kind:`column`,value:{name:`version`,type:`bigint`,nullable:!0,identity:!1,default:null,position:3}},{table:`workspace_setup_state`,kind:`column`,value:{name:`bootstrap_seeded_at`,type:`text`,nullable:!0,identity:!1,default:null,position:4}},{table:`workspace_setup_state`,kind:`column`,value:{name:`setup_completed_at`,type:`text`,nullable:!0,identity:!1,default:null,position:5}},{table:`workspace_setup_state`,kind:`column`,value:{name:`updated_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:6}},{table:`workspace_setup_state`,kind:`column`,value:{name:`attested_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:7}},{table:`workspace_setup_state`,kind:`column`,value:{name:`attestation_updated_at_ms`,type:`bigint`,nullable:!0,identity:!1,default:null,position:8}},{table:`workspace_setup_state`,kind:`column`,value:{name:`bootstrap_deferred`,type:`bigint`,nullable:!0,identity:!1,default:null,position:9}},{table:`workspace_setup_state`,kind:`primaryKey`,value:[`workspace_key`]},{table:`workspace_setup_state`,kind:`indexes`,value:2},{table:`workspace_setup_state`,kind:`checks`,value:1},{table:`worktree_provisioned_file_chunks`,kind:`table`,value:null},{table:`worktree_provisioned_file_chunks`,kind:`column`,value:{name:`worktree_id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worktree_provisioned_file_chunks`,kind:`column`,value:{name:`path`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worktree_provisioned_file_chunks`,kind:`column`,value:{name:`chunk_index`,type:`bigint`,nullable:!1,identity:!1,default:null,position:3}},{table:`worktree_provisioned_file_chunks`,kind:`column`,value:{name:`data`,type:`bytea`,nullable:!1,identity:!1,default:null,position:4}},{table:`worktree_provisioned_file_chunks`,kind:`primaryKey`,value:[`worktree_id`,`path`,`chunk_index`]},{table:`worktree_provisioned_file_chunks`,kind:`indexes`,value:1},{table:`worktree_provisioned_file_chunks`,kind:`checks`,value:1},{table:`worktree_templates`,kind:`table`,value:null},{table:`worktree_templates`,kind:`column`,value:{name:`cache_key`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worktree_templates`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worktree_templates`,kind:`column`,value:{name:`repo_root`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worktree_templates`,kind:`column`,value:{name:`common_dir`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`worktree_templates`,kind:`column`,value:{name:`worktree_root`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worktree_templates`,kind:`column`,value:{name:`path`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worktree_templates`,kind:`column`,value:{name:`backend`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`worktree_templates`,kind:`column`,value:{name:`source_commit`,type:`text`,nullable:!1,identity:!1,default:null,position:8}},{table:`worktree_templates`,kind:`column`,value:{name:`content_key`,type:`text`,nullable:!1,identity:!1,default:null,position:9}},{table:`worktree_templates`,kind:`column`,value:{name:`status`,type:`text`,nullable:!1,identity:!1,default:null,position:10}},{table:`worktree_templates`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`worktree_templates`,kind:`column`,value:{name:`last_used_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`worktree_templates`,kind:`primaryKey`,value:[`cache_key`]},{table:`worktree_templates`,kind:`unique`,value:[`id`]},{table:`worktree_templates`,kind:`indexes`,value:2},{table:`worktree_templates`,kind:`checks`,value:1},{table:`worktrees`,kind:`table`,value:null},{table:`worktrees`,kind:`column`,value:{name:`id`,type:`text`,nullable:!1,identity:!1,default:null,position:1}},{table:`worktrees`,kind:`column`,value:{name:`repo_fingerprint`,type:`text`,nullable:!1,identity:!1,default:null,position:2}},{table:`worktrees`,kind:`column`,value:{name:`repo_root`,type:`text`,nullable:!1,identity:!1,default:null,position:3}},{table:`worktrees`,kind:`column`,value:{name:`path`,type:`text`,nullable:!1,identity:!1,default:null,position:4}},{table:`worktrees`,kind:`column`,value:{name:`branch`,type:`text`,nullable:!1,identity:!1,default:null,position:5}},{table:`worktrees`,kind:`column`,value:{name:`base_ref`,type:`text`,nullable:!1,identity:!1,default:null,position:6}},{table:`worktrees`,kind:`column`,value:{name:`owner_kind`,type:`text`,nullable:!1,identity:!1,default:null,position:7}},{table:`worktrees`,kind:`column`,value:{name:`owner_id`,type:`text`,nullable:!0,identity:!1,default:null,position:8}},{table:`worktrees`,kind:`column`,value:{name:`snapshot_ref`,type:`text`,nullable:!0,identity:!1,default:null,position:9}},{table:`worktrees`,kind:`column`,value:{name:`provisioned_paths_json`,type:`text`,nullable:!0,identity:!1,default:null,position:10}},{table:`worktrees`,kind:`column`,value:{name:`created_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:11}},{table:`worktrees`,kind:`column`,value:{name:`last_active_at`,type:`bigint`,nullable:!1,identity:!1,default:null,position:12}},{table:`worktrees`,kind:`column`,value:{name:`removed_at`,type:`bigint`,nullable:!0,identity:!1,default:null,position:13}},{table:`worktrees`,kind:`column`,value:{name:`run_end_cleanup_json`,type:`text`,nullable:!0,identity:!1,default:null,position:14}},{table:`worktrees`,kind:`column`,value:{name:`gc_protection_json`,type:`text`,nullable:!0,identity:!1,default:null,position:15}},{table:`worktrees`,kind:`primaryKey`,value:[`id`]},{table:`worktrees`,kind:`indexes`,value:3},{table:`worktrees`,kind:`checks`,value:1}];return Object.defineProperty(this,"expectedCatalog",{value:e,enumerable:!0,configurable:!0,writable:!0}),e}},Mi=`Use the matching OpenClaw version or restore the matching PostgreSQL schema and anchor.`;function isStatePostgres(){return Tn()!==void 0}function assertStateFileSnapshotAllowed(){Tn()&&ge(`postgres`,`file-snapshot`)}function inspectStateSqlite(e){let t=y(e)??Ee(e);return{hasEngineAnchor:t.tables.has(`openclaw_engine_anchor`),hasExistingData:[...t.tables,...t.views,...t.triggers.keys()].some(e=>e!==`openclaw_engine_anchor`&&!e.startsWith(`sqlite_`))}}function admitStatePostgres(e,t){if(!t&&getStateRuntimeSchemaAdmission(e)?.startupReady)return;let n=withPostgresSchemaAdmissionRetry(e,()=>{let t=Je(e);if(!t)throw new PostgresSchemaAdmissionUnavailableError(`Missing PostgreSQL state admission. ${Mi}`);return t}),r=new Set(n.catalog.filter(e=>e.kind===`table`).map(e=>e.table)),i=new Set(X.fragments.flatMap(e=>e.tables.some(e=>r.has(e))?[]:e.tables));if(n.version===40&&Oe(n.catalog.filter(e=>!e.kind.endsWith(`Definition`)&&e.table!==`openclaw_schema_meta`),X.expectedCatalog.filter(e=>!i.has(e.table))),t){let t=Date.now();e.prepare(`INSERT INTO schema_meta
(meta_key, role, schema_version, agent_id, app_version, created_at, updated_at)
VALUES ('primary', 'global', ?, NULL, ?, ?, ?)`).run(40,g,t,t),writeStateSchemaContentVersion(e)}let a=e.prepare(`SELECT schema_version, role, agent_id FROM schema_meta WHERE meta_key = 'primary'`).get(),o=e.prepare(`SELECT value_json FROM config_machine_state WHERE state_key = 'state.schema.contentVersion'`).get(),s;try{let e=o?.value_json;if(e!=null&&typeof e!=`string`)throw Error(`Invalid PostgreSQL state content marker`);s=parseStateSchemaContentVersion(e)}catch{throw Error(`PostgreSQL state metadata mismatch. ${Mi}`)}if(a?.schema_version!==n.version||a.role!==`global`||a.agent_id!==null||s>n.version)throw Error(`PostgreSQL state metadata mismatch. ${Mi}`);publishStateSchemaVersionAdmission(e,{userVersion:n.version,contentVersion:n.version}),publishStateRuntimeSchemaAdmission(e,!0)}function statePostgresVersionSql(e){return`UPDATE schema_meta
SET schema_version = ${e},
app_version = '${g.replaceAll(`'`,`''`)}',
updated_at = CAST(EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000 AS bigint)
WHERE meta_key = 'primary';
INSERT INTO config_machine_state (state_key, value_json, updated_at_ms)
VALUES ('state.schema.contentVersion', '${e}',
CAST(EXTRACT(EPOCH FROM CURRENT_TIMESTAMP) * 1000 AS bigint))
ON CONFLICT (state_key) DO UPDATE
SET value_json = EXCLUDED.value_json, updated_at_ms = EXCLUDED.updated_at_ms;`}function createStatePostgresMigrations(){let e={postgres:Ni.postgres,postgresFragments:Ni.postgresFragments},t=withLegacyWorkerProvisionSource(e.postgres),n=withLegacyWorkspaceBootstrapDeferred(t),r={...e,postgres:t,postgresWithoutOptionalColumn:{table:`workspace_setup_state`,column:`bootstrap_deferred`,sql:n}},i={...e,postgres:withLegacyWorkerRetention(n)},a={postgres:withLegacyRepositoryDiskAuthority(i.postgres),postgresFragments:i.postgresFragments.map(e=>({...e,sql:withLegacyRepositoryDiskAuthority(e.sql)}))},o={postgres:withLegacyWorkerResourceReceipts(a.postgres),postgresFragments:a.postgresFragments},s={postgres:withLegacyTemplateStateSchema(o.postgres),postgresFragments:o.postgresFragments.map(e=>({...e,tables:e.tables.map(legacyTemplateStateIdentifier),sql:withLegacyTemplateStateSchema(e.sql)}))},c={postgres:withLegacyLocalWorkspaceCas(s.postgres),postgresFragments:s.postgresFragments.map(e=>({...e,tables:e.tables.filter(e=>!mi.some(t=>t===e)),sql:withLegacyLocalWorkspaceCas(e.sql)}))},l={postgres:withLegacyPostgresIndexOrdering(c.postgres,`schema-nullability`),postgresFragments:c.postgresFragments.map(e=>({...e,sql:withLegacyPostgresIndexOrdering(e.sql,`schema-nullability`)}))},u={postgres:withLegacyPostgresIndexOrdering(l.postgres),postgresFragments:l.postgresFragments.map(e=>({...e,sql:withLegacyPostgresIndexOrdering(e.sql)}))},d={postgres:withLegacyLocalWorkspaceManifests(u.postgres),postgresFragments:u.postgresFragments.map(e=>({...e,tables:e.tables.filter(e=>e!==`local_workspace_manifest_nodes`),sql:withLegacyLocalWorkspaceManifests(e.sql)}))},f={...d,postgres:`${d.postgres}\n${X.clientCredentialSource.sql}`},p={postgres:withLegacyPublicationDraft(f.postgres),postgresFragments:f.postgresFragments.map(e=>({...e,sql:withLegacyPublicationDraft(e.sql)}))},m={...p,postgres:p.postgres.replace(/CREATE INDEX "idx_state_leases_owner"[^;]*;/u,X.preWriteIndexesV27Sql.state_leases)+X.preWriteIndexesV27Sql.skill_usage+X.preWriteIndexesV27Sql.acp_replay_events,postgresFragments:p.postgresFragments};return[{version:25,sql:X.operatorRecoveryV25Sql,fromSchema:m,schema:m},{version:26,fromSchema:m,schema:m,sql:statePostgresVersionSql(26)},{version:27,fromSchema:m,schema:p,sql:`${X.writeIndexesV27Sql}
${statePostgresVersionSql(27)}`},{version:28,fromSchema:p,schema:f,sql:`ALTER TABLE IF EXISTS github_publication_requests ADD COLUMN draft bigint;
ALTER TABLE IF EXISTS github_personal_publication_requests ADD COLUMN draft bigint;
ALTER TABLE IF EXISTS github_repository_publication_requests ADD COLUMN draft bigint;
${statePostgresVersionSql(28)}`},{version:29,fromSchema:f,schema:d,sql:X.clientCredentialV29Sql},{version:30,fromSchema:d,schema:d,sql:statePostgresVersionSql(30)},{version:31,fromSchema:d,schema:u,sql:`DO $workspace$
DECLARE baseline_constraint text;
BEGIN
IF to_regclass('local_workspace_projections') IS NOT NULL THEN
SELECT conname INTO STRICT baseline_constraint FROM pg_constraint
WHERE conrelid = 'local_workspace_projections'::regclass AND contype = 'c'
AND pg_get_constraintdef(oid) LIKE '%baseline_json%baseline_ref%';
EXECUTE format('ALTER TABLE local_workspace_projections DROP CONSTRAINT %I', baseline_constraint);
ALTER TABLE local_workspace_projections
ADD COLUMN checkpoint_json text COLLATE "C",
ADD CHECK (baseline_json IS NULL OR baseline_ref IS NOT NULL);
CREATE TABLE local_workspace_manifest_nodes (
worktree_id text COLLATE "C" NOT NULL,
path text COLLATE "C" NOT NULL,
node_json text COLLATE "C" NOT NULL,
PRIMARY KEY (worktree_id, path),
FOREIGN KEY (worktree_id) REFERENCES local_workspace_projections(worktree_id)
ON DELETE CASCADE
);
END IF;
END $workspace$;
${statePostgresVersionSql(31)}`},{version:32,fromSchema:u,schema:l,sql:`${postgresIndexOrderingMigration([l.postgres,...l.postgresFragments.map(e=>e.sql)].join(`
`))}
${statePostgresVersionSql(32)}`},{version:33,fromSchema:l,schema:c,sql:`${postgresIndexOrderingMigration([c.postgres,...c.postgresFragments.map(e=>e.sql)].join(`
`),`schema-nullability`)}
${statePostgresVersionSql(33)}`},{version:34,fromSchema:c,schema:c,sql:statePostgresVersionSql(34)},{version:35,fromSchema:c,schema:s,sql:`${X.workspaceCasV35Sql}\n${statePostgresVersionSql(35)}`},{version:36,fromSchema:s,schema:o,sql:`${Di}\n${statePostgresVersionSql(36)}`},{version:37,fromSchema:o,schema:a,sql:`ALTER TABLE worker_environments ADD COLUMN resource_receipt_json text COLLATE "C";
${statePostgresVersionSql(37)}`},{version:38,fromSchema:a,schema:i,sql:`ALTER TABLE IF EXISTS session_repository_workspaces ADD COLUMN disk_authority_json text COLLATE "C";
ALTER TABLE worker_workspace_pending_results ADD COLUMN repository_disk_authority_json text COLLATE "C";
${statePostgresVersionSql(38)}`},{version:39,fromSchema:i,schema:r,sql:`ALTER TABLE worker_environments ADD COLUMN retention_json text COLLATE "C";
${statePostgresVersionSql(39)}`},{version:40,fromSchema:r,schema:e,sql:`ALTER TABLE workspace_setup_state ADD COLUMN IF NOT EXISTS bootstrap_deferred bigint;
ALTER TABLE worker_environments ADD COLUMN provision_source_json text COLLATE "C";
UPDATE worker_environments
SET provision_source_json = '{"kind":"unavailable"}'
WHERE (state IN ('requested', 'provisioning') AND lease_id IS NULL
OR state = 'bootstrapping' AND owner_epoch = 0)
AND provision_source_json IS NULL;
${statePostgresVersionSql(40)}`}]}const Ni={id:`state`,version:40,sqlite:``,get postgres(){let e=X.eagerSql;return Object.defineProperty(this,"postgres",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get postgresFragments(){let e=X.fragments.map(e=>{let{activation:t}=e;if(t!==`first-use`&&t!==`version-additive`)throw Error(`Unknown PostgreSQL state fragment activation: ${t}`);return{id:e.id,tables:e.tables,sql:e.sql,dependencies:e.dependencies,activation:t}});return Object.defineProperty(this,"postgresFragments",{value:e,enumerable:!0,configurable:!0,writable:!0}),e},get postgresMigrations(){let e=createStatePostgresMigrations();return Object.defineProperty(this,"postgresMigrations",{value:e,enumerable:!0,configurable:!0,writable:!0}),e}};function openExistingStatePostgresConnection(e,t){if(Tn())return openExistingStatePostgresConnectionFromAnchor(Ln(e,{existingOnly:!0,expectedIdentity:t}),e)}function openExistingStatePostgresConnectionFromAnchor(e,t){let n;try{let r=Tn();if(!r)throw Error(`PostgreSQL state inspection requires the configured state connection.`);admitStateSchemaFacts(e,t);let i=openEngineStore({anchor:e,schema:Ni,input:r,inspectSqlite:()=>inspectStateSqlite(e),prepareAnchor:()=>{},openSqlite:()=>{},existingOnly:!0,reusePostgresConnection:!0,existingVersion:!0,admitPostgres:admitStatePostgres,closeOnFailure:(e,t)=>{throw n=e,t}});if(!E(i))throw Error(`Expected PostgreSQL state connection`);return n=i,{database:{db:n,path:t},close(){return A(li.closeUnpublishedOpenClawStateDatabaseHandle({db:i,path:t}),`PostgreSQL state connection cleanup failed.`),!i.isOpen&&!e.isOpen}}}catch(r){let i=li.closeUnpublishedOpenClawStateDatabaseHandle({db:n??e,path:t});throw i.length?w([r,...i],`PostgreSQL state connection acquisition and cleanup failed.`,r):r}}function assertSqliteSchemaContains(e,t,n,r={},i){let a=collectSqliteSchemaIssues(e,n,r,i);a.length>0&&An(t,Cn(a))}function collectSqliteSchemaIssues(e,t,n={},r){if(!ve(e))return Xe(e,()=>collectSqliteSchemaIssues(e,t,n,r));let i=typeof t==`string`?readGeneratedSqliteFingerprint(t):void 0,a=i?.viewNames??getSqliteSchemaContract(t).catalog.views.map(e=>e.name),o=r??Vn(e,a,i?.tableNames??getSqliteSchemaContract(t).catalog.tables.map(e=>e.name));if(hasCanonicalSqliteSchemaFingerprint(t,o,n))return[];let s=getSqliteSchemaContract(t),c=new Set(n.excludedTables??[]),l=new Set(n.excludedIndexes??[]),u=new Set(n.allowedMissingTables??[]),d=new Set(n.allowedMissingIndexes??[]),f=[],add=(e,t,n)=>{f.push(P(e,t,n))};for(let[t,r]of s.tables){if(c.has(t))continue;let i=o(t);if(!i){if(u.has(t))continue;add(`missing-table`,t);continue}f.push(...compareTableDefinitions(t,i.definition,r.definition,n,!u.has(t)));for(let e of compareTablePragmaFacts(t,i,r,n))f.some(t=>t.code===e.code&&t.objectName===e.objectName)||f.push(e);let a=new Set(i.indexes.map(e=>JSON.stringify(e))),s=/* @__PURE__ */ new Set;for(let n of r.indexes){if(n.name!==null&&l.has(n.name))continue;let r=JSON.stringify(n);if(s.add(r),!a.has(r)){let r=n.name??t;if(n.name&&d.has(n.name)&&!e.prepare(`SELECT 1 FROM main.sqlite_schema WHERE type = 'index' AND name = ? COLLATE NOCASE LIMIT 1`).get(n.name))continue;add(`missing-or-drifted-index`,r,`missing or drifted index ${n.name??`on ${t}`}`)}}for(let e of i.indexes)e.unique===1&&!s.has(JSON.stringify(e))&&add(`unexpected-unique-index`,e.name??t,`unexpected unique index ${e.name??`on ${t}`}`);let p=collectOptionalCanonicalTriggerGroups(e,n,t),m=p.flatMap(e=>e.triggers),h=p.filter(e=>e.optional).flatMap(e=>e.triggers);for(let e of r.triggers)h.some(t=>t.name===e.name)||containsTrigger(i.triggers,e)||add(`missing-or-drifted-trigger`,e.name);for(let e of p){let t=i.triggers.some(t=>e.triggers.some(e=>t.name===e.name));if(!e.optional||t)for(let t of e.triggers)containsTrigger(i.triggers,t)||add(`missing-or-drifted-trigger`,t.name)}for(let e of i.triggers)!containsTrigger(r.triggers,e)&&!containsTrigger(m,e)&&add(`unexpected-trigger`,e.name);i.virtualTableSql!==r.virtualTableSql&&add(`virtual-table-definition-drift`,t),(i.strict!==r.strict||i.withoutRowid!==r.withoutRowid)&&add(`table-options-drift`,t)}let p=o.readView??Vn(e,a).readView;for(let e of s.catalog.views){let t=p(e.name);if(!t||t.sql!==e.sql||JSON.stringify(normalizeColumns(t.columns))!==JSON.stringify(normalizeColumns(e.columns)))add(`missing-or-drifted-view`,e.name);else{for(let n of e.triggers)containsTrigger(t.triggers,n)||add(`missing-or-drifted-trigger`,n.name);for(let n of t.triggers)containsTrigger(e.triggers,n)||add(`unexpected-trigger`,n.name)}}return f}function assertSqliteSchemaTablesPresent(e,t,n,r={}){let i=new Set(r.allowedMissingTables??[]),a=getCanonicalSqliteTableNames(n).filter(e=>!i.has(e)),o=[];for(let t=0;t<a.length;t+=500){let n=a.slice(t,t+500),r=n.map((e,t)=>`(${t}, ?)`).join(`, `),i=e.prepare(`WITH expected(ordinal, name) AS (VALUES ${r})
SELECT ordinal FROM expected
WHERE EXISTS (
SELECT 1 FROM main.sqlite_schema
WHERE type = 'table' AND name = expected.name LIMIT 1
)`).all(...n),s=new Set(i.map(e=>e.ordinal));for(let[e,t]of n.entries())s.has(e)||o.push(`missing table ${t}`)}o.length>0&&An(t,o)}function getCanonicalSqliteTableNames(e){if(typeof e==`string`){let t=readGeneratedSqliteFingerprint(e);if(t)return[...t.tableNames]}return[...getSqliteSchemaContract(e).tables.keys()]}function hasCanonicalSqliteSchemaFingerprint(e,t,n={}){let r=typeof e==`string`?readGeneratedSqliteFingerprint(e):void 0;if(!r||!t.readCatalog)return!1;let i=t.readCatalog(r.viewNames,r.tableNames);if(fingerprintSqliteSchemaCatalog(i,r)!==r.fingerprint)return!1;for(let e of n.optionalCanonicalTriggerGroups??[]){if(!r.tableNames.includes(e.tableName)||n.excludedTables?.includes(e.tableName))continue;let t=i.tables.find(t=>t.name===e.tableName).triggers;if((e.optionalWhenTableMissing&&i.tables.some(t=>t.name===e.optionalWhenTableMissing)||t.some(t=>e.triggers.some(e=>e.name===t.name)))&&!e.triggers.every(e=>containsTrigger(t,{name:e.name,sql:normalizeOptionalCanonicalTriggerSql(e.sql)})))return!1}return!n.excludedIndexes?.length||!i.tables.some(e=>r.tableNames.includes(e.name)&&!n.excludedTables?.includes(e.name)&&e.indexes.some(e=>e.origin===`c`&&e.unique===1&&n.excludedIndexes?.includes(e.name)))}function collectOptionalCanonicalTriggerGroups(e,t,n){return(t.optionalCanonicalTriggerGroups??[]).filter(e=>e.tableName===n).map(t=>({optional:!t.optionalWhenTableMissing||!e.prepare(`SELECT 1 FROM main.sqlite_schema WHERE type = 'table' AND name = ? LIMIT 1`).get(t.optionalWhenTableMissing),triggers:t.triggers.map(e=>({name:e.name,sql:normalizeOptionalCanonicalTriggerSql(e.sql)}))}))}function normalizeOptionalCanonicalTriggerSql(e){return D(e)?.replace(/^(CREATE TRIGGER) main\./iu,`$1 `)??null}const Pi=/* @__PURE__ */ new WeakMap,Fi=/* @__PURE__ */ new Map;function getSqliteSchemaContract(e){if(typeof e==`string`){let t=Fi.get(e);if(t)return t}let t=typeof e==`string`?readGeneratedSqliteCatalog(e):e;if(!t)throw Error(`SQLite schema has no generated catalog; run pnpm db:postgres:gen for its declared schema input.`);let n=Pi.get(t);return n||(n={catalog:t,tables:Kn(t)},Pi.set(t,n)),typeof e==`string`&&Fi.set(e,n),n}function normalizeColumns(e){return e.map(({cid:e,name:t,type:n,dflt_value:r,...i})=>({...i,name:Ot(t),type:n.toUpperCase(),dflt_value:r===null?null:Pt(r)})).toSorted((e,t)=>e.name.localeCompare(t.name))}function normalizeForeignKeys(e,t){let n=/* @__PURE__ */ new Map;for(let{id:t,from:r,table:i,to:a,...o}of e){let e=n.get(t)??[];e.push({...o,from:Ot(r),table:Ot(i),to:a===null?null:Ot(a)}),n.set(t,e)}return[...n.values()].filter(e=>!e.some(e=>t.has(e.from))).map(e=>e.toSorted((e,t)=>e.seq-t.seq)).toSorted((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)))}function compareTablePragmaFacts(e,t,n,r){let i=[],a=new Map(normalizeColumns(t.columns).map(e=>[e.name,e])),o=normalizeColumns(n.columns),s=/* @__PURE__ */ new Set;for(let n of o){let o=n.name,c=`${e}.${o}`,l=a.get(o);if(!l){(r.allowedMissingColumns??[]).includes(c)?s.add(o):i.push(P(`missing-column`,c));continue}let u=t.definition?.columns.get(o),d=r.allowedColumnDefinitions?.[c]??[];u!==void 0&&d.some(e=>Pt(e)===u)?s.add(o):JSON.stringify(l)!==JSON.stringify(n)&&i.push(P(`column-definition-drift`,c))}if(n.definition===null){let t=new Set(o.map(e=>e.name));for(let n of a.values())t.has(n.name)||i.push(P(`unexpected-column`,`${e}.${n.name}`))}return JSON.stringify(normalizeForeignKeys(t.foreignKeys,s))!==JSON.stringify(normalizeForeignKeys(n.foreignKeys,s))&&i.push(P(`table-constraint-drift`,e)),i}function compareTableDefinitions(e,t,n,r,i){let a=[],add=(e,t)=>{a.push(P(e,t))};if(!t||!n)return t!==n&&add(`table-definition-drift`,e),a;let o=new Set(r.allowedMissingColumns??[]);for(let[a,o]of t.columns)if(!n.columns.has(a)){let t=`${e}.${a}`;if((r.allowedColumnDefinitions?.[t]??[]).some(e=>Pt(e)===o)||i&&r.allowCompatibleAdditiveColumns&&isCompatibleAdditiveColumnDefinition(o))continue;add(`unexpected-column`,t)}for(let[i,a]of n.columns){let n=`${e}.${i}`,s=t.columns.get(i);s===void 0?o.has(n)||add(`missing-column`,n):s!==a&&((r.allowedColumnDefinitions?.[n]??[]).some(e=>Pt(e)===s)||add(`column-definition-drift`,n))}return JSON.stringify(t.constraints)!==JSON.stringify(n.constraints)&&add(`table-constraint-drift`,e),a}const Ii=/* @__PURE__ */ new Set([`ANY`,`BLOB`,`INT`,`INTEGER`,`REAL`,`TEXT`]);function isCompatibleAdditiveColumnDefinition(e){let t=Nt(e,0),n=t?Nt(e,t.end):null;return!!(n?.keyword&&Ii.has(n.keyword)&&e.slice(n.end).trim().length===0)}function containsTrigger(e,t){return e.some(e=>e.name===t.name&&e.sql===t.sql)}function readSqliteSchemaCookie(e){return e.prepare(`PRAGMA schema_version`).get()?.schema_version}const Li=Hn().int().min(0).max(2**53-1);Gn(`reason`,[F({reason:L(`expired`),expiresAt:Li,expiredByMs:Li,heartbeatAgeMs:Li,renewalTimerLateByMs:Li.optional()}),F({reason:L(`replaced`),owner:L(`[redacted]`)}),F({reason:L(`missing`)}),F({reason:L(`storage-failed`)}),F({reason:L(`admission-failed`)})]);function hasLegacyCronRunLogs(e){let t=y(e);return t?t.tables.has(`cron_run_logs`):!!e.prepare(`SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'cron_run_logs' LIMIT 1`).get()}const Ri=R().refine(e=>!e.includes(`\0`),`Must not contain NUL`),zi=In([Ri,Rn(Ri).min(1).refine(e=>!!e[0]?.length,`Executable must not be empty`)]),Z=In([zi,I(R(),zi)]),Bi=R().regex(/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/u),Vi=R().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),Hi=I(Vi,F({description:R().optional(),documentationUrl:R().optional()}).passthrough()).refine(e=>Object.keys(e).length<=16,`At most 16 setup secrets may be requested`),Ui=I(R().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),Ri),Wi=F({source:xn([`devcontainer`,`script`,`detected`,`none`]),identity:Bi.optional(),inputs:I(R(),Bi),env:I(R().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),Ri.nullable()),secretNames:Rn(Vi).max(16).optional(),ignoredPropertiesNote:R().optional(),onCreate:Z.optional(),updateContent:Z.optional(),postCreate:Z.optional(),postStart:Z.optional(),detectedInstall:Z.optional()}).strict();F({onCreateCommand:Z.optional(),updateContentCommand:Z.optional(),postCreateCommand:Z.optional(),postStartCommand:Z.optional(),secrets:Hi.optional(),containerEnv:Ui.optional(),remoteEnv:I(R().regex(/^[A-Za-z_][A-Za-z0-9_]*$/u),Ri.nullable()).optional()}).passthrough();const Q=R().regex(/^[a-f0-9]{64}$/u),Gi=F({nodeBootstrapSha256:Q,enabledPluginIds:Rn(R().min(1).max(256)).max(256),workerBundleHash:Q,workerArchiveSha256:Q,openclawVersion:R().min(1).max(128),protocolFeatures:Rn(R().min(1).max(128)).max(64)}).strict(),Ki=F({machineClass:R().min(1).max(256),platform:R().min(1).max(64),arch:R().min(1).max(64).optional(),profileKey:Q.optional()}).strict();F({key:Q,cacheKey:Q,contractVersion:In([L(1),L(2)]),setupRecipe:R().regex(/^[a-f0-9]{40}(?:[a-f0-9]{24})?$/u).optional(),runSetupScript:Xn().optional(),recipe:Wi.optional(),target:Ki,artifacts:Gi}).strict().omit({setupRecipe:!0,runSetupScript:!0,recipe:!0}).extend({source:xn([`empty`,`image`])});const qi=[`device_identities`,`device_auth_tokens`,`gateway_origin_device_tokens`,`exec_approvals_config`],Ji={version:21,tables:[`meeting_transcript_sessions`,`meeting_transcript_summaries`,`delivery_queue_entries`],columns:[...[`source_account_id`,`source_guild_id`,`source_channel_id`,`source_meeting_url`,`source_thread_ts`,`source_file_id`,`metadata_agent_id`].map(e=>`meeting_transcript_sessions.${e}`),`meeting_transcript_summaries.overview`,`delivery_queue_entries.retention_id_prefix`,`delivery_queue_entries.retention_max_age_ms`,`delivery_queue_entries.retention_max_entries`],migrate:migratePredicateColumnsV21,applied:`Derived meeting transcript selectors and bounded delivery retention columns (v21)`};function migratePredicateColumnsV21(e,t){let n=t===21&&Ji.columns.some(t=>{let n=t.indexOf(`.`),r=t.slice(0,n);return N(e,r)&&!On(e,r,t.slice(n+1))});if(t>=21&&!n)return!1;let r=!1,text=(e,t)=>`CASE WHEN json_valid(${e}) THEN CASE WHEN json_type(${e}, '${t}') = 'text' THEN json_extract(${e}, '${t}') END END`;if(N(e,`meeting_transcript_sessions`)){let t=[`accountId`,`guildId`,`channelId`,`meetingUrl`,`threadTs`,`fileId`],n=[`source_account_id`,`source_guild_id`,`source_channel_id`,`source_meeting_url`,`source_thread_ts`,`source_file_id`];for(let t of[...n,`metadata_agent_id`])r=M(e,`meeting_transcript_sessions`,`${t} TEXT`)||r;e.exec(`UPDATE meeting_transcript_sessions SET
${n.map((e,n)=>`${e} = ${text(`source_json`,`$.${t[n]}`)}`).join(`,`)},
metadata_agent_id = ${text(`metadata_json`,`$.agentId`)}`)}return N(e,`meeting_transcript_summaries`)&&(r=M(e,`meeting_transcript_summaries`,`overview TEXT`)||r,e.exec(`UPDATE meeting_transcript_summaries SET overview = ${text(`summary_json`,`$.overview`)}`)),N(e,`delivery_queue_entries`)&&(r=M(e,`delivery_queue_entries`,`retention_id_prefix TEXT`)||r,r=M(e,`delivery_queue_entries`,`retention_max_age_ms INTEGER`)||r,r=M(e,`delivery_queue_entries`,`retention_max_entries INTEGER`)||r,e.exec(`UPDATE delivery_queue_entries SET
(retention_id_prefix, retention_max_age_ms, retention_max_entries) = (
SELECT id_prefix, max_age_ms, max_entries FROM (
SELECT json_extract(entry_json, '$.completionRetention.idPrefix') id_prefix,
json_extract(entry_json, '$.completionRetention.maxAgeMs') max_age_ms,
json_extract(entry_json, '$.completionRetention.maxEntries') max_entries
WHERE json_valid(entry_json)
AND json_type(entry_json, '$.completionRetention') = 'object'
) WHERE typeof(id_prefix) = 'text' AND id_prefix <> ''
AND substr(id, 1, length(id_prefix)) = id_prefix
AND typeof(max_age_ms) = 'integer' AND max_age_ms BETWEEN 1 AND 9007199254740991
AND typeof(max_entries) = 'integer' AND max_entries BETWEEN 1 AND 9007199254740991
)`)),r}function getAuditRecordKysely(e){return Jn(e)}function createAuditRecordInsert(e){return Mn(e,t=>getAuditRecordKysely(e).insertInto(`diagnostic_events`).values({scope:t(e=>e.scope),event_key:t(e=>e.event_key),payload_json:t(e=>e.payload_json),created_at:t(e=>e.created_at),sequence:t(e=>e.sequence)}).onConflict(e=>e.columns([`scope`,`event_key`]).doNothing()))}jn(createAuditRecordInsert),n(Symbol.for(`openclaw.outboundDeliveryEnqueued`),()=>({onEnqueued:e=>{}})),jn(()=>({})),jn(()=>({}));function tableSql$1(e){let t=y(e);if(t)return t.tableSql.get(`operator_approvals`)??void 0;let n=e.prepare(`SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'operator_approvals'`).get();return typeof n?.sql==`string`?n.sql:void 0}function hasCanonicalOperatorApprovalKinds(e){return!N(e,`operator_approvals`)||/kind\s+text\s+not\s+null\s+check\s*\(\s*kind\s+in\s*\(\s*'exec'\s*,\s*'plugin'\s*,\s*'system-agent'\s*\)\s*\)/.test(tableSql$1(e)?.toLowerCase()??``)}function assertCanonicalOperatorApprovalKinds(e,t){if(!hasCanonicalOperatorApprovalKinds(e))throw new j(`OpenClaw state database ${t} has a legacy operator approval schema; run openclaw doctor --fix to migrate it.`)}const Yi=[`operator_approvals`,`cron_run_receipts`,`execution_decision_facts`,`skill_workshop_changes`];function withLegacyStateHeadLayout(e){return e.replace(/(CREATE TABLE IF NOT EXISTS session_state_heads \([\s\S]*?\n\) STRICT), WITHOUT ROWID;/u,`$1;`)}function withLegacyStateWriteIndexes(e){return`${e.replace(/ON state_leases\(owner\);/u,`ON state_leases(owner, updated_at DESC);`)}
CREATE INDEX IF NOT EXISTS idx_skill_usage_key
ON skill_usage(skill_key, skill_file);
CREATE INDEX IF NOT EXISTS idx_acp_replay_events_session_seq
ON acp_replay_events(session_id, seq);
`}n(Symbol.for(`openclaw.stateSchemaMutationConflictError`),()=>class extends Error{constructor(e,t){super(`OpenClaw refused shared state schema mutation at ${e} because another Gateway owns that state directory. Stop that Gateway or perform the update through its managed restart path, then retry.`,{cause:t}),this.name=`StateSchemaMutationConflictError`}});function getOpenClawStatePredecessorSchema(e){let t=Rt;for(let[n,r]of[[40,withLegacyWorkerProvisionSource],[40,withLegacyStateV40Additions],[39,withLegacyWorkerRetention],[38,withLegacyRepositoryDiskAuthority],[37,withLegacyWorkerResourceReceipts],[36,withLegacyTemplateStateSchema],[35,withLegacyLocalWorkspaceCas],[31,withLegacyLocalWorkspaceManifests],[27,withLegacyStateWriteIndexes],[26,withLegacyStateHeadLayout]])e<n&&(t=r(t));return t}const Xi=[...Be,`worker_session_tool_operations`,`worker_turn_tool_authorities`],Zi=[`agent_database_leases`,`agent_deletion_journal`,`claw_cron_refs`,`claw_installs`,`claw_mcp_server_refs`,`claw_package_refs`,`claw_workspace_files`,`config_machine_state`,`cron_job_scratch`,`meeting_transcript_sessions`,`meeting_transcript_summaries`,`meeting_transcript_utterances`,`outbound_media_provenance`,`worker_environment_credentials`,`worker_transcript_commit_heads`,`worker_transcript_commits`,...Xi],Qi=_i.map(({columnName:e,tableName:t})=>`${t}.${e}`),$i=yi.map(({columnName:e,tableName:t})=>`${t}.${e}`);new Set($i),[...vi.map(({columnName:e,tableName:t})=>`${t}.${e}`),...Object.values(bi).flat().map(([e,t])=>`${e}.${t.split(` `,1)[0]}`)];const ea=[`worker_session_tool_operations`,`worker_turn_tool_authorities`];new Set(ea);const ta=[`idx_meeting_transcript_utterances_id`,`idx_operator_approvals_source_run_resolved`,`idx_worker_session_placements_environment`],na=[`fleet_cells`],ra={excludedTables:na,allowCompatibleAdditiveColumns:!0,allowedMissingTables:Ze,allowedMissingColumns:$i,allowedColumnDefinitions:{"diagnostic_events.sequence":[`sequence INTEGER NOT NULL DEFAULT 0`],"template_package_refs.package_integrity":[`package_integrity TEXT NOT NULL DEFAULT 'sha256:0000000000000000000000000000000000000000000000000000000000000000'`],"template_package_refs.updated_at_ms":[`updated_at_ms INTEGER NOT NULL DEFAULT 0`],"cron_jobs.enabled":[`enabled INTEGER NOT NULL DEFAULT 1`],"cron_jobs.name":[`name TEXT NOT NULL DEFAULT ''`],"cron_jobs.payload_kind":[`payload_kind TEXT NOT NULL DEFAULT 'message'`],"current_conversation_bindings.conversation_kind":[`conversation_kind TEXT NOT NULL DEFAULT 'channel'`],"operator_approvals.resolution_ref":[`resolution_ref TEXT`],"worker_environments.desktop_json":[`desktop_json TEXT`],"worker_environments.bootstrap_install_kind":[`bootstrap_install_kind TEXT`],"worker_environments.shared_host":[`shared_host INTEGER CHECK (shared_host IN (0, 1))`],"worker_environments.node_setup_id":[`node_setup_id TEXT`],"worker_environments.node_device_id":[`node_device_id TEXT`],"worker_session_placements.terminal_reason":[`terminal_reason TEXT`],"worker_session_placements.terminal_at_ms":[`terminal_at_ms INTEGER`]}},ia={...ra,excludedTables:[...na,...Be],excludedIndexes:dt};function findMissingLazyStateStartupColumn(e){for(let{tableName:t,columnName:n}of vi){if(!ia.excludedTables?.includes(t))continue;let r=e(t);if(r&&!r.columns.some(e=>e.name===n))return{tableName:t,columnName:n}}}const aa={...ra,allowedMissingTables:[...Be,...ea,...Ze],allowedMissingIndexes:ta,allowedMissingColumns:Qi},oa={agent:{30:[`trajectory_runtime_events`,`sqlite_stat1`,`sqlite_stat4`],27:[`context_engine_turn_outbox`,`sqlite_stat1`,`sqlite_stat4`],28:[`transcript_event_identities`,`session_windows`,`memory_entry_origins`,`sqlite_stat1`,`sqlite_stat4`],29:[`session_nodes`,`session_reactions`,`sqlite_stat1`,`sqlite_stat4`],31:[`memory_index_sources`,`memory_index_chunks`],32:[],33:[],34:[],35:[],36:[],37:[`session_transcript_cold_archive_chunks`],38:[],39:[`transcript_events`],40:[`session_creation_operations`],41:[`session_transcript_active_event_facts`],42:[`agent_tool_usage`]},state:{29:[...qi,`sqlite_stat1`,`sqlite_stat4`],23:[`meeting_transcript_sessions`,`worker_environments`],26:[`session_state_heads`,`sqlite_stat1`,`sqlite_stat4`],27:[`acp_replay_events`,`skill_usage`,`state_leases`,`sqlite_stat1`,`sqlite_stat4`],28:[`github_publication_requests`,`github_personal_publication_requests`,`github_repository_publication_requests`],30:[],31:[`local_workspace_projections`,`local_workspace_manifest_nodes`,`sqlite_stat1`,`sqlite_stat4`],32:[],33:[],34:[`config_machine_state`],35:[`local_workspace_projections`,`local_workspace_manifest_nodes`,`local_workspace_tree_packs`,`local_workspace_source_path_sets`],36:[`claw_installs`,`template_installs`,`claw_workspace_files`,`template_workspace_files`,`claw_package_refs`,`template_package_refs`,`claw_cron_refs`,`template_cron_refs`,`claw_mcp_server_refs`,`template_mcp_server_refs`,`agent_provenance`,`sqlite_stat1`,`sqlite_stat4`],37:[`worker_environments`],38:[`session_repository_workspaces`,`worker_workspace_pending_results`],39:[`worker_environments`],40:[`worker_environments`]}},sa=[`sqlite_stat1`,`sqlite_stat4`];[...sa],[...vi.map(({tableName:e})=>e),...Object.values(bi).flatMap(e=>e.map(([e])=>e)),...sa],{...oa.agent},{...oa.state},[...sa],[...sa],[...sa];function assertOpenClawStateDatabaseOwner(e,t){let n=getStateSchemaVersionAdmission(e);if(n&&getStateRuntimeSchemaAdmission(e))return{schema_version:n.userVersion};let r=N(e,`schema_meta`),i;try{i=r?e.prepare(`SELECT role, schema_version FROM schema_meta WHERE meta_key = 'primary' LIMIT 1`).get():void 0}catch(t){throw En(e,`schema_meta`,[`meta_key`,`role`,`schema_version`],t)}if(i?.role!==`global`){let e=typeof i?.role==`string`?i.role:`missing`;throw new j(`OpenClaw state database ${t.pathname} has schema role ${e}; expected global. Run openclaw doctor --fix to inspect and repair its ownership.`)}return i}function assertOpenClawStateDatabaseForMaintenance(e,t,n){E(e)&&ge(`postgres`,`repair`);let r=assertSupportedStateSchemaVersion(e,t.pathname,t.schemaVersions);if((t.schemaVersions?.contentVersion??readStateSchemaContentVersion(e))!==40)throw new j(`OpenClaw state database ${t.pathname} uses schema version ${r}; run openclaw doctor --fix before compacting it.`);let i=assertOpenClawStateDatabaseOwner(e,t);if(i?.schema_version!==r&&!adoptPeerPublishedStateSchemaVersion(e,i)){let e=typeof i?.schema_version==`number`?i.schema_version:`invalid`;throw new j(`OpenClaw state database ${t.pathname} metadata schema version ${e} does not match ${r}; run openclaw doctor --fix before compacting it.`)}assertSqliteSchemaContains(e,t.pathname,Rt,aa,n)}function assertOpenClawStateDatabaseVersionForMigration(e,t){let n=b(e);if(readStateSchemaContentVersion(e)!==t.version)throw new j(`OpenClaw state database ${t.pathname} uses schema version ${n}; expected ${t.version} before migrating it.`);let r=assertOpenClawStateDatabaseOwner(e,t);if(r?.schema_version!==n){let e=typeof r?.schema_version==`number`?r.schema_version:`invalid`;throw new j(`OpenClaw state database ${t.pathname} metadata schema version ${e} does not match ${n}; repair the ownership metadata before migrating it.`)}assertSqliteSchemaTablesPresent(e,t.pathname,getOpenClawStatePredecessorSchema(t.version),{allowedMissingTables:[...t.version===5?Zi:t.version<13?Xi:Be,...Ze]})}new Map(We.map(e=>[e,(t,n)=>assertOpenClawStateDatabaseVersionForMigration(t,{...n,version:e})])),[([...Yi],[...Yi.map(e=>`${e}.cursor_id`)]),...ki];const ca=[`audit_events`,`audit_identity_keys`].map(e=>({name:e,sql:D(wt(Rt,e))})),la=[`sequence`,`event_id`,`source_id`,`source_sequence`,`occurred_at`,`kind`,`action`,`status`,`error_code`,`actor_type`,`actor_id`,`agent_id`,`session_key`,`session_id`,`run_id`,`tool_call_id`,`tool_name`],ua=[...la.flatMap(e=>e===`source_id`?[e,`schema_version`]:[e]),`direction`,`channel`,`conversation_kind`,`message_outcome`,`reason_code`,`delivery_kind`,`failure_stage`,`duration_ms`,`result_count`,`account_ref`,`conversation_ref`,`message_ref`,`target_ref`];function tableHasCanonicalColumns(e,t,n,r,i){let a=e.prepare(`PRAGMA table_info(${t})`).all(),o=a.filter(e=>Number(e.pk??0)>0);return a.length===n.length&&a.every((e,t)=>e.name===n[t])&&o.length===1&&o[0]?.name===r&&i.every(e=>a.some(t=>t.name===e&&Number(t.notnull??0)===1))}function tableSql(e,t){let n=e.prepare(`SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?`).get(t);return typeof n?.sql==`string`?n.sql:void 0}function tableHasUniqueColumns(e,t,n){let r=e.prepare(`PRAGMA index_list(${t})`).all();return n.every(t=>r.some(n=>{if(Number(n.unique??0)!==1||typeof n.name!=`string`)return!1;let r=n.name.replaceAll(`'`,`''`),i=e.prepare(`PRAGMA index_info('${r}')`).all();return i.length===1&&i[0]?.name===t}))}function hasCanonicalAuditEventTable(e,t,n){let r=tableSql(e,`audit_events`)?.toLowerCase();return tableHasCanonicalColumns(e,`audit_events`,t,`sequence`,n)&&typeof r==`string`&&/\bsequence\s+integer\s+primary\s+key\s+autoincrement\b/.test(r)&&tableHasUniqueColumns(e,`audit_events`,[`event_id`,`source_id`])}function hasCanonicalAuditIdentityKeyTable(e){if(!N(e,`audit_identity_keys`))return!1;let t=tableSql(e,`audit_identity_keys`)?.toLowerCase();return tableHasCanonicalColumns(e,`audit_identity_keys`,[`id`,`key_id`,`key`,`created_at`],`id`,[`id`,`key_id`,`key`,`created_at`])&&typeof t==`string`&&/\bcheck\s*\(\s*id\s*=\s*1\s*\)/.test(t)}function hasCanonicalAuditEventsSchema(e){let t=y(e);return t&&ca.every(({name:e,sql:n})=>D(t.tableSql.get(e)??null)===n)?!0:N(e,`audit_events`)?hasCanonicalAuditEventTable(e,ua,[`event_id`,`source_id`,`schema_version`,`source_sequence`,`occurred_at`,`kind`,`action`,`status`,`actor_type`,`actor_id`])&&hasCanonicalAuditIdentityKeyTable(e):b(e)<2&&!N(e,`audit_identity_keys`)}function canRepairLegacyAuditEventsSchema(e){return!N(e,`audit_events`)||N(e,`audit_events_migration_new`)||On(e,`audit_events`,`schema_version`)?!1:(!N(e,`audit_identity_keys`)||hasCanonicalAuditIdentityKeyTable(e))&&hasCanonicalAuditEventTable(e,la,[`event_id`,`source_id`,`source_sequence`,`occurred_at`,`kind`,`action`,`status`,`actor_type`,`actor_id`,`agent_id`,`run_id`])}const da=[`skill_curator_state`,`update_check_state`,`clawhub_promotions_feed_state`,`model_catalog_remote`,`voicewake_triggers`,`voicewake_routing_routes`,`voicewake_routing_config`,`onboarding_recommendations`,`cron_store_epochs`,`tui_last_sessions`,`sidebar_sections`,`node_host_config`,`web_push_vapid_keys`],fa=`
id TEXT NOT NULL PRIMARY KEY,
agent_id TEXT NOT NULL,
session_key TEXT NOT NULL,
channel TEXT NOT NULL,
account_id TEXT,
recipient_id TEXT,
thread_id TEXT,
sender_id TEXT,
kind TEXT NOT NULL,
sensitivity TEXT NOT NULL,
source TEXT NOT NULL,
status TEXT NOT NULL,
reason TEXT NOT NULL,
suggested_text TEXT NOT NULL,
dedupe_key TEXT NOT NULL,
confidence REAL NOT NULL,
due_earliest_ms INTEGER NOT NULL,
due_latest_ms INTEGER NOT NULL,
due_timezone TEXT NOT NULL,
source_message_id TEXT,
source_run_id TEXT,
created_at_ms INTEGER NOT NULL,
updated_at_ms INTEGER NOT NULL,
attempts INTEGER NOT NULL,
last_attempt_at_ms INTEGER,
sent_at_ms INTEGER,
dismissed_at_ms INTEGER,
snoozed_until_ms INTEGER,
expired_at_ms INTEGER,
record_json TEXT NOT NULL
`;`${fa.slice(1,-1)}`,`${fa.slice(1,-1)}`,p(`state/db`),[...da],[...Yi],[...xi.flat()],Rt.split(`
`).flatMap(e=>{let t=/^CREATE TABLE IF NOT EXISTS (\w+) \(/u.exec(e)?.[1];return t?[t]:[]});function assertCanonicalAgentDatabasesPrimaryKey(e,t){if(!N(e,`agent_databases`))return;let n=tr(e,`agent_databases`);if(n.length!==2||n[0]!==`agent_id`||n[1]!==`path`)throw new j(`OpenClaw state database ${t} has an unsupported agent database registry schema. Upgrades from pre-July-2026 state are no longer migrated; restore a backup produced by a July 2026 or newer release before retrying.`)}function assertCanonicalStateSchemaShape(e,t){if(assertCanonicalOperatorApprovalKinds(e,t),assertCanonicalAgentDatabasesPrimaryKey(e,t),!hasCanonicalAuditEventsSchema(e))throw canRepairLegacyAuditEventsSchema(e)?new Ge(`audit-events-v2`,t):new j(`OpenClaw state database ${t} has a noncanonical audit event schema that cannot be repaired automatically; restore the canonical audit_events shape before retrying.`)}function assertCurrentStateRuntimeSchema(e,t,n=Vn(e)){let r=findMissingLazyStateStartupColumn(n);r&&An(t,[`missing column `+r.tableName+`.`+r.columnName]),assertCanonicalStateSchemaShape(e,t),assertOpenClawStateDatabaseForMaintenance(e,{pathname:t},n),assertSqliteSchemaContains(e,t,Rt,ia,n)}function assertNoLegacyStateRuntimeRepair(e,t){if(hasLegacyCronRunLogs(e))throw new Ge(`legacy-cron-run-logs`,t)}function assertExistingOpenClawStateRuntimeMetadata(e,t,n){if(getStateRuntimeSchemaAdmission(e)){let t=getStateSchemaVersionAdmission(e)?.userVersion;if(t!==void 0)return t}let r=assertSupportedStateSchemaVersion(e,t,void 0,void 0,n);if(readStateSchemaContentVersion(e)!==40)throw Error(`Existing shared-state database ${t} requires schema migration by its owning installation; run openclaw doctor --fix there before using it.`);let i;try{i=wn(e,Jn(e).selectFrom(`schema_meta`).select([`role`,`schema_version`]).where(`meta_key`,`=`,`primary`).limit(1))}catch(t){throw En(e,`schema_meta`,[`meta_key`,`role`,`schema_version`],t)}if(i?.role!==`global`||i.schema_version!==r)throw Error(`Existing shared-state database ${t} has inconsistent ownership or schema metadata.`);return r}function assertExistingOpenClawStateRuntimeSchema(e,t,n,r,i=`runtime`){let a=getStateRuntimeSchemaAdmission(e)?y(e):void 0;if(a){assertOpenClawStateRuntimeIntegrity(e,t,a,n,r)?.();return}let o;Qn(e,()=>{let a=assertExistingOpenClawStateRuntimeMetadata(e,t,i),s=readSqliteSchemaCookie(e);if(typeof s!=`number`)throw Error(`Existing shared-state database ${t} schema version is unavailable.`);o=assertOpenClawStateRuntimeIntegrity(e,t,{schemaVersion:s,userVersion:a},n,r),assertCurrentStateRuntimeSchema(e,t,Vn(e)),assertNoLegacyStateRuntimeRepair(e,t)},{operationLabel:`state.admission.existing-schema`}),o?.(),publishStateRuntimeSchemaAdmission(e,!0)}function assertStateReadSchemaForPolicy(e,t,n,r,i,a=`runtime`){E(e)?(r!==void 0&&ge(`postgres`,`integrity`),assertSupportedStateSchemaVersion(e,t,void 0,i,a)):n?assertExistingOpenClawStateRuntimeSchema(e,t,getSqliteWorkerStateIntegrityAdmission(),r,a):assertSupportedStateSchemaVersion(e,t,void 0,i,a)}const pa=n(Symbol.for(`openclaw.postgresStateReadSnapshot`),()=>new V);var ma=/* @__PURE__ */ __exportAll({assertStateReadSchema:()=>assertStateReadSchema,closeRetainedOpenClawStateReadConnections:()=>closeRetainedOpenClawStateReadConnections,openExistingOpenClawStateDatabaseReadOnly:()=>openExistingOpenClawStateDatabaseReadOnly,openOpenClawStateReadConnection:()=>openOpenClawStateReadConnection,openOpenClawStateReadOnlyLocation:()=>openOpenClawStateReadOnlyLocation,readOnlyStateDatabase:()=>readOnlyStateDatabase,readOpenClawStateReadOnlyLocation:()=>readOpenClawStateReadOnlyLocation,withOpenClawStateReadOnlyLocation:()=>withOpenClawStateReadOnlyLocation});const $=/* @__PURE__ */ new Map,ha=/* @__PURE__ */ new WeakSet;let ga;function retireReader(e){$.get(e.identity.key)===e&&(clearTimeout(e.idleTimer),e.idleTimer=void 0,e.retiring=!0,e.connection.close(),e.quarantineAdmission?.release(),$.delete(e.identity.key),$.size||(ga?.(),ga=void 0))}function scheduleReaderRetirement(e){Bt().explicitSqliteCloseReleasesNativeResources&&$.get(e.identity.key)===e&&(e.idleTimer??=a(()=>setTimeout(()=>{try{retireReader(e)}catch(t){process.emitWarning(`Idle shared-state reader cleanup failed: ${String(t)}`),scheduleReaderRetirement(e)}},Wn).unref()),e.idleTimer.refresh())}function closeRetainedOpenClawStateReadConnections(e){let t=[];for(let n of $.values())if(e===void 0||n.identity.key===e)try{retireReader(n)}catch(e){t.push(e)}A(t,`Retained shared-state reader cleanup failed.`)}function borrowStateReadConnection(e,t,n){if(isStatePostgres())return openStateReadConnectionResult(e,e,t,void 0,!0);isExistingOpenClawStateSchema(e);let r=$t(e);t!==void 0&&fn(e,t);for(let e of $.values())e.identity.canonicalPath===r.canonicalPath&&e.identity.key!==r.key&&retireReader(e);if(!r.key.startsWith(`file:`))return openStateReadConnectionResult(e,e,t);let i=$.get(r.key);if((i?.retiring||i&&!i.connection.database.db.isOpen)&&(retireReader(i),i=void 0),i?.borrowed)return openStateReadConnectionResult(e,e,r.key);if(!i){let t=openStateReadConnectionResult(e,e,r.key);if(t.status===`unavailable`)return t;i={connection:t.value,identity:r,retiring:!1,borrowed:!1},$.set(r.key,i),ga??=u(closeRetainedOpenClawStateReadConnections)}let a=i;if(a.quarantineAdmission?.location!==n||!a.quarantineAdmission?.isCurrent()){a.quarantineAdmission?.release(),a.quarantineAdmission=void 0;try{a.quarantineAdmission=n?un(n):void 0}catch{}}return Ke(a),a.borrowed=!0,{status:`available`,value:{database:{db:a.connection.database.db,path:e},close(e){return a.borrowed=!1,e&&a.connection.database.db.isOpen&&!a.connection.database.db.isTransaction?scheduleReaderRetirement(a):retireReader(a),!0}}}}var SnapshotCleanupIncompleteError=class extends Error{};function assertStateReadSchema(e,t,n,r=`runtime`){assertStateReadSchemaForPolicy(e,t,isExistingOpenClawStateSchema(t,e),n,void 0,r)}function withOpenClawStateReadOnlyLocation(e,t,n,r,i,a,o=!1,s,c){let l=readOpenClawStateReadOnlyLocation(e,t,n,r,i,a,o,s,c);if(l.status===`unavailable`)throw l.error;return l.value}function readOpenClawStateReadOnlyLocation(e,t,n,r,i,a,o=!1,s,c){let l=typeof n!=`string`&&`connection`in n?n.connection:void 0,u=typeof n!=`string`&&`connection`in n?n.location:n,d=l?{status:`available`,value:l}:o&&u===t&&!a?borrowStateReadConnection(t,i,c):openStateReadConnectionResult(t,u,i,a,!0);if(d.status===`unavailable`)return d;let f=d.value,p=[],m,h;try{r&&!E(f.database.db)&&(m=r(f.database.db));let n=isExistingOpenClawStateSchema(t,f.database.db),i=r?`doctor-maintenance`:`runtime`;try{let r=!1,a=pa.getStore(),read=()=>gt(f.database.db,()=>{admitStateSchemaFacts(f.database.db,t,i),assertStateReadSchemaForPolicy(f.database.db,t,n,void 0,s,i),r=!0;let a=e(f.database);if(u===t&&kt(a))throw new It(`SQLite source read must remain synchronous`);return a});h={status:`available`,value:withPostgresSchemaAdmissionRetry(f.database.db,()=>E(f.database.db)?f.database.db.runTransaction(()=>(a?.path===t&&f.database.db.exec(`SET TRANSACTION SNAPSHOT '${a.snapshot.replaceAll(`'`,`''`)}'`),read()),void 0,!0):l&&u===t?Qn(f.database.db,read):read(),()=>!r&&a?.path!==t)}}catch(e){!E(f.database.db)&&rn(e)&&(invalidateOpenClawStateRuntimeIntegrity(f.database.db),ha.add(f.database.db)),h={status:`unavailable`,error:e}}Bn(f.database.db)}catch(e){p.push(e)}try{m?.()}catch(e){p.push(e)}try{let e=typeof n!=`string`&&p.length===0&&h?.status===`available`&&!Bt().explicitSqliteCloseReleasesNativeResources;if(!l&&!f.close(p.length===0&&h?.status===`available`&&!ha.has(f.database.db))&&!e)throw new SnapshotCleanupIncompleteError(`Shared-state snapshot cleanup is incomplete.`)}catch(e){p.push(e)}return p.length&&(h?.status===`unavailable`&&!p.includes(h.error)&&p.unshift(h.error),A(p,`Shared-state read and reader cleanup failed.`)),h}function openOpenClawStateReadOnlyLocation(e,t){let n=openOpenClawStateReadConnection(e,t);try{gt(n.database.db,()=>{admitStateSchemaFacts(n.database.db,e),assertStateReadSchema(n.database.db,e)})}catch(e){try{n.close()}catch(t){A([e,t],`Shared-state reader admission and cleanup failed.`)}throw e}return n}function openOpenClawStateReadConnection(e,t,n,r){let i=openStateReadConnectionResult(e,t,n,r);if(i.status===`unavailable`)throw i.error;return i.value}function openStateReadConnectionResult(e,t,n,r,i=!1){let a=typeof t==`string`?void 0:t,o=typeof t==`string`?t:t.location,s=Vt(o),c={readOnly:!0,timeout:it},l,cleanupFailedOpen=e=>{let t=[e];try{l?.()}catch(e){t.push(e)}try{a&&!a.cleanup()&&t.push(new SnapshotCleanupIncompleteError(`Shared-state snapshot cleanup is incomplete.`))}catch(e){t.push(e)}if(t.length>1)throw w(t,`Shared-state reader open and cleanup failed.`,e)},u;try{if(isStatePostgres()){(t!==e||r)&&assertStateFileSnapshotAllowed(),i&&isExistingOpenClawStateSchema(e);let a=openExistingStatePostgresConnection(e,n);if(a)return{status:`available`,value:a}}if(n!==void 0&&fn(s,n),l=r?acquireSqliteSnapshotReadToken(r):void 0,i&&isExistingOpenClawStateSchema(e),o===e)u=zn(e,c);else try{u={status:`available`,database:Qe(o,c)}}catch(e){u={status:`unavailable`,error:e}}}catch(e){throw cleanupFailedOpen(e),e}if(u.status===`unavailable`)return cleanupFailedOpen(u.error),u;let d=u.database,f=!1,p=!1,m=0,h={db:d,path:e,afterClose:()=>{if(l?.(),a&&m===0&&!a.cleanup())throw new SnapshotCleanupIncompleteError(`Shared-state snapshot cleanup is incomplete.`)}},g={database:{db:d,path:e},snapshotSource:a?{retain(){if(p||f)throw Error(`Shared-state snapshot source is closing or closed`);let e=pe(a.cleanupRoot??B.dirname(a.location));m++;let t=!1;return{location:a.location,cleanupRoot:a.cleanupRoot,async release(){if(t||(t=!0,e(),m--),f&&m===0&&!await a.cleanupAsync())throw new SnapshotCleanupIncompleteError(`Shared-state snapshot cleanup is incomplete.`)}}}}:void 0,close(){if(f)return!1;p=!0;let e=li.closeOpenClawStateDatabaseHandle(h);return e.length===1&&e[0]instanceof SnapshotCleanupIncompleteError?!1:(A(e,`Shared-state reader cleanup failed.`),f=!0,!0)}};try{me(d),n!==void 0&&fn(s,n)}catch(e){try{if(!g.close())throw new SnapshotCleanupIncompleteError(`Shared-state snapshot cleanup is incomplete.`)}catch(t){throw w([e,t],`Shared-state reader identity and cleanup failed.`,e)}throw e}return{status:`available`,value:g}}function readOnlyStateDatabase(e,t){return{...e,walMaintenance:{checkpoint:()=>!1,stop:async()=>{},reclaimFreePages:createSqliteWalReclamationResult,close:t}}}async function openExistingOpenClawStateDatabaseReadOnly(e={}){let t=v(e);if(isExistingOpenClawStateSchema(t),!ar(t))return;li.assertOpenClawStateDatabaseFreshOpenAllowedAtPath(t,e.env??process.env);let n=x(),r=openOpenClawStateReadConnection(t,isStatePostgres()||n&&tt(n,t)?t:await prepareSqliteReadOnlyLocation(t)),{db:i}=r.database;try{E(i)?assertSupportedStateSchemaVersion(i,t):isExistingOpenClawStateSchema(t,i)||e.requireCanonicalSchema?assertExistingOpenClawStateRuntimeSchema(i,t):(assertSupportedStateSchemaVersion(i,t),assertSqliteIntegrity(i,t,{check:e.integrityCheck}),readStateSchemaContentVersion(i)===40&&assertOpenClawStateDatabaseForMaintenance(i,{pathname:t}))}catch(e){try{r.close()}catch{}throw e}return readOnlyStateDatabase(r.database,r.close)}export{ai as A,registerOpenClawStateDatabaseLifecycleListener as C,requireOpenClawStateDatabaseIdentity as D,releaseOpenClawStateDatabaseCustody as E,captureSqliteSnapshotStagingOwner as F,sqliteWorkerRequestBytes as M,getExistingOpenClawStateSchemaPath as N,ri as O,isExistingOpenClawStateSchema as P,oi as S,registerOpenClawStatePathCacheInvalidation as T,prepareOpenClawStateCachedRead as _,ci as a,assertStateReadSchema,$r as b,closeOpenClawStateDatabaseAsync as c,closeRetainedOpenClawStateReadConnections,closeOpenClawStateDatabaseForTest as d,closeOpenClawStateDatabaseWorkersByPathAsync as f,li as g,joinOpenClawStateDatabaseBorrowers as h,si as i,captureSqliteWorkerStateContext as j,Zr as k,closeOpenClawStateDatabaseByPath as l,isOpenClawStateDatabaseOpen as m,assertPublishedOpenClawStateDatabaseLifecycle as n,clearOpenClawStateDatabaseOpenFailure as o,openExistingOpenClawStateDatabaseReadOnly,openOpenClawStateReadConnection,openOpenClawStateReadOnlyLocation,getOpenClawStateDatabaseTerminalFailureAsync as p,ii as r,readOnlyStateDatabase,readOpenClawStateReadOnlyLocation,closeOpenClawStateDatabase as s,ma as t,closeOpenClawStateDatabaseByPathAsync as u,prepareOpenClawStateDatabaseRemoval as v,registerOpenClawStatePathAsyncResource as w,withOpenClawStateReadOnlyLocation,recordOpenClawStateDatabaseOpenFailure as x,publishOpenClawStateDatabaseWorkerAdmission as y};