{"version":3,"file":"config-ch_DJeTs.cjs","names":["fs","readText","nodeHost","globalPoConfigPath","repositoryConfigFor","mergeConfigLayers","configFromText","defaultPoConfig","mergeLenientLayers","lenientConfigFromText","composeConfigLayers","layerFromText","absentRepositoryLayer","path","readTextIfExists","configFromText","parseYaml","parsePoConfig","nodeHost","globalPoConfigPath","repositoryConfigFor","defaultPoConfig","mergeConfigLayers","lenientConfigFromText","mergeLenientLayers","layerFromText","absentRepositoryLayer","composeConfigLayers"],"sources":["../src/services/config/sync.ts","../src/services/config/index.ts"],"sourcesContent":["// sync: readTextSync supports exported Node-only synchronous config readers retained for phase 2.\nimport fs from 'node:fs';\n\nimport { nodeHost } from '@agimon-ai/po-core/platform';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult } from '../../types/config';\nimport {\n  absentRepositoryLayer,\n  composeConfigLayers,\n  configFromText,\n  defaultPoConfig,\n  globalPoConfigPath,\n  layerFromText,\n  lenientConfigFromText,\n  mergeConfigLayers,\n  mergeLenientLayers,\n  repositoryConfigFor,\n} from './core';\n\nfunction readTextSync(filePath: string | undefined): string | undefined {\n  if (filePath === undefined) return undefined;\n  try {\n    return fs.readFileSync(filePath, 'utf8');\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n    throw error;\n  }\n}\n\nasync function readText(filePath: string): Promise<string | undefined> {\n  try {\n    return await fs.promises.readFile(filePath, 'utf8');\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n    throw error;\n  }\n}\n\n/** @deprecated Node-only sync shim; use readPoConfig. Removed in M2. */\nexport function loadPoConfig(\n  repoRoot: string,\n  homeDirectory = nodeHost.homeDirectory(),\n  environment: NodeJS.ProcessEnv = process.env,\n): PoConfig {\n  const globalPath = globalPoConfigPath(homeDirectory, environment);\n  const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory, environment);\n  return mergeConfigLayers(\n    configFromText(readTextSync(globalPath), globalPath),\n    repositoryPath === undefined ? defaultPoConfig() : configFromText(readTextSync(repositoryPath), repositoryPath),\n    environment,\n  );\n}\n\n/**\n * Loads the merged config, tolerating unknown keys in either file.\n *\n * Only `po sync` uses this. Everything that runs during a session keeps\n * `loadPoConfig`, because a key a running extension cannot understand is\n * better reported than silently ignored; a build that refuses to start over\n * the same key is not.\n *\n * @deprecated Node-only sync shim; use readPoConfigLenient. Removed in M2.\n */\nexport function loadPoConfigLenient(\n  repoRoot: string,\n  homeDirectory = nodeHost.homeDirectory(),\n  environment: NodeJS.ProcessEnv = process.env,\n): LenientParseResult {\n  const globalPath = globalPoConfigPath(homeDirectory, environment);\n  const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory, environment);\n  return mergeLenientLayers(\n    lenientConfigFromText(readTextSync(globalPath), globalPath),\n    lenientConfigFromText(readTextSync(repositoryPath), repositoryPath ?? ''),\n    environment,\n  );\n}\n\n/** @deprecated Node-only shim over node:fs; use readPoConfig. Removed in M2. */\nexport async function loadPoConfigAsync(\n  repoRoot: string,\n  homeDirectory = nodeHost.homeDirectory(),\n  environment: NodeJS.ProcessEnv = process.env,\n): Promise<PoConfig> {\n  const globalPath = globalPoConfigPath(homeDirectory, environment);\n  const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory, environment);\n  const globalConfig = configFromText(await readText(globalPath), globalPath);\n  const repositoryConfig =\n    repositoryPath === undefined ? defaultPoConfig() : configFromText(await readText(repositoryPath), repositoryPath);\n  return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** @deprecated Node-only sync shim; use readPoConfigLayers. Removed in M2. */\nexport function loadPoConfigLayers(\n  repoRoot: string | undefined,\n  homeDirectory = nodeHost.homeDirectory(),\n  environment: NodeJS.ProcessEnv = process.env,\n): PoConfigLayers {\n  const globalPath = globalPoConfigPath(homeDirectory, environment);\n  const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory, environment);\n  const globalText = readTextSync(globalPath);\n  const repositoryText = readTextSync(repositoryPath);\n  const repositoryConfig =\n    repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n  return composeConfigLayers(\n    layerFromText(globalPath, globalText),\n    repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText),\n    mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment),\n  );\n}\n","import path from 'node:path';\n\nimport { nodeHost, readTextIfExists, type FileSystem } from '@agimon-ai/po-core/platform';\nimport { parse as parseYaml } from 'yaml';\n\nimport type { PoConfig, PoConfigLayers, LenientParseResult, WorkspaceDeclaration } from '../../types/config';\nimport { parsePoConfig } from '../configPolicy';\nimport {\n  absentRepositoryLayer,\n  composeConfigLayers,\n  configFromText,\n  defaultPoConfig,\n  globalPoConfigPath,\n  layerFromText,\n  lenientConfigFromText,\n  mergeConfigLayers,\n  mergeLenientLayers,\n  repositoryConfigFor,\n  type ConfigEnvironment,\n} from './core';\n\ntype IoContext = Parameters<FileSystem['readTextFile']>[1];\n\nexport interface ReadWorkspaceDeclarationsOptions {\n  fs: FileSystem;\n  repositoryRoot: string;\n  context: IoContext;\n}\n\nexport interface WorkspaceDeclarationsResult {\n  declarations: WorkspaceDeclaration[];\n  source: 'workspaces.yaml' | 'config.yaml' | undefined;\n  notices: string[];\n}\n\nconst object = (value: unknown): value is Record<string, unknown> =>\n  typeof value === 'object' &&\n  value !== null &&\n  (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null);\n\nfunction jsonValue(value: unknown, seen = new Set<object>()): boolean {\n  if (value === null || typeof value === 'string' || typeof value === 'boolean') return true;\n  if (typeof value === 'number') return Number.isFinite(value);\n  if (typeof value !== 'object' || (!Array.isArray(value) && !object(value)) || seen.has(value)) return false;\n  seen.add(value);\n  const valid = (Array.isArray(value) ? value : Object.values(value)).every((entry) => jsonValue(entry, seen));\n  seen.delete(value);\n  return valid;\n}\n\n/** Repository-only declarations. An existing new document is authoritative, even when empty. */\nexport async function readWorkspaceDeclarations({\n  fs,\n  repositoryRoot,\n  context,\n}: ReadWorkspaceDeclarationsOptions): Promise<WorkspaceDeclarationsResult> {\n  const filePath = path.join(repositoryRoot, '.po', 'workspaces.yaml');\n  const text = await readTextIfExists(fs, filePath, context);\n  if (text === undefined) {\n    const legacyPath = path.join(repositoryRoot, '.po', 'config.yaml');\n    const legacy = await readTextIfExists(fs, legacyPath, context);\n    const declarations = legacy === undefined ? undefined : configFromText(legacy, legacyPath).workspaces;\n    return {\n      declarations: declarations ?? [],\n      source: declarations === undefined ? undefined : 'config.yaml',\n      notices:\n        declarations === undefined\n          ? []\n          : [`Move workspaces from ${legacyPath} to ${filePath}; config.yaml workspaces is deprecated.`],\n    };\n  }\n  let document: unknown;\n  try {\n    document = parseYaml(text);\n  } catch (error) {\n    throw new Error(`Could not parse workspace declarations at ${filePath}`, { cause: error });\n  }\n  if (\n    !object(document) ||\n    Object.keys(document).some((key) => key !== 'workspaces') ||\n    !Array.isArray(document.workspaces)\n  )\n    throw new Error(`Workspace declarations at ${filePath} must be an object containing a workspaces list`);\n  const aliases = new Set<string>();\n  const declarations = document.workspaces.map((entry: unknown, index): WorkspaceDeclaration => {\n    const location = `workspaces[${String(index)}]`;\n    if (\n      !object(entry) ||\n      Object.keys(entry).some((key) => !['name', 'path', 'alias', 'instructions', 'metadata'].includes(key))\n    )\n      throw new Error(\n        `Workspace declarations at ${filePath} require ${location} to contain only name, path, alias, instructions, metadata`,\n      );\n    // Reuse the established declaration name/instructions parser, without changing the legacy config contract.\n    const base = parsePoConfig(\n      JSON.stringify({ workspaces: [{ name: entry.name, instructions: entry.instructions }] }),\n      filePath,\n    ).workspaces![0]!;\n    if (base.name.length > 80 || !/^[A-Za-z0-9][A-Za-z0-9 ._-]*$/u.test(base.name) || base.name.includes('..'))\n      throw new Error(\n        `Workspace declarations at ${filePath} require ${location}.name to use letters, numbers, spaces, dots, dashes, or underscores (up to 80 characters)`,\n      );\n    if (\n      entry.path !== undefined &&\n      (typeof entry.path !== 'string' || entry.path.trim() === '' || entry.path.includes('\\0'))\n    )\n      throw new Error(`Workspace declarations at ${filePath} require ${location}.path to be a non-empty path`);\n    if (entry.alias !== undefined && (typeof entry.alias !== 'string' || entry.alias.trim() === ''))\n      throw new Error(`Workspace declarations at ${filePath} require ${location}.alias to be a non-empty string`);\n    const alias = typeof entry.alias === 'string' ? entry.alias.trim() : undefined;\n    if (alias !== undefined) {\n      if (aliases.has(alias)) throw new Error(`Workspace declarations at ${filePath} have duplicate alias: ${alias}`);\n      aliases.add(alias);\n    }\n    if (entry.metadata !== undefined && (!object(entry.metadata) || !jsonValue(entry.metadata)))\n      throw new Error(`Workspace declarations at ${filePath} require ${location}.metadata to be a JSON object`);\n    return {\n      ...base,\n      ...(entry.path === undefined ? {} : { path: entry.path as string }),\n      ...(alias === undefined ? {} : { alias }),\n      ...(entry.metadata === undefined ? {} : { metadata: entry.metadata as Record<string, unknown> }),\n    };\n  });\n  // Retain the legacy parser's case-insensitive duplicate-name rule across the entire document.\n  parsePoConfig(\n    JSON.stringify({ workspaces: declarations.map(({ name, instructions }) => ({ name, instructions })) }),\n    filePath,\n  );\n  return { declarations, source: 'workspaces.yaml', notices: [] };\n}\n\nexport interface ReadPoConfigOptions {\n  /** Defaults to the host's home directory. */\n  readonly homeDirectory?: string;\n  /** Defaults to `process.env`. */\n  readonly environment?: ConfigEnvironment;\n}\n\nfunction resolved(options: ReadPoConfigOptions): { homeDirectory: string; environment: ConfigEnvironment } {\n  return {\n    homeDirectory: options.homeDirectory ?? nodeHost.homeDirectory(),\n    environment: options.environment ?? process.env,\n  };\n}\n\nconst readText = (fs: FileSystem, filePath: string | undefined, context: IoContext) =>\n  filePath === undefined ? Promise.resolve(undefined) : readTextIfExists(fs, filePath, context);\n\n/**\n * Loads the merged global and repository config over a FileSystem. A missing\n * file contributes the defaults, so a host with neither file, such as a fresh\n * Durable Object filesystem, reads the same config as an empty Node home.\n */\nexport async function readPoConfig(\n  fs: FileSystem,\n  repoRoot: string,\n  context: IoContext,\n  options: ReadPoConfigOptions = {},\n): Promise<PoConfig> {\n  const { homeDirectory, environment } = resolved(options);\n  const globalPath = globalPoConfigPath(homeDirectory, environment);\n  const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory, environment);\n  const globalConfig = configFromText(await readText(fs, globalPath, context), globalPath);\n  const repositoryConfig =\n    repositoryPath === undefined\n      ? defaultPoConfig()\n      : configFromText(await readText(fs, repositoryPath, context), repositoryPath);\n  return mergeConfigLayers(globalConfig, repositoryConfig, environment);\n}\n\n/** As `readPoConfig`, tolerating unknown keys in either file and reporting them. */\nexport async function readPoConfigLenient(\n  fs: FileSystem,\n  repoRoot: string,\n  context: IoContext,\n  options: ReadPoConfigOptions = {},\n): Promise<LenientParseResult> {\n  const { homeDirectory, environment } = resolved(options);\n  const globalPath = globalPoConfigPath(homeDirectory, environment);\n  const repositoryPath = repositoryConfigFor(repoRoot, homeDirectory, environment);\n  const globalConfig = lenientConfigFromText(await readText(fs, globalPath, context), globalPath);\n  const repositoryConfig =\n    repositoryPath === undefined\n      ? lenientConfigFromText(undefined, '')\n      : lenientConfigFromText(await readText(fs, repositoryPath, context), repositoryPath);\n  return mergeLenientLayers(globalConfig, repositoryConfig, environment);\n}\n\n/**\n * The two config files kept apart, with the merge alongside them.\n *\n * `repoRoot` is optional because the global file is complete on its own: a\n * settings surface with no repository in view still has settings to show.\n */\nexport async function readPoConfigLayers(\n  fs: FileSystem,\n  repoRoot: string | undefined,\n  context: IoContext,\n  options: ReadPoConfigOptions = {},\n): Promise<PoConfigLayers> {\n  const { homeDirectory, environment } = resolved(options);\n  const globalPath = globalPoConfigPath(homeDirectory, environment);\n  const repositoryPath = repoRoot === undefined ? undefined : repositoryConfigFor(repoRoot, homeDirectory, environment);\n  const globalText = await readText(fs, globalPath, context);\n  const repositoryText = await readText(fs, repositoryPath, context);\n  const globalLayer = layerFromText(globalPath, globalText);\n  const repositoryLayer =\n    repositoryPath === undefined ? absentRepositoryLayer() : layerFromText(repositoryPath, repositoryText);\n  const repositoryConfig =\n    repositoryPath === undefined ? defaultPoConfig() : configFromText(repositoryText, repositoryPath);\n  const effective = mergeConfigLayers(configFromText(globalText, globalPath), repositoryConfig, environment);\n  return composeConfigLayers(globalLayer, repositoryLayer, effective);\n}\n\nexport {\n  globalPoConfigDirectory,\n  globalPoConfigPath,\n  isGlobalPoConfigRoot,\n  repositoryPoConfigPath,\n  resolvePlanningPlansDirectory,\n} from './core';\nexport type { ConfigEnvironment } from './core';\nexport { loadPoConfig, loadPoConfigAsync, loadPoConfigLayers, loadPoConfigLenient } from './sync';\n"],"mappings":";;;;;;;;;;AAmBA,SAAS,aAAa,UAAkD;CACtE,IAAI,aAAa,KAAA,GAAW,OAAO,KAAA;CACnC,IAAI;EACF,OAAOA,QAAAA,QAAG,aAAa,UAAU,MAAM;CACzC,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;AAEA,eAAeC,WAAS,UAA+C;CACrE,IAAI;EACF,OAAO,MAAMD,QAAAA,QAAG,SAAS,SAAS,UAAU,MAAM;CACpD,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,OAAO,KAAA;EAC/D,MAAM;CACR;AACF;;AAGA,SAAgB,aACd,UACA,gBAAgBE,4BAAAA,SAAS,cAAc,GACvC,cAAiC,QAAQ,KAC/B;CACV,MAAM,aAAaC,aAAAA,mBAAmB,eAAe,WAAW;CAChE,MAAM,iBAAiBC,aAAAA,oBAAoB,UAAU,eAAe,WAAW;CAC/E,OAAOC,aAAAA,kBACLC,aAAAA,eAAe,aAAa,UAAU,GAAG,UAAU,GACnD,mBAAmB,KAAA,IAAYC,aAAAA,gBAAgB,IAAID,aAAAA,eAAe,aAAa,cAAc,GAAG,cAAc,GAC9G,WACF;AACF;;;;;;;;;;;AAYA,SAAgB,oBACd,UACA,gBAAgBJ,4BAAAA,SAAS,cAAc,GACvC,cAAiC,QAAQ,KACrB;CACpB,MAAM,aAAaC,aAAAA,mBAA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