@eventcatalog/core 3.0.0-beta.19 → 3.0.0-beta.20

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 (35) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-R6WYYOD5.js → chunk-7ANM33NO.js} +1 -1
  6. package/dist/{chunk-FHSD3KUQ.js → chunk-BLIEWBVS.js} +1 -1
  7. package/dist/{chunk-ZK4S7XBB.js → chunk-IZGKMOOO.js} +1 -1
  8. package/dist/{chunk-E7QOZU4L.js → chunk-SUPFYBDY.js} +1 -1
  9. package/dist/{chunk-FQUOTAQT.js → chunk-VDAAJC4X.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -48
  13. package/dist/eventcatalog.js +5 -48
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/astro.config.mjs +3 -0
  19. package/eventcatalog/integrations/eventcatalog-features.ts +69 -0
  20. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +17 -10
  21. package/eventcatalog/src/content.config.ts +1 -10
  22. package/eventcatalog/src/enterprise/auth/[...auth].ts +3 -0
  23. package/eventcatalog/src/enterprise/auth/login.astro +420 -0
  24. package/eventcatalog/src/enterprise/collections/index.ts +0 -1
  25. package/eventcatalog/src/utils/feature.ts +1 -1
  26. package/package.json +1 -1
  27. package/eventcatalog/src/enterprise/collections/chat-prompts.ts +0 -32
  28. package/eventcatalog/src/pages/auth/login.astro +0 -280
  29. package/eventcatalog/src/pages/nav-index.json.ts +0 -30
  30. /package/eventcatalog/src/enterprise/{eventcatalog-chat/pages/api/chat.ts → ai/chat-api.ts} +0 -0
  31. /package/eventcatalog/src/{pages → enterprise}/auth/error.astro +0 -0
  32. /package/eventcatalog/src/{middleware-auth.ts → enterprise/auth/middleware/middleware-auth.ts} +0 -0
  33. /package/eventcatalog/src/{middleware.ts → enterprise/auth/middleware/middleware.ts} +0 -0
  34. /package/eventcatalog/src/{pages/unauthorized/index.astro → enterprise/auth/unauthorized.astro} +0 -0
  35. /package/eventcatalog/src/{pages → enterprise}/plans/index.astro +0 -0
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "3.0.0-beta.19";
40
+ var version = "3.0.0-beta.20";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-R6WYYOD5.js";
4
- import "../chunk-FHSD3KUQ.js";
3
+ } from "../chunk-7ANM33NO.js";
4
+ import "../chunk-BLIEWBVS.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "3.0.0-beta.19";
109
+ var version = "3.0.0-beta.20";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-ZK4S7XBB.js";
4
- import "../chunk-R6WYYOD5.js";
5
- import "../chunk-FHSD3KUQ.js";
3
+ } from "../chunk-IZGKMOOO.js";
4
+ import "../chunk-7ANM33NO.js";
5
+ import "../chunk-BLIEWBVS.js";
6
6
  import "../chunk-UPONRQSN.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-FHSD3KUQ.js";
3
+ } from "./chunk-BLIEWBVS.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.0.0-beta.19";
2
+ var version = "3.0.0-beta.20";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-R6WYYOD5.js";
3
+ } from "./chunk-7ANM33NO.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-FHSD3KUQ.js";
3
+ } from "./chunk-BLIEWBVS.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-E7QOZU4L.js";
3
+ } from "./chunk-SUPFYBDY.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.0.0-beta.19";
28
+ var version = "3.0.0-beta.20";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-FHSD3KUQ.js";
3
+ } from "./chunk-BLIEWBVS.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -109,7 +109,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
109
109
  var import_picocolors = __toESM(require("picocolors"), 1);
110
110
 
111
111
  // package.json
112
- var version = "3.0.0-beta.19";
112
+ var version = "3.0.0-beta.20";
113
113
 
114
114
  // src/constants.ts
115
115
  var VERSION = version;
@@ -547,11 +547,6 @@ var isOutputServer = async () => {
547
547
  const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
548
548
  return config?.output === "server";
549
549
  };
550
- var isAuthEnabled = async () => {
551
- const directory = process.env.PROJECT_DIR || process.cwd();
552
- const hasAuthConfig = import_node_fs4.default.existsSync((0, import_node_path5.join)(directory, "eventcatalog.auth.js"));
553
- return hasAuthConfig;
554
- };
555
550
 
