@aigne/example-mcp-puppeteer 1.8.0 → 1.9.0

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/README.md CHANGED
@@ -105,7 +105,7 @@ The following example demonstrates how to extract content from a website:
105
105
 
106
106
  ```typescript
107
107
  import assert from "node:assert";
108
- import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
108
+ import { AIAgent, AIGNE, MCPAgent } from "@aigne/core";
109
109
  import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
110
110
 
111
111
  const { OPENAI_API_KEY } = process.env;
@@ -120,9 +120,9 @@ const puppeteerMCPAgent = await MCPAgent.from({
120
120
  args: ["-y", "@modelcontextprotocol/server-puppeteer"],
121
121
  });
122
122
 
123
- const engine = new ExecutionEngine({
123
+ const aigne = new AIGNE({
124
124
  model,
125
- tools: [puppeteerMCPAgent],
125
+ skills: [puppeteerMCPAgent],
126
126
  });
127
127
 
128
128
  const agent = AIAgent.from({
@@ -133,7 +133,7 @@ const agent = AIAgent.from({
133
133
  `,
134
134
  });
135
135
 
136
- const result = await engine.call(agent, "extract content from https://www.arcblock.io");
136
+ const result = await aigne.invoke(agent, "extract content from https://www.arcblock.io");
137
137
 
138
138
  console.log(result);
139
139
  // output:
@@ -141,7 +141,7 @@ console.log(result);
141
141
  // $message: "The content extracted from the website [ArcBlock](https://www.arcblock.io) is as follows:\n\n---\n\n**Redefining Software Architect and Ecosystems**\n\nA total solution for building decentralized applications ...",
142
142
  // }
143
143
 
144
- await engine.shutdown();
144
+ await aigne.shutdown();
145
145
  ```
146
146
 
147
147
  ## License
package/index.test.ts CHANGED
@@ -1,5 +1,11 @@
1
- import { test } from "bun:test";
1
+ import { expect, test } from "bun:test";
2
+ import { runExampleTest } from "@aigne/test-utils/run-example-test.js";
2
3
 
3
- test("should successfully execute the mcp-puppeteer", () => import("./index.js"), {
4
- timeout: 100000,
5
- });
4
+ test(
5
+ "should successfully run the mcp-puppeteer",
6
+ async () => {
7
+ const { code } = await runExampleTest();
8
+ expect(code).toBe(0);
9
+ },
10
+ { timeout: 600000 },
11
+ );
package/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bunwrapper
2
2
 
3
3
  import { runChatLoopInTerminal } from "@aigne/cli/utils/run-chat-loop.js";
4
- import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
4
+ import { AIAgent, AIGNE, MCPAgent } from "@aigne/core";
5
5
  import { loadModel } from "@aigne/core/loader/index.js";
6
6
  import { logger } from "@aigne/core/utils/logger.js";
7
7
 
@@ -15,9 +15,9 @@ const puppeteer = await MCPAgent.from({
15
15
  env: process.env as Record<string, string>,
16
16
  });
17
17
 
18
- const engine = new ExecutionEngine({
18
+ const aigne = new AIGNE({
19
19
  model,
20
- tools: [puppeteer],
20
+ skills: [puppeteer],
21
21
  });
22
22
 
23
23
  const agent = AIAgent.from({
@@ -30,7 +30,7 @@ const agent = AIAgent.from({
30
30
  memory: true,
31
31
  });
32
32
 
33
- const userAgent = engine.call(agent);
33
+ const userAgent = aigne.invoke(agent);
34
34
 
35
35
  await runChatLoopInTerminal(userAgent, {
36
36
  welcome:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/example-mcp-puppeteer",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "A demonstration of using AIGNE Framework and Puppeteer MCP Server to extract content from websites using Puppeteer",
5
5
  "author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
6
6
  "homepage": "https://github.com/AIGNE-io/aigne-framework/tree/main/examples/mcp-puppeteer",
@@ -18,8 +18,11 @@
18
18
  "dependencies": {
19
19
  "openai": "^4.94.0",
20
20
  "zod": "^3.24.2",
21
- "@aigne/cli": "^1.7.0",
22
- "@aigne/core": "^1.11.0"
21
+ "@aigne/cli": "^1.8.0",
22
+ "@aigne/core": "^1.12.0"
23
+ },
24
+ "devDependencies": {
25
+ "@aigne/test-utils": "^0.1.0"
23
26
  },
24
27
  "scripts": {
25
28
  "start": "bun run index.ts",
package/usages.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert";
2
- import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
2
+ import { AIAgent, AIGNE, MCPAgent } from "@aigne/core";
3
3
  import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
4
4
 
5
5
  const { OPENAI_API_KEY } = process.env;
@@ -14,9 +14,9 @@ const puppeteerMCPAgent = await MCPAgent.from({
14
14
  args: ["-y", "@modelcontextprotocol/server-puppeteer"],
15
15
  });
16
16
 
17
- const engine = new ExecutionEngine({
17
+ const aigne = new AIGNE({
18
18
  model,
19
- tools: [puppeteerMCPAgent],
19
+ skills: [puppeteerMCPAgent],
20
20
  });
21
21
 
22
22
  const agent = AIAgent.from({
@@ -27,7 +27,7 @@ const agent = AIAgent.from({
27
27
  `,
28
28
  });
29
29
 
30
- const result = await engine.call(agent, "extract content from https://www.arcblock.io");
30
+ const result = await aigne.invoke(agent, "extract content from https://www.arcblock.io");
31
31
 
32
32
  console.log(result);
33
33
  // output:
@@ -35,4 +35,4 @@ console.log(result);
35
35
  // $message: "The content extracted from the website [ArcBlock](https://www.arcblock.io) is as follows:\n\n---\n\n**Redefining Software Architect and Ecosystems**\n\nA total solution for building decentralized applications ...",
36
36
  // }
37
37
 
38
- await engine.shutdown();
38
+ await aigne.shutdown();