@mongoosejs/studio 0.2.4 → 0.2.5

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.
@@ -1488,7 +1488,7 @@ module.exports = "<div class=\"flex\" style=\"height: calc(100vh - 55px); height
1488
1488
  const api = __webpack_require__(/*! ../api */ "./frontend/src/api.js");
1489
1489
  const template = __webpack_require__(/*! ./chat.html */ "./frontend/src/chat/chat.html");
1490
1490
 
1491
- module.exports = app => app.component('chat', {
1491
+ module.exports = {
1492
1492
  template: template,
1493
1493
  props: ['threadId'],
1494
1494
  data: () => ({
@@ -1533,10 +1533,14 @@ module.exports = app => app.component('chat', {
1533
1533
  if (event.chatMessage) {
1534
1534
  if (!userChatMessage) {
1535
1535
  userChatMessage = event.chatMessage;
1536
- } else {
1536
+ } else if (!assistantChatMessage) {
1537
1537
  const assistantChatMessageIndex = this.chatMessages.indexOf(assistantChatMessage);
1538
1538
  assistantChatMessage = event.chatMessage;
1539
- this.chatMessages[assistantChatMessageIndex] = assistantChatMessage;
1539
+ if (assistantChatMessageIndex !== -1) {
1540
+ this.chatMessages[assistantChatMessageIndex] = assistantChatMessage;
1541
+ } else {
1542
+ this.chatMessages.push(assistantChatMessage);
1543
+ }
1540
1544
  }
1541
1545
  } else if (event.chatThread) {
1542
1546
  for (const thread of this.chatThreads) {
@@ -1669,7 +1673,7 @@ module.exports = app => app.component('chat', {
1669
1673
 
1670
1674
  this.$refs.messageInput.focus();
1671
1675
  }
1672
- });
1676
+ };
1673
1677
 
1674
1678
 
1675
1679
  /***/ },
@@ -32450,7 +32454,7 @@ const compile = () => {
32450
32454
  (module) {
32451
32455
 
32452
32456
  "use strict";
32453
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.2.4","description":"A Mongoose-native MongoDB UI with schema-aware autocomplete, AI-assisted queries, and dashboards that understand your models - not just your data.","homepage":"https://mongoosestudio.app/","repository":{"type":"git","url":"https://github.com/mongoosejs/studio"},"license":"Apache-2.0","dependencies":{"@ai-sdk/anthropic":"2.x","@ai-sdk/google":"2.x","@ai-sdk/openai":"2.x","ai":"5.x","archetype":"0.13.1","csv-stringify":"6.3.0","ejson":"^2.2.3","extrovert":"^0.2.0","marked":"15.0.12","node-inspect-extracted":"3.x","tailwindcss":"3.4.0","vue":"3.x","vue-toastification":"^2.0.0-rc.5","webpack":"5.x"},"peerDependencies":{"mongoose":"7.x || 8.x || ^9.0.0"},"devDependencies":{"@masteringjs/eslint-config":"0.1.1","axios":"1.2.2","dedent":"^1.6.0","eslint":"9.30.0","express":"4.x","mocha":"10.2.0","mongoose":"9.x","sinon":"^21.0.1"},"scripts":{"lint":"eslint .","tailwind":"tailwindcss -o ./frontend/public/tw.css","tailwind:watch":"tailwindcss -o ./frontend/public/tw.css --watch","test":"mocha test/*.test.js","test:frontend":"mocha test/frontend/*.test.js"}}');
32457
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.2.5","description":"A Mongoose-native MongoDB UI with schema-aware autocomplete, AI-assisted queries, and dashboards that understand your models - not just your data.","homepage":"https://mongoosestudio.app/","repository":{"type":"git","url":"https://github.com/mongoosejs/studio"},"license":"Apache-2.0","dependencies":{"@ai-sdk/anthropic":"2.x","@ai-sdk/google":"2.x","@ai-sdk/openai":"2.x","ai":"5.x","archetype":"0.13.1","csv-stringify":"6.3.0","ejson":"^2.2.3","extrovert":"^0.2.0","marked":"15.0.12","node-inspect-extracted":"3.x","tailwindcss":"3.4.0","vue":"3.x","vue-toastification":"^2.0.0-rc.5","webpack":"5.x"},"peerDependencies":{"mongoose":"7.x || 8.x || ^9.0.0"},"devDependencies":{"@masteringjs/eslint-config":"0.1.1","axios":"1.2.2","dedent":"^1.6.0","eslint":"9.30.0","express":"4.x","mocha":"10.2.0","mongoose":"9.x","sinon":"^21.0.1"},"scripts":{"lint":"eslint .","tailwind":"tailwindcss -o ./frontend/public/tw.css","tailwind:watch":"tailwindcss -o ./frontend/public/tw.css --watch","test":"mocha test/*.test.js","test:frontend":"mocha test/frontend/*.test.js"}}');
32454
32458
 
32455
32459
  /***/ }
32456
32460
 
@@ -3,7 +3,7 @@
3
3
  const api = require('../api');
4
4
  const template = require('./chat.html');
5
5
 
6
- module.exports = app => app.component('chat', {
6
+ module.exports = {
7
7
  template: template,
8
8
  props: ['threadId'],
9
9
  data: () => ({
@@ -48,10 +48,14 @@ module.exports = app => app.component('chat', {
48
48
  if (event.chatMessage) {
49
49
  if (!userChatMessage) {
50
50
  userChatMessage = event.chatMessage;
51
- } else {
51
+ } else if (!assistantChatMessage) {
52
52
  const assistantChatMessageIndex = this.chatMessages.indexOf(assistantChatMessage);
53
53
  assistantChatMessage = event.chatMessage;
54
- this.chatMessages[assistantChatMessageIndex] = assistantChatMessage;
54
+ if (assistantChatMessageIndex !== -1) {
55
+ this.chatMessages[assistantChatMessageIndex] = assistantChatMessage;
56
+ } else {
57
+ this.chatMessages.push(assistantChatMessage);
58
+ }
55
59
  }
56
60
  } else if (event.chatThread) {
57
61
  for (const thread of this.chatThreads) {
@@ -184,4 +188,4 @@ module.exports = app => app.component('chat', {
184
188
 
185
189
  this.$refs.messageInput.focus();
186
190
  }
187
- });
191
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongoosejs/studio",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "A Mongoose-native MongoDB UI with schema-aware autocomplete, AI-assisted queries, and dashboards that understand your models - not just your data.",
5
5
  "homepage": "https://mongoosestudio.app/",
6
6
  "repository": {