var{defineProperty:k,getOwnPropertyNames:q,getOwnPropertyDescriptor:v}=Object,w=Object.prototype.hasOwnProperty;function x(b){return this[b]}var A=(b)=>{var g=(m??=new WeakMap).get(b),h;if(g)return g;if(g=k({},"__esModule",{value:!0}),b&&typeof b==="object"||typeof b==="function"){for(var j of q(b))if(!w.call(g,j))k(g,j,{get:x.bind(b,j),enumerable:!(h=v(b,j))||h.enumerable})}return m.set(b,g),g},m;var y=(b)=>b;function z(b,g){this[b]=y.bind(null,g)}var B=(b,g)=>{for(var h in g)k(b,h,{get:g[h],enumerable:!0,configurable:!0,set:z.bind(g,h)})};var C=(b,g)=>()=>(b&&(g=b(b=0)),g);var E=(b)=>b,G=[{id:"docs.tech.contracts.ops-to-presentation-linking",title:"Ops ↔ Presentation linking (V2)",summary:"This document explains how operations (OperationSpec) are linked to Presentations (PresentationSpec) via Feature modules.",kind:"reference",visibility:"public",route:"/docs/tech/contracts/ops-to-presentation-linking",tags:["tech","contracts","ops-to-presentation-linking"],body:`### Ops to Presentation Linking (V2)

This document explains how operations (\`OperationSpec\`) are linked to presentations (\`PresentationSpec\`) via feature modules.

- Location: \`packages/libs/contracts-spec/src/features/types.ts\`
- Field: \`FeatureModuleSpec.opToPresentation?: { op: OpRef; pres: PresentationRef }[]\`
- Validation:
  - \`validateFeatureSpec()\` checks that linked refs are declared in the feature itself
  - \`installFeature()\` checks that declared refs exist in the provided registries
  - \`validateFeatureTargetsV2()\` checks descriptor target support

Example:

\`\`\`ts
import { defineFeature, FeatureRegistry } from '@contractspec/lib.contracts-spec/features';

export const WidgetsFeature = defineFeature({
  meta: {
    key: 'myapp.widgets.linkage',
    version: '1.0.0',
    title: 'Widgets (linked)',
    description: 'Links create and update operations to UI presentations.',
    domain: 'widgets',
    owners: ['platform.widgets'],
    tags: ['widgets', 'linkage'],
    stability: 'beta',
  },
  operations: [
    { key: 'widgets.create', version: '1.0.0' },
    { key: 'widgets.update', version: '1.0.0' },
  ],
  presentations: [
    { key: 'myapp.widgets.editor.page', version: '1.0.0' },
  ],
  opToPresentation: [
    {
      op: { key: 'widgets.create', version: '1.0.0' },
      pres: { key: 'myapp.widgets.editor.page', version: '1.0.0' },
    },
    {
      op: { key: 'widgets.update', version: '1.0.0' },
      pres: { key: 'myapp.widgets.editor.page', version: '1.0.0' },
    },
  ],
  presentationsTargets: [
    {
      key: 'myapp.widgets.editor.page',
      version: '1.0.0',
      targets: ['react', 'markdown'],
    },
  ],
});

const features = new FeatureRegistry().register(WidgetsFeature);
\`\`\`

Notes:

- This enables traceability: the UI flow that realizes an operation is discoverable via the feature catalog.
- Presentations can target multiple outputs (\`react\`, \`markdown\`, \`application/json\`, \`application/xml\`).
- Use \`renderFeaturePresentation()\` to render a descriptor to a given target with a component map.
`}];export{G as tech_contracts_ops_to_presentation_linking_DocBlocks,E as defineFeature};
