@cometchat/skills 4.2.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -12
- package/bin/install.js +32 -4
- package/package.json +1 -1
- package/skills/cometchat/SKILL.md +236 -17
- package/skills/cometchat-android-v5-core/SKILL.md +16 -0
- package/skills/cometchat-android-v6-calls/SKILL.md +1 -1
- package/skills/cometchat-android-v6-core/SKILL.md +202 -2
- package/skills/cometchat-android-v6-migration/SKILL.md +1 -1
- package/skills/cometchat-angular-core/SKILL.md +22 -0
- package/skills/cometchat-astro-patterns/SKILL.md +20 -0
- package/skills/cometchat-core/SKILL.md +163 -0
- package/skills/cometchat-flutter-v5-core/SKILL.md +17 -0
- package/skills/cometchat-flutter-v6-calls/SKILL.md +10 -10
- package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +3 -3
- package/skills/cometchat-flutter-v6-core/SKILL.md +178 -1
- package/skills/cometchat-flutter-v6-push/SKILL.md +2 -2
- package/skills/cometchat-flutter-v6-testing/SKILL.md +2 -2
- package/skills/cometchat-ios-core/SKILL.md +142 -0
- package/skills/cometchat-native-bare-patterns/SKILL.md +22 -1
- package/skills/cometchat-native-calls/SKILL.md +63 -5
- package/skills/cometchat-native-components/SKILL.md +7 -5
- package/skills/cometchat-native-core/SKILL.md +209 -6
- package/skills/cometchat-native-expo-patterns/SKILL.md +20 -1
- package/skills/cometchat-native-features/SKILL.md +57 -34
- package/skills/cometchat-native-troubleshooting/SKILL.md +62 -0
- package/skills/cometchat-nextjs-patterns/SKILL.md +28 -0
- package/skills/cometchat-react-patterns/SKILL.md +13 -0
- package/skills/cometchat-react-router-patterns/SKILL.md +33 -0
package/README.md
CHANGED
|
@@ -74,6 +74,21 @@ Then in your IDE:
|
|
|
74
74
|
/cometchat add chat to my app
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
Or add voice & video calling (new in v4.2):
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
/cometchat add voice and video calls to my app
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
When integrating chat, the dispatcher now asks **how** you want to customize (new in v4.3):
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
◉ Visually — drag-and-drop in browser
|
|
87
|
+
○ In code — code-driven defaults
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Pick **Visually** and the dispatcher opens CometChat's Visual Builder in your browser, waits while you customize colors / layout / features, then fetches the config and emits the integration into your existing app — no ZIP downloads, no manual file copying. Works for React, React Native, iOS, Android v6, and Flutter v6. Angular customers auto-route to the In-code path (Visual Builder doesn't ship Angular code yet).
|
|
91
|
+
|
|
77
92
|
## What happens
|
|
78
93
|
|
|
79
94
|
1. **Detects** your framework (React / Next.js / React Router / Astro / Expo / bare React Native / Angular / Android / Flutter / iOS), router, env prefix, existing auth system
|
|
@@ -87,18 +102,24 @@ No templates, no experiences to pick — the agent writes real code that fits yo
|
|
|
87
102
|
|
|
88
103
|
## Supported frameworks
|
|
89
104
|
|
|
90
|
-
| Framework |
|
|
91
|
-
|
|
92
|
-
| React.js / Vite / CRA | ✅ (
|
|
93
|
-
| Next.js (App Router + Pages Router) | ✅ (
|
|
94
|
-
| React Router v6 / v7 | ✅ (
|
|
95
|
-
| Astro (React islands) | ✅ (
|
|
96
|
-
| Expo (managed + Expo Router) | ✅ (
|
|
97
|
-
| Bare React Native (CLI) | ✅ (
|
|
98
|
-
| Angular 12-15 | ✅ (
|
|
99
|
-
| Android (V5 stable + V6 beta) | ✅ (
|
|
100
|
-
| Flutter (V5 stable + V6 beta) | ✅ (
|
|
101
|
-
| iOS (V5 stable) | ✅
|
|
105
|
+
| Framework | Chat | Voice & Video Calls | Visual Builder |
|
|
106
|
+
|---|---|---|---|
|
|
107
|
+
| React.js / Vite / CRA | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
108
|
+
| Next.js (App Router + Pages Router) | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
109
|
+
| React Router v6 / v7 | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
110
|
+
| Astro (React islands) | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
111
|
+
| Expo (managed + Expo Router) | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
112
|
+
| Bare React Native (CLI) | ✅ | ✅ Ringing + Session | ✅ (v4.3) |
|
|
113
|
+
| Angular 12-15 | ✅ | ✅ Ringing + Session | ❌ (auto-falls back to In code) |
|
|
114
|
+
| Android (V5 stable + V6 beta) | ✅ | ✅ Ringing + Session | ✅ V6 (v4.3) |
|
|
115
|
+
| Flutter (V5 stable + V6 beta) | ✅ | ✅ Ringing + Session | ✅ V6 chat-only (v4.3) |
|
|
116
|
+
| iOS (V5 stable) | ✅ | ✅ Ringing + Session | ⏸ Pending Xcode 26 vendor fix |
|
|
117
|
+
|
|
118
|
+
**Calling modes:**
|
|
119
|
+
- **Ringing** — kit-driven incoming/outgoing call surfaces, system-level VoIP push (CallKit on iOS, ConnectionService on Android, web push fallback on browsers). Production-grade for 1:1 + group calls.
|
|
120
|
+
- **Session** — both peers join a shared `/meet/:sessionId` URL. No ringing. For embedded meetings, scheduled calls, support flows, broadcast use-cases.
|
|
121
|
+
|
|
122
|
+
The dispatcher asks Ringing vs Session up front in Step 3.0.
|
|
102
123
|
|
|
103
124
|
## After the first integration
|
|
104
125
|
|
package/bin/install.js
CHANGED
|
@@ -652,11 +652,39 @@ async function delegateToSkillsCli({ skills, families, isGlobal }) {
|
|
|
652
652
|
];
|
|
653
653
|
if (isGlobal) npxArgs.push("-g");
|
|
654
654
|
|
|
655
|
+
// F42 (2026-05-22) + F79 (2026-05-28): on Windows, `npx` is `npx.cmd` /
|
|
656
|
+
// `npx.ps1` and Node's spawn can't resolve the shim cleanly. The original
|
|
657
|
+
// F42 fix used `shell: true`, but that still fails in some Windows envs
|
|
658
|
+
// (nested npx, PowerShell execution-policy restrictions) with
|
|
659
|
+
// `spawn npx ENOENT` — reported by a customer on 2026-05-28.
|
|
660
|
+
//
|
|
661
|
+
// F79: on Windows, resolve npm's bundled `npx-cli.js` next to the running
|
|
662
|
+
// Node binary and invoke it directly via `process.execPath`. This bypasses
|
|
663
|
+
// the .cmd/.ps1 shim entirely. Falls back to the F42 `shell: true` path if
|
|
664
|
+
// npx-cli.js can't be located (pnpm / yarn / custom Node installs without
|
|
665
|
+
// a bundled npm). macOS/Linux keep the plain `spawn("npx")` path unchanged.
|
|
666
|
+
const isWindows = process.platform === "win32";
|
|
667
|
+
|
|
668
|
+
let spawnCmd = "npx";
|
|
669
|
+
let spawnArgs = npxArgs;
|
|
670
|
+
let spawnOpts = { stdio: "inherit" };
|
|
671
|
+
|
|
672
|
+
if (isWindows) {
|
|
673
|
+
// npm ships npx-cli.js at <node-dir>/node_modules/npm/bin/npx-cli.js
|
|
674
|
+
const nodeDir = path.dirname(process.execPath);
|
|
675
|
+
const npxCli = path.join(nodeDir, "node_modules", "npm", "bin", "npx-cli.js");
|
|
676
|
+
if (fs.existsSync(npxCli)) {
|
|
677
|
+
spawnCmd = process.execPath; // the current node binary
|
|
678
|
+
spawnArgs = [npxCli, ...npxArgs];
|
|
679
|
+
spawnOpts = { stdio: "inherit" }; // no shell needed — direct node invocation
|
|
680
|
+
} else {
|
|
681
|
+
// Fallback: F42 path (shim via shell). Covers pnpm/yarn/custom installs.
|
|
682
|
+
spawnOpts = { stdio: "inherit", shell: true };
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
655
686
|
return new Promise((resolve) => {
|
|
656
|
-
const child = spawn(
|
|
657
|
-
stdio: "inherit",
|
|
658
|
-
shell: false,
|
|
659
|
-
});
|
|
687
|
+
const child = spawn(spawnCmd, spawnArgs, spawnOpts);
|
|
660
688
|
child.on("close", (code) => {
|
|
661
689
|
if (code === 0) {
|
|
662
690
|
// Post-spawn success: celebrate + concrete next steps
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat
|
|
3
|
-
description: Entry-point for CometChat integration in any React, React Native, Angular, Android, Flutter, or iOS project — web (React/Next.js/React Router/Astro), React Native (Expo/bare), Angular (12-15), native Android (
|
|
3
|
+
description: Entry-point for CometChat integration in any React, React Native, Angular, Android, Flutter, or iOS project — web (React/Next.js/React Router/Astro), React Native (Expo/bare), Angular (12-15), native Android (V6 stable, V5 legacy), Flutter (V6 stable, V5 legacy), and native iOS (V5 stable). Detects the framework, gathers requirements through an interactive conversation, and writes production-quality integration code.
|
|
4
4
|
license: "MIT"
|
|
5
5
|
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|
|
6
6
|
metadata:
|
|
@@ -28,11 +28,11 @@ framework first and routes to the right ones.
|
|
|
28
28
|
| **Web** | React (Vite/CRA), Next.js, React Router v6/v7, Astro |
|
|
29
29
|
| **React Native** | Expo (managed + Expo Router), bare RN CLI |
|
|
30
30
|
| **Angular** | Angular 12-15 (Angular CLI / NgModule) |
|
|
31
|
-
| **Android** |
|
|
32
|
-
| **Flutter** |
|
|
31
|
+
| **Android** | V6 stable (Compose + Kotlin Views, `chatuikit-{compose,kotlin}-android:6.x`) / V5 legacy (Java + Kotlin Views, `chat-uikit-android:5.x`) |
|
|
32
|
+
| **Flutter** | V6 stable (Bloc-based, `cometchat_chat_uikit:^6.0`) / V5 legacy (GetX-based, `cometchat_chat_uikit:^5.2`) |
|
|
33
33
|
| **iOS** | V5 stable (Swift; SwiftUI + UIKit hosting; `CometChatUIKitSwift:~> 5.1`) |
|
|
34
34
|
|
|
35
|
-
The web family loads `@cometchat/chat-uikit-react` + `@cometchat/chat-sdk-javascript`. The RN family loads `@cometchat/chat-uikit-react-native` + `@cometchat/chat-sdk-react-native`. The Angular family loads `@cometchat/chat-uikit-angular` + `@cometchat/chat-sdk-javascript`. The Android family loads `com.cometchat:
|
|
35
|
+
The web family loads `@cometchat/chat-uikit-react` + `@cometchat/chat-sdk-javascript`. The RN family loads `@cometchat/chat-uikit-react-native` + `@cometchat/chat-sdk-react-native`. The Angular family loads `@cometchat/chat-uikit-angular` + `@cometchat/chat-sdk-javascript`. The Android family loads `com.cometchat:chatuikit-{compose,kotlin}-android:6.x` (V6 — stable, recommended) or `com.cometchat:chat-uikit-android:5.x` (V5 — legacy) from Maven Central. The Flutter family loads `cometchat_chat_uikit:^6.0` (V6 — stable, recommended; calls fold into the same package) or `cometchat_chat_uikit:^5.2` (V5 — legacy; pair with `cometchat_calls_uikit:^5.0` for calls) from the Cloudsmith Dart pub-hosted registry. The dispatcher decides which set after Step 1's detection.
|
|
36
36
|
|
|
37
37
|
## How v3 works
|
|
38
38
|
|
|
@@ -72,17 +72,21 @@ npx @cometchat/skills-cli detect --json
|
|
|
72
72
|
|
|
73
73
|
The JSON output includes `framework` (one of `reactjs`, `nextjs`, `react-router`, `astro`, `expo`, `react-native`, `angular`, `android`, `flutter`, `ios`, or `null`), framework-specific fields (`router`, `expo_mode`, `react_native_version`, `android_version`, `flutter_version`, `env_prefix`), and a `compatibility.supported` flag. If `supported` is `false`, stop and surface the warnings.
|
|
74
74
|
|
|
75
|
-
**Android — `android_version` is load-bearing.** When `framework === "android"`, the detect output includes `android_version: "v5" | "v6" | null`. The cohort selects which V5 or V6 pattern set to load —
|
|
75
|
+
**Android — `android_version` is load-bearing.** When `framework === "android"`, the detect output includes `android_version: "v5" | "v6" | null`. The cohort selects which V5 or V6 pattern set to load — V6 (stable + recommended, `chatuikit-{compose,kotlin}-android:6.x`, Compose + Kotlin Views split) and V5 (legacy, `chat-uikit-android:5.x`, Java + Kotlin Views) are different SDKs with different APIs. Treat them as separate routing targets even though both live under `--family android`. **V6 went GA 2026-05-25** ([docs](https://www.cometchat.com/docs/ui-kit/android/v6/overview)) — was beta in earlier `/cometchat` releases; the prompt + recommendation flipped from V5 → V6 in v4.3.0.
|
|
76
76
|
|
|
77
77
|
If `android_version` is `null`, the project is greenfield (no cometchat dep yet). Ask the user:
|
|
78
|
-
> "Which CometChat Android UI Kit do you want to use?
|
|
78
|
+
> "Which CometChat Android UI Kit do you want to use? V6 is the latest stable SDK (recommended; Compose + Kotlin Views split, went GA 2026-05-25). V5 is the legacy SDK (Java + Kotlin Views — still supported but no new features)."
|
|
79
79
|
|
|
80
|
-
Save the choice into `.cometchat/config.json` under `
|
|
80
|
+
Save the choice into `.cometchat/config.json` under `androidVersion`:
|
|
81
|
+
```bash
|
|
82
|
+
npx @cometchat/skills-cli config save --android-version v5 --json
|
|
83
|
+
```
|
|
84
|
+
The CLI accepts `--android-version v5` / `v6` and `--flutter-version v5` / `v6` flags (added 2026-05-22 — F46 fix). Subsequent `/cometchat` runs read this from config and don't re-ask.
|
|
81
85
|
|
|
82
|
-
**Flutter — `flutter_version` is load-bearing too.** When `framework === "flutter"`, the detect output includes `flutter_version: "v5" | "v6" | null`.
|
|
86
|
+
**Flutter — `flutter_version` is load-bearing too.** When `framework === "flutter"`, the detect output includes `flutter_version: "v5" | "v6" | null`. V6 (stable + recommended) is Bloc-based (`cometchat_chat_uikit:^6.0`, calls folded into the same package). V5 (legacy) is GetX-based (`cometchat_chat_uikit:^5.2`; pair with `cometchat_calls_uikit:^5.0` for calls). The two cohorts have different state-management primitives, different barrel exports, and different theme APIs — never mix them. Same `--family flutter` install ships both sets; routing picks the right one. **V6 went GA 2026-05-25** ([docs](https://www.cometchat.com/docs/ui-kit/flutter/overview)) at version 6.0.1 — was `6.0.0-beta2` in earlier `/cometchat` releases; the prompt + recommendation flipped from V5 → V6 in v4.3.0.
|
|
83
87
|
|
|
84
88
|
If `flutter_version` is `null`, ask the user:
|
|
85
|
-
> "Which CometChat Flutter UI Kit do you want to use?
|
|
89
|
+
> "Which CometChat Flutter UI Kit do you want to use? V6 is the latest stable SDK (recommended; Bloc-based, calls folded into the same package, went GA 2026-05-25 at 6.0.1). V5 is the legacy SDK (GetX-based — still supported but no new features)."
|
|
86
90
|
|
|
87
91
|
Save the choice into `.cometchat/config.json` under `flutter_version`.
|
|
88
92
|
|
|
@@ -124,7 +128,7 @@ Save the choice into `.cometchat/config.json` under `flutter_version`.
|
|
|
124
128
|
|
|
125
129
|
**For Flutter (`flutter`):**
|
|
126
130
|
- `pubspec.yaml` — package name + Dart SDK constraint + Flutter SDK constraint + `dependencies:` (this is where `cometchat_chat_uikit` lives)
|
|
127
|
-
- For V5: a typical project has BOTH `cometchat_chat_uikit:^5.2` AND `cometchat_calls_uikit:^5.0` if calls are needed. V6 folds calls into the single `cometchat_chat_uikit:^6.0
|
|
131
|
+
- For V5: a typical project has BOTH `cometchat_chat_uikit:^5.2` AND `cometchat_calls_uikit:^5.0` if calls are needed. V6 folds calls into the single `cometchat_chat_uikit:^6.0` package (no separate calls package; depends on `cometchat_calls_sdk: >=5.0.2 <6.0.0` transitively).
|
|
128
132
|
- `lib/` — Dart source. The app entry is `lib/main.dart` (the `void main() => runApp(...)` site); init goes in `main()` or in a top-level `Stateful`/`State.initState()`.
|
|
129
133
|
- `lib/<config>.dart` (or similar) — credentials. There is NO Flutter `.env` convention — credentials are typically defined as `const` Dart values in a config file, OR injected at compile time via `--dart-define=COMETCHAT_APP_ID=...` flags read inside Dart with `String.fromEnvironment`. NOT a `.env` file at runtime.
|
|
130
134
|
- `android/app/build.gradle` and `ios/Runner/Info.plist` — platform-specific config (FCM service registration, Push capabilities, microphone/camera Info.plist entries for calls). Flutter projects DO have these subdirs but they're configured Flutter-side; do not run the native skill flows.
|
|
@@ -691,6 +695,28 @@ After writing credentials, don't echo the Auth Key back in the transcript. Confi
|
|
|
691
695
|
|
|
692
696
|
This is the core of v3. A multi-step conversation that gathers everything you need before writing a single line of code.
|
|
693
697
|
|
|
698
|
+
#### Step 3 sub-flow order (NON-NEGOTIABLE — run in this exact order)
|
|
699
|
+
|
|
700
|
+
1. **3.0** — Branch by product (chat vs calls) — sets `product`
|
|
701
|
+
2. **3.1** — Customization preference (Visually vs In code) — sets `customize` ← **MUST run before 3a**
|
|
702
|
+
3. **3a** — Intent ("What are you building?")
|
|
703
|
+
4. **3b** — Recommendation (skip on Visually path per §3.1)
|
|
704
|
+
5. **3c** — Placement
|
|
705
|
+
6. **3d** — Authentication
|
|
706
|
+
7. **3e** — User mapping (optional)
|
|
707
|
+
8. **3f** — Plan confirmation
|
|
708
|
+
|
|
709
|
+
**Common skip-bug (observed 2026-05-22 in a real Android run):** the agent
|
|
710
|
+
runs 3a + 3c after Step 2 (provision) and goes straight to writing code,
|
|
711
|
+
skipping 3.1 entirely. **Step 3.1 must fire on EVERY chat-messaging
|
|
712
|
+
integration on a builder-supported platform** (react, react-native, ios,
|
|
713
|
+
android, flutter — see §3.1 table). The only exception is Angular, which
|
|
714
|
+
auto-routes to In-code with the explicit fallback note.
|
|
715
|
+
|
|
716
|
+
The customer-visible symptom of the skip: agent never asks "How do you
|
|
717
|
+
want to customize your chat experience? Visually vs In code". Customer
|
|
718
|
+
gets the In-code path silently. Visual Builder feature is invisible to them.
|
|
719
|
+
|
|
694
720
|
#### 3.0. Branch by product (chat vs calls)
|
|
695
721
|
|
|
696
722
|
`product` decides which dispatcher (chat or calls) handles the rest of Step 3. Resolve it in this priority order:
|
|
@@ -736,6 +762,179 @@ Once `product` is resolved, route — the rest of Step 3 is chat-shaped, and a c
|
|
|
736
762
|
|
|
737
763
|
**Why this branch comes before 3a:** Step 3a's options are all chat archetypes (Messaging app, Marketplace, SaaS, …). For a `voice-video` product, that taxonomy doesn't apply — the user isn't picking *where chat lives*, they're picking *where the call trigger lives* (profile button vs `/calls` route vs always-on lock-screen-ringer). The `cometchat-calls` dispatcher owns its own placement question with the right options for the calls surface.
|
|
738
764
|
|
|
765
|
+
#### 3.1 — Customization preference (Visually vs In code)
|
|
766
|
+
|
|
767
|
+
**Only runs if** `product` includes `chat-messaging` (skip entirely for `voice-video` — the Visual Builder is chat-only today).
|
|
768
|
+
|
|
769
|
+
**Only runs if** the resolved framework maps to a builder-supported platform. Use this table — these are the same cohorts the dashboard's Visual Builder emits code for:
|
|
770
|
+
|
|
771
|
+
| Skills cohort/framework | Builder `platform` value | If Visually picked |
|
|
772
|
+
|---|---|---|
|
|
773
|
+
| `reactjs`, `nextjs`, `react-router`, `astro` | `react` | Build with React UI Kit, mount via `<CometChatApp />` |
|
|
774
|
+
| `expo`, `react-native` | `react-native` | Build with RN UI Kit, mount in app root |
|
|
775
|
+
| `android-v5`, `android-v6` | `android` | Build with Android UI Kit (V5 schema; V6 customers get a one-line migration shim) |
|
|
776
|
+
| `ios` | `ios` | Build with iOS UI Kit |
|
|
777
|
+
| `flutter-v5`, `flutter-v6` | `flutter` | Build with Flutter UI Kit (V5 schema; V6 same shim story as Android) |
|
|
778
|
+
| `angular` | **not supported** | See "Angular" note below — auto-route to In code with an explicit one-time message. |
|
|
779
|
+
|
|
780
|
+
##### Angular — explicit fallback
|
|
781
|
+
|
|
782
|
+
The dashboard's Visual Builder export pipeline doesn't have an Angular emitter — `https://preview.cometchat.com/downloads/cometchat-builder-{platform}.zip` ships only `react`, `react-native`, `ios`, `android`, `flutter`. Skills can't bridge that gap by emitting Angular code from React/JSON output because the kit's Angular package (`@cometchat/chat-uikit-angular`) uses different selectors, modules, and content-projection slots than React.
|
|
783
|
+
|
|
784
|
+
**For Angular projects:**
|
|
785
|
+
1. **Do NOT show the Visually-vs-In-code prompt.** It's a dead choice — there's no Visually path to take.
|
|
786
|
+
2. **Surface this once, then move on.** Print a brief, friendly note in the chat — single message, no follow-up question:
|
|
787
|
+
|
|
788
|
+
> *"The Visual Builder doesn't ship Angular code yet (the dashboard's export covers React / React Native / iOS / Android / Flutter today). I'll set up the code-driven Angular integration instead — you can theme via `CometChatThemeService` later. Want to be notified when an Angular Visual Builder lands? Drop a 👍 on https://github.com/cometchat/cometchat-skills/discussions/categories/feature-requests."*
|
|
789
|
+
|
|
790
|
+
Tweak wording to fit the conversation tone (greeting the user by name if `meta.name` is set, etc.) but keep it factual: WHY it's missing + WHAT we're doing instead + WHERE to register interest.
|
|
791
|
+
|
|
792
|
+
3. **Set `customize=code` in `.cometchat/config.json`** so subsequent `/cometchat` reruns skip the prompt silently. Run via Bash:
|
|
793
|
+
```bash
|
|
794
|
+
npx @cometchat/skills-cli config save --customize code --json
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
4. **Continue to Step 3a (intent).** The rest of the chat flow proceeds as normal — `cometchat-angular-{core,components,placement,patterns}` handle the actual code emission.
|
|
798
|
+
|
|
799
|
+
5. **Stale `customize=visual` from a previous framework?** If `auth me`/config carries `customize=visual` from a prior run on a different framework, OVERWRITE it to `code` for this Angular session — same `config save` call as above — and surface the same note. The dispatcher must never try to call `builder create --platform angular` (the CLI rejects it with "Missing or invalid --platform"; the customer would see a confusing CLI error instead of the explanatory note).
|
|
800
|
+
|
|
801
|
+
##### Next.js Pages Router — explicit fallback (F17)
|
|
802
|
+
|
|
803
|
+
Visual Builder is architecturally incompatible with Next.js **Pages Router**. The canonical's `src/CometChat/` has 25+ per-component CSS imports, but Pages Router enforces "global CSS only in `pages/_app.tsx`" — Webpack fails the build on the first component import. App Router tolerates per-component CSS; Pages Router does not. There's no client-side workaround short of rewriting the canonical's styling architecture.
|
|
804
|
+
|
|
805
|
+
The CLI guards this — `builder create --platform react` will refuse when `detect.router === "pages"` with an explicit F17 message. The dispatcher must surface this BEFORE calling the CLI, same shape as the Angular fallback:
|
|
806
|
+
|
|
807
|
+
**For Next.js Pages Router projects (`detect.framework === "nextjs"` AND `detect.router === "pages"`):**
|
|
808
|
+
|
|
809
|
+
1. **Do NOT show the Visually-vs-In-code prompt.** Same dead choice as Angular.
|
|
810
|
+
2. **Surface this once:**
|
|
811
|
+
|
|
812
|
+
> *"Visual Builder isn't compatible with your Pages Router setup — the canonical's per-component CSS imports break Pages Router's strict 'global CSS in `_app.tsx` only' rule (F17). Two options: migrate to App Router (the Next.js 13+ default), or stay on Pages Router and I'll use the code-driven integration. Want to be notified when Pages Router compatibility lands? https://github.com/cometchat/cometchat-skills/discussions/categories/feature-requests"*
|
|
813
|
+
|
|
814
|
+
3. **Set `customize=code` in `.cometchat/config.json`**:
|
|
815
|
+
```bash
|
|
816
|
+
npx @cometchat/skills-cli config save --customize code --json
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
4. **Continue to Step 3a (intent).** `cometchat-nextjs-patterns` §4 covers the Pages Router provider mount (`_app.tsx` with `next/dynamic` + `ssr: false`).
|
|
820
|
+
|
|
821
|
+
5. **App Router projects (`detect.router === "app"`)** are fully supported by Visual Builder — proceed with the Visually-vs-In-code prompt as normal.
|
|
822
|
+
|
|
823
|
+
**If config has `customize` set from a previous run AND the framework is in the builder-supported table above**, confirm it (*"Continuing the visual-builder flow you started last time — builder ID `abc123`. Re-fetch latest config? [Y/n]"* for `customize=visual`; just *"Continuing in-code customization."* for `customize=code`) and skip the question. On `Y` for the re-fetch, jump straight to the `builder fetch` step below.
|
|
824
|
+
|
|
825
|
+
**If `.cometchat/builder.json` already exists** (customer started a builder in a prior `/cometchat` invocation but didn't finish), surface it before asking: *"Found an existing builder for this project (`abc123`, created 3 days ago). Resume it, start fresh, or switch to code-driven?"* — three options via `AskUserQuestion`. "Resume" jumps to the `builder fetch` step; "Start fresh" creates a new one; "Code-driven" sets `customize=code` and falls through to 3a.
|
|
826
|
+
|
|
827
|
+
Otherwise, ask:
|
|
828
|
+
|
|
829
|
+
`AskUserQuestion`:
|
|
830
|
+
- **Question:** "How do you want to customize your chat experience?"
|
|
831
|
+
- **Header:** "Customize"
|
|
832
|
+
- **Options:**
|
|
833
|
+
- *Visually — drag-and-drop in browser* — "Open CometChat's Visual Builder in your browser, customize colors / layout / features without code, then come back here. I'll wire the result into your app."
|
|
834
|
+
- *In code — code-driven defaults* — "I'll scaffold a clean integration with sensible defaults. You customize later by editing files / CSS variables."
|
|
835
|
+
|
|
836
|
+
Persist the answer to `.cometchat/config.json` as `customize: "visual" | "code"` so reruns don't re-ask.
|
|
837
|
+
|
|
838
|
+
**If the customer picks "In code":** continue to Step 3a as before. Nothing else in Step 3 changes for the In-code path.
|
|
839
|
+
|
|
840
|
+
**If the customer picks "Visually":** run the visual-builder sub-flow below, then resume the rest of Step 3 (`3a` intent and `3c` placement still run — placement asks where the single `<CometChatApp />` mount goes; the visually-customized features replace what 3b would otherwise recommend).
|
|
841
|
+
|
|
842
|
+
---
|
|
843
|
+
|
|
844
|
+
##### 3.1.v — Visually sub-flow
|
|
845
|
+
|
|
846
|
+
1. **Create the builder.** Run via Bash:
|
|
847
|
+
|
|
848
|
+
```bash
|
|
849
|
+
cometchat builder create \
|
|
850
|
+
--app-id <appId-from-config> \
|
|
851
|
+
--platform <react|react-native|ios|android|flutter from the table above> \
|
|
852
|
+
--json
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
Parse the JSON. On success, you get `{ status: "created", builderId, builderUrl, appId, platform, createdAt }`. Cache file `.cometchat/builder.json` is written automatically by the CLI.
|
|
856
|
+
|
|
857
|
+
**Error handling:**
|
|
858
|
+
- `Not logged in` → run `cometchat auth login` (or hand back to Step 1 auth) and retry.
|
|
859
|
+
- `AUTH_SCOPE` (token lacks `vcb:write`) → tell the customer: *"Your CometChat account doesn't have the Visual Builder add-on enabled — falling back to code-driven customization."* Set `customize=code` and continue to Step 3a.
|
|
860
|
+
- Any other API error → print the error, set `customize=code` (graceful fallback), continue to 3a.
|
|
861
|
+
|
|
862
|
+
2. **Open the builder URL in the customer's default browser.** Try the OS-appropriate command via Bash:
|
|
863
|
+
- macOS: `open "<builderUrl>"`
|
|
864
|
+
- Linux: `xdg-open "<builderUrl>"` (suppress stderr — many SSH-only / headless boxes don't have a display)
|
|
865
|
+
- Windows: `start "" "<builderUrl>"`
|
|
866
|
+
|
|
867
|
+
If the open command exits non-zero (headless, no display, locked down), don't treat it as a failure — print the URL prominently with: *"Couldn't open your browser automatically. Open this URL on a machine where you can use a browser: `<builderUrl>`"*
|
|
868
|
+
|
|
869
|
+
Either way, print the URL itself in the terminal so the customer can copy/paste if the auto-open failed silently.
|
|
870
|
+
|
|
871
|
+
**Tell the customer** (F31, verified 2026-05-22 via headless Playwright): *"If you're not already logged into app.cometchat.com in your browser, you'll see the dashboard signup/login screen first. Log in with the SAME account you used to run `cometchat auth login` (typically your work email) — the dashboard will then redirect you to the Visual Builder UI for this specific builder ID."* Without this heads-up, customers seeing the signup screen think skills opened the wrong URL.
|
|
872
|
+
|
|
873
|
+
3. **Wait for the customer.** Customizing in the Visual Builder typically takes minutes to hours — the customer may walk away. Use `AskUserQuestion` to block:
|
|
874
|
+
- **Question:** "When you're done customizing in the browser, let me know."
|
|
875
|
+
- **Header:** "Builder"
|
|
876
|
+
- **Options:**
|
|
877
|
+
- *Done — fetch my customization and integrate* — Customer finished customizing in the browser.
|
|
878
|
+
- *Skip — use code-driven defaults instead* — Customer changed their mind / didn't want to customize after all. Set `customize=code` and continue to 3a (do NOT delete the builder — customer can come back to it later).
|
|
879
|
+
- *Cancel — exit `/cometchat`* — Customer wants to stop entirely. Exit cleanly.
|
|
880
|
+
|
|
881
|
+
4. **Export the per-builder integration** (only on "Done"). The CLI command depends on the platform `cometchat detect` resolved:
|
|
882
|
+
|
|
883
|
+
| Detected framework | `--platform` value | Default `--output` | Layout kind |
|
|
884
|
+
|---|---|---|---|
|
|
885
|
+
| reactjs, nextjs, react-router, astro | `react` | `src/CometChat` (or `src/app/CometChat` for Next App Router via `--output`) | single-dir |
|
|
886
|
+
| react-native, expo | `react-native` | `src/config` | single-dir |
|
|
887
|
+
| flutter | `flutter` | `chat_builder` | single-dir |
|
|
888
|
+
| ios | `ios` | `CometChat` | selective — 3 files: MessagesVC.swift, ThreadedMessagesVC.swift, cometchat-builder-settings.json |
|
|
889
|
+
| android | `android` | `cometchat` | selective — 2 files: BuilderSettingsHelper.kt, cometchat-builder-settings.json (agent rewrites package decl + moves to app/src/main/java/<package>/cometchat/ — see cometchat-android-v6-core §"Visual Builder integration") |
|
|
890
|
+
|
|
891
|
+
For example, on a React Vite project:
|
|
892
|
+
|
|
893
|
+
```bash
|
|
894
|
+
cometchat builder export --platform react --json
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
(No `--id` needed — the CLI reads it from `.cometchat/builder.json`. Pass `--output <dir>` for non-default destinations like `src/app/CometChat` for Next.js App Router.)
|
|
898
|
+
|
|
899
|
+
This **single command** mirrors the dashboard's Export-button workflow:
|
|
900
|
+
1. Downloads the canonical static template ZIP from `preview.cometchat.com/downloads/cometchat-builder-<platform>.zip`
|
|
901
|
+
2. Fetches the customer's per-builder settings via `GET /vcb/builders/{id}`
|
|
902
|
+
3. Applies F3 + F10 missing-field defaults (`inAppSounds`, `mentionAll`)
|
|
903
|
+
4. Unzips the template into a temp dir
|
|
904
|
+
5. Patches the platform's Settings file:
|
|
905
|
+
- **React** — `CometChatSettings.ts` with `export const CometChatSettings = <settings>;` + sentinel comment
|
|
906
|
+
- **React Native** — `config.json` with `{ builderId, name, settings }` envelope (no sentinel — JSON forbids `//`)
|
|
907
|
+
- **Flutter** — `assets/sample_app/cometchat-builder-settings.json` with the same envelope (no sentinel)
|
|
908
|
+
- **iOS / Android** — `cometchat-builder-settings.json` with the same envelope (no sentinel)
|
|
909
|
+
6. Copies the platform-relevant subdirectory (or files, for selective layouts) to `--output`
|
|
910
|
+
|
|
911
|
+
The command runs an F25 case-collision pre-check (warns if a lowercase `src/cometchat/` with In-code-shape files exists alongside the intended `src/CometChat/` output, on macOS APFS / HFS+ default).
|
|
912
|
+
|
|
913
|
+
Parse the returned JSON: `{ status: "exported", builderId, appId, platform, output, settings_file, builder_name }`. Skills' Step 5 file-emission section then patches the customer's existing project to wire in the exported integration (entry file, package.json, tsconfig — see `cometchat-core` §11.2).
|
|
914
|
+
|
|
915
|
+
**Error handling:**
|
|
916
|
+
- `NOT_FOUND` (builder was deleted out-of-band, or token's appId mismatch) → offer to create a fresh one (`builder create` again) OR fall back to code-driven.
|
|
917
|
+
- `--output directory already exists` → on first emit this means the customer has a previous integration to overwrite; surface to the customer and re-run with `--force` if they confirm. On resync (step 7 iteration), use `--force` directly per `cometchat-core` §11.6.
|
|
918
|
+
- `Failed to download template ZIP` → network issue or wrong CC_BUILDER_HOST env override; surface the error verbatim.
|
|
919
|
+
- Note: the per-builder settings are ALWAYS populated. The dashboard returns a full default config on `builder create` (typing indicators, threads, media, theme, etc.) — verified 2026-05-19 against the real `/vcb/builders` endpoint. "Customer said done but never customized" is indistinguishable from "customer kept the defaults" without diffing against the canonical default blob; don't try to detect it. Always export with whatever comes back.
|
|
920
|
+
|
|
921
|
+
5. **Continue to Step 3a.** The intent question (3a) and the placement question (3c) still run — intent feeds the *recommendation*, but in the Visually path the recommendation is effectively pre-decided by the builder. Skills should phrase 3a as: *"Just for context — what kind of app is this? (This won't change your visual customizations; it helps me set the right defaults for placement.)"* and skip 3b entirely (no "Here's why I recommend X" — they already chose visually).
|
|
922
|
+
|
|
923
|
+
##### 3.1.f — Failure-mode summary
|
|
924
|
+
|
|
925
|
+
| Failure | What skills does |
|
|
926
|
+
|---|---|
|
|
927
|
+
| Framework is `angular` | Dashboard's Visual Builder has no Angular emitter. Surface the one-time explanation note (see "Angular — explicit fallback" above), set `customize=code`, route to the code-driven Angular flow. NEVER call `builder create --platform angular` (the CLI rejects it). |
|
|
928
|
+
| `auth login` token has no `vcb:write` scope | Tell customer their account lacks the add-on; auto-fall-through to In code; do not block. |
|
|
929
|
+
| Customer's network can't reach `apimgmt.cc-cluster-2.io` (corp firewall) | `builder create` errors with network failure; fall back to In code; warn customer the Visual Builder requires outbound HTTPS. |
|
|
930
|
+
| `open` / `xdg-open` / `start` exits non-zero | Treat as soft failure; print URL prominently; continue to wait for "done". |
|
|
931
|
+
| Customer closes the terminal mid-wait | Builder persists server-side. On next `/cometchat` run, the `.cometchat/builder.json` cache triggers the "found existing builder" prompt at the top of 3.1. |
|
|
932
|
+
| Customer says "Done" but didn't actually customize | The builder is never truly empty — `create` returns full defaults (verified 2026-05-19). Emit with what comes back; if they want to tweak later, they use the iteration menu's "Re-sync visual builder" option. |
|
|
933
|
+
| `builder create` returns `ERR_BAD_REQUEST` even with valid `--platform` and a fresh name | The dashboard backend enforces ONE active builder per app — if any prior builder exists and is still "active", subsequent `POST /vcb/builders` calls reject. Detect via `cometchat builder list --json` (if any builder exists, reuse its `builderId` instead of creating new). Surface to the customer: *"Found an existing builder on this app — reusing it. Reset it via the dashboard if you want to start fresh."* Verified against real dashboard 2026-05-21. |
|
|
934
|
+
| Builder ID expired / deleted server-side | `builder fetch` returns `NOT_FOUND`; offer to create fresh or fall to code. |
|
|
935
|
+
| Stale `customize=visual` config from a previous (non-Angular) framework | Overwrite to `customize=code` for the Angular session; surface the Angular note once. Do NOT prompt the customer to "resume" a builder that targets the wrong platform. |
|
|
936
|
+
| Customer is migrating **In-code → Visually** on the same project (existing `src/cometchat/` lowercase dir from a prior In-code integration) | **CASE-COLLISION RISK on macOS APFS / HFS+ default (case-insensitive)** — `src/cometchat/` and `src/CometChat/` resolve to the SAME directory. `cometchat builder export` runs an automatic pre-check: if `src/cometchat/` exists AND contains In-code-shape files (`init.ts` / `CometChatProvider.tsx`) BUT NOT Visual-shape files (`CometChatApp.tsx` + `context/`), it bails with the F25 message and asks the agent to `mv src/cometchat src/cometchat.bak` first. (If the lowercase dir is just the customer's own previous Visual export — `CometChatApp.tsx` + `context/` present — the check skips: that's a resync, not a migration.) F25 finding, 2026-05-22. |
|
|
937
|
+
|
|
739
938
|
#### 3a. "What are you building?"
|
|
740
939
|
|
|
741
940
|
If config has `intent` set, confirm it and move on.
|
|
@@ -1129,7 +1328,7 @@ If `flutter_version === "v5"`:
|
|
|
1129
1328
|
8. `cometchat-flutter-v5-troubleshooting` — pubspec resolution, GetX errors, runtime crashes
|
|
1130
1329
|
|
|
1131
1330
|
If `flutter_version === "v6"`:
|
|
1132
|
-
1. `cometchat-flutter-v6-core` — pubspec deps (single `cometchat_chat_uikit
|
|
1331
|
+
1. `cometchat-flutter-v6-core` — pubspec deps (single `cometchat_chat_uikit: ^6.0` package), `UIKitSettingsBuilder`, init, login, message sending. The `enableCalls`/`CallingConfiguration()` knobs live in `cometchat-flutter-v6-calls`.
|
|
1133
1332
|
2. `cometchat-flutter-v6-components` — full Bloc-driven widget catalog
|
|
1134
1333
|
3. `cometchat-flutter-v6-conversations` / `-messages` / `-users-groups` / `-calls` — per-widget deep dives
|
|
1135
1334
|
4. `cometchat-flutter-v6-features` — feature catalog
|
|
@@ -1158,6 +1357,12 @@ For projects migrating from V5 to V6, ALSO load `cometchat-flutter-v6-migration`
|
|
|
1158
1357
|
|
|
1159
1358
|
Execute the confirmed plan. The order of operations is the same for every framework, but the file names + provider shape differ.
|
|
1160
1359
|
|
|
1360
|
+
**Branch by `customize` (from Step 3.1):**
|
|
1361
|
+
|
|
1362
|
+
- `customize=visual` → emit a single `CometChatApp` wrapper that consumes the builder config cached in `.cometchat/builder.json` (the `settings` blob returned by `cometchat builder fetch`). The wrapper is one file per platform (`CometChatApp.tsx` for web/RN, `CometChatApp.kt` for Android, `CometChatApp.swift` for iOS, `cometchat_app.dart` for Flutter); the customer's existing entry file gets a single `<CometChatApp />` mount. Per-framework emit templates are documented in the per-family skills (`cometchat-{family}-core` § "Visual Builder integration"). The CSS-variable / theme overrides the customer chose in the Visual Builder are inlined verbatim — skills does NOT re-derive them. Then skip the framework-specific steps below and go straight to **dependency install** + **environment variables**.
|
|
1363
|
+
|
|
1364
|
+
- `customize=code` (default) → run the framework-specific steps below as normal.
|
|
1365
|
+
|
|
1161
1366
|
**Web — common steps:**
|
|
1162
1367
|
|
|
1163
1368
|
1. **CometChatProvider** — follow the framework skill's provider pattern. Use the correct env var prefix. Module-level `initialized` guard. Mount at the level agreed in Step 3f.
|
|
@@ -1238,7 +1443,7 @@ Execute the confirmed plan. The order of operations is the same for every framew
|
|
|
1238
1443
|
1. **Migrate credentials to a Dart const file or `--dart-define`** — if `provision setup` wrote a `.env` (Flutter handoff), do the migration documented in Step 2d above. Confirm `lib/cometchat_config.dart` is in `.gitignore` if you go the const-file route.
|
|
1239
1444
|
2. **Add the cometchat dep** to `pubspec.yaml` and run `flutter pub get`:
|
|
1240
1445
|
- V5: `cometchat_chat_uikit: ^5.2.14` (and `cometchat_calls_uikit: ^5.0.15` if calls are needed). Both packages live on the Cloudsmith Dart pub registry, so you'll also need a `--hosted-url` flag in your CI scripts: `dart pub add cometchat_chat_uikit:^5.2.14 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/`.
|
|
1241
|
-
- V6: `cometchat_chat_uikit: ^6.0
|
|
1446
|
+
- V6: `cometchat_chat_uikit: ^6.0` (single package — calls fold in).
|
|
1242
1447
|
3. **Imports — V5 has TWO barrels.** For chat-only V5 apps, only the chat barrel is needed: `import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';`. For V5 + calls, ADD a second import: `import 'package:cometchat_calls_uikit/cometchat_calls_uikit.dart';` — the calls barrel does NOT re-export the chat barrel, so chat widgets aren't reachable through it alone. V6 has ONE barrel: `import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';`.
|
|
1243
1448
|
4. **Init in `main.dart`** — `CometChatUIKit.init(uiKitSettings: settings, onSuccess: ..., onError: ...)`. V5 and V6 share the same init signature (callback-style); the difference is what comes after — V5 wires GetX controllers; V6 wires `BlocProvider`s. Always set `subscriptionType: CometChatSubscriptionType.allUsers` on the builder.
|
|
1244
1449
|
5. **Place chat in your app** — Flutter routing is in code (`Navigator.push`/`go_router`/etc.). Wire chat screens into your app's existing navigation. V6 has a dedicated placement skill for route/modal/embed patterns; V5 covers the same ground inside its per-widget skills.
|
|
@@ -1411,7 +1616,7 @@ Then:
|
|
|
1411
1616
|
|
|
1412
1617
|
Ask the user (preserve this exact shape — `question`, `header`, `multiSelect`, `options[].label`, `options[].description` — agents have varying primitive names but all support this structured form). The option set differs by family — RN has two extra options (push notifications + testing) that don't apply to web.
|
|
1413
1618
|
|
|
1414
|
-
**Web — 8 canonical options:**
|
|
1619
|
+
**Web — 8 canonical options (or 9 if `.cometchat/builder.json` exists, see Visual Builder option below):**
|
|
1415
1620
|
- **question:** "What would you like to do next?"
|
|
1416
1621
|
- **header:** "Next step"
|
|
1417
1622
|
- **multiSelect:** false
|
|
@@ -1425,7 +1630,7 @@ Ask the user (preserve this exact shape — `question`, `header`, `multiSelect`,
|
|
|
1425
1630
|
7. label: "Run diagnostics", description: "Check for drift, missing env vars, broken imports."
|
|
1426
1631
|
8. label: "I'm done", description: "Exit."
|
|
1427
1632
|
|
|
1428
|
-
**RN — 10 canonical options:**
|
|
1633
|
+
**RN — 10 canonical options (or 11 if `.cometchat/builder.json` exists, see Visual Builder option below):**
|
|
1429
1634
|
- **question:** "What would you like to do next?"
|
|
1430
1635
|
- **header:** "Next step"
|
|
1431
1636
|
- **multiSelect:** false
|
|
@@ -1441,6 +1646,20 @@ Ask the user (preserve this exact shape — `question`, `header`, `multiSelect`,
|
|
|
1441
1646
|
9. label: "Troubleshoot an issue", description: "Metro cache, pod install, iOS privacy manifest, push notifications, native module linking."
|
|
1442
1647
|
10. label: "I'm done", description: "Exit."
|
|
1443
1648
|
|
|
1649
|
+
**Visual Builder option (conditional — only if `.cometchat/builder.json` exists):**
|
|
1650
|
+
|
|
1651
|
+
If `.cometchat/builder.json` is present in the project (the customer picked Visually in Step 3.1), inject an additional option **before** "I'm done":
|
|
1652
|
+
|
|
1653
|
+
- label: "Re-sync visual builder", description: "Re-fetch your latest builder customizations from the dashboard and update the emitted code. Use this after you've gone back to the browser and tweaked colors / features / layout."
|
|
1654
|
+
|
|
1655
|
+
When selected:
|
|
1656
|
+
1. Read `.cometchat/builder.json` to learn the platform.
|
|
1657
|
+
2. Surface to customer: *"This will re-download the latest Visual Builder template + your current settings, and replace the `src/CometChat/` directory entirely. Customer hand-edits inside that directory will be lost (per the SKILLS-AUTO-GENERATED contract). Continue?"* via `AskUserQuestion` (Continue / Cancel).
|
|
1658
|
+
3. On Continue: run `cometchat builder export --platform <p> --force --json` via Bash. The `--force` flag is required (it explicitly authorizes replacing the existing directory).
|
|
1659
|
+
4. Parse the returned JSON. On `status: "exported"`, surface a brief summary: *"Re-synced from builder `<builderId>`. Latest sync: `<settings_file>`."*
|
|
1660
|
+
5. Run `cometchat verify --builder --json` to confirm the integration is still intact (settings file valid, canonical wrappers present, entry file wired, deps declared).
|
|
1661
|
+
6. Re-render the iteration menu.
|
|
1662
|
+
|
|
1444
1663
|
For **theme customization**: read the framework-appropriate theming skill and write the customization code.
|
|
1445
1664
|
|
|
1446
1665
|
For **adding features**: read the framework-appropriate features skill. Features fall into six buckets:
|
|
@@ -1530,7 +1749,7 @@ The iteration loop is the whole point of Phase B. Re-rendering the canonical men
|
|
|
1530
1749
|
|
|
1531
1750
|
### Flutter only
|
|
1532
1751
|
|
|
1533
|
-
- **Never mix V5 and V6 packages.** `cometchat_chat_uikit:^5.2` (V5, GetX-based, calls in a separate `cometchat_calls_uikit:^5.0` package) and `cometchat_chat_uikit
|
|
1752
|
+
- **Never mix V5 and V6 packages.** `cometchat_chat_uikit:^5.2` (V5, GetX-based, calls in a separate `cometchat_calls_uikit:^5.0` package) and `cometchat_chat_uikit: ^6.0` (V6, Bloc-based, calls bundled in) are different SDKs with different state-management primitives, theme APIs, and barrel exports. The skills target one cohort each — pick V6 for new projects, V5 for legacy projects, never both in the same app.
|
|
1534
1753
|
- **V5 has TWO barrels; V6 has ONE.** V5 chat widgets (`CometChatConversations`, `CometChatMessageList`, `CometChatMessageComposer`) are reachable ONLY through `package:cometchat_chat_uikit/cometchat_chat_uikit.dart`. The calls package barrel re-exports `cometchat_uikit_shared` + `cometchat_sdk` + `cometchat_calls_sdk` but NOT `cometchat_chat_uikit` — using only the calls import will fail to resolve chat widgets. V6 ships a single package, so the chat barrel covers both chat AND calls.
|
|
1535
1754
|
- **`subscriptionType` is required on `UIKitSettingsBuilder`.** Omitting it silently disables presence and typing-indicator events — no error is thrown, just no presence updates. Always set `..subscriptionType = CometChatSubscriptionType.allUsers` (or `..forFriends` / `..forRoles`).
|
|
1536
1755
|
- **`CometChatUIKit.login(uid)` takes a String, not an object.** Both V5 and V6 use the bare-string form for dev login. For production: `CometChatUIKit.loginWithAuthToken(token, ...)`.
|
|
@@ -1538,7 +1757,7 @@ The iteration loop is the whole point of Phase B. Re-rendering the canonical men
|
|
|
1538
1757
|
- **Listener IDs must be unique + removed in `dispose()`.** Hardcoded listener IDs collide across screens; missing `dispose()` removal leaks listeners across navigations. Use a per-instance ID and remove it on teardown.
|
|
1539
1758
|
- **Credentials live in a Dart const file or `--dart-define`, NOT `.env`.** Flutter doesn't read `.env` at runtime; the CLI's `provision setup --framework flutter` writes a `.env` only as a credentials handoff — migrate during Step 5.
|
|
1540
1759
|
- **`ComponentToggles` and `CallScreenOverlay` do not exist in V6.** Per-widget feature flags (e.g. `disableReactions`, `hideReplyInThreadOption`) replace v5's `BuilderSettings`. In-call UI is `CometChatOngoingCall` widget + `CometChatDisplayIncomingCallOverlay`, not an overlay class with `.show()`.
|
|
1541
|
-
- **AI widget availability varies across V6
|
|
1760
|
+
- **AI widget availability varies across V6 versions.** Some AI widgets (`CometChatAIAssistantChatHistory`, `CometChatAIConversationSummary`) are exported in 6.0.1 (the GA cut); others were added in later patches or are still rolling out. If an import errors with "undefined name", the symbol isn't in that version. Drive AI features via dashboard-enabled extensions for the most stable path — the kit surfaces AI replies/summaries inside the existing message list and composer regardless.
|
|
1542
1761
|
- **V6 conversations slot signatures are asymmetric.** `subtitleView` / `leadingView` / `titleView` take `(BuildContext, Conversation)` (two-arg). `trailingView` and `listItemView` take just `(Conversation)` (single-arg). Match the source — guessing one shape across all four breaks template type-checking. See `cometchat-flutter-v6-conversations` for the example.
|
|
1543
1762
|
- **`PNRegistry` is sample-app code, not a kit API.** The kit's only public push surface is `CometChatNotifications.registerPushToken(token, providerId, platform)` and `unregisterPushToken()`. Use the kit API directly, or copy the sample-app `PNRegistry` helper into your project.
|
|
1544
1763
|
|
|
@@ -1682,7 +1901,7 @@ Not required for integration or Phase B CLI flows.
|
|
|
1682
1901
|
| `cometchat-flutter-v5-push` | When setting up FCM / APNs / VoIP push |
|
|
1683
1902
|
| `cometchat-flutter-v5-troubleshooting` | When diagnosing problems (pubspec, GetX, Pod errors, runtime crashes) |
|
|
1684
1903
|
|
|
1685
|
-
### Flutter V6 family (beta — `cometchat_chat_uikit
|
|
1904
|
+
### Flutter V6 family (beta — `cometchat_chat_uikit: ^6.0`)
|
|
1686
1905
|
|
|
1687
1906
|
| Skill | When to load |
|
|
1688
1907
|
|---|---|
|
|
@@ -466,3 +466,19 @@ class SplashActivity : AppCompatActivity() {
|
|
|
466
466
|
- **App theme must inherit from `CometChatTheme.DayNight`.** The kit itself parents on `Theme.MaterialComponents.DayNight.NoActionBar` (Material 2). Inheriting from `Theme.AppCompat.*` or `Theme.Material3.*` triggers `UnsupportedOperationException: Failed to resolve attribute` at inflate time.
|
|
467
467
|
- **Always use the published Maven artifact for dependencies, never local project modules.** Use `implementation 'com.cometchat:chat-uikit-android:5.+'` — never `implementation project(':chatuikit')`. Local module references only apply to CometChat's own internal sample apps. External apps must always depend on the published artifact from the CometChat Maven repository.
|
|
468
468
|
- **`gradle.properties` MUST contain `android.useAndroidX=true` AND `android.enableJetifier=true`.** Both lines, no exceptions. The CometChat V5 Android SDK transitively depends on the legacy `com.android.support:support-compat`. Without Jetifier rewriting those references to `androidx.*` at build time, Gradle hits "Duplicate class android.support.v4.os.ResultReceiver$1" and the build fails. Modern Android Studio scaffolds set `useAndroidX=true` by default but leave Jetifier off — the integration must add the Jetifier line. Idempotent — if both lines are already present, no change.
|
|
469
|
+
|
|
470
|
+
## Visual Builder integration
|
|
471
|
+
|
|
472
|
+
**Android V5 is the primary home for Visual Builder integration.** The canonical repo at the Android Visual Builder ZIP (download from https://preview.cometchat.com/downloads/cometchat-builder-android.zip) ships **V5-shaped code** — `com.cometchat:chat-uikit-android:5.2.6` + `com.cometchat:calls-sdk-android:4.3.1`. The Gradle plugin `com.cometchat.builder.settings:5.0.1` auto-generates a `CometChatBuilderSettings` constants class from `cometchat-builder-settings.json` at build time. The plugin's output is plain Kotlin `object` declarations — usable from both V5 Views (the canonical path) and V6 Compose / Kotlin Views code, though V6 deps need to be added separately to a V6 project.
|
|
473
|
+
|
|
474
|
+
**The full recipe lives in `cometchat-android-v6-core` §"Visual Builder integration"** because that's where the V6-prep restructure originally landed the validated content. Both skills reference the same canonical; the V6 page carries a "V5-shaped code" warning at the top. V5 customers should follow that recipe AS-IS — it targets V5 deps natively (no shim needed).
|
|
475
|
+
|
|
476
|
+
Validated 2026-05-21 against builder-plugin 5.0.1: `./gradlew :chat-builder:assembleDebug` produces `chat-builder-debug.apk` after applying:
|
|
477
|
+
- Envelope-wrapped `cometchat-builder-settings.json` (`{ builderId, name, settings: {...} }` — NOT raw settings blob)
|
|
478
|
+
- Two missing-field defaults injected pre-write: `chatFeatures.deeperUserEngagement.mentionAll: true` + `chatFeatures.inAppSounds: { incomingMessageSound: true, outgoingMessageSound: true }`
|
|
479
|
+
- `android.enableJetifier=true` in `gradle.properties`
|
|
480
|
+
- `@style/CometChat.Builder.Theme` set on `<application>` in `AndroidManifest.xml`
|
|
481
|
+
|
|
482
|
+
Differences from the V6 page's recipe text:
|
|
483
|
+
- V5 calls integration uses `cometchat-android-v5-calls` patterns (see [[project_v6_calls_sdk_still_required]] for context — V5 customers don't hit the V6-specific workarounds, but the calls SDK requirement is the same).
|
|
484
|
+
- The Compose stack split (`chatuikit-compose-android` vs `chatuikit-kotlin-android`) doesn't apply to V5 — the V5 UI Kit is Kotlin Views only.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cometchat-android-v6-calls
|
|
3
|
-
description: CometChat Calls v6 integration for native Android (V6 beta — Compose + Kotlin Views). Works end-to-end on chatuikit-compose-android:6.0.0 (validated 2026-05-12 against web peer) — but only with FIVE non-obvious workarounds the kit itself doesn't ship
|
|
3
|
+
description: "CometChat Calls v6 integration for native Android (V6 beta — Compose + Kotlin Views). Works end-to-end on chatuikit-compose-android:6.0.0 (validated 2026-05-12 against web peer) — but only with FIVE non-obvious workarounds the kit itself doesn't ship — (1) explicit calls-sdk-android:5.0.+ peer dep, (2) annotations-java5 exclude, (3) stub classes for legacy com.cometchat.calls.{CometChatRTCView, model.RTCUser, model.RTCReceiver, model.RTCCallback} to satisfy chat-sdk's CallManager bytecode, (4) AVOID CometChatCallButtons (broken — captures first-rendered user globally; ignores per-row prop) — instead wire your own button to CometChat.initiateCall then CometChatCallActivity.Companion.launchOutgoingCallScreen(context, call, null), (5) Call constructor arg order CHANGED in chat-sdk 5.x — (receiverUid, receiverType, type) not (receiverUid, type, receiverType). Covers UIKitSettings calling configuration, surface-aware Compose+Views routing, foreground service correctness on Android 14+, ConnectionService + FCM VoIP push."
|
|
4
4
|
license: "MIT"
|
|
5
5
|
compatibility: "Android Studio Hedgehog+, JDK 17, Gradle 8+, AGP 8+, minSdk 28+ (V6 raised the floor); chatuikit-compose-android:6.0.+ OR chatuikit-kotlin-android:6.0.+ PAIRED with com.cometchat:calls-sdk-android:5.0.+ (peer dep required despite the V6 marketing — see §1.0)"
|
|
6
6
|
allowed-tools: "shell, file-read, file-search, file-list, ask-user"
|