create-chaaskit 0.1.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 (122) hide show
  1. package/dist/cli.d.ts +3 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +25 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/add-infra.d.ts +6 -0
  6. package/dist/commands/add-infra.d.ts.map +1 -0
  7. package/dist/commands/add-infra.js +160 -0
  8. package/dist/commands/add-infra.js.map +1 -0
  9. package/dist/commands/build.d.ts +2 -0
  10. package/dist/commands/build.d.ts.map +1 -0
  11. package/dist/commands/build.js +63 -0
  12. package/dist/commands/build.js.map +1 -0
  13. package/dist/commands/db-sync.d.ts +13 -0
  14. package/dist/commands/db-sync.d.ts.map +1 -0
  15. package/dist/commands/db-sync.js +108 -0
  16. package/dist/commands/db-sync.js.map +1 -0
  17. package/dist/commands/dev.d.ts +7 -0
  18. package/dist/commands/dev.d.ts.map +1 -0
  19. package/dist/commands/dev.js +61 -0
  20. package/dist/commands/dev.js.map +1 -0
  21. package/dist/commands/init.d.ts +9 -0
  22. package/dist/commands/init.d.ts.map +1 -0
  23. package/dist/commands/init.js +214 -0
  24. package/dist/commands/init.js.map +1 -0
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +57 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/templates/.env.example +24 -0
  30. package/dist/templates/README.md +81 -0
  31. package/dist/templates/app/components/AcceptInviteClient.tsx +10 -0
  32. package/dist/templates/app/components/AdminDashboardClient.tsx +10 -0
  33. package/dist/templates/app/components/AdminTeamClient.tsx +10 -0
  34. package/dist/templates/app/components/AdminTeamsClient.tsx +10 -0
  35. package/dist/templates/app/components/AdminUsersClient.tsx +10 -0
  36. package/dist/templates/app/components/ApiKeysClient.tsx +10 -0
  37. package/dist/templates/app/components/AutomationsClient.tsx +10 -0
  38. package/dist/templates/app/components/ChatClient.tsx +13 -0
  39. package/dist/templates/app/components/ClientOnly.tsx +6 -0
  40. package/dist/templates/app/components/DocumentsClient.tsx +10 -0
  41. package/dist/templates/app/components/OAuthConsentClient.tsx +10 -0
  42. package/dist/templates/app/components/PricingClient.tsx +10 -0
  43. package/dist/templates/app/components/TeamSettingsClient.tsx +10 -0
  44. package/dist/templates/app/components/VerifyEmailClient.tsx +10 -0
  45. package/dist/templates/app/entry.client.tsx +12 -0
  46. package/dist/templates/app/entry.server.tsx +67 -0
  47. package/dist/templates/app/root.tsx +91 -0
  48. package/dist/templates/app/routes/_index.tsx +82 -0
  49. package/dist/templates/app/routes/admin._index.tsx +57 -0
  50. package/dist/templates/app/routes/admin.teams.$teamId.tsx +57 -0
  51. package/dist/templates/app/routes/admin.teams._index.tsx +57 -0
  52. package/dist/templates/app/routes/admin.users.tsx +57 -0
  53. package/dist/templates/app/routes/api-keys.tsx +57 -0
  54. package/dist/templates/app/routes/automations.tsx +57 -0
  55. package/dist/templates/app/routes/chat._index.tsx +11 -0
  56. package/dist/templates/app/routes/chat.admin._index.tsx +10 -0
  57. package/dist/templates/app/routes/chat.admin.teams.$teamId.tsx +10 -0
  58. package/dist/templates/app/routes/chat.admin.teams._index.tsx +10 -0
  59. package/dist/templates/app/routes/chat.admin.users.tsx +10 -0
  60. package/dist/templates/app/routes/chat.api-keys.tsx +10 -0
  61. package/dist/templates/app/routes/chat.automations.tsx +10 -0
  62. package/dist/templates/app/routes/chat.documents.tsx +10 -0
  63. package/dist/templates/app/routes/chat.team.$teamId.settings.tsx +10 -0
  64. package/dist/templates/app/routes/chat.thread.$threadId.tsx +11 -0
  65. package/dist/templates/app/routes/chat.tsx +39 -0
  66. package/dist/templates/app/routes/documents.tsx +57 -0
  67. package/dist/templates/app/routes/invite.$token.tsx +10 -0
  68. package/dist/templates/app/routes/login.tsx +334 -0
  69. package/dist/templates/app/routes/oauth.consent.tsx +10 -0
  70. package/dist/templates/app/routes/pricing.tsx +10 -0
  71. package/dist/templates/app/routes/privacy.tsx +197 -0
  72. package/dist/templates/app/routes/register.tsx +398 -0
  73. package/dist/templates/app/routes/shared.$shareId.tsx +226 -0
  74. package/dist/templates/app/routes/team.$teamId.settings.tsx +57 -0
  75. package/dist/templates/app/routes/terms.tsx +173 -0
  76. package/dist/templates/app/routes/thread.$threadId.tsx +102 -0
  77. package/dist/templates/app/routes/verify-email.tsx +10 -0
  78. package/dist/templates/app/routes.ts +47 -0
  79. package/dist/templates/config/app.config.ts +216 -0
  80. package/dist/templates/docs/admin.md +257 -0
  81. package/dist/templates/docs/api-keys.md +403 -0
  82. package/dist/templates/docs/authentication.md +247 -0
  83. package/dist/templates/docs/configuration.md +1212 -0
  84. package/dist/templates/docs/custom-pages.md +466 -0
  85. package/dist/templates/docs/deployment.md +362 -0
  86. package/dist/templates/docs/development.md +411 -0
  87. package/dist/templates/docs/documents.md +293 -0
  88. package/dist/templates/docs/extensions.md +639 -0
  89. package/dist/templates/docs/index.md +139 -0
  90. package/dist/templates/docs/installation.md +286 -0
  91. package/dist/templates/docs/mcp.md +952 -0
  92. package/dist/templates/docs/native-tools.md +688 -0
  93. package/dist/templates/docs/queue.md +514 -0
  94. package/dist/templates/docs/scheduled-prompts.md +279 -0
  95. package/dist/templates/docs/settings.md +415 -0
  96. package/dist/templates/docs/slack.md +318 -0
  97. package/dist/templates/docs/styling.md +288 -0
  98. package/dist/templates/extensions/agents/.gitkeep +0 -0
  99. package/dist/templates/extensions/pages/.gitkeep +0 -0
  100. package/dist/templates/extensions/payment-plans/.gitkeep +0 -0
  101. package/dist/templates/index.html +16 -0
  102. package/dist/templates/infra-aws/.github/workflows/deploy.yml +95 -0
  103. package/dist/templates/infra-aws/README.md +207 -0
  104. package/dist/templates/infra-aws/bin/cdk.ts +18 -0
  105. package/dist/templates/infra-aws/cdk.json +43 -0
  106. package/dist/templates/infra-aws/config/deployment.ts +156 -0
  107. package/dist/templates/infra-aws/lib/chaaskit-stack.ts +419 -0
  108. package/dist/templates/infra-aws/package.json +27 -0
  109. package/dist/templates/infra-aws/scripts/build-app.sh +63 -0
  110. package/dist/templates/infra-aws/tsconfig.json +25 -0
  111. package/dist/templates/package.json +46 -0
  112. package/dist/templates/prisma/schema/base.prisma +584 -0
  113. package/dist/templates/prisma/schema/custom.prisma +24 -0
  114. package/dist/templates/prisma/schema.prisma +271 -0
  115. package/dist/templates/public/favicon.svg +4 -0
  116. package/dist/templates/public/logo.svg +4 -0
  117. package/dist/templates/react-router.config.ts +11 -0
  118. package/dist/templates/server.js +52 -0
  119. package/dist/templates/src/main.tsx +8 -0
  120. package/dist/templates/tsconfig.json +26 -0
  121. package/dist/templates/vite.config.ts +26 -0
  122. package/package.json +46 -0
