beecork 1.3.0 → 1.3.2
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/LICENSE +21 -0
- package/README.md +154 -0
- package/dist/capabilities/index.d.ts +0 -1
- package/dist/capabilities/index.js +0 -1
- package/dist/capabilities/manager.d.ts +0 -1
- package/dist/capabilities/manager.js +0 -1
- package/dist/capabilities/packs.d.ts +0 -1
- package/dist/capabilities/packs.js +7 -8
- package/dist/capabilities/types.d.ts +0 -1
- package/dist/capabilities/types.js +0 -1
- package/dist/channels/command-handler.d.ts +0 -1
- package/dist/channels/command-handler.js +0 -1
- package/dist/channels/discord.d.ts +0 -1
- package/dist/channels/discord.js +30 -47
- package/dist/channels/index.d.ts +0 -1
- package/dist/channels/index.js +0 -1
- package/dist/channels/loader.d.ts +0 -1
- package/dist/channels/loader.js +6 -1
- package/dist/channels/pipeline.d.ts +50 -0
- package/dist/channels/pipeline.js +83 -0
- package/dist/channels/registry.d.ts +0 -1
- package/dist/channels/registry.js +0 -1
- package/dist/channels/telegram.d.ts +0 -1
- package/dist/channels/telegram.js +65 -67
- package/dist/channels/types.d.ts +0 -1
- package/dist/channels/types.js +0 -1
- package/dist/channels/webhook.d.ts +0 -1
- package/dist/channels/webhook.js +0 -1
- package/dist/channels/whatsapp.d.ts +0 -1
- package/dist/channels/whatsapp.js +25 -59
- package/dist/cli/capabilities.d.ts +0 -1
- package/dist/cli/capabilities.js +0 -1
- package/dist/cli/channel.d.ts +0 -1
- package/dist/cli/channel.js +1 -2
- package/dist/cli/commands.d.ts +0 -1
- package/dist/cli/commands.js +9 -3
- package/dist/cli/doctor.d.ts +0 -1
- package/dist/cli/doctor.js +2 -2
- package/dist/cli/handoff.d.ts +0 -1
- package/dist/cli/handoff.js +0 -1
- package/dist/cli/helpers.d.ts +0 -1
- package/dist/cli/helpers.js +0 -1
- package/dist/cli/mcp.d.ts +0 -1
- package/dist/cli/mcp.js +0 -1
- package/dist/cli/media.d.ts +0 -1
- package/dist/cli/media.js +0 -1
- package/dist/cli/setup.d.ts +0 -1
- package/dist/cli/setup.js +11 -11
- package/dist/cli/store.d.ts +0 -1
- package/dist/cli/store.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/daemon.d.ts +0 -1
- package/dist/daemon.js +1 -2
- package/dist/dashboard/html.d.ts +0 -1
- package/dist/dashboard/html.js +45 -38
- package/dist/dashboard/server.d.ts +0 -1
- package/dist/dashboard/server.js +60 -25
- package/dist/db/index.d.ts +11 -1
- package/dist/db/index.js +12 -1
- package/dist/db/migrations.d.ts +0 -1
- package/dist/db/migrations.js +5 -1
- package/dist/delegation/manager.d.ts +0 -3
- package/dist/delegation/manager.js +0 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +21 -6
- package/dist/knowledge/index.d.ts +0 -1
- package/dist/knowledge/index.js +0 -1
- package/dist/knowledge/manager.d.ts +0 -1
- package/dist/knowledge/manager.js +19 -10
- package/dist/knowledge/types.d.ts +0 -1
- package/dist/knowledge/types.js +0 -1
- package/dist/machines/index.d.ts +1 -3
- package/dist/machines/index.js +1 -3
- package/dist/machines/registry.d.ts +0 -7
- package/dist/machines/registry.js +0 -25
- package/dist/mcp/server.d.ts +0 -1
- package/dist/mcp/server.js +28 -52
- package/dist/media/factory.d.ts +0 -1
- package/dist/media/factory.js +0 -1
- package/dist/media/generators/dall-e.d.ts +0 -1
- package/dist/media/generators/dall-e.js +0 -1
- package/dist/media/generators/elevenlabs-music.d.ts +0 -1
- package/dist/media/generators/elevenlabs-music.js +0 -1
- package/dist/media/generators/elevenlabs-sfx.d.ts +0 -1
- package/dist/media/generators/elevenlabs-sfx.js +0 -1
- package/dist/media/generators/kling.d.ts +0 -1
- package/dist/media/generators/kling.js +14 -20
- package/dist/media/generators/lyria.d.ts +0 -1
- package/dist/media/generators/lyria.js +0 -1
- package/dist/media/generators/nano-banana.d.ts +0 -1
- package/dist/media/generators/nano-banana.js +0 -1
- package/dist/media/generators/poll-util.d.ts +12 -0
- package/dist/media/generators/poll-util.js +22 -0
- package/dist/media/generators/recraft.d.ts +0 -1
- package/dist/media/generators/recraft.js +0 -1
- package/dist/media/generators/runway.d.ts +0 -1
- package/dist/media/generators/runway.js +14 -23
- package/dist/media/generators/stable-diffusion.d.ts +0 -1
- package/dist/media/generators/stable-diffusion.js +0 -1
- package/dist/media/generators/veo.d.ts +0 -1
- package/dist/media/generators/veo.js +0 -1
- package/dist/media/index.d.ts +0 -2
- package/dist/media/index.js +0 -2
- package/dist/media/store.d.ts +0 -1
- package/dist/media/store.js +0 -1
- package/dist/media/types.d.ts +0 -1
- package/dist/media/types.js +0 -1
- package/dist/memory/extractor.d.ts +0 -1
- package/dist/memory/extractor.js +8 -3
- package/dist/notifications/index.d.ts +0 -1
- package/dist/notifications/index.js +0 -1
- package/dist/notifications/ntfy.d.ts +0 -1
- package/dist/notifications/ntfy.js +0 -1
- package/dist/notifications/pushover.d.ts +0 -1
- package/dist/notifications/pushover.js +0 -1
- package/dist/notifications/types.d.ts +0 -1
- package/dist/notifications/types.js +0 -1
- package/dist/notifications/webhook-provider.d.ts +0 -1
- package/dist/notifications/webhook-provider.js +0 -1
- package/dist/observability/analytics.d.ts +0 -1
- package/dist/observability/analytics.js +0 -1
- package/dist/pipe/anthropic-client.d.ts +0 -1
- package/dist/pipe/anthropic-client.js +5 -3
- package/dist/pipe/brain.d.ts +0 -1
- package/dist/pipe/brain.js +0 -1
- package/dist/pipe/memory-store.d.ts +0 -1
- package/dist/pipe/memory-store.js +0 -1
- package/dist/pipe/project-scanner.d.ts +5 -3
- package/dist/pipe/project-scanner.js +21 -90
- package/dist/pipe/types.d.ts +0 -11
- package/dist/pipe/types.js +0 -1
- package/dist/projects/index.d.ts +0 -1
- package/dist/projects/index.js +0 -1
- package/dist/projects/manager.d.ts +0 -1
- package/dist/projects/manager.js +0 -1
- package/dist/projects/router.d.ts +0 -1
- package/dist/projects/router.js +1 -2
- package/dist/projects/types.d.ts +0 -7
- package/dist/projects/types.js +0 -1
- package/dist/service/install.d.ts +0 -1
- package/dist/service/install.js +0 -1
- package/dist/service/templates.d.ts +0 -1
- package/dist/service/templates.js +0 -1
- package/dist/service/windows.d.ts +0 -3
- package/dist/service/windows.js +0 -11
- package/dist/session/circuit-breaker.d.ts +0 -1
- package/dist/session/circuit-breaker.js +0 -1
- package/dist/session/context-monitor.d.ts +0 -1
- package/dist/session/context-monitor.js +0 -1
- package/dist/session/manager.d.ts +0 -1
- package/dist/session/manager.js +3 -4
- package/dist/session/subprocess.d.ts +0 -1
- package/dist/session/subprocess.js +0 -1
- package/dist/session/tool-classifier.d.ts +0 -1
- package/dist/session/tool-classifier.js +0 -1
- package/dist/tasks/scheduler.d.ts +0 -3
- package/dist/tasks/scheduler.js +4 -7
- package/dist/tasks/store.d.ts +0 -3
- package/dist/tasks/store.js +0 -3
- package/dist/timeline/index.d.ts +0 -1
- package/dist/timeline/index.js +0 -1
- package/dist/timeline/logger.d.ts +0 -1
- package/dist/timeline/logger.js +0 -1
- package/dist/timeline/query.d.ts +0 -1
- package/dist/timeline/query.js +2 -2
- package/dist/timeline/types.d.ts +0 -1
- package/dist/timeline/types.js +0 -1
- package/dist/types.d.ts +1 -7
- package/dist/types.js +0 -1
- package/dist/users/index.d.ts +1 -2
- package/dist/users/index.js +1 -2
- package/dist/users/service.d.ts +0 -8
- package/dist/users/service.js +0 -19
- package/dist/util/logger.d.ts +0 -1
- package/dist/util/logger.js +0 -1
- package/dist/util/paths.d.ts +0 -1
- package/dist/util/paths.js +0 -1
- package/dist/util/platform.d.ts +0 -1
- package/dist/util/platform.js +0 -1
- package/dist/util/progress.d.ts +0 -1
- package/dist/util/progress.js +0 -1
- package/dist/util/rate-limiter.d.ts +0 -1
- package/dist/util/rate-limiter.js +0 -1
- package/dist/util/retry.d.ts +0 -1
- package/dist/util/retry.js +1 -2
- package/dist/util/text.d.ts +0 -1
- package/dist/util/text.js +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/dist/voice/index.d.ts +8 -1
- package/dist/voice/index.js +23 -1
- package/dist/voice/stt.d.ts +0 -1
- package/dist/voice/stt.js +0 -1
- package/dist/voice/tts.d.ts +0 -1
- package/dist/voice/tts.js +0 -1
- package/dist/watchers/evaluator.d.ts +0 -1
- package/dist/watchers/evaluator.js +25 -10
- package/dist/watchers/index.d.ts +0 -1
- package/dist/watchers/index.js +0 -1
- package/dist/watchers/scheduler.d.ts +0 -1
- package/dist/watchers/scheduler.js +3 -4
- package/dist/watchers/store.d.ts +0 -1
- package/dist/watchers/store.js +0 -1
- package/dist/watchers/types.d.ts +0 -1
- package/dist/watchers/types.js +0 -1
- package/package.json +26 -3
- package/dist/capabilities/index.d.ts.map +0 -1
- package/dist/capabilities/index.js.map +0 -1
- package/dist/capabilities/manager.d.ts.map +0 -1
- package/dist/capabilities/manager.js.map +0 -1
- package/dist/capabilities/packs.d.ts.map +0 -1
- package/dist/capabilities/packs.js.map +0 -1
- package/dist/capabilities/types.d.ts.map +0 -1
- package/dist/capabilities/types.js.map +0 -1
- package/dist/channels/command-handler.d.ts.map +0 -1
- package/dist/channels/command-handler.js.map +0 -1
- package/dist/channels/discord.d.ts.map +0 -1
- package/dist/channels/discord.js.map +0 -1
- package/dist/channels/index.d.ts.map +0 -1
- package/dist/channels/index.js.map +0 -1
- package/dist/channels/loader.d.ts.map +0 -1
- package/dist/channels/loader.js.map +0 -1
- package/dist/channels/registry.d.ts.map +0 -1
- package/dist/channels/registry.js.map +0 -1
- package/dist/channels/telegram.d.ts.map +0 -1
- package/dist/channels/telegram.js.map +0 -1
- package/dist/channels/types.d.ts.map +0 -1
- package/dist/channels/types.js.map +0 -1
- package/dist/channels/webhook.d.ts.map +0 -1
- package/dist/channels/webhook.js.map +0 -1
- package/dist/channels/whatsapp.d.ts.map +0 -1
- package/dist/channels/whatsapp.js.map +0 -1
- package/dist/cli/capabilities.d.ts.map +0 -1
- package/dist/cli/capabilities.js.map +0 -1
- package/dist/cli/channel.d.ts.map +0 -1
- package/dist/cli/channel.js.map +0 -1
- package/dist/cli/commands.d.ts.map +0 -1
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/doctor.d.ts.map +0 -1
- package/dist/cli/doctor.js.map +0 -1
- package/dist/cli/handoff.d.ts.map +0 -1
- package/dist/cli/handoff.js.map +0 -1
- package/dist/cli/helpers.d.ts.map +0 -1
- package/dist/cli/helpers.js.map +0 -1
- package/dist/cli/mcp.d.ts.map +0 -1
- package/dist/cli/mcp.js.map +0 -1
- package/dist/cli/media.d.ts.map +0 -1
- package/dist/cli/media.js.map +0 -1
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js.map +0 -1
- package/dist/cli/store.d.ts.map +0 -1
- package/dist/cli/store.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/daemon.d.ts.map +0 -1
- package/dist/daemon.js.map +0 -1
- package/dist/dashboard/html.d.ts.map +0 -1
- package/dist/dashboard/html.js.map +0 -1
- package/dist/dashboard/server.d.ts.map +0 -1
- package/dist/dashboard/server.js.map +0 -1
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations.d.ts.map +0 -1
- package/dist/db/migrations.js.map +0 -1
- package/dist/delegation/manager.d.ts.map +0 -1
- package/dist/delegation/manager.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/knowledge/index.d.ts.map +0 -1
- package/dist/knowledge/index.js.map +0 -1
- package/dist/knowledge/manager.d.ts.map +0 -1
- package/dist/knowledge/manager.js.map +0 -1
- package/dist/knowledge/types.d.ts.map +0 -1
- package/dist/knowledge/types.js.map +0 -1
- package/dist/machines/forwarder.d.ts +0 -7
- package/dist/machines/forwarder.d.ts.map +0 -1
- package/dist/machines/forwarder.js +0 -35
- package/dist/machines/forwarder.js.map +0 -1
- package/dist/machines/index.d.ts.map +0 -1
- package/dist/machines/index.js.map +0 -1
- package/dist/machines/registry.d.ts.map +0 -1
- package/dist/machines/registry.js.map +0 -1
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/media/factory.d.ts.map +0 -1
- package/dist/media/factory.js.map +0 -1
- package/dist/media/generators/dall-e.d.ts.map +0 -1
- package/dist/media/generators/dall-e.js.map +0 -1
- package/dist/media/generators/elevenlabs-music.d.ts.map +0 -1
- package/dist/media/generators/elevenlabs-music.js.map +0 -1
- package/dist/media/generators/elevenlabs-sfx.d.ts.map +0 -1
- package/dist/media/generators/elevenlabs-sfx.js.map +0 -1
- package/dist/media/generators/kling.d.ts.map +0 -1
- package/dist/media/generators/kling.js.map +0 -1
- package/dist/media/generators/lyria.d.ts.map +0 -1
- package/dist/media/generators/lyria.js.map +0 -1
- package/dist/media/generators/nano-banana.d.ts.map +0 -1
- package/dist/media/generators/nano-banana.js.map +0 -1
- package/dist/media/generators/recraft.d.ts.map +0 -1
- package/dist/media/generators/recraft.js.map +0 -1
- package/dist/media/generators/runway.d.ts.map +0 -1
- package/dist/media/generators/runway.js.map +0 -1
- package/dist/media/generators/stable-diffusion.d.ts.map +0 -1
- package/dist/media/generators/stable-diffusion.js.map +0 -1
- package/dist/media/generators/veo.d.ts.map +0 -1
- package/dist/media/generators/veo.js.map +0 -1
- package/dist/media/index.d.ts.map +0 -1
- package/dist/media/index.js.map +0 -1
- package/dist/media/loader.d.ts +0 -8
- package/dist/media/loader.d.ts.map +0 -1
- package/dist/media/loader.js +0 -46
- package/dist/media/loader.js.map +0 -1
- package/dist/media/store.d.ts.map +0 -1
- package/dist/media/store.js.map +0 -1
- package/dist/media/types.d.ts.map +0 -1
- package/dist/media/types.js.map +0 -1
- package/dist/memory/extractor.d.ts.map +0 -1
- package/dist/memory/extractor.js.map +0 -1
- package/dist/notifications/index.d.ts.map +0 -1
- package/dist/notifications/index.js.map +0 -1
- package/dist/notifications/ntfy.d.ts.map +0 -1
- package/dist/notifications/ntfy.js.map +0 -1
- package/dist/notifications/pushover.d.ts.map +0 -1
- package/dist/notifications/pushover.js.map +0 -1
- package/dist/notifications/types.d.ts.map +0 -1
- package/dist/notifications/types.js.map +0 -1
- package/dist/notifications/webhook-provider.d.ts.map +0 -1
- package/dist/notifications/webhook-provider.js.map +0 -1
- package/dist/observability/analytics.d.ts.map +0 -1
- package/dist/observability/analytics.js.map +0 -1
- package/dist/pipe/anthropic-client.d.ts.map +0 -1
- package/dist/pipe/anthropic-client.js.map +0 -1
- package/dist/pipe/brain.d.ts.map +0 -1
- package/dist/pipe/brain.js.map +0 -1
- package/dist/pipe/memory-store.d.ts.map +0 -1
- package/dist/pipe/memory-store.js.map +0 -1
- package/dist/pipe/project-scanner.d.ts.map +0 -1
- package/dist/pipe/project-scanner.js.map +0 -1
- package/dist/pipe/types.d.ts.map +0 -1
- package/dist/pipe/types.js.map +0 -1
- package/dist/projects/index.d.ts.map +0 -1
- package/dist/projects/index.js.map +0 -1
- package/dist/projects/manager.d.ts.map +0 -1
- package/dist/projects/manager.js.map +0 -1
- package/dist/projects/router.d.ts.map +0 -1
- package/dist/projects/router.js.map +0 -1
- package/dist/projects/types.d.ts.map +0 -1
- package/dist/projects/types.js.map +0 -1
- package/dist/service/install.d.ts.map +0 -1
- package/dist/service/install.js.map +0 -1
- package/dist/service/templates.d.ts.map +0 -1
- package/dist/service/templates.js.map +0 -1
- package/dist/service/windows.d.ts.map +0 -1
- package/dist/service/windows.js.map +0 -1
- package/dist/session/circuit-breaker.d.ts.map +0 -1
- package/dist/session/circuit-breaker.js.map +0 -1
- package/dist/session/context-monitor.d.ts.map +0 -1
- package/dist/session/context-monitor.js.map +0 -1
- package/dist/session/manager.d.ts.map +0 -1
- package/dist/session/manager.js.map +0 -1
- package/dist/session/subprocess.d.ts.map +0 -1
- package/dist/session/subprocess.js.map +0 -1
- package/dist/session/tool-classifier.d.ts.map +0 -1
- package/dist/session/tool-classifier.js.map +0 -1
- package/dist/tasks/scheduler.d.ts.map +0 -1
- package/dist/tasks/scheduler.js.map +0 -1
- package/dist/tasks/store.d.ts.map +0 -1
- package/dist/tasks/store.js.map +0 -1
- package/dist/timeline/index.d.ts.map +0 -1
- package/dist/timeline/index.js.map +0 -1
- package/dist/timeline/logger.d.ts.map +0 -1
- package/dist/timeline/logger.js.map +0 -1
- package/dist/timeline/query.d.ts.map +0 -1
- package/dist/timeline/query.js.map +0 -1
- package/dist/timeline/types.d.ts.map +0 -1
- package/dist/timeline/types.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/users/index.d.ts.map +0 -1
- package/dist/users/index.js.map +0 -1
- package/dist/users/service.d.ts.map +0 -1
- package/dist/users/service.js.map +0 -1
- package/dist/util/logger.d.ts.map +0 -1
- package/dist/util/logger.js.map +0 -1
- package/dist/util/paths.d.ts.map +0 -1
- package/dist/util/paths.js.map +0 -1
- package/dist/util/platform.d.ts.map +0 -1
- package/dist/util/platform.js.map +0 -1
- package/dist/util/progress.d.ts.map +0 -1
- package/dist/util/progress.js.map +0 -1
- package/dist/util/rate-limiter.d.ts.map +0 -1
- package/dist/util/rate-limiter.js.map +0 -1
- package/dist/util/retry.d.ts.map +0 -1
- package/dist/util/retry.js.map +0 -1
- package/dist/util/text.d.ts.map +0 -1
- package/dist/util/text.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/voice/index.d.ts.map +0 -1
- package/dist/voice/index.js.map +0 -1
- package/dist/voice/stt.d.ts.map +0 -1
- package/dist/voice/stt.js.map +0 -1
- package/dist/voice/tts.d.ts.map +0 -1
- package/dist/voice/tts.js.map +0 -1
- package/dist/watchers/evaluator.d.ts.map +0 -1
- package/dist/watchers/evaluator.js.map +0 -1
- package/dist/watchers/index.d.ts.map +0 -1
- package/dist/watchers/index.js.map +0 -1
- package/dist/watchers/scheduler.d.ts.map +0 -1
- package/dist/watchers/scheduler.js.map +0 -1
- package/dist/watchers/store.d.ts.map +0 -1
- package/dist/watchers/store.js.map +0 -1
- package/dist/watchers/types.d.ts.map +0 -1
- package/dist/watchers/types.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import TelegramBot from 'node-telegram-bot-api';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { chunkText, timeAgo, parseTabMessage
|
|
4
|
+
import { chunkText, timeAgo, parseTabMessage } from '../util/text.js';
|
|
5
5
|
import { logger } from '../util/logger.js';
|
|
6
6
|
import { retryWithBackoff } from '../util/retry.js';
|
|
7
7
|
import { getAdminUserId } from '../config.js';
|
|
8
8
|
import { getLogsDir } from '../util/paths.js';
|
|
9
9
|
import { saveMedia, isOversized } from '../media/store.js';
|
|
10
10
|
import { inboundLimiter, groupLimiter } from '../util/rate-limiter.js';
|
|
11
|
-
import {
|
|
11
|
+
import { processInboundMessage } from './pipeline.js';
|
|
12
12
|
import { initVoiceProviders } from '../voice/index.js';
|
|
13
13
|
const DEFAULT_GROUP_CONFIG = { activationMode: 'mention', maxResponsesPerMinute: 3, tabPerGroup: true };
|
|
14
14
|
/** Format tab status for Telegram display */
|
|
@@ -229,26 +229,10 @@ export class TelegramChannel {
|
|
|
229
229
|
const media = downloadResults
|
|
230
230
|
.filter((r) => r.status === 'fulfilled' && r.value !== null)
|
|
231
231
|
.map(r => r.value);
|
|
232
|
-
// Warm up STT connection on first voice message
|
|
233
|
-
if (this.sttProvider && !this.sttWarmedUp) {
|
|
234
|
-
this.sttProvider.warmup?.();
|
|
235
|
-
this.sttWarmedUp = true;
|
|
236
|
-
}
|
|
237
232
|
// Transcribe voice messages if STT is configured
|
|
238
233
|
if (this.sttProvider) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const voiceStartTime = Date.now();
|
|
242
|
-
try {
|
|
243
|
-
const transcription = await this.sttProvider.transcribe(m.filePath);
|
|
244
|
-
m.caption = `[Transcribed from voice message]: ${transcription}`;
|
|
245
|
-
logger.info(`[telegram] Voice transcription: ${Date.now() - voiceStartTime}ms`);
|
|
246
|
-
}
|
|
247
|
-
catch (err) {
|
|
248
|
-
logger.warn('Voice transcription failed, passing file path instead:', err);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
234
|
+
const { transcribeVoiceMessages } = await import('../voice/index.js');
|
|
235
|
+
this.sttWarmedUp = await transcribeVoiceMessages(media, this.sttProvider, 'telegram', this.sttWarmedUp);
|
|
252
236
|
}
|
|
253
237
|
// Skip if no text AND no media
|
|
254
238
|
if (!text && media.length === 0)
|
|
@@ -337,28 +321,17 @@ export class TelegramChannel {
|
|
|
337
321
|
await this.handleMessage(chatId, text, messageId);
|
|
338
322
|
}
|
|
339
323
|
async handleMessage(chatId, text, messageId, media = [], isGroup = false) {
|
|
340
|
-
|
|
341
|
-
if (!
|
|
324
|
+
const { tabName } = parseTabMessage(text);
|
|
325
|
+
if (!tabName && !text && media.length === 0)
|
|
342
326
|
return;
|
|
343
|
-
//
|
|
327
|
+
// Telegram-specific: group tab routing
|
|
328
|
+
let overrideTabName;
|
|
344
329
|
if (isGroup) {
|
|
345
330
|
const groupConfig = this.ctx.config.groups || DEFAULT_GROUP_CONFIG;
|
|
346
331
|
if (groupConfig.tabPerGroup && !text.startsWith('/tab ')) {
|
|
347
|
-
|
|
332
|
+
overrideTabName = `group-tg-${Math.abs(chatId)}`;
|
|
348
333
|
}
|
|
349
334
|
}
|
|
350
|
-
// Smart project routing (shared across all channels)
|
|
351
|
-
const { resolveProjectRoute } = await import('./command-handler.js');
|
|
352
|
-
const route = await resolveProjectRoute(rawPrompt, tabName, text, String(chatId));
|
|
353
|
-
if (route.confirmationMessage) {
|
|
354
|
-
await this.bot.sendMessage(chatId, route.confirmationMessage);
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
let effectiveTabName = route.effectiveTabName;
|
|
358
|
-
let projectPath = route.projectPath;
|
|
359
|
-
// Build prompt with media references
|
|
360
|
-
const prompt = buildMediaPrompt(media, rawPrompt);
|
|
361
|
-
logger.info(`[telegram] Handling message for tab "${effectiveTabName}" (chat: ${chatId}, msg: ${messageId})`);
|
|
362
335
|
// React with ⏳
|
|
363
336
|
await this.setReaction(chatId, messageId, '⏳');
|
|
364
337
|
// Typing indicator — keep refreshing every 4s
|
|
@@ -369,13 +342,14 @@ export class TelegramChannel {
|
|
|
369
342
|
const typingInterval = setInterval(sendTyping, 4000);
|
|
370
343
|
// "Still working" timeout
|
|
371
344
|
const stillWorkingTimeout = setTimeout(() => {
|
|
372
|
-
this.bot.sendMessage(chatId, `Still working on your request
|
|
345
|
+
this.bot.sendMessage(chatId, `Still working on your request...`).catch(() => { });
|
|
373
346
|
}, 120000);
|
|
374
347
|
try {
|
|
375
348
|
let responseText;
|
|
376
349
|
let responseError;
|
|
377
|
-
let responseTab
|
|
350
|
+
let responseTab;
|
|
378
351
|
if (this.ctx.pipeBrain) {
|
|
352
|
+
// PipeBrain path is Telegram-specific (not shared in pipeline)
|
|
379
353
|
const pipeResult = await this.ctx.pipeBrain.process(text, { chatId, userId: 0, messageId });
|
|
380
354
|
responseText = pipeResult.response.text || '(empty response)';
|
|
381
355
|
responseError = pipeResult.response.error;
|
|
@@ -386,9 +360,13 @@ export class TelegramChannel {
|
|
|
386
360
|
}
|
|
387
361
|
}
|
|
388
362
|
else {
|
|
363
|
+
// Telegram-specific: streaming message edits
|
|
389
364
|
let streamMsgId = null;
|
|
390
365
|
let streamBuffer = '';
|
|
391
366
|
let lastEditTime = 0;
|
|
367
|
+
// We need the effective tab name for the stream prefix, but it's determined
|
|
368
|
+
// inside the pipeline. Use a mutable ref that the pipeline result will fill.
|
|
369
|
+
let effectiveTabForStream = overrideTabName || tabName;
|
|
392
370
|
const onTextChunk = async (chunk) => {
|
|
393
371
|
streamBuffer += chunk;
|
|
394
372
|
const now = Date.now();
|
|
@@ -396,7 +374,7 @@ export class TelegramChannel {
|
|
|
396
374
|
return;
|
|
397
375
|
lastEditTime = now;
|
|
398
376
|
try {
|
|
399
|
-
const prefix =
|
|
377
|
+
const prefix = effectiveTabForStream !== 'default' ? `[${effectiveTabForStream}] ` : '';
|
|
400
378
|
const preview = prefix + streamBuffer.slice(0, 4000) + (streamBuffer.length > 4000 ? '...' : '');
|
|
401
379
|
if (!streamMsgId) {
|
|
402
380
|
const sent = await this.bot.sendMessage(chatId, preview);
|
|
@@ -408,59 +386,80 @@ export class TelegramChannel {
|
|
|
408
386
|
}
|
|
409
387
|
catch { /* edit failures are non-critical */ }
|
|
410
388
|
};
|
|
411
|
-
//
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
389
|
+
// Shared pipeline handles: routing, media prompt, progress, sendMessage, TTS
|
|
390
|
+
const pipelineResult = await processInboundMessage({
|
|
391
|
+
text,
|
|
392
|
+
media,
|
|
393
|
+
channelId: 'telegram',
|
|
394
|
+
tabManager: this.ctx.tabManager,
|
|
395
|
+
voiceReplyMode: this.ctx.config.voice?.replyMode,
|
|
396
|
+
ttsProvider: this.ttsProvider,
|
|
397
|
+
userId: String(chatId),
|
|
398
|
+
sendProgress: (msg) => {
|
|
399
|
+
this.bot.sendMessage(chatId, msg).catch(() => { });
|
|
400
|
+
},
|
|
401
|
+
overrideTabName,
|
|
416
402
|
onTextChunk,
|
|
417
|
-
onToolUse: (name, input) => progressTracker.record(name, input),
|
|
418
|
-
projectPath,
|
|
419
403
|
});
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
404
|
+
// Empty result means no prompt and no media
|
|
405
|
+
if (!pipelineResult.responseText) {
|
|
406
|
+
clearInterval(typingInterval);
|
|
407
|
+
clearTimeout(stillWorkingTimeout);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
// Update the effective tab for stream prefix (now known)
|
|
411
|
+
effectiveTabForStream = pipelineResult.tabName;
|
|
412
|
+
responseText = pipelineResult.responseText;
|
|
413
|
+
responseError = pipelineResult.isError;
|
|
414
|
+
responseTab = pipelineResult.tabName;
|
|
415
|
+
// Telegram-specific: if streaming was active and no error, edit the final message
|
|
423
416
|
if (streamMsgId && !responseError) {
|
|
424
417
|
clearInterval(typingInterval);
|
|
425
418
|
clearTimeout(stillWorkingTimeout);
|
|
426
419
|
await this.setReaction(chatId, messageId, '✅');
|
|
420
|
+
// Send voice if available (even with streaming)
|
|
421
|
+
if (pipelineResult.audioPath) {
|
|
422
|
+
await this.bot.sendVoice(chatId, pipelineResult.audioPath);
|
|
423
|
+
if (pipelineResult.voiceOnly)
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
427
426
|
try {
|
|
428
|
-
const prefix =
|
|
427
|
+
const prefix = responseTab !== 'default' ? `[${responseTab}] ` : '';
|
|
429
428
|
const finalText = prefix + responseText;
|
|
430
429
|
if (finalText.length <= 4096) {
|
|
431
430
|
await this.bot.editMessageText(finalText, { chat_id: chatId, message_id: streamMsgId });
|
|
432
431
|
}
|
|
433
432
|
else {
|
|
434
|
-
await this.sendResponse(chatId, responseText,
|
|
433
|
+
await this.sendResponse(chatId, responseText, responseTab);
|
|
435
434
|
}
|
|
436
435
|
}
|
|
437
436
|
catch {
|
|
438
|
-
await this.sendResponse(chatId, responseText,
|
|
437
|
+
await this.sendResponse(chatId, responseText, responseTab);
|
|
439
438
|
}
|
|
440
439
|
return;
|
|
441
440
|
}
|
|
441
|
+
// Send voice reply if TTS generated audio (non-streaming path)
|
|
442
|
+
if (pipelineResult.audioPath) {
|
|
443
|
+
clearInterval(typingInterval);
|
|
444
|
+
clearTimeout(stillWorkingTimeout);
|
|
445
|
+
await this.setReaction(chatId, messageId, responseError ? '❌' : '✅');
|
|
446
|
+
await this.bot.sendVoice(chatId, pipelineResult.audioPath);
|
|
447
|
+
if (pipelineResult.voiceOnly)
|
|
448
|
+
return;
|
|
449
|
+
if (!responseError) {
|
|
450
|
+
await this.sendResponse(chatId, responseText, responseTab);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
442
454
|
}
|
|
443
455
|
clearInterval(typingInterval);
|
|
444
456
|
clearTimeout(stillWorkingTimeout);
|
|
445
457
|
if (responseError) {
|
|
446
458
|
await this.setReaction(chatId, messageId, '❌');
|
|
447
|
-
await this.sendResponse(chatId,
|
|
459
|
+
await this.sendResponse(chatId, responseText, responseTab);
|
|
448
460
|
return;
|
|
449
461
|
}
|
|
450
462
|
await this.setReaction(chatId, messageId, '✅');
|
|
451
|
-
// TTS: send voice reply if configured
|
|
452
|
-
const voiceReplyMode = this.ctx.config.voice?.replyMode;
|
|
453
|
-
if (this.ttsProvider && (voiceReplyMode === 'voice' || voiceReplyMode === 'both')) {
|
|
454
|
-
try {
|
|
455
|
-
const audioPath = await this.ttsProvider.synthesize(responseText);
|
|
456
|
-
await this.bot.sendVoice(chatId, audioPath);
|
|
457
|
-
if (voiceReplyMode === 'voice')
|
|
458
|
-
return; // Don't send text
|
|
459
|
-
}
|
|
460
|
-
catch (err) {
|
|
461
|
-
logger.warn('TTS failed, sending text reply:', err);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
463
|
await this.sendResponse(chatId, responseText, responseTab);
|
|
465
464
|
}
|
|
466
465
|
catch (err) {
|
|
@@ -551,4 +550,3 @@ export class TelegramChannel {
|
|
|
551
550
|
}
|
|
552
551
|
}
|
|
553
552
|
}
|
|
554
|
-
//# sourceMappingURL=telegram.js.map
|
package/dist/channels/types.d.ts
CHANGED
package/dist/channels/types.js
CHANGED
package/dist/channels/webhook.js
CHANGED
|
@@ -2,9 +2,9 @@ import fs from 'node:fs';
|
|
|
2
2
|
import { logger } from '../util/logger.js';
|
|
3
3
|
import { saveMedia, isOversized } from '../media/store.js';
|
|
4
4
|
import { retryWithBackoff } from '../util/retry.js';
|
|
5
|
-
import { chunkText
|
|
5
|
+
import { chunkText } from '../util/text.js';
|
|
6
6
|
import { inboundLimiter } from '../util/rate-limiter.js';
|
|
7
|
-
import {
|
|
7
|
+
import { processInboundMessage } from './pipeline.js';
|
|
8
8
|
import { initVoiceProviders } from '../voice/index.js';
|
|
9
9
|
const WHATSAPP_MAX_LENGTH = 8192;
|
|
10
10
|
export class WhatsAppChannel {
|
|
@@ -145,26 +145,10 @@ export class WhatsAppChannel {
|
|
|
145
145
|
const media = waResults
|
|
146
146
|
.filter((r) => r.status === 'fulfilled' && r.value !== null)
|
|
147
147
|
.map(r => r.value);
|
|
148
|
-
// Warm up STT connection on first voice message
|
|
149
|
-
if (this.sttProvider && !this.sttWarmedUp) {
|
|
150
|
-
this.sttProvider.warmup?.();
|
|
151
|
-
this.sttWarmedUp = true;
|
|
152
|
-
}
|
|
153
148
|
// Transcribe voice messages if STT is configured
|
|
154
149
|
if (this.sttProvider) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const voiceStartTime = Date.now();
|
|
158
|
-
try {
|
|
159
|
-
const transcription = await this.sttProvider.transcribe(att.filePath);
|
|
160
|
-
att.caption = `[Transcribed from voice message]: ${transcription}`;
|
|
161
|
-
logger.info(`[whatsapp] Voice transcription: ${Date.now() - voiceStartTime}ms`);
|
|
162
|
-
}
|
|
163
|
-
catch (err) {
|
|
164
|
-
logger.warn('Voice transcription failed, passing file path instead:', err);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
150
|
+
const { transcribeVoiceMessages } = await import('../voice/index.js');
|
|
151
|
+
this.sttWarmedUp = await transcribeVoiceMessages(media, this.sttProvider, 'whatsapp', this.sttWarmedUp);
|
|
168
152
|
}
|
|
169
153
|
if (!text && media.length === 0)
|
|
170
154
|
return;
|
|
@@ -185,48 +169,31 @@ export class WhatsAppChannel {
|
|
|
185
169
|
return;
|
|
186
170
|
}
|
|
187
171
|
}
|
|
188
|
-
const { tabName, prompt: rawPrompt } = parseTabMessage(text);
|
|
189
|
-
if (!rawPrompt && media.length === 0)
|
|
190
|
-
return;
|
|
191
|
-
// Build prompt with media references
|
|
192
|
-
const prompt = buildMediaPrompt(media, rawPrompt);
|
|
193
|
-
// Smart project routing (shared across all channels)
|
|
194
|
-
const { resolveProjectRoute } = await import('./command-handler.js');
|
|
195
|
-
const route = await resolveProjectRoute(rawPrompt, tabName, text, waUserId);
|
|
196
|
-
if (route.confirmationMessage) {
|
|
197
|
-
await sock.sendMessage(sender, { text: route.confirmationMessage });
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
let effectiveTabName = route.effectiveTabName;
|
|
201
|
-
let projectPath = route.projectPath;
|
|
202
172
|
await sock.sendPresenceUpdate('composing', sender).catch(() => { });
|
|
203
|
-
//
|
|
204
|
-
const
|
|
205
|
-
|
|
173
|
+
// Shared message pipeline
|
|
174
|
+
const pipelineResult = await processInboundMessage({
|
|
175
|
+
text,
|
|
176
|
+
media,
|
|
177
|
+
channelId: 'whatsapp',
|
|
178
|
+
tabManager: this.ctx.tabManager,
|
|
179
|
+
voiceReplyMode: this.ctx.config.voice?.replyMode,
|
|
180
|
+
ttsProvider: this.ttsProvider,
|
|
181
|
+
userId: waUserId,
|
|
182
|
+
sendProgress: (msg) => {
|
|
183
|
+
sock.sendMessage(sender, { text: msg }).catch(() => { });
|
|
184
|
+
},
|
|
206
185
|
});
|
|
207
|
-
const result = await this.ctx.tabManager.sendMessage(effectiveTabName, prompt, {
|
|
208
|
-
onToolUse: (name, input) => progressTracker.record(name, input),
|
|
209
|
-
projectPath,
|
|
210
|
-
});
|
|
211
|
-
progressTracker.stop();
|
|
212
|
-
const responseText = result.error
|
|
213
|
-
? `Error: ${result.text}`
|
|
214
|
-
: result.text || '(empty response)';
|
|
215
186
|
await sock.sendPresenceUpdate('paused', sender).catch(() => { });
|
|
216
|
-
//
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
catch (err) {
|
|
226
|
-
logger.warn('TTS failed, sending text reply:', err);
|
|
227
|
-
}
|
|
187
|
+
// Empty result means no prompt and no media
|
|
188
|
+
if (!pipelineResult.responseText)
|
|
189
|
+
return;
|
|
190
|
+
// Send voice reply if TTS generated audio
|
|
191
|
+
if (pipelineResult.audioPath) {
|
|
192
|
+
await sock.sendMessage(sender, { audio: { url: pipelineResult.audioPath }, mimetype: 'audio/ogg; codecs=opus', ptt: true });
|
|
193
|
+
if (pipelineResult.voiceOnly)
|
|
194
|
+
return;
|
|
228
195
|
}
|
|
229
|
-
await this.sendResponse(sender, responseText,
|
|
196
|
+
await this.sendResponse(sender, pipelineResult.responseText, pipelineResult.tabName);
|
|
230
197
|
}
|
|
231
198
|
catch (err) {
|
|
232
199
|
logger.error('WhatsApp message handler error:', err);
|
|
@@ -300,4 +267,3 @@ export class WhatsAppChannel {
|
|
|
300
267
|
return this.allowedNumbers.has(number);
|
|
301
268
|
}
|
|
302
269
|
}
|
|
303
|
-
//# sourceMappingURL=whatsapp.js.map
|
package/dist/cli/capabilities.js
CHANGED
package/dist/cli/channel.d.ts
CHANGED
package/dist/cli/channel.js
CHANGED
|
@@ -174,7 +174,7 @@ npm publish
|
|
|
174
174
|
}
|
|
175
175
|
export function channelList() {
|
|
176
176
|
try {
|
|
177
|
-
const output = execSync('npm list -g --depth=0
|
|
177
|
+
const output = execSync('npm list -g --depth=0', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] });
|
|
178
178
|
const lines = output.split('\n').filter(line => line.includes(CHANNEL_PREFIX));
|
|
179
179
|
if (lines.length === 0) {
|
|
180
180
|
console.log('No community channels installed.');
|
|
@@ -191,4 +191,3 @@ export function channelList() {
|
|
|
191
191
|
console.log('No community channels installed.');
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
//# sourceMappingURL=channel.js.map
|
package/dist/cli/commands.d.ts
CHANGED
package/dist/cli/commands.js
CHANGED
|
@@ -119,8 +119,15 @@ export async function tailLogs(tabName) {
|
|
|
119
119
|
console.log(`No log file found: ${logFile}`);
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
if (process.platform === 'win32') {
|
|
123
|
+
// Windows: use PowerShell Get-Content -Wait
|
|
124
|
+
const child = spawn('powershell', ['-Command', `Get-Content -Path '${logFile}' -Tail 50 -Wait`], { stdio: 'inherit' });
|
|
125
|
+
process.on('SIGINT', () => child.kill());
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const child = spawn('tail', ['-f', '-n', '50', logFile], { stdio: 'inherit' });
|
|
129
|
+
process.on('SIGINT', () => child.kill());
|
|
130
|
+
}
|
|
124
131
|
}
|
|
125
132
|
export async function listCrons() {
|
|
126
133
|
requireDb();
|
|
@@ -260,4 +267,3 @@ export async function sendMessage(message) {
|
|
|
260
267
|
}
|
|
261
268
|
closeDb();
|
|
262
269
|
}
|
|
263
|
-
//# sourceMappingURL=commands.js.map
|
package/dist/cli/doctor.d.ts
CHANGED
package/dist/cli/doctor.js
CHANGED
|
@@ -8,7 +8,8 @@ export async function runDoctor() {
|
|
|
8
8
|
try {
|
|
9
9
|
const config = getConfig();
|
|
10
10
|
const bin = config.claudeCode?.bin || 'claude';
|
|
11
|
-
|
|
11
|
+
const whichCmd = process.platform === 'win32' ? 'where' : 'which';
|
|
12
|
+
execSync(`${whichCmd} ${bin}`, { encoding: 'utf-8' });
|
|
12
13
|
try {
|
|
13
14
|
const version = execSync(`${bin} --version 2>&1`, { encoding: 'utf-8' }).trim();
|
|
14
15
|
checks.push({ name: 'Claude Code', status: 'pass', message: `Found: ${version}` });
|
|
@@ -147,4 +148,3 @@ export async function runDoctor() {
|
|
|
147
148
|
if (fails > 0)
|
|
148
149
|
process.exit(1);
|
|
149
150
|
}
|
|
150
|
-
//# sourceMappingURL=doctor.js.map
|
package/dist/cli/handoff.d.ts
CHANGED
package/dist/cli/handoff.js
CHANGED
package/dist/cli/helpers.d.ts
CHANGED
package/dist/cli/helpers.js
CHANGED
package/dist/cli/mcp.d.ts
CHANGED
package/dist/cli/mcp.js
CHANGED
package/dist/cli/media.d.ts
CHANGED
package/dist/cli/media.js
CHANGED
package/dist/cli/setup.d.ts
CHANGED
package/dist/cli/setup.js
CHANGED
|
@@ -19,7 +19,8 @@ function ask(rl, question, defaultValue) {
|
|
|
19
19
|
}
|
|
20
20
|
function findClaudeBin() {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
const cmd = process.platform === 'win32' ? 'where claude' : 'which claude';
|
|
23
|
+
return execSync(cmd, { encoding: 'utf-8' }).trim().split('\n')[0];
|
|
23
24
|
}
|
|
24
25
|
catch {
|
|
25
26
|
return 'claude';
|
|
@@ -48,7 +49,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
48
49
|
console.log(' You can continue setup now and install Claude Code afterwards.');
|
|
49
50
|
console.log(' Beecork will remind you at the end.');
|
|
50
51
|
console.log('');
|
|
51
|
-
console.log(' Guide: https://
|
|
52
|
+
console.log(' Guide: https://github.com/beecork/beecork/blob/main/docs/getting-started.md#prerequisites');
|
|
52
53
|
}
|
|
53
54
|
console.log('');
|
|
54
55
|
// 1. Telegram token with step-by-step instructions
|
|
@@ -65,7 +66,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
65
66
|
console.log(' 5. Choose a username ending in "bot" (e.g., "mybeecork_bot")');
|
|
66
67
|
console.log(' 6. BotFather will reply with a token — copy it');
|
|
67
68
|
console.log('');
|
|
68
|
-
console.log(' Detailed guide: https://
|
|
69
|
+
console.log(' Detailed guide: https://github.com/beecork/beecork/blob/main/docs/getting-started.md\n');
|
|
69
70
|
let token = '';
|
|
70
71
|
while (!token) {
|
|
71
72
|
token = await ask(rl, 'Paste your Telegram Bot token');
|
|
@@ -100,7 +101,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
100
101
|
console.log(' 2. Tap "Start" and send it any message');
|
|
101
102
|
console.log(' 3. It replies with your user ID (a number like 123456789)');
|
|
102
103
|
console.log('');
|
|
103
|
-
console.log(' Detailed guide: https://
|
|
104
|
+
console.log(' Detailed guide: https://github.com/beecork/beecork/blob/main/docs/getting-started.md\n');
|
|
104
105
|
const userIdStr = await ask(rl, 'Your Telegram user ID');
|
|
105
106
|
const userId = parseInt(userIdStr, 10);
|
|
106
107
|
if (isNaN(userId)) {
|
|
@@ -126,7 +127,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
126
127
|
console.log(' and screen. This lets Beecork use any app on your computer — browsers,');
|
|
127
128
|
console.log(' spreadsheets, design tools, internal dashboards. Powerful but requires');
|
|
128
129
|
console.log(' granting screen recording and accessibility permissions.');
|
|
129
|
-
console.log(' Guide: https://
|
|
130
|
+
console.log(' Guide: https://github.com/beecork/beecork/blob/main/docs/troubleshooting.md\n');
|
|
130
131
|
enableComputerUse = await ask(rl, 'Enable computer use? (y/n)', 'n');
|
|
131
132
|
// 6. Anthropic API key (optional - enables intelligent pipe)
|
|
132
133
|
console.log('\n Intelligent routing (optional): Beecork can route messages to the right');
|
|
@@ -191,7 +192,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
191
192
|
console.log(' 5. Under Bot → enable "Message Content Intent"');
|
|
192
193
|
console.log(' 6. Use OAuth2 URL Generator to invite bot to your server');
|
|
193
194
|
console.log('');
|
|
194
|
-
console.log(' Detailed guide: https://
|
|
195
|
+
console.log(' Detailed guide: https://github.com/beecork/beecork/blob/main/docs/getting-started.md\n');
|
|
195
196
|
const discordToken = await ask(rl, 'Discord bot token (or press Enter to skip)');
|
|
196
197
|
if (discordToken) {
|
|
197
198
|
const discordUserId = await ask(rl, 'Your Discord user ID (right-click your name → Copy User ID)');
|
|
@@ -212,7 +213,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
212
213
|
console.log(' Note: This uses reverse-engineered WhatsApp Web protocol.');
|
|
213
214
|
console.log(' For personal use only — not officially supported by WhatsApp.');
|
|
214
215
|
console.log('');
|
|
215
|
-
console.log(' Guide: https://
|
|
216
|
+
console.log(' Guide: https://github.com/beecork/beecork/blob/main/docs/getting-started.md\n');
|
|
216
217
|
const waNumber = await ask(rl, 'Your WhatsApp phone number (e.g., 14155551234)');
|
|
217
218
|
if (waNumber) {
|
|
218
219
|
config.whatsapp = {
|
|
@@ -363,7 +364,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
363
364
|
console.log(`✓ ${cap.packId} enabled`);
|
|
364
365
|
}
|
|
365
366
|
catch (err) {
|
|
366
|
-
console.log(`⚠ Failed to enable ${cap.packId}: ${err.message}`);
|
|
367
|
+
console.log(`⚠ Failed to enable ${cap.packId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
367
368
|
}
|
|
368
369
|
}
|
|
369
370
|
}
|
|
@@ -398,7 +399,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
398
399
|
console.log('');
|
|
399
400
|
console.log(' You also need a Claude Pro or Max subscription ($20/month).');
|
|
400
401
|
console.log(' Sign up at: https://claude.ai');
|
|
401
|
-
console.log(' Guide: https://
|
|
402
|
+
console.log(' Guide: https://github.com/beecork/beecork/blob/main/docs/getting-started.md#prerequisites');
|
|
402
403
|
console.log('');
|
|
403
404
|
}
|
|
404
405
|
console.log(' Next steps:');
|
|
@@ -420,7 +421,7 @@ export async function setupWizard(mode = 'quick') {
|
|
|
420
421
|
console.log(' beecork setup --full — full guided setup');
|
|
421
422
|
console.log('');
|
|
422
423
|
}
|
|
423
|
-
console.log(' Need help? https://
|
|
424
|
+
console.log(' Need help? https://github.com/beecork/beecork/blob/main/docs/troubleshooting.md\n');
|
|
424
425
|
}
|
|
425
426
|
finally {
|
|
426
427
|
rl.close();
|
|
@@ -515,4 +516,3 @@ function injectClaudeMd() {
|
|
|
515
516
|
content = content + '\n\n' + BEECORK_CLAUDE_MD + '\n';
|
|
516
517
|
fs.writeFileSync(claudeMdPath, content);
|
|
517
518
|
}
|
|
518
|
-
//# sourceMappingURL=setup.js.map
|
package/dist/cli/store.d.ts
CHANGED
package/dist/cli/store.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -5,4 +5,3 @@ export declare function getTabConfig(tabName: string): TabConfig;
|
|
|
5
5
|
export declare function resolveWorkingDir(tabName: string): string;
|
|
6
6
|
export declare function getAdminUserId(): number;
|
|
7
7
|
export declare function validateTabName(name: string): string | null;
|
|
8
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.js
CHANGED
package/dist/daemon.d.ts
CHANGED