charness 3.1.0 → 3.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.
Files changed (138) hide show
  1. package/.env.example +8 -7
  2. package/DEVELOPMENT.md +12 -6
  3. package/MIGRATION_1_TO_2.md +1 -1
  4. package/MIGRATION_RENAME_TO_CHARNESS.md +133 -0
  5. package/README.md +75 -581
  6. package/SETUP.md +539 -0
  7. package/dist/adapters/claudeCliAdapter.d.ts +1 -1
  8. package/dist/adapters/claudeCliAdapter.js +1 -1
  9. package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
  10. package/dist/adapters/claudeJsonStreamAdapter.js +2 -1
  11. package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
  12. package/dist/adapters/openCodeAdapter.js +1 -1
  13. package/dist/bot.d.ts.map +1 -1
  14. package/dist/bot.js +7 -6
  15. package/dist/bot.js.map +1 -1
  16. package/dist/cli/bot.d.ts +4 -2
  17. package/dist/cli/bot.d.ts.map +1 -1
  18. package/dist/cli/bot.js +11 -3
  19. package/dist/cli/bot.js.map +1 -1
  20. package/dist/cli/botEntry.js +3 -1
  21. package/dist/cli/botEntry.js.map +1 -1
  22. package/dist/cli/claudeProfiles.d.ts +3 -3
  23. package/dist/cli/claudeProfiles.js +4 -4
  24. package/dist/cli/claudeProfiles.js.map +1 -1
  25. package/dist/cli/envLoader.d.ts +6 -5
  26. package/dist/cli/envLoader.d.ts.map +1 -1
  27. package/dist/cli/envLoader.js +8 -27
  28. package/dist/cli/envLoader.js.map +1 -1
  29. package/dist/cli/hot.d.ts +2 -2
  30. package/dist/cli/hot.d.ts.map +1 -1
  31. package/dist/cli/hot.js +26 -16
  32. package/dist/cli/hot.js.map +1 -1
  33. package/dist/cli.js +12 -12
  34. package/dist/cli.js.map +1 -1
  35. package/dist/connectors/jira/adf.d.ts +21 -0
  36. package/dist/connectors/jira/adf.d.ts.map +1 -1
  37. package/dist/connectors/jira/adf.js +39 -0
  38. package/dist/connectors/jira/adf.js.map +1 -1
  39. package/dist/connectors/jira/answerSink.d.ts +20 -3
  40. package/dist/connectors/jira/answerSink.d.ts.map +1 -1
  41. package/dist/connectors/jira/answerSink.js +126 -13
  42. package/dist/connectors/jira/answerSink.js.map +1 -1
  43. package/dist/connectors/jira/client.d.ts +4 -0
  44. package/dist/connectors/jira/client.d.ts.map +1 -1
  45. package/dist/connectors/jira/client.js +3 -0
  46. package/dist/connectors/jira/client.js.map +1 -1
  47. package/dist/connectors/jira/config.d.ts +10 -1
  48. package/dist/connectors/jira/config.d.ts.map +1 -1
  49. package/dist/connectors/jira/config.js +11 -2
  50. package/dist/connectors/jira/config.js.map +1 -1
  51. package/dist/connectors/jira/connector.d.ts +7 -1
  52. package/dist/connectors/jira/connector.d.ts.map +1 -1
  53. package/dist/connectors/jira/connector.js +23 -4
  54. package/dist/connectors/jira/connector.js.map +1 -1
  55. package/dist/connectors/jira/contextLedger.d.ts +6 -0
  56. package/dist/connectors/jira/contextLedger.d.ts.map +1 -1
  57. package/dist/connectors/jira/contextLedger.js +16 -0
  58. package/dist/connectors/jira/contextLedger.js.map +1 -1
  59. package/dist/connectors/jira/contextPreamble.d.ts.map +1 -1
  60. package/dist/connectors/jira/contextPreamble.js +6 -3
  61. package/dist/connectors/jira/contextPreamble.js.map +1 -1
  62. package/dist/connectors/jira/inbound.d.ts +60 -7
  63. package/dist/connectors/jira/inbound.d.ts.map +1 -1
  64. package/dist/connectors/jira/inbound.js +169 -16
  65. package/dist/connectors/jira/inbound.js.map +1 -1
  66. package/dist/connectors/jira/issueBlocks.d.ts +6 -1
  67. package/dist/connectors/jira/issueBlocks.d.ts.map +1 -1
  68. package/dist/connectors/jira/issueBlocks.js +5 -1
  69. package/dist/connectors/jira/issueBlocks.js.map +1 -1
  70. package/dist/connectors/jira/prompt.d.ts +2 -0
  71. package/dist/connectors/jira/prompt.d.ts.map +1 -1
  72. package/dist/connectors/jira/prompt.js +16 -0
  73. package/dist/connectors/jira/prompt.js.map +1 -1
  74. package/dist/connectors/jira/trigger.d.ts +12 -3
  75. package/dist/connectors/jira/trigger.d.ts.map +1 -1
  76. package/dist/connectors/jira/trigger.js +8 -1
  77. package/dist/connectors/jira/trigger.js.map +1 -1
  78. package/dist/connectors/jira/triggerLog.d.ts +10 -3
  79. package/dist/connectors/jira/triggerLog.d.ts.map +1 -1
  80. package/dist/connectors/jira/triggerLog.js +18 -2
  81. package/dist/connectors/jira/triggerLog.js.map +1 -1
  82. package/dist/index.js +1 -1
  83. package/dist/index.js.map +1 -1
  84. package/dist/installManager.d.ts +16 -2
  85. package/dist/installManager.d.ts.map +1 -1
  86. package/dist/installManager.js +42 -12
  87. package/dist/installManager.js.map +1 -1
  88. package/dist/instanceLock.d.ts.map +1 -1
  89. package/dist/instanceLock.js +10 -8
  90. package/dist/instanceLock.js.map +1 -1
  91. package/dist/legacyMigration.d.ts +69 -0
  92. package/dist/legacyMigration.d.ts.map +1 -0
  93. package/dist/legacyMigration.js +338 -0
  94. package/dist/legacyMigration.js.map +1 -0
  95. package/dist/legacyNames.d.ts +107 -0
  96. package/dist/legacyNames.d.ts.map +1 -0
  97. package/dist/legacyNames.js +230 -0
  98. package/dist/legacyNames.js.map +1 -0
  99. package/dist/platform/answerSink.d.ts +5 -0
  100. package/dist/platform/answerSink.d.ts.map +1 -1
  101. package/dist/platform/answerSink.js.map +1 -1
  102. package/dist/requests/answerRequest.d.ts +2 -0
  103. package/dist/requests/answerRequest.d.ts.map +1 -1
  104. package/dist/requests/answerRequest.js +3 -1
  105. package/dist/requests/answerRequest.js.map +1 -1
  106. package/dist/requests/answerStyle.d.ts +11 -0
  107. package/dist/requests/answerStyle.d.ts.map +1 -0
  108. package/dist/requests/answerStyle.js +14 -0
  109. package/dist/requests/answerStyle.js.map +1 -0
  110. package/dist/requests/answerTail.d.ts.map +1 -1
  111. package/dist/requests/answerTail.js +2 -0
  112. package/dist/requests/answerTail.js.map +1 -1
  113. package/dist/requests/requestHeader.d.ts.map +1 -1
  114. package/dist/requests/requestHeader.js +3 -0
  115. package/dist/requests/requestHeader.js.map +1 -1
  116. package/dist/requests/requestLedger.js +1 -1
  117. package/dist/requests/requestLedger.js.map +1 -1
  118. package/dist/requests/types.d.ts +3 -1
  119. package/dist/requests/types.d.ts.map +1 -1
  120. package/dist/scheduler/mcpSurface.d.ts +9 -1
  121. package/dist/scheduler/mcpSurface.d.ts.map +1 -1
  122. package/dist/scheduler/mcpSurface.js +45 -12
  123. package/dist/scheduler/mcpSurface.js.map +1 -1
  124. package/dist/state.d.ts +3 -1
  125. package/dist/state.d.ts.map +1 -1
  126. package/dist/state.js +5 -2
  127. package/dist/state.js.map +1 -1
  128. package/dist/utils/claudeProfiles.d.ts +7 -0
  129. package/dist/utils/claudeProfiles.d.ts.map +1 -1
  130. package/dist/utils/claudeProfiles.js +19 -0
  131. package/dist/utils/claudeProfiles.js.map +1 -1
  132. package/dist/utils/openCodeCompactPlugin.d.ts +11 -3
  133. package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
  134. package/dist/utils/openCodeCompactPlugin.js +37 -5
  135. package/dist/utils/openCodeCompactPlugin.js.map +1 -1
  136. package/examples/.env.example +7 -7
  137. package/examples/docker-compose.yml +15 -14
  138. package/package.json +3 -1
