@nuvin/nuvin-core 2.0.0 → 2.1.0-rc.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "2.0.0",
3
- "commit": "6b69079"
2
+ "version": "2.1.0-rc.1",
3
+ "commit": "f897e19"
4
4
  }
package/dist/index.d.ts CHANGED
@@ -409,6 +409,8 @@ type FileReadMetadata = FileMetadata & {
409
409
  lineRange?: LineRangeMetadata;
410
410
  encoding?: string;
411
411
  bomStripped?: boolean;
412
+ truncated?: boolean;
413
+ totalLines?: number;
412
414
  };
413
415
  type FileEditMetadata = FileMetadata & {
414
416
  eol: 'lf' | 'crlf';
@@ -1330,6 +1332,7 @@ declare class AgentOrchestrator {
1330
1332
  private memory;
1331
1333
  private hookPort?;
1332
1334
  private sessionId;
1335
+ private sessionDir;
1333
1336
  constructor(cfg: AgentConfig, deps: {
1334
1337
  memory: MemoryPort<Message>;
1335
1338
  tools: ToolPort;
@@ -1405,6 +1408,14 @@ declare class AgentOrchestrator {
1405
1408
  * Gets the current session ID.
1406
1409
  */
1407
1410
  getSessionId(): string;
1411
+ /**
1412
+ * Updates the session directory path.
1413
+ */
1414
+ setSessionDir(dir: string | null): void;
1415
+ /**
1416
+ * Gets the current session directory path.
1417
+ */
1418
+ getSessionDir(): string | null;
1408
1419
  /**
1409
1420
  * Checks if hooks are registered for an event type.
1410
1421
  */
@@ -1833,6 +1844,7 @@ type ToolExecutionContext = {
1833
1844
  conversationId?: string;
1834
1845
  agentId?: string;
1835
1846
  sessionId?: string;
1847
+ sessionDir?: string;
1836
1848
  workspaceDir?: string;
1837
1849
  delegationDepth?: number;
1838
1850
  messageId?: string;
@@ -3268,6 +3280,41 @@ declare function convertToolCallsWithErrorHandling(toolCalls: ToolCall[], option
3268
3280
  availableTools?: Set<string>;
3269
3281
  }): ToolCallConversionResult;
3270
3282
 
3283
+ type SpillOptions = {
3284
+ /** Full output content to write */
3285
+ content: string | Buffer;
3286
+ /** Tool name, e.g. 'bash_tool' */
3287
+ toolName: string;
3288
+ /** Unique tool call ID */
3289
+ toolCallId: string;
3290
+ /** Session directory — if null, falls back to os.tmpdir() */
3291
+ sessionDir?: string | null;
3292
+ };
3293
+ /**
3294
+ * Write tool output to a session-scoped file.
3295
+ *
3296
+ * File is written as `{toolName}_{toolCallId}.log` inside the session
3297
+ * directory (or os.tmpdir() if no session dir is available).
3298
+ *
3299
+ * @returns The absolute path of the written file
3300
+ */
3301
+ declare function spillToolOutput(opts: SpillOptions): string;
3302
+ /**
3303
+ * Open a spill file for incremental writing.
3304
+ *
3305
+ * Returns an object with `write()` to append chunks and `close()` to finalize.
3306
+ * Call `close()` to get the final file path.
3307
+ */
3308
+ declare function openToolOutputSpill(opts: Omit<SpillOptions, 'content'>): ToolOutputSpillHandle;
3309
+ interface ToolOutputSpillHandle {
3310
+ /** Absolute path of the spill file */
3311
+ readonly path: string;
3312
+ /** Append a chunk to the spill file */
3313
+ write(chunk: string | Buffer): void;
3314
+ /** Close the file descriptor */
3315
+ close(): void;
3316
+ }
3317
+
3271
3318
  type FileReadParams = {
3272
3319
  path: string;
3273
3320
  lineStart?: number;
@@ -4266,4 +4313,4 @@ declare function resolveBackspaces(s: string): string;
4266
4313
  declare function stripAnsiAndControls(s: string): string;
4267
4314
  declare function canonicalizeTerminalPaste(raw: string): string;
4268
4315
 
4269
- export { AGENT_CREATOR_SYSTEM_PROMPT, type AXElement, type AXPressResult, type AXSetValueResult, type AXSnapshotResult, AbortError, type AgentAwareToolPort, type AgentCatalog, type AgentConfig, type AgentEvent, AgentEventTypes, AgentFilePersistence, AgentManager, AgentManagerCommandRunner, AgentOrchestrator, AgentRegistry, type AgentSession, type AgentStateManager, type AgentTemplate, type AnnotateResult, AnthropicAISDKLLM, type AskUserArgs, type AskUserMetadata, AskUserTool, type AssignAliasHiddenAgentResolver, type AssignAliasTask, AssignAliasTool, type AssignAliasToolOptions, type AssignErrorResult, type AssignParams, type AssignResult, type AssignSuccessResult$1 as AssignSuccessResult, type AssignTaskArgs, type AssignTaskMetadata, type AuthFlowResult, type AuthServerMetadata, type BaseLLMOptions, type BashErrorResult, type BashParams, type BashResult, type BashSuccessResult$1 as BashSuccessResult, BashTool, type BashToolArgs, type BashToolMetadata, CommandFilePersistence, CommandHookExecutor, type CommandMetadata, type CommandSource, type CompleteAgent, type CompleteCustomCommand, CompositeHookPort, CompositeToolPort, type ComputerAction, type ComputerBackend, type ComputerUseArgs, type ComputerUseMetadata, type ComputerUseParams, type ComputerUseResult, ComputerUseTool, type Conversation, ConversationContext, type ConversationMetadata, type ConversationSnapshot, ConversationStore, CoreMCPClient, type CustomCommandFrontmatter, type CustomCommandTemplate, DEFAULT_RETRY_CONFIG, DefaultAgentStateManager, 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, type HookContext, HookDecision, type HookDecisionType, type HookDefinition, type HookEventConfig, type HookEventType, HookEventTypes, type HookPort, HookRegistry, type HookResult, type HooksConfig, InMemoryMemory, InMemoryMetadata, InMemoryMetricsPort, JsonFileMemoryPersistence, JsonFileMemoryStore, 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 LspService, LspTool, type MCPAuthOptions, type MCPCallResult, type MCPConfig, type MCPHttpOptions, MCPOAuthClient, type MCPOAuthConfig, type MCPOptions, type MCPServerConfig, type MCPStdioOptions, type MCPToolCall, MCPToolPort, type MCPToolSchema, type MemoryCandidate, type MemoryEntry, type MemoryEntryInput, type MemoryExtractArgs, type MemoryExtractToolInput, type MemoryExtractToolResult, type MemoryExtractionTaskBuilder, MemoryExtractionTool, MemoryExtractor, type MemoryPort, MemoryPortMetadataAdapter, type MemoryQueryArgs, type MemoryQueryToolHit, type MemoryQueryToolInput, type MemoryQueryToolResult, type MemorySaveToolInput, type MemoryScope, type MemorySearchOptions, type MemorySource, type MemoryStatement, type MemoryStatus, type MemoryStorePort, type MemoryType, 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 ProtectedResourceMetadata, type RetryConfig, RetryTransport, RuntimeEnv, type SendMessageOptions, SimpleContextBuilder, SimpleCost, SimpleId, type SkillErrorResult, type SkillMetadata, type SkillParams, type SkillProvider, type SkillResult, type SkillSuccessResult, SkillTool, type SkillInfo as SkillToolInfo, type SpecialistAgentConfig, type SpecialistAgentResult, type StoredTokens, type SubAgentState, type SubAgentToolCall, SystemClock, type TaskOutputMetadata, type TaskOutputParams, type TaskOutputResult, type TaskOutputSuccessResult, type TodoWriteArgs, type TodoWriteMetadata, type TodoWriteResult, type TodoWriteSuccessResult$1 as TodoWriteSuccessResult, type TokenStorage, type ToolApprovalDecision, type ToolArguments, type ToolCall, type ToolCallConversionResult, 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 ValidationError, 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, assignTaskSchema, bashToolSchema, buildAISDKToolResultOutput, buildAgentCreationPrompt, buildInjectedSystem, canonicalizeTerminalPaste, computerToolSchema, convertToolCall, convertToolCalls, convertToolCallsWithErrorHandling, createEmptySnapshot, createLLM, deduplicateModels, err, fileEditSchema, fileNewSchema, fileReadSchema, formatMemoriesForPrompt, generateFolderTree, getAvailableProviders, getFallbackLimits, getProviderAuthMethods, getProviderDefaultModels, getProviderLabel, globToolSchema, grepToolSchema, isAssignResult, isAssignSuccess, isAssignTaskArgs, isBashResult, isBashSuccess, isBashToolArgs, isComputerResult, isComputerSuccess, isComputerUseArgs, isError, isFileEditArgs, isFileEditResult, isFileEditSuccess, isFileNewArgs, isFileNewResult, isFileNewSuccess, isFileReadArgs, isFileReadResult, isFileReadSuccess, isGlobArgs, isGlobResult, isGlobSuccess, isGrepArgs, isGrepResult, isGrepSuccess, isInsufficientScopeError, isJsonResult, isLsArgs, isLsToolResult, isLsToolSuccess, isMemoryExtractArgs, isMemoryQueryArgs, isRetryableError, isRetryableStatusCode, isSuccess, isSuccessJson, isSuccessText, isTextResult, isTodoWriteArgs, isTodoWriteResult, isTodoWriteSuccess, isUnauthorizedError, isValidCommandId, isWebFetchArgs, isWebFetchResult, isWebFetchSuccess, isWebSearchArgs, isWebSearchResult, isWebSearchSuccess, loadHooksFromFrontmatter, lsToolSchema, memoryExtractSchema, memoryQuerySchema, memoryQueryToolDefinition, memorySaveToolDefinition, mergeAgentConfig, normalizeModelInfo, normalizeModelLimits, normalizeNewlines, okJson, okText, parseJSON, parseSubAgentToolCallArguments, parseToolArguments, parseWWWAuthenticate, rankMemories, renderTemplate, resolveBackspaces, resolveCarriageReturns, safeParseToolArguments, sanitizeCommandId, stripAnsiAndControls, supportsGetModels, todoWriteSchema, toolSchemas, toolValidators, validateToolParams, webFetchSchema, webSearchSchema };
4316
+ export { AGENT_CREATOR_SYSTEM_PROMPT, type AXElement, type AXPressResult, type AXSetValueResult, type AXSnapshotResult, AbortError, type AgentAwareToolPort, type AgentCatalog, type AgentConfig, type AgentEvent, AgentEventTypes, AgentFilePersistence, AgentManager, AgentManagerCommandRunner, AgentOrchestrator, AgentRegistry, type AgentSession, type AgentStateManager, type AgentTemplate, type AnnotateResult, AnthropicAISDKLLM, type AskUserArgs, type AskUserMetadata, AskUserTool, type AssignAliasHiddenAgentResolver, type AssignAliasTask, AssignAliasTool, type AssignAliasToolOptions, type AssignErrorResult, type AssignParams, type AssignResult, type AssignSuccessResult$1 as AssignSuccessResult, type AssignTaskArgs, type AssignTaskMetadata, type AuthFlowResult, type AuthServerMetadata, type BaseLLMOptions, type BashErrorResult, type BashParams, type BashResult, type BashSuccessResult$1 as BashSuccessResult, BashTool, type BashToolArgs, type BashToolMetadata, CommandFilePersistence, CommandHookExecutor, type CommandMetadata, type CommandSource, type CompleteAgent, type CompleteCustomCommand, CompositeHookPort, CompositeToolPort, type ComputerAction, type ComputerBackend, type ComputerUseArgs, type ComputerUseMetadata, type ComputerUseParams, type ComputerUseResult, ComputerUseTool, type Conversation, ConversationContext, type ConversationMetadata, type ConversationSnapshot, ConversationStore, CoreMCPClient, type CustomCommandFrontmatter, type CustomCommandTemplate, DEFAULT_RETRY_CONFIG, DefaultAgentStateManager, 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, type HookContext, HookDecision, type HookDecisionType, type HookDefinition, type HookEventConfig, type HookEventType, HookEventTypes, type HookPort, HookRegistry, type HookResult, type HooksConfig, InMemoryMemory, InMemoryMetadata, InMemoryMetricsPort, JsonFileMemoryPersistence, JsonFileMemoryStore, 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 LspService, LspTool, type MCPAuthOptions, type MCPCallResult, type MCPConfig, type MCPHttpOptions, MCPOAuthClient, type MCPOAuthConfig, type MCPOptions, type MCPServerConfig, type MCPStdioOptions, type MCPToolCall, MCPToolPort, type MCPToolSchema, type MemoryCandidate, type MemoryEntry, type MemoryEntryInput, type MemoryExtractArgs, type MemoryExtractToolInput, type MemoryExtractToolResult, type MemoryExtractionTaskBuilder, MemoryExtractionTool, MemoryExtractor, type MemoryPort, MemoryPortMetadataAdapter, type MemoryQueryArgs, type MemoryQueryToolHit, type MemoryQueryToolInput, type MemoryQueryToolResult, type MemorySaveToolInput, type MemoryScope, type MemorySearchOptions, type MemorySource, type MemoryStatement, type MemoryStatus, type MemoryStorePort, type MemoryType, 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 ProtectedResourceMetadata, type RetryConfig, RetryTransport, RuntimeEnv, type SendMessageOptions, SimpleContextBuilder, SimpleCost, SimpleId, type SkillErrorResult, type SkillMetadata, type SkillParams, type SkillProvider, type SkillResult, type SkillSuccessResult, SkillTool, type SkillInfo as SkillToolInfo, type SpecialistAgentConfig, type SpecialistAgentResult, type SpillOptions, type StoredTokens, type SubAgentState, type SubAgentToolCall, SystemClock, type TaskOutputMetadata, type TaskOutputParams, type TaskOutputResult, type TaskOutputSuccessResult, type TodoWriteArgs, type TodoWriteMetadata, type TodoWriteResult, type TodoWriteSuccessResult$1 as TodoWriteSuccessResult, type TokenStorage, type ToolApprovalDecision, type ToolArguments, type ToolCall, type ToolCallConversionResult, type ToolCallValidation, type ToolErrorMetadata, type ToolExecutionContext, type ToolExecutionResult, type ToolMetadataMap, type ToolName, type ToolOutputSpillHandle, type ToolParameterMap, type ToolPort, ToolRegistry, type ToolValidator, type TypedToolInvocation, type UsageData, type UserAttachment, type UserMessagePayload, type ValidationError, 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, assignTaskSchema, bashToolSchema, buildAISDKToolResultOutput, buildAgentCreationPrompt, buildInjectedSystem, canonicalizeTerminalPaste, computerToolSchema, convertToolCall, convertToolCalls, convertToolCallsWithErrorHandling, createEmptySnapshot, createLLM, deduplicateModels, err, fileEditSchema, fileNewSchema, fileReadSchema, formatMemoriesForPrompt, generateFolderTree, getAvailableProviders, getFallbackLimits, getProviderAuthMethods, getProviderDefaultModels, getProviderLabel, globToolSchema, grepToolSchema, isAssignResult, isAssignSuccess, isAssignTaskArgs, isBashResult, isBashSuccess, isBashToolArgs, isComputerResult, isComputerSuccess, isComputerUseArgs, isError, isFileEditArgs, isFileEditResult, isFileEditSuccess, isFileNewArgs, isFileNewResult, isFileNewSuccess, isFileReadArgs, isFileReadResult, isFileReadSuccess, isGlobArgs, isGlobResult, isGlobSuccess, isGrepArgs, isGrepResult, isGrepSuccess, isInsufficientScopeError, isJsonResult, isLsArgs, isLsToolResult, isLsToolSuccess, isMemoryExtractArgs, isMemoryQueryArgs, isRetryableError, isRetryableStatusCode, isSuccess, isSuccessJson, isSuccessText, isTextResult, isTodoWriteArgs, isTodoWriteResult, isTodoWriteSuccess, isUnauthorizedError, isValidCommandId, isWebFetchArgs, isWebFetchResult, isWebFetchSuccess, isWebSearchArgs, isWebSearchResult, isWebSearchSuccess, loadHooksFromFrontmatter, lsToolSchema, memoryExtractSchema, memoryQuerySchema, memoryQueryToolDefinition, memorySaveToolDefinition, mergeAgentConfig, normalizeModelInfo, normalizeModelLimits, normalizeNewlines, okJson, okText, openToolOutputSpill, parseJSON, parseSubAgentToolCallArguments, parseToolArguments, parseWWWAuthenticate, rankMemories, renderTemplate, resolveBackspaces, resolveCarriageReturns, safeParseToolArguments, sanitizeCommandId, spillToolOutput, stripAnsiAndControls, supportsGetModels, todoWriteSchema, toolSchemas, toolValidators, validateToolParams, webFetchSchema, webSearchSchema };