@nuvin/agent-core 0.0.0-rc.9 → 0.1.0-rc.0
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/agent.d.ts +28 -0
- package/dist/agent/context-compactor.d.ts +8 -0
- package/dist/agent/extension-registry.d.ts +3 -0
- package/dist/agent/index.d.ts +8 -68
- package/dist/agent/index.js +1 -1
- package/dist/agent/messages-to-text.d.ts +3 -0
- package/dist/agent/metrics.d.ts +30 -0
- package/dist/agent/topic-reminder-extension.d.ts +32 -0
- package/dist/agent/turn-engine.d.ts +3 -0
- package/dist/chunk-FFIZ6TKW.js +1 -0
- package/dist/chunk-HRU363DY.js +1 -0
- package/dist/chunk-NHBKADBW.js +1 -0
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-QDOE7NWO.js +1 -0
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/formats/base64-image-content.d.ts +4 -0
- package/dist/formats/index.d.ts +4 -28
- package/dist/formats/index.js +1 -1
- package/dist/formats/message-format.d.ts +33 -0
- package/dist/formats/provider-adapters.d.ts +3 -0
- package/dist/hooks/executor.d.ts +3 -0
- package/dist/hooks/extensions.d.ts +28 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/registry.d.ts +8 -0
- package/dist/hooks/types.d.ts +40 -0
- package/dist/lsp/client.d.ts +11 -0
- package/dist/lsp/index.d.ts +24 -0
- package/dist/lsp/installer.d.ts +11 -0
- package/dist/lsp/language.d.ts +2 -0
- package/dist/lsp/server.d.ts +6 -0
- package/dist/lsp/types.d.ts +68 -0
- package/dist/models/anthropic-model.d.ts +27 -0
- package/dist/models/anthropic-surface.d.ts +5 -0
- package/dist/models/chat-model.d.ts +31 -0
- package/dist/models/github-model.d.ts +32 -0
- package/dist/models/http-transport.d.ts +10 -0
- package/dist/models/index.d.ts +16 -347
- package/dist/models/index.js +1 -1
- package/dist/models/mock-model.d.ts +15 -0
- package/dist/models/model-errors.d.ts +16 -0
- package/dist/models/model-limits.d.ts +7 -0
- package/dist/models/model-registry.d.ts +44 -0
- package/dist/models/model-surface-router.d.ts +19 -0
- package/dist/models/model-transports.d.ts +17 -0
- package/dist/models/openai-model.d.ts +67 -0
- package/dist/models/openai-surfaces.d.ts +74 -0
- package/dist/models/provider-adapter.d.ts +23 -0
- package/dist/models/provider-session.d.ts +16 -0
- package/dist/models/routed-model.d.ts +90 -0
- package/dist/shared/abort.d.ts +9 -0
- package/dist/shared/index.d.ts +5 -17
- package/dist/shared/index.js +1 -1
- package/dist/shared/reasoning-config.d.ts +5 -0
- package/dist/shared/turn-failed.d.ts +6 -0
- package/dist/{types-Bb2eVtsy.d.ts → shared/types.d.ts} +180 -164
- package/dist/tools/ask-user-tool.d.ts +55 -0
- package/dist/tools/background-process-registry.d.ts +64 -0
- package/dist/tools/bash-internals.d.ts +5 -0
- package/dist/tools/bash-output-tool.d.ts +20 -0
- package/dist/tools/bash-tool.d.ts +75 -0
- package/dist/tools/command-tool.d.ts +23 -0
- package/dist/tools/file-edit-tool.d.ts +29 -0
- package/dist/tools/file-new-tool.d.ts +21 -0
- package/dist/tools/file-read-tool.d.ts +27 -0
- package/dist/tools/glob-tool.d.ts +26 -0
- package/dist/tools/grep-tool.d.ts +34 -0
- package/dist/tools/index.d.ts +31 -773
- package/dist/tools/index.js +1 -1
- package/dist/tools/internal-tool-runtime.d.ts +8 -0
- package/dist/tools/kill-shell-tool.d.ts +16 -0
- package/dist/tools/ls-tool.d.ts +20 -0
- package/dist/tools/lsp-tool.d.ts +36 -0
- package/dist/tools/mcp-oauth-provider.d.ts +11 -0
- package/dist/tools/mcp-server-manager.d.ts +43 -0
- package/dist/tools/mcp-tool-adapter.d.ts +47 -0
- package/dist/tools/mock-tool-runtime.d.ts +3 -0
- package/dist/tools/ripgrep.d.ts +20 -0
- package/dist/tools/runtime-manager-tools.d.ts +58 -0
- package/dist/tools/safe-fetch.d.ts +36 -0
- package/dist/tools/skill-tool.d.ts +33 -0
- package/dist/tools/todo-write-tool.d.ts +66 -0
- package/dist/tools/tool-output-offload.d.ts +12 -0
- package/dist/tools/tools.d.ts +24 -0
- package/dist/tools/update-topic-tool.d.ts +12 -0
- package/dist/tools/view-file-tool.d.ts +22 -0
- package/dist/tools/web-fetch-tool.d.ts +23 -0
- package/dist/tools/web-search-tool.d.ts +75 -0
- package/dist/tools/workspace-paths.d.ts +5 -0
- package/package.json +6 -2
- package/dist/chunk-3QLMAAJY.js +0 -1
- package/dist/chunk-4DNIDCX7.js +0 -1
- package/dist/chunk-G2FR4UGO.js +0 -1
- package/dist/provider-adapters-NxiNWlxu.d.ts +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x358e55,_0x463c28){const _0x53c659={_0x3e5fa0:0x49,_0x1d0f7e:0x46,_0x416fd0:0x54,_0xb6abd:0x5a,_0x14c2b2:0x4c,_0x14ea83:0x49,_0x4a4daf:0x101,_0x3baaf7:0xfd,_0x57438a:0xef,_0x3acd1c:0x115,_0x107356:0x7b,_0x4959fb:0x60,_0x13e175:0x76,_0x4345c8:0x143,_0x5013f7:0x147,_0x5a5840:0xf7,_0x2294d2:0x103,_0x89ad70:0x8c,_0x2d798f:0x63},_0x2d560d=_0x358e55();function _0x33eddc(_0x39f8c5,_0x21fd3c,_0x48c1ad,_0x245063){return _0x2aff(_0x21fd3c- -0x218,_0x245063);}function _0x9f97c7(_0x2413d2,_0x271a02,_0xa13c1d,_0xf301cb){return _0x2aff(_0x2413d2- -0x2c4,_0xa13c1d);}while(!![]){try{const _0x754e02=parseInt(_0x33eddc(-_0x53c659._0x3e5fa0,-_0x53c659._0x1d0f7e,-_0x53c659._0x416fd0,-0x5e))/0x1+-parseInt(_0x33eddc(-0x71,-_0x53c659._0xb6abd,-_0x53c659._0x14c2b2,-_0x53c659._0x14ea83))/0x2+parseInt(_0x9f97c7(-_0x53c659._0x4a4daf,-_0x53c659._0x3baaf7,-_0x53c659._0x57438a,-_0x53c659._0x3acd1c))/0x3+parseInt(_0x33eddc(-_0x53c659._0x107356,-0x65,-0x7b,-_0x53c659._0x4959fb))/0x4+-parseInt(_0x33eddc(-_0x53c659._0x13e175,-0x6a,-0x65,-0x74))/0x5+parseInt(_0x9f97c7(-0x129,-_0x53c659._0x4345c8,-_0x53c659._0x5013f7,-0x12e))/0x6*(-parseInt(_0x9f97c7(-0xf6,-_0x53c659._0x5a5840,-_0x53c659._0x2294d2,-0xe4))/0x7)+-parseInt(_0x33eddc(-0x6a,-0x6d,-0x59,-0x4e))/0x8*(-parseInt(_0x33eddc(-0x81,-0x7e,-_0x53c659._0x89ad70,-_0x53c659._0x2d798f))/0x9);if(_0x754e02===_0x463c28)break;else _0x2d560d['push'](_0x2d560d['shift']());}catch(_0x46d99d){_0x2d560d['push'](_0x2d560d['shift']());}}}(_0x1071,0xe5963));function createTextBlock(_0x50a7ca){const _0x8e187b={_0xe0d1fc:0x570,_0x2759a0:0x583},_0x58d09b={_0x8485a3:0x3cc};function _0x169dc8(_0x4f3bab,_0x3b2a59,_0x398acc,_0x1f708c){return _0x2aff(_0x398acc-_0x58d09b._0x8485a3,_0x1f708c);}return{'type':_0x169dc8(_0x8e187b._0xe0d1fc,0x56f,_0x8e187b._0x2759a0,0x590),'text':_0x50a7ca};}function normalizeTextBlock(_0x34ca69){return createTextBlock(_0x34ca69['text']??'');}function normalizeContent(_0x3544b3){const _0x38cdca={_0x61bef3:0x437,_0x5cf808:0x43d,_0x339cc1:0x43f,_0x43014e:0x332},_0xc61208={_0x2393c1:0x60,_0x2a5e39:0x62,_0x3be0ef:0x523,_0x3550f2:0x501,_0x18f185:0x501},_0x47f78e={_0x4ee570:0xa1,_0x512f26:0xa5};if(typeof _0x3544b3===_0x2390fe(0x450,_0x38cdca._0x61bef3,_0x38cdca._0x5cf808,_0x38cdca._0x339cc1))return[createTextBlock(_0x3544b3)];if(!Array[_0x554f15(0x331,0x350,_0x38cdca._0x43014e,0x33a)](_0x3544b3))return[];function _0x2390fe(_0x27a41c,_0x5055a1,_0x477985,_0x3bfbfe){return _0x2aff(_0x477985-0x279,_0x27a41c);}function _0x554f15(_0x2feca1,_0x40d7bf,_0x143977,_0x3c471d){return _0x2aff(_0x3c471d-0x175,_0x40d7bf);}return _0x3544b3['map'](_0xcd297c=>{const _0x1443b7={_0x493d79:0xbe,_0x531465:0x45f,_0x36e2d1:0x15a};function _0x140db2(_0x475767,_0x2c38b7,_0x2b5cf7,_0x56b0f9){return _0x554f15(_0x475767-_0x47f78e._0x4ee570,_0x475767,_0x2b5cf7-_0x47f78e._0x512f26,_0x56b0f9-0x1e5);}function _0xa1266c(_0xfb7c3b,_0x42a813,_0x5530a2,_0x32ba48){return _0x2390fe(_0x42a813,_0x42a813-_0x1443b7._0x493d79,_0xfb7c3b- -_0x1443b7._0x531465,_0x32ba48-_0x1443b7._0x36e2d1);}if(_0xcd297c[_0xa1266c(-0x44,-_0xc61208._0x2393c1,-0x33,-_0xc61208._0x2a5e39)]===_0x140db2(_0xc61208._0x3be0ef,_0xc61208._0x3550f2,_0xc61208._0x18f185,0x511))return normalizeTextBlock(_0xcd297c);return structuredClone(_0xcd297c);});}function normalizeSystem(_0x1c0b08=[]){const _0x31c9fd={_0xccbd72:0x4e8,_0xf4983c:0x4e1,_0x417fb4:0x4e4},_0x53350a={_0x2ef08d:0x339};function _0x10d31f(_0x51822f,_0x2f812f,_0x2b9ca9,_0x5a1924){return _0x2aff(_0x2b9ca9-0x2f0,_0x5a1924);}function _0x1cffb1(_0x57856a,_0x356869,_0x1a07c3,_0xf268cb){return _0x2aff(_0x57856a-_0x53350a._0x2ef08d,_0xf268cb);}return normalizeContent(_0x1c0b08)[_0x1cffb1(_0x31c9fd._0xccbd72,_0x31c9fd._0xf4983c,0x4f4,_0x31c9fd._0x417fb4)](_0x3c790b=>_0x3c790b[_0x1cffb1(0x4db,0x4cc,0x4bf,0x4e2)]==='text');}function normalizeMessage(_0x42546d){const _0x43bd10={_0x4840c0:0x30b,_0x567d46:0xe5,_0x2ed6c6:0x118,_0x66e11b:0x2f0,_0x50d20a:0x2d7,_0x562e62:0x300,_0x4a4dd9:0x2f0,_0x5ed1f9:0x2ec};function _0x4337e7(_0x3c1584,_0x356727,_0x3ee30f,_0xda8c06){return _0x2aff(_0x356727-0x150,_0xda8c06);}function _0x189625(_0x257206,_0x1639e6,_0xb71554,_0x5da114){return _0x2aff(_0x1639e6- -0xd0,_0xb71554);}return{...typeof _0x42546d['id']===_0x4337e7(_0x43bd10._0x4840c0,0x314,0x32d,0x300)?{'id':_0x42546d['id']}:{},'role':_0x42546d[_0x189625(0x107,0xff,0xee,0xfb)],'content':normalizeContent(_0x42546d[_0x189625(_0x43bd10._0x567d46,0xfc,_0x43bd10._0x2ed6c6,0x107)]),..._0x42546d[_0x4337e7(0x2ed,_0x43bd10._0x66e11b,_0x43bd10._0x50d20a,0x2de)]?{'providerState':structuredClone(_0x42546d[_0x4337e7(_0x43bd10._0x562e62,_0x43bd10._0x4a4dd9,0x2fa,_0x43bd10._0x5ed1f9)])}:{}};}function _0x1071(){const _0x22688a=['AgfZ','n3rXuhbXAq','CM9Szq','zxjYB3i','C3rVCf9YzwfZB24','mZu0nJqXu3LPDLPL','C2vZC2LVBKLK','yw50AhjVCgLJx3jLzgfJDgvKx3rOAw5RAw5N','Bwf4x3rVA2vUCW','ChvZAa','mti2ndi4nZz1EurMt00','otG1nJa4nKzvB050DG','DhjPBq','DxnHz2u','AM9PBG','vg9VBcbLEgvJDxrPB24GD2fZigLUDgvYCNvWDgvKigjLzM9YzsbJB21WBgv0Aw9UigfUzcbWCM9KDwnLzcbUBYbYzxn1BhqU','ChjVDMLKzxjtDgf0zq','Bwf4vg9Rzw5Z','DhLWzq','DxnLCG','Bwv0ywrHDge','zw5JCNLWDgvKq29UDgvUDa','BgvUz3rO','CMvHC29UAw5Nvg9Rzw5Z','B3v0Chv0vg9Rzw5Z','Aw5WDxruB2TLBNm','C3vTBwfYEq','mtzPru1cvwy','ywrK','Dg9VBf91C2vFAwq','nduYmdmYmhr1s2vovW','zMLSDgvY','CMvHC29UAw5Nx3rVA2vUCW','BwvZC2fNzxm','Dg9VBhm','ntaWotK1mKf5zgfprG','B3v0Chv0rM9YBwf0','Bw9KzwW','DgHPBMTPBMC','Dgv4Da','yw50AhjVCgLJx3rOAw5RAw5N','C3rVCfjLyxnVBG','C3LZDgvT','yxnZAxn0yw50','DhvYBL9Pza','CMvHC29UAw5N','mZqYotGXnhHoDMfKsa','C2vZC2LVBL9Pza','Dg9VBf91C2u','kgvUy3j5ChrLzcbYzwfZB25PBMCP','BwfW','mJm1nJe0nKX5CgDxtW','C3rYAw5N','AxnbCNjHEq','B3v0Chv0x3rVA2vUCW','zMXHDe1HCa','y2XHDwrLlxnVBM5LDc00ltiWmJuWnte0','Dg9VBf9Yzxn1Bhq','BwvZC2fNzq','B3bLBMfPx3jLyxnVBMLUzW','y29UDgvUDa'];_0x1071=function(){return _0x22688a;};return _0x1071();}function compileRequest(_0x531117){const _0x57f5c6={_0x5bb794:0x1cd,_0x3dac19:0x1d8,_0x113b8d:0x59c,_0x276db9:0x590,_0x57c080:0x59a,_0x2de7dc:0x5a0,_0x3c0652:0x1ba,_0x558033:0x1ca,_0x4f892f:0x1d3,_0x23fd27:0x1c3,_0x3e90b0:0x58a,_0x397cb1:0x5ac,_0x3a1489:0x565,_0x3742b2:0x56e},_0x4478f8={_0x339f99:0x3d8};function _0x14ea45(_0x37a216,_0x10065a,_0x2c46d8,_0x5bd089){return _0x2aff(_0x5bd089-0x23,_0x37a216);}function _0x5b13f0(_0x501413,_0x10f8e2,_0x157ec4,_0x223192){return _0x2aff(_0x223192-_0x4478f8._0x339f99,_0x10f8e2);}return{'model':_0x531117[_0x14ea45(_0x57f5c6._0x5bb794,0x1d6,_0x57f5c6._0x3dac19,_0x57f5c6._0x3dac19)]??_0x5b13f0(_0x57f5c6._0x113b8d,_0x57f5c6._0x276db9,_0x57f5c6._0x57c080,_0x57f5c6._0x2de7dc),'max_tokens':_0x531117[_0x14ea45(0x1ae,_0x57f5c6._0x3c0652,_0x57f5c6._0x558033,0x1bb)]??0x400,..._0x531117[_0x14ea45(_0x57f5c6._0x4f892f,0x1f4,_0x57f5c6._0x23fd27,0x1e0)]?{'reasoning':structuredClone(_0x531117[_0x5b13f0(_0x57f5c6._0x3e90b0,0x588,0x595,0x595)])}:{},'system':normalizeSystem(_0x531117[_0x14ea45(0x1f9,0x1ee,0x1cb,0x1dd)]),'messages':_0x531117['messages'][_0x5b13f0(0x5b8,_0x57f5c6._0x397cb1,0x5a4,_0x57f5c6._0x57c080)](normalizeMessage),'tools':structuredClone(_0x531117['tools']??[]),'metadata':{'session_id':_0x531117[_0x5b13f0(0x584,0x574,_0x57f5c6._0x3a1489,_0x57f5c6._0x3742b2)],'turn_id':_0x531117['turnId']}};}function toChatRequest(_0x247583){const _0x45c6e2={_0x50f36e:0x2ab,_0x3b3306:0x296,_0x1c0779:0x54a,_0x32c6e5:0x538,_0x472721:0x53a,_0x58ece4:0x540,_0x1bcffc:0x52d,_0x5ca9f5:0x515,_0x59a8cc:0x51e,_0x1e85a6:0x535,_0x198a6a:0x54c,_0x346797:0x544,_0x4ae45e:0x527},_0x3212a5={_0x4a4fdd:0xf6},_0x3cd62b={_0x4b789b:0x389};function _0x4bd756(_0x10f494,_0x522651,_0x42789b,_0x157e7b){return _0x2aff(_0x10f494-_0x3cd62b._0x4b789b,_0x522651);}function _0x3228c8(_0x4dad4d,_0x4ff26f,_0x1eeb4d,_0x1ad6a4){return _0x2aff(_0x4dad4d-_0x3212a5._0x4a4fdd,_0x1ad6a4);}return{'model':_0x247583[_0x3228c8(_0x45c6e2._0x50f36e,0x2a0,_0x45c6e2._0x3b3306,0x2c4)],'maxTokens':_0x247583['max_tokens'],..._0x247583[_0x4bd756(0x546,0x53d,_0x45c6e2._0x1c0779,0x53b)]?{'reasoning':structuredClone(_0x247583[_0x3228c8(0x2b3,0x29e,0x2b9,0x2b6)])}:{},'system':structuredClone(_0x247583[_0x4bd756(0x543,0x52f,_0x45c6e2._0x32c6e5,0x540)]),'messages':structuredClone(_0x247583[_0x4bd756(_0x45c6e2._0x472721,0x548,0x550,_0x45c6e2._0x58ece4)]),'tools':structuredClone(_0x247583['tools']),'metadata':{'sessionId':_0x247583[_0x4bd756(_0x45c6e2._0x1bcffc,_0x45c6e2._0x5ca9f5,_0x45c6e2._0x59a8cc,0x52b)][_0x4bd756(0x548,_0x45c6e2._0x1e85a6,_0x45c6e2._0x198a6a,0x545)],'turnId':_0x247583[_0x4bd756(0x52d,0x519,_0x45c6e2._0x346797,0x51b)][_0x4bd756(0x545,0x563,0x53c,_0x45c6e2._0x4ae45e)]},..._0x247583['outputFormat']?{'outputFormat':structuredClone(_0x247583[_0x4bd756(0x53d,0x54f,0x545,0x520)])}:{}};}function toModelRequest(_0x328920){const _0x561544={_0x490e23:0x4ad,_0x146212:0x4a7,_0x41cdd0:0x47b,_0xd3dca4:0x483,_0x5ae47e:0x47,_0x2bcc5c:0x27,_0x2361c6:0x3e,_0x3219f0:0x4ba,_0x120f1b:0x4b3,_0x290972:0x1d,_0x35cbe6:0x4f,_0x56f533:0x492,_0x3e82e:0x4a3,_0x5cdf08:0x48b,_0xd7b266:0xa,_0x4f4910:0x38,_0x1c8290:0x10,_0x4b0017:0x4b4,_0x37ea8a:0x4a9,_0x5f9363:0x496,_0x5de503:0x49e},_0x51e248={_0x508f43:0x2f5};function _0x28dfb9(_0x2e2c73,_0x5c7dc3,_0x1bcdf7,_0x4613d9){return _0x2aff(_0x4613d9- -0x17f,_0x5c7dc3);}function _0x151492(_0x18f4b2,_0x167541,_0x1c3bab,_0x4be970){return _0x2aff(_0x4be970-_0x51e248._0x508f43,_0x167541);}return{'model':_0x328920[_0x151492(0x4bb,_0x561544._0x490e23,_0x561544._0x146212,0x4aa)],'max_tokens':_0x328920[_0x151492(_0x561544._0x41cdd0,0x494,_0x561544._0xd3dca4,0x496)],..._0x328920[_0x28dfb9(_0x561544._0x5ae47e,_0x561544._0x2bcc5c,0x22,_0x561544._0x2361c6)]?{'reasoning':structuredClone(_0x328920[_0x151492(0x4b7,_0x561544._0x3219f0,_0x561544._0x120f1b,0x4b2)])}:{},'system':structuredClone(_0x328920['system']),'messages':structuredClone(_0x328920[_0x28dfb9(0x44,_0x561544._0x290972,_0x561544._0x35cbe6,0x32)]),'tools':structuredClone(_0x328920['tools']),'metadata':{'session_id':_0x328920[_0x151492(0x482,0x4af,0x47b,0x499)][_0x151492(_0x561544._0x56f533,_0x561544._0x3e82e,0x481,_0x561544._0x5cdf08)],'turn_id':_0x328920[_0x28dfb9(_0x561544._0xd7b266,_0x561544._0x4f4910,_0x561544._0x1c8290,0x25)]['turnId']},..._0x328920[_0x151492(0x4a1,_0x561544._0x4b0017,0x48a,_0x561544._0x37ea8a)]?{'outputFormat':structuredClone(_0x328920[_0x151492(_0x561544._0x5f9363,0x4b2,_0x561544._0x5de503,0x4a9)])}:{}};}function toProviderModelRequest(_0x5a83b9){const _0x34b703={_0x5c1332:0x6,_0x39e4f6:0x18,_0x446ed1:0xb,_0x4ed2c0:0x11,_0x3b228b:0x17,_0x5e022b:0x1f2,_0x388e28:0x1ed,_0xa87e04:0x1ec,_0x2af8ff:0x1c8,_0x1fd72d:0x0,_0x39963b:0x7},_0x55af69={_0x17979e:0x33};function _0x4887dd(_0x43727e,_0x35f707,_0x126f17,_0x18639c){return _0x2aff(_0x126f17-_0x55af69._0x17979e,_0x18639c);}function _0x5e1a14(_0x4e1122,_0x484322,_0xad7802,_0x3126df){return _0x2aff(_0x484322- -0x1b2,_0xad7802);}return{'model':_0x5a83b9[_0x5e1a14(-_0x34b703._0x5c1332,0x3,0x2,-_0x34b703._0x39e4f6)],'max_tokens':_0x5a83b9[_0x5e1a14(_0x34b703._0x446ed1,-_0x34b703._0x4ed2c0,-_0x34b703._0x3b228b,0x0)],'system':structuredClone(_0x5a83b9[_0x4887dd(_0x34b703._0x5e022b,0x1d6,_0x34b703._0x388e28,_0x34b703._0xa87e04)]),'messages':structuredClone(_0x5a83b9[_0x4887dd(_0x34b703._0x2af8ff,0x1fe,0x1e4,0x1df)]),'tools':structuredClone(_0x5a83b9[_0x5e1a14(-0x2,_0x34b703._0x1fd72d,-0x1c,_0x34b703._0x39963b)])};}function toChatResponse(_0x1e959e){const _0x32d873={_0x295148:0x6a,_0x553bc9:0x73,_0x17aa04:0x153,_0x11f6a3:0x15f,_0x20cee8:0x123,_0x2df7ed:0x112,_0x18079e:0x12e,_0x7d9e78:0x12b,_0x58e482:0x136,_0x22db83:0x82,_0x1b2120:0x118,_0x24f40a:0x13d,_0x403f1b:0x120,_0x3ea133:0x13e,_0x229598:0x152,_0x43413e:0xa8,_0x59c1ff:0x99,_0x5aa366:0x7b,_0x340f30:0x129,_0x3e7935:0x13b,_0x31e93b:0x125};function _0x58f6a1(_0x4c8102,_0x2f450b,_0x18f6fe,_0xca48bd){return _0x2aff(_0x18f6fe- -0x236,_0xca48bd);}function _0x480a8e(_0x402329,_0x3f4c3c,_0x4ed8c9,_0xdc71f2){return _0x2aff(_0x3f4c3c- -0x72,_0x402329);}return{'id':_0x1e959e['id'],'content':structuredClone(_0x1e959e[_0x58f6a1(-0x82,-0x75,-_0x32d873._0x295148,-_0x32d873._0x553bc9)]),'stopReason':_0x1e959e[_0x480a8e(_0x32d873._0x17aa04,_0x32d873._0x11f6a3,0x154,0x149)],'usage':{'inputTokens':_0x1e959e[_0x480a8e(_0x32d873._0x20cee8,0x12b,0x12c,_0x32d873._0x2df7ed)]['input_tokens'],'outputTokens':_0x1e959e[_0x480a8e(_0x32d873._0x18079e,_0x32d873._0x7d9e78,_0x32d873._0x58e482,0x120)][_0x58f6a1(-0x7d,-_0x32d873._0x22db83,-0x70,-0x65)],..._0x1e959e[_0x480a8e(_0x32d873._0x1b2120,0x12b,_0x32d873._0x24f40a,_0x32d873._0x403f1b)][_0x480a8e(0x122,_0x32d873._0x3ea133,0x136,_0x32d873._0x229598)]!==void 0x0?{'reasoningTokens':_0x1e959e[_0x58f6a1(-_0x32d873._0x43413e,-0xa7,-_0x32d873._0x59c1ff,-_0x32d873._0x5aa366)][_0x480a8e(_0x32d873._0x340f30,_0x32d873._0x3ea133,_0x32d873._0x3e7935,_0x32d873._0x31e93b)]}:{}},..._0x1e959e[_0x58f6a1(-0x83,-0xa3,-0x96,-0x79)]?{'providerState':structuredClone(_0x1e959e[_0x58f6a1(-0x92,-0x92,-0x96,-0xae)])}:{}};}function toModelResponse(_0x5f57fb){const _0x56f603={_0x3c8a87:0x3eb,_0x3b9a23:0x151,_0xe55dee:0x3d4,_0xf5bfcd:0x19b,_0x35a02b:0x163,_0x37a0c8:0x199,_0x49e7a9:0x1a1,_0x524614:0x1a3,_0x426e74:0x18f,_0x5a8394:0x3a2,_0x44cbde:0x3bf,_0x44648c:0x3d5,_0x28f3b2:0x18a,_0x464d65:0x3be,_0x5ec02b:0x3c4,_0x246628:0x3bd,_0x20445e:0x3c9,_0x500422:0x3a9,_0x3e7f49:0x3a4,_0xafa397:0x3d3,_0x1213ee:0x3b7};function _0x4eb997(_0xa2a4f7,_0x4f972a,_0x5dc25a,_0x156a1a){return _0x2aff(_0x156a1a- -0x327,_0x5dc25a);}function _0x74ea30(_0x672058,_0x4e12f2,_0xb2136,_0x4aaab4){return _0x2aff(_0x4e12f2-0x217,_0xb2136);}return{'id':_0x5f57fb['id'],'type':_0x4eb997(-0x147,-0x153,-0x16a,-0x15d),'role':_0x74ea30(0x3d6,0x3d2,0x3e5,_0x56f603._0x3c8a87),'content':structuredClone(_0x5f57fb[_0x4eb997(-_0x56f603._0x3b9a23,-0x16a,-0x154,-0x15b)]),'stop_reason':_0x5f57fb[_0x74ea30(_0x56f603._0xe55dee,0x3d0,0x3c7,0x3de)],'stop_sequence':null,'usage':{'input_tokens':_0x5f57fb[_0x4eb997(-0x199,-0x183,-_0x56f603._0xf5bfcd,-0x18a)][_0x4eb997(-_0x56f603._0x35a02b,-_0x56f603._0x37a0c8,-0x199,-0x17e)],'output_tokens':_0x5f57fb[_0x4eb997(-_0x56f603._0x49e7a9,-_0x56f603._0x524614,-_0x56f603._0x426e74,-0x18a)][_0x74ea30(_0x56f603._0x5a8394,_0x56f603._0x44cbde,0x3a5,_0x56f603._0x44648c)],..._0x5f57fb[_0x4eb997(-_0x56f603._0x524614,-0x178,-0x18c,-_0x56f603._0x28f3b2)][_0x74ea30(0x3d7,_0x56f603._0x464d65,_0x56f603._0x5ec02b,_0x56f603._0x246628)]!==void 0x0?{'reasoning_tokens':_0x5f57fb[_0x74ea30(0x3a2,0x3b4,_0x56f603._0x20445e,0x3c6)][_0x74ea30(_0x56f603._0x500422,_0x56f603._0x464d65,0x3a5,_0x56f603._0x3e7f49)]}:{}},..._0x5f57fb[_0x74ea30(_0x56f603._0xafa397,_0x56f603._0x1213ee,0x3a5,0x3c6)]?{'providerState':structuredClone(_0x5f57fb['providerState'])}:{}};}function responseToAssistantMessage(_0x513ac7){const _0x5d7065={_0x594bb3:0x44d,_0x39d73d:0x468,_0x5c8be8:0x19,_0xb715db:0x1b,_0x5c388c:0x3c,_0x2fb15a:0x23},_0x31930c={_0x5d74e8:0x281},_0x129f39={_0x39291b:0x17d};function _0x2f59eb(_0x5d5a69,_0x5ed958,_0x41d580,_0x4ad299){return _0x2aff(_0x5ed958- -_0x129f39._0x39291b,_0x41d580);}function _0x32cf3c(_0x482071,_0x3d80a7,_0x141581,_0x47ba4b){return _0x2aff(_0x482071-_0x31930c._0x5d74e8,_0x141581);}return{'role':'assistant','content':normalizeContent(_0x513ac7[_0x32cf3c(_0x5d7065._0x594bb3,0x42f,_0x5d7065._0x39d73d,0x463)]),..._0x513ac7[_0x2f59eb(0x11,0x23,_0x5d7065._0x5c8be8,_0x5d7065._0xb715db)]?{'providerState':structuredClone(_0x513ac7[_0x2f59eb(_0x5d7065._0x5c388c,_0x5d7065._0x2fb15a,0x20,0x39)])}:{}};}function createReasoningMessage(_0x3cf19f){const _0x5216a1={_0x68a3be:0x159,_0xf8b794:0x15a,_0x419fdc:0x395,_0x573556:0x3b3,_0x4a5bce:0x3ba,_0x415354:0x166,_0x1a0a51:0x180,_0x1a7ef5:0x168},_0x29e808={_0x1cced3:0x1f6},_0xbb876c={_0x414c5c:0x321},_0x226ecc={_0xa73752:0x231,_0x428e26:0x231,_0x55325e:0x232,_0x5a15a1:0x231,_0x273e3e:0x23d,_0xc290a3:0x220,_0x5d6e80:0x24c,_0x28489f:0x266},_0x28aaea={_0x2870b9:0x1d2,_0x137249:0x15c,_0x156ee3:0x6e},_0x2d2c7d=normalizeContent(_0x3cf19f?.[_0x33a7c7(-0x155,-0x164,-_0x5216a1._0x68a3be,-_0x5216a1._0xf8b794)])[_0x3e3c05(_0x5216a1._0x419fdc,0x3a5,0x3bd,0x39b)](_0x2389c3=>{const _0x5011b7={_0x1ffa6b:0x39f,_0x1f2867:0x163,_0x3e3d80:0xbe};function _0x32d452(_0x51a1e2,_0x10a0c1,_0x5e7b64,_0x62b845){return _0x3e3c05(_0x51a1e2-_0x28aaea._0x2870b9,_0x10a0c1- -_0x28aaea._0x137249,_0x5e7b64-_0x28aaea._0x156ee3,_0x51a1e2);}function _0xb1ab71(_0x4e71d6,_0x4ee87e,_0x4f0dd1,_0x49bb8d){return _0x33a7c7(_0x4e71d6-_0x5011b7._0x1ffa6b,_0x4ee87e-_0x5011b7._0x1f2867,_0x4f0dd1-_0x5011b7._0x3e3d80,_0x49bb8d);}return _0x2389c3['type']===_0x32d452(0x237,_0x226ecc._0xa73752,0x23b,0x213)||_0x2389c3[_0x32d452(_0x226ecc._0x428e26,0x23c,_0x226ecc._0x55325e,0x24a)]==='anthropic_thinking'||_0x2389c3[_0x32d452(_0x226ecc._0x5a15a1,0x23c,_0x226ecc._0x273e3e,_0x226ecc._0xc290a3)]===_0xb1ab71(0x249,_0x226ecc._0x5d6e80,0x244,_0x226ecc._0x28489f);});function _0x33a7c7(_0x5ecb8c,_0x3cb580,_0x2550a6,_0x233928){return _0x2aff(_0x5ecb8c- -_0xbb876c._0x414c5c,_0x233928);}if(_0x2d2c7d[_0x3e3c05(_0x5216a1._0x573556,0x39c,_0x5216a1._0x4a5bce,0x380)]===0x0)return void 0x0;function _0x3e3c05(_0x417bde,_0x4e5829,_0x35c7c5,_0x471670){return _0x2aff(_0x4e5829-_0x29e808._0x1cced3,_0x471670);}return{'role':_0x33a7c7(-_0x5216a1._0x415354,-_0x5216a1._0x1a0a51,-0x181,-_0x5216a1._0x1a7ef5),'content':_0x2d2c7d};}function createAssistantTextMessage(_0x43b46f){const _0x553e28={_0x5a1ace:0x383,_0xb03bd7:0x37b,_0x43663b:0x397},_0x2dcb0f={_0x4a859c:0x324,_0xf91a4:0x30e,_0x1f7efb:0x183},_0x73fa7d={_0x3c2c50:0x9};function _0x5ebb97(_0x27f6e0,_0x25bd7f,_0x233b0e,_0x5708cb){return _0x2aff(_0x27f6e0- -_0x73fa7d._0x3c2c50,_0x233b0e);}const _0x451a36=normalizeContent(_0x43b46f?.['content'])['filter'](_0x2b94e8=>{const _0x284bde={_0xc4ffb2:0x16c};function _0x50d652(_0x16ad86,_0xfd3570,_0x3c9127,_0x1208dd){return _0x2aff(_0x16ad86- -0x34,_0x3c9127);}function _0x3329cf(_0x5c141f,_0x398681,_0x121d52,_0x4fd8c7){return _0x2aff(_0x121d52-_0x284bde._0xc4ffb2,_0x4fd8c7);}return _0x2b94e8[_0x3329cf(_0x2dcb0f._0x4a859c,0x30e,_0x2dcb0f._0xf91a4,0x30f)]===_0x50d652(0x183,_0x2dcb0f._0x1f7efb,0x165,0x16a);});function _0xed8eb9(_0x4ec018,_0x8dbafc,_0x423fa2,_0x3698f4){return _0x2aff(_0x3698f4-0x1ef,_0x8dbafc);}if(_0x451a36[_0xed8eb9(_0x553e28._0x5a1ace,0x3b0,_0x553e28._0xb03bd7,0x395)]===0x0)return void 0x0;return{'role':_0xed8eb9(0x39f,_0x553e28._0x43663b,0x3bd,0x3aa),'content':_0x451a36};}function _0x2aff(_0x10fdfe,_0x1b8cd2){_0x10fdfe=_0x10fdfe-0x196;const _0x107118=_0x1071();let _0x2aff91=_0x107118[_0x10fdfe];if(_0x2aff['buubJs']===undefined){var _0x5ecaa3=function(_0x45ebaf){const _0x5c49d1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x50a7ca='',_0x34ca69='';for(let _0x3544b3=0x0,_0xcd297c,_0x1c0b08,_0x3c790b=0x0;_0x1c0b08=_0x45ebaf['charAt'](_0x3c790b++);~_0x1c0b08&&(_0xcd297c=_0x3544b3%0x4?_0xcd297c*0x40+_0x1c0b08:_0x1c0b08,_0x3544b3++%0x4)?_0x50a7ca+=String['fromCharCode'](0xff&_0xcd297c>>(-0x2*_0x3544b3&0x6)):0x0){_0x1c0b08=_0x5c49d1['indexOf'](_0x1c0b08);}for(let _0x42546d=0x0,_0x531117=_0x50a7ca['length'];_0x42546d<_0x531117;_0x42546d++){_0x34ca69+='%'+('00'+_0x50a7ca['charCodeAt'](_0x42546d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x34ca69);};_0x2aff['czdpWu']=_0x5ecaa3,_0x2aff['efgFYl']={},_0x2aff['buubJs']=!![];}const _0x4edf5e=_0x107118[0x0],_0x17b74e=_0x10fdfe+_0x4edf5e,_0x1bf550=_0x2aff['efgFYl'][_0x17b74e];return!_0x1bf550?(_0x2aff91=_0x2aff['czdpWu'](_0x2aff91),_0x2aff['efgFYl'][_0x17b74e]=_0x2aff91):_0x2aff91=_0x1bf550,_0x2aff91;}function createToolUseMessage(_0x514381){const _0x41562d={_0x2e5839:0x0,_0x48d0ac:0x1a,_0x500f2c:0xb,_0x4092bb:0x311,_0xba2902:0x31b,_0x40d2a1:0x23,_0x4acbab:0x6},_0x7412f8={_0x3cb37b:0x54,_0x13110d:0x67,_0x556b18:0x142},_0x3c0b0a={_0x457c85:0x19e,_0x28244f:0x66},_0x3cd59f={_0x3ab728:0x1c1};function _0x2cca02(_0x26fa76,_0xe632fe,_0x4d5912,_0x265384){return _0x2aff(_0x4d5912- -_0x3cd59f._0x3ab728,_0xe632fe);}function _0x44fe89(_0x4c98a9,_0x5bd040,_0x2f9df8,_0x43c34a){return _0x2aff(_0x43c34a-0x16c,_0x4c98a9);}const _0x401d62=normalizeContent(_0x514381?.[_0x2cca02(_0x41562d._0x2e5839,_0x41562d._0x48d0ac,_0x41562d._0x500f2c,0x1f)])[_0x44fe89(0x339,_0x41562d._0x4092bb,0x315,_0x41562d._0xba2902)](_0x4962b3=>{function _0x37c278(_0x280d92,_0x2b8d2e,_0x2aadc9,_0x35e551){return _0x2cca02(_0x280d92-0x13d,_0x2aadc9,_0x2b8d2e-0x79,_0x35e551-0xff);}function _0x4010d9(_0x133016,_0x4a7c2a,_0x3d5cb4,_0x1c7173){return _0x44fe89(_0x3d5cb4,_0x4a7c2a-_0x3c0b0a._0x457c85,_0x3d5cb4-_0x3c0b0a._0x28244f,_0x1c7173- -0x202);}return _0x4962b3[_0x37c278(_0x7412f8._0x3cb37b,0x5a,_0x7412f8._0x13110d,0x67)]===_0x4010d9(0x118,0x11e,_0x7412f8._0x556b18,0x12a);});if(_0x401d62[_0x2cca02(_0x41562d._0x2e5839,-_0x41562d._0x40d2a1,-0x1b,-0x14)]===0x0)return void 0x0;return{'role':_0x2cca02(-0x1b,0x2,-_0x41562d._0x4acbab,0x6),'content':_0x401d62};}function getTextFromMessage(_0x106fdd){const _0x5354ed={_0x447fc3:0x3f6,_0x160309:0x3f5,_0x17dcae:0x403,_0x2c41c7:0x402,_0x5cd197:0x3f3,_0x5a7dd8:0x3e0,_0x3297a1:0x3e7},_0x3d9217={_0x4fd694:0x242};function _0x54083e(_0xdf5f1a,_0x44143b,_0x5557c5,_0x515078){return _0x2aff(_0x44143b-_0x3d9217._0x4fd694,_0x5557c5);}function _0x2ebef4(_0x47b282,_0x2e23e0,_0x22b242,_0x3c117b){return _0x2aff(_0x3c117b-0x240,_0x47b282);}return normalizeContent(_0x106fdd?.[_0x2ebef4(0x40b,0x403,0x429,0x40c)])[_0x2ebef4(0x409,_0x5354ed._0x447fc3,_0x5354ed._0x160309,0x3ef)](_0x416b3d=>_0x416b3d[_0x2ebef4(0x3e3,0x3cc,0x3ec,0x3e2)]===_0x54083e(0x3fe,0x3f9,0x3ff,0x3eb))[_0x2ebef4(_0x5354ed._0x17dcae,0x40a,0x415,_0x5354ed._0x2c41c7)](_0x581521=>_0x581521[_0x54083e(0x3fe,0x3f9,0x3f8,0x3f3)])[_0x54083e(_0x5354ed._0x5cd197,_0x5354ed._0x5a7dd8,_0x5354ed._0x3297a1,0x3f5)]('\x0a');}function getReasoningTextFromMessage(_0x25e7ff){const _0x1f138b={_0x14ef72:0x255,_0x2f3852:0x243,_0x12256f:0x1b3,_0x3476f1:0x1d1,_0x53d7c6:0x1e8,_0x520001:0x1c7,_0x3fb430:0x1de,_0x30bda2:0x1fa,_0x5d7ce8:0x1e7,_0x1281a4:0x1fc},_0x27a886={_0x583ee7:0x24,_0x29dc2d:0x3a,_0x5b2ffe:0x37,_0x133aac:0x1b5,_0x32f185:0x1bd,_0x5781b0:0x8,_0x75c6e:0x17,_0x1602c3:0x4,_0x11ee35:0x1,_0x172b78:0x1bb,_0x26c925:0x19f,_0x504369:0x1a9,_0x4d4e86:0x1ea,_0x5963db:0x1fc,_0x34851c:0x1e4,_0x4f8984:0x1e2,_0x4fac85:0x16,_0x27f737:0xc,_0x39de5b:0x1ad,_0xa691cc:0x1c8,_0x3e0da4:0x1b3,_0x36f160:0x1bf,_0x2ba822:0x1d7,_0x2d7afe:0x1c0,_0x5afdab:0x3c,_0x32a2e7:0x1b5,_0x45c2a4:0x1b4,_0x59d815:0x2,_0x33342d:0x5},_0xd7de0f={_0x46dd05:0x89};function _0x161844(_0x58d909,_0x1321ab,_0x287f26,_0x2de793){return _0x2aff(_0x1321ab-_0xd7de0f._0x46dd05,_0x2de793);}function _0x14cae5(_0x3363e3,_0x294a05,_0x47ef4d,_0x558372){return _0x2aff(_0x294a05- -0x398,_0x47ef4d);}return normalizeContent(_0x25e7ff?.[_0x161844(0x24e,_0x1f138b._0x14ef72,_0x1f138b._0x2f3852,0x252)])[_0x14cae5(-_0x1f138b._0x12256f,-_0x1f138b._0x3476f1,-_0x1f138b._0x53d7c6,-_0x1f138b._0x520001)](_0x328404=>{const _0xfa708={_0x56c6d9:0x129,_0x334b13:0x70,_0x5017a1:0xff};if(_0x328404['type']===_0x3a0115(_0x27a886._0x583ee7,_0x27a886._0x29dc2d,0x27,_0x27a886._0x5b2ffe))return _0x328404[_0x201e12(_0x27a886._0x133aac,0x1cf,0x1cf,_0x27a886._0x32f185)][_0x3a0115(_0x27a886._0x5781b0,0xf,-_0x27a886._0x75c6e,-0x9)]()[_0x3a0115(0x12,0x4,_0x27a886._0x1602c3,_0x27a886._0x11ee35)]>0x0?[_0x328404['thinking']]:[];if(_0x328404[_0x201e12(0x1a8,0x1a6,_0x27a886._0x172b78,_0x27a886._0x26c925)]===_0x201e12(0x1bb,_0x27a886._0x504369,0x1b0,0x1c2))return['(redacted\x20reasoning)'];if(_0x328404['type']!==_0x201e12(_0x27a886._0x4d4e86,_0x27a886._0x5963db,_0x27a886._0x34851c,_0x27a886._0x4f8984))return[];const _0x467772=_0x328404[_0x3a0115(_0x27a886._0x4fac85,_0x27a886._0x27f737,_0x27a886._0x11ee35,0xd)]['map'](_0x437c34=>_0x437c34[_0x201e12(0x1e7,0x1df,0x1d0,0x1bc)])[_0x201e12(0x1db,_0x27a886._0x39de5b,_0x27a886._0xa691cc,_0x27a886._0x3e0da4)](_0x3059cf=>_0x3059cf[_0x201e12(0x1c1,0x1cf,0x1b5,0x1ac)]()[_0x201e12(0x1d6,0x1be,0x1bf,0x1ab)]>0x0)['join']('\x0a\x0a');function _0x3a0115(_0x49b5af,_0x49194e,_0x3cce5f,_0x5e149e){return _0x14cae5(_0x49b5af-0xc,_0x49b5af-0x204,_0x49194e,_0x5e149e-0x42);}function _0x201e12(_0x45c627,_0x15d548,_0x4068f6,_0x311664){return _0x161844(_0x45c627-_0xfa708._0x56c6d9,_0x4068f6- -_0xfa708._0x334b13,_0x4068f6-_0xfa708._0x5017a1,_0x311664);}if(_0x467772[_0x201e12(0x1ca,0x1b5,_0x27a886._0x36f160,0x1ad)]>0x0)return[_0x467772];if(_0x328404[_0x201e12(_0x27a886._0x2ba822,_0x27a886._0x2d7afe,0x1d0,0x1ea)]&&_0x328404[_0x3a0115(0x23,0x3b,0x38,_0x27a886._0x5afdab)][_0x201e12(0x19f,0x1b7,0x1b5,_0x27a886._0x32a2e7)]()['length']>0x0)return[_0x328404[_0x201e12(0x1c3,_0x27a886._0x45c2a4,0x1d0,0x1bb)]];return _0x328404[_0x3a0115(0x11,-_0x27a886._0x59d815,0x17,_0x27a886._0x33342d)]?[_0x201e12(0x1ec,0x1c5,0x1da,0x1dd)]:[];})[_0x14cae5(-_0x1f138b._0x3fb430,-_0x1f138b._0x30bda2,-_0x1f138b._0x5d7ce8,-_0x1f138b._0x1281a4)]('\x0a\x0a');}function getToolUseBlocks(_0x50a19f){const _0xc86bf6={_0x1b6b1a:0x2ac,_0x3bfd51:0x279,_0x3c9ce3:0x11b,_0x32b4d8:0x100},_0x5415cf={_0x41b630:0x2b7};function _0x162a05(_0x2f4bf2,_0x3ae717,_0x3c6760,_0x532320){return _0x2aff(_0x2f4bf2-0xca,_0x532320);}function _0x36b03c(_0x45735b,_0x512fca,_0xe39ef2,_0x192148){return _0x2aff(_0x512fca- -_0x5415cf._0x41b630,_0x192148);}return normalizeContent(_0x50a19f?.[_0x162a05(0x296,_0xc86bf6._0x1b6b1a,_0xc86bf6._0x3bfd51,0x29b)])[_0x36b03c(-0x10f,-0x108,-_0xc86bf6._0x3c9ce3,-_0xc86bf6._0x32b4d8)](_0x317c7c=>_0x317c7c[_0x162a05(0x26c,0x281,0x27b,0x284)]===_0x36b03c(-0x111,-0xf7,-0xfa,-0xff));}function getToolResultBlocks(_0x5de507){const _0x562856={_0x451d8e:0x50a,_0x4d63a6:0x4f8,_0x18263f:0x4d6};function _0xc357fa(_0x15f12a,_0x4741c5,_0x1c23aa,_0x32e385){return _0x2aff(_0x15f12a- -0x7d,_0x1c23aa);}function _0x17ffca(_0x385fb4,_0x2476e4,_0x1da50e,_0x494b2f){return _0x2aff(_0x385fb4-0x339,_0x1da50e);}return normalizeContent(_0x5de507?.[_0x17ffca(0x505,0x502,_0x562856._0x451d8e,0x503)])[_0x17ffca(0x4e8,_0x562856._0x4d63a6,_0x562856._0x18263f,0x4e3)](_0x12e74b=>_0x12e74b[_0xc357fa(0x125,0x11b,0x12e,0x13d)]===_0xc357fa(0x14c,0x14e,0x131,0x15c));}function createToolResultUserMessage(_0x134440){const _0xc48076={_0x1402b0:0x106,_0x349c74:0x110,_0x36b46d:0x124,_0x577ed4:0xe7,_0x2cee07:0xd2},_0x45ecdb={_0x554aea:0x57f,_0x39d6fe:0x562,_0x19de69:0x574,_0x2edb96:0x568,_0x3c59d2:0x56f,_0x1d9a84:0x55c,_0x4071a1:0x578},_0x3ef90d={_0x4d2a18:0x2a9};function _0x5acc75(_0x3a8c95,_0x164dbf,_0x329d33,_0x291a4a){return _0x2aff(_0x291a4a- -0x1cd,_0x329d33);}function _0x2a2903(_0x98acc3,_0x42d02d,_0x2c0840,_0x8b81a3){return _0x2aff(_0x42d02d- -_0x3ef90d._0x4d2a18,_0x2c0840);}return{'role':_0x2a2903(-0xee,-_0xc48076._0x1402b0,-_0xc48076._0x349c74,-_0xc48076._0x36b46d),'content':_0x134440[_0x2a2903(-0xf9,-_0xc48076._0x577ed4,-_0xc48076._0x2cee07,-0xfb)](_0x454dfb=>{const _0x5989b3={_0x11a9ed:0x1d4},_0x23970d={_0x230798:0x1cb,_0x1b9753:0x7d,_0x44c2cd:0x1f9};function _0xb4f3c7(_0x384c98,_0x396fe7,_0x3cd4ad,_0x526ce3){return _0x5acc75(_0x384c98-_0x23970d._0x230798,_0x396fe7-_0x23970d._0x1b9753,_0x526ce3,_0x3cd4ad- -_0x23970d._0x44c2cd);}function _0x16e501(_0x4c9d53,_0x3fa684,_0x30e7f3,_0x2cb740){return _0x2a2903(_0x4c9d53-0xdd,_0x4c9d53-0x648,_0x3fa684,_0x2cb740-_0x5989b3._0x11a9ed);}return{'type':_0x16e501(0x568,_0x45ecdb._0x554aea,_0x45ecdb._0x39d6fe,_0x45ecdb._0x19de69),'tool_use_id':_0x454dfb['callId'],'content':_0x454dfb[_0x16e501(0x56b,0x561,0x567,_0x45ecdb._0x2edb96)]??_0x454dfb['output'],'is_error':_0x454dfb['status']===_0x16e501(_0x45ecdb._0x3c59d2,_0x45ecdb._0x1d9a84,_0x45ecdb._0x4071a1,0x57c)};})};}function _0x34361e(_0x5bb3c4,_0x2cf4f3,_0xfadb30,_0x2450cf){const _0x307d60={_0x2f6afd:0x61};return _0x2aff(_0x2450cf- -_0x307d60._0x2f6afd,_0xfadb30);}var INTERRUPTED_TOOL_RESULT_TEXT=_0x34361e(0x128,0x120,0x154,0x13e);function synthesizeMissingToolResults(_0x39d14c){const _0x26d26c={_0x4f387d:0x2e0,_0x1efd6d:0x30f,_0x1c29c0:0x10f,_0x510c24:0xf6,_0xfcac6a:0xfc,_0x48dc07:0x2fa,_0x4720f3:0x2e6,_0x4434ff:0x2fa,_0x2880ce:0x2da,_0x207f42:0x2e4,_0xa4496a:0x2d1,_0x592b7d:0x30b,_0x50ccf7:0x2ee,_0x346ff4:0x308,_0x1ea55c:0x30e,_0x4337c0:0x30d,_0x2bd272:0x105,_0xaa0f3:0x12d},_0x476eef={_0x415f38:0x1ac},_0x8484ca=new Set();function _0x59c4b4(_0x58ddf2,_0x121fe0,_0x9d5973,_0x367054){return _0x34361e(_0x58ddf2-0xb6,_0x121fe0-0xfa,_0x9d5973,_0x121fe0-_0x476eef._0x415f38);}for(const _0x3587e7 of _0x39d14c){for(const _0x424346 of getToolResultBlocks(_0x3587e7)){_0x8484ca[_0x59c4b4(_0x26d26c._0x4f387d,0x2f7,0x2ff,_0x26d26c._0x1efd6d)](_0x424346[_0x5dbd2c(-_0x26d26c._0x1c29c0,-_0x26d26c._0x510c24,-0x125,-_0x26d26c._0xfcac6a)]);}}function _0x5dbd2c(_0x212b3d,_0x9bac7d,_0xacdf50,_0x338b5d){return _0x34361e(_0x212b3d-0x71,_0x9bac7d-0x137,_0x9bac7d,_0x212b3d- -0x25b);}const _0x57df8d=[];for(const _0x48d234 of _0x39d14c){_0x57df8d['push'](_0x48d234);const _0x4180ec=getToolUseBlocks(_0x48d234)[_0x59c4b4(0x2fd,_0x26d26c._0x48dc07,0x2ef,0x312)](_0xa78356=>!_0x8484ca[_0x5dbd2c(-0xef,-0x107,-0x109,-0xda)](_0xa78356['id']));if(_0x4180ec[_0x59c4b4(_0x26d26c._0x4720f3,0x2f1,0x2dd,_0x26d26c._0x4434ff)]===0x0)continue;_0x57df8d[_0x59c4b4(_0x26d26c._0x2880ce,_0x26d26c._0x207f42,0x301,_0x26d26c._0xa4496a)]({'role':_0x59c4b4(_0x26d26c._0x592b7d,_0x26d26c._0x50ccf7,0x2ed,_0x26d26c._0x346ff4),'content':_0x4180ec[_0x59c4b4(_0x26d26c._0x1ea55c,_0x26d26c._0x4337c0,0x302,0x323)](_0x2fee01=>({'type':'tool_result','tool_use_id':_0x2fee01['id'],'content':INTERRUPTED_TOOL_RESULT_TEXT,'is_error':!![]}))});for(const _0xe158b3 of _0x4180ec){_0x8484ca[_0x5dbd2c(-0x110,-_0x26d26c._0x2bd272,-_0x26d26c._0xaa0f3,-0x12e)](_0xe158b3['id']);}}return _0x57df8d;}export{createTextBlock,normalizeTextBlock,normalizeContent,normalizeSystem,normalizeMessage,compileRequest,toChatRequest,toModelRequest,toProviderModelRequest,toChatResponse,toModelResponse,responseToAssistantMessage,createReasoningMessage,createAssistantTextMessage,createToolUseMessage,getTextFromMessage,getReasoningTextFromMessage,getToolUseBlocks,getToolResultBlocks,createToolResultUserMessage,INTERRUPTED_TOOL_RESULT_TEXT,synthesizeMissingToolResults};
|
package/dist/chunk-X7VAACWY.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31e9e6,_0x1263bf){var _0x5ce00e={_0x4ea1d9:0x437,_0x2c7c1b:0x387,_0x1301b1:0x37c,_0x189ae9:0x37d,_0x3ce5c2:0x43a,_0x5bffec:0x436,_0x4c50e7:0x38a,_0x443c5a:0x388,_0x59fa5a:0x441,_0x5d3c37:0x444,_0x116f54:0x44c,_0x3e301b:0x438,_0x62daa3:0x430,_0x4ca449:0x381,_0x2859d6:0x380,_0x53d439:0x378,_0xbf27fa:0x441,_0x4a7370:0x444,_0x2967fd:0x437,_0xec6739:0x43d,_0x3933ca:0x42f,_0x5449d5:0x386,_0x6a4de3:0x394,_0x40592e:0x380,_0x16b340:0x44a,_0x9e0443:0x438},_0x11b684={_0x5e37ce:0x2ac},_0x191961={_0x57a00e:0x1f0};function _0x23010d(_0x3fadbf,_0x2354bc,_0x21c3be,_0x3658ab){return _0x5d9b(_0x3658ab-_0x191961._0x57a00e,_0x3fadbf);}function _0x21348a(_0x79f8a3,_0xbed26,_0x4186d9,_0x38839e){return _0x5d9b(_0x4186d9-_0x11b684._0x5e37ce,_0x38839e);}var _0x3ef0e5=_0x31e9e6();while(!![]){try{var _0x803a48=-parseInt(_0x21348a(0x434,0x438,_0x5ce00e._0x4ea1d9,0x438))/0x1*(-parseInt(_0x23010d(_0x5ce00e._0x2c7c1b,0x386,_0x5ce00e._0x1301b1,_0x5ce00e._0x189ae9))/0x2)+-parseInt(_0x21348a(0x433,_0x5ce00e._0x3ce5c2,0x432,_0x5ce00e._0x5bffec))/0x3*(parseInt(_0x23010d(_0x5ce00e._0x4c50e7,0x381,_0x5ce00e._0x443c5a,0x388))/0x4)+-parseInt(_0x21348a(_0x5ce00e._0x59fa5a,_0x5ce00e._0x5d3c37,0x446,_0x5ce00e._0x116f54))/0x5*(parseInt(_0x21348a(_0x5ce00e._0x3e301b,_0x5ce00e._0x62daa3,0x438,_0x5ce00e._0x4ea1d9))/0x6)+-parseInt(_0x23010d(_0x5ce00e._0x4ca449,0x37c,_0x5ce00e._0x2859d6,_0x5ce00e._0x53d439))/0x7*(-parseInt(_0x21348a(0x449,0x43c,_0x5ce00e._0xbf27fa,_0x5ce00e._0x4a7370))/0x8)+parseInt(_0x21348a(_0x5ce00e._0x2967fd,_0x5ce00e._0xec6739,0x433,_0x5ce00e._0x3933ca))/0x9+parseInt(_0x23010d(0x388,0x37b,0x37b,0x383))/0xa*(-parseInt(_0x23010d(0x388,_0x5ce00e._0x5449d5,_0x5ce00e._0x6a4de3,0x38b))/0xb)+-parseInt(_0x23010d(0x391,_0x5ce00e._0x40592e,0x383,0x386))/0xc*(parseInt(_0x21348a(_0x5ce00e._0x16b340,_0x5ce00e._0x9e0443,0x43e,0x43a))/0xd);if(_0x803a48===_0x1263bf)break;else _0x3ef0e5['push'](_0x3ef0e5['shift']());}catch(_0x1f5caf){_0x3ef0e5['push'](_0x3ef0e5['shift']());}}}(_0x498e,0x6bfa5));var OperationAbortedError=class extends Error{[_0x18cf43(0x2a5,0x2a6,0x2ad,0x29e)]=_0x18cf43(0x2b2,0x2b1,0x2b8,0x2b3);constructor(_0x1ce211='Operation\x20aborted'){var _0x19d21a={_0x575e42:0x26,_0x3c3593:0x28,_0x45bbd8:0x14,_0x59f3cb:0x1c},_0x451708={_0x2713b5:0x11d};function _0x42ae01(_0x5b1d26,_0x33104c,_0xefa5d0,_0x25df5a){return _0x291d97(_0x33104c,_0x33104c-_0x451708._0x2713b5,_0x25df5a- -0x4f8,_0x25df5a-0x35);}super(_0x1ce211),this[_0x42ae01(_0x19d21a._0x575e42,_0x19d21a._0x3c3593,_0x19d21a._0x45bbd8,_0x19d21a._0x59f3cb)]='AbortError';}};function _0x291d97(_0x161e38,_0x2aa04a,_0x29e6bc,_0x56609a){return _0x5d9b(_0x29e6bc-0x385,_0x161e38);}function _0x5d9b(_0x432a0a,_0x3b78ea){_0x432a0a=_0x432a0a-0x185;var _0x498e91=_0x498e();var _0x5d9bc6=_0x498e91[_0x432a0a];if(_0x5d9b['mfFAfa']===undefined){var _0x11dd73=function(_0x200adb){var _0x40a601='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1ce211='',_0x3e5a82='';for(var _0x49202f=0x0,_0xa6a1b4,_0x542fe1,_0x543348=0x0;_0x542fe1=_0x200adb['charAt'](_0x543348++);~_0x542fe1&&(_0xa6a1b4=_0x49202f%0x4?_0xa6a1b4*0x40+_0x542fe1:_0x542fe1,_0x49202f++%0x4)?_0x1ce211+=String['fromCharCode'](0xff&_0xa6a1b4>>(-0x2*_0x49202f&0x6)):0x0){_0x542fe1=_0x40a601['indexOf'](_0x542fe1);}for(var _0x2e7455=0x0,_0x244661=_0x1ce211['length'];_0x2e7455<_0x244661;_0x2e7455++){_0x3e5a82+='%'+('00'+_0x1ce211['charCodeAt'](_0x2e7455)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e5a82);};_0x5d9b['KRTWPz']=_0x11dd73,_0x5d9b['imXBkL']={},_0x5d9b['mfFAfa']=!![];}var _0x10c041=_0x498e91[0x0],_0x169b54=_0x432a0a+_0x10c041,_0x26934e=_0x5d9b['imXBkL'][_0x169b54];return!_0x26934e?(_0x5d9bc6=_0x5d9b['KRTWPz'](_0x5d9bc6),_0x5d9b['imXBkL'][_0x169b54]=_0x5d9bc6):_0x5d9bc6=_0x26934e,_0x5d9bc6;}function toAbortError(_0x3e5a82){var _0x35fb59={_0x4f012c:0x198,_0x497752:0x1ac,_0x4d3787:0x1a9,_0x629e9e:0x1b3,_0x405a17:0x1b4,_0x40a5ee:0x2e1,_0x143638:0x2ec,_0xc2304f:0x2ee},_0x264170={_0x49a930:0xed,_0x11d57a:0x229,_0x4f70bd:0x6d},_0x1fe2f7={_0x47eaba:0x71};if(isAbortError(_0x3e5a82))return _0x3e5a82;if(_0x3e5a82 instanceof Error)return new OperationAbortedError(_0x3e5a82[_0x3f6eac(_0x35fb59._0x4f012c,_0x35fb59._0x497752,0x1a2,_0x35fb59._0x4d3787)]);if(typeof _0x3e5a82===_0x3f6eac(0x1be,_0x35fb59._0x629e9e,_0x35fb59._0x405a17,0x1af)&&_0x3e5a82[_0x126906(_0x35fb59._0x40a5ee,_0x35fb59._0x143638,_0x35fb59._0xc2304f,0x2ee)]>0x0)return new OperationAbortedError(_0x3e5a82);function _0x3f6eac(_0x310bf5,_0x40cf17,_0x2eae2d,_0x24dd63){return _0x18cf43(_0x310bf5-_0x1fe2f7._0x47eaba,_0x2eae2d- -0xfb,_0x40cf17,_0x24dd63-0xca);}function _0x126906(_0x53fbf5,_0x19579f,_0x5e9249,_0x48c450){return _0x291d97(_0x5e9249,_0x19579f-_0x264170._0x49a930,_0x19579f- -_0x264170._0x11d57a,_0x48c450-_0x264170._0x4f70bd);}return new OperationAbortedError();}function _0x498e(){var _0x170232=['mte2mJaXveLqDwDR','mJi1nJCYDKvSEg1y','mMvjzhn4rq','y29Kzq','BMfTzq','BgvUz3rO','CMvTB3zLrxzLBNrmAxn0zw5LCG','ndeXmZu5whfcD3HV','ntu3mezjDNnlAG','ywjVCNrLza','nZa5otC2A1vZBfnm','mtGWt290wfr4','C3rYAw5N','mti1mK5orw90yG','qujpuLrFrvjs','ndblELjjy0W','ndmWmvfIshPbBa','ywjVCNq','BwvZC2fNzq','mtq5mw1UA1LAsa','nZy4mZyYngzOA3nPAG','ndL4Cffsz0u','CMvHC29U','ywrKrxzLBNrmAxn0zw5LCG'];_0x498e=function(){return _0x170232;};return _0x498e();}function isAbortError(_0x49202f){return _0x49202f instanceof OperationAbortedError||_0x49202f instanceof Error&&(_0x49202f['name']==='AbortError'||'code'in _0x49202f&&_0x49202f['code']==='ABORT_ERR');}function throwIfAborted(_0xa6a1b4){var _0x59e280={_0x48eefc:0x20b,_0x5e223a:0x20c,_0x4e88c4:0x201,_0x49cd4b:0x20c,_0x2c7cfb:0x1ff},_0x3b6a40={_0x13ca92:0x4b},_0x5878d4={_0xe5d5db:0xac};function _0x403b34(_0x2b7ff3,_0x1a3d56,_0x12d4a8,_0x5872fd){return _0x291d97(_0x2b7ff3,_0x1a3d56-_0x5878d4._0xe5d5db,_0x1a3d56- -0x474,_0x5872fd-0x23);}if(!_0xa6a1b4?.[_0x1d6eef(_0x59e280._0x48eefc,_0x59e280._0x5e223a,0x213,0x213)])return;function _0x1d6eef(_0x4f240f,_0x5f5119,_0x3a35ae,_0x2d294a){return _0x18cf43(_0x4f240f-0xb8,_0x5f5119- -0xa0,_0x4f240f,_0x2d294a-_0x3b6a40._0x13ca92);}throw toAbortError(_0xa6a1b4[_0x1d6eef(0x203,_0x59e280._0x4e88c4,_0x59e280._0x49cd4b,_0x59e280._0x2c7cfb)]);}function addAbortListener(_0x542fe1,_0x543348){var _0x114da6={_0x436bd4:0x422,_0x1a492e:0x412,_0x40b5f5:0x408,_0x534177:0x41b},_0x4d1f2d={_0x4bca59:0x124},_0x250075={_0x197bd5:0x172},_0xbbe434={_0x7acd13:0x100};if(!_0x542fe1)return()=>{};if(_0x542fe1[_0x5b2aef(0x41e,0x41d,_0x114da6._0x436bd4,0x413)])return _0x543348(),()=>{};function _0x1e3506(_0x3a1927,_0x274cd2,_0x2d2ea8,_0xcb6406){return _0x18cf43(_0x3a1927-_0xbbe434._0x7acd13,_0xcb6406- -0x1ec,_0x3a1927,_0xcb6406-0x17);}const _0x2e7455=()=>{_0x543348();};_0x542fe1[_0x5b2aef(0x414,_0x114da6._0x1a492e,_0x114da6._0x40b5f5,_0x114da6._0x534177)]('abort',_0x2e7455,{'once':!![]});function _0x5b2aef(_0x573739,_0x4e1d11,_0x1864ac,_0x359e6c){return _0x18cf43(_0x573739-0x1ae,_0x573739-_0x250075._0x197bd5,_0x359e6c,_0x359e6c-0x57);}return()=>{var _0x330ad1={_0x250e65:0x9c,_0x21c498:0x1ee};function _0x8145c(_0x187e41,_0x28dcc3,_0x5cbc4b,_0x31b358){return _0x1e3506(_0x187e41,_0x28dcc3-_0x330ad1._0x250e65,_0x5cbc4b-0x15b,_0x31b358- -_0x330ad1._0x21c498);}function _0x498299(_0x2cc5f5,_0x8c0866,_0x1b5dbb,_0x3da484){return _0x1e3506(_0x1b5dbb,_0x8c0866-0x67,_0x1b5dbb-0x153,_0x2cc5f5-0x3f1);}_0x542fe1[_0x498299(0x4ae,0x4b8,0x4af,0x4ac)](_0x8145c(-_0x4d1f2d._0x4bca59,-0x131,-0x130,-0x126),_0x2e7455);};}function _0x18cf43(_0x103a24,_0x1b534e,_0x2797e2,_0x1285c9){var _0x5f0287={_0x27dfb1:0x118};return _0x5d9b(_0x1b534e-_0x5f0287._0x27dfb1,_0x2797e2);}export{OperationAbortedError,toAbortError,isAbortError,throwIfAborted,addAbortListener};
|
package/dist/formats/index.d.ts
CHANGED
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare function contentFromPastedText(input: string): ContentBlock[];
|
|
6
|
-
|
|
7
|
-
declare function createTextBlock(text: string): TextBlock;
|
|
8
|
-
declare function normalizeTextBlock(block: TextBlock): TextBlock;
|
|
9
|
-
declare function normalizeContent(content: ContentInput): ContentBlock[];
|
|
10
|
-
declare function normalizeSystem(system?: SystemInput): TextBlock[];
|
|
11
|
-
declare function normalizeMessage(message: MessageInput): Message;
|
|
12
|
-
declare function compileRequest(input: CompileRequestInput): ModelRequest;
|
|
13
|
-
declare function toChatRequest(request: ModelRequest): ChatRequest;
|
|
14
|
-
declare function toModelRequest(request: ChatRequest): ModelRequest;
|
|
15
|
-
declare function toProviderModelRequest(request: ChatRequest): Omit<ModelRequest, "metadata" | "reasoning">;
|
|
16
|
-
declare function toChatResponse(response: ModelResponse): ChatResponse;
|
|
17
|
-
declare function toModelResponse(response: ChatResponse): ModelResponse;
|
|
18
|
-
declare function responseToAssistantMessage(response: ModelResponse | ChatResponse): Message;
|
|
19
|
-
declare function createReasoningMessage(message: Message | undefined): Message | undefined;
|
|
20
|
-
declare function createAssistantTextMessage(message: Message | undefined): Message | undefined;
|
|
21
|
-
declare function createToolUseMessage(message: Message | undefined): Message | undefined;
|
|
22
|
-
declare function getTextFromMessage(message: Message | undefined): string;
|
|
23
|
-
declare function getReasoningTextFromMessage(message: Message | undefined): string;
|
|
24
|
-
declare function getToolUseBlocks(message: Message | undefined): ToolUseBlock[];
|
|
25
|
-
declare function getToolResultBlocks(message: Message | undefined): ToolResultBlock[];
|
|
26
|
-
declare function createToolResultUserMessage(toolResults: ToolResult[]): Message;
|
|
27
|
-
|
|
28
|
-
export { compileRequest, contentFromPastedText, createAssistantTextMessage, createReasoningMessage, createTextBlock, createToolResultUserMessage, createToolUseMessage, getReasoningTextFromMessage, getTextFromMessage, getToolResultBlocks, getToolUseBlocks, hasPastedImages, normalizeContent, normalizeMessage, normalizeSystem, normalizeTextBlock, responseToAssistantMessage, toChatRequest, toChatResponse, toModelRequest, toModelResponse, toProviderModelRequest };
|
|
1
|
+
export * from "./base64-image-content.ts";
|
|
2
|
+
export * from "./message-format.ts";
|
|
3
|
+
export * from "./provider-adapters.ts";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/formats/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x354461,_0x5a73e7){const _0x3b76ba={_0x137701:0x7d,_0x4eed27:0x7b,_0x4acaa2:0x78,_0x3992e2:0x75,_0x587993:0x6f,_0xa1dba3:0x74,_0x137ecb:0x2bc,_0x5de458:0x2b6,_0x3a325f:0x2b8,_0x4b6b43:0x6d,_0x4f21de:0x6e,_0x1e8769:0x6d,_0x3aa3f3:0x2b5,_0x17d6df:0x6b,_0x9d7586:0x62},_0x1cfeb6={_0x4a37c1:0x29},_0x4ce981=_0x354461();function _0x48db50(_0x5cb05c,_0x4e4af3,_0x572d1d,_0xfb088c){return _0x5edb(_0x5cb05c-0x219,_0x4e4af3);}function _0xb8d233(_0x157ceb,_0x5623ea,_0x41615f,_0x37a51a){return _0x5edb(_0x41615f- -_0x1cfeb6._0x4a37c1,_0x5623ea);}while(!![]){try{const _0x51d2a7=-parseInt(_0xb8d233(0x79,_0x3b76ba._0x137701,_0x3b76ba._0x4eed27,_0x3b76ba._0x4acaa2))/0x1+parseInt(_0xb8d233(_0x3b76ba._0x3992e2,_0x3b76ba._0x587993,_0x3b76ba._0xa1dba3,0x70))/0x2+-parseInt(_0x48db50(0x2b5,_0x3b76ba._0x137ecb,_0x3b76ba._0x5de458,0x2ba))/0x3+parseInt(_0x48db50(0x2b4,0x2af,_0x3b76ba._0x3a325f,_0x3b76ba._0x5de458))/0x4+parseInt(_0xb8d233(0x72,0x7f,0x76,_0x3b76ba._0x4b6b43))/0x5+parseInt(_0xb8d233(_0x3b76ba._0x4f21de,_0x3b76ba._0xa1dba3,_0x3b76ba._0x1e8769,0x68))/0x6*(parseInt(_0x48db50(0x2b3,_0x3b76ba._0x137ecb,0x2ae,_0x3b76ba._0x3aa3f3))/0x7)+-parseInt(_0xb8d233(0x6c,0x73,_0x3b76ba._0x17d6df,_0x3b76ba._0x9d7586))/0x8;if(_0x51d2a7===_0x5a73e7)break;else _0x4ce981['push'](_0x4ce981['shift']());}catch(_0x57ce8d){_0x4ce981['push'](_0x4ce981['shift']());}}}(_0xb886,0x5a2d2));import{toOpenAiResponsesRequest}from'../chunk-NHBKADBW.js';import'../chunk-NYZR4XKO.js';function _0x5edb(_0x1d5eca,_0x367a72){_0x1d5eca=_0x1d5eca-0x91;const _0xb88615=_0xb886();let _0x5edb7b=_0xb88615[_0x1d5eca];if(_0x5edb['SqQGMW']===undefined){var _0x4af055=function(_0x5a143d){const _0x39179b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f8384='',_0x4ac83d='';for(let _0x223ea1=0x0,_0xba3ded,_0x5f15d5,_0xf776ea=0x0;_0x5f15d5=_0x5a143d['charAt'](_0xf776ea++);~_0x5f15d5&&(_0xba3ded=_0x223ea1%0x4?_0xba3ded*0x40+_0x5f15d5:_0x5f15d5,_0x223ea1++%0x4)?_0x3f8384+=String['fromCharCode'](0xff&_0xba3ded>>(-0x2*_0x223ea1&0x6)):0x0){_0x5f15d5=_0x39179b['indexOf'](_0x5f15d5);}for(let _0x2924aa=0x0,_0x2a429e=_0x3f8384['length'];_0x2924aa<_0x2a429e;_0x2924aa++){_0x4ac83d+='%'+('00'+_0x3f8384['charCodeAt'](_0x2924aa)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4ac83d);};_0x5edb['uiFxNI']=_0x4af055,_0x5edb['LdZZuo']={},_0x5edb['SqQGMW']=!![];}const _0xcf0bfa=_0xb88615[0x0],_0x4ada89=_0x1d5eca+_0xcf0bfa,_0x9944d2=_0x5edb['LdZZuo'][_0x4ada89];return!_0x9944d2?(_0x5edb7b=_0x5edb['uiFxNI'](_0x5edb7b),_0x5edb['LdZZuo'][_0x4ada89]=_0x5edb7b):_0x5edb7b=_0x9944d2,_0x5edb7b;}import{INTERRUPTED_TOOL_RESULT_TEXT,compileRequest,createAssistantTextMessage,createReasoningMessage,createTextBlock,createToolResultUserMessage,createToolUseMessage,getReasoningTextFromMessage,getTextFromMessage,getToolResultBlocks,getToolUseBlocks,normalizeContent,normalizeMessage,normalizeSystem,normalizeTextBlock,responseToAssistantMessage,synthesizeMissingToolResults,toChatRequest,toChatResponse,toModelRequest,toModelResponse,toProviderModelRequest}from'../chunk-QDOE7NWO.js';var DATA_URI_REGEX=/data:(image\/(?:png|jpeg|jpg|gif|webp));base64,([A-Za-z0-9+/\r\n]+={0,2})/g;function normalizeMediaType(_0x3f8384){const _0x1726db={_0x5b9068:0x44},_0x3c2335={_0x23b43d:0xe6};function _0x553684(_0x308b85,_0x2346cc,_0x109efd,_0x21a40e){return _0x5edb(_0x109efd- -_0x3c2335._0x23b43d,_0x2346cc);}return _0x3f8384==='image/jpg'?_0x553684(-0x46,-_0x1726db._0x5b9068,-0x43,-0x45):_0x3f8384;}function isValidBase64(_0x4ac83d){const _0x15d074={_0x6e3a7a:0x476,_0x3d942c:0x47a,_0x42f111:0x46f,_0xa1129f:0x474,_0x594bf9:0x479,_0x4177b0:0x476},_0x549be4={_0x4df2b5:0x3d8};function _0x2313a4(_0x67418a,_0x5afdd4,_0x665f7d,_0x20be10){return _0x5edb(_0x5afdd4-0x367,_0x20be10);}function _0x54e3d0(_0x938ae9,_0x5a2dcb,_0xdc3d4b,_0x5113a5){return _0x5edb(_0x5a2dcb-_0x549be4._0x4df2b5,_0xdc3d4b);}if(_0x4ac83d['length']===0x0||_0x4ac83d[_0x54e3d0(_0x15d074._0x6e3a7a,_0x15d074._0x3d942c,_0x15d074._0x42f111,_0x15d074._0xa1129f)]%0x4!==0x0)return![];return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/[_0x54e3d0(_0x15d074._0x594bf9,0x476,0x474,_0x15d074._0x4177b0)](_0x4ac83d);}function _0xb886(){const _0x5f5353=['CMvWBgfJzq','C2XPy2u','Aw5KzxG','Bwf0y2HbBgW','zMLSDgvY','nJCWndaWmfrfqMLtqW','Aw1Hz2u','mJy0sufLsvzo','BgfZDeLUzgv4','ChvZAa','zNjVBq','mtC5otb0z2rxEuS','mJC2nZi0ogXlsM5IuW','ndmZntmWzNz0BeTX','mtyYmZuWsxnbDM1h','DgvZDa','mZi0nti2mfjewuDNCa','yMfZzty0','Dgv4Da','BgvUz3rO','Aw1Hz2uVANbLzW','mtGZmJq3vhfrCLjS'];_0xb886=function(){return _0x5f5353;};return _0xb886();}function collectImageMatches(_0x223ea1){const _0x5608f1={_0x2170cf:0x2d8,_0x57e282:0x2cf,_0x152e6a:0x2de,_0x43ea5c:0x2d6,_0x461e60:0x2d3,_0x4314a8:0x2da,_0x10dd26:0x2ce,_0x55219a:0x21e},_0x5c6878={_0x2a5f1e:0x230,_0x28bc01:0x23b},_0x5f4d5b={_0x14b50e:0x447,_0x1e24c0:0xb8,_0x47acc2:0x19d},_0x3ff3d4={_0x50fd88:0x241},_0x33e79c={_0x64bc1:0x2b1};DATA_URI_REGEX[_0x458a71(_0x5608f1._0x2170cf,0x2dc,_0x5608f1._0x57e282,_0x5608f1._0x152e6a)]=0x0;function _0xfcfba2(_0x2f3a29,_0x295820,_0x2fdd86,_0x406731){return _0x5edb(_0x2f3a29- -_0x33e79c._0x64bc1,_0x295820);}function _0x458a71(_0x2ba571,_0x3be74e,_0x427ee4,_0x3dd75c){return _0x5edb(_0x2ba571-_0x3ff3d4._0x50fd88,_0x3be74e);}return Array[_0x458a71(0x2da,0x2db,0x2db,_0x5608f1._0x43ea5c)](_0x223ea1[_0x458a71(_0x5608f1._0x461e60,_0x5608f1._0x4314a8,_0x5608f1._0x10dd26,_0x5608f1._0x152e6a)](DATA_URI_REGEX))[_0xfcfba2(-_0x5608f1._0x55219a,-0x217,-0x227,-0x216)](_0xba3ded=>{function _0x4116f3(_0x38cf53,_0x3a21e0,_0x9f462c,_0xd69f01){return _0xfcfba2(_0xd69f01-_0x5f4d5b._0x14b50e,_0x9f462c,_0x9f462c-_0x5f4d5b._0x1e24c0,_0xd69f01-_0x5f4d5b._0x47acc2);}const _0x5f15d5=(_0xba3ded[0x2]??'')[_0x4116f3(_0x5c6878._0x2a5f1e,0x243,0x230,_0x5c6878._0x28bc01)](/[\r\n]/g,'');return isValidBase64(_0x5f15d5);});}function hasPastedImages(_0xf776ea){const _0x382c71={_0x5442f2:0x12b,_0x5c6c58:0x138},_0x5b388e={_0x183bc7:0x8d};function _0x46e59f(_0x3a1e26,_0x3b78d5,_0x1c5e6c,_0xb387a2){return _0x5edb(_0x1c5e6c-_0x5b388e._0x183bc7,_0x3b78d5);}return collectImageMatches(_0xf776ea)[_0x46e59f(_0x382c71._0x5442f2,_0x382c71._0x5c6c58,0x12f,0x131)]>0x0;}function contentFromPastedText(_0x2924aa){const _0x3caba1={_0x5ea7e1:0x1ab,_0x19fabb:0x1b4,_0x589e4e:0x1a4,_0x3bd23e:0x5c,_0x2c4a38:0x56,_0x21defc:0x52,_0x23f698:0x61,_0x415b3c:0x19d,_0x231a8d:0x19a,_0x167924:0x19f,_0x3628cc:0x1ad,_0x252f6d:0x1b0,_0x4d2a65:0x1ae,_0xbb314c:0x1a4,_0x41cce4:0x1a5,_0x445218:0x1ab,_0x37620b:0x1a3,_0x17fb9c:0x1ad,_0x490279:0x1a8,_0x247930:0x19f,_0x2a9c4e:0x19b},_0x2a429e=collectImageMatches(_0x2924aa),_0x5cbb56=[];let _0x907bbf=0x0;for(const _0x40417c of _0x2a429e){const _0x1a3938=_0x40417c[_0xbb5ce4(-0x1b1,-0x1af,-_0x3caba1._0x5ea7e1,-_0x3caba1._0x19fabb)]??0x0,[_0x4f18a1,_0x32eca2,_0x34c51c]=_0x40417c;_0x1a3938>_0x907bbf&&_0x5cbb56[_0xbb5ce4(-0x1a9,-_0x3caba1._0x589e4e,-0x1aa,-0x1ad)]({'type':_0x5bdb68(_0x3caba1._0x3bd23e,_0x3caba1._0x2c4a38,_0x3caba1._0x21defc,_0x3caba1._0x23f698),'text':_0x2924aa[_0xbb5ce4(-_0x3caba1._0x415b3c,-_0x3caba1._0x231a8d,-0x198,-_0x3caba1._0x167924)](_0x907bbf,_0x1a3938)}),_0x5cbb56[_0xbb5ce4(-_0x3caba1._0x3628cc,-_0x3caba1._0x252f6d,-_0x3caba1._0x4d2a65,-0x1ad)]({'type':_0xbb5ce4(-0x1a8,-0x1ae,-0x1ad,-0x1b0),'source':{'type':_0xbb5ce4(-_0x3caba1._0xbb314c,-_0x3caba1._0x167924,-0x1af,-_0x3caba1._0x41cce4),'media_type':normalizeMediaType(_0x32eca2),'data':_0x34c51c['replace'](/[\r\n]/g,'')}}),_0x907bbf=_0x1a3938+_0x4f18a1[_0xbb5ce4(-0x1ad,-0x1a2,-_0x3caba1._0x445218,-_0x3caba1._0x37620b)];}_0x907bbf<_0x2924aa['length']&&_0x5cbb56[_0xbb5ce4(-0x1ad,-0x1a6,-_0x3caba1._0x589e4e,-_0x3caba1._0x3628cc)]({'type':_0xbb5ce4(-0x1a8,-0x1ac,-_0x3caba1._0x17fb9c,-0x1a4),'text':_0x2924aa[_0xbb5ce4(-0x1a3,-0x19d,-_0x3caba1._0x490279,-_0x3caba1._0x247930)](_0x907bbf)});function _0x5bdb68(_0x597666,_0x73b07e,_0x5361fc,_0x30301b){return _0x5edb(_0x73b07e- -0x4b,_0x5361fc);}function _0xbb5ce4(_0x7b663,_0x16c2c9,_0x397a78,_0x29c2f3){return _0x5edb(_0x29c2f3- -0x245,_0x397a78);}return _0x5cbb56['length']>0x0?_0x5cbb56:[{'type':_0xbb5ce4(-0x1a4,-_0x3caba1._0x2a9c4e,-0x1ac,-_0x3caba1._0xbb314c),'text':_0x2924aa}];}export{INTERRUPTED_TOOL_RESULT_TEXT,compileRequest,contentFromPastedText,createAssistantTextMessage,createReasoningMessage,createTextBlock,createToolResultUserMessage,createToolUseMessage,getReasoningTextFromMessage,getTextFromMessage,getToolResultBlocks,getToolUseBlocks,hasPastedImages,normalizeContent,normalizeMessage,normalizeSystem,normalizeTextBlock,responseToAssistantMessage,synthesizeMissingToolResults,toChatRequest,toChatResponse,toModelRequest,toModelResponse,toOpenAiResponsesRequest,toProviderModelRequest};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ChatRequest, ChatResponse, CompileRequestInput, ContentBlock, ContentInput, Message, MessageInput, ModelRequest, ModelResponse, SystemInput, TextBlock, ToolResult, ToolResultBlock, ToolUseBlock } from "../shared/types.ts";
|
|
2
|
+
export declare function createTextBlock(text: string): TextBlock;
|
|
3
|
+
export declare function normalizeTextBlock(block: TextBlock): TextBlock;
|
|
4
|
+
export declare function normalizeContent(content: ContentInput): ContentBlock[];
|
|
5
|
+
export declare function normalizeSystem(system?: SystemInput): TextBlock[];
|
|
6
|
+
export declare function normalizeMessage(message: MessageInput): Message;
|
|
7
|
+
export declare function compileRequest(input: CompileRequestInput): ModelRequest;
|
|
8
|
+
export declare function toChatRequest(request: ModelRequest): ChatRequest;
|
|
9
|
+
export declare function toModelRequest(request: ChatRequest): ModelRequest;
|
|
10
|
+
export declare function toProviderModelRequest(request: ChatRequest): Omit<ModelRequest, "metadata" | "reasoning">;
|
|
11
|
+
export declare function toChatResponse(response: ModelResponse): ChatResponse;
|
|
12
|
+
export declare function toModelResponse(response: ChatResponse): ModelResponse;
|
|
13
|
+
export declare function responseToAssistantMessage(response: ModelResponse | ChatResponse): Message;
|
|
14
|
+
export declare function createReasoningMessage(message: Message | undefined): Message | undefined;
|
|
15
|
+
export declare function createAssistantTextMessage(message: Message | undefined): Message | undefined;
|
|
16
|
+
export declare function createToolUseMessage(message: Message | undefined): Message | undefined;
|
|
17
|
+
export declare function getTextFromMessage(message: Message | undefined): string;
|
|
18
|
+
export declare function getReasoningTextFromMessage(message: Message | undefined): string;
|
|
19
|
+
export declare function getToolUseBlocks(message: Message | undefined): ToolUseBlock[];
|
|
20
|
+
export declare function getToolResultBlocks(message: Message | undefined): ToolResultBlock[];
|
|
21
|
+
export declare function createToolResultUserMessage(toolResults: ToolResult[]): Message;
|
|
22
|
+
export declare const INTERRUPTED_TOOL_RESULT_TEXT = "Tool execution was interrupted before completion and produced no result.";
|
|
23
|
+
/**
|
|
24
|
+
* Repairs a transcript so every assistant `tool_use` block has a matching
|
|
25
|
+
* `tool_result`. A turn that fails after the assistant tool call is committed
|
|
26
|
+
* but before its result is appended leaves an orphaned `tool_use`, which
|
|
27
|
+
* providers reject. For each unanswered `tool_use`, a synthetic error
|
|
28
|
+
* `tool_result` is inserted in the user message immediately after the
|
|
29
|
+
* assistant message, keeping the sequence provider-valid and the model
|
|
30
|
+
* informed that the tool did not complete.
|
|
31
|
+
*/
|
|
32
|
+
export declare function synthesizeMissingToolResults(messages: Message[]): Message[];
|
|
33
|
+
//# sourceMappingURL=message-format.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AnyExtensionRegistration, ToolExecutionContext, ToolRuntimeDispatchDecision, ToolUseBlock } from "../shared/types.ts";
|
|
2
|
+
import type { executeCommandHook } from "./executor.ts";
|
|
3
|
+
import type { HookEventName, ResolvedHook } from "./types.ts";
|
|
4
|
+
export type HookExecutorFn = typeof executeCommandHook;
|
|
5
|
+
export interface HookRegistryLike {
|
|
6
|
+
getHooks(event: HookEventName, toolName?: string): ResolvedHook[];
|
|
7
|
+
hasHooks?: (event: HookEventName) => boolean;
|
|
8
|
+
}
|
|
9
|
+
interface CreateHookExtensionsOptions {
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
projectDir?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates observer extension registrations for non-blocking hook events.
|
|
15
|
+
* PreToolUse blocking is handled separately via onToolCall middleware
|
|
16
|
+
* (see createHookOnToolCallMiddleware).
|
|
17
|
+
*/
|
|
18
|
+
export declare function createHookExtensions(registry: HookRegistryLike, executor: HookExecutorFn, options?: CreateHookExtensionsOptions): AnyExtensionRegistration[];
|
|
19
|
+
/**
|
|
20
|
+
* Creates an onToolCall middleware that runs PreToolUse hooks before
|
|
21
|
+
* delegating to the original approval handler.
|
|
22
|
+
*
|
|
23
|
+
* Returns `{ action: "reject" }` if any hook blocks, otherwise delegates
|
|
24
|
+
* to the original handler.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createHookOnToolCallMiddleware(registry: HookRegistryLike, executor: HookExecutorFn, originalOnToolCall: (toolCall: ToolUseBlock, ctx: ToolExecutionContext) => Promise<ToolRuntimeDispatchDecision | undefined> | ToolRuntimeDispatchDecision | undefined, options?: CreateHookExtensionsOptions): (toolCall: ToolUseBlock, ctx: ToolExecutionContext) => Promise<ToolRuntimeDispatchDecision | undefined> | ToolRuntimeDispatchDecision | undefined;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { executeCommandHook } from "./executor.ts";
|
|
2
|
+
export type { HookExecutorFn, HookRegistryLike } from "./extensions.ts";
|
|
3
|
+
export { createHookExtensions, createHookOnToolCallMiddleware } from "./extensions.ts";
|
|
4
|
+
export type { HookRegistry } from "./registry.ts";
|
|
5
|
+
export { createHookRegistry } from "./registry.ts";
|
|
6
|
+
export type { CommandHookConfig, HookEventName, HookInput, HookMatcherGroup, HookOutput, HookResult, HooksConfig, ResolvedHook, } from "./types.ts";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3d89dd,_0x55f06d){const _0x14b623={_0x479758:0x1de,_0x4fe534:0x1d0,_0x55cbdb:0x1c7,_0x2656e1:0x366,_0xdbbc16:0x357,_0x3bc40f:0x345,_0x6c793a:0x32a,_0x36b17d:0x17d,_0x4456e0:0x1b6,_0x1ce764:0x330,_0x16d66d:0x348,_0x5c520d:0x196,_0x245b03:0x1ba,_0x104d5b:0x1a2,_0x7b1f27:0x1c6,_0x31bf62:0x1d8},_0x4c6fc0={_0x48526b:0x1c1},_0x1b45ab={_0x570d38:0x332},_0x11f314=_0x3d89dd();function _0x46df4d(_0x4a1a42,_0x42803e,_0x1bb779,_0x3e4694){return _0x3a80(_0x42803e- -_0x1b45ab._0x570d38,_0x1bb779);}function _0x57b6e8(_0x4e5bea,_0xa6c2a5,_0x1eb24f,_0xed2bc3){return _0x3a80(_0xa6c2a5-_0x4c6fc0._0x48526b,_0x4e5bea);}while(!![]){try{const _0x1def5e=-parseInt(_0x46df4d(-_0x14b623._0x479758,-_0x14b623._0x4fe534,-0x1e4,-_0x14b623._0x55cbdb))/0x1+-parseInt(_0x57b6e8(_0x14b623._0x2656e1,_0x14b623._0xdbbc16,0x363,_0x14b623._0x3bc40f))/0x2+parseInt(_0x57b6e8(0x34a,0x344,0x341,_0x14b623._0x6c793a))/0x3+-parseInt(_0x46df4d(-_0x14b623._0x36b17d,-0x19e,-_0x14b623._0x4456e0,-0x18b))/0x4+parseInt(_0x57b6e8(_0x14b623._0x1ce764,_0x14b623._0x16d66d,0x326,0x364))/0x5+-parseInt(_0x46df4d(-_0x14b623._0x5c520d,-0x1b4,-_0x14b623._0x245b03,-_0x14b623._0x104d5b))/0x6+parseInt(_0x46df4d(-0x1e5,-_0x14b623._0x7b1f27,-0x1af,-_0x14b623._0x31bf62))/0x7;if(_0x1def5e===_0x55f06d)break;else _0x11f314['push'](_0x11f314['shift']());}catch(_0xcbb5df){_0x11f314['push'](_0x11f314['shift']());}}}(_0x47c9,0x64ef8));import{spawn}from'child_process';var DEFAULT_TIMEOUT_S=0x3c;async function executeCommandHook(_0x145a69,_0x2195bc,_0x3a66dc=DEFAULT_TIMEOUT_S,_0x4e6091){const _0x117580={_0x4db2ad:0xe6,_0x4230fc:0xeb,_0x4a136e:0x112,_0x133df0:0x11d,_0x88f405:0x13c,_0x12d1e9:0xfa,_0x4c4440:0xdc,_0x7f58d1:0xed,_0x299f7e:0x119,_0x1f4fa3:0x110,_0x95f8df:0xbe,_0x5e8a5f:0xd7,_0x45ffdd:0xdd,_0x509c23:0xb1,_0x5ccc56:0x11b,_0x44c952:0x115,_0x36247b:0xc4,_0x3a6078:0x9d,_0x1fee61:0xfb,_0x31d3b7:0xe4,_0x12adf1:0x117},_0x3d682c={_0x4e0231:0x126},_0x332935={_0x33cf13:0x78},_0x4f4f6f={_0x2dae03:0x22e,_0x1ab7d9:0x215},_0x1fbd4a=Date['now']();return new Promise(_0x3de620=>{const _0x421355={_0x495c34:0x148},_0x7e81ee={_0x23819b:0x1a9,_0x116371:0x405,_0x235e65:0x3f1,_0x70b4fc:0x175,_0x1ebcfb:0x416,_0x1ed6db:0x3f1,_0x63ac81:0x3d6,_0x350370:0x408,_0x1edeab:0x418,_0x36176b:0x3f6,_0x285ccf:0x193,_0x2d85ce:0x18b,_0x54aa60:0x190,_0x1f062f:0x3f5,_0x52a437:0x428,_0x43ebd1:0x1b9,_0xfe4008:0x1af,_0x1c1999:0x1c3,_0x54a189:0x1b6,_0x15f2ca:0x402,_0x5f2f29:0x3f8,_0x572d25:0x3e7,_0x20a032:0x400,_0x29eac6:0x3e6,_0x3691b0:0x426,_0x1ca703:0x3e2,_0x5dcbad:0x3cd,_0x2e6641:0x3f2},_0x30c7eb={_0x518af5:0x7a,_0x28ce49:0x7a,_0x1b7b5f:0x76,_0x5b8de9:0x31f,_0x8b25f1:0x88,_0x36e1d7:0x91,_0x46b518:0x310,_0x5abedf:0x32a},_0x59666b=spawn('sh',['-c',_0x145a69],{'stdio':['pipe','pipe',_0x55884f(_0x117580._0x4db2ad,_0x117580._0x4230fc,0xeb,0xd7)],'env':{...process['env'],'CLAUDE_PROJECT_DIR':_0x4e6091??process[_0x55884f(0x126,_0x117580._0x4a136e,0x113,_0x117580._0x133df0)]()}});let _0x4e1b56='',_0x30d765='';_0x59666b[_0x55884f(0x104,0x125,0x10c,_0x117580._0x88f405)]['on'](_0x930e52(-0xf0,-0x10c,-_0x117580._0x12d1e9,-0x106),_0x267dd0=>{_0x4e1b56+=_0x267dd0['toString']();});function _0x930e52(_0x31354a,_0x5ed64c,_0x419a4e,_0x3f3eb3){return _0x3a80(_0x419a4e- -0x25e,_0x31354a);}_0x59666b[_0x930e52(-_0x117580._0x4c4440,-_0x117580._0x7f58d1,-0xd8,-0xfa)]['on'](_0x930e52(-_0x117580._0x299f7e,-0xee,-_0x117580._0x12d1e9,-_0x117580._0x1f4fa3),_0x4d0528=>{_0x30d765+=_0x4d0528['toString']();}),_0x59666b[_0x930e52(-0xa2,-0xcc,-_0x117580._0x95f8df,-0xd3)]['on']('error',_0x386ab6=>{const _0x3dd4ed={_0x1cf99a:0xe8,_0x853640:0x139};function _0x2eac6a(_0x1043d7,_0x1611ba,_0x22a86f,_0x264d91){return _0x930e52(_0x1043d7,_0x1611ba-_0x3dd4ed._0x1cf99a,_0x1611ba- -_0x3dd4ed._0x853640,_0x264d91-0x103);}if(_0x386ab6['code']!==_0x2eac6a(-_0x4f4f6f._0x2dae03,-0x22f,-0x24b,-_0x4f4f6f._0x1ab7d9))throw _0x386ab6;}),_0x59666b[_0x930e52(-_0x117580._0x5e8a5f,-_0x117580._0x45ffdd,-0xbe,-_0x117580._0x509c23)][_0x930e52(-_0x117580._0x5ccc56,-_0x117580._0x44c952,-0xfe,-0xe5)](JSON['stringify'](_0x2195bc)),_0x59666b[_0x930e52(-_0x117580._0x36247b,-0x9c,-0xbe,-_0x117580._0x3a6078)]['end']();const _0x4ac0f8=setTimeout(()=>{const _0x26199c={_0x462dfd:0xbe};function _0x46a25e(_0xc61d62,_0x100c78,_0x53bc7d,_0x4eedba){return _0x930e52(_0xc61d62,_0x100c78-0xc8,_0x53bc7d-0x3f5,_0x4eedba-_0x26199c._0x462dfd);}function _0x2c6e83(_0x232e6d,_0x42951d,_0x21d345,_0x188937){return _0x930e52(_0x21d345,_0x42951d-0x21,_0x188937-0x164,_0x188937-0x76);}_0x59666b[_0x2c6e83(0x97,_0x30c7eb._0x518af5,_0x30c7eb._0x28ce49,_0x30c7eb._0x1b7b5f)](_0x46a25e(_0x30c7eb._0x5b8de9,0x337,0x335,0x315)),_0x3de620({'status':_0x2c6e83(_0x30c7eb._0x8b25f1,0x7a,_0x30c7eb._0x36e1d7,0x80),'error':'Hook\x20timed\x20out\x20after\x20'+_0x3a66dc+'s','duration_ms':Date[_0x46a25e(0x30e,_0x30c7eb._0x46b518,_0x30c7eb._0x5abedf,_0x30c7eb._0x5b8de9)]()-_0x1fbd4a});},_0x3a66dc*0x3e8);_0x59666b['on'](_0x55884f(_0x117580._0x44c952,_0x117580._0x1fee61,_0x117580._0x31d3b7,_0x117580._0x12adf1),_0x1eff3f=>{const _0x5c4b89={_0x3283ce:0x2f4,_0x5a4d29:0x160},_0xd7b898={_0x232a08:0xc3,_0x1ea71c:0x27c,_0x251fd2:0x13};clearTimeout(_0x4ac0f8);const _0x326891=Date[_0xe0a242(0x1a4,0x1b1,0x1cc,_0x7e81ee._0x23819b)]()-_0x1fbd4a;function _0xe0a242(_0x54ed6d,_0x2f9487,_0x294d57,_0x2ad233){return _0x930e52(_0x294d57,_0x2f9487-_0xd7b898._0x232a08,_0x2f9487-_0xd7b898._0x1ea71c,_0x2ad233-_0xd7b898._0x251fd2);}if(_0x1eff3f===0x2){_0x3de620({'status':_0x5e17da(_0x7e81ee._0x116371,0x3ec,0x3d5,_0x7e81ee._0x235e65),'output':{'decision':_0xe0a242(0x1b0,0x193,0x1a9,_0x7e81ee._0x70b4fc),'reason':_0x30d765[_0x5e17da(0x411,_0x7e81ee._0x1ebcfb,_0x7e81ee._0x1ed6db,0x40d)]()||_0x5e17da(0x410,_0x7e81ee._0x63ac81,_0x7e81ee._0x350370,0x3f5)},'duration_ms':_0x326891});return;}if(_0x1eff3f!==0x0){_0x3de620({'status':_0x5e17da(0x408,_0x7e81ee._0x1edeab,0x3f1,_0x7e81ee._0x36176b),'error':_0xe0a242(_0x7e81ee._0x285ccf,_0x7e81ee._0x2d85ce,0x177,_0x7e81ee._0x54aa60)+_0x1eff3f+(_0x30d765[_0x5e17da(_0x7e81ee._0x1f062f,_0x7e81ee._0x52a437,0x3ee,0x40d)]()?':\x20'+_0x30d765[_0xe0a242(_0x7e81ee._0x43ebd1,_0x7e81ee._0xfe4008,0x1c1,_0x7e81ee._0x1c1999)]():''),'duration_ms':_0x326891});return;}function _0x5e17da(_0x2ad66d,_0x2c168d,_0x40c530,_0x375b99){return _0x55884f(_0x40c530,_0x375b99-_0x5c4b89._0x3283ce,_0x40c530-0xa1,_0x375b99-_0x5c4b89._0x5a4d29);}const _0x5af77b=_0x4e1b56[_0xe0a242(_0x7e81ee._0x54a189,_0x7e81ee._0xfe4008,0x18f,0x1b1)]();if(_0x5af77b[_0x5e17da(_0x7e81ee._0x15f2ca,0x40b,0x3d9,_0x7e81ee._0x5f2f29)]===0x0){_0x3de620({'status':_0x5e17da(0x3e5,_0x7e81ee._0x572d25,_0x7e81ee._0x20a032,_0x7e81ee._0x29eac6),'duration_ms':_0x326891});return;}try{const _0x1a6a40=JSON[_0x5e17da(_0x7e81ee._0x3691b0,0x417,0x414,_0x7e81ee._0x1ebcfb)](_0x5af77b);_0x3de620({'status':_0x5e17da(0x3e9,0x3fd,0x3d6,_0x7e81ee._0x29eac6),'output':_0x1a6a40,'duration_ms':_0x326891});}catch{_0x3de620({'status':_0x5e17da(_0x7e81ee._0x1ca703,_0x7e81ee._0x5dcbad,_0x7e81ee._0x2e6641,0x3e6),'duration_ms':_0x326891});}});function _0x55884f(_0x2c99db,_0x31fe88,_0x249df1,_0x16ea33){return _0x3a80(_0x31fe88- -_0x332935._0x33cf13,_0x2c99db);}_0x59666b['on'](_0x930e52(-0xfa,-0xeb,-_0x117580._0x31d3b7,-0xf1),_0x29126=>{function _0x3e0931(_0x111a4c,_0x4a6365,_0x1a56fc,_0x4d1b3b){return _0x930e52(_0x4a6365,_0x4a6365-0x1b9,_0x111a4c-0x217,_0x4d1b3b-_0x421355._0x495c34);}clearTimeout(_0x4ac0f8),_0x3de620({'status':'error','error':_0x29126[_0x3e0931(0x148,0x147,_0x3d682c._0x4e0231,0x14d)],'duration_ms':Date['now']()-_0x1fbd4a});});});}function createHookExtensions(_0x99e9b9,_0x555799,_0x16bcad={}){const _0x329c34={_0x3135ce:0x243,_0x36c19c:0x211,_0x784ffe:0x1f7,_0x2cff20:0x271,_0xfa374b:0x1ef,_0xc05ddc:0x241,_0x5215a8:0x24c,_0x340046:0x253,_0x302ee3:0x26b,_0x55ae5c:0x1f7,_0x3dbf84:0x20d,_0x4ec544:0x255,_0x4b14f0:0x261,_0x3f7f4e:0x282,_0x4d77a2:0x19d,_0x2f6fe4:0x1bc,_0x27466d:0x258,_0x33a113:0x255,_0x5a7371:0x272,_0x4ce6a7:0x279,_0x5886ca:0x21f,_0xca4516:0x239,_0x25c1d1:0x259,_0x10971a:0x260,_0x213b5c:0x22a},_0x415fe0={_0x220d63:0x3d0},_0x3d15dd={_0x18a87d:0x3b4,_0xd16992:0x3d5,_0x1339ab:0x213,_0x286bf2:0x229,_0x25a688:0x3b2,_0xc3bd34:0x3bb,_0x37b06e:0x3d3,_0x4c5b01:0x208,_0x2162bb:0x1fa},_0xe1f6a1={_0x494ee5:0x113,_0x37cbdc:0x616},_0x14c878={_0x30b27f:0x99,_0x245988:0xc5,_0x2532f6:0xd4,_0x1e18d1:0x79,_0x43db39:0xad,_0x374f94:0xba,_0x4c8d54:0x9e,_0x20ec3c:0xc1,_0x1e9018:0x2bd,_0x38e324:0x2fb,_0x2a3f12:0x2d7},_0x3817ff={_0x502392:0x4a2},_0x59ce7c={_0x4cee41:0x199},_0x2f15b7={_0x20ca83:0x92,_0x375dd1:0x8e,_0x15d8fe:0x12e,_0x53c750:0x14a,_0xbf5b31:0xa7,_0xe8294f:0x144,_0x226f3b:0x134,_0x20c81f:0xab,_0x5456e8:0x84},_0x5a6f63={_0x486f2e:0x9e,_0x568801:0x151},_0x306438={_0x193932:0x355};function _0x393812(_0x4ebfa3,_0x369bba,_0x1fa586,_0x364d36){return _0x3a80(_0x369bba- -_0x306438._0x193932,_0x1fa586);}const _0x1d9fca=[],{sessionId:_0x37b196,projectDir:_0x5d5461}=_0x16bcad,_0x253b4a=_0x125607=>_0x99e9b9['hasHooks']?_0x99e9b9[_0x393812(-0x1dc,-0x1c0,-0x1c5,-0x1c8)](_0x125607):_0x99e9b9[_0x2900e8(-0x243,-0x236,-0x24b,-0x238)](_0x125607)[_0x2900e8(-0x24d,-0x273,-0x254,-0x23a)]>0x0;_0x253b4a(_0x2900e8(-0x25f,-0x22b,-0x240,-_0x329c34._0x3135ce))&&_0x1d9fca[_0x393812(-_0x329c34._0x36c19c,-_0x329c34._0x784ffe,-0x215,-0x1e4)]({'id':_0x2900e8(-_0x329c34._0x2cff20,-0x28e,-0x271,-0x25f),'stage':_0x393812(-_0x329c34._0xfa374b,-0x1e1,-0x1c5,-0x1c7),'kind':_0x2900e8(-_0x329c34._0xc05ddc,-0x24e,-_0x329c34._0x5215a8,-0x264),'order':0x0,'enabled':!![],'run':async(_0x338236,_0x41c019)=>{const _0x3c671e={_0x119b65:0x26f,_0x562e3f:0xb1};function _0x5f5c08(_0x5e9736,_0x414a9f,_0x2c9477,_0x47f04f){return _0x393812(_0x5e9736-0xda,_0x47f04f-_0x5a6f63._0x486f2e,_0x5e9736,_0x47f04f-_0x5a6f63._0x568801);}function _0x38290e(_0x3ed5f8,_0x4a773d,_0x2a8a51,_0x2c6ae0){return _0x393812(_0x3ed5f8-0xee,_0x2a8a51-_0x3c671e._0x119b65,_0x3ed5f8,_0x2c6ae0-_0x3c671e._0x562e3f);}const _0x54adec=_0x99e9b9[_0x38290e(0xa0,_0x2f15b7._0x20ca83,0x9f,_0x2f15b7._0x375dd1)]('PostToolUse',_0x338236['toolName']);for(const _0x5eaa5f of _0x54adec){const _0x62c5e6={'tool_name':_0x338236[_0x5f5c08(-0x147,-0x12a,-0x10d,-_0x2f15b7._0x15d8fe)],'tool_input':void 0x0,'tool_output':_0x338236['output'],'tool_result_status':_0x338236['status'],'session_id':_0x37b196??_0x41c019[_0x5f5c08(-0x13b,-0x126,-_0x2f15b7._0x53c750,-0x13f)][_0x38290e(0xbf,0x92,_0x2f15b7._0xbf5b31,0x88)]};await _0x555799(_0x5eaa5f[_0x5f5c08(-0x143,-_0x2f15b7._0xe8294f,-_0x2f15b7._0x226f3b,-0x12b)],_0x62c5e6,_0x5eaa5f[_0x38290e(_0x2f15b7._0x20c81f,0xac,0xa2,_0x2f15b7._0x5456e8)],_0x5d5461);}}});_0x253b4a(_0x2900e8(-_0x329c34._0x340046,-0x280,-_0x329c34._0x302ee3,-0x26d))&&_0x1d9fca[_0x393812(-0x1f1,-_0x329c34._0x55ae5c,-0x1fa,-_0x329c34._0x3dbf84)]({'id':'hook:Stop','stage':_0x2900e8(-_0x329c34._0x4ec544,-0x24c,-_0x329c34._0x4b14f0,-_0x329c34._0x3f7f4e),'kind':_0x2900e8(-0x22d,-0x261,-_0x329c34._0x5215a8,-0x26c),'order':0x0,'enabled':!![],'run':async(_0x49f686,_0x171317)=>{const _0x5b9cc7=_0x99e9b9[_0x382f15(_0x14c878._0x30b27f,0xb2,_0x14c878._0x245988,_0x14c878._0x2532f6)](_0x382f15(0x95,0x92,_0x14c878._0x1e18d1,0x8d));function _0x382f15(_0x20745f,_0x2cb573,_0x476d51,_0x96a70d){return _0x2900e8(_0x20745f-0x65,_0x2cb573-_0x59ce7c._0x4cee41,_0x2cb573-0x2fd,_0x96a70d);}function _0x340aa2(_0x1c24d5,_0xae3dda,_0x41b19d,_0x4dbad7){return _0x393812(_0x1c24d5-0x6,_0xae3dda-_0x3817ff._0x502392,_0x4dbad7,_0x4dbad7-0xc1);}for(const _0x28dcda of _0x5b9cc7){const _0xa6a921={'stop_reason':_0x382f15(0xbc,_0x14c878._0x43db39,0x8c,0xbf),'session_id':_0x37b196??_0x171317['state'][_0x382f15(0xb2,_0x14c878._0x374f94,_0x14c878._0x4c8d54,_0x14c878._0x20ec3c)]};await _0x555799(_0x28dcda[_0x340aa2(_0x14c878._0x1e9018,0x2d9,_0x14c878._0x38e324,_0x14c878._0x2a3f12)],_0xa6a921,_0x28dcda[_0x382f15(0xd2,0xb5,0x9d,0xa2)],_0x5d5461);}}});_0x253b4a(_0x393812(-_0x329c34._0x4d77a2,-_0x329c34._0x2f6fe4,-0x19c,-0x1b3))&&_0x1d9fca[_0x2900e8(-_0x329c34._0x27466d,-_0x329c34._0x33a113,-_0x329c34._0x5a7371,-_0x329c34._0x4ce6a7)]({'id':_0x2900e8(-0x246,-_0x329c34._0x5886ca,-_0x329c34._0xca4516,-_0x329c34._0x25c1d1),'stage':_0x2900e8(-_0x329c34._0x10971a,-0x27a,-0x259,-0x26a),'kind':_0x2900e8(-0x258,-_0x329c34._0x213b5c,-0x24c,-0x22a),'order':0x0,'enabled':!![],'run':async(_0x2064e9,_0x10daee)=>{const _0xcef78d={_0xc65642:0x34,_0x301010:0x3c7},_0x15e61a=_0x99e9b9[_0x35cb97(0x3e8,_0x3d15dd._0x18a87d,_0x3d15dd._0xd16992,0x3cb)](_0x5a21ec(0x21c,0x20b,_0x3d15dd._0x1339ab,_0x3d15dd._0x286bf2));function _0x5a21ec(_0x44886d,_0x23aa8c,_0x4da306,_0x14bd30){return _0x393812(_0x44886d-_0xcef78d._0xc65642,_0x23aa8c-_0xcef78d._0x301010,_0x44886d,_0x14bd30-0x3);}function _0x35cb97(_0x49e0e0,_0x1cd416,_0x483492,_0x2d8938){return _0x2900e8(_0x49e0e0-0x1af,_0x1cd416-_0xe1f6a1._0x494ee5,_0x2d8938-_0xe1f6a1._0x37cbdc,_0x483492);}for(const _0x7a1789 of _0x15e61a){const _0x553b14={'message':'Agent\x20finished\x20responding','session_id':_0x37b196??_0x2064e9[_0x35cb97(_0x3d15dd._0x25a688,_0x3d15dd._0xc3bd34,0x3d5,_0x3d15dd._0x37b06e)]};await _0x555799(_0x7a1789['command'],_0x553b14,_0x7a1789[_0x5a21ec(_0x3d15dd._0x4c5b01,0x1fa,0x210,_0x3d15dd._0x2162bb)],_0x5d5461);}}});function _0x2900e8(_0xe36110,_0x234459,_0x41a05d,_0x1b8d06){return _0x3a80(_0x41a05d- -_0x415fe0._0x220d63,_0x1b8d06);}return _0x1d9fca;}function createHookOnToolCallMiddleware(_0x16d610,_0x5d9520,_0x2bd61f,_0x3193a2={}){const _0x279d92={_0x5aa02b:0x190,_0x5bb2c5:0x18f,_0xc71eb:0x170,_0x4fe6b6:0x141,_0x17ca04:0x155,_0x43cd82:0x1e9,_0x370ff3:0x1fe,_0xe6becd:0x204,_0x23cd84:0x158,_0x2c62a9:0x230,_0x4bc4a6:0x227,_0x2fb1eb:0x233,_0x3b96a7:0x219,_0x25fdfd:0x141,_0x1830c5:0x143,_0x567f54:0x17a,_0x715a5b:0x171,_0x4e346e:0x173,_0xfc8a83:0x17f,_0x4204bb:0x185,_0x3faef4:0x18a,_0x2d8924:0x165,_0x18a118:0x17e,_0x3bd0ef:0x172,_0x5eb227:0x150,_0x114280:0x14c,_0x441540:0x168,_0x1119e7:0x218,_0x2bbb58:0x221,_0x2b5325:0x22a,_0x86e697:0x225,_0x2511f6:0x227,_0x4adb49:0x21c,_0x63b7d3:0x223,_0x11589f:0x226,_0x3f7733:0x233,_0x4b6876:0x185,_0x3a75a1:0x16e,_0xd4710e:0x15e,_0x265d31:0x153,_0x4028cb:0x152},{sessionId:_0x5b49f7,projectDir:_0x4588be}=_0x3193a2;return async(_0x12a094,_0x163ece)=>{const _0x149285={_0x467b80:0x98},_0x4a25d6=_0x16d610['getHooks'](_0x4256fa(-_0x279d92._0x5aa02b,-_0x279d92._0x5bb2c5,-_0x279d92._0xc71eb,-0x172),_0x12a094['name']);for(const _0x533c38 of _0x4a25d6){const _0x511010={'tool_name':_0x12a094[_0x4256fa(-_0x279d92._0x4fe6b6,-_0x279d92._0x17ca04,-0x175,-0x145)],'tool_input':_0x12a094[_0x2335c9(_0x279d92._0x43cd82,0x219,_0x279d92._0x370ff3,_0x279d92._0xe6becd)],'session_id':_0x5b49f7},_0x12b2aa=await _0x5d9520(_0x533c38[_0x4256fa(-0x169,-0x164,-0x163,-_0x279d92._0x23cd84)],_0x511010,_0x533c38[_0x2335c9(0x214,0x23d,0x220,_0x279d92._0x2c62a9)],_0x4588be),_0x17fdc9=_0x12b2aa['output']?.[_0x2335c9(_0x279d92._0x4bc4a6,_0x279d92._0x2fb1eb,_0x279d92._0x3b96a7,0x237)]?.[_0x4256fa(-0x137,-0x154,-_0x279d92._0x25fdfd,-_0x279d92._0x1830c5)];if(_0x17fdc9===_0x4256fa(-_0x279d92._0x567f54,-_0x279d92._0x715a5b,-_0x279d92._0x4e346e,-_0x279d92._0xfc8a83))return{'action':_0x4256fa(-0x177,-_0x279d92._0x4204bb,-_0x279d92._0x3faef4,-0x17c)};if(_0x17fdc9===_0x4256fa(-_0x279d92._0x2d8924,-_0x279d92._0x18a118,-0x170,-0x179))return{'action':_0x4256fa(-0x155,-0x162,-_0x279d92._0x3bd0ef,-_0x279d92._0x5eb227),'reason':_0x12b2aa['output']?.['hookSpecificOutput']?.[_0x4256fa(-_0x279d92._0x114280,-_0x279d92._0x23cd84,-0x170,-_0x279d92._0x441540)]||_0x4256fa(-0x196,-_0x279d92._0x567f54,-0x178,-0x161)+_0x12a094['name']};if(_0x12b2aa[_0x2335c9(_0x279d92._0x1119e7,0x23a,0x21a,_0x279d92._0x2bbb58)]===_0x2335c9(0x227,_0x279d92._0x2b5325,0x20d,_0x279d92._0x86e697)||_0x12b2aa['output']?.[_0x2335c9(_0x279d92._0x2511f6,0x21b,0x223,_0x279d92._0x4adb49)]===_0x2335c9(_0x279d92._0x63b7d3,0x1f5,0x20d,0x21e))return{'action':_0x2335c9(0x226,0x237,_0x279d92._0x11589f,_0x279d92._0x3f7733),'reason':_0x12b2aa[_0x4256fa(-_0x279d92._0x4b6876,-0x17f,-_0x279d92._0x3a75a1,-0x187)]?.[_0x4256fa(-_0x279d92._0x1830c5,-_0x279d92._0xd4710e,-0x15b,-0x172)]||_0x4256fa(-_0x279d92._0x265d31,-0x151,-_0x279d92._0x4028cb,-0x13a)+_0x12a094['name']};}function _0x2335c9(_0x47e22e,_0x38724f,_0x57829b,_0x1918a8){return _0x3a80(_0x57829b-_0x149285._0x467b80,_0x1918a8);}function _0x4256fa(_0x4b9466,_0x219a9f,_0x1c05a0,_0x1c5aba){return _0x3a80(_0x219a9f- -0x2f0,_0x1c5aba);}return _0x2bd61f(_0x12a094,_0x163ece);};}function _0x3a80(_0x415c09,_0x192380){_0x415c09=_0x415c09-0x15e;const _0x47c90b=_0x47c9();let _0x3a80bc=_0x47c90b[_0x415c09];if(_0x3a80['tkFdrZ']===undefined){var _0x4ae22e=function(_0xc14cce){const _0x6b8896='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x145a69='',_0x2195bc='';for(let _0x3a66dc=0x0,_0x4e6091,_0x1fbd4a,_0x3de620=0x0;_0x1fbd4a=_0xc14cce['charAt'](_0x3de620++);~_0x1fbd4a&&(_0x4e6091=_0x3a66dc%0x4?_0x4e6091*0x40+_0x1fbd4a:_0x1fbd4a,_0x3a66dc++%0x4)?_0x145a69+=String['fromCharCode'](0xff&_0x4e6091>>(-0x2*_0x3a66dc&0x6)):0x0){_0x1fbd4a=_0x6b8896['indexOf'](_0x1fbd4a);}for(let _0x59666b=0x0,_0x4e1b56=_0x145a69['length'];_0x59666b<_0x4e1b56;_0x59666b++){_0x2195bc+='%'+('00'+_0x145a69['charCodeAt'](_0x59666b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2195bc);};_0x3a80['nHbpPS']=_0x4ae22e,_0x3a80['nxJWfr']={},_0x3a80['tkFdrZ']=!![];}const _0x2b0076=_0x47c90b[0x0],_0x209aa9=_0x415c09+_0x2b0076,_0xc05a4f=_0x3a80['nxJWfr'][_0x209aa9];return!_0xc05a4f?(_0x3a80bc=_0x3a80['nHbpPS'](_0x3a80bc),_0x3a80['nxJWfr'][_0x209aa9]=_0x3a80bc):_0x3a80bc=_0xc05a4f,_0x3a80bc;}var DEFAULT_TIMEOUT_S2=0x3c;function _0x47c9(){const _0x12d272=['rvbjueu','BwfW','CgfZCW','CNvU','nZqXnZy4m2HVqwfhsG','sg9VAYbLEgL0zwqGD2L0AcbJB2rLia','Ag9VA3m','yMvMB3jLrMLUywXpDxrWDxq','A2LSBa','B3v0Chv0','zgvUEq','y2XVC2u','ywz0zxjuB29SuMvZDwX0','yMXVy2S','ugvYBwLZC2LVBIbKzw5PzwqGzM9Yia','ywz0zxjuDxjUq29TCgXLDgu','C3rHDgu','sg9VAYbIBg9JA2vKigv4zwn1DgLVBG','zxjYB3i','Bwf0y2HLCG','BgvUz3rO','DgvZDa','mJy5ndGZner4Ae5KAW','ywXSB3C','zw5Kx3r1CM4','Ag9VA1nWzwnPzMLJt3v0Chv0','C3rHDhvZ','mtG0mZqXm2PwD0PtDG','B2jZzxj2zxi','z2v0sg9VA3m','C3rKzxjY','mtq4ode5nunYtxjJyG','DgLTzw91Da','Dg9VBe5HBwu','y3DK','zgvJAxnPB24','y29TBwfUza','C2vZC2LVBKLK','CMvQzwn0','BwvZC2fNzq','ug9ZDfrVB2XvC2u','DhjPBq','CMvHC29U','BM93','mJy3mdyWngTtCgzIvG','AgfZsg9VA3m','nZe0mJaYwNLVAMDj','Ag9VAZPoB3rPzMLJyxrPB24','CgvYBwLZC2LVBKrLy2LZAw9UuMvHC29U','tM90AwzPy2f0Aw9U','CgfYC2u','BMfTzq','CgvYBwLZC2LVBKrLy2LZAw9U','C3rKB3v0','u0Lhs0Lmta','qMXVy2TLzcbIEsbqCMvuB29SvxnLigHVB2SGzM9Yia','C3rKAw4','ChvZAa','Ag9VAZPqB3n0vg9VBfvZzq','D3jPDgu','uhjLvg9VBfvZzq','odq0ntzLDeX1ug8','CgLWzq','zgf0yq','u3rVCa','Aw5WDxq','xIG/oG'];_0x47c9=function(){return _0x12d272;};return _0x47c9();}function createHookRegistry(_0x5ae11b){const _0x57d06c={_0x45ce74:0x36e,_0x1b3d9a:0x338,_0x189a71:0x35e,_0x5705ca:0x34e,_0x583917:0x2fa,_0xb82cf9:0x310,_0x1256ed:0x312,_0x22a723:0x31d,_0x4152fb:0x33a,_0x808df2:0x337,_0x3b2f0f:0x33a,_0x53bae1:0x300,_0x54cd26:0x2fd,_0x403601:0x2ed,_0xa24bbc:0x30f,_0x4bcb51:0x2f6,_0x43dcb4:0x31c,_0x1e899f:0x2f0,_0x537663:0x31b},_0x9b4128={_0xff4fd1:0x1de,_0x385034:0x1d6,_0xa47a4f:0x1ee};return{'hasHooks'(_0x234168){function _0xe584ce(_0x59c961,_0x3cbe45,_0x12ca8c,_0x356bcd){return _0x3a80(_0x59c961- -0x35a,_0x12ca8c);}return(_0x5ae11b[_0x234168]?.[_0xe584ce(-_0x9b4128._0xff4fd1,-0x1f3,-_0x9b4128._0x385034,-_0x9b4128._0xa47a4f)]??0x0)>0x0;},'getHooks'(_0xb1cc33,_0x1fed07){const _0xbd03b6={_0x43185a:0x1d3},_0xce2d24={_0x2a346d:0x1a2},_0x57f218=_0x5ae11b[_0xb1cc33];if(!_0x57f218)return[];function _0x1b12b6(_0x5f1ee5,_0xc26206,_0x733c53,_0x4766f){return _0x3a80(_0x5f1ee5-_0xce2d24._0x2a346d,_0x4766f);}const _0x5c33bd=[];function _0x3313c1(_0x1a2692,_0x2fa20a,_0x5e73d0,_0xdd8f){return _0x3a80(_0x1a2692-_0xbd03b6._0x43185a,_0xdd8f);}for(const _0x550a91 of _0x57f218){if(!_0x550a91[_0x3313c1(0x34e,_0x57d06c._0x45ce74,_0x57d06c._0x1b3d9a,_0x57d06c._0x189a71)]||_0x550a91[_0x3313c1(_0x57d06c._0x5705ca,0x33c,0x339,0x352)]==='*'){_0x5c33bd['push'](..._0x550a91[_0x1b12b6(0x310,0x320,_0x57d06c._0x583917,0x302)][_0x1b12b6(0x30b,_0x57d06c._0xb82cf9,_0x57d06c._0x1256ed,0x2fe)](_0x4150d0=>({'command':_0x4150d0[_0x3313c1(0x35f,0x352,0x37d,0x34d)],'timeout':_0x4150d0['timeout']??DEFAULT_TIMEOUT_S2})));continue;}if(_0x1fed07===void 0x0)continue;const _0x2fe79f=new RegExp(_0x3313c1(0x33a,0x34b,0x330,0x32e)+_0x550a91[_0x1b12b6(_0x57d06c._0x22a723,_0x57d06c._0x4152fb,0x326,_0x57d06c._0x808df2)]+')$');_0x2fe79f[_0x1b12b6(0x31f,0x33f,0x31f,_0x57d06c._0x3b2f0f)](_0x1fed07)&&_0x5c33bd[_0x1b12b6(_0x57d06c._0x53bae1,_0x57d06c._0x54cd26,_0x57d06c._0x403601,_0x57d06c._0xa24bbc)](..._0x550a91[_0x1b12b6(_0x57d06c._0xb82cf9,_0x57d06c._0x4bcb51,_0x57d06c._0x43dcb4,0x32b)][_0x1b12b6(0x30b,_0x57d06c._0x1e899f,0x31b,_0x57d06c._0x537663)](_0x204f1d=>({'command':_0x204f1d['command'],'timeout':_0x204f1d[_0x3313c1(0x35b,0x36e,0x353,0x354)]??DEFAULT_TIMEOUT_S2})));}return _0x5c33bd;}};}export{createHookExtensions,createHookOnToolCallMiddleware,createHookRegistry,executeCommandHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HooksConfig } from "@nuvin/config";
|
|
2
|
+
import type { HookEventName, ResolvedHook } from "./types.ts";
|
|
3
|
+
export interface HookRegistry {
|
|
4
|
+
getHooks(event: HookEventName, toolName?: string): ResolvedHook[];
|
|
5
|
+
hasHooks(event: HookEventName): boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function createHookRegistry(config: HooksConfig): HookRegistry;
|
|
8
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type { CommandHookConfig, HookMatcherGroup, HooksConfig } from "@nuvin/config";
|
|
2
|
+
export type HookEventName = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "Notification" | "ToolApprovalRequest" | "SessionStart" | "SessionEnd";
|
|
3
|
+
export interface ResolvedHook {
|
|
4
|
+
command: string;
|
|
5
|
+
timeout: number;
|
|
6
|
+
}
|
|
7
|
+
/** JSON payload written to hook's stdin. */
|
|
8
|
+
export interface HookInput {
|
|
9
|
+
session_id?: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
/** JSON output parsed from hook's stdout. */
|
|
13
|
+
export interface HookOutput {
|
|
14
|
+
/** Approve or block the action. PreToolUse only. */
|
|
15
|
+
decision?: "approve" | "block";
|
|
16
|
+
/** Reason for block. PreToolUse only. */
|
|
17
|
+
reason?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Event-specific outputs. For PreToolUse, this carries `permissionDecision`
|
|
20
|
+
* (Claude Code compat). For all events, this carries `additionalContext`.
|
|
21
|
+
*/
|
|
22
|
+
hookSpecificOutput?: {
|
|
23
|
+
/** Echoed event name — not required to parse, but useful for debugging. */
|
|
24
|
+
hookEventName?: string;
|
|
25
|
+
/** Auto-approve/deny/ask the permission. PreToolUse only. */
|
|
26
|
+
permissionDecision?: "allow" | "deny" | "ask";
|
|
27
|
+
/** Reason for the permission decision. */
|
|
28
|
+
permissionDecisionReason?: string;
|
|
29
|
+
/** Inject additional context into the prompt/system. */
|
|
30
|
+
additionalContext?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** Internal result from executing a hook command. */
|
|
34
|
+
export interface HookResult {
|
|
35
|
+
status: "pass" | "block" | "error";
|
|
36
|
+
output?: HookOutput;
|
|
37
|
+
error?: string;
|
|
38
|
+
duration_ms: number;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Location } from "vscode-languageserver-types";
|
|
2
|
+
import type { LspClientInfo, LspServerHandle, LspServerInfo } from "./types.ts";
|
|
3
|
+
type LocationResponse = Location | Location[] | null | undefined;
|
|
4
|
+
export declare function normalizeLocations(value: LocationResponse): Location[];
|
|
5
|
+
export declare function createLspClient(input: {
|
|
6
|
+
server: LspServerInfo;
|
|
7
|
+
root: string;
|
|
8
|
+
handle: LspServerHandle;
|
|
9
|
+
}): Promise<LspClientInfo>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, Diagnostic, DocumentSymbol, Hover, Location, LspPosition, LspServiceConfig, SymbolInformation } from "./types.ts";
|
|
2
|
+
export type { LspServiceConfig } from "./types.ts";
|
|
3
|
+
export interface LspService {
|
|
4
|
+
isEnabled(): boolean;
|
|
5
|
+
hasClients(file: string): Promise<boolean>;
|
|
6
|
+
touchFile(filePath: string, waitDiagnostics?: boolean): Promise<void>;
|
|
7
|
+
diagnostics(): Promise<Record<string, Diagnostic[]>>;
|
|
8
|
+
diagnosticsForFile(filePath: string): Promise<Diagnostic[]>;
|
|
9
|
+
definition(pos: LspPosition): Promise<Location[]>;
|
|
10
|
+
references(pos: LspPosition): Promise<Location[]>;
|
|
11
|
+
hover(pos: LspPosition): Promise<Hover[]>;
|
|
12
|
+
documentSymbol(filePath: string): Promise<(DocumentSymbol | SymbolInformation)[]>;
|
|
13
|
+
workspaceSymbol(query: string): Promise<SymbolInformation[]>;
|
|
14
|
+
implementation(pos: LspPosition): Promise<Location[]>;
|
|
15
|
+
prepareCallHierarchy(pos: LspPosition): Promise<CallHierarchyItem[]>;
|
|
16
|
+
incomingCalls(pos: LspPosition): Promise<CallHierarchyIncomingCall[]>;
|
|
17
|
+
outgoingCalls(pos: LspPosition): Promise<CallHierarchyOutgoingCall[]>;
|
|
18
|
+
shutdown(): Promise<void>;
|
|
19
|
+
status(): {
|
|
20
|
+
connectedClients: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function createLspService(config?: LspServiceConfig): LspService;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function shouldDisableLspDownload(env?: NodeJS.ProcessEnv): boolean;
|
|
2
|
+
export declare function getLspPackageDir(packageName: string): string;
|
|
3
|
+
export declare function getLspBinDir(packageName: string): string;
|
|
4
|
+
export declare function findPackageBinary(binaryName: string, startDir: string): Promise<string | undefined>;
|
|
5
|
+
export declare function resolvePackageBinary(input: {
|
|
6
|
+
packageName: string;
|
|
7
|
+
binaryName?: string;
|
|
8
|
+
startDir: string;
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
}): Promise<string | undefined>;
|
|
11
|
+
//# sourceMappingURL=installer.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LspServerInfo } from "./types.ts";
|
|
2
|
+
export declare const TypeScriptServer: LspServerInfo;
|
|
3
|
+
export declare const BiomeServer: LspServerInfo;
|
|
4
|
+
export declare const BUILTIN_LSP_SERVERS: readonly LspServerInfo[];
|
|
5
|
+
export declare function getServersForFile(file: string): LspServerInfo[];
|
|
6
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
import type { MessageConnection } from "vscode-jsonrpc";
|
|
3
|
+
import type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, Diagnostic, DocumentSymbol, Hover, Location, SymbolInformation } from "vscode-languageserver-types";
|
|
4
|
+
export type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, Diagnostic, DocumentSymbol, Hover, Location, SymbolInformation, };
|
|
5
|
+
export interface LspPosition {
|
|
6
|
+
file: string;
|
|
7
|
+
line: number;
|
|
8
|
+
character: number;
|
|
9
|
+
}
|
|
10
|
+
export interface LspServerInfo {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
extensions: string[];
|
|
14
|
+
root(file: string): Promise<string | undefined>;
|
|
15
|
+
spawn(root: string): Promise<LspServerHandle | undefined>;
|
|
16
|
+
}
|
|
17
|
+
export interface LspServerHandle {
|
|
18
|
+
process: ChildProcess;
|
|
19
|
+
initialization?: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export interface LspServerCapabilities {
|
|
22
|
+
definitionProvider?: boolean;
|
|
23
|
+
referencesProvider?: boolean;
|
|
24
|
+
hoverProvider?: boolean;
|
|
25
|
+
documentSymbolProvider?: boolean;
|
|
26
|
+
workspaceSymbolProvider?: boolean;
|
|
27
|
+
implementationProvider?: boolean;
|
|
28
|
+
callHierarchyProvider?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface LspClientInfo {
|
|
31
|
+
serverId: string;
|
|
32
|
+
root: string;
|
|
33
|
+
connection: MessageConnection;
|
|
34
|
+
diagnostics: Map<string, Diagnostic[]>;
|
|
35
|
+
capabilities: LspServerCapabilities;
|
|
36
|
+
notify: {
|
|
37
|
+
open(input: {
|
|
38
|
+
path: string;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
change(input: {
|
|
41
|
+
path: string;
|
|
42
|
+
version: number;
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
close(input: {
|
|
45
|
+
path: string;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
request: {
|
|
49
|
+
definition(pos: LspPosition): Promise<Location[]>;
|
|
50
|
+
references(pos: LspPosition): Promise<Location[]>;
|
|
51
|
+
hover(pos: LspPosition): Promise<Hover | null>;
|
|
52
|
+
documentSymbol(filePath: string): Promise<(DocumentSymbol | SymbolInformation)[]>;
|
|
53
|
+
workspaceSymbol(query: string): Promise<SymbolInformation[]>;
|
|
54
|
+
implementation(pos: LspPosition): Promise<Location[]>;
|
|
55
|
+
prepareCallHierarchy(pos: LspPosition): Promise<CallHierarchyItem[]>;
|
|
56
|
+
incomingCalls(item: CallHierarchyItem): Promise<CallHierarchyIncomingCall[]>;
|
|
57
|
+
outgoingCalls(item: CallHierarchyItem): Promise<CallHierarchyOutgoingCall[]>;
|
|
58
|
+
};
|
|
59
|
+
waitForDiagnostics(input: {
|
|
60
|
+
path: string;
|
|
61
|
+
timeoutMs?: number;
|
|
62
|
+
}): Promise<void>;
|
|
63
|
+
shutdown(): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
export interface LspServiceConfig {
|
|
66
|
+
enabled?: boolean;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseChatModelOptions, ChatRequest, ChatResponse, ChatResponseChunk, ModelExecutionOptions, ProviderCredential } from "../shared/types.ts";
|
|
2
|
+
import type { ProviderRequestMutator, ProviderSessionResolver, ResolvedProviderSession } from "./provider-session.ts";
|
|
3
|
+
import { RoutedModel } from "./routed-model.ts";
|
|
4
|
+
export interface AnthropicModelOptions extends Partial<BaseChatModelOptions> {
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
protocolVersion?: string;
|
|
8
|
+
authScheme?: "bearer" | "x-api-key";
|
|
9
|
+
fetch?: typeof globalThis.fetch;
|
|
10
|
+
providerSessionResolver?: ProviderSessionResolver;
|
|
11
|
+
requestMutators?: ProviderRequestMutator[];
|
|
12
|
+
headerResolver?: AnthropicHeaderResolver;
|
|
13
|
+
}
|
|
14
|
+
export interface AnthropicRequestHeadersContext {
|
|
15
|
+
request?: ChatRequest;
|
|
16
|
+
body: unknown;
|
|
17
|
+
credential: ProviderCredential;
|
|
18
|
+
session?: ResolvedProviderSession;
|
|
19
|
+
stream: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type AnthropicHeaderResolver = (context: AnthropicRequestHeadersContext) => Promise<Record<string, string>> | Record<string, string>;
|
|
22
|
+
export declare class AnthropicModel extends RoutedModel {
|
|
23
|
+
constructor(options?: AnthropicModelOptions);
|
|
24
|
+
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
25
|
+
stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=anthropic-model.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RoutedModelSurface } from "./routed-model.ts";
|
|
2
|
+
export declare const ANTHROPIC_MESSAGES_SURFACE = "anthropic-messages";
|
|
3
|
+
export declare const ANTHROPIC_MESSAGES_STREAM_SURFACE = "anthropic-messages-stream";
|
|
4
|
+
export declare function createAnthropicSurfaces(): RoutedModelSurface[];
|
|
5
|
+
//# sourceMappingURL=anthropic-surface.d.ts.map
|