codeclaw 0.1.0 → 0.2.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/package.json +1 -1
- package/src/channel-telegram.js +29 -2
- package/src/codeclaw.js +1 -1
package/package.json
CHANGED
package/src/channel-telegram.js
CHANGED
|
@@ -945,8 +945,8 @@ export class TelegramChannel {
|
|
|
945
945
|
}
|
|
946
946
|
text = arg;
|
|
947
947
|
} else {
|
|
948
|
-
|
|
949
|
-
|
|
948
|
+
// Pass through unrecognized commands to the engine (e.g. /commit, /simplify, /compact)
|
|
949
|
+
text = `/${cmd}` + (arg ? ` ${arg}` : '');
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
|
|
@@ -958,6 +958,32 @@ export class TelegramChannel {
|
|
|
958
958
|
// Startup notice
|
|
959
959
|
// -------------------------------------------------------------------
|
|
960
960
|
|
|
961
|
+
async _registerBotCommands() {
|
|
962
|
+
const commands = [
|
|
963
|
+
// codeclaw native commands
|
|
964
|
+
{ command: 'ask', description: 'Ask the AI agent' },
|
|
965
|
+
{ command: 'engine', description: 'Show or switch engine (codex/claude)' },
|
|
966
|
+
{ command: 'battle', description: 'Run both engines and compare' },
|
|
967
|
+
{ command: 'new', description: 'Reset session (optionally with prompt)' },
|
|
968
|
+
{ command: 'stop', description: 'Clear session thread' },
|
|
969
|
+
{ command: 'status', description: 'Session / engine / thread info' },
|
|
970
|
+
{ command: 'session', description: 'Multi-session: list|use|new|del' },
|
|
971
|
+
{ command: 'clear', description: 'Delete bot messages (default 50)' },
|
|
972
|
+
{ command: 'help', description: 'Show help' },
|
|
973
|
+
// Engine passthrough commands (claude / codex)
|
|
974
|
+
{ command: 'compact', description: '[engine] Compact conversation context' },
|
|
975
|
+
{ command: 'commit', description: '[engine] Generate a git commit' },
|
|
976
|
+
{ command: 'simplify', description: '[engine] Review and simplify changed code' },
|
|
977
|
+
{ command: 'pr_comments', description: '[engine] Address PR review comments' },
|
|
978
|
+
];
|
|
979
|
+
try {
|
|
980
|
+
await this._apiCall('setMyCommands', { commands });
|
|
981
|
+
this.core._log(`registered ${commands.length} bot commands`);
|
|
982
|
+
} catch (exc) {
|
|
983
|
+
this.core._log(`setMyCommands failed: ${exc}`, { err: true });
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
961
987
|
async _sendStartupNotice() {
|
|
962
988
|
const { execSync } = await import('node:child_process');
|
|
963
989
|
const targets = new Set(this.core.allowedChatIds);
|
|
@@ -1001,6 +1027,7 @@ export class TelegramChannel {
|
|
|
1001
1027
|
// -------------------------------------------------------------------
|
|
1002
1028
|
|
|
1003
1029
|
async run() {
|
|
1030
|
+
await this._registerBotCommands();
|
|
1004
1031
|
await this._sendStartupNotice();
|
|
1005
1032
|
this.core._log(`polling started (mention_required=${this.core.requireMention})`);
|
|
1006
1033
|
|
package/src/codeclaw.js
CHANGED
|
@@ -12,7 +12,7 @@ import { createInterface } from 'node:readline';
|
|
|
12
12
|
import { execSync } from 'node:child_process';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
14
|
|
|
15
|
-
export const VERSION = '0.1
|
|
15
|
+
export const VERSION = '0.2.1';
|
|
16
16
|
|
|
17
17
|
// ---------------------------------------------------------------------------
|
|
18
18
|
// Helpers
|