@nuvin/agent-core 0.2.0-rc.8 → 0.2.0-rc.9
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.js +1 -1
- package/dist/chunk-D5IVWJHX.js +1 -1
- package/dist/chunk-FFIZ6TKW.js +1 -1
- package/dist/chunk-IUZALP6K.js +1 -1
- package/dist/chunk-LIE76IJA.js +1 -1
- package/dist/chunk-VYW6MSQ3.js +1 -0
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/chunk-YNOIG4FD.js +1 -1
- package/dist/formats/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/models/index.js +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/types.d.ts +14 -5
- package/dist/tools/index.js +1 -1
- package/dist/tools/mcp-tool-adapter.d.ts +13 -13
- package/package.json +2 -2
- package/dist/chunk-A4CS4HLK.js +0 -1
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x347104,_0x4b6609){const _0x12014c={_0x42e73f:0x1c1,_0x2237ee:0x1c2,_0x23a14d:0x1c2,_0x5917d7:0x493,_0x23cfb6:0x497,_0x821fff:0x1cb,_0x5d567d:0x1c5,_0x58fb21:0x1bd,_0x531651:0x49f,_0x9fc41:0x496,_0x5df345:0x48d,_0x1e749d:0x49d,_0x1ce2fc:0x48e,_0x48f1f5:0x49d,_0x165d7d:0x49a,_0x2323f8:0x491,_0x5db008:0x48c,_0x56cec3:0x492,_0x5f3ed5:0x488,_0x356e0e:0x486,_0x3107dc:0x493,_0x23957b:0x486};function _0x264a77(_0x932f5c,_0x121573,_0x1d032a,_0x17ae08){return _0x2b31(_0x121573- -0x340,_0x17ae08);}const _0x156f07=_0x347104();function _0x4fd38c(_0x3a0663,_0x545063,_0x53eb22,_0x30d64c){return _0x2b31(_0x545063-0x309,_0x30d64c);}while(!![]){try{const _0xe552cd=parseInt(_0x264a77(-_0x12014c._0x42e73f,-_0x12014c._0x2237ee,-_0x12014c._0x23a14d,-0x1cd))/0x1+parseInt(_0x4fd38c(_0x12014c._0x5917d7,_0x12014c._0x5917d7,_0x12014c._0x23cfb6,0x496))/0x2*(parseInt(_0x4fd38c(0x495,0x499,0x491,0x4a0))/0x3)+parseInt(_0x264a77(-0x1c7,-0x1c0,-0x1ba,-_0x12014c._0x821fff))/0x4+-parseInt(_0x264a77(-0x1c5,-0x1bd,-_0x12014c._0x5d567d,-_0x12014c._0x58fb21))/0x5*(-parseInt(_0x4fd38c(_0x12014c._0x531651,_0x12014c._0x9fc41,_0x12014c._0x5df345,_0x12014c._0x1e749d))/0x6)+-parseInt(_0x4fd38c(0x497,0x48d,_0x12014c._0x1ce2fc,0x489))/0x7*(-parseInt(_0x4fd38c(_0x12014c._0x48f1f5,_0x12014c._0x165d7d,_0x12014c._0x2323f8,0x498))/0x8)+-parseInt(_0x4fd38c(_0x12014c._0x5db008,_0x12014c._0x56cec3,0x48e,_0x12014c._0x5f3ed5))/0x9*(parseInt(_0x4fd38c(0x48e,0x491,_0x12014c._0x356e0e,0x48b))/0xa)+-parseInt(_0x4fd38c(0x485,0x48f,0x497,0x486))/0xb*(parseInt(_0x4fd38c(_0x12014c._0x3107dc,0x490,0x492,_0x12014c._0x23957b))/0xc);if(_0xe552cd===_0x4b6609)break;else _0x156f07['push'](_0x156f07['shift']());}catch(_0x2417f6){_0x156f07['push'](_0x156f07['shift']());}}}(_0x410f,0xd7533));function _0x410f(){const _0x20d539=['ChvZAa','mtyYnZa1ou5pDNfssW','CMvTB3zLqwjVCNrmAxn0zw5LCG','mtGXmJiWog1dBhzXqG','Bwf4q29Uy3vYCMvUy3KGBxvZDcbIzsbHigzPBML0zsbWB3nPDgL2zsbPBNrLz2vY','AxnjBNrLz2vY','nxnmD1rsDW','mJfKyKPIzfi','C2HPzNq','nduYmtKZmdzuC25vDu0','mtjywvvXwNu','mta1mhrvvgH4zW','ode0otvNs3f6z3e','nJiXodjdBg9rv1m','y2fUy2vSBgvK','BgvUz3rO','nte3mZa3nfjAs2D3CW','CMvQzwn0','CMvZB2X2zq','mtuZs1r4ruXZ','mZC3nta5nNjcCufdAW','C3bSAwnL'];_0x410f=function(){return _0x20d539;};return _0x410f();}import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';import{TurnFailedError}from'../chunk-FFIZ6TKW.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function createAbortAwareSemaphore(_0x3a164e){const _0x4c1d77={_0x2e52f5:0x254,_0xfccf89:0x260,_0x210f79:0x230,_0x2b02a2:0x22a},_0x271fcb={_0x1feb00:0x7c,_0x378f38:0x7e,_0x5f2be0:0x85,_0x2b76f5:0x84,_0x1e6cc0:0x86},_0x387e75={_0x2817a5:0x198},_0x3add55={_0x259226:0x74,_0x3627b6:0x4,_0x26f9b6:0x1,_0x931307:0x0,_0x49baea:0x3,_0xf24f58:0x9,_0x3c7144:0xa,_0x4579c2:0xa},_0x2dc613={_0x2d402d:0x253},_0x4ff36e={_0x1fff85:0x3e1},_0x696c44={_0x9712f5:0x3ab};function _0x99bd2(_0x2b54,_0xfaafe3,_0x48feb4,_0x11b899){return _0x2b31(_0x48feb4- -_0x696c44._0x9712f5,_0x2b54);}if(!Number['isFinite'](_0x3a164e)||!Number[_0x372d40(-0x255,-_0x4c1d77._0x2e52f5,-0x25f,-_0x4c1d77._0xfccf89)](_0x3a164e)||_0x3a164e<=0x0)throw new Error(_0x99bd2(-_0x4c1d77._0x210f79,-0x229,-_0x4c1d77._0x2b02a2,-0x226));let _0x15e098=0x0;function _0x372d40(_0x25249b,_0xaf1917,_0x849462,_0x5b35fc){return _0x2b31(_0x849462- -_0x4ff36e._0x1fff85,_0xaf1917);}const _0x413ae3=[],_0x2d34b0=()=>{let _0xb7cd35=![];return()=>{if(_0xb7cd35)return;_0xb7cd35=!![],_0x15e098-=0x1,_0x5a09aa();};},_0x5a09aa=()=>{function _0x365d1a(_0x5e3b80,_0x32428b,_0x5dd29c,_0x683b15){return _0x372d40(_0x5e3b80-0xa3,_0x5dd29c,_0x32428b-0x2be,_0x683b15-0xa0);}function _0x500b4c(_0x1ec8d6,_0x5cafb3,_0x1f3de2,_0xa05293){return _0x372d40(_0x1ec8d6-0x72,_0x1ec8d6,_0x5cafb3-_0x2dc613._0x2d402d,_0xa05293-0x18c);}while(_0x413ae3[_0x365d1a(_0x3add55._0x259226,0x69,0x6c,0x69)]>0x0){const _0xd94b67=_0x413ae3[_0x500b4c(-0x10,-0x9,-0x11,-0xc)]();if(!_0xd94b67||_0xd94b67[_0x500b4c(_0x3add55._0x3627b6,-0x3,-0xc,-_0x3add55._0x26f9b6)])continue;_0xd94b67[_0x500b4c(_0x3add55._0x931307,-_0x3add55._0x49baea,0x0,-_0x3add55._0xf24f58)]=!![],_0xd94b67['removeAbortListener'](),_0x15e098+=0x1,_0xd94b67[_0x500b4c(-0x3,0x1,-_0x3add55._0x3c7144,_0x3add55._0x4579c2)](_0x2d34b0());return;}};return{'acquire'(_0x56eb81){const _0x46a582={_0x2f596e:0x1d7,_0x25ea00:0x1d3,_0x5b5809:0x1df},_0x5efb61={_0x642230:0x15c,_0x98bbdb:0x26f},_0x298b95={_0x472d7a:0x627};if(_0x56eb81?.['aborted'])return Promise[_0x2dc467(-_0x271fcb._0x1feb00,-_0x271fcb._0x378f38,-_0x271fcb._0x5f2be0,-0x83)](toAbortError(_0x56eb81['reason']));function _0x17afa9(_0xb02781,_0x398316,_0x527f73,_0x1db5b8){return _0x99bd2(_0xb02781,_0x398316-0x133,_0x398316-_0x298b95._0x472d7a,_0x1db5b8-0xf9);}if(_0x15e098<_0x3a164e)return _0x15e098+=0x1,Promise[_0x2dc467(-0x7a,-0x7e,-_0x271fcb._0x2b76f5,-_0x271fcb._0x1e6cc0)](_0x2d34b0());function _0x2dc467(_0x4fd7c8,_0x1c63e3,_0x5d62b3,_0x443df1){return _0x99bd2(_0x443df1,_0x1c63e3-0xee,_0x5d62b3-_0x387e75._0x2817a5,_0x443df1-0x63);}return new Promise((_0x2197bd,_0x3c3874)=>{const _0x29c107={_0x499aab:0x1f9,_0x4ba2cf:0x20b,_0x2aed88:0x205,_0x4f145c:0x208,_0x6a6d40:0x1fd,_0x6dd31c:0x284,_0x3b1b42:0x286,_0x170f7c:0x27d};function _0x250129(_0x20dafb,_0x27553f,_0x2ce09d,_0x26e36b){return _0x2dc467(_0x20dafb-_0x5efb61._0x642230,_0x27553f-0xcd,_0x26e36b-_0x5efb61._0x98bbdb,_0x2ce09d);}const _0x7fbf49={'resolve':_0x2197bd,'reject':_0x3c3874,'cancelled':![],'removeAbortListener':()=>{}};_0x413ae3[_0x250129(_0x46a582._0x2f596e,_0x46a582._0x25ea00,_0x46a582._0x5b5809,0x1d9)](_0x7fbf49),_0x7fbf49['removeAbortListener']=addAbortListener(_0x56eb81,()=>{const _0x2fb8a0={_0x387bd4:0x5f},_0x5bd777={_0xc947ea:0x3e0};function _0x577125(_0x348c1d,_0x31bd7b,_0x16707c,_0x5906aa){return _0x250129(_0x348c1d-0x1d0,_0x31bd7b-0x7d,_0x16707c,_0x31bd7b- -_0x5bd777._0xc947ea);}if(_0x7fbf49[_0x577125(-0x1fe,-0x1f9,-_0x29c107._0x499aab,-0x1f4)])return;_0x7fbf49[_0x577125(-0x1f7,-0x1f9,-0x1f1,-0x1f4)]=!![],_0x7fbf49[_0x577125(-_0x29c107._0x4ba2cf,-_0x29c107._0x2aed88,-_0x29c107._0x4f145c,-_0x29c107._0x6a6d40)]();function _0x6d6e12(_0x5299a5,_0x4716f8,_0x217f55,_0x392d95){return _0x250129(_0x5299a5-0x37,_0x4716f8-_0x2fb8a0._0x387bd4,_0x217f55,_0x5299a5-0x94);}const _0x2737a4=_0x413ae3['indexOf'](_0x7fbf49);if(_0x2737a4>=0x0)_0x413ae3[_0x6d6e12(0x282,_0x29c107._0x6dd31c,_0x29c107._0x3b1b42,_0x29c107._0x170f7c)](_0x2737a4,0x1);_0x7fbf49['reject'](toAbortError(_0x56eb81?.['reason']));});});}};}function _0x2b31(_0x991c51,_0x3ffe1e){_0x991c51=_0x991c51-0x17d;const _0x410ff7=_0x410f();let _0x2b313e=_0x410ff7[_0x991c51];if(_0x2b31['FRQNLp']===undefined){var _0x2036da=function(_0x2e5fa6){const _0x39abd8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3a164e='',_0x15e098='';for(let _0x413ae3=0x0,_0x2d34b0,_0x5a09aa,_0xb7cd35=0x0;_0x5a09aa=_0x2e5fa6['charAt'](_0xb7cd35++);~_0x5a09aa&&(_0x2d34b0=_0x413ae3%0x4?_0x2d34b0*0x40+_0x5a09aa:_0x5a09aa,_0x413ae3++%0x4)?_0x3a164e+=String['fromCharCode'](0xff&_0x2d34b0>>(-0x2*_0x413ae3&0x6)):0x0){_0x5a09aa=_0x39abd8['indexOf'](_0x5a09aa);}for(let _0xd94b67=0x0,_0x56eb81=_0x3a164e['length'];_0xd94b67<_0x56eb81;_0xd94b67++){_0x15e098+='%'+('00'+_0x3a164e['charCodeAt'](_0xd94b67)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x15e098);};_0x2b31['ysWSkz']=_0x2036da,_0x2b31['JZLwRk']={},_0x2b31['FRQNLp']=!![];}const _0x27e41d=_0x410ff7[0x0],_0x171c35=_0x991c51+_0x27e41d,_0x23baf9=_0x2b31['JZLwRk'][_0x171c35];return!_0x23baf9?(_0x2b313e=_0x2b31['ysWSkz'](_0x2b313e),_0x2b31['JZLwRk'][_0x171c35]=_0x2b313e):_0x2b313e=_0x23baf9,_0x2b313e;}export{OperationAbortedError,TurnFailedError,addAbortListener,createAbortAwareSemaphore,isAbortError,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ export interface JsonObject {
|
|
|
4
4
|
}
|
|
5
5
|
export type JsonValue = JsonObject | JsonPrimitive | JsonValue[];
|
|
6
6
|
export type JsonSchemaType = "array" | "boolean" | "number" | "object" | "string";
|
|
7
|
-
export interface JsonSchemaString {
|
|
7
|
+
export interface JsonSchemaString<TEnum extends readonly string[] | undefined = readonly string[] | undefined> {
|
|
8
8
|
type: "string";
|
|
9
9
|
description?: string;
|
|
10
|
+
enum?: TEnum;
|
|
10
11
|
}
|
|
11
12
|
export interface JsonSchemaNumber {
|
|
12
13
|
type: "number";
|
|
@@ -22,8 +23,12 @@ export interface JsonSchemaObject<TProperties extends Record<string, JsonSchema>
|
|
|
22
23
|
type: "object";
|
|
23
24
|
properties: TProperties;
|
|
24
25
|
required?: TRequired;
|
|
26
|
+
additionalProperties?: boolean;
|
|
25
27
|
}
|
|
26
|
-
export
|
|
28
|
+
export interface JsonSchemaAnyOf<TVariants extends readonly JsonSchema[] = readonly JsonSchema[]> {
|
|
29
|
+
anyOf: TVariants;
|
|
30
|
+
}
|
|
31
|
+
export type JsonSchema = JsonSchemaAnyOf | JsonSchemaArray | JsonSchemaBoolean | JsonSchemaNumber | JsonSchemaObject | JsonSchemaString;
|
|
27
32
|
export interface TextBlock {
|
|
28
33
|
type: "text";
|
|
29
34
|
text: string;
|
|
@@ -579,10 +584,14 @@ export interface ToolRuntime {
|
|
|
579
584
|
executeCalls(toolCalls: ToolUseBlock[], ctx: ToolExecutionContext): Promise<ToolResult[]>;
|
|
580
585
|
execute(toolCall: ToolUseBlock, ctx: ToolExecutionContext): Promise<ToolResult>;
|
|
581
586
|
}
|
|
582
|
-
export type InferJsonSchema<TSchema extends JsonSchema> = TSchema extends JsonSchemaString ? string : TSchema extends JsonSchemaNumber ? number : TSchema extends JsonSchemaBoolean ? boolean : TSchema extends JsonSchemaArray<infer TItem> ? InferJsonSchema<TItem>[] : TSchema extends JsonSchemaObject<infer TProperties, infer TRequired> ? Expand<RequiredProperties<TProperties, TRequired> & OptionalProperties<TProperties, TRequired>> : never;
|
|
587
|
+
export type InferJsonSchema<TSchema extends JsonSchema> = TSchema extends JsonSchemaAnyOf<infer TVariants> ? JsonSchema extends TVariants[number] ? JsonValue : InferJsonSchemaAnyOf<TVariants> : TSchema extends JsonSchemaString<infer TEnum> ? TEnum extends readonly string[] ? TEnum[number] : string : TSchema extends JsonSchemaNumber ? number : TSchema extends JsonSchemaBoolean ? boolean : TSchema extends JsonSchemaArray<infer TItem> ? InferJsonSchema<TItem>[] : TSchema extends JsonSchemaObject<infer TProperties, infer TRequired> ? Expand<RequiredProperties<TProperties, TRequired> & OptionalProperties<TProperties, TRequired>> : never;
|
|
583
588
|
type Expand<TValue> = TValue extends infer TObject ? {
|
|
584
589
|
[TKey in keyof TObject]: TObject[TKey];
|
|
585
590
|
} : never;
|
|
591
|
+
type JsonSchemaObjectPropertyKeys<TSchema extends JsonSchema> = TSchema extends JsonSchemaObject<infer TProperties> ? Extract<keyof TProperties, string> : never;
|
|
592
|
+
type InferJsonSchemaAnyOfVariant<TVariant extends JsonSchema, TAllVariants extends JsonSchema> = TVariant extends JsonSchemaObject<infer TProperties, infer TRequired> ? Expand<RequiredProperties<TProperties, TRequired> & OptionalProperties<TProperties, TRequired> & (TVariant["additionalProperties"] extends false ? Partial<Record<Exclude<JsonSchemaObjectPropertyKeys<TAllVariants>, keyof TProperties>, never>> : Record<never, never>)> : InferJsonSchema<TVariant>;
|
|
593
|
+
type InferJsonSchemaAnyOfVariants<TVariant extends JsonSchema, TAllVariants extends JsonSchema> = TVariant extends JsonSchema ? InferJsonSchemaAnyOfVariant<TVariant, TAllVariants> : never;
|
|
594
|
+
type InferJsonSchemaAnyOf<TVariants extends readonly JsonSchema[]> = InferJsonSchemaAnyOfVariants<TVariants[number], TVariants[number]>;
|
|
586
595
|
type RequiredKeyUnion<TRequired extends readonly string[] | undefined> = TRequired extends readonly string[] ? TRequired[number] : never;
|
|
587
596
|
type OptionalKeyUnion<TProperties extends Record<string, JsonSchema>, TRequired extends readonly string[] | undefined> = Exclude<keyof TProperties, RequiredKeyUnion<TRequired>>;
|
|
588
597
|
type RequiredProperties<TProperties extends Record<string, JsonSchema>, TRequired extends readonly string[] | undefined> = {
|
|
@@ -597,7 +606,7 @@ export type ToolGenerator<TYield extends ToolOutputValue = ToolOutputValue, TRet
|
|
|
597
606
|
export interface ToolDefinitionLifecycle {
|
|
598
607
|
acquire(): () => void;
|
|
599
608
|
}
|
|
600
|
-
export interface ToolDefinition<TInput extends
|
|
609
|
+
export interface ToolDefinition<TInput extends object = JsonObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined, TSchema extends JsonSchemaObject = JsonSchemaObject> {
|
|
601
610
|
name: string;
|
|
602
611
|
description: string;
|
|
603
612
|
inputSchema: TSchema;
|
|
@@ -605,7 +614,7 @@ export interface ToolDefinition<TInput extends JsonObject = JsonObject, TYield e
|
|
|
605
614
|
internalLifecycle?: ToolDefinitionLifecycle;
|
|
606
615
|
execute(input: TInput, ctx: ToolExecutionContext): ToolGenerator<TYield, TReturn>;
|
|
607
616
|
}
|
|
608
|
-
export type AnyToolDefinition = ToolDefinition<
|
|
617
|
+
export type AnyToolDefinition = ToolDefinition<object, ToolOutputValue, ToolOutputValue | undefined, JsonSchemaObject>;
|
|
609
618
|
export type TransformableStage = "afterModelResponse" | "afterToolResult" | "beforeAssistantAppend" | "beforeFinalOutput" | "beforeModelRequest" | "beforeToolExecution" | "beforeToolResultAppend" | "onUserMessage";
|
|
610
619
|
export type ObserverOnlyStage = "afterMessageAppend" | "afterTurnComplete";
|
|
611
620
|
export type Stage = ObserverOnlyStage | TransformableStage;
|