package/SETUP.md ADDED
@@ -0,0 +1,539 @@
1
+ # Setup
2
+
3
+ How to install, configure and run Charness. The common part comes first — where to run it, install, the
4
+ environment, several instances on one host, updating; then follow the surface you use:
5
+ [Telegram](#telegram-setup) or [Jira](#jira-setup). The whole bot can also run in a container instead of through
6
+ npm — see [Alternatives](#alternatives) at the end. What Charness does is in the [README](README.md).
7
+
8
+ ## Common setup
9
+
10
+ ### Where to run the bot server
11
+
12
+ The bot runs anywhere the agent CLIs run:
13
+
14
+ - **Your own working machine** — the simplest start: launch `charness`
15
+ from your projects parent folder and your laptop/desktop becomes the
16
+ backend. The catch: agents are only reachable while the machine is on and
17
+ awake.
18
+ - **A remote server (cloud VPS/VDS or bare metal)** — the more convenient
19
+ setup: organize your working environment there once (git + your repos,
20
+ Claude Code / OpenCode, `charness`) and you get an always-on dev box you
21
+ drive from any device through Telegram — phone, tablet, voice. When picking
22
+ one, a bare-metal server without virtualization beats a virtualized VPS/VDS:
23
+ its NVMe drives are usually much faster, which matters once you also build
24
+ and run a dev server there, not just the agents. Classic terminal access to
25
+ the very same Claude sessions stays available over SSH — run plain `claude`
26
+ in the project folder: it reads the same `~/.claude/projects/<cwd-slug>/`
27
+ session store the bot uses, so a session started in a Telegram thread can
28
+ be picked up in the terminal and vice versa.
29
+
30
+ ### Install the CLI
31
+
32
+ ```bash
33
+ npm install -g charness # needs Node ≥ 22.12
34
+ ```
35
+
36
+ This registers the `charness` command; the former `telegramcode` command (and
37
+ `telegramCode`) still works as an alias. Coming from the old `telegramcode` npm
38
+ package (2.x)? Run `npm uninstall -g telegramcode` first: both install the same
39
+ commands. The config, `DATA_DIR` and sessions carry over as they are: a
40
+ `~/.config/telegramcode/.env` is still read while `~/.config/charness/.env` does
41
+ not exist, and a `~/.telegramCode` data dir is still used while `~/.charness` does
42
+ not exist. At a cold start the bot renames those two dirs itself (leaving a symlink
43
+ at the old path) and says so; every old name still in use prints one deprecation
44
+ line. What it does, its limits and the steps by hand:
45
+ [MIGRATION_RENAME_TO_CHARNESS.md](MIGRATION_RENAME_TO_CHARNESS.md).
46
+
47
+ ### Environment variables
48
+
49
+ These settings apply to every surface. The Telegram ones — the bot token, the group and the DM, voice — are listed
50
+ under [Telegram environment variables](#telegram-environment-variables).
51
+
52
+ #### External Optional
53
+
54
+ | Variable | Default | Description |
55
+ |---|---|---|
56
+ | `DATA_DIR` | `~/.charness` (an existing `~/.telegramCode` is kept while `~/.charness` does not exist) | Per-instance state. **Mandatory** if you run two bots on the same host — otherwise both share `state.json` and `mcp.json` and corrupt each other |
57
+
58
+ Agent provider/auth setup is normally done inside the agents themselves:
59
+ `claude login` for Claude CLI and `/connect <provider-id>` (for example,
60
+ `/connect openrouter`) or OpenCode's own config/plugins for OpenCode. No provider
61
+ API key env var is required by the bot for text sessions. For OpenCode, install
62
+ any third-party provider plugins or authentication resolvers before launch if
63
+ your chosen providers need them.
64
+
65
+ #### Advanced / Not Normally Needed
66
+
67
+ | Variable | Default | Set only when |
68
+ |---|---|---|
69
+ | `WORK_ROOT` | `$PWD` | You cannot control the process cwd; normal launch uses `cd <projects-parent> && charness` |
70
+ | `OPENCODE_URL` | `http://localhost:4096` | You use a custom OpenCode port or external server; the port must differ per instance |
71
+ | `OPENCODE_USERNAME` | `opencode` | `OPENCODE_PASSWORD` is set for a protected OpenCode server |
72
+ | `OPENCODE_PASSWORD` | — | Connecting to a protected OpenCode server |
73
+ | `OPENCODE_ALLOW_REMOTE` | — | `OPENCODE_URL` intentionally points outside loopback |
74
+ | `OPENCODE_BIN` | (auto) | The `opencode` binary is not on PATH or you use a fork |
75
+ | `CLAUDE_BIN` | (auto) | The `claude` binary is not on PATH due to nvm/asdf/systemd PATH differences |
76
+ | `ANTHROPIC_API_KEY` | — | A custom MCP/OpenCode plugin/auth resolver explicitly reads it; not needed for normal Claude CLI auth. The json-stream Claude backend strips it from the agent's env (subscription billing) |
77
+ | `SCHEDULER_MCP_PORT` | an OS-chosen free loopback port | You need a stable, explicitly chosen port; it must differ from this instance's `OPENCODE_URL` port |
78
+ | `CLAUDE_SCRAPE_DEBUG` | off | You are debugging Claude tmux scraping and need full RAW/FILTERED chunks |
79
+ | `AGENT_IDLE_MINUTES` | `55` | A json-stream Claude topic idle for this long is compacted (when `/compact_on_idle` allows) and its process stopped; the session sleeps and the next message resumes it — shorten it only for a test; a non-positive or non-numeric value keeps the default |
80
+ | `REQUEST_BACKSTOP_MINUTES` | `90` | A request (a Jira hand-over, a message in an answers-only topic) with nothing seen working on it for this long is re-posted to its session — shorten it only for a test; a non-positive or non-numeric value keeps the default |
81
+ | `TMUX_SOCKET_NAME` | — (the default tmux server) | The instance must run its agents on its OWN tmux server (`tmux -L <name>`; any plain name except `default`). Recommended for a second instance on one host: at boot an instance kills every agent session on its server that its own state does not know |
82
+ | `ENV_FILE` | — | Absolute path of the ONLY env file to read — no `~/.config/charness/.env`, no `$PWD/.env`; its values win over the inherited environment. Set it in the launching environment, never inside an env file (the start refuses that). `scripts/run-isolated.sh <env-file>` (in a checkout) starts an instance with a clean environment plus this variable |
83
+ | `CONNECTORS` | `telegram` | Experimental: the surfaces this instance serves, as a comma list — see [Jira setup](#jira-setup). An instance that lists `jira` refuses to start on Node below 22.12 and without `ENV_FILE`, `TMUX_SOCKET_NAME` and `DATA_DIR/jira.json`, and — with Telegram off — with a `TELEGRAM_BOT_TOKEN` or any `ATLASSIAN_*` variable in its environment. Any instance refuses to start on a `DATA_DIR` that holds conversations of a surface it does not serve |
84
+
85
+ > `WORK_DIR` (1.x) is retired. Use the wrapper from the desired parent folder
86
+ > instead of carrying the old env forward.
87
+
88
+ ### Two instances on one host
89
+
90
+ Two host instances, or a host instance next to a container: each pair of variables below must differ to avoid
91
+ silent corruption. Two containers need only different tokens and groups (Telegram), `DATA_DIR`s, container names and
92
+ hostnames: their ports and tmux servers are their own.
93
+
94
+ | What | Why it must differ |
95
+ |---|---|
96
+ | `TELEGRAM_BOT_TOKEN` (Telegram) | Telegram routes updates to a single long-poller per token; sharing → message loss |
97
+ | `ALLOWED_GROUP_ID` (Telegram) | The bot gates by group id; sharing → cross-instance leakage |
98
+ | `WORK_ROOT` | Each instance manages its subtree; sharing → tmux name collisions |
99
+ | `DATA_DIR` | `state.json` / `mcp.json` / `threads/` per instance; sharing → corrupted JSON |
100
+ | `OPENCODE_URL` port | OpenCode server binds the port; second start fails with `EADDRINUSE` and you'd silently share sessions |
101
+ | `SCHEDULER_MCP_PORT` | Optional stable scheduler-MCP port; if set, it must differ from that instance's `OPENCODE_URL` port |
102
+ | `TMUX_SOCKET_NAME` | Optional, recommended: each instance's boot kills the agent sessions on its tmux server that its own state does not know — on one shared server, the other instance's |
103
+
104
+ ### Updating
105
+
106
+ An npm install updates with `npm install -g charness@latest`; then restart `charness` (what survives a restart:
107
+ [Restart behaviour](README.md#restart-behaviour)).
108
+
109
+ **An update that renames something ships a migration guide** — read it before the restart. The names that were
110
+ renamed from TelegramCode to Charness (environment variables, the data dir, the Docker names, …) still work for
111
+ now and print a deprecation line at start; the steps are in
112
+ [MIGRATION_RENAME_TO_CHARNESS.md](MIGRATION_RENAME_TO_CHARNESS.md), the summary in the top entry of
113
+ [CHANGELOG.md](CHANGELOG.md). `scripts/self-update.sh` names a newly added migration guide in its log.
114
+
115
+ #### Updating a checkout (self-update, no root)
116
+
117
+ A checkout — the one the [Docker container](#run-with-docker) runs, or a clone from
118
+ [DEVELOPMENT.md](DEVELOPMENT.md#local-development) — updates with `scripts/self-update.sh` (not in the npm package).
119
+ It refreshes the checkout in place, running as the checkout's owning user — no root, no cross-user copying. It is
120
+ safe to run blindly (e.g. from cron):
121
+
122
+ - fast-forward only: it skips silently when the tree has tracked changes, a
123
+ merge/rebase is in progress, or local history diverged from the upstream —
124
+ a dev clone that is ahead of origin is never touched;
125
+ - `yarn install --immutable` runs only when `yarn.lock` / `package.json`
126
+ changed;
127
+ - a hot-mode instance (`charness hot`) rebuilds and restarts the worker
128
+ by itself (after a dependency install the script touches `tsconfig.json`
129
+ so `tsc -w` recompiles with the new modules); a non-hot instance gets
130
+ `yarn build` plus a restart notice — the script never kills processes;
131
+ - changes to the hot supervisor itself (`src/cli.ts`, `src/cli/hot.ts`,
132
+ `nodemon.json`) are flagged with a warning: those need a manual
133
+ `charness hot` restart (nodemon reloads only the worker).
134
+
135
+ For unattended updates give the deploying user read access to the repo (e.g.
136
+ a read-only GitLab deploy key on a passphrase-less SSH key) and add a cron
137
+ entry:
138
+
139
+ ```cron
140
+ */10 * * * * /path/to/charness/scripts/self-update.sh >> "$HOME/.local/state/charness/self-update.log" 2>&1
141
+ ```
142
+
143
+ (create the log directory once: `mkdir -p ~/.local/state/charness`).
144
+
145
+ ## Telegram setup
146
+
147
+ Four steps: create a bot, (optionally) set up a group, launch from your projects folder, bind a topic to an agent.
148
+ The CLI is installed first — see [Install the CLI](#install-the-cli). After the steps: the
149
+ [required files structure](#required-files-structure) and the
150
+ [Telegram environment variables](#telegram-environment-variables).
151
+
152
+ > **[manual]** tags a step you must do by hand in the Telegram app — an agent
153
+ > running on the host can't do it for you. Everything unmarked is a host-side
154
+ > command (or file edit) that can be automated.
155
+
156
+ ### 1. Create the bot
157
+
158
+ **[manual]** In Telegram, with @BotFather:
159
+
160
+ 1. Message [@BotFather](https://t.me/BotFather), send `/newbot`, follow prompts.
161
+ 2. Save the token (`123456789:ABCdef...`).
162
+ 3. **Disable privacy mode** — same chat: `/setprivacy` → pick this bot →
163
+ `Disable`. Without this the bot only sees `/commands`, not free-form text.
164
+
165
+ <p><img src="docs/images/01-botfather.png" width="360" alt="@BotFather: /newbot to get the token, then /setprivacy → this bot → Disable" /></p>
166
+
167
+ Put the token where the bot reads it — the global config `.env`:
168
+
169
+ ```bash
170
+ mkdir -p ~/.config/charness
171
+ $EDITOR ~/.config/charness/.env
172
+ ```
173
+
174
+ ```dotenv
175
+ # ~/.config/charness/.env — the one place your keys live
176
+ TELEGRAM_BOT_TOKEN=123456789:ABCdef...
177
+ # GROQ_API_KEY=... # optional: free voice transcription
178
+ # OWNER_USER_ID=... # set to drive the bot from its DM (step 2)
179
+ ```
180
+
181
+ All keys the bot needs live in this one file — the bot token and the optional
182
+ `GROQ_API_KEY` for voice sit side by side, no separate stores. (Agent
183
+ provider auth is the exception, and lives inside the agents themselves:
184
+ `claude login` for Claude, `/connect` or OpenCode's own config for OpenCode —
185
+ see [Environment Variables](#environment-variables).) The wrapper loads env
186
+ from two locations, in order — a global base and an optional per-project
187
+ override:
188
+
189
+ 1. `~/.config/charness/.env` — base, set once, used everywhere.
190
+ 2. `$PWD/.env` — per-project tweaks (last write wins).
191
+
192
+ The full annotated template is `.env.example` (shipped with the package and in
193
+ the repo).
194
+
195
+ ### 2. Set up a group (optional) or DM
196
+
197
+ The bot serves a **forum supergroup**, the **owner's private chat (DM)**, or
198
+ both at once (`CHAT_MODE`, default `both`). The group is the nicest UX — a
199
+ visible topic list, per-topic names/icons, quick agent switching — but it is
200
+ **optional**: with `OWNER_USER_ID` set you can run entirely from the bot's DM.
201
+
202
+ **To use a group (recommended)** — **[manual]**, all in the Telegram client:
203
+
204
+ 1. In a Telegram client: `New Group` → name it → add the bot.
205
+ 2. Open group settings → enable **Topics** (Forum mode).
206
+ 3. Promote the bot to admin with these rights:
207
+ - `Manage Topics` (required — bind/create threads)
208
+ - `Delete Messages` (for `/clear_messages`)
209
+ - `Pin Messages` (per-thread status banner + question alerts; `/doctor`
210
+ warns if missing, but the bot still runs without it)
211
+ 4. **Remove the bot from the group and add it again.** Telegram caches the
212
+ privacy-mode flag on join; without re-adding, the bot keeps private-mode and
213
+ ignores free-form messages (see
214
+ [Troubleshooting → Bot doesn't see text](README.md#bot-doesnt-see-text-telegram)).
215
+
216
+ <p>
217
+ <img src="docs/images/02-enable-topics.png" width="360" alt="Group settings → Topics toggle enabled (Forum mode)" />
218
+ <img src="docs/images/03-promote-admin.png" width="360" alt="Bot admin rights: Manage Topics, Delete Messages, Pin Messages ticked" />
219
+ </p>
220
+
221
+ The group **id is automatic** — leave `ALLOWED_GROUP_ID` empty and the bot
222
+ auto-pairs with the first forum supergroup an admin talks to it from (the
223
+ `-100…` id is saved to `state.json`; re-point later with `/pair`). To pin a
224
+ specific id by hand, set `ALLOWED_GROUP_ID` to the numeric value (a group
225
+ **name** is not accepted) — that also disables auto-pairing. **Access control:**
226
+ whoever is a creator/administrator of that group may drive the bot — there is no
227
+ separate allow-list.
228
+
229
+ **To use the DM instead (or as well):** **[manual]** send `/start` to
230
+ [@userinfobot](https://t.me/userinfobot) for your numeric user id, then add it
231
+ (host-side) to the same `.env`:
232
+
233
+ ```dotenv
234
+ OWNER_USER_ID=987654321
235
+ ```
236
+
237
+ With the default `CHAT_MODE=both`, an unset `OWNER_USER_ID` just leaves the DM
238
+ surface inert (group-only); set it and the DM lights up alongside the group. Use
239
+ `CHAT_MODE=dm` to skip the group entirely.
240
+
241
+ ### 3. Launch from your projects folder
242
+
243
+ ```bash
244
+ cd ~/projects && charness
245
+ ```
246
+
247
+ That `$PWD` — the parent folder holding your repositories — is the folder the
248
+ bot works in; each topic binds to a subfolder under it. There's nothing else to
249
+ configure for it. A single-instance lockfile (`$DATA_DIR/instance.lock`) stops a
250
+ second bot starting under the same user; stale locks (after `kill -9`) are
251
+ reclaimed automatically.
252
+
253
+ ### 4. Bind a topic and talk to an agent
254
+
255
+ This step is **[manual]** — it all happens inside the Telegram app.
256
+
257
+ **In the group:**
258
+
259
+ 1. Open the group; in the General topic send `/ls` — the bot lists subfolders
260
+ under the work root.
261
+ 2. Create a topic (the `+` button).
262
+ 3. In the new topic: `/bind <subdir>` (auto-bound if the topic name matches a
263
+ subdir).
264
+ 4. `/claude` or `/opencode` → talk to the agent (text or voice).
265
+
266
+ <p><img src="docs/images/04-bind-and-run.png" width="360" alt="A topic bound with /bind, /claude started, and the agent replying" /></p>
267
+
268
+ **In the DM:** the same commands, one thread per agent — `/ls`,
269
+ `/bind <subdir>`, then `/claude` or `/opencode`.
270
+
271
+ Then: `/quit` ends the session; bare `/bind` inspects/reconfigures the binding;
272
+ `/clear_messages` deletes the topic's bot messages.
273
+
274
+ > **Continue the same session from a terminal.** No wrapper needed: run
275
+ > `claude --dangerously-skip-permissions` in the project folder. It is the same
276
+ > binary and the same `~/.claude/projects/<cwd-slug>/` session store the bot
277
+ > uses, so a thread started in Telegram can be picked up with `claude --resume`
278
+ > and vice versa.
279
+
280
+ ### Required files structure
281
+
282
+ Launch `charness` from the parent folder that holds your project repos —
283
+ that `$PWD` is the work root, and every topic binds to a subfolder under it:
284
+
285
+ ```
286
+ $PWD=/home/user/src ← run the bot here ($PWD = work root)
287
+ ├── projectA/ ← Topic "projectA" (claude)
288
+ ├── projectB/ ← Topic "projB-frontend" (claude)
289
+ │ ← Topic "projB-backend" (opencode) ← one folder, two topics
290
+ │ ← Topic "projB-refactor" (claude)
291
+ └── projectC/ ← Topic "projectC" (opencode)
292
+
293
+ Telegram forum supergroup
294
+ ├── Bot is admin with can_manage_topics + can_delete_messages + can_pin_messages
295
+ └── Routes each topic by (chatId, threadId) → remembered in state.json
296
+ ```
297
+
298
+ **What the bot remembers (`state.json`).** So a restart is seamless, the bot
299
+ saves which topic is bound to which folder, each topic's live agent session (to
300
+ re-attach it after a reboot), your per-topic preferences (agent, model,
301
+ reasoning effort, language, display verbosity), scheduled prompts, and the
302
+ paired group id. This file lives in `DATA_DIR` (default `~/.charness`) and
303
+ is written safely, so a crash can't corrupt it.
304
+
305
+ ### Telegram environment variables
306
+
307
+ The settings of the Telegram surface; the ones every surface shares are under
308
+ [Environment variables](#environment-variables).
309
+
310
+ #### Set Before Launch
311
+
312
+ | Variable | Description |
313
+ |---|---|
314
+ | `TELEGRAM_BOT_TOKEN` | Token from @BotFather. Telegram only: a Jira-only instance refuses to start with it set — see [Jira setup](#jira-setup) |
315
+
316
+ Start from the parent folder containing your projects: `cd ~/projects && charness`.
317
+ That `$PWD` is the folder the bot works in — nothing else to set for it.
318
+
319
+ **Access control.** There is no user allow-list. Whoever is a **creator or
320
+ administrator of the served forum group** may talk to the agent — read live from
321
+ Telegram (`getChatAdministrators`) and cached for 1h. Promote someone in the
322
+ group to grant access; demote/remove them to revoke it — the bot subscribes to
323
+ `chat_member` updates, so an admin change invalidates the cache and takes
324
+ effect immediately (the 1h TTL is only the fallback). The bot must be a group
325
+ admin itself (it already needs that to create topics and pin). Anonymous admins
326
+ can't be matched from their messages, so post non-anonymously. The DM surface
327
+ (when enabled) is gated separately: only the configured `OWNER_USER_ID` may
328
+ talk to the bot there.
329
+
330
+ > **Security model — group admin (or the DM owner) ⇒ shell on the host.** The agents run with
331
+ > permission checks disabled (`--dangerously-skip-permissions` for Claude,
332
+ > auto-approve for OpenCode) and `/terminal` opens a raw `$SHELL` in the bound
333
+ > folder, so anyone who can talk to the bot can execute arbitrary commands as
334
+ > the bot's OS user. Only promote people you would trust with SSH access to
335
+ > that machine, and keep the served group itself private.
336
+
337
+ #### External Optional (Telegram)
338
+
339
+ | Variable | Default | Description |
340
+ |---|---|---|
341
+ | `ALLOWED_GROUP_ID` | (auto-pair) | Numeric forum supergroup id (`-100…`). Leave empty to auto-pair with the first forum group a group **admin/creator** contacts the bot from (id is saved to `state.json`; re-point with `/pair`). A **name** is not accepted. A numeric value disables auto-pairing |
342
+ | `CHAT_MODE` | `both` | Which surface(s) this instance serves: `group`, `dm`, or `both` — see [Two surfaces](README.md#two-surfaces-group-topics-bot-dm-or-both) |
343
+ | `OWNER_USER_ID` | — | **Optional.** Numeric Telegram user id of the owner — leave it unset to run group-only (the DM surface stays inert; a group works fully without it). Set it only to enable the owner-DM surface; **required** solely for `CHAT_MODE=dm` |
344
+ | `GROQ_API_KEY` | — | Recommended for voice transcription. Without it, voice messages are not transcribed unless you intentionally configure the OpenAI fallback |
345
+
346
+ **Localized in 12 languages** — the bot UI (commands, buttons, notices) speaks
347
+ 中文, English, Français, ქართული, Deutsch, हिन्दी, 日本語, Português, Русский,
348
+ Español, Українська, Oʻzbekcha. The language is automatic per Telegram chat:
349
+ explicit `/language <locale>` override wins, then the sender's Telegram client
350
+ language, then the last supported Telegram locale seen for that chat, then
351
+ English.
352
+ Supported locales: `en`, `de`, `fr`, `es`, `pt`, `ru`, `zh`, `ja`, `hi`, `uz`,
353
+ `ka`, `uk`. Bare `/language` opens a single-message inline picker with each language
354
+ shown by its own name (endonym), sorted A→Z by English name, and a `🌐 Auto` button
355
+ (all 12 fit at once — no pagination). Tapping a language (or `🌐 Auto`) applies it, then the menu
356
+ disappears and a short confirmation stays in the chosen language;
357
+ `/language auto` returns a DM/group to automatic selection.
358
+
359
+ #### Advanced (Telegram)
360
+
361
+ | Variable | Default | Set only when |
362
+ |---|---|---|
363
+ | `OPENAI_API_KEY` | — | You intentionally use OpenAI Whisper as the voice fallback instead of Groq |
364
+ | `SHELL` | `/bin/bash` | You want `/terminal` to open a different shell than your login shell (host env var, not set by the bot) |
365
+
366
+ ## Jira setup
367
+
368
+ A Jira instance runs on its own — a `DATA_DIR`, a work root, a private tmux server and one env file. How the
369
+ connector behaves is described in [`src/connectors/jira/README.md`](src/connectors/jira/README.md).
370
+
371
+ 1. Create a Jira account for the AI (its API token is the instance's only secret) and note its account id.
372
+ 2. Recommended: create or choose a Jira group of the people whose words may steer the AI (for example
373
+ `ai-trusted`), and give the AI account the *Browse users and groups* global permission so that it can read
374
+ the group. Then the agent reads only the text and files of its members and of Jira's apps and automations,
375
+ and only their hand-overs start it.
376
+ 3. An instance of its own: a `DATA_DIR`, a `WORK_ROOT` with one folder per project, a private tmux server, and
377
+ an env file that is the ONLY configuration it reads:
378
+
379
+ ```bash
380
+ # /path/to/jira-instance.env
381
+ CONNECTORS=jira
382
+ DATA_DIR=/path/to/jira-instance/data
383
+ WORK_ROOT=/path/to/jira-instance/work
384
+ TMUX_SOCKET_NAME=jira-instance
385
+ OPENCODE_URL=http://localhost:4097 # a port of its own — the default 4096 is refused (other instances use it)
386
+ JIRA_AI_API_TOKEN=... # referenced by jira.json below, never written there
387
+ ```
388
+
389
+ 4. `DATA_DIR/jira.json` — the allowlist, the trusted group and the credentials (`${VAR}` expands from the env file; an unknown
390
+ key is an error):
391
+
392
+ ```json
393
+ {
394
+ "site": "example.atlassian.net",
395
+ "email": "ai-account@example.com",
396
+ "apiToken": "${JIRA_AI_API_TOKEN}",
397
+ "accountId": "<the AI account's id>",
398
+ "projects": {
399
+ "PROJ": { "folder": "proj", "triggerStatuses": ["In Progress"], "extraFields": ["customfield_10042"] }
400
+ },
401
+ "trustedGroup": "ai-trusted",
402
+ "wakeOnMention": true,
403
+ "pollIntervalSeconds": 30,
404
+ "runBudgetPer24h": 5,
405
+ "model": "opus",
406
+ "effort": "high"
407
+ }
408
+ ```
409
+
410
+ `trustedGroup` (optional, but without it everyone who can edit or comment steers the agent) is the group's
411
+ NAME — one group per instance; a team with several trust circles runs a second instance. The instance
412
+ resolves it to the group's id at start, so renaming the group while it runs keeps working, and reads its
413
+ members again whenever its last read is older than 5 minutes: a removed member loses the AI's trust within
414
+ that time. List only projects where only your team can write, and where no automation acts on text or
415
+ actions from outside it — an e-mail handler, a portal form, a copy from another project, a rule that
416
+ hands an issue to the AI when someone outside the team acts: an app's or automation's text and hand-over
417
+ are trusted, so such a rule brings that outside text, or that person's hand-over, to the agent. Nor list a
418
+ project where anyone outside the team holds the *Edit all comments* permission: Jira Cloud keeps no history
419
+ of a comment's edits, so a comment is judged by its author and its LAST editor only — an outsider's edit of a
420
+ member's comment, followed by a member's own edit, reads as trusted.
421
+
422
+ `wakeOnMention` (optional) decides whether an @-mention of the AI account in a comment wakes it to answer
423
+ only, without the issue being handed over; absent, it is on exactly when `trustedGroup` is set, and `true`
424
+ without a group is refused — without one, anyone who can comment could start the AI.
425
+
426
+ `projects` maps each served project key to its folder under `WORK_ROOT` and the status names in which an
427
+ assigned issue is a request; the agent loads that folder's project memory (`CLAUDE.md`, `.claude/`, … in it
428
+ and in every parent) like any Claude Code session, while your user-level Claude setup stays out of its
429
+ sessions — except that for a folder under HOME that walk reads `~/.claude/CLAUDE.md` back in.
430
+ `pollIntervalSeconds` is 10–600 (default 30);
431
+ `runBudgetPer24h` defaults to 5; `model` and `effort` set the sessions' Claude model and reasoning effort
432
+ (optional; absent → `opus` and `high`, either key overrides only its own default). `extraFields` (optional,
433
+ none by default) names fields by id (`customfield_…`, or a system one like `duedate`) the agent should see next to the standard
434
+ ones, shown under their site name; an id the site does not list is logged at start and left out. `agentBinaries` (optional, host runtime) maps a tool name to the absolute path of an executable — for
435
+ example `{ "ffmpeg": "/opt/tools/ffmpeg" }` — which is checked at start and put on the agents' PATH. `adapter` is `claude-json-stream` (the default — the agent process is stopped when an issue
436
+ idles) or `claude-per-turn` (stopped after every answer); either way the issue's conversation sleeps between
437
+ requests and the next request resumes it.
438
+
439
+ 5. Start it with a clean environment, so nothing of the calling shell reaches it:
440
+
441
+ ```bash
442
+ env -i HOME="$HOME" PATH="$PATH" LANG=C.UTF-8 ENV_FILE=/path/to/jira-instance.env charness
443
+ ```
444
+
445
+ (In a checkout, `scripts/run-isolated.sh /path/to/jira-instance.env` does the same.)
446
+
447
+ The start refuses a missing `ENV_FILE`, `TMUX_SOCKET_NAME` or `jira.json`, an `OPENCODE_URL` on the default
448
+ port, a `TELEGRAM_BOT_TOKEN` or any `ATLASSIAN_*` variable when Telegram is off, a token that belongs to
449
+ another account, an unknown project or status, a `trustedGroup` the site does not have or the AI account
450
+ may not read, and a `DATA_DIR` holding another surface's state. An unreachable Jira does not refuse the start —
451
+ polling backs off and resumes.
452
+
453
+ The agent sessions of a Jira instance run without the user-level Claude settings, hooks and skills, with the
454
+ bot's MCP server only, without the native question tool, and with an environment reduced to a short allowlist
455
+ — the Jira token is not in the agent's environment. The agent still runs as the instance's OS user and can read
456
+ the instance's env file and `DATA_DIR`, so run the instance under an OS user that holds nothing else, with an AI
457
+ account that sees only the allowlisted projects. **A production Jira account runs only in the Docker container**
458
+ ([Run with Docker](#run-with-docker)): there the agent can still read the instance's env file and `DATA_DIR`,
459
+ but nothing of the host outside the container's mounts. Module details: `src/connectors/jira/README.md`.
460
+
461
+ ## Alternatives
462
+
463
+ The npm install above is the way to run Charness; this is the alternative to it.
464
+
465
+ ### Run with Docker
466
+
467
+ Choose this over the npm install for **isolation** — the agents reach only the folders you mount — or for **a ready
468
+ environment**: the image brings Node 22, tmux, git and ffmpeg, and the bot installs Claude Code and OpenCode the first
469
+ time it starts each, so the host needs only Docker and a clone of this repository.
470
+
471
+ The whole bot runs in one container: the bot itself, tmux, every agent it starts (Claude Code in any backend,
472
+ `/terminal`, OpenCode and its server) and the bot's MCP server. Everything works as on a host; the host only
473
+ lends the container the folders it mounts, so the bot and its agents see nothing else of the machine.
474
+
475
+ ```
476
+ host container charness-<instance>
477
+ your instance env file (tokens) ── ro ──▶ the bot (hot mode) + a restart loop
478
+ DATA_DIR, WORK_ROOT ──────▶ tmux, the agents, OpenCode, the bot MCP
479
+ a clone of this repository ──────▶ /opt/charness
480
+ the agents' home folder ──────▶ /home/charness: their Claude / OpenCode
481
+ login, sessions and CLI installs
482
+ ```
483
+
484
+ 1. **Image and checkout.** Clone the repository for the container (a full clone of its own, not a worktree and
485
+ not the checkout a host instance runs from) and build the image from it:
486
+
487
+ ```bash
488
+ git clone https://github.com/olosegres/charness /srv/charness/checkout
489
+ cd /srv/charness/checkout && docker build -t charness -f docker/Dockerfile .
490
+ ```
491
+
492
+ The image holds only system tools (tmux, git, ffmpeg, ripgrep, …) and the yarn the checkout's `package.json`
493
+ names (build from the checkout's root, which is how the build reads it; rebuild after a yarn bump so no
494
+ container has to download it). On first start the container installs the checkout's dependencies for the
495
+ image and builds it; the bot installs Claude Code and OpenCode into the agents' home.
496
+ 2. **Instance env file**, as for a host install (`TELEGRAM_BOT_TOKEN`, `DATA_DIR`, `WORK_ROOT`, …). It stays on
497
+ the host and is mounted read-only. Every host path it names (`DATA_DIR`, `WORK_ROOT`, `TMUX_TMPDIR`, …) is
498
+ mounted at the SAME path, so `state.json`, sessions and file paths stay valid inside and an instance can move
499
+ between host and container unchanged.
500
+ 3. **Run** (or use `examples/docker-compose.yml`):
501
+
502
+ ```bash
503
+ docker run -d --name charness-main --hostname charness-main \
504
+ --restart unless-stopped --stop-timeout 60 \
505
+ -v /srv/charness/checkout:/opt/charness \
506
+ -v /srv/charness/home:/home/charness \
507
+ -v /srv/charness/data:/srv/charness/data \
508
+ -v /srv/projects:/srv/projects \
509
+ -v /srv/charness/instance.env:/srv/charness/instance.env:ro \
510
+ -e ENV_FILE=/srv/charness/instance.env \
511
+ charness
512
+ ```
513
+
514
+ No port is published: Telegram is long polling, and the bot's MCP server and the OpenCode server listen on the
515
+ container's own loopback. Keep the `--hostname` fixed and unique per instance: the instance lock tells its own
516
+ restarted container from another machine by it.
517
+ 4. **Log the agents in once**, with the account the agents should use (a separate one is best):
518
+ `docker exec -it charness-main claude`, then `/login` (or `/login` in a topic). OpenCode: `/connect` in a
519
+ topic, or `docker exec -it charness-main opencode auth login`. Never copy your own `~/.claude` login in:
520
+ a second holder of its refresh token can log the first one out. For git, put a `.gitconfig` and an SSH key of
521
+ their own into the agents' home.
522
+
523
+ Running it:
524
+
525
+ - **Restart the bot only** (agents keep running and are adopted): `docker exec charness-main
526
+ charness-restart-bot`. A crashed bot is restarted by the container after 20 s.
527
+ - **Update the bot**: `docker exec charness-main /opt/charness/scripts/self-update.sh` (by hand or from
528
+ a timer on the host); hot mode picks the change up. A change to `src/cli.ts`, `src/cli/hot.ts` or `nodemon.json`
529
+ needs the bot restart above. **Update Claude Code / OpenCode**: they update themselves in the agents' home, or
530
+ `docker exec charness-main npm install -g @anthropic-ai/claude-code` / `… opencode-ai`.
531
+ - **A container restart is a reboot**: every agent process ends; each conversation resumes with its next message.
532
+ - **Rootless Docker** (recommended): the container's root is your user, so everything written on the mounts is
533
+ yours. **Rootful Docker**: add `--user "$(id -u):$(id -g)"` and give that user the agents' home.
534
+ - **Moving a host instance in**: stop it first (the lock refuses a lock written on another host), mount its
535
+ folders at their paths, and copy its conversations' folders from `~/.claude/projects/` into the agents' home
536
+ `.claude/projects/` — without them each conversation starts a fresh session on its next message.
537
+ - **What the agents can read**: everything mounted, the instance env file with its tokens, `DATA_DIR` and the
538
+ checkout included. The container keeps the rest of the host out of reach; running the agents as a second user
539
+ inside the container would close that gap later.
@@ -608,7 +608,7 @@ export declare function stripTuiElements(text: string, incomingKind?: ToolResult
608
608
  * Claude stores per-project transcripts under
609
609
  * `~/.claude/projects/<slug>/<sessionUuid>.jsonl`, where the slug is the
610
610
  * absolute path with every non-alphanumeric character replaced by `-`
611
- * (e.g. `/home/user/src/telegramCode` → `-home-user-src-telegramCode`).
611
+ * (e.g. `/home/user/src/myProject` → `-home-user-src-myProject`).
612
612
  *
613
613
  * The slug encoding is undocumented and could drift across Claude versions,
614
614
  * so it is used only to *locate* the candidate folder — the authoritative
@@ -1617,7 +1617,7 @@ function stripTuiElements(text, incomingKind = null) {
1617
1617
  * Claude stores per-project transcripts under
1618
1618
  * `~/.claude/projects/<slug>/<sessionUuid>.jsonl`, where the slug is the
1619
1619
  * absolute path with every non-alphanumeric character replaced by `-`
1620
- * (e.g. `/home/user/src/telegramCode` → `-home-user-src-telegramCode`).
1620
+ * (e.g. `/home/user/src/myProject` → `-home-user-src-myProject`).
1621
1621
  *
1622
1622
  * The slug encoding is undocumented and could drift across Claude versions,
1623
1623
  * so it is used only to *locate* the candidate folder — the authoritative
@@ -1 +1 @@
1
- {"version":3,"file":"claudeJsonStreamAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/claudeJsonStreamAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,aAAa,EAEb,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAOhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAkBhH,OAAO,EACL,sBAAsB,EAOvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAML,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAsBL,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAA2B,KAAK,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAGpG,kGAAkG;AAClG,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAAC;AAmBrD;wCACwC;AACxC,eAAO,MAAM,8BAA8B,wBAAwB,CAAC;AAMpE,qGAAqG;AACrG,UAAU,uBAAuB;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AO,CAAC,MAAM,EAAE,CAAC;IAKvC,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAWvE,SAAS,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAInC,wBAAwB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAInE;;;;;;OAMG;YACW,iBAAiB;IAsB/B,yHAAyH;IACzH,yBAAyB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAKrE;;;;;;;;;;;OAWG;IACG,oBAAoB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAkB1H,wGAAwG;IACxG,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,WAAW;CAqBpB;AA8BD;;;;;;;GAOG;AACH,wBAAgB,sCAAsC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA6BtF"}
@@ -58,6 +58,7 @@ const pollBackoff_1 = require("../utils/pollBackoff");
58
58
  const claudeRuntimeInfo_1 = require("../utils/claudeRuntimeInfo");
59
59
  const jsonStreamBusyWatchdog_1 = require("../utils/jsonStreamBusyWatchdog");
60
60
  const jsonStreamHost_1 = require("../utils/jsonStreamHost");
61
+ const claudeProfiles_1 = require("../utils/claudeProfiles");
61
62
  const adapterNames_1 = require("./adapterNames");
62
63
  const claudeCodeVersion_1 = require("../utils/claudeCodeVersion");
63
64
  const sessionLaunchDefaults_1 = require("./sessionLaunchDefaults");
@@ -1742,7 +1743,7 @@ class ClaudeJsonStreamAdapter extends events_1.EventEmitter {
1742
1743
  if (!session?.isActive)
1743
1744
  return 'inactive';
1744
1745
  const wanted = this.resolveConfigDir(key);
1745
- if (wanted === session.configDir) {
1746
+ if ((0, claudeProfiles_1.checkIsSameClaudeConfigDir)(wanted, session.configDir)) {
1746
1747
  session.isConfigDirSwitchPending = false;
1747
1748
  return 'unchanged';
1748
1749
  }