import{s as e}from"./DrKWWDpL.js";import{t}from"./DYP3EJMY.js";import{Hn as n}from"./DIQmuJJZ.js";import{t as r}from"./CxlOpib82.js";import{r as i}from"./CX8DOZuw2.js";var a=e(t(),1);function o(e,t){let o;try{o=i(t)}catch{return}let s=(0,a.dirname)(o),c=(0,a.join)(s,`.git`),l=!1;try{l=(0,a.existsSync)(c)&&(0,a.statSync)(c).isFile()}catch{}if(l){if({}.CLEO_ALLOW_WORKTREE_DB_CREATE===`1`){process.stderr.write(`[T9806 WT-DB-OVERRIDE] role=${e} path=${o} reason=CLEO_ALLOW_WORKTREE_DB_CREATE=1\n`);return}throw new r(n.CONFIG_ERROR,`E_WT_DB_ISOLATION_VIOLATION: refusing to open '${e}' DB at ${o} — parent ${s} is a git worktree (gitlink). DBs must open against the canonical project root.`,{fix:`Run from the canonical project root, OR delete the leaked .cleo/ inside the worktree, OR set CLEO_ALLOW_WORKTREE_DB_CREATE=1 (emergency override, audited).`})}}export{o as t};