@nuvin/agent-core 0.0.0-rc.13 → 0.0.0-rc.14
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 +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/chunk-FFIZ6TKW.js +1 -1
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-SEP4YYY3.js +1 -1
- package/dist/chunk-T7UKN6FZ.js +1 -1
- package/dist/chunk-WJMBJOVF.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/hooks/index.d.ts +76 -0
- package/dist/hooks/index.js +1 -0
- package/dist/models/index.d.ts +3 -3
- package/dist/models/index.js +1 -1
- package/dist/{provider-adapters-BZo_Yh3I.d.ts → provider-adapters-CVC34mwR.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 +5 -3
- package/dist/tools/index.js +1 -1
- package/dist/{types-DQXrm4dp.d.ts → types-CSXSwpwn.d.ts} +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { bj as AnyExtensionRegistration, o as ToolUseBlock, aG as ToolExecutionContext, b0 as ToolRuntimeDispatchDecision } from '../types-CSXSwpwn.js';
|
|
2
|
+
import { HooksConfig } from '@nuvin/config';
|
|
3
|
+
export { CommandHookConfig, HookMatcherGroup, HooksConfig } from '@nuvin/config';
|
|
4
|
+
|
|
5
|
+
type HookEventName = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "Notification" | "SessionStart" | "SessionEnd";
|
|
6
|
+
interface ResolvedHook {
|
|
7
|
+
command: string;
|
|
8
|
+
timeout: number;
|
|
9
|
+
}
|
|
10
|
+
/** JSON payload written to hook's stdin. */
|
|
11
|
+
interface HookInput {
|
|
12
|
+
session_id?: string;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
/** JSON output parsed from hook's stdout. */
|
|
16
|
+
interface HookOutput {
|
|
17
|
+
/** Approve or block the action. PreToolUse only. */
|
|
18
|
+
decision?: "approve" | "block";
|
|
19
|
+
/** Reason for block. PreToolUse only. */
|
|
20
|
+
reason?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Event-specific outputs. For PreToolUse, this carries `permissionDecision`
|
|
23
|
+
* (Claude Code compat). For all events, this carries `additionalContext`.
|
|
24
|
+
*/
|
|
25
|
+
hookSpecificOutput?: {
|
|
26
|
+
/** Echoed event name — not required to parse, but useful for debugging. */
|
|
27
|
+
hookEventName?: string;
|
|
28
|
+
/** Auto-approve/deny/ask the permission. PreToolUse only. */
|
|
29
|
+
permissionDecision?: "allow" | "deny" | "ask";
|
|
30
|
+
/** Reason for the permission decision. */
|
|
31
|
+
permissionDecisionReason?: string;
|
|
32
|
+
/** Inject additional context into the prompt/system. */
|
|
33
|
+
additionalContext?: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Internal result from executing a hook command. */
|
|
37
|
+
interface HookResult {
|
|
38
|
+
status: "pass" | "block" | "error";
|
|
39
|
+
output?: HookOutput;
|
|
40
|
+
error?: string;
|
|
41
|
+
duration_ms: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare function executeCommandHook(command: string, input: HookInput, timeoutSeconds?: number, projectDir?: string): Promise<HookResult>;
|
|
45
|
+
|
|
46
|
+
type HookExecutorFn = typeof executeCommandHook;
|
|
47
|
+
interface HookRegistryLike {
|
|
48
|
+
getHooks(event: HookEventName, toolName?: string): ResolvedHook[];
|
|
49
|
+
hasHooks?: (event: HookEventName) => boolean;
|
|
50
|
+
}
|
|
51
|
+
interface CreateHookExtensionsOptions {
|
|
52
|
+
sessionId?: string;
|
|
53
|
+
projectDir?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Creates observer extension registrations for non-blocking hook events.
|
|
57
|
+
* PreToolUse blocking is handled separately via onToolCall middleware
|
|
58
|
+
* (see createHookOnToolCallMiddleware).
|
|
59
|
+
*/
|
|
60
|
+
declare function createHookExtensions(registry: HookRegistryLike, executor: HookExecutorFn, options?: CreateHookExtensionsOptions): AnyExtensionRegistration[];
|
|
61
|
+
/**
|
|
62
|
+
* Creates an onToolCall middleware that runs PreToolUse hooks before
|
|
63
|
+
* delegating to the original approval handler.
|
|
64
|
+
*
|
|
65
|
+
* Returns `{ action: "reject" }` if any hook blocks, otherwise delegates
|
|
66
|
+
* to the original handler.
|
|
67
|
+
*/
|
|
68
|
+
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;
|
|
69
|
+
|
|
70
|
+
interface HookRegistry {
|
|
71
|
+
getHooks(event: HookEventName, toolName?: string): ResolvedHook[];
|
|
72
|
+
hasHooks(event: HookEventName): boolean;
|
|
73
|
+
}
|
|
74
|
+
declare function createHookRegistry(config: HooksConfig): HookRegistry;
|
|
75
|
+
|
|
76
|
+
export { type HookEventName, type HookExecutorFn, type HookInput, type HookOutput, type HookRegistry, type HookRegistryLike, type HookResult, type ResolvedHook, createHookExtensions, createHookOnToolCallMiddleware, createHookRegistry, executeCommandHook };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x1eb76f,_0x3357a4){const _0x128026={_0x52b585:0x374,_0x2931dd:0x35f,_0x470e29:0x378,_0xb481fe:0x362,_0x462890:0x355,_0x2d714f:0x321,_0x53a666:0x327,_0x448db4:0x331,_0x16c330:0x33a,_0x209363:0x384,_0xde7f16:0x36c,_0x16d010:0x36d,_0x2f32dd:0x389,_0x348f23:0x36f,_0x2e9381:0x376,_0xba51ab:0x35d,_0x2b7df4:0x354,_0x1506d8:0x18e,_0x30a8fe:0x176,_0x2b1126:0x34a,_0x17ad1:0x33f,_0x151a60:0x359,_0x450085:0x365,_0x573474:0x343,_0x362eb9:0x16a,_0x3a5405:0x17a};function _0x4a2968(_0x461479,_0x438378,_0xd28687,_0x17edb6){return _0x1d25(_0x17edb6- -0x290,_0x461479);}function _0x18208e(_0x44843a,_0x2a05e3,_0x36285c,_0x415018){return _0x1d25(_0x36285c-0x23e,_0x415018);}const _0xf2d9a6=_0x1eb76f();while(!![]){try{const _0x18a7e6=-parseInt(_0x18208e(0x37a,0x376,0x365,0x348))/0x1*(-parseInt(_0x18208e(0x36f,_0x128026._0x52b585,_0x128026._0x2931dd,_0x128026._0x470e29))/0x2)+-parseInt(_0x18208e(0x382,0x35b,_0x128026._0xb481fe,_0x128026._0x462890))/0x3+parseInt(_0x18208e(0x34f,_0x128026._0x2d714f,0x337,_0x128026._0x53a666))/0x4*(-parseInt(_0x18208e(_0x128026._0x448db4,0x34b,_0x128026._0x16c330,0x33c))/0x5)+parseInt(_0x18208e(_0x128026._0x209363,_0x128026._0xde7f16,_0x128026._0x16d010,_0x128026._0x2f32dd))/0x6+parseInt(_0x18208e(_0x128026._0x348f23,_0x128026._0x2e9381,_0x128026._0xba51ab,0x36d))/0x7*(parseInt(_0x18208e(0x35a,_0x128026._0x2b7df4,0x358,0x358))/0x8)+-parseInt(_0x4a2968(-0x17b,-_0x128026._0x1506d8,-_0x128026._0x30a8fe,-0x18c))/0x9*(-parseInt(_0x18208e(0x34a,_0x128026._0x2b1126,_0x128026._0x17ad1,0x32b))/0xa)+parseInt(_0x18208e(_0x128026._0x151a60,_0x128026._0x450085,0x361,_0x128026._0x573474))/0xb*(parseInt(_0x4a2968(-0x16e,-_0x128026._0x362eb9,-0x199,-_0x128026._0x3a5405))/0xc);if(_0x18a7e6===_0x3357a4)break;else _0xf2d9a6['push'](_0xf2d9a6['shift']());}catch(_0xc0651a){_0xf2d9a6['push'](_0xf2d9a6['shift']());}}}(_0x35fa,0x61c62));import{spawn}from'child_process';function _0x1d25(_0x5db542,_0x1a70d9){_0x5db542=_0x5db542-0xec;const _0x35fac7=_0x35fa();let _0x1d25e=_0x35fac7[_0x5db542];if(_0x1d25['JopAyL']===undefined){var _0x390361=function(_0x231933){const _0x4e26a5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4bf5ac='',_0x12861c='';for(let _0x34d5a2=0x0,_0x10a04b,_0x1ea976,_0x22be89=0x0;_0x1ea976=_0x231933['charAt'](_0x22be89++);~_0x1ea976&&(_0x10a04b=_0x34d5a2%0x4?_0x10a04b*0x40+_0x1ea976:_0x1ea976,_0x34d5a2++%0x4)?_0x4bf5ac+=String['fromCharCode'](0xff&_0x10a04b>>(-0x2*_0x34d5a2&0x6)):0x0){_0x1ea976=_0x4e26a5['indexOf'](_0x1ea976);}for(let _0x4c6199=0x0,_0x541428=_0x4bf5ac['length'];_0x4c6199<_0x541428;_0x4c6199++){_0x12861c+='%'+('00'+_0x4bf5ac['charCodeAt'](_0x4c6199)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12861c);};_0x1d25['wkdfLc']=_0x390361,_0x1d25['qHTqmu']={},_0x1d25['JopAyL']=!![];}const _0x355bdc=_0x35fac7[0x0],_0x54bff8=_0x5db542+_0x355bdc,_0x126951=_0x1d25['qHTqmu'][_0x54bff8];return!_0x126951?(_0x1d25e=_0x1d25['wkdfLc'](_0x1d25e),_0x1d25['qHTqmu'][_0x54bff8]=_0x1d25e):_0x1d25e=_0x126951,_0x1d25e;}var DEFAULT_TIMEOUT_S=0x3c;async function executeCommandHook(_0x4bf5ac,_0x12861c,_0x34d5a2=DEFAULT_TIMEOUT_S,_0x10a04b){const _0x4a4cc3={_0x4deed7:0x172,_0x5d7dbb:0x15c},_0x3e390a={_0x4f4d7c:0x410,_0x4ea155:0x40e,_0x480c5d:0x404,_0xdb3325:0x3f4,_0x2fc442:0x3e6,_0x3d4255:0x40a,_0x177727:0x11c,_0x4a7859:0x11d,_0x2efaf0:0x12c,_0x403f8b:0x13e,_0x4218c6:0x3db,_0x35f5bf:0x13a,_0x5014db:0x132,_0x580281:0x122,_0x2ee9f2:0x126,_0xe5866c:0x132,_0x16f1d8:0x3eb,_0x4be664:0x111,_0x380e50:0x12a,_0x57574b:0x138,_0x5308fa:0x140,_0x3d1e35:0x155,_0xc36361:0x3f0,_0x350784:0x3f8,_0x4f1efe:0x10b,_0x1e21bb:0x110,_0x1599de:0x3fa,_0x470601:0x3da},_0x7cbcff={_0x3db915:0x364},_0x3ec35f={_0x43b27a:0x399,_0x4dc7dc:0x391,_0x1f1ee3:0x3a5,_0xae288b:0x389,_0x347f00:0x176,_0x4e7d0a:0x15c,_0x13a058:0x173,_0xc47f5d:0x166,_0x515cf2:0x178,_0x2d124e:0x170,_0x3766c9:0x392,_0x25121e:0x374,_0x2500a9:0x38b,_0x3f108b:0x3ab,_0x178748:0x395,_0x12bad6:0x38a,_0x4eeb98:0x38f,_0x261c40:0x383,_0x16e35c:0x384},_0x11399d={_0x48c03c:0x544,_0x51b932:0x1d4,_0x33dd25:0xd3},_0x3d79f8={_0xa12eb2:0x56},_0x2579f5={_0xaa6c:0x383,_0x4a2d9e:0x467,_0x5003fd:0x45e,_0x553ea9:0x34b,_0x562960:0x350,_0x30d855:0x351},_0x3cecb0={_0x2074c1:0x2eb,_0x2069d4:0x306,_0x562d31:0x18b},_0x314a92={_0xbbc95e:0x1f8,_0x3e1fd4:0x21d,_0x5ddf7f:0x208},_0x4be26c={_0x43683f:0x28f,_0x3bab15:0x2af,_0x506e16:0x2b2},_0x1ea976=Date[_0x1b89b1(-0x162,-_0x4a4cc3._0x4deed7,-_0x4a4cc3._0x5d7dbb,-0x189)]();function _0x1b89b1(_0x1bf4c7,_0x3e3caf,_0x5f57f5,_0x2229fc){return _0x1d25(_0x3e3caf- -0x267,_0x1bf4c7);}return new Promise(_0x22be89=>{const _0x3032e2={_0x264c6c:0xa0,_0x1556cc:0x1eb},_0x33b589={_0x3ef476:0x255},_0x5ac75e={_0x4fc95e:0x6c2,_0x165bbb:0xc9},_0x740e28={_0x5bf704:0x74},_0x4c6199=spawn('sh',['-c',_0x4bf5ac],{'stdio':[_0x2e1c09(0x404,0x3f4,_0x3e390a._0x4f4d7c,_0x3e390a._0x4ea155),_0x2e1c09(_0x3e390a._0x480c5d,_0x3e390a._0xdb3325,_0x3e390a._0x2fc442,_0x3e390a._0x3d4255),_0x170efc(-0x132,-0x12c,-0x121,-_0x3e390a._0x177727)],'env':{...process['env'],'CLAUDE_PROJECT_DIR':_0x10a04b??process[_0x170efc(-0x148,-_0x3e390a._0x4a7859,-_0x3e390a._0x2efaf0,-_0x3e390a._0x403f8b)]()}});let _0x541428='',_0x22aa06='';_0x4c6199[_0x2e1c09(0x3bd,0x3cd,_0x3e390a._0x4218c6,0x3dd)]['on'](_0x170efc(-_0x3e390a._0x35f5bf,-0x120,-_0x3e390a._0x5014db,-_0x3e390a._0x177727),_0x2fb383=>{const _0x390364={_0xadb01e:0xbc,_0x1fcfe8:0x1f0};function _0x5878e3(_0x53aad6,_0x2efa40,_0x4ac7bd,_0x24a34e){return _0x170efc(_0x53aad6,_0x2efa40-_0x390364._0xadb01e,_0x4ac7bd-0x3e4,_0x24a34e-_0x390364._0x1fcfe8);}_0x541428+=_0x2fb383[_0x5878e3(_0x4be26c._0x43683f,0x29a,_0x4be26c._0x3bab15,_0x4be26c._0x506e16)]();}),_0x4c6199['stderr']['on'](_0x170efc(-_0x3e390a._0x580281,-_0x3e390a._0x2ee9f2,-_0x3e390a._0xe5866c,-0x135),_0x48e33a=>{function _0x12e61b(_0x2065d9,_0x461027,_0x13b049,_0x4fe943){return _0x170efc(_0x2065d9,_0x461027-_0x740e28._0x5bf704,_0x13b049-0x33d,_0x4fe943-0x15b);}_0x22aa06+=_0x48e33a[_0x12e61b(_0x314a92._0xbbc95e,_0x314a92._0x3e1fd4,_0x314a92._0x5ddf7f,0x215)]();}),_0x4c6199['stdin']['on']('error',_0x56565b=>{function _0x28bdd8(_0x2dd242,_0x4b14cc,_0x4edfe8,_0x4d7a8a){return _0x2e1c09(_0x4b14cc,_0x2dd242- -_0x5ac75e._0x4fc95e,_0x4edfe8-0xaf,_0x4d7a8a-_0x5ac75e._0x165bbb);}function _0x250500(_0x531369,_0x40039a,_0x1bb4d6,_0xf01681){return _0x2e1c09(_0x531369,_0xf01681- -_0x33b589._0x3ef476,_0x1bb4d6-0xed,_0xf01681-0x1e3);}if(_0x56565b[_0x28bdd8(-_0x3cecb0._0x2074c1,-0x2fc,-_0x3cecb0._0x2069d4,-0x2f3)]!==_0x250500(_0x3cecb0._0x562d31,0x182,0x17b,0x175))throw _0x56565b;}),_0x4c6199[_0x2e1c09(_0x3e390a._0x16f1d8,0x3dd,0x3c1,0x3c9)][_0x170efc(-_0x3e390a._0x4be664,-0x12a,-0x133,-_0x3e390a._0x380e50)](JSON[_0x170efc(-0x12b,-_0x3e390a._0x57574b,-0x123,-0x103)](_0x12861c)),_0x4c6199[_0x170efc(-0x14a,-_0x3e390a._0x5308fa,-0x138,-_0x3e390a._0x3d1e35)][_0x2e1c09(_0x3e390a._0xc36361,0x3ff,_0x3e390a._0x350784,0x3ec)]();const _0x2c5414=setTimeout(()=>{const _0x59a756={_0x14b084:0x69,_0x6a02e0:0xc4},_0x341a5b={_0x4354d3:0x566,_0x46aaf4:0x29};_0x4c6199[_0x1dcfe6(0x39c,0x381,0x386,_0x2579f5._0xaa6c)](_0x31663f(0x454,_0x2579f5._0x4a2d9e,_0x2579f5._0x5003fd,0x44a));function _0x31663f(_0x488fd5,_0x2ac508,_0x57b38e,_0xf683b8){return _0x170efc(_0x2ac508,_0x2ac508-0xd1,_0x488fd5-_0x341a5b._0x4354d3,_0xf683b8-_0x341a5b._0x46aaf4);}function _0x1dcfe6(_0x3e0ad2,_0x35783a,_0x59b2dc,_0x7cb02c){return _0x2e1c09(_0x35783a,_0x7cb02c- -_0x59a756._0x14b084,_0x59b2dc-0x156,_0x7cb02c-_0x59a756._0x6a02e0);}_0x22be89({'status':'error','error':'Hook\x20timed\x20out\x20after\x20'+_0x34d5a2+'s','duration_ms':Date[_0x1dcfe6(_0x2579f5._0x553ea9,_0x2579f5._0x562960,_0x2579f5._0x30d855,0x369)]()-_0x1ea976});},_0x34d5a2*0x3e8);function _0x170efc(_0x42c910,_0x3903c7,_0x49a298,_0x1785fb){return _0x1b89b1(_0x42c910,_0x49a298-0x2f,_0x49a298-_0x3d79f8._0xa12eb2,_0x1785fb-0x10e);}function _0x2e1c09(_0xecb4a,_0x229ee6,_0x4528c1,_0x334248){return _0x1b89b1(_0xecb4a,_0x229ee6-_0x11399d._0x48c03c,_0x4528c1-_0x11399d._0x51b932,_0x334248-_0x11399d._0x33dd25);}_0x4c6199['on'](_0x170efc(-0x10b,-_0x3e390a._0x4f1efe,-_0x3e390a._0x1e21bb,-0xff),_0x170383=>{const _0x2d8331={_0x200464:0xa4},_0x5afd22={_0x5b1b92:0x38,_0x477299:0x177};clearTimeout(_0x2c5414);const _0x54701e=Date[_0x511051(_0x3ec35f._0x43b27a,_0x3ec35f._0x4dc7dc,_0x3ec35f._0x1f1ee3,_0x3ec35f._0xae288b)]()-_0x1ea976;if(_0x170383===0x2){_0x22be89({'status':_0x10b04c(-0x13a,-_0x3ec35f._0x347f00,-_0x3ec35f._0x4e7d0a,-0x15a),'output':{'decision':_0x10b04c(-_0x3ec35f._0x13a058,-_0x3ec35f._0xc47f5d,-0x15c,-0x147),'reason':_0x22aa06[_0x10b04c(-0x17f,-0x189,-0x172,-_0x3ec35f._0x515cf2)]()||'Hook\x20blocked\x20execution'},'duration_ms':_0x54701e});return;}function _0x10b04c(_0x4c8355,_0x1c1ebe,_0x59c71d,_0x56789c){return _0x170efc(_0x1c1ebe,_0x1c1ebe-0x196,_0x59c71d- -_0x5afd22._0x5b1b92,_0x56789c-_0x5afd22._0x477299);}if(_0x170383!==0x0){_0x22be89({'status':'error','error':_0x10b04c(-_0x3ec35f._0x2d124e,-0x155,-0x175,-0x185)+_0x170383+(_0x22aa06[_0x511051(0x38b,0x3b3,0x377,_0x3ec35f._0x3766c9)]()?':\x20'+_0x22aa06[_0x511051(_0x3ec35f._0x25121e,_0x3ec35f._0x2500a9,_0x3ec35f._0x3f108b,_0x3ec35f._0x3766c9)]():''),'duration_ms':_0x54701e});return;}const _0x335d4d=_0x541428[_0x511051(_0x3ec35f._0x25121e,_0x3ec35f._0x178748,0x392,_0x3ec35f._0x3766c9)]();function _0x511051(_0x645568,_0x56fc54,_0x124589,_0x396155){return _0x170efc(_0x56fc54,_0x56fc54-_0x2d8331._0x200464,_0x396155-0x4cc,_0x396155-0x1e6);}if(_0x335d4d[_0x511051(0x390,0x378,0x3a1,_0x3ec35f._0x12bad6)]===0x0){_0x22be89({'status':_0x511051(0x393,0x383,_0x3ec35f._0x4eeb98,_0x3ec35f._0x261c40),'duration_ms':_0x54701e});return;}try{const _0xf03ec5=JSON[_0x10b04c(-0x14e,-0x16e,-0x16e,-0x17a)](_0x335d4d);_0x22be89({'status':'pass','output':_0xf03ec5,'duration_ms':_0x54701e});}catch{_0x22be89({'status':_0x511051(0x38f,0x39e,_0x3ec35f._0x16e35c,0x383),'duration_ms':_0x54701e});}}),_0x4c6199['on'](_0x2e1c09(0x3ed,_0x3e390a._0x1599de,_0x3e390a._0x470601,0x3ec),_0x56789d=>{function _0x221969(_0x54191b,_0x1b0b99,_0x21bfcb,_0x1110c1){return _0x2e1c09(_0x1b0b99,_0x54191b- -_0x3032e2._0x264c6c,_0x21bfcb-_0x3032e2._0x1556cc,_0x1110c1-0x13f);}clearTimeout(_0x2c5414),_0x22be89({'status':_0x221969(0x35a,0x361,_0x7cbcff._0x3db915,0x35d),'error':_0x56789d['message'],'duration_ms':Date['now']()-_0x1ea976});});});}function createHookExtensions(_0x13182c,_0x501174,_0x1a6a5b={}){const _0x357bb7={_0x411a2e:0x57,_0x13f465:0x13a,_0x2d76ce:0x117,_0xa62cb4:0x135,_0x182c46:0x155,_0x1e3f18:0x5d,_0x4486ff:0x4f,_0x5a8f8f:0x54,_0x118d5a:0x157,_0x2d047e:0x2d,_0x89092d:0xf,_0xa43ca6:0x22,_0x2b9018:0x32,_0x450ea5:0x42,_0x4e5d00:0x10d,_0x2cbea3:0x127,_0x16da02:0x126,_0x3fc5be:0x3c,_0x2ac39c:0x4e},_0x395db7={_0x499af5:0x2bd,_0x1f9aae:0x2bd,_0x59b2b3:0x26e,_0x1122b7:0x280,_0x214e4c:0x27d,_0x38591a:0x26c,_0x55ed6c:0x261,_0x400757:0x275,_0x53a55d:0x25d,_0x5a78a5:0x27d,_0x5e0d3c:0x1c6,_0x3aeac9:0x1e3},_0x23d23d={_0x3beb79:0x24a,_0x597411:0x171},_0x35d1d2={_0x2b0695:0x4c,_0x19e84c:0x326},_0x164e21={_0x212dc7:0xca},_0x43d101={_0x578b92:0xce,_0x1a007d:0xd2,_0x2026d1:0xc4,_0x3413ea:0x9b,_0x53b230:0x3f3,_0x3d7970:0x3d5,_0x3643e4:0x3de,_0x4803b9:0xc0},_0x12bbef={_0x2297e1:0x172,_0x44939e:0x182,_0x5354a6:0x155,_0x14e8ce:0x14e,_0xa116a6:0x171,_0x2b0ac1:0x165,_0x5733dd:0x101,_0x3bc826:0xd8,_0xb6002f:0xeb,_0x62552f:0xaa,_0x4d87a1:0xce,_0x4ed5f8:0x128,_0x1b45a3:0x163,_0x35d9bd:0x8b,_0x4e3cc6:0xb6,_0x4a2ba9:0xb6,_0x57a3a0:0xa2},_0x52c4b0={_0xb302e6:0xf4,_0x2e4f94:0x112,_0x4aae75:0x299},_0x96142e=[];function _0x32605a(_0x3dc8cb,_0x45ac33,_0x80481e,_0xb0d23e){return _0x1d25(_0x80481e- -0x24c,_0xb0d23e);}const {sessionId:_0x179b76,projectDir:_0x55afe4}=_0x1a6a5b,_0x669a70=_0x46b411=>_0x13182c['hasHooks']?_0x13182c[_0x32605a(-0x123,-0x157,-0x141,-0x152)](_0x46b411):_0x13182c['getHooks'](_0x46b411)[_0x297c7a(0xe,0x1e,0x2c,0xf)]>0x0;_0x669a70('PostToolUse')&&_0x96142e['push']({'id':_0x297c7a(0x55,_0x357bb7._0x411a2e,0x62,0x51),'stage':'afterToolResult','kind':_0x32605a(-_0x357bb7._0x13f465,-_0x357bb7._0x2d76ce,-0x134,-0x123),'order':0x0,'enabled':!![],'run':async(_0x115c9f,_0x59e927)=>{const _0x528ec5={_0x517b8a:0x1a5};function _0x34ebf0(_0x37e6bd,_0x28934d,_0x480bc0,_0x1c38a3){return _0x32605a(_0x37e6bd-_0x52c4b0._0xb302e6,_0x28934d-_0x52c4b0._0x2e4f94,_0x37e6bd-_0x52c4b0._0x4aae75,_0x1c38a3);}const _0x3517a7=_0x13182c[_0x34ebf0(_0x12bbef._0x2297e1,0x150,0x16e,_0x12bbef._0x44939e)]('PostToolUse',_0x115c9f[_0x34ebf0(_0x12bbef._0x5354a6,0x140,0x16a,_0x12bbef._0x14e8ce)]);function _0x1b5645(_0x20e03f,_0xe14696,_0xf32ae9,_0x55b729){return _0x297c7a(_0x20e03f,_0xe14696-_0x528ec5._0x517b8a,_0xe14696-0x81,_0x55b729-0x14f);}for(const _0x105010 of _0x3517a7){const _0x52f2dd={'tool_name':_0x115c9f[_0x34ebf0(0x155,_0x12bbef._0xa116a6,0x16a,_0x12bbef._0x2b0ac1)],'tool_input':void 0x0,'tool_output':_0x115c9f[_0x1b5645(_0x12bbef._0x5733dd,0xe2,_0x12bbef._0x3bc826,_0x12bbef._0xb6002f)],'tool_result_status':_0x115c9f[_0x1b5645(_0x12bbef._0x62552f,0xbe,0xab,_0x12bbef._0x4d87a1)],'session_id':_0x179b76??_0x59e927[_0x34ebf0(0x141,_0x12bbef._0x4ed5f8,0x159,_0x12bbef._0x1b45a3)][_0x1b5645(_0x12bbef._0x35d9bd,0xa8,_0x12bbef._0x4e3cc6,0xc5)]};await _0x501174(_0x105010[_0x1b5645(0xbf,_0x12bbef._0x4a2ba9,0xbd,0xba)],_0x52f2dd,_0x105010[_0x1b5645(0xb0,0xc0,0xc9,_0x12bbef._0x57a3a0)],_0x55afe4);}}});_0x669a70(_0x32605a(-0x139,-_0x357bb7._0xa62cb4,-_0x357bb7._0x182c46,-0x176))&&_0x96142e['push']({'id':_0x297c7a(0x37,_0x357bb7._0x1e3f18,_0x357bb7._0x4486ff,0x53),'stage':_0x297c7a(0x6d,0x3f,_0x357bb7._0x5a8f8f,0x5a),'kind':'observer','order':0x0,'enabled':!![],'run':async(_0x52d595,_0x4a986b)=>{const _0x14c8da={_0x5e1293:0x81,_0xa1daea:0xf1},_0x4af417={_0x3cb78a:0xc8,_0x424ece:0x73};function _0x217e01(_0x15bff8,_0x533290,_0x5d4698,_0x377688){return _0x297c7a(_0x15bff8,_0x533290-_0x4af417._0x3cb78a,_0x377688-0x3b7,_0x377688-_0x4af417._0x424ece);}function _0x1af86c(_0x21fea6,_0x560fec,_0x5d4227,_0xb26e05){return _0x297c7a(_0x560fec,_0x560fec-_0x14c8da._0x5e1293,_0x5d4227- -_0x14c8da._0xa1daea,_0xb26e05-0x1c6);}const _0x4c1842=_0x13182c['getHooks'](_0x1af86c(-_0x43d101._0x578b92,-_0x43d101._0x1a007d,-_0x43d101._0x2026d1,-0xdd));for(const _0x15fc74 of _0x4c1842){const _0x646be1={'stop_reason':_0x1af86c(-0x8e,-0xb4,-_0x43d101._0x3413ea,-0x82),'session_id':_0x179b76??_0x4a986b['state'][_0x217e01(0x3ff,_0x43d101._0x53b230,_0x43d101._0x3d7970,_0x43d101._0x3643e4)]};await _0x501174(_0x15fc74['command'],_0x646be1,_0x15fc74[_0x1af86c(-_0x43d101._0x4803b9,-0xd4,-0xb2,-_0x43d101._0x2026d1)],_0x55afe4);}}});function _0x297c7a(_0xa1ffdc,_0x33d85b,_0x535a6f,_0x23f464){return _0x1d25(_0x535a6f- -_0x164e21._0x212dc7,_0xa1ffdc);}return _0x669a70(_0x32605a(-_0x357bb7._0x118d5a,-0x14e,-0x13c,-0x11d))&&_0x96142e[_0x297c7a(_0x357bb7._0x2d047e,_0x357bb7._0x89092d,_0x357bb7._0xa43ca6,0x20)]({'id':_0x297c7a(_0x357bb7._0x2b9018,_0x357bb7._0x450ea5,0x44,0x5b),'stage':_0x32605a(-_0x357bb7._0x4e5d00,-_0x357bb7._0x2cbea3,-0x123,-_0x357bb7._0x16da02),'kind':_0x297c7a(0x43,_0x357bb7._0x3fc5be,_0x357bb7._0x2ac39c,_0x357bb7._0x2ac39c),'order':0x0,'enabled':!![],'run':async(_0x4a4b89,_0x5109bc)=>{function _0x2008dd(_0x3aeafc,_0x1d4281,_0x18df1b,_0x2d7f5c){return _0x32605a(_0x3aeafc-0x181,_0x1d4281-_0x35d1d2._0x2b0695,_0x2d7f5c-_0x35d1d2._0x19e84c,_0x3aeafc);}function _0x10f0d3(_0x495cdb,_0x5609b4,_0x4e04d6,_0x1ff12a){return _0x297c7a(_0x495cdb,_0x5609b4-0x3e,_0x5609b4-_0x23d23d._0x3beb79,_0x1ff12a-_0x23d23d._0x597411);}const _0x4168c4=_0x13182c[_0x10f0d3(_0x395db7._0x499af5,0x2a5,0x2b6,_0x395db7._0x1f9aae)](_0x10f0d3(_0x395db7._0x59b2b3,0x290,0x26f,0x2b1));for(const _0xec98b5 of _0x4168c4){const _0x16f700={'message':_0x10f0d3(0x294,0x273,_0x395db7._0x1122b7,_0x395db7._0x214e4c),'session_id':_0x179b76??_0x4a4b89[_0x10f0d3(_0x395db7._0x38591a,0x271,_0x395db7._0x55ed6c,_0x395db7._0x400757)]};await _0x501174(_0xec98b5[_0x10f0d3(_0x395db7._0x53a55d,0x27f,_0x395db7._0x5a78a5,0x272)],_0x16f700,_0xec98b5[_0x2008dd(0x1e1,0x205,_0x395db7._0x5e0d3c,_0x395db7._0x3aeac9)],_0x55afe4);}}}),_0x96142e;}function createHookOnToolCallMiddleware(_0x15e31c,_0x418979,_0x1794ed,_0x2f703f={}){const _0x540172={_0x143cef:0x421,_0x242e8f:0x43f,_0x40d46b:0x438,_0xbdb52a:0x19c,_0x5cf97d:0x1b7,_0x350faa:0x406,_0x2ff5dd:0x424,_0x3601a2:0x42a,_0x132fe5:0x1ab,_0x16eaae:0x18e,_0x422353:0x172,_0x104550:0x17d,_0x396173:0x187,_0x22a3d0:0x416,_0xc01b53:0x18c,_0x343d98:0x196,_0x448e8c:0x16b,_0xa48555:0x154,_0xb99b25:0x164,_0x97f48c:0x44d,_0x3c82b7:0x445,_0x1de93e:0x428,_0x121a2e:0x18f,_0xd9c861:0x19b,_0x34d98a:0x42c,_0x2273e6:0x160,_0x1ff447:0x441,_0x4aff00:0x41a,_0x32824c:0x42e,_0x87e6e2:0x43a,_0x8ba0f0:0x433,_0x5cfecd:0x176,_0x4c5e87:0x15c},_0x3de85e={_0x5b1243:0x31a},{sessionId:_0x11f7bf,projectDir:_0x1993a9}=_0x2f703f;return async(_0x4290af,_0x5dc788)=>{function _0x28ae43(_0x18e825,_0x15b3ff,_0x528627,_0x520235){return _0x1d25(_0x15b3ff-_0x3de85e._0x5b1243,_0x520235);}const _0x598ba2=_0x15e31c[_0x28ae43(_0x540172._0x143cef,_0x540172._0x242e8f,0x420,_0x540172._0x40d46b)](_0x5a3742(-0x1a4,-_0x540172._0xbdb52a,-0x17c,-_0x540172._0x5cf97d),_0x4290af[_0x5a3742(-0x18c,-0x17e,-0x17c,-0x168)]);for(const _0x31b3de of _0x598ba2){const _0x49d341={'tool_name':_0x4290af['name'],'tool_input':_0x4290af[_0x28ae43(_0x540172._0x350faa,_0x540172._0x2ff5dd,_0x540172._0x3601a2,0x41b)],'session_id':_0x11f7bf},_0x3ba6c8=await _0x418979(_0x31b3de[_0x5a3742(-_0x540172._0x132fe5,-0x19a,-0x1a7,-_0x540172._0x16eaae)],_0x49d341,_0x31b3de['timeout'],_0x1993a9),_0x56fb3f=_0x3ba6c8[_0x5a3742(-0x156,-0x16e,-_0x540172._0x422353,-_0x540172._0x104550)]?.[_0x5a3742(-0x184,-_0x540172._0x104550,-0x18b,-_0x540172._0x396173)]?.['permissionDecision'];if(_0x56fb3f===_0x28ae43(0x3fd,0x40c,0x40f,_0x540172._0x22a3d0))return{'action':_0x5a3742(-0x171,-_0x540172._0xc01b53,-_0x540172._0x343d98,-0x1a3)};if(_0x56fb3f===_0x5a3742(-0x190,-0x1a1,-0x1bf,-0x189))return{'action':_0x5a3742(-0x174,-_0x540172._0x448e8c,-_0x540172._0xa48555,-_0x540172._0xb99b25),'reason':_0x3ba6c8[_0x28ae43(_0x540172._0x97f48c,_0x540172._0x3c82b7,0x452,_0x540172._0x1de93e)]?.['hookSpecificOutput']?.[_0x5a3742(-_0x540172._0x121a2e,-0x186,-0x182,-_0x540172._0xd9c861)]||_0x28ae43(0x423,_0x540172._0x34d98a,0x42d,0x44c)+_0x4290af[_0x5a3742(-0x161,-0x17e,-0x164,-_0x540172._0x2273e6)]};if(_0x3ba6c8[_0x28ae43(_0x540172._0x1ff447,0x421,0x43d,0x402)]==='block'||_0x3ba6c8[_0x28ae43(0x44f,0x445,0x43b,_0x540172._0x2ff5dd)]?.[_0x5a3742(-0x18f,-0x1ab,-0x199,-0x1c4)]===_0x28ae43(_0x540172._0x4aff00,_0x540172._0x32824c,0x449,_0x540172._0x87e6e2))return{'action':'reject','reason':_0x3ba6c8[_0x28ae43(_0x540172._0x8ba0f0,_0x540172._0x3c82b7,0x457,0x45b)]?.['reason']||'Blocked\x20by\x20PreToolUse\x20hook\x20for\x20'+_0x4290af[_0x5a3742(-_0x540172._0x448e8c,-0x17e,-_0x540172._0x5cfecd,-_0x540172._0x4c5e87)]};}function _0x5a3742(_0x54c7b4,_0x1204c5,_0x4624a0,_0x78096c){return _0x1d25(_0x1204c5- -0x299,_0x4624a0);}return _0x1794ed(_0x4290af,_0x5dc788);};}var DEFAULT_TIMEOUT_S2=0x3c;function createHookRegistry(_0xdbd565){const _0x11cb3c={_0x1aeced:0x37b,_0xc2a067:0x4d,_0x1cdddf:0x27,_0x4d958a:0x378,_0x5ddabb:0x37f,_0x4d4928:0x365,_0x353fd2:0x383,_0x35b4c9:0x33d,_0x58d40f:0x340,_0x1ec7b0:0x399,_0x506839:0x377,_0x8cc2fa:0x376,_0x1d51ec:0x37e},_0x87b294={_0x1aa0ad:0x154},_0x1d4ee5={_0x4b42ab:0x4bf,_0x4b224d:0x4d8},_0x5ae54c={_0xba8052:0x3df};return{'hasHooks'(_0x13910c){function _0x393e01(_0x4a81f7,_0x30e477,_0x54e0bf,_0x1fb27d){return _0x1d25(_0x54e0bf-_0x5ae54c._0xba8052,_0x30e477);}return(_0xdbd565[_0x13910c]?.[_0x393e01(_0x1d4ee5._0x4b42ab,0x4d0,0x4d5,_0x1d4ee5._0x4b224d)]??0x0)>0x0;},'getHooks'(_0x2d4ee9,_0x2b2d2e){const _0x46a3c3=_0xdbd565[_0x2d4ee9];if(!_0x46a3c3)return[];const _0x19b200=[];function _0x22eb41(_0x3c7a6d,_0x19fb23,_0x447083,_0xa6157d){return _0x1d25(_0x447083-0x254,_0x3c7a6d);}for(const _0x4bef4b of _0x46a3c3){if(!_0x4bef4b[_0x22eb41(0x357,0x37f,0x365,_0x11cb3c._0x1aeced)]||_0x4bef4b[_0x18fc54(-0x43,-0x3b,-0x50,-_0x11cb3c._0xc2a067)]==='*'){_0x19b200['push'](..._0x4bef4b[_0x18fc54(-_0x11cb3c._0x1cdddf,-0x26,-0x3e,-0x31)][_0x22eb41(_0x11cb3c._0x4d958a,0x361,0x37e,0x35e)](_0x4076be=>({'command':_0x4076be['command'],'timeout':_0x4076be[_0x22eb41(0x37b,0x364,0x35d,0x37c)]??DEFAULT_TIMEOUT_S2})));continue;}if(_0x2b2d2e===void 0x0)continue;const _0x49430b=new RegExp('^(?:'+_0x4bef4b[_0x22eb41(_0x11cb3c._0x5ddabb,0x379,_0x11cb3c._0x4d4928,_0x11cb3c._0x353fd2)]+')$');_0x49430b['test'](_0x2b2d2e)&&_0x19b200[_0x22eb41(_0x11cb3c._0x35b4c9,0x348,_0x11cb3c._0x58d40f,0x342)](..._0x4bef4b[_0x22eb41(_0x11cb3c._0x1ec7b0,_0x11cb3c._0x506839,0x381,0x36d)][_0x22eb41(0x372,_0x11cb3c._0x8cc2fa,_0x11cb3c._0x1d51ec,0x36b)](_0x304c5f=>({'command':_0x304c5f[_0x22eb41(0x333,0x367,0x353,0x346)],'timeout':_0x304c5f[_0x18fc54(-0x4b,-0x46,-0x47,-0x61)]??DEFAULT_TIMEOUT_S2})));}function _0x18fc54(_0x311171,_0x9ab130,_0x44f991,_0x2555b3){return _0x1d25(_0x311171- -_0x87b294._0x1aa0ad,_0x9ab130);}return _0x19b200;}};}export{createHookExtensions,createHookOnToolCallMiddleware,createHookRegistry,executeCommandHook};function _0x35fa(){const _0xdff948=['nte2zvDHCKXT','CgLWzq','B2jZzxj2zxi','Ag9VAZPtDg9W','mJu0ntzXv1j0u1q','BMfTzq','Ag9VA1nWzwnPzMLJt3v0Chv0','zxjYB3i','yMvMB3jLrMLUywXpDxrWDxq','nZG0zhjfwfL6','zw5Kx3r1CM4','mJK3ngLrDgrYDG','zw5K','nZyYodveCMLKAwW','mJa0odGZnw5hrxjxCa','z2v0sg9VA3m','u0Lhs0Lmta','mZC3u2HdA01Q','y2XVC2u','ywz0zxjuDxjUq29TCgXLDgu','BwfW','B3v0Chv0','Ag9VAZPqB3n0vg9VBfvZzq','Ag9VA3m','CMvQzwn0','mJm1ote0vLDeuM92','ChvZAa','rvbjueu','zgvJAxnPB24','CgfZCW','C3rKB3v0','C2vZC2LVBKLK','ywXSB3C','qwDLBNqGzMLUAxnOzwqGCMvZCg9UzgLUzW','C3rHDgu','BM93','BgvUz3rO','u3rVCa','zgvUEq','odq0mg9VDNbSCq','y29Kzq','sg9VAYbLEgL0zwqGD2L0AcbJB2rLia','mte4mgnxrLbYCa','uhjLvg9VBfvZzq','DhjPBq','y29TBwfUza','C3rKAw4','mtuWqK5krunq','CgfYC2u','Dg9tDhjPBMC','mtK2mti4DKnJy25l','D3jPDgu','zgf0yq','C3rHDhvZ','Dg9VBe5HBwu','DgLTzw91Da','Aw5WDxq','AgfZsg9VA3m','y3DK','CNvU','Ag9VAZPoB3rPzMLJyxrPB24','A2LSBa','tM90AwzPy2f0Aw9U','Bwf0y2HLCG','ugvYBwLZC2LVBIbKzw5PzwqGzM9Yia','CgvYBwLZC2LVBKrLy2LZAw9UuMvHC29U','yMXVy2S','C3rYAw5NAwz5'];_0x35fa=function(){return _0xdff948;};return _0x35fa();}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
2
|
-
export { D as ProviderCredentialKind, F as ProviderEndpoints } from '../types-
|
|
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-CSXSwpwn.js';
|
|
2
|
+
export { D as ProviderCredentialKind, F as ProviderEndpoints } from '../types-CSXSwpwn.js';
|
|
3
|
+
import { t as toOpenAiResponsesRequest } from '../provider-adapters-CVC34mwR.js';
|
|
4
4
|
|
|
5
5
|
interface PrepareProviderRequestOptions {
|
|
6
6
|
sessionManager?: ProviderSessionManager;
|