st-comp 0.0.262 → 0.0.266

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 (140) hide show
  1. package/es/ChartLayout.js +4 -4
  2. package/es/CustomFunction.cjs +1 -1
  3. package/es/CustomFunction.js +31 -31
  4. package/es/FactorWarning.cjs +1 -1
  5. package/es/FactorWarning.js +37 -36
  6. package/es/Kline.cjs +1 -1
  7. package/es/Kline.js +839 -1593
  8. package/es/KlineBasic.cjs +1 -1
  9. package/es/KlineBasic.js +1198 -1
  10. package/es/KlineConfig.cjs +1 -1
  11. package/es/KlineConfig.js +89 -89
  12. package/es/KlineNew.cjs +1 -1
  13. package/es/KlineNew.js +17 -17
  14. package/es/KlinePlus.cjs +1 -1
  15. package/es/KlinePlus.js +20 -20
  16. package/es/MonacoEditor.cjs +1 -1
  17. package/es/MonacoEditor.js +25 -25
  18. package/es/Pagination.cjs +1 -1
  19. package/es/Pagination.js +113 -113
  20. package/es/PasswordPrompt.cjs +1 -1
  21. package/es/PasswordPrompt.js +3 -3
  22. package/es/Table.cjs +1 -1
  23. package/es/Table.js +29 -29
  24. package/es/User.cjs +1 -1
  25. package/es/User.js +25 -25
  26. package/es/VarSelectDialog.cjs +1 -1
  27. package/es/VarSelectDialog.js +27 -27
  28. package/es/VarietyAiHelper.cjs +3 -3
  29. package/es/VarietyAiHelper.js +324 -283
  30. package/es/VarietyAutoComplete.cjs +1 -1
  31. package/es/VarietyAutoComplete.js +11 -11
  32. package/es/VarietySearch.cjs +1 -1
  33. package/es/VarietySearch.js +56 -55
  34. package/es/{VarietySelect-faef4799.js → VarietySelect-1ac10ec2.js} +4 -4
  35. package/es/{VarietySelect-5c845562.cjs → VarietySelect-639a8d9a.cjs} +1 -1
  36. package/es/VarietyTextCopy.cjs +1 -1
  37. package/es/VarietyTextCopy.js +13 -13
  38. package/es/VirtualTable.cjs +1 -1
  39. package/es/VirtualTable.js +14 -14
  40. package/es/{_initCloneObject-009eedf8.js → _initCloneObject-6b8c230e.js} +7 -7
  41. package/es/{_initCloneObject-2b82e9f7.cjs → _initCloneObject-9eddcb0c.cjs} +1 -1
  42. package/es/aiTools-6c9c58bd.cjs +4 -0
  43. package/es/aiTools-ab67ffa0.js +149 -0
  44. package/es/aiTools.js +92 -1
  45. package/es/{base-7ff209fc.js → base-29f73b05.js} +40 -40
  46. package/es/{castArray-b9f1609f.js → castArray-609a313e.js} +1 -1
  47. package/es/{config-provider-071b8bec.js → config-provider-56193d47.js} +6 -6
  48. package/es/{config-provider-2ae47cc8.cjs → config-provider-ea286661.cjs} +1 -1
  49. package/es/{debounce-23c2f7e1.js → debounce-a09ce9a3.js} +1 -1
  50. package/es/{dropdown-9941f401.js → dropdown-4e541d60.js} +4 -4
  51. package/es/{dropdown-eba9eaf5.cjs → dropdown-f30148cc.cjs} +1 -1
  52. package/es/{el-autocomplete-b59eb529.cjs → el-autocomplete-3949e68c.cjs} +1 -1
  53. package/es/{el-autocomplete-43f205b0.js → el-autocomplete-4b521c83.js} +17 -17
  54. package/es/{el-button-7f58608d.js → el-button-4f201000.js} +33 -33
  55. package/es/{el-button-974ff9e9.cjs → el-button-dd065de0.cjs} +1 -1
  56. package/es/{el-checkbox-08185353.cjs → el-checkbox-02ce40f0.cjs} +1 -1
  57. package/es/{el-checkbox-40664b27.js → el-checkbox-33cb73db.js} +17 -17
  58. package/es/el-checkbox-group-0ea8fbf8.cjs +1 -0
  59. package/es/el-checkbox-group-4ed993c7.js +1 -0
  60. package/es/{el-dialog-2f10a2f4.js → el-dialog-1939f7c5.js} +15 -15
  61. package/es/{el-dialog-1b185570.cjs → el-dialog-6501a151.cjs} +1 -1
  62. package/es/{el-divider-4e66c835.js → el-divider-523e5874.js} +1 -1
  63. package/es/{el-empty-e0d826de.js → el-empty-f5a1607a.js} +5 -5
  64. package/es/{el-form-item-c997b4fa.cjs → el-form-item-316b35d8.cjs} +1 -1
  65. package/es/{el-form-item-2b68cdf5.js → el-form-item-ea11211d.js} +36 -36
  66. package/es/{el-input-fa18ef84.cjs → el-input-094afbe2.cjs} +1 -1
  67. package/es/{el-input-31a818d4.js → el-input-58786d42.js} +43 -43
  68. package/es/{el-checkbox-group-f775e73f.cjs → el-input-number-a609a5e3.cjs} +1 -1
  69. package/es/{el-checkbox-group-3ddad0d7.js → el-input-number-a7971697.js} +30 -30
  70. package/es/{el-loading-969a79ca.cjs → el-loading-d171ce64.cjs} +1 -1
  71. package/es/{el-loading-3e350f5e.js → el-loading-f3815921.js} +5 -5
  72. package/es/el-menu-item-3d1e0aff.cjs +1 -0
  73. package/es/el-menu-item-a166b997.js +769 -0
  74. package/es/{el-message-box-31e0aa98.cjs → el-message-box-b8ffcf34.cjs} +1 -1
  75. package/es/{el-message-box-a3aa9b89.js → el-message-box-f2b667e9.js} +11 -11
  76. package/es/{el-overlay-4e9a99e0.js → el-overlay-1dfe3675.js} +59 -59
  77. package/es/{el-overlay-ea65cb05.cjs → el-overlay-a94f8a98.cjs} +1 -1
  78. package/es/{el-popconfirm-9e232436.cjs → el-popconfirm-70e2849c.cjs} +1 -1
  79. package/es/{el-popconfirm-c2896741.js → el-popconfirm-ca31ceea.js} +12 -12
  80. package/es/{el-popper-2d3914e4.cjs → el-popper-ce575c12.cjs} +1 -1
  81. package/es/{el-popper-003b3af7.js → el-popper-db6c599f.js} +177 -177
  82. package/es/{el-segmented-140ac042.cjs → el-segmented-4d50b63f.cjs} +1 -1
  83. package/es/{el-segmented-4ae54e6a.js → el-segmented-741f2252.js} +8 -8
  84. package/es/{el-select-19ee0e79.js → el-select-086bcb6c.js} +65 -65
  85. package/es/{el-select-a11f33e8.cjs → el-select-2ebc8380.cjs} +1 -1
  86. package/es/{el-table-column-98570a4d.cjs → el-table-column-2f07fbdb.cjs} +1 -1
  87. package/es/{el-table-column-3be856d7.js → el-table-column-8a15378a.js} +16 -16
  88. package/es/{el-tag-19cc5b59.js → el-tag-65a99986.js} +14 -14
  89. package/es/{el-tag-6d8e653e.cjs → el-tag-f48b1190.cjs} +1 -1
  90. package/es/{el-text-a18106cb.cjs → el-text-33359f44.cjs} +1 -1
  91. package/es/{el-text-9a7a4f0f.js → el-text-cbb693f2.js} +2 -2
  92. package/es/{index-99abf4ff.js → index-072c4a65.js} +17 -17
  93. package/es/{index-299ee017.cjs → index-0f767104.cjs} +1 -1
  94. package/es/{index-eb99b188.cjs → index-18565979.cjs} +1 -1
  95. package/es/{index-19ac550e.js → index-1955f23d.js} +49 -49
  96. package/es/{index-6917da9d.js → index-1e91e986.js} +43 -43
  97. package/es/{index-6ca95c8a.cjs → index-21e8d2bc.cjs} +1 -1
  98. package/es/{index-33f80550.cjs → index-3792552a.cjs} +1 -1
  99. package/es/{index-7dce9f59.cjs → index-4f900527.cjs} +1 -1
  100. package/es/{index-308aab33.js → index-57d82da0.js} +34 -34
  101. package/es/{index-e8eeea22.cjs → index-5b546f7d.cjs} +1 -1
  102. package/es/{index-808db9b4.js → index-7db02db7.js} +11 -11
  103. package/es/{index-37b8d3c6.cjs → index-7eb88616.cjs} +1 -1
  104. package/es/{index-d898531c.js → index-8391a3df.js} +37 -37
  105. package/es/{index-6b99def3.cjs → index-8439d2f9.cjs} +1 -1
  106. package/es/{index-40f05e2c.cjs → index-8b055879.cjs} +2 -2
  107. package/es/{index-f3799536.js → index-a4e252a0.js} +2 -2
  108. package/es/{index-b56d81e8.js → index-b51915a2.js} +3 -3
  109. package/es/{index-28e03bad.cjs → index-bf98dd03.cjs} +1 -1
  110. package/es/{index-e17987ac.js → index-ca91ac68.js} +83 -68
  111. package/es/{index-41dd5a1c.js → index-d857270a.js} +10 -10
  112. package/es/{index-f402d1da.js → index-de24705f.js} +1 -1
  113. package/es/{index-6d530e54.js → index-ff26b1a6.js} +13 -13
  114. package/es/{python-02c3937a.cjs → python-5b5c9c58.cjs} +1 -1
  115. package/es/{python-be79c7c1.js → python-ad9239f9.js} +25 -25
  116. package/es/raf-744cf95a.js +6 -0
  117. package/es/{scroll-8642151c.js → scroll-6799bafc.js} +5 -5
  118. package/es/style.css +1 -1
  119. package/es/{use-form-common-props-d3ed62c6.cjs → use-form-common-props-00ec25ac.cjs} +1 -1
  120. package/es/{use-form-common-props-d170ccfd.js → use-form-common-props-c14990b9.js} +65 -65
  121. package/es/{use-global-config-c80f33a4.cjs → use-global-config-28efb416.cjs} +1 -1
  122. package/es/{use-global-config-74436b92.js → use-global-config-a01b5ce1.js} +14 -14
  123. package/es/{validator-07160325.cjs → validator-119fdaf4.cjs} +1 -1
  124. package/es/{validator-672bad4a.js → validator-65de1caf.js} +1 -1
  125. package/es/{vnode-6d2615f0.js → vnode-a83e6de8.js} +1 -1
  126. package/es/{zh-cn-6a0f844c.cjs → zh-cn-9fb29a39.cjs} +1 -1
  127. package/es/{zh-cn-ed10eeb1.js → zh-cn-c1c28e70.js} +2 -2
  128. package/lib/aiTools.js +92 -1
  129. package/lib/bundle.js +1 -1
  130. package/lib/bundle.umd.cjs +182 -181
  131. package/lib/{index-c3ddbee7.js → index-53b3465c.js} +18966 -18852
  132. package/lib/{python-da8fd227.js → python-4a270481.js} +1 -1
  133. package/lib/style.css +1 -1
  134. package/package.json +1 -1
  135. package/packages/KlineBasic/index.vue +1 -1
  136. package/packages/VarietyAiHelper/index.vue +271 -290
  137. package/public/aiTools.js +92 -1
  138. package/es/aiTools-2e1f92d2.cjs +0 -3
  139. package/es/aiTools-faa0a14d.js +0 -90
  140. package/es/raf-ba3dfafe.js +0 -6
