clawless 0.1.2 → 0.2.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/dist/bin/cli.js +15 -15
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -26,8 +26,8 @@ const ENV_KEY_MAP = {
|
|
|
26
26
|
memoryMaxChars: 'MEMORY_MAX_CHARS',
|
|
27
27
|
schedulesFilePath: 'SCHEDULES_FILE_PATH',
|
|
28
28
|
};
|
|
29
|
-
const DEFAULT_CONFIG_PATH = path.join(os.homedir(), '.
|
|
30
|
-
const DEFAULT_AGENT_BRIDGE_HOME = path.join(os.homedir(), '.
|
|
29
|
+
const DEFAULT_CONFIG_PATH = path.join(os.homedir(), '.clawless', 'config.json');
|
|
30
|
+
const DEFAULT_AGENT_BRIDGE_HOME = path.join(os.homedir(), '.clawless');
|
|
31
31
|
const DEFAULT_MEMORY_FILE_PATH = path.join(DEFAULT_AGENT_BRIDGE_HOME, 'MEMORY.md');
|
|
32
32
|
const DEFAULT_CONFIG_TEMPLATE = {
|
|
33
33
|
telegramToken: 'your_telegram_bot_token_here',
|
|
@@ -47,19 +47,19 @@ const DEFAULT_CONFIG_TEMPLATE = {
|
|
|
47
47
|
callbackPort: 8788,
|
|
48
48
|
callbackAuthToken: '',
|
|
49
49
|
callbackMaxBodyBytes: 65536,
|
|
50
|
-
agentBridgeHome: '~/.
|
|
51
|
-
memoryFilePath: '~/.
|
|
50
|
+
agentBridgeHome: '~/.clawless',
|
|
51
|
+
memoryFilePath: '~/.clawless/MEMORY.md',
|
|
52
52
|
memoryMaxChars: 12000,
|
|
53
|
-
schedulesFilePath: '~/.
|
|
53
|
+
schedulesFilePath: '~/.clawless/schedules.json',
|
|
54
54
|
};
|
|
55
55
|
function printHelp() {
|
|
56
|
-
console.log(`
|
|
56
|
+
console.log(`clawless
|
|
57
57
|
|
|
58
58
|
Usage:
|
|
59
|
-
|
|
59
|
+
clawless [--config <path>]
|
|
60
60
|
|
|
61
61
|
Options:
|
|
62
|
-
--config <path> Path to JSON config file (default: ~/.
|
|
62
|
+
--config <path> Path to JSON config file (default: ~/.clawless/config.json)
|
|
63
63
|
-h, --help Show this help message
|
|
64
64
|
|
|
65
65
|
Config precedence:
|
|
@@ -151,9 +151,9 @@ function ensureMemoryFile(memoryFilePath) {
|
|
|
151
151
|
if (!fs.existsSync(absolutePath)) {
|
|
152
152
|
fs.mkdirSync(path.dirname(absolutePath), { recursive: true });
|
|
153
153
|
const template = [
|
|
154
|
-
'#
|
|
154
|
+
'# Clawless Memory',
|
|
155
155
|
'',
|
|
156
|
-
'This file stores durable memory notes for
|
|
156
|
+
'This file stores durable memory notes for Clawless.',
|
|
157
157
|
'',
|
|
158
158
|
'## Notes',
|
|
159
159
|
'',
|
|
@@ -176,7 +176,7 @@ function ensureMemoryFromEnv() {
|
|
|
176
176
|
}
|
|
177
177
|
function logMemoryFileCreation(memoryState) {
|
|
178
178
|
if (memoryState.created) {
|
|
179
|
-
console.log(`[
|
|
179
|
+
console.log(`[clawless] Created memory file: ${memoryState.path}`);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
function loadConfigFile(configPath) {
|
|
@@ -199,19 +199,19 @@ try {
|
|
|
199
199
|
const memoryState = ensureMemoryFromEnv();
|
|
200
200
|
logMemoryFileCreation(memoryState);
|
|
201
201
|
if (configState.created) {
|
|
202
|
-
console.log(`[
|
|
203
|
-
console.log('[
|
|
202
|
+
console.log(`[clawless] Created config template: ${configState.path}`);
|
|
203
|
+
console.log('[clawless] Fill in placeholder values, then run clawless again.');
|
|
204
204
|
process.exit(0);
|
|
205
205
|
}
|
|
206
206
|
const loadedConfigPath = loadConfigFile(args.configPath);
|
|
207
207
|
if (loadedConfigPath) {
|
|
208
|
-
console.log(`[
|
|
208
|
+
console.log(`[clawless] Loaded config: ${loadedConfigPath}`);
|
|
209
209
|
}
|
|
210
210
|
const postConfigMemoryState = ensureMemoryFromEnv();
|
|
211
211
|
logMemoryFileCreation(postConfigMemoryState);
|
|
212
212
|
await import('../index.js');
|
|
213
213
|
}
|
|
214
214
|
catch (error) {
|
|
215
|
-
console.error(`[
|
|
215
|
+
console.error(`[clawless] ${error.message}`);
|
|
216
216
|
process.exit(1);
|
|
217
217
|
}
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ const ACP_DEBUG_STREAM = String(process.env.ACP_DEBUG_STREAM || '').toLowerCase(
|
|
|
34
34
|
const HEARTBEAT_INTERVAL_MS = parseInt(process.env.HEARTBEAT_INTERVAL_MS || '60000', 10);
|
|
35
35
|
const ACP_PREWARM_RETRY_MS = parseInt(process.env.ACP_PREWARM_RETRY_MS || '30000', 10);
|
|
36
36
|
const GEMINI_KILL_GRACE_MS = parseInt(process.env.GEMINI_KILL_GRACE_MS || '5000', 10);
|
|
37
|
-
const AGENT_BRIDGE_HOME = process.env.AGENT_BRIDGE_HOME || path.join(os.homedir(), '.
|
|
37
|
+
const AGENT_BRIDGE_HOME = process.env.AGENT_BRIDGE_HOME || path.join(os.homedir(), '.clawless');
|
|
38
38
|
const MEMORY_FILE_PATH = process.env.MEMORY_FILE_PATH || path.join(AGENT_BRIDGE_HOME, 'MEMORY.md');
|
|
39
39
|
const SCHEDULES_FILE_PATH = process.env.SCHEDULES_FILE_PATH || path.join(AGENT_BRIDGE_HOME, 'schedules.json');
|
|
40
40
|
const CALLBACK_CHAT_STATE_FILE_PATH = path.join(AGENT_BRIDGE_HOME, 'callback-chat-state.json');
|
|
@@ -1107,7 +1107,7 @@ messagingClient.launch()
|
|
|
1107
1107
|
.catch((error) => {
|
|
1108
1108
|
if (error?.response?.error_code === 404 && error?.on?.method === 'getMe') {
|
|
1109
1109
|
console.error('Failed to launch bot: Telegram token is invalid (getMe returned 404 Not Found).');
|
|
1110
|
-
console.error('Update TELEGRAM_TOKEN in ~/.
|
|
1110
|
+
console.error('Update TELEGRAM_TOKEN in ~/.clawless/config.json or env and restart.');
|
|
1111
1111
|
process.exit(1);
|
|
1112
1112
|
}
|
|
1113
1113
|
console.error('Failed to launch bot:', error);
|