var{defineProperty:_,getOwnPropertyNames:j,getOwnPropertyDescriptor:v}=Object,z=Object.prototype.hasOwnProperty;function J(A){return this[A]}var o=(A)=>{var S=(M??=new WeakMap).get(A),E;if(S)return S;if(S=_({},"__esModule",{value:!0}),A&&typeof A==="object"||typeof A==="function"){for(var N of j(A))if(!z.call(S,N))_(S,N,{get:J.bind(A,N),enumerable:!(E=v(A,N))||E.enumerable})}return M.set(A,S),S},M;var Q=(A)=>A;function U(A,S){this[A]=Q.bind(null,S)}var X=(A,S)=>{for(var E in S)_(A,E,{get:S[E],enumerable:!0,configurable:!0,set:U.bind(S,E)})};var Z=(A,S)=>()=>(A&&(S=A(A=0)),S);var C={};X(C,{groupByToArray:()=>$,groupByMultiple:()=>w,groupBy:()=>H,getUniqueTags:()=>I,getUniqueOwners:()=>V,getUniqueDomains:()=>B,filterBy:()=>d,GroupingStrategies:()=>x});function d(A,S){return A.filter((E)=>{if(S.tags?.length){if(!S.tags.some((R)=>E.meta.tags?.includes(R)))return!1}if(S.owners?.length){if(!S.owners.some((R)=>E.meta.owners?.includes(R)))return!1}if(S.stability?.length){if(!S.stability.includes(E.meta.stability??"stable"))return!1}if(S.domain){if(x.byDomain(E)!==S.domain)return!1}if(S.keyPattern){let N=E.meta.key??E.meta.key??"",R=S.keyPattern.replace(/\*/g,".*").replace(/\?/g,".");if(!new RegExp(`^${R}$`,"i").test(N))return!1}return!0})}function H(A,S){let E=new Map;for(let N of A){let R=S(N),h=E.get(R);if(h)h.push(N);else E.set(R,[N])}return E}function $(A,S){let E=H(A,S);return Array.from(E.entries()).map(([N,R])=>({key:N,items:R}))}function w(A,S){let E=new Map;for(let N of A){let R=S(N);for(let h of R){let L=E.get(h);if(L)L.push(N);else E.set(h,[N])}}return E}function I(A){let S=new Set;for(let E of A)for(let N of E.meta.tags??[])S.add(N);return Array.from(S).sort()}function V(A){let S=new Set;for(let E of A)for(let N of E.meta.owners??[])S.add(N);return Array.from(S).sort()}function B(A){let S=new Set;for(let E of A)S.add(x.byDomain(E));return Array.from(S).sort()}var x;var O=Z(()=>{x={byTag:(A)=>A.meta.tags?.[0]??"untagged",byAllTags:(A)=>A.meta.tags?.length?A.meta.tags:["untagged"],byOwner:(A)=>A.meta.owners?.[0]??"unowned",byDomain:(A)=>{return(A.meta.key??A.meta.key??"").split(".")[0]??"default"},byStability:(A)=>A.meta.stability??"stable",byUrlPath:(A)=>(S)=>{if(!S.path)return"root";return S.path.split("/").filter(Boolean).slice(0,A).join("/")||"root"}}});var W={Idea:"idea",InCreation:"in_creation",Experimental:"experimental",Beta:"beta",Stable:"stable",Deprecated:"deprecated"},G={PlatformCore:"platform.core",PlatformSigil:"platform.sigil",PlatformMarketplace:"platform.marketplace",PlatformMessaging:"platform.messaging",PlatformContent:"platform.content",PlatformFeatureFlags:"platform.featureflags",PlatformFinance:"platform.finance"},F=G,T={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"},p=T;O();import{compareVersions as q}from"compare-versions";var u=(A)=>`${A.meta.key}.v${A.meta.version}`;class b{contractType;items=new Map;constructor(A,S){this.contractType=A;if(S)S.forEach((E)=>this.register(E))}register(A){let S=u(A);if(this.items.has(S))throw Error(`Duplicate contract \`${this.contractType}\` ${S}`);return this.items.set(S,A),this}count(){return this.items.size}list(){return[...this.items.values()]}get(A,S){if(S!=null)return this.items.get(`${A}.v${S}`);let E;for(let[N,R]of this.items.entries()){if(!N.startsWith(`${A}.v`))continue;if(!E||q(R.meta.version,E.meta.version)>0)E=R}return E}has(A,S){return!!this.get(A,S)}filter(A){return d(this.list(),A)}listByTag(A){return this.list().filter((S)=>S.meta.tags?.includes(A))}listByOwner(A){return this.list().filter((S)=>S.meta.owners?.includes(A))}groupBy(A){return H(this.list(),A)}getUniqueTags(){return I(this.list())}}var Y=(A)=>{return A},g=[{id:"docs.tech.contracts.presentations-conventions",title:"Presentations Conventions (A11y & i18n)",summary:"- Always provide `meta.description` (≥ 3 chars) — used by a11y/docs/agents.",kind:"reference",visibility:"public",route:"/docs/tech/contracts/presentations-conventions",tags:["tech","contracts","presentations-conventions"],body:`## Presentations Conventions (A11y & i18n)

- Always provide \`meta.description\` (≥ 3 chars) — used by a11y/docs/agents.
- Prefer source = BlockNote for rich guides; use component key for interactive flows.
- i18n strings belong in host apps; descriptors carry keys/defaults only.
- Target selection: include only what you intend to support to avoid drift.
- PII: declare JSON-like paths under \`policy.pii\`; engine redacts in outputs.
`}],r=[{id:"docs.tech.contracts.presentations",title:"Presentations — Unified Descriptor & Transform Engine",summary:"How PresentationSpec and TransformEngine keep docs/renderers consistent.",visibility:"public",route:"/docs/tech/contracts/presentations",kind:"reference",tags:["presentations","docs","mcp"],body:`## Presentations V2 — Unified Descriptor & Transform Engine

### Purpose

Unify presentations into one descriptor (\`PresentationSpec\`) that declares a single source (React component key or BlockNote doc) and a list of output targets (react, markdown, application/json, application/xml). A pluggable \`TransformEngine\` renders any target and applies PII redaction.

### Types

\`\`\`ts
type PresentationTarget =
  | 'react'
  | 'markdown'
  | 'application/json'
  | 'application/xml';

type PresentationSource =
  | {
      type: 'component';
      framework: 'react';
      componentKey: string;
      props?: AnySchemaModel;
    }
  | { type: 'blocknotejs'; docJson: unknown; blockConfig?: unknown };

interface PresentationSpec {
  meta: PresentationMeta; // includes partial OwnerShipMeta + description
  policy?: { flags?: string[]; pii?: string[] };
  source: PresentationSource;
  targets: PresentationTarget[];
}

// Shared ownership schema (source of truth in @contractspec/lib.contracts-spec/src/ownership.ts)
interface OwnerShipMeta {
  title: string;
  description: string;
  domain: string;
  owners: Owner[];
  tags: Tag[];
  stability: Stability;
}

type Stability = 'experimental' | 'beta' | 'stable' | 'deprecated';
type Owner = string; // curated list available in code (e.g., '@sigil-team', 'team-strit')
type Tag = string; // curated list available in code (e.g., 'auth', 'spots')

// For presentations, meta is a Partial<OwnerShipMeta> plus description, name, version
interface PresentationMeta extends Partial<OwnerShipMeta> {
  name: string;
  version: string;
  description?: string;
}
\`\`\`

### Engine

Use \`createDefaultTransformEngine()\` from \`@contractspec/lib.presentation-runtime-core/transform-engine\` and register custom renderers as needed. React hosts add \`registerDefaultReactRenderer()\` from \`@contractspec/lib.contracts-runtime-client-react/transform-engine\`. The core engine supports markdown/json/xml; the React renderer returns a serializable descriptor the host app renders via a \`componentMap\` or a BlockNote renderer. The canonical source type string is \`blocknotejs\` (not \`blocknote\`).

PII paths (JSON-like) are redacted from rendered outputs.

### MCP Integration

\`createMcpServer\` accepts \`presentationsV2\`. Each descriptor is exposed under \`presentation://<name>/v<version>\` and negotiated variants (\`.md/.json/.xml\`) are rendered by the engine.

### Migration

- V1 \`PresentationSpec\` remains supported; a back-compat helper converts V1 → V2 when convenient.
- Prefer V2 for new work.

### Examples (Sigil)

- \`sigil.auth.webauth_tabs_v2\`: component source (\`componentKey: 'sigil.webauth.tabs'\`), targets \`react/json/xml\`.
- \`sigil.signup.guide_v2\`: BlockNote doc source, targets \`react/markdown/json/xml\`.

### React Rendering

Host apps use a \`componentMap\` (e.g., \`'sigil.webauth.tabs' → WebAuthTabs\`) and a BlockNote renderer to turn the React render descriptor into elements.`}];class n extends b{constructor(A){super("presentation",A)}}var a="harness",D=["platform.harness"],K=[T.Automation,"harness","evidence","evaluation"],P=W.Experimental;var hA=Y({meta:{key:"harness.run.audit",title:"Harness Run Audit",version:"1.0.0",description:"Audit view for harness runs, steps, evidence, and assertions.",goal:"Explain what happened, why it happened, and what proves it.",context:"Used by review surfaces to inspect bounded harness execution.",domain:a,owners:D,tags:[...K,"audit"],stability:P},capability:{key:"harness.evidence",version:"1.0.0"},source:{type:"component",framework:"react",componentKey:"harnessRunAudit"},targets:["react","markdown"]});export{hA as HarnessRunAuditPresentation};
