@nuvin/agent-core 0.0.0-rc.9 → 0.0.0

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 (91) 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 -68
  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 -0
  12. package/dist/chunk-HRU363DY.js +1 -0
  13. package/dist/chunk-NHBKADBW.js +1 -0
  14. package/dist/chunk-NYZR4XKO.js +1 -1
  15. package/dist/chunk-QDOE7NWO.js +1 -0
  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 -28
  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 -0
  25. package/dist/hooks/index.js +1 -0
  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 -347
  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 +67 -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 -17
  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-Bb2eVtsy.d.ts → shared/types.d.ts} +180 -164
  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 -773
  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/safe-fetch.d.ts +36 -0
  78. package/dist/tools/skill-tool.d.ts +33 -0
  79. package/dist/tools/todo-write-tool.d.ts +66 -0
  80. package/dist/tools/tool-output-offload.d.ts +12 -0
  81. package/dist/tools/tools.d.ts +24 -0
  82. package/dist/tools/update-topic-tool.d.ts +12 -0
  83. package/dist/tools/view-file-tool.d.ts +22 -0
  84. package/dist/tools/web-fetch-tool.d.ts +23 -0
  85. package/dist/tools/web-search-tool.d.ts +75 -0
  86. package/dist/tools/workspace-paths.d.ts +5 -0
  87. package/package.json +6 -2
  88. package/dist/chunk-3QLMAAJY.js +0 -1
  89. package/dist/chunk-4DNIDCX7.js +0 -1
  90. package/dist/chunk-G2FR4UGO.js +0 -1
  91. package/dist/provider-adapters-NxiNWlxu.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,36 @@
