"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../shared-types-B8BH5zz1.cjs");class t extends i.KiroError{constructor(){super("Cannot update a completed AsyncDeliveredObject")}get userFacingSessionErrorMessage(){return"Closed stream had unexpected results delivered"}}class o{value;isComplete=!1;resolvePromise;promise;constructor(e){this.value=e,this.promise=new Promise(s=>{this.resolvePromise=s})}getCurrentValue(){return this.value}isCompleted(){return this.isComplete}update(e){if(this.isComplete)throw new t;this.value=e}complete(e){this.isComplete||(e!==void 0&&(this.value=e),this.isComplete=!0,this.resolvePromise&&this.resolvePromise(this.value))}getCompletionPromise(){return this.isComplete?Promise.resolve(this.value):this.promise}async waitForCompletion(){return this.getCompletionPromise()}}exports.AsyncDeliveredObject=o;exports.CompletedObjectUpdateError=t;
//# sourceMappingURL=index.cjs.map
