dsh-tg-bridge 1.28.0 → 1.28.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.
Files changed (2) hide show
  1. package/control/cmd-views.mjs +444 -441
  2. package/package.json +1 -1
@@ -1,441 +1,444 @@
1
- // The reading cards: what this session is, which model answers, and how it answers.
2
- //
3
- // One group of the `/` surface. `control.mjs` owns the dispatch and this file
4
- // owns the commands, so a change to `/agents` no longer touches `/update`.
5
- import { execFileSync, spawn, spawnSync } from 'node:child_process';
6
- import { cpSync, existsSync, copyFileSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
7
- import { homedir, tmpdir } from 'node:os';
8
- import { join, basename } from 'node:path';
9
- import { fileURLToPath } from 'node:url';
10
- import { t, LANGS, normalizeLang } from '../i18n.mjs';
11
- import { addTask, clearGoal, doneTask, editTask, finishGoal, goalOf, progressOf, reopenGoal, removeTask, setGoal } from '../goals.mjs';
12
- import { lastTurnReasoning, lastTurnReasoningSteps, lastTurnText, reasoningMarkdown, sessionFile, sessionReasoningSteps, sessionStats } from '../thoughts.mjs';
13
- import { parseAgentPresets, parseModelSelection, parsePermissionPresets, parseReasoningEfforts, parseSubagentFleet, parseSubagentRows } from '../agents.mjs';
14
- import { setRowConfig, unsetRowConfig } from '../profile-edit.mjs';
15
- import { parseReminder, stampAt, upcoming } from '../reminders.mjs';
16
- import { AgentsetStore, emptySet, slugId } from '../agentsets.mjs';
17
- import { SETTINGS_PAGES, cardPin, renderSettingsCard, settingsCurrent } from '../settings-card.mjs';
18
- import { applyFork, planFork, planRewind } from '../rewind.mjs';
19
- import { cutSession, isRewindPress } from '../rewind-buttons.mjs';
20
- import { renderRewindCard, renderRewindUsage } from '../rewind-card.mjs';
21
- import { MENU_GROUPS, commandForName, renderPanel, replyKeyboard } from '../menu-card.mjs';
22
- import { explainCommand } from '../help-explain.mjs';
23
- import { profileValues, resolveSettings } from '../settings.mjs';
24
- import { UPDATE_DEFAULTS, describeUpdate, modeChange, updateState } from '../update-policy.mjs';
25
- import { isNewer, pluginInfo, rowLine, searchPlugins } from '../plugin-search.mjs';
26
- import { COMMAND_ALIASES, CONTROL_COMMANDS, DOCUMENTED_COMMANDS } from '../commands-registry.mjs';
27
- import { APP, CLI_JS, DSH_CMD, DSH_HOME, EXE, HOME, PROFILES, THOUGHT_DIR } from '../paths.mjs';
28
- import { read, readJson, patchPath, pkgPath, OVERLAY_MARK, modelsOf, modelOf, windowOf, modelIndent, depthOf, modelsReport, setModel, disabledIds, setDisabled, writePatch } from './models.mjs';
29
- import { listPids, waitForExit, waitForStart, pluginsOf, bundleRowIds, addBundle, removeBundle, createProfile, dshPlugin } from './plugins.mjs';
30
- import { cwdSlug, bareId, stamp, recentSessions, sessionTitle } from './sessions.mjs';
31
- import { agentsOf, fleetOf, patchRows, skillsOf, AGENTS, PERSONA_HEADING, soulOf, setSoul } from './agents.mjs';
32
- import { fmt, AGENTSETS, agentset, agentsetOf, profileRowOf, bindAgentset, agentsetCard, agentsetKeyboard } from './agentsets.mjs';
33
- import { taskKeyboard, goalView, taskView, filterLogLines } from './tasks.mjs';
34
- import { reasoningMode } from '../notes.mjs';
35
- import { updatePolicy, bridgeRoot, copyRelease, installRelease, bridgeVersion, newestModuleMtime, npmLatest, npmLatestAsync } from './release.mjs';
36
- import { presetOf } from '../profile-view.mjs';
37
-
38
- export async function handleViewCommands(ctx) {
39
- const { command, arg, send, reply, log, profile, state, key, config, lang: rawLang } = ctx;
40
- // The topic's language, then the config default, then English. Never Russian:
41
- // a group that has no opinion still must not guess a language.
42
- const lang = normalizeLang(rawLang) || normalizeLang(config?.lang) || 'en';
43
- const say = (text, extra) => (extra ? reply(text, extra) : reply(text));
44
- const activeProfile = profile || config.profile || 'headless';
45
- const effective = ctx.effective || command;
46
- switch (effective) {
47
- case '/status': {
48
- const head = modelOf(activeProfile);
49
- const active = ctx.activeTurns ? ctx.activeTurns.size : 0;
50
- // A card, not a key dump: the identity first, then what the session is
51
- // doing, then the environment. Numbers are the ones a person asks for
52
- // ("how much context is left", "how big is this session").
53
- const sessionId = state.sessions[key] || '';
54
- const stats = sessionId ? sessionStats(sessionFile(join(DSH_HOME, 'sessions'), sessionId)) : null;
55
- const title = sessionId ? (state.titles?.[key] || sessionTitle(sessionId)) : '';
56
- const lines = [t(lang, 'ctrl.status.head')];
57
- lines.push(t(lang, 'ctrl.status.session', { id: sessionId || t(lang, 'ctrl.session.none') }));
58
- if (title) lines.push(t(lang, 'ctrl.status.title', { title }));
59
- lines.push(t(lang, 'ctrl.status.profile', { name: activeProfile, route: `${head.provider}/${head.model}` }));
60
- lines.push(t(lang, 'ctrl.status.thread', { name: ctx.threadId || t(lang, 'ctrl.status.threadDefault') }));
61
- if (stats?.createdAt) lines.push(t(lang, 'ctrl.status.created', { when: stamp(stats.createdAt) }));
62
- if (stats?.lastActivity) lines.push(t(lang, 'ctrl.status.activity', { when: stamp(stats.lastActivity) }));
63
- if (stats?.contextTokens) {
64
- // The window belongs to the profile that answered, not to this bridge's
65
- // config: read it where the harness reads it, and say "unknown" only when
66
- // the profile really does not declare one.
67
- const window = windowOf(activeProfile, stats.model || head.model);
68
- lines.push(window
69
- ? t(lang, 'ctrl.status.context', {
70
- now: stats.contextTokens.toLocaleString('en-US'),
71
- max: window.toLocaleString('en-US'),
72
- pct: Math.round((stats.contextTokens / window) * 100),
73
- })
74
- : t(lang, 'ctrl.status.contextNoWindow', { now: stats.contextTokens.toLocaleString('en-US') }));
75
- }
76
- if (stats?.lifetimeTokens) {
77
- lines.push(t(lang, 'ctrl.status.lifetime', { n: stats.lifetimeTokens.toLocaleString('en-US') }));
78
- }
79
- if (stats?.turns) lines.push(t(lang, 'ctrl.status.steps', { n: stats.turns }));
80
- lines.push(t(lang, 'ctrl.status.turns', {
81
- n: active,
82
- state: active > 0 ? t(lang, 'ctrl.status.running') : t(lang, 'ctrl.status.idle'),
83
- }));
84
- lines.push(t(lang, 'ctrl.status.notes', {
85
- state: t(lang, `msg.reasoningMode.${reasoningMode(state, config, key)}`),
86
- }));
87
- lines.push(t(lang, 'ctrl.status.skills', { n: skillsOf().length }));
88
- // The desktop profile only matters when this install actually has one.
89
- if (existsSync(join(PROFILES, 'desktop', 'cordis.patch.yml'))) {
90
- const desk = modelOf('desktop');
91
- const deskPlugins = pluginsOf('desktop');
92
- lines.push(t(lang, 'ctrl.status.ui', {
93
- route: `${desk.provider}/${desk.model}`,
94
- n: deskPlugins.bundles.length,
95
- }));
96
- }
97
- const currentGoal = goalOf(state, key);
98
- if (currentGoal) {
99
- const { done, total } = progressOf(currentGoal);
100
- lines.push(t(lang, 'status.goal', {
101
- done, total, text: currentGoal.text.length > 60 ? `${currentGoal.text.slice(0, 59)}…` : currentGoal.text,
102
- }));
103
- }
104
- lines.push(`DSH_HOME: ${DSH_HOME}`);
105
- say(lines.join('\n'));
106
- return true;
107
- }
108
- case '/models': {
109
- say(modelsReport(lang, activeProfile));
110
- return true;
111
- }
112
- case '/model': {
113
- const [wanted = '', scope = ''] = (arg || '').split(/\s+/);
114
- if (!wanted) {
115
- // One command, two states: bare `/model` lists what can be picked, and
116
- // `/model <id>` picks it. A separate `/models` read as a second, near
117
- // identical command (and did the same thing as `/model` with no id).
118
- say(modelsReport(lang, activeProfile));
119
- return true;
120
- }
121
- if (!setModel(activeProfile, wanted)) {
122
- say(t(lang, 'ctrl.model.failed', { name: activeProfile, model: wanted }));
123
- return true;
124
- }
125
- const desktop = scope === 'both' ? setModel('desktop', wanted) : false;
126
- // Report the route the patch now carries, not the string that was typed:
127
- // `/model deepseek-v4.1-flash` leaves the provider as it was, and the answer
128
- // is the only place that says so. "Model → deepseek" while the turn still
129
- // runs on the slow host is the confusion this line exists to remove.
130
- const route = modelOf(activeProfile);
131
- say(t(lang, 'ctrl.model.switched', {
132
- name: activeProfile,
133
- model: `${route.provider}/${route.model}`,
134
- desktop: desktop ? t(lang, 'ctrl.model.withDesktop', { model: wanted }) : '',
135
- }));
136
- return true;
137
- }
138
- case '/profile': {
139
- // The GUI lets a person build a profile per kind of work; the same switch
140
- // belongs here, per topic. A new profile is a copy of a shipped template,
141
- // dependencies are installed on its first turn.
142
- const [action = '', verb = '', template = ''] = String(arg || '').trim().split(/\s+/).filter(Boolean);
143
- const profiles = readdirSync(PROFILES, { withFileTypes: true })
144
- .filter((entry) => entry.isDirectory() && existsSync(join(PROFILES, entry.name, 'cordis.patch.yml')))
145
- // Overlay profiles are generated per model (photo turns and fallbacks)
146
- // and carry a marker row; they are an implementation detail, not a
147
- // place a person switches a topic to.
148
- .filter((entry) => !read(join(PROFILES, entry.name, 'cordis.patch.yml')).includes(OVERLAY_MARK))
149
- .map((entry) => entry.name)
150
- .sort();
151
- const bound = state.profiles?.[key];
152
-
153
- if (!action) {
154
- const name = bound ? activeProfile : `${activeProfile}${t(lang, 'profile.default')}`;
155
- say([
156
- t(lang, 'profile.current', { name }),
157
- t(lang, 'profile.available', { list: profiles.join(', ') }),
158
- t(lang, 'profile.hint'),
159
- ].join('\n'));
160
- return true;
161
- }
162
-
163
- if (action === 'show') {
164
- // One card per profile: what it runs, what it carries, who may delegate.
165
- // `/profile` alone answers "which one am I on"; this answers "should I
166
- // switch to it", which is the question a person asks next.
167
- const name = verb || bound || activeProfile;
168
- if (!profiles.includes(name)) {
169
- say(t(lang, 'profile.unknown', { name, list: profiles.join(', ') }));
170
- return true;
171
- }
172
- const pkg = pluginsOf(name);
173
- const route = modelOf(name);
174
- const { rows, selection } = agentsOf(name);
175
- say([
176
- t(lang, 'ctrl.profile.title', { name }),
177
- t(lang, 'ctrl.profile.model', { route: `${route.provider}/${route.model}` }),
178
- t(lang, 'ctrl.profile.plugins', { n: patchRows(name), off: pkg.disabled.length }),
179
- t(lang, 'ctrl.profile.bundles', { n: pkg.bundles.length }),
180
- t(lang, 'ctrl.profile.agents', { n: rows.length, routes: selection ? selection.allowed.length : 0 }),
181
- t(lang, 'ctrl.profile.file', { path: join(PROFILES, name, 'cordis.patch.yml') }),
182
- ].join('\n'));
183
- return true;
184
- }
185
-
186
- if (action === 'new') {
187
- const from = template || 'headless';
188
- if (!verb || !/^[a-z0-9][a-z0-9-]{1,30}$/.test(verb)) {
189
- say(t(lang, 'profile.badName'));
190
- return true;
191
- }
192
- if (!profiles.includes(from)) {
193
- say(t(lang, 'profile.unknownTemplate', { name: from, list: profiles.join(', ') }));
194
- return true;
195
- }
196
- if (profiles.includes(verb)) {
197
- say(t(lang, 'profile.exists', { name: verb }));
198
- return true;
199
- }
200
- if (!(await createProfile(verb, from))) {
201
- say(t(lang, 'profile.createFailed', { name: verb }));
202
- return true;
203
- }
204
- state.profiles = state.profiles || {};
205
- state.profiles[key] = verb;
206
- ctx.saveState();
207
- say(t(lang, 'profile.created', { name: verb, template: from }));
208
- return true;
209
- }
210
-
211
- if (action === 'default') {
212
- if (state.profiles) delete state.profiles[key];
213
- ctx.saveState();
214
- say(t(lang, 'profile.set', { name: config.profile || 'headless', route: 'install default' }));
215
- return true;
216
- }
217
-
218
- if (!profiles.includes(action)) {
219
- say(t(lang, 'profile.unknown', { name: action, list: profiles.join(', ') }));
220
- return true;
221
- }
222
- state.profiles = state.profiles || {};
223
- state.profiles[key] = action;
224
- ctx.saveState();
225
- const head = modelOf(action);
226
- say(t(lang, 'profile.set', { name: action, route: `${head.provider}/${head.model}` }));
227
- return true;
228
- }
229
- case '/settings': {
230
- // The same switches, drawn: one card, four tabs, every button equal to the
231
- // command a person would type. A button press carries `m:<row>[:<value>]`
232
- // and `bridge.mjs` answers it by rendering the same card again — the card
233
- // is a view of the commands, never a second implementation of them.
234
- const page = String(arg || '').trim().split(/\s+/)[0].toLowerCase();
235
- if (page && !SETTINGS_PAGES.includes(page)) {
236
- say(t(lang, 'ctrl.settings.usage'));
237
- return true;
238
- }
239
- // The preset the topic actually starts in comes from the profile it boots,
240
- // which for a bound topic is a derived copy — not the install's profile.
241
- let permission = null;
242
- try {
243
- permission = presetOf(key);
244
- } catch {
245
- permission = null;
246
- }
247
- const current = {
248
- ...settingsCurrent({ config, state, key }),
249
- permissions: permission ? { profile: permission.profile, preset: permission.preset?.id || '' } : null,
250
- };
251
- const bound = agentsetOf(state, key);
252
- const card = renderSettingsCard({
253
- page: SETTINGS_PAGES.includes(page) ? page : 'reply',
254
- t: (k, vars) => t(lang, k, vars),
255
- current,
256
- updateMode: updatePolicy(state).mode,
257
- bound,
258
- });
259
- say(card.text, { keyboard: card.keyboard });
260
- return true;
261
- }
262
- case '/lang': {
263
- const wanted = normalizeLang((arg || '').trim());
264
- if (!wanted) {
265
- say(t(lang, 'ctrl.lang.state', {
266
- lang: state.lang?.[key] || config.lang || t(lang, 'ctrl.lang.auto'),
267
- list: LANGS.join(', '),
268
- }));
269
- return true;
270
- }
271
- state.lang = state.lang || {};
272
- state.lang[key] = wanted;
273
- ctx.saveState();
274
- say(t(wanted, 'msg.langSet'));
275
- return true;
276
- }
277
- case '/reasoning': {
278
- // One switch for "how much of the decision trail reaches me": off, the
279
- // progress card, or the chat itself. Anything else prints the current
280
- // state, so a bare /reasoning never guesses.
281
- const wanted = String(arg || '').trim().toLowerCase();
282
- const mode = reasoningMode(state, config, key);
283
- const next = { on: 'card', card: 'card', chat: 'chat', off: 'off' }[wanted];
284
- if (!next) {
285
- say(t(lang, 'msg.reasoningState', { state: t(lang, `msg.reasoningMode.${mode}`) }));
286
- return true;
287
- }
288
- state.reasoning = state.reasoning || {};
289
- // `on` is the old spelling of the card and stays accepted: it is the word
290
- // the previous release printed, and a chat is full of those instructions.
291
- state.reasoning[key] = next;
292
- ctx.saveState();
293
- say(t(lang, next === 'off' ? 'msg.reasoningOff' : next === 'chat' ? 'msg.reasoningChat' : 'msg.reasoningOn'));
294
- return true;
295
- }
296
- case '/pin': {
297
- // The progress card is pinned while its turn runs, so getting back to the
298
- // numbers is one tap instead of a scroll. Off by default: pinning someone's
299
- // chat uninvited is not a favour, and a group needs the right to pin.
300
- const wanted = String(arg || '').trim().toLowerCase();
301
- const mode = cardPin(state, config, key);
302
- const next = { on: 'on', off: 'off' }[wanted];
303
- if (!next) {
304
- say(t(lang, 'msg.pinState', { state: t(lang, `msg.pinMode.${mode}`) }));
305
- return true;
306
- }
307
- state.pin = state.pin || {};
308
- state.pin[key] = next;
309
- ctx.saveState();
310
- say(t(lang, next === 'on' ? 'msg.pinOn' : 'msg.pinOff'));
311
- return true;
312
- }
313
- case '/thoughts': {
314
- // The model's reasoning, read from the session log. Text by default (short,
315
- // ephemeral, deletes itself); `file` and `all` write a Markdown log and send
316
- // it as a document, because a five-hour turn is megabytes of text that no
317
- // chat message can hold; `off` keeps the block out of the panel entirely.
318
- const mode = String(arg || '').trim().toLowerCase();
319
-
320
- if (mode === 'off' || mode === 'on') {
321
- state.thinkBlock = state.thinkBlock || {};
322
- if (mode === 'off') state.thinkBlock[key] = 'counter';
323
- else delete state.thinkBlock[key];
324
- ctx.saveState?.();
325
- say(t(lang, mode === 'off' ? 'ctrl.thoughts.off' : 'ctrl.thoughts.on'));
326
- return true;
327
- }
328
-
329
- const sessionId = ctx.state.sessions?.[key];
330
- if (!sessionId) {
331
- say(t(lang, 'ctrl.thoughts.noSession'));
332
- return true;
333
- }
334
- const file = sessionFile(join(DSH_HOME, 'sessions'), sessionId);
335
-
336
- if (mode === 'file' || mode === 'all') {
337
- const turns = mode === 'all'
338
- ? sessionReasoningSteps(file).map((turn, index) => ({ title: t(lang, 'ctrl.thoughts.turn', { n: index + 1 }), steps: turn.steps }))
339
- : [{ steps: lastTurnReasoningSteps(file) }];
340
- const steps = turns.reduce((sum, turn) => sum + turn.steps.length, 0);
341
- const chars = turns.reduce((sum, turn) => sum + turn.steps.reduce((n, step) => n + step.length, 0), 0);
342
- if (!steps) {
343
- say(t(lang, 'ctrl.thoughts.none'));
344
- return true;
345
- }
346
- const now = new Date();
347
- const pad = (n) => String(n).padStart(2, '0');
348
- const date = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}`;
349
- const stamp = date.replace(/[ :]/g, '-');
350
- const path = join(THOUGHT_DIR, `reasoning-${stamp}-${mode}.md`);
351
- try {
352
- mkdirSync(THOUGHT_DIR, { recursive: true });
353
- writeFileSync(path, reasoningMarkdown({
354
- title: t(lang, mode === 'all' ? 'ctrl.thoughts.fileTitleAll' : 'ctrl.thoughts.fileTitleLast'),
355
- meta: [date, t(lang, 'ctrl.thoughts.fileMeta', { steps, chars, turns: turns.length })],
356
- stepTitle: t(lang, 'ctrl.thoughts.step'),
357
- turns,
358
- }), 'utf8');
359
- // A log is a keepsake, not an archive: a week is plenty and the dir
360
- // does not grow without bound.
361
- for (const name of readdirSync(THOUGHT_DIR)) {
362
- if (!name.startsWith('reasoning-')) continue;
363
- const old = join(THOUGHT_DIR, name);
364
- try {
365
- if (Date.now() - statSync(old).mtimeMs > 7 * 86400000) rmSync(old, { force: true });
366
- } catch {}
367
- }
368
- if (ctx.sendFile) {
369
- await ctx.sendFile(path, t(lang, 'ctrl.thoughts.fileCaption', { chars, steps }));
370
- return true;
371
- }
372
- // No file transport in this context (tests): the log still leaves as text.
373
- say(`${t(lang, 'ctrl.thoughts.fileCaption', { chars, steps })}\n\n${readFileSync(path, 'utf8').slice(0, 3200)}`);
374
- return true;
375
- } catch (error) {
376
- say(t(lang, 'ctrl.thoughts.fileError', { error: String(error.message).slice(0, 120) }));
377
- return true;
378
- }
379
- }
380
-
381
- const brief = ctx.ephemeral || ((out) => say(out));
382
- const text = file ? lastTurnReasoning(file, { maxChars: 20000 }) : '';
383
- if (!text) {
384
- // Not every turn plans: a one-word answer has no reasoning part at all.
385
- // Saying "here is what the last turn answered" beats a dead end that
386
- // looks like a broken command.
387
- const answered = file ? lastTurnText(file, { maxChars: 1200 }) : '';
388
- brief(answered
389
- ? `${t(lang, 'ctrl.thoughts.none')}\n\n${t(lang, 'ctrl.thoughts.lastAnswer')}\n\n${answered}\n\n${t(lang, 'ctrl.thoughts.hint')}`
390
- : `${t(lang, 'ctrl.thoughts.none')}\n\n${t(lang, 'ctrl.thoughts.hint')}`);
391
- return true;
392
- }
393
- // A message caps at 4096 characters; a long plan goes out in parts instead
394
- // of being cut at the first one with a "…" that hides the rest.
395
- const title = t(lang, 'ctrl.thoughts.title', { chars: text.length });
396
- const parts = [];
397
- for (let at = 0; at < text.length; at += 3600) parts.push(text.slice(at, at + 3600));
398
- parts.forEach((part, index) => {
399
- const last = index === parts.length - 1;
400
- const head = parts.length > 1 ? `${title} (${index + 1}/${parts.length})` : title;
401
- brief(`${head}\n\n${part}${last ? `\n\n${t(lang, 'ctrl.thoughts.hint')}` : ''}`);
402
- });
403
- return true;
404
- }
405
- case '/prices': {
406
- if (!ctx.prices) {
407
- say(t(lang, 'ctrl.prices.unsupported'));
408
- return true;
409
- }
410
- try {
411
- const text = await ctx.prices(arg);
412
- say(text);
413
- } catch (error) {
414
- say(t(lang, 'ctrl.prices.failed', { err: error.message }));
415
- }
416
- return true;
417
- }
418
- case '/help': {
419
- // One translated body keeps the help in step with the menu; the Russian
420
- // text stays as the fallback when a key is missing.
421
- const helpLang = lang;
422
- // `/help <command>` answers about one command: the list alone forced a
423
- // reader to guess which of /task and /tasks they wanted, and the pairs
424
- // that look alike are exactly the ones worth a sentence each.
425
- const about = String(arg || '').trim().toLowerCase().replace(/^\//, '');
426
- if (about) {
427
- const lines = explainCommand(about, helpLang, t);
428
- if (lines) {
429
- say(lines);
430
- return true;
431
- }
432
- say(t(helpLang, 'ctrl.help.unknown', { name: about }));
433
- return true;
434
- }
435
- say(t(helpLang, 'help.body'));
436
- return true;
437
- }
438
- default:
439
- return false;
440
- }
441
- }
1
+ // The reading cards: what this session is, which model answers, and how it answers.
2
+ //
3
+ // One group of the `/` surface. `control.mjs` owns the dispatch and this file
4
+ // owns the commands, so a change to `/agents` no longer touches `/update`.
5
+ import { execFileSync, spawn, spawnSync } from 'node:child_process';
6
+ import { cpSync, existsSync, copyFileSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
7
+ import { homedir, tmpdir } from 'node:os';
8
+ import { join, basename } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+ import { t, LANGS, normalizeLang } from '../i18n.mjs';
11
+ import { addTask, clearGoal, doneTask, editTask, finishGoal, goalOf, progressOf, reopenGoal, removeTask, setGoal } from '../goals.mjs';
12
+ import { lastTurnReasoning, lastTurnReasoningSteps, lastTurnText, reasoningMarkdown, sessionFile, sessionReasoningSteps, sessionStats } from '../thoughts.mjs';
13
+ import { parseAgentPresets, parseModelSelection, parsePermissionPresets, parseReasoningEfforts, parseSubagentFleet, parseSubagentRows } from '../agents.mjs';
14
+ import { setRowConfig, unsetRowConfig } from '../profile-edit.mjs';
15
+ import { parseReminder, stampAt, upcoming } from '../reminders.mjs';
16
+ import { AgentsetStore, emptySet, slugId } from '../agentsets.mjs';
17
+ import { SETTINGS_PAGES, cardPin, renderSettingsCard, settingsCurrent } from '../settings-card.mjs';
18
+ import { applyFork, planFork, planRewind } from '../rewind.mjs';
19
+ import { cutSession, isRewindPress } from '../rewind-buttons.mjs';
20
+ import { renderRewindCard, renderRewindUsage } from '../rewind-card.mjs';
21
+ import { MENU_GROUPS, commandForName, renderPanel, replyKeyboard } from '../menu-card.mjs';
22
+ import { explainCommand } from '../help-explain.mjs';
23
+ import { profileValues, resolveSettings } from '../settings.mjs';
24
+ import { UPDATE_DEFAULTS, describeUpdate, modeChange, updateState } from '../update-policy.mjs';
25
+ import { isNewer, pluginInfo, rowLine, searchPlugins } from '../plugin-search.mjs';
26
+ import { COMMAND_ALIASES, CONTROL_COMMANDS, DOCUMENTED_COMMANDS } from '../commands-registry.mjs';
27
+ import { APP, CLI_JS, DSH_CMD, DSH_HOME, EXE, HOME, PROFILES, THOUGHT_DIR } from '../paths.mjs';
28
+ import { read, readJson, patchPath, pkgPath, OVERLAY_MARK, modelsOf, modelOf, windowOf, modelIndent, depthOf, modelsReport, setModel, disabledIds, setDisabled, writePatch } from './models.mjs';
29
+ import { listPids, waitForExit, waitForStart, pluginsOf, bundleRowIds, addBundle, removeBundle, createProfile, dshPlugin } from './plugins.mjs';
30
+ import { cwdSlug, bareId, stamp, recentSessions, sessionTitle } from './sessions.mjs';
31
+ import { agentsOf, fleetOf, patchRows, skillsOf, AGENTS, PERSONA_HEADING, soulOf, setSoul } from './agents.mjs';
32
+ import { fmt, AGENTSETS, agentset, agentsetOf, profileRowOf, bindAgentset, agentsetCard, agentsetKeyboard } from './agentsets.mjs';
33
+ import { taskKeyboard, goalView, taskView, filterLogLines } from './tasks.mjs';
34
+ import { reasoningMode } from '../notes.mjs';
35
+ import { updatePolicy, bridgeRoot, copyRelease, installRelease, bridgeVersion, newestModuleMtime, npmLatest, npmLatestAsync } from './release.mjs';
36
+ import { presetOf } from '../profile-view.mjs';
37
+
38
+ export async function handleViewCommands(ctx) {
39
+ const { command, arg, send, reply, log, profile, state, key, config, lang: rawLang } = ctx;
40
+ // The topic's language, then the config default, then English. Never Russian:
41
+ // a group that has no opinion still must not guess a language.
42
+ const lang = normalizeLang(rawLang) || normalizeLang(config?.lang) || 'en';
43
+ const say = (text, extra) => (extra ? reply(text, extra) : reply(text));
44
+ const activeProfile = profile || config.profile || 'headless';
45
+ const effective = ctx.effective || command;
46
+ switch (effective) {
47
+ case '/status': {
48
+ const head = modelOf(activeProfile);
49
+ const active = ctx.activeTurns ? ctx.activeTurns.size : 0;
50
+ // A card, not a key dump: the identity first, then what the session is
51
+ // doing, then the environment. Numbers are the ones a person asks for
52
+ // ("how much context is left", "how big is this session").
53
+ const sessionId = state.sessions[key] || '';
54
+ const stats = sessionId ? sessionStats(sessionFile(join(DSH_HOME, 'sessions'), sessionId)) : null;
55
+ const title = sessionId ? (state.titles?.[key] || sessionTitle(sessionId)) : '';
56
+ const lines = [t(lang, 'ctrl.status.head')];
57
+ lines.push(t(lang, 'ctrl.status.session', { id: sessionId || t(lang, 'ctrl.session.none') }));
58
+ if (title) lines.push(t(lang, 'ctrl.status.title', { title }));
59
+ lines.push(t(lang, 'ctrl.status.profile', { name: activeProfile, route: `${head.provider}/${head.model}` }));
60
+ lines.push(t(lang, 'ctrl.status.thread', { name: ctx.threadId || t(lang, 'ctrl.status.threadDefault') }));
61
+ if (stats?.createdAt) lines.push(t(lang, 'ctrl.status.created', { when: stamp(stats.createdAt) }));
62
+ if (stats?.lastActivity) lines.push(t(lang, 'ctrl.status.activity', { when: stamp(stats.lastActivity) }));
63
+ if (stats?.contextTokens) {
64
+ // The window belongs to the profile that answered, not to this bridge's
65
+ // config: read it where the harness reads it, and say "unknown" only when
66
+ // the profile really does not declare one.
67
+ const window = windowOf(activeProfile, stats.model || head.model);
68
+ lines.push(window
69
+ ? t(lang, 'ctrl.status.context', {
70
+ now: stats.contextTokens.toLocaleString('en-US'),
71
+ max: window.toLocaleString('en-US'),
72
+ pct: Math.round((stats.contextTokens / window) * 100),
73
+ })
74
+ : t(lang, 'ctrl.status.contextNoWindow', { now: stats.contextTokens.toLocaleString('en-US') }));
75
+ }
76
+ if (stats?.lifetimeTokens) {
77
+ lines.push(t(lang, 'ctrl.status.lifetime', { n: stats.lifetimeTokens.toLocaleString('en-US') }));
78
+ }
79
+ if (stats?.turns) lines.push(t(lang, 'ctrl.status.steps', { n: stats.turns }));
80
+ lines.push(t(lang, 'ctrl.status.turns', {
81
+ n: active,
82
+ state: active > 0 ? t(lang, 'ctrl.status.running') : t(lang, 'ctrl.status.idle'),
83
+ }));
84
+ lines.push(t(lang, 'ctrl.status.notes', {
85
+ state: t(lang, `msg.reasoningMode.${reasoningMode(state, config, key)}`),
86
+ }));
87
+ lines.push(t(lang, 'ctrl.status.skills', { n: skillsOf().length }));
88
+ // The desktop profile only matters when this install actually has one.
89
+ if (existsSync(join(PROFILES, 'desktop', 'cordis.patch.yml'))) {
90
+ const desk = modelOf('desktop');
91
+ const deskPlugins = pluginsOf('desktop');
92
+ lines.push(t(lang, 'ctrl.status.ui', {
93
+ route: `${desk.provider}/${desk.model}`,
94
+ n: deskPlugins.bundles.length,
95
+ }));
96
+ }
97
+ const currentGoal = goalOf(state, key);
98
+ if (currentGoal) {
99
+ const { done, total } = progressOf(currentGoal);
100
+ lines.push(t(lang, 'status.goal', {
101
+ done, total, text: currentGoal.text.length > 60 ? `${currentGoal.text.slice(0, 59)}…` : currentGoal.text,
102
+ }));
103
+ }
104
+ lines.push(`DSH_HOME: ${DSH_HOME}`);
105
+ say(lines.join('\n'));
106
+ return true;
107
+ }
108
+ case '/models': {
109
+ say(modelsReport(lang, activeProfile));
110
+ return true;
111
+ }
112
+ case '/model': {
113
+ const [wanted = '', scope = ''] = (arg || '').split(/\s+/);
114
+ if (!wanted) {
115
+ // One command, two states: bare `/model` lists what can be picked, and
116
+ // `/model <id>` picks it. A separate `/models` read as a second, near
117
+ // identical command (and did the same thing as `/model` with no id).
118
+ say(modelsReport(lang, activeProfile));
119
+ return true;
120
+ }
121
+ if (!setModel(activeProfile, wanted)) {
122
+ say(t(lang, 'ctrl.model.failed', { name: activeProfile, model: wanted }));
123
+ return true;
124
+ }
125
+ const desktop = scope === 'both' ? setModel('desktop', wanted) : false;
126
+ // Report the route the patch now carries, not the string that was typed:
127
+ // `/model deepseek-v4.1-flash` leaves the provider as it was, and the answer
128
+ // is the only place that says so. "Model → deepseek" while the turn still
129
+ // runs on the slow host is the confusion this line exists to remove.
130
+ const route = modelOf(activeProfile);
131
+ say(t(lang, 'ctrl.model.switched', {
132
+ name: activeProfile,
133
+ model: `${route.provider}/${route.model}`,
134
+ desktop: desktop ? t(lang, 'ctrl.model.withDesktop', { model: wanted }) : '',
135
+ }));
136
+ return true;
137
+ }
138
+ case '/profile': {
139
+ // The GUI lets a person build a profile per kind of work; the same switch
140
+ // belongs here, per topic. A new profile is a copy of a shipped template,
141
+ // dependencies are installed on its first turn.
142
+ const [action = '', verb = '', template = ''] = String(arg || '').trim().split(/\s+/).filter(Boolean);
143
+ // A fresh install has no `profiles/` until DSH writes one, and
144
+ // `readdirSync` on a missing directory throws: `/profile` answered a
145
+ // brand-new machine with an exception instead of the list of nothing.
146
+ const profiles = (existsSync(PROFILES) ? readdirSync(PROFILES, { withFileTypes: true }) : [])
147
+ .filter((entry) => entry.isDirectory() && existsSync(join(PROFILES, entry.name, 'cordis.patch.yml')))
148
+ // Overlay profiles are generated per model (photo turns and fallbacks)
149
+ // and carry a marker row; they are an implementation detail, not a
150
+ // place a person switches a topic to.
151
+ .filter((entry) => !read(join(PROFILES, entry.name, 'cordis.patch.yml')).includes(OVERLAY_MARK))
152
+ .map((entry) => entry.name)
153
+ .sort();
154
+ const bound = state.profiles?.[key];
155
+
156
+ if (!action) {
157
+ const name = bound ? activeProfile : `${activeProfile}${t(lang, 'profile.default')}`;
158
+ say([
159
+ t(lang, 'profile.current', { name }),
160
+ t(lang, 'profile.available', { list: profiles.join(', ') }),
161
+ t(lang, 'profile.hint'),
162
+ ].join('\n'));
163
+ return true;
164
+ }
165
+
166
+ if (action === 'show') {
167
+ // One card per profile: what it runs, what it carries, who may delegate.
168
+ // `/profile` alone answers "which one am I on"; this answers "should I
169
+ // switch to it", which is the question a person asks next.
170
+ const name = verb || bound || activeProfile;
171
+ if (!profiles.includes(name)) {
172
+ say(t(lang, 'profile.unknown', { name, list: profiles.join(', ') }));
173
+ return true;
174
+ }
175
+ const pkg = pluginsOf(name);
176
+ const route = modelOf(name);
177
+ const { rows, selection } = agentsOf(name);
178
+ say([
179
+ t(lang, 'ctrl.profile.title', { name }),
180
+ t(lang, 'ctrl.profile.model', { route: `${route.provider}/${route.model}` }),
181
+ t(lang, 'ctrl.profile.plugins', { n: patchRows(name), off: pkg.disabled.length }),
182
+ t(lang, 'ctrl.profile.bundles', { n: pkg.bundles.length }),
183
+ t(lang, 'ctrl.profile.agents', { n: rows.length, routes: selection ? selection.allowed.length : 0 }),
184
+ t(lang, 'ctrl.profile.file', { path: join(PROFILES, name, 'cordis.patch.yml') }),
185
+ ].join('\n'));
186
+ return true;
187
+ }
188
+
189
+ if (action === 'new') {
190
+ const from = template || 'headless';
191
+ if (!verb || !/^[a-z0-9][a-z0-9-]{1,30}$/.test(verb)) {
192
+ say(t(lang, 'profile.badName'));
193
+ return true;
194
+ }
195
+ if (!profiles.includes(from)) {
196
+ say(t(lang, 'profile.unknownTemplate', { name: from, list: profiles.join(', ') }));
197
+ return true;
198
+ }
199
+ if (profiles.includes(verb)) {
200
+ say(t(lang, 'profile.exists', { name: verb }));
201
+ return true;
202
+ }
203
+ if (!(await createProfile(verb, from))) {
204
+ say(t(lang, 'profile.createFailed', { name: verb }));
205
+ return true;
206
+ }
207
+ state.profiles = state.profiles || {};
208
+ state.profiles[key] = verb;
209
+ ctx.saveState();
210
+ say(t(lang, 'profile.created', { name: verb, template: from }));
211
+ return true;
212
+ }
213
+
214
+ if (action === 'default') {
215
+ if (state.profiles) delete state.profiles[key];
216
+ ctx.saveState();
217
+ say(t(lang, 'profile.set', { name: config.profile || 'headless', route: 'install default' }));
218
+ return true;
219
+ }
220
+
221
+ if (!profiles.includes(action)) {
222
+ say(t(lang, 'profile.unknown', { name: action, list: profiles.join(', ') }));
223
+ return true;
224
+ }
225
+ state.profiles = state.profiles || {};
226
+ state.profiles[key] = action;
227
+ ctx.saveState();
228
+ const head = modelOf(action);
229
+ say(t(lang, 'profile.set', { name: action, route: `${head.provider}/${head.model}` }));
230
+ return true;
231
+ }
232
+ case '/settings': {
233
+ // The same switches, drawn: one card, four tabs, every button equal to the
234
+ // command a person would type. A button press carries `m:<row>[:<value>]`
235
+ // and `bridge.mjs` answers it by rendering the same card again — the card
236
+ // is a view of the commands, never a second implementation of them.
237
+ const page = String(arg || '').trim().split(/\s+/)[0].toLowerCase();
238
+ if (page && !SETTINGS_PAGES.includes(page)) {
239
+ say(t(lang, 'ctrl.settings.usage'));
240
+ return true;
241
+ }
242
+ // The preset the topic actually starts in comes from the profile it boots,
243
+ // which for a bound topic is a derived copy — not the install's profile.
244
+ let permission = null;
245
+ try {
246
+ permission = presetOf(key);
247
+ } catch {
248
+ permission = null;
249
+ }
250
+ const current = {
251
+ ...settingsCurrent({ config, state, key }),
252
+ permissions: permission ? { profile: permission.profile, preset: permission.preset?.id || '' } : null,
253
+ };
254
+ const bound = agentsetOf(state, key);
255
+ const card = renderSettingsCard({
256
+ page: SETTINGS_PAGES.includes(page) ? page : 'reply',
257
+ t: (k, vars) => t(lang, k, vars),
258
+ current,
259
+ updateMode: updatePolicy(state).mode,
260
+ bound,
261
+ });
262
+ say(card.text, { keyboard: card.keyboard });
263
+ return true;
264
+ }
265
+ case '/lang': {
266
+ const wanted = normalizeLang((arg || '').trim());
267
+ if (!wanted) {
268
+ say(t(lang, 'ctrl.lang.state', {
269
+ lang: state.lang?.[key] || config.lang || t(lang, 'ctrl.lang.auto'),
270
+ list: LANGS.join(', '),
271
+ }));
272
+ return true;
273
+ }
274
+ state.lang = state.lang || {};
275
+ state.lang[key] = wanted;
276
+ ctx.saveState();
277
+ say(t(wanted, 'msg.langSet'));
278
+ return true;
279
+ }
280
+ case '/reasoning': {
281
+ // One switch for "how much of the decision trail reaches me": off, the
282
+ // progress card, or the chat itself. Anything else prints the current
283
+ // state, so a bare /reasoning never guesses.
284
+ const wanted = String(arg || '').trim().toLowerCase();
285
+ const mode = reasoningMode(state, config, key);
286
+ const next = { on: 'card', card: 'card', chat: 'chat', off: 'off' }[wanted];
287
+ if (!next) {
288
+ say(t(lang, 'msg.reasoningState', { state: t(lang, `msg.reasoningMode.${mode}`) }));
289
+ return true;
290
+ }
291
+ state.reasoning = state.reasoning || {};
292
+ // `on` is the old spelling of the card and stays accepted: it is the word
293
+ // the previous release printed, and a chat is full of those instructions.
294
+ state.reasoning[key] = next;
295
+ ctx.saveState();
296
+ say(t(lang, next === 'off' ? 'msg.reasoningOff' : next === 'chat' ? 'msg.reasoningChat' : 'msg.reasoningOn'));
297
+ return true;
298
+ }
299
+ case '/pin': {
300
+ // The progress card is pinned while its turn runs, so getting back to the
301
+ // numbers is one tap instead of a scroll. Off by default: pinning someone's
302
+ // chat uninvited is not a favour, and a group needs the right to pin.
303
+ const wanted = String(arg || '').trim().toLowerCase();
304
+ const mode = cardPin(state, config, key);
305
+ const next = { on: 'on', off: 'off' }[wanted];
306
+ if (!next) {
307
+ say(t(lang, 'msg.pinState', { state: t(lang, `msg.pinMode.${mode}`) }));
308
+ return true;
309
+ }
310
+ state.pin = state.pin || {};
311
+ state.pin[key] = next;
312
+ ctx.saveState();
313
+ say(t(lang, next === 'on' ? 'msg.pinOn' : 'msg.pinOff'));
314
+ return true;
315
+ }
316
+ case '/thoughts': {
317
+ // The model's reasoning, read from the session log. Text by default (short,
318
+ // ephemeral, deletes itself); `file` and `all` write a Markdown log and send
319
+ // it as a document, because a five-hour turn is megabytes of text that no
320
+ // chat message can hold; `off` keeps the block out of the panel entirely.
321
+ const mode = String(arg || '').trim().toLowerCase();
322
+
323
+ if (mode === 'off' || mode === 'on') {
324
+ state.thinkBlock = state.thinkBlock || {};
325
+ if (mode === 'off') state.thinkBlock[key] = 'counter';
326
+ else delete state.thinkBlock[key];
327
+ ctx.saveState?.();
328
+ say(t(lang, mode === 'off' ? 'ctrl.thoughts.off' : 'ctrl.thoughts.on'));
329
+ return true;
330
+ }
331
+
332
+ const sessionId = ctx.state.sessions?.[key];
333
+ if (!sessionId) {
334
+ say(t(lang, 'ctrl.thoughts.noSession'));
335
+ return true;
336
+ }
337
+ const file = sessionFile(join(DSH_HOME, 'sessions'), sessionId);
338
+
339
+ if (mode === 'file' || mode === 'all') {
340
+ const turns = mode === 'all'
341
+ ? sessionReasoningSteps(file).map((turn, index) => ({ title: t(lang, 'ctrl.thoughts.turn', { n: index + 1 }), steps: turn.steps }))
342
+ : [{ steps: lastTurnReasoningSteps(file) }];
343
+ const steps = turns.reduce((sum, turn) => sum + turn.steps.length, 0);
344
+ const chars = turns.reduce((sum, turn) => sum + turn.steps.reduce((n, step) => n + step.length, 0), 0);
345
+ if (!steps) {
346
+ say(t(lang, 'ctrl.thoughts.none'));
347
+ return true;
348
+ }
349
+ const now = new Date();
350
+ const pad = (n) => String(n).padStart(2, '0');
351
+ const date = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}`;
352
+ const stamp = date.replace(/[ :]/g, '-');
353
+ const path = join(THOUGHT_DIR, `reasoning-${stamp}-${mode}.md`);
354
+ try {
355
+ mkdirSync(THOUGHT_DIR, { recursive: true });
356
+ writeFileSync(path, reasoningMarkdown({
357
+ title: t(lang, mode === 'all' ? 'ctrl.thoughts.fileTitleAll' : 'ctrl.thoughts.fileTitleLast'),
358
+ meta: [date, t(lang, 'ctrl.thoughts.fileMeta', { steps, chars, turns: turns.length })],
359
+ stepTitle: t(lang, 'ctrl.thoughts.step'),
360
+ turns,
361
+ }), 'utf8');
362
+ // A log is a keepsake, not an archive: a week is plenty and the dir
363
+ // does not grow without bound.
364
+ for (const name of readdirSync(THOUGHT_DIR)) {
365
+ if (!name.startsWith('reasoning-')) continue;
366
+ const old = join(THOUGHT_DIR, name);
367
+ try {
368
+ if (Date.now() - statSync(old).mtimeMs > 7 * 86400000) rmSync(old, { force: true });
369
+ } catch {}
370
+ }
371
+ if (ctx.sendFile) {
372
+ await ctx.sendFile(path, t(lang, 'ctrl.thoughts.fileCaption', { chars, steps }));
373
+ return true;
374
+ }
375
+ // No file transport in this context (tests): the log still leaves as text.
376
+ say(`${t(lang, 'ctrl.thoughts.fileCaption', { chars, steps })}\n\n${readFileSync(path, 'utf8').slice(0, 3200)}`);
377
+ return true;
378
+ } catch (error) {
379
+ say(t(lang, 'ctrl.thoughts.fileError', { error: String(error.message).slice(0, 120) }));
380
+ return true;
381
+ }
382
+ }
383
+
384
+ const brief = ctx.ephemeral || ((out) => say(out));
385
+ const text = file ? lastTurnReasoning(file, { maxChars: 20000 }) : '';
386
+ if (!text) {
387
+ // Not every turn plans: a one-word answer has no reasoning part at all.
388
+ // Saying "here is what the last turn answered" beats a dead end that
389
+ // looks like a broken command.
390
+ const answered = file ? lastTurnText(file, { maxChars: 1200 }) : '';
391
+ brief(answered
392
+ ? `${t(lang, 'ctrl.thoughts.none')}\n\n${t(lang, 'ctrl.thoughts.lastAnswer')}\n\n${answered}\n\n${t(lang, 'ctrl.thoughts.hint')}`
393
+ : `${t(lang, 'ctrl.thoughts.none')}\n\n${t(lang, 'ctrl.thoughts.hint')}`);
394
+ return true;
395
+ }
396
+ // A message caps at 4096 characters; a long plan goes out in parts instead
397
+ // of being cut at the first one with a "…" that hides the rest.
398
+ const title = t(lang, 'ctrl.thoughts.title', { chars: text.length });
399
+ const parts = [];
400
+ for (let at = 0; at < text.length; at += 3600) parts.push(text.slice(at, at + 3600));
401
+ parts.forEach((part, index) => {
402
+ const last = index === parts.length - 1;
403
+ const head = parts.length > 1 ? `${title} (${index + 1}/${parts.length})` : title;
404
+ brief(`${head}\n\n${part}${last ? `\n\n${t(lang, 'ctrl.thoughts.hint')}` : ''}`);
405
+ });
406
+ return true;
407
+ }
408
+ case '/prices': {
409
+ if (!ctx.prices) {
410
+ say(t(lang, 'ctrl.prices.unsupported'));
411
+ return true;
412
+ }
413
+ try {
414
+ const text = await ctx.prices(arg);
415
+ say(text);
416
+ } catch (error) {
417
+ say(t(lang, 'ctrl.prices.failed', { err: error.message }));
418
+ }
419
+ return true;
420
+ }
421
+ case '/help': {
422
+ // One translated body keeps the help in step with the menu; the Russian
423
+ // text stays as the fallback when a key is missing.
424
+ const helpLang = lang;
425
+ // `/help <command>` answers about one command: the list alone forced a
426
+ // reader to guess which of /task and /tasks they wanted, and the pairs
427
+ // that look alike are exactly the ones worth a sentence each.
428
+ const about = String(arg || '').trim().toLowerCase().replace(/^\//, '');
429
+ if (about) {
430
+ const lines = explainCommand(about, helpLang, t);
431
+ if (lines) {
432
+ say(lines);
433
+ return true;
434
+ }
435
+ say(t(helpLang, 'ctrl.help.unknown', { name: about }));
436
+ return true;
437
+ }
438
+ say(t(helpLang, 'help.body'));
439
+ return true;
440
+ }
441
+ default:
442
+ return false;
443
+ }
444
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tg-bridge",
3
- "version": "1.28.0",
3
+ "version": "1.28.1",
4
4
  "description": "Telegram bridge for DeepSeek Harness: text, voice, photos and project-per-topic sessions without opening the desktop app",
5
5
  "type": "module",
6
6
  "main": "plugin-bridge.mjs",