visionclaw 0.1.157 → 0.1.158
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [0.1.158](https://github.com/babelcloud/visionclaw/compare/v0.1.157...v0.1.158) (2026-03-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **shim:** update prepublish script to include entry shim generation ([48d2b8c](https://github.com/babelcloud/visionclaw/commit/48d2b8c8b1436a49c8106bd22ca30a5bf106c407))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [0.1.157](https://github.com/babelcloud/visionclaw/compare/v0.1.156...v0.1.157) (2026-03-22)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGxE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,GACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGxE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,GACvB,MAAM,CAyKR"}
|
|
@@ -45,6 +45,8 @@ All messages from enabled channels come from your owner (or people your owner ha
|
|
|
45
45
|
- Never stop/restart yourself through command line, you can only use upgrade tool to upgrade yourself. After upgrade, you will automatically restart.
|
|
46
46
|
- The system has **pm2** (process manager) and **cloudflared** (Cloudflare Tunnel) pre-installed. You can use pm2 to manage long-running processes and cloudflared to expose local services via secure tunnels.
|
|
47
47
|
|
|
48
|
+
YOU MUST USE THE \`upgrade\` TOOL TO UPGRADE YOURSELF. NEVER TRY TO UPGRADE YOURSELF MANUALLY.
|
|
49
|
+
|
|
48
50
|
## Communication Channels
|
|
49
51
|
You receive "Command Messages" from your user through these enabled channels:
|
|
50
52
|
${channelList}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAwB,EACxB,WAAwB;IAExB,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC;IAC5D,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE;QAC7C,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,MAAM;KAClB,CAAC,CAAC;IAEH,OAAO;;UAEC,MAAM,CAAC,SAAS,oHAAoH,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;;;cAGnL,MAAM,CAAC,SAAS;eACf,MAAM,CAAC,KAAK;kDACuB,MAAM,CAAC,KAAK;EAC5D,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,MAAM,CAAC,WAAW,8BAA8B,CAAC,CAAC,CAAC,6BAA6B;;;;EAIrH,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,WAAW,CAA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AAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,309 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { installBuiltinSkills } from "./skills/install.js";
|
|
6
|
-
import { startAgentLoop } from "./agent/loop.js";
|
|
7
|
-
import { getAgentState } from "./agent/state.js";
|
|
8
|
-
import { startObsServer } from "./obs/server.js";
|
|
9
|
-
import { buildStatusReport } from "./agent/status.js";
|
|
10
|
-
function parseArgs(argv = process.argv.slice(2)) {
|
|
11
|
-
const command = argv[0] && !argv[0].startsWith("-") ? argv[0] : undefined;
|
|
12
|
-
const commandArgs = command ? argv.slice(1) : argv;
|
|
13
|
-
const idx = commandArgs.indexOf("--profile");
|
|
14
|
-
const profile = idx !== -1 && idx + 1 < commandArgs.length ? commandArgs[idx + 1] : "default";
|
|
15
|
-
return {
|
|
16
|
-
command,
|
|
17
|
-
commandArgs,
|
|
18
|
-
profile,
|
|
19
|
-
debug: commandArgs.includes("-d") || commandArgs.includes("--debug"),
|
|
20
|
-
help: commandArgs.includes("-h") || commandArgs.includes("--help"),
|
|
21
|
-
version: commandArgs.includes("-v") || commandArgs.includes("--version"),
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function printHelp() {
|
|
25
|
-
console.log(`VisionClaw\n\nUsage:\n visionclaw [--profile <name>] [--debug]\n\nOptions:\n --profile <name> Use a specific profile (default: "default")\n -d, --debug Enable debug logging (sets LOG_LEVEL=debug)\n -v, --version Print version and exit\n -h, --help Show this help and exit\n`);
|
|
26
|
-
}
|
|
27
|
-
function printCommandHelp() {
|
|
28
|
-
console.log(`VisionClaw\n\nUsage:\n visionclaw [command] [options]\n\nCommands:\n prepare-mac Prepare a fresh Mac (install dependencies, configure desktop, check permissions)\n prepare-mac-power Run only the macOS power and screen settings step\n prepare-windows Prepare a fresh Windows machine (install dependencies, check prerequisites)\n prepare Auto-detect platform and run the appropriate prepare command\n setup <source> Run manufacturer (pre-ship) setup from a provisioning JSON, URL, or onboarding key\n backup Create a ZIP backup of the current profile and upload it to Google Drive\n restore Restore a profile from a VisionClaw backup ZIP\n set-owner Set the owner email for post-ship onboarding\n reconfigure Update an existing profile without starting the agent\n reset Reset profile to pre-owner state (removes memories, skills, owner config)\n reinstall-skills Reinstall built-in skills (does not start the agent)\n weixin-login Authenticate WeChat via QR code scan (standalone, no OpenClaw required)\n sanitize-logs Sanitize JSONL log files in-place (redact secrets, images, noise)\n restructure-logs Restructure logs into task-oriented records (clean, interrupted, incomplete)\n service install Install auto-start login service (macOS LaunchAgent)\n service uninstall Remove the auto-start login service\n service status Show current service status\n gbox-tun install Install gbox-tun as a system daemon (macOS LaunchDaemon)\n gbox-tun uninstall Remove the gbox-tun system daemon\n gbox-tun status Show gbox-tun daemon status\n\nGlobal options:\n --profile <name> Use a specific profile (default: "default")\n -d, --debug Enable debug logging (sets LOG_LEVEL=debug)\n -v, --version Print version and exit\n -h, --help Show this help and exit\n`);
|
|
29
|
-
}
|
|
30
|
-
async function printVersionAndExit() {
|
|
31
|
-
try {
|
|
32
|
-
// Use fs to read package.json to avoid import assertions/attributes issues
|
|
33
|
-
// across different Node versions and bundlers.
|
|
34
|
-
const fs = await import("node:fs");
|
|
35
|
-
const path = await import("node:path");
|
|
36
|
-
const url = await import("node:url");
|
|
37
|
-
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
38
|
-
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
39
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
40
|
-
console.log(pkg.version ?? "unknown");
|
|
41
|
-
}
|
|
42
|
-
catch (_err) {
|
|
43
|
-
console.log("unknown");
|
|
44
|
-
}
|
|
45
|
-
process.exit(0);
|
|
46
|
-
}
|
|
47
|
-
async function main() {
|
|
48
|
-
const parsed = parseArgs();
|
|
49
|
-
if (parsed.help) {
|
|
50
|
-
if (parsed.command)
|
|
51
|
-
printCommandHelp();
|
|
52
|
-
else
|
|
53
|
-
printHelp();
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (parsed.version) {
|
|
57
|
-
await printVersionAndExit();
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
// Parse --profile before anything else
|
|
61
|
-
setProfile(parsed.profile);
|
|
62
|
-
// Point the WeChat vendor SDK at VisionClaw's profile dir so credentials
|
|
63
|
-
// are stored under ~/.visionclaw/profiles/<profile>/ instead of ~/.openclaw/
|
|
64
|
-
process.env.OPENCLAW_STATE_DIR = getConfigDir();
|
|
65
|
-
// Enable debug logging early (before logger.init())
|
|
66
|
-
if (parsed.debug) {
|
|
67
|
-
process.env.LOG_LEVEL = "debug";
|
|
68
|
-
}
|
|
69
|
-
logger.init();
|
|
70
|
-
// Prevent unhandled async errors from crashing the agent process.
|
|
71
|
-
process.on("unhandledRejection", (reason) => {
|
|
72
|
-
logger.err(`Unhandled promise rejection: ${reason instanceof Error ? reason.message : String(reason)}`, { stack: reason instanceof Error ? reason.stack : undefined });
|
|
73
|
-
});
|
|
74
|
-
process.on("uncaughtException", (err) => {
|
|
75
|
-
logger.err(`Uncaught exception: ${err.message}`, { stack: err.stack });
|
|
76
|
-
});
|
|
77
|
-
// Graceful shutdown on SIGTERM/SIGINT — drain in-flight messages before exit.
|
|
78
|
-
let shuttingDown = false;
|
|
79
|
-
const handleSignal = (signal) => {
|
|
80
|
-
if (shuttingDown)
|
|
81
|
-
return;
|
|
82
|
-
shuttingDown = true;
|
|
83
|
-
logger.system(`Received ${signal}, shutting down gracefully...`);
|
|
84
|
-
import("./agent/state.js")
|
|
85
|
-
.then(({ runGracefulShutdown }) => runGracefulShutdown())
|
|
86
|
-
.catch((err) => {
|
|
87
|
-
logger.warn(`Graceful shutdown error: ${err instanceof Error ? err.message : String(err)}`);
|
|
88
|
-
})
|
|
89
|
-
.finally(() => {
|
|
90
|
-
process.exit(0);
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
process.on("SIGTERM", () => handleSignal("SIGTERM"));
|
|
94
|
-
process.on("SIGINT", () => handleSignal("SIGINT"));
|
|
95
|
-
logger.system(`VisionClaw - Personal Desktop Agent`);
|
|
96
|
-
logger.system(`Profile: ${getProfile()}\n`);
|
|
97
|
-
// Subcommands that do NOT require an existing config
|
|
98
|
-
if (parsed.command === "prepare-mac") {
|
|
99
|
-
const { runPrepareMac } = (await import("./onboarding/prepare-mac.js"));
|
|
100
|
-
await runPrepareMac();
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (parsed.command === "prepare-mac-power") {
|
|
104
|
-
const { runPrepareMacPower } = (await import("./onboarding/prepare-mac.js"));
|
|
105
|
-
runPrepareMacPower();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (parsed.command === "prepare-windows") {
|
|
109
|
-
const { runPrepareWindows } = (await import("./onboarding/prepare-windows.js"));
|
|
110
|
-
await runPrepareWindows();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (parsed.command === "prepare") {
|
|
114
|
-
if (process.platform === "win32") {
|
|
115
|
-
const { runPrepareWindows } = (await import("./onboarding/prepare-windows.js"));
|
|
116
|
-
await runPrepareWindows();
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
const { runPrepareMac } = (await import("./onboarding/prepare-mac.js"));
|
|
120
|
-
await runPrepareMac();
|
|
121
|
-
}
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (parsed.command === "sanitize-logs") {
|
|
125
|
-
const { runSanitize } = (await import("./data-processing/index.js"));
|
|
126
|
-
runSanitize(parsed.commandArgs);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (parsed.command === "restructure-logs") {
|
|
130
|
-
const { runRestructure } = (await import("./data-processing/index.js"));
|
|
131
|
-
await runRestructure(parsed.commandArgs);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
if (parsed.command === "setup") {
|
|
135
|
-
logger.system(`Starting manufacturer setup for profile "${parsed.profile}"...\n`);
|
|
136
|
-
await runSetup(parsed.commandArgs);
|
|
137
|
-
logger.system("\nManufacturer setup complete!");
|
|
138
|
-
process.exit(0);
|
|
139
|
-
}
|
|
140
|
-
if (parsed.command === "setup-step") {
|
|
141
|
-
const { runSetupStepCli } = await import("./onboarding/setup-steps.js");
|
|
142
|
-
await runSetupStepCli(parsed.commandArgs);
|
|
143
|
-
process.exit(0);
|
|
144
|
-
}
|
|
145
|
-
if (parsed.command === "weixin-login") {
|
|
146
|
-
const { runWeixinLogin } = await import("./channels/weixin-login.js");
|
|
147
|
-
await runWeixinLogin(parsed.commandArgs);
|
|
148
|
-
process.exit(0);
|
|
149
|
-
}
|
|
150
|
-
if (parsed.command === "restore") {
|
|
151
|
-
const { runRestoreCli } = (await import("./restore.js"));
|
|
152
|
-
await runRestoreCli(parsed.commandArgs);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (parsed.command === "service") {
|
|
156
|
-
const subAction = parsed.commandArgs[0];
|
|
157
|
-
const mod = (await import("./service/launchd.js"));
|
|
158
|
-
if (subAction === "install") {
|
|
159
|
-
mod.installService({ profile: parsed.profile, debug: parsed.debug });
|
|
160
|
-
}
|
|
161
|
-
else if (subAction === "uninstall") {
|
|
162
|
-
mod.uninstallService();
|
|
163
|
-
}
|
|
164
|
-
else if (subAction === "status") {
|
|
165
|
-
mod.printServiceStatus();
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
console.log("Usage: visionclaw service <install|uninstall|status> [--profile <name>] [--debug]");
|
|
169
|
-
}
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (parsed.command === "gbox-tun") {
|
|
173
|
-
const subAction = parsed.commandArgs[0];
|
|
174
|
-
const mod = (await import("./service/gbox-tun.js"));
|
|
175
|
-
if (subAction === "install") {
|
|
176
|
-
const config = loadConfig();
|
|
177
|
-
if (!config.gboxTunEnabled || !config.gboxTunServer || !config.gboxTunApikey) {
|
|
178
|
-
console.log("gbox-tun is not configured. Run setup with gboxTun enabled first.");
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
await mod.installGboxTunService({ server: config.gboxTunServer, apikey: config.gboxTunApikey });
|
|
182
|
-
}
|
|
183
|
-
else if (subAction === "uninstall") {
|
|
184
|
-
mod.uninstallGboxTunService();
|
|
185
|
-
}
|
|
186
|
-
else if (subAction === "status") {
|
|
187
|
-
mod.printGboxTunServiceStatus();
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
console.log("Usage: visionclaw gbox-tun <install|uninstall|status>");
|
|
191
|
-
}
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (parsed.command === "reset") {
|
|
195
|
-
const { runResetCli } = (await import("./reset.js"));
|
|
196
|
-
await runResetCli(parsed.commandArgs);
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
logger.system(`Provider: ${loadConfig().provider}`);
|
|
200
|
-
if (parsed.command === "backup") {
|
|
201
|
-
const { runBackupCli } = (await import("./backup.js"));
|
|
202
|
-
await runBackupCli();
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
if (parsed.command === "set-owner") {
|
|
206
|
-
const { runSetOwner } = (await import("./onboarding/set-owner.js"));
|
|
207
|
-
runSetOwner(parsed.commandArgs);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (parsed.command === "reconfigure") {
|
|
211
|
-
// NOTE: Under Node16 moduleResolution, runtime ESM imports require an explicit extension.
|
|
212
|
-
// This resolves at runtime after compilation because `dist/reconfigure.js` exists.
|
|
213
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
214
|
-
// @ts-ignore - module exists post-build in dist output
|
|
215
|
-
const { runReconfigureCli } = (await import("./reconfigure.js"));
|
|
216
|
-
await runReconfigureCli(parsed.commandArgs);
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
if (parsed.command === "reinstall-skills") {
|
|
220
|
-
installBuiltinSkills({ force: true });
|
|
221
|
-
logger.system("Built-in skills reinstalled.");
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
if (parsed.command) {
|
|
225
|
-
logger.err(`Unknown command: ${parsed.command}`);
|
|
226
|
-
printCommandHelp();
|
|
227
|
-
process.exit(1);
|
|
228
|
-
}
|
|
229
|
-
// If no config exists for this profile, run manufacturer onboarding
|
|
230
|
-
if (!configExists()) {
|
|
231
|
-
logger.err(`No configuration found for profile "${parsed.profile}". Run "visionclaw setup <provisioning-json-source>" first.`);
|
|
232
|
-
process.exit(1);
|
|
233
|
-
}
|
|
234
|
-
const config = loadConfig();
|
|
235
|
-
logger.system(`Agent identity: ${config.gmail}`);
|
|
236
|
-
// Start runtime observability server as early as possible so the tunnel
|
|
237
|
-
// has the maximum time to establish before the agent loop begins.
|
|
238
|
-
let obsRestartTunnel;
|
|
239
|
-
let obsHandle;
|
|
240
|
-
const obsOptions = {};
|
|
241
|
-
if (config.obs.enabled) {
|
|
242
|
-
const obs = startObsServer({
|
|
243
|
-
host: config.obs.host || "0.0.0.0",
|
|
244
|
-
port: config.obs.port,
|
|
245
|
-
bufferSize: config.obs.bufferSize,
|
|
246
|
-
tunnel: config.obs.tunnel === "off" ? undefined : config.obs.tunnel,
|
|
247
|
-
tunnelName: config.obs.tunnelName,
|
|
248
|
-
tunnelHostname: config.obs.tunnelHostname,
|
|
249
|
-
config,
|
|
250
|
-
get statusReport() { return obsOptions.statusReport; },
|
|
251
|
-
agentStatus: {
|
|
252
|
-
getBusy: () => {
|
|
253
|
-
try {
|
|
254
|
-
return getAgentState().busy;
|
|
255
|
-
}
|
|
256
|
-
catch {
|
|
257
|
-
return false;
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
getStopRequested: () => {
|
|
261
|
-
try {
|
|
262
|
-
return getAgentState().stopRequested;
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
return false;
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
requestStop: () => {
|
|
269
|
-
try {
|
|
270
|
-
getAgentState().requestStop();
|
|
271
|
-
}
|
|
272
|
-
catch { /* not yet started */ }
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
});
|
|
276
|
-
obsRestartTunnel = obs.restartTunnel;
|
|
277
|
-
obsHandle = obs;
|
|
278
|
-
}
|
|
279
|
-
// Install/update built-in skills (safe to call on every startup)
|
|
280
|
-
installBuiltinSkills();
|
|
281
|
-
// Cache display size for computer_use tools (cross-platform)
|
|
282
|
-
const { initDisplaySize } = await import("./tools/desktop-executor-factory.js");
|
|
283
|
-
await initDisplaySize();
|
|
284
|
-
const obsClose = obsHandle ? () => obsHandle.close() : undefined;
|
|
285
|
-
// Start the main agent loop (handles onboarding gate internally)
|
|
286
|
-
await startAgentLoop(config, {
|
|
287
|
-
restartTunnel: obsRestartTunnel,
|
|
288
|
-
obsClose: obsClose,
|
|
289
|
-
onReady: (deps) => {
|
|
290
|
-
obsOptions.statusReport = (forceRefresh) => buildStatusReport({
|
|
291
|
-
agentState: deps.agentState,
|
|
292
|
-
sessionManager: deps.sessionManager,
|
|
293
|
-
messageQueue: deps.messageQueue,
|
|
294
|
-
config,
|
|
295
|
-
ownerConfig: deps.ownerConfig,
|
|
296
|
-
forceRefresh,
|
|
297
|
-
});
|
|
298
|
-
},
|
|
299
|
-
});
|
|
300
|
-
// startAgentLoop runs the infinite agent loop and should never return.
|
|
301
|
-
// If it does, close obs and exit cleanly.
|
|
302
|
-
if (obsHandle)
|
|
303
|
-
await obsHandle.close();
|
|
304
|
-
}
|
|
305
|
-
main().catch((err) => {
|
|
306
|
-
logger.err(`Fatal error: ${err instanceof Error ? err.message : String(err)}`);
|
|
307
|
-
process.exit(1);
|
|
308
|
-
});
|
|
309
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
require("../dist-agent/bundle.cjs");
|
package/dist-agent/bundle.cjs
CHANGED
|
@@ -910201,6 +910201,8 @@ All messages from enabled channels come from your owner (or people your owner ha
|
|
|
910201
910201
|
- Never stop/restart yourself through command line, you can only use upgrade tool to upgrade yourself. After upgrade, you will automatically restart.
|
|
910202
910202
|
- The system has **pm2** (process manager) and **cloudflared** (Cloudflare Tunnel) pre-installed. You can use pm2 to manage long-running processes and cloudflared to expose local services via secure tunnels.
|
|
910203
910203
|
|
|
910204
|
+
YOU MUST USE THE \`upgrade\` TOOL TO UPGRADE YOURSELF. NEVER TRY TO UPGRADE YOURSELF MANUALLY.
|
|
910205
|
+
|
|
910204
910206
|
## Communication Channels
|
|
910205
910207
|
You receive "Command Messages" from your user through these enabled channels:
|
|
910206
910208
|
${channelList}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visionclaw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.158",
|
|
4
4
|
"description": "A personal assistant agent that runs on your desktop, receives commands from messaging channels, and executes tasks autonomously.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|