// @bun
var{defineProperty:n,getOwnPropertyNames:s,getOwnPropertyDescriptor:a}=Object,p=Object.prototype.hasOwnProperty;function l(o){return this[o]}var d=(o)=>{var e=(i??=new WeakMap).get(o),t;if(e)return e;if(e=n({},"__esModule",{value:!0}),o&&typeof o==="object"||typeof o==="function"){for(var r of s(o))if(!p.call(e,r))n(e,r,{get:l.bind(o,r),enumerable:!(t=a(o,r))||t.enumerable})}return i.set(o,e),e},i;var c=(o)=>o;function u(o,e){this[o]=c.bind(null,e)}var x=(o,e)=>{for(var t in e)n(o,t,{get:e[t],enumerable:!0,configurable:!0,set:u.bind(e,t)})};var f=(o,e)=>()=>(o&&(e=o(o=0)),e);class g{executor;options;constructor(o,e={}){this.executor=o;this.options=e}async submit(o,e){let t=this.options.dryRun??!1;try{let r=await this.executor.execute(o,e,{dryRun:t});if(this.options.logger?.info)this.options.logger.info("[regenerator] proposal executed",{proposalId:e.id,contextId:o.id,status:r.status});if(this.options.onResult)await this.options.onResult({context:o,proposal:e,result:r})}catch(r){if(this.options.logger?.error)this.options.logger.error("[regenerator] proposal execution failed",r instanceof Error?r:Error(String(r)),{proposalId:e.id,contextId:o.id});throw r instanceof Error?r:Error(String(r))}}}export{g as ExecutorProposalSink};
