{"version":3,"sources":["../../src/manifest/index.ts"],"names":[],"mappings":";;;;;;;;AAwBO,SAAS,sBAAsB,MAAA,EAAkC;AACtE,EAAA,MAAM,MAAA,GAAS,OAAO,MAAM,CAAA;AAC5B,EAAA,IAAI,OAAO,IAAA,CAAK,MAAA,CAAO,IAAI,CAAA,CAAE,WAAW,CAAA,EAAG;AACzC,IAAA,MAAM,IAAI,MAAM,qDAAqD,CAAA;AAAA,EACvE;AACA,EAAA,MAAM,MAAA,GAAS,yBAAA,CAA0B,SAAA,CAAU,MAAA,CAAO,IAAI,CAAA;AAC9D,EAAA,IAAI,CAAC,OAAO,OAAA,EAAS;AACnB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,kDAAA,EAAgD,OAAO,KAAA,CAAM,MAAA,CAC1D,IAAI,CAAC,CAAA,KAAM,GAAG,CAAA,CAAE,IAAA,CAAK,KAAK,GAAG,CAAC,KAAK,CAAA,CAAE,OAAO,EAAE,CAAA,CAC9C,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,KACf;AAAA,EACF;AACA,EAAA,OAAO,EAAE,WAAA,EAAa,MAAA,CAAO,IAAA,EAAM,IAAA,EAAM,OAAO,OAAA,EAAQ;AAC1D;AAEO,SAAS,qBACd,QAAA,EACgB;AAChB,EAAA,OAAO,cAAA,CAAe,SAAS,WAA4C,CAAA;AAC7E","file":"index.mjs","sourcesContent":["/**\n * AIP-45 AGENT-CLI.md sidecar parser + manifest-to-handle constructor.\n *\n * Mirror of `@agentproto/skill/manifest` and `@agentproto/acp/manifest`:\n * the .md provides metadata; the TS runtime supplies any spec-specific\n * runtime bits. Both inputs end up in `defineAgentCli` so the cross-AIP\n * invariants run uniformly.\n */\n\nimport matter from \"gray-matter\"\nimport {\n  agentCliFrontmatterSchema,\n  type AgentCliFrontmatter,\n} from \"../schema.js\"\nimport { defineAgentCli } from \"../define-agent-cli.js\"\nimport type { AgentCliDefinition, AgentCliHandle } from \"../types.js\"\n\nexport { agentCliFrontmatterSchema, type AgentCliFrontmatter }\n\nexport interface AgentCliManifest {\n  frontmatter: AgentCliFrontmatter\n  body: string\n}\n\nexport function parseAgentCliManifest(source: string): AgentCliManifest {\n  const parsed = matter(source)\n  if (Object.keys(parsed.data).length === 0) {\n    throw new Error(\"parseAgentCliManifest: missing or empty frontmatter\")\n  }\n  const result = agentCliFrontmatterSchema.safeParse(parsed.data)\n  if (!result.success) {\n    throw new Error(\n      `parseAgentCliManifest: invalid frontmatter — ${result.error.issues\n        .map((i) => `${i.path.join(\".\")}: ${i.message}`)\n        .join(\"; \")}`,\n    )\n  }\n  return { frontmatter: result.data, body: parsed.content }\n}\n\nexport function agentCliFromManifest(\n  manifest: AgentCliManifest,\n): AgentCliHandle {\n  return defineAgentCli(manifest.frontmatter as unknown as AgentCliDefinition)\n}\n"]}