@lcap/nasl 3.3.0-alpha.3 → 3.4.0-alpha.1
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/out/concepts/BindEvent__.js +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -1
- package/out/concepts/Logic__.js +47 -38
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -1
- package/out/concepts/View__.js +37 -7
- package/out/concepts/View__.js.map +1 -1
- package/out/natural/genNaturalTS.js +31 -21
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/transformTSCode.js +199 -55
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/naslServer.d.ts +3 -3
- package/out/server/naslServer.js +105 -123
- package/out/server/naslServer.js.map +1 -1
- package/out/service/storage/init.js +3 -3
- package/out/service/storage/init.js.map +1 -1
- package/out/translator/index.js +1 -1
- package/out/translator/index.js.map +1 -1
- package/out/utils/time-slicing.js +1 -1
- package/out/utils/time-slicing.js.map +1 -1
- package/package.json +1 -1
- package/sandbox-natural/stdlib/nasl.ui.ts +7 -0
- package/sandbox-natural/stdlib/nasl.util.ts +35 -1
- package/src/concepts/BindEvent__.ts +1 -1
- package/src/concepts/Logic__.ts +50 -38
- package/src/concepts/View__.ts +42 -7
- package/src/natural/genNaturalTS.ts +75 -66
- package/src/natural/transformTSCode.ts +761 -607
- package/src/server/naslServer.ts +102 -101
- package/src/service/storage/init.ts +3 -3
- package/src/translator/index.ts +1 -1
- package/src/utils/time-slicing.ts +1 -1
|
@@ -128,18 +128,18 @@ function getMiniAppChange(target: any, obj: any, action: string) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
let aiExecuted = 0;
|
|
131
|
-
let
|
|
131
|
+
let sessionPath = '';
|
|
132
132
|
// AI 生成内容是否被采纳
|
|
133
133
|
const handleAIPoint = (app: any, actionItem: any) => {
|
|
134
134
|
const { actionMsg, action } = actionItem || {};
|
|
135
135
|
if (aiExecuted > 0) {
|
|
136
|
-
app.emit('logic:accepted', { ...actionItem,
|
|
136
|
+
app.emit('logic:accepted', { ...actionItem, sessionPath });
|
|
137
137
|
aiExecuted -= 1;
|
|
138
138
|
}
|
|
139
139
|
if (actionMsg.includes('自然语言生成代码') && !action) {
|
|
140
140
|
aiExecuted += 1;
|
|
141
141
|
// eslint-disable-next-line prefer-destructuring
|
|
142
|
-
|
|
142
|
+
sessionPath = actionMsg.match(/:(.*)/)[1];
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
package/src/translator/index.ts
CHANGED
|
@@ -92,7 +92,7 @@ export function withSourceMap() {
|
|
|
92
92
|
} catch (err) {}
|
|
93
93
|
if (!state) {
|
|
94
94
|
// 没有状态不生成 SourceMap
|
|
95
|
-
return oldMethod.call(this);
|
|
95
|
+
return oldMethod.call(this, state, ...args);
|
|
96
96
|
}
|
|
97
97
|
// state = Object.freeze(Object.assign({
|
|
98
98
|
// position: { line: 0, character: 0, offset: 0 },
|
|
@@ -33,7 +33,7 @@ export interface TimeSlicingOption {
|
|
|
33
33
|
*/
|
|
34
34
|
export function timeSlicing<T>(list: T[], cb: (val: T, index: number) => void, opt: Partial<TimeSlicingOption> = {}): Promise<void> {
|
|
35
35
|
// node 环境不需要进行切片
|
|
36
|
-
if (process.env.BUILD_TARGET === 'node') {
|
|
36
|
+
if (process.env.BUILD_TARGET === 'node' || !globalThis.window) {
|
|
37
37
|
list.forEach((item, i) => cb(item, i));
|
|
38
38
|
return;
|
|
39
39
|
}
|