@agimon-ai/po-domain 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.
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/apiContracts.cjs +17 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +13 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/apply.cjs +76 -0
- package/dist/apply.cjs.map +1 -0
- package/dist/apply.d.mts +23 -0
- package/dist/apply.d.mts.map +1 -0
- package/dist/apply.mjs +72 -0
- package/dist/apply.mjs.map +1 -0
- package/dist/domainText-Dm8k7p4z.mjs +97 -0
- package/dist/domainText-Dm8k7p4z.mjs.map +1 -0
- package/dist/domainText-UIRIz6-_.cjs +204 -0
- package/dist/domainText-UIRIz6-_.cjs.map +1 -0
- package/dist/extensions/mcp.cjs +26 -0
- package/dist/extensions/mcp.cjs.map +1 -0
- package/dist/extensions/mcp.d.mts +5 -0
- package/dist/extensions/mcp.d.mts.map +1 -0
- package/dist/extensions/mcp.mjs +21 -0
- package/dist/extensions/mcp.mjs.map +1 -0
- package/dist/extensions/server.cjs +229 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +221 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +26 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.mts +84 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/mcp.cjs +32 -0
- package/dist/mcp.cjs.map +1 -0
- package/dist/mcp.d.mts +52 -0
- package/dist/mcp.d.mts.map +1 -0
- package/dist/mcp.mjs +19 -0
- package/dist/mcp.mjs.map +1 -0
- package/dist/mcpFilter-CZNmU_VF.cjs +189 -0
- package/dist/mcpFilter-CZNmU_VF.cjs.map +1 -0
- package/dist/mcpFilter-Cf-czy8O.mjs +151 -0
- package/dist/mcpFilter-Cf-czy8O.mjs.map +1 -0
- package/dist/pluginMaterializer-C8IZ1PSY.cjs +267 -0
- package/dist/pluginMaterializer-C8IZ1PSY.cjs.map +1 -0
- package/dist/pluginMaterializer-D9-oDF-b.mjs +259 -0
- package/dist/pluginMaterializer-D9-oDF-b.mjs.map +1 -0
- package/dist/plugins.cjs +3 -0
- package/dist/plugins.d.mts +14 -0
- package/dist/plugins.d.mts.map +1 -0
- package/dist/plugins.mjs +2 -0
- package/dist/resourceCollector-CRY5cmeY.mjs +773 -0
- package/dist/resourceCollector-CRY5cmeY.mjs.map +1 -0
- package/dist/resourceCollector-Cu-lp5hJ.cjs +837 -0
- package/dist/resourceCollector-Cu-lp5hJ.cjs.map +1 -0
- package/dist/resources-BEjxE3Zn.d.mts +66 -0
- package/dist/resources-BEjxE3Zn.d.mts.map +1 -0
- package/dist/resources.cjs +12 -0
- package/dist/resources.d.mts +43 -0
- package/dist/resources.d.mts.map +1 -0
- package/dist/resources.mjs +2 -0
- package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
- package/dist/toolNames-Ckp5VLMD.mjs +43 -0
- package/dist/toolNames-Ckp5VLMD.mjs.map +1 -0
- package/dist/toolNames-Cuu-u8r1.cjs +48 -0
- package/dist/toolNames-Cuu-u8r1.cjs.map +1 -0
- package/llms.txt +12 -0
- package/package.json +158 -0
- package/src/prompts/po-author-domain/SKILL.md +18 -0
- package/src/prompts/po-author-domain/references/domains-contract.md +165 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceCollector-CRY5cmeY.mjs","names":[],"sources":["../src/services/skillCacheLocation/index.ts","../src/services/resourceCollector/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { poHomeDirectory } from '@agimon-ai/po-core/piSettings';\n\nconst SYNC_DIRECTORY = 'sync';\nconst WORKTREES_DIRECTORY = 'worktrees';\nconst SKILL_CACHE_SEGMENTS = ['cache', 'skills'];\nconst GIT_DIRECTORY = '.git';\nconst COMMON_DIRECTORY_FILE = 'commondir';\nconst IDENTITY_HEX_LENGTH = 32;\nconst LABEL_MAX_LENGTH = 48;\nconst DEFAULT_REPOSITORY_LABEL = 'repo';\nconst DEFAULT_WORKTREE_LABEL = 'worktree';\n\n/**\n * The home-scoped skill manifest cache for one worktree.\n *\n * This mirrors the namespace the Po launcher publishes into, so a session\n * that stages resources through the launcher and one that stages them through a\n * `/domains` switch hit the same manifests instead of rescanning every tree.\n * Two worktrees of one repository stay separate, and a checkout reached through\n * a symlink resolves to the same identity as the real path.\n */\nexport function resolveSkillCacheDirectory(repositoryRoot: string, homeDirectory: string = os.homedir()): string {\n const root = canonicalPath(repositoryRoot);\n const commonDirectory = gitCommonDirectory(root);\n const repositoryToken = commonDirectory ? `git:${commonDirectory}` : `root:${root}`;\n const repositoryId = identityHash(repositoryToken);\n const worktreeId = identityHash(`${repositoryToken}\\0worktree:${root}`);\n const repoLabel = repositoryLabel(commonDirectory, root);\n const worktreeLabel = sanitizeSyncLabel(path.basename(root), DEFAULT_WORKTREE_LABEL);\n return path.join(\n poHomeDirectory(path.resolve(homeDirectory)),\n SYNC_DIRECTORY,\n `${repoLabel}--${repositoryId}`,\n WORKTREES_DIRECTORY,\n `${worktreeLabel}--${worktreeId}`,\n ...SKILL_CACHE_SEGMENTS,\n );\n}\n\nfunction canonicalPath(target: string): string {\n const absolute = path.resolve(target);\n try {\n return fs.realpathSync.native(absolute);\n } catch {\n return absolute;\n }\n}\n\nfunction readGitDirectory(repositoryRoot: string): string | undefined {\n const gitPath = path.join(repositoryRoot, GIT_DIRECTORY);\n try {\n const stat = fs.statSync(gitPath);\n if (stat.isDirectory()) return canonicalPath(gitPath);\n if (!stat.isFile()) return undefined;\n const match = /^gitdir:\\s*(.+)$/imu.exec(fs.readFileSync(gitPath, 'utf8').trim());\n return match?.[1] ? canonicalPath(path.resolve(repositoryRoot, match[1].trim())) : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction gitCommonDirectory(repositoryRoot: string): string | undefined {\n const gitDirectory = readGitDirectory(repositoryRoot);\n if (!gitDirectory) return undefined;\n try {\n const relative = fs.readFileSync(path.join(gitDirectory, COMMON_DIRECTORY_FILE), 'utf8').trim();\n return relative ? canonicalPath(path.resolve(gitDirectory, relative)) : gitDirectory;\n } catch {\n return gitDirectory;\n }\n}\n\nfunction identityHash(value: string): string {\n return crypto.createHash('sha256').update(value, 'utf8').digest('hex').slice(0, IDENTITY_HEX_LENGTH);\n}\n\n/** Keeps a repository or worktree name usable as one path segment. */\nexport function sanitizeSyncLabel(value: string, fallback: string): string {\n const normalized = value\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/gu, '')\n .replace(/[^A-Za-z0-9._-]+/gu, '-')\n .replace(/^[._-]+|[._-]+$/gu, '')\n .slice(0, LABEL_MAX_LENGTH)\n .replace(/[._-]+$/gu, '');\n return normalized === '' || normalized === '.' || normalized === '..' ? fallback : normalized;\n}\n\nfunction repositoryLabel(commonDirectory: string | undefined, repositoryRoot: string): string {\n if (!commonDirectory) return sanitizeSyncLabel(path.basename(repositoryRoot), DEFAULT_REPOSITORY_LABEL);\n const base = path.basename(commonDirectory);\n const source = base === GIT_DIRECTORY ? path.basename(path.dirname(commonDirectory)) : base;\n return sanitizeSyncLabel(source, DEFAULT_REPOSITORY_LABEL);\n}\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { normalizeAgentPluginMcpSource } from '@agimon-ai/po-config/agentPluginMcp';\nimport { globalDoomConfigDirectory } from '@agimon-ai/po-config/config';\nimport type { PluginEntry, PluginSkillDiscovery } from '@agimon-ai/po-config/domains';\nimport type { PluginHookSource } from '@agimon-ai/po-config/types';\nimport {\n AGENT_PLUGIN_MCP_SCHEMA_URL,\n DOOM_MCP_PROJECTION_VERSION,\n type DoomMcpProjection,\n type DoomMcpProjectionSource,\n} from '@agimon-ai/po-core/mcpProjection';\nimport { parse, stringify } from 'yaml';\n\nimport type {\n HarnessResourceOptions,\n HarnessResources,\n JsonObject,\n McpResourceOptions,\n NamedResource,\n StagedMcpResources,\n} from '../../types/resources';\nimport { applyMcpAllowlist } from '../mcpFilter';\nimport { resolveSkillCacheDirectory } from '../skillCacheLocation';\nimport { toPiToolName } from '../toolNames';\n\nexport const DISPATCHER_AGENT_NAME = 'agiflow-dispatcher';\nconst DISPATCHER_TOOLS = ['read', 'grep', 'find', 'ls', 'bash', 'launch_workflow', 'list_workflows'];\nconst SKILL_MANIFEST_VERSION = 4;\nconst SKILL_MANIFEST_HASH_LENGTH = 16;\nconst AGENT_PLUGIN_SCHEMA = 'https://agent-plugins.org/schemas/1.0.0/plugin.schema.json';\nconst PLUGIN_DATA_DIRECTORY = 'plugin-data';\n\nfunction isJsonObject(value: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction canonicalJson(value: unknown): string {\n const normalize = (candidate: unknown): unknown => {\n if (Array.isArray(candidate)) return candidate.map(normalize);\n if (!isJsonObject(candidate)) return candidate;\n return Object.fromEntries(\n Object.entries(candidate)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, child]) => [key, normalize(child)]),\n );\n };\n return JSON.stringify(normalize(value));\n}\n\nfunction projectionFingerprint(input: Omit<DoomMcpProjection, 'fingerprint' | 'stagingDirectory'>): string {\n return createHash('sha256').update(canonicalJson(input)).digest('hex');\n}\n\nfunction stablePluginIdentity(entry: PluginEntry): string {\n const source = entry.source;\n const identity =\n source?.type === 'git'\n ? ['git', source.url, source.path ?? '']\n : source?.type === 'npm'\n ? ['npm', source.registry ?? '', source.package]\n : ['local', fs.realpathSync(entry.directory)];\n return createHash('sha256').update(JSON.stringify(identity)).digest('hex');\n}\n\nfunction rootAgentPluginSchema(entry: PluginEntry): string | undefined {\n const manifestPath = path.join(entry.directory, 'plugin.json');\n if (entry.manifest?.path === manifestPath && entry.manifest.agentPluginSchema === AGENT_PLUGIN_SCHEMA) {\n return AGENT_PLUGIN_SCHEMA;\n }\n try {\n const stat = fs.lstatSync(manifestPath);\n if (stat.isSymbolicLink() || !stat.isFile()) return undefined;\n const parsed = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as unknown;\n return isJsonObject(parsed) && parsed.$schema === AGENT_PLUGIN_SCHEMA ? AGENT_PLUGIN_SCHEMA : undefined;\n } catch {\n return undefined;\n }\n}\n\nasync function pluginMcpSource(\n entry: PluginEntry,\n pluginDataRoot: string,\n): Promise<DoomMcpProjectionSource | undefined> {\n if (entry.mcp === false) return undefined;\n const pluginRoot = fs.realpathSync(entry.directory);\n const agentPlugin = rootAgentPluginSchema(entry) === AGENT_PLUGIN_SCHEMA;\n const configPath = path.join(pluginRoot, agentPlugin ? 'mcp.json' : '.mcp.json');\n let stat: fs.Stats;\n try {\n stat = await fs.promises.lstat(configPath);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n if (!stat.isFile() || stat.isSymbolicLink()) return undefined;\n const content = await fs.promises.readFile(configPath);\n const contentDigest = createHash('sha256').update(content).digest('hex');\n const pluginId = stablePluginIdentity(entry);\n const sourceId = `plugin:${pluginId}`;\n if (!agentPlugin) return { sourceId, owner: 'plugin', format: 'native', configPath, contentDigest };\n return {\n sourceId,\n owner: 'plugin',\n format: 'agent-plugin-v1',\n configPath,\n contentDigest,\n pluginId,\n pluginRoot,\n pluginDataDirectory: path.join(pluginDataRoot, pluginId),\n mcpSchemaUrl: AGENT_PLUGIN_MCP_SCHEMA_URL,\n };\n}\n\ninterface SkillManifestFile {\n path: string;\n name: string;\n description?: string;\n digest: string;\n size: number;\n mtimeMs: number;\n ctimeMs: number;\n}\n\ninterface SkillManifestDirectory {\n path: string;\n mtimeMs: number;\n ctimeMs: number;\n}\n\ninterface SkillManifest {\n version: number;\n root: string;\n discovery: PluginSkillDiscovery;\n files: SkillManifestFile[];\n directories: SkillManifestDirectory[];\n}\n\nfunction splitFrontmatter(content: string): { attributes: JsonObject; body: string } {\n const match = content.match(/^---\\r?\\n([\\s\\S]*?)\\r?\\n---\\r?\\n?([\\s\\S]*)$/);\n if (!match) throw new Error('Resource is missing YAML frontmatter');\n return { attributes: parse(match[1]!) as JsonObject, body: match[2] ?? '' };\n}\n\nconst CLAUDE_MODEL_ALIASES: Record<string, string> = {\n sonnet: 'anthropic/claude-sonnet-4-6',\n opus: 'anthropic/claude-opus-4-6',\n haiku: 'anthropic/claude-haiku-4-5',\n};\n\nfunction assertSafeAgentName(name: string): string {\n const trimmed = name.trim();\n if (\n !trimmed ||\n trimmed !== name ||\n trimmed === '.' ||\n trimmed === '..' ||\n trimmed.includes('\\0') ||\n /[\\\\/]/.test(trimmed)\n ) {\n throw new Error(`Unsafe agent name: ${JSON.stringify(name)}`);\n }\n return trimmed;\n}\n\nfunction normalizeClaudeModel(value: unknown): unknown {\n if (typeof value === 'string') return CLAUDE_MODEL_ALIASES[value.toLowerCase()] ?? value;\n if (Array.isArray(value)) return value.map((entry) => normalizeClaudeModel(entry));\n return value;\n}\n\n/** Rewrites a Claude-authored agent definition into the form Pi loads. */\nexport function adaptAgentDefinition(content: string): { name: string; content: string } {\n const { attributes, body } = splitFrontmatter(content);\n const rawName = typeof attributes.name === 'string' ? attributes.name : undefined;\n if (!rawName) throw new Error('Agent definition requires a name');\n const name = assertSafeAgentName(rawName);\n const hasTools = Object.hasOwn(attributes, 'tools');\n const rawTools = Array.isArray(attributes.tools)\n ? attributes.tools.map(String)\n : typeof attributes.tools === 'string'\n ? attributes.tools\n .split(',')\n .map((tool) => tool.trim())\n .filter(Boolean)\n : [];\n const mappedTools = [...new Set(rawTools.map(toPiToolName).filter((tool): tool is string => Boolean(tool)))];\n const converted: JsonObject = {\n ...attributes,\n inheritProjectContext: true,\n inheritSkills: true,\n systemPromptMode: attributes.systemPromptMode ?? 'replace',\n };\n if (hasTools) converted.tools = Array.isArray(attributes.tools) ? mappedTools : mappedTools.join(', ');\n else delete converted.tools;\n if (converted.model !== undefined) converted.model = normalizeClaudeModel(converted.model);\n if (converted.fallbackModels !== undefined) converted.fallbackModels = normalizeClaudeModel(converted.fallbackModels);\n if (converted.memory === 'project' || converted.memory === 'user')\n converted.memory = { scope: converted.memory, path: name };\n else if (\n converted.memory !== undefined &&\n (typeof converted.memory !== 'object' || converted.memory === null || Array.isArray(converted.memory))\n )\n throw new Error('Unsupported memory declaration');\n delete converted.permissionMode;\n return { name, content: `---\\n${stringify(converted).trim()}\\n---\\n\\n${body.trimStart()}` };\n}\n\nfunction skillManifestPath(\n repoRoot: string,\n skillRoot: string,\n discovery: PluginSkillDiscovery,\n cacheDirectory?: string,\n): string {\n const key = createHash('sha256')\n .update(`${path.resolve(skillRoot)}\\0${discovery}`)\n .digest('hex')\n .slice(0, SKILL_MANIFEST_HASH_LENGTH);\n return path.join(cacheDirectory ?? resolveSkillCacheDirectory(repoRoot), `${key}.json`);\n}\n\nfunction fileMatches(previous: SkillManifestFile): boolean {\n try {\n const stat = fs.statSync(previous.path);\n return (\n stat.isFile() &&\n stat.size === previous.size &&\n stat.mtimeMs === previous.mtimeMs &&\n stat.ctimeMs === previous.ctimeMs\n );\n } catch {\n return false;\n }\n}\n\nfunction directoryMatches(previous: SkillManifestDirectory): boolean {\n try {\n const stat = fs.statSync(previous.path);\n return stat.isDirectory() && stat.mtimeMs === previous.mtimeMs && stat.ctimeMs === previous.ctimeMs;\n } catch {\n return false;\n }\n}\n\nfunction readSkillManifest(\n manifestPath: string,\n root: string,\n discovery: PluginSkillDiscovery,\n): SkillManifest | undefined {\n try {\n const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as SkillManifest;\n if (\n manifest.version !== SKILL_MANIFEST_VERSION ||\n manifest.root !== path.resolve(root) ||\n manifest.discovery !== discovery ||\n !Array.isArray(manifest.files) ||\n !Array.isArray(manifest.directories) ||\n !manifest.files.every(fileMatches) ||\n !manifest.directories.every(directoryMatches)\n ) {\n return undefined;\n }\n return manifest;\n } catch {\n return undefined;\n }\n}\n\nfunction writeSkillManifest(manifestPath: string, manifest: SkillManifest): void {\n fs.mkdirSync(path.dirname(manifestPath), { recursive: true, mode: 0o700 });\n const temporary = `${manifestPath}.${process.pid}.${Date.now()}.tmp`;\n fs.writeFileSync(temporary, `${JSON.stringify(manifest, null, 2)}\\n`, { mode: 0o600 });\n try {\n fs.renameSync(temporary, manifestPath);\n } catch (error) {\n fs.rmSync(temporary, { force: true });\n if (!fs.existsSync(manifestPath)) throw error;\n }\n}\n\nasync function pathExists(target: string): Promise<boolean> {\n try {\n await fs.promises.access(target);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function readSkillManifestAsync(\n manifestPath: string,\n root: string,\n discovery: PluginSkillDiscovery,\n): Promise<SkillManifest | undefined> {\n try {\n const manifest = JSON.parse(await fs.promises.readFile(manifestPath, 'utf8')) as SkillManifest;\n if (\n manifest.version !== SKILL_MANIFEST_VERSION ||\n manifest.root !== path.resolve(root) ||\n manifest.discovery !== discovery ||\n !Array.isArray(manifest.files) ||\n !Array.isArray(manifest.directories)\n ) {\n return undefined;\n }\n for (const previous of manifest.files) {\n const stat = await fs.promises.stat(previous.path);\n if (\n !stat.isFile() ||\n stat.size !== previous.size ||\n stat.mtimeMs !== previous.mtimeMs ||\n stat.ctimeMs !== previous.ctimeMs\n ) {\n return undefined;\n }\n }\n for (const previous of manifest.directories) {\n const stat = await fs.promises.stat(previous.path);\n if (!stat.isDirectory() || stat.mtimeMs !== previous.mtimeMs || stat.ctimeMs !== previous.ctimeMs) {\n return undefined;\n }\n }\n return manifest;\n } catch {\n return undefined;\n }\n}\n\nasync function writeSkillManifestAsync(manifestPath: string, manifest: SkillManifest): Promise<void> {\n await fs.promises.mkdir(path.dirname(manifestPath), { recursive: true, mode: 0o700 });\n const temporary = `${manifestPath}.${process.pid}.${Date.now()}.tmp`;\n await fs.promises.writeFile(temporary, `${JSON.stringify(manifest, null, 2)}\\n`, { mode: 0o600 });\n try {\n await fs.promises.rename(temporary, manifestPath);\n } catch (error) {\n await fs.promises.rm(temporary, { force: true });\n if (!(await pathExists(manifestPath))) throw error;\n }\n}\n\n/**\n * A directory entry resolved through any symlink, or undefined for a broken one.\n *\n * `readdir` reports symlinks with lstat semantics, so a symlinked skill\n * directory answers false to both `isDirectory()` and `isFile()` and would be\n * skipped by a naive branch. Pi stats through the link instead\n * (dist/core/skills.js:171-183) and treats a failing stat as a broken link to\n * skip, which is what keeps a shared skill published as a symlink visible.\n */\nfunction resolveEntryKind(entry: fs.Dirent, candidate: string): { directory: boolean; file: boolean } | undefined {\n if (!entry.isSymbolicLink()) return { directory: entry.isDirectory(), file: entry.isFile() };\n try {\n const stat = fs.statSync(candidate);\n return { directory: stat.isDirectory(), file: stat.isFile() };\n } catch {\n return undefined;\n }\n}\n\nasync function resolveEntryKindAsync(\n entry: fs.Dirent,\n candidate: string,\n): Promise<{ directory: boolean; file: boolean } | undefined> {\n if (!entry.isSymbolicLink()) return { directory: entry.isDirectory(), file: entry.isFile() };\n try {\n const stat = await fs.promises.stat(candidate);\n return { directory: stat.isDirectory(), file: stat.isFile() };\n } catch {\n return undefined;\n }\n}\n\n/**\n * The skill's declared name, or the name of the directory holding it.\n *\n * Pi falls back to the containing directory rather than rejecting the file\n * (dist/core/skills.js:245). Rejecting is worse than one missing skill here:\n * this walk feeds the whole resource collection, so a single unnamed SKILL.md\n * from a third-party plugin would fail session launch outright rather than\n * degrade.\n */\nfunction skillName(filePath: string, attributes: JsonObject): string {\n const declared = typeof attributes.name === 'string' ? attributes.name.trim() : '';\n if (declared) return declared;\n const fallback = path.basename(path.dirname(filePath));\n if (!fallback) throw new Error(`Resource requires a name: ${filePath}`);\n return fallback;\n}\n\nfunction scanSkillManifest(root: string, discovery: PluginSkillDiscovery): SkillManifest {\n const directories: SkillManifestDirectory[] = [];\n const files: SkillManifestFile[] = [];\n // Following symlinks makes a cycle reachable, and this walk records every\n // directory it visits, so an unguarded cycle would exhaust the stack and the\n // manifest together. Real paths are what a cycle repeats.\n const visited = new Set<string>();\n const walk = (directory: string, depth: number): void => {\n if (!fs.existsSync(directory)) return;\n const realDirectory = fs.realpathSync(directory);\n if (visited.has(realDirectory)) return;\n visited.add(realDirectory);\n const directoryStat = fs.statSync(directory);\n directories.push({ path: directory, mtimeMs: directoryStat.mtimeMs, ctimeMs: directoryStat.ctimeMs });\n for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {\n const candidate = path.join(directory, entry.name);\n const kind = resolveEntryKind(entry, candidate);\n if (!kind) continue;\n if (kind.directory) {\n if (discovery === 'recursive' || depth === 0) walk(candidate, depth + 1);\n continue;\n }\n if (!kind.file || entry.name !== 'SKILL.md' || (discovery === 'direct-children' && depth !== 1)) {\n continue;\n }\n const content = fs.readFileSync(candidate, 'utf8');\n const { attributes } = splitFrontmatter(content);\n const stat = fs.statSync(candidate);\n files.push({\n path: candidate,\n name: skillName(candidate, attributes),\n ...(typeof attributes.description === 'string' ? { description: attributes.description.trim() } : {}),\n digest: createHash('sha256').update(content).digest('hex'),\n size: stat.size,\n mtimeMs: stat.mtimeMs,\n ctimeMs: stat.ctimeMs,\n });\n }\n };\n const resolvedRoot = path.resolve(root);\n walk(resolvedRoot, 0);\n files.sort((left, right) => left.path.localeCompare(right.path));\n directories.sort((left, right) => left.path.localeCompare(right.path));\n return { version: SKILL_MANIFEST_VERSION, root: resolvedRoot, discovery, files, directories };\n}\n\n/** Cached skill metadata and exact files, ready for Pi without a second tree walk. */\nexport function discoverSkills(\n repoRoot: string,\n root: string,\n discovery: PluginSkillDiscovery = 'recursive',\n cacheDirectory?: string,\n): NamedResource[] {\n if (!fs.existsSync(root)) return [];\n const manifestPath = skillManifestPath(repoRoot, root, discovery, cacheDirectory);\n const cached = readSkillManifest(manifestPath, root, discovery);\n const manifest = cached ?? scanSkillManifest(root, discovery);\n if (!cached) writeSkillManifest(manifestPath, manifest);\n return manifest.files.map(({ name, path: filePath, description, digest }) => ({\n name,\n path: filePath,\n digest,\n ...(description === undefined ? {} : { description }),\n }));\n}\n\nasync function scanSkillManifestAsync(root: string, discovery: PluginSkillDiscovery): Promise<SkillManifest> {\n const directories: SkillManifestDirectory[] = [];\n const files: SkillManifestFile[] = [];\n const visited = new Set<string>();\n const walk = async (directory: string, depth: number): Promise<void> => {\n let entries: fs.Dirent[];\n try {\n const realDirectory = await fs.promises.realpath(directory);\n if (visited.has(realDirectory)) return;\n visited.add(realDirectory);\n const directoryStat = await fs.promises.stat(directory);\n directories.push({ path: directory, mtimeMs: directoryStat.mtimeMs, ctimeMs: directoryStat.ctimeMs });\n entries = await fs.promises.readdir(directory, { withFileTypes: true });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return;\n throw error;\n }\n for (const entry of entries) {\n const candidate = path.join(directory, entry.name);\n const kind = await resolveEntryKindAsync(entry, candidate);\n if (!kind) continue;\n if (kind.directory) {\n if (discovery === 'recursive' || depth === 0) await walk(candidate, depth + 1);\n continue;\n }\n if (!kind.file || entry.name !== 'SKILL.md' || (discovery === 'direct-children' && depth !== 1)) {\n continue;\n }\n const content = await fs.promises.readFile(candidate, 'utf8');\n const { attributes } = splitFrontmatter(content);\n const stat = await fs.promises.stat(candidate);\n files.push({\n path: candidate,\n name: skillName(candidate, attributes),\n ...(typeof attributes.description === 'string' ? { description: attributes.description.trim() } : {}),\n digest: createHash('sha256').update(content).digest('hex'),\n size: stat.size,\n mtimeMs: stat.mtimeMs,\n ctimeMs: stat.ctimeMs,\n });\n }\n };\n const resolvedRoot = path.resolve(root);\n await walk(resolvedRoot, 0);\n files.sort((left, right) => left.path.localeCompare(right.path));\n directories.sort((left, right) => left.path.localeCompare(right.path));\n return { version: SKILL_MANIFEST_VERSION, root: resolvedRoot, discovery, files, directories };\n}\n\nexport async function discoverSkillsAsync(\n repoRoot: string,\n root: string,\n discovery: PluginSkillDiscovery = 'recursive',\n cacheDirectory?: string,\n): Promise<NamedResource[]> {\n if (!(await pathExists(root))) return [];\n const manifestPath = skillManifestPath(repoRoot, root, discovery, cacheDirectory);\n const cached = await readSkillManifestAsync(manifestPath, root, discovery);\n const manifest = cached ?? (await scanSkillManifestAsync(root, discovery));\n if (!cached) await writeSkillManifestAsync(manifestPath, manifest);\n return manifest.files.map(({ name, path: filePath, description, digest }) => ({\n name,\n path: filePath,\n digest,\n ...(description === undefined ? {} : { description }),\n }));\n}\n\nasync function markdownFilesAsync(directory: string): Promise<string[]> {\n let entries: fs.Dirent[];\n try {\n entries = await fs.promises.readdir(directory, { withFileTypes: true });\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return [];\n throw error;\n }\n const results: string[] = [];\n for (const entry of entries) {\n const candidate = path.join(directory, entry.name);\n if (entry.isDirectory()) results.push(...(await markdownFilesAsync(candidate)));\n if (entry.isFile() && entry.name.endsWith('.md')) results.push(candidate);\n }\n return results;\n}\n\nasync function frontmatterNameAsync(filePath: string): Promise<string> {\n const { attributes } = splitFrontmatter(await fs.promises.readFile(filePath, 'utf8'));\n if (typeof attributes.name !== 'string') throw new Error(`Resource requires a name: ${filePath}`);\n return attributes.name;\n}\n\nasync function assertUniqueAsync(resources: NamedResource[], kind: string): Promise<void> {\n const seen = new Map<string, string>();\n const digestByName = new Map<string, string>();\n for (const resource of resources) {\n const previous = seen.get(resource.name);\n const digest =\n resource.digest ??\n createHash('sha256')\n .update(await fs.promises.readFile(resource.path))\n .digest('hex');\n if (previous && digestByName.get(resource.name) !== digest) {\n throw new Error(`Conflicting ${kind} \"${resource.name}\": ${previous} and ${resource.path}`);\n }\n seen.set(resource.name, resource.path);\n digestByName.set(resource.name, digest);\n }\n}\n\nfunction dispatcherAgentSource(): string {\n const attributes: JsonObject = {\n name: DISPATCHER_AGENT_NAME,\n description: 'Selects and launches Agiflow workflows for one loop pass without implementing the work.',\n thinking: 'high',\n systemPromptMode: 'replace',\n inheritProjectContext: true,\n inheritSkills: true,\n tools: DISPATCHER_TOOLS.join(', '),\n // No feature extension is named here. Team inherits the ordered child\n // composition projected from the selected layers for every helper process.\n defaultContext: 'fresh',\n defaultProgress: false,\n };\n const body = [\n 'You are the Agiflow workflow dispatcher.',\n 'Reason about the supplied dispatch context and launch eligible workflows.',\n 'Launch workflows without monitoring them. After dispatching, report and exit.',\n 'Follow the task restrictions exactly. Do not implement jobs or edit repository files.',\n ].join('\\n');\n return `---\\n${stringify(attributes).trim()}\\n---\\n\\n${body}\\n`;\n}\n\nexport function mergeMcpConfigs(configPaths: string[]): JsonObject {\n const merged: JsonObject = { mcpServers: {} };\n const servers = merged.mcpServers as Record<string, unknown>;\n const sources = new Map<string, string>();\n for (const configPath of configPaths) {\n if (!fs.existsSync(configPath)) continue;\n const config = JSON.parse(fs.readFileSync(configPath, 'utf8')) as JsonObject;\n const incoming = (config.mcpServers ?? {}) as Record<string, unknown>;\n for (const [name, definition] of Object.entries(incoming)) {\n const previous = servers[name];\n if (previous && JSON.stringify(previous) !== JSON.stringify(definition)) {\n throw new Error(`Conflicting MCP server \"${name}\": ${sources.get(name)} and ${configPath}`);\n }\n servers[name] = definition;\n sources.set(name, configPath);\n }\n }\n return merged;\n}\n\nexport async function mergeMcpConfigsAsync(configPaths: string[]): Promise<JsonObject> {\n const merged: JsonObject = { mcpServers: {} };\n const servers = merged.mcpServers as Record<string, unknown>;\n const sources = new Map<string, string>();\n for (const configPath of configPaths) {\n let content: string;\n try {\n content = await fs.promises.readFile(configPath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') continue;\n throw error;\n }\n const config = JSON.parse(content) as JsonObject;\n const incoming = (config.mcpServers ?? {}) as Record<string, unknown>;\n for (const [name, definition] of Object.entries(incoming)) {\n const previous = servers[name];\n if (previous && JSON.stringify(previous) !== JSON.stringify(definition)) {\n throw new Error(`Conflicting MCP server \"${name}\": ${sources.get(name)} and ${configPath}`);\n }\n servers[name] = definition;\n sources.set(name, configPath);\n }\n }\n return merged;\n}\n\nasync function mergeProjectedMcpConfigs(\n sources: readonly DoomMcpProjectionSource[],\n stagingDirectory: string,\n): Promise<JsonObject> {\n const merged: JsonObject = { mcpServers: {} };\n const servers = merged.mcpServers as Record<string, unknown>;\n const origins = new Map<string, string>();\n\n for (const source of sources) {\n let config: JsonObject;\n if (source.format === 'agent-plugin-v1') {\n config = normalizeAgentPluginMcpSource(source, {\n stagingDirectory,\n // The generated file is consumed by external MCP clients. Keep wrapper\n // names there; Doom strips its own in-process wrapper at runtime.\n stripProxyWrappers: false,\n }).claudeConfig;\n } else {\n let content: string;\n try {\n content = await fs.promises.readFile(source.configPath, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') continue;\n throw error;\n }\n config = JSON.parse(content) as JsonObject;\n }\n\n const incoming = (config.mcpServers ?? {}) as Record<string, unknown>;\n for (const [name, definition] of Object.entries(incoming)) {\n const previous = servers[name];\n if (previous && JSON.stringify(previous) !== JSON.stringify(definition)) {\n throw new Error(`Conflicting MCP server \"${name}\": ${origins.get(name)} and ${source.configPath}`);\n }\n servers[name] = definition;\n origins.set(name, source.configPath);\n }\n }\n\n return merged;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n/** Matches a resource name against a subset filter. Undefined keeps everything. */\nfunction keepsName(allowed: string[] | undefined, name: string): boolean {\n if (!allowed) return true;\n return allowed.some((pattern) =>\n pattern.includes('*')\n ? new RegExp(`^${pattern.split('*').map(escapeRegExp).join('.*')}$`).test(name)\n : pattern === name,\n );\n}\n\n/** Stages only the MCP slice shared by Po and compatibility frontends. */\nexport async function stageMcpResources(\n repoRoot: string,\n plugins: Array<string | PluginEntry>,\n options: McpResourceOptions,\n): Promise<StagedMcpResources> {\n const pluginEntries: PluginEntry[] = plugins.map((plugin) =>\n typeof plugin === 'string' ? { directory: plugin } : plugin,\n );\n const pluginMcpConfigPaths: string[] = [];\n const pluginMcpSources: DoomMcpProjectionSource[] = [];\n const mcpSources: DoomMcpProjectionSource[] = [];\n const pluginDataRoot = options.pluginDataRoot ?? path.join(globalDoomConfigDirectory(), PLUGIN_DATA_DIRECTORY);\n const repositoryMcpPath = path.join(repoRoot, '.mcp.json');\n\n await fs.promises.mkdir(options.temporaryDirectory, { mode: 0o700, recursive: true });\n await fs.promises.chmod(options.temporaryDirectory, 0o700);\n if (options.enabled && (await pathExists(repositoryMcpPath))) {\n const content = await fs.promises.readFile(repositoryMcpPath);\n mcpSources.push({\n sourceId: 'repository:.mcp.json',\n owner: 'repository',\n format: 'native',\n configPath: repositoryMcpPath,\n contentDigest: createHash('sha256').update(content).digest('hex'),\n });\n }\n\n if (options.enabled) {\n for (const entry of pluginEntries) {\n const source = await pluginMcpSource(entry, pluginDataRoot);\n if (!source) continue;\n mcpSources.push(source);\n pluginMcpSources.push(source);\n pluginMcpConfigPaths.push(source.configPath);\n }\n }\n\n let mcpConfigPath: string | undefined;\n if (options.enabled) {\n mcpConfigPath = path.join(options.temporaryDirectory, 'mcp.json');\n const merged = await applyMcpAllowlist(\n await mergeProjectedMcpConfigs(mcpSources, options.temporaryDirectory),\n options.mcpAllowlist,\n repoRoot,\n options.temporaryDirectory,\n );\n await fs.promises.writeFile(mcpConfigPath, `${JSON.stringify(merged, null, 2)}\\n`, { mode: 0o600 });\n }\n\n const projectionWithoutRuntimePath = {\n version: DOOM_MCP_PROJECTION_VERSION,\n enabled: options.enabled,\n repoRoot,\n ...(mcpConfigPath ? { generatedConfigPath: mcpConfigPath } : {}),\n sources: options.enabled ? mcpSources : [],\n ...(options.mcpAllowlist ? { allowlist: structuredClone(options.mcpAllowlist) } : {}),\n } satisfies Omit<DoomMcpProjection, 'fingerprint' | 'stagingDirectory'>;\n\n return {\n mcpConfigPath,\n mcpProjection: {\n ...projectionWithoutRuntimePath,\n stagingDirectory: options.temporaryDirectory,\n fingerprint: projectionFingerprint(projectionWithoutRuntimePath),\n },\n pluginMcpSources,\n pluginMcpConfigPaths,\n };\n}\n\n/**\n * Stages every resource the selected domains contribute, ready for one Pi session.\n *\n * The caller owns the returned cleanup(): the temporary directory holding agents\n * and the generated MCP config has to outlive this function and be removed once\n * the session that reads it is done.\n */\nexport async function collectResources(\n repoRoot: string,\n plugins: Array<string | PluginEntry>,\n options: HarnessResourceOptions,\n): Promise<HarnessResources & { skillSources: NamedResource[] }> {\n const pluginEntries: PluginEntry[] = plugins.map((plugin) =>\n typeof plugin === 'string' ? { directory: plugin } : plugin,\n );\n // A caller-supplied directory is owned by the caller: it is either a live\n // session's directory or the synced one, and removing it here would delete\n // resources that outlive this collection.\n const ownsDirectory = options.temporaryDirectory === undefined;\n const temporaryDirectory = options.temporaryDirectory ?? (await fs.promises.mkdtemp(path.join(os.tmpdir(), 'po-')));\n await fs.promises.mkdir(temporaryDirectory, { mode: 0o700, recursive: true });\n await fs.promises.chmod(temporaryDirectory, 0o700);\n const sharedSkills = path.join(repoRoot, '.claude', 'skills');\n // A domain can opt out of the always-on shared skills to keep its context small.\n const sharedSkillSources =\n options.sharedSkills === false\n ? []\n : await discoverSkillsAsync(repoRoot, sharedSkills, 'recursive', options.skillCacheDirectory);\n const skillDirectories: string[] = [];\n const skillSources: NamedResource[] = [];\n const agentSources: Array<{ name: string; path: string }> = [];\n const pluginHooks: PluginHookSource[] = [];\n\n for (const entry of pluginEntries) {\n const pluginDirectory = entry.directory;\n const skills = path.join(pluginDirectory, 'skills');\n if (await pathExists(skills)) {\n const found = (\n await discoverSkillsAsync(repoRoot, skills, entry.skillDiscovery ?? 'recursive', options.skillCacheDirectory)\n ).filter((skill) => keepsName(entry.skills, skill.name));\n // Exact files let Pi skip another recursive traversal and make a plugin\n // subset unambiguous without staging copies of the skill bodies.\n skillDirectories.push(...found.map((skill) => skill.path));\n skillSources.push(...found);\n }\n const agents = path.join(pluginDirectory, 'agents');\n const agentFiles = await markdownFilesAsync(agents);\n const agentNames = await Promise.all(agentFiles.map((filePath) => frontmatterNameAsync(filePath)));\n agentSources.push(\n ...agentFiles\n .map((filePath, index) => ({ name: agentNames[index] ?? '', path: filePath }))\n .filter((agent) => keepsName(entry.agents, agent.name)),\n );\n const hookConfig = path.join(pluginDirectory, 'hooks', 'hooks.json');\n if (entry.hooks !== false && (await pathExists(hookConfig))) {\n pluginHooks.push({ pluginRoot: pluginDirectory, configPath: hookConfig });\n }\n }\n\n await assertUniqueAsync(skillSources, 'skill');\n await assertUniqueAsync(sharedSkillSources, 'skill');\n // Pi keeps the first skill for a duplicated name. Selected domain plugins are\n // authoritative; shared Claude skills remain fallbacks for names no plugin owns.\n const pluginSkillNames = new Set(skillSources.map((skill) => skill.name));\n const fallbackSharedSkills = sharedSkillSources.filter((skill) => !pluginSkillNames.has(skill.name));\n skillDirectories.push(...fallbackSharedSkills.map((skill) => skill.path));\n skillSources.push(...fallbackSharedSkills);\n\n await assertUniqueAsync(agentSources, 'agent');\n if (agentSources.some((source) => source.name === DISPATCHER_AGENT_NAME)) {\n throw new Error(`Conflicting agent \"${DISPATCHER_AGENT_NAME}\": reserved by the agent harness`);\n }\n\n const agentDirectories: string[] = [];\n const outputDirectory = path.join(temporaryDirectory, 'agents');\n await fs.promises.rm(outputDirectory, { recursive: true, force: true });\n if (options.agents) {\n await fs.promises.mkdir(outputDirectory, { mode: 0o700 });\n for (const source of agentSources) {\n const adapted = adaptAgentDefinition(await fs.promises.readFile(source.path, 'utf8'));\n await fs.promises.writeFile(\n path.join(outputDirectory, `${assertSafeAgentName(adapted.name)}.md`),\n adapted.content,\n { mode: 0o600 },\n );\n }\n await fs.promises.writeFile(path.join(outputDirectory, `${DISPATCHER_AGENT_NAME}.md`), dispatcherAgentSource(), {\n mode: 0o600,\n });\n agentDirectories.push(outputDirectory);\n }\n\n const { mcpConfigPath, mcpProjection, pluginMcpSources, pluginMcpConfigPaths } = await stageMcpResources(\n repoRoot,\n pluginEntries,\n {\n enabled: options.mcp,\n temporaryDirectory,\n ...(options.mcpAllowlist ? { mcpAllowlist: options.mcpAllowlist } : {}),\n ...(options.pluginDataRoot ? { pluginDataRoot: options.pluginDataRoot } : {}),\n },\n );\n\n return {\n temporaryDirectory,\n skillDirectories,\n skillSources,\n skillCount: skillSources.length,\n agentCount: agentSources.length,\n agentDirectories,\n pluginHooks,\n mcpConfigPath,\n mcpProjection,\n pluginMcpSources,\n pluginMcpConfigPaths,\n cleanup: () =>\n ownsDirectory ? fs.promises.rm(temporaryDirectory, { recursive: true, force: true }) : Promise.resolve(),\n };\n}\n"],"mappings":";;;;;;;;;;;;AAOA,MAAM,iBAAiB;AACvB,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB,CAAC,SAAS,QAAQ;AAC/C,MAAM,gBAAgB;AACtB,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAC5B,MAAM,mBAAmB;AACzB,MAAM,2BAA2B;AACjC,MAAM,yBAAyB;;;;;;;;;;AAW/B,SAAgB,2BAA2B,gBAAwB,gBAAwB,GAAG,QAAQ,GAAW;CAC/G,MAAM,OAAO,cAAc,cAAc;CACzC,MAAM,kBAAkB,mBAAmB,IAAI;CAC/C,MAAM,kBAAkB,kBAAkB,OAAO,oBAAoB,QAAQ;CAC7E,MAAM,eAAe,aAAa,eAAe;CACjD,MAAM,aAAa,aAAa,GAAG,gBAAgB,aAAa,MAAM;CACtE,MAAM,YAAY,gBAAgB,iBAAiB,IAAI;CACvD,MAAM,gBAAgB,kBAAkB,KAAK,SAAS,IAAI,GAAG,sBAAsB;CACnF,OAAO,KAAK,KACV,gBAAgB,KAAK,QAAQ,aAAa,CAAC,GAC3C,gBACA,GAAG,UAAU,IAAI,gBACjB,qBACA,GAAG,cAAc,IAAI,cACrB,GAAG,oBACL;AACF;AAEA,SAAS,cAAc,QAAwB;CAC7C,MAAM,WAAW,KAAK,QAAQ,MAAM;CACpC,IAAI;EACF,OAAO,GAAG,aAAa,OAAO,QAAQ;CACxC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,iBAAiB,gBAA4C;CACpE,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