@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":"domains-DZOu9vYM.mjs","names":["isRecord","requireRecord","optionalString","requireString","assertOnlyKeys"],"sources":["../src/services/pluginCatalog/index.ts","../src/services/domains/completion.ts","../src/services/domains/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport type {\n GitPluginSource,\n PluginCatalog,\n PluginCatalogEntry,\n PluginManifestMetadata,\n PluginSource,\n} from '../../types/domains';\n\nconst AGENT_PLUGIN_SCHEMA_PREFIX = 'https://agent-plugins.org/schemas/';\nconst CACHE_DIRECTORY = 'plugin-cache';\nconst PLUGIN_ID_SEGMENT = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;\nconst NPM_PACKAGE_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*$/;\nconst LEGACY_PLUGIN_MANIFEST_PATHS = [\n '.codex-plugin/plugin.json',\n '.claude-plugin/plugin.json',\n '.cursor-plugin/plugin.json',\n] as const;\n\nexport const MARKETPLACE_MANIFEST_RELATIVE_PATHS = [\n '.agents/plugins/marketplace.json',\n '.agents/plugins/api_marketplace.json',\n '.claude-plugin/marketplace.json',\n '.cursor-plugin/marketplace.json',\n] as const;\n\nexport interface PluginCatalogConfigSource {\n filePath: string;\n baseDirectory: string;\n value: unknown;\n}\n\ninterface MarketplaceLocation {\n manifestPath: string;\n root: string;\n}\n\ninterface ParsedConfiguredEntry {\n source: PluginSource;\n description?: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction requireRecord(value: unknown, label: string): Record<string, unknown> {\n if (!isRecord(value)) throw new Error(`${label} must be an object`);\n return value;\n}\n\nfunction optionalString(value: unknown, label: string): string | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== 'string' || !value.trim()) throw new Error(`${label} must be a non-empty string`);\n return value.trim();\n}\n\nfunction requireString(value: unknown, label: string): string {\n const result = optionalString(value, label);\n if (!result) throw new Error(`${label} must be a non-empty string`);\n return result;\n}\n\nfunction assertOnlyKeys(record: Record<string, unknown>, allowed: readonly string[], label: string): void {\n const unexpected = Object.keys(record).filter((key) => !allowed.includes(key));\n if (unexpected.length > 0) throw new Error(`${label} contains unsupported field \"${unexpected[0]}\"`);\n}\n\nfunction validatePluginIdSegment(value: string, label: string): void {\n if (!PLUGIN_ID_SEGMENT.test(value)) {\n throw new Error(`${label} must start with an alphanumeric character and contain only alphanumerics, ., _, or -`);\n }\n}\n\nfunction validatePluginId(value: string, label: string): void {\n const segments = value.split('@');\n if (segments.length > 2 || segments.some((segment) => !PLUGIN_ID_SEGMENT.test(segment))) {\n throw new Error(`${label} must be a plugin name or plugin@marketplace identifier`);\n }\n}\n\nfunction normalizeRemoteSubdirectory(value: unknown, label: string): string | undefined {\n const raw = optionalString(value, label);\n if (!raw) return undefined;\n const normalized = raw.replaceAll('\\\\', '/').replace(/^\\.\\//, '');\n if (\n normalized.startsWith('/') ||\n normalized.split('/').some((segment) => segment === '' || segment === '.' || segment === '..')\n ) {\n throw new Error(`${label} must stay within the remote repository root`);\n }\n return normalized;\n}\n\nfunction normalizeGitUrl(value: unknown, baseDirectory: string, label: string): string {\n const url = requireString(value, label);\n if (/^(?:https?|ssh|file):\\/\\//.test(url) || /^git@[^:]+:.+/.test(url) || path.isAbsolute(url)) return url;\n if (url.startsWith('./') || url.startsWith('.\\\\')) {\n const relative = url.replaceAll('\\\\', '/').slice(2);\n if (!relative || relative.split('/').some((segment) => segment === '' || segment === '.' || segment === '..')) {\n throw new Error(`${label} must stay within its declaring root`);\n }\n return path.resolve(baseDirectory, relative);\n }\n if (/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+(?:\\.git)?$/.test(url)) {\n return `https://github.com/${url.endsWith('.git') ? url : `${url}.git`}`;\n }\n throw new Error(`${label} is not a supported Git URL`);\n}\n\nfunction resolveMarketplaceLocalPath(rawPath: string, marketplace: MarketplaceLocation, label: string): string {\n if (rawPath === '.' || rawPath === './') return marketplace.root;\n const cursorMarketplace = marketplace.manifestPath.endsWith('.cursor-plugin/marketplace.json');\n const relative = rawPath.startsWith('./') ? rawPath.slice(2) : cursorMarketplace ? rawPath : undefined;\n if (!relative) throw new Error(`${label} must start with ./`);\n const normalized = relative.replaceAll('\\\\', '/');\n if (normalized.split('/').some((segment) => segment === '' || segment === '.' || segment === '..')) {\n throw new Error(`${label} must stay within the marketplace root`);\n }\n return path.resolve(marketplace.root, normalized);\n}\n\nfunction parseSourceObject(\n value: Record<string, unknown>,\n baseDirectory: string,\n label: string,\n marketplace?: MarketplaceLocation,\n): PluginSource {\n const sourceType = requireString(value.source, `${label}.source`);\n if (sourceType === 'local') {\n assertOnlyKeys(value, ['source', 'path', 'description'], label);\n const rawPath = requireString(value.path, `${label}.path`);\n return {\n type: 'local',\n path: marketplace\n ? resolveMarketplaceLocalPath(rawPath, marketplace, `${label}.path`)\n : path.resolve(baseDirectory, rawPath),\n };\n }\n if (sourceType === 'url' || sourceType === 'git-subdir') {\n assertOnlyKeys(value, ['source', 'url', 'path', 'ref', 'sha', 'description'], label);\n const remotePath = normalizeRemoteSubdirectory(value.path, `${label}.path`);\n if (sourceType === 'git-subdir' && !remotePath) {\n throw new Error(`${label}.path must be a non-empty string for git-subdir sources`);\n }\n const ref = optionalString(value.ref, `${label}.ref`);\n const sha = optionalString(value.sha, `${label}.sha`);\n return {\n type: 'git',\n url: normalizeGitUrl(value.url, marketplace?.root ?? baseDirectory, `${label}.url`),\n ...(remotePath ? { path: remotePath } : {}),\n ...(ref ? { ref } : {}),\n ...(sha ? { sha } : {}),\n };\n }\n if (sourceType === 'npm') {\n assertOnlyKeys(value, ['source', 'package', 'version', 'registry', 'description'], label);\n const packageName = requireString(value.package, `${label}.package`);\n if (!NPM_PACKAGE_NAME.test(packageName)) throw new Error(`${label}.package must be a valid npm package name`);\n const version = optionalString(value.version, `${label}.version`);\n const registry = optionalString(value.registry, `${label}.registry`);\n return {\n type: 'npm',\n package: packageName,\n ...(version ? { version } : {}),\n ...(registry ? { registry } : {}),\n };\n }\n throw new Error(`${label}.source must be local, url, git-subdir, or npm`);\n}\n\nfunction parsePluginSource(\n value: unknown,\n baseDirectory: string,\n label: string,\n marketplace?: MarketplaceLocation,\n): PluginSource {\n if (typeof value === 'string') {\n const rawPath = requireString(value, label);\n return {\n type: 'local',\n path: marketplace\n ? resolveMarketplaceLocalPath(rawPath, marketplace, label)\n : path.resolve(baseDirectory, rawPath),\n };\n }\n return parseSourceObject(requireRecord(value, label), baseDirectory, label, marketplace);\n}\n\nfunction parseConfiguredEntry(value: unknown, baseDirectory: string, label: string): ParsedConfiguredEntry {\n if (typeof value === 'string') return { source: parsePluginSource(value, baseDirectory, label) };\n const record = requireRecord(value, label);\n const description = optionalString(record.description, `${label}.description`);\n if (record.source === undefined && typeof record.path === 'string') {\n assertOnlyKeys(record, ['path', 'description'], label);\n return {\n source: { type: 'local', path: path.resolve(baseDirectory, requireString(record.path, `${label}.path`)) },\n ...(description ? { description } : {}),\n };\n }\n if (typeof record.source === 'string' && !['local', 'url', 'git-subdir', 'npm'].includes(record.source)) {\n assertOnlyKeys(record, ['source', 'description'], label);\n return {\n source: parsePluginSource(record.source, baseDirectory, `${label}.source`),\n ...(description ? { description } : {}),\n };\n }\n if (isRecord(record.source)) {\n assertOnlyKeys(record, ['source', 'description'], label);\n return {\n source: parsePluginSource(record.source, baseDirectory, `${label}.source`),\n ...(description ? { description } : {}),\n };\n }\n return {\n source: parseSourceObject(record, baseDirectory, label),\n ...(description ? { description } : {}),\n };\n}\n\nfunction marketplaceRootFromManifest(manifestPath: string): string | undefined {\n const normalized = path.resolve(manifestPath);\n for (const relativePath of MARKETPLACE_MANIFEST_RELATIVE_PATHS) {\n const suffix = path.normalize(relativePath);\n if (!normalized.endsWith(suffix)) continue;\n let root = normalized;\n for (const _segment of relativePath.split('/')) root = path.dirname(root);\n return root;\n }\n return undefined;\n}\n\nfunction findMarketplace(rootOrManifest: string): MarketplaceLocation | undefined {\n if (fs.existsSync(rootOrManifest) && fs.statSync(rootOrManifest).isFile()) {\n const root = marketplaceRootFromManifest(rootOrManifest);\n return root ? { manifestPath: path.resolve(rootOrManifest), root } : undefined;\n }\n for (const relativePath of MARKETPLACE_MANIFEST_RELATIVE_PATHS) {\n const manifestPath = path.join(rootOrManifest, relativePath);\n if (fs.existsSync(manifestPath) && fs.statSync(manifestPath).isFile()) {\n return { manifestPath: path.resolve(manifestPath), root: path.resolve(rootOrManifest) };\n }\n }\n return undefined;\n}\n\nfunction readJsonRecord(filePath: string, label: string): Record<string, unknown> {\n let parsed: unknown;\n try {\n parsed = JSON.parse(fs.readFileSync(filePath, 'utf8')) as unknown;\n } catch (error) {\n throw new Error(\n `${label} at ${filePath} is invalid JSON: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n return requireRecord(parsed, `${label} at ${filePath}`);\n}\n\n/** Matches Codex manifest precedence, including schema-gated root plugin.json. */\nexport function findPluginManifestPath(pluginRoot: string): string | undefined {\n const rootManifest = path.join(pluginRoot, 'plugin.json');\n try {\n const metadata = fs.lstatSync(rootManifest);\n if (metadata.isSymbolicLink() || !metadata.isFile()) return undefined;\n const parsed = JSON.parse(fs.readFileSync(rootManifest, 'utf8')) as unknown;\n const schema = isRecord(parsed) && typeof parsed.$schema === 'string' ? parsed.$schema : undefined;\n if (schema?.startsWith(AGENT_PLUGIN_SCHEMA_PREFIX)) return rootManifest;\n } catch {\n // A missing, unreadable, or unrelated root manifest does not outrank legacy manifests.\n }\n return LEGACY_PLUGIN_MANIFEST_PATHS.map((relativePath) => path.join(pluginRoot, relativePath)).find(\n (manifestPath) => fs.existsSync(manifestPath) && fs.statSync(manifestPath).isFile(),\n );\n}\n\nfunction readPluginManifestMetadata(pluginRoot: string, diagnostics: string[]): PluginManifestMetadata | undefined {\n const manifestPath = findPluginManifestPath(pluginRoot);\n if (!manifestPath) return undefined;\n try {\n const manifest = readJsonRecord(manifestPath, 'Plugin manifest');\n const schema = optionalString(manifest.$schema, `${manifestPath}.$schema`);\n const name = optionalString(manifest.name, `${manifestPath}.name`);\n const version = optionalString(manifest.version, `${manifestPath}.version`);\n const description = optionalString(manifest.description, `${manifestPath}.description`);\n return {\n path: manifestPath,\n ...(name ? { name } : {}),\n ...(version ? { version } : {}),\n ...(description ? { description } : {}),\n ...(schema?.startsWith(AGENT_PLUGIN_SCHEMA_PREFIX) ? { agentPluginSchema: schema } : {}),\n };\n } catch (error) {\n diagnostics.push(error instanceof Error ? error.message : String(error));\n return { path: manifestPath };\n }\n}\n\nfunction discoverPluginRoot(\n pluginRoot: string,\n entries: Record<string, PluginCatalogEntry>,\n diagnostics: string[],\n): boolean {\n const diagnosticCount = diagnostics.length;\n const manifest = readPluginManifestMetadata(pluginRoot, diagnostics);\n if (!manifest || diagnostics.length !== diagnosticCount) return false;\n const name = manifest.name ?? path.basename(pluginRoot);\n try {\n validatePluginIdSegment(name, `Plugin name in ${manifest.path}`);\n } catch (error) {\n diagnostics.push(error instanceof Error ? error.message : String(error));\n return false;\n }\n entries[name] = {\n source: { type: 'local', path: pluginRoot },\n ...(manifest.description ? { description: manifest.description } : {}),\n manifest,\n };\n return true;\n}\n\nfunction discoverPluginFolder(\n root: string,\n entries: Record<string, PluginCatalogEntry>,\n diagnostics: string[],\n): number {\n if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) return 0;\n if (findPluginManifestPath(root)) return discoverPluginRoot(root, entries, diagnostics) ? 1 : 0;\n\n let discovered = 0;\n const children = fs\n .readdirSync(root, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .sort((left, right) => left.name.localeCompare(right.name));\n for (const child of children) {\n if (discoverPluginRoot(path.join(root, child.name), entries, diagnostics)) discovered += 1;\n }\n return discovered;\n}\n\nfunction parseMarketplace(\n marketplace: MarketplaceLocation,\n entries: Record<string, PluginCatalogEntry>,\n diagnostics: string[],\n): void {\n const document = readJsonRecord(marketplace.manifestPath, 'Marketplace manifest');\n const marketplaceName = requireString(document.name, `${marketplace.manifestPath}.name`);\n validatePluginIdSegment(marketplaceName, `${marketplace.manifestPath}.name`);\n if (!Array.isArray(document.plugins)) throw new Error(`${marketplace.manifestPath}.plugins must be an array`);\n for (let index = 0; index < document.plugins.length; index += 1) {\n const label = `${marketplace.manifestPath}.plugins[${index}]`;\n try {\n const plugin = requireRecord(document.plugins[index], label);\n const pluginName = requireString(plugin.name, `${label}.name`);\n validatePluginIdSegment(pluginName, `${label}.name`);\n const id = `${pluginName}@${marketplaceName}`;\n if (Object.hasOwn(entries, id)) continue;\n const source = parsePluginSource(plugin.source, marketplace.root, `${label}.source`, marketplace);\n const description = optionalString(plugin.description, `${label}.description`);\n const manifest = source.type === 'local' ? readPluginManifestMetadata(source.path, diagnostics) : undefined;\n const resolvedDescription = description ?? manifest?.description;\n entries[id] = {\n source,\n marketplace: marketplaceName,\n ...(resolvedDescription ? { description: resolvedDescription } : {}),\n ...(manifest ? { manifest } : {}),\n };\n } catch (error) {\n diagnostics.push(error instanceof Error ? error.message : String(error));\n }\n }\n}\n\nfunction parseConfiguredRoots(source: PluginCatalogConfigSource): string[] {\n if (source.value === undefined) return [];\n const document = requireRecord(source.value, `plugins in ${source.filePath}`);\n assertOnlyKeys(document, ['roots', 'entries'], `plugins in ${source.filePath}`);\n if (document.roots === undefined) return [];\n if (!Array.isArray(document.roots)) throw new Error(`plugins.roots in ${source.filePath} must be an array`);\n return document.roots.map((root, index) =>\n path.resolve(source.baseDirectory, requireString(root, `plugins.roots[${index}] in ${source.filePath}`)),\n );\n}\n\nfunction applyConfiguredEntries(\n source: PluginCatalogConfigSource,\n entries: Record<string, PluginCatalogEntry>,\n diagnostics: string[],\n): void {\n if (source.value === undefined) return;\n const document = requireRecord(source.value, `plugins in ${source.filePath}`);\n if (document.entries === undefined) return;\n const configuredEntries = requireRecord(document.entries, `plugins.entries in ${source.filePath}`);\n for (const [name, value] of Object.entries(configuredEntries)) {\n validatePluginId(name, `Plugin entry \"${name}\" in ${source.filePath}`);\n const parsed = parseConfiguredEntry(value, source.baseDirectory, `plugins.entries.${name} in ${source.filePath}`);\n const manifest =\n parsed.source.type === 'local' ? readPluginManifestMetadata(parsed.source.path, diagnostics) : undefined;\n const description = parsed.description ?? manifest?.description;\n entries[name] = {\n source: parsed.source,\n ...(description ? { description } : {}),\n ...(manifest ? { manifest } : {}),\n };\n }\n}\n\nexport function pluginDirectoryForSource(source: PluginSource, homeDoomDirectory: string): string {\n if (source.type === 'local') return source.path;\n const identity =\n source.type === 'git'\n ? ['git', source.url, source.path ?? '', source.ref ?? '', source.sha ?? '']\n : ['npm', source.package, source.version ?? '', source.registry ?? ''];\n const digest = crypto.createHash('sha256').update(JSON.stringify(identity)).digest('hex');\n return path.join(homeDoomDirectory, CACHE_DIRECTORY, digest);\n}\n\nexport function loadPluginCatalog(\n sources: readonly PluginCatalogConfigSource[],\n repoRoot: string,\n homeDirectory: string,\n): PluginCatalog {\n const diagnostics: string[] = [];\n const entries: Record<string, PluginCatalogEntry> = {};\n const roots = [...new Set(sources.flatMap(parseConfiguredRoots))];\n const candidates = [homeDirectory, repoRoot, ...roots];\n const marketplaces: string[] = [];\n const seenMarketplaces = new Set<string>();\n\n for (const candidate of candidates) {\n const marketplace = findMarketplace(candidate);\n if (!marketplace) continue;\n if (seenMarketplaces.has(marketplace.manifestPath)) continue;\n seenMarketplaces.add(marketplace.manifestPath);\n marketplaces.push(marketplace.manifestPath);\n try {\n parseMarketplace(marketplace, entries, diagnostics);\n } catch (error) {\n diagnostics.push(error instanceof Error ? error.message : String(error));\n }\n }\n\n for (const root of roots) {\n if (findMarketplace(root)) continue;\n if (discoverPluginFolder(root, entries, diagnostics) === 0) {\n diagnostics.push(`Plugin root contains neither a supported marketplace nor discoverable plugins: ${root}`);\n }\n }\n\n for (const source of sources) applyConfiguredEntries(source, entries, diagnostics);\n return { roots, marketplaces, entries, diagnostics };\n}\n\nexport function isRemotePluginSource(\n source: PluginSource,\n): source is GitPluginSource | Extract<PluginSource, { type: 'npm' }> {\n return source.type !== 'local';\n}\n","import type { DomainManifest } from '../../types/domains';\n\nconst NAME_DELIMITER = ',';\n\n/** Splits comma-joined selections and expands aliases into concrete domain names. */\nexport function expandDomainNames(manifest: DomainManifest, domainNames: readonly string[]): string[] {\n return domainNames\n .flatMap((raw) =>\n raw\n .split(NAME_DELIMITER)\n .map((name) => name.trim())\n .filter(Boolean),\n )\n .flatMap((name) => manifest.aliases[name] ?? [name]);\n}\n\nexport function domainCompletionPrefix(textBeforeCursor: string): string | undefined {\n const match = textBeforeCursor.match(/^\\/domains\\s+(?:[^\\s,]+,)*([^\\s,]*)$/);\n return match?.[1];\n}\n\nexport function domainCompletionItems(domainNames: string[], query: string): Array<{ value: string; label: string }> {\n const normalizedQuery = query.toLowerCase();\n return domainNames\n .filter((name) => name.toLowerCase().startsWith(normalizedQuery))\n .map((name) => ({ value: name, label: name }));\n}\n","import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport type {\n DomainDefinition,\n DomainManifest,\n DomainMcpAllowlist,\n DomainPlugin,\n PluginEntry,\n ResolvedDomain,\n} from '../../types/domains';\nimport { globalDoomConfigDirectory } from '../config';\nimport { readDoomConfigSources } from '../layeredConfig';\nimport { loadPluginCatalog, pluginDirectoryForSource } from '../pluginCatalog';\nimport { expandDomainNames } from './completion';\n\nexport { DOOM_DIR } from '../layeredConfig';\n\nconst DOMAINS_FILE = 'domains.yaml';\nconst UNKNOWN_DOMAIN_ERROR = 'Unknown domain';\nconst UNKNOWN_PLUGIN_ERROR = 'Unknown plugin';\nconst MISSING_PLUGIN_DIRECTORY_ERROR = 'Plugin directory does not exist';\nconst DEFAULT_DOMAINS_PATH = '.po/domains.yaml';\nconst SUPPORTED_AGENT_PLUGIN_SCHEMA = 'https://agent-plugins.org/schemas/1.0.0/plugin.schema.json';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction requireRecord(value: unknown, label: string): Record<string, unknown> {\n if (!isRecord(value)) throw new Error(`${label} must be an object`);\n return value;\n}\n\nfunction assertOnlyKeys(record: Record<string, unknown>, allowed: readonly string[], label: string): void {\n const unexpected = Object.keys(record).filter((key) => !allowed.includes(key));\n if (unexpected.length > 0) throw new Error(`${label} contains unsupported field \"${unexpected[0]}\"`);\n}\n\nfunction requireString(value: unknown, label: string): string {\n if (typeof value !== 'string' || !value.trim()) throw new Error(`${label} must be a non-empty string`);\n return value.trim();\n}\n\nfunction optionalString(value: unknown, label: string): string | undefined {\n if (value === undefined) return undefined;\n return requireString(value, label);\n}\n\nfunction parseStringArray(value: unknown, label: string): string[] {\n if (!Array.isArray(value)) throw new Error(`${label} must be an array of non-empty strings`);\n return [...new Set(value.map((entry, index) => requireString(entry, `${label}[${index}]`)))];\n}\n\nfunction parseOptionalBoolean(value: unknown, label: string): boolean | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== 'boolean') throw new Error(`${label} must be a boolean`);\n return value;\n}\n\nfunction parseDefaultDomains(value: unknown): string[] {\n return parseStringArray(value, `defaultDomains in ${DEFAULT_DOMAINS_PATH}`);\n}\n\nfunction parseDomainPlugin(value: unknown, label: string): DomainPlugin {\n if (typeof value === 'string') return requireString(value, label);\n const plugin = requireRecord(value, label);\n assertOnlyKeys(plugin, ['name', 'skills', 'agents', 'hooks', 'mcp'], label);\n const skills = plugin.skills === undefined ? undefined : parseStringArray(plugin.skills, `${label}.skills`);\n const agents = plugin.agents === undefined ? undefined : parseStringArray(plugin.agents, `${label}.agents`);\n const hooks = parseOptionalBoolean(plugin.hooks, `${label}.hooks`);\n const mcp = parseOptionalBoolean(plugin.mcp, `${label}.mcp`);\n return {\n name: requireString(plugin.name, `${label}.name`),\n ...(skills ? { skills } : {}),\n ...(agents ? { agents } : {}),\n ...(hooks === undefined ? {} : { hooks }),\n ...(mcp === undefined ? {} : { mcp }),\n };\n}\n\nfunction parseMcpAllowlist(value: unknown, label: string): DomainMcpAllowlist {\n const mcp = requireRecord(value, label);\n assertOnlyKeys(mcp, ['servers', 'proxy'], label);\n return {\n ...(mcp.servers === undefined ? {} : { servers: parseStringArray(mcp.servers, `${label}.servers`) }),\n ...(mcp.proxy === undefined ? {} : { proxy: parseStringArray(mcp.proxy, `${label}.proxy`) }),\n };\n}\n\nfunction parseDomain(value: unknown, label: string): DomainDefinition {\n const domain = requireRecord(value, label);\n assertOnlyKeys(domain, ['description', 'plugins', 'mcp', 'sharedSkills'], label);\n const description = optionalString(domain.description, `${label}.description`);\n if (domain.plugins !== undefined && !Array.isArray(domain.plugins)) {\n throw new Error(`${label}.plugins must be an array`);\n }\n const sharedSkills = parseOptionalBoolean(domain.sharedSkills, `${label}.sharedSkills`);\n return {\n ...(description ? { description } : {}),\n ...(Array.isArray(domain.plugins)\n ? { plugins: domain.plugins.map((plugin, index) => parseDomainPlugin(plugin, `${label}.plugins[${index}]`)) }\n : {}),\n ...(domain.mcp === undefined ? {} : { mcp: parseMcpAllowlist(domain.mcp, `${label}.mcp`) }),\n ...(sharedSkills === undefined ? {} : { sharedSkills }),\n };\n}\n\nfunction parseAliases(value: unknown, label: string): Record<string, string[]> {\n if (value === undefined) return {};\n const aliases = requireRecord(value, label);\n return Object.fromEntries(\n Object.entries(aliases).map(([name, domains]) => [name, parseStringArray(domains, `${label}.${name}`)]),\n );\n}\n\n/**\n * Reads domains and plugin catalogs from global and repository configs.\n *\n * Named domains and explicit plugin entries are replaced by later repository\n * definitions. Configured roots accumulate, with exact marketplace manifests\n * deduplicated in discovery order. Explicit entries override discovered IDs.\n */\nexport function loadDomains(repoRoot: string, homeDirectory: string = os.homedir()): DomainManifest {\n const sources = readDoomConfigSources<unknown>(DOMAINS_FILE, repoRoot, homeDirectory);\n const aliases: Record<string, string[]> = {};\n const domains: Record<string, ResolvedDomain> = {};\n let defaultDomains: string[] | undefined;\n\n for (const source of sources) {\n const document = requireRecord(source.document, source.filePath);\n assertOnlyKeys(document, ['plugins', 'domains', 'aliases', 'defaultDomains'], source.filePath);\n Object.assign(aliases, parseAliases(document.aliases, `aliases in ${source.filePath}`));\n if (document.domains !== undefined) {\n const sourceDomains = requireRecord(document.domains, `domains in ${source.filePath}`);\n for (const [name, definition] of Object.entries(sourceDomains)) {\n domains[name] = {\n ...parseDomain(definition, `domains.${name} in ${source.filePath}`),\n baseDirectory: source.baseDirectory,\n };\n }\n }\n if (Object.hasOwn(document, 'defaultDomains')) defaultDomains = parseDefaultDomains(document.defaultDomains);\n }\n\n const plugins = loadPluginCatalog(\n sources.map((source) => ({\n filePath: source.filePath,\n baseDirectory: source.baseDirectory,\n value: requireRecord(source.document, source.filePath).plugins,\n })),\n repoRoot,\n homeDirectory,\n );\n\n if (defaultDomains) {\n for (const name of expandDomainNames({ plugins, domains, aliases }, defaultDomains)) {\n if (!Object.hasOwn(domains, name)) {\n throw new Error(`Unknown default domain \"${name}\" in ${DEFAULT_DOMAINS_PATH}`);\n }\n }\n }\n return { plugins, domains, aliases, ...(defaultDomains ? { defaultDomains } : {}) };\n}\n\nexport function listDomainNames(repoRoot: string, homeDirectory?: string): string[] {\n const manifest = loadDomains(repoRoot, homeDirectory);\n return [...new Set([...Object.keys(manifest.domains), ...Object.keys(manifest.aliases)])].sort();\n}\n\n/**\n * Whether to include .claude/skills as shared fallbacks.\n *\n * Shared skills are included unless every selected domain opts out, so mixing a\n * trimmed domain with an untrimmed one cannot strip the untrimmed one's skills.\n */\nexport function resolveSharedSkills(repoRoot: string, domainNames: string[], homeDirectory?: string): boolean {\n const manifest = loadDomains(repoRoot, homeDirectory);\n const expanded = expandDomainNames(manifest, domainNames);\n if (expanded.length === 0) return true;\n return expanded.some((name) => manifest.domains[name]?.sharedSkills !== false);\n}\n\n/** Resolves named domain plugins while preserving each subset filter. */\nexport function resolvePluginEntries(\n repoRoot: string,\n domainNames: string[],\n explicitDirectories: string[],\n homeDirectory: string = os.homedir(),\n): PluginEntry[] {\n const manifest = loadDomains(repoRoot, homeDirectory);\n const entries: PluginEntry[] = [];\n const seen = new Set<string>();\n const homeDoomDirectory = globalDoomConfigDirectory(homeDirectory);\n\n for (const domainName of expandDomainNames(manifest, domainNames)) {\n const domain = manifest.domains[domainName];\n if (!domain) throw new Error(`${UNKNOWN_DOMAIN_ERROR}: ${domainName}`);\n for (const selection of domain.plugins ?? []) {\n const isSubset = typeof selection !== 'string';\n const pluginName = isSubset ? selection.name : selection;\n const plugin = manifest.plugins.entries[pluginName];\n if (!plugin) throw new Error(`${UNKNOWN_PLUGIN_ERROR} \"${pluginName}\" referenced by domain \"${domainName}\"`);\n const directory = pluginDirectoryForSource(plugin.source, homeDoomDirectory);\n if (plugin.source.type === 'local' && (!fs.existsSync(directory) || !fs.statSync(directory).isDirectory())) {\n throw new Error(`${MISSING_PLUGIN_DIRECTORY_ERROR}: ${directory}`);\n }\n if (seen.has(directory)) continue;\n seen.add(directory);\n entries.push({\n name: pluginName,\n directory,\n // The domain is only in scope here. `resolvePluginDirectories` keeps\n // just the path, so anything downstream that wants to say which domain\n // brought a plugin has to be told now or not at all.\n domain: domainName,\n source: plugin.source,\n ...(plugin.manifest ? { manifest: plugin.manifest } : {}),\n ...(plugin.manifest?.agentPluginSchema === SUPPORTED_AGENT_PLUGIN_SCHEMA\n ? { skillDiscovery: 'direct-children' as const }\n : {}),\n ...(isSubset && selection.skills ? { skills: selection.skills } : {}),\n ...(isSubset && selection.agents ? { agents: selection.agents } : {}),\n ...(isSubset && selection.hooks !== undefined ? { hooks: selection.hooks } : {}),\n ...(isSubset && selection.mcp !== undefined ? { mcp: selection.mcp } : {}),\n });\n }\n }\n\n for (const configuredDirectory of explicitDirectories) {\n const directory = path.resolve(configuredDirectory);\n if (!fs.existsSync(directory) || !fs.statSync(directory).isDirectory()) {\n throw new Error(`${MISSING_PLUGIN_DIRECTORY_ERROR}: ${directory}`);\n }\n if (seen.has(directory)) continue;\n seen.add(directory);\n entries.push({\n name: path.basename(directory),\n directory,\n source: { type: 'local', path: directory },\n });\n }\n return entries;\n}\n\nexport function resolvePluginDirectories(\n repoRoot: string,\n domainNames: string[],\n explicitDirectories: string[],\n homeDirectory?: string,\n): string[] {\n return resolvePluginEntries(repoRoot, domainNames, explicitDirectories, homeDirectory).map(\n (entry) => entry.directory,\n );\n}\n\nexport const PO_DOMAINS_ENV = 'PO_DOMAINS';\nexport const DEFAULT_DOMAIN = 'default';\nconst MARKETING_MAJOR_MODE = 'marketing';\n\nfunction parseDomainList(value: string): string[] {\n return value\n .split(',')\n .map((entry) => entry.trim())\n .filter(Boolean);\n}\n\n/**\n * Domains selected when the caller names none.\n *\n * Configuration keeps this axis independent of the major mode. The\n * major-mode-derived choice is retained only as the compatibility fallback for\n * domains files that declare no defaultDomains.\n */\nexport function defaultDomainsForMajorMode(\n majorMode: string,\n environment: NodeJS.ProcessEnv,\n defaultDomains?: readonly string[],\n): string[] {\n const inherited = environment[PO_DOMAINS_ENV];\n // An explicitly empty variable means no domains, so this tests for the key\n // rather than for a truthy value.\n if (inherited !== undefined) return parseDomainList(inherited);\n if (defaultDomains !== undefined) return [...defaultDomains];\n return parseDomainList(majorMode === MARKETING_MAJOR_MODE ? MARKETING_MAJOR_MODE : DEFAULT_DOMAIN);\n}\n"],"mappings":";;;;;;;AAYA,MAAM,6BAA6B;AACnC,MAAM,kBAAkB;AACxB,MAAM,oBAAoB;AAC1B,MAAM,mBAAmB;AACzB,MAAM,+BAA+B;CACnC;CACA;CACA;AACF;AAEA,MAAa,sCAAsC;CACjD;CACA;CACA;CACA;AACF;AAkBA,SAASA,WAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAASC,gBAAc,OAAgB,OAAwC;CAC7E,IAAI,CAACD,WAAS,KAAK,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,mBAAmB;CAClE,OAAO;AACT;AAEA,SAASE,iBAAe,OAAgB,OAAmC;CACzE,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;CAChC,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,4BAA4B;CACrG,OAAO,MAAM,KAAK;AACpB;AAEA,SAASC,gBAAc,OAAgB,OAAuB;CAC5D,MAAM,SAASD,iBAAe,OAAO,KAAK;CAC1C,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,GAAG,MAAM,4BAA4B;CAClE,OAAO;AACT;AAEA,SAASE,iBAAe,QAAiC,SAA4B,OAAqB;CACxG,MAAM,aAAa,OAAO,KAAK,MAAM,CAAC,CAAC,QAAQ,QAAQ,CAAC,QAAQ,SAAS,GAAG,CAAC;CAC7E,IAAI,WAAW,SAAS,GAAG,MAAM,IAAI,MAAM,GAAG,MAAM,+BAA+B,WAAW,GAAG,E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nE,GAAI,YAAY,UAAU,UAAU,KAAA,IAAY,EAAE,OAAO,UAAU,MAAM,IAAI,CAAC;IAC9E,GAAI,YAAY,UAAU,QAAQ,KAAA,IAAY,EAAE,KAAK,UAAU,IAAI,IAAI,CAAC;GAC1E,CAAC;EACH;CACF;CAEA,KAAK,MAAM,uBAAuB,qBAAqB;EACrD,MAAM,YAAY,KAAK,QAAQ,mBAAmB;EAClD,IAAI,CAAC,GAAG,WAAW,SAAS,KAAK,CAAC,GAAG,SAAS,SAAS,CAAC,CAAC,YAAY,GACnE,MAAM,IAAI,MAAM,GAAG,+BAA+B,IAAI,WAAW;EAEnE,IAAI,KAAK,IAAI,SAAS,GAAG;EACzB,KAAK,IAAI,SAAS;EAClB,QAAQ,KAAK;GACX,MAAM,KAAK,SAAS,SAAS;GAC7B;GACA,QAAQ;IAAE,MAAM;IAAS,MAAM;GAAU;EAC3C,CAAC;CACH;CACA,OAAO;AACT;AAEA,SAAgB,yBACd,UACA,aACA,qBACA,eACU;CACV,OAAO,qBAAqB,UAAU,aAAa,qBAAqB,aAAa,CAAC,CAAC,KACpF,UAAU,MAAM,SACnB;AACF;AAEA,MAAa,iBAAiB;AAC9B,MAAa,iBAAiB;AAC9B,MAAM,uBAAuB;AAE7B,SAAS,gBAAgB,OAAyB;CAChD,OAAO,MACJ,MAAM,GAAG,CAAC,CACV,KAAK,UAAU,MAAM,KAAK,CAAC,CAAC,CAC5B,OAAO,OAAO;AACnB;;;;;;;;AASA,SAAgB,2BACd,WACA,aACA,gBACU;CACV,MAAM,YAAY,YAAY;CAG9B,IAAI,cAAc,KAAA,GAAW,OAAO,gBAAgB,SAAS;CAC7D,IAAI,mBAAmB,KAAA,GAAW,OAAO,CAAC,GAAG,cAAc;CAC3D,OAAO,gBAAgB,cAAc,uBAAuB,uBAAuB,cAAc;AACnG"}
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_layeredConfig = require("./layeredConfig-DdI5ysUf.cjs");
3
+ const require_domains = require("./domains-CBYkuxs5.cjs");
4
+ exports.DEFAULT_DOMAIN = require_domains.DEFAULT_DOMAIN;
5
+ exports.DOOM_DIR = require_layeredConfig.DOOM_DIR;
6
+ exports.MARKETPLACE_MANIFEST_RELATIVE_PATHS = require_domains.MARKETPLACE_MANIFEST_RELATIVE_PATHS;
7
+ exports.PO_DOMAINS_ENV = require_domains.PO_DOMAINS_ENV;
8
+ exports.defaultDomainsForMajorMode = require_domains.defaultDomainsForMajorMode;
9
+ exports.domainCompletionItems = require_domains.domainCompletionItems;
10
+ exports.domainCompletionPrefix = require_domains.domainCompletionPrefix;
11
+ exports.expandDomainNames = require_domains.expandDomainNames;
12
+ exports.findPluginManifestPath = require_domains.findPluginManifestPath;
13
+ exports.isRemotePluginSource = require_domains.isRemotePluginSource;
14
+ exports.listDomainNames = require_domains.listDomainNames;
15
+ exports.loadDomains = require_domains.loadDomains;
16
+ exports.pluginDirectoryForSource = require_domains.pluginDirectoryForSource;
17
+ exports.resolvePluginDirectories = require_domains.resolvePluginDirectories;
18
+ exports.resolvePluginEntries = require_domains.resolvePluginEntries;
19
+ exports.resolveSharedSkills = require_domains.resolveSharedSkills;
@@ -0,0 +1,3 @@
1
+ import { C as PluginCatalog, D as PluginSkillDiscovery, E as PluginManifestMetadata, O as PluginSource, S as NpmPluginSource, T as PluginEntry, _ as DomainManifest, a as domainCompletionItems, b as GitPluginSource, c as DEFAULT_DOMAIN, d as listDomainNames, f as loadDomains, g as DomainDefinition, h as resolveSharedSkills, i as pluginDirectoryForSource, k as ResolvedDomain, l as PO_DOMAINS_ENV, m as resolvePluginEntries, n as findPluginManifestPath, o as domainCompletionPrefix, p as resolvePluginDirectories, r as isRemotePluginSource, s as expandDomainNames, t as MARKETPLACE_MANIFEST_RELATIVE_PATHS, u as defaultDomainsForMajorMode, v as DomainMcpAllowlist, w as PluginCatalogEntry, x as LocalPluginSource, y as DomainPlugin } from "./index-BT29GZx5.mjs";
2
+ import { t as DOOM_DIR } from "./index-Ch7ptOkW.mjs";
3
+ export { DEFAULT_DOMAIN, DOOM_DIR, type DomainDefinition, type DomainManifest, type DomainMcpAllowlist, type DomainPlugin, type GitPluginSource, type LocalPluginSource, MARKETPLACE_MANIFEST_RELATIVE_PATHS, type NpmPluginSource, PO_DOMAINS_ENV, type PluginCatalog, type PluginCatalogEntry, type PluginEntry, type PluginManifestMetadata, type PluginSkillDiscovery, type PluginSource, type ResolvedDomain, defaultDomainsForMajorMode, domainCompletionItems, domainCompletionPrefix, expandDomainNames, findPluginManifestPath, isRemotePluginSource, listDomainNames, loadDomains, pluginDirectoryForSource, resolvePluginDirectories, resolvePluginEntries, resolveSharedSkills };
@@ -0,0 +1,3 @@
1
+ import { t as DOOM_DIR } from "./layeredConfig-B922ibgn.mjs";
2
+ import { a as loadDomains, c as resolveSharedSkills, d as expandDomainNames, f as MARKETPLACE_MANIFEST_RELATIVE_PATHS, h as pluginDirectoryForSource, i as listDomainNames, l as domainCompletionItems, m as isRemotePluginSource, n as PO_DOMAINS_ENV, o as resolvePluginDirectories, p as findPluginManifestPath, r as defaultDomainsForMajorMode, s as resolvePluginEntries, t as DEFAULT_DOMAIN, u as domainCompletionPrefix } from "./domains-DZOu9vYM.mjs";
3
+ export { DEFAULT_DOMAIN, DOOM_DIR, MARKETPLACE_MANIFEST_RELATIVE_PATHS, PO_DOMAINS_ENV, defaultDomainsForMajorMode, domainCompletionItems, domainCompletionPrefix, expandDomainNames, findPluginManifestPath, isRemotePluginSource, listDomainNames, loadDomains, pluginDirectoryForSource, resolvePluginDirectories, resolvePluginEntries, resolveSharedSkills };
@@ -0,0 +1,101 @@
1
+ import { defineMcpWidget } from "@agimon-ai/po-core/web";
2
+ import { McpToolFields, McpToolFrame, McpToolOutput } from "@agimon-ai/po-web-components";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useEffect, useRef, useState } from "react";
5
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/load_context.mcp.tsx
6
+ function LoadContextMcpWidget(props) {
7
+ return /* @__PURE__ */ jsx(McpToolFrame, {
8
+ ...props,
9
+ title: "Load repository context",
10
+ children: /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })
11
+ });
12
+ }
13
+ var load_context_mcp_default = defineMcpWidget(LoadContextMcpWidget);
14
+ //#endregion
15
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/rename_thread.mcp.tsx
16
+ function RenameThreadMcpWidget(props) {
17
+ return /* @__PURE__ */ jsxs(McpToolFrame, {
18
+ ...props,
19
+ title: "Rename thread",
20
+ children: [/* @__PURE__ */ jsx(McpToolFields, { fields: [["Title", props.args.title]] }), /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })]
21
+ });
22
+ }
23
+ var rename_thread_mcp_default = defineMcpWidget(RenameThreadMcpWidget);
24
+ //#endregion
25
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/show_session.mcp.tsx
26
+ function sessionView(value) {
27
+ if (typeof value !== "object" || value === null) return void 0;
28
+ const data = value;
29
+ if (typeof data.sessionId !== "string" || !data.sessionId || typeof data.repositoryName !== "string" || typeof data.majorMode !== "string" || !Number.isSafeInteger(data.revision) || data.revision < 0 || data.profile !== null && typeof data.profile !== "string") return void 0;
30
+ if (![
31
+ "domains",
32
+ "layers",
33
+ "minorModes"
34
+ ].every((key) => Array.isArray(data[key]) && data[key].every((item) => typeof item === "string"))) return void 0;
35
+ return data;
36
+ }
37
+ function ShowSessionMcpWidget(props) {
38
+ const [refreshed, setRefreshed] = useState(null);
39
+ const [busy, setBusy] = useState(false);
40
+ const [refreshError, setRefreshError] = useState();
41
+ const alive = useRef(true);
42
+ useEffect(() => {
43
+ alive.current = true;
44
+ return () => {
45
+ alive.current = false;
46
+ };
47
+ }, []);
48
+ const result = refreshed ?? props.result;
49
+ const view = sessionView(result?.structuredContent);
50
+ const original = sessionView(props.result?.structuredContent);
51
+ const error = refreshError ?? (result?.isError ? "Session could not be loaded. Check the Po connection." : result && !view ? "The host returned an invalid session summary." : view && original && view.sessionId !== original.sessionId ? "The session changed. Reopen this widget from the conversation." : void 0);
52
+ const refresh = async () => {
53
+ if (!props.refresh || busy) return;
54
+ setBusy(true);
55
+ setRefreshError(void 0);
56
+ try {
57
+ const next = await props.refresh();
58
+ if (alive.current) setRefreshed(next);
59
+ } catch {
60
+ if (alive.current) setRefreshError("Refresh failed. Check the Po connection, then try again.");
61
+ } finally {
62
+ if (alive.current) setBusy(false);
63
+ }
64
+ };
65
+ return /* @__PURE__ */ jsxs(McpToolFrame, {
66
+ ...props,
67
+ result,
68
+ title: "Po session",
69
+ error,
70
+ phase: error ? "error" : busy ? "running" : props.phase,
71
+ children: [/* @__PURE__ */ jsx("button", {
72
+ type: "button",
73
+ disabled: !props.refresh || !props.result || busy || props.phase === "cancelled",
74
+ onClick: () => {
75
+ refresh();
76
+ },
77
+ className: "rounded-md border border-doom-border bg-doom-panel px-3 py-2 text-base text-doom-text focus-visible:outline disabled:opacity-50",
78
+ children: "Refresh"
79
+ }), view && !error ? /* @__PURE__ */ jsx(McpToolFields, { fields: [
80
+ ["Repository", view.repositoryName],
81
+ ["Session", view.sessionId],
82
+ ["Revision", view.revision],
83
+ ["Profile", view.profile ?? "Default"],
84
+ ["Major mode", view.majorMode],
85
+ ["Domains", view.domains.length ? view.domains : "None"],
86
+ ["Layers", view.layers.length ? view.layers : "None"],
87
+ ["Minor modes", view.minorModes.length ? view.minorModes : "None"]
88
+ ] }) : null]
89
+ });
90
+ }
91
+ //#endregion
92
+ //#region generated/mcp-ui.ts
93
+ const widgets = {
94
+ "@agimon-ai/po-config/load_context": load_context_mcp_default,
95
+ "@agimon-ai/po-config/rename_thread": rename_thread_mcp_default,
96
+ "@agimon-ai/po-config/show_session": defineMcpWidget(ShowSessionMcpWidget)
97
+ };
98
+ //#endregion
99
+ export { widgets };
100
+
101
+ //# sourceMappingURL=mcp-ui.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-ui.mjs","names":["Widget0","Widget1","Widget2"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/load_context.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/rename_thread.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/show_session.mcp.tsx","../../generated/mcp-ui.ts"],"sourcesContent":["import { defineMcpWidget, type DoomMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction LoadContextMcpWidget(props: DoomMcpWidgetProps) {\n return (\n <McpToolFrame {...props} title=\"Load repository context\">\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(LoadContextMcpWidget);\n","import { defineMcpWidget, type DoomMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFields, McpToolFrame, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction RenameThreadMcpWidget(props: DoomMcpWidgetProps) {\n return (\n <McpToolFrame {...props} title=\"Rename thread\">\n <McpToolFields fields={[['Title', props.args.title]]} />\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(RenameThreadMcpWidget);\n","import { defineMcpWidget, type DoomMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFields, McpToolFrame } from '@agimon-ai/po-web-components';\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { SessionView } from '../../../../../types/sessionView';\n\nfunction sessionView(value: unknown): SessionView | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const data = value as Record<string, unknown>;\n if (\n typeof data.sessionId !== 'string' ||\n !data.sessionId ||\n typeof data.repositoryName !== 'string' ||\n typeof data.majorMode !== 'string' ||\n !Number.isSafeInteger(data.revision) ||\n (data.revision as number) < 0 ||\n (data.profile !== null && typeof data.profile !== 'string')\n )\n return undefined;\n if (\n !['domains', 'layers', 'minorModes'].every(\n (key) => Array.isArray(data[key]) && data[key].every((item: unknown) => typeof item === 'string'),\n )\n )\n return undefined;\n return data as unknown as SessionView;\n}\n\nfunction ShowSessionMcpWidget(props: DoomMcpWidgetProps) {\n const [refreshed, setRefreshed] = useState<DoomMcpWidgetProps['result']>(null);\n const [busy, setBusy] = useState(false);\n const [refreshError, setRefreshError] = useState<string>();\n const alive = useRef(true);\n useEffect(() => {\n alive.current = true;\n return () => {\n alive.current = false;\n };\n }, []);\n const result = refreshed ?? props.result;\n const view = sessionView(result?.structuredContent);\n const original = sessionView(props.result?.structuredContent);\n const error =\n refreshError ??\n (result?.isError\n ? 'Session could not be loaded. Check the Po connection.'\n : result && !view\n ? 'The host returned an invalid session summary.'\n : view && original && view.sessionId !== original.sessionId\n ? 'The session changed. Reopen this widget from the conversation.'\n : undefined);\n const refresh = async (): Promise<void> => {\n if (!props.refresh || busy) return;\n setBusy(true);\n setRefreshError(undefined);\n try {\n const next = await props.refresh();\n if (alive.current) setRefreshed(next);\n } catch {\n if (alive.current) setRefreshError('Refresh failed. Check the Po connection, then try again.');\n } finally {\n if (alive.current) setBusy(false);\n }\n };\n return (\n <McpToolFrame\n {...props}\n result={result}\n title=\"Po session\"\n error={error}\n phase={error ? 'error' : busy ? 'running' : props.phase}\n >\n <button\n type=\"button\"\n disabled={!props.refresh || !props.result || busy || props.phase === 'cancelled'}\n onClick={() => {\n void refresh();\n }}\n className=\"rounded-md border border-doom-border bg-doom-panel px-3 py-2 text-base text-doom-text focus-visible:outline disabled:opacity-50\"\n >\n Refresh\n </button>\n {view && !error ? (\n <McpToolFields\n fields={[\n ['Repository', view.repositoryName],\n ['Session', view.sessionId],\n ['Revision', view.revision],\n ['Profile', view.profile ?? 'Default'],\n ['Major mode', view.majorMode],\n ['Domains', view.domains.length ? view.domains : 'None'],\n ['Layers', view.layers.length ? view.layers : 'None'],\n ['Minor modes', view.minorModes.length ? view.minorModes : 'None'],\n ]}\n />\n ) : null}\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(ShowSessionMcpWidget);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport type { ComponentType } from 'react';\nimport type { DoomMcpWidgetProps } from '@agimon-ai/po-core/mcpWidget';\nimport Widget0 from \"../src/extensions/workspaces/sessions/(frontend)/tool/load_context.mcp\";\nimport Widget1 from \"../src/extensions/workspaces/sessions/(frontend)/tool/rename_thread.mcp\";\nimport Widget2 from \"../src/extensions/workspaces/sessions/(frontend)/tool/show_session.mcp\";\n\nexport const widgets: Readonly<Record<string, ComponentType<DoomMcpWidgetProps>>> = {\n \"@agimon-ai/po-config/load_context\": Widget0,\n \"@agimon-ai/po-config/rename_thread\": Widget1,\n \"@agimon-ai/po-config/show_session\": Widget2,\n};\n"],"mappings":";;;;;AAGA,SAAS,qBAAqB,OAA2B;CACvD,OACE,oBAAC,cAAD;EAAc,GAAI;EAAO,OAAM;EAC7B,UAAA,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA;CAC1B,CAAA;AAElB;AAEA,IAAA,2BAAe,gBAAgB,oBAAoB;;;ACRnD,SAAS,sBAAsB,OAA2B;CACxD,OACE,qBAAC,cAAD;EAAc,GAAI;EAAO,OAAM;EAA/B,UAAA,CACE,oBAAC,eAAD,EAAe,QAAQ,CAAC,CAAC,SAAS,MAAM,KAAK,KAAK,CAAC,EAAI,CAAA,GACvD,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA,CAC1B;;AAElB;AAEA,IAAA,4BAAe,gBAAgB,qBAAqB;;;ACNpD,SAAS,YAAY,OAAyC;CAC5D,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,OAAO;CACb,IACE,OAAO,KAAK,cAAc,YAC1B,CAAC,KAAK,aACN,OAAO,KAAK,mBAAmB,YAC/B,OAAO,KAAK,cAAc,YAC1B,CAAC,OAAO,cAAc,KAAK,QAAQ,KAClC,KAAK,WAAsB,KAC3B,KAAK,YAAY,QAAQ,OAAO,KAAK,YAAY,UAElD,OAAO,KAAA;CACT,IACE,CAAC;EAAC;EAAW;EAAU;CAAY,CAAC,C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AC,QACR,oBAAC,eAAD,EACE,QAAQ;GACN,CAAC,cAAc,KAAK,cAAc;GAClC,CAAC,WAAW,KAAK,SAAS;GAC1B,CAAC,YAAY,KAAK,QAAQ;GAC1B,CAAC,WAAW,KAAK,WAAW,SAAS;GACrC,CAAC,cAAc,KAAK,SAAS;GAC7B,CAAC,WAAW,KAAK,QAAQ,SAAS,KAAK,UAAU,MAAM;GACvD,CAAC,UAAU,KAAK,OAAO,SAAS,KAAK,SAAS,MAAM;GACpD,CAAC,eAAe,KAAK,WAAW,SAAS,KAAK,aAAa,MAAM;EACnE,EACD,CAAA,IACC,IACQ;;AAElB;;;AC3FA,MAAa,UAAuE;CAClF,qCAAqCA;CACrC,sCAAsCC;CACtC,qCD0Fa,gBAAgB,oBC1FQC;AACvC"}
@@ -0,0 +1,171 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ let _agimon_ai_po_core_mcpFacet = require("@agimon-ai/po-core/mcpFacet");
6
+ let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
7
+ let typebox = require("typebox");
8
+ //#region src/extensions/workspaces/sessions/(backend)/skill/po-author-config.mcp.ts
9
+ var po_author_config_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpSkill)({
10
+ name: "po-author-config",
11
+ description: "Configure Po runtime settings, source precedence, and typed session configuration. Use for config.yaml, the doom/config Cordis service, immutable context snapshots, or shared selection transition state. Do not use for defining modes.yaml, domains.yaml, or profiles.yaml.",
12
+ read: () => (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-author-config/SKILL.md")
13
+ });
14
+ //#endregion
15
+ //#region src/schemas/mcpContextTools.ts
16
+ const loadContextParameters = typebox.Type.Object({}, { additionalProperties: false });
17
+ const renameThreadParameters = typebox.Type.Object({ title: typebox.Type.String({
18
+ minLength: 1,
19
+ maxLength: 256
20
+ }) }, { additionalProperties: false });
21
+ //#endregion
22
+ //#region src/schemas/mcpSessionView.ts
23
+ const sessionViewSchema = typebox.Type.Object({
24
+ sessionId: typebox.Type.String(),
25
+ revision: typebox.Type.Integer({ minimum: 0 }),
26
+ repositoryName: typebox.Type.String(),
27
+ profile: typebox.Type.Union([typebox.Type.String(), typebox.Type.Null()]),
28
+ majorMode: typebox.Type.String(),
29
+ domains: typebox.Type.Array(typebox.Type.String()),
30
+ layers: typebox.Type.Array(typebox.Type.String()),
31
+ minorModes: typebox.Type.Array(typebox.Type.String())
32
+ }, { additionalProperties: false });
33
+ //#endregion
34
+ //#region src/services/mcpContextTools/index.ts
35
+ function createLoadContextTool(context) {
36
+ return {
37
+ name: "load_context",
38
+ label: "Load context",
39
+ description: "Call at the beginning of a session, and after changing profile or modes, to load repository instructions and current session context.",
40
+ parameters: loadContextParameters,
41
+ annotations: {
42
+ readOnlyHint: true,
43
+ destructiveHint: false,
44
+ openWorldHint: false
45
+ },
46
+ async execute() {
47
+ const snapshot = context.loadContext();
48
+ return {
49
+ content: [{
50
+ type: "text",
51
+ text: JSON.stringify(snapshot)
52
+ }],
53
+ structuredContent: { ...snapshot }
54
+ };
55
+ }
56
+ };
57
+ }
58
+ function createRenameThreadTool(context) {
59
+ return {
60
+ name: "rename_thread",
61
+ label: "Rename thread",
62
+ description: "Rename the current Po conversation so its purpose is clear in the workspace session list.",
63
+ parameters: renameThreadParameters,
64
+ annotations: {
65
+ readOnlyHint: false,
66
+ destructiveHint: false,
67
+ openWorldHint: false
68
+ },
69
+ async execute(_toolCallId, { title }) {
70
+ const next = title.trim();
71
+ if (!next) throw new Error("Thread title cannot be empty.");
72
+ if (context.execution.session.setName === void 0) throw new Error("Session rename is unavailable.");
73
+ await context.execution.session.setName(next);
74
+ return { content: [{
75
+ type: "text",
76
+ text: `Renamed thread to "${next}".`
77
+ }] };
78
+ }
79
+ };
80
+ }
81
+ function createShowSessionTool(context) {
82
+ return {
83
+ name: "show_session",
84
+ label: "Show session",
85
+ description: "Show or refresh a read-only summary of the current Po session. Does not load repository instructions.",
86
+ parameters: loadContextParameters,
87
+ outputSchema: { ...sessionViewSchema },
88
+ annotations: {
89
+ readOnlyHint: true,
90
+ destructiveHint: false,
91
+ openWorldHint: false
92
+ },
93
+ _meta: {
94
+ ui: { visibility: ["model", "app"] },
95
+ "openai/toolInvocation/invoking": "Loading session",
96
+ "openai/toolInvocation/invoked": "Session ready"
97
+ },
98
+ async execute() {
99
+ const snapshot = context.loadContext();
100
+ const view = {
101
+ sessionId: snapshot.session.id,
102
+ revision: snapshot.session.revision,
103
+ repositoryName: snapshot.repository.root.replaceAll("\\", "/").split("/").filter(Boolean).at(-1) ?? "Repository",
104
+ profile: snapshot.selection.profile,
105
+ majorMode: snapshot.selection.majorMode,
106
+ domains: [...snapshot.selection.domains],
107
+ layers: [...snapshot.selection.activeLayers],
108
+ minorModes: [...snapshot.selection.minorModes ?? []]
109
+ };
110
+ return {
111
+ content: [{
112
+ type: "text",
113
+ text: [
114
+ `Po session: ${view.sessionId} (revision ${view.revision})`,
115
+ `Repository: ${view.repositoryName}`,
116
+ `Profile: ${view.profile ?? "Default"}`,
117
+ `Major mode: ${view.majorMode}`,
118
+ `Domains: ${view.domains.join(", ") || "None"}`,
119
+ `Layers: ${view.layers.join(", ") || "None"}`,
120
+ `Minor modes: ${view.minorModes.join(", ") || "None"}`
121
+ ].join("\n")
122
+ }],
123
+ structuredContent: { ...view },
124
+ _meta: { widgetType: "session" }
125
+ };
126
+ }
127
+ };
128
+ }
129
+ //#endregion
130
+ //#region src/extensions/workspaces/sessions/(backend)/tool/load_context.mcp.ts
131
+ var load_context_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpTool)((context) => createLoadContextTool(context));
132
+ //#endregion
133
+ //#region src/extensions/workspaces/sessions/(backend)/tool/rename_thread.mcp.ts
134
+ var rename_thread_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpTool)((context) => createRenameThreadTool(context));
135
+ //#endregion
136
+ //#region src/extensions/workspaces/sessions/(backend)/tool/show_session.mcp.ts
137
+ var show_session_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpTool)((context) => createShowSessionTool(context));
138
+ //#endregion
139
+ //#region generated/mcp.ts
140
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
141
+ const via = (identity, value) => value === void 0 ? void 0 : {
142
+ ...identity,
143
+ ...value
144
+ };
145
+ const withWidget = (key, value) => value === void 0 ? value : {
146
+ ...value,
147
+ _meta: {
148
+ ...value._meta,
149
+ ["po/widget"]: key
150
+ }
151
+ };
152
+ const mcp = (0, _agimon_ai_po_core_mcpFacet.defineMcpPlugin)({
153
+ name: "@agimon-ai/po-config",
154
+ session: (context) => ({
155
+ get skills() {
156
+ return [at(po_author_config_mcp_default, context)];
157
+ },
158
+ get tools() {
159
+ return [
160
+ withWidget("@agimon-ai/po-config/load_context", via({ name: "load_context" }, at(load_context_mcp_default, context))),
161
+ withWidget("@agimon-ai/po-config/rename_thread", via({ name: "rename_thread" }, at(rename_thread_mcp_default, context))),
162
+ withWidget("@agimon-ai/po-config/show_session", via({ name: "show_session" }, at(show_session_mcp_default, context)))
163
+ ];
164
+ }
165
+ })
166
+ });
167
+ //#endregion
168
+ exports.default = mcp;
169
+ exports.mcp = mcp;
170
+
171
+ //# sourceMappingURL=mcp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","Type","Type","defineMcpTool","defineMcpTool","defineMcpTool","defineMcpPlugin","skillPoAuthorConfig","toolLoadContext","toolRenameThread","toolShowSession"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-author-config.mcp.ts","../../src/schemas/mcpContextTools.ts","../../src/schemas/mcpSessionView.ts","../../src/services/mcpContextTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/load_context.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/rename_thread.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/show_session.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-author-config',\n description:\n 'Configure Po runtime settings, source precedence, and typed session configuration. Use for config.yaml, the doom/config Cordis service, immutable context snapshots, or shared selection transition state. Do not use for defining modes.yaml, domains.yaml, or profiles.yaml.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-author-config/SKILL.md'),\n});\n","import { Type } from 'typebox';\n\nexport const loadContextParameters = Type.Object({}, { additionalProperties: false });\nexport const renameThreadParameters = Type.Object(\n { title: Type.String({ minLength: 1, maxLength: 256 }) },\n { additionalProperties: false },\n);\n","import { Type } from 'typebox';\n\nexport const sessionViewSchema = Type.Object(\n {\n sessionId: Type.String(),\n revision: Type.Integer({ minimum: 0 }),\n repositoryName: Type.String(),\n profile: Type.Union([Type.String(), Type.Null()]),\n majorMode: Type.String(),\n domains: Type.Array(Type.String()),\n layers: Type.Array(Type.String()),\n minorModes: Type.Array(Type.String()),\n },\n { additionalProperties: false },\n);\n","import type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { loadContextParameters, renameThreadParameters } from '../../schemas/mcpContextTools';\nimport { sessionViewSchema } from '../../schemas/mcpSessionView';\nimport type { SessionView } from '../../types/sessionView';\n\nexport function createLoadContextTool(context: DoomMcpPluginContext): DoomHeadlessTool<typeof loadContextParameters> {\n return {\n // web-plugin-tool-renderers: ignore load_context (remote MCP only)\n name: 'load_context',\n label: 'Load context',\n description:\n 'Call at the beginning of a session, and after changing profile or modes, to load repository instructions and current session context.',\n parameters: loadContextParameters,\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n async execute() {\n const snapshot = context.loadContext();\n return { content: [{ type: 'text', text: JSON.stringify(snapshot) }], structuredContent: { ...snapshot } };\n },\n };\n}\n\nexport function createRenameThreadTool(context: DoomMcpPluginContext): DoomHeadlessTool<typeof renameThreadParameters> {\n return {\n // web-plugin-tool-renderers: ignore rename_thread (remote MCP only)\n name: 'rename_thread',\n label: 'Rename thread',\n description: 'Rename the current Po conversation so its purpose is clear in the workspace session list.',\n parameters: renameThreadParameters,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },\n async execute(_toolCallId, { title }) {\n const next = title.trim();\n if (!next) throw new Error('Thread title cannot be empty.');\n if (context.execution.session.setName === undefined) throw new Error('Session rename is unavailable.');\n await context.execution.session.setName(next);\n return { content: [{ type: 'text', text: `Renamed thread to \"${next}\".` }] };\n },\n };\n}\n\nexport function createShowSessionTool(context: DoomMcpPluginContext): DoomHeadlessTool<typeof loadContextParameters> {\n return {\n // web-plugin-tool-renderers: ignore show_session (remote MCP only)\n name: 'show_session',\n label: 'Show session',\n description:\n 'Show or refresh a read-only summary of the current Po session. Does not load repository instructions.',\n parameters: loadContextParameters,\n outputSchema: { ...sessionViewSchema },\n annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },\n _meta: {\n ui: { visibility: ['model', 'app'] },\n 'openai/toolInvocation/invoking': 'Loading session',\n 'openai/toolInvocation/invoked': 'Session ready',\n },\n async execute() {\n const snapshot = context.loadContext();\n const view: SessionView = {\n sessionId: snapshot.session.id,\n revision: snapshot.session.revision,\n repositoryName:\n snapshot.repository.root.replaceAll('\\\\', '/').split('/').filter(Boolean).at(-1) ?? 'Repository',\n profile: snapshot.selection.profile,\n majorMode: snapshot.selection.majorMode,\n domains: [...snapshot.selection.domains],\n layers: [...snapshot.selection.activeLayers],\n minorModes: [...(snapshot.selection.minorModes ?? [])],\n };\n const text = [\n `Po session: ${view.sessionId} (revision ${view.revision})`,\n `Repository: ${view.repositoryName}`,\n `Profile: ${view.profile ?? 'Default'}`,\n `Major mode: ${view.majorMode}`,\n `Domains: ${view.domains.join(', ') || 'None'}`,\n `Layers: ${view.layers.join(', ') || 'None'}`,\n `Minor modes: ${view.minorModes.join(', ') || 'None'}`,\n ].join('\\n');\n return { content: [{ type: 'text', text }], structuredContent: { ...view }, _meta: { widgetType: 'session' } };\n },\n };\n}\n","import { defineMcpTool, type DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createLoadContextTool } from '../../../../../services/mcpContextTools';\n\nexport default defineMcpTool((context: DoomMcpPluginContext) => createLoadContextTool(context));\n","import { defineMcpTool, type DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createRenameThreadTool } from '../../../../../services/mcpContextTools';\n\nexport default defineMcpTool((context: DoomMcpPluginContext) => createRenameThreadTool(context));\n","import { defineMcpTool, type DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createShowSessionTool } from '../../../../../services/mcpContextTools';\n\nexport default defineMcpTool((context: DoomMcpPluginContext) => createShowSessionTool(context));\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoAuthorConfig from '../src/extensions/workspaces/sessions/(backend)/skill/po-author-config.mcp';\nimport toolLoadContext from '../src/extensions/workspaces/sessions/(backend)/tool/load_context.mcp';\nimport toolRenameThread from '../src/extensions/workspaces/sessions/(backend)/tool/rename_thread.mcp';\nimport toolShowSession from '../src/extensions/workspaces/sessions/(backend)/tool/show_session.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"po/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-config',\n session: (context) => ({\n get skills(): DoomMcpSessionPlugin['skills'] { return [at(skillPoAuthorConfig, context)]; },\n get tools(): DoomMcpSessionPlugin['tools'] { return [withWidget(\"@agimon-ai/po-config/load_context\", via({ name: 'load_context' }, at(toolLoadContext, context))), withWidget(\"@agimon-ai/po-config/rename_thread\", via({ name: 'rename_thread' }, at(toolRenameThread, context))), withWidget(\"@agimon-ai/po-config/show_session\", via({ name: 'show_session' }, at(toolShowSession, context)))]; },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;;AAGA,IAAA,gCAAA,GAAeA,4BAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aACE;CACF,aAAA,GAAYC,+BAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,uCAAuC;AAC1F,CAAC;;;ACND,MAAa,wBAAwBC,QAAAA,KAAK,OAAO,CAAC,GAAG,EAAE,sBAAsB,MAAM,CAAC;AACpF,MAAa,yBAAyBA,QAAAA,KAAK,OACzC,EAAE,OAAOA,QAAAA,KAAK,OAAO;CAAE,WAAW;CAAG,WAAW;AAAI,CAAC,EAAE,GACvD,EAAE,sBAAsB,MAAM,CAChC;;;ACJA,MAAa,oBAAoBC,QAAAA,KAAK,OACpC;CACE,WAAWA,QAAAA,KAAK,OAAO;CACvB,UAAUA,QAAAA,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC;CACrC,gBAAgBA,QAAAA,KAAK,OAAO;CAC5B,SAASA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,OAAO,GAAGA,QAAAA,KAAK,KAAK,CAAC,CAAC;CAChD,WAAWA,QAAAA,KAAK,OAAO;CACvB,SAASA,QAAAA,KAAK,MAAMA,QAAAA,KAAK,OAAO,CAAC;CACjC,QAAQA,QAAAA,KAAK,MAAMA,QAAAA,KAAK,OAAO,CAAC;CAChC,YAAYA,QAAAA,KAAK,MAAMA,QAAAA,KAAK,OAAO,CAAC;AACtC,GACA,EAAE,sBAAs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A6B;GAAQ,cAAc;CAAI;AAChF;AAEA,MAAa,OAAA,GAAMC,4BAAAA,gBAAAA,CAAgB;CACjC,MAAM;CACN,UAAU,aAAa;EACrB,IAAI,SAAyC;GAAE,OAAO,CAAC,GAAGC,8BAAqB,OAAO,CAAC;EAAG;EAC1F,IAAI,QAAuC;GAAE,OAAO;IAAC,WAAW,qCAAqC,IAAI,EAAE,MAAM,eAAe,GAAG,GAAGC,0BAAiB,OAAO,CAAC,CAAC;IAAG,WAAW,sCAAsC,IAAI,EAAE,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;IAAG,WAAW,qCAAqC,IAAI,EAAE,MAAM,eAAe,GAAG,GAAGC,0BAAiB,OAAO,CAAC,CAAC;GAAC;EAAG;CACrY;AACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ //#region generated/mcp.d.ts
2
+ export declare const mcp: import("@agimon-ai/po-core/mcpFacet").DoomMcpPluginDefinition;
3
+ //#endregion
4
+ export { mcp as default };
5
+ //# sourceMappingURL=mcp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.mts","names":[],"sources":["../../generated/mcp.ts"],"mappings":";qBAkBa,2CAAG"}