@cometchat/skills-cli 2.4.1 → 3.0.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 (111) hide show
  1. package/README.md +45 -37
  2. package/dist/index.js +1821 -13090
  3. package/dist/utils/error-dictionary.js +0 -69
  4. package/package.json +10 -12
  5. package/dist/registry/schemas/config.schema.json +0 -119
  6. package/dist/registry/schemas/template.schema.json +0 -142
  7. package/dist/registry/v6/experiences/1-conversation-list/astro.template.json +0 -89
  8. package/dist/registry/v6/experiences/1-conversation-list/nextjs-pages.template.json +0 -83
  9. package/dist/registry/v6/experiences/1-conversation-list/nextjs.template.json +0 -83
  10. package/dist/registry/v6/experiences/1-conversation-list/react-router.template.json +0 -102
  11. package/dist/registry/v6/experiences/1-conversation-list/reactjs-dedicated-route.template.json +0 -81
  12. package/dist/registry/v6/experiences/1-conversation-list/reactjs.template.json +0 -86
  13. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.css.tpl +0 -43
  14. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/ChatApp.tsx.tpl +0 -86
  15. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/CometChatSelector.tsx.tpl +0 -40
  16. package/dist/registry/v6/experiences/1-conversation-list/templates/astro/chat.astro.tpl +0 -17
  17. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.css.tpl +0 -43
  18. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -86
  19. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/CometChatSelector.tsx.tpl +0 -41
  20. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs/chat-page.tsx.tpl +0 -11
  21. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.css.tpl +0 -43
  22. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatNoSSR.tsx.tpl +0 -88
  23. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/CometChatSelector.tsx.tpl +0 -41
  24. package/dist/registry/v6/experiences/1-conversation-list/templates/nextjs-pages/chat-page.tsx.tpl +0 -15
  25. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChat-route.tsx.tpl +0 -22
  26. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.css.tpl +0 -43
  27. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatNoSSR.tsx.tpl +0 -87
  28. package/dist/registry/v6/experiences/1-conversation-list/templates/react-router/CometChatSelector.tsx.tpl +0 -40
  29. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.css.tpl +0 -40
  30. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/App.tsx.tpl +0 -55
  31. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/CometChatSelector.tsx.tpl +0 -40
  32. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs/main.tsx.tpl +0 -46
  33. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -87
  34. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -20
  35. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -54
  36. package/dist/registry/v6/experiences/1-conversation-list/templates/reactjs-dedicated-route/CometChatSelector.tsx.tpl +0 -40
  37. package/dist/registry/v6/experiences/2-one-to-one/astro.template.json +0 -81
  38. package/dist/registry/v6/experiences/2-one-to-one/nextjs.template.json +0 -77
  39. package/dist/registry/v6/experiences/2-one-to-one/react-router.template.json +0 -93
  40. package/dist/registry/v6/experiences/2-one-to-one/reactjs-dedicated-route.template.json +0 -75
  41. package/dist/registry/v6/experiences/2-one-to-one/reactjs.template.json +0 -80
  42. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.css.tpl +0 -21
  43. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/ChatApp.tsx.tpl +0 -66
  44. package/dist/registry/v6/experiences/2-one-to-one/templates/astro/chat.astro.tpl +0 -17
  45. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.css.tpl +0 -21
  46. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -66
  47. package/dist/registry/v6/experiences/2-one-to-one/templates/nextjs/chat-page.tsx.tpl +0 -11
  48. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChat-route.tsx.tpl +0 -21
  49. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.css.tpl +0 -21
  50. package/dist/registry/v6/experiences/2-one-to-one/templates/react-router/CometChatNoSSR.tsx.tpl +0 -67
  51. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.css.tpl +0 -4
  52. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/App.tsx.tpl +0 -44
  53. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs/main.tsx.tpl +0 -46
  54. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -84
  55. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -9
  56. package/dist/registry/v6/experiences/2-one-to-one/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -43
  57. package/dist/registry/v6/experiences/3-tab-based/astro.template.json +0 -93
  58. package/dist/registry/v6/experiences/3-tab-based/nextjs.template.json +0 -90
  59. package/dist/registry/v6/experiences/3-tab-based/react-router.template.json +0 -105
  60. package/dist/registry/v6/experiences/3-tab-based/reactjs-dedicated-route.template.json +0 -89
  61. package/dist/registry/v6/experiences/3-tab-based/reactjs.template.json +0 -93
  62. package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.css.tpl +0 -39
  63. package/dist/registry/v6/experiences/3-tab-based/templates/astro/ChatApp.tsx.tpl +0 -93
  64. package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.css.tpl +0 -43
  65. package/dist/registry/v6/experiences/3-tab-based/templates/astro/CometChatTabs.tsx.tpl +0 -72
  66. package/dist/registry/v6/experiences/3-tab-based/templates/astro/chat.astro.tpl +0 -17
  67. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.css.tpl +0 -39
  68. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatNoSSR.tsx.tpl +0 -93
  69. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.css.tpl +0 -43
  70. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/CometChatTabs.tsx.tpl +0 -73
  71. package/dist/registry/v6/experiences/3-tab-based/templates/nextjs/chat-page.tsx.tpl +0 -11
  72. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChat-route.tsx.tpl +0 -21
  73. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.css.tpl +0 -39
  74. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatNoSSR.tsx.tpl +0 -94
  75. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.css.tpl +0 -43
  76. package/dist/registry/v6/experiences/3-tab-based/templates/react-router/CometChatTabs.tsx.tpl +0 -72
  77. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.css.tpl +0 -7
  78. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/App.tsx.tpl +0 -62
  79. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.css.tpl +0 -43
  80. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/CometChatTabs.tsx.tpl +0 -72
  81. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs/main.tsx.tpl +0 -46
  82. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/ChatPage.tsx.tpl +0 -84
  83. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatMessenger.css.tpl +0 -11
  84. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatMessenger.tsx.tpl +0 -61
  85. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatTabs.css.tpl +0 -43
  86. package/dist/registry/v6/experiences/3-tab-based/templates/reactjs-dedicated-route/CometChatTabs.tsx.tpl +0 -72
  87. package/dist/registry/v6/features/catalog.json +0 -990
  88. package/dist/registry/v6/production/astro/cometchat-token.ts.tpl +0 -86
  89. package/dist/registry/v6/production/astro.template.json +0 -51
  90. package/dist/registry/v6/production/nextjs/route.ts.tpl +0 -79
  91. package/dist/registry/v6/production/nextjs.template.json +0 -50
  92. package/dist/registry/v6/production/react-router/api.cometchat-token.ts.tpl +0 -73
  93. package/dist/registry/v6/production/react-router.template.json +0 -58
  94. package/dist/registry/v6/user-mgmt/astro/cometchat-user.ts.tpl +0 -164
  95. package/dist/registry/v6/user-mgmt/astro.template.json +0 -33
  96. package/dist/registry/v6/user-mgmt/nextjs/route.ts.tpl +0 -212
  97. package/dist/registry/v6/user-mgmt/nextjs.template.json +0 -57
  98. package/dist/registry/v6/user-mgmt/react-router/api.cometchat-user.ts.tpl +0 -176
  99. package/dist/registry/v6/user-mgmt/react-router.template.json +0 -40
  100. package/dist/registry/v6/widget/astro/CometChatWidget.css.tpl +0 -105
  101. package/dist/registry/v6/widget/astro/CometChatWidget.tsx.tpl +0 -88
  102. package/dist/registry/v6/widget/astro.template.json +0 -38
  103. package/dist/registry/v6/widget/nextjs/CometChatWidget.css.tpl +0 -105
  104. package/dist/registry/v6/widget/nextjs/CometChatWidget.tsx.tpl +0 -88
  105. package/dist/registry/v6/widget/nextjs.template.json +0 -40
  106. package/dist/registry/v6/widget/react-router/CometChatWidget.css.tpl +0 -105
  107. package/dist/registry/v6/widget/react-router/CometChatWidget.tsx.tpl +0 -98
  108. package/dist/registry/v6/widget/react-router.template.json +0 -36
  109. package/dist/registry/v6/widget/reactjs/CometChatWidget.css.tpl +0 -105
  110. package/dist/registry/v6/widget/reactjs/CometChatWidget.tsx.tpl +0 -89
  111. package/dist/registry/v6/widget/reactjs.template.json +0 -36
