@nuvin/agent-core 0.0.0-rc.18 → 0.0.0-rc.19

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.
Files changed (87) hide show
  1. package/dist/VERSION +2 -2
  2. package/dist/agent/agent.d.ts +28 -0
  3. package/dist/agent/context-compactor.d.ts +8 -0
  4. package/dist/agent/extension-registry.d.ts +3 -0
  5. package/dist/agent/index.d.ts +8 -101
  6. package/dist/agent/index.js +1 -1
  7. package/dist/agent/messages-to-text.d.ts +3 -0
  8. package/dist/agent/metrics.d.ts +30 -0
  9. package/dist/agent/topic-reminder-extension.d.ts +32 -0
  10. package/dist/agent/turn-engine.d.ts +3 -0
  11. package/dist/chunk-FFIZ6TKW.js +1 -1
  12. package/dist/chunk-HRU363DY.js +1 -1
  13. package/dist/chunk-NHBKADBW.js +1 -1
  14. package/dist/chunk-NYZR4XKO.js +1 -1
  15. package/dist/chunk-QDOE7NWO.js +1 -1
  16. package/dist/chunk-X7VAACWY.js +1 -1
  17. package/dist/formats/base64-image-content.d.ts +4 -0
  18. package/dist/formats/index.d.ts +4 -39
  19. package/dist/formats/index.js +1 -1
  20. package/dist/formats/message-format.d.ts +33 -0
  21. package/dist/formats/provider-adapters.d.ts +3 -0
  22. package/dist/hooks/executor.d.ts +3 -0
  23. package/dist/hooks/extensions.d.ts +28 -0
  24. package/dist/hooks/index.d.ts +7 -76
  25. package/dist/hooks/index.js +1 -1
  26. package/dist/hooks/registry.d.ts +8 -0
  27. package/dist/hooks/types.d.ts +40 -0
  28. package/dist/lsp/client.d.ts +11 -0
  29. package/dist/lsp/index.d.ts +24 -0
  30. package/dist/lsp/installer.d.ts +11 -0
  31. package/dist/lsp/language.d.ts +2 -0
  32. package/dist/lsp/server.d.ts +6 -0
  33. package/dist/lsp/types.d.ts +68 -0
  34. package/dist/models/anthropic-model.d.ts +27 -0
  35. package/dist/models/anthropic-surface.d.ts +5 -0
  36. package/dist/models/chat-model.d.ts +31 -0
  37. package/dist/models/github-model.d.ts +32 -0
  38. package/dist/models/http-transport.d.ts +10 -0
  39. package/dist/models/index.d.ts +16 -439
  40. package/dist/models/index.js +1 -1
  41. package/dist/models/mock-model.d.ts +15 -0
  42. package/dist/models/model-errors.d.ts +16 -0
  43. package/dist/models/model-limits.d.ts +7 -0
  44. package/dist/models/model-registry.d.ts +44 -0
  45. package/dist/models/model-surface-router.d.ts +19 -0
  46. package/dist/models/model-transports.d.ts +17 -0
  47. package/dist/models/openai-model.d.ts +60 -0
  48. package/dist/models/openai-surfaces.d.ts +74 -0
  49. package/dist/models/provider-adapter.d.ts +23 -0
  50. package/dist/models/provider-session.d.ts +16 -0
  51. package/dist/models/routed-model.d.ts +90 -0
  52. package/dist/shared/abort.d.ts +9 -0
  53. package/dist/shared/index.d.ts +5 -22
  54. package/dist/shared/index.js +1 -1
  55. package/dist/shared/reasoning-config.d.ts +5 -0
  56. package/dist/shared/turn-failed.d.ts +6 -0
  57. package/dist/{types-11Znykt2.d.ts → shared/types.d.ts} +163 -163
  58. package/dist/tools/ask-user-tool.d.ts +55 -0
  59. package/dist/tools/bash-tool.d.ts +63 -0
  60. package/dist/tools/command-tool.d.ts +23 -0
  61. package/dist/tools/file-edit-tool.d.ts +29 -0
  62. package/dist/tools/file-new-tool.d.ts +21 -0
  63. package/dist/tools/file-read-tool.d.ts +27 -0
  64. package/dist/tools/glob-tool.d.ts +26 -0
  65. package/dist/tools/grep-tool.d.ts +34 -0
  66. package/dist/tools/index.d.ts +28 -810
  67. package/dist/tools/index.js +1 -1
  68. package/dist/tools/internal-tool-runtime.d.ts +8 -0
  69. package/dist/tools/ls-tool.d.ts +20 -0
  70. package/dist/tools/lsp-tool.d.ts +36 -0
  71. package/dist/tools/mcp-oauth-provider.d.ts +11 -0
  72. package/dist/tools/mcp-server-manager.d.ts +43 -0
  73. package/dist/tools/mcp-tool-adapter.d.ts +47 -0
  74. package/dist/tools/mock-tool-runtime.d.ts +3 -0
  75. package/dist/tools/ripgrep.d.ts +20 -0
  76. package/dist/tools/runtime-manager-tools.d.ts +58 -0
  77. package/dist/tools/skill-tool.d.ts +33 -0
  78. package/dist/tools/todo-write-tool.d.ts +66 -0
  79. package/dist/tools/tool-output-offload.d.ts +12 -0
  80. package/dist/tools/tools.d.ts +24 -0
  81. package/dist/tools/update-topic-tool.d.ts +12 -0
  82. package/dist/tools/view-file-tool.d.ts +22 -0
  83. package/dist/tools/web-fetch-tool.d.ts +20 -0
  84. package/dist/tools/web-search-tool.d.ts +72 -0
  85. package/dist/tools/workspace-paths.d.ts +5 -0
  86. package/package.json +2 -2
  87. package/dist/provider-adapters-D1hQNeFc.d.ts +0 -5
