agent-tool-chat 1.0.2 → 1.1.1

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/types.d.ts CHANGED
@@ -7,13 +7,16 @@ export interface ToolDefinition {
7
7
  parameters: Record<string, any>;
8
8
  displayHints?: {
9
9
  suggestComponent?: string;
10
- resultFormat?: 'table' | 'card' | 'list' | 'text' | 'map';
10
+ resultFormat?: 'table' | 'card' | 'list' | 'text' | 'map' | 'none' | 'auto';
11
11
  previewFields?: string[];
12
12
  summaryTemplate?: string;
13
13
  suggestedNext?: string;
14
14
  selectable?: boolean;
15
15
  labelField?: string;
16
16
  suggestedNextEvent?: string;
17
+ /** 是否展示大模型对该工具结果的 md 文字回复,默认 true;
18
+ * 设为 false(且本工具配置了 resultFormat 结构化输出)时隐藏模型 md,避免与卡片/表格重复 */
19
+ showModelContent?: boolean;
17
20
  };
18
21
  }
19
22
  export interface ToolPackage {
@@ -30,7 +33,7 @@ export interface ToolCallEvent {
30
33
  args: Record<string, any>;
31
34
  }
32
35
  export interface RenderBlock {
33
- type: 'component' | 'table' | 'card' | 'list';
36
+ type: 'component' | 'table' | 'card' | 'list' | 'auto' | 'none';
34
37
  packageId?: string;
35
38
  componentName?: string;
36
39
  title?: string;
@@ -72,6 +75,8 @@ export interface ChatMessage {
72
75
  files?: FileAttachment[];
73
76
  /** 工具调用结果 */
74
77
  toolResults?: ToolResult[];
78
+ /** 隐藏本条消息的大模型 md 内容(由 displayHints.showModelContent=false 触发) */
79
+ hideMarkdown?: boolean;
75
80
  }
76
81
  export interface ToolResult {
77
82
  callId: string;
@@ -89,6 +94,14 @@ export interface ChatSettings {
89
94
  useTools?: boolean;
90
95
  providerMode: 'direct' | 'proxy';
91
96
  proxyUrl: string;
97
+ /** 思考模式(推理/思维链)开关 */
98
+ thinking?: boolean;
99
+ /** 思考强度:低/高/最大 */
100
+ thinkingEffort?: 'low' | 'high' | 'max';
101
+ /** md 内容表格行点击选择(触发"我选择 X"回灌对话),默认关闭 */
102
+ mdTableClick?: boolean;
103
+ /** md 内容列表项点击执行,默认关闭 */
104
+ mdListClick?: boolean;
92
105
  }
93
106
  export declare const DEFAULT_SETTINGS: ChatSettings;
94
107
  export interface ChatCommand {
@@ -100,6 +113,8 @@ export interface AgentChatOptions {
100
113
  onToolCall?: (call: ToolCallEvent) => Promise<any>;
101
114
  provider?: any;
102
115
  providerConfig?: Partial<LLMProviderConfig>;
116
+ /** 初始设置项:合并到 DEFAULT_SETTINGS(用户已保存的本地设置优先) */
117
+ settings?: Partial<ChatSettings>;
103
118
  systemPrompt?: string;
104
119
  storagePrefix?: string;
105
120
  /** 上传的文件数据是否发给 LLM,默认 false(仅前端展示) */
@@ -110,6 +125,10 @@ export interface AgentChatOptions {
110
125
  suggestedCommands?: ChatCommand[];
111
126
  /** 内置工具开关:true=全启用(默认) / string[]=按工具名启用 / false=关闭 */
112
127
  builtInTools?: boolean | string[];
128
+ /** 发给模型的历史令牌预算(约值),超出从前往后裁剪;≤0 表示不限制。默认 48000(见 useAgentChat) */
129
+ maxContextTokens?: number;
130
+ /** 历史消息硬上限(条),超出仅保留最近 N 条;≤0 表示不限制。默认 60(见 useAgentChat) */
131
+ maxHistoryMessages?: number;
113
132
  }
114
133
  export interface BusinessEvent {
115
134
  type: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "agent-tool-chat",
3
3
  "description": "An agent-driven chat plugin with ToolPackage architecture and host-controlled execution",
4
4
  "author": "kangjinrui <1092014304@qq.com>",
5
- "version": "1.0.2",
5
+ "version": "1.1.1",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "type": "module",