@nocobase/plugin-ai 2.1.0-beta.17 → 2.1.0-beta.19
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/dist/ai/ai-employees/atlas/prompt.md +28 -22
- package/dist/ai/ai-employees/viz.js +14 -88
- package/dist/ai/skills/business-analysis-report/SKILLS.md +8 -3
- package/dist/ai/skills/business-analysis-report/tools/businessReportGenerator.js +49 -8
- package/dist/client/280.003b9e9788599244.js +10 -0
- package/dist/client/{646.51313bb0d85d6366.js → 646.cba98d80e9e6ea74.js} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/common/recommended-models.js +1 -25
- package/dist/externalVersion.js +14 -14
- package/dist/locale/en-US.json +9 -0
- package/dist/locale/zh-CN.json +9 -0
- package/dist/node_modules/fast-glob/package.json +1 -1
- package/dist/node_modules/flexsearch/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/bin/cli.js +179 -0
- package/dist/node_modules/jsonrepair/lib/cjs/index.js +1 -0
- package/dist/node_modules/jsonrepair/lib/cjs/package.json +3 -0
- package/dist/node_modules/jsonrepair/lib/cjs/regular/jsonrepair.js +746 -0
- package/dist/node_modules/jsonrepair/lib/cjs/stream.js +13 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/buffer/InputBuffer.js +75 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/buffer/OutputBuffer.js +117 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/core.js +824 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/stack.js +51 -0
- package/dist/node_modules/jsonrepair/lib/cjs/streaming/stream.js +37 -0
- package/dist/node_modules/jsonrepair/lib/cjs/utils/JSONRepairError.js +14 -0
- package/dist/node_modules/jsonrepair/lib/cjs/utils/stringUtils.js +174 -0
- package/dist/node_modules/jsonrepair/lib/esm/index.js +4 -0
- package/dist/node_modules/jsonrepair/lib/esm/regular/jsonrepair.js +740 -0
- package/dist/node_modules/jsonrepair/lib/esm/stream.js +3 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/buffer/InputBuffer.js +69 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/buffer/OutputBuffer.js +111 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/core.js +818 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/stack.js +44 -0
- package/dist/node_modules/jsonrepair/lib/esm/streaming/stream.js +31 -0
- package/dist/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js +7 -0
- package/dist/node_modules/jsonrepair/lib/esm/utils/stringUtils.js +147 -0
- package/dist/node_modules/jsonrepair/lib/types/index.d.ts +3 -0
- package/dist/node_modules/jsonrepair/lib/types/regular/jsonrepair.d.ts +18 -0
- package/dist/node_modules/jsonrepair/lib/types/stream.d.ts +2 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/buffer/InputBuffer.d.ts +14 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/buffer/OutputBuffer.d.ts +18 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/core.d.ts +11 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/stack.d.ts +20 -0
- package/dist/node_modules/jsonrepair/lib/types/streaming/stream.d.ts +7 -0
- package/dist/node_modules/jsonrepair/lib/types/utils/JSONRepairError.d.ts +5 -0
- package/dist/node_modules/jsonrepair/lib/types/utils/stringUtils.d.ts +65 -0
- package/dist/node_modules/jsonrepair/lib/umd/jsonrepair.js +903 -0
- package/dist/node_modules/jsonrepair/lib/umd/jsonrepair.min.js +3 -0
- package/dist/node_modules/jsonrepair/lib/umd/package.json +3 -0
- package/dist/node_modules/jsonrepair/package.json +1 -0
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/resource/aiEmployees.js +15 -1
- package/dist/server/resource/aiSkills.js +1 -1
- package/package.json +2 -2
- package/dist/client/280.029428b83d62155f.js +0 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "jsonrepairTransform", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _stream.jsonrepairTransform;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _stream = require("./streaming/stream.js");
|
|
13
|
+
//# sourceMappingURL=stream.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createInputBuffer = createInputBuffer;
|
|
7
|
+
function createInputBuffer() {
|
|
8
|
+
let buffer = '';
|
|
9
|
+
let offset = 0;
|
|
10
|
+
let currentLength = 0;
|
|
11
|
+
let closed = false;
|
|
12
|
+
function ensure(index) {
|
|
13
|
+
if (index < offset) {
|
|
14
|
+
throw new Error(`${indexOutOfRangeMessage} (index: ${index}, offset: ${offset})`);
|
|
15
|
+
}
|
|
16
|
+
if (index >= currentLength) {
|
|
17
|
+
if (!closed) {
|
|
18
|
+
throw new Error(`${indexOutOfRangeMessage} (index: ${index})`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function push(chunk) {
|
|
23
|
+
buffer += chunk;
|
|
24
|
+
currentLength += chunk.length;
|
|
25
|
+
}
|
|
26
|
+
function flush(position) {
|
|
27
|
+
if (position > currentLength) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
buffer = buffer.substring(position - offset);
|
|
31
|
+
offset = position;
|
|
32
|
+
}
|
|
33
|
+
function charAt(index) {
|
|
34
|
+
ensure(index);
|
|
35
|
+
return buffer.charAt(index - offset);
|
|
36
|
+
}
|
|
37
|
+
function charCodeAt(index) {
|
|
38
|
+
ensure(index);
|
|
39
|
+
return buffer.charCodeAt(index - offset);
|
|
40
|
+
}
|
|
41
|
+
function substring(start, end) {
|
|
42
|
+
ensure(end - 1); // -1 because end is excluded
|
|
43
|
+
ensure(start);
|
|
44
|
+
return buffer.slice(start - offset, end - offset);
|
|
45
|
+
}
|
|
46
|
+
function length() {
|
|
47
|
+
if (!closed) {
|
|
48
|
+
throw new Error('Cannot get length: input is not yet closed');
|
|
49
|
+
}
|
|
50
|
+
return currentLength;
|
|
51
|
+
}
|
|
52
|
+
function isEnd(index) {
|
|
53
|
+
if (!closed) {
|
|
54
|
+
ensure(index);
|
|
55
|
+
}
|
|
56
|
+
return index >= currentLength;
|
|
57
|
+
}
|
|
58
|
+
function close() {
|
|
59
|
+
closed = true;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
push,
|
|
63
|
+
flush,
|
|
64
|
+
charAt,
|
|
65
|
+
charCodeAt,
|
|
66
|
+
substring,
|
|
67
|
+
length,
|
|
68
|
+
currentLength: () => currentLength,
|
|
69
|
+
currentBufferSize: () => buffer.length,
|
|
70
|
+
isEnd,
|
|
71
|
+
close
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const indexOutOfRangeMessage = 'Index out of range, please configure a larger buffer size';
|
|
75
|
+
//# sourceMappingURL=InputBuffer.js.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createOutputBuffer = createOutputBuffer;
|
|
7
|
+
var _stringUtils = require("../../utils/stringUtils.js");
|
|
8
|
+
function createOutputBuffer(_ref) {
|
|
9
|
+
let {
|
|
10
|
+
write,
|
|
11
|
+
chunkSize,
|
|
12
|
+
bufferSize
|
|
13
|
+
} = _ref;
|
|
14
|
+
let buffer = '';
|
|
15
|
+
let offset = 0;
|
|
16
|
+
function flushChunks() {
|
|
17
|
+
let minSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bufferSize;
|
|
18
|
+
while (buffer.length >= minSize + chunkSize) {
|
|
19
|
+
const chunk = buffer.substring(0, chunkSize);
|
|
20
|
+
write(chunk);
|
|
21
|
+
offset += chunkSize;
|
|
22
|
+
buffer = buffer.substring(chunkSize);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function flush() {
|
|
26
|
+
flushChunks(0);
|
|
27
|
+
if (buffer.length > 0) {
|
|
28
|
+
write(buffer);
|
|
29
|
+
offset += buffer.length;
|
|
30
|
+
buffer = '';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function push(text) {
|
|
34
|
+
buffer += text;
|
|
35
|
+
flushChunks();
|
|
36
|
+
}
|
|
37
|
+
function unshift(text) {
|
|
38
|
+
if (offset > 0) {
|
|
39
|
+
throw new Error(`Cannot unshift: ${flushedMessage}`);
|
|
40
|
+
}
|
|
41
|
+
buffer = text + buffer;
|
|
42
|
+
flushChunks();
|
|
43
|
+
}
|
|
44
|
+
function remove(start, end) {
|
|
45
|
+
if (start < offset) {
|
|
46
|
+
throw new Error(`Cannot remove: ${flushedMessage}`);
|
|
47
|
+
}
|
|
48
|
+
if (end !== undefined) {
|
|
49
|
+
buffer = buffer.substring(0, start - offset) + buffer.substring(end - offset);
|
|
50
|
+
} else {
|
|
51
|
+
buffer = buffer.substring(0, start - offset);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function insertAt(index, text) {
|
|
55
|
+
if (index < offset) {
|
|
56
|
+
throw new Error(`Cannot insert: ${flushedMessage}`);
|
|
57
|
+
}
|
|
58
|
+
buffer = buffer.substring(0, index - offset) + text + buffer.substring(index - offset);
|
|
59
|
+
}
|
|
60
|
+
function length() {
|
|
61
|
+
return offset + buffer.length;
|
|
62
|
+
}
|
|
63
|
+
function stripLastOccurrence(textToStrip) {
|
|
64
|
+
let stripRemainingText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
65
|
+
const bufferIndex = buffer.lastIndexOf(textToStrip);
|
|
66
|
+
if (bufferIndex !== -1) {
|
|
67
|
+
if (stripRemainingText) {
|
|
68
|
+
buffer = buffer.substring(0, bufferIndex);
|
|
69
|
+
} else {
|
|
70
|
+
buffer = buffer.substring(0, bufferIndex) + buffer.substring(bufferIndex + textToStrip.length);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function insertBeforeLastWhitespace(textToInsert) {
|
|
75
|
+
let bufferIndex = buffer.length; // index relative to the start of the buffer, not taking `offset` into account
|
|
76
|
+
|
|
77
|
+
if (!(0, _stringUtils.isWhitespace)(buffer, bufferIndex - 1)) {
|
|
78
|
+
// no trailing whitespaces
|
|
79
|
+
push(textToInsert);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
while ((0, _stringUtils.isWhitespace)(buffer, bufferIndex - 1)) {
|
|
83
|
+
bufferIndex--;
|
|
84
|
+
}
|
|
85
|
+
if (bufferIndex <= 0) {
|
|
86
|
+
throw new Error(`Cannot insert: ${flushedMessage}`);
|
|
87
|
+
}
|
|
88
|
+
buffer = buffer.substring(0, bufferIndex) + textToInsert + buffer.substring(bufferIndex);
|
|
89
|
+
flushChunks();
|
|
90
|
+
}
|
|
91
|
+
function endsWithIgnoringWhitespace(char) {
|
|
92
|
+
let i = buffer.length - 1;
|
|
93
|
+
while (i > 0) {
|
|
94
|
+
if (char === buffer.charAt(i)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
if (!(0, _stringUtils.isWhitespace)(buffer, i)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
i--;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
push,
|
|
106
|
+
unshift,
|
|
107
|
+
remove,
|
|
108
|
+
insertAt,
|
|
109
|
+
length,
|
|
110
|
+
flush,
|
|
111
|
+
stripLastOccurrence,
|
|
112
|
+
insertBeforeLastWhitespace,
|
|
113
|
+
endsWithIgnoringWhitespace
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const flushedMessage = 'start of the output is already flushed from the buffer';
|
|
117
|
+
//# sourceMappingURL=OutputBuffer.js.map
|