@grinev/opencode-telegram-bot 0.9.0 → 0.9.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/README.md CHANGED
@@ -32,7 +32,7 @@ Quick start: `npx @grinev/opencode-telegram-bot`
32
32
  - **Input flow control** — when an interactive flow is active, the bot accepts only relevant input to keep context consistent and avoid accidental actions
33
33
  - **Configurable reply formatting** — assistant replies use Telegram MarkdownV2 by default, with optional raw mode (`MESSAGE_FORMAT_MODE=markdown|raw`)
34
34
  - **Security** — strict user ID whitelist; no one else can access your bot, even if they find it
35
- - **Localization** — English, German, Spanish, Russian, and Simplified Chinese UI (`BOT_LOCALE=en|de|es|ru|zh`)
35
+ - **Localization** — UI localization is supported for multiple languages (`BOT_LOCALE`)
36
36
 
37
37
  ## Prerequisites
38
38
 
@@ -52,7 +52,7 @@ You'll also need your **Telegram User ID** — send any message to [@userinfobot
52
52
 
53
53
  ### 2. Start OpenCode Server
54
54
 
55
- In your project directory, start the OpenCode server:
55
+ Start the OpenCode server:
56
56
 
57
57
  ```bash
58
58
  opencode serve
@@ -24,6 +24,18 @@ function formatProjectButtonLabel(label, isActive) {
24
24
  }
25
25
  return `${prefix}${label.slice(0, Math.max(0, availableLength - 3))}...`;
26
26
  }
27
+ export function getProjectFolderName(worktree) {
28
+ const normalized = worktree.replace(/[\\/]+$/g, "");
29
+ if (!normalized) {
30
+ return worktree;
31
+ }
32
+ const segments = normalized.split(/[\\/]/).filter(Boolean);
33
+ return segments.at(-1) ?? normalized;
34
+ }
35
+ export function buildProjectButtonLabel(index, worktree) {
36
+ const folderName = getProjectFolderName(worktree);
37
+ return `${index + 1}. ${folderName} [${worktree}]`;
38
+ }
27
39
  export async function projectsCommand(ctx) {
28
40
  try {
29
41
  await syncSessionDirectoryCache();
@@ -38,9 +50,7 @@ export async function projectsCommand(ctx) {
38
50
  projectsToShow.forEach((project, index) => {
39
51
  const isActive = currentProject &&
40
52
  (project.id === currentProject.id || project.worktree === currentProject.worktree);
41
- const label = project.name
42
- ? `${index + 1}. ${project.name}`
43
- : `${index + 1}. ${project.worktree}`;
53
+ const label = buildProjectButtonLabel(index, project.worktree);
44
54
  const labelWithCheck = formatProjectButtonLabel(label, Boolean(isActive));
45
55
  keyboard.text(labelWithCheck, `project:${project.id}`).row();
46
56
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grinev/opencode-telegram-bot",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Telegram bot client for OpenCode to run and monitor coding tasks from chat.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",