package/public/aiTools.js CHANGED
@@ -27,7 +27,7 @@ export const sendToBaiLianAppNonStreaming = async ({ appId, apiKey, value }) =>
27
27
  throw error;
28
28
  }
29
29
  };
30
- // 流式返回 - 支持错误处理
30
+ // 单智能体应用: 流式返回
31
31
  export const sendToBaiLianAppStreaming = async ({ appId, apiKey, value, callback }) => {
32
32
  try {
33
33
  const response = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${appId}/completion`, {
@@ -114,7 +114,98 @@ export const sendToBaiLianAppStreaming = async ({ appId, apiKey, value, callback
114
114
  callback("error", error.message);
115
115
  }
116
116
  };
117
+ // 工作流: 流式返回
118
+ export const sendToBaiLianWorkflowStreaming = async ({ appId, apiKey, value, callback }) => {
119
+ try {
120
+ const response = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${appId}/completion`, {
121
+ method: "POST",
122
+ body: JSON.stringify({
123
+ input: { prompt: value },
124
+ parameters: { incremental_output: "true", flow_stream_mode: "message_format_plus" },
125
+ debug: {},
126
+ }),
127
+ headers: {
128
+ Authorization: `Bearer ${apiKey}`,
129
+ "Content-Type": "application/json",
130
+ "X-DashScope-SSE": "enable",
131
+ },
132
+ });
133
+
134
+ if (!response.ok) {
135
+ callback("error", `HTTP ${response.status}: ${response.statusText}`);
136
+ return;
137
+ }
138
+
139
+ const reader = response.body.getReader();
140
+ const decoder = new TextDecoder();
141
+ let buffer = "";
142
+ let finalResult = "";
143
+ // 记录已出现的节点(去重用)
144
+ const nodeMap = {};
145
+
146
+ while (true) {
147
+ const { done, value } = await reader.read();
148
+ if (done) {
149
+ if (finalResult) {
150
+ callback("message", finalResult);
151
+ }
152
+ callback("finish", "");
153
+ break;
154
+ }
155
+
156
+ buffer += decoder.decode(value, { stream: true });
157
+ let newlineIndex;
158
+ while ((newlineIndex = buffer.indexOf("\n")) !== -1) {
159
+ const line = buffer.substring(0, newlineIndex).trim();
160
+ buffer = buffer.substring(newlineIndex + 1);
161
+
162
+ if (line.startsWith("data:")) {
163
+ const dataStr = line.substring(5).trim();
164
+ if (!dataStr || dataStr === "[DONE]") continue;
165
+
166
+ try {
167
+ const parsed = JSON.parse(dataStr);
168
+ const output = parsed?.output;
169
+ const wfMsg = output?.workflow_message;
170
+
171
+ // 提取节点信息
172
+ if (wfMsg?.node_name && wfMsg?.node_type) {
173
+ const nodeName = wfMsg.node_name;
174
+ const nodeStatus = wfMsg.node_status; // "executing" | "success"
175
+ const isCompleted = wfMsg.node_is_completed;
176
+
177
+ // 去重:同一节点只推送状态变化
178
+ const prevStatus = nodeMap[nodeName];
179
+ if (prevStatus !== nodeStatus || (isCompleted && prevStatus !== "success")) {
180
+ nodeMap[nodeName] = isCompleted ? "success" : nodeStatus;
181
+ callback("node", {
182
+ name: nodeName,
183
+ status: isCompleted ? "success" : "executing",
184
+ });
185
+ }
186
+ }
187
+
188
+ // 最终结果
189
+ if (output?.finish_reason === "stop" && output?.text) {
190
+ finalResult = output.text;
191
+ }
117
192
 
193
+ // 错误
194
+ if (output?.code || output?.message) {
195
+ callback("error", output.message || output.code || "未知错误");
196
+ return;
197
+ }
198
+ } catch (e) {
199
+ // 忽略非 JSON 行
200
+ }
201
+ }
202
+ }
203
+ }
204
+ } catch (error) {
205
+ console.error("工作流请求失败:", error);
206
+ callback("error", error.message);
207
+ }
208
+ };
118
209
  // 辅助函数:处理缓冲区剩余数据