1
+ /**
2
+ * Resolves a hostname to its IP addresses. Mirrors the shape of
3
+ * `node:dns/promises` `lookup(host, { all: true })` but is injectable so the
4
+ * SSRF guard can be tested without real DNS.
5
+ */
6
+ export type SafeFetchLookup = (hostname: string) => Promise<Array<{
7
+ address: string;
8
+ family: number;
9
+ }>>;
10
+ export interface SafeFetchOptions {
11
+ lookup?: SafeFetchLookup;
12
+ fetchImpl?: typeof fetch;
13
+ maxRedirects?: number;
14
+ }
15
+ export declare const defaultLookup: SafeFetchLookup;
16
+ /**
17
+ * True when an IP literal points at a non-public destination (loopback,
18
+ * private, link-local, CGNAT, multicast, reserved). Fails closed on anything
19
+ * unparseable so a bypass cannot slip through as "not blocked".
20
+ */
21
+ export declare function isBlockedAddress(ip: string): boolean;
22
+ /**
23
+ * Validate that a URL is safe for the server to fetch: http(s) only, no
24
+ * embedded credentials, and a destination that does not resolve to a private
25
+ * or otherwise non-public address. Literal IPs are range-checked directly;
26
+ * hostnames are resolved and rejected if ANY resolved address is non-public.
27
+ * Throws ToolExecutionError on rejection; returns the parsed URL on success.
28
+ */
29
+ export declare function assertPublicUrl(value: string, options?: SafeFetchOptions): Promise<URL>;
30
+ /**
31
+ * SSRF-hardened fetch: validates the target (and every redirect hop) against
32
+ * {@link assertPublicUrl} before connecting, following redirects manually so a
33
+ * 30x into a private/metadata address cannot be transparently followed.
34
+ */
35
+ export declare function safeFetch(value: string, init?: RequestInit, options?: SafeFetchOptions): Promise<Response>;
36
+ //# sourceMappingURL=safe-fetch.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,23 @@
1
+ import { type SafeFetchLookup } from "./safe-fetch.ts";
2
+ export interface WebFetchToolOptions {
3
+ timeoutMs?: number;
4
+ name?: string;
5
+ /** DNS resolver used by the SSRF guard. Injectable for tests. */
6
+ lookup?: SafeFetchLookup;
7
+ }
8
+ export declare function createWebFetchTool(options?: WebFetchToolOptions): import("../shared/types.ts").ToolDefinition<{
9
+ url: string;
10
+ description?: string | undefined;
11
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
12
+ type: "object";
13
+ properties: {
14
+ description: {
15
+ type: "string";
16
+ };
17
+ url: {
18
+ type: "string";
19
+ };
20
+ };
21
+ required: readonly ["url"];
22
+ }>;
23
+ //# sourceMappingURL=web-fetch-tool.d.ts.map
@@ -0,0 +1,75 @@
1
+ import { type SafeFetchLookup } from "./safe-fetch.ts";
2
+ export interface GoogleCseEngineOptions {
3
+ googleCseKey: string;
4
+ googleCseCx: string;
5
+ }
6
+ export interface OllamaEngineOptions {
7
+ apiKey: string;
8
+ }
9
+ export interface TavilyEngineOptions {
10
+ tavilyApiKey: string;
11
+ searchDepth?: "basic" | "advanced";
12
+ topic?: "general" | "news" | "finance";
13
+ }
14
+ export type WebSearchEngine = GoogleCseEngineOptions | OllamaEngineOptions | TavilyEngineOptions;
15
+ export interface WebSearchToolOptions {
16
+ engines: WebSearchEngine[];
17
+ name?: string;
18
+ /** DNS resolver used by the SSRF guard when hydrating result pages. Injectable for tests. */
19
+ lookup?: SafeFetchLookup;
20
+ }
21
+ export declare function createWebSearchTool(options: WebSearchToolOptions): import("../shared/types.ts").ToolDefinition<{
22
+ query: string;
23
+ type?: string | undefined;
24
+ description?: string | undefined;
25
+ count?: number | undefined;
26
+ offset?: number | undefined;
27
+ safe?: boolean | undefined;
28
+ domains?: string[] | undefined;
29
+ recencyDays?: number | undefined;
30
+ lang?: string | undefined;
31
+ region?: string | undefined;
32
+ hydrateMeta?: boolean | undefined;
33
+ }, import("../shared/types.ts").ToolOutputEnvelope, undefined, {
34
+ type: "object";
35
+ properties: {
36
+ description: {
37
+ type: "string";
38
+ };
39
+ query: {
40
+ type: "string";
41
+ };
42
+ count: {
43
+ type: "number";
44
+ };
45
+ offset: {
46
+ type: "number";
47
+ };
48
+ domains: {
49
+ type: "array";
50
+ items: {
51
+ type: "string";
52
+ };
53
+ };
54
+ recencyDays: {
55
+ type: "number";
56
+ };
57
+ lang: {
58
+ type: "string";
59
+ };
60
+ region: {
61
+ type: "string";
62
+ };
63
+ safe: {
64
+ type: "boolean";
65
+ };
66
+ type: {
67
+ type: "string";
68
+ };
69
+ hydrateMeta: {
70
+ type: "boolean";
71
+ };
72
+ };
73
+ required: readonly ["query"];
74
+ }>;
75
+ //# 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.9",
3
+ "version": "0.0.0",
4
4
  "private": false,
5
5
  "description": "Core agent, model, format, and tool primitives for Nuvin",
6
6
  "license": "Apache-2.0",
@@ -37,6 +37,10 @@
37
37
  "./tools": {
38
38
  "types": "./dist/tools/index.d.ts",
39
39
  "import": "./dist/tools/index.js"
40
+ },
41
+ "./hooks": {
42
+ "types": "./dist/hooks/index.d.ts",
43
+ "import": "./dist/hooks/index.js"
40
44
  }
41
45
  },
42
46
  "devDependencies": {
@@ -48,7 +52,7 @@
48
52
  "tsup": "^8.5.1",
49
53
  "typescript": "^6.0.2",
50
54
  "vitest": "^4.1.2",
51
- "@nuvin/config": "0.1.0-rc.4"
55
+ "@nuvin/config": "0.1.0"
52
56
  },
53
57
  "dependencies": {
54
58
  "@anthropic-ai/sdk": "^0.82.0",