@@ -29,35 +29,6 @@ const DICTIONARY = {
29
29
  suggestion: "Run `cometchat auth login` again to re-authenticate.",
30
30
  retryable: false
31
31
  },
32
- ERR_NO_INTEGRATION: {
33
- humanMessage: "CometChat isn't installed in this project yet.",
34
- suggestion: "Run `cometchat apply` first (or restart the wizard from the beginning) to create the base integration, then come back to this step.",
35
- retryable: false
36
- },
37
- ERR_UNSUPPORTED_FRAMEWORK: {
38
- humanMessage: "This step isn't available for your framework.",
39
- suggestion: "Some features (server-side user management, production auth) need a framework with a built-in server (Next.js, Astro, React Router v7). Skip this step or switch frameworks to enable it.",
40
- retryable: false
41
- },
42
- ERR_ALREADY_APPLIED: {
43
- humanMessage: "This is already set up in your project.",
44
- suggestion: "Delete the existing files first if you want to re-create them, or skip this step.",
45
- retryable: false
46
- },
47
- ERR_APPLY_UNSAFE_OVERWRITE: {
48
- humanMessage: "One or more files already have your code in them.",
49
- suggestion: "Retry with --force-overwrite to replace them, or edit the files manually first. Use --placement embed:<path> to write the chat entry file somewhere else entirely.",
50
- retryable: true,
51
- retryArgs: ["--force-overwrite"],
52
- retryArgsLabel: "Overwrite and retry"
53
- },
54
- ERR_APPLY_ALREADY_APPLIED: {
55
- humanMessage: "CometChat is already integrated in this project.",
56
- suggestion: "If you want to re-apply (e.g., switching experience), retry with --force.",
57
- retryable: true,
58
- retryArgs: ["--force"],
59
- retryArgsLabel: "Re-apply and override"
60
- },
61
32
  ERR_APP_CREATION_FAILED_MAX_LIMIT: {
62
33
  humanMessage: "You've hit the free-tier app limit on this account.",
63
34
  suggestion: "Delete an unused app from app.cometchat.com, then retry. Deleted apps count toward the limit for 30 days on some plans.",
@@ -97,46 +68,6 @@ const DICTIONARY = {
97
68
  humanMessage: "The CLI returned an unexpected response.",
98
69
  suggestion: "This is likely a CLI bug. Re-run the last step; if it repeats, file an issue with the `--verbose` output.",
99
70
  retryable: true
100
- },
101
- ERR_TOO_LARGE_FILE: {
102
- humanMessage: "The file you tried to upload is too big.",
103
- suggestion: "Reduce the file size or check your app's upload limits in the dashboard.",
104
- retryable: true
105
- },
106
- ERR_MISSING_CUSTOMIZE_KEY: {
107
- humanMessage: "No Claude API key found. Set ANTHROPIC_API_KEY to enable the `customize` command. A CometChat-hosted gateway is coming.",
108
- suggestion: "Export ANTHROPIC_API_KEY in your shell (or a .env file) with a key from https://console.anthropic.com/, then re-run the command.",
109
- retryable: false
110
- },
111
- ERR_CUSTOMIZE_NETWORK: {
112
- humanMessage: "Couldn't reach the LLM endpoint.",
113
- suggestion: "Check your connection and API key.",
114
- retryable: true
115
- },
116
- ERR_CUSTOMIZE_API: {
117
- humanMessage: "The LLM API returned an error.",
118
- suggestion: "Re-check your API key and try again. If the error persists, the upstream provider may be degraded.",
119
- retryable: true
120
- },
121
- ERR_CUSTOMIZE_UNSAFE_PATH: {
122
- humanMessage: "The AI tried to modify a file it shouldn't.",
123
- suggestion: "This is a safety check. Re-run with a more specific instruction.",
124
- retryable: true
125
- },
126
- ERR_CUSTOMIZE_PATCH_TOO_LARGE: {
127
- humanMessage: "The proposed change is too large to apply automatically.",
128
- suggestion: "Break the request into smaller pieces.",
129
- retryable: true
130
- },
131
- ERR_CUSTOMIZE_INVALID_ACTION: {
132
- humanMessage: "The AI proposed an inconsistent change (e.g., create-over-existing).",
133
- suggestion: "Re-run the command; the model may recover on retry.",
134
- retryable: true
135
- },
136
- ERR_CUSTOMIZE_LOW_CONFIDENCE: {
137
- humanMessage: "The AI isn't confident about this change.",
138
- suggestion: "Review the plan and diff carefully before applying, or rephrase the instruction with more detail.",
139
- retryable: true
140
71
  }
141
72
  };
