@nuvin/agent-core 0.3.0-rc.2 → 0.3.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  export interface AbortAwareSemaphore {
2
+ tryAcquire(): (() => void) | undefined;
2
3
  acquire(signal?: AbortSignal): Promise<() => void>;
3
4
  }
4
5
  export declare function createAbortAwareSemaphore(maxConcurrency: number): AbortAwareSemaphore;
@@ -1 +1 @@
1
- (function(_0x4e26a1,_0x2a9050){const _0x36f146={_0x29d9dd:0x3d,_0x4cce36:0x32,_0x3bfdef:0x233,_0x15c47b:0x224,_0x44444b:0x3a,_0xb2f4e4:0x228,_0x4256dd:0x223,_0x5e6160:0x226,_0x4a91e6:0x35,_0x14c0f2:0x39,_0x43a577:0x38,_0x95340d:0x3b,_0x4f418c:0x40,_0x543a6e:0x30,_0x42e176:0x22b,_0x4d4f45:0x237,_0x1426d6:0x235},_0x5b15b3={_0x5b720b:0x2f3},_0x3a380d={_0x8c6bde:0xfc};function _0x864a49(_0x32977a,_0x32af65,_0x1416ff,_0x10fa15){return _0x7a50(_0x32af65- -_0x3a380d._0x8c6bde,_0x10fa15);}function _0x3b2fc4(_0x226c40,_0x1116d8,_0x3a09e0,_0x3bac1a){return _0x7a50(_0x3a09e0- -_0x5b15b3._0x5b720b,_0x226c40);}const _0x5c7404=_0x4e26a1();while(!![]){try{const _0x34ec46=-parseInt(_0x864a49(-_0x36f146._0x29d9dd,-0x3e,-_0x36f146._0x4cce36,-0x44))/0x1*(parseInt(_0x3b2fc4(-0x22e,-0x236,-0x231,-_0x36f146._0x3bfdef))/0x2)+parseInt(_0x3b2fc4(-0x22a,-0x22f,-0x226,-_0x36f146._0x15c47b))/0x3+parseInt(_0x864a49(-_0x36f146._0x44444b,-0x43,-0x48,-0x3b))/0x4+-parseInt(_0x3b2fc4(-_0x36f146._0xb2f4e4,-0x233,-_0x36f146._0x3bfdef,-0x22f))/0x5*(parseInt(_0x3b2fc4(-_0x36f146._0x4256dd,-0x226,-0x225,-_0x36f146._0x5e6160))/0x6)+parseInt(_0x864a49(-_0x36f146._0x4a91e6,-_0x36f146._0x14c0f2,-0x40,-_0x36f146._0x43a577))/0x7*(parseInt(_0x864a49(-_0x36f146._0x95340d,-0x33,-0x3a,-0x3d))/0x8)+parseInt(_0x864a49(-0x2d,-0x35,-_0x36f146._0x4f418c,-_0x36f146._0x543a6e))/0x9*(-parseInt(_0x3b2fc4(-0x22c,-0x231,-_0x36f146._0x42e176,-0x231))/0xa)+-parseInt(_0x3b2fc4(-_0x36f146._0x4d4f45,-0x234,-0x22d,-_0x36f146._0x1426d6))/0xb*(parseInt(_0x3b2fc4(-0x22c,-0x23b,-0x234,-0x232))/0xc);if(_0x34ec46===_0x2a9050)break;else _0x5c7404['push'](_0x5c7404['shift']());}catch(_0x24b2f0){_0x5c7404['push'](_0x5c7404['shift']());}}}(_0x20bd,0x7064a));import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';function _0x20bd(){const _0x49fced=['ndKZmMLoy0Pczq','C2HPzNq','BgvUz3rO','mJKWmJaZmMnuEuPQAa','C3bSAwnL','AxnjBNrLz2vY','CMvQzwn0','ywjVCNrLza','nteZodnAz0rNq0W','mZzuu1nuALG','mZaZnwHMCwf0rq','AxngAw5PDgu','mtbPBMPYsem','ndLjB01TBva','y2fUy2vSBgvK','Aw5KzxHpzG','mJiWodiZoxHpq1zQzG','mtKYmZeYs1vxq3nn','mtCWz2nRA2Xf','nJm2nty4sNLVy1z4','CMvHC29U','CMvTB3zLqwjVCNrmAxn0zw5LCG','ChvZAa','mJy5nZy4n3bSwuP5tq'];_0x20bd=function(){return _0x49fced;};return _0x20bd();}import{TurnFailedError}from'../chunk-FFIZ6TKW.js';function _0x7a50(_0x1256da,_0x1453c0){_0x1256da=_0x1256da-0xb8;const _0x20bd47=_0x20bd();let _0x7a50e2=_0x20bd47[_0x1256da];if(_0x7a50['KRlwRz']===undefined){var _0x570179=function(_0x393f65){const _0x1acfe7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x59a96d='',_0x4cc35b='';for(let _0x5ca942=0x0,_0x3fdbca,_0x13dbc8,_0x2ad9a6=0x0;_0x13dbc8=_0x393f65['charAt'](_0x2ad9a6++);~_0x13dbc8&&(_0x3fdbca=_0x5ca942%0x4?_0x3fdbca*0x40+_0x13dbc8:_0x13dbc8,_0x5ca942++%0x4)?_0x59a96d+=String['fromCharCode'](0xff&_0x3fdbca>>(-0x2*_0x5ca942&0x6)):0x0){_0x13dbc8=_0x1acfe7['indexOf'](_0x13dbc8);}for(let _0x12468f=0x0,_0x1ace23=_0x59a96d['length'];_0x12468f<_0x1ace23;_0x12468f++){_0x4cc35b+='%'+('00'+_0x59a96d['charCodeAt'](_0x12468f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4cc35b);};_0x7a50['brYuIG']=_0x570179,_0x7a50['ttzgyU']={},_0x7a50['KRlwRz']=!![];}const _0x1273d9=_0x20bd47[0x0],_0x1601c1=_0x1256da+_0x1273d9,_0x5e5d72=_0x7a50['ttzgyU'][_0x1601c1];return!_0x5e5d72?(_0x7a50e2=_0x7a50['brYuIG'](_0x7a50e2),_0x7a50['ttzgyU'][_0x1601c1]=_0x7a50e2):_0x7a50e2=_0x5e5d72,_0x7a50e2;}import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function createAbortAwareSemaphore(_0x59a96d){const _0x39a786={_0x49dd49:0x441,_0x30f162:0x226,_0x3a4e03:0x21a},_0xeeb1db={_0x42f7b4:0x12c,_0x259bbf:0x136,_0x3e3c71:0x12e,_0x2391e4:0x124,_0xeff6ce:0x12b,_0x1f2d97:0x136,_0x4c272f:0x145,_0x305271:0x139,_0x5d049e:0x134},_0x24d750={_0x4214f8:0x2f8,_0x160bb7:0x309,_0xc5e4bd:0x308,_0x422d2e:0x49,_0x20ba6c:0x302},_0x2b4a1a={_0x41e88f:0x51a},_0x17fcf8={_0x2cbef8:0x2e1};if(!Number[_0x4895b6(0x43a,0x446,0x43b,_0x39a786._0x49dd49)](_0x59a96d)||!Number[_0x448ae3(-_0x39a786._0x30f162,-_0x39a786._0x3a4e03,-0x22a,-0x232)](_0x59a96d)||_0x59a96d<=0x0)throw new Error('maxConcurrency\x20must\x20be\x20a\x20finite\x20positive\x20integer');let _0x4cc35b=0x0;function _0x448ae3(_0x51ce23,_0x20ee4c,_0x43651a,_0x16fccc){return _0x7a50(_0x51ce23- -_0x17fcf8._0x2cbef8,_0x20ee4c);}const _0x5ca942=[],_0x3fdbca=()=>{let _0x2ad9a6=![];return()=>{if(_0x2ad9a6)return;_0x2ad9a6=!![],_0x4cc35b-=0x1,_0x13dbc8();};};function _0x4895b6(_0x5cac16,_0x1a48eb,_0x5f2160,_0xa23fa9){return _0x7a50(_0x5f2160-0x37a,_0xa23fa9);}const _0x13dbc8=()=>{const _0x4877d6={_0xc36291:0x1d8};function _0x29bd06(_0x2677e0,_0xfbef50,_0x3ac17e,_0x2de14b){return _0x448ae3(_0x2677e0-_0x4877d6._0xc36291,_0x2de14b,_0x3ac17e-0xbb,_0x2de14b-0x33);}function _0x17a55e(_0x1a49ef,_0x303d4c,_0x28253f,_0x42bb1a){return _0x448ae3(_0x28253f-_0x2b4a1a._0x41e88f,_0x1a49ef,_0x28253f-0x1a9,_0x42bb1a-0x1d5);}while(_0x5ca942[_0x17a55e(0x2f9,0x2f7,0x2f1,_0x24d750._0x4214f8)]>0x0){const _0x12468f=_0x5ca942[_0x17a55e(0x30f,_0x24d750._0x160bb7,_0x24d750._0xc5e4bd,0x30c)]();if(!_0x12468f||_0x12468f['cancelled'])continue;_0x12468f[_0x29bd06(-0x45,-_0x24d750._0x422d2e,-0x3f,-0x47)]=!![],_0x12468f[_0x17a55e(0x301,0x30f,0x304,_0x24d750._0x20ba6c)](),_0x4cc35b+=0x1,_0x12468f['resolve'](_0x3fdbca());return;}};return{'acquire'(_0x1ace23){const _0x585338={_0x2a8038:0x2f8,_0x358c16:0x302,_0x5c3cea:0x2ff,_0x82385c:0x2fd,_0x2c50dd:0x2fe},_0x455ef3={_0x376c1c:0x156,_0x252266:0x1d},_0x27d997={_0x13a49b:0x1e8,_0x1bd844:0x337};if(_0x1ace23?.[_0x5e4b51(_0xeeb1db._0x42f7b4,_0xeeb1db._0x259bbf,0x12c,_0xeeb1db._0x3e3c71)])return Promise[_0x5e4b51(0x128,_0xeeb1db._0x2391e4,_0xeeb1db._0xeff6ce,_0xeeb1db._0x1f2d97)](toAbortError(_0x1ace23[_0x5e4b51(0x12f,_0xeeb1db._0x4c272f,_0xeeb1db._0x305271,_0xeeb1db._0x5d049e)]));function _0x24628b(_0x271b05,_0x5cbd05,_0x9d8d25,_0x5f4b98){return _0x4895b6(_0x271b05-0x18e,_0x5cbd05-_0x27d997._0x13a49b,_0x5cbd05- -_0x27d997._0x1bd844,_0x271b05);}function _0x5e4b51(_0x2c2698,_0x11c6c9,_0xc9abb,_0x342380){return _0x4895b6(_0x2c2698-_0x455ef3._0x376c1c,_0x11c6c9-_0x455ef3._0x252266,_0xc9abb- -0x30b,_0x11c6c9);}if(_0x4cc35b<_0x59a96d)return _0x4cc35b+=0x1,Promise['resolve'](_0x3fdbca());return new Promise((_0x3bc0e3,_0x16be5c)=>{const _0xf103fe={_0x43af0a:0xb6,_0x53d042:0xbb,_0x49896c:0xb8,_0x48bd6b:0x2bb,_0x442af1:0x2b0,_0x4d82a3:0x2c1,_0x236bf8:0x2ba,_0x19e05f:0x2c6,_0x2cb97a:0x2b9,_0x2555e5:0xa8,_0x356b8c:0xb5,_0x16b2da:0xb2},_0x2387f9={_0x4be447:0xe7,_0x5a6869:0x5b0},_0x8354d3={_0x31c2df:0x19f,_0x19f461:0x3af},_0x816f2e={_0x2686fe:0x1f0,_0x394e1c:0x7c,_0x2882e6:0x2e};function _0x3ec488(_0x5f3a9a,_0x588680,_0x390523,_0x38378b){return _0x24628b(_0x390523,_0x38378b- -0x268,_0x390523-0x128,_0x38378b-0x129);}function _0x78fc11(_0x38a1e2,_0x23d60b,_0xd3ec09,_0x4daf49){return _0x24628b(_0xd3ec09,_0x4daf49-_0x816f2e._0x2686fe,_0xd3ec09-_0x816f2e._0x394e1c,_0x4daf49-_0x816f2e._0x2882e6);}const _0xde72e6={'resolve':_0x3bc0e3,'reject':_0x16be5c,'cancelled':![],'removeAbortListener':()=>{}};_0x5ca942[_0x78fc11(0x2fe,_0x585338._0x2a8038,_0x585338._0x358c16,_0x585338._0x5c3cea)](_0xde72e6),_0xde72e6[_0x78fc11(0x2fa,0x2fa,_0x585338._0x82385c,_0x585338._0x2c50dd)]=addAbortListener(_0x1ace23,()=>{if(_0xde72e6[_0x33025f(-_0xf103fe._0x43af0a,-0xbc,-_0xf103fe._0x53d042,-_0xf103fe._0x49896c)])return;_0xde72e6['cancelled']=!![];function _0x33025f(_0xabb9c5,_0x135a02,_0x5ab727,_0x4381a0){return _0x78fc11(_0xabb9c5-_0x8354d3._0x31c2df,_0x135a02-0xe,_0xabb9c5,_0x4381a0- -_0x8354d3._0x19f461);}_0xde72e6['removeAbortListener']();function _0x29d6f7(_0x29d091,_0x5a341a,_0x308f76,_0xb2119a){return _0x78fc11(_0x29d091-_0x2387f9._0x4be447,_0x5a341a-0x172,_0x29d091,_0x308f76- -_0x2387f9._0x5a6869);}const _0x17c2aa=_0x5ca942[_0x29d6f7(-0x2c4,-_0xf103fe._0x48bd6b,-0x2b8,-_0xf103fe._0x442af1)](_0xde72e6);if(_0x17c2aa>=0x0)_0x5ca942[_0x29d6f7(-0x2b8,-_0xf103fe._0x4d82a3,-0x2c3,-_0xf103fe._0x236bf8)](_0x17c2aa,0x1);_0xde72e6[_0x29d6f7(-_0xf103fe._0x19e05f,-0x2c8,-0x2c1,-_0xf103fe._0x2cb97a)](toAbortError(_0x1ace23?.[_0x33025f(-0xb1,-_0xf103fe._0x2555e5,-_0xf103fe._0x356b8c,-_0xf103fe._0x16b2da)]));});});}};}export{OperationAbortedError,TurnFailedError,addAbortListener,createAbortAwareSemaphore,isAbortError,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
1
+ (function(_0x50ec99,_0x2d6cd5){const _0x5f379f={_0x4a65a1:0x55b,_0x1d0d52:0x55a,_0x402795:0x56e,_0x20b1b3:0x56d,_0x3b9c6c:0x56f,_0x3a88ef:0x429,_0x270186:0x42c,_0x44aecc:0x435,_0x40e07a:0x569,_0x35f876:0x427,_0x262cc5:0x42e,_0x3db25d:0x423,_0x4974d4:0x424,_0x5aca7f:0x55f,_0x259a5a:0x560,_0x3b798d:0x555,_0x13172c:0x563,_0x2b8f2c:0x56b,_0x2186bc:0x419,_0x172b5e:0x41d,_0x4ebe34:0x428,_0x3b2c97:0x425},_0x512a0e={_0x630ebc:0x295};function _0x305d10(_0x5db3ad,_0x497cbc,_0x488b65,_0x2cf896){return _0x509d(_0x5db3ad-0x3d7,_0x497cbc);}const _0x23e4b8=_0x50ec99();function _0x47ffd9(_0x5b4f76,_0x4311d4,_0x3e909d,_0x2acf99){return _0x509d(_0x5b4f76-_0x512a0e._0x630ebc,_0x2acf99);}while(!![]){try{const _0x3c345e=-parseInt(_0x305d10(_0x5f379f._0x4a65a1,0x564,0x568,_0x5f379f._0x1d0d52))/0x1+parseInt(_0x305d10(0x567,0x566,_0x5f379f._0x402795,_0x5f379f._0x20b1b3))/0x2*(parseInt(_0x305d10(0x562,0x564,_0x5f379f._0x3b9c6c,_0x5f379f._0x3b9c6c))/0x3)+parseInt(_0x47ffd9(_0x5f379f._0x3a88ef,_0x5f379f._0x270186,_0x5f379f._0x44aecc,0x435))/0x4+-parseInt(_0x305d10(0x560,0x558,_0x5f379f._0x40e07a,0x563))/0x5*(-parseInt(_0x47ffd9(_0x5f379f._0x35f876,_0x5f379f._0x262cc5,_0x5f379f._0x3db25d,_0x5f379f._0x4974d4))/0x6)+-parseInt(_0x305d10(_0x5f379f._0x5aca7f,_0x5f379f._0x259a5a,0x56a,_0x5f379f._0x3b798d))/0x7*(-parseInt(_0x47ffd9(0x417,0x411,0x416,0x40f))/0x8)+-parseInt(_0x305d10(_0x5f379f._0x13172c,0x56a,_0x5f379f._0x4a65a1,_0x5f379f._0x4a65a1))/0x9*(parseInt(_0x305d10(0x566,0x55e,0x562,_0x5f379f._0x2b8f2c))/0xa)+parseInt(_0x47ffd9(0x416,_0x5f379f._0x2186bc,0x41f,_0x5f379f._0x172b5e))/0xb*(-parseInt(_0x47ffd9(_0x5f379f._0x4ebe34,0x429,_0x5f379f._0x3b2c97,0x427))/0xc);if(_0x3c345e===_0x2d6cd5)break;else _0x23e4b8['push'](_0x23e4b8['shift']());}catch(_0x93a3b2){_0x23e4b8['push'](_0x23e4b8['shift']());}}}(_0x496d,0x443e8));import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';import{TurnFailedError}from'../chunk-FFIZ6TKW.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function _0x509d(_0x4f4347,_0xcc2911){_0x4f4347=_0x4f4347-0x181;const _0x496df2=_0x496d();let _0x509d08=_0x496df2[_0x4f4347];if(_0x509d['NXjsEM']===undefined){var _0x4bc96e=function(_0x1d6a33){const _0x4d43c7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4376d0='',_0x4dc606='';for(let _0x66793d=0x0,_0x1add49,_0x36b4ae,_0x502da2=0x0;_0x36b4ae=_0x1d6a33['charAt'](_0x502da2++);~_0x36b4ae&&(_0x1add49=_0x66793d%0x4?_0x1add49*0x40+_0x36b4ae:_0x36b4ae,_0x66793d++%0x4)?_0x4376d0+=String['fromCharCode'](0xff&_0x1add49>>(-0x2*_0x66793d&0x6)):0x0){_0x36b4ae=_0x4d43c7['indexOf'](_0x36b4ae);}for(let _0x46dfc4=0x0,_0x529b68=_0x4376d0['length'];_0x46dfc4<_0x529b68;_0x46dfc4++){_0x4dc606+='%'+('00'+_0x4376d0['charCodeAt'](_0x46dfc4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4dc606);};_0x509d['ZhVorf']=_0x4bc96e,_0x509d['vRSIve']={},_0x509d['NXjsEM']=!![];}const _0x2abd4e=_0x496df2[0x0],_0x4d3cf9=_0x4f4347+_0x2abd4e,_0x6ab552=_0x509d['vRSIve'][_0x4d3cf9];return!_0x6ab552?(_0x509d08=_0x509d['ZhVorf'](_0x509d08),_0x509d['vRSIve'][_0x4d3cf9]=_0x509d08):_0x509d08=_0x6ab552,_0x509d08;}function _0x11c68e(_0x219ed3,_0x560db7,_0xe56f25,_0x5675a3){return _0x509d(_0x219ed3-0x31a,_0x5675a3);}function createAbortAwareSemaphore(_0x4376d0){const _0x55195a={_0x19e93d:0xb8,_0x4f6c8c:0xc6},_0x199ef9={_0x203406:0x1f,_0xf09298:0x22,_0x58cea2:0x23,_0x37beaf:0x2c,_0x3978d7:0x30,_0xb5a789:0x19f},_0x3d145={_0xfaff30:0x198},_0x408171={_0x3a1151:0xea},_0x8a78e8={_0x12526e:0x1ea},_0x314d0c={_0x5c3f05:0x1d2,_0x276c35:0x1e2,_0x4ecdfc:0x1d6,_0x369487:0x370,_0x34a4f0:0x37b,_0x48e181:0x1cc},_0x30900c={_0x2f3b71:0xc6,_0x1204c3:0xc0,_0x59e876:0x7},_0x52a77c={_0x419441:0x8b,_0x703e5e:0xeb,_0x745414:0x290};if(!Number['isFinite'](_0x4376d0)||!Number[_0x4f29bd(0xc6,0xd6,0xc8,0xce)](_0x4376d0)||_0x4376d0<=0x0)throw new Error(_0x4f29bd(_0x55195a._0x19e93d,_0x55195a._0x4f6c8c,0xae,0xb9));function _0x4f29bd(_0x3c6ab6,_0xd50327,_0x2cd731,_0x39dd9a){return _0x509d(_0x39dd9a- -0xcc,_0xd50327);}let _0x4dc606=0x0;const _0x66793d=[],_0x1add49=()=>{let _0x46dfc4=![];return()=>{if(_0x46dfc4)return;_0x46dfc4=!![],_0x4dc606-=0x1,_0x36b4ae();};},_0x36b4ae=()=>{function _0x4b08f6(_0x2d75fe,_0x31b139,_0x1d5ef5,_0x4a4b60){return _0x4f29bd(_0x2d75fe-_0x52a77c._0x419441,_0x31b139,_0x1d5ef5-_0x52a77c._0x703e5e,_0x4a4b60- -_0x52a77c._0x745414);}function _0x48dd8a(_0x318d05,_0x2b4d6e,_0x46add2,_0x40c91a){return _0x14890b(_0x46add2,_0x2b4d6e-_0x30900c._0x2f3b71,_0x46add2-_0x30900c._0x1204c3,_0x40c91a-_0x30900c._0x59e876);}while(_0x66793d[_0x4b08f6(-_0x314d0c._0x5c3f05,-0x1d4,-_0x314d0c._0x276c35,-_0x314d0c._0x4ecdfc)]>0x0){const _0x529b68=_0x66793d[_0x48dd8a(_0x314d0c._0x369487,0x374,0x36f,_0x314d0c._0x34a4f0)]();if(!_0x529b68||_0x529b68['cancelled'])continue;_0x529b68['cancelled']=!![],_0x529b68['removeAbortListener'](),_0x4dc606+=0x1,_0x529b68[_0x4b08f6(-0x1cc,-_0x314d0c._0x48e181,-0x1ca,-0x1ce)](_0x1add49());return;}};function _0x14890b(_0x4b67c4,_0xed71b9,_0x53c413,_0x27a806){return _0x509d(_0x27a806-_0x8a78e8._0x12526e,_0x4b67c4);}const _0x502da2=()=>{if(_0x4dc606>=_0x4376d0)return void 0x0;return _0x4dc606+=0x1,_0x1add49();};return{'tryAcquire':_0x502da2,'acquire'(_0x3fd245){const _0x2eb0ed={_0x1d0aa3:0xf3,_0x4cc138:0xe1,_0x2be143:0xe5,_0x187e79:0xec},_0x3a96b1={_0x4c5832:0xb8,_0x1ec0c8:0xa2,_0x38a4e0:0xa7,_0x5dc2ba:0xa4,_0x394024:0x1c8,_0x3e0eda:0x1d5,_0x3df323:0x1bf,_0x220a00:0x1d6,_0x1b394f:0x1ca,_0x527754:0x1cc,_0x42f8e2:0x1dc,_0x301bca:0x1e7};function _0x59aa09(_0x705eb7,_0x3c92b4,_0x34c342,_0x4a8ea3){return _0x4f29bd(_0x705eb7-0x3f,_0x3c92b4,_0x34c342-0x14a,_0x705eb7-_0x408171._0x3a1151);}if(_0x3fd245?.[_0x1f58d3(-_0x199ef9._0x203406,-0x22,-0x1b,-_0x199ef9._0xf09298)])return Promise[_0x1f58d3(-0x21,-0x1b,-0x21,-_0x199ef9._0x58cea2)](toAbortError(_0x3fd245[_0x1f58d3(-_0x199ef9._0x37beaf,-_0x199ef9._0x37beaf,-0x24,-_0x199ef9._0x3978d7)]));const _0x2bbf06=_0x502da2();if(_0x2bbf06!==void 0x0)return Promise[_0x59aa09(0x1ac,0x1b0,0x1b7,_0x199ef9._0xb5a789)](_0x2bbf06);function _0x1f58d3(_0x48fb2a,_0x3c2fc1,_0x238163,_0x5911d0){return _0x14890b(_0x238163,_0x3c2fc1-_0x3d145._0xfaff30,_0x238163-0x1ba,_0x3c2fc1- -0x39d);}return new Promise((_0x4db447,_0x3a2f86)=>{const _0x5ea060={_0x286c0c:0x359,_0xaa4439:0x164};function _0xef5ff5(_0x89fea1,_0x4745b8,_0x3aa378,_0xc792ff){return _0x59aa09(_0x4745b8-_0x5ea060._0x286c0c,_0x89fea1,_0x3aa378-_0x5ea060._0xaa4439,_0xc792ff-0xc3);}const _0x6887a9={'resolve':_0x4db447,'reject':_0x3a2f86,'cancelled':![],'removeAbortListener':()=>{}};_0x66793d[_0x419bf7(_0x2eb0ed._0x1d0aa3,0xf4,0xea,0xef)](_0x6887a9);function _0x419bf7(_0x4f17ea,_0x38ddbd,_0x14c1b1,_0x3e2434){return _0x59aa09(_0x14c1b1- -0xcb,_0x3e2434,_0x14c1b1-0xa5,_0x3e2434-0x3b);}_0x6887a9[_0x419bf7(_0x2eb0ed._0x4cc138,_0x2eb0ed._0x2be143,_0x2eb0ed._0x187e79,_0x2eb0ed._0x4cc138)]=addAbortListener(_0x3fd245,()=>{const _0x53fa32={_0xa5057b:0xe3},_0x14c3d2={_0x25722b:0x41};if(_0x6887a9['cancelled'])return;_0x6887a9['cancelled']=!![];function _0x2ea7d6(_0x5d96b1,_0x4ad666,_0x29fcc2,_0x347a7d){return _0x419bf7(_0x5d96b1-0x1c3,_0x4ad666-0x68,_0x5d96b1- -_0x14c3d2._0x25722b,_0x347a7d);}function _0x48339a(_0x4376e0,_0x7f3092,_0x348838,_0xdecd4f){return _0x419bf7(_0x4376e0-_0x53fa32._0xa5057b,_0x7f3092-0x187,_0x348838- -0x2b5,_0xdecd4f);}_0x6887a9[_0x2ea7d6(0xab,_0x3a96b1._0x4c5832,_0x3a96b1._0x1ec0c8,0xa1)]();const _0xb6d437=_0x66793d[_0x2ea7d6(_0x3a96b1._0x38a4e0,0xac,_0x3a96b1._0x5dc2ba,0xab)](_0x6887a9);if(_0xb6d437>=0x0)_0x66793d[_0x48339a(-0x1c9,-_0x3a96b1._0x394024,-_0x3a96b1._0x3e0eda,-0x1ca)](_0xb6d437,0x1);_0x6887a9[_0x48339a(-_0x3a96b1._0x3df323,-_0x3a96b1._0x220a00,-_0x3a96b1._0x1b394f,-_0x3a96b1._0x527754)](toAbortError(_0x3fd245?.[_0x48339a(-_0x3a96b1._0x42f8e2,-_0x3a96b1._0x301bca,-0x1db,-0x1da)]));});});}};}var MESSAGE_ROLES=[_0x11c68e(0x49d,0x499,0x491,0x49d),'user'];function _0x6144b8(_0x597208,_0x58e4c0,_0x546bc9,_0x14b284){return _0x509d(_0x14b284-0x7,_0x597208);}Object[_0x6144b8(0x1aa,0x193,0x1a8,0x19d)](MESSAGE_ROLES);function _0x496d(){const _0x3c352f=['nZi3ndq0t2TUu3jK','Aw5KzxHpzG','zNjLzxPL','ChvZAa','CMvQzwn0','CMvTB3zLqwjVCNrmAxn0zw5LCG','AxnjBNrLz2vY','mtqZuMzPALvZ','nZeYDfb3s2Lc','yxnZAxn0yw50','nte0odu5Dez4suni','Bwf4q29Uy3vYCMvUy3KGBxvZDcbIzsbHigzPBML0zsbWB3nPDgL2zsbPBNrLz2vY','BgvUz3rO','CMvHC29U','mti5ntbSvfjYAxa','nvDkvefJCW','C2HPzNq','mta4mdqYowvPrwTuCa','nJy0nduYr2D2C3rq','C3bSAwnL','CMvZB2X2zq','mtbAv011Bw4','mLjbrw1qta','ywjVCNrLza','mtK5odCZmLbOA0PvvG','mtu4mZy0ueHvDe9W'];_0x496d=function(){return _0x3c352f;};return _0x496d();}export{MESSAGE_ROLES,OperationAbortedError,TurnFailedError,addAbortListener,createAbortAwareSemaphore,isAbortError,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
@@ -133,7 +133,8 @@ export interface MessageProviderState {
133
133
  export type AssistantContentBlock = AnthropicRedactedThinkingBlock | AnthropicThinkingBlock | OpenAiReasoningBlock | TextBlock | ToolUseBlock;
134
134
  export type ContentBlock = AssistantContentBlock | ImageBlock | ToolResultBlock;
135
135
  export type ContentInput = ContentBlock[] | string | null | undefined;
136
- export type MessageRole = "assistant" | "user";
136
+ export declare const MESSAGE_ROLES: readonly ["assistant", "user"];
137
+ export type MessageRole = (typeof MESSAGE_ROLES)[number];
137
138
  export type SystemInput = TextBlock[] | string | null | undefined;
138
139
  export interface Message {
139
140
  id?: string;
@@ -337,7 +338,8 @@ export interface TurnInput {
337
338
  system?: SystemInput;
338
339
  messages?: MessageInput[];
339
340
  message: MessageInput;
340
- drainSteering?: () => Promise<MessageInput[]>;
341
+ submission?: AgentSubmission;
342
+ drainSteering?: () => Promise<TurnSteeringInput[]>;
341
343
  }
342
344
  export interface TurnState {
343
345
  sessionId: string;
@@ -414,6 +416,10 @@ export interface TurnMessageMeta {
414
416
  reasoningStartedAt?: number;
415
417
  /** ms epoch — reasoning settled (first assistant text / done). */
416
418
  reasoningCompletedAt?: number;
419
+ /** Marks a canonical user-role append submitted by a trusted runtime source. */
420
+ submissionOrigin?: "coordinator" | "agent";
421
+ /** Canonical sender ID for an agent-origin user-role append. */
422
+ senderAgentId?: string;
417
423
  }
418
424
  export interface EngineChatModel {
419
425
  model: string;
@@ -518,6 +524,8 @@ export type ToolRuntimeEvent = ToolRuntimeOutputChunkEvent | ToolRuntimeComplete
518
524
  export interface AgentUserMessageEvent {
519
525
  type: "user_message";
520
526
  message: Message;
527
+ /** Canonical sender ID when another agent submitted this message. */
528
+ senderAgentId?: string;
521
529
  }
522
530
  export interface AgentModelRequestEvent {
523
531
  type: "model_request";
@@ -667,7 +675,7 @@ export interface ExtensionContext {
667
675
  state: TurnState;
668
676
  delivery: "model" | "program-intermediate";
669
677
  executionScope: ToolExecutionScope;
670
- /** Present only on the assistant-message `afterMessageAppend` run. */
678
+ /** Present on assistant appends and coordinator-owned user appends. */
671
679
  turnMeta?: TurnMessageMeta;
672
680
  }
673
681
  export type Transformer<S extends TransformableStage> = (payload: PayloadByStage[S], ctx: ExtensionContext) => PayloadByStage[S] | Promise<PayloadByStage[S]>;
@@ -713,14 +721,25 @@ export interface RunTurnDeps {
713
721
  beginProgramTrace?: BeginProgramTrace;
714
722
  }
715
723
  export type AgentInput = MessageInput | string;
716
- export type SteeringInputDrain = () => Promise<AgentInput[]>;
717
724
  /** Immutable ownership metadata for the exact agent submission being sent. */
718
725
  export type AgentSubmission = Readonly<{
719
726
  origin: "user";
720
727
  }> | Readonly<{
721
728
  origin: "coordinator";
722
729
  token: string;
730
+ }> | Readonly<{
731
+ origin: "agent";
732
+ senderAgentId: string;
733
+ }>;
734
+ export type TurnSteeringInput = MessageInput | Readonly<{
735
+ input: MessageInput;
736
+ submission: AgentSubmission;
737
+ }>;
738
+ export type SteeringInput = AgentInput | Readonly<{
739
+ input: AgentInput;
740
+ submission: AgentSubmission;
723
741
  }>;
742
+ export type SteeringInputDrain = () => Promise<SteeringInput[]>;
724
743
  export interface AgentSendOptions {
725
744
  streaming?: boolean;
726
745
  signal?: AbortSignal;
@@ -3,6 +3,57 @@ import type { AbortAwareSemaphore } from "../../shared/abort-aware-semaphore.ts"
3
3
  import type { AgentDefinitionFactoryContext, AgentOptions } from "../../shared/types.ts";
4
4
  export declare const MODEL_TIERS: readonly ["fast", "balanced", "powerful"];
5
5
  export type ModelTier = (typeof MODEL_TIERS)[number];
6
+ export type BackgroundAssignmentState = "started" | "queued";
7
+ export type BackgroundMessageState = BackgroundAssignmentState | "queued-as-steering";
8
+ export type BackgroundDelegationFailureCode = "subagent-not-found" | "subagent-corrupt" | "subagent-unavailable" | "subagent-busy" | "subagent-closing";
9
+ export type BackgroundAssignmentRequest = Readonly<{
10
+ agentId: string;
11
+ task: string;
12
+ senderAgentId: string;
13
+ parentSessionId: string;
14
+ parentToolCallId: string;
15
+ requestedModelTier?: ModelTier;
16
+ }>;
17
+ export type BackgroundMessageRequest = Readonly<{
18
+ runId: string;
19
+ message: string;
20
+ senderAgentId: string;
21
+ parentSessionId: string;
22
+ triggerToolCallId: string;
23
+ }>;
24
+ export type BackgroundStopRequest = Readonly<{
25
+ runId: string;
26
+ parentSessionId: string;
27
+ }>;
28
+ export type BackgroundDelegationRejection = Readonly<{
29
+ kind: "rejected";
30
+ code: BackgroundDelegationFailureCode;
31
+ message: string;
32
+ runId?: string;
33
+ }>;
34
+ export type BackgroundAssignmentResult = Readonly<{
35
+ kind: "accepted";
36
+ runId: string;
37
+ agentId: string;
38
+ state: BackgroundAssignmentState;
39
+ }> | BackgroundDelegationRejection;
40
+ export type BackgroundMessageResult = Readonly<{
41
+ kind: "accepted";
42
+ runId: string;
43
+ agentId: string;
44
+ state: BackgroundMessageState;
45
+ }> | BackgroundDelegationRejection;
46
+ export type BackgroundStopResult = Readonly<{
47
+ kind: "accepted";
48
+ runId: string;
49
+ agentId: string;
50
+ state: "idle" | "stopping";
51
+ }> | BackgroundDelegationRejection;
52
+ export interface BackgroundDelegationCapability {
53
+ assign(request: BackgroundAssignmentRequest): Promise<BackgroundAssignmentResult>;
54
+ sendMessage(request: BackgroundMessageRequest): Promise<BackgroundMessageResult>;
55
+ stopAgent(request: BackgroundStopRequest): Promise<BackgroundStopResult>;
56
+ }
6
57
  export interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
7
58
  parentSessionId: string;
8
59
  runId: string;
@@ -61,7 +112,10 @@ export interface CreateDelegationToolsOptions {
61
112
  * delegation factory's own failure-release may safely converge here.
62
113
  */
63
114
  releaseAgentResources?: (context: DelegatedAgentFactoryContext) => void;
115
+ background?: BackgroundDelegationCapability;
64
116
  }
117
+ export declare function isValidDelegatedRunId(value: unknown): value is string;
118
+ export declare function createDelegatedRunId(): string;
65
119
  export declare function resolveDelegatedAgentOptions(definition: DelegatedAgentDefinition, ctx: DelegatedAgentFactoryContext): Promise<DelegatedAgentResolution>;
66
120
  export declare function createAssignTaskTool(options: CreateDelegationToolsOptions): import("../../shared/types.ts").ToolDefinition<{
67
121
  description: string;
@@ -96,8 +150,44 @@ export declare function createAssignTaskTool(options: CreateDelegationToolsOptio
96
150
  };
97
151
  required: string[];
98
152
  }>;
153
+ export declare function createSendMessageTool(background: BackgroundDelegationCapability): import("../../shared/types.ts").ToolDefinition<{
154
+ message: string;
155
+ description: string;
156
+ runId: string;
157
+ }, never, import("../../shared/types.ts").ToolOutputEnvelope, {
158
+ type: "object";
159
+ properties: {
160
+ runId: {
161
+ type: "string";
162
+ description: string;
163
+ };
164
+ description: {
165
+ type: "string";
166
+ description: string;
167
+ };
168
+ message: {
169
+ type: "string";
170
+ description: string;
171
+ };
172
+ };
173
+ required: string[];
174
+ additionalProperties: false;
175
+ }>;
176
+ export declare function createStopAgentTool(background: BackgroundDelegationCapability): import("../../shared/types.ts").ToolDefinition<{
177
+ runId: string;
178
+ }, never, import("../../shared/types.ts").ToolOutputEnvelope, {
179
+ type: "object";
180
+ properties: {
181
+ runId: {
182
+ type: "string";
183
+ description: string;
184
+ };
185
+ };
186
+ required: string[];
187
+ additionalProperties: false;
188
+ }>;
99
189
  export declare const createDelegateToAgentTool: typeof createAssignTaskTool;
100
- export declare function createDelegationTools(options: CreateDelegationToolsOptions): import("../../shared/types.ts").ToolDefinition<{
190
+ export declare function createDelegationTools(options: CreateDelegationToolsOptions): (import("../../shared/types.ts").ToolDefinition<{
101
191
  description: string;
102
192
  agentId: string;
103
193
  nickname: string;
@@ -129,6 +219,18 @@ export declare function createDelegationTools(options: CreateDelegationToolsOpti
129
219
  };
130
220
  };
131
221
  required: string[];
132
- }>[];
222
+ }> | import("../../shared/types.ts").ToolDefinition<{
223
+ runId: string;
224
+ }, never, import("../../shared/types.ts").ToolOutputEnvelope, {
225
+ type: "object";
226
+ properties: {
227
+ runId: {
228
+ type: "string";
229
+ description: string;
230
+ };
231
+ };
232
+ required: string[];
233
+ additionalProperties: false;
234
+ }>)[];
133
235
  export {};
134
236
  //# sourceMappingURL=runtime-manager-tools.d.ts.map