beecork 1.3.0 → 1.3.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.
- 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 +25 -2
- 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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Beecork
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/beecork/beecork/main/logos/horizontal.svg" alt="Beecork" width="400">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Claude Code, always on. Reachable from anywhere.</strong>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/beecork"><img src="https://img.shields.io/npm/v/beecork" alt="npm version"></a>
|
|
11
|
+
<a href="https://github.com/beecork/beecork/actions"><img src="https://github.com/beecork/beecork/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/npm/l/beecork" alt="License"></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Beecork is infrastructure for Claude Code. It gives Claude Code a phone number, a memory, and an alarm clock.
|
|
18
|
+
|
|
19
|
+
Message Claude Code from Telegram at 2am — it wakes up, does the work, messages you back. Or schedule it to wake itself up every Monday, check something, act on it, and go back to sleep. All without sitting at a terminal.
|
|
20
|
+
|
|
21
|
+
## What It Does
|
|
22
|
+
|
|
23
|
+
- **Messaging channels** — Telegram, WhatsApp, Discord. Send a message, get a response.
|
|
24
|
+
- **Virtual tabs** — Persistent Claude Code sessions with context that survives restarts.
|
|
25
|
+
- **Task scheduling** — Tell Claude Code to set up recurring tasks via MCP tools — it wakes up, runs the task, reports back.
|
|
26
|
+
- **Memory** — Cross-session memory so Claude Code never loses context.
|
|
27
|
+
- **MCP server** — 38 tools Claude Code can call to manage tabs, memory, cron jobs, watchers, media, projects, and more.
|
|
28
|
+
- **Smart routing** — Pipe brain routes messages to the right tab, tracks goals, learns from your usage.
|
|
29
|
+
- **Background service** — Runs as a launchd (macOS), systemd (Linux), or Task Scheduler (Windows) service. Starts on login, runs silently.
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Install
|
|
35
|
+
npm install -g beecork
|
|
36
|
+
|
|
37
|
+
# Interactive setup (Telegram token, Claude Code path, background service)
|
|
38
|
+
beecork setup
|
|
39
|
+
|
|
40
|
+
# Start
|
|
41
|
+
beecork start
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then message your Telegram bot. Claude Code handles the rest.
|
|
45
|
+
|
|
46
|
+
See [Getting Started](https://github.com/beecork/beecork/blob/main/docs/getting-started.md) for the full walkthrough.
|
|
47
|
+
|
|
48
|
+
## CLI
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Core
|
|
52
|
+
beecork start # Start the daemon
|
|
53
|
+
beecork stop # Stop the daemon
|
|
54
|
+
beecork status # Check if running
|
|
55
|
+
beecork setup # Interactive setup wizard
|
|
56
|
+
beecork setup --full # Full setup with all options
|
|
57
|
+
beecork doctor # Diagnose common issues
|
|
58
|
+
beecork update # Update to latest version
|
|
59
|
+
beecork quickstart # Print getting-started checklist
|
|
60
|
+
|
|
61
|
+
# Tabs & Messages
|
|
62
|
+
beecork tabs # List active tabs
|
|
63
|
+
beecork send <msg> # Send a message to the default tab
|
|
64
|
+
beecork logs # Tail daemon logs
|
|
65
|
+
beecork export <tab> # Export tab for terminal handoff
|
|
66
|
+
beecork attach <tab> # Attach to a running tab
|
|
67
|
+
|
|
68
|
+
# Scheduling & Watchers
|
|
69
|
+
beecork tasks list # List scheduled tasks
|
|
70
|
+
beecork tasks delete <id> # Delete a task
|
|
71
|
+
beecork watches # List active watchers
|
|
72
|
+
beecork watch delete <id> # Delete a watcher
|
|
73
|
+
|
|
74
|
+
# Memory & Knowledge
|
|
75
|
+
beecork memory list # List stored memories
|
|
76
|
+
beecork memory delete <id> # Delete a memory
|
|
77
|
+
beecork knowledge # View stored knowledge
|
|
78
|
+
|
|
79
|
+
# Channels & Integrations
|
|
80
|
+
beecork discord # Set up Discord bot
|
|
81
|
+
beecork whatsapp # Set up WhatsApp
|
|
82
|
+
beecork webhook # Set up webhook endpoint
|
|
83
|
+
beecork enable <cap> # Enable a capability (email, github, calendar, etc.)
|
|
84
|
+
beecork disable <cap> # Disable a capability
|
|
85
|
+
beecork capabilities # List available capabilities
|
|
86
|
+
|
|
87
|
+
# Tools
|
|
88
|
+
beecork dashboard # Open the web dashboard
|
|
89
|
+
beecork mcp list # List MCP server configs
|
|
90
|
+
beecork media setup # Configure media generators
|
|
91
|
+
beecork activity # View activity summary
|
|
92
|
+
beecork history # Show activity timeline
|
|
93
|
+
beecork projects # List discovered projects
|
|
94
|
+
beecork machines # List registered machines
|
|
95
|
+
beecork templates # List tab templates
|
|
96
|
+
beecork store search <q> # Search community extensions
|
|
97
|
+
beecork store install <p> # Install a community package
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Tasks, watchers, and memories are created by Claude Code itself via MCP tools — just tell it what you need in natural language. The CLI is for viewing and managing them.
|
|
101
|
+
|
|
102
|
+
Run `beecork --help` for the full list of commands.
|
|
103
|
+
|
|
104
|
+
## Deploy Anywhere
|
|
105
|
+
|
|
106
|
+
| Setup | Best For |
|
|
107
|
+
|-------|----------|
|
|
108
|
+
| **Local machine** | Tasks that need local files, Xcode projects, local apps |
|
|
109
|
+
| **VPS** | Always-on — web scraping, monitoring, API calls, server management. Requires a full OS environment (Node.js, Claude Code CLI, system service). |
|
|
110
|
+
| **[Beecork Cloud](https://beecork.com/cloud)** | Zero setup — a full cloud computer with everything pre-configured. No terminal, no installation. |
|
|
111
|
+
|
|
112
|
+
Local install is `npm install -g beecork`. VPS requires the same plus a properly configured server environment. Beecork Cloud handles all of that for you.
|
|
113
|
+
|
|
114
|
+
## Architecture
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Telegram/WhatsApp/Discord
|
|
118
|
+
|
|
|
119
|
+
Pipe Brain (intelligent routing)
|
|
120
|
+
|
|
|
121
|
+
Daemon (always-on)
|
|
122
|
+
|
|
|
123
|
+
TabManager
|
|
124
|
+
|
|
|
125
|
+
Claude Code subprocess (persistent sessions)
|
|
126
|
+
|
|
|
127
|
+
MCP Server <-> SQLite (memory, state)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Community
|
|
131
|
+
|
|
132
|
+
- [Discord](https://discord.gg/wEM9avTzb) — Chat, ask questions, share what you've built
|
|
133
|
+
- [Twitter/X](https://x.com/BeecorkAI) — Updates, demos, announcements
|
|
134
|
+
- [GitHub Discussions](https://github.com/beecork/beecork/discussions) — Feature ideas, Q&A
|
|
135
|
+
|
|
136
|
+
## Documentation
|
|
137
|
+
|
|
138
|
+
- [Getting Started](https://github.com/beecork/beecork/blob/main/docs/getting-started.md) — Full setup walkthrough
|
|
139
|
+
- [Use Cases](https://github.com/beecork/beecork/blob/main/docs/use-cases.md) — What you can build with Beecork
|
|
140
|
+
- [Troubleshooting](https://github.com/beecork/beecork/blob/main/docs/troubleshooting.md) — Common issues and fixes
|
|
141
|
+
- [Comparison](https://github.com/beecork/beecork/blob/main/docs/comparison.md) — How Beecork compares to alternatives
|
|
142
|
+
- [Contributing](https://github.com/beecork/beecork/blob/main/CONTRIBUTING.md) — How to contribute
|
|
143
|
+
- [Security](https://github.com/beecork/beecork/blob/main/SECURITY.md) — Reporting vulnerabilities
|
|
144
|
+
|
|
145
|
+
## Requirements
|
|
146
|
+
|
|
147
|
+
- Node.js 18+
|
|
148
|
+
- Claude Code CLI (`npm install -g @anthropic-ai/claude-code`)
|
|
149
|
+
- Claude Pro or Max subscription
|
|
150
|
+
- Telegram account (for the bot)
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
[MIT](https://github.com/beecork/beecork/blob/main/LICENSE)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export type { CapabilityPack, EnabledCapability } from './types.js';
|
|
2
2
|
export { CAPABILITY_PACKS } from './packs.js';
|
|
3
3
|
export { getAvailablePacks, getEnabledCapabilities, isEnabled, enablePack, disablePack, updateMcpConfig } from './manager.js';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -11,4 +11,3 @@ export declare function enablePack(packId: string, apiKey?: string): void;
|
|
|
11
11
|
export declare function disablePack(packId: string): void;
|
|
12
12
|
/** Regenerate MCP config based on enabled capabilities */
|
|
13
13
|
export declare function updateMcpConfig(): void;
|
|
14
|
-
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -13,7 +13,7 @@ export const CAPABILITY_PACKS = [
|
|
|
13
13
|
requiresApiKey: true,
|
|
14
14
|
apiKeyHint: 'Google OAuth credentials (follow the setup guide)',
|
|
15
15
|
apiKeyEnvVar: 'GOOGLE_OAUTH_CREDENTIALS',
|
|
16
|
-
setupUrl: 'https://
|
|
16
|
+
setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
id: 'calendar',
|
|
@@ -28,7 +28,7 @@ export const CAPABILITY_PACKS = [
|
|
|
28
28
|
requiresApiKey: true,
|
|
29
29
|
apiKeyHint: 'Google OAuth credentials (same as email if already set up)',
|
|
30
30
|
apiKeyEnvVar: 'GOOGLE_OAUTH_CREDENTIALS',
|
|
31
|
-
setupUrl: 'https://
|
|
31
|
+
setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: 'notion',
|
|
@@ -44,7 +44,7 @@ export const CAPABILITY_PACKS = [
|
|
|
44
44
|
requiresApiKey: true,
|
|
45
45
|
apiKeyHint: 'Notion integration token (from notion.so/my-integrations)',
|
|
46
46
|
apiKeyEnvVar: 'NOTION_API_KEY',
|
|
47
|
-
setupUrl: 'https://
|
|
47
|
+
setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
id: 'drive',
|
|
@@ -59,7 +59,7 @@ export const CAPABILITY_PACKS = [
|
|
|
59
59
|
requiresApiKey: true,
|
|
60
60
|
apiKeyHint: 'Google OAuth credentials',
|
|
61
61
|
apiKeyEnvVar: 'GOOGLE_OAUTH_CREDENTIALS',
|
|
62
|
-
setupUrl: 'https://
|
|
62
|
+
setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
|
|
63
63
|
},
|
|
64
64
|
// Development
|
|
65
65
|
{
|
|
@@ -76,7 +76,7 @@ export const CAPABILITY_PACKS = [
|
|
|
76
76
|
requiresApiKey: true,
|
|
77
77
|
apiKeyHint: 'GitHub personal access token (from github.com/settings/tokens)',
|
|
78
78
|
apiKeyEnvVar: 'GITHUB_TOKEN',
|
|
79
|
-
setupUrl: 'https://
|
|
79
|
+
setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
|
|
80
80
|
},
|
|
81
81
|
// Data
|
|
82
82
|
{
|
|
@@ -92,7 +92,7 @@ export const CAPABILITY_PACKS = [
|
|
|
92
92
|
requiresApiKey: true,
|
|
93
93
|
apiKeyHint: 'PostgreSQL connection string (e.g., postgresql://user:pass@host:5432/db)',
|
|
94
94
|
apiKeyEnvVar: 'DATABASE_URL',
|
|
95
|
-
setupUrl: 'https://
|
|
95
|
+
setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
|
|
96
96
|
},
|
|
97
97
|
// Web
|
|
98
98
|
{
|
|
@@ -106,7 +106,6 @@ export const CAPABILITY_PACKS = [
|
|
|
106
106
|
args: ['-y', '@anthropic/web-search-mcp'],
|
|
107
107
|
},
|
|
108
108
|
requiresApiKey: false,
|
|
109
|
-
setupUrl: 'https://
|
|
109
|
+
setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
|
|
110
110
|
},
|
|
111
111
|
];
|
|
112
|
-
//# sourceMappingURL=packs.js.map
|
|
@@ -25,4 +25,3 @@ export declare function handleSharedCommand(ctx: CommandContext, tabManager: Tab
|
|
|
25
25
|
* Extracted from the identical blocks in Telegram, WhatsApp, and Discord channels.
|
|
26
26
|
*/
|
|
27
27
|
export declare function resolveProjectRoute(rawPrompt: string, tabName: string, text: string, userId: string): Promise<RouteResult>;
|
|
28
|
-
//# sourceMappingURL=command-handler.d.ts.map
|
package/dist/channels/discord.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { logger } from '../util/logger.js';
|
|
2
|
-
import { chunkText, parseTabMessage
|
|
2
|
+
import { chunkText, parseTabMessage } from '../util/text.js';
|
|
3
3
|
import { retryWithBackoff } from '../util/retry.js';
|
|
4
4
|
import { inboundLimiter } from '../util/rate-limiter.js';
|
|
5
5
|
import { saveMedia, isOversized } from '../media/store.js';
|
|
6
6
|
import { initVoiceProviders } from '../voice/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { processInboundMessage } from './pipeline.js';
|
|
8
8
|
export class DiscordChannel {
|
|
9
9
|
id = 'discord';
|
|
10
10
|
name = 'Discord';
|
|
@@ -107,10 +107,8 @@ export class DiscordChannel {
|
|
|
107
107
|
try {
|
|
108
108
|
// Show typing
|
|
109
109
|
await message.channel.sendTyping().catch(() => { });
|
|
110
|
-
// Parse tab name
|
|
111
|
-
const { tabName
|
|
112
|
-
if (!prompt && media.length === 0)
|
|
113
|
-
return;
|
|
110
|
+
// Parse tab name (needed for command handling check)
|
|
111
|
+
const { tabName } = parseTabMessage(text || '');
|
|
114
112
|
// Shared command handler
|
|
115
113
|
if (text.startsWith('/')) {
|
|
116
114
|
const { handleSharedCommand } = await import('./command-handler.js');
|
|
@@ -126,61 +124,47 @@ export class DiscordChannel {
|
|
|
126
124
|
return;
|
|
127
125
|
}
|
|
128
126
|
}
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
// Use thread name as tab if in a thread (sanitize to valid tab name)
|
|
132
|
-
let effectiveTab = tabName;
|
|
133
|
-
let projectPath;
|
|
127
|
+
// Discord-specific: use thread name as tab if in a thread
|
|
128
|
+
let overrideTabName;
|
|
134
129
|
if (message.channel.isThread?.()) {
|
|
135
130
|
const threadName = (message.channel.name || '')
|
|
136
131
|
.replace(/[^a-zA-Z0-9-]/g, '-')
|
|
137
132
|
.replace(/^-+|-+$/g, '')
|
|
138
133
|
.slice(0, 32);
|
|
139
|
-
if (threadName)
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
// Smart project routing (shared across all channels)
|
|
143
|
-
const { resolveProjectRoute } = await import('./command-handler.js');
|
|
144
|
-
const route = await resolveProjectRoute(prompt || '', effectiveTab, text, message.author.id);
|
|
145
|
-
if (route.confirmationMessage) {
|
|
146
|
-
await message.reply(route.confirmationMessage);
|
|
147
|
-
return;
|
|
134
|
+
if (threadName && tabName === 'default')
|
|
135
|
+
overrideTabName = threadName;
|
|
148
136
|
}
|
|
149
|
-
effectiveTab = route.effectiveTabName;
|
|
150
|
-
projectPath = route.projectPath;
|
|
151
137
|
// Typing indicator refresh
|
|
152
138
|
const typingInterval = setInterval(() => {
|
|
153
139
|
message.channel.sendTyping().catch(() => { });
|
|
154
140
|
}, 8000); // Discord typing lasts 10s
|
|
155
141
|
try {
|
|
156
|
-
//
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
142
|
+
// Shared message pipeline
|
|
143
|
+
const pipelineResult = await processInboundMessage({
|
|
144
|
+
text: text || '',
|
|
145
|
+
media,
|
|
146
|
+
channelId: 'discord',
|
|
147
|
+
tabManager: this.ctx.tabManager,
|
|
148
|
+
voiceReplyMode: this.ctx.config.voice?.replyMode,
|
|
149
|
+
ttsProvider: this.ttsProvider,
|
|
150
|
+
userId: message.author.id,
|
|
151
|
+
sendProgress: (msg) => {
|
|
152
|
+
message.channel.send(msg).catch(() => { });
|
|
153
|
+
},
|
|
154
|
+
overrideTabName,
|
|
163
155
|
});
|
|
164
|
-
progressTracker.stop();
|
|
165
156
|
clearInterval(typingInterval);
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
// Voice reply if
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
await message.reply({ files: [audioPath] });
|
|
175
|
-
if (voiceMode === 'voice')
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
catch (err) {
|
|
179
|
-
logger.warn('Discord TTS failed:', err);
|
|
180
|
-
}
|
|
157
|
+
// Empty result means no prompt and no media
|
|
158
|
+
if (!pipelineResult.responseText)
|
|
159
|
+
return;
|
|
160
|
+
// Voice reply if TTS generated audio
|
|
161
|
+
if (pipelineResult.audioPath) {
|
|
162
|
+
await message.reply({ files: [pipelineResult.audioPath] });
|
|
163
|
+
if (pipelineResult.voiceOnly)
|
|
164
|
+
return;
|
|
181
165
|
}
|
|
182
166
|
// Send text response
|
|
183
|
-
await this.sendResponse(message, responseText,
|
|
167
|
+
await this.sendResponse(message, pipelineResult.responseText, pipelineResult.tabName);
|
|
184
168
|
}
|
|
185
169
|
catch (err) {
|
|
186
170
|
clearInterval(typingInterval);
|
|
@@ -263,4 +247,3 @@ export class DiscordChannel {
|
|
|
263
247
|
}
|
|
264
248
|
}
|
|
265
249
|
}
|
|
266
|
-
//# sourceMappingURL=discord.js.map
|
package/dist/channels/index.d.ts
CHANGED
|
@@ -5,4 +5,3 @@ export { WebhookChannel } from './webhook.js';
|
|
|
5
5
|
export { DiscordChannel } from './discord.js';
|
|
6
6
|
export { loadCommunityChannels } from './loader.js';
|
|
7
7
|
export type { Channel, ChannelContext, InboundMessage, InboundMessageHandler, MediaAttachment, SendOptions } from './types.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/channels/index.js
CHANGED
package/dist/channels/loader.js
CHANGED
|
@@ -9,6 +9,10 @@ const CHANNEL_PREFIX = 'beecork-channel-';
|
|
|
9
9
|
*/
|
|
10
10
|
export async function loadCommunityChannels(ctx) {
|
|
11
11
|
const channels = [];
|
|
12
|
+
// Require explicit opt-in via config to prevent supply-chain attacks
|
|
13
|
+
const allowlist = ctx.config.communityChannels;
|
|
14
|
+
if (!allowlist || allowlist.length === 0)
|
|
15
|
+
return channels;
|
|
12
16
|
// Look in global and local node_modules
|
|
13
17
|
const searchPaths = [
|
|
14
18
|
path.join(process.cwd(), 'node_modules'),
|
|
@@ -31,6 +35,8 @@ export async function loadCommunityChannels(ctx) {
|
|
|
31
35
|
for (const dir of dirs) {
|
|
32
36
|
if (!dir.startsWith(CHANNEL_PREFIX))
|
|
33
37
|
continue;
|
|
38
|
+
if (!allowlist.includes(dir))
|
|
39
|
+
continue;
|
|
34
40
|
const channelName = dir.slice(CHANNEL_PREFIX.length);
|
|
35
41
|
const pkgPath = path.join(searchPath, dir);
|
|
36
42
|
try {
|
|
@@ -70,4 +76,3 @@ export async function loadCommunityChannels(ctx) {
|
|
|
70
76
|
}
|
|
71
77
|
return channels;
|
|
72
78
|
}
|
|
73
|
-
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { MediaAttachment } from './types.js';
|
|
2
|
+
import type { TabManager } from '../session/manager.js';
|
|
3
|
+
import type { TTSProvider } from '../voice/tts.js';
|
|
4
|
+
export interface PipelineOptions {
|
|
5
|
+
/** Raw message text (may include /tab prefix) */
|
|
6
|
+
text: string;
|
|
7
|
+
/** Downloaded media attachments */
|
|
8
|
+
media: MediaAttachment[];
|
|
9
|
+
/** Channel identifier for logging */
|
|
10
|
+
channelId: string;
|
|
11
|
+
/** Tab manager instance */
|
|
12
|
+
tabManager: TabManager;
|
|
13
|
+
/** Voice reply mode from config */
|
|
14
|
+
voiceReplyMode?: 'voice' | 'both' | 'text';
|
|
15
|
+
/** TTS provider (if configured) */
|
|
16
|
+
ttsProvider?: TTSProvider | null;
|
|
17
|
+
/** User ID for project routing */
|
|
18
|
+
userId: string;
|
|
19
|
+
/** Callback to send progress messages to the user */
|
|
20
|
+
sendProgress: (message: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Override the tab name (e.g., group tabs in Telegram, thread tabs in Discord).
|
|
23
|
+
* When set, parseTabMessage result is ignored for the tab name.
|
|
24
|
+
*/
|
|
25
|
+
overrideTabName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Callback invoked on each text chunk from Claude (for streaming).
|
|
28
|
+
* Only Telegram uses this currently.
|
|
29
|
+
*/
|
|
30
|
+
onTextChunk?: (chunk: string) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface PipelineResult {
|
|
33
|
+
/** The final response text (already includes "Error: " prefix on errors) */
|
|
34
|
+
responseText: string;
|
|
35
|
+
/** The tab name that was actually used */
|
|
36
|
+
tabName: string;
|
|
37
|
+
/** Whether the response was an error */
|
|
38
|
+
isError: boolean;
|
|
39
|
+
/** Path to TTS audio file, if voice reply was generated */
|
|
40
|
+
audioPath?: string;
|
|
41
|
+
/** Whether voice-only mode is active (caller should skip text response) */
|
|
42
|
+
voiceOnly?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Process an inbound message through the shared pipeline.
|
|
46
|
+
*
|
|
47
|
+
* Returns the response text and optional audio path. The caller (channel)
|
|
48
|
+
* is responsible for delivering the response using its platform API.
|
|
49
|
+
*/
|
|
50
|
+
export declare function processInboundMessage(opts: PipelineOptions): Promise<PipelineResult>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared message-processing pipeline for all channels.
|
|
3
|
+
*
|
|
4
|
+
* Handles the common flow: project routing -> media prompt building ->
|
|
5
|
+
* tab message sending -> progress tracking -> TTS voice reply.
|
|
6
|
+
*
|
|
7
|
+
* Each channel remains responsible for:
|
|
8
|
+
* - Platform-specific message parsing and media download
|
|
9
|
+
* - Typing indicators (passed as a callback)
|
|
10
|
+
* - Sending the final response via its own API
|
|
11
|
+
* - Any channel-specific features (Telegram streaming, Discord threads, etc.)
|
|
12
|
+
*/
|
|
13
|
+
import { parseTabMessage, buildMediaPrompt } from '../util/text.js';
|
|
14
|
+
import { ProgressTracker } from '../util/progress.js';
|
|
15
|
+
import { logger } from '../util/logger.js';
|
|
16
|
+
/**
|
|
17
|
+
* Process an inbound message through the shared pipeline.
|
|
18
|
+
*
|
|
19
|
+
* Returns the response text and optional audio path. The caller (channel)
|
|
20
|
+
* is responsible for delivering the response using its platform API.
|
|
21
|
+
*/
|
|
22
|
+
export async function processInboundMessage(opts) {
|
|
23
|
+
const { text, media, channelId, tabManager, voiceReplyMode, ttsProvider, userId, sendProgress, overrideTabName, onTextChunk, } = opts;
|
|
24
|
+
// 1. Parse tab name and prompt from the message text
|
|
25
|
+
let { tabName, prompt: rawPrompt } = parseTabMessage(text);
|
|
26
|
+
// Allow channel to override tab name (group tabs, thread tabs, etc.)
|
|
27
|
+
if (overrideTabName) {
|
|
28
|
+
tabName = overrideTabName;
|
|
29
|
+
}
|
|
30
|
+
if (!rawPrompt && media.length === 0) {
|
|
31
|
+
return { responseText: '', tabName, isError: false };
|
|
32
|
+
}
|
|
33
|
+
// 2. Smart project routing
|
|
34
|
+
const { resolveProjectRoute } = await import('./command-handler.js');
|
|
35
|
+
const route = await resolveProjectRoute(rawPrompt, tabName, text, userId);
|
|
36
|
+
if (route.confirmationMessage) {
|
|
37
|
+
return {
|
|
38
|
+
responseText: route.confirmationMessage,
|
|
39
|
+
tabName,
|
|
40
|
+
isError: false,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const effectiveTabName = route.effectiveTabName;
|
|
44
|
+
const projectPath = route.projectPath;
|
|
45
|
+
// 3. Build prompt with media references
|
|
46
|
+
const prompt = buildMediaPrompt(media, rawPrompt);
|
|
47
|
+
logger.info(`[${channelId}] Pipeline processing for tab "${effectiveTabName}"`);
|
|
48
|
+
// 4. Create progress tracker
|
|
49
|
+
const progressTracker = new ProgressTracker(effectiveTabName, sendProgress);
|
|
50
|
+
// 5. Send message to tab
|
|
51
|
+
const result = await tabManager.sendMessage(effectiveTabName, prompt, {
|
|
52
|
+
onTextChunk,
|
|
53
|
+
onToolUse: (name, input) => progressTracker.record(name, input),
|
|
54
|
+
projectPath,
|
|
55
|
+
});
|
|
56
|
+
progressTracker.stop();
|
|
57
|
+
// 6. Build response text
|
|
58
|
+
const isError = result.error;
|
|
59
|
+
const responseText = isError
|
|
60
|
+
? `Error: ${result.text}`
|
|
61
|
+
: result.text || '(empty response)';
|
|
62
|
+
// 7. TTS voice reply (shared logic)
|
|
63
|
+
let audioPath;
|
|
64
|
+
let voiceOnly = false;
|
|
65
|
+
if (ttsProvider && (voiceReplyMode === 'voice' || voiceReplyMode === 'both')) {
|
|
66
|
+
try {
|
|
67
|
+
audioPath = await ttsProvider.synthesize(responseText);
|
|
68
|
+
if (voiceReplyMode === 'voice') {
|
|
69
|
+
voiceOnly = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
logger.warn(`[${channelId}] TTS failed, falling back to text:`, err);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
responseText,
|
|
78
|
+
tabName: effectiveTabName,
|
|
79
|
+
isError,
|
|
80
|
+
audioPath,
|
|
81
|
+
voiceOnly,
|
|
82
|
+
};
|
|
83
|
+
}
|