@locusai/telegram 0.9.5 → 0.9.8
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 +2 -2
- package/bin/telegram.js +16 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,10 +34,10 @@ LOCUS_PROJECT_PATH="/path/to/your/project"
|
|
|
34
34
|
```json
|
|
35
35
|
{
|
|
36
36
|
"apiKey": "your-locus-api-key",
|
|
37
|
+
"agentCount": 2,
|
|
37
38
|
"telegram": {
|
|
38
39
|
"botToken": "your-bot-token",
|
|
39
40
|
"chatId": 123456789,
|
|
40
|
-
"agentCount": 1,
|
|
41
41
|
"testMode": false
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -105,7 +105,7 @@ bun run dev
|
|
|
105
105
|
| API Base URL | — | `apiUrl` | Custom API URL |
|
|
106
106
|
| Provider | — | `provider` | AI provider (`claude` or `codex`) |
|
|
107
107
|
| Model | — | `model` | AI model override |
|
|
108
|
-
| Agent Count |
|
|
108
|
+
| Agent Count | `LOCUS_AGENT_COUNT` | `agentCount` | Number of agents to spawn with `/run` (1-5) |
|
|
109
109
|
| Test Mode | `LOCUS_TEST_MODE` | `telegram.testMode` | Use local CLI source instead of published binary |
|
|
110
110
|
|
|
111
111
|
## Security
|
package/bin/telegram.js
CHANGED
|
@@ -19924,10 +19924,10 @@ function executeShellCommand(command, options) {
|
|
|
19924
19924
|
// src/timeouts.ts
|
|
19925
19925
|
var HANDLER_TIMEOUT = 600000;
|
|
19926
19926
|
var EXECUTE_DEFAULT_TIMEOUT = 600000;
|
|
19927
|
-
var PLAN_TIMEOUT =
|
|
19927
|
+
var PLAN_TIMEOUT = 600000;
|
|
19928
19928
|
var STREAMING_DEFAULT_TIMEOUT = 3600000;
|
|
19929
19929
|
var GIT_TIMEOUT = 60000;
|
|
19930
|
-
var DEV_TIMEOUT =
|
|
19930
|
+
var DEV_TIMEOUT = 600000;
|
|
19931
19931
|
|
|
19932
19932
|
// src/commands/dev.ts
|
|
19933
19933
|
var USAGE = `<b>Usage:</b> /dev <command>
|
|
@@ -20195,7 +20195,19 @@ async function cancelCommand(ctx, executor) {
|
|
|
20195
20195
|
// src/commands/run.ts
|
|
20196
20196
|
var activeRunKill = null;
|
|
20197
20197
|
async function runCommand(ctx, executor, config) {
|
|
20198
|
-
|
|
20198
|
+
const text = (ctx.message && "text" in ctx.message ? ctx.message.text : "") || "";
|
|
20199
|
+
const input = text.replace(/^\/run\s*/, "").trim();
|
|
20200
|
+
let parsedAgentCount;
|
|
20201
|
+
const agentsMatch = input.match(/(?:--agents|-a)\s+(\d+)/);
|
|
20202
|
+
if (agentsMatch) {
|
|
20203
|
+
parsedAgentCount = Number.parseInt(agentsMatch[1], 10);
|
|
20204
|
+
if (parsedAgentCount < 1 || parsedAgentCount > 5) {
|
|
20205
|
+
await ctx.reply(formatError("Agent count must be between 1 and 5."), { parse_mode: "HTML" });
|
|
20206
|
+
return;
|
|
20207
|
+
}
|
|
20208
|
+
}
|
|
20209
|
+
const agentCount = parsedAgentCount ?? config.agentCount ?? 1;
|
|
20210
|
+
console.log(`[run] Starting agents (count: ${agentCount})`);
|
|
20199
20211
|
if (!config.apiKey) {
|
|
20200
20212
|
await ctx.reply(formatError("API key is not configured. Run: locus config setup --api-key <key>"), { parse_mode: "HTML" });
|
|
20201
20213
|
return;
|
|
@@ -20204,7 +20216,6 @@ async function runCommand(ctx, executor, config) {
|
|
|
20204
20216
|
await ctx.reply(formatInfo("Agents are already running. Use /stop to stop them first."), { parse_mode: "HTML" });
|
|
20205
20217
|
return;
|
|
20206
20218
|
}
|
|
20207
|
-
const agentCount = config.agentCount ?? 1;
|
|
20208
20219
|
const agentLabel = agentCount > 1 ? `${agentCount} agents` : "1 agent";
|
|
20209
20220
|
await ctx.reply(formatInfo(`Starting ${agentLabel}...`), {
|
|
20210
20221
|
parse_mode: "HTML"
|
|
@@ -38758,7 +38769,7 @@ function resolveConfig() {
|
|
|
38758
38769
|
workspaceId: process.env.LOCUS_WORKSPACE_ID || settings?.workspaceId || undefined,
|
|
38759
38770
|
provider: process.env.LOCUS_PROVIDER || settings?.provider || undefined,
|
|
38760
38771
|
model: process.env.LOCUS_MODEL || settings?.model || undefined,
|
|
38761
|
-
agentCount:
|
|
38772
|
+
agentCount: process.env.LOCUS_AGENT_COUNT ? Number.parseInt(process.env.LOCUS_AGENT_COUNT, 10) : settings?.agentCount,
|
|
38762
38773
|
testMode: isTestMode
|
|
38763
38774
|
};
|
|
38764
38775
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/telegram",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "Telegram bot for Locus - remote control your AI agents from Telegram",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@locusai/sdk": "^0.9.
|
|
35
|
+
"@locusai/sdk": "^0.9.8",
|
|
36
36
|
"dotenv": "^16.4.7",
|
|
37
37
|
"telegraf": "^4.16.3"
|
|
38
38
|
},
|