@mongoosejs/studio 0.5.9 → 0.5.10
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/backend/integrations/streamLLM.js +1 -1
- package/frontend/index.js +2 -1
- package/frontend/public/app.js +28 -5
- package/frontend/src/_util/document-search-autocomplete.js +11 -0
- package/frontend/src/index.js +0 -4
- package/frontend/src/models/document-search/document-search.js +16 -0
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@ module.exports = async function* streamLLM(messages, system, options) {
|
|
|
51
51
|
system,
|
|
52
52
|
messages,
|
|
53
53
|
tools: options?.tools,
|
|
54
|
-
stopWhen: options?.tools ? stepCountIs(
|
|
54
|
+
stopWhen: options?.tools ? stepCountIs(50) : undefined,
|
|
55
55
|
onError(err) {
|
|
56
56
|
error = err.error;
|
|
57
57
|
}
|
package/frontend/index.js
CHANGED
|
@@ -6,6 +6,7 @@ const path = require('path');
|
|
|
6
6
|
const webpack = require('webpack');
|
|
7
7
|
const { defaultMothershipURL } = require('../constants');
|
|
8
8
|
const webpackConfig = require('./webpack.config');
|
|
9
|
+
const util = require('util');
|
|
9
10
|
|
|
10
11
|
module.exports = async function frontend(apiUrl, isLambda, options, workspace) {
|
|
11
12
|
const mothershipUrl = options?._mothershipUrl || defaultMothershipURL;
|
|
@@ -22,7 +23,7 @@ module.exports = async function frontend(apiUrl, isLambda, options, workspace) {
|
|
|
22
23
|
.then(response => {
|
|
23
24
|
if (response.status < 200 || response.status >= 400) {
|
|
24
25
|
return response.json().then(data => {
|
|
25
|
-
throw new Error(`Mongoose Studio API Key Error ${response.status}: ${
|
|
26
|
+
throw new Error(`Mongoose Studio API Key Error ${response.status}: ${util.inspect(data)}`);
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
return response;
|
package/frontend/public/app.js
CHANGED
|
@@ -614,6 +614,16 @@ function applySuggestion(searchText, cursorPos, suggestion) {
|
|
|
614
614
|
return null;
|
|
615
615
|
}
|
|
616
616
|
|
|
617
|
+
function insertClosingBrace(searchText, selectionStart, selectionEnd) {
|
|
618
|
+
const start = typeof selectionStart === 'number' ? selectionStart : searchText.length;
|
|
619
|
+
const end = typeof selectionEnd === 'number' ? selectionEnd : start;
|
|
620
|
+
const selectedText = searchText.slice(start, end);
|
|
621
|
+
return {
|
|
622
|
+
text: searchText.slice(0, start) + `{${selectedText}}` + searchText.slice(end),
|
|
623
|
+
newCursorPos: start + 1 + selectedText.length
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
|
|
617
627
|
/**
|
|
618
628
|
* When the cursor is inside a Date(…) or new Date(…) argument, returns the
|
|
619
629
|
* slice indices of that argument so a picker can replace it with a quoted ISO string.
|
|
@@ -695,6 +705,7 @@ module.exports = {
|
|
|
695
705
|
getAutocompleteContext,
|
|
696
706
|
getAutocompleteSuggestions,
|
|
697
707
|
applySuggestion,
|
|
708
|
+
insertClosingBrace,
|
|
698
709
|
getDatePickerInsertionRange,
|
|
699
710
|
dateArgumentSliceToDatetimeLocal,
|
|
700
711
|
formatDateArgumentValue,
|
|
@@ -7736,10 +7747,6 @@ module.exports = function getCurrentDateTimeContext() {
|
|
|
7736
7747
|
"use strict";
|
|
7737
7748
|
|
|
7738
7749
|
|
|
7739
|
-
if (typeof process === 'undefined') {
|
|
7740
|
-
__webpack_require__.g.process = { env: {} }; // To make `util` package work
|
|
7741
|
-
}
|
|
7742
|
-
|
|
7743
7750
|
const { version } = __webpack_require__(/*! ../../package.json */ "./package.json");
|
|
7744
7751
|
console.log(`Mongoose Studio Version ${version}`);
|
|
7745
7752
|
|
|
@@ -9023,6 +9030,7 @@ const {
|
|
|
9023
9030
|
buildAutocompleteTrie,
|
|
9024
9031
|
getAutocompleteSuggestions,
|
|
9025
9032
|
applySuggestion,
|
|
9033
|
+
insertClosingBrace,
|
|
9026
9034
|
getDatePickerInsertionRange,
|
|
9027
9035
|
dateArgumentSliceToDatetimeLocal,
|
|
9028
9036
|
insertDateInDateArgument
|
|
@@ -9157,6 +9165,21 @@ module.exports = app => app.component('document-search', {
|
|
|
9157
9165
|
});
|
|
9158
9166
|
},
|
|
9159
9167
|
handleKeyDown(ev) {
|
|
9168
|
+
if (ev.key === '{') {
|
|
9169
|
+
ev.preventDefault();
|
|
9170
|
+
const input = this.$refs.searchInput;
|
|
9171
|
+
const selectionStart = input ? input.selectionStart : this.searchText.length;
|
|
9172
|
+
const selectionEnd = input ? input.selectionEnd : selectionStart;
|
|
9173
|
+
const result = insertClosingBrace(this.searchText, selectionStart, selectionEnd);
|
|
9174
|
+
this.searchText = result.text;
|
|
9175
|
+
this.$nextTick(() => {
|
|
9176
|
+
if (input) {
|
|
9177
|
+
input.setSelectionRange(result.newCursorPos, result.newCursorPos);
|
|
9178
|
+
}
|
|
9179
|
+
this.updateAutocomplete();
|
|
9180
|
+
});
|
|
9181
|
+
return;
|
|
9182
|
+
}
|
|
9160
9183
|
if (this.autocompleteSuggestions.length === 0) {
|
|
9161
9184
|
return;
|
|
9162
9185
|
}
|
|
@@ -65762,7 +65785,7 @@ var src_default = VueToastificationPlugin;
|
|
|
65762
65785
|
(module) {
|
|
65763
65786
|
|
|
65764
65787
|
"use strict";
|
|
65765
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.5.
|
|
65788
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.5.10","description":"AI-Powered Data Workspace for MongoDB: Turn your MongoDB data into dashboards, maps, and interactive workflows - powered by your Mongoose models and AI.","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","ace-builds":"^1.43.6","ai":"5.x","archetype":"0.13.1","csv-stringify":"6.3.0","ejson":"^2.2.3","extrovert":"^0.2.0","marked":"15.0.12","mpath":"^0.9.0","node-inspect-extracted":"3.x","regexp.escape":"^2.0.1","tailwindcss":"3.4.0","time-commando":"1.0.1","typescript":"^6.0.2","vue":"3.x","vue-toastification":"^2.0.0-rc.5","webpack":"5.x","xss":"^1.0.15"},"peerDependencies":{"@nestjs/common":"10.x || 11.x","mongoose":"7.x || 8.x || ^9.0.0"},"peerDependenciesMeta":{"@nestjs/common":{"optional":true}},"optionalPeerDependencies":{"@mongoosejs/task":"0.5.x || 0.6.x"},"devDependencies":{"@masteringjs/eslint-config":"0.1.1","axios":"1.2.2","dedent":"^1.6.0","eslint":"9.30.0","@nestjs/common":"^11.1.9","express":"4.x","mocha":"10.2.0","mongodb-memory-server":"^11.0.1","mongoose":"9.x","sinon":"^21.0.1"},"scripts":{"lint":"eslint .","seed":"node seed/index.js","start":"node ./local.js","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","eval:agent":"node eval/agent/run.js"}}');
|
|
65766
65789
|
|
|
65767
65790
|
/***/ }
|
|
65768
65791
|
|
|
@@ -220,6 +220,16 @@ function applySuggestion(searchText, cursorPos, suggestion) {
|
|
|
220
220
|
return null;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
function insertClosingBrace(searchText, selectionStart, selectionEnd) {
|
|
224
|
+
const start = typeof selectionStart === 'number' ? selectionStart : searchText.length;
|
|
225
|
+
const end = typeof selectionEnd === 'number' ? selectionEnd : start;
|
|
226
|
+
const selectedText = searchText.slice(start, end);
|
|
227
|
+
return {
|
|
228
|
+
text: searchText.slice(0, start) + `{${selectedText}}` + searchText.slice(end),
|
|
229
|
+
newCursorPos: start + 1 + selectedText.length
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
223
233
|
/**
|
|
224
234
|
* When the cursor is inside a Date(…) or new Date(…) argument, returns the
|
|
225
235
|
* slice indices of that argument so a picker can replace it with a quoted ISO string.
|
|
@@ -301,6 +311,7 @@ module.exports = {
|
|
|
301
311
|
getAutocompleteContext,
|
|
302
312
|
getAutocompleteSuggestions,
|
|
303
313
|
applySuggestion,
|
|
314
|
+
insertClosingBrace,
|
|
304
315
|
getDatePickerInsertionRange,
|
|
305
316
|
dateArgumentSliceToDatetimeLocal,
|
|
306
317
|
formatDateArgumentValue,
|
package/frontend/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const {
|
|
|
5
5
|
buildAutocompleteTrie,
|
|
6
6
|
getAutocompleteSuggestions,
|
|
7
7
|
applySuggestion,
|
|
8
|
+
insertClosingBrace,
|
|
8
9
|
getDatePickerInsertionRange,
|
|
9
10
|
dateArgumentSliceToDatetimeLocal,
|
|
10
11
|
insertDateInDateArgument
|
|
@@ -139,6 +140,21 @@ module.exports = app => app.component('document-search', {
|
|
|
139
140
|
});
|
|
140
141
|
},
|
|
141
142
|
handleKeyDown(ev) {
|
|
143
|
+
if (ev.key === '{') {
|
|
144
|
+
ev.preventDefault();
|
|
145
|
+
const input = this.$refs.searchInput;
|
|
146
|
+
const selectionStart = input ? input.selectionStart : this.searchText.length;
|
|
147
|
+
const selectionEnd = input ? input.selectionEnd : selectionStart;
|
|
148
|
+
const result = insertClosingBrace(this.searchText, selectionStart, selectionEnd);
|
|
149
|
+
this.searchText = result.text;
|
|
150
|
+
this.$nextTick(() => {
|
|
151
|
+
if (input) {
|
|
152
|
+
input.setSelectionRange(result.newCursorPos, result.newCursorPos);
|
|
153
|
+
}
|
|
154
|
+
this.updateAutocomplete();
|
|
155
|
+
});
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
142
158
|
if (this.autocompleteSuggestions.length === 0) {
|
|
143
159
|
return;
|
|
144
160
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "AI-Powered Data Workspace for MongoDB: Turn your MongoDB data into dashboards, maps, and interactive workflows - powered by your Mongoose models and AI.",
|
|
5
5
|
"homepage": "https://mongoosestudio.app/",
|
|
6
6
|
"repository": {
|