@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,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StackType = exports.Caret = void 0;
|
|
7
|
+
exports.createStack = createStack;
|
|
8
|
+
let Caret = exports.Caret = /*#__PURE__*/function (Caret) {
|
|
9
|
+
Caret["beforeValue"] = "beforeValue";
|
|
10
|
+
Caret["afterValue"] = "afterValue";
|
|
11
|
+
Caret["beforeKey"] = "beforeKey";
|
|
12
|
+
return Caret;
|
|
13
|
+
}({});
|
|
14
|
+
let StackType = exports.StackType = /*#__PURE__*/function (StackType) {
|
|
15
|
+
StackType["root"] = "root";
|
|
16
|
+
StackType["object"] = "object";
|
|
17
|
+
StackType["array"] = "array";
|
|
18
|
+
StackType["ndJson"] = "ndJson";
|
|
19
|
+
StackType["functionCall"] = "dataType";
|
|
20
|
+
return StackType;
|
|
21
|
+
}({});
|
|
22
|
+
function createStack() {
|
|
23
|
+
const stack = [StackType.root];
|
|
24
|
+
let caret = Caret.beforeValue;
|
|
25
|
+
return {
|
|
26
|
+
get type() {
|
|
27
|
+
return last(stack);
|
|
28
|
+
},
|
|
29
|
+
get caret() {
|
|
30
|
+
return caret;
|
|
31
|
+
},
|
|
32
|
+
pop() {
|
|
33
|
+
stack.pop();
|
|
34
|
+
caret = Caret.afterValue;
|
|
35
|
+
return true;
|
|
36
|
+
},
|
|
37
|
+
push(type, newCaret) {
|
|
38
|
+
stack.push(type);
|
|
39
|
+
caret = newCaret;
|
|
40
|
+
return true;
|
|
41
|
+
},
|
|
42
|
+
update(newCaret) {
|
|
43
|
+
caret = newCaret;
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function last(array) {
|
|
49
|
+
return array[array.length - 1];
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=stack.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.jsonrepairTransform = jsonrepairTransform;
|
|
7
|
+
var _nodeStream = require("node:stream");
|
|
8
|
+
var _core = require("./core.js");
|
|
9
|
+
function jsonrepairTransform(options) {
|
|
10
|
+
const repair = (0, _core.jsonrepairCore)({
|
|
11
|
+
onData: chunk => transform.push(chunk),
|
|
12
|
+
bufferSize: options?.bufferSize,
|
|
13
|
+
chunkSize: options?.chunkSize
|
|
14
|
+
});
|
|
15
|
+
const transform = new _nodeStream.Transform({
|
|
16
|
+
transform(chunk, _encoding, callback) {
|
|
17
|
+
try {
|
|
18
|
+
repair.transform(chunk.toString());
|
|
19
|
+
} catch (err) {
|
|
20
|
+
this.emit('error', err);
|
|
21
|
+
} finally {
|
|
22
|
+
callback();
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
flush(callback) {
|
|
26
|
+
try {
|
|
27
|
+
repair.flush();
|
|
28
|
+
} catch (err) {
|
|
29
|
+
this.emit('error', err);
|
|
30
|
+
} finally {
|
|
31
|
+
callback();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return transform;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=stream.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.JSONRepairError = void 0;
|
|
7
|
+
class JSONRepairError extends Error {
|
|
8
|
+
constructor(message, position) {
|
|
9
|
+
super(`${message} at position ${position}`);
|
|
10
|
+
this.position = position;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.JSONRepairError = JSONRepairError;
|
|
14
|
+
//# sourceMappingURL=JSONRepairError.js.map
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.endsWithCommaOrNewline = endsWithCommaOrNewline;
|
|
7
|
+
exports.insertBeforeLastWhitespace = insertBeforeLastWhitespace;
|
|
8
|
+
exports.isControlCharacter = isControlCharacter;
|
|
9
|
+
exports.isDelimiter = isDelimiter;
|
|
10
|
+
exports.isDigit = isDigit;
|
|
11
|
+
exports.isDoubleQuote = isDoubleQuote;
|
|
12
|
+
exports.isDoubleQuoteLike = isDoubleQuoteLike;
|
|
13
|
+
exports.isFunctionNameChar = isFunctionNameChar;
|
|
14
|
+
exports.isFunctionNameCharStart = isFunctionNameCharStart;
|
|
15
|
+
exports.isHex = isHex;
|
|
16
|
+
exports.isQuote = isQuote;
|
|
17
|
+
exports.isSingleQuote = isSingleQuote;
|
|
18
|
+
exports.isSingleQuoteLike = isSingleQuoteLike;
|
|
19
|
+
exports.isSpecialWhitespace = isSpecialWhitespace;
|
|
20
|
+
exports.isStartOfValue = isStartOfValue;
|
|
21
|
+
exports.isUnquotedStringDelimiter = isUnquotedStringDelimiter;
|
|
22
|
+
exports.isValidStringCharacter = isValidStringCharacter;
|
|
23
|
+
exports.isWhitespace = isWhitespace;
|
|
24
|
+
exports.isWhitespaceExceptNewline = isWhitespaceExceptNewline;
|
|
25
|
+
exports.regexUrlStart = exports.regexUrlChar = void 0;
|
|
26
|
+
exports.removeAtIndex = removeAtIndex;
|
|
27
|
+
exports.stripLastOccurrence = stripLastOccurrence;
|
|
28
|
+
const codeSpace = 0x20; // " "
|
|
29
|
+
const codeNewline = 0xa; // "\n"
|
|
30
|
+
const codeTab = 0x9; // "\t"
|
|
31
|
+
const codeReturn = 0xd; // "\r"
|
|
32
|
+
const codeNonBreakingSpace = 0xa0;
|
|
33
|
+
const codeEnQuad = 0x2000;
|
|
34
|
+
const codeHairSpace = 0x200a;
|
|
35
|
+
const codeNarrowNoBreakSpace = 0x202f;
|
|
36
|
+
const codeMediumMathematicalSpace = 0x205f;
|
|
37
|
+
const codeIdeographicSpace = 0x3000;
|
|
38
|
+
function isHex(char) {
|
|
39
|
+
return /^[0-9A-Fa-f]$/.test(char);
|
|
40
|
+
}
|
|
41
|
+
function isDigit(char) {
|
|
42
|
+
return char >= '0' && char <= '9';
|
|
43
|
+
}
|
|
44
|
+
function isValidStringCharacter(char) {
|
|
45
|
+
// note that the valid range is between \u{0020} and \u{10ffff},
|
|
46
|
+
// but in JavaScript it is not possible to create a code point larger than
|
|
47
|
+
// \u{10ffff}, so there is no need to test for that here.
|
|
48
|
+
return char >= '\u0020';
|
|
49
|
+
}
|
|
50
|
+
function isDelimiter(char) {
|
|
51
|
+
return ',:[]/{}()\n+'.includes(char);
|
|
52
|
+
}
|
|
53
|
+
function isFunctionNameCharStart(char) {
|
|
54
|
+
return char >= 'a' && char <= 'z' || char >= 'A' && char <= 'Z' || char === '_' || char === '$';
|
|
55
|
+
}
|
|
56
|
+
function isFunctionNameChar(char) {
|
|
57
|
+
return char >= 'a' && char <= 'z' || char >= 'A' && char <= 'Z' || char === '_' || char === '$' || char >= '0' && char <= '9';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// matches "https://" and other schemas
|
|
61
|
+
const regexUrlStart = exports.regexUrlStart = /^(http|https|ftp|mailto|file|data|irc):\/\/$/;
|
|
62
|
+
|
|
63
|
+
// matches all valid URL characters EXCEPT "[", "]", and ",", since that are important JSON delimiters
|
|
64
|
+
const regexUrlChar = exports.regexUrlChar = /^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;
|
|
65
|
+
function isUnquotedStringDelimiter(char) {
|
|
66
|
+
return ',[]/{}\n+'.includes(char);
|
|
67
|
+
}
|
|
68
|
+
function isStartOfValue(char) {
|
|
69
|
+
return isQuote(char) || regexStartOfValue.test(char);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// alpha, number, minus, or opening bracket or brace
|
|
73
|
+
const regexStartOfValue = /^[[{\w-]$/;
|
|
74
|
+
function isControlCharacter(char) {
|
|
75
|
+
return char === '\n' || char === '\r' || char === '\t' || char === '\b' || char === '\f';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check if the given character is a whitespace character like space, tab, or
|
|
79
|
+
* newline
|
|
80
|
+
*/
|
|
81
|
+
function isWhitespace(text, index) {
|
|
82
|
+
const code = text.charCodeAt(index);
|
|
83
|
+
return code === codeSpace || code === codeNewline || code === codeTab || code === codeReturn;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Check if the given character is a whitespace character like space or tab,
|
|
88
|
+
* but NOT a newline
|
|
89
|
+
*/
|
|
90
|
+
function isWhitespaceExceptNewline(text, index) {
|
|
91
|
+
const code = text.charCodeAt(index);
|
|
92
|
+
return code === codeSpace || code === codeTab || code === codeReturn;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if the given character is a special whitespace character, some
|
|
97
|
+
* unicode variant
|
|
98
|
+
*/
|
|
99
|
+
function isSpecialWhitespace(text, index) {
|
|
100
|
+
const code = text.charCodeAt(index);
|
|
101
|
+
return code === codeNonBreakingSpace || code >= codeEnQuad && code <= codeHairSpace || code === codeNarrowNoBreakSpace || code === codeMediumMathematicalSpace || code === codeIdeographicSpace;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Test whether the given character is a quote or double quote character.
|
|
106
|
+
* Also tests for special variants of quotes.
|
|
107
|
+
*/
|
|
108
|
+
function isQuote(char) {
|
|
109
|
+
// the first check double quotes, since that occurs most often
|
|
110
|
+
return isDoubleQuoteLike(char) || isSingleQuoteLike(char);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Test whether the given character is a double quote character.
|
|
115
|
+
* Also tests for special variants of double quotes.
|
|
116
|
+
*/
|
|
117
|
+
function isDoubleQuoteLike(char) {
|
|
118
|
+
return char === '"' || char === '\u201c' || char === '\u201d';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Test whether the given character is a double quote character.
|
|
123
|
+
* Does NOT test for special variants of double quotes.
|
|
124
|
+
*/
|
|
125
|
+
function isDoubleQuote(char) {
|
|
126
|
+
return char === '"';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Test whether the given character is a single quote character.
|
|
131
|
+
* Also tests for special variants of single quotes.
|
|
132
|
+
*/
|
|
133
|
+
function isSingleQuoteLike(char) {
|
|
134
|
+
return char === "'" || char === '\u2018' || char === '\u2019' || char === '\u0060' || char === '\u00b4';
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Test whether the given character is a single quote character.
|
|
139
|
+
* Does NOT test for special variants of single quotes.
|
|
140
|
+
*/
|
|
141
|
+
function isSingleQuote(char) {
|
|
142
|
+
return char === "'";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Strip last occurrence of textToStrip from text
|
|
147
|
+
*/
|
|
148
|
+
function stripLastOccurrence(text, textToStrip) {
|
|
149
|
+
let stripRemainingText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
150
|
+
const index = text.lastIndexOf(textToStrip);
|
|
151
|
+
return index !== -1 ? text.substring(0, index) + (stripRemainingText ? '' : text.substring(index + 1)) : text;
|
|
152
|
+
}
|
|
153
|
+
function insertBeforeLastWhitespace(text, textToInsert) {
|
|
154
|
+
let index = text.length;
|
|
155
|
+
if (!isWhitespace(text, index - 1)) {
|
|
156
|
+
// no trailing whitespaces
|
|
157
|
+
return text + textToInsert;
|
|
158
|
+
}
|
|
159
|
+
while (isWhitespace(text, index - 1)) {
|
|
160
|
+
index--;
|
|
161
|
+
}
|
|
162
|
+
return text.substring(0, index) + textToInsert + text.substring(index);
|
|
163
|
+
}
|
|
164
|
+
function removeAtIndex(text, start, count) {
|
|
165
|
+
return text.substring(0, start) + text.substring(start + count);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Test whether a string ends with a newline or comma character and optional whitespace
|
|
170
|
+
*/
|
|
171
|
+
function endsWithCommaOrNewline(text) {
|
|
172
|
+
return /[,\n][ \t\r]*$/.test(text);
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=stringUtils.js.map
|