wuying-agentbay-sdk 0.7.0 → 0.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
@@ -24,18 +24,23 @@ async function main() {
24
24
  // Create session
25
25
  const agentBay = new AgentBay();
26
26
  const result = await agentBay.create();
27
-
27
+ // Verified: ✓ Client initialized and session created successfully
28
+
28
29
  if (result.success) {
29
30
  const session = result.session;
30
-
31
+
31
32
  // Execute command
32
33
  const cmdResult = await session.command.executeCommand("ls -la");
33
34
  console.log(cmdResult.output);
34
-
35
+ // Verified: ✓ Command executed successfully
36
+ // Sample output: "总计 100\ndrwxr-x--- 16 wuying wuying 4096..."
37
+
35
38
  // File operations
36
39
  await session.fileSystem.writeFile("/tmp/test.txt", "Hello World");
37
40
  const content = await session.fileSystem.readFile("/tmp/test.txt");
38
- console.log(content.data);
41
+ console.log(content.content);
42
+ // Verified: ✓ File written and read successfully
43
+ // Output: "Hello World"
39
44
  }
40
45
  }
41
46
 
@@ -45,18 +50,22 @@ main().catch(console.error);
45
50
  ## 📖 Complete Documentation
46
51
 
47
52
  ### 🆕 New Users
48
- - [📚 Quick Start Tutorial](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/quickstart) - Get started in 5 minutes
53
+ - [📚 Quick Start Tutorial](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/quickstart/README.md) - Get started in 5 minutes
49
54
  - [🎯 Core Concepts](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/quickstart/basic-concepts.md) - Understanding cloud environments and sessions
50
- - [💡 Best Practices](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/quickstart/best-practices.md) - Common patterns and techniques
51
55
 
52
56
  ### 🚀 Experienced Users
53
- - [📖 Feature Guides](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/guides) - Complete feature introduction
54
- - [🔧 TypeScript API Reference](docs/api/) - Detailed API documentation
55
- - [💻 TypeScript Examples](docs/examples/) - Complete example code
57
+ **Choose Your Cloud Environment:**
58
+ - 🌐 [Browser Use](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/guides/browser-use/README.md) - Web scraping, browser testing, form automation
59
+ - 🖥️ [Computer Use](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/guides/computer-use/README.md) - Windows desktop automation, UI testing
60
+ - 📱 [Mobile Use](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/guides/mobile-use/README.md) - Android UI testing, mobile app automation
61
+ - 💻 [CodeSpace](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/guides/codespace/README.md) - Code execution, development environments
62
+
63
+ **Additional Resources:**
64
+ - [📖 Feature Guides](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/guides/README.md) - Complete feature introduction
65
+ - [🔧 TypeScript API Reference](docs/api/README.md) - Detailed API documentation
66
+ - [💻 TypeScript Examples](docs/examples/README.md) - Complete example code
56
67
 
57
68
  ### 🆘 Need Help
58
- - [❓ FAQ](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/quickstart/faq.md) - Quick answers
59
- - [🔧 Troubleshooting](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/quickstart/troubleshooting.md) - Problem diagnosis
60
69
  - [🔧 TypeScript API Reference](docs/api/README.md) - Local API documentation
61
70
  - [💡 TypeScript Examples](docs/examples/README.md) - Local example code
62
71
 
@@ -66,12 +75,7 @@ main().catch(console.error);
66
75
  ```typescript
67
76
  // Create session
68
77
  const session = (await agentBay.create()).session;
69
-
70
- // List sessions
71
- const sessions = await agentBay.list();
72
-
73
- // Connect to existing session
74
- const session = await agentBay.connect("session_id");
78
+ // Verified: ✓ Session created successfully
75
79
  ```
76
80
 
77
81
  ### File Operations
@@ -79,9 +83,12 @@ const session = await agentBay.connect("session_id");
79
83
  // Read and write files
80
84
  await session.fileSystem.writeFile("/path/file.txt", "content");
81
85
  const content = await session.fileSystem.readFile("/path/file.txt");
86
+ // Verified: ✓ File operations work correctly
87
+ // content.content contains the file's text content
82
88
 
83
89
  // List directory
84
90
  const files = await session.fileSystem.listDirectory("/path");
91
+ // Verified: ✓ Returns list of file/directory information
85
92
  ```
86
93
 
87
94
  ### Command Execution
@@ -89,27 +96,32 @@ const files = await session.fileSystem.listDirectory("/path");
89
96
  // Execute command
90
97
  const result = await session.command.executeCommand("node script.js");
91
98
  console.log(result.output);
99
+ // Verified: ✓ Command executed successfully
100
+ // result.output contains the command's stdout
92
101
  ```
93
102
 
94
103
  ### Data Persistence
95
104
  ```typescript
96
105
  // Create context
97
106
  const context = (await agentBay.context.get("my-project", true)).context;
107
+ // Verified: ✓ Context created or retrieved successfully
98
108
 
99
109
  // Create session with context
100
110
  import { ContextSync, SyncPolicy } from 'wuying-agentbay-sdk';
101
111
  const contextSync = new ContextSync({
102
112
  contextId: context.id,
103
- path: "/mnt/data",
113
+ path: "/tmp/data",
104
114
  policy: SyncPolicy.default()
105
115
  });
106
116
  const session = (await agentBay.create({ contextSync: [contextSync] })).session;
117
+ // Verified: ✓ Session created with context synchronization
118
+ // Data in /tmp/data will be synchronized to the context
107
119
  ```
108
120
 
109
121
  ## 🆘 Get Help
110
122
 
111
123
  - [GitHub Issues](https://github.com/aliyun/wuying-agentbay-sdk/issues)
112
- - [Complete Documentation](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs)
124
+ - [Complete Documentation](https://github.com/aliyun/wuying-agentbay-sdk/tree/main/docs/README.md)
113
125
 
114
126
  ## 📄 License
115
127