@agentscope-ai/agentscope 0.0.4 → 0.0.5
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/agent/index.d.mts +7 -7
- package/dist/agent/index.d.ts +7 -7
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/{base-ClilytRZ.d.mts → base-BB9eTlit.d.mts} +1 -1
- package/dist/{base-B_MQMHWr.d.mts → base-BDyDUIhj.d.mts} +3 -3
- package/dist/{base-1YVBgB4n.d.mts → base-BI5s2ksj.d.mts} +2 -2
- package/dist/{base-ChWjyzPL.d.ts → base-CFDeoJRe.d.ts} +2 -2
- package/dist/{base-CY4DMBH1.d.ts → base-DHtZCg94.d.ts} +1 -1
- package/dist/{base-BherSLRs.d.ts → base-qmU135_k.d.ts} +3 -3
- package/dist/{block-B72uPF1H.d.mts → block-BqWf-Qcb.d.mts} +15 -1
- package/dist/{block-B72uPF1H.d.ts → block-BqWf-Qcb.d.ts} +15 -1
- package/dist/event/index.d.mts +1 -14
- package/dist/event/index.d.ts +1 -14
- package/dist/formatter/index.d.mts +3 -3
- package/dist/formatter/index.d.ts +3 -3
- package/dist/formatter/index.js.map +1 -1
- package/dist/formatter/index.mjs.map +1 -1
- package/dist/{index-BNfyKbQN.d.ts → index-9YC8onn7.d.ts} +1 -1
- package/dist/{index-UQCwdfet.d.mts → index-DpRGxYeT.d.mts} +1 -1
- package/dist/mcp/index.d.mts +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/message/index.d.mts +2 -2
- package/dist/message/index.d.ts +2 -2
- package/dist/message/index.js +17 -1
- package/dist/message/index.js.map +1 -1
- package/dist/message/index.mjs +17 -1
- package/dist/message/index.mjs.map +1 -1
- package/dist/{message-DgpfAaHK.d.mts → message-D-LObC06.d.mts} +1 -1
- package/dist/{message-CPZd0NIc.d.ts → message-DU0_qm3u.d.ts} +1 -1
- package/dist/model/index.d.mts +5 -5
- package/dist/model/index.d.ts +5 -5
- package/dist/model/index.js.map +1 -1
- package/dist/model/index.mjs.map +1 -1
- package/dist/storage/index.d.mts +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/tool/index.d.mts +4 -4
- package/dist/tool/index.d.ts +4 -4
- package/dist/{toolkit-DeOlul5Y.d.ts → toolkit-CLGa-xW0.d.ts} +2 -2
- package/dist/{toolkit-jwe7NmVJ.d.mts → toolkit-DvER4yhm.d.mts} +2 -2
- package/package.json +1 -1
- package/src/message/block.ts +3 -0
- package/src/message/message.ts +19 -1
package/dist/storage/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as StorageBase, A as AgentState } from '../base-
|
|
2
|
-
import { M as Msg } from '../message-
|
|
1
|
+
import { S as StorageBase, A as AgentState } from '../base-BB9eTlit.mjs';
|
|
2
|
+
import { M as Msg } from '../message-D-LObC06.mjs';
|
|
3
3
|
import '../index-CAxQAkiP.mjs';
|
|
4
|
-
import '../block-
|
|
4
|
+
import '../block-BqWf-Qcb.mjs';
|
|
5
5
|
import '../event/index.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as StorageBase, A as AgentState } from '../base-
|
|
2
|
-
import { M as Msg } from '../message-
|
|
1
|
+
import { S as StorageBase, A as AgentState } from '../base-DHtZCg94.js';
|
|
2
|
+
import { M as Msg } from '../message-DU0_qm3u.js';
|
|
3
3
|
import '../index-CAxQAkiP.js';
|
|
4
|
-
import '../block-
|
|
4
|
+
import '../block-BqWf-Qcb.js';
|
|
5
5
|
import '../event/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/tool/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as ToolResponse } from '../index-
|
|
2
|
-
export { T as Tool } from '../index-
|
|
3
|
-
export { T as Toolkit } from '../toolkit-
|
|
1
|
+
import { a as ToolResponse } from '../index-DpRGxYeT.mjs';
|
|
2
|
+
export { T as Tool } from '../index-DpRGxYeT.mjs';
|
|
3
|
+
export { T as Toolkit } from '../toolkit-DvER4yhm.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
6
6
|
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
7
7
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
8
8
|
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
9
9
|
import '../index-CAxQAkiP.mjs';
|
|
10
|
-
import '../block-
|
|
10
|
+
import '../block-BqWf-Qcb.mjs';
|
|
11
11
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
12
12
|
|
|
13
13
|
/**
|
package/dist/tool/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as ToolResponse } from '../index-
|
|
2
|
-
export { T as Tool } from '../index-
|
|
3
|
-
export { T as Toolkit } from '../toolkit-
|
|
1
|
+
import { a as ToolResponse } from '../index-9YC8onn7.js';
|
|
2
|
+
export { T as Tool } from '../index-9YC8onn7.js';
|
|
3
|
+
export { T as Toolkit } from '../toolkit-CLGa-xW0.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
6
6
|
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
7
7
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
8
8
|
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
9
9
|
import '../index-CAxQAkiP.js';
|
|
10
|
-
import '../block-
|
|
10
|
+
import '../block-BqWf-Qcb.js';
|
|
11
11
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as Tool, H as HTTPMCPClient, S as StdioMCPClient, a as ToolResponse } from './index-
|
|
1
|
+
import { T as Tool, H as HTTPMCPClient, S as StdioMCPClient, a as ToolResponse } from './index-9YC8onn7.js';
|
|
2
2
|
import { T as ToolSchema } from './index-CAxQAkiP.js';
|
|
3
|
-
import { b as ToolCallBlock } from './block-
|
|
3
|
+
import { b as ToolCallBlock } from './block-BqWf-Qcb.js';
|
|
4
4
|
|
|
5
5
|
interface RegisteredTool extends Tool {
|
|
6
6
|
type: 'function' | 'mcp';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as Tool, H as HTTPMCPClient, S as StdioMCPClient, a as ToolResponse } from './index-
|
|
1
|
+
import { T as Tool, H as HTTPMCPClient, S as StdioMCPClient, a as ToolResponse } from './index-DpRGxYeT.mjs';
|
|
2
2
|
import { T as ToolSchema } from './index-CAxQAkiP.mjs';
|
|
3
|
-
import { b as ToolCallBlock } from './block-
|
|
3
|
+
import { b as ToolCallBlock } from './block-BqWf-Qcb.mjs';
|
|
4
4
|
|
|
5
5
|
interface RegisteredTool extends Tool {
|
|
6
6
|
type: 'function' | 'mcp';
|
package/package.json
CHANGED
package/src/message/block.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PermissionRule } from '../permission';
|
|
2
|
+
|
|
1
3
|
export interface TextBlock {
|
|
2
4
|
type: 'text';
|
|
3
5
|
text: string;
|
|
@@ -24,6 +26,7 @@ export interface ToolCallBlock {
|
|
|
24
26
|
id: string;
|
|
25
27
|
input: string;
|
|
26
28
|
state: ToolCallState;
|
|
29
|
+
suggested_rules?: PermissionRule[];
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
export type ToolResultState = 'success' | 'error' | 'interrupted' | 'denied' | 'running';
|
package/src/message/message.ts
CHANGED
|
@@ -360,10 +360,28 @@ export function appendEvent(msg: Msg, event: AgentEvent): Msg {
|
|
|
360
360
|
break;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
+
case EventType.MODEL_CALL_END:
|
|
364
|
+
// Accumulated the input and output tokens here.
|
|
365
|
+
if (msg.usage) {
|
|
366
|
+
msg.usage.inputTokens += event.input_tokens;
|
|
367
|
+
msg.usage.outputTokens += event.output_tokens;
|
|
368
|
+
} else {
|
|
369
|
+
msg.usage = {
|
|
370
|
+
inputTokens: event.input_tokens,
|
|
371
|
+
outputTokens: event.output_tokens,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
|
|
363
376
|
case EventType.REQUIRE_USER_CONFIRM:
|
|
364
377
|
for (const tc of event.tool_calls) {
|
|
365
378
|
const b = findBlock(msg, 'tool_call', tc.id);
|
|
366
|
-
if (b)
|
|
379
|
+
if (b) {
|
|
380
|
+
(b as ToolCallBlock).state = 'asking';
|
|
381
|
+
if (tc.suggested_rules !== undefined) {
|
|
382
|
+
(b as ToolCallBlock).suggested_rules = tc.suggested_rules;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
367
385
|
}
|
|
368
386
|
break;
|
|
369
387
|
|