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
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal-style rendering for Telegram messages.
|
|
3
|
+
* Provides emoji icons, spinners, and progress indicators for a terminal-like experience.
|
|
4
|
+
*/
|
|
5
|
+
import { formatDuration } from '../utils/agent-timer.js';
|
|
6
|
+
import { EntityText } from './entities.js';
|
|
7
|
+
// Tool icons (emoji-based for mobile friendliness)
|
|
8
|
+
export const TOOL_ICONS = {
|
|
9
|
+
// File operations
|
|
10
|
+
Read: '📖',
|
|
11
|
+
Write: '✏️',
|
|
12
|
+
Edit: '🔧',
|
|
13
|
+
// Search and navigation
|
|
14
|
+
Grep: '🔍',
|
|
15
|
+
Glob: '📁',
|
|
16
|
+
// Execution
|
|
17
|
+
Bash: '💻',
|
|
18
|
+
Task: '📋',
|
|
19
|
+
Skill: '🛠️',
|
|
20
|
+
// Task list (Claude Code's checklist, mirrored by telegram/task-list.ts)
|
|
21
|
+
TaskCreate: '📝',
|
|
22
|
+
TaskUpdate: '📝',
|
|
23
|
+
TaskList: '📝',
|
|
24
|
+
TaskGet: '📝',
|
|
25
|
+
// Web
|
|
26
|
+
WebFetch: '🌐',
|
|
27
|
+
WebSearch: '🔎',
|
|
28
|
+
// Notebook
|
|
29
|
+
NotebookEdit: '📓',
|
|
30
|
+
// TeleCoder MCP tools — keys are the full names Claude Code reports so
|
|
31
|
+
// updateToolOperation/getToolIcon match without any extra normalization.
|
|
32
|
+
'mcp__telecoder-tools__telecoder_ask_user': '❓',
|
|
33
|
+
'mcp__telecoder-tools__telecoder_set_topic': '🏷️',
|
|
34
|
+
'mcp__telecoder-tools__telecoder_send_file': '📎',
|
|
35
|
+
'mcp__telecoder-tools__telecoder_list_projects': '📂',
|
|
36
|
+
'mcp__telecoder-tools__telecoder_switch_project': '🔀',
|
|
37
|
+
'mcp__telecoder-tools__telecoder_create_bot': '🤖',
|
|
38
|
+
// Status indicators
|
|
39
|
+
thinking: '💭',
|
|
40
|
+
complete: '✅',
|
|
41
|
+
error: '❌',
|
|
42
|
+
warning: '⚠️',
|
|
43
|
+
info: 'ℹ️',
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Strip the `mcp__<server>__` prefix from a tool name so it can be displayed
|
|
47
|
+
* concisely (e.g. `mcp__telecoder-tools__telecoder_ask_user` → `telecoder_ask_user`).
|
|
48
|
+
* Returns the original name when no prefix is present.
|
|
49
|
+
*/
|
|
50
|
+
function stripMcpPrefix(toolName) {
|
|
51
|
+
if (!toolName.startsWith('mcp__'))
|
|
52
|
+
return toolName;
|
|
53
|
+
const lastSep = toolName.lastIndexOf('__');
|
|
54
|
+
return lastSep > 0 ? toolName.slice(lastSep + 2) : toolName;
|
|
55
|
+
}
|
|
56
|
+
// Spinner frames. Telegram throttles edits to ~5/min, so a fast-cycling braille
|
|
57
|
+
// spinner just looks static. An hourglass is clearer at slow refresh rates.
|
|
58
|
+
export const SPINNER_FRAMES = ['⏳'];
|
|
59
|
+
// Claude Code's TUI spinner verbs, extracted verbatim from the CLI binary
|
|
60
|
+
// (v2.1.168 — 187 entries). A random one is shown while Claude works, then
|
|
61
|
+
// re-rolled on each refresh so it cycles over a turn.
|
|
62
|
+
export const THINKING_VERBS = [
|
|
63
|
+
'Accomplishing',
|
|
64
|
+
'Actioning',
|
|
65
|
+
'Actualizing',
|
|
66
|
+
'Architecting',
|
|
67
|
+
'Baking',
|
|
68
|
+
'Beaming',
|
|
69
|
+
'Beboppin\'',
|
|
70
|
+
'Befuddling',
|
|
71
|
+
'Billowing',
|
|
72
|
+
'Blanching',
|
|
73
|
+
'Bloviating',
|
|
74
|
+
'Boogieing',
|
|
75
|
+
'Boondoggling',
|
|
76
|
+
'Booping',
|
|
77
|
+
'Bootstrapping',
|
|
78
|
+
'Brewing',
|
|
79
|
+
'Bunning',
|
|
80
|
+
'Burrowing',
|
|
81
|
+
'Calculating',
|
|
82
|
+
'Canoodling',
|
|
83
|
+
'Caramelizing',
|
|
84
|
+
'Cascading',
|
|
85
|
+
'Catapulting',
|
|
86
|
+
'Cerebrating',
|
|
87
|
+
'Channeling',
|
|
88
|
+
'Channelling',
|
|
89
|
+
'Choreographing',
|
|
90
|
+
'Churning',
|
|
91
|
+
'Clauding',
|
|
92
|
+
'Coalescing',
|
|
93
|
+
'Cogitating',
|
|
94
|
+
'Combobulating',
|
|
95
|
+
'Composing',
|
|
96
|
+
'Computing',
|
|
97
|
+
'Concocting',
|
|
98
|
+
'Considering',
|
|
99
|
+
'Contemplating',
|
|
100
|
+
'Cooking',
|
|
101
|
+
'Crafting',
|
|
102
|
+
'Creating',
|
|
103
|
+
'Crunching',
|
|
104
|
+
'Crystallizing',
|
|
105
|
+
'Cultivating',
|
|
106
|
+
'Deciphering',
|
|
107
|
+
'Deliberating',
|
|
108
|
+
'Determining',
|
|
109
|
+
'Dilly-dallying',
|
|
110
|
+
'Discombobulating',
|
|
111
|
+
'Doing',
|
|
112
|
+
'Doodling',
|
|
113
|
+
'Drizzling',
|
|
114
|
+
'Ebbing',
|
|
115
|
+
'Effecting',
|
|
116
|
+
'Elucidating',
|
|
117
|
+
'Embellishing',
|
|
118
|
+
'Enchanting',
|
|
119
|
+
'Envisioning',
|
|
120
|
+
'Evaporating',
|
|
121
|
+
'Fermenting',
|
|
122
|
+
'Fiddle-faddling',
|
|
123
|
+
'Finagling',
|
|
124
|
+
'Flambéing',
|
|
125
|
+
'Flibbertigibbeting',
|
|
126
|
+
'Flowing',
|
|
127
|
+
'Flummoxing',
|
|
128
|
+
'Fluttering',
|
|
129
|
+
'Forging',
|
|
130
|
+
'Forming',
|
|
131
|
+
'Frolicking',
|
|
132
|
+
'Frosting',
|
|
133
|
+
'Gallivanting',
|
|
134
|
+
'Galloping',
|
|
135
|
+
'Garnishing',
|
|
136
|
+
'Generating',
|
|
137
|
+
'Gesticulating',
|
|
138
|
+
'Germinating',
|
|
139
|
+
'Gitifying',
|
|
140
|
+
'Grooving',
|
|
141
|
+
'Gusting',
|
|
142
|
+
'Harmonizing',
|
|
143
|
+
'Hashing',
|
|
144
|
+
'Hatching',
|
|
145
|
+
'Herding',
|
|
146
|
+
'Honking',
|
|
147
|
+
'Hullaballooing',
|
|
148
|
+
'Hyperspacing',
|
|
149
|
+
'Ideating',
|
|
150
|
+
'Imagining',
|
|
151
|
+
'Improvising',
|
|
152
|
+
'Incubating',
|
|
153
|
+
'Inferring',
|
|
154
|
+
'Infusing',
|
|
155
|
+
'Ionizing',
|
|
156
|
+
'Jitterbugging',
|
|
157
|
+
'Julienning',
|
|
158
|
+
'Kneading',
|
|
159
|
+
'Leavening',
|
|
160
|
+
'Levitating',
|
|
161
|
+
'Lollygagging',
|
|
162
|
+
'Manifesting',
|
|
163
|
+
'Marinating',
|
|
164
|
+
'Meandering',
|
|
165
|
+
'Metamorphosing',
|
|
166
|
+
'Misting',
|
|
167
|
+
'Moonwalking',
|
|
168
|
+
'Moseying',
|
|
169
|
+
'Mulling',
|
|
170
|
+
'Mustering',
|
|
171
|
+
'Musing',
|
|
172
|
+
'Nebulizing',
|
|
173
|
+
'Nesting',
|
|
174
|
+
'Newspapering',
|
|
175
|
+
'Noodling',
|
|
176
|
+
'Nucleating',
|
|
177
|
+
'Orbiting',
|
|
178
|
+
'Orchestrating',
|
|
179
|
+
'Osmosing',
|
|
180
|
+
'Perambulating',
|
|
181
|
+
'Percolating',
|
|
182
|
+
'Perusing',
|
|
183
|
+
'Philosophising',
|
|
184
|
+
'Photosynthesizing',
|
|
185
|
+
'Pollinating',
|
|
186
|
+
'Pondering',
|
|
187
|
+
'Pontificating',
|
|
188
|
+
'Pouncing',
|
|
189
|
+
'Precipitating',
|
|
190
|
+
'Prestidigitating',
|
|
191
|
+
'Processing',
|
|
192
|
+
'Proofing',
|
|
193
|
+
'Propagating',
|
|
194
|
+
'Puttering',
|
|
195
|
+
'Puzzling',
|
|
196
|
+
'Quantumizing',
|
|
197
|
+
'Razzle-dazzling',
|
|
198
|
+
'Razzmatazzing',
|
|
199
|
+
'Recombobulating',
|
|
200
|
+
'Reticulating',
|
|
201
|
+
'Roosting',
|
|
202
|
+
'Ruminating',
|
|
203
|
+
'Sautéing',
|
|
204
|
+
'Scampering',
|
|
205
|
+
'Schlepping',
|
|
206
|
+
'Scurrying',
|
|
207
|
+
'Seasoning',
|
|
208
|
+
'Shenaniganing',
|
|
209
|
+
'Shimmying',
|
|
210
|
+
'Simmering',
|
|
211
|
+
'Skedaddling',
|
|
212
|
+
'Sketching',
|
|
213
|
+
'Slithering',
|
|
214
|
+
'Smooshing',
|
|
215
|
+
'Sock-hopping',
|
|
216
|
+
'Spelunking',
|
|
217
|
+
'Spinning',
|
|
218
|
+
'Sprouting',
|
|
219
|
+
'Stewing',
|
|
220
|
+
'Sublimating',
|
|
221
|
+
'Swirling',
|
|
222
|
+
'Swooping',
|
|
223
|
+
'Symbioting',
|
|
224
|
+
'Synthesizing',
|
|
225
|
+
'Tempering',
|
|
226
|
+
'Thinking',
|
|
227
|
+
'Thundering',
|
|
228
|
+
'Tinkering',
|
|
229
|
+
'Tomfoolering',
|
|
230
|
+
'Topsy-turvying',
|
|
231
|
+
'Transfiguring',
|
|
232
|
+
'Transmuting',
|
|
233
|
+
'Twisting',
|
|
234
|
+
'Undulating',
|
|
235
|
+
'Unfurling',
|
|
236
|
+
'Unravelling',
|
|
237
|
+
'Vibing',
|
|
238
|
+
'Waddling',
|
|
239
|
+
'Wandering',
|
|
240
|
+
'Warping',
|
|
241
|
+
'Whatchamacalliting',
|
|
242
|
+
'Whirlpooling',
|
|
243
|
+
'Whirring',
|
|
244
|
+
'Whisking',
|
|
245
|
+
'Wibbling',
|
|
246
|
+
'Working',
|
|
247
|
+
'Wrangling',
|
|
248
|
+
'Zesting',
|
|
249
|
+
'Zigzagging',
|
|
250
|
+
];
|
|
251
|
+
// Progress bar characters
|
|
252
|
+
export const PROGRESS = {
|
|
253
|
+
empty: '░',
|
|
254
|
+
filled: '█',
|
|
255
|
+
partial: '▓',
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Get icon for a tool name. MCP tools without an explicit entry fall back
|
|
259
|
+
* to a generic 🛠️ so they're visually distinct from built-in tools (🔹).
|
|
260
|
+
*/
|
|
261
|
+
export function getToolIcon(toolName) {
|
|
262
|
+
const explicit = TOOL_ICONS[toolName];
|
|
263
|
+
if (explicit)
|
|
264
|
+
return explicit;
|
|
265
|
+
if (toolName.startsWith('mcp__'))
|
|
266
|
+
return '🛠️';
|
|
267
|
+
return '🔹';
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Get current spinner frame based on index
|
|
271
|
+
*/
|
|
272
|
+
export function getSpinnerFrame(index) {
|
|
273
|
+
return SPINNER_FRAMES[index % SPINNER_FRAMES.length];
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Get a random thinking verb.
|
|
277
|
+
*/
|
|
278
|
+
export function getThinkingVerb() {
|
|
279
|
+
return THINKING_VERBS[Math.floor(Math.random() * THINKING_VERBS.length)];
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Render a status line showing current operation
|
|
283
|
+
* Example: "⠹ 📖 Reading src/config.ts... [1m 12s]"
|
|
284
|
+
*/
|
|
285
|
+
export function renderStatusLine(spinnerIndex, icon, operation, detail, elapsedMs, pausedMs) {
|
|
286
|
+
const spinner = getSpinnerFrame(spinnerIndex);
|
|
287
|
+
const detailStr = detail ? ` → ${detail}` : '';
|
|
288
|
+
const timerStr = elapsedMs !== undefined && elapsedMs >= 5000
|
|
289
|
+
? ` [${formatDuration(elapsedMs)}]`
|
|
290
|
+
: '';
|
|
291
|
+
const pausedStr = pausedMs !== undefined && pausedMs > 0
|
|
292
|
+
? ` ⏸️ paused ${formatDuration(pausedMs)} (Telegram rate limit)`
|
|
293
|
+
: '';
|
|
294
|
+
return `${spinner} ${icon} ${operation}${detailStr}${timerStr}${pausedStr}`;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Render a progress bar
|
|
298
|
+
* Example: "[████████░░░░] 67%"
|
|
299
|
+
*/
|
|
300
|
+
export function renderProgressBar(percent, width = 12) {
|
|
301
|
+
const clampedPercent = Math.max(0, Math.min(100, percent));
|
|
302
|
+
const filledCount = Math.round((clampedPercent / 100) * width);
|
|
303
|
+
const emptyCount = width - filledCount;
|
|
304
|
+
const filled = PROGRESS.filled.repeat(filledCount);
|
|
305
|
+
const empty = PROGRESS.empty.repeat(emptyCount);
|
|
306
|
+
return `[${filled}${empty}] ${Math.round(clampedPercent)}%`;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Render a tool operation status
|
|
310
|
+
* Example: "📖 Read → src/config.ts"
|
|
311
|
+
*/
|
|
312
|
+
export function renderToolOperation(toolName, detail) {
|
|
313
|
+
const icon = getToolIcon(toolName);
|
|
314
|
+
const action = getToolAction(toolName);
|
|
315
|
+
const detailStr = detail ? ` → ${detail}` : '';
|
|
316
|
+
return `${icon} ${action}${detailStr}`;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Get human-readable action name for a tool.
|
|
320
|
+
* For MCP tools: explicit map first, then fall back to the de-prefixed
|
|
321
|
+
* name (e.g. `mcp__foo__bar_baz` → `bar_baz`) so the rendered status line
|
|
322
|
+
* stays short instead of dumping the full server-prefixed identifier.
|
|
323
|
+
*/
|
|
324
|
+
export function getToolAction(toolName) {
|
|
325
|
+
const actions = {
|
|
326
|
+
Read: 'Reading',
|
|
327
|
+
Write: 'Writing',
|
|
328
|
+
Edit: 'Editing',
|
|
329
|
+
Bash: 'Running',
|
|
330
|
+
Grep: 'Searching',
|
|
331
|
+
Glob: 'Finding files',
|
|
332
|
+
Task: 'Running task',
|
|
333
|
+
Skill: 'Running skill',
|
|
334
|
+
TaskCreate: 'Adding task',
|
|
335
|
+
TaskUpdate: 'Updating task',
|
|
336
|
+
TaskList: 'Listing tasks',
|
|
337
|
+
TaskGet: 'Reading task',
|
|
338
|
+
WebFetch: 'Fetching',
|
|
339
|
+
WebSearch: 'Searching web',
|
|
340
|
+
NotebookEdit: 'Editing notebook',
|
|
341
|
+
'mcp__telecoder-tools__telecoder_ask_user': 'Asking',
|
|
342
|
+
'mcp__telecoder-tools__telecoder_set_topic': 'Setting topic',
|
|
343
|
+
'mcp__telecoder-tools__telecoder_send_file': 'Sending file',
|
|
344
|
+
'mcp__telecoder-tools__telecoder_list_projects': 'Listing projects',
|
|
345
|
+
'mcp__telecoder-tools__telecoder_switch_project': 'Switching project',
|
|
346
|
+
'mcp__telecoder-tools__telecoder_create_bot': 'Creating bot',
|
|
347
|
+
};
|
|
348
|
+
if (actions[toolName])
|
|
349
|
+
return actions[toolName];
|
|
350
|
+
if (toolName.startsWith('mcp__'))
|
|
351
|
+
return stripMcpPrefix(toolName);
|
|
352
|
+
return toolName;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Extract a meaningful detail from tool input for display.
|
|
356
|
+
* Caller controls truncation via the `verbose` flag (resolved per-chat by
|
|
357
|
+
* the verbosity tier in `utils/verbosity.ts`).
|
|
358
|
+
*/
|
|
359
|
+
export function extractToolDetail(toolName, input, verbose) {
|
|
360
|
+
const str = (key) => {
|
|
361
|
+
const val = input[key];
|
|
362
|
+
return typeof val === 'string' ? val : undefined;
|
|
363
|
+
};
|
|
364
|
+
switch (toolName) {
|
|
365
|
+
case 'Read':
|
|
366
|
+
case 'Write':
|
|
367
|
+
case 'Edit':
|
|
368
|
+
case 'NotebookEdit':
|
|
369
|
+
return verbose ? str('file_path') : truncatePath(str('file_path'));
|
|
370
|
+
case 'Bash':
|
|
371
|
+
return verbose ? extractFirstLine(str('command')) : truncateCommand(str('command'));
|
|
372
|
+
case 'Grep':
|
|
373
|
+
return str('pattern');
|
|
374
|
+
case 'Glob':
|
|
375
|
+
return str('pattern');
|
|
376
|
+
case 'WebFetch':
|
|
377
|
+
case 'WebSearch':
|
|
378
|
+
return verbose ? (str('url') || str('query')) : truncateUrl(str('url') || str('query'));
|
|
379
|
+
case 'Task':
|
|
380
|
+
case 'Agent': // subagent tool — renamed Task→Agent in newer Claude Code builds
|
|
381
|
+
return verbose ? str('description') : truncateCommand(str('description'));
|
|
382
|
+
case 'TaskCreate':
|
|
383
|
+
return verbose ? str('subject') : truncateCommand(str('subject'));
|
|
384
|
+
case 'TaskUpdate': {
|
|
385
|
+
const id = str('taskId');
|
|
386
|
+
const status = str('status')?.replace('_', ' ');
|
|
387
|
+
return id ? `#${id}${status ? ` ${status}` : ''}` : undefined;
|
|
388
|
+
}
|
|
389
|
+
case 'TaskGet': {
|
|
390
|
+
const id = str('taskId');
|
|
391
|
+
return id ? `#${id}` : undefined;
|
|
392
|
+
}
|
|
393
|
+
case 'mcp__telecoder-tools__telecoder_ask_user':
|
|
394
|
+
return verbose ? str('question') : truncateCommand(str('question'));
|
|
395
|
+
case 'mcp__telecoder-tools__telecoder_set_topic':
|
|
396
|
+
return str('topic');
|
|
397
|
+
case 'mcp__telecoder-tools__telecoder_send_file':
|
|
398
|
+
return verbose ? str('file_path') : truncatePath(str('file_path'));
|
|
399
|
+
case 'mcp__telecoder-tools__telecoder_switch_project':
|
|
400
|
+
case 'mcp__telecoder-tools__telecoder_create_bot':
|
|
401
|
+
return str('project_name');
|
|
402
|
+
default:
|
|
403
|
+
return undefined;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Extract the first line of a command (no length limit)
|
|
408
|
+
*/
|
|
409
|
+
function extractFirstLine(command) {
|
|
410
|
+
if (!command)
|
|
411
|
+
return undefined;
|
|
412
|
+
return command.split('\n')[0].trim();
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Truncate a file path for display
|
|
416
|
+
*/
|
|
417
|
+
function truncatePath(filePath, maxLen = 40) {
|
|
418
|
+
if (!filePath)
|
|
419
|
+
return undefined;
|
|
420
|
+
if (filePath.length <= maxLen)
|
|
421
|
+
return filePath;
|
|
422
|
+
// Keep the last part of the path
|
|
423
|
+
const parts = filePath.split('/');
|
|
424
|
+
let result = parts[parts.length - 1];
|
|
425
|
+
// Truncate filename itself if it exceeds maxLen
|
|
426
|
+
if (result.length > maxLen) {
|
|
427
|
+
return result.substring(0, maxLen - 3) + '...';
|
|
428
|
+
}
|
|
429
|
+
// Add parent dirs if space allows
|
|
430
|
+
for (let i = parts.length - 2; i >= 0; i--) {
|
|
431
|
+
const candidate = `.../${parts.slice(i).join('/')}`;
|
|
432
|
+
if (candidate.length <= maxLen) {
|
|
433
|
+
result = candidate;
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return result;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Truncate a command for display
|
|
443
|
+
*/
|
|
444
|
+
function truncateCommand(command, maxLen = 50) {
|
|
445
|
+
if (!command)
|
|
446
|
+
return undefined;
|
|
447
|
+
const firstLine = command.split('\n')[0].trim();
|
|
448
|
+
if (firstLine.length <= maxLen)
|
|
449
|
+
return firstLine;
|
|
450
|
+
return firstLine.substring(0, maxLen - 3) + '...';
|
|
451
|
+
}
|
|
452
|
+
// Caps for the live Bash command block (terminal UI). While a command runs,
|
|
453
|
+
// this block is the user's only window into what's executing, so we show the
|
|
454
|
+
// command in full rather than just its first line. Non-verbose applies a tight
|
|
455
|
+
// readability cap; verbose only truncates at a high failsafe ceiling — well
|
|
456
|
+
// under Telegram's 4096-char message limit, leaving room for the status header
|
|
457
|
+
// and background-task footer that share the message. Either way, long commands
|
|
458
|
+
// are elided in the MIDDLE so the leading setup (e.g. `cd …`) and the trailing
|
|
459
|
+
// work the command is actually spending time on both stay visible.
|
|
460
|
+
const BASH_BLOCK_CAP_COMPACT = 300;
|
|
461
|
+
const BASH_BLOCK_CAP_VERBOSE = 3500;
|
|
462
|
+
/**
|
|
463
|
+
* Format a Bash command for the live status block. Newlines are preserved so
|
|
464
|
+
* the command reads like a shell paste; the result is capped per the `verbose`
|
|
465
|
+
* flag with a middle ellipsis when it exceeds the cap. Returns undefined for
|
|
466
|
+
* empty/whitespace input (so callers can omit the block entirely).
|
|
467
|
+
*/
|
|
468
|
+
export function formatBashCommandBlock(command, verbose) {
|
|
469
|
+
if (!command)
|
|
470
|
+
return undefined;
|
|
471
|
+
const trimmed = command.trim();
|
|
472
|
+
if (!trimmed)
|
|
473
|
+
return undefined;
|
|
474
|
+
const cap = verbose ? BASH_BLOCK_CAP_VERBOSE : BASH_BLOCK_CAP_COMPACT;
|
|
475
|
+
if (trimmed.length <= cap)
|
|
476
|
+
return trimmed;
|
|
477
|
+
return elideMiddle(trimmed, cap);
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Truncate `text` to at most `maxLen` chars by dropping the middle and
|
|
481
|
+
* inserting an ellipsis marker, keeping ~60% head and ~40% tail.
|
|
482
|
+
*/
|
|
483
|
+
function elideMiddle(text, maxLen) {
|
|
484
|
+
const marker = '\n …\n';
|
|
485
|
+
if (maxLen <= marker.length)
|
|
486
|
+
return text.slice(0, maxLen);
|
|
487
|
+
const budget = maxLen - marker.length;
|
|
488
|
+
const headLen = Math.ceil(budget * 0.6);
|
|
489
|
+
const tailLen = budget - headLen;
|
|
490
|
+
return text.slice(0, headLen).trimEnd() + marker + text.slice(text.length - tailLen).trimStart();
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Remove ANSI CSI/OSC escape sequences from tool output.
|
|
494
|
+
*
|
|
495
|
+
* The ESC byte is non-printing, so an unstripped sequence does not merely look
|
|
496
|
+
* wrong in Telegram's plain-text view — the client swallows the ESC and renders
|
|
497
|
+
* the remainder as a literal `[1m`. The bytes also count against the caller's
|
|
498
|
+
* truncation budget, so colourised output loses most of its char cap to codes
|
|
499
|
+
* the reader never sees.
|
|
500
|
+
*
|
|
501
|
+
* Written with `\x1b`/`\x07` escapes rather than literal control bytes on
|
|
502
|
+
* purpose: if a raw ESC is ever lost in transit, `\x1b\][^\x07]*` degrades to
|
|
503
|
+
* `\][^]*`, which matches everything after the first `]` and silently shreds
|
|
504
|
+
* output instead of failing loudly.
|
|
505
|
+
*/
|
|
506
|
+
const ANSI_RE = /\x1b\[[0-9;?]*[a-zA-Z]|\x1b\][^\x07]*(?:\x07|\x1b\\)/g;
|
|
507
|
+
export function stripAnsi(text) {
|
|
508
|
+
return text.replace(ANSI_RE, '');
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Truncate tool/command output for display (action log + inline tool-result
|
|
512
|
+
* posts), bounded by both a line cap and a char cap.
|
|
513
|
+
*
|
|
514
|
+
* Unlike command *input*, output truncation is direction-sensitive and keyed on
|
|
515
|
+
* `isError`. Errors, test summaries and result lines land at the END of output,
|
|
516
|
+
* so error output is TAIL-biased (~1/3 head, ~2/3 tail) — plain head-only
|
|
517
|
+
* truncation drops exactly what the reader needs. Successful output is
|
|
518
|
+
* HEAD-biased (~2/3 head, ~1/3 tail): you usually want the start (a file dump,
|
|
519
|
+
* an `ls`), but the trailing slice still preserves a final summary line. Either
|
|
520
|
+
* way a `[+N more lines]` marker sits between head and tail. The char cap is a
|
|
521
|
+
* secondary guard (e.g. one very long line) and also elides toward the middle
|
|
522
|
+
* with the same bias so the important side survives. The marker is embedded
|
|
523
|
+
* inline — the caller appends no separate trailer.
|
|
524
|
+
*/
|
|
525
|
+
export function elideToolOutput(content, maxLines, maxChars, opts = {}) {
|
|
526
|
+
// Fraction of the budget given to the head. Errors lean tail; success leans head.
|
|
527
|
+
const headFraction = opts.isError ? 1 / 3 : 2 / 3;
|
|
528
|
+
let text = content;
|
|
529
|
+
const lines = text.split('\n');
|
|
530
|
+
if (lines.length > maxLines) {
|
|
531
|
+
if (maxLines >= 3) {
|
|
532
|
+
const budget = maxLines - 1; // reserve one line for the marker
|
|
533
|
+
const headCount = Math.min(budget - 1, Math.max(1, Math.round(budget * headFraction)));
|
|
534
|
+
const tailCount = budget - headCount;
|
|
535
|
+
const hidden = lines.length - headCount - tailCount;
|
|
536
|
+
text = [
|
|
537
|
+
...lines.slice(0, headCount),
|
|
538
|
+
`[+${hidden} more lines]`,
|
|
539
|
+
...lines.slice(lines.length - tailCount),
|
|
540
|
+
].join('\n');
|
|
541
|
+
}
|
|
542
|
+
else {
|
|
543
|
+
// Too few lines allowed to bother with a head — keep whichever side the
|
|
544
|
+
// bias favors (tail for errors, head for success).
|
|
545
|
+
const keep = Math.max(1, maxLines - 1);
|
|
546
|
+
const slice = opts.isError ? lines.slice(lines.length - keep) : lines.slice(0, keep);
|
|
547
|
+
const marker = `[+${lines.length - slice.length} more lines]`;
|
|
548
|
+
text = (opts.isError ? [marker, ...slice] : [...slice, marker]).join('\n');
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
if (text.length > maxChars) {
|
|
552
|
+
const marker = '\n[chars truncated]\n';
|
|
553
|
+
if (maxChars <= marker.length) {
|
|
554
|
+
text = opts.isError ? text.slice(text.length - maxChars) : text.slice(0, maxChars);
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
const budget = maxChars - marker.length;
|
|
558
|
+
const headLen = Math.round(budget * headFraction);
|
|
559
|
+
const tailLen = budget - headLen;
|
|
560
|
+
text = text.slice(0, headLen).trimEnd() + marker + text.slice(text.length - tailLen).trimStart();
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return text;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Truncate a URL for display
|
|
567
|
+
*/
|
|
568
|
+
function truncateUrl(url, maxLen = 40) {
|
|
569
|
+
if (!url)
|
|
570
|
+
return undefined;
|
|
571
|
+
if (url.length <= maxLen)
|
|
572
|
+
return url;
|
|
573
|
+
return url.substring(0, maxLen - 3) + '...';
|
|
574
|
+
}
|
|
575
|
+
/** Update lines the footer shows under a lone task. */
|
|
576
|
+
const FOOTER_UPDATES = 3;
|
|
577
|
+
const FOOTER_UPDATE_CHARS = 80;
|
|
578
|
+
const FOOTER_TASK_CHARS = 60;
|
|
579
|
+
/** Tasks the footer lists by name before the rest go into "+N more". */
|
|
580
|
+
const FOOTER_MAX_TASKS = 6;
|
|
581
|
+
function cut(text, max) {
|
|
582
|
+
return text.length > max ? text.substring(0, max - 3) + '...' : text;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Render a compact background-task footer for the streaming status block.
|
|
586
|
+
* - 0 tasks: null.
|
|
587
|
+
* - 1 task: "🔄 Running in background: <description>", and under it the
|
|
588
|
+
* latest few things it reported doing.
|
|
589
|
+
* - N tasks: "🔄 N tasks running in background", then each by name with its
|
|
590
|
+
* latest update under it. A bare count left the user guessing what had
|
|
591
|
+
* started once there was more than one.
|
|
592
|
+
*
|
|
593
|
+
* Updates are timed as the action log times its entries, so a long task
|
|
594
|
+
* shows it's getting somewhere.
|
|
595
|
+
*/
|
|
596
|
+
export function renderBackgroundFooter(tasks) {
|
|
597
|
+
if (tasks.length === 0)
|
|
598
|
+
return null;
|
|
599
|
+
const b = new EntityText();
|
|
600
|
+
const addUpdate = (update, indent) => {
|
|
601
|
+
b.newline().add(`${indent}⎿ [`)
|
|
602
|
+
.dateTime(clockTime(update.at), update.at)
|
|
603
|
+
.add(`] ${cut(update.text, FOOTER_UPDATE_CHARS)}`);
|
|
604
|
+
};
|
|
605
|
+
if (tasks.length === 1) {
|
|
606
|
+
b.add(`🔄 Running in background: ${cut(tasks[0].description, FOOTER_TASK_CHARS)}`);
|
|
607
|
+
for (const update of (tasks[0].updates ?? []).slice(-FOOTER_UPDATES))
|
|
608
|
+
addUpdate(update, ' ');
|
|
609
|
+
return b.build();
|
|
610
|
+
}
|
|
611
|
+
b.add(`🔄 ${tasks.length} tasks running in background`);
|
|
612
|
+
for (const task of tasks.slice(0, FOOTER_MAX_TASKS)) {
|
|
613
|
+
b.newline().add(` • ${cut(task.description, FOOTER_TASK_CHARS)}`);
|
|
614
|
+
const latest = task.updates?.at(-1);
|
|
615
|
+
if (latest)
|
|
616
|
+
addUpdate(latest, ' ');
|
|
617
|
+
}
|
|
618
|
+
const more = tasks.length - FOOTER_MAX_TASKS;
|
|
619
|
+
if (more > 0)
|
|
620
|
+
b.newline().add(` … +${more} more · /tasks`);
|
|
621
|
+
return b.build();
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* A time as the server's clock reads it, for the clients that can't show a
|
|
625
|
+
* `date_time` entity.
|
|
626
|
+
*/
|
|
627
|
+
function clockTime(ms) {
|
|
628
|
+
return new Date(ms).toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' });
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Render a background task status line
|
|
632
|
+
* Example: "📋 Background: Installing dependencies ✅"
|
|
633
|
+
*/
|
|
634
|
+
export function renderBackgroundTask(name, status, spinnerIndex = 0) {
|
|
635
|
+
const statusIcon = status === 'complete'
|
|
636
|
+
? TOOL_ICONS.complete
|
|
637
|
+
: status === 'error'
|
|
638
|
+
? TOOL_ICONS.error
|
|
639
|
+
: getSpinnerFrame(spinnerIndex);
|
|
640
|
+
return `📋 Background: ${name} ${statusIcon}`;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Format a terminal-style message with optional status and background tasks
|
|
644
|
+
*/
|
|
645
|
+
export function formatTerminalMessage(content, options = {}) {
|
|
646
|
+
const { spinnerIndex = 0, currentOperation, backgroundTasks = [], isComplete = false } = options;
|
|
647
|
+
const parts = [];
|
|
648
|
+
// Add status line if there's a current operation and not complete
|
|
649
|
+
if (currentOperation && !isComplete) {
|
|
650
|
+
parts.push(renderStatusLine(spinnerIndex, currentOperation.icon, currentOperation.name, currentOperation.detail));
|
|
651
|
+
parts.push('');
|
|
652
|
+
}
|
|
653
|
+
// Add main content
|
|
654
|
+
if (content) {
|
|
655
|
+
parts.push(content);
|
|
656
|
+
}
|
|
657
|
+
// Add background tasks if any
|
|
658
|
+
if (backgroundTasks.length > 0) {
|
|
659
|
+
if (content)
|
|
660
|
+
parts.push('');
|
|
661
|
+
for (const task of backgroundTasks) {
|
|
662
|
+
parts.push(renderBackgroundTask(task.name, task.status, spinnerIndex));
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return parts.join('\n');
|
|
666
|
+
}
|
|
667
|
+
//# sourceMappingURL=terminal-renderer.js.map
|