var{defineProperty:v,getOwnPropertyNames:x,getOwnPropertyDescriptor:z}=Object,A=Object.prototype.hasOwnProperty;function B(b){return this[b]}var E=(b)=>{var d=(w??=new WeakMap).get(b),h;if(d)return d;if(d=v({},"__esModule",{value:!0}),b&&typeof b==="object"||typeof b==="function"){for(var j of x(b))if(!A.call(d,j))v(d,j,{get:B.bind(b,j),enumerable:!(h=z(b,j))||h.enumerable})}return w.set(b,d),d},w;var C=(b)=>b;function D(b,d){this[b]=C.bind(null,d)}var F=(b,d)=>{for(var h in d)v(b,h,{get:d[h],enumerable:!0,configurable:!0,set:D.bind(d,h)})};var H=(b,d)=>()=>(b&&(d=b(b=0)),d);var J={id:"docs.tech.agent.operations-as-tools",title:"Operations as tools",summary:"Reference ContractSpec operations as agent tools. One contract to many surfaces.",kind:"reference",visibility:"public",route:"/docs/tech/agent/operations-as-tools",tags:["agent","tools","operations"],body:"# Operations as tools\n\nReference ContractSpec operations in `AgentSpec.tools` with `operationRef` to reuse schemas, handlers, and output bindings across REST, GraphQL, MCP, and agent execution.\n"},K={id:"docs.tech.agent.subagents",title:"Subagents",summary:"Delegate tasks to subagents with streaming and isolated context.",kind:"reference",visibility:"public",route:"/docs/tech/agent/subagents",tags:["agent","subagents","delegation"],body:`# Subagents

Subagents let a primary agent delegate bounded work to worker agents while keeping orchestration, summaries, and approval policy in the parent flow.
`},L={id:"docs.tech.agent.memory-tools",title:"Memory tools",summary:"Model-accessible CRUD for agent memory and ephemeral knowledge.",kind:"reference",visibility:"public",route:"/docs/tech/agent/memory-tools",tags:["agent","memory","tools"],body:`# Memory tools

Memory tools expose model-facing storage for cross-conversation recall. They are distinct from session summarization and can be backed by Anthropic memory or custom ContractSpec operations.
`},M={id:"docs.tech.agent.workflow-integration",title:"Workflow-agent integration",summary:"Patterns for orchestrator-worker, workflow steps, and evaluator loops.",kind:"reference",visibility:"public",route:"/docs/tech/agent/workflow-integration",tags:["agent","workflow","orchestrator"],body:`# Workflow-agent integration

Agents can act as workflow workers, orchestrators, or evaluators. Contract-backed operations keep those integrations explicit and replayable.
`};function O(b){if(!b.meta?.key)throw Error("Agent key is required");if(typeof b.meta.version!=="string")throw Error(`Agent ${b.meta.key} is missing a string version`);if(!b.instructions?.trim())throw Error(`Agent ${b.meta.key} requires instructions`);if(!b.tools?.length)throw Error(`Agent ${b.meta.key} must expose at least one tool`);for(let[h,j]of Object.entries(b.runtime?.ports??{}))if(j!==void 0&&j.trim().length===0)throw Error(`Agent ${b.meta.key} has invalid runtime config: port "${h}" must not be empty`);let d=new Set;for(let h of b.tools){if(d.has(h.name))throw Error(`Agent ${b.meta.key} has duplicate tool name: ${h.name}`);if(d.add(h.name),h.subagentRef&&h.operationRef)throw Error(`Agent ${b.meta.key} tool "${h.name}" cannot have both subagentRef and operationRef. Use one.`);if([h.outputPresentation,h.outputForm,h.outputDataView].filter(Boolean).length>1)throw Error(`Agent ${b.meta.key} tool "${h.name}" has multiple output refs (outputPresentation, outputForm, outputDataView). Use at most one.`)}return Object.freeze(b)}function P(b){return`${b.key}.v${b.version}`}export{O as defineAgent,P as agentKey,M as AgentWorkflowIntegrationDocBlock,K as AgentSubagentsDocBlock,J as AgentOperationsAsToolsDocBlock,L as AgentMemoryToolsDocBlock};
