@nuvin/agent-core 0.2.0-rc.2 → 0.2.0-rc.4
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/agent/metrics.d.ts +9 -1
- package/dist/chunk-A4CS4HLK.js +1 -0
- package/dist/chunk-D5IVWJHX.js +1 -1
- package/dist/chunk-FFIZ6TKW.js +1 -1
- package/dist/chunk-IUZALP6K.js +1 -0
- package/dist/chunk-LIE76IJA.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/models/model-registry.d.ts +8 -0
- package/dist/models/openai-surfaces.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/reasoning-config.d.ts +3 -4
- package/dist/shared/types.d.ts +38 -10
- package/dist/tools/bash-tool.d.ts +6 -2
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/mcp-connection-generation.d.ts +59 -0
- package/dist/tools/mcp-safe-error-provenance.d.ts +4 -0
- package/dist/tools/mcp-safe-error.d.ts +14 -0
- package/dist/tools/mcp-server-manager.d.ts +3 -52
- package/dist/tools/mcp-tool-adapter.d.ts +21 -1
- package/dist/tools/runtime-manager-tools.d.ts +2 -0
- package/package.json +2 -2
- package/dist/chunk-JQLCZGQ7.js +0 -1
- package/dist/chunk-NYZR4XKO.js +0 -1
- package/dist/chunk-WDPOWIJR.js +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { ModelReasoningConfig } from "@nuvin/config";
|
|
1
2
|
import type { ChatModelAuthScheme, ChatModelSurface } from "./chat-model.ts";
|
|
2
3
|
export interface ModelProfile {
|
|
3
4
|
contextWindow?: number;
|
|
4
5
|
maxOutput?: number;
|
|
6
|
+
reasoning?: ModelReasoningConfig;
|
|
5
7
|
surface?: ChatModelSurface;
|
|
6
8
|
baseUrl?: string;
|
|
7
9
|
}
|
|
@@ -29,7 +31,13 @@ export interface ResolvedModelProfile {
|
|
|
29
31
|
supportsModelFetch?: boolean;
|
|
30
32
|
contextWindow?: number;
|
|
31
33
|
maxOutput?: number;
|
|
34
|
+
reasoning?: ModelReasoningConfig;
|
|
32
35
|
}
|
|
36
|
+
export declare const REASONING_METADATA_VERSIONS: {
|
|
37
|
+
readonly anthropic: "2026-07-22";
|
|
38
|
+
readonly openai: "2026-07-22";
|
|
39
|
+
readonly codex: "0.145.0+25af12f7e61572b0bc18ddb1008be543b91519b0";
|
|
40
|
+
};
|
|
33
41
|
export declare function getProviderProfile(provider: string): ProviderProfile | undefined;
|
|
34
42
|
export declare function getModelProfile(provider: string, model: string): ModelProfile | undefined;
|
|
35
43
|
export declare function resolveModelProfile(provider: string, model: string): ResolvedModelProfile | undefined;
|
|
@@ -43,7 +43,7 @@ interface OpenAiChatCompletionsRequest {
|
|
|
43
43
|
messages: OpenAiChatCompletionMessage[];
|
|
44
44
|
max_completion_tokens?: number;
|
|
45
45
|
max_tokens?: number;
|
|
46
|
-
reasoning_effort?: "high" | "low" | "medium" | "minimal" | "none" | "xhigh";
|
|
46
|
+
reasoning_effort?: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh";
|
|
47
47
|
stream: boolean;
|
|
48
48
|
stream_options?: {
|
|
49
49
|
include_usage: true;
|
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5decff,_0x3c2c65){var _0x456f32={_0x42f1f7:0x27c,_0x126e93:0x277,_0x368610:0x276,_0xe76eb8:0x244,_0x74400e:0x245,_0x14c5e3:0x273,_0x13ad44:0x248,_0x525a5c:0x250,_0x11e31e:0x24a,_0x216957:0x276,_0x51acd3:0x27c,_0x322857:0x275,_0x4d6895:0x27b,_0x410316:0x274,_0x208522:0x24c,_0x1bcaf8:0x24d,_0x14786d:0x249,_0x3939e7:0x246},_0x3140d5={_0xfe6fcd:0x374};function _0x8cbafb(_0x3e2fb7,_0x2c8786,_0x4a7e95,_0x11c6a1){return _0x491b(_0x11c6a1-0x14a,_0x4a7e95);}var _0x12381e=_0x5decff();function _0xc870c6(_0x26c597,_0x1342d0,_0x39868f,_0x44c244){return _0x491b(_0x1342d0- -_0x3140d5._0xfe6fcd,_0x44c244);}while(!![]){try{var _0x5299ac=-parseInt(_0xc870c6(-_0x456f32._0x42f1f7,-_0x456f32._0x126e93,-_0x456f32._0x368610,-0x272))/0x1*(parseInt(_0x8cbafb(_0x456f32._0xe76eb8,0x245,0x249,_0x456f32._0x74400e))/0x2)+-parseInt(_0xc870c6(-0x270,-_0x456f32._0x14c5e3,-0x276,-0x276))/0x3+parseInt(_0x8cbafb(_0x456f32._0x13ad44,_0x456f32._0x525a5c,_0x456f32._0x11e31e,_0x456f32._0x11e31e))/0x4*(parseInt(_0xc870c6(-0x26d,-0x272,-_0x456f32._0x216957,-0x271))/0x5)+-parseInt(_0xc870c6(-_0x456f32._0x51acd3,-0x27a,-_0x456f32._0x322857,-0x27b))/0x6*(parseInt(_0xc870c6(-0x27b,-0x27c,-0x27a,-0x278))/0x7)+-parseInt(_0x8cbafb(0x23f,0x246,0x248,0x243))/0x8*(parseInt(_0xc870c6(-_0x456f32._0x4d6895,-_0x456f32._0x216957,-0x27a,-_0x456f32._0x410316))/0x9)+parseInt(_0x8cbafb(_0x456f32._0x208522,_0x456f32._0x1bcaf8,0x245,_0x456f32._0x14786d))/0xa+parseInt(_0x8cbafb(_0x456f32._0x3939e7,_0x456f32._0x11e31e,0x243,_0x456f32._0x3939e7))/0xb;if(_0x5299ac===_0x3c2c65)break;else _0x12381e['push'](_0x12381e['shift']());}catch(_0x159437){_0x12381e['push'](_0x12381e['shift']());}}}(_0x3405,0x8db6d));import{modelIdentityFromParts}from'../chunk-D5IVWJHX.js';import{resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig}from'../chunk-IUZALP6K.js';function _0x491b(_0x341534,_0x5a81be){_0x341534=_0x341534-0xf8;var _0x340527=_0x3405();var _0x491bd9=_0x340527[_0x341534];if(_0x491b['RlwUjy']===undefined){var _0x2e4e10=function(_0x4a94a4){var _0x498c35='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x32ea79='',_0x2b8e1b='';for(var _0x283b30=0x0,_0x439ee3,_0x1873ba,_0x29be11=0x0;_0x1873ba=_0x4a94a4['charAt'](_0x29be11++);~_0x1873ba&&(_0x439ee3=_0x283b30%0x4?_0x439ee3*0x40+_0x1873ba:_0x1873ba,_0x283b30++%0x4)?_0x32ea79+=String['fromCharCode'](0xff&_0x439ee3>>(-0x2*_0x283b30&0x6)):0x0){_0x1873ba=_0x498c35['indexOf'](_0x1873ba);}for(var _0x3a3de9=0x0,_0x32f36e=_0x32ea79['length'];_0x3a3de9<_0x32f36e;_0x3a3de9++){_0x2b8e1b+='%'+('00'+_0x32ea79['charCodeAt'](_0x3a3de9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2b8e1b);};_0x491b['ebrCTv']=_0x2e4e10,_0x491b['YhpFIX']={},_0x491b['RlwUjy']=!![];}var _0x524e7f=_0x340527[0x0],_0x4994aa=_0x341534+_0x524e7f,_0x14eff7=_0x491b['YhpFIX'][_0x4994aa];return!_0x14eff7?(_0x491bd9=_0x491b['ebrCTv'](_0x491bd9),_0x491b['YhpFIX'][_0x4994aa]=_0x491bd9):_0x491bd9=_0x14eff7,_0x491bd9;}function _0x3405(){var _0x253c5f=['mJu2otyXmhLTEez2Bq','ngPjBgrlqW','ntq0nZi1turfwun3','mJqYnJyXnw1ht0nxEG','mZK2mdq0nNrND2XRsG','mte1odiYneznu0zSrq','nNDlsfbREG','mta1otrLs3L2DMW','ote0mdq2muvsrMDOAq','mtLRz1P5uKK','ovHPzenqzG'];_0x3405=function(){return _0x253c5f;};return _0x3405();}import{TurnFailedError}from'../chunk-FFIZ6TKW.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,TurnFailedError,addAbortListener,isAbortError,modelIdentityFromParts,resolveAnthropicReasoningConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function resolveOpenAiReasoningConfig(reasoning: ReasoningConfig | undefined): OpenAiReasoningConfig | undefined;
|
|
1
|
+
import type { AnthropicReasoningConfig, CodexReasoningConfig, OpenAiReasoningConfig, ReasoningConfig } from "./types.ts";
|
|
2
|
+
export declare function resolveAnthropicReasoningConfig(reasoning: ReasoningConfig | undefined): AnthropicReasoningConfig | undefined;
|
|
3
|
+
export declare function resolveOpenAiReasoningConfig(reasoning: ReasoningConfig | undefined): CodexReasoningConfig | OpenAiReasoningConfig | undefined;
|
|
5
4
|
//# sourceMappingURL=reasoning-config.d.ts.map
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -82,12 +82,8 @@ export interface AnthropicRedactedThinkingWireBlock {
|
|
|
82
82
|
}
|
|
83
83
|
export type AnthropicAssistantContentBlock = AnthropicRedactedThinkingWireBlock | AnthropicThinkingWireBlock | TextBlock | ToolUseBlock;
|
|
84
84
|
export type ReasoningVisibility = "continuity-only" | "user-visible";
|
|
85
|
-
export type AutoReasoningEffort = "low" | "medium" | "high";
|
|
86
|
-
export interface AutoReasoningConfig {
|
|
87
|
-
effort: AutoReasoningEffort;
|
|
88
|
-
}
|
|
89
85
|
export type AnthropicThinkingDisplay = "omitted" | "summarized";
|
|
90
|
-
export type AnthropicThinkingEffort = "low" | "medium" | "high";
|
|
86
|
+
export type AnthropicThinkingEffort = "low" | "medium" | "high" | "xhigh" | "max";
|
|
91
87
|
export interface AnthropicEnabledThinkingConfig {
|
|
92
88
|
type: "enabled";
|
|
93
89
|
budgetTokens: number;
|
|
@@ -97,23 +93,29 @@ export interface AnthropicEnabledThinkingConfig {
|
|
|
97
93
|
export interface AnthropicAdaptiveThinkingConfig {
|
|
98
94
|
type: "adaptive";
|
|
99
95
|
display?: AnthropicThinkingDisplay;
|
|
100
|
-
effort?: AnthropicThinkingEffort;
|
|
101
96
|
interleaved?: boolean;
|
|
102
97
|
}
|
|
103
98
|
export interface AnthropicDisabledThinkingConfig {
|
|
104
99
|
type: "disabled";
|
|
105
100
|
}
|
|
106
101
|
export type AnthropicThinkingConfig = AnthropicAdaptiveThinkingConfig | AnthropicDisabledThinkingConfig | AnthropicEnabledThinkingConfig;
|
|
107
|
-
export
|
|
102
|
+
export interface AnthropicReasoningConfig {
|
|
103
|
+
thinking: AnthropicThinkingConfig;
|
|
104
|
+
effort?: AnthropicThinkingEffort;
|
|
105
|
+
}
|
|
106
|
+
export type OpenAiReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
108
107
|
export type OpenAiReasoningSummary = "auto" | "concise" | "detailed";
|
|
109
108
|
export interface OpenAiReasoningConfig {
|
|
110
109
|
effort?: OpenAiReasoningEffort;
|
|
111
110
|
includeEncryptedContent?: boolean;
|
|
112
111
|
summary?: OpenAiReasoningSummary;
|
|
113
112
|
}
|
|
113
|
+
export interface CodexReasoningConfig {
|
|
114
|
+
effort: string;
|
|
115
|
+
}
|
|
114
116
|
export interface ReasoningConfig {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
anthropic?: AnthropicReasoningConfig;
|
|
118
|
+
codex?: CodexReasoningConfig;
|
|
117
119
|
openai?: OpenAiReasoningConfig;
|
|
118
120
|
visibility?: ReasoningVisibility;
|
|
119
121
|
}
|
|
@@ -220,6 +222,13 @@ export interface ChatResponseUsage {
|
|
|
220
222
|
reportedCost?: ReportedModelCost;
|
|
221
223
|
estimatedCost?: EstimatedModelCost;
|
|
222
224
|
}
|
|
225
|
+
export interface PersistedModelCallMetricsV1 {
|
|
226
|
+
version: 1;
|
|
227
|
+
usage: ChatResponseUsage;
|
|
228
|
+
modelTimeMs: number;
|
|
229
|
+
completesRequest: boolean;
|
|
230
|
+
}
|
|
231
|
+
export type PersistedModelCallMetrics = PersistedModelCallMetricsV1;
|
|
223
232
|
export interface ChatResponse {
|
|
224
233
|
id: string;
|
|
225
234
|
content: AssistantContentBlock[];
|
|
@@ -320,6 +329,7 @@ export interface TurnInput {
|
|
|
320
329
|
system?: SystemInput;
|
|
321
330
|
messages?: MessageInput[];
|
|
322
331
|
message: MessageInput;
|
|
332
|
+
drainSteering?: () => Promise<MessageInput[]>;
|
|
323
333
|
}
|
|
324
334
|
export interface TurnState {
|
|
325
335
|
sessionId: string;
|
|
@@ -387,6 +397,7 @@ export interface TurnMessageMeta {
|
|
|
387
397
|
provider?: string;
|
|
388
398
|
model?: string;
|
|
389
399
|
modelIdentity?: string;
|
|
400
|
+
metrics?: PersistedModelCallMetrics;
|
|
390
401
|
/** ms epoch — provider request sent. */
|
|
391
402
|
turnStartedAt?: number;
|
|
392
403
|
/** ms epoch — response fully received. */
|
|
@@ -441,9 +452,17 @@ export interface ToolExecutionContext extends AgentEventContext {
|
|
|
441
452
|
signal: AbortSignal;
|
|
442
453
|
toolCallId?: string;
|
|
443
454
|
permissionClass?: ToolPermissionClass;
|
|
455
|
+
executionAuthorization?: unknown;
|
|
444
456
|
askUser?: (request: AskUserQuestionRequest) => Promise<AskUserAnswers>;
|
|
445
457
|
setTopic?: (topic: string) => void;
|
|
446
458
|
}
|
|
459
|
+
export interface BashExecutionTarget {
|
|
460
|
+
command: string;
|
|
461
|
+
cwd: string;
|
|
462
|
+
shellPath: string;
|
|
463
|
+
dialect: "bash" | "posix" | "windows" | "unknown";
|
|
464
|
+
background: boolean;
|
|
465
|
+
}
|
|
447
466
|
export interface ToolRuntimeStartedEvent {
|
|
448
467
|
type: "tool_started";
|
|
449
468
|
toolCall: ToolUseBlock;
|
|
@@ -474,6 +493,8 @@ export interface AgentModelRequestEvent {
|
|
|
474
493
|
}
|
|
475
494
|
export interface AgentModelResponseEvent {
|
|
476
495
|
type: "model_response";
|
|
496
|
+
/** Exact provider/model-call duration measured by the turn engine. */
|
|
497
|
+
modelTimeMs?: number;
|
|
477
498
|
response: ChatResponse;
|
|
478
499
|
}
|
|
479
500
|
export interface AgentAssistantMessageEvent {
|
|
@@ -545,6 +566,9 @@ export type ToolRuntimeDispatchDecision = {
|
|
|
545
566
|
dir: string;
|
|
546
567
|
persist: boolean;
|
|
547
568
|
};
|
|
569
|
+
executionAuthorization?: unknown;
|
|
570
|
+
approvalDecision?: "y" | "a" | "t";
|
|
571
|
+
approvalSource?: "policy" | "remembered" | "sudo" | "user";
|
|
548
572
|
};
|
|
549
573
|
export type ToolRuntimeToolCallHandler = (toolCall: ToolUseBlock, ctx: ToolExecutionContext) => Promise<ToolRuntimeDispatchDecision | undefined> | ToolRuntimeDispatchDecision | undefined;
|
|
550
574
|
export type ToolRuntimeEventHandler = (event: ToolRuntimeEvent, ctx: ToolExecutionContext) => Promise<void> | void;
|
|
@@ -618,6 +642,8 @@ export interface ObserverExtensionRegistration<S extends Stage = Stage> {
|
|
|
618
642
|
kind: "observer";
|
|
619
643
|
order: number;
|
|
620
644
|
enabled: boolean;
|
|
645
|
+
/** Runs after every enabled non-terminal observer registered for this stage. */
|
|
646
|
+
terminal?: boolean;
|
|
621
647
|
run: Observer<S>;
|
|
622
648
|
}
|
|
623
649
|
export type AnyExtensionRegistration = {
|
|
@@ -641,9 +667,11 @@ export interface RunTurnDeps {
|
|
|
641
667
|
outputFormat?: OutputFormat;
|
|
642
668
|
}
|
|
643
669
|
export type AgentInput = MessageInput | string;
|
|
670
|
+
export type SteeringInputDrain = () => Promise<AgentInput[]>;
|
|
644
671
|
export interface AgentSendOptions {
|
|
645
672
|
streaming?: boolean;
|
|
646
673
|
signal?: AbortSignal;
|
|
674
|
+
drainSteering?: SteeringInputDrain;
|
|
647
675
|
}
|
|
648
676
|
export interface AgentOptions {
|
|
649
677
|
sessionId?: string;
|
|
@@ -778,7 +806,7 @@ export interface OpenAiReasoningOutputItem {
|
|
|
778
806
|
}
|
|
779
807
|
export type OpenAiResponsesOutputItem = JsonObject | OpenAiFunctionCall | OpenAiOutputMessage | OpenAiReasoningOutputItem;
|
|
780
808
|
export interface OpenAiResponsesReasoningParam {
|
|
781
|
-
effort?:
|
|
809
|
+
effort?: string;
|
|
782
810
|
generate_summary?: OpenAiReasoningSummary;
|
|
783
811
|
summary?: OpenAiReasoningSummary;
|
|
784
812
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BashExecutionTarget, ToolExecutionContext } from "../shared/types.ts";
|
|
1
2
|
import type { BackgroundProcessRegistry } from "./background-process-registry.ts";
|
|
2
3
|
export interface BashToolInput {
|
|
3
4
|
command: string;
|
|
@@ -18,16 +19,19 @@ export interface BashToolOptions {
|
|
|
18
19
|
shellPath?: string;
|
|
19
20
|
stripAnsi?: boolean;
|
|
20
21
|
scrubEnvKeys?: readonly string[];
|
|
22
|
+
scrubEnvPrefixes?: readonly string[];
|
|
21
23
|
backgroundRegistry?: BackgroundProcessRegistry;
|
|
24
|
+
verifyExecution?: (target: BashExecutionTarget, authorization: unknown, ctx: ToolExecutionContext) => Promise<void> | void;
|
|
22
25
|
}
|
|
26
|
+
export declare function resolveBashExecutionTarget(input: Pick<BashToolInput, "command" | "cwd" | "runInBackground">, options?: Pick<BashToolOptions, "allowedDirs" | "defaultCwd" | "shellPath">): BashExecutionTarget;
|
|
23
27
|
export declare function createBashTool(options?: BashToolOptions): import("../shared/types.ts").ToolDefinition<{
|
|
24
28
|
description: string;
|
|
25
29
|
command: string;
|
|
26
30
|
timeoutMs?: number | undefined;
|
|
27
31
|
cwd?: string | undefined;
|
|
32
|
+
runInBackground?: boolean | undefined;
|
|
28
33
|
ignoreOutput?: boolean | undefined;
|
|
29
34
|
outputRegex?: string | undefined;
|
|
30
|
-
runInBackground?: boolean | undefined;
|
|
31
35
|
}, string, import("../shared/types.ts").ToolOutputEnvelope, {
|
|
32
36
|
type: "object";
|
|
33
37
|
properties: {
|
|
@@ -62,9 +66,9 @@ export declare function createShellExecTool(options?: BashToolOptions): import("
|
|
|
62
66
|
command: string;
|
|
63
67
|
timeoutMs?: number | undefined;
|
|
64
68
|
cwd?: string | undefined;
|
|
69
|
+
runInBackground?: boolean | undefined;
|
|
65
70
|
ignoreOutput?: boolean | undefined;
|
|
66
71
|
outputRegex?: string | undefined;
|
|
67
|
-
runInBackground?: boolean | undefined;
|
|
68
72
|
}, string, import("../shared/types.ts").ToolOutputEnvelope, {
|
|
69
73
|
type: "object";
|
|
70
74
|
properties: {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -13,7 +13,10 @@ export * from "./internal-tool-runtime.ts";
|
|
|
13
13
|
export * from "./kill-shell-tool.ts";
|
|
14
14
|
export * from "./ls-tool.ts";
|
|
15
15
|
export * from "./lsp-tool.ts";
|
|
16
|
+
export * from "./mcp-connection-generation.ts";
|
|
16
17
|
export * from "./mcp-oauth-provider.ts";
|
|
18
|
+
export * from "./mcp-safe-error.ts";
|
|
19
|
+
export { extractOwnedMcpSafeError } from "./mcp-safe-error-provenance.ts";
|
|
17
20
|
export * from "./mcp-server-manager.ts";
|
|
18
21
|
export * from "./mcp-tool-adapter.ts";
|
|
19
22
|
export * from "./mock-tool-runtime.ts";
|