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