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 ↔ Presentation linking (V2)

This document explains how operations (OperationSpec) are linked to Presentations (PresentationSpec) via Feature modules.

- Location: \`@contractspec/lib.contracts-spec/src/features.ts\`
- Field: \`FeatureModuleSpec.opToPresentation?: { op: { name; version }; pres: { name; version } }[]\`
- Validation: \`installFeature()\` validates that linked ops exist in \`OperationSpecRegistry\` and linked presentations exist in the registry, and that declared targets are present.

Example:

\`\`\`ts
import type { OperationSpecRegistry } from '@contractspec/lib.contracts-spec/src/registry';
import { FeatureRegistry, createFeatureModule } from '@contractspec/lib.contracts-spec';

export function buildFeaturesWithOps(ops: OperationSpecRegistry) {
  const features = new FeatureRegistry();
  features.register(
    createFeatureModule(
      {
        key: 'myapp.widgets.linkage',
        title: 'Widgets (linked)',
        description: 'Links create/update ops to UI presentations',
        domain: 'widgets',
        tags: ['widgets', 'linkage'],
        stability: 'beta',
      },
      {
        operations: [
          { name: 'widgets.create', version: '1.0.0' },
          { name: 'widgets.update', version: '1.0.0' },
        ],
        presentations: [{ name: 'myapp.widgets.editor.page', version: '1.0.0' }],
        opToPresentation: [
          {
            op: { name: 'widgets.create', version: '1.0.0' },
            pres: { name: 'myapp.widgets.editor.page', version: '1.0.0' },
          },
          {
            op: { name: 'widgets.update', version: '1.0.0' },
            pres: { name: 'myapp.widgets.editor.page', version: '1.0.0' },
          },
        ],
        presentationsTargets: [
          {
            name: 'myapp.widgets.editor.page',
            version: '1.0.0',
            targets: ['react', 'markdown'],
          },
        ],
      }
    )
  );
  return { features };
}
\`\`\`

Notes

- This enables traceability: the UI flow that realizes an op 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};
