import{defineCommand as F,installOp as H}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var J=["@contractspec"],K=["contracts","mcp","adoption"];function b(x,z){let L=k({name:"AdoptionCatalogSearchInput",fields:{query:{type:j.String_unsecure(),isOptional:!1},family:{type:j.String_unsecure(),isOptional:!0},platform:{type:j.String_unsecure(),isOptional:!0}}}),P=k({name:"AdoptionCatalogSearchOutput",fields:{results:{type:j.JSON(),isOptional:!1}}});H(x,F({meta:{key:"adoption.catalog_search",version:"1.0.0",stability:"beta",owners:J,tags:K,description:"Search the local ContractSpec adoption catalog.",goal:"Find relevant ContractSpec reuse candidates for a query.",context:"Contracts MCP server."},io:{input:L,output:P},policy:{auth:"anonymous"}}),async({family:B,platform:w,query:D})=>({results:await z.searchAdoptionCatalog({family:B,platform:w,query:D})}));let Q=k({name:"AdoptionResolveInput",fields:{family:{type:j.String_unsecure(),isOptional:!1},query:{type:j.String_unsecure(),isOptional:!1},paths:{type:j.JSON(),isOptional:!0},platform:{type:j.String_unsecure(),isOptional:!0},runtime:{type:j.String_unsecure(),isOptional:!0}}}),U=k({name:"AdoptionResolveOutput",fields:{resolution:{type:j.JSON(),isOptional:!1}}});H(x,F({meta:{key:"adoption.resolve",version:"1.0.0",stability:"beta",owners:J,tags:K,description:"Resolve the best adoption candidate for one family.",goal:"Provide one ordered recommendation that matches Connect.",context:"Contracts MCP server."},io:{input:Q,output:U},policy:{auth:"anonymous"}}),async({family:B,paths:w,platform:D,query:Y,runtime:Z})=>({resolution:await z.resolveAdoption({family:B,paths:Array.isArray(w)?w:void 0,platform:D,query:Y,runtime:Z})}));let V=k({name:"AdoptionSyncInput",fields:{}}),X=k({name:"AdoptionSyncOutput",fields:{catalogPath:{type:j.String_unsecure(),isOptional:!1},total:{type:j.Int_unsecure(),isOptional:!1}}});H(x,F({meta:{key:"adoption.sync",version:"1.0.0",stability:"beta",owners:J,tags:K,description:"Mirror the bundled ContractSpec adoption catalog locally.",goal:"Refresh the local adoption catalog used by Connect and MCP.",context:"Contracts MCP server."},io:{input:V,output:X},policy:{auth:"user"}}),async()=>z.syncAdoptionCatalog())}export{b as registerAdoptionOps};
