@nuvin/agent-core 0.0.0-rc.17 → 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.
- package/dist/VERSION +2 -2
- package/dist/agent/agent.d.ts +28 -0
- package/dist/agent/context-compactor.d.ts +8 -0
- package/dist/agent/extension-registry.d.ts +3 -0
- package/dist/agent/index.d.ts +8 -99
- package/dist/agent/index.js +1 -1
- package/dist/agent/messages-to-text.d.ts +3 -0
- package/dist/agent/metrics.d.ts +30 -0
- package/dist/agent/topic-reminder-extension.d.ts +32 -0
- package/dist/agent/turn-engine.d.ts +3 -0
- package/dist/chunk-FFIZ6TKW.js +1 -1
- package/dist/chunk-HRU363DY.js +1 -0
- package/dist/chunk-NHBKADBW.js +1 -0
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-QDOE7NWO.js +1 -0
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/formats/base64-image-content.d.ts +4 -0
- package/dist/formats/index.d.ts +4 -39
- package/dist/formats/index.js +1 -1
- package/dist/formats/message-format.d.ts +33 -0
- package/dist/formats/provider-adapters.d.ts +3 -0
- package/dist/hooks/executor.d.ts +3 -0
- package/dist/hooks/extensions.d.ts +28 -0
- package/dist/hooks/index.d.ts +7 -76
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/registry.d.ts +8 -0
- package/dist/hooks/types.d.ts +40 -0
- package/dist/lsp/client.d.ts +11 -0
- package/dist/lsp/index.d.ts +24 -0
- package/dist/lsp/installer.d.ts +11 -0
- package/dist/lsp/language.d.ts +2 -0
- package/dist/lsp/server.d.ts +6 -0
- package/dist/lsp/types.d.ts +68 -0
- package/dist/models/anthropic-model.d.ts +27 -0
- package/dist/models/anthropic-surface.d.ts +5 -0
- package/dist/models/chat-model.d.ts +31 -0
- package/dist/models/github-model.d.ts +32 -0
- package/dist/models/http-transport.d.ts +10 -0
- package/dist/models/index.d.ts +16 -390
- package/dist/models/index.js +1 -1
- package/dist/models/mock-model.d.ts +15 -0
- package/dist/models/model-errors.d.ts +16 -0
- package/dist/models/model-limits.d.ts +7 -0
- package/dist/models/model-registry.d.ts +44 -0
- package/dist/models/model-surface-router.d.ts +19 -0
- package/dist/models/model-transports.d.ts +17 -0
- package/dist/models/openai-model.d.ts +60 -0
- package/dist/models/openai-surfaces.d.ts +74 -0
- package/dist/models/provider-adapter.d.ts +23 -0
- package/dist/models/provider-session.d.ts +16 -0
- package/dist/models/routed-model.d.ts +90 -0
- package/dist/shared/abort.d.ts +9 -0
- package/dist/shared/index.d.ts +5 -22
- package/dist/shared/index.js +1 -1
- package/dist/shared/reasoning-config.d.ts +5 -0
- package/dist/shared/turn-failed.d.ts +6 -0
- package/dist/{types-3UUDPpJs.d.ts → shared/types.d.ts} +172 -162
- package/dist/tools/ask-user-tool.d.ts +55 -0
- package/dist/tools/bash-tool.d.ts +63 -0
- package/dist/tools/command-tool.d.ts +23 -0
- package/dist/tools/file-edit-tool.d.ts +29 -0
- package/dist/tools/file-new-tool.d.ts +21 -0
- package/dist/tools/file-read-tool.d.ts +27 -0
- package/dist/tools/glob-tool.d.ts +26 -0
- package/dist/tools/grep-tool.d.ts +34 -0
- package/dist/tools/index.d.ts +28 -809
- package/dist/tools/index.js +1 -1
- package/dist/tools/internal-tool-runtime.d.ts +8 -0
- package/dist/tools/ls-tool.d.ts +20 -0
- package/dist/tools/lsp-tool.d.ts +36 -0
- package/dist/tools/mcp-oauth-provider.d.ts +11 -0
- package/dist/tools/mcp-server-manager.d.ts +43 -0
- package/dist/tools/mcp-tool-adapter.d.ts +47 -0
- package/dist/tools/mock-tool-runtime.d.ts +3 -0
- package/dist/tools/ripgrep.d.ts +20 -0
- package/dist/tools/runtime-manager-tools.d.ts +58 -0
- package/dist/tools/skill-tool.d.ts +33 -0
- package/dist/tools/todo-write-tool.d.ts +66 -0
- package/dist/tools/tool-output-offload.d.ts +12 -0
- package/dist/tools/tools.d.ts +24 -0
- package/dist/tools/update-topic-tool.d.ts +12 -0
- package/dist/tools/view-file-tool.d.ts +22 -0
- package/dist/tools/web-fetch-tool.d.ts +20 -0
- package/dist/tools/web-search-tool.d.ts +72 -0
- package/dist/tools/workspace-paths.d.ts +5 -0
- package/package.json +2 -2
- package/dist/chunk-SEP4YYY3.js +0 -1
- package/dist/chunk-T7UKN6FZ.js +0 -1
- package/dist/chunk-WHYFEBOU.js +0 -1
- package/dist/provider-adapters-Bupd2RBH.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,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.
|
|
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.
|
|
55
|
+
"@nuvin/config": "0.1.0-rc.8"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@anthropic-ai/sdk": "^0.82.0",
|
package/dist/chunk-SEP4YYY3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(_0x1e2087,_0x544885){const _0x23b81c={_0x5e8937:0x32e,_0x4e509a:0x336,_0x126814:0x16e,_0x4b0e03:0x187,_0x428055:0x15e,_0x540b2d:0x347,_0x549743:0x33a,_0x5e78c8:0x33e,_0x40309d:0x337,_0xf83e88:0x18a,_0x2ca3dc:0x18d,_0x260233:0x151,_0x1be8a5:0x17e,_0x17e83e:0x335,_0x90dfa3:0x17f,_0xc87955:0x182,_0x16afdd:0x191,_0x2a197c:0x341,_0x4d57e3:0x362,_0x479300:0x324,_0x3bc85a:0x315,_0xb6c418:0x179,_0x407966:0x33c,_0x5b1299:0x326},_0x167fd5={_0x2d5005:0x26a};function _0x6fb191(_0x1dbd83,_0x4c5e1e,_0x3405b,_0x39803c){return _0x36a2(_0x1dbd83-0xac,_0x4c5e1e);}function _0x2629d4(_0x4482de,_0x365452,_0x16777a,_0x57a05f){return _0x36a2(_0x4482de-_0x167fd5._0x2d5005,_0x365452);}const _0x160dab=_0x1e2087();while(!![]){try{const _0x576345=-parseInt(_0x2629d4(_0x23b81c._0x5e8937,0x330,0x33d,_0x23b81c._0x4e509a))/0x1*(parseInt(_0x6fb191(_0x23b81c._0x126814,_0x23b81c._0x4b0e03,_0x23b81c._0x428055,0x160))/0x2)+parseInt(_0x2629d4(_0x23b81c._0x540b2d,_0x23b81c._0x549743,_0x23b81c._0x5e78c8,_0x23b81c._0x40309d))/0x3+-parseInt(_0x6fb191(_0x23b81c._0xf83e88,0x17e,0x178,_0x23b81c._0x2ca3dc))/0x4+-parseInt(_0x6fb191(0x164,_0x23b81c._0x260233,_0x23b81c._0x1be8a5,0x146))/0x5+-parseInt(_0x2629d4(0x320,0x320,_0x23b81c._0x17e83e,0x303))/0x6*(-parseInt(_0x6fb191(_0x23b81c._0x90dfa3,0x166,_0x23b81c._0xc87955,_0x23b81c._0x16afdd))/0x7)+parseInt(_0x2629d4(0x354,_0x23b81c._0x2a197c,_0x23b81c._0x4d57e3,0x367))/0x8*(-parseInt(_0x2629d4(_0x23b81c._0x479300,0x339,_0x23b81c._0x3bc85a,0x331))/0x9)+-parseInt(_0x6fb191(0x174,0x185,_0x23b81c._0xb6c418,0x17a))/0xa*(-parseInt(_0x2629d4(_0x23b81c._0x407966,0x31f,_0x23b81c._0x5b1299,0x33a))/0xb);if(_0x576345===_0x544885)break;else _0x160dab['push'](_0x160dab['shift']());}catch(_0x34cd18){_0x160dab['push'](_0x160dab['shift']());}}}(_0x59b9,0x1ef16));function createTextBlock(_0x19c5c8){const _0x1f0b5b={_0x1aa6b2:0x271,_0x5305a1:0x28a};function _0x5e74a3(_0x170b07,_0x35a51b,_0x510dc9,_0x1798c4){return _0x36a2(_0x170b07- -0x358,_0x35a51b);}return{'type':_0x5e74a3(-_0x1f0b5b._0x1aa6b2,-_0x1f0b5b._0x5305a1,-0x28f,-0x283),'text':_0x19c5c8};}function normalizeTextBlock(_0x2537cd){return createTextBlock(_0x2537cd['text']??'');}function normalizeContent(_0x218062){const _0x468eaf={_0x12be8e:0x2b5,_0x4a998a:0x2ca,_0x147885:0x2bb,_0x3cee30:0x306,_0x10a31d:0x2f8,_0x42274f:0x30d},_0x53b9be={_0x445369:0x3e4,_0x130973:0x40a,_0x3bca58:0x40b},_0x2138cb={_0xaf0c34:0x20a};function _0x1cf246(_0x15ce21,_0x468341,_0x4b0802,_0x4492c6){return _0x36a2(_0x4492c6- -0x225,_0x4b0802);}if(typeof _0x218062==='string')return[createTextBlock(_0x218062)];if(!Array[_0x35f7f3(_0x468eaf._0x12be8e,_0x468eaf._0x4a998a,_0x468eaf._0x147885,0x2b7)](_0x218062))return[];function _0x35f7f3(_0x2adc1b,_0x5d2c0d,_0x341de9,_0x309eb9){return _0x36a2(_0x5d2c0d-_0x2138cb._0xaf0c34,_0x341de9);}return _0x218062[_0x35f7f3(_0x468eaf._0x3cee30,_0x468eaf._0x10a31d,0x2e4,_0x468eaf._0x42274f)](_0x2d27f8=>{const _0xc04cae={_0x5a21a8:0x1f},_0x37218d={_0x2addbe:0x93,_0x3ed829:0x12f,_0x2a4e6a:0xd4};function _0x20f9b3(_0x50dddc,_0x397d98,_0x3d2f81,_0x2d2b35){return _0x35f7f3(_0x50dddc-_0x37218d._0x2addbe,_0x50dddc-_0x37218d._0x3ed829,_0x2d2b35,_0x2d2b35-_0x37218d._0x2a4e6a);}function _0x4281ab(_0x45b12f,_0x5c921c,_0xecf3c7,_0x2de044){return _0x35f7f3(_0x45b12f-0xad,_0xecf3c7-_0xc04cae._0x5a21a8,_0x2de044,_0x2de044-0x14e);}if(_0x2d27f8[_0x20f9b3(0x3f0,_0x53b9be._0x445369,0x3f4,_0x53b9be._0x130973)]===_0x20f9b3(0x420,_0x53b9be._0x3bca58,0x412,0x42e))return normalizeTextBlock(_0x2d27f8);return structuredClone(_0x2d27f8);});}function normalizeSystem(_0xd846e0=[]){const _0x137b60={_0xf72271:0x10c,_0x48a6da:0xf7},_0x197184={_0x164880:0x236};function _0x5d2073(_0x361c1c,_0x597fa4,_0x2248bf,_0x15dcf6){return _0x36a2(_0x15dcf6- -_0x197184._0x164880,_0x597fa4);}function _0x4c1f29(_0x5d282a,_0x4a2dc7,_0x5b9251,_0x5a9a12){return _0x36a2(_0x4a2dc7-0x3b,_0x5a9a12);}return normalizeContent(_0xd846e0)[_0x4c1f29(_0x137b60._0xf72271,_0x137b60._0x48a6da,0xfc,0xe8)](_0x2dda5a=>_0x2dda5a[_0x4c1f29(0xef,0xf2,0xd6,0xfc)]===_0x4c1f29(0x11e,0x122,0x125,0x12b));}function _0x36a2(_0x1084a3,_0xa2318d){_0x1084a3=_0x1084a3-0xb6;const _0x59b9a2=_0x59b9();let _0x36a271=_0x59b9a2[_0x1084a3];if(_0x36a2['ocLmfK']===undefined){var _0x2a5f31=function(_0x14f64f){const _0x10ecb2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x19c5c8='',_0x2537cd='';for(let _0x218062=0x0,_0x2d27f8,_0xd846e0,_0x2dda5a=0x0;_0xd846e0=_0x14f64f['charAt'](_0x2dda5a++);~_0xd846e0&&(_0x2d27f8=_0x218062%0x4?_0x2d27f8*0x40+_0xd846e0:_0xd846e0,_0x218062++%0x4)?_0x19c5c8+=String['fromCharCode'](0xff&_0x2d27f8>>(-0x2*_0x218062&0x6)):0x0){_0xd846e0=_0x10ecb2['indexOf'](_0xd846e0);}for(let _0x39e440=0x0,_0x532318=_0x19c5c8['length'];_0x39e440<_0x532318;_0x39e440++){_0x2537cd+='%'+('00'+_0x19c5c8['charCodeAt'](_0x39e440)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2537cd);};_0x36a2['BDqSWa']=_0x2a5f31,_0x36a2['BJhXOv']={},_0x36a2['ocLmfK']=!![];}const _0x27c2e9=_0x59b9a2[0x0],_0x2858b5=_0x1084a3+_0x27c2e9,_0x57a61a=_0x36a2['BJhXOv'][_0x2858b5];return!_0x57a61a?(_0x36a271=_0x36a2['BDqSWa'](_0x36a271),_0x36a2['BJhXOv'][_0x2858b5]=_0x36a271):_0x36a271=_0x57a61a,_0x36a271;}function normalizeMessage(_0x39e440){const _0x3eadb1={_0x43e208:0x2be,_0x4dc5c3:0x2a9,_0x578ee1:0x2a5,_0x4ae766:0x38e,_0x2dba93:0x380,_0x439e6e:0x352,_0x394c73:0x342,_0x4b3753:0x33c,_0x1a50e2:0x350,_0x4e4681:0x28d,_0x641296:0x295,_0x2deb11:0x2a8,_0x494901:0x27a,_0x4e8c3f:0x28d},_0x51c2b7={_0x58ac36:0x293},_0xc9f110={_0x49022d:0x37c};function _0x35ad9a(_0x58c500,_0x28506c,_0x4fc793,_0x76789f){return _0x36a2(_0x58c500- -_0xc9f110._0x49022d,_0x28506c);}function _0xe651f0(_0xff740a,_0x26d085,_0x2461fb,_0x19ca49){return _0x36a2(_0x19ca49-_0x51c2b7._0x58ac36,_0xff740a);}return{...typeof _0x39e440['id']===_0x35ad9a(-_0x3eadb1._0x43e208,-0x2ae,-_0x3eadb1._0x4dc5c3,-_0x3eadb1._0x578ee1)?{'id':_0x39e440['id']}:{},'role':_0x39e440[_0xe651f0(0x37a,_0x3eadb1._0x4ae766,0x366,_0x3eadb1._0x2dba93)],'content':normalizeContent(_0x39e440[_0xe651f0(_0x3eadb1._0x439e6e,_0x3eadb1._0x394c73,_0x3eadb1._0x4b3753,_0x3eadb1._0x1a50e2)]),..._0x39e440[_0x35ad9a(-_0x3eadb1._0x4e4681,-_0x3eadb1._0x641296,-_0x3eadb1._0x2deb11,-_0x3eadb1._0x494901)]?{'providerState':structuredClone(_0x39e440[_0x35ad9a(-_0x3eadb1._0x4e4681,-_0x3eadb1._0x4e8c3f,-0x282,-0x295)])}:{}};}function compileRequest(_0x532318){const _0x2ea852={_0x4995f2:0x1bd,_0x337ac0:0x1d1,_0x476f83:0x1c5,_0x1968a6:0x1c7,_0x51179a:0x1cf,_0x98d716:0x1b6,_0x169e21:0x1cd,_0x753a39:0x20f,_0x58cce3:0x1db,_0x3895ef:0x1ee,_0x3fc6d3:0x1be,_0x372f9e:0x228,_0x5a3289:0x213},_0x2e83bc={_0x29f9ce:0x2a6};function _0x5d00c2(_0x4afa22,_0x916a70,_0x194e7b,_0x373b3c){return _0x36a2(_0x194e7b- -0x2fa,_0x373b3c);}function _0x4bc06f(_0x26106b,_0x27b95d,_0x5d4ffe,_0x33df05){return _0x36a2(_0x27b95d- -_0x2e83bc._0x29f9ce,_0x33df05);}return{'model':_0x532318[_0x5d00c2(-0x227,-0x20d,-0x221,-0x22c)]??_0x4bc06f(-0x1b3,-_0x2ea852._0x4995f2,-_0x2ea852._0x337ac0,-_0x2ea852._0x476f83),'max_tokens':_0x532318[_0x4bc06f(-0x1d6,-0x1d5,-0x1ba,-_0x2ea852._0x1968a6)]??0x400,..._0x532318[_0x4bc06f(-0x1e4,-_0x2ea852._0x51179a,-_0x2ea852._0x98d716,-0x1cb)]?{'reasoning':structuredClone(_0x532318[_0x4bc06f(-_0x2ea852._0x169e21,-0x1cf,-0x1ba,-0x1b6)])}:{},'system':normalizeSystem(_0x532318[_0x5d00c2(-_0x2ea852._0x753a39,-0x213,-0x21b,-0x225)]),'messages':_0x532318[_0x4bc06f(-0x1d8,-_0x2ea852._0x58cce3,-_0x2ea852._0x3895ef,-0x1d6)][_0x4bc06f(-0x1c5,-0x1b8,-0x1bc,-_0x2ea852._0x3fc6d3)](normalizeMessage),'tools':structuredClone(_0x532318['tools']??[]),'metadata':{'session_id':_0x532318[_0x5d00c2(-_0x2ea852._0x372f9e,-_0x2ea852._0x5a3289,-0x225,-0x214)],'turn_id':_0x532318['turnId']}};}function toChatRequest(_0xc6d216){const _0x92283f={_0x5451e7:0x2a6,_0x294fbf:0x295,_0x4664bc:0x297,_0x2edebd:0x1d5,_0x1d3733:0x1b4,_0xacd710:0x1ca,_0xfec370:0x2a8,_0x45690f:0x2af,_0x177286:0x2b7,_0x396ed6:0x288,_0xae4b1:0x2a4,_0x3abbd0:0x299,_0x1fc8b5:0x2ab,_0xdaf3f2:0x1a3,_0x534dd4:0x1ae,_0x30c406:0x1a4,_0x299038:0x2bd,_0xdef16c:0x1c4,_0x45a7ed:0x1cf,_0x395a30:0x1aa},_0x28da81={_0x55f4c8:0xe0};function _0x2ee2ef(_0x62cdd6,_0xc76fb9,_0x96e8d7,_0x5a2fc7){return _0x36a2(_0xc76fb9-_0x28da81._0x55f4c8,_0x5a2fc7);}function _0xa02866(_0x48a405,_0x28350a,_0x4d3183,_0x4966f9){return _0x36a2(_0x28350a- -0x37f,_0x48a405);}return{'model':_0xc6d216[_0xa02866(-0x2ad,-_0x92283f._0x5451e7,-_0x92283f._0x294fbf,-_0x92283f._0x4664bc)],'maxTokens':_0xc6d216['max_tokens'],..._0xc6d216[_0x2ee2ef(_0x92283f._0x2edebd,0x1b7,_0x92283f._0x1d3733,_0x92283f._0xacd710)]?{'reasoning':structuredClone(_0xc6d216[_0xa02866(-0x2b3,-_0x92283f._0xfec370,-_0x92283f._0x45690f,-0x29b)])}:{},'system':structuredClone(_0xc6d216['system']),'messages':structuredClone(_0xc6d216['messages']),'tools':structuredClone(_0xc6d216[_0xa02866(-0x29e,-0x29d,-_0x92283f._0x177286,-0x2a2)]),'metadata':{'sessionId':_0xc6d216[_0xa02866(-_0x92283f._0x396ed6,-_0x92283f._0xae4b1,-_0x92283f._0x3abbd0,-_0x92283f._0x1fc8b5)][_0x2ee2ef(0x198,_0x92283f._0xdaf3f2,_0x92283f._0x534dd4,_0x92283f._0x30c406)],'turnId':_0xc6d216[_0xa02866(-_0x92283f._0x299038,-_0x92283f._0xae4b1,-0x293,-_0x92283f._0x4664bc)][_0x2ee2ef(0x1d6,_0x92283f._0xdef16c,_0x92283f._0x45a7ed,_0x92283f._0x395a30)]}};}function toModelRequest(_0x4f3234){const _0x515a6a={_0x899ca8:0x7e,_0x34a232:0x62,_0x114e97:0x86,_0x1bed45:0x82,_0x3bf3a9:0x7a,_0x528c18:0x6a,_0x32c4b4:0x58,_0x249e46:0x75,_0x3fa1a4:0x68,_0x28b3aa:0x1be},_0x320519={_0x3c1af5:0x277};function _0x18e747(_0x56c11f,_0x1b22b2,_0x2897b4,_0x27af0a){return _0x36a2(_0x27af0a- -_0x320519._0x3c1af5,_0x56c11f);}function _0x46326a(_0x5cc84d,_0x2174bc,_0x386b6f,_0x2e83a0){return _0x36a2(_0x5cc84d- -0x68,_0x2e83a0);}return{'model':_0x4f3234['model'],'max_tokens':_0x4f3234[_0x46326a(0x89,_0x515a6a._0x899ca8,0x6f,0x70)],..._0x4f3234[_0x46326a(0x6f,0x6f,_0x515a6a._0x34a232,0x61)]?{'reasoning':structuredClone(_0x4f3234[_0x46326a(0x6f,_0x515a6a._0x114e97,_0x515a6a._0x1bed45,0x68)])}:{},'system':structuredClone(_0x4f3234['system']),'messages':structuredClone(_0x4f3234[_0x18e747(-0x1a0,-0x19a,-0x18e,-0x1ac)]),'tools':structuredClone(_0x4f3234[_0x46326a(_0x515a6a._0x3bf3a9,_0x515a6a._0x34a232,0x6c,_0x515a6a._0x528c18)]),'metadata':{'session_id':_0x4f3234[_0x46326a(0x73,_0x515a6a._0x32c4b4,0x61,_0x515a6a._0x249e46)]['sessionId'],'turn_id':_0x4f3234[_0x46326a(0x73,0x5f,0x74,_0x515a6a._0x3fa1a4)][_0x18e747(-0x1b4,-0x1bc,-0x1b5,-_0x515a6a._0x28b3aa)]}};}function _0x209649(_0x847714,_0x3c0d44,_0x5372ff,_0x2e0149){const _0x36e533={_0xf406d6:0x207};return _0x36a2(_0x847714- -_0x36e533._0xf406d6,_0x5372ff);}function toProviderModelRequest(_0x26be8c){const _0x567f62={_0x5e39ca:0x322,_0x545a9e:0x30c,_0xffcd1c:0x335},_0x1bfbb9={_0x5e81d4:0x257};function _0x4e63f8(_0x44c8fd,_0x17678f,_0x198c89,_0x34bcd1){return _0x36a2(_0x44c8fd-_0x1bfbb9._0x5e81d4,_0x17678f);}return{'model':_0x26be8c['model'],'max_tokens':_0x26be8c['maxTokens'],'system':structuredClone(_0x26be8c['system']),'messages':structuredClone(_0x26be8c[_0x4e63f8(_0x567f62._0x5e39ca,_0x567f62._0x545a9e,0x337,_0x567f62._0xffcd1c)]),'tools':structuredClone(_0x26be8c['tools'])};}function toChatResponse(_0x1a7b5d){const _0x5868df={_0x2369cb:0xc9,_0x182114:0xd8,_0x36b278:0x216,_0x2a864d:0x22b,_0x16166d:0xdf,_0x23329b:0x254,_0x4f14ed:0x23f,_0x5f1cbf:0xde,_0x439bd3:0xdd,_0x5e5e5e:0xcf,_0x2a51e0:0xea,_0xa48d13:0x233,_0x3cf531:0x220,_0x34af8e:0x211,_0x239ec7:0x21d,_0x1cf544:0xda,_0x47b836:0xb3,_0x1fff57:0xd0,_0x5a5086:0xd3},_0x454809={_0x32aba6:0x1b8};function _0x368391(_0x5529cf,_0x3e79f2,_0x65b2ef,_0x1b96df){return _0x36a2(_0x1b96df- -_0x454809._0x32aba6,_0x5529cf);}function _0x5f6c9f(_0xb02093,_0x5a4118,_0x16774a,_0x57027c){return _0x36a2(_0x57027c-0x14f,_0x5a4118);}return{'id':_0x1a7b5d['id'],'content':structuredClone(_0x1a7b5d['content']),'stopReason':_0x1a7b5d['stop_reason'],'usage':{'inputTokens':_0x1a7b5d[_0x368391(-_0x5868df._0x2369cb,-0xb9,-_0x5868df._0x182114,-0xc8)][_0x5f6c9f(_0x5868df._0x36b278,0x208,0x22d,0x215)],'outputTokens':_0x1a7b5d[_0x5f6c9f(_0x5868df._0x2a864d,0x256,0x234,0x23f)][_0x368391(-0xc3,-_0x5868df._0x16166d,-0xcb,-0xd2)],..._0x1a7b5d[_0x5f6c9f(_0x5868df._0x23329b,0x22f,0x258,_0x5868df._0x4f14ed)][_0x368391(-_0x5868df._0x5f1cbf,-_0x5868df._0x439bd3,-_0x5868df._0x5e5e5e,-_0x5868df._0x2a51e0)]!==void 0x0?{'reasoningTokens':_0x1a7b5d[_0x5f6c9f(0x227,0x24c,_0x5868df._0xa48d13,0x23f)][_0x5f6c9f(_0x5868df._0x3cf531,_0x5868df._0x34af8e,0x21f,_0x5868df._0x239ec7)]}:{}},..._0x1a7b5d[_0x368391(-_0x5868df._0x1cf544,-_0x5868df._0x47b836,-_0x5868df._0x47b836,-_0x5868df._0x2369cb)]?{'providerState':structuredClone(_0x1a7b5d[_0x368391(-_0x5868df._0x1fff57,-_0x5868df._0x5f1cbf,-_0x5868df._0x5a5086,-_0x5868df._0x2369cb)])}:{}};}function toModelResponse(_0x55348b){const _0x404ab8={_0x4c2877:0x24,_0x24aa01:0x18,_0x462e64:0x16,_0x44c053:0xc,_0x567754:0x27,_0x5c7082:0x13,_0x37daa0:0x3,_0x3ae283:0x6,_0x4dce92:0x32,_0x19b5a5:0x1c,_0x25b4fb:0xa,_0x19574f:0x37,_0x328ed8:0x7,_0x32effe:0x22,_0x50d7de:0x53,_0x14a28a:0x4b,_0x482830:0x1c,_0x227454:0x6},_0x51255f={_0x5bf75a:0xe9};function _0xebcf7f(_0x38ee17,_0x56e42d,_0x130662,_0x152dc2){return _0x36a2(_0x130662- -_0x51255f._0x5bf75a,_0x152dc2);}function _0x5c5e97(_0x472240,_0x4613d2,_0x30f03a,_0x3e4eb0){return _0x36a2(_0x472240- -0xa7,_0x3e4eb0);}return{'id':_0x55348b['id'],'type':_0xebcf7f(-_0x404ab8._0x4c2877,-0x37,-0x24,-_0x404ab8._0x24aa01),'role':'assistant','content':structuredClone(_0x55348b[_0x5c5e97(_0x404ab8._0x462e64,_0x404ab8._0x44c053,_0x404ab8._0x567754,_0x404ab8._0x5c7082)]),'stop_reason':_0x55348b['stopReason'],'stop_sequence':null,'usage':{'input_tokens':_0x55348b[_0xebcf7f(0x2,_0x404ab8._0x37daa0,0x7,_0x404ab8._0x3ae283)][_0xebcf7f(-0xa,-_0x404ab8._0x4dce92,-_0x404ab8._0x19b5a5,-_0x404ab8._0x25b4fb)],'output_tokens':_0x55348b['usage'][_0x5c5e97(0x33,_0x404ab8._0x19574f,0x3a,0x2f)],..._0x55348b[_0xebcf7f(_0x404ab8._0x328ed8,_0x404ab8._0x32effe,0x7,_0x404ab8._0x4c2877)]['reasoningTokens']!==void 0x0?{'reasoning_tokens':_0x55348b[_0x5c5e97(0x49,_0x404ab8._0x50d7de,_0x404ab8._0x14a28a,0x48)]['reasoningTokens']}:{}},..._0x55348b['providerState']?{'providerState':structuredClone(_0x55348b[_0xebcf7f(_0x404ab8._0x482830,-0x2,_0x404ab8._0x227454,-0x18)])}:{}};}function responseToAssistantMessage(_0x439bf6){const _0x386b25={_0x5a0b4b:0x273,_0x13bb54:0x26b,_0x1200b8:0x280,_0xe22a0e:0x28c},_0x4af04d={_0x32c7b0:0x1ae},_0x152f20={_0xf4ef70:0x203};function _0x46644e(_0x3d6874,_0x424cbb,_0x126bd4,_0x21ea4b){return _0x36a2(_0x126bd4- -_0x152f20._0xf4ef70,_0x3d6874);}function _0x15c70d(_0x1031a5,_0x21b3b2,_0x1e6325,_0x3de058){return _0x36a2(_0x21b3b2-_0x4af04d._0x32c7b0,_0x1031a5);}return{'role':'assistant','content':normalizeContent(_0x439bf6[_0x15c70d(_0x386b25._0x5a0b4b,_0x386b25._0x13bb54,_0x386b25._0x1200b8,0x268)]),..._0x439bf6['providerState']?{'providerState':structuredClone(_0x439bf6[_0x15c70d(0x28e,0x29d,_0x386b25._0xe22a0e,0x2a2)])}:{}};}function createReasoningMessage(_0x265c56){const _0x1130b6={_0x30878f:0x1de,_0x1b8b0e:0x1fb,_0x27e99d:0x1e6,_0x2f963d:0x1d9,_0x538740:0x1d6,_0x6beb46:0x1fe},_0x752fa1={_0x5bdbf6:0x2a2},_0x4f3d11={_0x128227:0x38a,_0x32a10d:0x36c,_0x3d4ac4:0x1e2,_0x1fd1fc:0x1c1,_0x2b1144:0x1e5,_0x423541:0x1c7,_0x5d74a6:0x1c0,_0x26d986:0x1a7,_0x548616:0x197,_0xdfafca:0x1e8,_0x1df2fb:0x1d3},_0x284b37={_0x13e9d3:0x34d};function _0x58d537(_0x4de8d0,_0x165fdf,_0x519258,_0x5ce747){return _0x36a2(_0x519258- -_0x284b37._0x13e9d3,_0x4de8d0);}const _0x3f1ded=normalizeContent(_0x265c56?.[_0x2aa7ec(-0x1e9,-_0x1130b6._0x30878f,-0x1e5,-0x1d6)])[_0x2aa7ec(-_0x1130b6._0x1b8b0e,-0x1f8,-_0x1130b6._0x27e99d,-_0x1130b6._0x2f963d)](_0x497ccc=>{const _0x43ed73={_0xf5d9bc:0x118},_0x1eb753={_0x180386:0x121,_0x39496f:0x620};function _0x4697ca(_0x78b6bb,_0xfbe35e,_0x3e56e4,_0x4ae630){return _0x58d537(_0x3e56e4,_0xfbe35e-_0x1eb753._0x180386,_0xfbe35e-_0x1eb753._0x39496f,_0x4ae630-0x1da);}function _0x9b5084(_0x4c076a,_0x5b3fcc,_0x3af45e,_0xcdfcf4){return _0x2aa7ec(_0x4c076a-0xa3,_0x5b3fcc-_0x43ed73._0xf5d9bc,_0xcdfcf4-0x389,_0x4c076a);}return _0x497ccc[_0x4697ca(0x375,_0x4f3d11._0x128227,_0x4f3d11._0x32a10d,0x39d)]===_0x9b5084(_0x4f3d11._0x3d4ac4,_0x4f3d11._0x1fd1fc,_0x4f3d11._0x2b1144,_0x4f3d11._0x423541)||_0x497ccc['type']===_0x9b5084(0x1b9,0x1c1,_0x4f3d11._0x5d74a6,0x1b0)||_0x497ccc[_0x9b5084(0x1ad,_0x4f3d11._0x26d986,_0x4f3d11._0x548616,0x19e)]===_0x9b5084(0x1b5,_0x4f3d11._0xdfafca,0x1e0,_0x4f3d11._0x1df2fb);});function _0x2aa7ec(_0x4947ed,_0x14df5f,_0x17e320,_0x3b9722){return _0x36a2(_0x17e320- -_0x752fa1._0x5bdbf6,_0x3b9722);}if(_0x3f1ded[_0x2aa7ec(-0x1c5,-_0x1130b6._0x538740,-0x1ba,-0x1b3)]===0x0)return void 0x0;return{'role':_0x2aa7ec(-_0x1130b6._0x6beb46,-0x1d8,-0x1e1,-_0x1130b6._0x27e99d),'content':_0x3f1ded};}function createAssistantTextMessage(_0x4f2277){const _0x40e468={_0x58cbe0:0x227,_0x59f0cf:0x22b,_0x230f96:0x23f,_0x46093f:0x218,_0x512f19:0x210,_0x305602:0x223},_0x3b3582={_0x4d1707:0x135},_0x3027e6={_0x2933b4:0x8e,_0x510395:0xa0,_0x456a04:0xb8},_0x331f46={_0x19cca3:0x1b5,_0x164f3e:0x28c},_0x51aec8=normalizeContent(_0x4f2277?.[_0x48fc1c(-_0x40e468._0x58cbe0,-0x213,-_0x40e468._0x59f0cf,-0x20e)])[_0x48fc1c(-0x228,-0x236,-0x219,-_0x40e468._0x230f96)](_0x7b9696=>{function _0x5b8f5b(_0x138b39,_0x221459,_0x2f51df,_0x554902){return _0x27bc53(_0x138b39,_0x221459-_0x331f46._0x19cca3,_0x2f51df-0x63,_0x221459- -_0x331f46._0x164f3e);}return _0x7b9696[_0x5b8f5b(-_0x3027e6._0x2933b4,-_0x3027e6._0x510395,-_0x3027e6._0x456a04,-0x97)]==='text';});if(_0x51aec8[_0x27bc53(0x208,_0x40e468._0x46093f,_0x40e468._0x512f19,0x21d)]===0x0)return void 0x0;function _0x48fc1c(_0x4318b2,_0x17138d,_0x5cb837,_0x1b338d){return _0x36a2(_0x4318b2- -0x2e4,_0x17138d);}function _0x27bc53(_0x33f3a2,_0x119936,_0x593b6f,_0x153830){return _0x36a2(_0x153830-_0x3b3582._0x4d1707,_0x33f3a2);}return{'role':_0x48fc1c(-_0x40e468._0x305602,-0x21d,-0x23b,-0x206),'content':_0x51aec8};}function createToolUseMessage(_0x5ecdb1){const _0x2cf8dc={_0x239b40:0x73,_0x499eb6:0x63,_0x3db400:0x4e,_0x57d91d:0x54,_0x397914:0x44,_0x6dd87f:0x38,_0xf5f0ff:0x47,_0x3d99df:0x5e,_0x53bb2a:0x74,_0x4cd98d:0x5f},_0x13e7b4={_0x3e28a7:0x1c6,_0x57140e:0x1c7,_0x4847c8:0x1af,_0x35231e:0x26d};function _0x156b4b(_0x5e3b96,_0x1c1291,_0x24588f,_0x2054c2){return _0x36a2(_0x2054c2- -0x120,_0x1c1291);}const _0x1ed44c=normalizeContent(_0x5ecdb1?.[_0x156b4b(-_0x2cf8dc._0x239b40,-0x78,-0x60,-_0x2cf8dc._0x499eb6)])[_0x156b4b(-0x47,-0x77,-0x5f,-0x64)](_0x16fca0=>{const _0x39cb1b={_0x74d4ea:0xb9},_0x5cbe6a={_0x431ace:0x138};function _0x41a334(_0x1654f8,_0x2c52e,_0xb7a8ba,_0x1506a0){return _0xd6b2f9(_0x1654f8-0x44,_0x2c52e-_0x5cbe6a._0x431ace,_0xb7a8ba- -0x202,_0x2c52e);}function _0x56e4da(_0x4e79c7,_0x24df3a,_0x1852b9,_0x369e34){return _0x156b4b(_0x4e79c7-0x17,_0x369e34,_0x1852b9-_0x39cb1b._0x74d4ea,_0x1852b9-0x2c5);}return _0x16fca0[_0x41a334(_0x13e7b4._0x3e28a7,_0x13e7b4._0x57140e,0x1b8,_0x13e7b4._0x4847c8)]===_0x56e4da(0x28d,0x289,0x27d,_0x13e7b4._0x35231e);});function _0xd6b2f9(_0x5858a5,_0x54e2cb,_0x46523c,_0x634258){return _0x36a2(_0x46523c-0x303,_0x634258);}if(_0x1ed44c[_0x156b4b(-_0x2cf8dc._0x3db400,-_0x2cf8dc._0x57d91d,-_0x2cf8dc._0x397914,-_0x2cf8dc._0x6dd87f)]===0x0)return void 0x0;return{'role':_0x156b4b(-_0x2cf8dc._0xf5f0ff,-_0x2cf8dc._0x3d99df,-_0x2cf8dc._0x53bb2a,-_0x2cf8dc._0x4cd98d),'content':_0x1ed44c};}function getTextFromMessage(_0x3c5467){const _0x30f8b0={_0x1eb88d:0x28b,_0x3a37ee:0x286,_0x527c6c:0x29e,_0x357b34:0x2a6,_0x30f7d5:0x2a7,_0x4706e3:0x160,_0xb87f7b:0x14f,_0x4b899a:0x150},_0x17454f={_0x508350:0x1ce};function _0x4ab3cc(_0x5ebca2,_0x507707,_0x53a6b1,_0x319d9e){return _0x36a2(_0x319d9e-0x86,_0x507707);}function _0x159767(_0x3bbee1,_0x3e988a,_0x53c820,_0xf46ea0){return _0x36a2(_0x3bbee1-_0x17454f._0x508350,_0xf46ea0);}return normalizeContent(_0x3c5467?.[_0x159767(_0x30f8b0._0x1eb88d,_0x30f8b0._0x3a37ee,0x274,_0x30f8b0._0x527c6c)])[_0x159767(0x28a,_0x30f8b0._0x357b34,0x29e,_0x30f8b0._0x30f7d5)](_0x44ddbd=>_0x44ddbd[_0x159767(0x285,0x277,0x29f,0x29b)]===_0x159767(0x2b5,0x2a0,0x2af,0x2ab))[_0x159767(0x2bc,0x2c3,0x2a6,0x2ab)](_0x4b0962=>_0x4b0962[_0x4ab3cc(0x17f,0x15d,0x157,0x16d)])[_0x4ab3cc(0x162,_0x30f8b0._0x4706e3,_0x30f8b0._0xb87f7b,_0x30f8b0._0x4b899a)]('\x0a');}function getReasoningTextFromMessage(_0x5eef3c){const _0xeb54c8={_0x210dfc:0x1b0,_0x38df95:0x14a,_0x45c50d:0x13e},_0x336afe={_0xbc4d84:0x346,_0x41a1fa:0x330,_0x32fad7:0x33b,_0x2070e0:0x345,_0x35d908:0x395,_0x4cf2bf:0x3b1,_0x2f0348:0x348,_0x46aec9:0x352,_0x230cae:0x356,_0x202409:0x355,_0x33d786:0x357,_0x104ce8:0x362,_0x17de9b:0x391,_0x14894d:0x37b,_0x4b165f:0x3ae,_0x40db20:0x3ab,_0x152476:0x368,_0x52d183:0x35d,_0x158a49:0x351,_0x44d90e:0x3b7,_0x26c6b1:0x3a5,_0x13f8d9:0x34a,_0x57af48:0x37a,_0x22e88f:0x38c,_0x19de66:0x39c,_0x144f5c:0x38d,_0x485d9c:0x3a4},_0x213eba={_0x16bd1d:0xc7},_0x40abd1={_0xad9e1f:0x215};function _0x1a0cf5(_0x204d52,_0x409cb8,_0x1d6b49,_0x5b7297){return _0x36a2(_0x409cb8- -_0x40abd1._0xad9e1f,_0x5b7297);}function _0x2f9a85(_0x92be30,_0x51b300,_0x24004a,_0x15bfa0){return _0x36a2(_0x24004a-_0x213eba._0x16bd1d,_0x92be30);}return normalizeContent(_0x5eef3c?.['content'])[_0x2f9a85(0x1b3,_0xeb54c8._0x210dfc,0x1ac,0x1b3)](_0xfcf74c=>{const _0x5f4a54={_0x221413:0x1e8,_0x4864c1:0x1f6,_0x44e474:0x1b3};if(_0xfcf74c[_0x847228(0x335,0x311,0x31a,0x32c)]===_0x847228(_0x336afe._0xbc4d84,0x336,0x32c,0x33e))return _0xfcf74c[_0x847228(0x352,0x34d,0x347,0x34b)][_0x847228(_0x336afe._0x41a1fa,0x350,_0x336afe._0x32fad7,_0x336afe._0x2070e0)]()[_0x4d7979(0x3ba,_0x336afe._0x35d908,_0x336afe._0x4cf2bf,0x3a5)]>0x0?[_0xfcf74c[_0x847228(0x333,0x344,_0x336afe._0x2f0348,0x34b)]]:[];if(_0xfcf74c['type']===_0x847228(_0x336afe._0x46aec9,_0x336afe._0x230cae,0x356,_0x336afe._0x202409))return[_0x847228(0x355,_0x336afe._0x33d786,0x35d,0x360)];if(_0xfcf74c[_0x4d7979(_0x336afe._0x104ce8,_0x336afe._0x17de9b,_0x336afe._0x14894d,0x374)]!==_0x4d7979(0x390,0x3be,0x3a9,0x3a9))return[];function _0x847228(_0x37f095,_0x17cb97,_0x154bf8,_0x52458e){return _0x2f9a85(_0x17cb97,_0x17cb97-0xe3,_0x52458e-0x1ae,_0x52458e-0x92);}const _0xc3142=_0xfcf74c['summary'][_0x4d7979(_0x336afe._0x4b165f,0x38d,0x394,_0x336afe._0x40db20)](_0xce3014=>_0xce3014[_0x4d7979(0x397,0x3b4,0x3b1,0x3a4)])[_0x4d7979(0x386,0x36b,_0x336afe._0x152476,0x379)](_0x2ce1f0=>_0x2ce1f0[_0x4d7979(0x38b,0x396,0x39a,0x38d)]()[_0x847228(0x354,0x34f,0x366,0x35d)]>0x0)[_0x847228(_0x336afe._0x52d183,0x354,_0x336afe._0x158a49,0x33f)]('\x0a\x0a');if(_0xc3142[_0x4d7979(0x397,0x3b5,_0x336afe._0x44d90e,_0x336afe._0x26c6b1)]>0x0)return[_0xc3142];if(_0xfcf74c[_0x847228(_0x336afe._0x13f8d9,0x34b,_0x336afe._0x57af48,0x35c)]&&_0xfcf74c['text'][_0x4d7979(_0x336afe._0x22e88f,_0x336afe._0x19de66,0x3a4,_0x336afe._0x144f5c)]()['length']>0x0)return[_0xfcf74c['text']];function _0x4d7979(_0x457406,_0x1625d1,_0x59e930,_0x15be4a){return _0x2f9a85(_0x59e930,_0x1625d1-_0x5f4a54._0x221413,_0x15be4a-_0x5f4a54._0x4864c1,_0x15be4a-_0x5f4a54._0x44e474);}return _0xfcf74c['encryptedContent']?[_0x4d7979(0x3a7,_0x336afe._0x485d9c,0x39b,0x3a0)]:[];})[_0x1a0cf5(-_0xeb54c8._0x38df95,-0x14b,-0x15c,-_0xeb54c8._0x45c50d)]('\x0a\x0a');}function getToolUseBlocks(_0x4e7296){const _0x57b957={_0x4979b7:0x293,_0x46e5f3:0x286,_0x4eaddb:0x268};function _0x2b7e16(_0x2c232f,_0x1bb046,_0x55a582,_0x290004){return _0x36a2(_0x1bb046- -0x342,_0x2c232f);}return normalizeContent(_0x4e7296?.['content'])[_0x2b7e16(-_0x57b957._0x4979b7,-_0x57b957._0x46e5f3,-_0x57b957._0x4eaddb,-0x28c)](_0x4f8182=>_0x4f8182['type']==='tool_use');}function getToolResultBlocks(_0x21279f){const _0x2fcf40={_0x34c2e3:0x2cf,_0x3756cf:0x2b8},_0x501020={_0x4960e3:0x217};function _0x2cef5e(_0x4e63e9,_0x5693eb,_0x5cceda,_0x577deb){return _0x36a2(_0x4e63e9- -_0x501020._0x4960e3,_0x5693eb);}function _0x3c2d02(_0x51ad57,_0x574a28,_0x131a03,_0x42b19e){return _0x36a2(_0x51ad57- -0x38b,_0x131a03);}return normalizeContent(_0x21279f?.['content'])[_0x3c2d02(-_0x2fcf40._0x34c2e3,-0x2c2,-0x2c4,-_0x2fcf40._0x3756cf)](_0x27e28c=>_0x27e28c[_0x2cef5e(-0x160,-0x14b,-0x17d,-0x157)]===_0x3c2d02(-0x2aa,-0x294,-0x2a8,-0x2ba));}function createToolResultUserMessage(_0x2e6881){const _0xb21e65={_0x42a65c:0x3ea,_0x57b862:0x3f6,_0x480b69:0x3be,_0x20744e:0x3c6,_0x5042fb:0x3d7,_0x3234d5:0x3e9,_0x2eb648:0x3f4},_0x1f16c4={_0x4b6f01:0x31a};return{'role':'user','content':_0x2e6881['map'](_0x136d4c=>{function _0x158984(_0x2003ea,_0x4b16e6,_0x41e745,_0x3caf02){return _0x36a2(_0x41e745-0x304,_0x2003ea);}function _0x5d62b9(_0x1d3b63,_0x3ff217,_0x30a257,_0x13a4e5){return _0x36a2(_0x13a4e5-_0x1f16c4._0x4b6f01,_0x3ff217);}return{'type':_0x5d62b9(0x3e2,_0xb21e65._0x42a65c,_0xb21e65._0x57b862,0x3fb),'tool_use_id':_0x136d4c[_0x5d62b9(0x3d6,0x3f5,0x3d1,0x3e9)],'content':_0x136d4c[_0x5d62b9(0x3df,_0xb21e65._0x480b69,_0xb21e65._0x20744e,_0xb21e65._0x5042fb)]??_0x136d4c['output'],'is_error':_0x136d4c['status']===_0x5d62b9(_0xb21e65._0x3234d5,_0xb21e65._0x2eb648,0x3e5,0x3d9)};})};}var INTERRUPTED_TOOL_RESULT_TEXT=_0x209649(-0x12b,-0x11f,-0x142,-0x149);function _0x59b9(){const _0x3b882a=['Aw5WDxruB2TLBNm','CMvHC29UAw5Nx3rVA2vUCW','y2fSBeLK','DhjPBq','Bwf4x3rVA2vUCW','mtfpvKjKB2i','mZu3u3jKvNbH','ywrK','C2vZC2LVBKLK','DgHPBMTPBMC','CMvHC29UAw5N','Dg9VBf91C2u','Bw9KzwW','B3v0Chv0vg9Rzw5Z','Bwv0ywrHDge','vg9VBcbLEgvJDxrPB24GD2fZigLUDgvYCNvWDgvKigjLzM9YzsbJB21WBgv0Aw9UigfUzcbWCM9KDwnLzcbUBYbYzxn1BhqU','mZu5nJqZr2zJq2Dq','nZC0nJG4vLLqzefK','C3LZDgvT','yw50AhjVCgLJx3jLzgfJDgvKx3rOAw5RAw5N','Dg9VBf9Yzxn1Bhq','Dg9VBhm','kgvUy3j5ChrLzcbYzwfZB25PBMCP','DhvYBL9Pza','zMXHDe1HCa','B3v0Chv0x3rVA2vUCW','Dgv4Da','BgvUz3rO','y2XHDwrLlxnVBM5LDc00ltiWmJuWnte0','mtq5mdC3nMXtzw14tq','khjLzgfJDgvKihjLyxnVBMLUzYK','B3bLBMfPx3jLyxnVBMLUzW','CM9Szq','BwfW','ChjVDMLKzxjtDgf0zq','DxnHz2u','Bwf4vg9Rzw5Z','mJGYmtjWuu1ovfq','DhLWzq','nJi5mtyWELn6Bu1N','DhvYBKLK','ow92quP3ta','Dg9VBf91C2vFAwq','zMLSDgvY','y29UDgvUDa','C3rYAw5N','zxjYB3i','AxnbCNjHEq','yxnZAxn0yw50','nJi2nKXLwLjOra','C2vZC2LVBL9Pza','nZfrzMjlvgG','BwvZC2fNzq','Aw5WDxrFDg9Rzw5Z','AgfZ','ndK1mZuZmfPpweTRDa','yw50AhjVCgLJx3rOAw5RAw5N','AM9PBG','BwvZC2fNzxm','ChvZAa'];_0x59b9=function(){return _0x3b882a;};return _0x59b9();}function synthesizeMissingToolResults(_0x175296){const _0x5e0d08={_0x3b2d0d:0xb9,_0x297068:0xbf,_0x175c43:0xac,_0x5da5a5:0xd8,_0x1291da:0x22d,_0x5b9501:0x242,_0x108ab7:0x243,_0x4943be:0x215,_0xefcd0b:0x216,_0x4da47e:0x24c,_0x1192fc:0x22c,_0xad1632:0x263,_0x593c59:0x264},_0x582f47={_0x505ba6:0x74,_0x480652:0x9},_0x4067fb={_0x3b6d8f:0x58},_0x5a6daa=new Set();for(const _0x98a706 of _0x175296){for(const _0x26dfe4 of getToolResultBlocks(_0x98a706)){_0x5a6daa[_0x3cad74(-_0x5e0d08._0x3b2d0d,-_0x5e0d08._0x297068,-_0x5e0d08._0x175c43,-0xd5)](_0x26dfe4[_0x3cad74(-0xcd,-0xd8,-0xef,-_0x5e0d08._0x5da5a5)]);}}const _0x548e0b=[];function _0x5b3352(_0x195780,_0x43372a,_0x5dbc9c,_0x4035b8){return _0x209649(_0x5dbc9c-0x37d,_0x43372a-0x122,_0x4035b8,_0x4035b8-_0x4067fb._0x3b6d8f);}for(const _0x22968a of _0x175296){_0x548e0b[_0x5b3352(0x245,_0x5e0d08._0x1291da,_0x5e0d08._0x5b9501,_0x5e0d08._0x108ab7)](_0x22968a);const _0x48a242=getToolUseBlocks(_0x22968a)[_0x5b3352(0x234,_0x5e0d08._0x4943be,0x232,_0x5e0d08._0xefcd0b)](_0x2c674a=>!_0x5a6daa[_0x5b3352(0x242,0x22b,0x23d,0x227)](_0x2c674a['id']));if(_0x48a242[_0x5b3352(0x251,0x26b,0x25e,_0x5e0d08._0x5b9501)]===0x0)continue;_0x548e0b[_0x5b3352(0x235,_0x5e0d08._0x4da47e,0x242,_0x5e0d08._0x1192fc)]({'role':'user','content':_0x48a242[_0x5b3352(_0x5e0d08._0xad1632,0x277,_0x5e0d08._0x593c59,0x24b)](_0x322a2a=>({'type':_0x3cad74(-0x9f,-0xb2,-0xc9,-0x99),'tool_use_id':_0x322a2a['id'],'content':INTERRUPTED_TOOL_RESULT_TEXT,'is_error':!![]}))});for(const _0x3c8ca0 of _0x48a242){_0x5a6daa['add'](_0x3c8ca0['id']);}}function _0x3cad74(_0x204781,_0x5a9123,_0x2bc64f,_0x33724f){return _0x209649(_0x5a9123-_0x582f47._0x505ba6,_0x5a9123-_0x582f47._0x480652,_0x2bc64f,_0x33724f-0x120);}return _0x548e0b;}export{createTextBlock,normalizeTextBlock,normalizeContent,normalizeSystem,normalizeMessage,compileRequest,toChatRequest,toModelRequest,toProviderModelRequest,toChatResponse,toModelResponse,responseToAssistantMessage,createReasoningMessage,createAssistantTextMessage,createToolUseMessage,getTextFromMessage,getReasoningTextFromMessage,getToolUseBlocks,getToolResultBlocks,createToolResultUserMessage,INTERRUPTED_TOOL_RESULT_TEXT,synthesizeMissingToolResults};
|