@cometchat/skills-cli 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. package/dist/index.js +3468 -736
  2. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/CometChatSelector.tsx.tpl +1 -1
  3. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatSelector.tsx.tpl +1 -1
  4. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatSelector.tsx.tpl +1 -1
  5. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatSelector.tsx.tpl +1 -1
  6. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/CometChatSelector.tsx.tpl +1 -1
  7. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatSelector.tsx.tpl +1 -1
  8. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.tsx.tpl +1 -1
  9. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.tsx.tpl +1 -1
  10. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.tsx.tpl +1 -1
  11. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.tsx.tpl +1 -1
  12. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +1 -1
  13. package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.tsx.tpl +1 -1
  14. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.tsx.tpl +1 -1
  15. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.tsx.tpl +1 -1
  16. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.tsx.tpl +1 -1
  17. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatTabs.tsx.tpl +1 -1
  18. package/dist/registry/v6/features/catalog.json +171 -5
  19. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatConversations,
5
5
  CometChatUIKitLoginListener,
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useEffect, useState } from "react";
3
- import { CometChat } from "@cometchat/chat-sdk-javascript";
3
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
4
4
  import {
5
5
  CometChatConversations,
6
6
  CometChatUIKitLoginListener,
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useEffect, useState } from "react";
3
- import { CometChat } from "@cometchat/chat-sdk-javascript";
3
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
4
4
  import {
5
5
  CometChatConversations,
6
6
  CometChatUIKitLoginListener,
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatConversations,
5
5
  CometChatUIKitLoginListener,
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatConversations,
5
5
  CometChatUIKitLoginListener,
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatConversations,
5
5
  CometChatUIKitLoginListener,
@@ -6,7 +6,7 @@ import {
6
6
  CometChatUIKit,
7
7
  UIKitSettingsBuilder,
8
8
  } from "@cometchat/chat-uikit-react";
9
- import { CometChat } from "@cometchat/chat-sdk-javascript";
9
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
10
10
  // IMPORTANT: css-variables.css MUST be imported here (inside the React island)
11
11
  // — global stylesheets imported in .astro files do not apply to client:only islands.
12
12
  import "@cometchat/chat-uikit-react/css-variables.css";
@@ -7,7 +7,7 @@ import {
7
7
  CometChatUIKit,
8
8
  UIKitSettingsBuilder,
9
9
  } from "@cometchat/chat-uikit-react";
10
- import { CometChat } from "@cometchat/chat-sdk-javascript";
10
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
11
11
  // css-variables.css is imported in app/globals.css — do NOT import it here
12
12
  import "./CometChatNoSSR.css";
13
13
 
@@ -6,7 +6,7 @@ import {
6
6
  CometChatUIKit,
7
7
  UIKitSettingsBuilder,
8
8
  } from "@cometchat/chat-uikit-react";
9
- import { CometChat } from "@cometchat/chat-sdk-javascript";
9
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
10
10
  // css-variables.css is imported in app/app.css — do NOT import it here
11
11
  import "./CometChatNoSSR.css";
12
12
 
@@ -4,7 +4,7 @@ import {
4
4
  CometChatMessageHeader,
5
5
  CometChatMessageList,
6
6
  } from "@cometchat/chat-uikit-react";
7
- import { CometChat } from "@cometchat/chat-sdk-javascript";
7
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
8
8
  import "./App.css";
9
9
 
10
10
  // The hardcoded user this chat connects to. Change to point at any
@@ -4,7 +4,7 @@ import {
4
4
  CometChatMessageHeader,
5
5
  CometChatMessageList,
6
6
  } from "@cometchat/chat-uikit-react";
7
- import { CometChat } from "@cometchat/chat-sdk-javascript";
7
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
8
8
  import "./CometChatMessenger.css";
9
9
 
10
10
  // The hardcoded user this chat connects to. Change to point at any
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatCallLogs,
5
5
  CometChatConversations,
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useEffect, useState } from "react";
3
- import { CometChat } from "@cometchat/chat-sdk-javascript";
3
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
4
4
  import {
5
5
  CometChatCallLogs,
6
6
  CometChatConversations,
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatCallLogs,
5
5
  CometChatConversations,
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatCallLogs,
5
5
  CometChatConversations,
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { CometChat } from "@cometchat/chat-sdk-javascript";
2
+ import type { CometChat } from "@cometchat/chat-sdk-javascript";
3
3
  import {
4
4
  CometChatCallLogs,
5
5
  CometChatConversations,
@@ -9,7 +9,9 @@
9
9
  "ai-feature": "Backend AI feature toggle. Requires an OpenAI API key (PUT /apps/{appId}/ai/settings) before the feature can be enabled (POST /apps/{appId}/features/ai.{ai_key}/enabled). The CLI prompts for the key once, stores it on the app's settings, then enables the feature. The `ai_key` field is the API suffix.",
10
10
  "dashboard-only": "Requires entering third-party config the user has to fetch themselves (Giphy/Stipop/Tenor API key, Chatwoot webhook URL, Intercom token, etc.) or making a multi-field configuration choice (Disappearing Messages interval, Message Shortcuts list). The CLI cannot automate these — falls back to opening the dashboard. `dashboard_path` is load-bearing for these entries.",
11
11
  "package-install": "Requires installing an additional npm package. The UI Kit's initiateAfterLogin() auto-calls enableCalling() which detects the calls SDK and wires up call buttons. Currently calls only.",
12
- "component-swap": "Requires replacing one UI Kit component with a drop-in variant. One-line change. The SDK currently ships exactly one such variant (CometChatCompactMessageComposer for rich text formatting); more variants will become catalog entries here as the SDK adds them."
12
+ "component-swap": "Requires replacing one UI Kit component with a drop-in variant. One-line change. The SDK currently ships exactly one such variant (CometChatCompactMessageComposer for rich text formatting); more variants will become catalog entries here as the SDK adds them.",
13
+ "moderation": "Backend moderation feature with configuration. Like 'extension' but takes a `config` payload (keyword lists, sensitivity levels, severity thresholds, quarantine action). The CLI's `apply-feature` walks an interactive config-collection step, then POSTs to /apps/{appId}/extensions/{id}/config plus the standard enable POST. `config_schema` describes the fields the user must supply.",
14
+ "calls-feature": "Calls SDK feature configured via CallSettingsBuilder (no backend toggle, no extension). The CLI's `apply-feature` command verifies the calls SDK is installed and points the agent at the matching per-family reference doc (e.g. `cometchat-react-calls/references/raise-hand.md`). The `reference_topic` field maps to the file slug; the `settings_flag` field is the CallSettingsBuilder method involved. Idempotency: persisted in state.applied_features."
13
15
  },
14
16
  "features": [
15
17
  {
@@ -118,12 +120,116 @@
118
120
  },
119
121
  {
120
122
  "id": "moderation",
121
- "name": "Moderation",
123
+ "name": "Moderation (overview)",
122
124
  "type": "default",
123
- "description": "Automatic content filtering. Requires moderation rule configuration in the dashboard.",
125
+ "description": "Umbrella entry moderation is the family of seven configurable backend features below (profanity-filter, image-moderation, data-masking, sentiment-analysis, xss-filter, slow-mode, virus-malware-scanner). Each has its own catalog entry of type 'moderation' that the CLI can configure interactively.",
124
126
  "components": ["CometChatMessageList"],
125
- "docs_topic": "core-features#moderation",
126
- "requires_dashboard_setup": true
127
+ "docs_topic": "core-features#moderation"
128
+ },
129
+ {
130
+ "id": "profanity-filter",
131
+ "name": "Profanity Filter",
132
+ "type": "moderation",
133
+ "extension_id": "profanity-filter",
134
+ "description": "Detects and filters profane language from messages. Replaces matched words with asterisks or rejects the message outright.",
135
+ "components": ["CometChatMessageList", "CometChatMessageComposer"],
136
+ "config_schema": {
137
+ "case_sensitivity": { "type": "enum", "values": ["case-sensitive", "case-insensitive"], "default": "case-insensitive", "prompt": "Case sensitivity for keyword matching?" },
138
+ "filter_profanities_for": { "type": "enum", "values": ["all", "specific-roles"], "default": "all", "prompt": "Apply filter to all users or specific roles?" },
139
+ "specific_roles": { "type": "array<string>", "when": { "filter_profanities_for": "specific-roles" }, "prompt": "Comma-separated role names" },
140
+ "profane_words": { "type": "array<string>", "default": [], "prompt": "Custom words to add to the profanity list (comma-separated; empty for default list only)" },
141
+ "white_listed_words": { "type": "array<string>", "default": [], "prompt": "Words to whitelist that would otherwise match (comma-separated)" },
142
+ "rule": { "type": "enum", "values": ["mask", "drop", "tag"], "default": "mask", "prompt": "What to do with matched messages? (mask: replace with ****, drop: reject, tag: deliver but flag)" }
143
+ },
144
+ "docs_topic": "extensions#profanity-filter"
145
+ },
146
+ {
147
+ "id": "image-moderation",
148
+ "name": "Image Moderation",
149
+ "type": "moderation",
150
+ "extension_id": "image-moderation",
151
+ "description": "Detects unsafe content in images (NSFW, violence, etc.) using ML-based classification. Configurable confidence thresholds.",
152
+ "components": ["CometChatMessageList"],
153
+ "config_schema": {
154
+ "explicit_threshold": { "type": "number", "min": 0, "max": 100, "default": 70, "prompt": "Threshold for explicit content (0-100; lower = stricter)" },
155
+ "suggestive_threshold": { "type": "number", "min": 0, "max": 100, "default": 70, "prompt": "Threshold for suggestive content" },
156
+ "violence_threshold": { "type": "number", "min": 0, "max": 100, "default": 70, "prompt": "Threshold for violent content" },
157
+ "drugs_threshold": { "type": "number", "min": 0, "max": 100, "default": 70, "prompt": "Threshold for drug-related content" },
158
+ "rule": { "type": "enum", "values": ["block", "blur", "tag"], "default": "blur", "prompt": "Action for flagged images?" }
159
+ },
160
+ "docs_topic": "extensions#image-moderation"
161
+ },
162
+ {
163
+ "id": "data-masking",
164
+ "name": "Data Masking",
165
+ "type": "moderation",
166
+ "extension_id": "data-masking",
167
+ "description": "Masks PII (phone numbers, email addresses, credit cards, SSNs) in messages. Critical for healthcare, fintech, marketplace apps.",
168
+ "components": ["CometChatMessageList"],
169
+ "config_schema": {
170
+ "mask_phone": { "type": "boolean", "default": true, "prompt": "Mask phone numbers?" },
171
+ "mask_email": { "type": "boolean", "default": true, "prompt": "Mask email addresses?" },
172
+ "mask_ssn": { "type": "boolean", "default": false, "prompt": "Mask US Social Security Numbers?" },
173
+ "mask_credit_card": { "type": "boolean", "default": true, "prompt": "Mask credit card numbers?" },
174
+ "custom_patterns": { "type": "array<{name:string,regex:string}>", "default": [], "prompt": "Custom regex patterns to mask (e.g. internal IDs)" },
175
+ "rule": { "type": "enum", "values": ["mask", "drop", "tag"], "default": "mask", "prompt": "Action for messages containing matched data?" }
176
+ },
177
+ "docs_topic": "extensions#data-masking"
178
+ },
179
+ {
180
+ "id": "sentiment-analysis",
181
+ "name": "Sentiment Analysis",
182
+ "type": "moderation",
183
+ "extension_id": "sentiment-analysis",
184
+ "description": "Detects negative sentiment / toxicity in messages. Optionally surfaces a 'View confidently' confirm dialog before showing flagged messages.",
185
+ "components": ["CometChatMessageList"],
186
+ "config_schema": {
187
+ "threshold": { "type": "number", "min": 0, "max": 100, "default": 50, "prompt": "Sentiment threshold (0-100; lower = more aggressive)" },
188
+ "rule": { "type": "enum", "values": ["confirm-view", "tag", "drop"], "default": "confirm-view", "prompt": "Action for flagged messages?" }
189
+ },
190
+ "docs_topic": "extensions#sentiment-analysis"
191
+ },
192
+ {
193
+ "id": "xss-filter",
194
+ "name": "XSS Filter",
195
+ "type": "moderation",
196
+ "extension_id": "xss-filter",
197
+ "description": "Strips HTML/script injection from messages before delivery. Critical for chat surfaces that render rich text.",
198
+ "components": ["CometChatMessageList"],
199
+ "config_schema": {
200
+ "strict_mode": { "type": "boolean", "default": true, "prompt": "Strict mode (blocks all HTML; safer)?" },
201
+ "allowed_tags": { "type": "array<string>", "default": ["b", "i", "u", "strong", "em"], "when": { "strict_mode": false }, "prompt": "Allowed HTML tags (when strict mode off)" }
202
+ },
203
+ "docs_topic": "extensions#xss-filter"
204
+ },
205
+ {
206
+ "id": "slow-mode",
207
+ "name": "Slow Mode",
208
+ "type": "moderation",
209
+ "extension_id": "slow-mode",
210
+ "description": "Rate-limits how often a user can post in a conversation/group. Reduces spam in busy channels.",
211
+ "components": ["CometChatMessageComposer"],
212
+ "config_schema": {
213
+ "interval_seconds": { "type": "number", "min": 1, "max": 3600, "default": 5, "prompt": "Minimum seconds between messages from the same user" },
214
+ "applies_to": { "type": "enum", "values": ["all", "groups-only", "specific-groups"], "default": "groups-only", "prompt": "Apply slow mode where?" },
215
+ "specific_group_ids": { "type": "array<string>", "when": { "applies_to": "specific-groups" }, "prompt": "Group IDs (comma-separated)" }
216
+ },
217
+ "docs_topic": "extensions#slow-mode"
218
+ },
219
+ {
220
+ "id": "virus-malware-scanner",
221
+ "name": "Virus / Malware Scanner",
222
+ "type": "moderation",
223
+ "extension_id": "virus-malware-scanner",
224
+ "description": "Scans uploaded files (images, documents, archives) for malware before delivery. Required for healthcare, legal, finance apps.",
225
+ "components": ["CometChatMessageList", "CometChatMessageComposer"],
226
+ "config_schema": {
227
+ "scan_images": { "type": "boolean", "default": true, "prompt": "Scan image uploads?" },
228
+ "scan_documents": { "type": "boolean", "default": true, "prompt": "Scan document uploads (.pdf, .docx, etc.)?" },
229
+ "scan_archives": { "type": "boolean", "default": true, "prompt": "Scan archive uploads (.zip, .tar.gz)?" },
230
+ "rule": { "type": "enum", "values": ["block", "quarantine", "tag"], "default": "block", "prompt": "Action when malware detected?" }
231
+ },
232
+ "docs_topic": "extensions#virus-malware-scanner"
127
233
  },
128
234
  {
129
235
  "id": "bitly",
@@ -355,6 +461,66 @@
355
461
  "swap_from": "CometChatMessageComposer",
356
462
  "swap_to": "CometChatCompactMessageComposer",
357
463
  "docs_topic": "core-features#rich-text-formatting"
464
+ },
465
+ {
466
+ "id": "call-recording",
467
+ "name": "Call Recording",
468
+ "type": "calls-feature",
469
+ "description": "Record calls to cloud storage. Built into Calls SDK; configured via CallSettingsBuilder. Server-side recording requires the Recording add-on enabled on your CometChat plan.",
470
+ "settings_flag": "startRecordingOnCallStart",
471
+ "reference_topic": "recording",
472
+ "platforms_supported": ["web", "react-native", "angular", "ios", "android-v5", "android-v6", "flutter-v5", "flutter-v6"],
473
+ "docs_topic": "calls/recording"
474
+ },
475
+ {
476
+ "id": "screen-share",
477
+ "name": "Screen Sharing",
478
+ "type": "calls-feature",
479
+ "description": "Share screen during a call. Built into Calls SDK; configured via CallSettingsBuilder hideScreenShareButton flag. Mobile platforms have OS-level gating (iOS broadcast extension, Android MediaProjection).",
480
+ "settings_flag": "hideScreenShareButton",
481
+ "reference_topic": "screen-sharing",
482
+ "platforms_supported": ["web", "react-native", "angular", "ios", "android-v5", "android-v6", "flutter-v5", "flutter-v6"],
483
+ "docs_topic": "calls/screen-sharing"
484
+ },
485
+ {
486
+ "id": "virtual-background",
487
+ "name": "Virtual Background",
488
+ "type": "calls-feature",
489
+ "description": "Blur or replace the user's background during a call. JavaScript-only feature — not available on iOS/Android/RN browsers (mobile webviews don't ship the ML Kit needed).",
490
+ "settings_flag": "hideVirtualBackgroundButton",
491
+ "reference_topic": "virtual-background",
492
+ "platforms_supported": ["web", "angular"],
493
+ "docs_topic": "calls/virtual-background"
494
+ },
495
+ {
496
+ "id": "raise-hand",
497
+ "name": "Raise Hand",
498
+ "type": "calls-feature",
499
+ "description": "Participants can raise a hand to signal they want to speak. Built into Calls SDK.",
500
+ "settings_flag": "hideRaiseHandButton",
501
+ "reference_topic": "raise-hand",
502
+ "platforms_supported": ["web", "react-native", "angular", "ios", "android-v5", "android-v6", "flutter-v5", "flutter-v6"],
503
+ "docs_topic": "calls/raise-hand"
504
+ },
505
+ {
506
+ "id": "picture-in-picture",
507
+ "name": "Picture-in-Picture",
508
+ "type": "calls-feature",
509
+ "description": "Minimize an in-progress call into a floating window so the user can keep using the rest of your app (or other apps on mobile). Per-platform constraints — iOS PIP requires a multitasking-capable iPad or iOS 15+ iPhone, Android requires API 26+.",
510
+ "settings_flag": "hidePIPButton",
511
+ "reference_topic": "picture-in-picture",
512
+ "platforms_supported": ["web", "react-native", "angular", "ios", "android-v5", "android-v6", "flutter-v5", "flutter-v6"],
513
+ "docs_topic": "calls/picture-in-picture"
514
+ },
515
+ {
516
+ "id": "idle-timeout",
517
+ "name": "Idle Timeout",
518
+ "type": "calls-feature",
519
+ "description": "Auto-end a call after a configurable period of no activity. Prevents zombie calls + unbounded billing. Built into Calls SDK; configured via CallSettingsBuilder callIdleTime.",
520
+ "settings_flag": "callIdleTime",
521
+ "reference_topic": "idle-timeout",
522
+ "platforms_supported": ["web", "react-native", "angular", "ios", "android-v5", "android-v6", "flutter-v5", "flutter-v6"],
523
+ "docs_topic": "calls/idle-timeout"
358
524
  }
359
525
  ]
360
526
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cometchat/skills-cli",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "CLI for the CometChat skills v3 architecture — auth, provision, detect, apply, verify CometChat integrations in React/Next.js/React-Router/Astro/Expo/React-Native/Angular/Android/iOS/Flutter projects.",
5
5
  "type": "module",
6
6
  "license": "MIT",