@nuvin/nuvin-core 1.10.0 → 1.11.1
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/index.d.ts +31 -67
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/VERSION
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -230,7 +230,7 @@ type FileNewArgs = {
|
|
|
230
230
|
content: string;
|
|
231
231
|
description?: string;
|
|
232
232
|
};
|
|
233
|
-
type
|
|
233
|
+
type LsArgs = {
|
|
234
234
|
path?: string;
|
|
235
235
|
limit?: number;
|
|
236
236
|
description?: string;
|
|
@@ -278,7 +278,7 @@ type AssignTaskArgs = {
|
|
|
278
278
|
task: string;
|
|
279
279
|
description: string;
|
|
280
280
|
};
|
|
281
|
-
type ToolArguments = BashToolArgs | FileReadArgs | FileEditArgs | FileNewArgs |
|
|
281
|
+
type ToolArguments = BashToolArgs | FileReadArgs | FileEditArgs | FileNewArgs | LsArgs | GlobArgs | GrepArgs | WebSearchArgs | WebFetchArgs | TodoWriteArgs | AssignTaskArgs;
|
|
282
282
|
/**
|
|
283
283
|
* Type guard to safely parse tool arguments
|
|
284
284
|
*/
|
|
@@ -296,13 +296,13 @@ declare function isWebSearchArgs(args: ToolArguments): args is WebSearchArgs;
|
|
|
296
296
|
declare function isWebFetchArgs(args: ToolArguments): args is WebFetchArgs;
|
|
297
297
|
declare function isGlobArgs(args: ToolArguments): args is GlobArgs;
|
|
298
298
|
declare function isGrepArgs(args: ToolArguments): args is GrepArgs;
|
|
299
|
-
declare function
|
|
299
|
+
declare function isLsArgs(args: ToolArguments): args is LsArgs;
|
|
300
300
|
type ToolParameterMap = {
|
|
301
301
|
bash_tool: BashToolArgs;
|
|
302
302
|
file_read: FileReadArgs;
|
|
303
303
|
file_edit: FileEditArgs;
|
|
304
304
|
file_new: FileNewArgs;
|
|
305
|
-
|
|
305
|
+
ls_tool: LsArgs;
|
|
306
306
|
glob: GlobArgs;
|
|
307
307
|
grep: GrepArgs;
|
|
308
308
|
web_search: WebSearchArgs;
|
|
@@ -391,7 +391,7 @@ type FileNewMetadata = {
|
|
|
391
391
|
created: string;
|
|
392
392
|
overwritten?: boolean;
|
|
393
393
|
};
|
|
394
|
-
type
|
|
394
|
+
type LsMetadata = {
|
|
395
395
|
limit: number;
|
|
396
396
|
includeHidden: boolean;
|
|
397
397
|
};
|
|
@@ -457,7 +457,7 @@ type ToolMetadataMap = {
|
|
|
457
457
|
file_read: FileReadMetadata;
|
|
458
458
|
file_edit: FileEditMetadata;
|
|
459
459
|
file_new: FileNewMetadata;
|
|
460
|
-
|
|
460
|
+
ls_tool: LsMetadata;
|
|
461
461
|
glob: GlobToolMetadata;
|
|
462
462
|
grep: GrepToolMetadata;
|
|
463
463
|
web_search: WebSearchMetadata;
|
|
@@ -660,8 +660,8 @@ type ToolInvocation = {
|
|
|
660
660
|
editInstruction?: string;
|
|
661
661
|
} | {
|
|
662
662
|
id: string;
|
|
663
|
-
name: '
|
|
664
|
-
parameters:
|
|
663
|
+
name: 'ls_tool';
|
|
664
|
+
parameters: LsArgs;
|
|
665
665
|
editInstruction?: string;
|
|
666
666
|
} | {
|
|
667
667
|
id: string;
|
|
@@ -736,11 +736,11 @@ type ToolExecutionResult = {
|
|
|
736
736
|
durationMs?: number;
|
|
737
737
|
} | {
|
|
738
738
|
id: string;
|
|
739
|
-
name: '
|
|
739
|
+
name: 'ls_tool';
|
|
740
740
|
status: 'success';
|
|
741
741
|
type: 'text';
|
|
742
742
|
result: string;
|
|
743
|
-
metadata?:
|
|
743
|
+
metadata?: LsMetadata;
|
|
744
744
|
durationMs?: number;
|
|
745
745
|
} | {
|
|
746
746
|
id: string;
|
|
@@ -1738,7 +1738,7 @@ type FileNewSuccessResult$1 = {
|
|
|
1738
1738
|
};
|
|
1739
1739
|
type FileNewResult = FileNewSuccessResult$1 | ExecResultError;
|
|
1740
1740
|
|
|
1741
|
-
type
|
|
1741
|
+
type LsParams = {
|
|
1742
1742
|
path?: string;
|
|
1743
1743
|
limit?: number;
|
|
1744
1744
|
};
|
|
@@ -1750,18 +1750,13 @@ type DirEntry = {
|
|
|
1750
1750
|
mode?: number;
|
|
1751
1751
|
lineCount?: number;
|
|
1752
1752
|
};
|
|
1753
|
-
type
|
|
1753
|
+
type LsSuccessResult$1 = {
|
|
1754
1754
|
status: 'success';
|
|
1755
|
-
type: '
|
|
1756
|
-
result:
|
|
1757
|
-
|
|
1758
|
-
entries: DirEntry[];
|
|
1759
|
-
truncated: boolean;
|
|
1760
|
-
total: number;
|
|
1761
|
-
};
|
|
1762
|
-
metadata?: DirLsMetadata;
|
|
1755
|
+
type: 'text';
|
|
1756
|
+
result: string;
|
|
1757
|
+
metadata?: LsMetadata;
|
|
1763
1758
|
};
|
|
1764
|
-
type
|
|
1759
|
+
type LsResult = LsSuccessResult$1 | ExecResultError;
|
|
1765
1760
|
|
|
1766
1761
|
type GlobParams = {
|
|
1767
1762
|
pattern: string;
|
|
@@ -1905,7 +1900,7 @@ type BashSuccessResult = WithToolExecutionFields<BashSuccessResult$1>;
|
|
|
1905
1900
|
type FileReadSuccessResult = WithToolExecutionFields<FileReadSuccessResult$1>;
|
|
1906
1901
|
type FileEditSuccessResult = WithToolExecutionFields<FileEditSuccessResult$1>;
|
|
1907
1902
|
type FileNewSuccessResult = WithToolExecutionFields<FileNewSuccessResult$1>;
|
|
1908
|
-
type
|
|
1903
|
+
type LsSuccessResult = WithToolExecutionFields<LsSuccessResult$1>;
|
|
1909
1904
|
type GlobSuccessResult = WithToolExecutionFields<GlobSuccessResult$1>;
|
|
1910
1905
|
type GrepSuccessResult = WithToolExecutionFields<GrepSuccessResult$1>;
|
|
1911
1906
|
type WebSearchSuccessResult = WithToolExecutionFields<WebSearchSuccessResult$1>;
|
|
@@ -1920,8 +1915,8 @@ declare function isFileEditResult(result: ToolExecutionResult): result is ToolEx
|
|
|
1920
1915
|
declare function isFileEditSuccess(result: ToolExecutionResult): result is FileEditSuccessResult;
|
|
1921
1916
|
declare function isFileNewResult(result: ToolExecutionResult): result is ToolExecutionResult;
|
|
1922
1917
|
declare function isFileNewSuccess(result: ToolExecutionResult): result is FileNewSuccessResult;
|
|
1923
|
-
declare function
|
|
1924
|
-
declare function
|
|
1918
|
+
declare function isLsToolResult(result: ToolExecutionResult): result is ToolExecutionResult;
|
|
1919
|
+
declare function isLsToolSuccess(result: ToolExecutionResult): result is LsSuccessResult;
|
|
1925
1920
|
declare function isGlobResult(result: ToolExecutionResult): result is ToolExecutionResult;
|
|
1926
1921
|
declare function isGlobSuccess(result: ToolExecutionResult): result is GlobSuccessResult;
|
|
1927
1922
|
declare function isGrepResult(result: ToolExecutionResult): result is ToolExecutionResult;
|
|
@@ -2035,17 +2030,6 @@ type SubAgentState = {
|
|
|
2035
2030
|
*/
|
|
2036
2031
|
declare function parseSubAgentToolCallArguments(argsString?: string): Record<string, unknown>;
|
|
2037
2032
|
|
|
2038
|
-
type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
|
2039
|
-
type LogFormat = 'json' | 'structured';
|
|
2040
|
-
type PersistOptions = {
|
|
2041
|
-
persistFile?: string;
|
|
2042
|
-
logLevel?: LogLevel;
|
|
2043
|
-
logFormat?: LogFormat;
|
|
2044
|
-
maxFileSize?: number;
|
|
2045
|
-
enableConsoleLog?: boolean;
|
|
2046
|
-
captureResponseBody?: boolean;
|
|
2047
|
-
};
|
|
2048
|
-
|
|
2049
2033
|
type HttpHeaders = Record<string, string>;
|
|
2050
2034
|
interface TransportResponse {
|
|
2051
2035
|
ok: boolean;
|
|
@@ -2057,36 +2041,6 @@ interface HttpTransport {
|
|
|
2057
2041
|
get(url: string, headers?: HttpHeaders, signal?: AbortSignal): Promise<TransportResponse>;
|
|
2058
2042
|
post(url: string, body: unknown, headers?: HttpHeaders, signal?: AbortSignal): Promise<Response>;
|
|
2059
2043
|
}
|
|
2060
|
-
declare class FetchTransport implements HttpTransport {
|
|
2061
|
-
private opts;
|
|
2062
|
-
private logger;
|
|
2063
|
-
constructor(opts?: PersistOptions);
|
|
2064
|
-
private getResponseSize;
|
|
2065
|
-
private headersToRecord;
|
|
2066
|
-
post(url: string, body: unknown, headers?: HttpHeaders, signal?: AbortSignal): Promise<Response>;
|
|
2067
|
-
get(url: string, headers?: HttpHeaders, signal?: AbortSignal): Promise<TransportResponse>;
|
|
2068
|
-
}
|
|
2069
|
-
|
|
2070
|
-
declare class GithubAuthTransport implements HttpTransport {
|
|
2071
|
-
private apiKey?;
|
|
2072
|
-
private accessToken?;
|
|
2073
|
-
private dynamicApiUrl?;
|
|
2074
|
-
private readonly baseUrl;
|
|
2075
|
-
private readonly inner;
|
|
2076
|
-
constructor(inner: FetchTransport, opts: {
|
|
2077
|
-
apiKey?: string;
|
|
2078
|
-
accessToken?: string;
|
|
2079
|
-
baseUrl?: string;
|
|
2080
|
-
});
|
|
2081
|
-
private exchangeToken;
|
|
2082
|
-
private buildFullUrl;
|
|
2083
|
-
private hasVisionPayload;
|
|
2084
|
-
private makeAuthHeaders;
|
|
2085
|
-
private determineInitiator;
|
|
2086
|
-
private generateRequestId;
|
|
2087
|
-
post(url: string, body: unknown, headers?: HttpHeaders, signal?: AbortSignal): Promise<Response>;
|
|
2088
|
-
get(url: string, headers?: HttpHeaders, signal?: AbortSignal): Promise<TransportResponse>;
|
|
2089
|
-
}
|
|
2090
2044
|
|
|
2091
2045
|
interface RetryConfig {
|
|
2092
2046
|
maxRetries: number;
|
|
@@ -2116,6 +2070,15 @@ declare class RetryTransport implements HttpTransport {
|
|
|
2116
2070
|
declare function isRetryableStatusCode(status: number, retryableStatusCodes?: number[]): boolean;
|
|
2117
2071
|
declare function isRetryableError(error: unknown, retryableStatusCodes?: number[]): boolean;
|
|
2118
2072
|
|
|
2073
|
+
declare class LLMErrorTransport implements HttpTransport {
|
|
2074
|
+
private inner;
|
|
2075
|
+
constructor(inner: HttpTransport);
|
|
2076
|
+
get(url: string, headers?: HttpHeaders, signal?: AbortSignal): Promise<TransportResponse>;
|
|
2077
|
+
post(url: string, body: unknown, headers?: HttpHeaders, signal?: AbortSignal): Promise<Response>;
|
|
2078
|
+
private throwLLMError;
|
|
2079
|
+
private handleError;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2119
2082
|
interface BaseLLMOptions {
|
|
2120
2083
|
enablePromptCaching?: boolean;
|
|
2121
2084
|
retry?: Partial<RetryConfig>;
|
|
@@ -2134,6 +2097,7 @@ declare abstract class BaseLLM implements LLMPort {
|
|
|
2134
2097
|
protected abstract createTransport(): HttpTransport;
|
|
2135
2098
|
protected transformUsage(rawUsage: unknown): UsageData | undefined;
|
|
2136
2099
|
protected getTransport(): HttpTransport;
|
|
2100
|
+
protected throwResponseError(statusCode: number, message: string): never;
|
|
2137
2101
|
protected applyCacheControl(params: CompletionParams): CompletionParams;
|
|
2138
2102
|
generateCompletion(params: CompletionParams, signal?: AbortSignal): Promise<CompletionResult>;
|
|
2139
2103
|
streamCompletion(params: CompletionParams, handlers?: {
|
|
@@ -2171,7 +2135,7 @@ type GithubOptions = {
|
|
|
2171
2135
|
declare class GithubLLM extends BaseLLM implements LLMPort {
|
|
2172
2136
|
private readonly opts;
|
|
2173
2137
|
constructor(opts?: GithubOptions);
|
|
2174
|
-
protected createTransport():
|
|
2138
|
+
protected createTransport(): LLMErrorTransport;
|
|
2175
2139
|
protected transformUsage(rawUsage: unknown): UsageData | undefined;
|
|
2176
2140
|
getModels(signal?: AbortSignal): Promise<ModelInfo[]>;
|
|
2177
2141
|
private handleError;
|
|
@@ -2347,4 +2311,4 @@ declare function resolveBackspaces(s: string): string;
|
|
|
2347
2311
|
declare function stripAnsiAndControls(s: string): string;
|
|
2348
2312
|
declare function canonicalizeTerminalPaste(raw: string): string;
|
|
2349
2313
|
|
|
2350
|
-
export { AGENT_CREATOR_SYSTEM_PROMPT, AbortError, type AgentAwareToolPort, type AgentCatalog, type AgentConfig, type AgentEvent, AgentEventTypes, AgentFilePersistence, AgentManager, AgentManagerCommandRunner, AgentOrchestrator, AgentRegistry, type AgentTemplate, AnthropicAISDKLLM, type AssignErrorResult, type AssignParams, type AssignResult, type AssignSuccessResult$1 as AssignSuccessResult, type AssignTaskArgs, type AssignTaskMetadata, type BaseLLMOptions, type BashErrorResult, type BashParams, type BashResult, type BashSuccessResult$1 as BashSuccessResult, BashTool, type BashToolArgs, type BashToolMetadata, CommandFilePersistence, type CommandMetadata, type CommandSource, type CompleteAgent, type CompleteCustomCommand, CompositeToolPort, type Conversation, ConversationContext, type ConversationMetadata, type ConversationSnapshot, ConversationStore, CoreMCPClient, type CustomCommandFrontmatter, type CustomCommandTemplate, DEFAULT_RETRY_CONFIG, DefaultDelegationPolicy, DefaultDelegationResultFormatter, DefaultDelegationService, DefaultSpecialistAgentFactory, type DelegationMetadata, type DelegationService, type DelegationServiceConfig, DelegationServiceFactory, type DirEntry, type
|
|
2314
|
+
export { AGENT_CREATOR_SYSTEM_PROMPT, AbortError, type AgentAwareToolPort, type AgentCatalog, type AgentConfig, type AgentEvent, AgentEventTypes, AgentFilePersistence, AgentManager, AgentManagerCommandRunner, AgentOrchestrator, AgentRegistry, type AgentTemplate, AnthropicAISDKLLM, type AssignErrorResult, type AssignParams, type AssignResult, type AssignSuccessResult$1 as AssignSuccessResult, type AssignTaskArgs, type AssignTaskMetadata, type BaseLLMOptions, type BashErrorResult, type BashParams, type BashResult, type BashSuccessResult$1 as BashSuccessResult, BashTool, type BashToolArgs, type BashToolMetadata, CommandFilePersistence, type CommandMetadata, type CommandSource, type CompleteAgent, type CompleteCustomCommand, CompositeToolPort, type Conversation, ConversationContext, type ConversationMetadata, type ConversationSnapshot, ConversationStore, CoreMCPClient, type CustomCommandFrontmatter, type CustomCommandTemplate, DEFAULT_RETRY_CONFIG, DefaultDelegationPolicy, DefaultDelegationResultFormatter, DefaultDelegationService, DefaultSpecialistAgentFactory, type DelegationMetadata, type DelegationService, type DelegationServiceConfig, DelegationServiceFactory, type DirEntry, type ErrorMetadata, ErrorReason, type ExecResult, type ExecResultError, type ExecResultSuccess, type FileEditArgs, type FileEditMetadata, type FileEditResult, type FileEditSuccessResult$1 as FileEditSuccessResult, type FileMetadata, type FileNewArgs, type FileNewMetadata, type FileNewParams, type FileNewResult, type FileNewSuccessResult$1 as FileNewSuccessResult, type FileReadArgs, type FileReadErrorResult, type FileReadMetadata, type FileReadParams, type FileReadResult, type FileReadSuccessResult$1 as FileReadSuccessResult, type FolderTreeOptions, type FunctionTool, GithubLLM, type GlobArgs, type GlobParams, type GlobResult, type GlobSuccessResult$1 as GlobSuccessResult, type GlobToolMetadata, type GrepArgs, type GrepParams, type GrepResult, type GrepSuccessResult$1 as GrepSuccessResult, type GrepToolMetadata, InMemoryMemory, InMemoryMetadata, InMemoryMetricsPort, JsonFileMemoryPersistence, type LLMConfig, LLMError, type LLMFactory, type LLMOptions, type LLMPort, LLMResolver, type LineRangeMetadata, type LsArgs, type LsMetadata, type LsParams, type LsResult, type LsSuccessResult$1 as LsSuccessResult, type MCPConfig, type MCPServerConfig, MCPToolPort, type MemoryPort, MemoryPortMetadataAdapter, type Message, type MessageContent, type MessageContentPart, type MetadataPort, type MetricsChangeHandler, type MetricsPort, type MetricsSnapshot, type ModelInfo, type ModelLimits, NoopMetricsPort, NoopReminders, type OrchestratorAwareToolPort, type ParseResult, PersistedMemory, PersistingConsoleEventPort, type RetryConfig, RetryTransport, RuntimeEnv, type SendMessageOptions, SimpleContextBuilder, SimpleCost, SimpleId, type SpecialistAgentConfig, type SpecialistAgentResult, type SubAgentState, type SubAgentToolCall, SystemClock, type TodoWriteArgs, type TodoWriteMetadata, type TodoWriteResult, type TodoWriteSuccessResult$1 as TodoWriteSuccessResult, type ToolApprovalDecision, type ToolArguments, type ToolCall, type ToolCallValidation, type ToolErrorMetadata, type ToolExecutionContext, type ToolExecutionResult, type ToolMetadataMap, type ToolName, type ToolParameterMap, type ToolPort, ToolRegistry, type ToolValidator, type TypedToolInvocation, type UsageData, type UserAttachment, type UserMessagePayload, type ValidationResult, type WebFetchArgs, type WebFetchMetadata, type WebFetchParams, type WebFetchResult, type WebFetchSuccessResult$1 as WebFetchSuccessResult, type WebSearchArgs, type WebSearchMetadata, type WebSearchParams, type WebSearchResult, type WebSearchSuccessResult$1 as WebSearchSuccessResult, type WebSearchToolResult, buildAgentCreationPrompt, buildInjectedSystem, canonicalizeTerminalPaste, convertToolCall, convertToolCalls, createEmptySnapshot, createLLM, deduplicateModels, err, generateFolderTree, getAvailableProviders, getFallbackLimits, getProviderLabel, isAssignResult, isAssignSuccess, isAssignTaskArgs, isBashResult, isBashSuccess, isBashToolArgs, isError, isFileEditArgs, isFileEditResult, isFileEditSuccess, isFileNewArgs, isFileNewResult, isFileNewSuccess, isFileReadArgs, isFileReadResult, isFileReadSuccess, isGlobArgs, isGlobResult, isGlobSuccess, isGrepArgs, isGrepResult, isGrepSuccess, isJsonResult, isLsArgs, isLsToolResult, isLsToolSuccess, isRetryableError, isRetryableStatusCode, isSuccess, isSuccessJson, isSuccessText, isTextResult, isTodoWriteArgs, isTodoWriteResult, isTodoWriteSuccess, isValidCommandId, isWebFetchArgs, isWebFetchResult, isWebFetchSuccess, isWebSearchArgs, isWebSearchResult, isWebSearchSuccess, normalizeModelInfo, normalizeModelLimits, normalizeNewlines, okJson, okText, parseJSON, parseSubAgentToolCallArguments, parseToolArguments, renderTemplate, resolveBackspaces, resolveCarriageReturns, sanitizeCommandId, stripAnsiAndControls, supportsGetModels, toolValidators };
|