@@ -0,0 +1,173 @@
1
+ import type { Route } from './+types/terms';
2
+ import { config } from '../../config/app.config';
3
+
4
+ export function meta({}: Route.MetaArgs) {
5
+ return [
6
+ { title: `Terms of Service - ${config.app.name}` },
7
+ { name: 'description', content: `Terms of Service for ${config.app.name}` },
8
+ ];
9
+ }
10
+
11
+ export default function Terms() {
12
+ return (
13
+ <div
14
+ style={{
15
+ minHeight: '100vh',
16
+ backgroundColor: 'rgb(var(--color-background))',
17
+ padding: '2rem 1rem',
18
+ }}
19
+ >
20
+ <div style={{ maxWidth: '48rem', marginLeft: 'auto', marginRight: 'auto' }}>
21
+ <div style={{ marginBottom: '2rem' }}>
22
+ <a
23
+ href="/"
24
+ style={{
25
+ fontSize: '0.875rem',
26
+ color: 'rgb(var(--color-primary))',
27
+ textDecoration: 'none',
28
+ }}
29
+ >
30
+ &larr; Back to {config.app.name}
31
+ </a>
32
+ </div>
33
+
34
+ <article>
35
+ <h1
36
+ style={{
37
+ fontSize: '2rem',
38
+ fontWeight: 'bold',
39
+ color: 'rgb(var(--color-text-primary))',
40
+ marginBottom: '1.5rem',
41
+ }}
42
+ >
43
+ Terms of Service
44
+ </h1>
45
+
46
+ <p
47
+ style={{
48
+ color: 'rgb(var(--color-text-muted))',
49
+ marginBottom: '2rem',
50
+ fontSize: '0.875rem',
51
+ }}
52
+ >
53
+ Last updated:{' '}
54
+ {new Date().toLocaleDateString('en-US', {
55
+ year: 'numeric',
56
+ month: 'long',
57
+ day: 'numeric',
58
+ })}
59
+ </p>
60
+
61
+ <div
62
+ style={{
63
+ color: 'rgb(var(--color-text-secondary))',
64
+ lineHeight: 1.7,
65
+ }}
66
+ >
67
+ <Section title="Agreement to Terms">
68
+ <p>
69
+ By accessing or using {config.app.name}, you agree to be bound by
70
+ these Terms of Service. If you disagree with any part of the
71
+ terms, you may not access the service.
72
+ </p>
73
+ </Section>
74
+
75
+ <Section title="Use of Service">
76
+ <p>
77
+ You agree to use {config.app.name} only for lawful purposes and
78
+ in accordance with these Terms. You agree not to:
79
+ </p>
80
+ <ul style={{ marginTop: '1rem', paddingLeft: '1.5rem' }}>
81
+ <li style={{ marginBottom: '0.5rem' }}>
82
+ Use the service for any illegal purpose
83
+ </li>
84
+ <li style={{ marginBottom: '0.5rem' }}>
85
+ Attempt to gain unauthorized access to the service
86
+ </li>
87
+ <li style={{ marginBottom: '0.5rem' }}>
88
+ Interfere with or disrupt the service
89
+ </li>
90
+ <li style={{ marginBottom: '0.5rem' }}>
91
+ Use the service to send spam or unsolicited messages
92
+ </li>
93
+ </ul>
94
+ </Section>
95
+
96
+ <Section title="User Accounts">
97
+ <p>
98
+ When you create an account, you must provide accurate and
99
+ complete information. You are responsible for maintaining the
100
+ security of your account and password.
101
+ </p>
102
+ </Section>
103
+
104
+ <Section title="AI-Generated Content">
105
+ <p>
106
+ {config.app.name} uses AI to generate responses. While we strive
107
+ for accuracy, AI-generated content may contain errors or
108
+ inaccuracies. You should verify important information
109
+ independently.
110
+ </p>
111
+ </Section>
112
+
113
+ <Section title="Intellectual Property">
114
+ <p>
115
+ The service and its original content, features, and
116
+ functionality are owned by us and are protected by international
117
+ copyright, trademark, and other intellectual property laws.
118
+ </p>
119
+ </Section>
120
+
121
+ <Section title="Limitation of Liability">
122
+ <p>
123
+ In no event shall we be liable for any indirect, incidental,
124
+ special, consequential, or punitive damages arising out of or
125
+ relating to your use of the service.
126
+ </p>
127
+ </Section>
128
+
129
+ <Section title="Changes to Terms">
130
+ <p>
131
+ We reserve the right to modify these terms at any time. We will
132
+ notify users of any material changes by posting the new Terms of
133
+ Service on this page.
134
+ </p>
135
+ </Section>
136
+
137
+ <Section title="Contact Us">
138
+ <p>
139
+ If you have any questions about these Terms of Service, please
140
+ contact us.
141
+ </p>
142
+ </Section>
143
+ </div>
144
+ </article>
145
+ </div>
146
+ </div>
147
+ );
148
+ }
149
+
150
+ function Section({
151
+ title,
152
+ children,
153
+ }: {
154
+ title: string;
155
+ children: React.ReactNode;
156
+ }) {
157
+ return (
158
+ <>
159
+ <h2
160
+ style={{
161
+ fontSize: '1.25rem',
162
+ fontWeight: 600,
163
+ marginTop: '2rem',
164
+ marginBottom: '1rem',
165
+ color: 'rgb(var(--color-text-primary))',
166
+ }}
167
+ >
168
+ {title}
169
+ </h2>
170
+ {children}
171
+ </>
172
+ );
173
+ }
@@ -0,0 +1,102 @@
1
+ import type { Route } from './+types/thread.$threadId';
2
+ import { lazy, Suspense } from 'react';
3
+ import { ClientOnly } from '../components/ClientOnly';
4
+
5
+ // Lazy load the client-only component
6
+ const ChatClient = lazy(() => import('../components/ChatClient'));
7
+
8
+ export function meta({}: Route.MetaArgs) {
9
+ return [{ title: 'Chat' }];
10
+ }
11
+
12
+ // Styles are loaded via link tag in root.tsx to avoid SSR import issues
13
+ export function links() {
14
+ return [{ rel: 'stylesheet', href: '/node_modules/@chaaskit/client/dist/lib/styles.css' }];
15
+ }
16
+
17
+ /**
18
+ * Thread view route - shows a specific chat thread.
19
+ * Uses the same ChatClient component as the main chat route.
20
+ */
21
+ export default function Thread() {
22
+ return (
23
+ <ClientOnly fallback={<ThreadLoadingSkeleton />}>
24
+ {() => (
25
+ <Suspense fallback={<ThreadLoadingSkeleton />}>
26
+ <ChatClient />
27
+ </Suspense>
28
+ )}
29
+ </ClientOnly>
30
+ );
31
+ }
32
+
33
+ function ThreadLoadingSkeleton() {
34
+ return (
35
+ <div style={{ display: 'flex', height: '100vh' }}>
36
+ {/* Sidebar skeleton */}
37
+ <div
38
+ style={{
39
+ width: '256px',
40
+ backgroundColor: 'rgb(var(--color-sidebar))',
41
+ borderRight: '1px solid rgb(var(--color-border))',
42
+ padding: '1rem',
43
+ }}
44
+ >
45
+ <div
46
+ style={{
47
+ height: '2rem',
48
+ backgroundColor: 'rgb(var(--color-background-secondary))',
49
+ borderRadius: '0.5rem',
50
+ marginBottom: '1rem',
51
+ }}
52
+ />
53
+ <div
54
+ style={{
55
+ height: '1rem',
56
+ backgroundColor: 'rgb(var(--color-background-secondary))',
57
+ borderRadius: '0.25rem',
58
+ width: '80%',
59
+ }}
60
+ />
61
+ </div>
62
+ {/* Main content skeleton */}
63
+ <div
64
+ style={{
65
+ flex: 1,
66
+ display: 'flex',
67
+ alignItems: 'center',
68
+ justifyContent: 'center',
69
+ backgroundColor: 'rgb(var(--color-background))',
70
+ }}
71
+ >
72
+ <div
73
+ style={{
74
+ display: 'flex',
75
+ flexDirection: 'column',
76
+ alignItems: 'center',
77
+ gap: '1rem',
78
+ }}
79
+ >
80
+ <div
81
+ style={{
82
+ width: '2rem',
83
+ height: '2rem',
84
+ border: '2px solid rgb(var(--color-primary))',
85
+ borderTopColor: 'transparent',
86
+ borderRadius: '50%',
87
+ animation: 'spin 1s linear infinite',
88
+ }}
89
+ />
90
+ <p style={{ color: 'rgb(var(--color-text-muted))' }}>Loading...</p>
91
+ </div>
92
+ </div>
93
+ <style>
94
+ {`
95
+ @keyframes spin {
96
+ to { transform: rotate(360deg); }
97
+ }
98
+ `}
99
+ </style>
100
+ </div>
101
+ );
102
+ }
@@ -0,0 +1,10 @@
1
+ import { createRoute } from '@chaaskit/client/ssr-utils';
2
+
3
+ const route = createRoute({
4
+ title: 'Verify Email',
5
+ load: () => import('@chaaskit/client/routes/VerifyEmailRoute'),
6
+ });
7
+
8
+ export const meta = route.meta;
9
+ export const links = route.links;
10
+ export default route.default;
@@ -0,0 +1,47 @@
1
+ import { type RouteConfig, route, index, layout } from '@react-router/dev/routes';
2
+ import { config } from '../config/app.config';
3
+
4
+ // Get basePath from config, default to '/chat'
5
+ const basePath = config.app.basePath || '/chat';
6
+ // Remove leading slash for route path matching
7
+ const base = basePath.startsWith('/') ? basePath.slice(1) : basePath;
8
+
9
+ export default [
10
+ // ==========================================
11
+ // Public routes (no basePath prefix)
12
+ // ==========================================
13
+ index('routes/_index.tsx'),
14
+ route('login', 'routes/login.tsx'),
15
+ route('register', 'routes/register.tsx'),
16
+ route('shared/:shareId', 'routes/shared.$shareId.tsx'),
17
+ route('terms', 'routes/terms.tsx'),
18
+ route('privacy', 'routes/privacy.tsx'),
19
+ route('verify-email', 'routes/verify-email.tsx'),
20
+ route('invite/:token', 'routes/invite.$token.tsx'),
21
+ route('pricing', 'routes/pricing.tsx'),
22
+ route('oauth/consent', 'routes/oauth.consent.tsx'),
23
+
24
+ // ==========================================
25
+ // Authenticated app routes (under basePath)
26
+ // Layout handles authentication check
27
+ // ==========================================
28
+ layout('routes/chat.tsx', [
29
+ // Main chat interface
30
+ route(base, 'routes/chat._index.tsx'),
31
+ route(`${base}/thread/:threadId`, 'routes/chat.thread.$threadId.tsx'),
32
+
33
+ // Settings pages
34
+ route(`${base}/api-keys`, 'routes/chat.api-keys.tsx'),
35
+ route(`${base}/documents`, 'routes/chat.documents.tsx'),
36
+ route(`${base}/automations`, 'routes/chat.automations.tsx'),
37
+
38
+ // Team settings
39
+ route(`${base}/team/:teamId/settings`, 'routes/chat.team.$teamId.settings.tsx'),
40
+
41
+ // Admin pages
42
+ route(`${base}/admin`, 'routes/chat.admin._index.tsx'),
43
+ route(`${base}/admin/users`, 'routes/chat.admin.users.tsx'),
44
+ route(`${base}/admin/teams`, 'routes/chat.admin.teams._index.tsx'),
45
+ route(`${base}/admin/teams/:teamId`, 'routes/chat.admin.teams.$teamId.tsx'),
46
+ ]),
47
+ ] satisfies RouteConfig;
@@ -0,0 +1,216 @@
1
+ import type { AppConfig } from '@chaaskit/shared';
2
+
3
+ export const config: AppConfig = {
4
+ app: {
5
+ name: 'My Chat App',
6
+ description: 'AI-powered chat application',
7
+ url: 'http://localhost:5173',
8
+ basePath: '/chat', // Chat app lives under /chat, landing page at /
9
+ },
10
+
11
+ ui: {
12
+ welcomeTitle: 'Welcome to My Chat App',
13
+ welcomeSubtitle: 'How can I help you today?',
14
+ inputPlaceholder: 'Type your message...',
15
+ samplePrompts: [
16
+ { label: 'Explain a concept', prompt: 'Explain quantum computing in simple terms' },
17
+ { label: 'Write code', prompt: 'Write a function to sort an array' },
18
+ { label: 'Help me brainstorm', prompt: 'Help me brainstorm ideas for a mobile app' },
19
+ ],
20
+ logo: '/logo.svg',
21
+ },
22
+
23
+ theming: {
24
+ defaultTheme: 'light',
25
+ allowUserThemeSwitch: true,
26
+ themes: {
27
+ light: {
28
+ name: 'Light',
29
+ colors: {
30
+ primary: '#6366f1',
31
+ primaryHover: '#4f46e5',
32
+ secondary: '#8b5cf6',
33
+ background: '#ffffff',
34
+ backgroundSecondary: '#f9fafb',
35
+ sidebar: '#f3f4f6',
36
+ textPrimary: '#111827',
37
+ textSecondary: '#6b7280',
38
+ textMuted: '#9ca3af',
39
+ border: '#e5e7eb',
40
+ inputBackground: '#ffffff',
41
+ inputBorder: '#d1d5db',
42
+ userMessageBg: '#6366f1',
43
+ userMessageText: '#ffffff',
44
+ assistantMessageBg: '#f3f4f6',
45
+ assistantMessageText: '#111827',
46
+ success: '#10b981',
47
+ warning: '#f59e0b',
48
+ error: '#ef4444',
49
+ },
50
+ },
51
+ dark: {
52
+ name: 'Dark',
53
+ colors: {
54
+ primary: '#818cf8',
55
+ primaryHover: '#a5b4fc',
56
+ secondary: '#a78bfa',
57
+ background: '#111827',
58
+ backgroundSecondary: '#1f2937',
59
+ sidebar: '#0f172a',
60
+ textPrimary: '#f9fafb',
61
+ textSecondary: '#d1d5db',
62
+ textMuted: '#6b7280',
63
+ border: '#374151',
64
+ inputBackground: '#1f2937',
65
+ inputBorder: '#4b5563',
66
+ userMessageBg: '#4f46e5',
67
+ userMessageText: '#ffffff',
68
+ assistantMessageBg: '#1f2937',
69
+ assistantMessageText: '#f9fafb',
70
+ success: '#34d399',
71
+ warning: '#fbbf24',
72
+ error: '#f87171',
73
+ },
74
+ },
75
+ },
76
+ fonts: {
77
+ sans: 'Inter, system-ui, sans-serif',
78
+ mono: 'JetBrains Mono, Menlo, monospace',
79
+ },
80
+ borderRadius: {
81
+ sm: '0.25rem',
82
+ md: '0.5rem',
83
+ lg: '0.75rem',
84
+ full: '9999px',
85
+ },
86
+ },
87
+
88
+ auth: {
89
+ methods: ['email-password'],
90
+ allowUnauthenticated: false,
91
+ magicLink: {
92
+ enabled: true,
93
+ expiresInMinutes: 15,
94
+ },
95
+ },
96
+
97
+ // Configure your AI agent(s) here
98
+ // Using multi-agent format to enable native tools
99
+ agent: {
100
+ agents: [
101
+ {
102
+ id: 'default',
103
+ name: 'Assistant',
104
+ provider: 'openai', // or 'anthropic'
105
+ model: 'gpt-4o-mini',
106
+ systemPrompt: 'You are a helpful AI assistant.',
107
+ maxTokens: 4096,
108
+ isDefault: true,
109
+ // Enable all native tools (web-scrape, etc.)
110
+ // Use 'native:*' for all, or 'native:web-scrape' for specific tools
111
+ allowedTools: ['native:*'],
112
+ },
113
+ ],
114
+ },
115
+
116
+ payments: {
117
+ enabled: false,
118
+ provider: 'stripe',
119
+ plans: [
120
+ {
121
+ id: 'free',
122
+ name: 'Free',
123
+ type: 'free',
124
+ params: {
125
+ monthlyMessageLimit: 20,
126
+ },
127
+ },
128
+ ],
129
+ },
130
+
131
+ legal: {
132
+ privacyPolicyUrl: '/privacy',
133
+ termsOfServiceUrl: '/terms',
134
+ },
135
+
136
+ userSettings: {
137
+ fields: [
138
+ {
139
+ key: 'name',
140
+ label: 'Your Name',
141
+ type: 'text',
142
+ placeholder: 'Enter your name',
143
+ },
144
+ {
145
+ key: 'context',
146
+ label: 'Additional Context',
147
+ type: 'textarea',
148
+ placeholder: 'Any context the AI should know about you...',
149
+ },
150
+ ],
151
+ },
152
+
153
+ sharing: {
154
+ enabled: true,
155
+ scope: 'public',
156
+ expirationOptions: ['1h', '24h', '7d', '30d', 'never'],
157
+ },
158
+
159
+ teams: {
160
+ enabled: true,
161
+ },
162
+
163
+ projects: {
164
+ enabled: true,
165
+ colors: ['#6366f1', '#8b5cf6', '#ec4899', '#f43f5e', '#f97316', '#eab308', '#22c55e', '#14b8a6', '#06b6d4', '#3b82f6'],
166
+ },
167
+
168
+ // API access (for programmatic use)
169
+ api: {
170
+ enabled: true,
171
+ // allowedPlans: ['pro', 'enterprise'], // Optional: restrict to specific plans
172
+ // keyPrefix: 'myapp-', // Optional: custom prefix for API keys (default: "sk-")
173
+ // allowedEndpoints: [ // Endpoints accessible via API keys (default: none)
174
+ // '/api/chat', // Exact match
175
+ // '/api/threads', // List threads
176
+ // '/api/threads/*', // Single thread operations (e.g., /api/threads/123)
177
+ // '/api/threads/**', // All thread sub-routes (e.g., /api/threads/123/messages)
178
+ // ],
179
+ },
180
+
181
+ promptTemplates: {
182
+ enabled: true,
183
+ builtIn: [
184
+ {
185
+ id: 'explain',
186
+ name: 'Explain Code',
187
+ prompt: 'Explain this code:\n\n{{code}}',
188
+ variables: ['code'],
189
+ },
190
+ {
191
+ id: 'review',
192
+ name: 'Code Review',
193
+ prompt: 'Review this code for bugs, security issues, and improvements:\n\n{{code}}',
194
+ variables: ['code'],
195
+ },
196
+ ],
197
+ allowUserTemplates: true,
198
+ },
199
+
200
+ // Mentionable documents - reference documents in chat with @mentions
201
+ documents: {
202
+ enabled: true,
203
+ storage: {
204
+ provider: 'database', // 'database' | 'filesystem' | 's3'
205
+ },
206
+ maxFileSizeMB: 10,
207
+ hybridThreshold: 1000, // Documents under this char count are injected into context
208
+ acceptedTypes: [
209
+ 'text/plain',
210
+ 'text/markdown',
211
+ 'text/x-markdown',
212
+ 'text/csv',
213
+ 'application/json',
214
+ ],
215
+ },
216
+ };