@saber2pr/ai-agent 0.0.35 → 0.0.37

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.
@@ -1,5 +1,6 @@
1
1
  import { BaseMessage } from '@langchain/core/messages';
2
2
  import { GraphAgentOptions } from '../types/type';
3
+ import { AgentGraphModel } from '../model/AgentGraphModel';
3
4
  export declare const CONFIG_FILE: string;
4
5
  interface TokenUsage {
5
6
  total: number;
@@ -12,7 +13,7 @@ declare const AgentState: import("@langchain/langgraph").AnnotationRoot<{
12
13
  tokenUsage: import("@langchain/langgraph").BinaryOperatorAggregate<TokenUsage, TokenUsage>;
13
14
  totalDuration: import("@langchain/langgraph").BinaryOperatorAggregate<number, number>;
14
15
  }>;
15
- export default class McpGraphAgent {
16
+ export default class McpGraphAgent<T extends AgentGraphModel = any> {
16
17
  private model;
17
18
  private toolNode;
18
19
  private targetDir;
@@ -27,7 +28,7 @@ export default class McpGraphAgent {
27
28
  private maxTargetCount;
28
29
  private maxTokens;
29
30
  private mcpClients;
30
- constructor(options?: GraphAgentOptions);
31
+ constructor(options?: GraphAgentOptions<T>);
31
32
  private printLoadedTools;
32
33
  private loadMcpConfigs;
33
34
  private initMcpTools;
@@ -37,13 +38,13 @@ export default class McpGraphAgent {
37
38
  private showLoading;
38
39
  private startLoading;
39
40
  private stopLoading;
40
- private getModel;
41
+ getModel(): Promise<T>;
41
42
  private askForConfig;
42
43
  chat(query?: string): Promise<void>;
43
44
  start(): Promise<void>;
44
45
  private renderOutput;
45
46
  callModel(state: typeof AgentState.State): Promise<{
46
- messages: any[];
47
+ messages: import("@langchain/core/messages").AIMessageChunk[];
47
48
  tokenUsage: {
48
49
  total: number;
49
50
  };
@@ -34,8 +34,8 @@ export interface AgentOptions {
34
34
  verbose?: boolean;
35
35
  apiConfig?: ApiConfig;
36
36
  }
37
- export interface GraphAgentOptions extends AgentOptions {
38
- apiModel?: AgentGraphModel;
37
+ export interface GraphAgentOptions<T extends AgentGraphModel = any> extends AgentOptions {
38
+ apiModel?: T;
39
39
  alwaysSystem?: boolean;
40
40
  recursionLimit?: number;
41
41
  maxTargetCount?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saber2pr/ai-agent",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "AI Assistant CLI.",
5
5
  "author": "saber2pr",
6
6
  "license": "ISC",