@nuvin/agent-core 0.2.1-rc.1 → 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(_0x3a7297,_0x50d781){const _0x1f1174={_0x1de72d:0x1b6,_0x5d5921:0x1bb,_0x11dcf7:0x1b7,_0x54e3ae:0x41c,_0x5b28a1:0x41b,_0x5770a9:0x411,_0x5ee620:0x416,_0x11969c:0x1bc,_0x42d04c:0x1bd,_0x518b25:0x1c0,_0x2952e9:0x1c4,_0x1b23bb:0x1c3,_0xb0a81:0x1cc,_0x502311:0x1cd,_0x4cbe82:0x40a,_0x43a890:0x1ba,_0x3ee44d:0x1b8,_0x29ee09:0x413,_0x119553:0x410,_0x15ec45:0x406,_0x1ff110:0x1d2,_0x41ba12:0x1c1,_0x4a36d1:0x1d4},_0x54166e={_0x2b285c:0x341};function _0x388482(_0x56d387,_0x2244ba,_0x2a3840,_0xcdea20){return _0x29e1(_0x2a3840-_0x54166e._0x2b285c,_0x2244ba);}function _0x9c1dcf(_0x7a599a,_0x3e40e5,_0x57c5fe,_0x51ad89){return _0x29e1(_0x3e40e5- -0x299,_0x57c5fe);}const _0x34a03b=_0x3a7297();while(!![]){try{const _0x11cefb=parseInt(_0x9c1dcf(-_0x1f1174._0x1de72d,-_0x1f1174._0x5d5921,-_0x1f1174._0x11dcf7,-0x1b8))/0x1*(-parseInt(_0x388482(_0x1f1174._0x54e3ae,_0x1f1174._0x5b28a1,0x412,0x40f))/0x2)+-parseInt(_0x388482(0x40c,_0x1f1174._0x5770a9,0x414,_0x1f1174._0x5ee620))/0x3+parseInt(_0x9c1dcf(-_0x1f1174._0x11969c,-_0x1f1174._0x42d04c,-0x1bc,-_0x1f1174._0x518b25))/0x4*(parseInt(_0x9c1dcf(-0x1c8,-_0x1f1174._0x2952e9,-_0x1f1174._0x1b23bb,-0x1cc))/0x5)+parseInt(_0x9c1dcf(-0x1c7,-_0x1f1174._0xb0a81,-0x1cd,-_0x1f1174._0x502311))/0x6*(-parseInt(_0x388482(0x407,0x41c,0x411,_0x1f1174._0x4cbe82))/0x7)+-parseInt(_0x9c1dcf(-0x1c2,-_0x1f1174._0x43a890,-0x1bb,-_0x1f1174._0x3ee44d))/0x8+parseInt(_0x388482(_0x1f1174._0x5ee620,_0x1f1174._0x29ee09,_0x1f1174._0x119553,_0x1f1174._0x15ec45))/0x9*(parseInt(_0x9c1dcf(-_0x1f1174._0x1ff110,-0x1cd,-_0x1f1174._0x41ba12,-_0x1f1174._0x4a36d1))/0xa)+parseInt(_0x9c1dcf(-0x1ca,-0x1c2,-0x1bc,-0x1c0))/0xb;if(_0x11cefb===_0x50d781)break;else _0x34a03b['push'](_0x34a03b['shift']());}catch(_0x4ccf69){_0x34a03b['push'](_0x34a03b['shift']());}}}(_0x4971,0x6df73));function _0x4971(){const _0x6a0100=['CMvHC29U','mJiWv01MA1zT','y2fUy2vSBgvK','mxvKyLLwBW','nJeXotqWmhDjzhf0wG','BgvUz3rO','CMvQzwn0','AxngAw5PDgu','mtbcv0XAALq','nJe4nKrfuMTOsa','C3bSAwnL','nZiXmda1m0nyy0LMzq','mJyXogLgseHeyW','ntG3oty2BKX4q1jN','CMvTB3zLqwjVCNrmAxn0zw5LCG','mJi1mJKYmMrRrLbqyG','CMvZB2X2zq','nJG2ndvSuKjHuem','C2HPzNq','mte5ody1mtn2zKHlvwq','AxnjBNrLz2vY','ChvZAa','Aw5KzxHpzG'];_0x4971=function(){return _0x6a0100;};return _0x4971();}import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';function _0x29e1(_0x1dcc84,_0x2a09ce){_0x1dcc84=_0x1dcc84-0xcc;const _0x497151=_0x4971();let _0x29e1b7=_0x497151[_0x1dcc84];if(_0x29e1['igoaLm']===undefined){var _0x1f2ffd=function(_0x59d1f0){const _0x382187='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3633dc='',_0x21a093='';for(let _0x273af8=0x0,_0x9358e,_0x77797f,_0x44a36f=0x0;_0x77797f=_0x59d1f0['charAt'](_0x44a36f++);~_0x77797f&&(_0x9358e=_0x273af8%0x4?_0x9358e*0x40+_0x77797f:_0x77797f,_0x273af8++%0x4)?_0x3633dc+=String['fromCharCode'](0xff&_0x9358e>>(-0x2*_0x273af8&0x6)):0x0){_0x77797f=_0x382187['indexOf'](_0x77797f);}for(let _0x4c8318=0x0,_0x5cca88=_0x3633dc['length'];_0x4c8318<_0x5cca88;_0x4c8318++){_0x21a093+='%'+('00'+_0x3633dc['charCodeAt'](_0x4c8318)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x21a093);};_0x29e1['kJEtuP']=_0x1f2ffd,_0x29e1['mbibuw']={},_0x29e1['igoaLm']=!![];}const _0x23e1ed=_0x497151[0x0],_0x2d2ec9=_0x1dcc84+_0x23e1ed,_0x245f02=_0x29e1['mbibuw'][_0x2d2ec9];return!_0x245f02?(_0x29e1b7=_0x29e1['kJEtuP'](_0x29e1b7),_0x29e1['mbibuw'][_0x2d2ec9]=_0x29e1b7):_0x29e1b7=_0x245f02,_0x29e1b7;}import{TurnFailedError}from'../chunk-FFIZ6TKW.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function createAbortAwareSemaphore(_0x3633dc){const _0x465c49={_0xc13ff5:0x249,_0x103521:0x18d,_0x1b18c7:0x184,_0x5682a2:0x187},_0x1d4f1a={_0x3097c9:0x151,_0xa95535:0x14a,_0x54b46b:0x141,_0x450165:0x13e,_0x34bfac:0x145,_0x146a18:0x69,_0x51ba60:0x5f,_0x169742:0x68},_0x540b8b={_0x4b6112:0x1c9,_0x21d96f:0x38c,_0x55e823:0x38e,_0x299a13:0x384,_0x195b52:0x382},_0x3265a8={_0x2a20eb:0x1c0,_0x46086d:0x1e8},_0x56707b={_0x37bd1a:0x1e1,_0x3a9831:0x42,_0x9280ae:0xe},_0x1d49f8={_0x557643:0x171,_0x4c9f2a:0x17a,_0x2aeb92:0x32a,_0x15150c:0x334,_0x3824f3:0x321,_0x3dc6c9:0x327},_0x18fc49={_0x19d67d:0xb0,_0x28644a:0x1a5},_0x373506={_0x6deffa:0x3b0};if(!Number[_0x346055(_0x465c49._0xc13ff5,0x242,0x248,0x241)](_0x3633dc)||!Number[_0x34f8ab(_0x465c49._0x103521,_0x465c49._0x1b18c7,_0x465c49._0x5682a2,0x179)](_0x3633dc)||_0x3633dc<=0x0)throw new Error('maxConcurrency\x20must\x20be\x20a\x20finite\x20positive\x20integer');let _0x21a093=0x0;function _0x34f8ab(_0x1e38bd,_0x160d4e,_0x23b2ff,_0x5049f0){return _0x29e1(_0x160d4e-0xac,_0x23b2ff);}const _0x273af8=[];function _0x346055(_0x598c23,_0x4996a6,_0x25d520,_0xd3e13e){return _0x29e1(_0x4996a6-0x160,_0x598c23);}const _0x9358e=()=>{let _0x44a36f=![];return()=>{if(_0x44a36f)return;_0x44a36f=!![],_0x21a093-=0x1,_0x77797f();};},_0x77797f=()=>{function _0x291d13(_0x2dbde2,_0x5864cd,_0x1a27b2,_0x449f07){return _0x346055(_0x449f07,_0x1a27b2- -_0x373506._0x6deffa,_0x1a27b2-0xe3,_0x449f07-0x65);}function _0x2a8818(_0x3e23e8,_0x42b215,_0x3baff1,_0x47ca11){return _0x34f8ab(_0x3e23e8-_0x18fc49._0x19d67d,_0x3e23e8-0x1a1,_0x47ca11,_0x47ca11-_0x18fc49._0x28644a);}while(_0x273af8[_0x291d13(-0x168,-0x170,-0x170,-0x16f)]>0x0){const _0x4c8318=_0x273af8[_0x291d13(-0x179,-_0x1d49f8._0x557643,-_0x1d49f8._0x4c9f2a,-_0x1d49f8._0x4c9f2a)]();if(!_0x4c8318||_0x4c8318[_0x2a8818(_0x1d49f8._0x2aeb92,_0x1d49f8._0x15150c,0x32c,0x331)])continue;_0x4c8318[_0x2a8818(0x32a,_0x1d49f8._0x3824f3,0x32a,_0x1d49f8._0x3dc6c9)]=!![],_0x4c8318['removeAbortListener'](),_0x21a093+=0x1,_0x4c8318['resolve'](_0x9358e());return;}};return{'acquire'(_0x5cca88){const _0x547cb3={_0x4169ec:0x19e,_0x37f101:0x1a4,_0x28659f:0x19f,_0x20ddfc:0x1ab,_0x5d8b7b:0x241,_0xa21d54:0x248,_0x39b143:0x19a,_0x439bd2:0x23a,_0xbaa083:0x240,_0x2f3800:0x24b};if(_0x5cca88?.['aborted'])return Promise[_0x5dfda6(_0x1d4f1a._0x3097c9,0x14b,_0x1d4f1a._0xa95535,_0x1d4f1a._0x54b46b)](toAbortError(_0x5cca88[_0x5dfda6(_0x1d4f1a._0x450165,_0x1d4f1a._0x34bfac,0x14e,0x14c)]));if(_0x21a093<_0x3633dc)return _0x21a093+=0x1,Promise[_0x327e55(-0x70,-_0x1d4f1a._0x146a18,-_0x1d4f1a._0x51ba60,-_0x1d4f1a._0x169742)](_0x9358e());function _0x5dfda6(_0x4caf7a,_0x37794d,_0x5b0fdd,_0x1a3477){return _0x34f8ab(_0x4caf7a-_0x56707b._0x37bd1a,_0x37794d- -_0x56707b._0x3a9831,_0x5b0fdd,_0x1a3477-_0x56707b._0x9280ae);}function _0x327e55(_0x12af94,_0x58f5e2,_0x363170,_0xe8ada3){return _0x34f8ab(_0x12af94-_0x3265a8._0x2a20eb,_0xe8ada3- -_0x3265a8._0x46086d,_0x363170,_0xe8ada3-0x1aa);}return new Promise((_0x3c4760,_0xc4c224)=>{const _0x589e3a={_0xa04e81:0x179},_0x1af10e={_0x193cee:0x7a,_0xe082a5:0x19b},_0x3751f7={_0x3010ce:0x100,_0x3cbb67:0x16b},_0x1e642f={_0x5d4c2f:0x248,_0x3b9f01:0x7d},_0x4186ae={'resolve':_0x3c4760,'reject':_0xc4c224,'cancelled':![],'removeAbortListener':()=>{}};function _0x24725f(_0x2f5708,_0x2ef459,_0x30c841,_0x192700){return _0x5dfda6(_0x2f5708-0x12d,_0x30c841-_0x1e642f._0x5d4c2f,_0x2ef459,_0x192700-_0x1e642f._0x3b9f01);}function _0x18c5ff(_0x2d92ef,_0x4204e6,_0x305f8a,_0x207e38){return _0x327e55(_0x2d92ef-_0x3751f7._0x3010ce,_0x4204e6-0x1b6,_0x305f8a,_0x2d92ef- -_0x3751f7._0x3cbb67);}_0x273af8[_0x18c5ff(-0x1ce,-0x1c2,-0x1c6,-_0x540b8b._0x4b6112)](_0x4186ae),_0x4186ae[_0x24725f(_0x540b8b._0x21d96f,_0x540b8b._0x55e823,_0x540b8b._0x299a13,_0x540b8b._0x195b52)]=addAbortListener(_0x5cca88,()=>{if(_0x4186ae[_0x34b02c(_0x547cb3._0x4169ec,_0x547cb3._0x37f101,0x1aa,0x1a8)])return;_0x4186ae[_0x34b02c(_0x547cb3._0x28659f,0x1a6,0x1aa,_0x547cb3._0x20ddfc)]=!![],_0x4186ae['removeAbortListener']();const _0x3dffeb=_0x273af8[_0x3f8667(-_0x547cb3._0x5d8b7b,-0x247,-_0x547cb3._0xa21d54,-0x247)](_0x4186ae);function _0x3f8667(_0x9a6461,_0x2dc304,_0xccecaa,_0x134ea6){return _0x18c5ff(_0x2dc304- -_0x1af10e._0x193cee,_0x2dc304-_0x1af10e._0xe082a5,_0x9a6461,_0x134ea6-0x109);}function _0x34b02c(_0x4c6901,_0x509835,_0x30087e,_0x3933a9){return _0x24725f(_0x4c6901-0x1bb,_0x509835,_0x30087e- -0x1e5,_0x3933a9-_0x589e3a._0xa04e81);}if(_0x3dffeb>=0x0)_0x273af8[_0x34b02c(0x193,_0x547cb3._0x39b143,0x19b,0x1a7)](_0x3dffeb,0x1);_0x4186ae[_0x3f8667(-_0x547cb3._0x439bd2,-_0x547cb3._0xbaa083,-_0x547cb3._0x2f3800,-0x237)](toAbortError(_0x5cca88?.['reason']));});});}};}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;
@@ -434,10 +439,32 @@ export interface BaseChatModelOptions {
434
439
  providerSessionResolver?: ProviderSessionResolver;
435
440
  requestMutators?: ProviderRequestMutator[];
436
441
  }
