var{defineProperty:T,getOwnPropertyNames:z,getOwnPropertyDescriptor:J}=Object,K=Object.prototype.hasOwnProperty;function Q(S){return this[S]}var f=(S)=>{var E=(M??=new WeakMap).get(S),A;if(E)return E;if(E=T({},"__esModule",{value:!0}),S&&typeof S==="object"||typeof S==="function"){for(var N of z(S))if(!K.call(E,N))T(E,N,{get:Q.bind(S,N),enumerable:!(A=J(S,N))||A.enumerable})}return M.set(S,E),E},M;var X=(S)=>S;function Z(S,E){this[S]=X.bind(null,E)}var $=(S,E)=>{for(var A in E)T(S,A,{get:E[A],enumerable:!0,configurable:!0,set:Z.bind(E,A)})};var V=(S,E)=>()=>(S&&(E=S(S=0)),E);var w={};$(w,{groupByToArray:()=>B,groupByMultiple:()=>G,groupBy:()=>R,getUniqueTags:()=>O,getUniqueOwners:()=>U,getUniqueDomains:()=>q,filterBy:()=>h,GroupingStrategies:()=>d});function h(S,E){return S.filter((A)=>{if(E.tags?.length){if(!E.tags.some((H)=>A.meta.tags?.includes(H)))return!1}if(E.owners?.length){if(!E.owners.some((H)=>A.meta.owners?.includes(H)))return!1}if(E.stability?.length){if(!E.stability.includes(A.meta.stability??"stable"))return!1}if(E.domain){if(d.byDomain(A)!==E.domain)return!1}if(E.keyPattern){let N=A.meta.key??A.meta.key??"",H=E.keyPattern.replace(/\*/g,".*").replace(/\?/g,".");if(!new RegExp(`^${H}$`,"i").test(N))return!1}return!0})}function R(S,E){let A=new Map;for(let N of S){let H=E(N),I=A.get(H);if(I)I.push(N);else A.set(H,[N])}return A}function B(S,E){let A=R(S,E);return Array.from(A.entries()).map(([N,H])=>({key:N,items:H}))}function G(S,E){let A=new Map;for(let N of S){let H=E(N);for(let I of H){let x=A.get(I);if(x)x.push(N);else A.set(I,[N])}}return A}function O(S){let E=new Set;for(let A of S)for(let N of A.meta.tags??[])E.add(N);return Array.from(E).sort()}function U(S){let E=new Set;for(let A of S)for(let N of A.meta.owners??[])E.add(N);return Array.from(E).sort()}function q(S){let E=new Set;for(let A of S)E.add(d.byDomain(A));return Array.from(E).sort()}var d;var L=V(()=>{d={byTag:(S)=>S.meta.tags?.[0]??"untagged",byAllTags:(S)=>S.meta.tags?.length?S.meta.tags:["untagged"],byOwner:(S)=>S.meta.owners?.[0]??"unowned",byDomain:(S)=>{return(S.meta.key??S.meta.key??"").split(".")[0]??"default"},byStability:(S)=>S.meta.stability??"stable",byUrlPath:(S)=>(E)=>{if(!E.path)return"root";return E.path.split("/").filter(Boolean).slice(0,S).join("/")||"root"}}});var W={Idea:"idea",InCreation:"in_creation",Experimental:"experimental",Beta:"beta",Stable:"stable",Deprecated:"deprecated"},v={PlatformCore:"platform.core",PlatformSigil:"platform.sigil",PlatformMarketplace:"platform.marketplace",PlatformMessaging:"platform.messaging",PlatformContent:"platform.content",PlatformFeatureFlags:"platform.featureflags",PlatformFinance:"platform.finance"},n=v,a={Spots:"spots",Collectivity:"collectivity",Marketplace:"marketplace",Sellers:"sellers",Auth:"auth",Login:"login",Signup:"signup",Guide:"guide",Docs:"docs",I18n:"i18n",Incident:"incident",Automation:"automation",Hygiene:"hygiene"},y=a;L();import{compareVersions as c}from"compare-versions";var p=(S)=>`${S.meta.key}.v${S.meta.version}`;class D{contractType;items=new Map;constructor(S,E){this.contractType=S;if(E)E.forEach((A)=>this.register(A))}register(S){let E=p(S);if(this.items.has(E))throw Error(`Duplicate contract \`${this.contractType}\` ${E}`);return this.items.set(E,S),this}count(){return this.items.size}list(){return[...this.items.values()]}get(S,E){if(E!=null)return this.items.get(`${S}.v${E}`);let A;for(let[N,H]of this.items.entries()){if(!N.startsWith(`${S}.v`))continue;if(!A||c(H.meta.version,A.meta.version)>0)A=H}return A}has(S,E){return!!this.get(S,E)}filter(S){return h(this.list(),S)}listByTag(S){return this.list().filter((E)=>E.meta.tags?.includes(S))}listByOwner(S){return this.list().filter((E)=>E.meta.owners?.includes(S))}groupBy(S){return R(this.list(),S)}getUniqueTags(){return O(this.list())}}function Y(S){return S}var t=(S,E)=>`${S}.v${E}`;class u extends D{constructor(S){super("event",S)}}var b="harness",C=["platform.harness"],P=[a.Automation,"harness","evidence","evaluation"],j=W.Experimental;import{ScalarTypeEnum as _,SchemaModel as F}from"@contractspec/lib.schema";var l=new F({name:"HarnessEvidenceCapturedPayload",fields:{runId:{type:_.ID(),isOptional:!1},artifactId:{type:_.ID(),isOptional:!1},kind:{type:_.String_unsecure(),isOptional:!1},capturedAt:{type:_.DateTime(),isOptional:!1}}}),HS=Y({meta:{key:"harness.evidence.captured",version:"1.0.0",description:"Emitted when a harness artifact is captured.",domain:b,owners:C,tags:[...P,"evidence"],stability:j},payload:l});export{l as HarnessEvidenceCapturedPayload,HS as HarnessEvidenceCapturedEvent};
