@nuvin/agent-core 0.0.0-rc.6 → 0.0.0-rc.8
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.
- package/dist/VERSION +2 -2
- package/dist/agent/index.d.ts +40 -3
- package/dist/agent/index.js +1 -1
- package/dist/chunk-4DNIDCX7.js +1 -1
- package/dist/chunk-G2FR4UGO.js +1 -1
- package/dist/chunk-KVFXQ7HW.js +1 -0
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/formats/index.d.ts +2 -2
- package/dist/formats/index.js +1 -1
- package/dist/models/index.d.ts +10 -4
- package/dist/models/index.js +1 -1
- package/dist/{provider-adapters-aW7frG5B.d.ts → provider-adapters-BGVEzrOK.d.ts} +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/tools/index.d.ts +131 -3
- package/dist/tools/index.js +1 -1
- package/dist/{types-BS0Io2Vs.d.ts → types-mpqTRf_e.d.ts} +40 -17
- package/package.json +2 -2
- package/dist/chunk-P54V754C.js +0 -1
package/dist/chunk-X7VAACWY.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x1565ce(_0x5590e4,_0x5bccc0,_0x335495,_0xbc10d8){var _0x15881e={_0x562fc4:0x3a0};return _0x1857(_0xbc10d8-_0x15881e._0x562fc4,_0x5bccc0);}(function(_0x26b67d,_0x344f89){var _0x20daa8={_0x2aa5af:0x4cd,_0x560b6d:0x4d7,_0xe41db5:0x4ce,_0x529258:0x490,_0x4ef559:0x484,_0x235521:0x489,_0x1534b5:0x491,_0x34a117:0x49c,_0x34c2e1:0x493,_0x54d3bc:0x48c,_0x17cbd7:0x48e,_0x5a09b9:0x48a,_0x5ae19b:0x4c5,_0x37eb74:0x490,_0x3a9408:0x4d1,_0x131929:0x4d3,_0x459d70:0x493,_0x4e4934:0x49b},_0x36c346={_0x5e2bec:0x386};function _0x4efcfa(_0x291ed2,_0x13cf68,_0x4fd76c,_0x4dde01){return _0x1857(_0x4dde01-0x34a,_0x4fd76c);}function _0x340308(_0x3fd399,_0x2418d4,_0x128b00,_0x435852){return _0x1857(_0x435852-_0x36c346._0x5e2bec,_0x3fd399);}var _0x367452=_0x26b67d();while(!![]){try{var _0x2df162=-parseInt(_0x340308(_0x20daa8._0x2aa5af,0x4c6,_0x20daa8._0x560b6d,_0x20daa8._0xe41db5))/0x1+-parseInt(_0x4efcfa(_0x20daa8._0x529258,0x48d,_0x20daa8._0x4ef559,0x48b))/0x2+-parseInt(_0x4efcfa(0x493,0x492,_0x20daa8._0x235521,_0x20daa8._0x1534b5))/0x3*(-parseInt(_0x4efcfa(0x49b,_0x20daa8._0x34a117,0x48a,_0x20daa8._0x34c2e1))/0x4)+parseInt(_0x4efcfa(_0x20daa8._0x54d3bc,_0x20daa8._0x17cbd7,0x482,_0x20daa8._0x5a09b9))/0x5+parseInt(_0x340308(_0x20daa8._0x5ae19b,0x4bd,0x4c9,0x4c5))/0x6+parseInt(_0x4efcfa(0x48c,0x498,_0x20daa8._0x17cbd7,_0x20daa8._0x37eb74))/0x7*(parseInt(_0x340308(_0x20daa8._0x3a9408,0x4d8,0x4d4,_0x20daa8._0x131929))/0x8)+parseInt(_0x4efcfa(0x493,_0x20daa8._0x459d70,_0x20daa8._0x4e4934,0x494))/0x9*(-parseInt(_0x4efcfa(0x47d,0x490,0x47f,0x486))/0xa);if(_0x2df162===_0x344f89)break;else _0x367452['push'](_0x367452['shift']());}catch(_0x5245bd){_0x367452['push'](_0x367452['shift']());}}}(_0x163f,0x6267a));function _0x1857(_0x454460,_0x3bc4c0){_0x454460=_0x454460-0x13c;var _0x163f78=_0x163f();var _0x185728=_0x163f78[_0x454460];if(_0x1857['lBzlBF']===undefined){var _0x54f12=function(_0x320532){var _0x12eb49='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x38ddb3='',_0x761160='';for(var _0x4a967f=0x0,_0x38b2e9,_0x35efad,_0x14cd4c=0x0;_0x35efad=_0x320532['charAt'](_0x14cd4c++);~_0x35efad&&(_0x38b2e9=_0x4a967f%0x4?_0x38b2e9*0x40+_0x35efad:_0x35efad,_0x4a967f++%0x4)?_0x38ddb3+=String['fromCharCode'](0xff&_0x38b2e9>>(-0x2*_0x4a967f&0x6)):0x0){_0x35efad=_0x12eb49['indexOf'](_0x35efad);}for(var _0x997fdb=0x0,_0x201ed3=_0x38ddb3['length'];_0x997fdb<_0x201ed3;_0x997fdb++){_0x761160+='%'+('00'+_0x38ddb3['charCodeAt'](_0x997fdb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x761160);};_0x1857['WRJPmo']=_0x54f12,_0x1857['wCwaFz']={},_0x1857['lBzlBF']=!![];}var _0x3ef2f1=_0x163f78[0x0],_0x37883c=_0x454460+_0x3ef2f1,_0x34f51c=_0x1857['wCwaFz'][_0x37883c];return!_0x34f51c?(_0x185728=_0x1857['WRJPmo'](_0x185728),_0x1857['wCwaFz'][_0x37883c]=_0x185728):_0x185728=_0x34f51c,_0x185728;}var OperationAbortedError=class extends Error{[_0x1565ce(0x4f4,0x4f1,0x4f1,0x4ee)]='ABORT_ERR';constructor(_0x38ddb3='Operation\x20aborted'){var _0x29d6af={_0x421018:0xeb,_0x213f0c:0xf1,_0x56d8f3:0xe7,_0x58c801:0xed,_0x51557b:0xe8},_0x3adde0={_0x5275a0:0x22,_0x32e3fd:0x1ec},_0x5c22fe={_0x215699:0x9c};super(_0x38ddb3);function _0x330f36(_0x3af640,_0x32c2e1,_0x3a2197,_0x4c078b){return _0x1565ce(_0x3af640-0x2f,_0x4c078b,_0x3a2197-_0x5c22fe._0x215699,_0x3a2197- -0x3fc);}function _0x29a89f(_0x34cfc3,_0x1c4ce9,_0x3fdcea,_0x2b8cfb){return _0x1565ce(_0x34cfc3-_0x3adde0._0x5275a0,_0x2b8cfb,_0x3fdcea-_0x3adde0._0x32e3fd,_0x3fdcea- -0x33b);}this[_0x330f36(_0x29d6af._0x421018,_0x29d6af._0x213f0c,_0x29d6af._0x56d8f3,0xea)]=_0x330f36(_0x29d6af._0x58c801,0xf0,_0x29d6af._0x51557b,0xf0);}};function toAbortError(_0x761160){var _0x13df95={_0x19f39a:0x1d2,_0x249867:0x1d1},_0x1882f8={_0x4237ae:0x311},_0x2465bd={_0x10bbe2:0x1a6,_0xcc4841:0x482};function _0x3dc911(_0x128c76,_0x4a82b8,_0x775eee,_0x50edf8){return _0x1565ce(_0x128c76-_0x2465bd._0x10bbe2,_0x775eee,_0x775eee-0x5d,_0x4a82b8- -_0x2465bd._0xcc4841);}if(isAbortError(_0x761160))return _0x761160;if(_0x761160 instanceof Error)return new OperationAbortedError(_0x761160[_0x21d54c(0x1d0,0x1da,0x1da,0x1d7)]);function _0x21d54c(_0x19c934,_0x448332,_0xa114c6,_0x106261){return _0x1565ce(_0x19c934-0x13a,_0x19c934,_0xa114c6-0x14,_0xa114c6- -_0x1882f8._0x4237ae);}if(typeof _0x761160==='string'&&_0x761160[_0x21d54c(0x1c9,_0x13df95._0x19f39a,_0x13df95._0x249867,0x1d3)]>0x0)return new OperationAbortedError(_0x761160);return new OperationAbortedError();}function isAbortError(_0x4a967f){var _0x54013e={_0x47a961:0x45,_0x56c0da:0x3c,_0x31a718:0x3f,_0x319234:0x3d},_0xb2fb29={_0x1adbad:0x16},_0x241841={_0x42e96a:0xd8,_0x8bd835:0xab};function _0x2820c4(_0x446b0d,_0x191452,_0xe2ec52,_0x3f2d3a){return _0x1565ce(_0x446b0d-_0x241841._0x42e96a,_0x191452,_0xe2ec52-_0x241841._0x8bd835,_0x446b0d- -0x528);}function _0x9674(_0x5e5ef6,_0x580667,_0x22fff2,_0x45bc2a){return _0x1565ce(_0x5e5ef6-_0xb2fb29._0x1adbad,_0x22fff2,_0x22fff2-0x130,_0x580667- -0xa2);}return _0x4a967f instanceof OperationAbortedError||_0x4a967f instanceof Error&&(_0x4a967f[_0x2820c4(-_0x54013e._0x47a961,-0x4c,-_0x54013e._0x56c0da,-0x3c)]===_0x9674(0x449,0x442,0x442,0x43f)||'code'in _0x4a967f&&_0x4a967f[_0x2820c4(-0x3a,-_0x54013e._0x31a718,-0x3d,-_0x54013e._0x319234)]==='ABORT_ERR');}function throwIfAborted(_0x38b2e9){var _0x6458bf={_0x2e479d:0x47a,_0x2012d1:0x47e},_0x1e6e11={_0x41e97d:0x15a,_0x4974fe:0x64};function _0x1fd41e(_0x3a21a9,_0x1d0836,_0x29e75b,_0xe9a713){return _0x1565ce(_0x3a21a9-0x15a,_0xe9a713,_0x29e75b-_0x1e6e11._0x41e97d,_0x1d0836- -_0x1e6e11._0x4974fe);}if(!_0x38b2e9?.['aborted'])return;throw toAbortError(_0x38b2e9[_0x1fd41e(0x481,_0x6458bf._0x2e479d,0x477,_0x6458bf._0x2012d1)]);}function _0x163f(){var _0x162799=['mZCWotq4u1LAD3fA','BgvUz3rO','BMfTzq','qwjVCNrfCNjVCG','ywjVCNq','mZq4mtaZn0z4ELPAqW','mZe2odmZtLPYrvLY','nZmYnde5CgrJDevH','mJHgsgXrAuK','mZq5mKzUC3LQwa','BwvZC2fNzq','ywrKrxzLBNrmAxn0zw5LCG','ofvisuzjva','y29Kzq','ywjVCNrLza','mtaYmtbKEeXQrfu','CMvTB3zLrxzLBNrmAxn0zw5LCG','CMvHC29U','mtaYmde4nKLQzhnAvW','mtu1mJu0mhLKC3Pcvq'];_0x163f=function(){return _0x162799;};return _0x163f();}function addAbortListener(_0x35efad,_0x14cd4c){var _0x474c70={_0x48122f:0x4cc,_0x5803e7:0x4cd,_0x1207d4:0x229,_0x574e07:0x22d,_0x3eba71:0x231,_0x390ba0:0x4c3,_0x47741c:0x4b2},_0x3994a6={_0x122991:0x451,_0x5b113f:0x45a,_0x3a7543:0x16e,_0x24b7c6:0x16d},_0x3eb7b0={_0x37c62e:0x628,_0x42e382:0xd},_0x3ebbdf={_0x22d325:0x5e},_0x545ecc={_0x4d766a:0xec},_0x9355a3={_0x33ad0d:0x193,_0xf01ae9:0x179};if(!_0x35efad)return()=>{};if(_0x35efad[_0x46a5c9(0x4c9,_0x474c70._0x48122f,0x4c4,_0x474c70._0x5803e7)])return _0x14cd4c(),()=>{};const _0x997fdb=()=>{_0x14cd4c();};function _0x46a5c9(_0x44bebe,_0x2147ad,_0x18f4ff,_0x2e097f){return _0x1565ce(_0x44bebe-_0x9355a3._0x33ad0d,_0x44bebe,_0x18f4ff-_0x9355a3._0xf01ae9,_0x18f4ff- -0x2b);}_0x35efad[_0x21b2e6(-_0x474c70._0x1207d4,-_0x474c70._0x574e07,-0x223,-_0x474c70._0x3eba71)](_0x46a5c9(_0x474c70._0x390ba0,0x4bd,0x4ba,_0x474c70._0x47741c),_0x997fdb,{'once':!![]});function _0x21b2e6(_0x15ea0c,_0x56f8f3,_0x4aa640,_0xed5568){return _0x1565ce(_0x15ea0c-_0x545ecc._0x4d766a,_0xed5568,_0x4aa640-0x6b,_0x15ea0c- -0x715);}return()=>{function _0x426d4c(_0x39dfe9,_0x36e369,_0x371c4e,_0x66259a){return _0x46a5c9(_0x39dfe9,_0x36e369-0xde,_0x36e369- -_0x3ebbdf._0x22d325,_0x66259a-0x63);}function _0x8f035(_0x12b498,_0x5412e2,_0x599fb6,_0x43df14){return _0x46a5c9(_0x599fb6,_0x5412e2-0x31,_0x5412e2- -_0x3eb7b0._0x37c62e,_0x43df14-_0x3eb7b0._0x42e382);}_0x35efad[_0x426d4c(_0x3994a6._0x122991,0x454,0x44b,_0x3994a6._0x5b113f)](_0x8f035(-0x175,-_0x3994a6._0x3a7543,-0x175,-_0x3994a6._0x24b7c6),_0x997fdb);};}export{OperationAbortedError,toAbortError,isAbortError,throwIfAborted,addAbortListener};
|
package/dist/formats/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { t as toOpenAiResponsesRequest } from '../provider-adapters-
|
|
1
|
+
import { g as ContentBlock, h as TextBlock, i as ContentInput, S as SystemInput, j as MessageInput, M as Message, k as CompileRequestInput, l as ModelRequest, C as ChatRequest, m as ModelResponse, n as ChatResponse, o as ToolUseBlock, p as ToolResultBlock, q as ToolResult } from '../types-mpqTRf_e.js';
|
|
2
|
+
export { t as toOpenAiResponsesRequest } from '../provider-adapters-BGVEzrOK.js';
|
|
3
3
|
|
|
4
4
|
declare function hasPastedImages(input: string): boolean;
|
|
5
5
|
declare function contentFromPastedText(input: string): ContentBlock[];
|
package/dist/formats/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fccc2,_0xd18287){const _0x5f0a10={_0x4dda41:0x4be,_0x3a5604:0x4b9,_0x3604bb:0x4b5,_0x206ad7:0x116,_0xdc7bd6:0x4bd,_0x508366:0x4c0,_0x17af23:0x4ba,_0x8aad54:0x106,_0x5e88f7:0x10b,_0x4246fd:0x104,_0x3b9fee:0x108,_0x55f9d2:0x103,_0x54f999:0x4af,_0x4629f8:0x10a,_0x419af2:0x105},_0x27baa8={_0x118b55:0x3c6},_0x2b6516=_0x1fccc2();function _0x3d8aa5(_0xefeec9,_0x30655b,_0x327447,_0x42c5de){return _0x4350(_0x327447-_0x27baa8._0x118b55,_0xefeec9);}function _0x2a404f(_0x21ef54,_0x43cb59,_0xbcb761,_0x4bcbf0){return _0x4350(_0x43cb59- -0x1fc,_0x4bcbf0);}while(!![]){try{const _0x1660f1=parseInt(_0x3d8aa5(_0x5f0a10._0x4dda41,_0x5f0a10._0x3a5604,_0x5f0a10._0x3604bb,0x4af))/0x1*(parseInt(_0x2a404f(-0x10e,-0x10e,-0x115,-0x117))/0x2)+-parseInt(_0x2a404f(-0x110,-0x10f,-_0x5f0a10._0x206ad7,-0x110))/0x3+parseInt(_0x3d8aa5(0x4bb,_0x5f0a10._0xdc7bd6,0x4c2,0x4cd))/0x4+-parseInt(_0x3d8aa5(0x4b4,0x4b9,0x4ae,0x4a9))/0x5*(-parseInt(_0x3d8aa5(0x4c3,_0x5f0a10._0x508366,0x4bb,_0x5f0a10._0x17af23))/0x6)+-parseInt(_0x2a404f(-0x10e,-_0x5f0a10._0x8aad54,-_0x5f0a10._0x5e88f7,-0x10e))/0x7*(parseInt(_0x2a404f(-0x10c,-_0x5f0a10._0x4246fd,-_0x5f0a10._0x3b9fee,-_0x5f0a10._0x55f9d2))/0x8)+parseInt(_0x3d8aa5(0x4b7,0x4bf,0x4b6,0x4b1))/0x9+-parseInt(_0x3d8aa5(_0x5f0a10._0x54f999,0x4a7,0x4b2,0x4ac))/0xa*(parseInt(_0x2a404f(-_0x5f0a10._0x5e88f7,-_0x5f0a10._0x4629f8,-_0x5f0a10._0x419af2,-0x10b))/0xb);if(_0x1660f1===_0xd18287)break;else _0x2b6516['push'](_0x2b6516['shift']());}catch(_0x13f06c){_0x2b6516['push'](_0x2b6516['shift']());}}}(_0x4b2e,0x31e2a));function _0x4b2e(){const _0x49d01a=['mJy2mty0mef1tuvUwG','ChvZAa','Aw5KzxG','DgvZDa','mte0nJq4DurhEhjK','BgfZDeLUzgv4','nxHdDLv6uW','Aw1Hz2u','CMvWBgfJzq','Aw1Hz2uVANbLzW','mJuWyLHttKvJ','mtG4mtG3BKLYsKvI','mtyYDgDVsevO','nta0nvDZBxjjDG','mtC2nte5n2fArgnyqW','Bwf0y2HbBgW','mtG1ntGXqvr2z2jL','C2XPy2u','Dgv4Da','mJmYodu5neXuC3PQzG','n0nute5xvq','BgvUz3rO'];_0x4b2e=function(){return _0x49d01a;};return _0x4b2e();}import{toOpenAiResponsesRequest}from'../chunk-4DNIDCX7.js';import'../chunk-NYZR4XKO.js';import{compileRequest,createAssistantTextMessage,createReasoningMessage,createTextBlock,createToolResultUserMessage,createToolUseMessage,getReasoningTextFromMessage,getTextFromMessage,getToolResultBlocks,getToolUseBlocks,normalizeContent,normalizeMessage,normalizeSystem,normalizeTextBlock,responseToAssistantMessage,toChatRequest,toChatResponse,toModelRequest,toModelResponse,toProviderModelRequest}from'../chunk-G2FR4UGO.js';var DATA_URI_REGEX=/data:(image\/(?:png|jpeg|jpg|gif|webp));base64,([A-Za-z0-9+/\r\n]+={0,2})/g;function normalizeMediaType(_0xe7b8e9){const _0x23dbbd={_0x30edb5:0x475,_0x1f8de0:0x47d};function _0x292e80(_0x28b3ab,_0x17c603,_0x144fd1,_0x53f0c8){return _0x4350(_0x17c603-0x38a,_0x53f0c8);}return _0xe7b8e9==='image/jpg'?_0x292e80(0x47d,_0x23dbbd._0x30edb5,0x472,_0x23dbbd._0x1f8de0):_0xe7b8e9;}function isValidBase64(_0x1bbf77){const _0x3f0bdf={_0x2af7e4:0x19b,_0x211807:0x199,_0xa7c6ac:0x2c9},_0x9078bf={_0x53e526:0x1cb};function _0x2a4444(_0x5d04cf,_0x21d947,_0x64d59a,_0x124c9e){return _0x4350(_0x124c9e-_0x9078bf._0x53e526,_0x21d947);}function _0x31c087(_0x44378f,_0x42ce25,_0x50f97c,_0x323fe0){return _0x4350(_0x323fe0- -0x290,_0x50f97c);}if(_0x1bbf77[_0x31c087(-_0x3f0bdf._0x2af7e4,-0x19a,-0x1a2,-_0x3f0bdf._0x211807)]===0x0||_0x1bbf77['length']%0x4!==0x0)return![];return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/[_0x2a4444(0x2c8,0x2c5,_0x3f0bdf._0xa7c6ac,0x2c6)](_0x1bbf77);}function collectImageMatches(_0x418807){const _0x30b414={_0xe6dc8:0xff,_0x369c67:0x413,_0x3e574b:0x40d},_0x1a237f={_0x54233a:0x379,_0xd31515:0x37f,_0x265e38:0x382};DATA_URI_REGEX[_0x34d21d(-0xf7,-0xfb,-_0x30b414._0xe6dc8,-0xf5)]=0x0;function _0x2d7578(_0x2a7b7c,_0x2b7161,_0x26a5f5,_0x314e43){return _0x4350(_0x314e43-0x320,_0x26a5f5);}function _0x34d21d(_0x3b8744,_0x443ad2,_0x201c4e,_0xdc63ee){return _0x4350(_0xdc63ee- -0x1f2,_0x201c4e);}return Array['from'](_0x418807[_0x2d7578(0x40f,_0x30b414._0x369c67,_0x30b414._0x3e574b,0x411)](DATA_URI_REGEX))['filter'](_0xfcfebb=>{const _0x449722=(_0xfcfebb[0x2]??'')[_0x3a49b9(_0x1a237f._0x54233a,_0x1a237f._0xd31515,0x37f,_0x1a237f._0x265e38)](/[\r\n]/g,'');function _0x3a49b9(_0x2bdbee,_0x562ac2,_0x2f144c,_0xf9163b){return _0x34d21d(_0x2bdbee-0x1c6,_0x562ac2-0x100,_0x2f144c,_0x2bdbee-0x481);}return isValidBase64(_0x449722);});}function hasPastedImages(_0x4bb700){const _0x43d5b1={_0x3ec55b:0x229},_0x46aced={_0x54f9c1:0x132};function _0x4fe4b6(_0x5ead84,_0x571e0d,_0x24f5de,_0xc371bd){return _0x4350(_0xc371bd-_0x46aced._0x54f9c1,_0x571e0d);}return collectImageMatches(_0x4bb700)[_0x4fe4b6(0x230,0x220,0x22b,_0x43d5b1._0x3ec55b)]>0x0;}function contentFromPastedText(_0x12e826){const _0x517e5d={_0xaea6a8:0xc,_0x5d3f97:0x15c,_0x132ed8:0x153,_0x1f005b:0x162,_0x2024f4:0x163,_0x2740e6:0x158,_0x1b5fb2:0x15,_0x30e4c6:0xb,_0x343205:0x15,_0x33366e:0x16e,_0x4f1176:0x16b,_0x3882ec:0x9,_0x2e8641:0x9,_0x55a1ee:0x1,_0x31c007:0x161,_0xd7b31c:0x0,_0x1507c5:0x15e,_0x2e250b:0x15e,_0x1fec9b:0x5,_0x6d6b61:0x6,_0x40b4be:0x2},_0x55f03e={_0x2ad02f:0x255},_0x339281={_0x557928:0xee},_0x544ce1=collectImageMatches(_0x12e826),_0x519c4e=[];let _0x156230=0x0;for(const _0x4aeaa0 of _0x544ce1){const _0x205cc7=_0x4aeaa0[_0x26ea9d(0xf,_0x517e5d._0xaea6a8,0x13,0x5)]??0x0,[_0x184043,_0x44fb71,_0x4cb7ed]=_0x4aeaa0;_0x205cc7>_0x156230&&_0x519c4e[_0x39810f(-0x15b,-_0x517e5d._0x5d3f97,-_0x517e5d._0x132ed8,-_0x517e5d._0x5d3f97)]({'type':'text','text':_0x12e826[_0x39810f(-_0x517e5d._0x1f005b,-_0x517e5d._0x2024f4,-_0x517e5d._0x2740e6,-_0x517e5d._0x1f005b)](_0x156230,_0x205cc7)}),_0x519c4e[_0x26ea9d(_0x517e5d._0x1b5fb2,_0x517e5d._0x30e4c6,0xa,_0x517e5d._0x343205)]({'type':_0x39810f(-_0x517e5d._0x33366e,-0x167,-0x172,-0x16c),'source':{'type':'base64','media_type':normalizeMediaType(_0x44fb71),'data':_0x4cb7ed[_0x39810f(-0x165,-0x164,-_0x517e5d._0x2024f4,-_0x517e5d._0x4f1176)](/[\r\n]/g,'')}}),_0x156230=_0x205cc7+_0x184043[_0x26ea9d(-0x1,_0x517e5d._0x3882ec,_0x517e5d._0x2e8641,_0x517e5d._0x55a1ee)];}function _0x26ea9d(_0x56ce30,_0x194d7b,_0x3a1426,_0x287b78){return _0x4350(_0x194d7b- -_0x339281._0x557928,_0x3a1426);}_0x156230<_0x12e826['length']&&_0x519c4e['push']({'type':_0x39810f(-0x16c,-0x167,-0x16a,-_0x517e5d._0x31c007),'text':_0x12e826[_0x26ea9d(_0x517e5d._0xd7b31c,0x5,-0x4,0x7)](_0x156230)});function _0x39810f(_0xf66723,_0x4423c9,_0x47f670,_0x365a93){return _0x4350(_0x365a93- -_0x55f03e._0x2ad02f,_0x47f670);}return _0x519c4e[_0x39810f(-0x159,-_0x517e5d._0x132ed8,-_0x517e5d._0x1507c5,-_0x517e5d._0x2e250b)]>0x0?_0x519c4e:[{'type':_0x26ea9d(_0x517e5d._0x1fec9b,_0x517e5d._0x6d6b61,_0x517e5d._0x40b4be,0x0),'text':_0x12e826}];}function _0x4350(_0x42f426,_0x408b94){_0x42f426=_0x42f426-0xe8;const _0x4b2e86=_0x4b2e();let _0x435040=_0x4b2e86[_0x42f426];if(_0x4350['uUfDbO']===undefined){var _0x1f2225=function(_0x33677c){const _0x20918d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xe7b8e9='',_0x1bbf77='';for(let _0x418807=0x0,_0xfcfebb,_0x449722,_0x4bb700=0x0;_0x449722=_0x33677c['charAt'](_0x4bb700++);~_0x449722&&(_0xfcfebb=_0x418807%0x4?_0xfcfebb*0x40+_0x449722:_0x449722,_0x418807++%0x4)?_0xe7b8e9+=String['fromCharCode'](0xff&_0xfcfebb>>(-0x2*_0x418807&0x6)):0x0){_0x449722=_0x20918d['indexOf'](_0x449722);}for(let _0x12e826=0x0,_0x544ce1=_0xe7b8e9['length'];_0x12e826<_0x544ce1;_0x12e826++){_0x1bbf77+='%'+('00'+_0xe7b8e9['charCodeAt'](_0x12e826)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1bbf77);};_0x4350['tEuaig']=_0x1f2225,_0x4350['Kawfmb']={},_0x4350['uUfDbO']=!![];}const _0x5d6ea8=_0x4b2e86[0x0],_0x19aafa=_0x42f426+_0x5d6ea8,_0x15d75f=_0x4350['Kawfmb'][_0x19aafa];return!_0x15d75f?(_0x435040=_0x4350['tEuaig'](_0x435040),_0x4350['Kawfmb'][_0x19aafa]=_0x435040):_0x435040=_0x15d75f,_0x435040;}export{compileRequest,contentFromPastedText,createAssistantTextMessage,createReasoningMessage,createTextBlock,createToolResultUserMessage,createToolUseMessage,getReasoningTextFromMessage,getTextFromMessage,getToolResultBlocks,getToolUseBlocks,hasPastedImages,normalizeContent,normalizeMessage,normalizeSystem,normalizeTextBlock,responseToAssistantMessage,toChatRequest,toChatResponse,toModelRequest,toModelResponse,toOpenAiResponsesRequest,toProviderModelRequest};
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { P as ProviderSessionResolver,
|
|
2
|
-
export {
|
|
3
|
-
import { t as toOpenAiResponsesRequest } from '../provider-adapters-
|
|
1
|
+
import { P as ProviderSessionResolver, r as ResolvedProviderSession, s as ProviderRequestMutator, l as ModelRequest, t as PreparedRequest, C as ChatRequest, u as ProviderCredential, E as EngineChatModel, v as ReasoningConfig, w as ChatResponseChunk, n as ChatResponse, x as ModelExecutionOptions, B as BaseChatModelOptions, y as ModelInfo, z as ModelLimits } from '../types-mpqTRf_e.js';
|
|
2
|
+
export { D as ProviderCredentialKind, F as ProviderEndpoints } from '../types-mpqTRf_e.js';
|
|
3
|
+
import { t as toOpenAiResponsesRequest } from '../provider-adapters-BGVEzrOK.js';
|
|
4
4
|
|
|
5
5
|
interface PrepareProviderRequestOptions {
|
|
6
6
|
sessionManager?: ProviderSessionManager;
|
|
@@ -312,6 +312,7 @@ declare class GitHubModel extends OpenAiModel {
|
|
|
312
312
|
private streamViaConfiguredSurface;
|
|
313
313
|
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
314
314
|
stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
315
|
+
private streamChatCompletionsWithSessionRefresh;
|
|
315
316
|
getModels(signal?: AbortSignal): Promise<ModelInfo[]>;
|
|
316
317
|
}
|
|
317
318
|
|
|
@@ -339,4 +340,9 @@ declare class MockModel implements EngineChatModel {
|
|
|
339
340
|
complete(request: ChatRequest, _options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
340
341
|
}
|
|
341
342
|
|
|
342
|
-
|
|
343
|
+
type RawModelResponse = Record<string, unknown>;
|
|
344
|
+
declare function getFallbackModelLimits(provider: string, model: string): ModelLimits | undefined;
|
|
345
|
+
declare function normalizeModelInfo(provider: string, model: RawModelResponse): ModelInfo;
|
|
346
|
+
declare function normalizeModelLimits(provider: string, model: RawModelResponse): ModelLimits | undefined;
|
|
347
|
+
|
|
348
|
+
export { ANTHROPIC_MESSAGES_STREAM_SURFACE, ANTHROPIC_MESSAGES_SURFACE, AVAILABLE_CHAT_MODEL_SURFACES, type AnthropicHeaderResolver, AnthropicModel, type AnthropicModelOptions, type AnthropicRequestHeadersContext, ChatModel, type ChatModelAuthScheme, type ChatModelOptions, type ChatModelSurface, type FetchJsonOptions, GitHubModel, type GitHubModelOptions, type GitHubModelSurface, MockModel, type MockModelOptions, type ModelSurfaceRouter, type ModelWebSocket, OPENAI_CHAT_COMPLETIONS_STREAM_SURFACE, OPENAI_CHAT_COMPLETIONS_SURFACE, OPENAI_RESPONSES_STREAM_SURFACE, OPENAI_RESPONSES_SURFACE, OPENAI_RESPONSES_WEBSOCKET_SURFACE, OpenAiApiError, type OpenAiHeaderResolver, OpenAiModel, type OpenAiModelOptions, type OpenAiRequestHeadersContext, type PrepareProviderRequestOptions, type ProviderAdapter, ProviderCredential, type ProviderHeaderContext, ProviderRequestMutator, ProviderSessionManager, ProviderSessionResolver, ResolvedProviderSession, RoutedModel, type RoutedModelMode, type RoutedModelOptions, type RoutedModelStreamParser, type RoutedModelSurface, type RoutedModelSurfaceRequest, StaticModelSurfaceRouter, type WebSocketFactory, createAnthropicSurfaces, createDefaultWebSocketFactory, createOpenAiApiError, createOpenAiResponsesStreamParser, createOpenAiResponsesWebSocketEvent, createOpenAiSurfaces, fetchJsonResponse, fetchRawResponse, getFallbackModelLimits, iterateSseEvents, iterateWebSocketMessages, normalizeModelInfo, normalizeModelLimits, prepareProviderRequest, resolveApiCredential, resolveSessionBaseUrl, toWebSocketUrl, trimTrailingSlashes, waitForWebSocketOpen };
|