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

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 _0x1f6b(){const _0x3ba620=['nZKWre9eyuTW','AxnjBNrLz2vY','mte4mdm1zxD0tMj2','otK2mJeWs3DXCwvO','ChvZAa','Aw5KzxHpzG','mtKWD0nms3jR','C2HPzNq','Bwf4q29Uy3vYCMvUy3KGBxvZDcbIzsbHigzPBML0zsbWB3nPDgL2zsbPBNrLz2vY','CMvZB2X2zq','mty4ntuYmgTnzePKzG','mtuYohHcqu52qq','CMvTB3zLqwjVCNrmAxn0zw5LCG','y2fUy2vSBgvK','AxngAw5PDgu','mJq5ogncr09tuG','mtqWmdC5m0TSq0nmqW','CMvQzwn0','mJiXnZK0neXsqKPdyG','mJy2DeTqBMr6'];_0x1f6b=function(){return _0x3ba620;};return _0x1f6b();}function _0x5270(_0x3b6684,_0x458af4){_0x3b6684=_0x3b6684-0x1b0;const _0x1f6bdc=_0x1f6b();let _0x527048=_0x1f6bdc[_0x3b6684];if(_0x5270['zvzGCI']===undefined){var _0x1f6439=function(_0x2a9fc3){const _0x4da58b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x47e339='',_0x5214af='';for(let _0x42bdf0=0x0,_0x174c63,_0x5d26b1,_0x3bd524=0x0;_0x5d26b1=_0x2a9fc3['charAt'](_0x3bd524++);~_0x5d26b1&&(_0x174c63=_0x42bdf0%0x4?_0x174c63*0x40+_0x5d26b1:_0x5d26b1,_0x42bdf0++%0x4)?_0x47e339+=String['fromCharCode'](0xff&_0x174c63>>(-0x2*_0x42bdf0&0x6)):0x0){_0x5d26b1=_0x4da58b['indexOf'](_0x5d26b1);}for(let _0x27f711=0x0,_0x251b12=_0x47e339['length'];_0x27f711<_0x251b12;_0x27f711++){_0x5214af+='%'+('00'+_0x47e339['charCodeAt'](_0x27f711)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5214af);};_0x5270['dzyiUt']=_0x1f6439,_0x5270['gMXpeH']={},_0x5270['zvzGCI']=!![];}const _0x3f5e73=_0x1f6bdc[0x0],_0x5ec07f=_0x3b6684+_0x3f5e73,_0x1d0e63=_0x5270['gMXpeH'][_0x5ec07f];return!_0x1d0e63?(_0x527048=_0x5270['dzyiUt'](_0x527048),_0x5270['gMXpeH'][_0x5ec07f]=_0x527048):_0x527048=_0x1d0e63,_0x527048;}(function(_0x4e3078,_0x265a9c){const _0x1bc05e={_0x428286:0x41e,_0x12e51e:0x421,_0xd2a1c4:0x42b,_0x3d8384:0x132,_0x26e630:0x130,_0x24e890:0x136,_0x4ee2f5:0x13d,_0x5cee7b:0x425,_0x21feb0:0x42e,_0x270a92:0x420,_0x2747df:0x438,_0x1ff033:0x135,_0x4edbe9:0x143,_0x1acf8d:0x41d,_0x4c3093:0x41e,_0x2fecfa:0x133,_0x773a72:0x426},_0x5ba48f={_0x41fa3e:0x2f5},_0x25ba55=_0x4e3078();function _0x114904(_0x30ce8e,_0x50826a,_0x28d83b,_0x5db166){return _0x5270(_0x28d83b- -_0x5ba48f._0x41fa3e,_0x5db166);}function _0x3ac399(_0x1f1d07,_0x56c962,_0x508f01,_0x4da4d0){return _0x5270(_0x56c962-0x26d,_0x4da4d0);}while(!![]){try{const _0x248def=parseInt(_0x3ac399(_0x1bc05e._0x428286,_0x1bc05e._0x12e51e,0x41e,_0x1bc05e._0xd2a1c4))/0x1*(parseInt(_0x114904(-_0x1bc05e._0x3d8384,-_0x1bc05e._0x26e630,-_0x1bc05e._0x24e890,-_0x1bc05e._0x4ee2f5))/0x2)+parseInt(_0x3ac399(0x422,0x422,0x41d,_0x1bc05e._0x5cee7b))/0x3+parseInt(_0x114904(-0x13c,-0x144,-0x13e,-0x13d))/0x4+-parseInt(_0x3ac399(0x42c,0x429,_0x1bc05e._0x21feb0,_0x1bc05e._0x270a92))/0x5+parseInt(_0x3ac399(_0x1bc05e._0x2747df,0x430,0x427,0x427))/0x6+-parseInt(_0x114904(-_0x1bc05e._0x1ff033,-0x145,-0x13d,-_0x1bc05e._0x4edbe9))/0x7*(parseInt(_0x3ac399(0x417,_0x1bc05e._0x1acf8d,0x41a,_0x1bc05e._0x4c3093))/0x8)+parseInt(_0x114904(-0x141,-0x143,-0x13a,-_0x1bc05e._0x2fecfa))/0x9*(-parseInt(_0x3ac399(0x426,_0x1bc05e._0x773a72,0x42a,0x426))/0xa);if(_0x248def===_0x265a9c)break;else _0x25ba55['push'](_0x25ba55['shift']());}catch(_0x2d12aa){_0x25ba55['push'](_0x25ba55['shift']());}}}(_0x1f6b,0x48866));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 createAbortAwareSemaphore(_0x47e339){const _0x3d26ca={_0x16084b:0x3f8,_0x466ae7:0x3f3,_0x3c5e70:0x57,_0x289781:0x54,_0x4aaae0:0x5b},_0x22515c={_0x2210da:0x20e},_0x380367={_0x256504:0x1a3,_0x2d2f09:0x1a0,_0x5c7bbb:0x1a8,_0x447ba0:0x200,_0x4772a1:0x1f8,_0x1ac8ff:0x1ff,_0x28bfac:0x207},_0x5598b3={_0x185e14:0x24a},_0x593b6b={_0xf37ace:0x11a,_0x1bdd90:0x1e8},_0x40514f={_0x545146:0x242};if(!Number[_0x1f3682(_0x3d26ca._0x16084b,0x3f5,_0x3d26ca._0x466ae7,0x3f0)](_0x47e339)||!Number[_0x3b2b2b(0x54,_0x3d26ca._0x3c5e70,0x4d,_0x3d26ca._0x289781)](_0x47e339)||_0x47e339<=0x0)throw new Error(_0x3b2b2b(_0x3d26ca._0x4aaae0,_0x3d26ca._0x3c5e70,_0x3d26ca._0x3c5e70,0x61));function _0x1f3682(_0xa5bc4d,_0x3cb19e,_0x586302,_0x1a424e){return _0x5270(_0x3cb19e-_0x40514f._0x545146,_0x1a424e);}let _0x5214af=0x0;function _0x3b2b2b(_0x4c4c6c,_0x59f93b,_0x4866c9,_0x3aa17c){return _0x5270(_0x4c4c6c- -0x166,_0x3aa17c);}const _0x42bdf0=[],_0x174c63=()=>{let _0x27f711=![];return()=>{if(_0x27f711)return;_0x27f711=!![],_0x5214af-=0x1,_0x5d26b1();};},_0x5d26b1=()=>{function _0x4fef81(_0x27a38d,_0x97f4ed,_0x4b101f,_0x4dc64e){return _0x1f3682(_0x27a38d-_0x593b6b._0xf37ace,_0x97f4ed- -0x5a2,_0x4b101f-_0x593b6b._0x1bdd90,_0x4b101f);}function _0x112848(_0x4a443c,_0x565fd3,_0xfc05df,_0x43e4cb){return _0x3b2b2b(_0x43e4cb- -_0x5598b3._0x185e14,_0x565fd3-0x97,_0xfc05df-0x104,_0xfc05df);}while(_0x42bdf0['length']>0x0){const _0x251b12=_0x42bdf0[_0x4fef81(-_0x380367._0x256504,-_0x380367._0x2d2f09,-_0x380367._0x5c7bbb,-0x1a0)]();if(!_0x251b12||_0x251b12['cancelled'])continue;_0x251b12[_0x112848(-_0x380367._0x447ba0,-0x204,-_0x380367._0x4772a1,-0x1fe)]=!![],_0x251b12[_0x112848(-_0x380367._0x1ac8ff,-0x1fb,-_0x380367._0x28bfac,-_0x380367._0x1ac8ff)](),_0x5214af+=0x1,_0x251b12['resolve'](_0x174c63());return;}},_0x3bd524=()=>{if(_0x5214af>=_0x47e339)return void 0x0;return _0x5214af+=0x1,_0x174c63();};return{'tryAcquire':_0x3bd524,'acquire'(_0x4e7d23){const _0x385e56={_0x1b00be:0x211,_0x2c0f0e:0x362,_0x59602b:0x367},_0x45f8b0={_0x51ddcd:0x90},_0x1a49b0={_0x32a956:0x101},_0x58cb58={_0x3893eb:0x266,_0xdf943c:0x1cd,_0x21bf85:0xc3};if(_0x4e7d23?.['aborted'])return Promise['reject'](toAbortError(_0x4e7d23['reason']));function _0x6c81b8(_0x161be5,_0x4a0420,_0x330060,_0x272410){return _0x3b2b2b(_0x330060- -_0x58cb58._0x3893eb,_0x4a0420-_0x58cb58._0xdf943c,_0x330060-_0x58cb58._0x21bf85,_0x272410);}const _0x35da83=_0x3bd524();if(_0x35da83!==void 0x0)return Promise[_0x6c81b8(-0x214,-0x202,-0x20a,-_0x22515c._0x2210da)](_0x35da83);return new Promise((_0x4c74d7,_0x51c081)=>{const _0x10641d={_0x300c48:0xe1,_0x436acc:0xec,_0x1cf3a1:0xf3,_0x27d1cb:0xe0,_0x3be64b:0xdf},_0x48679b={_0x5ef1ff:0x1db,_0x6b6972:0x12f,_0x296e2f:0x45};function _0x1566a6(_0x728f3a,_0x4c4418,_0xc0ef34,_0x48c496){return _0x6c81b8(_0x728f3a-0x168,_0x4c4418-_0x1a49b0._0x32a956,_0x48c496-0x582,_0x728f3a);}const _0x417cfd={'resolve':_0x4c74d7,'reject':_0x51c081,'cancelled':![],'removeAbortListener':()=>{}};_0x42bdf0[_0x472796(-0x20f,-_0x385e56._0x1b00be,-0x20f,-0x213)](_0x417cfd);function _0x472796(_0x23e32a,_0xa655a8,_0xbd0e85,_0x3cc3f1){return _0x6c81b8(_0x23e32a-0x0,_0xa655a8-_0x45f8b0._0x51ddcd,_0xbd0e85-0x0,_0x23e32a);}_0x417cfd[_0x1566a6(0x367,_0x385e56._0x2c0f0e,0x361,_0x385e56._0x59602b)]=addAbortListener(_0x4e7d23,()=>{const _0x9fffe9={_0x343eea:0x63};function _0x29616b(_0x187ffc,_0x52d35e,_0x2e13ba,_0x16adf2){return _0x472796(_0x52d35e,_0x52d35e-_0x48679b._0x5ef1ff,_0x16adf2-_0x48679b._0x6b6972,_0x16adf2-_0x48679b._0x296e2f);}if(_0x417cfd['cancelled'])return;function _0x3f425f(_0x4af6b9,_0x3f6ee6,_0x43f09f,_0x29d05c){return _0x472796(_0x43f09f,_0x3f6ee6-_0x9fffe9._0x343eea,_0x29d05c-0x24e,_0x29d05c-0x195);}_0x417cfd[_0x29616b(-_0x10641d._0x300c48,-_0x10641d._0x436acc,-_0x10641d._0x1cf3a1,-0xeb)]=!![],_0x417cfd['removeAbortListener']();const _0x3eced7=_0x42bdf0[_0x29616b(-_0x10641d._0x27d1cb,-0xdf,-0xd8,-_0x10641d._0x3be64b)](_0x417cfd);if(_0x3eced7>=0x0)_0x42bdf0['splice'](_0x3eced7,0x1);_0x417cfd[_0x29616b(-0xe1,-0xf1,-0xec,-0xe7)](toAbortError(_0x4e7d23?.['reason']));});});}};}export{OperationAbortedError,TurnFailedError,addAbortListener,createAbortAwareSemaphore,isAbortError,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
@@ -337,7 +337,8 @@ export interface TurnInput {
337
337
  system?: SystemInput;
338
338
  messages?: MessageInput[];
339
339
  message: MessageInput;
340
- drainSteering?: () => Promise<MessageInput[]>;
340
+ submission?: AgentSubmission;
341
+ drainSteering?: () => Promise<TurnSteeringInput[]>;
341
342
  }
342
343
  export interface TurnState {
343
344
  sessionId: string;
@@ -414,6 +415,10 @@ export interface TurnMessageMeta {
414
415
  reasoningStartedAt?: number;
415
416
  /** ms epoch — reasoning settled (first assistant text / done). */
416
417
  reasoningCompletedAt?: number;
418
+ /** Marks a canonical user-role append submitted by a trusted runtime source. */
419
+ submissionOrigin?: "coordinator" | "agent";
420
+ /** Canonical sender ID for an agent-origin user-role append. */
421
+ senderAgentId?: string;
417
422
  }
418
423
  export interface EngineChatModel {
419
424
  model: string;
@@ -518,6 +523,8 @@ export type ToolRuntimeEvent = ToolRuntimeOutputChunkEvent | ToolRuntimeComplete
518
523
  export interface AgentUserMessageEvent {
519
524
  type: "user_message";
520
525
  message: Message;
526
+ /** Canonical sender ID when another agent submitted this message. */
527
+ senderAgentId?: string;
521
528
  }
522
529
  export interface AgentModelRequestEvent {
523
530
  type: "model_request";
@@ -667,7 +674,7 @@ export interface ExtensionContext {
667
674
  state: TurnState;
668
675
  delivery: "model" | "program-intermediate";
669
676
  executionScope: ToolExecutionScope;
670
- /** Present only on the assistant-message `afterMessageAppend` run. */
677
+ /** Present on assistant appends and coordinator-owned user appends. */
671
678
  turnMeta?: TurnMessageMeta;
672
679
  }
673
680
  export type Transformer<S extends TransformableStage> = (payload: PayloadByStage[S], ctx: ExtensionContext) => PayloadByStage[S] | Promise<PayloadByStage[S]>;
@@ -713,14 +720,25 @@ export interface RunTurnDeps {
713
720
  beginProgramTrace?: BeginProgramTrace;
714
721
  }
715
722
  export type AgentInput = MessageInput | string;
716
- export type SteeringInputDrain = () => Promise<AgentInput[]>;
717
723
  /** Immutable ownership metadata for the exact agent submission being sent. */
718
724
  export type AgentSubmission = Readonly<{
719
725
  origin: "user";
720
726
  }> | Readonly<{
721
727
  origin: "coordinator";
722
728
  token: string;
729
+ }> | Readonly<{
730
+ origin: "agent";
731
+ senderAgentId: string;
732
+ }>;
733
+ export type TurnSteeringInput = MessageInput | Readonly<{
734
+ input: MessageInput;
735
+ submission: AgentSubmission;
736
+ }>;
737
+ export type SteeringInput = AgentInput | Readonly<{
738
+ input: AgentInput;
739
+ submission: AgentSubmission;
723
740
  }>;
741
+ export type SteeringInputDrain = () => Promise<SteeringInput[]>;
724
742
  export interface AgentSendOptions {
725
743
  streaming?: boolean;
726
744
  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