@phuetz/code-buddy 0.1.12 → 0.1.14
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/README.md +228 -13
- package/dist/agent/architect-mode.d.ts +11 -0
- package/dist/agent/architect-mode.js +133 -25
- package/dist/agent/architect-mode.js.map +1 -1
- package/dist/agent/codebuddy-agent.d.ts +24 -0
- package/dist/agent/codebuddy-agent.js +118 -16
- package/dist/agent/codebuddy-agent.js.map +1 -1
- package/dist/agent/execution/agent-executor.d.ts +9 -0
- package/dist/agent/execution/agent-executor.js +62 -1
- package/dist/agent/execution/agent-executor.js.map +1 -1
- package/dist/agent/message-queue.d.ts +77 -0
- package/dist/agent/message-queue.js +116 -0
- package/dist/agent/message-queue.js.map +1 -0
- package/dist/agent/middleware/auto-observation.d.ts +37 -0
- package/dist/agent/middleware/auto-observation.js +231 -0
- package/dist/agent/middleware/auto-observation.js.map +1 -0
- package/dist/agent/middleware/index.d.ts +2 -0
- package/dist/agent/middleware/index.js +1 -0
- package/dist/agent/middleware/index.js.map +1 -1
- package/dist/agent/tool-handler.js +3 -2
- package/dist/agent/tool-handler.js.map +1 -1
- package/dist/agent/turn-diff-tracker.js +3 -0
- package/dist/agent/turn-diff-tracker.js.map +1 -1
- package/dist/agent/types.d.ts +7 -2
- package/dist/analytics/budget-alerts.d.ts +81 -0
- package/dist/analytics/budget-alerts.js +126 -0
- package/dist/analytics/budget-alerts.js.map +1 -0
- package/dist/analytics/cost-predictor.d.ts +79 -0
- package/dist/analytics/cost-predictor.js +150 -0
- package/dist/analytics/cost-predictor.js.map +1 -0
- package/dist/analytics/index.d.ts +2 -0
- package/dist/analytics/index.js +2 -0
- package/dist/analytics/index.js.map +1 -1
- package/dist/auth/profile-manager.d.ts +205 -0
- package/dist/auth/profile-manager.js +484 -0
- package/dist/auth/profile-manager.js.map +1 -0
- package/dist/browser-automation/browser-manager.d.ts +79 -1
- package/dist/browser-automation/browser-manager.js +265 -2
- package/dist/browser-automation/browser-manager.js.map +1 -1
- package/dist/browser-automation/profile-manager.d.ts +32 -0
- package/dist/browser-automation/profile-manager.js +83 -0
- package/dist/browser-automation/profile-manager.js.map +1 -0
- package/dist/browser-automation/route-interceptor.d.ts +29 -0
- package/dist/browser-automation/route-interceptor.js +103 -0
- package/dist/browser-automation/route-interceptor.js.map +1 -0
- package/dist/browser-automation/screenshot-annotator.d.ts +23 -0
- package/dist/browser-automation/screenshot-annotator.js +86 -0
- package/dist/browser-automation/screenshot-annotator.js.map +1 -0
- package/dist/browser-automation/types.d.ts +47 -0
- package/dist/cache/llm-response-cache.js +3 -0
- package/dist/cache/llm-response-cache.js.map +1 -1
- package/dist/canvas/canvas-server.js +4 -3
- package/dist/canvas/canvas-server.js.map +1 -1
- package/dist/channels/discord/client.d.ts +2 -1
- package/dist/channels/discord/client.js +28 -16
- package/dist/channels/discord/client.js.map +1 -1
- package/dist/channels/dm-pairing.js +6 -3
- package/dist/channels/dm-pairing.js.map +1 -1
- package/dist/channels/google-chat/index.d.ts +210 -0
- package/dist/channels/google-chat/index.js +505 -0
- package/dist/channels/google-chat/index.js.map +1 -0
- package/dist/channels/group-security.d.ts +182 -0
- package/dist/channels/group-security.js +407 -0
- package/dist/channels/group-security.js.map +1 -0
- package/dist/channels/index.d.ts +17 -1
- package/dist/channels/index.js +16 -0
- package/dist/channels/index.js.map +1 -1
- package/dist/channels/matrix/index.d.ts +181 -0
- package/dist/channels/matrix/index.js +643 -0
- package/dist/channels/matrix/index.js.map +1 -0
- package/dist/channels/offline-queue.d.ts +92 -0
- package/dist/channels/offline-queue.js +112 -0
- package/dist/channels/offline-queue.js.map +1 -0
- package/dist/channels/reconnection-manager.d.ts +117 -0
- package/dist/channels/reconnection-manager.js +171 -0
- package/dist/channels/reconnection-manager.js.map +1 -0
- package/dist/channels/signal/index.d.ts +184 -0
- package/dist/channels/signal/index.js +488 -0
- package/dist/channels/signal/index.js.map +1 -0
- package/dist/channels/slack/client.d.ts +2 -1
- package/dist/channels/slack/client.js +30 -15
- package/dist/channels/slack/client.js.map +1 -1
- package/dist/channels/teams/index.d.ts +196 -0
- package/dist/channels/teams/index.js +477 -0
- package/dist/channels/teams/index.js.map +1 -0
- package/dist/channels/telegram/client.d.ts +3 -1
- package/dist/channels/telegram/client.js +29 -2
- package/dist/channels/telegram/client.js.map +1 -1
- package/dist/channels/webchat/index.d.ts +103 -0
- package/dist/channels/webchat/index.js +697 -0
- package/dist/channels/webchat/index.js.map +1 -0
- package/dist/channels/whatsapp/index.d.ts +105 -0
- package/dist/channels/whatsapp/index.js +533 -0
- package/dist/channels/whatsapp/index.js.map +1 -0
- package/dist/codebuddy/client.js +11 -5
- package/dist/codebuddy/client.js.map +1 -1
- package/dist/codebuddy/tool-definitions/advanced-tools.d.ts +1 -0
- package/dist/codebuddy/tool-definitions/advanced-tools.js +103 -3
- package/dist/codebuddy/tool-definitions/advanced-tools.js.map +1 -1
- package/dist/codebuddy/tool-definitions/index.d.ts +1 -1
- package/dist/codebuddy/tool-definitions/index.js +1 -1
- package/dist/codebuddy/tool-definitions/index.js.map +1 -1
- package/dist/codebuddy/tools.js +3 -1
- package/dist/codebuddy/tools.js.map +1 -1
- package/dist/commands/cli/config-command.d.ts +8 -0
- package/dist/commands/cli/config-command.js +90 -0
- package/dist/commands/cli/config-command.js.map +1 -0
- package/dist/commands/cli/openclaw-commands.d.ts +12 -0
- package/dist/commands/cli/openclaw-commands.js +446 -0
- package/dist/commands/cli/openclaw-commands.js.map +1 -0
- package/dist/commands/cli/utility-commands.js +30 -0
- package/dist/commands/cli/utility-commands.js.map +1 -1
- package/dist/commands/client-dispatcher.js +22 -2
- package/dist/commands/client-dispatcher.js.map +1 -1
- package/dist/commands/enhanced-command-handler.js +21 -2
- package/dist/commands/enhanced-command-handler.js.map +1 -1
- package/dist/commands/handlers/extra-handlers.d.ts +30 -0
- package/dist/commands/handlers/extra-handlers.js +547 -0
- package/dist/commands/handlers/extra-handlers.js.map +1 -0
- package/dist/commands/handlers/index.d.ts +1 -0
- package/dist/commands/handlers/index.js +2 -0
- package/dist/commands/handlers/index.js.map +1 -1
- package/dist/commands/slash/builtin-commands.js +41 -34
- package/dist/commands/slash/builtin-commands.js.map +1 -1
- package/dist/config/env-schema.d.ts +58 -0
- package/dist/config/env-schema.js +789 -0
- package/dist/config/env-schema.js.map +1 -0
- package/dist/config/feature-flags.js +2 -1
- package/dist/config/feature-flags.js.map +1 -1
- package/dist/context/bootstrap-loader.d.ts +48 -0
- package/dist/context/bootstrap-loader.js +123 -0
- package/dist/context/bootstrap-loader.js.map +1 -0
- package/dist/context/codebase-rag/chunker.js +2 -2
- package/dist/context/codebase-rag/chunker.js.map +1 -1
- package/dist/copilot/copilot-proxy.d.ts +15 -1
- package/dist/copilot/copilot-proxy.js +92 -23
- package/dist/copilot/copilot-proxy.js.map +1 -1
- package/dist/daemon/health-monitor.js +11 -7
- package/dist/daemon/health-monitor.js.map +1 -1
- package/dist/daemon/heartbeat.d.ts +112 -0
- package/dist/daemon/heartbeat.js +339 -0
- package/dist/daemon/heartbeat.js.map +1 -0
- package/dist/desktop-automation/smart-snapshot.d.ts +11 -0
- package/dist/desktop-automation/smart-snapshot.js +38 -0
- package/dist/desktop-automation/smart-snapshot.js.map +1 -1
- package/dist/extensions/extension-loader.js +4 -0
- package/dist/extensions/extension-loader.js.map +1 -1
- package/dist/identity/identity-manager.d.ts +95 -0
- package/dist/identity/identity-manager.js +242 -0
- package/dist/identity/identity-manager.js.map +1 -0
- package/dist/index.js +147 -17
- package/dist/index.js.map +1 -1
- package/dist/input/text-to-speech.js +4 -2
- package/dist/input/text-to-speech.js.map +1 -1
- package/dist/input/voice-control.js +5 -3
- package/dist/input/voice-control.js.map +1 -1
- package/dist/integrations/github-integration.js +1 -1
- package/dist/integrations/github-integration.js.map +1 -1
- package/dist/orchestration/orchestrator.js +3 -0
- package/dist/orchestration/orchestrator.js.map +1 -1
- package/dist/persistence/conversation-branches.js +2 -1
- package/dist/persistence/conversation-branches.js.map +1 -1
- package/dist/persistence/session-store.d.ts +1 -1
- package/dist/persistence/session-store.js +1 -1
- package/dist/persistence/session-store.js.map +1 -1
- package/dist/plugins/plugin-system.js +5 -2
- package/dist/plugins/plugin-system.js.map +1 -1
- package/dist/providers/gemini-provider.js +6 -4
- package/dist/providers/gemini-provider.js.map +1 -1
- package/dist/providers/local-llm-provider.js +8 -0
- package/dist/providers/local-llm-provider.js.map +1 -1
- package/dist/sandbox/auto-sandbox.d.ts +59 -0
- package/dist/sandbox/auto-sandbox.js +145 -0
- package/dist/sandbox/auto-sandbox.js.map +1 -0
- package/dist/scheduler/cron-scheduler.js +2 -0
- package/dist/scheduler/cron-scheduler.js.map +1 -1
- package/dist/scheduler/scheduler.js +11 -2
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/security/audit-logger.d.ts +127 -0
- package/dist/security/audit-logger.js +194 -0
- package/dist/security/audit-logger.js.map +1 -0
- package/dist/security/bash-allowlist/allowlist-store.js +3 -2
- package/dist/security/bash-allowlist/allowlist-store.js.map +1 -1
- package/dist/security/bash-parser.js +0 -2
- package/dist/security/bash-parser.js.map +1 -1
- package/dist/security/code-validator.d.ts +51 -0
- package/dist/security/code-validator.js +185 -0
- package/dist/security/code-validator.js.map +1 -0
- package/dist/security/dangerous-patterns.d.ts +68 -0
- package/dist/security/dangerous-patterns.js +218 -0
- package/dist/security/dangerous-patterns.js.map +1 -0
- package/dist/security/remote-approval.d.ts +65 -0
- package/dist/security/remote-approval.js +138 -0
- package/dist/security/remote-approval.js.map +1 -0
- package/dist/security/security-audit.d.ts +7 -0
- package/dist/security/security-audit.js +23 -0
- package/dist/security/security-audit.js.map +1 -1
- package/dist/security/syntax-validator.d.ts +17 -0
- package/dist/security/syntax-validator.js +292 -0
- package/dist/security/syntax-validator.js.map +1 -0
- package/dist/server/index.js +277 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/middleware/logging.js +9 -1
- package/dist/server/middleware/logging.js.map +1 -1
- package/dist/server/routes/memory.js +4 -1
- package/dist/server/routes/memory.js.map +1 -1
- package/dist/server/routes/metrics.js +1 -1
- package/dist/server/routes/metrics.js.map +1 -1
- package/dist/server/routes/sessions.js +5 -4
- package/dist/server/routes/sessions.js.map +1 -1
- package/dist/server/websocket/handler.js +8 -2
- package/dist/server/websocket/handler.js.map +1 -1
- package/dist/services/prompt-builder.js +16 -0
- package/dist/services/prompt-builder.js.map +1 -1
- package/dist/skills/hub.d.ts +231 -0
- package/dist/skills/hub.js +694 -0
- package/dist/skills/hub.js.map +1 -0
- package/dist/skills/skill-loader.js +1 -1
- package/dist/skills/skill-loader.js.map +1 -1
- package/dist/skills/skill-manager.js +2 -1
- package/dist/skills/skill-manager.js.map +1 -1
- package/dist/skills/skill-registry.js +4 -0
- package/dist/skills/skill-registry.js.map +1 -1
- package/dist/talk-mode/providers/audioreader-tts.js +1 -0
- package/dist/talk-mode/providers/audioreader-tts.js.map +1 -1
- package/dist/tools/apply-patch.d.ts +1 -0
- package/dist/tools/apply-patch.js +66 -12
- package/dist/tools/apply-patch.js.map +1 -1
- package/dist/tools/bash/bash-tool.d.ts +123 -0
- package/dist/tools/bash/bash-tool.js +549 -0
- package/dist/tools/bash/bash-tool.js.map +1 -0
- package/dist/tools/bash/command-validator.d.ts +49 -0
- package/dist/tools/bash/command-validator.js +223 -0
- package/dist/tools/bash/command-validator.js.map +1 -0
- package/dist/tools/bash/index.d.ts +7 -0
- package/dist/tools/bash/index.js +8 -0
- package/dist/tools/bash/index.js.map +1 -0
- package/dist/tools/bash/security-patterns.d.ts +44 -0
- package/dist/tools/bash/security-patterns.js +234 -0
- package/dist/tools/bash/security-patterns.js.map +1 -0
- package/dist/tools/bash/streaming-executor.d.ts +23 -0
- package/dist/tools/bash/streaming-executor.js +134 -0
- package/dist/tools/bash/streaming-executor.js.map +1 -0
- package/dist/tools/bash.js +5 -3
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/code-formatter.js +41 -27
- package/dist/tools/code-formatter.js.map +1 -1
- package/dist/tools/code-review.js +1 -1
- package/dist/tools/code-review.js.map +1 -1
- package/dist/tools/computer-control-tool.js +21 -0
- package/dist/tools/computer-control-tool.js.map +1 -1
- package/dist/tools/document-tool.js +3 -2
- package/dist/tools/document-tool.js.map +1 -1
- package/dist/tools/git-tool.d.ts +45 -0
- package/dist/tools/git-tool.js +224 -2
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/morph-editor.js +1 -0
- package/dist/tools/morph-editor.js.map +1 -1
- package/dist/tools/multi-edit.js +31 -3
- package/dist/tools/multi-edit.js.map +1 -1
- package/dist/tools/notebook-tool.js +8 -2
- package/dist/tools/notebook-tool.js.map +1 -1
- package/dist/tools/process-tool.d.ts +69 -0
- package/dist/tools/process-tool.js +222 -0
- package/dist/tools/process-tool.js.map +1 -0
- package/dist/tools/registry/git-tools.d.ts +32 -0
- package/dist/tools/registry/git-tools.js +211 -0
- package/dist/tools/registry/git-tools.js.map +1 -0
- package/dist/tools/registry/index.d.ts +2 -0
- package/dist/tools/registry/index.js +8 -0
- package/dist/tools/registry/index.js.map +1 -1
- package/dist/tools/registry/misc-tools.d.ts +32 -4
- package/dist/tools/registry/misc-tools.js +230 -90
- package/dist/tools/registry/misc-tools.js.map +1 -1
- package/dist/tools/registry/process-tools.d.ts +20 -0
- package/dist/tools/registry/process-tools.js +141 -0
- package/dist/tools/registry/process-tools.js.map +1 -0
- package/dist/tools/registry/types.d.ts +2 -0
- package/dist/tools/search.js +4 -2
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/video-tool.js +30 -14
- package/dist/tools/video-tool.js.map +1 -1
- package/dist/tools/web-search.js +4 -1
- package/dist/tools/web-search.js.map +1 -1
- package/dist/ui/components/ChatInterface.js +9 -0
- package/dist/ui/components/ChatInterface.js.map +1 -1
- package/dist/utils/autonomy-manager.js +3 -2
- package/dist/utils/autonomy-manager.js.map +1 -1
- package/dist/utils/config-validation/schema.d.ts +15 -15
- package/dist/utils/confirmation-service.d.ts +16 -0
- package/dist/utils/confirmation-service.js +37 -3
- package/dist/utils/confirmation-service.js.map +1 -1
- package/dist/utils/custom-instructions.js +2 -1
- package/dist/utils/custom-instructions.js.map +1 -1
- package/dist/utils/diff-generator.js +3 -1
- package/dist/utils/diff-generator.js.map +1 -1
- package/dist/utils/graceful-shutdown.js +9 -9
- package/dist/utils/graceful-shutdown.js.map +1 -1
- package/dist/utils/head-tail-truncation.d.ts +18 -0
- package/dist/utils/head-tail-truncation.js +127 -0
- package/dist/utils/head-tail-truncation.js.map +1 -1
- package/dist/utils/history-manager.js +3 -2
- package/dist/utils/history-manager.js.map +1 -1
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/logger.js +18 -3
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/performance.js +16 -15
- package/dist/utils/performance.js.map +1 -1
- package/dist/utils/stream-helpers.js +4 -2
- package/dist/utils/stream-helpers.js.map +1 -1
- package/dist/utils/update-notifier.js +2 -1
- package/dist/utils/update-notifier.js.map +1 -1
- package/dist/workflows/pipeline.d.ts +54 -1
- package/dist/workflows/pipeline.js +128 -7
- package/dist/workflows/pipeline.js.map +1 -1
- package/dist/workflows/step-manager.js +2 -1
- package/dist/workflows/step-manager.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group Chat Security
|
|
3
|
+
*
|
|
4
|
+
* OpenClaw-inspired group chat security with mention-gating, group allowlists,
|
|
5
|
+
* and activation control.
|
|
6
|
+
*
|
|
7
|
+
* In group chats, bots can be noisy if they respond to every message. This
|
|
8
|
+
* module provides configurable security controls:
|
|
9
|
+
*
|
|
10
|
+
* 1. **Mention-gating** - Require @mention to activate in groups
|
|
11
|
+
* 2. **Group allowlists** - Per-group user allowlists
|
|
12
|
+
* 3. **Activation modes** - Per-group control (active, mention-only, inactive, allowlist-only)
|
|
13
|
+
* 4. **Global blocklist** - Block users across all groups
|
|
14
|
+
* 5. **Rate limiting** - Per-group message rate limiting
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const security = getGroupSecurity();
|
|
19
|
+
*
|
|
20
|
+
* // Check if an inbound message should be processed
|
|
21
|
+
* const result = security.shouldProcess(message);
|
|
22
|
+
* if (result.allowed) {
|
|
23
|
+
* // Process message
|
|
24
|
+
* } else {
|
|
25
|
+
* logger.debug('Message blocked', { reason: result.reason });
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* // Configure a group
|
|
29
|
+
* security.addGroup({
|
|
30
|
+
* groupId: 'telegram:-100123456',
|
|
31
|
+
* channelType: 'telegram',
|
|
32
|
+
* activationMode: 'mention-only',
|
|
33
|
+
* allowedUsers: ['user-1', 'user-2'],
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
import { EventEmitter } from 'events';
|
|
38
|
+
import type { ChannelType, InboundMessage } from './index.js';
|
|
39
|
+
/**
|
|
40
|
+
* Group activation mode controlling how the bot responds in a group.
|
|
41
|
+
*
|
|
42
|
+
* - `active` - Process all messages (no gating)
|
|
43
|
+
* - `mention-only` - Only process messages that mention the bot
|
|
44
|
+
* - `inactive` - Ignore all messages in this group
|
|
45
|
+
* - `allowlist-only` - Only process messages from allowlisted users
|
|
46
|
+
*/
|
|
47
|
+
export type GroupActivationMode = 'active' | 'mention-only' | 'inactive' | 'allowlist-only';
|
|
48
|
+
/**
|
|
49
|
+
* Per-group configuration
|
|
50
|
+
*/
|
|
51
|
+
export interface GroupConfig {
|
|
52
|
+
/** Group/channel ID */
|
|
53
|
+
groupId: string;
|
|
54
|
+
/** Channel type (telegram, discord, etc.) */
|
|
55
|
+
channelType: ChannelType;
|
|
56
|
+
/** How the bot is activated in this group */
|
|
57
|
+
activationMode: GroupActivationMode;
|
|
58
|
+
/** Users allowed to interact in this group (for allowlist-only mode) */
|
|
59
|
+
allowedUsers?: string[];
|
|
60
|
+
/** Custom mention patterns for this group (overrides global) */
|
|
61
|
+
mentionPatterns?: string[];
|
|
62
|
+
/** Whether mentions are required in this group (default true for groups) */
|
|
63
|
+
requireMention?: boolean;
|
|
64
|
+
/** Cooldown between processed messages in ms */
|
|
65
|
+
cooldownMs?: number;
|
|
66
|
+
/** Maximum messages per minute for this group */
|
|
67
|
+
maxMessagesPerMinute?: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Global group security configuration
|
|
71
|
+
*/
|
|
72
|
+
export interface GroupSecurityConfig {
|
|
73
|
+
/** Enable group security */
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
/** Default activation mode for unconfigured groups */
|
|
76
|
+
defaultMode: GroupActivationMode;
|
|
77
|
+
/** Default mention patterns to detect bot mentions */
|
|
78
|
+
mentionPatterns: string[];
|
|
79
|
+
/** Per-group configurations (groupId -> config) */
|
|
80
|
+
groupConfigs: Map<string, GroupConfig>;
|
|
81
|
+
/** Users allowed in all groups */
|
|
82
|
+
globalAllowlist: string[];
|
|
83
|
+
/** Users blocked from all groups */
|
|
84
|
+
blocklist: string[];
|
|
85
|
+
/** Require @mention in group chats by default */
|
|
86
|
+
requireMentionInGroups: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Result of shouldProcess check
|
|
90
|
+
*/
|
|
91
|
+
export interface ProcessResult {
|
|
92
|
+
/** Whether the message should be processed */
|
|
93
|
+
allowed: boolean;
|
|
94
|
+
/** Human-readable reason for the decision */
|
|
95
|
+
reason: string;
|
|
96
|
+
}
|
|
97
|
+
export declare const DEFAULT_GROUP_SECURITY_CONFIG: GroupSecurityConfig;
|
|
98
|
+
export declare class GroupSecurityManager extends EventEmitter {
|
|
99
|
+
private config;
|
|
100
|
+
private rateLimits;
|
|
101
|
+
constructor(config?: Partial<GroupSecurityConfig>);
|
|
102
|
+
/**
|
|
103
|
+
* Determine whether an inbound message should be processed.
|
|
104
|
+
*
|
|
105
|
+
* DM (direct message) channels always pass through.
|
|
106
|
+
* Group messages are checked against activation mode, mention patterns,
|
|
107
|
+
* allowlists, blocklist, and rate limits.
|
|
108
|
+
*/
|
|
109
|
+
shouldProcess(message: InboundMessage): ProcessResult;
|
|
110
|
+
/**
|
|
111
|
+
* Check if message content contains any of the mention patterns.
|
|
112
|
+
* Case-insensitive matching.
|
|
113
|
+
*/
|
|
114
|
+
private containsMention;
|
|
115
|
+
/**
|
|
116
|
+
* Check if a group has exceeded its rate limit.
|
|
117
|
+
*/
|
|
118
|
+
private checkRateLimit;
|
|
119
|
+
/**
|
|
120
|
+
* Record a processed message for rate limiting purposes.
|
|
121
|
+
*/
|
|
122
|
+
private recordMessage;
|
|
123
|
+
/**
|
|
124
|
+
* Add a group configuration.
|
|
125
|
+
*/
|
|
126
|
+
addGroup(config: GroupConfig): void;
|
|
127
|
+
/**
|
|
128
|
+
* Remove a group configuration.
|
|
129
|
+
*/
|
|
130
|
+
removeGroup(groupId: string): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Update a group configuration (partial merge).
|
|
133
|
+
*/
|
|
134
|
+
updateGroup(groupId: string, partial: Partial<GroupConfig>): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Get configuration for a specific group.
|
|
137
|
+
*/
|
|
138
|
+
getGroupConfig(groupId: string): GroupConfig | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* List all configured groups.
|
|
141
|
+
*/
|
|
142
|
+
listGroups(): GroupConfig[];
|
|
143
|
+
/**
|
|
144
|
+
* Add a user to a group's allowlist.
|
|
145
|
+
*/
|
|
146
|
+
addToAllowlist(groupId: string, userId: string): boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Remove a user from a group's allowlist.
|
|
149
|
+
*/
|
|
150
|
+
removeFromAllowlist(groupId: string, userId: string): boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Add a user to the global blocklist.
|
|
153
|
+
*/
|
|
154
|
+
addToBlocklist(userId: string): void;
|
|
155
|
+
/**
|
|
156
|
+
* Remove a user from the global blocklist.
|
|
157
|
+
*/
|
|
158
|
+
removeFromBlocklist(userId: string): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Get group security statistics.
|
|
161
|
+
*/
|
|
162
|
+
getStats(): {
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
totalGroups: number;
|
|
165
|
+
defaultMode: GroupActivationMode;
|
|
166
|
+
globalAllowlistSize: number;
|
|
167
|
+
blocklistSize: number;
|
|
168
|
+
groupsByMode: Record<string, number>;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Dispose all internal state and remove all listeners.
|
|
172
|
+
*/
|
|
173
|
+
dispose(): void;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Get the singleton GroupSecurityManager instance.
|
|
177
|
+
*/
|
|
178
|
+
export declare function getGroupSecurity(config?: Partial<GroupSecurityConfig>): GroupSecurityManager;
|
|
179
|
+
/**
|
|
180
|
+
* Reset the singleton GroupSecurityManager (for testing).
|
|
181
|
+
*/
|
|
182
|
+
export declare function resetGroupSecurity(): void;
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group Chat Security
|
|
3
|
+
*
|
|
4
|
+
* OpenClaw-inspired group chat security with mention-gating, group allowlists,
|
|
5
|
+
* and activation control.
|
|
6
|
+
*
|
|
7
|
+
* In group chats, bots can be noisy if they respond to every message. This
|
|
8
|
+
* module provides configurable security controls:
|
|
9
|
+
*
|
|
10
|
+
* 1. **Mention-gating** - Require @mention to activate in groups
|
|
11
|
+
* 2. **Group allowlists** - Per-group user allowlists
|
|
12
|
+
* 3. **Activation modes** - Per-group control (active, mention-only, inactive, allowlist-only)
|
|
13
|
+
* 4. **Global blocklist** - Block users across all groups
|
|
14
|
+
* 5. **Rate limiting** - Per-group message rate limiting
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const security = getGroupSecurity();
|
|
19
|
+
*
|
|
20
|
+
* // Check if an inbound message should be processed
|
|
21
|
+
* const result = security.shouldProcess(message);
|
|
22
|
+
* if (result.allowed) {
|
|
23
|
+
* // Process message
|
|
24
|
+
* } else {
|
|
25
|
+
* logger.debug('Message blocked', { reason: result.reason });
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* // Configure a group
|
|
29
|
+
* security.addGroup({
|
|
30
|
+
* groupId: 'telegram:-100123456',
|
|
31
|
+
* channelType: 'telegram',
|
|
32
|
+
* activationMode: 'mention-only',
|
|
33
|
+
* allowedUsers: ['user-1', 'user-2'],
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
import { EventEmitter } from 'events';
|
|
38
|
+
import { logger } from '../utils/logger.js';
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Default Configuration
|
|
41
|
+
// ============================================================================
|
|
42
|
+
export const DEFAULT_GROUP_SECURITY_CONFIG = {
|
|
43
|
+
enabled: true,
|
|
44
|
+
defaultMode: 'mention-only',
|
|
45
|
+
mentionPatterns: ['@buddy', '@codebuddy', '@bot'],
|
|
46
|
+
groupConfigs: new Map(),
|
|
47
|
+
globalAllowlist: [],
|
|
48
|
+
blocklist: [],
|
|
49
|
+
requireMentionInGroups: true,
|
|
50
|
+
};
|
|
51
|
+
// ============================================================================
|
|
52
|
+
// GroupSecurityManager
|
|
53
|
+
// ============================================================================
|
|
54
|
+
export class GroupSecurityManager extends EventEmitter {
|
|
55
|
+
config;
|
|
56
|
+
rateLimits = new Map();
|
|
57
|
+
constructor(config = {}) {
|
|
58
|
+
super();
|
|
59
|
+
this.config = {
|
|
60
|
+
...DEFAULT_GROUP_SECURITY_CONFIG,
|
|
61
|
+
...config,
|
|
62
|
+
// Deep-copy collections so mutations don't leak
|
|
63
|
+
groupConfigs: config.groupConfigs
|
|
64
|
+
? new Map(config.groupConfigs)
|
|
65
|
+
: new Map(),
|
|
66
|
+
globalAllowlist: config.globalAllowlist
|
|
67
|
+
? [...config.globalAllowlist]
|
|
68
|
+
: [],
|
|
69
|
+
blocklist: config.blocklist
|
|
70
|
+
? [...config.blocklist]
|
|
71
|
+
: [],
|
|
72
|
+
mentionPatterns: config.mentionPatterns
|
|
73
|
+
? [...config.mentionPatterns]
|
|
74
|
+
: [...DEFAULT_GROUP_SECURITY_CONFIG.mentionPatterns],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// ==========================================================================
|
|
78
|
+
// Main Gating Function
|
|
79
|
+
// ==========================================================================
|
|
80
|
+
/**
|
|
81
|
+
* Determine whether an inbound message should be processed.
|
|
82
|
+
*
|
|
83
|
+
* DM (direct message) channels always pass through.
|
|
84
|
+
* Group messages are checked against activation mode, mention patterns,
|
|
85
|
+
* allowlists, blocklist, and rate limits.
|
|
86
|
+
*/
|
|
87
|
+
shouldProcess(message) {
|
|
88
|
+
// If security is disabled, allow everything
|
|
89
|
+
if (!this.config.enabled) {
|
|
90
|
+
return { allowed: true, reason: 'group security disabled' };
|
|
91
|
+
}
|
|
92
|
+
// DMs always pass through - group security only applies to groups
|
|
93
|
+
if (message.channel.isDM || !message.channel.isGroup) {
|
|
94
|
+
return { allowed: true, reason: 'direct message' };
|
|
95
|
+
}
|
|
96
|
+
const groupId = message.channel.id;
|
|
97
|
+
const senderId = message.sender.id;
|
|
98
|
+
// Check global blocklist first
|
|
99
|
+
if (this.config.blocklist.includes(senderId)) {
|
|
100
|
+
const result = { allowed: false, reason: 'user is on global blocklist' };
|
|
101
|
+
this.emit('message:blocked', message, result.reason);
|
|
102
|
+
logger.debug('Group security: blocked message (blocklist)', {
|
|
103
|
+
groupId,
|
|
104
|
+
senderId,
|
|
105
|
+
});
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
// Get group-specific config or fall back to defaults
|
|
109
|
+
const groupConfig = this.config.groupConfigs.get(groupId);
|
|
110
|
+
const activationMode = groupConfig?.activationMode ?? this.config.defaultMode;
|
|
111
|
+
// Handle activation modes
|
|
112
|
+
switch (activationMode) {
|
|
113
|
+
case 'inactive': {
|
|
114
|
+
const result = { allowed: false, reason: 'group is inactive' };
|
|
115
|
+
this.emit('message:blocked', message, result.reason);
|
|
116
|
+
logger.debug('Group security: blocked message (inactive group)', { groupId });
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
case 'active': {
|
|
120
|
+
// Active mode: process all (but still check blocklist which is done above
|
|
121
|
+
// and rate limits below)
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
case 'allowlist-only': {
|
|
125
|
+
const allowedUsers = groupConfig?.allowedUsers ?? [];
|
|
126
|
+
const isGloballyAllowed = this.config.globalAllowlist.includes(senderId);
|
|
127
|
+
const isGroupAllowed = allowedUsers.includes(senderId);
|
|
128
|
+
if (!isGloballyAllowed && !isGroupAllowed) {
|
|
129
|
+
const result = { allowed: false, reason: 'user not on allowlist' };
|
|
130
|
+
this.emit('message:blocked', message, result.reason);
|
|
131
|
+
logger.debug('Group security: blocked message (not on allowlist)', {
|
|
132
|
+
groupId,
|
|
133
|
+
senderId,
|
|
134
|
+
});
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
case 'mention-only': {
|
|
140
|
+
const requireMention = groupConfig?.requireMention ?? this.config.requireMentionInGroups;
|
|
141
|
+
if (requireMention) {
|
|
142
|
+
const patterns = groupConfig?.mentionPatterns ?? this.config.mentionPatterns;
|
|
143
|
+
const hasMention = this.containsMention(message.content, patterns);
|
|
144
|
+
if (!hasMention) {
|
|
145
|
+
const result = { allowed: false, reason: 'no mention detected' };
|
|
146
|
+
this.emit('message:blocked', message, result.reason);
|
|
147
|
+
logger.debug('Group security: blocked message (no mention)', {
|
|
148
|
+
groupId,
|
|
149
|
+
senderId,
|
|
150
|
+
});
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Rate limiting
|
|
158
|
+
const rateLimitResult = this.checkRateLimit(groupId, groupConfig);
|
|
159
|
+
if (!rateLimitResult.allowed) {
|
|
160
|
+
this.emit('message:rate-limited', message, rateLimitResult.reason);
|
|
161
|
+
logger.debug('Group security: rate limited', {
|
|
162
|
+
groupId,
|
|
163
|
+
reason: rateLimitResult.reason,
|
|
164
|
+
});
|
|
165
|
+
return rateLimitResult;
|
|
166
|
+
}
|
|
167
|
+
// Record this message for rate limiting
|
|
168
|
+
this.recordMessage(groupId);
|
|
169
|
+
const result = { allowed: true, reason: 'passed all checks' };
|
|
170
|
+
this.emit('message:allowed', message);
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
// ==========================================================================
|
|
174
|
+
// Mention Detection
|
|
175
|
+
// ==========================================================================
|
|
176
|
+
/**
|
|
177
|
+
* Check if message content contains any of the mention patterns.
|
|
178
|
+
* Case-insensitive matching.
|
|
179
|
+
*/
|
|
180
|
+
containsMention(content, patterns) {
|
|
181
|
+
const lower = content.toLowerCase();
|
|
182
|
+
return patterns.some(pattern => lower.includes(pattern.toLowerCase()));
|
|
183
|
+
}
|
|
184
|
+
// ==========================================================================
|
|
185
|
+
// Rate Limiting
|
|
186
|
+
// ==========================================================================
|
|
187
|
+
/**
|
|
188
|
+
* Check if a group has exceeded its rate limit.
|
|
189
|
+
*/
|
|
190
|
+
checkRateLimit(groupId, groupConfig) {
|
|
191
|
+
if (!groupConfig) {
|
|
192
|
+
return { allowed: true, reason: 'no rate limit configured' };
|
|
193
|
+
}
|
|
194
|
+
const entry = this.rateLimits.get(groupId);
|
|
195
|
+
if (!entry) {
|
|
196
|
+
return { allowed: true, reason: 'no rate limit history' };
|
|
197
|
+
}
|
|
198
|
+
const now = Date.now();
|
|
199
|
+
// Check cooldown
|
|
200
|
+
if (groupConfig.cooldownMs && groupConfig.cooldownMs > 0) {
|
|
201
|
+
const elapsed = now - entry.lastProcessed;
|
|
202
|
+
if (elapsed < groupConfig.cooldownMs) {
|
|
203
|
+
return {
|
|
204
|
+
allowed: false,
|
|
205
|
+
reason: `cooldown active (${groupConfig.cooldownMs - elapsed}ms remaining)`,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Check messages per minute
|
|
210
|
+
if (groupConfig.maxMessagesPerMinute && groupConfig.maxMessagesPerMinute > 0) {
|
|
211
|
+
const oneMinuteAgo = now - 60_000;
|
|
212
|
+
const recentCount = entry.timestamps.filter(ts => ts >= oneMinuteAgo).length;
|
|
213
|
+
if (recentCount >= groupConfig.maxMessagesPerMinute) {
|
|
214
|
+
return {
|
|
215
|
+
allowed: false,
|
|
216
|
+
reason: `rate limit exceeded (${recentCount}/${groupConfig.maxMessagesPerMinute} per minute)`,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return { allowed: true, reason: 'within rate limits' };
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Record a processed message for rate limiting purposes.
|
|
224
|
+
*/
|
|
225
|
+
recordMessage(groupId) {
|
|
226
|
+
const now = Date.now();
|
|
227
|
+
let entry = this.rateLimits.get(groupId);
|
|
228
|
+
if (!entry) {
|
|
229
|
+
entry = { timestamps: [], lastProcessed: 0 };
|
|
230
|
+
this.rateLimits.set(groupId, entry);
|
|
231
|
+
}
|
|
232
|
+
entry.timestamps.push(now);
|
|
233
|
+
entry.lastProcessed = now;
|
|
234
|
+
// Prune old timestamps (keep only last 2 minutes)
|
|
235
|
+
const cutoff = now - 120_000;
|
|
236
|
+
entry.timestamps = entry.timestamps.filter(ts => ts >= cutoff);
|
|
237
|
+
}
|
|
238
|
+
// ==========================================================================
|
|
239
|
+
// Group Management
|
|
240
|
+
// ==========================================================================
|
|
241
|
+
/**
|
|
242
|
+
* Add a group configuration.
|
|
243
|
+
*/
|
|
244
|
+
addGroup(config) {
|
|
245
|
+
this.config.groupConfigs.set(config.groupId, { ...config });
|
|
246
|
+
logger.debug('Group security: added group', {
|
|
247
|
+
groupId: config.groupId,
|
|
248
|
+
mode: config.activationMode,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Remove a group configuration.
|
|
253
|
+
*/
|
|
254
|
+
removeGroup(groupId) {
|
|
255
|
+
const existed = this.config.groupConfigs.delete(groupId);
|
|
256
|
+
if (existed) {
|
|
257
|
+
this.rateLimits.delete(groupId);
|
|
258
|
+
logger.debug('Group security: removed group', { groupId });
|
|
259
|
+
}
|
|
260
|
+
return existed;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Update a group configuration (partial merge).
|
|
264
|
+
*/
|
|
265
|
+
updateGroup(groupId, partial) {
|
|
266
|
+
const existing = this.config.groupConfigs.get(groupId);
|
|
267
|
+
if (!existing) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
const updated = { ...existing, ...partial, groupId };
|
|
271
|
+
this.config.groupConfigs.set(groupId, updated);
|
|
272
|
+
logger.debug('Group security: updated group', {
|
|
273
|
+
groupId,
|
|
274
|
+
mode: updated.activationMode,
|
|
275
|
+
});
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get configuration for a specific group.
|
|
280
|
+
*/
|
|
281
|
+
getGroupConfig(groupId) {
|
|
282
|
+
const config = this.config.groupConfigs.get(groupId);
|
|
283
|
+
return config ? { ...config } : undefined;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* List all configured groups.
|
|
287
|
+
*/
|
|
288
|
+
listGroups() {
|
|
289
|
+
return Array.from(this.config.groupConfigs.values()).map(c => ({ ...c }));
|
|
290
|
+
}
|
|
291
|
+
// ==========================================================================
|
|
292
|
+
// Allowlist Management
|
|
293
|
+
// ==========================================================================
|
|
294
|
+
/**
|
|
295
|
+
* Add a user to a group's allowlist.
|
|
296
|
+
*/
|
|
297
|
+
addToAllowlist(groupId, userId) {
|
|
298
|
+
const config = this.config.groupConfigs.get(groupId);
|
|
299
|
+
if (!config) {
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
if (!config.allowedUsers) {
|
|
303
|
+
config.allowedUsers = [];
|
|
304
|
+
}
|
|
305
|
+
if (!config.allowedUsers.includes(userId)) {
|
|
306
|
+
config.allowedUsers.push(userId);
|
|
307
|
+
logger.debug('Group security: added user to allowlist', { groupId, userId });
|
|
308
|
+
}
|
|
309
|
+
return true;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Remove a user from a group's allowlist.
|
|
313
|
+
*/
|
|
314
|
+
removeFromAllowlist(groupId, userId) {
|
|
315
|
+
const config = this.config.groupConfigs.get(groupId);
|
|
316
|
+
if (!config || !config.allowedUsers) {
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
const index = config.allowedUsers.indexOf(userId);
|
|
320
|
+
if (index === -1) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
config.allowedUsers.splice(index, 1);
|
|
324
|
+
logger.debug('Group security: removed user from allowlist', { groupId, userId });
|
|
325
|
+
return true;
|
|
326
|
+
}
|
|
327
|
+
// ==========================================================================
|
|
328
|
+
// Blocklist Management
|
|
329
|
+
// ==========================================================================
|
|
330
|
+
/**
|
|
331
|
+
* Add a user to the global blocklist.
|
|
332
|
+
*/
|
|
333
|
+
addToBlocklist(userId) {
|
|
334
|
+
if (!this.config.blocklist.includes(userId)) {
|
|
335
|
+
this.config.blocklist.push(userId);
|
|
336
|
+
logger.debug('Group security: added user to blocklist', { userId });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Remove a user from the global blocklist.
|
|
341
|
+
*/
|
|
342
|
+
removeFromBlocklist(userId) {
|
|
343
|
+
const index = this.config.blocklist.indexOf(userId);
|
|
344
|
+
if (index === -1) {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
this.config.blocklist.splice(index, 1);
|
|
348
|
+
logger.debug('Group security: removed user from blocklist', { userId });
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
// ==========================================================================
|
|
352
|
+
// Statistics
|
|
353
|
+
// ==========================================================================
|
|
354
|
+
/**
|
|
355
|
+
* Get group security statistics.
|
|
356
|
+
*/
|
|
357
|
+
getStats() {
|
|
358
|
+
const groupsByMode = {};
|
|
359
|
+
for (const config of this.config.groupConfigs.values()) {
|
|
360
|
+
groupsByMode[config.activationMode] = (groupsByMode[config.activationMode] || 0) + 1;
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
enabled: this.config.enabled,
|
|
364
|
+
totalGroups: this.config.groupConfigs.size,
|
|
365
|
+
defaultMode: this.config.defaultMode,
|
|
366
|
+
globalAllowlistSize: this.config.globalAllowlist.length,
|
|
367
|
+
blocklistSize: this.config.blocklist.length,
|
|
368
|
+
groupsByMode,
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
// ==========================================================================
|
|
372
|
+
// Lifecycle
|
|
373
|
+
// ==========================================================================
|
|
374
|
+
/**
|
|
375
|
+
* Dispose all internal state and remove all listeners.
|
|
376
|
+
*/
|
|
377
|
+
dispose() {
|
|
378
|
+
this.config.groupConfigs.clear();
|
|
379
|
+
this.config.globalAllowlist = [];
|
|
380
|
+
this.config.blocklist = [];
|
|
381
|
+
this.rateLimits.clear();
|
|
382
|
+
this.removeAllListeners();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
// ============================================================================
|
|
386
|
+
// Singleton
|
|
387
|
+
// ============================================================================
|
|
388
|
+
let securityInstance = null;
|
|
389
|
+
/**
|
|
390
|
+
* Get the singleton GroupSecurityManager instance.
|
|
391
|
+
*/
|
|
392
|
+
export function getGroupSecurity(config) {
|
|
393
|
+
if (!securityInstance) {
|
|
394
|
+
securityInstance = new GroupSecurityManager(config);
|
|
395
|
+
}
|
|
396
|
+
return securityInstance;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Reset the singleton GroupSecurityManager (for testing).
|
|
400
|
+
*/
|
|
401
|
+
export function resetGroupSecurity() {
|
|
402
|
+
if (securityInstance) {
|
|
403
|
+
securityInstance.dispose();
|
|
404
|
+
}
|
|
405
|
+
securityInstance = null;
|
|
406
|
+
}
|
|
407
|
+
//# sourceMappingURL=group-security.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-security.js","sourceRoot":"","sources":["../../src/channels/group-security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAqE5C,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,6BAA6B,GAAwB;IAChE,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC;IACjD,YAAY,EAAE,IAAI,GAAG,EAAE;IACvB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE;IACb,sBAAsB,EAAE,IAAI;CAC7B,CAAC;AAaF,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E,MAAM,OAAO,oBAAqB,SAAQ,YAAY;IAC5C,MAAM,CAAsB;IAC5B,UAAU,GAAgC,IAAI,GAAG,EAAE,CAAC;IAE5D,YAAY,SAAuC,EAAE;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,6BAA6B;YAChC,GAAG,MAAM;YACT,gDAAgD;YAChD,YAAY,EAAE,MAAM,CAAC,YAAY;gBAC/B,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC;gBAC9B,CAAC,CAAC,IAAI,GAAG,EAAE;YACb,eAAe,EAAE,MAAM,CAAC,eAAe;gBACrC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC;gBAC7B,CAAC,CAAC,EAAE;YACN,SAAS,EAAE,M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AAC;IACtD,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,gBAAgB,EAAE,CAAC;QACrB,gBAAgB,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IACD,gBAAgB,GAAG,IAAI,CAAC;AAC1B,CAAC"}
|
package/dist/channels/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { CanonicalIdentity } from './identity-links.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* Supported channel types
|
|
11
11
|
*/
|
|
12
|
-
export type ChannelType = 'telegram' | 'discord' | 'slack' | 'whatsapp' | 'signal' | 'matrix' | 'cli' | 'web' | 'api';
|
|
12
|
+
export type ChannelType = 'telegram' | 'discord' | 'slack' | 'whatsapp' | 'signal' | 'matrix' | 'google-chat' | 'teams' | 'webchat' | 'cli' | 'web' | 'api';
|
|
13
13
|
/**
|
|
14
14
|
* Message direction
|
|
15
15
|
*/
|
|
@@ -414,6 +414,22 @@ export type { RouteAgentConfig, PeerRoute, RouteCondition, ResolvedRoute, PeerRo
|
|
|
414
414
|
export { PeerRouter, getPeerRouter, resetPeerRouter, } from './peer-routing.js';
|
|
415
415
|
export type { PairingStatus, ApprovedSender, PairingRequest, DMPairingConfig, } from './dm-pairing.js';
|
|
416
416
|
export { DEFAULT_DM_PAIRING_CONFIG, DMPairingManager, getDMPairing, resetDMPairing, } from './dm-pairing.js';
|
|
417
|
+
export { WhatsAppChannel } from './whatsapp/index.js';
|
|
418
|
+
export type { WhatsAppConfig, WhatsAppContact } from './whatsapp/index.js';
|
|
419
|
+
export { SignalChannel } from './signal/index.js';
|
|
420
|
+
export type { SignalConfig, SignalMessage, SignalAttachment, SignalGroup, } from './signal/index.js';
|
|
421
|
+
export { GoogleChatChannel } from './google-chat/index.js';
|
|
422
|
+
export type { GoogleChatConfig, GoogleChatSpace, GoogleChatUser, GoogleChatMessage, GoogleChatEvent, } from './google-chat/index.js';
|
|
423
|
+
export { TeamsChannel } from './teams/index.js';
|
|
424
|
+
export type { TeamsConfig, BotFrameworkActivity, BotFrameworkAccount, BotFrameworkConversation, BotFrameworkAttachment, ConversationReference, } from './teams/index.js';
|
|
425
|
+
export { MatrixChannel } from './matrix/index.js';
|
|
426
|
+
export type { MatrixConfig, MatrixRoom, MatrixEventContent, MatrixRoomEvent, } from './matrix/index.js';
|
|
427
|
+
export { WebChatChannel } from './webchat/index.js';
|
|
428
|
+
export type { WebChatConfig } from './webchat/index.js';
|
|
429
|
+
export { ReconnectionManager } from './reconnection-manager.js';
|
|
430
|
+
export type { ReconnectionConfig, ReconnectionEvents } from './reconnection-manager.js';
|
|
431
|
+
export { OfflineQueue } from './offline-queue.js';
|
|
432
|
+
export type { QueuedMessage } from './offline-queue.js';
|
|
417
433
|
import { LaneQueue } from '../concurrency/lane-queue.js';
|
|
418
434
|
import type { TaskOptions } from '../concurrency/lane-queue.js';
|
|
419
435
|
/**
|
package/dist/channels/index.js
CHANGED
|
@@ -461,6 +461,22 @@ export { DEFAULT_SESSION_ISOLATION_CONFIG, SessionIsolator, getSessionIsolator,
|
|
|
461
461
|
export { IdentityLinker, getIdentityLinker, resetIdentityLinker, } from './identity-links.js';
|
|
462
462
|
export { PeerRouter, getPeerRouter, resetPeerRouter, } from './peer-routing.js';
|
|
463
463
|
export { DEFAULT_DM_PAIRING_CONFIG, DMPairingManager, getDMPairing, resetDMPairing, } from './dm-pairing.js';
|
|
464
|
+
// WhatsApp
|
|
465
|
+
export { WhatsAppChannel } from './whatsapp/index.js';
|
|
466
|
+
// Signal
|
|
467
|
+
export { SignalChannel } from './signal/index.js';
|
|
468
|
+
// Google Chat
|
|
469
|
+
export { GoogleChatChannel } from './google-chat/index.js';
|
|
470
|
+
// Microsoft Teams
|
|
471
|
+
export { TeamsChannel } from './teams/index.js';
|
|
472
|
+
// Matrix
|
|
473
|
+
export { MatrixChannel } from './matrix/index.js';
|
|
474
|
+
// WebChat
|
|
475
|
+
export { WebChatChannel } from './webchat/index.js';
|
|
476
|
+
// Reconnection Manager
|
|
477
|
+
export { ReconnectionManager } from './reconnection-manager.js';
|
|
478
|
+
// Offline Queue
|
|
479
|
+
export { OfflineQueue } from './offline-queue.js';
|
|
464
480
|
// ============================================================================
|
|
465
481
|
// Lane Queue Helpers
|
|
466
482
|
// ============================================================================
|