@frockbot/plugin-echo 0.3.1 → 0.3.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/package.json +5 -5
- package/src/agent.test.ts +11 -2
- package/src/agent.ts +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/plugin-echo",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@frockbot/kernel-contracts": "0.3.
|
|
22
|
-
"@frockbot/plugin-models": "0.3.
|
|
23
|
-
"@frockbot/plugin-tools": "0.3.
|
|
21
|
+
"@frockbot/kernel-contracts": "0.3.3",
|
|
22
|
+
"@frockbot/plugin-models": "0.3.3",
|
|
23
|
+
"@frockbot/plugin-tools": "0.3.3",
|
|
24
24
|
"cordis": "4.0.0-rc.8"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@frockbot/plugin-testkit": "0.3.
|
|
27
|
+
"@frockbot/plugin-testkit": "0.3.3",
|
|
28
28
|
"@types/bun": "1.4.0",
|
|
29
29
|
"typescript": "^7.0.2"
|
|
30
30
|
},
|
package/src/agent.test.ts
CHANGED
|
@@ -54,7 +54,14 @@ describe("echo plugin", () => {
|
|
|
54
54
|
expect(events).toHaveLength(2);
|
|
55
55
|
expect(events[0]).toMatchObject({
|
|
56
56
|
type: "tool-call",
|
|
57
|
-
call: {
|
|
57
|
+
call: {
|
|
58
|
+
name: "call_dynamic_tool",
|
|
59
|
+
input: {
|
|
60
|
+
namespace: "frockbot",
|
|
61
|
+
toolName: ECHO_TOOL_NAME,
|
|
62
|
+
arguments: { text: "hello plugins" },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
58
65
|
});
|
|
59
66
|
const first = events[0];
|
|
60
67
|
if (first?.type !== "tool-call") throw new Error("expected a tool call");
|
|
@@ -81,7 +88,9 @@ describe("echo plugin", () => {
|
|
|
81
88
|
).toEqual({ content: "hello plugins", isError: false });
|
|
82
89
|
|
|
83
90
|
await fiber.dispose();
|
|
84
|
-
expect(
|
|
91
|
+
expect(
|
|
92
|
+
harness.root.tools.schemas({ turnType: "chat" }).map((tool) => tool.name),
|
|
93
|
+
).toEqual(["get_dynamic_tools", "call_dynamic_tool"]);
|
|
85
94
|
await harness.dispose();
|
|
86
95
|
});
|
|
87
96
|
|
package/src/agent.ts
CHANGED
|
@@ -22,6 +22,7 @@ function decodeEchoInput(input: unknown): EchoInput | undefined {
|
|
|
22
22
|
|
|
23
23
|
export const echoTool: ToolDefinition = {
|
|
24
24
|
name: ECHO_TOOL_NAME,
|
|
25
|
+
namespace: "frockbot",
|
|
25
26
|
description: "Return text to the conversation unchanged.",
|
|
26
27
|
inputSchema: {
|
|
27
28
|
type: "object",
|
|
@@ -56,7 +57,15 @@ async function* requestEchoTool(
|
|
|
56
57
|
yield {
|
|
57
58
|
// pi-lens-ignore: ts:2322
|
|
58
59
|
type: "tool-call",
|
|
59
|
-
call: {
|
|
60
|
+
call: {
|
|
61
|
+
id: crypto.randomUUID(),
|
|
62
|
+
name: "call_dynamic_tool",
|
|
63
|
+
input: {
|
|
64
|
+
namespace: "frockbot",
|
|
65
|
+
toolName: ECHO_TOOL_NAME,
|
|
66
|
+
arguments: { text },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
60
69
|
};
|
|
61
70
|
yield {
|
|
62
71
|
type: "finish",
|