442
+ export type ToolExecutionScope = Readonly<{
443
+ agentId: string;
444
+ toolCallPath: readonly string[];
445
+ }>;
446
+ export interface NestedToolExecutionRequest {
447
+ requestedName: string;
448
+ tool?: AnyToolDefinition;
449
+ toolCall: ToolUseBlock;
450
+ sequence: number;
451
+ trace?: ProgramTraceHandle;
452
+ }
453
+ export interface ProgramTraceHandle {
454
+ readonly runId: string;
455
+ recordToolCall(sequence: number, toolCall: ToolUseBlock): Promise<void>;
456
+ recordToolResult(sequence: number, result: ToolResult): Promise<void>;
457
+ finish(status: "completed" | "failed" | "aborted", errorMessage?: string): Promise<void>;
458
+ }
459
+ export type BeginProgramTrace = (request: {
460
+ executionScope: ToolExecutionScope;
461
+ programToolCallId: string;
462
+ }) => Promise<ProgramTraceHandle>;
437
463
  export interface AgentEventContext {
438
464
  sessionId: string;
439
465
  turnId: string;
440
466
  state: TurnState;
467
+ executionScope: ToolExecutionScope;
441
468
  }
442
469
  export type AskUserOption = {
443
470
  label: string;
@@ -462,6 +489,8 @@ export interface ToolExecutionContext extends AgentEventContext {
462
489
  permissionClass?: ToolPermissionClass;
463
490
  executionAuthorization?: unknown;
464
491
  askUser?: (request: AskUserQuestionRequest) => Promise<AskUserAnswers>;
492
+ executeNestedTool?: (request: NestedToolExecutionRequest) => Promise<ToolResult>;
493
+ beginProgramTrace?: () => Promise<ProgramTraceHandle>;
465
494
  setTopic?: (topic: string) => void;
466
495
  }
467
496
  export interface BashExecutionTarget {
@@ -494,6 +523,8 @@ export type ToolRuntimeEvent = ToolRuntimeOutputChunkEvent | ToolRuntimeComplete
494
523
  export interface AgentUserMessageEvent {
495
524
  type: "user_message";
496
525
  message: Message;
526
+ /** Canonical sender ID when another agent submitted this message. */
527
+ senderAgentId?: string;
497
528
  }
498
529
  export interface AgentModelRequestEvent {
499
530
  type: "model_request";
@@ -641,7 +672,9 @@ export interface PayloadByStage {
641
672
  }
642
673
  export interface ExtensionContext {
643
674
  state: TurnState;
644
- /** Present only on the assistant-message `afterMessageAppend` run. */
675
+ delivery: "model" | "program-intermediate";
676
+ executionScope: ToolExecutionScope;
677
+ /** Present on assistant appends and coordinator-owned user appends. */
645
678
  turnMeta?: TurnMessageMeta;
646
679
  }
647
680
  export type Transformer<S extends TransformableStage> = (payload: PayloadByStage[S], ctx: ExtensionContext) => PayloadByStage[S] | Promise<PayloadByStage[S]>;
@@ -683,16 +716,29 @@ export interface RunTurnDeps {
683
716
  onEvent?: AgentEventHandler;
684
717
  sessionDir?: string | (() => string | undefined);
685
718
  outputFormat?: OutputFormat;
719
+ executionScope?: ToolExecutionScope;
720
+ beginProgramTrace?: BeginProgramTrace;
686
721
  }
687
722
  export type AgentInput = MessageInput | string;
688
- export type SteeringInputDrain = () => Promise<AgentInput[]>;
689
723
  /** Immutable ownership metadata for the exact agent submission being sent. */
690
724
  export type AgentSubmission = Readonly<{
691
725
  origin: "user";
692
726
  }> | Readonly<{
693
727
  origin: "coordinator";
694
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;
695
740
  }>;
741
+ export type SteeringInputDrain = () => Promise<SteeringInput[]>;
696
742
  export interface AgentSendOptions {
697
743
  streaming?: boolean;
698
744
  signal?: AbortSignal;
@@ -715,6 +761,8 @@ export interface AgentOptions {
715
761
  getContextWindowLimit?: (request: ChatRequest) => number | undefined;
716
762
  sessionDir?: string | (() => string | undefined);
717
763
  outputFormat?: OutputFormat;
764
+ executionScope?: ToolExecutionScope;
765
+ beginProgramTrace?: BeginProgramTrace;
718
766
  }
719
767
  export interface AgentDefinitionFactoryContext {
720
768
  agentId: string;
@@ -1,8 +1,14 @@
1
- import type { AnyToolDefinition, ToolRuntime, ToolRuntimeEventHandler, ToolRuntimeToolCallHandler } from "../../shared/types.ts";
1
+ import type { AgentEvent, AnyToolDefinition, BeginProgramTrace, ExtensionRegistry, ToolExecutionContext, ToolRuntime, ToolRuntimeToolCallHandler } from "../../shared/types.ts";
2
+ type InternalToolRuntimeEventHandler = (event: AgentEvent, ctx: ToolExecutionContext) => Promise<void> | void;
2
3
  interface InternalToolRuntimeOptions {
3
- onEvent?: ToolRuntimeEventHandler;
4
+ onEvent?: InternalToolRuntimeEventHandler;
4
5
  onToolCall?: ToolRuntimeToolCallHandler;
6
+ registry?: ExtensionRegistry;
7
+ beginProgramTrace?: BeginProgramTrace;
5
8
  }
9
+ export declare function closeBoundNestedToolExecution(executeNestedTool: ToolExecutionContext["executeNestedTool"], reason?: unknown): void;
10
+ export declare function drainBoundNestedToolPersistence(executeNestedTool: ToolExecutionContext["executeNestedTool"]): Promise<void>;
11
+ export declare function commitBoundToolExecutionTerminalState(executeNestedTool: ToolExecutionContext["executeNestedTool"]): void;
6
12
  export declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
7
13
  export {};
8
14
  //# sourceMappingURL=internal-tool-runtime.d.ts.map
@@ -3,11 +3,64 @@ 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;
9
60
  signal: AbortSignal;
10
61
  modelTier?: ModelTier;
62
+ /** Ancestors of the AssignTask call; the call's own ID remains in toolCallId. */
63
+ toolCallPath?: readonly string[];
11
64
  }
12
65
  export type DelegatedRoutingMetadata = {
13
66
  requestedModelTier: ModelTier;
@@ -59,7 +112,10 @@ export interface CreateDelegationToolsOptions {
59
112
  * delegation factory's own failure-release may safely converge here.
60
113
  */
61
114
  releaseAgentResources?: (context: DelegatedAgentFactoryContext) => void;
115
+ background?: BackgroundDelegationCapability;
62
116
  }
117
+ export declare function isValidDelegatedRunId(value: unknown): value is string;
118
+ export declare function createDelegatedRunId(): string;
63
119
  export declare function resolveDelegatedAgentOptions(definition: DelegatedAgentDefinition, ctx: DelegatedAgentFactoryContext): Promise<DelegatedAgentResolution>;
64
120
  export declare function createAssignTaskTool(options: CreateDelegationToolsOptions): import("../../shared/types.ts").ToolDefinition<{
65
121
  description: string;
@@ -94,8 +150,44 @@ export declare function createAssignTaskTool(options: CreateDelegationToolsOptio
94
150
  };
95
151
  required: string[];
96
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
+ }>;
97
189
  export declare const createDelegateToAgentTool: typeof createAssignTaskTool;
98
- export declare function createDelegationTools(options: CreateDelegationToolsOptions): import("../../shared/types.ts").ToolDefinition<{
190
+ export declare function createDelegationTools(options: CreateDelegationToolsOptions): (import("../../shared/types.ts").ToolDefinition<{
99
191
  description: string;
100
192
  agentId: string;
101
193
  nickname: string;
@@ -127,6 +219,18 @@ export declare function createDelegationTools(options: CreateDelegationToolsOpti
127
219
  };
128
220
  };
129
221
  required: string[];
130
- }>[];
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
+ }>)[];
131
235
  export {};
132
236
  //# sourceMappingURL=runtime-manager-tools.d.ts.map
@@ -24,6 +24,7 @@ export * from "./mcp/mcp-safe-error.ts";
24
24
  export { extractOwnedMcpSafeError } from "./mcp/mcp-safe-error-provenance.ts";
25
25
  export * from "./mcp/mcp-server-manager.ts";
26
26
  export * from "./mcp/mcp-tool-adapter.ts";
27
+ export { type CreateProgramOptions, createProgram } from "./program/program-tool.ts";
27
28
  export * from "./search/glob-tool.ts";
28
29
  export * from "./search/grep-engine.ts";
29
30
  export * from "./search/grep-tool.ts";