telecoder 0.0.0-stage → 1.3.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/.env.example +375 -0
- package/CHANGELOG.md +1867 -0
- package/LICENSE +22 -0
- package/README.md +130 -2
- package/dist/audio/transcribe.js +41 -0
- package/dist/bin/mcp-server.js +363 -0
- package/dist/bin/tool-result.js +22 -0
- package/dist/bot/access/group-access.js +147 -0
- package/dist/bot/bot.js +573 -0
- package/dist/bot/command-catalog.js +263 -0
- package/dist/bot/deleted-threads.js +103 -0
- package/dist/bot/file-access.js +150 -0
- package/dist/bot/handlers/album.handler.js +128 -0
- package/dist/bot/handlers/branch.handler.js +1096 -0
- package/dist/bot/handlers/command/access.js +407 -0
- package/dist/bot/handlers/command/admin.js +803 -0
- package/dist/bot/handlers/command/all-view.js +33 -0
- package/dist/bot/handlers/command/auto-approve.js +138 -0
- package/dist/bot/handlers/command/background.js +37 -0
- package/dist/bot/handlers/command/botname.js +76 -0
- package/dist/bot/handlers/command/btw.js +175 -0
- package/dist/bot/handlers/command/cleanup.js +329 -0
- package/dist/bot/handlers/command/model.js +226 -0
- package/dist/bot/handlers/command/prefs-scope.js +362 -0
- package/dist/bot/handlers/command/project.js +458 -0
- package/dist/bot/handlers/command/resume.js +325 -0
- package/dist/bot/handlers/command/session.js +299 -0
- package/dist/bot/handlers/command/settings.js +657 -0
- package/dist/bot/handlers/command/shared.js +207 -0
- package/dist/bot/handlers/command/tasks.js +681 -0
- package/dist/bot/handlers/command/thread.js +128 -0
- package/dist/bot/handlers/command/topic-store.js +74 -0
- package/dist/bot/handlers/command/topic.js +27 -0
- package/dist/bot/handlers/command/usage.js +382 -0
- package/dist/bot/handlers/command-fallback.js +179 -0
- package/dist/bot/handlers/command.handler.js +446 -0
- package/dist/bot/handlers/loop.handler.js +389 -0
- package/dist/bot/handlers/media-fallback.js +126 -0
- package/dist/bot/handlers/message/replies.js +56 -0
- package/dist/bot/handlers/message/shared.js +95 -0
- package/dist/bot/handlers/message/turn-notify.js +135 -0
- package/dist/bot/handlers/message/turn-runner.js +56 -0
- package/dist/bot/handlers/message.handler.js +114 -0
- package/dist/bot/handlers/newbot.handler.js +230 -0
- package/dist/bot/handlers/photo.handler.js +286 -0
- package/dist/bot/handlers/prompts.handler.js +343 -0
- package/dist/bot/handlers/running-note.js +44 -0
- package/dist/bot/handlers/session-guard.js +78 -0
- package/dist/bot/handlers/suggestion.handler.js +84 -0
- package/dist/bot/handlers/tree.handler.js +480 -0
- package/dist/bot/handlers/view.js +41 -0
- package/dist/bot/handlers/voice.handler.js +147 -0
- package/dist/bot/kept-threads.js +51 -0
- package/dist/bot/middleware/admin-only.js +49 -0
- package/dist/bot/middleware/album-collector.js +69 -0
- package/dist/bot/middleware/auth.middleware.js +122 -0
- package/dist/bot/middleware/group-mention.middleware.js +145 -0
- package/dist/bot/middleware/group-role.middleware.js +75 -0
- package/dist/bot/middleware/message-batcher.js +87 -0
- package/dist/bot/middleware/queued-messages.js +1082 -0
- package/dist/bot/middleware/stale-filter.js +9 -0
- package/dist/build-info.json +8 -0
- package/dist/claude/ask-user-form.js +517 -0
- package/dist/claude/ask-user.js +363 -0
- package/dist/claude/auto-approve.js +225 -0
- package/dist/claude/auto-topic-haiku.js +143 -0
- package/dist/claude/available-commands.js +156 -0
- package/dist/claude/background-hint.js +91 -0
- package/dist/claude/branch-tree.js +393 -0
- package/dist/claude/carry-over.js +25 -0
- package/dist/claude/ccr-shim.js +48 -0
- package/dist/claude/charter-judge.js +214 -0
- package/dist/claude/claude-auth.js +117 -0
- package/dist/claude/command-parser.js +206 -0
- package/dist/claude/cost-overlay-scraper.js +134 -0
- package/dist/claude/effort-level.js +5 -0
- package/dist/claude/enabled-plugins.js +52 -0
- package/dist/claude/in-flight-tracker.js +82 -0
- package/dist/claude/ipc-server.js +192 -0
- package/dist/claude/mcp-bridge.js +481 -0
- package/dist/claude/memory-guard.js +400 -0
- package/dist/claude/message-offsets.js +88 -0
- package/dist/claude/modal-relay.js +817 -0
- package/dist/claude/model-catalog.js +102 -0
- package/dist/claude/monitor-relay.js +712 -0
- package/dist/claude/native-commands.js +40 -0
- package/dist/claude/pending-branches.js +93 -0
- package/dist/claude/pending-suggestions.js +50 -0
- package/dist/claude/permission-gate.js +338 -0
- package/dist/claude/permission-mode.js +152 -0
- package/dist/claude/poll-user.js +51 -0
- package/dist/claude/prewarm.js +70 -0
- package/dist/claude/project-commands.js +69 -0
- package/dist/claude/prompt-hold.js +124 -0
- package/dist/claude/prompt-suggestion-scraper.js +89 -0
- package/dist/claude/pty-idle-reaper.js +96 -0
- package/dist/claude/pty-provider.js +2499 -0
- package/dist/claude/pty-spawn-config.js +343 -0
- package/dist/claude/pty-stream.js +363 -0
- package/dist/claude/pty-watch.js +201 -0
- package/dist/claude/request-queue.js +107 -0
- package/dist/claude/rewind.js +111 -0
- package/dist/claude/scheduled-runner.js +89 -0
- package/dist/claude/scheduler.js +241 -0
- package/dist/claude/scope-guard.js +279 -0
- package/dist/claude/screen-marks.js +83 -0
- package/dist/claude/screen-render.js +96 -0
- package/dist/claude/secret-request.js +576 -0
- package/dist/claude/session-history.js +288 -0
- package/dist/claude/session-jsonl.js +1067 -0
- package/dist/claude/session-manager.js +216 -0
- package/dist/claude/session-move.js +70 -0
- package/dist/claude/session-scan.js +270 -0
- package/dist/claude/setup-token.js +285 -0
- package/dist/claude/shell-mode-gate.js +60 -0
- package/dist/claude/side-call-options.js +45 -0
- package/dist/claude/side-question.js +252 -0
- package/dist/claude/stage-images.js +62 -0
- package/dist/claude/subagent-tools.js +12 -0
- package/dist/claude/synthetic-ctx.js +51 -0
- package/dist/claude/tasks-overlay-scraper.js +217 -0
- package/dist/claude/thread-judge-haiku.js +88 -0
- package/dist/claude/tip-scraper.js +77 -0
- package/dist/claude/tui-modal.js +746 -0
- package/dist/claude/tui-state.js +456 -0
- package/dist/claude/turn-end.js +105 -0
- package/dist/claude/turn-prose.js +64 -0
- package/dist/claude/typed-answer.js +104 -0
- package/dist/claude/update-banner-relay.js +70 -0
- package/dist/cli/commands/doctor.js +338 -0
- package/dist/cli/commands/help.js +34 -0
- package/dist/cli/commands/init.js +126 -0
- package/dist/cli/commands/service.js +710 -0
- package/dist/cli/commands/start.js +63 -0
- package/dist/cli/commands/version.js +11 -0
- package/dist/cli/commands/watch.js +322 -0
- package/dist/cli/dispatch.js +84 -0
- package/dist/cli/init/env-file.js +99 -0
- package/dist/cli/init/flow.js +705 -0
- package/dist/cli/init/prompter.js +124 -0
- package/dist/cli/init/telegram.js +120 -0
- package/dist/cli/service/render.js +212 -0
- package/dist/cli.js +18 -0
- package/dist/config-report.js +107 -0
- package/dist/config.js +525 -0
- package/dist/index.js +443 -0
- package/dist/launcher.js +960 -0
- package/dist/node-version-check.js +27 -0
- package/dist/providers/ccr-health.js +119 -0
- package/dist/providers/ccr-introspect.js +142 -0
- package/dist/providers/ccr-provider.js +59 -0
- package/dist/providers/claude-provider.js +10 -0
- package/dist/providers/prefs-sync.js +121 -0
- package/dist/providers/project-favorites.js +74 -0
- package/dist/providers/provider-router.js +128 -0
- package/dist/providers/provider-switch.js +91 -0
- package/dist/providers/spawn-settings.js +45 -0
- package/dist/providers/types.js +8 -0
- package/dist/providers/user-preferences.js +322 -0
- package/dist/restart-when-idle.js +173 -0
- package/dist/startup/auto-continue.js +67 -0
- package/dist/startup/auto-resume.js +161 -0
- package/dist/startup/notices.js +120 -0
- package/dist/startup/shared.js +44 -0
- package/dist/startup/verify-token.js +31 -0
- package/dist/telegram/access-request.js +153 -0
- package/dist/telegram/action-logger.js +522 -0
- package/dist/telegram/admin-mention.js +107 -0
- package/dist/telegram/background-activity-card.js +502 -0
- package/dist/telegram/botname-settings.js +282 -0
- package/dist/telegram/button-text.js +26 -0
- package/dist/telegram/client-options.js +26 -0
- package/dist/telegram/deduplication.js +33 -0
- package/dist/telegram/entities.js +295 -0
- package/dist/telegram/force-reply-tracker.js +96 -0
- package/dist/telegram/lettered-options.js +87 -0
- package/dist/telegram/markdown.js +362 -0
- package/dist/telegram/message-sender.js +1019 -0
- package/dist/telegram/prompt-label.js +148 -0
- package/dist/telegram/prompt-suggestion.js +54 -0
- package/dist/telegram/send.js +123 -0
- package/dist/telegram/streaming-turn.js +103 -0
- package/dist/telegram/suggestions-settings.js +30 -0
- package/dist/telegram/table-lists.js +56 -0
- package/dist/telegram/task-list.js +367 -0
- package/dist/telegram/task-tracker.js +128 -0
- package/dist/telegram/terminal-renderer.js +667 -0
- package/dist/telegram/thread-titles.js +262 -0
- package/dist/telegram/threads-setup.js +117 -0
- package/dist/utils/admins.js +143 -0
- package/dist/utils/agent-timer.js +55 -0
- package/dist/utils/atomic-write.js +24 -0
- package/dist/utils/bot-icon.js +248 -0
- package/dist/utils/bot-token.js +77 -0
- package/dist/utils/bounded-map.js +55 -0
- package/dist/utils/build-info.js +57 -0
- package/dist/utils/caffeinate.js +53 -0
- package/dist/utils/claude-env.js +53 -0
- package/dist/utils/claude-version.js +48 -0
- package/dist/utils/config-home.js +62 -0
- package/dist/utils/download.js +137 -0
- package/dist/utils/exit-codes.js +59 -0
- package/dist/utils/file-type.js +149 -0
- package/dist/utils/format.js +78 -0
- package/dist/utils/home-project.js +30 -0
- package/dist/utils/host-stall.js +51 -0
- package/dist/utils/id-list.js +44 -0
- package/dist/utils/idle-restart.js +92 -0
- package/dist/utils/install-mode.js +63 -0
- package/dist/utils/instance-config.js +148 -0
- package/dist/utils/instances.js +95 -0
- package/dist/utils/json-store.js +140 -0
- package/dist/utils/keyed-settings.js +62 -0
- package/dist/utils/legacy-env.js +35 -0
- package/dist/utils/memory-pressure.js +60 -0
- package/dist/utils/npm-version.js +134 -0
- package/dist/utils/prefs-relay.js +107 -0
- package/dist/utils/proc-children.js +102 -0
- package/dist/utils/resolve-bin.js +86 -0
- package/dist/utils/resolve-claude-bin.js +52 -0
- package/dist/utils/respawn-backoff.js +28 -0
- package/dist/utils/sanitize.js +91 -0
- package/dist/utils/session-key.js +37 -0
- package/dist/utils/stale-launcher.js +109 -0
- package/dist/utils/state-dir-migration.js +92 -0
- package/dist/utils/systemd.js +126 -0
- package/dist/utils/telegram-proxy.js +72 -0
- package/dist/utils/uploads-dir.js +27 -0
- package/dist/utils/user-roster.js +275 -0
- package/dist/utils/verbosity.js +118 -0
- package/dist/utils/version-check.js +166 -0
- package/dist/utils/workspace-guard.js +44 -0
- package/dist/worker-restart.js +141 -0
- package/instances.json.example +41 -0
- package/package.json +75 -4
package/.env.example
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# ═══════════════════════════════════════════════════════════════
|
|
2
|
+
# TeleCoder Configuration
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════
|
|
4
|
+
|
|
5
|
+
# Note: a variable already exported in the environment the bot was started from
|
|
6
|
+
# wins over the value here — dotenv never overwrites what is already set, and a
|
|
7
|
+
# restart inherits the environment it was started from, so an old exported value
|
|
8
|
+
# can outlive every restart. The bot logs an [env] warning at startup naming any
|
|
9
|
+
# setting in this file that is being shadowed that way; the fix is to restart it
|
|
10
|
+
# from a shell that doesn't export them.
|
|
11
|
+
|
|
12
|
+
# ── Core ──────────────────────────────────────────────────────
|
|
13
|
+
# Telegram bot token from @BotFather
|
|
14
|
+
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
|
|
15
|
+
|
|
16
|
+
# Comma-separated numeric Telegram user IDs allowed to use the bot — numbers,
|
|
17
|
+
# not @usernames. Get yours by messaging @userinfobot on Telegram, or message
|
|
18
|
+
# the bot once it runs: it tells anyone not on this list their ID.
|
|
19
|
+
# 123456789 below is a placeholder: the bot refuses to start until you replace it.
|
|
20
|
+
ALLOWED_USER_IDS=123456789
|
|
21
|
+
|
|
22
|
+
# ── Sharing the bot ───────────────────────────────────────────
|
|
23
|
+
# Everything below is for a bot you share with other people. A solo bot needs
|
|
24
|
+
# none of it and behaves exactly the same whether or not you read this section.
|
|
25
|
+
#
|
|
26
|
+
# ADMIN_USER_IDS is the subset of ALLOWED_USER_IDS that may approve permission
|
|
27
|
+
# prompts and run bot-lifecycle commands (/botupdate, /botrestart, /botrebuild)
|
|
28
|
+
# and the backend one (/ccr). Everyone else is a "guest":
|
|
29
|
+
# they can use the agent normally, but guarded commands wait on an admin.
|
|
30
|
+
# Unset = every allowed user is an admin. Admins must also be in
|
|
31
|
+
# ALLOWED_USER_IDS — the auth check runs first and would turn them away, so the
|
|
32
|
+
# bot refuses to start rather than leave an admin who can never act.
|
|
33
|
+
# ADMIN_USER_IDS=111111111
|
|
34
|
+
|
|
35
|
+
# APPROVER_USER_IDS is the subset of ALLOWED_USER_IDS that may answer a
|
|
36
|
+
# permission prompt without owning the bot. An approver is a guest everywhere
|
|
37
|
+
# else — the charter judge still reads their messages, the gate still stops
|
|
38
|
+
# their tool calls, /botrestart and /ccr still refuse them. They just stop
|
|
39
|
+
# you being the only person who can unblock a prompt. Nobody approves their own
|
|
40
|
+
# request: the buttons go to the admins plus every approver except whoever
|
|
41
|
+
# asked. Needs ADMIN_USER_IDS set — without it everyone is already an admin.
|
|
42
|
+
# An approver has to be able to reach the bot first, so their id must be in
|
|
43
|
+
# ALLOWED_USER_IDS or have been /allow'd from chat; the bot says so at startup
|
|
44
|
+
# if it is in neither.
|
|
45
|
+
# APPROVER_USER_IDS=222222222,333333333
|
|
46
|
+
|
|
47
|
+
# Comma-separated group/supergroup chat IDs the bot is used in.
|
|
48
|
+
# ALLOWED_GROUP_IDS=-1001234567890
|
|
49
|
+
|
|
50
|
+
# What being in an allow-listed group grants:
|
|
51
|
+
# spectator — membership grants presence only. People read along and talk to
|
|
52
|
+
# each other; only someone an admin has /allow'd can prompt the
|
|
53
|
+
# agent. Right for a group with an audience in it, and the
|
|
54
|
+
# default: it matches what the roster gate already enforced.
|
|
55
|
+
# contributor — membership is the whole gate: anyone in the group can prompt
|
|
56
|
+
# the agent, which is shell access on this machine. Right for a
|
|
57
|
+
# group of peers who all own the box.
|
|
58
|
+
# Admins always have full access. Grant and revoke from the chat with /allow and
|
|
59
|
+
# /deny — replying to someone's message is the surest way to name them — and
|
|
60
|
+
# check the current state with /members. Those take effect immediately; no
|
|
61
|
+
# restart. /allow in the group grants it *there*; /allow in a DM admits someone
|
|
62
|
+
# to the bot everywhere, which /users reads back.
|
|
63
|
+
#
|
|
64
|
+
# Note: posts from anonymous group admins all arrive as the same Telegram user
|
|
65
|
+
# id (1087968824), so under 'spectator' they are gated as one. /allow 1087968824
|
|
66
|
+
# admits every anonymous admin at once, or ask them to post normally.
|
|
67
|
+
# GROUP_MEMBERS_DEFAULT=spectator
|
|
68
|
+
|
|
69
|
+
# In a group, only react to messages that address the bot: an @mention, a reply
|
|
70
|
+
# to one of the bot's own messages, or a slash command. Set to false to treat
|
|
71
|
+
# every message in the group as a prompt (only sensible in a group dedicated to
|
|
72
|
+
# the bot — otherwise people can't talk to each other).
|
|
73
|
+
# Requires Telegram's privacy mode to be OFF for the bot (@BotFather ->
|
|
74
|
+
# /setprivacy -> Disable, then re-add the bot to the group), or Telegram won't
|
|
75
|
+
# deliver mentions at all.
|
|
76
|
+
# GROUP_REQUIRE_MENTION=true
|
|
77
|
+
|
|
78
|
+
# Treat any reply to one of the bot's messages as addressing it, as it worked
|
|
79
|
+
# before mentions were required. Off by default: replying is also how you quote
|
|
80
|
+
# a message, so it is a poor signal of intent. Answers to the bot's own
|
|
81
|
+
# ForceReply prompts (/dir, /file) always get through, since
|
|
82
|
+
# Telegram leaves nowhere to put a mention in those.
|
|
83
|
+
# GROUP_REPLY_IS_MENTION=false
|
|
84
|
+
|
|
85
|
+
# Confine guests to those groups, so they can't take the bot into a private
|
|
86
|
+
# chat where you can't see what they're asking it. Admins can still DM it.
|
|
87
|
+
# RESTRICT_TO_GROUPS=false
|
|
88
|
+
|
|
89
|
+
# The permission gate: matching a dangerous Bash pattern (rm -rf, sudo,
|
|
90
|
+
# git push --force, DROP TABLE, terraform destroy, ...) pauses the tool call
|
|
91
|
+
# and posts an approval prompt that only an admin can answer. With guests
|
|
92
|
+
# present it turns itself on; set it explicitly to override in either
|
|
93
|
+
# direction.
|
|
94
|
+
# TELECODER_PERMISSION_PROMPTS=1
|
|
95
|
+
|
|
96
|
+
# How long a prompt (or a held message) waits for an admin before it is refused.
|
|
97
|
+
# PERMISSION_PROMPT_TIMEOUT_MINUTES=10
|
|
98
|
+
|
|
99
|
+
# Scope guard: also prompt when a tool call names a path outside the shared
|
|
100
|
+
# projects, or a credential path anywhere (~/.ssh, ~/.aws, a .env outside the
|
|
101
|
+
# roots, the bot's own state). System paths and language toolchains stay
|
|
102
|
+
# readable without prompting, so ordinary work is unaffected.
|
|
103
|
+
# 'auto' follows the permission gate. 'on' / 'off' force it.
|
|
104
|
+
# SCOPE_GUARD=auto
|
|
105
|
+
|
|
106
|
+
# Extra directories the scope guard counts as in-bounds, on top of
|
|
107
|
+
# WORKSPACE_DIR and the temp dir. Comma-separated absolute paths.
|
|
108
|
+
# SCOPE_ALLOWED_PATHS=/srv/data,/opt/shared
|
|
109
|
+
|
|
110
|
+
# Charter judge: before a guest's message reaches Claude, a Haiku side-call
|
|
111
|
+
# reads it against a plain-language charter and holds anything out of bounds
|
|
112
|
+
# for an admin. Catches what the scope guard cannot — "open a tunnel to this
|
|
113
|
+
# box", "email me the projects folder" — because neither names a path.
|
|
114
|
+
# Adds ~5s to a guest's turn; conversational filler is skipped. Fails open.
|
|
115
|
+
# 'auto' turns it on once the bot has guests.
|
|
116
|
+
# CHARTER_JUDGE=auto
|
|
117
|
+
|
|
118
|
+
# The charter the judge reads. Defaults to CHARTER.md in WORKSPACE_DIR when
|
|
119
|
+
# that file exists, and to a generated one naming the allowed roots otherwise.
|
|
120
|
+
# CHARTER_FILE=/srv/shared/CHARTER.md
|
|
121
|
+
|
|
122
|
+
# ── Claude ────────────────────────────────────────────────────
|
|
123
|
+
# Anthropic API key (optional — leave empty to use Claude Max subscription)
|
|
124
|
+
# ANTHROPIC_API_KEY=sk-ant-...
|
|
125
|
+
|
|
126
|
+
# A long-lived Claude token from `claude setup-token`, for a machine you won't
|
|
127
|
+
# sign in on. Used in place of the `claude` login.
|
|
128
|
+
# CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
|
|
129
|
+
|
|
130
|
+
# Optional: explicit .env path (useful if you start the bot from another directory)
|
|
131
|
+
# TELECODER_ENV_PATH=/absolute/path/to/telecoder/.env
|
|
132
|
+
|
|
133
|
+
# Upgrading from Claudegram? Every TELECODER_* var below was CLAUDEGRAM_* before
|
|
134
|
+
# the July 2026 rename. The old names still work and log a one-time deprecation
|
|
135
|
+
# warning at startup, so you can rename them whenever it suits you:
|
|
136
|
+
# TELECODER_ENV_PATH, TELECODER_INSTANCES_CONFIG, TELECODER_IPC_PORT,
|
|
137
|
+
# TELECODER_PERMISSION_PROMPTS, TELECODER_ALLOW_NATIVE_SCHEDULING
|
|
138
|
+
|
|
139
|
+
# The `claude` your chats run: CLAUDE_BIN, else the one on PATH (~/.local/bin
|
|
140
|
+
# is searched first). Set it when the CLI lives where the service can't see it.
|
|
141
|
+
# CLAUDE_BIN=/home/username/.local/bin/claude
|
|
142
|
+
|
|
143
|
+
# The `claude` the quick Haiku side calls (topic names, the charter judge) run
|
|
144
|
+
# through: the copy bundled with the agent SDK, or CLAUDE_EXECUTABLE_PATH when
|
|
145
|
+
# the flag is false.
|
|
146
|
+
# CLAUDE_USE_BUNDLED_EXECUTABLE=true
|
|
147
|
+
# CLAUDE_EXECUTABLE_PATH=/home/username/.local/bin/claude
|
|
148
|
+
|
|
149
|
+
# Whether Claude starts with your own Claude Code setup, as it does in your
|
|
150
|
+
# terminal: ~/.claude (CLAUDE.md, skills, commands, agents, settings.json), your
|
|
151
|
+
# MCP servers, your plugins and your claude.ai connectors.
|
|
152
|
+
# auto yes, unless the bot has guests: they would otherwise work with your
|
|
153
|
+
# instructions, and with connectors signed in as you (default)
|
|
154
|
+
# on always
|
|
155
|
+
# off never: Claude knows the project and what the two settings below name
|
|
156
|
+
# CLAUDE_USER_SETUP=auto
|
|
157
|
+
|
|
158
|
+
# Extra MCP servers for the bot's agent, as a path to a JSON file holding
|
|
159
|
+
# {"mcpServers": {...}} in the same shape as ~/.claude.json. Merged into the
|
|
160
|
+
# spawn config; the bot's own telecoder-tools always wins a name clash.
|
|
161
|
+
#
|
|
162
|
+
# Your own servers come with your setup (CLAUDE_USER_SETUP). This is for a
|
|
163
|
+
# server only the bot should have, and it is the only way to add one while your
|
|
164
|
+
# setup stays out: a `claude mcp add` entry is then stored and ignored. Keep
|
|
165
|
+
# the file outside the repo if it carries a token.
|
|
166
|
+
# EXTRA_MCP_CONFIG=/home/you/.config/telecoder-mcp.json
|
|
167
|
+
|
|
168
|
+
# Marketplace plugins to enable inside the bot's agent, comma-separated, as the
|
|
169
|
+
# plugin@marketplace ids `claude plugin list` prints. A plugin you enabled in
|
|
170
|
+
# the terminal sits in ~/.claude/settings.json and comes with your setup
|
|
171
|
+
# (CLAUDE_USER_SETUP). This is for a plugin only the bot should have, or for
|
|
172
|
+
# bringing one across while your setup stays out.
|
|
173
|
+
# CLAUDE_PLUGINS=frontend-design@claude-plugins-official
|
|
174
|
+
|
|
175
|
+
# Claude Code's own scheduling tools (CronCreate, ScheduleWakeup, RemoteTrigger)
|
|
176
|
+
# are blocked: what they schedule fires outside the chat and never reaches
|
|
177
|
+
# Telegram. /loop and the bot's own tools take their place. 1 leaves the
|
|
178
|
+
# built-ins enabled.
|
|
179
|
+
# TELECODER_ALLOW_NATIVE_SCHEDULING=1
|
|
180
|
+
|
|
181
|
+
# The port on 127.0.0.1 where the bot listens for Claude Code's hooks and its
|
|
182
|
+
# own MCP tools. Unset, a free port is picked; leave it that way unless
|
|
183
|
+
# something has to know the port. Several bots in one launcher can't share one.
|
|
184
|
+
# TELECODER_IPC_PORT=47821
|
|
185
|
+
|
|
186
|
+
# The bot's name: what it calls itself in the system prompt and its messages,
|
|
187
|
+
# and the display name it sets in Telegram at startup when this is given.
|
|
188
|
+
# Unset, the name chosen in BotFather is kept. /botname in the chat wins over this.
|
|
189
|
+
# BOT_NAME=TeleCoder
|
|
190
|
+
|
|
191
|
+
# ── Workspace ─────────────────────────────────────────────────
|
|
192
|
+
# Root directory shown in /dir picker
|
|
193
|
+
# Default: $HOME
|
|
194
|
+
# WORKSPACE_DIR=/home/username/projects
|
|
195
|
+
|
|
196
|
+
# The project this bot is for: conversations with nothing to restore start
|
|
197
|
+
# there, and threads in it are named without it. Usually set per bot in
|
|
198
|
+
# instances.json, which /newbot does. Absolute, or relative to WORKSPACE_DIR.
|
|
199
|
+
# HOME_PROJECT=my-project
|
|
200
|
+
|
|
201
|
+
# ── Network ───────────────────────────────────────────────────
|
|
202
|
+
# An HTTP or HTTPS proxy for the bot's requests to Telegram, for a network
|
|
203
|
+
# where Telegram is blocked. SOCKS proxies aren't supported. Unset, HTTPS_PROXY
|
|
204
|
+
# or HTTP_PROXY is used when the environment has one. Files you send the bot
|
|
205
|
+
# are fetched through it too, and `telecoder init` and `telecoder doctor --live`
|
|
206
|
+
# reach Telegram through it.
|
|
207
|
+
# TELEGRAM_PROXY_URL=http://127.0.0.1:8080
|
|
208
|
+
|
|
209
|
+
# ── Response Behavior ─────────────────────────────────────────
|
|
210
|
+
# The longest one message of a reply may be, in characters; a longer reply is
|
|
211
|
+
# split into several (default: 4000, Telegram's own limit is 4096)
|
|
212
|
+
MAX_MESSAGE_LENGTH=4000
|
|
213
|
+
|
|
214
|
+
# Auto-restore session on /botrestart and /botrebuild (true/false)
|
|
215
|
+
# Default: false (shows manual Continue/Resume buttons instead)
|
|
216
|
+
AUTO_RESTORE_SESSION=false
|
|
217
|
+
|
|
218
|
+
# ── PTY turn timeout ──────────────────────────────────────────
|
|
219
|
+
# Absolute per-turn wall-clock cap. The turn is killed with a
|
|
220
|
+
# "turn exceeded" error if it runs longer. Default 7200000 = 2 h.
|
|
221
|
+
# Raise it if intensive turns legitimately hit the cap.
|
|
222
|
+
# CLAUDE_PTY_HARD_TIMEOUT_MS=7200000
|
|
223
|
+
|
|
224
|
+
# ── PTY idle timeout ──────────────────────────────────────────
|
|
225
|
+
# A PTY session keeps its claude process (a few hundred MB) between turns.
|
|
226
|
+
# One idle this long is ended; the next message resumes the conversation in
|
|
227
|
+
# a new one. Never while a turn, background task or background shell runs.
|
|
228
|
+
# Also cleans up after threads deleted by hand. Default 3600000 = 1 h; 0 keeps
|
|
229
|
+
# them until a restart.
|
|
230
|
+
# CLAUDE_PTY_IDLE_TIMEOUT_MS=3600000
|
|
231
|
+
|
|
232
|
+
# ── telecoder watch ───────────────────────────────────────────
|
|
233
|
+
# Serve each chat's live Claude Code screen, read-only, for the
|
|
234
|
+
# "telecoder watch" command. The socket is in ~/.telecoder/watch and only this
|
|
235
|
+
# user can open it. false turns it off.
|
|
236
|
+
# PTY_WATCH=true
|
|
237
|
+
|
|
238
|
+
# ── Early start ───────────────────────────────────────────────
|
|
239
|
+
# Start a chat's claude as soon as its conversation is chosen (/dir,
|
|
240
|
+
# /clear, /resume), so the first message doesn't wait for Claude Code to
|
|
241
|
+
# start. Skipped silently when memory is under the guard's floor below; one
|
|
242
|
+
# nobody uses is ended by the idle timeout. false starts it on the first
|
|
243
|
+
# message instead.
|
|
244
|
+
# PREWARM_CLAUDE=true
|
|
245
|
+
|
|
246
|
+
# ── Memory guard ──────────────────────────────────────────────
|
|
247
|
+
# Before a message starts a new claude for a chat (a new chat or thread,
|
|
248
|
+
# or one whose claude was ended), the machine's available memory is checked.
|
|
249
|
+
# Under MEMORY_GUARD_MIN_AVAILABLE_MB, claudes idle longer than
|
|
250
|
+
# MEMORY_GUARD_REAP_IDLE_MS are ended first; if that still leaves too little,
|
|
251
|
+
# the chat is asked: start anyway, end the longest-idle claude first, or drop
|
|
252
|
+
# the message. A message to a running claude never asks. A claude let through
|
|
253
|
+
# in the last half minute counts as a few hundred MB spent, so two threads
|
|
254
|
+
# started together can't both slip past. "auto" is a quarter of RAM, at least
|
|
255
|
+
# 1024 MB. 0 turns it off.
|
|
256
|
+
# MEMORY_GUARD_MIN_AVAILABLE_MB=auto
|
|
257
|
+
# MEMORY_GUARD_REAP_IDLE_MS=300000
|
|
258
|
+
# Swap in use above this many MB also counts as tight. Off (0) by default:
|
|
259
|
+
# swap stays occupied long after the pressure passes, so this nags on a box
|
|
260
|
+
# that swaps at all.
|
|
261
|
+
# MEMORY_GUARD_MAX_SWAP_USED_MB=0
|
|
262
|
+
|
|
263
|
+
# ── Question timeout ──────────────────────────────────────────
|
|
264
|
+
# How long a question the agent asks in the chat waits for an answer: the
|
|
265
|
+
# buttons of telecoder_ask_user, a telecoder_poll_user poll, a Claude Code
|
|
266
|
+
# dialog relayed to the chat. After that the turn carries on without one, and
|
|
267
|
+
# the question is closed — buttons taken down, poll stopped — so it doesn't
|
|
268
|
+
# look answerable any more. The turn is paused for the whole wait and new
|
|
269
|
+
# messages queue behind it, so a long timeout is a long stall whenever a
|
|
270
|
+
# question goes unanswered. Permission prompts have their own timeout,
|
|
271
|
+
# PERMISSION_PROMPT_TIMEOUT_MINUTES. Default: 10.
|
|
272
|
+
# QUESTION_TIMEOUT_MINUTES=10
|
|
273
|
+
|
|
274
|
+
# ── Voice Transcription (Groq Whisper) ────────────────────────
|
|
275
|
+
# Requires: a Groq API key
|
|
276
|
+
# Leave empty to disable voice message support
|
|
277
|
+
|
|
278
|
+
# Enable voice notes (set false to disable)
|
|
279
|
+
TRANSCRIBE_ENABLED=true
|
|
280
|
+
|
|
281
|
+
# Groq API key for Whisper transcription
|
|
282
|
+
# GROQ_API_KEY=gsk_...
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
# Show transcript text before agent response
|
|
286
|
+
VOICE_SHOW_TRANSCRIPT=true
|
|
287
|
+
|
|
288
|
+
# Max voice file size in MB (Telegram limit ~20MB)
|
|
289
|
+
VOICE_MAX_FILE_SIZE_MB=19
|
|
290
|
+
|
|
291
|
+
# Transcription language (ISO 639-1 code)
|
|
292
|
+
VOICE_LANGUAGE=en
|
|
293
|
+
|
|
294
|
+
# Transcription timeout (ms)
|
|
295
|
+
VOICE_TIMEOUT_MS=60000
|
|
296
|
+
|
|
297
|
+
# ── Replies and notifications ─────────────────────────────────
|
|
298
|
+
# The /verbosity tier for chats that haven't picked one: quiet, normal,
|
|
299
|
+
# verbose or debug.
|
|
300
|
+
# VERBOSITY_DEFAULT=normal
|
|
301
|
+
|
|
302
|
+
# The footer that closes every reply (project, effort, model, context and
|
|
303
|
+
# the topic), for chats that haven't used /footer. Sent silently. The
|
|
304
|
+
# last-prompts and claude --resume lines stay opt-in through /footer.
|
|
305
|
+
STATUS_LINE_DEFAULT=true
|
|
306
|
+
|
|
307
|
+
# Show a tool's full input in the live status message — the whole Bash command,
|
|
308
|
+
# the full file path or URL — instead of a shortened one, whatever the
|
|
309
|
+
# /verbosity tier (which turns it on from verbose up). Was TERMINAL_UI_VERBOSE.
|
|
310
|
+
# FULL_TOOL_INPUTS=true
|
|
311
|
+
|
|
312
|
+
# Show the context-use line after each turn (a bar, the percentage, tokens used
|
|
313
|
+
# and turns), whatever the /verbosity tier. Unset, the tier decides, and shows
|
|
314
|
+
# it from verbose up. It closes the footer when that's on.
|
|
315
|
+
# CONTEXT_SHOW_USAGE=true
|
|
316
|
+
|
|
317
|
+
# Say so in the chat when Claude Code compacts the conversation by itself.
|
|
318
|
+
# Unset, the tier decides, and every tier says so; false turns the notice off.
|
|
319
|
+
# CONTEXT_NOTIFY_COMPACTION=false
|
|
320
|
+
|
|
321
|
+
# Predicted next-prompt buttons under each reply, for chats that haven't used
|
|
322
|
+
# /suggestions. Off by default: each suggestion is an extra, speculative call,
|
|
323
|
+
# and Claude Code doesn't offer them on every account. Takes effect when a
|
|
324
|
+
# chat's claude next starts.
|
|
325
|
+
# PROMPT_SUGGESTIONS_DEFAULT=false
|
|
326
|
+
|
|
327
|
+
# After a turn that took at least NOTIFICATION_THRESHOLD_SECONDS, send a short
|
|
328
|
+
# "Done (1m 12s)" message, so that Telegram notifies you. The quiet /verbosity
|
|
329
|
+
# tier leaves it out. A background task that ran at least that long also
|
|
330
|
+
# notifies when it ends; a shorter one is noted silently, unless it failed.
|
|
331
|
+
# NOTIFICATION_ENABLED=true
|
|
332
|
+
# NOTIFICATION_THRESHOLD_SECONDS=60
|
|
333
|
+
|
|
334
|
+
# ── Message Batching ──────────────────────────────────────────
|
|
335
|
+
# Telegram splits a long paste into several messages; combine them back into a
|
|
336
|
+
# single prompt. Only a message of 2000+ characters waits for more parts, so
|
|
337
|
+
# ordinary messages aren't delayed. How long to wait for the next part, in ms;
|
|
338
|
+
# 0 = disabled.
|
|
339
|
+
# MESSAGE_BATCH_TIMEOUT_MS=1500
|
|
340
|
+
|
|
341
|
+
# Fire a parallel Haiku side-call on every user message to derive a 1-4 word
|
|
342
|
+
# topic label for the footer and the thread name, independent of the main
|
|
343
|
+
# agent. Deferral-immune (bypasses settingSources and tools entirely). Off, the
|
|
344
|
+
# agent is asked to keep the topic itself with telecoder_set_topic. Auth
|
|
345
|
+
# piggybacks on the same Claude executable, so no extra API key is needed under Max.
|
|
346
|
+
AUTO_TOPIC_HAIKU=true
|
|
347
|
+
|
|
348
|
+
# Image Uploads
|
|
349
|
+
# Max image file size in MB (Telegram limit ~20MB for downloads)
|
|
350
|
+
IMAGE_MAX_FILE_SIZE_MB=20
|
|
351
|
+
|
|
352
|
+
# Max size in MB for any other file sent to the bot. Telegram won't let a bot
|
|
353
|
+
# download a file over 20 MB, so raising either limit past that doesn't help.
|
|
354
|
+
# DOCUMENT_MAX_FILE_SIZE_MB=19
|
|
355
|
+
|
|
356
|
+
# ── Claude Code Router (CCR) Provider ────────────────────────
|
|
357
|
+
# Enable /ccr, the switch between Claude (Max) and CCR (true/false).
|
|
358
|
+
# Redirects the spawned `claude` binary through a local CCR proxy so it can
|
|
359
|
+
# be backed by non-Anthropic models — useful as a fallback when Max runs out.
|
|
360
|
+
# Requires CCR installed and running: https://github.com/musistudio/claude-code-router
|
|
361
|
+
# CCR_ENABLED=false
|
|
362
|
+
|
|
363
|
+
# CCR proxy base URL (where ccr's local HTTP proxy listens).
|
|
364
|
+
# CCR_BASE_URL=http://localhost:3456
|
|
365
|
+
|
|
366
|
+
# CCR's local auth token (see ccr config — usually any non-empty string).
|
|
367
|
+
# CCR_AUTH_TOKEN=
|
|
368
|
+
|
|
369
|
+
# When the CCR proxy isn't reachable, automatically run `ccr start` in the
|
|
370
|
+
# background instead of letting the request hang on ConnectionRefused.
|
|
371
|
+
# CCR_AUTOSTART=false
|
|
372
|
+
|
|
373
|
+
# Path or name of the `ccr` binary used for autostart. Defaults to `ccr`
|
|
374
|
+
# (resolved via PATH). Override if `ccr` lives where systemd can't see it.
|
|
375
|
+
# CCR_BINARY=ccr
|