@vietor/agent-core 0.7.1 → 0.7.3
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/README.md +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/mcp/manager.js +2 -2
- package/dist/runtime/agent.d.ts +1 -1
- package/dist/runtime/session.d.ts +1 -1
- package/dist/skills/loader.d.ts +1 -5
- package/dist/skills/loader.js +1 -0
- package/dist/skills/types.d.ts +5 -0
- package/dist/skills/types.js +1 -0
- package/dist/tools/ask-user.js +1 -1
- package/dist/tools/file-edit.js +1 -1
- package/dist/tools/file-read.js +1 -1
- package/dist/tools/file-write.js +1 -1
- package/dist/tools/glob.js +1 -1
- package/dist/tools/grep.js +1 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.js +2 -2
- package/dist/tools/shell.js +1 -1
- package/dist/tools/skill.d.ts +1 -1
- package/dist/tools/skill.js +1 -1
- package/dist/tools/sub-agent.js +1 -1
- package/dist/tools/types.d.ts +1 -1
- package/dist/tools/web-fetch.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -425,7 +425,7 @@ interface Tool {
|
|
|
425
425
|
readOnly?: boolean;
|
|
426
426
|
description: string;
|
|
427
427
|
parameters: Record<string, unknown>; // JSON Schema object
|
|
428
|
-
|
|
428
|
+
argSummaryKeys?: string[]; // parameter keys used for display summary
|
|
429
429
|
summarizeArgs?: (args: Record<string, unknown>) => string; // custom summary function
|
|
430
430
|
summarizeResult?(result: TextResult): string; // result summary for timeline display
|
|
431
431
|
execute(args: Record<string, unknown>, ctx: ToolContext): Promise<TextResult>;
|
|
@@ -436,7 +436,7 @@ interface Tool {
|
|
|
436
436
|
- `parameters` is passed to the LLM as a JSON Schema to describe the tool's arguments.
|
|
437
437
|
- When the LLM calls a tool, `execute` receives the parsed arguments and a context object.
|
|
438
438
|
- `execute` returns a `TextResult` (`{ content, isError? }`). Expected failures return `toolError(...)` (exported from the package); unexpected errors may throw and are wrapped by the registry.
|
|
439
|
-
- `
|
|
439
|
+
- `argSummaryKeys` / `summarizeArgs` control what appears in the tool log entry's `argsSummary` field.
|
|
440
440
|
- `summarizeResult` (optional) returns a short result summary for timeline display. Called after execution with the result; the registry prefixes the wall-clock duration. Falls back to a default summary (byte/line count) when not defined.
|
|
441
441
|
|
|
442
442
|
### `ToolContext`
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { INITIAL_RUN_METRICS, type SessionEvent, type TimelineEvent, type RunMet
|
|
|
5
5
|
export type { Tool, ToolContext, ToolSchema, Todo, TodoStatus, TextResult } from "./tools/types.js";
|
|
6
6
|
export { toolError } from "./tools/types.js";
|
|
7
7
|
export type { BuiltinToolsOptions } from "./tools/registry.js";
|
|
8
|
-
export type { Skill } from "./skills/
|
|
8
|
+
export type { Skill } from "./skills/types.js";
|
|
9
9
|
export { tryLoadSkills } from "./skills/loader.js";
|
|
10
10
|
export type { MCPClientInfo, MCPServerConfig, MCPServerInfo } from "./mcp/types.js";
|
|
11
11
|
export type { LLMConfig, LLMThinkingEffort, LLMBackend } from "./llm/types.js";
|
package/dist/mcp/manager.js
CHANGED
|
@@ -125,12 +125,12 @@ export class MCPServerManager {
|
|
|
125
125
|
this.markFailed(name, entry.type, error ?? "MCP server connection closed");
|
|
126
126
|
}
|
|
127
127
|
adapt(server, client, tool) {
|
|
128
|
-
const
|
|
128
|
+
const argSummaryKeys = summaryCandidates(tool.inputSchema);
|
|
129
129
|
return {
|
|
130
130
|
name: mcpToolName(server, tool.name),
|
|
131
131
|
description: tool.description ?? `${server} ${tool.name}`,
|
|
132
132
|
parameters: tool.inputSchema,
|
|
133
|
-
...(
|
|
133
|
+
...(argSummaryKeys.length ? { argSummaryKeys } : {}),
|
|
134
134
|
async execute(args, ctx) {
|
|
135
135
|
const result = await withTimeoutFn((signal) => client.callTool(tool.name, args, signal), CALL_TIMEOUT_MS, ctx.signal, `MCP tool call timed out (${CALL_TIMEOUT_MS / 1000}s)`);
|
|
136
136
|
const text = extractContent(result);
|
package/dist/runtime/agent.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LLMClient } from "../llm/types.js";
|
|
2
2
|
import { SessionMessages, type SessionMessage } from "./session-messages.js";
|
|
3
3
|
import type { SessionEvent } from "./events.js";
|
|
4
|
-
import type { Skill } from "../skills/
|
|
4
|
+
import type { Skill } from "../skills/types.js";
|
|
5
5
|
import type { ToolRegistry } from "../tools/registry.js";
|
|
6
6
|
import type { Todo } from "../tools/types.js";
|
|
7
7
|
export type RunStatus = "ok" | "aborted" | "error" | "stalled" | "maxTurns";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LLMClient, LLMConfig } from "../llm/types.js";
|
|
2
2
|
import type { MCPServerManager } from "../mcp/manager.js";
|
|
3
3
|
import type { MCPServerConfig, MCPServerInfo } from "../mcp/types.js";
|
|
4
|
-
import type { Skill } from "../skills/
|
|
4
|
+
import type { Skill } from "../skills/types.js";
|
|
5
5
|
import { type BuiltinToolsOptions, type ToolRegistry } from "../tools/registry.js";
|
|
6
6
|
import type { Todo, Tool } from "../tools/types.js";
|
|
7
7
|
import { type SessionEvent, type TimelineEvent } from "./events.js";
|
package/dist/skills/loader.d.ts
CHANGED
package/dist/skills/loader.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readdirSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { tryReadFileText } from "../util/file.js";
|
|
4
|
+
import {} from "./types.js";
|
|
4
5
|
function parseSkillFile(skillName, skillFile) {
|
|
5
6
|
const content = tryReadFileText(skillFile);
|
|
6
7
|
if (!content)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/tools/ask-user.js
CHANGED
package/dist/tools/file-edit.js
CHANGED
package/dist/tools/file-read.js
CHANGED
package/dist/tools/file-write.js
CHANGED
package/dist/tools/glob.js
CHANGED
package/dist/tools/grep.js
CHANGED
package/dist/tools/registry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Tool, ToolContext, ToolSchema, Todo } from "./types.js";
|
|
2
2
|
import { type SubAgentToolDeps } from "./sub-agent.js";
|
|
3
|
-
import type { Skill } from "../skills/
|
|
3
|
+
import type { Skill } from "../skills/types.js";
|
|
4
4
|
import type { TextResult } from "./types.js";
|
|
5
5
|
export declare class ToolRegistry {
|
|
6
6
|
private tools;
|
package/dist/tools/registry.js
CHANGED
|
@@ -76,10 +76,10 @@ export class ToolRegistry {
|
|
|
76
76
|
return "";
|
|
77
77
|
if (tool.summarizeArgs)
|
|
78
78
|
return tool.summarizeArgs(args);
|
|
79
|
-
if (!tool.
|
|
79
|
+
if (!tool.argSummaryKeys)
|
|
80
80
|
return "";
|
|
81
81
|
const parts = [];
|
|
82
|
-
for (const k of tool.
|
|
82
|
+
for (const k of tool.argSummaryKeys) {
|
|
83
83
|
const v = args[k];
|
|
84
84
|
if (typeof v === "string" && v) {
|
|
85
85
|
parts.push(v);
|
package/dist/tools/shell.js
CHANGED
package/dist/tools/skill.d.ts
CHANGED
package/dist/tools/skill.js
CHANGED
package/dist/tools/sub-agent.js
CHANGED
package/dist/tools/types.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface Tool {
|
|
|
25
25
|
readOnly?: boolean;
|
|
26
26
|
description: string;
|
|
27
27
|
parameters: Record<string, unknown>;
|
|
28
|
-
|
|
28
|
+
argSummaryKeys?: string[];
|
|
29
29
|
summarizeArgs?: (args: Record<string, unknown>) => string;
|
|
30
30
|
summarizeResult?(result: TextResult): string;
|
|
31
31
|
execute(args: Record<string, unknown>, ctx: ToolContext): Promise<TextResult>;
|
package/dist/tools/web-fetch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vietor/agent-core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"url": "https://github.com/vietor/easy-agent.git"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@anthropic-ai/sdk": "^0.
|
|
27
|
+
"@anthropic-ai/sdk": "^0.117.1",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
29
29
|
"@vscode/ripgrep": "^1.18.0",
|
|
30
|
-
"openai": "^7.
|
|
30
|
+
"openai": "^7.5.0",
|
|
31
31
|
"turndown": "^7.2.4",
|
|
32
32
|
"undici": "^8.10.0"
|
|
33
33
|
},
|