@@ -0,0 +1,8 @@
1
+ import type { HooksConfig } from "@nuvin/config";
2
+ import type { HookEventName, ResolvedHook } from "./types.ts";
3
+ export interface HookRegistry {
4
+ getHooks(event: HookEventName, toolName?: string): ResolvedHook[];
5
+ hasHooks(event: HookEventName): boolean;
6
+ }
7
+ export declare function createHookRegistry(config: HooksConfig): HookRegistry;
8
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1,40 @@
1
+ export type { CommandHookConfig, HookMatcherGroup, HooksConfig } from "@nuvin/config";
2
+ export type HookEventName = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "Notification" | "SessionStart" | "SessionEnd";
3
+ export interface ResolvedHook {
4
+ command: string;
5
+ timeout: number;
6
+ }
7
+ /** JSON payload written to hook's stdin. */
8
+ export interface HookInput {
9
+ session_id?: string;
10
+ [key: string]: unknown;
11
+ }
12
+ /** JSON output parsed from hook's stdout. */
13
+ export interface HookOutput {
14
+ /** Approve or block the action. PreToolUse only. */
15
+ decision?: "approve" | "block";
16
+ /** Reason for block. PreToolUse only. */
17
+ reason?: string;
18
+ /**
19
+ * Event-specific outputs. For PreToolUse, this carries `permissionDecision`
20
+ * (Claude Code compat). For all events, this carries `additionalContext`.
21
+ */
22
+ hookSpecificOutput?: {
23
+ /** Echoed event name — not required to parse, but useful for debugging. */
24
+ hookEventName?: string;
25
+ /** Auto-approve/deny/ask the permission. PreToolUse only. */
26
+ permissionDecision?: "allow" | "deny" | "ask";
27
+ /** Reason for the permission decision. */
28
+ permissionDecisionReason?: string;
29
+ /** Inject additional context into the prompt/system. */
30
+ additionalContext?: string;
31
+ };
32
+ }
33
+ /** Internal result from executing a hook command. */
34
+ export interface HookResult {
35
+ status: "pass" | "block" | "error";
36
+ output?: HookOutput;
37
+ error?: string;
38
+ duration_ms: number;
39
+ }
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { Location } from "vscode-languageserver-types";
2
+ import type { LspClientInfo, LspServerHandle, LspServerInfo } from "./types.ts";
3
+ type LocationResponse = Location | Location[] | null | undefined;
4
+ export declare function normalizeLocations(value: LocationResponse): Location[];
5
+ export declare function createLspClient(input: {
6
+ server: LspServerInfo;
7
+ root: string;
8
+ handle: LspServerHandle;
9
+ }): Promise<LspClientInfo>;
10
+ export {};
11
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, Diagnostic, DocumentSymbol, Hover, Location, LspPosition, LspServiceConfig, SymbolInformation } from "./types.ts";
2
+ export type { LspServiceConfig } from "./types.ts";
3
+ export interface LspService {
4
+ isEnabled(): boolean;
5
+ hasClients(file: string): Promise<boolean>;
6
+ touchFile(filePath: string, waitDiagnostics?: boolean): Promise<void>;
7
+ diagnostics(): Promise<Record<string, Diagnostic[]>>;
8
+ diagnosticsForFile(filePath: string): Promise<Diagnostic[]>;
9
+ definition(pos: LspPosition): Promise<Location[]>;
10
+ references(pos: LspPosition): Promise<Location[]>;
11
+ hover(pos: LspPosition): Promise<Hover[]>;
12
+ documentSymbol(filePath: string): Promise<(DocumentSymbol | SymbolInformation)[]>;
13
+ workspaceSymbol(query: string): Promise<SymbolInformation[]>;
14
+ implementation(pos: LspPosition): Promise<Location[]>;
15
+ prepareCallHierarchy(pos: LspPosition): Promise<CallHierarchyItem[]>;
16
+ incomingCalls(pos: LspPosition): Promise<CallHierarchyIncomingCall[]>;
17
+ outgoingCalls(pos: LspPosition): Promise<CallHierarchyOutgoingCall[]>;
18
+ shutdown(): Promise<void>;
19
+ status(): {
20
+ connectedClients: number;
21
+ };
22
+ }
23
+ export declare function createLspService(config?: LspServiceConfig): LspService;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ export declare function shouldDisableLspDownload(env?: NodeJS.ProcessEnv): boolean;
2
+ export declare function getLspPackageDir(packageName: string): string;
3
+ export declare function getLspBinDir(packageName: string): string;
4
+ export declare function findPackageBinary(binaryName: string, startDir: string): Promise<string | undefined>;
5
+ export declare function resolvePackageBinary(input: {
6
+ packageName: string;
7
+ binaryName?: string;
8
+ startDir: string;
9
+ env?: NodeJS.ProcessEnv;
10
+ }): Promise<string | undefined>;
11
+ //# sourceMappingURL=installer.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare function getLanguageId(filePath: string): string | undefined;
2
+ //# sourceMappingURL=language.d.ts.map
@@ -0,0 +1,6 @@
1
+ import type { LspServerInfo } from "./types.ts";
2
+ export declare const TypeScriptServer: LspServerInfo;
3
+ export declare const BiomeServer: LspServerInfo;
4
+ export declare const BUILTIN_LSP_SERVERS: readonly LspServerInfo[];
5
+ export declare function getServersForFile(file: string): LspServerInfo[];
6
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1,68 @@
1
+ import type { ChildProcess } from "node:child_process";
2
+ import type { MessageConnection } from "vscode-jsonrpc";
3
+ import type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, Diagnostic, DocumentSymbol, Hover, Location, SymbolInformation } from "vscode-languageserver-types";
4
+ export type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, Diagnostic, DocumentSymbol, Hover, Location, SymbolInformation, };
5
+ export interface LspPosition {
6
+ file: string;
7
+ line: number;
8
+ character: number;
9
+ }
10
+ export interface LspServerInfo {
11
+ id: string;
12
+ name: string;
13
+ extensions: string[];
14
+ root(file: string): Promise<string | undefined>;
15
+ spawn(root: string): Promise<LspServerHandle | undefined>;
16
+ }
17
+ export interface LspServerHandle {
18
+ process: ChildProcess;
19
+ initialization?: Record<string, unknown>;
20
+ }
21
+ export interface LspServerCapabilities {
22
+ definitionProvider?: boolean;
23
+ referencesProvider?: boolean;
24
+ hoverProvider?: boolean;
25
+ documentSymbolProvider?: boolean;
26
+ workspaceSymbolProvider?: boolean;
27
+ implementationProvider?: boolean;
28
+ callHierarchyProvider?: boolean;
29
+ }
30
+ export interface LspClientInfo {
31
+ serverId: string;
32
+ root: string;
33
+ connection: MessageConnection;
34
+ diagnostics: Map<string, Diagnostic[]>;
35
+ capabilities: LspServerCapabilities;
36
+ notify: {
37
+ open(input: {
38
+ path: string;
39
+ }): Promise<void>;
40
+ change(input: {
41
+ path: string;
42
+ version: number;
43
+ }): Promise<void>;
44
+ close(input: {
45
+ path: string;
46
+ }): Promise<void>;
47
+ };
48
+ request: {
49
+ definition(pos: LspPosition): Promise<Location[]>;
50
+ references(pos: LspPosition): Promise<Location[]>;
51
+ hover(pos: LspPosition): Promise<Hover | null>;
52
+ documentSymbol(filePath: string): Promise<(DocumentSymbol | SymbolInformation)[]>;
53
+ workspaceSymbol(query: string): Promise<SymbolInformation[]>;
54
+ implementation(pos: LspPosition): Promise<Location[]>;
55
+ prepareCallHierarchy(pos: LspPosition): Promise<CallHierarchyItem[]>;
56
+ incomingCalls(item: CallHierarchyItem): Promise<CallHierarchyIncomingCall[]>;
57
+ outgoingCalls(item: CallHierarchyItem): Promise<CallHierarchyOutgoingCall[]>;
58
+ };
59
+ waitForDiagnostics(input: {
60
+ path: string;
61
+ timeoutMs?: number;
62
+ }): Promise<void>;
63
+ shutdown(): Promise<void>;
64
+ }
65
+ export interface LspServiceConfig {
66
+ enabled?: boolean;
67
+ }
68
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,27 @@
1
+ import type { BaseChatModelOptions, ChatRequest, ChatResponse, ChatResponseChunk, ModelExecutionOptions, ProviderCredential } from "../shared/types.ts";
2
+ import type { ProviderRequestMutator, ProviderSessionResolver, ResolvedProviderSession } from "./provider-session.ts";
3
+ import { RoutedModel } from "./routed-model.ts";
4
+ export interface AnthropicModelOptions extends Partial<BaseChatModelOptions> {
5
+ apiKey?: string;
6
+ baseUrl?: string;
7
+ protocolVersion?: string;
8
+ authScheme?: "bearer" | "x-api-key";
9
+ fetch?: typeof globalThis.fetch;
10
+ providerSessionResolver?: ProviderSessionResolver;
11
+ requestMutators?: ProviderRequestMutator[];
12
+ headerResolver?: AnthropicHeaderResolver;
13
+ }
14
+ export interface AnthropicRequestHeadersContext {
15
+ request?: ChatRequest;
16
+ body: unknown;
17
+ credential: ProviderCredential;
18
+ session?: ResolvedProviderSession;
19
+ stream: boolean;
20
+ }
21
+ export type AnthropicHeaderResolver = (context: AnthropicRequestHeadersContext) => Promise<Record<string, string>> | Record<string, string>;
22
+ export declare class AnthropicModel extends RoutedModel {
23
+ constructor(options?: AnthropicModelOptions);
24
+ complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
25
+ stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
26
+ }
27
+ //# sourceMappingURL=anthropic-model.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { RoutedModelSurface } from "./routed-model.ts";
2
+ export declare const ANTHROPIC_MESSAGES_SURFACE = "anthropic-messages";
3
+ export declare const ANTHROPIC_MESSAGES_STREAM_SURFACE = "anthropic-messages-stream";
4
+ export declare function createAnthropicSurfaces(): RoutedModelSurface[];
5
+ //# sourceMappingURL=anthropic-surface.d.ts.map
@@ -0,0 +1,31 @@
1
+ import type { BaseChatModelOptions, ChatRequest, ChatResponse, ChatResponseChunk, EngineChatModel, ModelExecutionOptions } from "../shared/types.ts";
2
+ import type { AnthropicModelOptions } from "./anthropic-model.ts";
3
+ import type { OpenAiHeaderResolver, WebSocketFactory } from "./openai-model.ts";
4
+ import type { ProviderRequestMutator, ProviderSessionResolver } from "./provider-session.ts";
5
+ export declare const AVAILABLE_CHAT_MODEL_SURFACES: readonly ["anthropic-messages", "openai-chat-completions", "openai-responses", "openai-responses-ws"];
6
+ export type ChatModelSurface = (typeof AVAILABLE_CHAT_MODEL_SURFACES)[number];
7
+ export type ChatModelAuthScheme = NonNullable<AnthropicModelOptions["authScheme"]>;
8
+ export interface ChatModelOptions extends Partial<BaseChatModelOptions> {
9
+ apiKey?: string;
10
+ baseUrl?: string;
11
+ surface?: ChatModelSurface;
12
+ authScheme?: ChatModelAuthScheme;
13
+ fetch?: typeof globalThis.fetch;
14
+ providerSessionResolver?: ProviderSessionResolver;
15
+ requestMutators?: ProviderRequestMutator[];
16
+ headerResolver?: OpenAiHeaderResolver;
17
+ webSocketFactory?: WebSocketFactory;
18
+ }
19
+ export declare class ChatModel implements EngineChatModel {
20
+ readonly model: string;
21
+ readonly maxTokens: number;
22
+ readonly surface: ChatModelSurface;
23
+ private readonly anthropicDelegate?;
24
+ private readonly openAiDelegate?;
25
+ constructor(options?: ChatModelOptions);
26
+ private getAnthropicDelegate;
27
+ private getOpenAiDelegate;
28
+ complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
29
+ stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
30
+ }
31
+ //# sourceMappingURL=chat-model.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { BaseChatModelOptions, ChatRequest, ChatResponse, ChatResponseChunk, ModelExecutionOptions, ModelInfo, ProviderSessionResolver } from "../shared/types.ts";
2
+ import { OpenAiModel } from "./openai-model.ts";
3
+ export type GitHubModelSurface = "auto" | "anthropic-messages" | "openai-chat-completions" | "openai-responses" | "openai-responses-ws";
4
+ export interface GitHubModelOptions extends Partial<BaseChatModelOptions> {
5
+ apiKey?: string;
6
+ accessToken?: string;
7
+ baseUrl?: string;
8
+ surface?: GitHubModelSurface;
9
+ githubApiUrl?: string;
10
+ fetch?: typeof globalThis.fetch;
11
+ editorVersion?: string;
12
+ editorPluginVersion?: string;
13
+ tokenExchangeApiVersion?: string;
14
+ providerSessionResolver?: ProviderSessionResolver;
15
+ }
16
+ export declare class GitHubModel extends OpenAiModel {
17
+ private readonly anthropicDelegate;
18
+ private readonly modelEndpointCache;
19
+ private readonly surface;
20
+ constructor(options?: GitHubModelOptions);
21
+ protected createMissingCredentialError(): Error;
22
+ private usesResponsesApi;
23
+ private shouldPreferResponsesApi;
24
+ private markModelAsResponsesOnly;
25
+ protected mapApiError(error: Error): Error;
26
+ private completeViaConfiguredSurface;
27
+ private streamViaConfiguredSurface;
28
+ complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
29
+ stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
30
+ getModels(signal?: AbortSignal): Promise<ModelInfo[]>;
31
+ }
32
+ //# sourceMappingURL=github-model.d.ts.map
@@ -0,0 +1,10 @@
1
+ export interface FetchJsonOptions {
2
+ url: string;
3
+ body: unknown;
4
+ headers: Record<string, string>;
5
+ fetch?: typeof globalThis.fetch;
6
+ signal?: AbortSignal;
7
+ }
8
+ export declare function fetchRawResponse(options: FetchJsonOptions): Promise<Response>;
9
+ export declare function fetchJsonResponse<T>(options: FetchJsonOptions): Promise<T>;
10
+ //# sourceMappingURL=http-transport.d.ts.map