{"version":3,"file":"pi-config-shim-CZ1wFzqM.mjs","names":["nodeResolvePath"],"sources":["../src/compat/vendor/pi-config-shim.ts"],"sourcesContent":["// @ts-nocheck — vendored Pi source; checked upstream under Pi's own tsconfig.\n// Minimal stand-ins for pi-coding-agent's config.ts and utils/paths.ts,\n// scoped to what the vendored SessionManager consumes. The agent directory is\n// redirected into DSH's home so migrated state never collides with a real Pi\n// installation on the same machine.\nimport { homedir } from 'node:os'\nimport { isAbsolute, join, resolve as nodeResolvePath } from 'node:path'\n\nexport function getAgentDir(): string {\n  if (process.env.PI_CODING_AGENT_DIR) return process.env.PI_CODING_AGENT_DIR\n  const dshHome = process.env.DSH_HOME ?? join(homedir(), '.dsh')\n  return join(dshHome, 'pi2dsh', 'agent')\n}\n\nexport function getSessionsDir(): string {\n  return join(getAgentDir(), 'sessions')\n}\n\nexport function normalizePath(input: string): string {\n  const home = homedir()\n  if (input === '~') return home\n  if (input.startsWith('~/')) return join(home, input.slice(2))\n  return input\n}\n\nexport function resolvePath(input: string, baseDir: string = process.cwd()): string {\n  const normalized = normalizePath(input)\n  const normalizedBase = normalizePath(baseDir)\n  return isAbsolute(normalized) ? nodeResolvePath(normalized) : nodeResolvePath(normalizedBase, normalized)\n}\n"],"mappings":";;;;AAQA,SAAgB,cAAsB;CACpC,IAAI,QAAQ,IAAI,qBAAqB,OAAO,QAAQ,IAAI;CACxD,MAAM,UAAU,QAAQ,IAAI,YAAY,KAAK,QAAQ,GAAG,MAAM;CAC9D,OAAO,KAAK,SAAS,UAAU,OAAO;AACxC;AAEA,SAAgB,iBAAyB;CACvC,OAAO,KAAK,YAAY,GAAG,UAAU;AACvC;AAEA,SAAgB,cAAc,OAAuB;CACnD,MAAM,OAAO,QAAQ;CACrB,IAAI,UAAU,KAAK,OAAO;CAC1B,IAAI,MAAM,WAAW,IAAI,GAAG,OAAO,KAAK,MAAM,MAAM,MAAM,CAAC,CAAC;CAC5D,OAAO;AACT;AAEA,SAAgB,YAAY,OAAe,UAAkB,QAAQ,IAAI,GAAW;CAClF,MAAM,aAAa,cAAc,KAAK;CACtC,MAAM,iBAAiB,cAAc,OAAO;CAC5C,OAAO,WAAW,UAAU,IAAIA,QAAgB,UAAU,IAAIA,QAAgB,gBAAgB,UAAU;AAC1G"}