119
210
  const tryProcessBuffer = (buffer, callback) => {
120
211
  const lines = buffer.split("\n");
@@ -1,3 +0,0 @@
1
- "use strict";const y=async({appId:f,apiKey:i,value:p,callback:e})=>{var a;try{const t=await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${f}/completion`,{method:"POST",body:JSON.stringify({input:{prompt:p},parameters:{incremental_output:"true"},debug:{}}),headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-DashScope-SSE":"enable"}});if(!t.ok){e("error",`HTTP ${t.status}: ${t.statusText}`);return}const u=t.body.getReader(),r=new TextDecoder;let s="",o=null;for(;;){const{done:h,value:S}=await u.read();if(h){s.trim()&&x(s,e),e("finish","");break}s+=r.decode(S,{stream:!0});let m;for(;(m=s.indexOf(`
2
- `))!==-1;){const c=s.substring(0,m).trim();if(s=s.substring(m+1),c.startsWith("event:")){o=c.substring(6).trim();continue}if(c.startsWith("data:")){const d=c.substring(5).trim();if(o==="error"||d&&d.startsWith("{"))try{const n=JSON.parse(d);if(n.code||n.message||o==="error"){const l=n.message||n.code||"未知错误";e("error",`百炼服务端错误: ${l}`);return}const g=(a=n==null?void 0:n.output)==null?void 0:a.text;g&&e&&e("message",g)}catch{console.debug("JSON 解析失败:",d)}o=null}}}}catch(t){console.error("流式请求失败:",t),e("error",t.message)}},x=(f,i)=>{var a;const p=f.split(`
3
- `);let e=null;for(const t of p){if(t.startsWith("event:")){e=t.substring(6).trim();continue}if(t.startsWith("data:")){const u=t.substring(5).trim();if(u&&u!=="[DONE]")try{const r=JSON.parse(u);if(e==="error"||r.code||r.message){const o=r.message||r.code||"未知错误";i("error",`百炼服务端错误: ${o}`);return}const s=(a=r==null?void 0:r.output)==null?void 0:a.text;s&&i&&i("message",s)}catch{}e=null}}};exports.sendToBaiLianAppStreaming=y;
@@ -1,90 +0,0 @@
1
- const x = async ({ appId: f, apiKey: i, value: p, callback: e }) => {
2
- var a;
3
- try {
4
- const t = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${f}/completion`, {
5
- method: "POST",
6
- body: JSON.stringify({
7
- input: { prompt: p },
8
- parameters: { incremental_output: "true" },
9
- debug: {}
10
- }),
11
- headers: {
12
- Authorization: `Bearer ${i}`,
13
- "Content-Type": "application/json",
14
- "X-DashScope-SSE": "enable"
15
- }
16
- });
17
- if (!t.ok) {
18
- e("error", `HTTP ${t.status}: ${t.statusText}`);
19
- return;
20
- }
21
- const u = t.body.getReader(), r = new TextDecoder();
22
- let s = "", o = null;
23
- for (; ; ) {
24
- const { done: h, value: l } = await u.read();
25
- if (h) {
26
- s.trim() && y(s, e), e("finish", "");
27
- break;
28
- }
29
- s += r.decode(l, { stream: !0 });
30
- let m;
31
- for (; (m = s.indexOf(`
32
- `)) !== -1; ) {
33
- const c = s.substring(0, m).trim();
34
- if (s = s.substring(m + 1), c.startsWith("event:")) {
35
- o = c.substring(6).trim();
36
- continue;
37
- }
38
- if (c.startsWith("data:")) {
39
- const d = c.substring(5).trim();
40
- if (o === "error" || d && d.startsWith("{"))
41
- try {
42
- const n = JSON.parse(d);
43
- if (n.code || n.message || o === "error") {
44
- const S = n.message || n.code || "未知错误";
45
- e("error", `百炼服务端错误: ${S}`);
46
- return;
47
- }
48
- const g = (a = n == null ? void 0 : n.output) == null ? void 0 : a.text;
49
- g && e && e("message", g);
50
- } catch {
51
- console.debug("JSON 解析失败:", d);
52
- }
53
- o = null;
54
- }
55
- }
56
- }
57
- } catch (t) {
58
- console.error("流式请求失败:", t), e("error", t.message);
59
- }
60
- }, y = (f, i) => {
61
- var a;
62
- const p = f.split(`
63
- `);
64
- let e = null;
65
- for (const t of p) {
66
- if (t.startsWith("event:")) {
67
- e = t.substring(6).trim();
68
- continue;
69
- }
70
- if (t.startsWith("data:")) {
71
- const u = t.substring(5).trim();
72
- if (u && u !== "[DONE]")
73
- try {
74
- const r = JSON.parse(u);
75
- if (e === "error" || r.code || r.message) {
76
- const o = r.message || r.code || "未知错误";
77
- i("error", `百炼服务端错误: ${o}`);
78
- return;
79
- }
80
- const s = (a = r == null ? void 0 : r.output) == null ? void 0 : a.text;
81
- s && i && i("message", s);
82
- } catch {
83
- }
84
- e = null;
85
- }
86
- }
87
- };
88
- export {
89
- x as s
90
- };
@@ -1,6 +0,0 @@
1
- import { a as o } from "./base-7ff209fc.js";
2
- const e = (i) => o ? window.requestAnimationFrame(i) : setTimeout(i, 16), a = (i) => o ? window.cancelAnimationFrame(i) : clearTimeout(i);
3
- export {
4
- a as c,
5
- e as r
6
- };