142
73
  function parseErrorCode(raw) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cometchat/skills-cli",
3
- "version": "2.4.1",
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.",
3
+ "version": "3.0.0",
4
+ "description": "CLI for CometChat dashboard authentication, app-credential provisioning, and dashboard feature management (extensions + AI).",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "dev": "tsx src/index.ts",
24
24
  "test": "node --test --import tsx test/*.test.ts",
25
25
  "test:watch": "node --test --watch --import tsx test/*.test.ts",
26
- "build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --packages=external && esbuild src/utils/onboarding-options.ts --platform=node --format=esm --outfile=dist/utils/onboarding-options.js && esbuild src/utils/error-dictionary.ts --platform=node --format=esm --outfile=dist/utils/error-dictionary.js && node -e \"require('node:fs').cpSync(require('node:path').resolve('../registry/v6'),require('node:path').resolve('dist/registry/v6'),{recursive:true});require('node:fs').cpSync(require('node:path').resolve('../registry/schemas'),require('node:path').resolve('dist/registry/schemas'),{recursive:true});console.log(' bundled registry → dist/registry/');\"",
26
+ "build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --packages=external && esbuild src/utils/onboarding-options.ts --platform=node --format=esm --outfile=dist/utils/onboarding-options.js && esbuild src/utils/error-dictionary.ts --platform=node --format=esm --outfile=dist/utils/error-dictionary.js",
27
27
  "typecheck": "tsc --noEmit",
