@agimon-ai/po-config 0.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +170 -0
  3. package/dist/agentPluginMcp.cjs +322 -0
  4. package/dist/agentPluginMcp.cjs.map +1 -0
  5. package/dist/agentPluginMcp.d.mts +38 -0
  6. package/dist/agentPluginMcp.d.mts.map +1 -0
  7. package/dist/agentPluginMcp.mjs +318 -0
  8. package/dist/agentPluginMcp.mjs.map +1 -0
  9. package/dist/apiContracts.cjs +203 -0
  10. package/dist/apiContracts.cjs.map +1 -0
  11. package/dist/apiContracts.d.mts +53 -0
  12. package/dist/apiContracts.d.mts.map +1 -0
  13. package/dist/apiContracts.mjs +198 -0
  14. package/dist/apiContracts.mjs.map +1 -0
  15. package/dist/atomicJson-1W0WhuFF.mjs +44 -0
  16. package/dist/atomicJson-1W0WhuFF.mjs.map +1 -0
  17. package/dist/atomicJson-Dt2z_DXl.cjs +52 -0
  18. package/dist/atomicJson-Dt2z_DXl.cjs.map +1 -0
  19. package/dist/atomicJson.cjs +3 -0
  20. package/dist/atomicJson.d.mts +2 -0
  21. package/dist/atomicJson.mjs +2 -0
  22. package/dist/config-BUw5kHsx.cjs +219 -0
  23. package/dist/config-BUw5kHsx.cjs.map +1 -0
  24. package/dist/config-CKA07FxG.mjs +162 -0
  25. package/dist/config-CKA07FxG.mjs.map +1 -0
  26. package/dist/config-Cm3EV1jp.d.mts +320 -0
  27. package/dist/config-Cm3EV1jp.d.mts.map +1 -0
  28. package/dist/config-NSHRd6na.mjs +2 -0
  29. package/dist/config-zZz80Mh5.cjs +1 -0
  30. package/dist/config.cjs +24 -0
  31. package/dist/config.d.mts +3 -0
  32. package/dist/config.mjs +3 -0
  33. package/dist/configPolicy--TNX7feH.mjs +718 -0
  34. package/dist/configPolicy--TNX7feH.mjs.map +1 -0
  35. package/dist/configPolicy-DmsZEp0t.cjs +795 -0
  36. package/dist/configPolicy-DmsZEp0t.cjs.map +1 -0
  37. package/dist/configSchema.cjs +0 -0
  38. package/dist/configSchema.d.mts +2 -0
  39. package/dist/configSchema.mjs +1 -0
  40. package/dist/configWriter-BTuinLjs.cjs +150 -0
  41. package/dist/configWriter-BTuinLjs.cjs.map +1 -0
  42. package/dist/configWriter-BgkGaLrf.mjs +130 -0
  43. package/dist/configWriter-BgkGaLrf.mjs.map +1 -0
  44. package/dist/configWriter.cjs +5 -0
  45. package/dist/configWriter.d.mts +2 -0
  46. package/dist/configWriter.mjs +2 -0
  47. package/dist/domains-CBYkuxs5.cjs +727 -0
  48. package/dist/domains-CBYkuxs5.cjs.map +1 -0
  49. package/dist/domains-DZOu9vYM.mjs +633 -0
  50. package/dist/domains-DZOu9vYM.mjs.map +1 -0
  51. package/dist/domains.cjs +19 -0
  52. package/dist/domains.d.mts +3 -0
  53. package/dist/domains.mjs +3 -0
  54. package/dist/extensions/mcp-ui.mjs +101 -0
  55. package/dist/extensions/mcp-ui.mjs.map +1 -0
  56. package/dist/extensions/mcp.cjs +171 -0
  57. package/dist/extensions/mcp.cjs.map +1 -0
  58. package/dist/extensions/mcp.d.mts +5 -0
  59. package/dist/extensions/mcp.d.mts.map +1 -0
  60. package/dist/extensions/mcp.mjs +166 -0
  61. package/dist/extensions/mcp.mjs.map +1 -0
  62. package/dist/extensions/server.cjs +504 -0
  63. package/dist/extensions/server.cjs.map +1 -0
  64. package/dist/extensions/server.d.mts +5 -0
  65. package/dist/extensions/server.d.mts.map +1 -0
  66. package/dist/extensions/server.mjs +499 -0
  67. package/dist/extensions/server.mjs.map +1 -0
  68. package/dist/harnessState-CCyBeutB.cjs +188 -0
  69. package/dist/harnessState-CCyBeutB.cjs.map +1 -0
  70. package/dist/harnessState-Dn_S7fB9.mjs +163 -0
  71. package/dist/harnessState-Dn_S7fB9.mjs.map +1 -0
  72. package/dist/harnessState.cjs +6 -0
  73. package/dist/harnessState.d.mts +2 -0
  74. package/dist/harnessState.mjs +2 -0
  75. package/dist/harnessStore-CJSxdSkV.cjs +343 -0
  76. package/dist/harnessStore-CJSxdSkV.cjs.map +1 -0
  77. package/dist/harnessStore-CltwLB7M.mjs +262 -0
  78. package/dist/harnessStore-CltwLB7M.mjs.map +1 -0
  79. package/dist/harnessStore.cjs +15 -0
  80. package/dist/harnessStore.d.mts +2 -0
  81. package/dist/harnessStore.mjs +2 -0
  82. package/dist/index-BAaTySaM.d.mts +35 -0
  83. package/dist/index-BAaTySaM.d.mts.map +1 -0
  84. package/dist/index-BT29GZx5.d.mts +142 -0
  85. package/dist/index-BT29GZx5.d.mts.map +1 -0
  86. package/dist/index-B_lp0W3U.d.mts +114 -0
  87. package/dist/index-B_lp0W3U.d.mts.map +1 -0
  88. package/dist/index-C6GaYjq-.d.mts +6 -0
  89. package/dist/index-C6GaYjq-.d.mts.map +1 -0
  90. package/dist/index-CIQrKS1A.d.mts +50 -0
  91. package/dist/index-CIQrKS1A.d.mts.map +1 -0
  92. package/dist/index-CRcoVYXz.d.mts +39 -0
  93. package/dist/index-CRcoVYXz.d.mts.map +1 -0
  94. package/dist/index-CVlciCJF.d.mts +40 -0
  95. package/dist/index-CVlciCJF.d.mts.map +1 -0
  96. package/dist/index-CeOk2kqs.d.mts +118 -0
  97. package/dist/index-CeOk2kqs.d.mts.map +1 -0
  98. package/dist/index-Ch7ptOkW.d.mts +54 -0
  99. package/dist/index-Ch7ptOkW.d.mts.map +1 -0
  100. package/dist/index-Cvdt-Y-i.d.mts +66 -0
  101. package/dist/index-Cvdt-Y-i.d.mts.map +1 -0
  102. package/dist/index-DJpG-I9K.d.mts +122 -0
  103. package/dist/index-DJpG-I9K.d.mts.map +1 -0
  104. package/dist/index-DNk4q0Qm.d.mts +81 -0
  105. package/dist/index-DNk4q0Qm.d.mts.map +1 -0
  106. package/dist/index.cjs +121 -0
  107. package/dist/index.d.mts +15 -0
  108. package/dist/index.mjs +15 -0
  109. package/dist/init-C_9nyp3-.cjs +448 -0
  110. package/dist/init-C_9nyp3-.cjs.map +1 -0
  111. package/dist/init-DJ6wm-dr.mjs +415 -0
  112. package/dist/init-DJ6wm-dr.mjs.map +1 -0
  113. package/dist/init.cjs +7 -0
  114. package/dist/init.d.mts +2 -0
  115. package/dist/init.mjs +2 -0
  116. package/dist/layeredConfig-B922ibgn.mjs +67 -0
  117. package/dist/layeredConfig-B922ibgn.mjs.map +1 -0
  118. package/dist/layeredConfig-DdI5ysUf.cjs +94 -0
  119. package/dist/layeredConfig-DdI5ysUf.cjs.map +1 -0
  120. package/dist/layeredConfig.cjs +6 -0
  121. package/dist/layeredConfig.d.mts +2 -0
  122. package/dist/layeredConfig.mjs +2 -0
  123. package/dist/majorModes-CmPLEpMT.mjs +333 -0
  124. package/dist/majorModes-CmPLEpMT.mjs.map +1 -0
  125. package/dist/majorModes-DPhVMuhT.cjs +383 -0
  126. package/dist/majorModes-DPhVMuhT.cjs.map +1 -0
  127. package/dist/majorModes.cjs +10 -0
  128. package/dist/majorModes.d.mts +2 -0
  129. package/dist/majorModes.mjs +2 -0
  130. package/dist/piConfig-Bx26HMb_.d.mts +33 -0
  131. package/dist/piConfig-Bx26HMb_.d.mts.map +1 -0
  132. package/dist/piConfig-CCBdZXQr.cjs +260 -0
  133. package/dist/piConfig-CCBdZXQr.cjs.map +1 -0
  134. package/dist/piConfig-qGyCbcVj.mjs +197 -0
  135. package/dist/piConfig-qGyCbcVj.mjs.map +1 -0
  136. package/dist/piConfig.cjs +12 -0
  137. package/dist/piConfig.d.mts +2 -0
  138. package/dist/piConfig.mjs +2 -0
  139. package/dist/piContext.cjs +18 -0
  140. package/dist/piContext.d.mts +3 -0
  141. package/dist/piContext.mjs +2 -0
  142. package/dist/profiles-CTrUCmIh.d.mts +27 -0
  143. package/dist/profiles-CTrUCmIh.d.mts.map +1 -0
  144. package/dist/profiles-DnF9DBpd.cjs +552 -0
  145. package/dist/profiles-DnF9DBpd.cjs.map +1 -0
  146. package/dist/profiles-fujQKrS0.mjs +483 -0
  147. package/dist/profiles-fujQKrS0.mjs.map +1 -0
  148. package/dist/profiles.cjs +13 -0
  149. package/dist/profiles.d.mts +25 -0
  150. package/dist/profiles.d.mts.map +1 -0
  151. package/dist/profiles.mjs +2 -0
  152. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  153. package/dist/selectionSwitch.cjs +70 -0
  154. package/dist/selectionSwitch.cjs.map +1 -0
  155. package/dist/selectionSwitch.d.mts +30 -0
  156. package/dist/selectionSwitch.d.mts.map +1 -0
  157. package/dist/selectionSwitch.mjs +64 -0
  158. package/dist/selectionSwitch.mjs.map +1 -0
  159. package/dist/sessionConfig-Boh4Fdje.cjs +342 -0
  160. package/dist/sessionConfig-Boh4Fdje.cjs.map +1 -0
  161. package/dist/sessionConfig-CtLoc-lO.mjs +240 -0
  162. package/dist/sessionConfig-CtLoc-lO.mjs.map +1 -0
  163. package/dist/types.cjs +9 -0
  164. package/dist/types.d.mts +2 -0
  165. package/dist/types.mjs +2 -0
  166. package/llms.txt +12 -0
  167. package/package.json +206 -0
  168. package/src/prompts/po-author-config/SKILL.md +26 -0
  169. package/src/prompts/po-author-config/agents/openai.yaml +4 -0
  170. package/src/prompts/po-author-config/references/config-contract.md +201 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harnessStore-CltwLB7M.mjs","names":[],"sources":["../src/models/harnessCache.ts","../src/services/harnessStore/index.ts"],"sourcesContent":["import type { HarnessState } from '../types/config';\n\nexport interface LoadedHarnessState {\n /** Undefined when this process is running off the environment fallback. */\n filePath?: string;\n owned: boolean;\n state: HarnessState;\n}\n\nexport interface CachedHarnessState extends LoadedHarnessState {\n /** The file's mtime when it was read, so a rewrite by another copy is noticed. */\n mtimeMs?: number;\n}\n\nexport const harnessCache: { loaded: CachedHarnessState | undefined } = { loaded: undefined };\n","import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { readDoomSessionEnvironment } from '@agimon-ai/po-core/cordisHost';\n\nimport { harnessCache, type CachedHarnessState, type LoadedHarnessState } from '../../models/harnessCache';\nimport type { HarnessState } from '../../types/config';\nimport { writePrivateAtomicJson } from '../atomicJson';\nimport {\n HARNESS_STATE_KEYS,\n projectHarnessEnvironment,\n readHarnessState,\n type HarnessStateParseReporter,\n} from '../harnessState';\n\n/**\n * Who owns the harness state, and where it lives.\n *\n * The state used to be the environment: twenty variables that every reader\n * re-parsed and every writer mutated globally. The file is the authority now,\n * and the environment is a projection published for the readers that can only\n * see an environment, which are bash hooks, the shell launchers, packages that\n * do not depend on this one, and any process spawned by any of them.\n *\n * OWNERSHIP IS PER PROCESS, AND THAT IS THE WHOLE DESIGN:\n * Doom Team subagents run detached, in their own process group, from an\n * environment snapshot taken at spawn. A child can outlive its parent. If it\n * shared the parent's file it would corrupt a session it does not own, and if\n * that file sat in the parent's run directory the parent's shutdown sweep would\n * delete it from under a live run. So every process writes a file it owns:\n * `owner.pid` records who, and a process that finds someone else's file copies\n * it before its first write.\n *\n * AVOID:\n * - Treating the file as shared mutable state between processes. Atomic writes\n * prevent torn reads, not lost updates\n * - Reading the environment directly for anything this exposes\n */\n\n/** Points at the state file. The one variable that is not derived. */\nexport const HARNESS_STATE_POINTER = 'PO_STATE';\n\nconst STATE_FILE_VERSION = 1;\nconst STATE_FILE_NAME = 'harness-state.json';\nconst ADOPTED_DIRECTORY = 'doom-harness';\n/**\n * Written for a process that does not exist yet, so the first one to read it\n * owns it. A spawner cannot know its child's pid, and a child that inherited\n * its parent's file would lose it the moment the parent cleaned up.\n */\nconst UNCLAIMED_OWNER = 0;\n\nexport interface HarnessStateFile {\n version: number;\n owner: { pid: number; startedAt: string };\n state: HarnessState;\n}\n\nexport interface HarnessStateTransactionSnapshot {\n readonly filePath?: string;\n readonly owned: boolean;\n readonly state: HarnessState;\n readonly environment: Readonly<Record<string, string | undefined>>;\n}\n\n/** Drops the cached state. For tests, and for a process changing identity. */\nexport function resetHarnessStore(): void {\n harnessCache.loaded = undefined;\n}\n\nfunction fileMtime(filePath: string): number | undefined {\n try {\n return fs.statSync(filePath).mtimeMs;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Whether the cache still describes what the process points at.\n *\n * A session can load more than one copy of this package (a layer package\n * installed under .pi/npm brings its own), and each copy caches on its own.\n * The pointer and the file are shared, so a switch persisted through one copy\n * moves the pointer or rewrites the file, and every other copy must notice\n * rather than answer from memory.\n */\nfunction cacheCurrent(cache: CachedHarnessState, environment: NodeJS.ProcessEnv): boolean {\n const pointer = environment[HARNESS_STATE_POINTER];\n if (cache.filePath !== pointer) return false;\n if (!cache.filePath) return true;\n try {\n return fs.statSync(cache.filePath).mtimeMs === cache.mtimeMs;\n } catch {\n return false;\n }\n}\n\nfunction parseStateFile(source: string, filePath: string): HarnessStateFile {\n const parsed = JSON.parse(source) as Partial<HarnessStateFile>;\n if (parsed.version !== STATE_FILE_VERSION) {\n throw new Error(\n `Harness state at ${filePath} has version ${String(parsed.version)}, expected ${STATE_FILE_VERSION}`,\n );\n }\n if (typeof parsed.state !== 'object' || parsed.state === null) {\n throw new Error(`Harness state at ${filePath} has no state object`);\n }\n return {\n version: STATE_FILE_VERSION,\n owner: { pid: parsed.owner?.pid ?? -1, startedAt: parsed.owner?.startedAt ?? '' },\n state: parsed.state as HarnessState,\n };\n}\n\n/**\n * Reads the state for this process, once.\n *\n * A missing pointer means nobody wrote a file for this process, so the\n * environment is all there is: a nested run, a third-party spawn, or a caller\n * older than the store. A pointer that cannot be read is reported and then\n * treated the same way, because a session that starts degraded beats a session\n * that does not start at all.\n */\nexport function loadHarnessState(\n environment: NodeJS.ProcessEnv = process.env,\n report?: HarnessStateParseReporter,\n): LoadedHarnessState {\n // The cache describes this process. Asking about another environment is a\n // question about another process, so it reads through rather than answering\n // from what this one happens to hold.\n const cacheable = environment === process.env;\n if (cacheable && harnessCache.loaded && cacheCurrent(harnessCache.loaded, environment)) return harnessCache.loaded;\n\n const filePath = environment[HARNESS_STATE_POINTER];\n let result: CachedHarnessState | undefined;\n if (filePath && fs.existsSync(filePath)) {\n try {\n const file = parseStateFile(fs.readFileSync(filePath, 'utf8'), filePath);\n const owned = file.owner.pid === process.pid || file.owner.pid === UNCLAIMED_OWNER;\n result = { filePath, owned, state: file.state, mtimeMs: fileMtime(filePath) };\n } catch (error) {\n report?.(HARNESS_STATE_POINTER, error);\n }\n }\n result ??= { owned: false, state: readHarnessState(environment, report) };\n if (cacheable) harnessCache.loaded = result;\n return result;\n}\n\n/** Captures the owned state pointer and every projected harness variable. */\nexport function snapshotHarnessState(environment: NodeJS.ProcessEnv = process.env): HarnessStateTransactionSnapshot {\n const loadedState = loadHarnessState(environment);\n const environmentSnapshot: Record<string, string | undefined> = {\n [HARNESS_STATE_POINTER]: environment[HARNESS_STATE_POINTER],\n };\n for (const key of Object.values(HARNESS_STATE_KEYS)) environmentSnapshot[key] = environment[key];\n return {\n filePath: loadedState.filePath,\n owned: loadedState.owned,\n state: structuredClone(loadedState.state),\n environment: environmentSnapshot,\n };\n}\n\n/** Restores a snapshot only while the current process still owns its state pointer. */\nexport function restoreHarnessStateSnapshot(\n snapshot: HarnessStateTransactionSnapshot,\n environment: NodeJS.ProcessEnv = process.env,\n): void {\n const current = loadHarnessState(environment);\n if (snapshot.filePath && snapshot.owned) {\n if (!current.owned || current.filePath !== snapshot.filePath) {\n throw new Error('Harness state ownership changed; refusing to restore an older snapshot.');\n }\n persist(snapshot.filePath, snapshot.state);\n } else if (!snapshot.filePath) {\n if (current.filePath && !current.owned) {\n throw new Error('Harness state is no longer owned by this process; refusing to restore an older snapshot.');\n }\n if (current.filePath && current.owned) fs.rmSync(current.filePath, { force: true });\n resetHarnessStore();\n } else if (current.filePath !== snapshot.filePath) {\n throw new Error('Harness state pointer changed; refusing to restore an older snapshot.');\n }\n for (const [key, value] of Object.entries(snapshot.environment)) {\n if (value === undefined) delete environment[key];\n else environment[key] = value;\n }\n if (environment === process.env) {\n harnessCache.loaded = snapshot.filePath\n ? {\n filePath: snapshot.filePath,\n owned: snapshot.owned,\n state: snapshot.state,\n mtimeMs: fileMtime(snapshot.filePath),\n }\n : undefined;\n }\n}\n\nexport function getHarnessState(report?: HarnessStateParseReporter): HarnessState {\n return loadHarnessState(process.env, report).state;\n}\n\n/**\n * The harness state of one session, by id.\n *\n * A server runs many sessions' extensions in one process, each with its own state file, so\n * a session-scoped reader asks by session id. A terminal session owns its process, and the\n * answer is the same as `getHarnessState`.\n */\nexport function getSessionHarnessState(\n sessionId: string | undefined,\n report?: HarnessStateParseReporter,\n): HarnessState {\n return loadHarnessState(readDoomSessionEnvironment(sessionId), report).state;\n}\n\nfunction stateFilePath(directory: string): string {\n return path.join(directory, STATE_FILE_NAME);\n}\n\n/** Where a process writes state when it was not given a file of its own. */\nfunction adoptedStateFilePath(): string {\n return path.join(os.tmpdir(), ADOPTED_DIRECTORY, `${String(process.pid)}.json`);\n}\n\nfunction persist(filePath: string, state: HarnessState, ownerPid = process.pid): void {\n writePrivateAtomicJson(filePath, {\n version: STATE_FILE_VERSION,\n owner: { pid: ownerPid, startedAt: new Date().toISOString() },\n state,\n } satisfies HarnessStateFile);\n}\n\n/**\n * Starts a session: writes the file and publishes the derived environment.\n *\n * The environment is a parameter because the caller is usually describing a\n * process other than itself. The launcher builds the environment for the Pi it\n * is about to spawn, and Doom Team builds the snapshot for a detached child, so\n * neither should touch its own `process.env` to do it.\n */\nexport function createHarnessSession(\n state: HarnessState,\n options: {\n directory: string;\n environment: NodeJS.ProcessEnv;\n /**\n * Leave the file for a process that does not exist yet to claim.\n *\n * What a spawner wants: the child owns its state from its first read, in a\n * directory the spawner manages, so the parent cleaning up its own session\n * cannot pull the file out from under a detached run.\n */\n unclaimed?: boolean;\n },\n): string {\n const filePath = stateFilePath(options.directory);\n persist(filePath, state, options.unclaimed ? UNCLAIMED_OWNER : process.pid);\n options.environment[HARNESS_STATE_POINTER] = filePath;\n projectHarnessEnvironment(state, options.environment);\n // Only prime the cache when this process is the one being described.\n if (!options.unclaimed && options.environment === process.env)\n harnessCache.loaded = { filePath, owned: true, state, mtimeMs: fileMtime(filePath) };\n return filePath;\n}\n\n/**\n * Applies a patch to this process's state.\n *\n * Copy on write: a process holding a file it does not own writes its own copy\n * and repoints itself at it, so a child can never rewrite its parent's session.\n */\nexport function updateHarnessState(\n patch: Partial<HarnessState>,\n environment: NodeJS.ProcessEnv = process.env,\n): HarnessState {\n const current = loadHarnessState(environment);\n const state = { ...current.state, ...patch };\n const filePath = current.owned && current.filePath ? current.filePath : adoptedStateFilePath();\n persist(filePath, state);\n environment[HARNESS_STATE_POINTER] = filePath;\n if (environment === process.env) harnessCache.loaded = { filePath, owned: true, state, mtimeMs: fileMtime(filePath) };\n projectHarnessEnvironment(patch, environment);\n return state;\n}\n\n/** Removes this process's own state file. Safe when there is none. */\nexport function disposeHarnessState(environment: NodeJS.ProcessEnv = process.env): void {\n const current = harnessCache.loaded;\n resetHarnessStore();\n if (!current?.owned || !current.filePath) return;\n fs.rmSync(current.filePath, { force: true });\n delete environment[HARNESS_STATE_POINTER];\n}\n\nexport function harnessRoot(state: Pick<HarnessState, 'root'> = getHarnessState()): string {\n return state.root ?? process.cwd();\n}\n\n/**\n * The repository root, or a hard error.\n *\n * Separate from `requireHarnessPaths` because most callers only need the root,\n * and separate from `harnessRoot` because falling back to `process.cwd()` would\n * quietly operate on whatever directory the session happens to sit in. A caller\n * that asks for the root wants the session's repository or nothing.\n */\nexport function requireHarnessRoot(state: Pick<HarnessState, 'root'> = getHarnessState()): string {\n if (!state.root) throw new Error(`${HARNESS_STATE_KEYS.root} is not set`);\n return state.root;\n}\n\n/** The root and the run's scratch directory, for callers that write to disk. */\nexport function requireHarnessPaths(state: Pick<HarnessState, 'root' | 'temporaryDirectory'> = getHarnessState()): {\n root: string;\n temporaryDirectory: string;\n} {\n const root = requireHarnessRoot(state);\n if (!state.temporaryDirectory) throw new Error(`${HARNESS_STATE_KEYS.temporaryDirectory} is not set`);\n return { root, temporaryDirectory: state.temporaryDirectory };\n}\n"],"mappings":";;;;;;;AAcA,MAAa,eAA2D,EA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AAQ;EAAE,GAAG,QAAQ;EAAO,GAAG;CAAM;CAC3C,MAAM,WAAW,QAAQ,SAAS,QAAQ,WAAW,QAAQ,WAAW,qBAAqB;CAC7F,QAAQ,UAAU,KAAK;CACvB,YAAY,yBAAyB;CACrC,IAAI,gBAAgB,QAAQ,KAAK,aAAa,SAAS;EAAE;EAAU,OAAO;EAAM;EAAO,SAAS,UAAU,QAAQ;CAAE;CACpH,0BAA0B,OAAO,WAAW;CAC5C,OAAO;AACT;;AAGA,SAAgB,oBAAoB,cAAiC,QAAQ,KAAW;CACtF,MAAM,UAAU,aAAa;CAC7B,kBAAkB;CAClB,IAAI,CAAC,SAAS,SAAS,CAAC,QAAQ,UAAU;CAC1C,GAAG,OAAO,QAAQ,UAAU,EAAE,OAAO,KAAK,CAAC;CAC3C,OAAO,YAAY;AACrB;AAEA,SAAgB,YAAY,QAAoC,gBAAgB,GAAW;CACzF,OAAO,MAAM,QAAQ,QAAQ,IAAI;AACnC;;;;;;;;;AAUA,SAAgB,mBAAmB,QAAoC,gBAAgB,GAAW;CAChG,IAAI,CAAC,MAAM,MAAM,MAAM,IAAI,MAAM,GAAG,mBAAmB,KAAK,YAAY;CACxE,OAAO,MAAM;AACf;;AAGA,SAAgB,oBAAoB,QAA2D,gBAAgB,GAG7G;CACA,MAAM,OAAO,mBAAmB,KAAK;CACrC,IAAI,CAAC,MAAM,oBAAoB,MAAM,IAAI,MAAM,GAAG,mBAAmB,mBAAmB,YAAY;CACpG,OAAO;EAAE;EAAM,oBAAoB,MAAM;CAAmB;AAC9D"}
@@ -0,0 +1,15 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_harnessStore = require("./harnessStore-CJSxdSkV.cjs");
3
+ exports.HARNESS_STATE_POINTER = require_harnessStore.HARNESS_STATE_POINTER;
4
+ exports.createHarnessSession = require_harnessStore.createHarnessSession;
5
+ exports.disposeHarnessState = require_harnessStore.disposeHarnessState;
6
+ exports.getHarnessState = require_harnessStore.getHarnessState;
7
+ exports.getSessionHarnessState = require_harnessStore.getSessionHarnessState;
8
+ exports.harnessRoot = require_harnessStore.harnessRoot;
9
+ exports.loadHarnessState = require_harnessStore.loadHarnessState;
10
+ exports.requireHarnessPaths = require_harnessStore.requireHarnessPaths;
11
+ exports.requireHarnessRoot = require_harnessStore.requireHarnessRoot;
12
+ exports.resetHarnessStore = require_harnessStore.resetHarnessStore;
13
+ exports.restoreHarnessStateSnapshot = require_harnessStore.restoreHarnessStateSnapshot;
14
+ exports.snapshotHarnessState = require_harnessStore.snapshotHarnessState;
15
+ exports.updateHarnessState = require_harnessStore.updateHarnessState;
@@ -0,0 +1,2 @@
1
+ import { a as disposeHarnessState, c as harnessRoot, d as requireHarnessRoot, f as resetHarnessStore, g as LoadedHarnessState, h as updateHarnessState, i as createHarnessSession, l as loadHarnessState, m as snapshotHarnessState, n as HarnessStateFile, o as getHarnessState, p as restoreHarnessStateSnapshot, r as HarnessStateTransactionSnapshot, s as getSessionHarnessState, t as HARNESS_STATE_POINTER, u as requireHarnessPaths } from "./index-DJpG-I9K.mjs";
2
+ export { HARNESS_STATE_POINTER, type HarnessStateFile, type HarnessStateTransactionSnapshot, type LoadedHarnessState, createHarnessSession, disposeHarnessState, getHarnessState, getSessionHarnessState, harnessRoot, loadHarnessState, requireHarnessPaths, requireHarnessRoot, resetHarnessStore, restoreHarnessStateSnapshot, snapshotHarnessState, updateHarnessState };
@@ -0,0 +1,2 @@
1
+ import { a as getSessionHarnessState, c as requireHarnessPaths, d as restoreHarnessStateSnapshot, f as snapshotHarnessState, i as getHarnessState, l as requireHarnessRoot, n as createHarnessSession, o as harnessRoot, p as updateHarnessState, r as disposeHarnessState, s as loadHarnessState, t as HARNESS_STATE_POINTER, u as resetHarnessStore } from "./harnessStore-CltwLB7M.mjs";
2
+ export { HARNESS_STATE_POINTER, createHarnessSession, disposeHarnessState, getHarnessState, getSessionHarnessState, harnessRoot, loadHarnessState, requireHarnessPaths, requireHarnessRoot, resetHarnessStore, restoreHarnessStateSnapshot, snapshotHarnessState, updateHarnessState };
@@ -0,0 +1,35 @@
1
+ import { C as IDoomConfigService, g as DoomConfigTransitionRecord, m as DoomConfigSelection$1, p as DoomConfigPendingSelection, u as DoomConfigContext, x as HarnessState } from "./config-Cm3EV1jp.mjs";
2
+ import { Context } from "@deepseek-ai/cordis";
3
+ import "@agimon-ai/po-core/headless";
4
+ import { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
5
+ //#region src/services/sessionConfig/index.d.ts
6
+ declare const DOOM_CONFIG_ENTRY_TYPE = "po:config:v1";
7
+ declare const DOOM_CONFIG_TRANSITION_ENTRY_TYPE = "po:transition:v1";
8
+ type DoomConfigSelection = DoomConfigSelection$1;
9
+ declare function readDoomConfigSelection(ctx: Pick<ExtensionContext, 'sessionManager'>): DoomConfigSelection | undefined;
10
+ declare function createDoomConfigContext(ctx: Pick<ExtensionContext, 'cwd' | 'sessionManager'>): DoomConfigContext;
11
+ declare function createDoomConfigContextAsync(ctx: Pick<ExtensionContext, 'cwd' | 'sessionManager'>): Promise<DoomConfigContext>;
12
+ declare function appendDoomConfigSelection(pi: Pick<ExtensionAPI, 'appendEntry'>, selection: DoomConfigSelection): void;
13
+ /** Journals the live selection, defaulting to whatever the harness store holds. */
14
+ declare function persistHarnessSelection(pi: Pick<ExtensionAPI, 'appendEntry'>, state?: {
15
+ readonly majorMode: string;
16
+ readonly domains: readonly string[];
17
+ readonly profile?: string;
18
+ readonly compositionFingerprint?: string;
19
+ }): void;
20
+ declare function appendDoomConfigTransition(pi: Pick<ExtensionAPI, 'appendEntry'>, transition: DoomConfigTransitionRecord): void;
21
+ declare function supersedeDoomConfigTransition(pi: Pick<ExtensionAPI, 'appendEntry'>, transition: DoomConfigPendingSelection): void;
22
+ /** Acknowledges the latest pending transition from a fresh session that owns its exact target composition. */
23
+ declare function acknowledgeDoomConfigTransition(pi: Pick<ExtensionAPI, 'appendEntry'>, ctx: Pick<ExtensionContext, 'sessionManager'>, harness: HarnessState): boolean;
24
+ declare function readDoomConfigPendingSelection(ctx: Pick<ExtensionContext, 'sessionManager'>): DoomConfigPendingSelection | undefined;
25
+ declare function provideDoomConfigContext(ctx: Context, context: DoomConfigContext, generation?: string): IDoomConfigService;
26
+ /** Returns the binding identity used to fence in-flight transitions. */
27
+ declare function readDoomConfigContextGeneration(ctx: Context): string | undefined;
28
+ /** Precomputes an immutable context before a transaction reaches publication. */
29
+ declare function freezeDoomConfigContext(context: DoomConfigContext): DoomConfigContext;
30
+ /** Replaces a live binding with a deeply frozen context after publication. */
31
+ declare function replaceDoomConfigContext(ctx: Context, context: DoomConfigContext): DoomConfigContext;
32
+ declare function requireDoomConfigContext(ctx: Context): DoomConfigContext;
33
+ //#endregion
34
+ export { supersedeDoomConfigTransition as _, appendDoomConfigSelection as a, createDoomConfigContextAsync as c, provideDoomConfigContext as d, readDoomConfigContextGeneration as f, requireDoomConfigContext as g, replaceDoomConfigContext as h, acknowledgeDoomConfigTransition as i, freezeDoomConfigContext as l, readDoomConfigSelection as m, DOOM_CONFIG_TRANSITION_ENTRY_TYPE as n, appendDoomConfigTransition as o, readDoomConfigPendingSelection as p, DoomConfigSelection as r, createDoomConfigContext as s, DOOM_CONFIG_ENTRY_TYPE as t, persistHarnessSelection as u };
35
+ //# sourceMappingURL=index-BAaTySaM.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BAaTySaM.d.mts","names":["ConfigSelection"],"sources":["../src/services/sessionConfig/index.ts"],"mappings":";;;;;cAmBa;cACA;KAED,sBAAsBA;iBAsHlB,wBACd,KAAK,KAAK,sCACT;iBAyCa,wBAAwB,KAAK,KAAK,8CAA8C;iBAK1E,6BACpB,KAAK,KAAK,8CACT,QAAQ;iBA4BK,0BAA0B,IAAI,KAAK,8BAA8B,WAAW;;iBAK5E,wBACd,IAAI,KAAK,8BACT;WACW;WACA;WACA;WACA;;iBAYG,2BACd,IAAI,KAAK,8BACT,YAAY;iBAKE,8BACd,IAAI,KAAK,8BACT,YAAY;;iBAME,gCACd,IAAI,KAAK,8BACT,KAAK,KAAK,qCACV,SAAS;iBAUK,+BACd,KAAK,KAAK,sCACT;iBASa,yBACd,KAAK,SACL,SAAS,mBACT,sBACC;;iBAKa,gCAAgC,KAAK;;iBAKrC,wBAAwB,SAAS,oBAAoB;;iBAKrD,yBAAyB,KAAK,SAAS,SAAS,oBAAoB;iBAepE,yBAAyB,KAAK,UAAU"}
@@ -0,0 +1,142 @@
1
+ //#region src/types/domains.d.ts
2
+ interface LocalPluginSource {
3
+ type: 'local';
4
+ /** Absolute plugin directory after resolving the declaring config or marketplace root. */
5
+ path: string;
6
+ }
7
+ interface GitPluginSource {
8
+ type: 'git';
9
+ url: string;
10
+ /** Optional repository-relative plugin directory. */
11
+ path?: string;
12
+ ref?: string;
13
+ sha?: string;
14
+ }
15
+ interface NpmPluginSource {
16
+ type: 'npm';
17
+ package: string;
18
+ version?: string;
19
+ registry?: string;
20
+ }
21
+ type PluginSource = LocalPluginSource | GitPluginSource | NpmPluginSource;
22
+ type PluginSkillDiscovery = 'recursive' | 'direct-children';
23
+ interface PluginManifestMetadata {
24
+ path: string;
25
+ name?: string;
26
+ version?: string;
27
+ description?: string;
28
+ agentPluginSchema?: string;
29
+ }
30
+ interface PluginCatalogEntry {
31
+ source: PluginSource;
32
+ description?: string;
33
+ marketplace?: string;
34
+ manifest?: PluginManifestMetadata;
35
+ }
36
+ interface PluginCatalog {
37
+ /** Marketplace, plugin, or plugin-container roots resolved against their declaring config. */
38
+ roots: string[];
39
+ /** Supported marketplace manifests discovered in precedence order. */
40
+ marketplaces: string[];
41
+ /** Named explicit and marketplace plugin entries. */
42
+ entries: Record<string, PluginCatalogEntry>;
43
+ /** Non-fatal errors from automatic marketplace and folder discovery. */
44
+ diagnostics: string[];
45
+ }
46
+ /** A named plugin, or a subset of one. */
47
+ type DomainPlugin = string | {
48
+ name: string;
49
+ skills?: string[];
50
+ agents?: string[];
51
+ hooks?: boolean;
52
+ mcp?: boolean;
53
+ };
54
+ interface DomainMcpAllowlist {
55
+ /** Server names kept from the repository-level .mcp.json. */
56
+ servers?: string[];
57
+ /** Upstream server names kept in the agiflow-proxy config. */
58
+ proxy?: string[];
59
+ }
60
+ interface DomainDefinition {
61
+ description?: string;
62
+ plugins?: DomainPlugin[];
63
+ mcp?: DomainMcpAllowlist;
64
+ sharedSkills?: boolean;
65
+ }
66
+ interface ResolvedDomain extends DomainDefinition {
67
+ baseDirectory: string;
68
+ }
69
+ interface DomainManifest {
70
+ plugins: PluginCatalog;
71
+ domains: Record<string, ResolvedDomain>;
72
+ aliases: Record<string, string[]>;
73
+ defaultDomains?: string[];
74
+ }
75
+ interface PluginEntry {
76
+ /** Catalog identifier when the entry came from domains.yaml. */
77
+ name?: string;
78
+ directory: string;
79
+ /** The domain that admitted this plugin; absent for an explicit directory. */
80
+ domain?: string;
81
+ /** Omitted for legacy programmatic callers that already supply a directory. */
82
+ source?: PluginSource;
83
+ /** Manifest metadata retained so resource adapters can apply schema-gated plugin contracts. */
84
+ manifest?: PluginManifestMetadata;
85
+ skillDiscovery?: PluginSkillDiscovery;
86
+ skills?: string[];
87
+ agents?: string[];
88
+ hooks?: boolean;
89
+ mcp?: boolean;
90
+ }
91
+ //#endregion
92
+ //#region src/services/domains/index.d.ts
93
+ /**
94
+ * Reads domains and plugin catalogs from global and repository configs.
95
+ *
96
+ * Named domains and explicit plugin entries are replaced by later repository
97
+ * definitions. Configured roots accumulate, with exact marketplace manifests
98
+ * deduplicated in discovery order. Explicit entries override discovered IDs.
99
+ */
100
+ declare function loadDomains(repoRoot: string, homeDirectory?: string): DomainManifest;
101
+ declare function listDomainNames(repoRoot: string, homeDirectory?: string): string[];
102
+ /**
103
+ * Whether to include .claude/skills as shared fallbacks.
104
+ *
105
+ * Shared skills are included unless every selected domain opts out, so mixing a
106
+ * trimmed domain with an untrimmed one cannot strip the untrimmed one's skills.
107
+ */
108
+ declare function resolveSharedSkills(repoRoot: string, domainNames: string[], homeDirectory?: string): boolean;
109
+ /** Resolves named domain plugins while preserving each subset filter. */
110
+ declare function resolvePluginEntries(repoRoot: string, domainNames: string[], explicitDirectories: string[], homeDirectory?: string): PluginEntry[];
111
+ declare function resolvePluginDirectories(repoRoot: string, domainNames: string[], explicitDirectories: string[], homeDirectory?: string): string[];
112
+ declare const PO_DOMAINS_ENV = "PO_DOMAINS";
113
+ declare const DEFAULT_DOMAIN = "default";
114
+ /**
115
+ * Domains selected when the caller names none.
116
+ *
117
+ * Configuration keeps this axis independent of the major mode. The
118
+ * major-mode-derived choice is retained only as the compatibility fallback for
119
+ * domains files that declare no defaultDomains.
120
+ */
121
+ declare function defaultDomainsForMajorMode(majorMode: string, environment: NodeJS.ProcessEnv, defaultDomains?: readonly string[]): string[];
122
+ //#endregion
123
+ //#region src/services/domains/completion.d.ts
124
+ /** Splits comma-joined selections and expands aliases into concrete domain names. */
125
+ declare function expandDomainNames(manifest: DomainManifest, domainNames: readonly string[]): string[];
126
+ declare function domainCompletionPrefix(textBeforeCursor: string): string | undefined;
127
+ declare function domainCompletionItems(domainNames: string[], query: string): Array<{
128
+ value: string;
129
+ label: string;
130
+ }>;
131
+ //#endregion
132
+ //#region src/services/pluginCatalog/index.d.ts
133
+ declare const MARKETPLACE_MANIFEST_RELATIVE_PATHS: readonly ['.agents/plugins/marketplace.json', '.agents/plugins/api_marketplace.json', '.claude-plugin/marketplace.json', '.cursor-plugin/marketplace.json'];
134
+ /** Matches Codex manifest precedence, including schema-gated root plugin.json. */
135
+ declare function findPluginManifestPath(pluginRoot: string): string | undefined;
136
+ declare function pluginDirectoryForSource(source: PluginSource, homeDoomDirectory: string): string;
137
+ declare function isRemotePluginSource(source: PluginSource): source is GitPluginSource | Extract<PluginSource, {
138
+ type: 'npm';
139
+ }>;
140
+ //#endregion
141
+ export { PluginCatalog as C, PluginSkillDiscovery as D, PluginManifestMetadata as E, PluginSource as O, NpmPluginSource as S, PluginEntry as T, DomainManifest as _, domainCompletionItems as a, GitPluginSource as b, DEFAULT_DOMAIN as c, listDomainNames as d, loadDomains as f, DomainDefinition as g, resolveSharedSkills as h, pluginDirectoryForSource as i, ResolvedDomain as k, PO_DOMAINS_ENV as l, resolvePluginEntries as m, findPluginManifestPath as n, domainCompletionPrefix as o, resolvePluginDirectories as p, isRemotePluginSource as r, expandDomainNames as s, MARKETPLACE_MANIFEST_RELATIVE_PATHS as t, defaultDomainsForMajorMode as u, DomainMcpAllowlist as v, PluginCatalogEntry as w, LocalPluginSource as x, DomainPlugin as y };
142
+ //# sourceMappingURL=index-BT29GZx5.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BT29GZx5.d.mts","names":[],"sources":["../src/types/domains.ts","../src/services/domains/index.ts","../src/services/domains/completion.ts","../src/services/pluginCatalog/index.ts"],"mappings":";UAAiB;EACf;;EAEA;;UAGe;EACf;EACA;;EAEA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;KAGU,eAAe,oBAAoB,kBAAkB;KACrD;UAEK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;EACA,WAAW;;UAGI;;EAEf;;EAEA;;EAEA,SAAS,eAAe;;EAExB;;;KAIU;EAEN;EAAc;EAAmB;EAAmB;EAAiB;;UAE1D;;EAEf;;EAEA;;UAGe;EACf;EACA,UAAU;EACV,MAAM;EACN;;UAGe,uBAAuB;EACtC;;UAGe;EACf,SAAS;EACT,SAAS,eAAe;EACxB,SAAS;EACT;;UAGe;;EAEf;EACA;;EAEA;;EAEA,SAAS;;EAET,WAAW;EACX,iBAAiB;EACjB;EACA;EACA;EACA;;;;;;;;;;;iBC6Bc,YAAY,kBAAkB,yBAAuC;iBA0CrE,gBAAgB,kBAAkB;;;;;;;iBAWlC,oBAAoB,kBAAkB,uBAAuB;;iBAQ7D,qBACd,kBACA,uBACA,+BACA,yBACC;iBAwDa,yBACd,kBACA,uBACA,+BACA;cAOW;cACA;;;;;;;;iBAiBG,2BACd,mBACA,aAAa,OAAO,YACpB;;;;iBCjRc,kBAAkB,UAAU,gBAAgB;iBAW5C,uBAAuB;iBAKvB,sBAAsB,uBAAuB,gBAAgB;EAAQ;EAAe;;;;cCCvF;;iBAgPG,uBAAuB;iBAmJvB,yBAAyB,QAAQ,cAAc;iBA8C/C,qBACd,QAAQ,eACP,UAAU,kBAAkB,QAAQ;EAAgB"}
@@ -0,0 +1,114 @@
1
+ import { i as PersonaVoiceOverride } from "./profiles-CTrUCmIh.mjs";
2
+ import { I as VoiceConfig, N as ResolvedVoiceConfig, O as PlanningModeConfig, T as LenientParseResult, f as DoomConfigLayers, l as DoomConfig, t as AutocompactModeConfig, w as LenientParseOptions } from "./config-Cm3EV1jp.mjs";
3
+ //#region src/services/config/index.d.ts
4
+ declare function globalDoomConfigDirectory(homeDirectory?: string): string;
5
+ declare function globalDoomConfigPath(homeDirectory?: string): string;
6
+ declare function resolvePlanningPlansDirectory(configured: string | undefined, repoRoot: string, homeDirectory?: string): string;
7
+ declare function repositoryDoomConfigPath(repoRoot: string): string;
8
+ declare function loadDoomConfig(repoRoot: string, homeDirectory?: string, environment?: NodeJS.ProcessEnv): DoomConfig;
9
+ /**
10
+ * Loads the merged config, tolerating unknown keys in either file.
11
+ *
12
+ * Only `po sync` uses this. Everything that runs during a session keeps
13
+ * `loadDoomConfig`, because a key a running extension cannot understand is
14
+ * better reported than silently ignored; a build that refuses to start over
15
+ * the same key is not.
16
+ */
17
+ declare function loadDoomConfigLenient(repoRoot: string, homeDirectory?: string, environment?: NodeJS.ProcessEnv): LenientParseResult;
18
+ declare function loadDoomConfigAsync(repoRoot: string, homeDirectory?: string, environment?: NodeJS.ProcessEnv): Promise<DoomConfig>;
19
+ /**
20
+ * The two config files kept apart, with the merge alongside them.
21
+ *
22
+ * `repoRoot` is optional because the global file is complete on its own: a
23
+ * settings surface with no repository in view still has settings to show, and
24
+ * demanding one would leave it with nothing to render rather than with the
25
+ * global half.
26
+ *
27
+ * The origin answer respects the merge's own per-field rules rather than simply
28
+ * preferring the repository: `editor` is read from the global side whatever the
29
+ * repository says, and `projectTrust` from the repository side whatever the
30
+ * global one says. Reporting a file as the source of a value the merge discards
31
+ * is the exact confusion this exists to remove.
32
+ */
33
+ declare function loadDoomConfigLayers(repoRoot: string | undefined, homeDirectory?: string, environment?: NodeJS.ProcessEnv): DoomConfigLayers;
34
+ //#endregion
35
+ //#region src/services/configPolicy/index.d.ts
36
+ /**
37
+ * The accepted values, in the order a picker should offer them.
38
+ *
39
+ * Exported because the config UI has to offer exactly what the parser accepts,
40
+ * and a second hand-written list in the contributing package would drift. The
41
+ * validating Sets below are built from these for the same reason.
42
+ */
43
+ declare const DOOM_PLANNING_THINKING_LEVELS: readonly ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
44
+ declare const DOOM_VOICE_MODES: readonly ["legacy", 'live'];
45
+ declare const DOOM_VOICE_ENGINES: readonly ["auto", "whisper-cpp", "openai-whisper", "mlx-whisper"];
46
+ declare const DOOM_VOICE_TTS_ENGINES: readonly ["macos-say"];
47
+ declare function parseAutocompactModeConfig(value: unknown, filePath: string, location?: string): AutocompactModeConfig;
48
+ declare function parsePlanningModeConfig(value: unknown, filePath: string, location?: string): PlanningModeConfig;
49
+ /**
50
+ * Reads one Doom config file.
51
+ *
52
+ * The two-argument form is the strict contract every harness-launch consumer
53
+ * relies on: an unknown key is a hard error. `po sync` opts into the
54
+ * lenient form so a config written for a different version cannot break a
55
+ * build; `po doctor` is the strict check that still reports those keys.
56
+ * Invalid values for known keys throw in both modes.
57
+ */
58
+ declare function parseDoomConfig(content: string, filePath: string): DoomConfig;
59
+ declare function parseDoomConfig(content: string, filePath: string, options: LenientParseOptions): LenientParseResult;
60
+ declare function mergeDoomConfigs(globalConfig: DoomConfig, repositoryConfig: DoomConfig): DoomConfig;
61
+ /**
62
+ * Resolves voice settings, optionally shadowed by the active profile's override.
63
+ *
64
+ * The override is per field, so a persona that sets only `rate` keeps the voice
65
+ * from config.yaml. `engine` is deliberately not overridable: it selects the
66
+ * synthesiser binary, which is a machine-level fact rather than a persona's.
67
+ *
68
+ * The result is read once when autonomous voice activates, because
69
+ * `VoiceNarrationPlayback.config` is assigned in `activate()` and has no setter.
70
+ * That is sufficient today only because every profile switch reloads the
71
+ * session, which deactivates and reactivates voice. A future in-place profile
72
+ * switch would leave the spoken voice stale until the next activation.
73
+ */
74
+ declare function resolveVoiceConfig(config: VoiceConfig, ttsOverride?: PersonaVoiceOverride): ResolvedVoiceConfig;
75
+ /**
76
+ * Which files a key may be written to.
77
+ *
78
+ * `mergeDoomConfigs` above already decides this per field, but it decides it by
79
+ * doing it: `editor` reads only from the global side, `projectTrust` only from
80
+ * the repository side, and repository `voice.mode` or `voice.autoCapture`
81
+ * declarations throw outright. A caller holding a key path has no way to ask.
82
+ * surface offers writes that throw, or worse, writes that land in a file the
83
+ * merge will ignore, so the change appears to do nothing.
84
+ *
85
+ * Declared here rather than beside the writer because the rule is a property of
86
+ * the merge, not of the filesystem, and a test asserts the two agree.
87
+ */
88
+ type ConfigKeyScope = 'global' | 'repository' | 'both';
89
+ /**
90
+ * The scopes a key path accepts. An unknown root answers `both` rather than
91
+ * throwing: the parser is what rejects unsupported keys, and it reports them
92
+ * far better than a scope lookup could.
93
+ */
94
+ declare function configScopeOf(keyPath: readonly string[]): ConfigKeyScope;
95
+ /** Every root key the config accepts, so a caller can enumerate without importing the parser's internals. */
96
+ declare function configRootKeys(): readonly string[];
97
+ /**
98
+ * Every key path a parsed document actually sets, as dotted strings.
99
+ *
100
+ * A settings surface needs to tell "this file set this key" from "this file is
101
+ * silent about it", and the parsed `DoomConfig` cannot answer: an absent file
102
+ * reads as `{ projectTrust: 'ask' }` and `parseDoomConfig` always returns all
103
+ * known root keys, some undefined. So the question is asked of the raw document
104
+ * instead, before any defaulting has happened.
105
+ *
106
+ * Leaves only. A list is a leaf because it is replaced whole, and an empty
107
+ * record sets nothing.
108
+ */
109
+ declare function configLeafKeys(value: unknown, prefix?: readonly string[]): string[];
110
+ /** The value a key path points at, or undefined when any step is missing. */
111
+ declare function valueAtKeyPath(value: unknown, keyPath: readonly string[]): unknown;
112
+ //#endregion
113
+ export { resolvePlanningPlansDirectory as S, loadDoomConfig as _, DOOM_VOICE_TTS_ENGINES as a, loadDoomConfigLenient as b, configScopeOf as c, parseDoomConfig as d, parsePlanningModeConfig as f, globalDoomConfigPath as g, globalDoomConfigDirectory as h, DOOM_VOICE_MODES as i, mergeDoomConfigs as l, valueAtKeyPath as m, DOOM_PLANNING_THINKING_LEVELS as n, configLeafKeys as o, resolveVoiceConfig as p, DOOM_VOICE_ENGINES as r, configRootKeys as s, ConfigKeyScope as t, parseAutocompactModeConfig as u, loadDoomConfigAsync as v, repositoryDoomConfigPath as x, loadDoomConfigLayers as y };
114
+ //# sourceMappingURL=index-B_lp0W3U.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-B_lp0W3U.d.mts","names":[],"sources":["../src/services/config/index.ts","../src/services/configPolicy/index.ts"],"mappings":";;;iBAqCgB,0BAA0B;iBAI1B,qBAAqB;iBAIrB,8BACd,gCACA,kBACA;iBAYc,yBAAyB;iBAuBzB,eACd,kBACA,wBACA,cAAa,OAAO,aACnB;;;;;;;;;iBAmBa,sBACd,kBACA,wBACA,cAAa,OAAO,aACnB;iBAgBmB,oBACpB,kBACA,wBACA,cAAa,OAAO,aACnB,QAAQ;;;;;;;;;;;;;;;iBAgDK,qBACd,8BACA,wBACA,cAAa,OAAO,aACnB;;;;;;;;;;cC1DU;cACA;cACA;cAMA;iBA+VG,2BACd,gBACA,kBACA,oBACC;iBAgBa,wBACd,gBACA,kBACA,oBACC;;;;;;;;;;iBAiJa,gBAAgB,iBAAiB,mBAAmB;iBACpD,gBAAgB,iBAAiB,kBAAkB,SAAS,sBAAsB;iBA2DlF,iBAAiB,cAAc,YAAY,kBAAkB,aAAa;;;;;;;;;;;;;;iBA6G1E,mBAAmB,QAAQ,aAAa,cAAc,uBAAuB;;;;;;;;;;;;;;KA8CjF;;;;;;iBAoBI,cAAc,6BAA6B;;iBAU3C;;;;;;;;;;;;;iBAsBA,eAAe,gBAAgB;;iBAQ/B,eAAe,gBAAgB"}
@@ -0,0 +1,6 @@
1
+ //#region src/services/atomicJson/index.d.ts
2
+ /** Writes JSON readable by its owner only, replacing the target atomically. */
3
+ declare function writePrivateAtomicJson(filePath: string, value: unknown): void;
4
+ //#endregion
5
+ export { writePrivateAtomicJson as t };
6
+ //# sourceMappingURL=index-C6GaYjq-.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C6GaYjq-.d.mts","names":[],"sources":["../src/services/atomicJson/index.ts"],"mappings":";;iBA4BgB,uBAAuB,kBAAkB"}
@@ -0,0 +1,50 @@
1
+ import { x as HarnessState } from "./config-Cm3EV1jp.mjs";
2
+ //#region src/services/harnessState/index.d.ts
3
+ /**
4
+ * State that lives in the file only.
5
+ *
6
+ * These are JSON documents that every spawned process and every hook would
7
+ * otherwise copy in its environment. The plugin hook list and profile defaults
8
+ * are read from the store, while Config publishes the MCP projection through
9
+ * the session-scoped Cordis registry.
10
+ */
11
+ declare const FILE_ONLY_STATE_FIELDS: ReadonlySet<keyof HarnessState>;
12
+ type HarnessStateParseReporter = (key: string, error: unknown) => void;
13
+ declare const HARNESS_STATE_KEYS: {
14
+ readonly root: 'PO_ROOT';
15
+ readonly majorMode: 'PO_MAJOR_MODE';
16
+ readonly temporaryDirectory: 'PO_TEMP_DIR';
17
+ readonly domains: 'PO_DOMAINS';
18
+ readonly layers: 'PO_LAYERS';
19
+ readonly compositionFingerprint: 'PO_COMPOSITION_FINGERPRINT';
20
+ readonly profile: 'PO_PROFILE';
21
+ readonly profileEnvironment: 'PO_PROFILE_ENV';
22
+ readonly hookGroups: 'PO_HOOK_GROUPS';
23
+ readonly skillDirectories: 'PO_SKILL_DIRS';
24
+ readonly agentDirectories: 'PO_AGENT_DIRS';
25
+ readonly additionalDirectories: 'PO_ADDITIONAL_DIRS';
26
+ readonly childExtensions: 'PO_CHILD_EXTENSIONS';
27
+ readonly pluginDirectories: 'PO_PLUGIN_DIRS';
28
+ readonly pluginHooks: 'PO_PLUGIN_HOOKS';
29
+ readonly mcpConfigPath: 'PO_MCP_CONFIG';
30
+ readonly personaFile: 'PO_PERSONA_FILE';
31
+ readonly hooks: 'PO_HOOKS_ENABLED';
32
+ readonly agents: 'PO_AGENTS_ENABLED';
33
+ readonly mcp: 'PO_MCP_ENABLED';
34
+ readonly allowProtectedWrites: 'PO_ALLOW_PROTECTED_WRITES';
35
+ };
36
+ declare function readHarnessState(environment?: NodeJS.ProcessEnv, report?: HarnessStateParseReporter): HarnessState;
37
+ /**
38
+ * Publishes a state patch into an environment.
39
+ *
40
+ * Takes the environment rather than assuming `process.env`, because the
41
+ * launcher builds a child environment and Doom Team builds a spawn snapshot;
42
+ * neither should mutate its own process to describe another one.
43
+ *
44
+ * Fields in FILE_ONLY_FIELDS are skipped: the file carries them, and a reader
45
+ * that needs them reads the store.
46
+ */
47
+ declare function projectHarnessEnvironment(patch: Partial<HarnessState>, environment?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
48
+ //#endregion
49
+ export { readHarnessState as a, projectHarnessEnvironment as i, HARNESS_STATE_KEYS as n, HarnessStateParseReporter as r, FILE_ONLY_STATE_FIELDS as t };
50
+ //# sourceMappingURL=index-CIQrKS1A.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CIQrKS1A.d.mts","names":[],"sources":["../src/services/harnessState/index.ts"],"mappings":";;;;;;;;;;cAyBa,wBAAwB,kBAAkB;KAe3C,6BAA6B,aAAa;cAEzC;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;iBA4Ec,iBACd,cAAa,OAAO,YACpB,SAAS,4BACR;;;;;;;;;;;iBAsCa,0BACd,OAAO,QAAQ,eACf,cAAa,OAAO,aACnB,OAAO"}
@@ -0,0 +1,39 @@
1
+ //#region src/services/init/index.d.ts
2
+ /** The global seed files are processed in this fixed order. */
3
+ declare const GLOBAL_DOOM_SEED_FILES: readonly ['config.yaml', 'modes.yaml', 'domains.yaml', 'profiles.yaml'];
4
+ type DoomSeedFile = (typeof GLOBAL_DOOM_SEED_FILES)[number];
5
+ /** Portable defaults for a new global Doom configuration directory. */
6
+ declare const DOOM_CONFIG_TEMPLATES: Readonly<Record<DoomSeedFile, string>>;
7
+ /** Standalone defaults for a repository that is trying Po through DPI. */
8
+ declare const REPOSITORY_DOOM_CONFIG_TEMPLATES: Readonly<Record<DoomSeedFile, string>>;
9
+ /** Result of filling a Doom seed directory. File arrays contain names in seed order. */
10
+ interface GlobalDoomInitResult {
11
+ directory: string;
12
+ created: string[];
13
+ preserved: string[];
14
+ /** Existing files overwritten from the template. Only ever non-empty under `force`. */
15
+ replaced: string[];
16
+ }
17
+ interface GlobalDoomInitOptions {
18
+ /**
19
+ * Overwrite existing seed files instead of preserving them.
20
+ *
21
+ * Off by default: init is safe to re-run, and hand-edited config is the
22
+ * normal case rather than the exception.
23
+ */
24
+ force?: boolean;
25
+ }
26
+ type RepositoryDoomInitOptions = GlobalDoomInitOptions;
27
+ type RepositoryDoomInitResult = GlobalDoomInitResult;
28
+ /**
29
+ * Fills missing global seed files.
30
+ *
31
+ * Existing files are left alone so that re-running init never discards
32
+ * hand-edited config; pass `force` to overwrite them from the template.
33
+ */
34
+ declare function initializeGlobalDoomConfig(homeDirectory?: string, options?: GlobalDoomInitOptions): GlobalDoomInitResult;
35
+ /** Seeds repository-local configuration without creating or changing Pi settings. */
36
+ declare function initializeRepositoryDoomConfig(repositoryRoot?: string, options?: RepositoryDoomInitOptions): RepositoryDoomInitResult;
37
+ //#endregion
38
+ export { REPOSITORY_DOOM_CONFIG_TEMPLATES as a, initializeGlobalDoomConfig as c, GlobalDoomInitResult as i, initializeRepositoryDoomConfig as l, GLOBAL_DOOM_SEED_FILES as n, RepositoryDoomInitOptions as o, GlobalDoomInitOptions as r, RepositoryDoomInitResult as s, DOOM_CONFIG_TEMPLATES as t };
39
+ //# sourceMappingURL=index-CRcoVYXz.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CRcoVYXz.d.mts","names":[],"sources":["../src/services/init/index.ts"],"mappings":";;cAiBa;KAER,uBAAuB;;cAGf,uBAAuB,SAAS,OAAO;;cA0LvC,kCAAkC,SAAS,OAAO;;UA8D9C;EACf;EACA;EACA;;EAEA;;UAGe;;;;;;;EAOf;;KAGU,4BAA4B;KAC5B,2BAA2B;;;;;;;iBAiKvB,2BACd,wBACA,UAAS,wBACR;;iBAWa,+BACd,yBACA,UAAS,4BACR"}
@@ -0,0 +1,40 @@
1
+ import { a as PiConfigPaths, i as PiConfigLoadOptions, r as PiConfig } from "./piConfig-Bx26HMb_.mjs";
2
+ //#region src/services/imageSettings/index.d.ts
3
+ /** Pi's own cap, from its resize core; also the largest value worth writing. */
4
+ declare const DEFAULT_IMAGE_MAX_DIMENSION = 2000;
5
+ /** Below this a screenshot stops being readable, which is what reads are for. */
6
+ declare const MIN_IMAGE_MAX_DIMENSION = 256;
7
+ interface PiImageSettings {
8
+ /** Pi's own toggle. Unset is on, matching Pi's default. */
9
+ autoResize: boolean;
10
+ /** The longest edge an image keeps once resizing is on. */
11
+ maxDimension: number;
12
+ }
13
+ /** The written form of a change; an absent field leaves that key alone. */
14
+ interface PiImageSettingsUpdate {
15
+ autoResize?: boolean;
16
+ maxDimension?: number;
17
+ }
18
+ declare function clampImageMaxDimension(value: number): number;
19
+ /** Resolves the effective limits, defaulting anything absent or unusable. */
20
+ declare function parsePiImageSettings(config: PiConfig): PiImageSettings;
21
+ //#endregion
22
+ //#region src/services/piConfig/index.d.ts
23
+ declare function piConfigPaths(repoRoot: string, homeDirectory?: string, agentDirectory?: string): PiConfigPaths;
24
+ declare function loadPiConfig(options: PiConfigLoadOptions): PiConfig;
25
+ declare function loadPiConfigAsync(options: PiConfigLoadOptions): Promise<PiConfig>;
26
+ /** The file a change lands in; Pi's own settings toggle writes the same one. */
27
+ declare function piImageSettingsPath(homeDirectory?: string): string;
28
+ declare function loadPiImageSettings(homeDirectory?: string): PiImageSettings;
29
+ /**
30
+ * Writes the changed keys back and reports the limits that now apply.
31
+ *
32
+ * Read-modify-write on Pi's own file, so a save races a concurrent Pi settings
33
+ * save rather than merging with it. Pi writes only the fields its UI touched,
34
+ * as this does, which keeps the window to the one setting being changed on
35
+ * both sides at once.
36
+ */
37
+ declare function savePiImageSettings(update: PiImageSettingsUpdate, homeDirectory?: string): PiImageSettings;
38
+ //#endregion
39
+ export { piImageSettingsPath as a, MIN_IMAGE_MAX_DIMENSION as c, clampImageMaxDimension as d, parsePiImageSettings as f, piConfigPaths as i, PiImageSettings as l, loadPiConfigAsync as n, savePiImageSettings as o, loadPiImageSettings as r, DEFAULT_IMAGE_MAX_DIMENSION as s, loadPiConfig as t, PiImageSettingsUpdate as u };
40
+ //# sourceMappingURL=index-CVlciCJF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CVlciCJF.d.mts","names":[],"sources":["../src/services/imageSettings/index.ts","../src/services/piConfig/index.ts"],"mappings":";;;cA0Ba;;cAEA;UAEI;;EAEf;;EAEA;;;UAIe;EACf;EACA;;iBAGc,uBAAuB;;iBAYvB,qBAAqB,QAAQ,WAAW;;;iBCkBxC,cACd,kBACA,wBACA,0BACC;iBASa,aAAa,SAAS,sBAAsB;iBAkBtC,kBAAkB,SAAS,sBAAsB,QAAQ;;iBAoC/D,oBAAoB;iBAIpB,oBAAoB,yBAA+B;;;;;;;;;iBAanD,oBAAoB,QAAQ,uBAAuB,yBAA+B"}