556
551
  // src/eventcatalog.ts
557
552
  var import_update_notifier = __toESM(require("update-notifier"), 1);
@@ -702,41 +697,6 @@ var copyCore = () => {
702
697
  }
703
698
  });
704
699
  };
705
- var copyServerFiles = async () => {
706
- const isServerOutput = await isOutputServer();
707
- if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/server"))) {
708
- import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/server"), { recursive: true });
709
- }
710
- if (!isServerOutput) {
711
- if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"))) {
712
- import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"));
713
- }
714
- if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"))) {
715
- import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"));
716
- }
717
- return;
718
- }
719
- import_fs2.default.cpSync((0, import_node_path7.join)(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), (0, import_node_path7.join)(core, "src/pages/api"), {
720
- recursive: true
721
- });
722
- };
723
- var createAuthFileIfNotExists = async (hasRequiredLicense) => {
724
- const authEnabled = await isAuthEnabled();
725
- const isSRR = await isOutputServer();
726
- try {
727
- if (authEnabled && hasRequiredLicense && isSRR) {
728
- logger.info("Creating auth file", "auth");
729
- import_fs2.default.writeFileSync(
730
- (0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"),
731
- `import { AstroAuth } from 'auth-astro/server';
732
- export const prerender = false;
733
- export const { GET, POST } = AstroAuth();
734
- `
735
- );
736
- }
737
- } catch (error) {
738
- }
739
- };
740
700
  var clearCore = () => {
741
701
  if (import_fs2.default.existsSync(core)) import_fs2.default.rmSync(core, { recursive: true });
742
702
  };
@@ -806,14 +766,12 @@ program.command("dev").description("Run development server of EventCatalog").opt
806
766
  await checkAndConvertMdToMdx(dir, core);
807
767
  await runMigrations(dir);
808
768
  await catalogToAstro(dir, core);
809
- await copyServerFiles();
810
769
  const canEmbedPages = await (0, import_license.isFeatureEnabled)(
811
770
  "@eventcatalog/backstage-plugin-eventcatalog",
812
771
  process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
813
772
  );
814
773
  const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
815
774
  const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
816
- await createAuthFileIfNotExists(isEventCatalogScale);
817
775
  checkForUpdate();
818
776
  let watchUnsub;
819
777
  try {
@@ -854,7 +812,6 @@ program.command("build").description("Run build of EventCatalog").action(async (
854
812
  import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
855
813
  }
856
814
  copyCore();
857
- await copyServerFiles();
858
815
  const isBackstagePluginEnabled = await (0, import_license.isFeatureEnabled)(
859
816
  "@eventcatalog/backstage-plugin-eventcatalog",
860
817
  process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
@@ -862,7 +819,6 @@ program.command("build").description("Run build of EventCatalog").action(async (
862
819
  const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
863
820
  const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
864
821
  const canEmbedPages = isBackstagePluginEnabled || isEventCatalogScale;
865
- await createAuthFileIfNotExists(isEventCatalogScale);
866
822
  await log_build_default(dir, {
867
823
  isEventCatalogStarterEnabled: isEventCatalogStarter,
868
824
  isEventCatalogScaleEnabled: isEventCatalogScale,
@@ -924,8 +880,6 @@ program.command("preview").description("Serves the contents of your eventcatalog
924
880
  );
925
881
  const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
926
882
  const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
927
- await copyServerFiles();
928
- await createAuthFileIfNotExists(isEventCatalogScale);
929
883
  previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
930
884
  });
931
885
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
@@ -940,7 +894,6 @@ program.command("start").description("Serves the contents of your eventcatalog b
940
894
  );
941
895
  const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
942
896
  const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
943
- await copyServerFiles();
944
897
  const isServerOutput = await isOutputServer();
945
898
  if (isServerOutput) {
946
899
  startServerCatalog({
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-ZK4S7XBB.js";
10
- import "./chunk-R6WYYOD5.js";
9
+ } from "./chunk-IZGKMOOO.js";
10
+ import "./chunk-7ANM33NO.js";
11
11
  import {
12
12
  runMigrations
13
13
  } from "./chunk-BH3JMNAV.js";
@@ -18,18 +18,17 @@ import {
18
18
  } from "./chunk-R2BJ7MJG.js";
19
19
  import "./chunk-55D645EH.js";
20
20
  import {
21
- isAuthEnabled,
22
21
  isOutputServer
23
22
  } from "./chunk-5VBIXL6C.js";
24
23
  import {
25
24
  generate
26
- } from "./chunk-FQUOTAQT.js";
25
+ } from "./chunk-VDAAJC4X.js";
27
26
  import {
28
27
  logger
29
- } from "./chunk-E7QOZU4L.js";
28
+ } from "./chunk-SUPFYBDY.js";
30
29
  import {
31
30
  VERSION
32
- } from "./chunk-FHSD3KUQ.js";
31
+ } from "./chunk-BLIEWBVS.js";
33
32
  import "./chunk-UPONRQSN.js";
34
33
 
35
34
  // src/eventcatalog.ts
@@ -76,41 +75,6 @@ var copyCore = () => {
76
75
  }
77
76
  });
78
77
  };
79
- var copyServerFiles = async () => {
80
- const isServerOutput = await isOutputServer();
81
- if (fs.existsSync(join(core, "src/pages/api/server"))) {
82
- fs.rmSync(join(core, "src/pages/api/server"), { recursive: true });
83
- }
84
- if (!isServerOutput) {
85
- if (fs.existsSync(join(core, "src/pages/api/chat.ts"))) {
86
- fs.rmSync(join(core, "src/pages/api/chat.ts"));
87
- }
88
- if (fs.existsSync(join(core, "src/pages/api/[...auth].ts"))) {
89
- fs.rmSync(join(core, "src/pages/api/[...auth].ts"));
90
- }
91
- return;
92
- }
93
- fs.cpSync(join(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), join(core, "src/pages/api"), {
94
- recursive: true
95
- });
96
- };
97
- var createAuthFileIfNotExists = async (hasRequiredLicense) => {
98
- const authEnabled = await isAuthEnabled();
99
- const isSRR = await isOutputServer();
100
- try {
101
- if (authEnabled && hasRequiredLicense && isSRR) {
102
- logger.info("Creating auth file", "auth");
103
- fs.writeFileSync(
104
- join(core, "src/pages/api/[...auth].ts"),
105
- `import { AstroAuth } from 'auth-astro/server';
106
- export const prerender = false;
107
- export const { GET, POST } = AstroAuth();
108
- `
109
- );
110
- }
111
- } catch (error) {
112
- }
113
- };
114
78
  var clearCore = () => {
115
79
  if (fs.existsSync(core)) fs.rmSync(core, { recursive: true });
116
80
  };
@@ -180,14 +144,12 @@ program.command("dev").description("Run development server of EventCatalog").opt
180
144
  await checkAndConvertMdToMdx(dir, core);
181
145
  await runMigrations(dir);
182
146
  await catalogToAstro(dir, core);
183
- await copyServerFiles();
184
147
  const canEmbedPages = await isFeatureEnabled(
185
148
  "@eventcatalog/backstage-plugin-eventcatalog",
186
149
  process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
187
150
  );
188
151
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
189
152
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
190
- await createAuthFileIfNotExists(isEventCatalogScale);
191
153
  checkForUpdate();
192
154
  let watchUnsub;
193
155
  try {
@@ -228,7 +190,6 @@ program.command("build").description("Run build of EventCatalog").action(async (
228
190
  dotenv.config({ path: path.join(dir, ".env") });
229
191
  }
230
192
  copyCore();
231
- await copyServerFiles();
232
193
  const isBackstagePluginEnabled = await isFeatureEnabled(
233
194
  "@eventcatalog/backstage-plugin-eventcatalog",
234
195
  process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
@@ -236,7 +197,6 @@ program.command("build").description("Run build of EventCatalog").action(async (
236
197
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
237
198
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
238
199
  const canEmbedPages = isBackstagePluginEnabled || isEventCatalogScale;
239
- await createAuthFileIfNotExists(isEventCatalogScale);
240
200
  await log_build_default(dir, {
241
201
  isEventCatalogStarterEnabled: isEventCatalogStarter,
242
202
  isEventCatalogScaleEnabled: isEventCatalogScale,
@@ -298,8 +258,6 @@ program.command("preview").description("Serves the contents of your eventcatalog
298
258
  );
299
259
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
300
260
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
301
- await copyServerFiles();
302
- await createAuthFileIfNotExists(isEventCatalogScale);
303
261
  previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
304
262
  });
305
263
  program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
@@ -314,7 +272,6 @@ program.command("start").description("Serves the contents of your eventcatalog b
314
272
  );
315
273
  const isEventCatalogStarter = await isEventCatalogStarterEnabled();
316
274
  const isEventCatalogScale = await isEventCatalogScaleEnabled();
317
- await copyServerFiles();
318
275
  const isServerOutput = await isOutputServer();
319
276
  if (isServerOutput) {
320
277
  startServerCatalog({
package/dist/generate.cjs CHANGED
@@ -73,7 +73,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
73
73
  var import_picocolors = __toESM(require("picocolors"), 1);
74
74
 
75
75
  // package.json
76
- var version = "3.0.0-beta.19";
76
+ var version = "3.0.0-beta.20";
77
77
 
78
78
  // src/constants.ts
79
79
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-FQUOTAQT.js";
4
- import "./chunk-E7QOZU4L.js";
5
- import "./chunk-FHSD3KUQ.js";
3
+ } from "./chunk-VDAAJC4X.js";
4
+ import "./chunk-SUPFYBDY.js";
5
+ import "./chunk-BLIEWBVS.js";
6
6
  import "./chunk-UPONRQSN.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.0.0-beta.19";
39
+ var version = "3.0.0-beta.20";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-E7QOZU4L.js";
4
- import "../chunk-FHSD3KUQ.js";
3
+ } from "../chunk-SUPFYBDY.js";
4
+ import "../chunk-BLIEWBVS.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -20,12 +20,14 @@ import rehypeExpressiveCode from 'rehype-expressive-code'
20
20
  import config from './eventcatalog.config';
21
21
  import expressiveCode from 'astro-expressive-code';
22
22
  import ecstudioWatcher from './integrations/ecstudio-watcher.mjs';
23
+ import eventCatalogIntegration from './integrations/eventcatalog-features.ts';
23
24
 
24
25
  const projectDirectory = process.env.PROJECT_DIR || process.cwd();
25
26
  const base = config.base || '/';
26
27
  const host = config.host || false;
27
28
  const compress = config.compress ?? false;
28
29
 
30
+
29
31
  const expressiveCodeConfig = {
30
32
  themes: ['andromeeda'],
31
33
  defaultProps: {
@@ -89,6 +91,7 @@ export default defineConfig({
89
91
  CSS: false,
90
92
  }),
91
93
  ecstudioWatcher(),
94
+ eventCatalogIntegration(),
92
95
  ].filter(Boolean),
93
96
  vite: {
94
97
  define: {
@@ -0,0 +1,69 @@
1
+ import type { AstroIntegration } from 'astro';
2
+ import path from 'path';
3
+ import {
4
+ isEventCatalogChatEnabled,
5
+ isAuthEnabled,
6
+ isEventCatalogScaleEnabled,
7
+ isEventCatalogStarterEnabled,
8
+ } from '../src/utils/feature';
9
+
10
+ const catalogDirectory = process.env.CATALOG_DIR || process.cwd();
11
+
12
+ const configureAuthentication = (params: {
13
+ injectRoute: (route: { pattern: string; entrypoint: string }) => void;
14
+ addMiddleware: (middleware: { entrypoint: string; order: 'pre' }) => void;
15
+ }) => {
16
+ params.injectRoute({
17
+ pattern: '/api/[...auth]',
18
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/[...auth].ts'),
19
+ });
20
+ params.injectRoute({
21
+ pattern: '/auth/login',
22
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/login.astro'),
23
+ });
24
+ params.injectRoute({
25
+ pattern: '/auth/error',
26
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/error.astro'),
27
+ });
28
+
29
+ params.injectRoute({
30
+ pattern: '/unauthorized',
31
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/unauthorized.astro'),
32
+ });
33
+
34
+ // Add the authentication middleware
35
+ params.addMiddleware({
36
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/auth/middleware/middleware.ts'),
37
+ order: 'pre',
38
+ });
39
+ };
40
+
41
+ export default function eventCatalogIntegration(): AstroIntegration {
42
+ return {
43
+ name: 'eventcatalog',
44
+ hooks: {
45
+ 'astro:config:setup': (params) => {
46
+ // Handle routes for AI features
47
+ if (isEventCatalogChatEnabled()) {
48
+ params.injectRoute({
49
+ pattern: '/api/chat',
50
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/ai/chat-api.ts'),
51
+ });
52
+ }
53
+
54
+ // Handle routes for authentication
55
+ if (isAuthEnabled()) {
56
+ configureAuthentication(params);
57
+ }
58
+
59
+ // If non paying user, add the plans route into the project
60
+ if (!isEventCatalogStarterEnabled() && !isEventCatalogScaleEnabled()) {
61
+ params.injectRoute({
62
+ pattern: '/plans',
63
+ entrypoint: path.join(catalogDirectory, 'src/enterprise/plans/index.astro'),
64
+ });
65
+ }
66
+ },
67
+ },
68
+ };
69
+ }
@@ -217,12 +217,12 @@ const ChatPanel = ({ isOpen, onClose }: ChatPanelProps) => {
217
217
  (p) => p.type === 'text' && (p as { type: 'text'; text: string }).text.length > 0
218
218
  );
219
219
 
220
- // Clear waiting state once assistant starts outputting
220
+ // Clear waiting state once assistant starts outputting or on error
221
221
  useEffect(() => {
222
- if (assistantHasContent) {
222
+ if (assistantHasContent || status === 'error') {
223
223
  setIsWaitingForResponse(false);
224
224
  }
225
- }, [assistantHasContent]);
225
+ }, [assistantHasContent, status]);
226
226
 
227
227
  const isStreaming = status === 'streaming' && assistantHasContent;
228
228
  const isThinking = isWaitingForResponse || ((status === 'submitted' || status === 'streaming') && !assistantHasContent);
@@ -523,11 +523,14 @@ const ChatPanel = ({ isOpen, onClose }: ChatPanelProps) => {
523
523
  </div>
524
524
  )}
525
525
 
526
- {/* Error message */}
526
+ {/* Error message as chat bubble */}
527
527
  {status === 'error' && (
528
- <div className="flex justify-center">
529
- <div className="bg-red-50 text-red-600 rounded-lg px-4 py-2 text-sm">
530
- Something went wrong. Please try again.
528
+ <div className="flex justify-start">
529
+ <div className="w-full">
530
+ <div className="flex items-start gap-2 text-red-600 text-sm">
531
+ <span className="shrink-0">⚠️</span>
532
+ <span>Something went wrong. Please try again.</span>
533
+ </div>
531
534
  </div>
532
535
  </div>
533
536
  )}
@@ -747,10 +750,14 @@ const ChatPanel = ({ isOpen, onClose }: ChatPanelProps) => {
747
750
  </div>
748
751
  )}
749
752
 
753
+ {/* Error message as chat bubble */}
750
754
  {status === 'error' && (
751
- <div className="flex justify-center">
752
- <div className="bg-red-50 text-red-600 rounded-lg px-4 py-2 text-sm">
753
- Something went wrong. Please try again.
755
+ <div className="flex justify-start">
756
+ <div className="w-full">
757
+ <div className="flex items-start gap-2 text-red-600 text-sm">
758
+ <span className="shrink-0">⚠️</span>
759
+ <span>Something went wrong. Please try again.</span>
760
+ </div>
754
761
  </div>
755
762
  </div>
756
763
  )}
@@ -7,7 +7,7 @@ import fs from 'fs';
7
7
  import path from 'path';
8
8
 
9
9
  // Enterprise Collections
10
- import { chatPromptsSchema, customPagesSchema } from './enterprise/collections';
10
+ import { customPagesSchema } from './enterprise/collections';
11
11
 
12
12
  export const projectDirBase = (() => {
13
13
  if (process.platform === 'win32') {
@@ -469,14 +469,6 @@ const customPages = defineCollection({
469
469
  schema: customPagesSchema,
470
470
  });
471
471
 
472
- const chatPrompts = defineCollection({
473
- loader: glob({
474
- pattern: ['chat-prompts/*.(md|mdx)', 'chat-prompts/**/*.@(md|mdx)'],
475
- base: projectDirBase,
476
- }),
477
- schema: chatPromptsSchema,
478
- });
479
-
480
472
  const domains = defineCollection({
481
473
  loader: glob({
482
474
  pattern: [
@@ -722,7 +714,6 @@ export const collections = {
722
714
 
723
715
  // EventCatalog Pro Collections
724
716
  customPages,
725
- chatPrompts,
726
717
 
727
718
  // EventCatalog Studio Collections
728
719
  designs,
@@ -0,0 +1,3 @@
1
+ import { AstroAuth } from 'auth-astro/server';
2
+ export const prerender = false;
3
+ export const { GET, POST } = AstroAuth();