28
28
  "prepublishOnly": "npm run typecheck && npm test && npm run build"
29
29
  },
@@ -42,19 +42,17 @@
42
42
  "keywords": [
43
43
  "cometchat",
44
44
  "chat",
45
- "react",
46
- "nextjs",
47
- "vite",
48
- "astro",
49
- "react-router",
50
- "ai",
51
- "agent",
52
- "skills",
45
+ "dashboard",
46
+ "auth",
47
+ "provision",
48
+ "credentials",
49
+ "features",
50
+ "extensions",
53
51
  "cli"
54
52
  ],
55
53
  "repository": {
56
54
  "type": "git",
57
- "url": "git+https://github.com/cometchat-team/cometchat-skills.git",
55
+ "url": "git+https://github.com/cometchat/cometchat-skills.git",
58
56
  "directory": "packages/cli"
59
57
  }
60
58
  }
@@ -1,119 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cometchat.com/schemas/config.json",
4
- "title": "CometChat Project Config",
5
- "description": "Persistent project-level configuration for CometChat integrations. Written by the wizard/CLI, read by skills and commands.",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": ["version"],
9
- "properties": {
10
- "$schema": {
11
- "type": "string",
12
- "description": "JSON Schema URI for editor autocomplete."
13
- },
14
- "version": {
15
- "type": "number",
16
- "const": 1,
17
- "description": "Schema version. Always 1."
18
- },
19
- "appId": {
20
- "type": "string",
21
- "description": "CometChat App ID. Not a secret — safe to commit."
22
- },
23
- "region": {
24
- "type": "string",
25
- "enum": ["us", "eu", "in"],
26
- "description": "CometChat data region."
27
- },
28
- "framework": {
29
- "type": "string",
30
- "enum": ["reactjs", "nextjs", "react-router", "astro"],
31
- "description": "Detected or user-overridden framework."
32
- },
33
- "router": {
34
- "type": "string",
35
- "enum": ["app", "pages"],
36
- "description": "Next.js router variant. Only applicable when framework is nextjs."
37
- },
38
- "envPrefix": {
39
- "type": "string",
40
- "enum": ["VITE_", "NEXT_PUBLIC_", "PUBLIC_"],
41
- "description": "Environment variable prefix for client-side env vars."
42
- },
43
- "typescript": {
44
- "type": "boolean",
45
- "description": "Whether the project uses TypeScript."
46
- },
47
- "intent": {
48
- "type": "string",
49
- "enum": ["marketplace", "saas", "social", "messaging", "support", "exploring"],
50
- "description": "What the user is building — drives the recommended integration shape."
51
- },
52
- "experience": {
53
- "type": "number",
54
- "enum": [1, 2, 3],
55
- "description": "CometChat experience level (1 = multi-conversation, 2 = single-thread, 3 = full-messenger)."
56
- },
57
- "placement": {
58
- "type": "string",
59
- "enum": ["route", "modal", "drawer", "widget", "embed", "demo"],
60
- "description": "Where the chat UI is placed in the app."
61
- },
62
- "placementPath": {
63
- "type": "string",
64
- "description": "Route path for the chat page (e.g. \"/messages\")."
65
- },
66
- "authMode": {
67
- "type": "string",
68
- "enum": ["authKey", "tokenEndpoint"],
69
- "description": "Authentication mode — dev (authKey) or production (tokenEndpoint)."
70
- },
71
- "tokenEndpointPath": {
72
- "type": "string",
73
- "description": "Path to the server-side token endpoint (e.g. \"app/api/cometchat-token/route.ts\")."
74
- },
75
- "theme": {
76
- "type": "string",
77
- "description": "Theme preset name (slack, whatsapp, discord, etc.) or \"custom\"."
78
- },
79
- "darkMode": {
80
- "type": "boolean",
81
- "description": "Whether dark mode is enabled."
82
- },
83
- "paths": {
84
- "type": "object",
85
- "description": "Paths to CometChat files in this project.",
86
- "additionalProperties": false,
87
- "properties": {
88
- "provider": {
89
- "type": "string",
90
- "description": "Path to the CometChat provider component (e.g. \"src/providers/CometChatProvider.tsx\")."
91
- },
92
- "chatPage": {
93
- "type": "string",
94
- "description": "Path to the main chat page (e.g. \"app/messages/page.tsx\")."
95
- },
96
- "chatDrawer": {
97
- "type": "string",
98
- "description": "Path to the chat drawer component."
99
- },
100
- "chatModal": {
101
- "type": "string",
102
- "description": "Path to the chat modal component."
103
- },
104
- "cssImport": {
105
- "type": "string",
106
- "description": "Path where css-variables.css was imported."
107
- }
108
- }
109
- },
110
- "features": {
111
- "type": "array",
112
- "items": {
113
- "type": "string"
114
- },
115
- "uniqueItems": true,
116
- "description": "Features applied on top of the base integration (e.g. [\"instant-messaging\", \"media-sharing\"])."
117
- }
118
- }
119
- }
@@ -1,142 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cometchat.com/skills/schemas/template.schema.json",
4
- "title": "CometChat Skills Template",
5
- "description": "Schema for an experience-template manifest. One file per (framework × experience) combo.",
6
- "type": "object",
7
- "required": [
8
- "version",
9
- "experience_id",
10
- "framework",
11
- "sdk_compatibility",
12
- "deps",
13
- "env_vars",
14
- "files"
15
- ],
16
- "additionalProperties": false,
17
- "properties": {
18
- "version": {
19
- "type": "string",
20
- "description": "Template version. Bumped whenever the template content changes. Used by drift detection.",
21
- "pattern": "^\\d+\\.\\d+\\.\\d+$"
22
- },
23
- "experience_id": {
24
- "type": "integer",
25
- "enum": [1, 2, 3],
26
- "description": "Which experience this template implements."
27
- },
28
- "framework": {
29
- "type": "string",
30
- "enum": ["reactjs", "nextjs", "react-router", "astro"],
31
- "description": "Which framework this template targets."
32
- },
33
- "sdk_compatibility": {
34
- "type": "string",
35
- "description": "Semver range of @cometchat/chat-uikit-react this template is compatible with.",
36
- "examples": [">=6.0.0 <7.0.0"]
37
- },
38
- "default_placement": {
39
- "type": "string",
40
- "enum": ["dedicated-route", "embed", "spa-root"],
41
- "description": "Where the chat UI lands by default. spa-root means it replaces the App.tsx for SPA frameworks."
42
- },
43
- "deps": {
44
- "type": "array",
45
- "description": "npm packages to install.",
46
- "items": {
47
- "type": "object",
48
- "required": ["name", "version"],
49
- "additionalProperties": false,
50
- "properties": {
51
- "name": { "type": "string" },
52
- "version": { "type": "string" },
53
- "dev": { "type": "boolean", "default": false }
54
- }
55
- }
56
- },
57
- "env_vars": {
58
- "type": "array",
59
- "description": "Environment variables that need to be set in .env*. The {{ENV_PREFIX}} placeholder is substituted at apply time based on detected framework.",
60
- "items": {
61
- "type": "object",
62
- "required": ["name", "required"],
63
- "additionalProperties": false,
64
- "properties": {
65
- "name": { "type": "string" },
66
- "required": { "type": "boolean" },
67
- "secret": { "type": "boolean", "default": false },
68
- "description": { "type": "string" }
69
- }
70
- }
71
- },
72
- "files": {
73
- "type": "array",
74
- "description": "Files to create or patch. Order matters — patches apply in array order.",
75
- "items": {
76
- "oneOf": [
77
- {
78
- "type": "object",
79
- "required": ["path", "action", "template_ref"],
80
- "additionalProperties": false,
81
- "properties": {
82
- "path": {
83
- "type": "string",
84
- "description": "Destination path relative to project root. May contain {{VAR}} placeholders."
85
- },
86
- "action": { "const": "create" },
87
- "template_ref": {
88
- "type": "string",
89
- "description": "Path to the template file inside this template's directory."
90
- },
91
- "owned": {
92
- "type": "boolean",
93
- "default": true,
94
- "description": "Whether this file is owned by CometChat. Owned files can be cleanly removed by uninstall."
95
- }
96
- }
97
- },
98
- {
99
- "type": "object",
100
- "required": ["path", "action"],
101
- "additionalProperties": false,
102
- "properties": {
103
- "path": { "type": "string" },
104
- "action": { "const": "patch" },
105
- "patch_mode": {
106
- "type": "string",
107
- "enum": ["prepend", "append", "insert-after", "insert-before", "replace-section"],
108
- "default": "prepend"
109
- },
110
- "patch_content": {
111
- "type": "string",
112
- "description": "Inline patch content (for small patches)."
113
- },
114
- "patch_ref": {
115
- "type": "string",
116
- "description": "Path to a patch file (for larger patches)."
117
- },
118
- "anchor": {
119
- "type": "string",
120
- "description": "For insert-after / replace-section: the anchor string to find in the target file."
121
- },
122
- "skip_if_exists": {
123
- "type": "string",
124
- "description": "If this string is already in the file, skip the patch (idempotency)."
125
- }
126
- }
127
- }
128
- ]
129
- }
130
- },
131
- "verify_rules": {
132
- "type": "array",
133
- "description": "Names of AST verification rules that must pass after this template is applied.",
134
- "items": { "type": "string" }
135
- },
136
- "next_steps": {
137
- "type": "array",
138
- "description": "Human-readable instructions to show the user after a successful apply.",
139
- "items": { "type": "string" }
140
- }
141
- }
142
- }
@@ -1,89 +0,0 @@
1
- {
2
- "$schema": "../../../schemas/template.schema.json",
3
- "version": "1.0.0",
4
- "experience_id": 1,
5
- "framework": "astro",
6
- "sdk_compatibility": ">=6.0.0 <7.0.0",
7
- "default_placement": "dedicated-route",
8
- "deps": [
9
- {
10
- "name": "@cometchat/chat-uikit-react",
11
- "version": "^6"
12
- },
13
- {
14
- "name": "@cometchat/chat-sdk-javascript",
15
- "version": "^4"
16
- },
17
- {
18
- "name": "@astrojs/react",
19
- "version": "^4"
20
- },
21
- {
22
- "name": "react",
23
- "version": "^18"
24
- },
25
- {
26
- "name": "react-dom",
27
- "version": "^18"
28
- }
29
- ],
30
- "env_vars": [
31
- {
32
- "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
33
- "required": true,
34
- "description": "CometChat App ID from your dashboard"
35
- },
36
- {
37
- "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
38
- "required": true,
39
- "description": "CometChat region (us, eu, in, etc.)"
40
- },
41
- {
42
- "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
43
- "required": true,
44
- "secret": true,
45
- "description": "CometChat Auth Key (development only)"
46
- }
47
- ],
48
- "files": [
49
- {
50
- "path": "src/cometchat/ChatApp.tsx",
51
- "action": "create",
52
- "template_ref": "ChatApp.tsx.tpl",
53
- "owned": true
54
- },
55
- {
56
- "path": "src/cometchat/ChatApp.css",
57
- "action": "create",
58
- "template_ref": "ChatApp.css.tpl",
59
- "owned": true
60
- },
61
- {
62
- "path": "src/cometchat/CometChatSelector.tsx",
63
- "action": "create",
64
- "template_ref": "CometChatSelector.tsx.tpl",
65
- "owned": true
66
- },
67
- {
68
- "path": "src/pages/chat.astro",
69
- "action": "create",
70
- "template_ref": "chat.astro.tpl",
71
- "owned": true,
72
- "is_entry": true
73
- }
74
- ],
75
- "verify_rules": [
76
- "init_before_login",
77
- "no_user_and_group_same_component",
78
- "no_auth_key_in_source",
79
- "render_gated_on_login_resolve",
80
- "error_ui_visible_on_failure"
81
- ],
82
- "next_steps": [
83
- "If `@astrojs/react` isn't installed yet, run: `npx astro add react`",
84
- "Run `npm run dev` to start the dev server",
85
- "Visit http://localhost:4321/chat",
86
- "Note: css-variables.css is imported inside ChatApp.tsx (not in any global stylesheet) — this is required for Astro client:only islands",
87
- "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
88
- ]
89
- }
@@ -1,83 +0,0 @@
1
- {
2
- "$schema": "../../../schemas/template.schema.json",
3
- "version": "1.0.0",
4
- "experience_id": 1,
5
- "framework": "nextjs-pages",
6
- "sdk_compatibility": ">=6.0.0 <7.0.0",
7
- "default_placement": "dedicated-route",
8
- "deps": [
9
- {
10
- "name": "@cometchat/chat-uikit-react",
11
- "version": "^6"
12
- },
13
- {
14
- "name": "@cometchat/chat-sdk-javascript",
15
- "version": "^4"
16
- }
17
- ],
18
- "env_vars": [
19
- {
20
- "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
21
- "required": true,
22
- "description": "CometChat App ID from your dashboard"
23
- },
24
- {
25
- "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
26
- "required": true,
27
- "description": "CometChat region (us, eu, in, etc.)"
28
- },
29
- {
30
- "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
31
- "required": true,
32
- "secret": true,
33
- "description": "CometChat Auth Key (development only)"
34
- }
35
- ],
36
- "files": [
37
- {
38
- "path": "src/cometchat/CometChatNoSSR.tsx",
39
- "action": "create",
40
- "template_ref": "CometChatNoSSR.tsx.tpl",
41
- "owned": true
42
- },
43
- {
44
- "path": "src/cometchat/CometChatNoSSR.css",
45
- "action": "create",
46
- "template_ref": "CometChatNoSSR.css.tpl",
47
- "owned": true
48
- },
49
- {
50
- "path": "src/cometchat/CometChatSelector.tsx",
51
- "action": "create",
52
- "template_ref": "CometChatSelector.tsx.tpl",
53
- "owned": true
54
- },
55
- {
56
- "path": "src/pages/chat.tsx",
57
- "action": "create",
58
- "template_ref": "chat-page.tsx.tpl",
59
- "owned": true,
60
- "is_entry": true
61
- },
62
- {
63
- "path": "src/styles/globals.css",
64
- "action": "patch",
65
- "patch_mode": "prepend",
66
- "patch_content": "@import url(\"@cometchat/chat-uikit-react/css-variables.css\");\n",
67
- "skip_if_exists": "@cometchat/chat-uikit-react/css-variables.css"
68
- }
69
- ],
70
- "verify_rules": [
71
- "css_variables_imported_once",
72
- "init_before_login",
73
- "no_user_and_group_same_component",
74
- "no_auth_key_in_source",
75
- "render_gated_on_login_resolve",
76
- "error_ui_visible_on_failure"
77
- ],
78
- "next_steps": [
79
- "Run `npm run dev` to start the dev server",
80
- "Visit http://localhost:3000/chat",
81
- "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
82
- ]
83
- }
@@ -1,83 +0,0 @@
1
- {
2
- "$schema": "../../../schemas/template.schema.json",
3
- "version": "1.0.0",
4
- "experience_id": 1,
5
- "framework": "nextjs",
6
- "sdk_compatibility": ">=6.0.0 <7.0.0",
7
- "default_placement": "dedicated-route",
8
- "deps": [
9
- {
10
- "name": "@cometchat/chat-uikit-react",
11
- "version": "^6"
12
- },
13
- {
14
- "name": "@cometchat/chat-sdk-javascript",
15
- "version": "^4"
16
- }
17
- ],
18
- "env_vars": [
19
- {
20
- "name": "{{ENV_PREFIX}}COMETCHAT_APP_ID",
21
- "required": true,
22
- "description": "CometChat App ID from your dashboard"
23
- },
24
- {
25
- "name": "{{ENV_PREFIX}}COMETCHAT_REGION",
26
- "required": true,
27
- "description": "CometChat region (us, eu, in, etc.)"
28
- },
29
- {
30
- "name": "{{ENV_PREFIX}}COMETCHAT_AUTH_KEY",
31
- "required": true,
32
- "secret": true,
33
- "description": "CometChat Auth Key (development only)"
34
- }
35
- ],
36
- "files": [
37
- {
38
- "path": "src/app/cometchat/CometChatNoSSR.tsx",
39
- "action": "create",
40
- "template_ref": "CometChatNoSSR.tsx.tpl",
41
- "owned": true
42
- },
43
- {
44
- "path": "src/app/cometchat/CometChatNoSSR.css",
45
- "action": "create",
46
- "template_ref": "CometChatNoSSR.css.tpl",
47
- "owned": true
48
- },
49
- {
50
- "path": "src/app/cometchat/CometChatSelector.tsx",
51
- "action": "create",
52
- "template_ref": "CometChatSelector.tsx.tpl",
53
- "owned": true
54
- },
55
- {
56
- "path": "src/app/chat/page.tsx",
57
- "action": "create",
58
- "template_ref": "chat-page.tsx.tpl",
59
- "owned": true,
60
- "is_entry": true
61
- },
62
- {
63
- "path": "src/app/globals.css",
64
- "action": "patch",
65
- "patch_mode": "prepend",
66
- "patch_content": "@import url(\"@cometchat/chat-uikit-react/css-variables.css\");\n",
67
- "skip_if_exists": "@cometchat/chat-uikit-react/css-variables.css"
68
- }
69
- ],
70
- "verify_rules": [
71
- "css_variables_imported_once",
72
- "init_before_login",
73
- "no_user_and_group_same_component",
74
- "no_auth_key_in_source",
75
- "render_gated_on_login_resolve",
76
- "error_ui_visible_on_failure"
77
- ],
78
- "next_steps": [
79
- "Run `npm run dev` to start the dev server",
80
- "Visit http://localhost:3000/chat",
81
- "When ready for production, run `cometchat apply --production` to set up server-side auth tokens"
82
- ]
83
- }