@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 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
- summaryKeys?: string[]; // parameter keys used for display summary
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
- - `summaryKeys` / `summarizeArgs` control what appears in the tool log entry's `argsSummary` field.
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/loader.js";
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";
@@ -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 summaryKeys = summaryCandidates(tool.inputSchema);
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
- ...(summaryKeys.length ? { summaryKeys } : {}),
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);
@@ -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/loader.js";
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/loader.js";
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";
@@ -1,6 +1,2 @@
1
- export interface Skill {
2
- name: string;
3
- description?: string;
4
- prompt: string;
5
- }
1
+ import { type Skill } from "./types.js";
6
2
  export declare function tryLoadSkills(path: string): Skill[] | undefined;
@@ -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,5 @@
1
+ export interface Skill {
2
+ name: string;
3
+ description?: string;
4
+ prompt: string;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -21,6 +21,6 @@ export function createAskUserTool(ask) {
21
21
  }
22
22
  return { content: await ask(question, options) };
23
23
  },
24
- summaryKeys: ["question"],
24
+ argSummaryKeys: ["question"],
25
25
  };
26
26
  }
@@ -39,5 +39,5 @@ export const fileEditTool = {
39
39
  return "Edit failed";
40
40
  return "Edit completed";
41
41
  },
42
- summaryKeys: ["path"],
42
+ argSummaryKeys: ["path"],
43
43
  };
@@ -89,5 +89,5 @@ export const fileReadTool = {
89
89
  summarizeResult(result) {
90
90
  return summaryBytes("Read", result, "Read failed");
91
91
  },
92
- summaryKeys: ["path"],
92
+ argSummaryKeys: ["path"],
93
93
  };
@@ -21,5 +21,5 @@ export const fileWriteTool = {
21
21
  return "Write failed";
22
22
  return "Write completed";
23
23
  },
24
- summaryKeys: ["path"],
24
+ argSummaryKeys: ["path"],
25
25
  };
@@ -27,5 +27,5 @@ export const globTool = {
27
27
  summarizeResult(result) {
28
28
  return ripgrepResultSummary("file", result, "Glob failed", "Found 0 files");
29
29
  },
30
- summaryKeys: ["pattern", "path"],
30
+ argSummaryKeys: ["pattern", "path"],
31
31
  };
@@ -63,5 +63,5 @@ export const grepTool = {
63
63
  summarizeResult(result) {
64
64
  return ripgrepResultSummary("match", result, "Grep failed", "Found 0 matches");
65
65
  },
66
- summaryKeys: ["pattern", "path", "glob"],
66
+ argSummaryKeys: ["pattern", "path", "glob"],
67
67
  };
@@ -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/loader.js";
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;
@@ -76,10 +76,10 @@ export class ToolRegistry {
76
76
  return "";
77
77
  if (tool.summarizeArgs)
78
78
  return tool.summarizeArgs(args);
79
- if (!tool.summaryKeys)
79
+ if (!tool.argSummaryKeys)
80
80
  return "";
81
81
  const parts = [];
82
- for (const k of tool.summaryKeys) {
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);
@@ -53,5 +53,5 @@ export const shellTool = {
53
53
  summarizeResult(result) {
54
54
  return summaryBytes("Command executed", result, "Command failed");
55
55
  },
56
- summaryKeys: ["command"],
56
+ argSummaryKeys: ["command"],
57
57
  };
@@ -1,3 +1,3 @@
1
- import type { Skill } from "../skills/loader.js";
1
+ import type { Skill } from "../skills/types.js";
2
2
  import type { Tool } from "./types.js";
3
3
  export declare function createSkillTool(resolve: (name: string) => Skill | undefined): Tool;
@@ -12,7 +12,7 @@ export function createSkillTool(resolve) {
12
12
  },
13
13
  required: ["name"],
14
14
  },
15
- summaryKeys: ["name"],
15
+ argSummaryKeys: ["name"],
16
16
  async execute(args, _ctx) {
17
17
  const name = (args.name || "").trim();
18
18
  if (!name) {
@@ -55,7 +55,7 @@ export function createSubAgentTool(deps) {
55
55
  },
56
56
  required: ["type", "task"],
57
57
  },
58
- summaryKeys: ["type"],
58
+ argSummaryKeys: ["type"],
59
59
  async execute(args, ctx) {
60
60
  const type = args.type;
61
61
  const task = (args.task ?? "").trim();
@@ -25,7 +25,7 @@ export interface Tool {
25
25
  readOnly?: boolean;
26
26
  description: string;
27
27
  parameters: Record<string, unknown>;
28
- summaryKeys?: string[];
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>;
@@ -100,5 +100,5 @@ export const webFetchTool = {
100
100
  summarizeResult(result) {
101
101
  return summaryBytes("Fetched", result, "Fetch failed");
102
102
  },
103
- summaryKeys: ["url"],
103
+ argSummaryKeys: ["url"],
104
104
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vietor/agent-core",
3
- "version": "0.7.1",
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.115.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.4.0",
30
+ "openai": "^7.5.0",
31
31
  "turndown": "^7.2.4",
32
32
  "undici": "^8.10.0"
33
33
  },