@lcap/nasl 3.7.0-beta.5 → 3.7.0-beta.7
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/package.json +1 -1
- package/out/bak/translator.js +12 -12
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.js +2 -2
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +1 -1
- package/out/concepts/App__.js +2 -2
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +1 -0
- package/out/concepts/CallAuthInterface__.js +9 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +12 -6
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Frontend__.js +1 -0
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +1 -0
- package/out/concepts/Integration__.js +4 -0
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/LogicItem__.js +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +4 -4
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Param__.js +3 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/View__.d.ts +3 -2
- package/out/concepts/View__.js +11 -18
- package/out/concepts/View__.js.map +1 -1
- package/out/generator/release-body/body.js +1 -2
- package/out/generator/release-body/body.js.map +1 -1
- package/out/generator/release-body/data.js +1 -1
- package/out/generator/release-body/types.d.ts +1 -1
- package/out/natural/genNaturalTS.d.ts +8 -8
- package/out/natural/genNaturalTS.js +41 -41
- package/out/natural/prompt/analyzeClaims.js +5 -3
- package/out/natural/prompt/analyzeClaims.js.map +1 -1
- package/out/natural/prompt/analyzeFormatOutput.js +1 -1
- package/out/natural/prompt/analyzeTasks.js +2 -2
- package/out/server/naslServer.js +11 -4
- package/out/server/naslServer.js.map +1 -1
- package/out/templator/genCreateBlock.js +2 -2
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +2 -3
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +5 -4
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/utils/delay/index.d.ts +0 -0
- package/out/utils/delay/index.js +1 -0
- package/out/utils/delay/index.js.map +1 -0
- package/out/utils/delay.d.ts +9 -0
- package/out/utils/delay.js +41 -0
- package/out/utils/delay.js.map +1 -0
- package/out/utils/env.d.ts +4 -0
- package/out/utils/env.js +6 -1
- package/out/utils/env.js.map +1 -1
- package/out/utils/time-slicing/controller.js +4 -2
- package/out/utils/time-slicing/controller.js.map +1 -1
- package/out/utils/time-slicing/page-state.d.ts +1 -1
- package/out/utils/time-slicing/page-state.js +3 -9
- package/out/utils/time-slicing/page-state.js.map +1 -1
- package/package.json +1 -1
- package/src/bak/translator.js +13 -13
- package/src/common/BaseNode.ts +2 -2
- package/src/concepts/App__.ts +2 -2
- package/src/concepts/BindAttribute__.ts +1 -1
- package/src/concepts/BindDirective__.ts +1 -1
- package/src/concepts/CallAuthInterface__.ts +10 -0
- package/src/concepts/CallLogic__.ts +14 -7
- package/src/concepts/Frontend__.ts +1 -0
- package/src/concepts/Integration__.ts +6 -0
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +4 -4
- package/src/concepts/Param__.ts +3 -1
- package/src/concepts/View__.ts +12 -20
- package/src/generator/release-body/body.ts +1 -2
- package/src/generator/release-body/data.ts +1 -1
- package/src/generator/release-body/types.ts +1 -1
- package/src/natural/genNaturalTS.ts +41 -41
- package/src/natural/prompt/analyzeClaims.ts +5 -3
- package/src/natural/prompt/analyzeFormatOutput.ts +1 -1
- package/src/natural/prompt/analyzeTasks.ts +2 -2
- package/src/server/naslServer.ts +12 -4
- package/src/templator/genCreateBlock.ts +2 -2
- package/src/templator/genCurdEditMultipleKeyBlock.ts +1 -1
- package/src/templator/genCurdMultipleKeyBlock.ts +2 -3
- package/src/templator/genUpdateBlock.ts +5 -4
- package/src/utils/delay/index.ts +0 -0
- package/src/utils/delay.ts +41 -0
- package/src/utils/env.ts +7 -0
- package/src/utils/time-slicing/controller.ts +5 -3
- package/src/utils/time-slicing/page-state.ts +1 -9
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +2 -2
|
@@ -100,8 +100,8 @@ const getNaslOql = () => {
|
|
|
100
100
|
return { code, naslOql };
|
|
101
101
|
};
|
|
102
102
|
exports.getNaslOql = getNaslOql;
|
|
103
|
-
const getEnums = (app, state,
|
|
104
|
-
const needNamespace =
|
|
103
|
+
const getEnums = (app, state, requiredIndexes) => {
|
|
104
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
105
105
|
const namespace = 'app.enums';
|
|
106
106
|
const data = [];
|
|
107
107
|
let code = '';
|
|
@@ -116,8 +116,8 @@ const getEnums = (app, state, moduleIndexList) => {
|
|
|
116
116
|
return { code, namespace, enums: { namespace, data } };
|
|
117
117
|
};
|
|
118
118
|
exports.getEnums = getEnums;
|
|
119
|
-
const getEntities = (app, state,
|
|
120
|
-
const needNamespace =
|
|
119
|
+
const getEntities = (app, state, requiredIndexes) => {
|
|
120
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
121
121
|
const entities = [];
|
|
122
122
|
let code = '';
|
|
123
123
|
app.dataSources.forEach((dataSource) => {
|
|
@@ -139,8 +139,8 @@ const getEntities = (app, state, moduleIndexList) => {
|
|
|
139
139
|
return { code, entities };
|
|
140
140
|
};
|
|
141
141
|
exports.getEntities = getEntities;
|
|
142
|
-
const getStructures = (app, state,
|
|
143
|
-
const needNamespace =
|
|
142
|
+
const getStructures = (app, state, requiredIndexes) => {
|
|
143
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
144
144
|
const data = [];
|
|
145
145
|
const namespace = `app.structures`;
|
|
146
146
|
let code = '';
|
|
@@ -157,8 +157,8 @@ const getStructures = (app, state, moduleIndexList) => {
|
|
|
157
157
|
return { code, structures: { namespace, data } };
|
|
158
158
|
};
|
|
159
159
|
exports.getStructures = getStructures;
|
|
160
|
-
const getLogics = (app, currentNode,
|
|
161
|
-
const hasModuleIndexList =
|
|
160
|
+
const getLogics = (app, currentNode, requiredIndexes) => {
|
|
161
|
+
const hasModuleIndexList = requiredIndexes?.length > 0;
|
|
162
162
|
const data = [];
|
|
163
163
|
const namespace = `app.logics`;
|
|
164
164
|
let code = '';
|
|
@@ -166,10 +166,10 @@ const getLogics = (app, currentNode, moduleIndexList) => {
|
|
|
166
166
|
?.filter((logic) => logic !== currentNode && !logic.name.startsWith('LCAP'))
|
|
167
167
|
?.forEach((logic, index) => {
|
|
168
168
|
const logicIndex = `6-${index}`;
|
|
169
|
-
if (hasModuleIndexList && !
|
|
169
|
+
if (hasModuleIndexList && !requiredIndexes?.includes(logicIndex))
|
|
170
170
|
return;
|
|
171
|
-
const rename =
|
|
172
|
-
const needNamespace =
|
|
171
|
+
const rename = requiredIndexes?.length >= 0 ? logic?.calleewholeKey : undefined;
|
|
172
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
173
173
|
const tempCode = `${logic?.toNaturalTS({ needNamespace, rename, declaration: true })}`;
|
|
174
174
|
const description = logic?.description || '';
|
|
175
175
|
code += `[${logicIndex}]${description} ${tempCode}\n`;
|
|
@@ -178,8 +178,8 @@ const getLogics = (app, currentNode, moduleIndexList) => {
|
|
|
178
178
|
return { code, appLogics: { namespace, data } };
|
|
179
179
|
};
|
|
180
180
|
exports.getLogics = getLogics;
|
|
181
|
-
const getModuleInterfaces = (app, state,
|
|
182
|
-
const hasModuleIndexList =
|
|
181
|
+
const getModuleInterfaces = (app, state, requiredIndexes) => {
|
|
182
|
+
const hasModuleIndexList = requiredIndexes?.length > 0;
|
|
183
183
|
const interfaceDependencies = [];
|
|
184
184
|
let code = '';
|
|
185
185
|
app?.interfaceDependencies?.forEach((interfaceDependency, moduleIndex) => {
|
|
@@ -198,14 +198,14 @@ const getModuleInterfaces = (app, state, moduleIndexList) => {
|
|
|
198
198
|
const logicData = [];
|
|
199
199
|
interfaceDependency?.interfaces?.forEach((interface_, index) => {
|
|
200
200
|
const interfaceIndex = `7-${moduleIndex}-${index}`;
|
|
201
|
-
if (hasModuleIndexList && !
|
|
201
|
+
if (hasModuleIndexList && !requiredIndexes?.includes(interfaceIndex))
|
|
202
202
|
return;
|
|
203
203
|
const description = interface_?.description || '';
|
|
204
|
-
const interfaceName =
|
|
205
|
-
const needNamespace =
|
|
204
|
+
const interfaceName = requiredIndexes?.length >= 0 ? interface_?.calleewholeKey : undefined;
|
|
205
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
206
206
|
const tempCode = interface_?.toNaturalTS((0, translator_1.createCompilerState)('', { needNamespace }), interfaceName);
|
|
207
207
|
logicData.push({ description, code: tempCode });
|
|
208
|
-
if (
|
|
208
|
+
if (requiredIndexes?.includes(interfaceIndex)) {
|
|
209
209
|
code += (0, exports.getLogicStructures)(interface_, 'interface', { description, codeStr: tempCode }, structureNamespace);
|
|
210
210
|
}
|
|
211
211
|
else {
|
|
@@ -218,8 +218,8 @@ const getModuleInterfaces = (app, state, moduleIndexList) => {
|
|
|
218
218
|
return { code, interfaceDependencies };
|
|
219
219
|
};
|
|
220
220
|
exports.getModuleInterfaces = getModuleInterfaces;
|
|
221
|
-
const getConnectors = (app, state,
|
|
222
|
-
const hasModuleIndexList =
|
|
221
|
+
const getConnectors = (app, state, requiredIndexes) => {
|
|
222
|
+
const hasModuleIndexList = requiredIndexes?.length > 0;
|
|
223
223
|
const connections = [];
|
|
224
224
|
let code = '';
|
|
225
225
|
app?.connections?.forEach((connection, connectionIndex) => {
|
|
@@ -239,14 +239,14 @@ const getConnectors = (app, state, moduleIndexList) => {
|
|
|
239
239
|
connection?.connector?.namespaces?.forEach((namespace, namespaceIndex) => {
|
|
240
240
|
namespace?.logics?.forEach((logic, index) => {
|
|
241
241
|
const logicIndex = `8-${connectionIndex}-${namespaceIndex}-${index}`;
|
|
242
|
-
if (hasModuleIndexList && !
|
|
242
|
+
if (hasModuleIndexList && !requiredIndexes?.includes(logicIndex))
|
|
243
243
|
return;
|
|
244
244
|
const description = `${logic?.description || logic?.title || ''}`;
|
|
245
|
-
const rename =
|
|
246
|
-
const needNamespace =
|
|
245
|
+
const rename = requiredIndexes?.length >= 0 ? `${connection?.name}.${logic?.calleewholeKey}` : undefined;
|
|
246
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
247
247
|
const tempCode = `${logic?.toNaturalTS((0, translator_1.shiftState)(state, code, { needNamespace, rename, declaration: true }))}`;
|
|
248
248
|
logicData.push({ description, code: tempCode });
|
|
249
|
-
if (
|
|
249
|
+
if (requiredIndexes?.includes(logicIndex)) {
|
|
250
250
|
code += (0, exports.getLogicStructures)(logic, 'connector', { description, codeStr: tempCode }, structureNamespace);
|
|
251
251
|
}
|
|
252
252
|
else {
|
|
@@ -257,14 +257,14 @@ const getConnectors = (app, state, moduleIndexList) => {
|
|
|
257
257
|
if (!connection?.connector?.namespaces?.length && connection?.connector?.logics?.length) {
|
|
258
258
|
connection?.connector?.logics.forEach((logic, index) => {
|
|
259
259
|
const logicIndex = `8-${connectionIndex}-${index}`;
|
|
260
|
-
if (hasModuleIndexList && !
|
|
260
|
+
if (hasModuleIndexList && !requiredIndexes?.includes(logicIndex))
|
|
261
261
|
return;
|
|
262
262
|
const description = logic?.description || '';
|
|
263
|
-
const rename =
|
|
264
|
-
const needNamespace =
|
|
263
|
+
const rename = requiredIndexes?.length >= 0 ? `${connection?.name}.${logic?.calleewholeKey}` : undefined;
|
|
264
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
265
265
|
const tempCode = `${logic?.toNaturalTS((0, translator_1.shiftState)(state, code, { needNamespace, rename, declaration: true }))}`;
|
|
266
266
|
logicData.push({ description, code: tempCode });
|
|
267
|
-
if (
|
|
267
|
+
if (requiredIndexes?.includes(logicIndex)) {
|
|
268
268
|
code += (0, exports.getLogicStructures)(logic, 'connector', { description, codeStr: tempCode }, structureNamespace);
|
|
269
269
|
}
|
|
270
270
|
else {
|
|
@@ -278,8 +278,8 @@ const getConnectors = (app, state, moduleIndexList) => {
|
|
|
278
278
|
return { code, connections };
|
|
279
279
|
};
|
|
280
280
|
exports.getConnectors = getConnectors;
|
|
281
|
-
const getDependencies = (app, state,
|
|
282
|
-
const hasModuleIndexList =
|
|
281
|
+
const getDependencies = (app, state, requiredIndexes) => {
|
|
282
|
+
const hasModuleIndexList = requiredIndexes?.length > 0;
|
|
283
283
|
const dependencies = [];
|
|
284
284
|
let code = '';
|
|
285
285
|
app?.dependencies
|
|
@@ -300,14 +300,14 @@ const getDependencies = (app, state, moduleIndexList) => {
|
|
|
300
300
|
const logicData = [];
|
|
301
301
|
module?.logics?.forEach((logic, index) => {
|
|
302
302
|
const logicIndex = `9-${moduleIndex}-${index}`;
|
|
303
|
-
if (hasModuleIndexList && !
|
|
303
|
+
if (hasModuleIndexList && !requiredIndexes?.includes(logicIndex))
|
|
304
304
|
return;
|
|
305
305
|
const description = logic?.description || '';
|
|
306
|
-
const rename =
|
|
307
|
-
const needNamespace =
|
|
306
|
+
const rename = requiredIndexes?.length >= 0 ? logic?.calleewholeKey : undefined;
|
|
307
|
+
const needNamespace = requiredIndexes?.length >= 0;
|
|
308
308
|
const tempCode = `${logic?.toNaturalTS((0, translator_1.shiftState)(state, code, { needNamespace, rename, declaration: true }))}`;
|
|
309
309
|
logicData.push({ description, code: tempCode });
|
|
310
|
-
if (
|
|
310
|
+
if (requiredIndexes?.includes(logicIndex)) {
|
|
311
311
|
code += (0, exports.getLogicStructures)(logic, 'extension', { description, codeStr: tempCode }, structureNamespace);
|
|
312
312
|
}
|
|
313
313
|
else {
|
|
@@ -412,7 +412,7 @@ const getCurrentNodeContext = (currentNode, focusedNodePath) => {
|
|
|
412
412
|
return { code: (0, exports.genTsBlock)(code), currentLogic: code };
|
|
413
413
|
};
|
|
414
414
|
exports.getCurrentNodeContext = getCurrentNodeContext;
|
|
415
|
-
function genNaturalTSContext(app, currentNode, focusedNodePath,
|
|
415
|
+
function genNaturalTSContext(app, currentNode, focusedNodePath, requiredIndexes) {
|
|
416
416
|
const frontend = currentNode?.getAncestor('Frontend');
|
|
417
417
|
const logicType = currentNode?.parentNode?.concept === 'App' ? 'global_logic' : 'view_logic';
|
|
418
418
|
const state = (0, translator_1.createCompilerState)();
|
|
@@ -431,22 +431,22 @@ function genNaturalTSContext(app, currentNode, focusedNodePath, moduleIndexList)
|
|
|
431
431
|
}
|
|
432
432
|
code += '\n### [5]全局上下文\n';
|
|
433
433
|
code += '\n#### [5-0]枚举\n';
|
|
434
|
-
code += (0, exports.getEnums)(app, state,
|
|
434
|
+
code += (0, exports.getEnums)(app, state, requiredIndexes).code;
|
|
435
435
|
code += '\n#### [5-1]实体\n';
|
|
436
|
-
code += (0, exports.getEntities)(app, state,
|
|
436
|
+
code += (0, exports.getEntities)(app, state, requiredIndexes).code;
|
|
437
437
|
code += '\n#### [5-2]可用的数据结构\n';
|
|
438
|
-
code += (0, exports.getStructures)(app, state,
|
|
438
|
+
code += (0, exports.getStructures)(app, state, requiredIndexes).code;
|
|
439
439
|
code += '\n### [6]服务端逻辑\n';
|
|
440
|
-
code += (0, exports.getLogics)(app, currentNode,
|
|
440
|
+
code += (0, exports.getLogics)(app, currentNode, requiredIndexes).code;
|
|
441
441
|
code += '\n### [7]可调用的接口列表\n';
|
|
442
|
-
code += (0, exports.getModuleInterfaces)(app, state,
|
|
442
|
+
code += (0, exports.getModuleInterfaces)(app, state, requiredIndexes).code;
|
|
443
443
|
if (app?.connections?.length > 0 && logicType === 'global_logic') {
|
|
444
444
|
code += '\n### [8]连接器逻辑列表\n';
|
|
445
|
-
code += (0, exports.getConnectors)(app, state,
|
|
445
|
+
code += (0, exports.getConnectors)(app, state, requiredIndexes).code;
|
|
446
446
|
}
|
|
447
447
|
if (app?.dependencies?.length > 0) {
|
|
448
448
|
code += '\n### [9]依赖库逻辑列表\n';
|
|
449
|
-
code += (0, exports.getDependencies)(app, state,
|
|
449
|
+
code += (0, exports.getDependencies)(app, state, requiredIndexes).code;
|
|
450
450
|
}
|
|
451
451
|
if (frontend) {
|
|
452
452
|
code += '\n### [10]页面上下文\n';
|
|
@@ -5,10 +5,11 @@ const analyzeClaims = (params) => {
|
|
|
5
5
|
const { logicType } = params;
|
|
6
6
|
const claims = `
|
|
7
7
|
- Knowledge 是你的知识库,你可以参考,但是你最终制定的计划中禁止包含方法或者函数名
|
|
8
|
-
-
|
|
8
|
+
- requiredIndexes 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引
|
|
9
9
|
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
10
10
|
- 涉及到查询、获取数据时,先查找当前上下文[6/7/8/9]中是否有相关的方法,如果没有,再考虑实体的方法
|
|
11
11
|
- 实体的 get 方法一次只能获取一条数据,返回一个对象,无法返回列表。
|
|
12
|
+
- 当前逻辑类型下暂不支持 生成 js代码块 的功能,请提示用户: 当前暂不支持生成 js代码块, 请调整后重新输入。
|
|
12
13
|
- 如果用户的需求涉及定时或延时等操作,请提示用户:当前暂不支持定时或延时操作,请调整后重新输入。
|
|
13
14
|
- 如果用户的需求需要调用某个方法并且当前上下文中不存在时,请提示用户:当前应用中暂无该方法,请先导入相关依赖库或连接器模块
|
|
14
15
|
- 例如:加解密依赖库中的方法
|
|
@@ -17,12 +18,13 @@ const analyzeClaims = (params) => {
|
|
|
17
18
|
const claimsMap = {
|
|
18
19
|
global_logic: `
|
|
19
20
|
- Knowledge 是你的知识库,你可以参考,但是你最终制定的计划中禁止包含方法或者函数名
|
|
20
|
-
-
|
|
21
|
+
- requiredIndexes 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引
|
|
21
22
|
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
22
23
|
- 如果用户的需求涉及定时或延时等操作,请提示用户:当前暂不支持定时或延时操作,请调整后重新输入。
|
|
23
24
|
- 如果用户的需求需要调用某个方法并且当前上下文中不存在时,请提示用户:当前应用中暂无该方法,请先导入相关依赖库或连接器模块
|
|
24
25
|
- 例如:加解密依赖库中的方法
|
|
25
|
-
-
|
|
26
|
+
- 当前逻辑类型下暂不支持 生成 js代码块 的功能,请提示用户: 当前暂不支持生成 js代码块, 请调整后重新输入。
|
|
27
|
+
- 当前逻辑类型下暂不支持 跳转页面/弹出消息/弹窗消息 等前端功能,请提示用户: 当前逻辑类型暂不支持此功能,请切换到前端页面逻辑或事件逻辑。
|
|
26
28
|
- 分析用户的需求,当需要从实体中获取或者查询数据时
|
|
27
29
|
- 优先使用 SQL 的查询和数据操纵能力: 例如 JOIN、SUM、GROUP_BY 等能力
|
|
28
30
|
- 使用 SQL 语句同时实现查询和计算
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzeClaims.js","sourceRoot":"","sources":["../../../src/natural/prompt/analyzeClaims.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,MAAW,EAAE,EAAE;IAC3C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"analyzeClaims.js","sourceRoot":"","sources":["../../../src/natural/prompt/analyzeClaims.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,MAAW,EAAE,EAAE;IAC3C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,MAAM,GAAG;;;;;;;;;;CAUhB,CAAC;IACA,qDAAqD;IACrD,MAAM,SAAS,GAAG;QAChB,YAAY,EAAE;;;;;;;;;;;;CAYjB;KACS,CAAC;IACT,OAAO,SAAS,EAAE,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC;AAC1C,CAAC,CAAC;AA9BW,QAAA,aAAa,iBA8BxB"}
|
|
@@ -10,9 +10,9 @@ const analyzeTasks = () => {
|
|
|
10
10
|
- text: 如果你认为需求不够明确时,可以继续询问用户需求的细节,不可为空
|
|
11
11
|
- executable
|
|
12
12
|
- 类型为 boolean, 如果你认为需求比较明确并且 plan 可执行, 返回 true, 否则返回 false
|
|
13
|
-
-
|
|
13
|
+
- requiredIndexes
|
|
14
14
|
- 类型为 Array, 你需要根据用户的执行计划,从 Context Definition 中整理出执行需要用到的模块或者方法,返回对应的索引
|
|
15
|
-
- 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引。例如:"
|
|
15
|
+
- 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引。例如:"requiredIndexes": ['1','6-3','8-1-1-0']。
|
|
16
16
|
- needQueryRepository
|
|
17
17
|
- 类型为 boolean, 如果你认为需求相关的上下文信息不足,需要另外查询知识库时, 返回 true, 否则返回 false
|
|
18
18
|
`;
|
package/out/server/naslServer.js
CHANGED
|
@@ -395,7 +395,7 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
395
395
|
yield* getTsFiles(processes, 'process');
|
|
396
396
|
if (module instanceof concepts_1.Connector) {
|
|
397
397
|
yield* getTsFiles(triggerLaunchers, 'triggerLauncher');
|
|
398
|
-
yield* getTsFiles(authLogicsForCallInterface, 'authLogicForCallInterface');
|
|
398
|
+
// yield* getTsFiles(authLogicsForCallInterface, 'authLogicForCallInterface');
|
|
399
399
|
yield* getTsFiles(concat(namespaces, 'logics'), 'namespaces_logic');
|
|
400
400
|
}
|
|
401
401
|
if (module instanceof concepts_1.App) {
|
|
@@ -1950,7 +1950,7 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
1950
1950
|
}
|
|
1951
1951
|
else if (fileNode instanceof concepts_1.Logic || fileNode instanceof concepts_1.OverriddenLogic) {
|
|
1952
1952
|
const { isRefedByTrigger, fRefNames } = yield this.isRefedByTriggerAndReturnFirstRef(fileNode);
|
|
1953
|
-
if (fileNode instanceof concepts_1.Logic && fileNode?.exportInterface) {
|
|
1953
|
+
if (fileNode instanceof concepts_1.Logic && fileNode?.exportInterface && fileNode.calleewholeKey.startsWith('app.logics')) {
|
|
1954
1954
|
let isSame = true;
|
|
1955
1955
|
const itf = fileNode.exportInterface;
|
|
1956
1956
|
const { params: logicParams, returns: logicReturns } = fileNode;
|
|
@@ -1979,7 +1979,7 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
1979
1979
|
if (logicReturns[0].name !== itfReturns[0].name) {
|
|
1980
1980
|
isSame = false;
|
|
1981
1981
|
}
|
|
1982
|
-
else if (!logicReturns[0]?.typeAnnotation?.isSame?.(itfReturns[0]?.typeAnnotation)) {
|
|
1982
|
+
else if (!(logicReturns[0]?.typeAnnotation ?? logicReturns[0]?.__TypeAnnotation)?.isSame?.(itfReturns[0]?.typeAnnotation)) {
|
|
1983
1983
|
isSame = false;
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
@@ -4173,6 +4173,10 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
4173
4173
|
const typesMap = await this.getQuickInfoNodesTypeMap(nodes, true);
|
|
4174
4174
|
const json = app.toJSON();
|
|
4175
4175
|
this.logger.timeEnd('全量标注');
|
|
4176
|
+
// 测试环境打印数据
|
|
4177
|
+
if (utils.isTestBrowser) {
|
|
4178
|
+
this.logger.info('全量标注数据', json);
|
|
4179
|
+
}
|
|
4176
4180
|
if (releaseFlag) {
|
|
4177
4181
|
// 全量标注后对json进行一些修改,为了服务端翻译处理
|
|
4178
4182
|
this.annotationToJson(typesMap, json);
|
|
@@ -4466,7 +4470,10 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
4466
4470
|
* @param result toTs生成的内容
|
|
4467
4471
|
*/
|
|
4468
4472
|
async handleDelete(fileNode, targetNode, result) {
|
|
4469
|
-
const filePath = fileNode
|
|
4473
|
+
const filePath = fileNode?.getEmbeddedFilePath();
|
|
4474
|
+
if (!filePath) {
|
|
4475
|
+
return;
|
|
4476
|
+
}
|
|
4470
4477
|
// 如果要删除,而且当前要删Logic就直接删除并且清除错误
|
|
4471
4478
|
/**
|
|
4472
4479
|
* 删除节点中的一个内容,删除了以后,就查一下引用的地方一起查一下异常
|