@agentscope-ai/agentscope 0.0.2 → 0.0.4
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/LICENSE +202 -0
- package/dist/agent/index.d.mts +10 -10
- package/dist/agent/index.d.ts +10 -10
- package/dist/agent/index.js +104 -93
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +104 -93
- package/dist/agent/index.mjs.map +1 -1
- package/dist/{base-BOx3UzOl.d.mts → base-1YVBgB4n.d.mts} +2 -2
- package/dist/{base-DYlBMCy_.d.mts → base-B_MQMHWr.d.mts} +3 -3
- package/dist/{base-Cwi4bjze.d.ts → base-BherSLRs.d.ts} +3 -3
- package/dist/{base-NX-knWOv.d.ts → base-CY4DMBH1.d.ts} +1 -1
- package/dist/{base-BoIps2RL.d.ts → base-ChWjyzPL.d.ts} +2 -2
- package/dist/{base-C7jwyH4Z.d.mts → base-ClilytRZ.d.mts} +1 -1
- package/dist/{block-VsnHrllL.d.mts → block-B72uPF1H.d.mts} +7 -5
- package/dist/{block-VsnHrllL.d.ts → block-B72uPF1H.d.ts} +7 -5
- package/dist/event/index.d.mts +105 -89
- package/dist/event/index.d.ts +105 -89
- package/dist/event/index.js +8 -8
- package/dist/event/index.js.map +1 -1
- package/dist/event/index.mjs +8 -8
- package/dist/event/index.mjs.map +1 -1
- package/dist/formatter/index.d.mts +4 -3
- package/dist/formatter/index.d.ts +4 -3
- package/dist/formatter/index.js +17 -17
- package/dist/formatter/index.js.map +1 -1
- package/dist/formatter/index.mjs +17 -17
- package/dist/formatter/index.mjs.map +1 -1
- package/dist/{index-BcatlwXQ.d.ts → index-BNfyKbQN.d.ts} +1 -1
- package/dist/{index-BTJDlKvQ.d.mts → index-UQCwdfet.d.mts} +1 -1
- package/dist/mcp/index.d.mts +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/index.mjs +1 -1
- package/dist/mcp/index.mjs.map +1 -1
- package/dist/message/index.d.mts +3 -2
- package/dist/message/index.d.ts +3 -2
- package/dist/message/index.js +204 -5
- package/dist/message/index.js.map +1 -1
- package/dist/message/index.mjs +200 -5
- package/dist/message/index.mjs.map +1 -1
- package/dist/message-CPZd0NIc.d.ts +133 -0
- package/dist/message-DgpfAaHK.d.mts +133 -0
- package/dist/model/index.d.mts +6 -5
- package/dist/model/index.d.ts +6 -5
- package/dist/model/index.js +39 -28
- package/dist/model/index.js.map +1 -1
- package/dist/model/index.mjs +39 -28
- package/dist/model/index.mjs.map +1 -1
- package/dist/storage/index.d.mts +4 -3
- package/dist/storage/index.d.ts +4 -3
- package/dist/storage/index.js +4 -4
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/index.mjs +4 -4
- package/dist/storage/index.mjs.map +1 -1
- package/dist/tool/index.d.mts +4 -4
- package/dist/tool/index.d.ts +4 -4
- package/dist/{toolkit-CEpulFi0.d.ts → toolkit-DeOlul5Y.d.ts} +2 -2
- package/dist/{toolkit-CGEZSZPa.d.mts → toolkit-jwe7NmVJ.d.mts} +2 -2
- package/package.json +87 -87
- package/src/agent/agent.test.ts +104 -71
- package/src/agent/agent.ts +112 -104
- package/src/agent/test-compression.ts +1 -1
- package/src/event/index.ts +96 -98
- package/src/formatter/base.ts +3 -3
- package/src/formatter/dashscope-chat-formatter.test.ts +11 -8
- package/src/formatter/dashscope-chat-formatter.ts +3 -3
- package/src/formatter/openai-chat-formatter.test.ts +13 -5
- package/src/formatter/openai-chat-formatter.ts +6 -6
- package/src/mcp/base.ts +1 -1
- package/src/mcp/http.test.ts +2 -0
- package/src/mcp/stdio.test.ts +1 -0
- package/src/message/append-event.test.ts +783 -0
- package/src/message/block.ts +8 -4
- package/src/message/index.ts +12 -1
- package/src/message/message.test.ts +3 -1
- package/src/message/message.ts +310 -47
- package/src/model/dashscope-model.test.ts +4 -0
- package/src/model/dashscope-model.ts +3 -0
- package/src/model/deepseek-model.test.ts +2 -0
- package/src/model/deepseek-model.ts +3 -0
- package/src/model/ollama-model.test.ts +1 -0
- package/src/model/ollama-model.ts +2 -0
- package/src/model/openai-model.ts +3 -0
- package/src/permission/index.ts +13 -0
- package/src/storage/file-system.test.ts +4 -3
- package/src/storage/file-system.ts +4 -4
- package/src/tool/toolkit.test.ts +12 -0
- package/dist/message-CkN21KaY.d.mts +0 -99
- package/dist/message-CzLeTlua.d.ts +0 -99
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Msg } from './message-
|
|
2
|
-
import { T as TextBlock, D as DataBlock } from './block-
|
|
1
|
+
import { M as Msg } from './message-DgpfAaHK.mjs';
|
|
2
|
+
import { T as TextBlock, D as DataBlock } from './block-B72uPF1H.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Base class for message formatters.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { J as JSONSerializableObject, T as ToolSchema, a as ToolChoice } from './index-CAxQAkiP.mjs';
|
|
3
|
-
import { T as TextBlock, b as ToolCallBlock, a as ThinkingBlock, D as DataBlock } from './block-
|
|
4
|
-
import { F as FormatterBase } from './base-
|
|
5
|
-
import { M as Msg } from './message-
|
|
3
|
+
import { T as TextBlock, b as ToolCallBlock, a as ThinkingBlock, D as DataBlock } from './block-B72uPF1H.mjs';
|
|
4
|
+
import { F as FormatterBase } from './base-1YVBgB4n.mjs';
|
|
5
|
+
import { M as Msg } from './message-DgpfAaHK.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The usage structure for chat models.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { J as JSONSerializableObject, T as ToolSchema, a as ToolChoice } from './index-CAxQAkiP.js';
|
|
3
|
-
import { T as TextBlock, b as ToolCallBlock, a as ThinkingBlock, D as DataBlock } from './block-
|
|
4
|
-
import { F as FormatterBase } from './base-
|
|
5
|
-
import { M as Msg } from './message-
|
|
3
|
+
import { T as TextBlock, b as ToolCallBlock, a as ThinkingBlock, D as DataBlock } from './block-B72uPF1H.js';
|
|
4
|
+
import { F as FormatterBase } from './base-ChWjyzPL.js';
|
|
5
|
+
import { M as Msg } from './message-CPZd0NIc.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* The usage structure for chat models.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Msg } from './message-
|
|
2
|
-
import { T as TextBlock, D as DataBlock } from './block-
|
|
1
|
+
import { M as Msg } from './message-CPZd0NIc.js';
|
|
2
|
+
import { T as TextBlock, D as DataBlock } from './block-B72uPF1H.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Base class for message formatters.
|
|
@@ -13,29 +13,31 @@ interface HintBlock {
|
|
|
13
13
|
hint: string;
|
|
14
14
|
id: string;
|
|
15
15
|
}
|
|
16
|
+
type ToolCallState = 'pending' | 'asking' | 'allowed' | 'submitted' | 'finished';
|
|
16
17
|
interface ToolCallBlock {
|
|
17
18
|
type: 'tool_call';
|
|
18
19
|
name: string;
|
|
19
20
|
id: string;
|
|
20
21
|
input: string;
|
|
21
|
-
|
|
22
|
+
state: ToolCallState;
|
|
22
23
|
}
|
|
24
|
+
type ToolResultState = 'success' | 'error' | 'interrupted' | 'denied' | 'running';
|
|
23
25
|
interface ToolResultBlock {
|
|
24
26
|
type: 'tool_result';
|
|
25
27
|
id: string;
|
|
26
28
|
name: string;
|
|
27
29
|
output: string | (TextBlock | DataBlock)[];
|
|
28
|
-
state:
|
|
30
|
+
state: ToolResultState;
|
|
29
31
|
}
|
|
30
32
|
interface Base64Source {
|
|
31
33
|
type: 'base64';
|
|
32
34
|
data: string;
|
|
33
|
-
|
|
35
|
+
media_type: string;
|
|
34
36
|
}
|
|
35
37
|
interface URLSource {
|
|
36
38
|
type: 'url';
|
|
37
39
|
url: string;
|
|
38
|
-
|
|
40
|
+
media_type: string;
|
|
39
41
|
}
|
|
40
42
|
interface DataBlock {
|
|
41
43
|
type: 'data';
|
|
@@ -45,4 +47,4 @@ interface DataBlock {
|
|
|
45
47
|
}
|
|
46
48
|
type ContentBlock = TextBlock | ThinkingBlock | HintBlock | ToolCallBlock | ToolResultBlock | DataBlock;
|
|
47
49
|
|
|
48
|
-
export type { Base64Source as B, ContentBlock as C, DataBlock as D, TextBlock as T, URLSource as U, ThinkingBlock as a, ToolCallBlock as b,
|
|
50
|
+
export type { Base64Source as B, ContentBlock as C, DataBlock as D, TextBlock as T, URLSource as U, ThinkingBlock as a, ToolCallBlock as b, ToolCallState as c, ToolResultBlock as d, ToolResultState as e };
|
|
@@ -13,29 +13,31 @@ interface HintBlock {
|
|
|
13
13
|
hint: string;
|
|
14
14
|
id: string;
|
|
15
15
|
}
|
|
16
|
+
type ToolCallState = 'pending' | 'asking' | 'allowed' | 'submitted' | 'finished';
|
|
16
17
|
interface ToolCallBlock {
|
|
17
18
|
type: 'tool_call';
|
|
18
19
|
name: string;
|
|
19
20
|
id: string;
|
|
20
21
|
input: string;
|
|
21
|
-
|
|
22
|
+
state: ToolCallState;
|
|
22
23
|
}
|
|
24
|
+
type ToolResultState = 'success' | 'error' | 'interrupted' | 'denied' | 'running';
|
|
23
25
|
interface ToolResultBlock {
|
|
24
26
|
type: 'tool_result';
|
|
25
27
|
id: string;
|
|
26
28
|
name: string;
|
|
27
29
|
output: string | (TextBlock | DataBlock)[];
|
|
28
|
-
state:
|
|
30
|
+
state: ToolResultState;
|
|
29
31
|
}
|
|
30
32
|
interface Base64Source {
|
|
31
33
|
type: 'base64';
|
|
32
34
|
data: string;
|
|
33
|
-
|
|
35
|
+
media_type: string;
|
|
34
36
|
}
|
|
35
37
|
interface URLSource {
|
|
36
38
|
type: 'url';
|
|
37
39
|
url: string;
|
|
38
|
-
|
|
40
|
+
media_type: string;
|
|
39
41
|
}
|
|
40
42
|
interface DataBlock {
|
|
41
43
|
type: 'data';
|
|
@@ -45,4 +47,4 @@ interface DataBlock {
|
|
|
45
47
|
}
|
|
46
48
|
type ContentBlock = TextBlock | ThinkingBlock | HintBlock | ToolCallBlock | ToolResultBlock | DataBlock;
|
|
47
49
|
|
|
48
|
-
export type { Base64Source as B, ContentBlock as C, DataBlock as D, TextBlock as T, URLSource as U, ThinkingBlock as a, ToolCallBlock as b,
|
|
50
|
+
export type { Base64Source as B, ContentBlock as C, DataBlock as D, TextBlock as T, URLSource as U, ThinkingBlock as a, ToolCallBlock as b, ToolCallState as c, ToolResultBlock as d, ToolResultState as e };
|
package/dist/event/index.d.mts
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
import { b as ToolCallBlock,
|
|
1
|
+
import { b as ToolCallBlock, d as ToolResultBlock } from '../block-B72uPF1H.mjs';
|
|
2
|
+
|
|
3
|
+
declare enum PermissionBehavior {
|
|
4
|
+
ALLOW = "allow",
|
|
5
|
+
DENY = "deny",
|
|
6
|
+
ASK = "ask",
|
|
7
|
+
PASSTHROUGH = "passthrough"
|
|
8
|
+
}
|
|
9
|
+
interface PermissionRule {
|
|
10
|
+
tool_name: string;
|
|
11
|
+
rule_content: string | null;
|
|
12
|
+
behavior: PermissionBehavior;
|
|
13
|
+
source: string;
|
|
14
|
+
}
|
|
2
15
|
|
|
3
16
|
declare enum EventType {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
17
|
+
REPLY_START = "REPLY_START",
|
|
18
|
+
REPLY_END = "REPLY_END",
|
|
19
|
+
MODEL_CALL_START = "MODEL_CALL_START",
|
|
20
|
+
MODEL_CALL_END = "MODEL_CALL_END",
|
|
8
21
|
TEXT_BLOCK_START = "TEXT_BLOCK_START",
|
|
9
22
|
TEXT_BLOCK_DELTA = "TEXT_BLOCK_DELTA",
|
|
10
23
|
TEXT_BLOCK_END = "TEXT_BLOCK_END",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
24
|
+
DATA_BLOCK_START = "DATA_BLOCK_START",
|
|
25
|
+
DATA_BLOCK_DELTA = "DATA_BLOCK_DELTA",
|
|
26
|
+
DATA_BLOCK_END = "DATA_BLOCK_END",
|
|
14
27
|
THINKING_BLOCK_START = "THINKING_BLOCK_START",
|
|
15
28
|
THINKING_BLOCK_DELTA = "THINKING_BLOCK_DELTA",
|
|
16
29
|
THINKING_BLOCK_END = "THINKING_BLOCK_END",
|
|
@@ -19,7 +32,7 @@ declare enum EventType {
|
|
|
19
32
|
TOOL_CALL_END = "TOOL_CALL_END",
|
|
20
33
|
TOOL_RESULT_START = "TOOL_RESULT_START",
|
|
21
34
|
TOOL_RESULT_TEXT_DELTA = "TOOL_RESULT_TEXT_DELTA",
|
|
22
|
-
|
|
35
|
+
TOOL_RESULT_DATA_DELTA = "TOOL_RESULT_DATA_DELTA",
|
|
23
36
|
TOOL_RESULT_END = "TOOL_RESULT_END",
|
|
24
37
|
EXCEED_MAX_ITERS = "EXCEED_MAX_ITERS",
|
|
25
38
|
REQUIRE_USER_CONFIRM = "REQUIRE_USER_CONFIRM",
|
|
@@ -29,153 +42,156 @@ declare enum EventType {
|
|
|
29
42
|
}
|
|
30
43
|
interface EventBase {
|
|
31
44
|
id: string;
|
|
32
|
-
|
|
45
|
+
created_at: string;
|
|
33
46
|
}
|
|
34
|
-
interface
|
|
35
|
-
type: EventType.
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
interface ReplyStartEvent extends EventBase {
|
|
48
|
+
type: EventType.REPLY_START;
|
|
49
|
+
session_id: string;
|
|
50
|
+
reply_id: string;
|
|
38
51
|
name: string;
|
|
39
52
|
role: 'user' | 'assistant' | 'system';
|
|
40
53
|
}
|
|
41
|
-
interface
|
|
42
|
-
type: EventType.
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
interface ReplyEndEvent extends EventBase {
|
|
55
|
+
type: EventType.REPLY_END;
|
|
56
|
+
session_id: string;
|
|
57
|
+
reply_id: string;
|
|
45
58
|
}
|
|
46
|
-
interface
|
|
47
|
-
type: EventType.
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
interface ModelCallStartEvent extends EventBase {
|
|
60
|
+
type: EventType.MODEL_CALL_START;
|
|
61
|
+
reply_id: string;
|
|
62
|
+
model_name: string;
|
|
50
63
|
}
|
|
51
|
-
interface
|
|
52
|
-
type: EventType.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
interface ModelCallEndEvent extends EventBase {
|
|
65
|
+
type: EventType.MODEL_CALL_END;
|
|
66
|
+
reply_id: string;
|
|
67
|
+
input_tokens: number;
|
|
68
|
+
output_tokens: number;
|
|
56
69
|
}
|
|
57
70
|
interface TextBlockStartEvent extends EventBase {
|
|
58
71
|
type: EventType.TEXT_BLOCK_START;
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
block_id: string;
|
|
73
|
+
reply_id: string;
|
|
61
74
|
}
|
|
62
75
|
interface TextBlockDeltaEvent extends EventBase {
|
|
63
76
|
type: EventType.TEXT_BLOCK_DELTA;
|
|
64
|
-
|
|
65
|
-
|
|
77
|
+
reply_id: string;
|
|
78
|
+
block_id: string;
|
|
66
79
|
delta: string;
|
|
67
80
|
}
|
|
68
81
|
interface TextBlockEndEvent extends EventBase {
|
|
69
82
|
type: EventType.TEXT_BLOCK_END;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
interface
|
|
74
|
-
type: EventType.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
interface
|
|
80
|
-
type: EventType.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
reply_id: string;
|
|
84
|
+
block_id: string;
|
|
85
|
+
}
|
|
86
|
+
interface DataBlockStartEvent extends EventBase {
|
|
87
|
+
type: EventType.DATA_BLOCK_START;
|
|
88
|
+
reply_id: string;
|
|
89
|
+
block_id: string;
|
|
90
|
+
media_type: string;
|
|
91
|
+
}
|
|
92
|
+
interface DataBlockDeltaEvent extends EventBase {
|
|
93
|
+
type: EventType.DATA_BLOCK_DELTA;
|
|
94
|
+
reply_id: string;
|
|
95
|
+
block_id: string;
|
|
83
96
|
data: string;
|
|
84
|
-
|
|
97
|
+
media_type: string;
|
|
85
98
|
}
|
|
86
|
-
interface
|
|
87
|
-
type: EventType.
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
interface DataBlockEndEvent extends EventBase {
|
|
100
|
+
type: EventType.DATA_BLOCK_END;
|
|
101
|
+
reply_id: string;
|
|
102
|
+
block_id: string;
|
|
90
103
|
}
|
|
91
104
|
interface ThinkingBlockStartEvent extends EventBase {
|
|
92
105
|
type: EventType.THINKING_BLOCK_START;
|
|
93
|
-
|
|
94
|
-
|
|
106
|
+
reply_id: string;
|
|
107
|
+
block_id: string;
|
|
95
108
|
}
|
|
96
109
|
interface ThinkingBlockDeltaEvent extends EventBase {
|
|
97
110
|
type: EventType.THINKING_BLOCK_DELTA;
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
reply_id: string;
|
|
112
|
+
block_id: string;
|
|
100
113
|
delta: string;
|
|
101
114
|
}
|
|
102
115
|
interface ThinkingBlockEndEvent extends EventBase {
|
|
103
116
|
type: EventType.THINKING_BLOCK_END;
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
reply_id: string;
|
|
118
|
+
block_id: string;
|
|
106
119
|
}
|
|
107
120
|
interface ToolCallStartEvent extends EventBase {
|
|
108
121
|
type: EventType.TOOL_CALL_START;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
reply_id: string;
|
|
123
|
+
tool_call_id: string;
|
|
124
|
+
tool_call_name: string;
|
|
112
125
|
}
|
|
113
126
|
interface ToolCallDeltaEvent extends EventBase {
|
|
114
127
|
type: EventType.TOOL_CALL_DELTA;
|
|
115
|
-
|
|
116
|
-
|
|
128
|
+
reply_id: string;
|
|
129
|
+
tool_call_id: string;
|
|
117
130
|
delta: string;
|
|
118
131
|
}
|
|
119
132
|
interface ToolCallEndEvent extends EventBase {
|
|
120
133
|
type: EventType.TOOL_CALL_END;
|
|
121
|
-
|
|
122
|
-
|
|
134
|
+
reply_id: string;
|
|
135
|
+
tool_call_id: string;
|
|
123
136
|
}
|
|
124
137
|
interface ToolResultStartEvent extends EventBase {
|
|
125
138
|
type: EventType.TOOL_RESULT_START;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
139
|
+
reply_id: string;
|
|
140
|
+
tool_call_id: string;
|
|
141
|
+
tool_call_name: string;
|
|
129
142
|
}
|
|
130
143
|
interface ToolResultTextDeltaEvent extends EventBase {
|
|
131
144
|
type: EventType.TOOL_RESULT_TEXT_DELTA;
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
reply_id: string;
|
|
146
|
+
tool_call_id: string;
|
|
147
|
+
block_id: string;
|
|
134
148
|
delta: string;
|
|
135
149
|
}
|
|
136
|
-
interface
|
|
137
|
-
type: EventType.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
150
|
+
interface ToolResultDataDeltaEvent extends EventBase {
|
|
151
|
+
type: EventType.TOOL_RESULT_DATA_DELTA;
|
|
152
|
+
reply_id: string;
|
|
153
|
+
tool_call_id: string;
|
|
154
|
+
block_id: string;
|
|
155
|
+
media_type: string;
|
|
141
156
|
data?: string;
|
|
142
157
|
url?: string;
|
|
143
158
|
}
|
|
144
159
|
interface ToolResultEndEvent extends EventBase {
|
|
145
160
|
type: EventType.TOOL_RESULT_END;
|
|
146
|
-
|
|
147
|
-
|
|
161
|
+
reply_id: string;
|
|
162
|
+
tool_call_id: string;
|
|
148
163
|
state: ToolResultBlock['state'];
|
|
149
164
|
}
|
|
150
165
|
interface ExceedMaxItersEvent extends EventBase {
|
|
151
166
|
type: EventType.EXCEED_MAX_ITERS;
|
|
152
|
-
|
|
153
|
-
agentId: string;
|
|
167
|
+
reply_id: string;
|
|
154
168
|
name: string;
|
|
155
169
|
}
|
|
156
170
|
interface RequireUserConfirmEvent extends EventBase {
|
|
157
171
|
type: EventType.REQUIRE_USER_CONFIRM;
|
|
158
|
-
|
|
159
|
-
|
|
172
|
+
reply_id: string;
|
|
173
|
+
tool_calls: ToolCallBlock[];
|
|
160
174
|
}
|
|
161
175
|
interface RequireExternalExecutionEvent extends EventBase {
|
|
162
176
|
type: EventType.REQUIRE_EXTERNAL_EXECUTION;
|
|
163
|
-
|
|
164
|
-
|
|
177
|
+
reply_id: string;
|
|
178
|
+
tool_calls: ToolCallBlock[];
|
|
179
|
+
}
|
|
180
|
+
interface ConfirmResult {
|
|
181
|
+
confirmed: boolean;
|
|
182
|
+
tool_call: ToolCallBlock;
|
|
183
|
+
rules?: PermissionRule[] | null;
|
|
165
184
|
}
|
|
166
185
|
interface UserConfirmResultEvent extends EventBase {
|
|
167
186
|
type: EventType.USER_CONFIRM_RESULT;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
confirmed: boolean;
|
|
171
|
-
toolCall: ToolCallBlock;
|
|
172
|
-
}[];
|
|
187
|
+
reply_id: string;
|
|
188
|
+
confirm_results: ConfirmResult[];
|
|
173
189
|
}
|
|
174
190
|
interface ExternalExecutionResultEvent extends EventBase {
|
|
175
191
|
type: EventType.EXTERNAL_EXECUTION_RESULT;
|
|
176
|
-
|
|
177
|
-
|
|
192
|
+
reply_id: string;
|
|
193
|
+
execution_results: ToolResultBlock[];
|
|
178
194
|
}
|
|
179
|
-
type AgentEvent =
|
|
195
|
+
type AgentEvent = ReplyStartEvent | ReplyEndEvent | ExceedMaxItersEvent | RequireUserConfirmEvent | RequireExternalExecutionEvent | ModelCallStartEvent | ModelCallEndEvent | TextBlockStartEvent | TextBlockDeltaEvent | TextBlockEndEvent | DataBlockStartEvent | DataBlockDeltaEvent | DataBlockEndEvent | ThinkingBlockStartEvent | ThinkingBlockDeltaEvent | ThinkingBlockEndEvent | ToolCallStartEvent | ToolCallDeltaEvent | ToolCallEndEvent | ToolResultStartEvent | ToolResultTextDeltaEvent | ToolResultDataDeltaEvent | ToolResultEndEvent | UserConfirmResultEvent | ExternalExecutionResultEvent;
|
|
180
196
|
|
|
181
|
-
export { type AgentEvent, type
|
|
197
|
+
export { type AgentEvent, type ConfirmResult, type DataBlockDeltaEvent, type DataBlockEndEvent, type DataBlockStartEvent, type EventBase, EventType, type ExceedMaxItersEvent, type ExternalExecutionResultEvent, type ModelCallEndEvent, type ModelCallStartEvent, type ReplyEndEvent, type ReplyStartEvent, type RequireExternalExecutionEvent, type RequireUserConfirmEvent, type TextBlockDeltaEvent, type TextBlockEndEvent, type TextBlockStartEvent, type ThinkingBlockDeltaEvent, type ThinkingBlockEndEvent, type ThinkingBlockStartEvent, type ToolCallDeltaEvent, type ToolCallEndEvent, type ToolCallStartEvent, type ToolResultDataDeltaEvent, type ToolResultEndEvent, type ToolResultStartEvent, type ToolResultTextDeltaEvent, type UserConfirmResultEvent };
|