@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 { AnyToolDefinition, ToolRuntime, ToolRuntimeEventHandler, ToolRuntimeToolCallHandler } from "../shared/types.ts";
2
+ interface InternalToolRuntimeOptions {
3
+ onEvent?: ToolRuntimeEventHandler;
4
+ onToolCall?: ToolRuntimeToolCallHandler;
5
+ }
6
+ export declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
7
+ export {};
8
+ //# sourceMappingURL=internal-tool-runtime.d.ts.map
@@ -0,0 +1,20 @@
1
+ export interface LsToolOptions {
2
+ allowedDirs?: readonly string[];
3
+ defaultCwd?: string;
4
+ name?: string;
5
+ }
6
+ export declare function createLsTool(options?: LsToolOptions): import("../shared/types.ts").ToolDefinition<{
7
+ path: string;
8
+ limit: number;
9
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
10
+ type: "object";
11
+ properties: {
12
+ path: {
13
+ type: "string";
14
+ };
15
+ limit: {
16
+ type: "number";
17
+ };
18
+ };
19
+ }>;
20
+ //# sourceMappingURL=ls-tool.d.ts.map
@@ -0,0 +1,36 @@
1
+ import type { LspService } from "../lsp/index.ts";
2
+ export interface LspToolOptions {
3
+ defaultCwd?: string;
4
+ allowedDirs?: readonly string[];
5
+ lspService?: LspService;
6
+ name?: string;
7
+ }
8
+ export declare function createLspTool(options?: LspToolOptions): import("../shared/types.ts").ToolDefinition<{
9
+ filePath: string;
10
+ line: number;
11
+ character: number;
12
+ operation: string;
13
+ query?: string | undefined;
14
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
15
+ type: "object";
16
+ properties: {
17
+ operation: {
18
+ type: "string";
19
+ enum: string[];
20
+ };
21
+ filePath: {
22
+ type: "string";
23
+ };
24
+ line: {
25
+ type: "number";
26
+ };
27
+ character: {
28
+ type: "number";
29
+ };
30
+ query: {
31
+ type: "string";
32
+ };
33
+ };
34
+ required: readonly ["operation", "filePath", "line", "character"];
35
+ }>;
36
+ //# sourceMappingURL=lsp-tool.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
2
+ import type { MCPAuthConfig } from "@nuvin/config";
3
+ export interface McpOAuthProviderOptions {
4
+ serverName: string;
5
+ callbackUrl: string;
6
+ storageDir: string;
7
+ config: MCPAuthConfig;
8
+ onRedirect(url: URL): void | Promise<void>;
9
+ }
10
+ export declare function createMcpOAuthProvider(options: McpOAuthProviderOptions): OAuthClientProvider;
11
+ //# sourceMappingURL=mcp-oauth-provider.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { ListToolsResult } from "@modelcontextprotocol/sdk/types.js";
2
+ import type { MCPServerConfig } from "@nuvin/config";
3
+ import type { AnyToolDefinition } from "../shared/types.ts";
4
+ import { type McpToolClient } from "./mcp-tool-adapter.ts";
5
+ interface ConnectedMcpClient extends McpToolClient {
6
+ listTools(): Promise<ListToolsResult>;
7
+ close(): Promise<void>;
8
+ }
9
+ export type McpServerConnectionStatus = {
10
+ status: "connected";
11
+ toolCount: number;
12
+ } | {
13
+ status: "disabled";
14
+ } | {
15
+ status: "authRequired";
16
+ message: string;
17
+ } | {
18
+ status: "error";
19
+ message: string;
20
+ };
21
+ export interface McpToolBundle {
22
+ tools: AnyToolDefinition[];
23
+ servers: Record<string, McpServerConnectionStatus>;
24
+ close(): Promise<void>;
25
+ }
26
+ export interface McpConnectionOptions {
27
+ oauth?: {
28
+ storageDir: string;
29
+ callbackUrl: string;
30
+ onRedirect(serverName: string, url: URL): void | Promise<void>;
31
+ };
32
+ }
33
+ export type McpConnector = (serverName: string, config: MCPServerConfig, options?: McpConnectionOptions) => Promise<ConnectedMcpClient>;
34
+ export declare function buildMcpHttpHeaders(config: MCPServerConfig): Record<string, string> | undefined;
35
+ export declare function connectMcpServer(serverName: string, config: MCPServerConfig, options?: McpConnectionOptions): Promise<ConnectedMcpClient>;
36
+ export declare function createMcpToolsFromServers(options: {
37
+ servers?: Record<string, MCPServerConfig>;
38
+ allowedTools?: Record<string, Record<string, boolean>>;
39
+ connection?: McpConnectionOptions;
40
+ connect?: McpConnector;
41
+ }): Promise<McpToolBundle>;
42
+ export {};
43
+ //# sourceMappingURL=mcp-server-manager.d.ts.map
@@ -0,0 +1,47 @@
1
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
+ import type { JsonObject, JsonSchema, JsonSchemaObject } from "../shared/types.ts";
3
+ export interface McpToolDescriptor {
4
+ name: string;
5
+ description?: string;
6
+ inputSchema?: unknown;
7
+ }
8
+ export interface McpToolClient {
9
+ callTool(input: {
10
+ name: string;
11
+ arguments?: JsonObject;
12
+ }): Promise<CallToolResult>;
13
+ }
14
+ export declare function createMcpToolName(serverName: string, toolName: string): string;
15
+ export declare function toNuvinToolSchema(inputSchema: unknown): JsonSchemaObject;
16
+ export declare function createMcpTool(options: {
17
+ serverName: string;
18
+ tool: McpToolDescriptor;
19
+ client: McpToolClient;
20
+ }): import("../shared/types.ts").ToolDefinition<{
21
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
22
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
23
+ })[] | {
24
+ [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any;
25
+ })[] | {
26
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
27
+ })[] | {
28
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
29
+ })[] | {
30
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
31
+ })[] | {
32
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
33
+ })[] | {
34
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
35
+ })[] | {
36
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
37
+ })[] | {
38
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
39
+ })[] | {
40
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
41
+ })[] | {
42
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
43
+ })[] | {
44
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
45
+ };
46
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, JsonSchemaObject<Record<string, JsonSchema>, readonly string[] | undefined>>;
47
+ //# sourceMappingURL=mcp-tool-adapter.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { ToolRuntime } from "../shared/types.ts";
2
+ export declare function createMockToolRuntime(): ToolRuntime;
3
+ //# sourceMappingURL=mock-tool-runtime.d.ts.map
@@ -0,0 +1,20 @@
1
+ export type RipgrepMatch = {
2
+ filePath: string;
3
+ isContext?: boolean;
4
+ lineNum: number;
5
+ lineText: string;
6
+ };
7
+ export declare function filepath(): Promise<string>;
8
+ export declare function files(opts: {
9
+ cwd: string;
10
+ glob?: string[];
11
+ }): AsyncGenerator<string>;
12
+ export declare function search(opts: {
13
+ context?: number;
14
+ cwd: string;
15
+ file?: string;
16
+ glob?: string;
17
+ limit?: number;
18
+ pattern: string;
19
+ }): Promise<RipgrepMatch[]>;
20
+ //# sourceMappingURL=ripgrep.d.ts.map
@@ -0,0 +1,58 @@
1
+ import type { AgentDefinitionFactoryContext, AgentOptions } from "../shared/types.ts";
2
+ export interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
3
+ parentSessionId: string;
4
+ runId: string;
5
+ }
6
+ export type DelegatedAgentDefinition = AgentOptions | ((ctx: DelegatedAgentFactoryContext) => AgentOptions | Promise<AgentOptions>);
7
+ export interface CreateDelegationToolsOptions {
8
+ agents?: Record<string, DelegatedAgentDefinition>;
9
+ }
10
+ export declare function resolveDelegatedAgentOptions(definition: DelegatedAgentDefinition, ctx: DelegatedAgentFactoryContext): Promise<AgentOptions>;
11
+ export declare function createAssignTaskTool(options: CreateDelegationToolsOptions): import("../shared/types.ts").ToolDefinition<{
12
+ description: string;
13
+ task: string;
14
+ agentId: string;
15
+ nickname: string;
16
+ }, import("../shared/types.ts").ToolOutputEnvelope, import("../shared/types.ts").ToolOutputEnvelope, {
17
+ type: "object";
18
+ properties: {
19
+ agentId: {
20
+ type: "string";
21
+ };
22
+ description: {
23
+ type: "string";
24
+ };
25
+ nickname: {
26
+ type: "string";
27
+ };
28
+ task: {
29
+ type: "string";
30
+ };
31
+ };
32
+ required: string[];
33
+ }>;
34
+ export declare const createDelegateToAgentTool: typeof createAssignTaskTool;
35
+ export declare function createDelegationTools(options: CreateDelegationToolsOptions): import("../shared/types.ts").ToolDefinition<{
36
+ description: string;
37
+ task: string;
38
+ agentId: string;
39
+ nickname: string;
40
+ }, import("../shared/types.ts").ToolOutputEnvelope, import("../shared/types.ts").ToolOutputEnvelope, {
41
+ type: "object";
42
+ properties: {
43
+ agentId: {
44
+ type: "string";
45
+ };
46
+ description: {
47
+ type: "string";
48
+ };
49
+ nickname: {
50
+ type: "string";
51
+ };
52
+ task: {
53
+ type: "string";
54
+ };
55
+ };
56
+ required: string[];
57
+ }>[];
58
+ //# sourceMappingURL=runtime-manager-tools.d.ts.map
@@ -0,0 +1,33 @@
1
+ /** Minimal shape of a skill source reference — matches @nuvin/config SkillDefinitionSource */
2
+ export interface SkillSource {
3
+ path: string;
4
+ directory?: string;
5
+ scope?: string;
6
+ }
7
+ /** Minimal shape of a skill reference — matches @nuvin/config SkillDefinitionReference */
8
+ export interface SkillReference {
9
+ id: string;
10
+ name: string;
11
+ description: string;
12
+ source: SkillSource;
13
+ }
14
+ /** Minimal shape of a loaded skill — matches @nuvin/config SerializedSkillDefinition */
15
+ export interface LoadedSkill extends SkillReference {
16
+ instructions: string;
17
+ }
18
+ export interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
19
+ skills: TRef[];
20
+ loadSkill: (reference: TRef) => Promise<LoadedSkill>;
21
+ }
22
+ export declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): import("../shared/types.ts").ToolDefinition<{
23
+ name: string;
24
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
25
+ type: "object";
26
+ properties: {
27
+ name: {
28
+ type: "string";
29
+ };
30
+ };
31
+ required: readonly ["name"];
32
+ }>;
33
+ //# sourceMappingURL=skill-tool.d.ts.map
@@ -0,0 +1,66 @@
1
+ type TodoStatus = "pending" | "in_progress" | "completed";
2
+ type TodoPriority = "high" | "medium" | "low";
3
+ type TodoInputItem = {
4
+ id: string;
5
+ content: string;
6
+ status: TodoStatus;
7
+ priority: TodoPriority;
8
+ createdAt?: string;
9
+ };
10
+ type TodoItem = TodoInputItem & {
11
+ sessionId: string;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ };
15
+ type TodoStats = {
16
+ total: number;
17
+ pending: number;
18
+ inProgress: number;
19
+ completed: number;
20
+ };
21
+ declare class TodoStore {
22
+ private readonly todosBySession;
23
+ getTodos(sessionId: string): TodoItem[];
24
+ setTodos(sessionId: string, todos: TodoItem[]): void;
25
+ getStats(sessionId: string): TodoStats;
26
+ }
27
+ export declare function createTodoWriteTool(store?: TodoStore): import("../shared/types.ts").ToolDefinition<{
28
+ todos: {
29
+ id: string;
30
+ content: string;
31
+ status: string;
32
+ priority: string;
33
+ createdAt: string;
34
+ }[];
35
+ }, never, import("../shared/types.ts").ToolOutputEnvelope, {
36
+ type: "object";
37
+ properties: {
38
+ todos: {
39
+ type: "array";
40
+ items: {
41
+ type: "object";
42
+ properties: {
43
+ content: {
44
+ type: "string";
45
+ };
46
+ status: {
47
+ type: "string";
48
+ };
49
+ priority: {
50
+ type: "string";
51
+ };
52
+ id: {
53
+ type: "string";
54
+ };
55
+ createdAt: {
56
+ type: "string";
57
+ };
58
+ };
59
+ required: string[];
60
+ };
61
+ };
62
+ };
63
+ required: string[];
64
+ }>;
65
+ export {};
66
+ //# sourceMappingURL=todo-write-tool.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { ToolResult } from "../shared/types.ts";
2
+ export interface ToolOutputOffloadOptions {
3
+ maxBytes: number;
4
+ sessionDir?: string;
5
+ }
6
+ /**
7
+ * Truncate a tool result's output if it exceeds `maxBytes`.
8
+ * Full output is written to `{sessionDir}/{toolName}_{sanitizedCallId}.log`.
9
+ * Returns the (possibly truncated) result. Mutates nothing.
10
+ */
11
+ export declare function truncateToolOutput(result: ToolResult, options: ToolOutputOffloadOptions): Promise<ToolResult>;
12
+ //# sourceMappingURL=tool-output-offload.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { AnyToolDefinition, InferJsonSchema, JsonObject, JsonSchemaObject, JsonValue, ToolDefinition, ToolExecutionContext, ToolOutputEnvelope, ToolOutputValue, ToolResultChunk, ToolResultContent, ToolSchema } from "../shared/types.ts";
2
+ export declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
3
+ export declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
4
+ export declare class ToolExecutionError extends Error {
5
+ readonly structured: JsonObject;
6
+ constructor(message: string, structured?: JsonObject);
7
+ }
8
+ export declare function defineTool<TSchema extends JsonSchemaObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined>(definition: {
9
+ name: string;
10
+ description: string;
11
+ inputSchema: TSchema;
12
+ execute(input: InferJsonSchema<TSchema>, ctx: ToolExecutionContext): AsyncGenerator<TYield, TReturn, void>;
13
+ }): ToolDefinition<InferJsonSchema<TSchema>, TYield, TReturn, TSchema>;
14
+ export declare class ToolRegistry {
15
+ private readonly toolsByName;
16
+ constructor(tools?: AnyToolDefinition[]);
17
+ register(tool: AnyToolDefinition): void;
18
+ get(name: string): AnyToolDefinition | undefined;
19
+ list(): AnyToolDefinition[];
20
+ listToolSchemas(): ToolSchema[];
21
+ }
22
+ export declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
23
+ export declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
24
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1,12 @@
1
+ export declare function createUpdateTopicTool(): import("../shared/types.ts").ToolDefinition<{
2
+ topic: string;
3
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
4
+ readonly type: "object";
5
+ readonly properties: {
6
+ readonly topic: {
7
+ readonly type: "string";
8
+ };
9
+ };
10
+ readonly required: readonly ["topic"];
11
+ }>;
12
+ //# sourceMappingURL=update-topic-tool.d.ts.map
@@ -0,0 +1,22 @@
1
+ export interface ViewFileToolOptions {
2
+ allowedDirs?: readonly string[];
3
+ defaultCwd?: string;
4
+ maxBytes?: number;
5
+ name?: string;
6
+ }
7
+ export declare function createViewFileTool(options?: ViewFileToolOptions): import("../shared/types.ts").ToolDefinition<{
8
+ path: string;
9
+ detail?: string | undefined;
10
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
11
+ type: "object";
12
+ properties: {
13
+ path: {
14
+ type: "string";
15
+ };
16
+ detail: {
17
+ type: "string";
18
+ };
19
+ };
20
+ required: readonly ["path"];
21
+ }>;
22
+ //# sourceMappingURL=view-file-tool.d.ts.map
@@ -0,0 +1,20 @@
1
+ export interface WebFetchToolOptions {
2
+ timeoutMs?: number;
3
+ name?: string;
4
+ }
5
+ export declare function createWebFetchTool(options?: WebFetchToolOptions): import("../shared/types.ts").ToolDefinition<{
6
+ url: string;
7
+ description?: string | undefined;
8
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
9
+ type: "object";
10
+ properties: {
11
+ description: {
12
+ type: "string";
13
+ };
14
+ url: {
15
+ type: "string";
16
+ };
17
+ };
18
+ required: readonly ["url"];
19
+ }>;
20
+ //# sourceMappingURL=web-fetch-tool.d.ts.map
@@ -0,0 +1,72 @@
1
+ export interface GoogleCseEngineOptions {
2
+ googleCseKey: string;
3
+ googleCseCx: string;
4
+ }
5
+ export interface OllamaEngineOptions {
6
+ apiKey: string;
7
+ }
8
+ export interface TavilyEngineOptions {
9
+ tavilyApiKey: string;
10
+ searchDepth?: "basic" | "advanced";
11
+ topic?: "general" | "news" | "finance";
12
+ }
13
+ export type WebSearchEngine = GoogleCseEngineOptions | OllamaEngineOptions | TavilyEngineOptions;
14
+ export interface WebSearchToolOptions {
15
+ engines: WebSearchEngine[];
16
+ name?: string;
17
+ }
18
+ export declare function createWebSearchTool(options: WebSearchToolOptions): import("../shared/types.ts").ToolDefinition<{
19
+ query: string;
20
+ type?: string | undefined;
21
+ description?: string | undefined;
22
+ count?: number | undefined;
23
+ offset?: number | undefined;
24
+ safe?: boolean | undefined;
25
+ domains?: string[] | undefined;
26
+ recencyDays?: number | undefined;
27
+ lang?: string | undefined;
28
+ region?: string | undefined;
29
+ hydrateMeta?: boolean | undefined;
30
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
31
+ type: "object";
32
+ properties: {
33
+ description: {
34
+ type: "string";
35
+ };
36
+ query: {
37
+ type: "string";
38
+ };
39
+ count: {
40
+ type: "number";
41
+ };
42
+ offset: {
43
+ type: "number";
44
+ };
45
+ domains: {
46
+ type: "array";
47
+ items: {
48
+ type: "string";
49
+ };
50
+ };
51
+ recencyDays: {
52
+ type: "number";
53
+ };
54
+ lang: {
55
+ type: "string";
56
+ };
57
+ region: {
58
+ type: "string";
59
+ };
60
+ safe: {
61
+ type: "boolean";
62
+ };
63
+ type: {
64
+ type: "string";
65
+ };
66
+ hydrateMeta: {
67
+ type: "boolean";
68
+ };
69
+ };
70
+ required: readonly ["query"];
71
+ }>;
72
+ //# sourceMappingURL=web-search-tool.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
2
+ export declare function resolveAllowedPath(rootDir: string, allowedDirs: readonly string[], inputPath: string): string;
3
+ export declare function assertWorkspaceFile(filePath: string): Promise<void>;
4
+ export declare function isProbablyBinary(buffer: Buffer): boolean;
5
+ //# sourceMappingURL=workspace-paths.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvin/agent-core",
3
- "version": "0.0.0-rc.18",
3
+ "version": "0.0.0-rc.19",
4
4
  "private": false,
5
5
  "description": "Core agent, model, format, and tool primitives for Nuvin",
6
6
  "license": "Apache-2.0",
@@ -52,7 +52,7 @@
52
52
  "tsup": "^8.5.1",
53
53
  "typescript": "^6.0.2",
54
54
  "vitest": "^4.1.2",
55
- "@nuvin/config": "0.1.0-rc.7"
55
+ "@nuvin/config": "0.1.0-rc.8"
56
56
  },
57
57
  "dependencies": {
58
58
  "@anthropic-ai/sdk": "^0.82.0",
@@ -1,5 +0,0 @@
1
- import { C as ChatRequest, O as OpenAiResponsesRequest } from './types-11Znykt2.js';
2
-
3
- declare function toOpenAiResponsesRequest(request: ChatRequest): OpenAiResponsesRequest;
4
-
5
- export { toOpenAiResponsesRequest as t };