autoclaw 1.1.0 → 1.1.1
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.js +18 -14
- package/dist/index.js +39 -12
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -31,24 +31,28 @@ System Information:
|
|
|
31
31
|
this.messages = [
|
|
32
32
|
{
|
|
33
33
|
role: "system",
|
|
34
|
-
content: `You are AutoClaw,
|
|
35
|
-
|
|
36
|
-
You may
|
|
34
|
+
content: `You are AutoClaw, a lightweight AI agent that operates directly in the terminal. You accomplish tasks by executing shell commands, reading and writing files, and using integrated tools — no GUI, no guesswork, deterministic results.
|
|
35
|
+
|
|
36
|
+
You may be running on a developer workstation, a headless server, inside a Docker container, or in a CI/CD pipeline. Adapt accordingly.
|
|
37
37
|
|
|
38
|
-
CONTEXT:
|
|
39
38
|
${systemInfo}
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
WHAT YOU CAN DO:
|
|
41
|
+
- Shell: execute_shell_command — run scripts, install packages, manage processes, interact with the OS
|
|
42
|
+
- Files: read_file / write_file — inspect logs, generate configs, produce reports
|
|
43
|
+
- Web: web_search — real-time information lookup; read_website — extract article content; take_screenshot — capture page visuals
|
|
44
|
+
- Communication: send_email — SMTP email delivery; send_notification — push to Feishu/DingTalk/WeCom
|
|
45
|
+
- Creation: generate_image — AI image generation (DALL-E compatible); optimize_prompt — refine raw prompts for creative/complex tasks
|
|
46
|
+
- Utility: get_current_datetime — accurate system time for temporal reasoning
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
1.
|
|
48
|
-
2.
|
|
49
|
-
3.
|
|
50
|
-
4.
|
|
51
|
-
5.
|
|
48
|
+
RULES OF ENGAGEMENT:
|
|
49
|
+
1. One shot, not one chat. Produce working results, not conversation. Be terse.
|
|
50
|
+
2. Use the right tool for the job. Shell for system ops. Files for content. Web tools for external info.
|
|
51
|
+
3. Always pass non-interactive flags: --yes for npx, -y for apt/apk, -f for rm, etc. Assume no human is watching.
|
|
52
|
+
4. Container-friendly: stick to standard Unix tools available in Alpine/Debian slim images. No GUI apps, no browser-based debug tools.
|
|
53
|
+
5. For creative or complex tasks (image prompts, long-form writing, intricate scripts): call optimize_prompt first. It significantly raises output quality.
|
|
54
|
+
6. If a command fails, diagnose and try one alternative. Don't retry the same thing, don't give up on first error.
|
|
55
|
+
7. Read before write. When modifying a file, read it first. When installing a package, check if it's already there.
|
|
52
56
|
`
|
|
53
57
|
}
|
|
54
58
|
];
|
package/dist/index.js
CHANGED
|
@@ -123,31 +123,43 @@ async function runSetup(options = {}) {
|
|
|
123
123
|
{
|
|
124
124
|
type: 'confirm',
|
|
125
125
|
name: 'configureImage',
|
|
126
|
-
message:
|
|
127
|
-
|
|
126
|
+
message: currentConfig.imageApiKey
|
|
127
|
+
? `Do you want to reconfigure Image Generation (DALL-E)? (current: ${maskSecret(currentConfig.imageApiKey)})`
|
|
128
|
+
: 'Do you want to configure a separate Image Generation Service (DALL-E)?',
|
|
129
|
+
default: false
|
|
128
130
|
},
|
|
129
131
|
{
|
|
130
132
|
type: 'confirm',
|
|
131
133
|
name: 'configureEmail',
|
|
132
|
-
message:
|
|
133
|
-
|
|
134
|
+
message: currentConfig.smtpHost
|
|
135
|
+
? `Do you want to reconfigure Email (SMTP)? (current: ${currentConfig.smtpUser}@${currentConfig.smtpHost})`
|
|
136
|
+
: 'Do you want to configure the Email Tool (SMTP)?',
|
|
137
|
+
default: false
|
|
134
138
|
},
|
|
135
139
|
{
|
|
136
140
|
type: 'confirm',
|
|
137
141
|
name: 'configureSearch',
|
|
138
|
-
message:
|
|
139
|
-
|
|
142
|
+
message: currentConfig.tavilyApiKey
|
|
143
|
+
? `Do you want to reconfigure Web Search (Tavily)? (current: ${maskSecret(currentConfig.tavilyApiKey)})`
|
|
144
|
+
: 'Do you want to configure Web Search (Tavily)?',
|
|
145
|
+
default: false
|
|
140
146
|
},
|
|
141
147
|
{
|
|
142
148
|
type: 'confirm',
|
|
143
149
|
name: 'configureNotify',
|
|
144
|
-
message:
|
|
145
|
-
|
|
150
|
+
message: (currentConfig.feishuWebhook || currentConfig.dingtalkWebhook || currentConfig.wecomWebhook)
|
|
151
|
+
? 'Do you want to reconfigure Group Bots (Feishu/DingTalk/WeCom)?'
|
|
152
|
+
: 'Do you want to configure Group Bots (Feishu/DingTalk/WeCom)?',
|
|
153
|
+
default: false
|
|
146
154
|
}
|
|
147
155
|
]);
|
|
148
156
|
// Resolve sensitive values (Keep old if empty)
|
|
149
157
|
const finalApiKey = answers.apiKey || currentConfig.apiKey;
|
|
150
|
-
let imageConfig = {
|
|
158
|
+
let imageConfig = {
|
|
159
|
+
imageApiKey: currentConfig.imageApiKey,
|
|
160
|
+
imageBaseUrl: currentConfig.imageBaseUrl,
|
|
161
|
+
imageModel: currentConfig.imageModel
|
|
162
|
+
};
|
|
151
163
|
if (answers.configureImage) {
|
|
152
164
|
const imageAnswers = await inquirer.prompt([
|
|
153
165
|
{
|
|
@@ -177,7 +189,13 @@ async function runSetup(options = {}) {
|
|
|
177
189
|
imageModel: imageAnswers.imageModel
|
|
178
190
|
};
|
|
179
191
|
}
|
|
180
|
-
let emailConfig = {
|
|
192
|
+
let emailConfig = {
|
|
193
|
+
smtpHost: currentConfig.smtpHost,
|
|
194
|
+
smtpPort: currentConfig.smtpPort,
|
|
195
|
+
smtpUser: currentConfig.smtpUser,
|
|
196
|
+
smtpPass: currentConfig.smtpPass,
|
|
197
|
+
smtpFrom: currentConfig.smtpFrom
|
|
198
|
+
};
|
|
181
199
|
if (answers.configureEmail) {
|
|
182
200
|
const emailAnswers = await inquirer.prompt([
|
|
183
201
|
{
|
|
@@ -219,7 +237,9 @@ async function runSetup(options = {}) {
|
|
|
219
237
|
emailConfig.smtpFrom = emailConfig.smtpUser;
|
|
220
238
|
}
|
|
221
239
|
}
|
|
222
|
-
let searchConfig = {
|
|
240
|
+
let searchConfig = {
|
|
241
|
+
tavilyApiKey: currentConfig.tavilyApiKey
|
|
242
|
+
};
|
|
223
243
|
if (answers.configureSearch) {
|
|
224
244
|
const searchAnswers = await inquirer.prompt([
|
|
225
245
|
{
|
|
@@ -233,7 +253,14 @@ async function runSetup(options = {}) {
|
|
|
233
253
|
]);
|
|
234
254
|
searchConfig = { tavilyApiKey: searchAnswers.tavilyApiKey || currentConfig.tavilyApiKey };
|
|
235
255
|
}
|
|
236
|
-
let notifyConfig = {
|
|
256
|
+
let notifyConfig = {
|
|
257
|
+
feishuWebhook: currentConfig.feishuWebhook,
|
|
258
|
+
feishuKeyword: currentConfig.feishuKeyword,
|
|
259
|
+
dingtalkWebhook: currentConfig.dingtalkWebhook,
|
|
260
|
+
dingtalkKeyword: currentConfig.dingtalkKeyword,
|
|
261
|
+
wecomWebhook: currentConfig.wecomWebhook,
|
|
262
|
+
wecomKeyword: currentConfig.wecomKeyword
|
|
263
|
+
};
|
|
237
264
|
if (answers.configureNotify) {
|
|
238
265
|
const notifyAnswers = await inquirer.prompt([
|
|
239
266
|
{
|