@agentix-e/nl2spel 1.2.1 → 1.2.2
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/index.cjs +3040 -0
- package/dist/index.d.cts +908 -0
- package/dist/index.d.ts +908 -28
- package/dist/index.js +2999 -24
- package/package.json +16 -5
- package/dist/context/context-extractor.d.ts +0 -86
- package/dist/context/context-extractor.d.ts.map +0 -1
- package/dist/context/context-extractor.js +0 -181
- package/dist/context/context-extractor.js.map +0 -1
- package/dist/context/schema-formatter.d.ts +0 -20
- package/dist/context/schema-formatter.d.ts.map +0 -1
- package/dist/context/schema-formatter.js +0 -104
- package/dist/context/schema-formatter.js.map +0 -1
- package/dist/engine/nl2spel-engine.d.ts +0 -145
- package/dist/engine/nl2spel-engine.d.ts.map +0 -1
- package/dist/engine/nl2spel-engine.js +0 -130
- package/dist/engine/nl2spel-engine.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pattern/builtin-patterns.d.ts +0 -12
- package/dist/pattern/builtin-patterns.d.ts.map +0 -1
- package/dist/pattern/builtin-patterns.js +0 -812
- package/dist/pattern/builtin-patterns.js.map +0 -1
- package/dist/pattern/pattern-definition.d.ts +0 -49
- package/dist/pattern/pattern-definition.d.ts.map +0 -1
- package/dist/pattern/pattern-definition.js +0 -2
- package/dist/pattern/pattern-definition.js.map +0 -1
- package/dist/pattern/pattern-matcher.d.ts +0 -55
- package/dist/pattern/pattern-matcher.d.ts.map +0 -1
- package/dist/pattern/pattern-matcher.js +0 -216
- package/dist/pattern/pattern-matcher.js.map +0 -1
- package/dist/provider/llm-provider.d.ts +0 -146
- package/dist/provider/llm-provider.d.ts.map +0 -1
- package/dist/provider/llm-provider.js +0 -2
- package/dist/provider/llm-provider.js.map +0 -1
- package/dist/provider/provider-registry.d.ts +0 -28
- package/dist/provider/provider-registry.d.ts.map +0 -1
- package/dist/provider/provider-registry.js +0 -65
- package/dist/provider/provider-registry.js.map +0 -1
- package/dist/strategy/strategy-router.d.ts +0 -79
- package/dist/strategy/strategy-router.d.ts.map +0 -1
- package/dist/strategy/strategy-router.js +0 -182
- package/dist/strategy/strategy-router.js.map +0 -1
- package/dist/template/intent-classifier.d.ts +0 -56
- package/dist/template/intent-classifier.d.ts.map +0 -1
- package/dist/template/intent-classifier.js +0 -251
- package/dist/template/intent-classifier.js.map +0 -1
- package/dist/template/nl-intent.d.ts +0 -38
- package/dist/template/nl-intent.d.ts.map +0 -1
- package/dist/template/nl-intent.js +0 -39
- package/dist/template/nl-intent.js.map +0 -1
- package/dist/template/prompts/prompt-builder.d.ts +0 -20
- package/dist/template/prompts/prompt-builder.d.ts.map +0 -1
- package/dist/template/prompts/prompt-builder.js +0 -243
- package/dist/template/prompts/prompt-builder.js.map +0 -1
- package/dist/template/template-engine.d.ts +0 -27
- package/dist/template/template-engine.d.ts.map +0 -1
- package/dist/template/template-engine.js +0 -378
- package/dist/template/template-engine.js.map +0 -1
- package/dist/utils/chinese-number-parser.d.ts +0 -30
- package/dist/utils/chinese-number-parser.d.ts.map +0 -1
- package/dist/utils/chinese-number-parser.js +0 -92
- package/dist/utils/chinese-number-parser.js.map +0 -1
- package/dist/validation/auto-fixer.d.ts +0 -13
- package/dist/validation/auto-fixer.d.ts.map +0 -1
- package/dist/validation/auto-fixer.js +0 -110
- package/dist/validation/auto-fixer.js.map +0 -1
- package/dist/validation/self-correction-loop.d.ts +0 -46
- package/dist/validation/self-correction-loop.d.ts.map +0 -1
- package/dist/validation/self-correction-loop.js +0 -132
- package/dist/validation/self-correction-loop.js.map +0 -1
- package/dist/validation/validation-pipeline.d.ts +0 -81
- package/dist/validation/validation-pipeline.d.ts.map +0 -1
- package/dist/validation/validation-pipeline.js +0 -306
- package/dist/validation/validation-pipeline.js.map +0 -1
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
import { NLIntent } from './nl-intent.js';
|
|
2
|
-
/**
|
|
3
|
-
* SpEL template library — each Intent maps to a set of templates.
|
|
4
|
-
*/
|
|
5
|
-
const TEMPLATE_LIBRARY = {
|
|
6
|
-
[NLIntent.COMPARISON]: [
|
|
7
|
-
{
|
|
8
|
-
name: 'COMPARISON-SIMPLE',
|
|
9
|
-
template: '#{root}.{field} {operator} {value}',
|
|
10
|
-
conditions: { hasComparison: true, entityCount: { min: 1 } },
|
|
11
|
-
confidence: 0.9,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'COMPARISON-DUAL',
|
|
15
|
-
template: '(#{root}.{field1} {operator1} {value1}) {logic} (#{root}.{field2} {operator2} {value2})',
|
|
16
|
-
conditions: { hasComparison: true, hasLogical: true, entityCount: { min: 2 } },
|
|
17
|
-
confidence: 0.8,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
[NLIntent.NULL_CHECK]: [
|
|
21
|
-
{
|
|
22
|
-
name: 'NULL-IS_NULL',
|
|
23
|
-
template: '#{root}.{field} == null',
|
|
24
|
-
conditions: { hasNull: true },
|
|
25
|
-
confidence: 0.95,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'NULL-IS_NOT_NULL',
|
|
29
|
-
template: '#{root}.{field} != null',
|
|
30
|
-
conditions: { hasNull: true },
|
|
31
|
-
confidence: 0.95,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
[NLIntent.PERMISSION_CHECK]: [
|
|
35
|
-
{
|
|
36
|
-
name: 'PERM-HAS_ROLE',
|
|
37
|
-
template: "hasRole('{role}')",
|
|
38
|
-
conditions: {},
|
|
39
|
-
confidence: 0.9,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'PERM-HAS_PERMISSION',
|
|
43
|
-
template: "hasPermission('{permission}')",
|
|
44
|
-
conditions: {},
|
|
45
|
-
confidence: 0.9,
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
[NLIntent.LOGICAL]: [
|
|
49
|
-
{
|
|
50
|
-
name: 'LOGICAL-AND',
|
|
51
|
-
template: '({left}) and ({right})',
|
|
52
|
-
conditions: { hasLogical: true },
|
|
53
|
-
confidence: 0.75,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'LOGICAL-OR',
|
|
57
|
-
template: '({left}) or ({right})',
|
|
58
|
-
conditions: { hasLogical: true },
|
|
59
|
-
confidence: 0.75,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'LOGICAL-NOT',
|
|
63
|
-
template: '!({expr})',
|
|
64
|
-
conditions: { hasLogical: true },
|
|
65
|
-
confidence: 0.85,
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
[NLIntent.STRING_MATCH]: [
|
|
69
|
-
{
|
|
70
|
-
name: 'STR-CONTAINS',
|
|
71
|
-
template: "#{root}.{field}.contains('{substring}')",
|
|
72
|
-
conditions: { hasString: true },
|
|
73
|
-
confidence: 0.9,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'STR-STARTS_WITH',
|
|
77
|
-
template: "#{root}.{field}.startsWith('{prefix}')",
|
|
78
|
-
conditions: { hasString: true },
|
|
79
|
-
confidence: 0.9,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: 'STR-ENDS_WITH',
|
|
83
|
-
template: "#{root}.{field}.endsWith('{suffix}')",
|
|
84
|
-
conditions: { hasString: true },
|
|
85
|
-
confidence: 0.9,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'STR-MATCHES',
|
|
89
|
-
template: "#{root}.{field} matches '{pattern}'",
|
|
90
|
-
conditions: { hasString: true },
|
|
91
|
-
confidence: 0.8,
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
[NLIntent.COLLECTION]: [
|
|
95
|
-
{
|
|
96
|
-
name: 'COLL-IS_EMPTY',
|
|
97
|
-
template: '#{root}.{list}.isEmpty()',
|
|
98
|
-
conditions: { hasCollection: true },
|
|
99
|
-
confidence: 0.95,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'COLL-IS_NOT_EMPTY',
|
|
103
|
-
template: '!#{root}.{list}.isEmpty()',
|
|
104
|
-
conditions: { hasCollection: true },
|
|
105
|
-
confidence: 0.9,
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: 'COLL-SIZE',
|
|
109
|
-
template: '#{root}.{list}.size() {operator} {value}',
|
|
110
|
-
conditions: { hasCollection: true, hasComparison: true },
|
|
111
|
-
confidence: 0.85,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: 'COLL-CONTAINS',
|
|
115
|
-
template: "#{root}.{list}.contains('{element}')",
|
|
116
|
-
conditions: { hasCollection: true },
|
|
117
|
-
confidence: 0.9,
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
[NLIntent.RANGE]: [
|
|
121
|
-
{
|
|
122
|
-
name: 'RANGE-BETWEEN',
|
|
123
|
-
template: '#{root}.{field} between {{{min}, {max}}}',
|
|
124
|
-
conditions: { entityCount: { min: 1 } },
|
|
125
|
-
confidence: 0.9,
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
[NLIntent.SELECTION]: [
|
|
129
|
-
{
|
|
130
|
-
name: 'SELECT-ALL',
|
|
131
|
-
template: '#{root}.{list}.?[#{this}.{conditionField} {conditionOp} {conditionValue}]',
|
|
132
|
-
conditions: {},
|
|
133
|
-
confidence: 0.75,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: 'SELECT-FIRST',
|
|
137
|
-
template: '#{root}.{list}.^[#{this}.{conditionField} {conditionOp} {conditionValue}]',
|
|
138
|
-
conditions: {},
|
|
139
|
-
confidence: 0.75,
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
[NLIntent.PROJECTION]: [
|
|
143
|
-
{
|
|
144
|
-
name: 'PROJ-FIELD',
|
|
145
|
-
template: '#{root}.{list}.![#{this}.{field}]',
|
|
146
|
-
conditions: {},
|
|
147
|
-
confidence: 0.75,
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
[NLIntent.TYPE_CHECK]: [
|
|
151
|
-
{
|
|
152
|
-
name: 'TYPE-INSTANCEOF',
|
|
153
|
-
template: '#{root}.{field} instanceof T({typeName})',
|
|
154
|
-
conditions: {},
|
|
155
|
-
confidence: 0.85,
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
[NLIntent.BOOLEAN]: [
|
|
159
|
-
{
|
|
160
|
-
name: 'BOOL-IS_TRUE',
|
|
161
|
-
template: '#{root}.{field} == true',
|
|
162
|
-
conditions: {},
|
|
163
|
-
confidence: 0.9,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: 'BOOL-IS_FALSE',
|
|
167
|
-
template: '#{root}.{field} == false',
|
|
168
|
-
conditions: {},
|
|
169
|
-
confidence: 0.9,
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: 'BOOL-FIELD',
|
|
173
|
-
template: '#{root}.{field}',
|
|
174
|
-
conditions: {},
|
|
175
|
-
confidence: 0.85,
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
[NLIntent.DATE]: [
|
|
179
|
-
{
|
|
180
|
-
name: 'DATE-AFTER',
|
|
181
|
-
template: "#{root}.{field}.after(T(java.util.Date).valueOf('{date}'))",
|
|
182
|
-
conditions: {},
|
|
183
|
-
confidence: 0.85,
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
name: 'DATE-BEFORE',
|
|
187
|
-
template: "#{root}.{field}.before(T(java.util.Date).valueOf('{date}'))",
|
|
188
|
-
conditions: {},
|
|
189
|
-
confidence: 0.85,
|
|
190
|
-
},
|
|
191
|
-
],
|
|
192
|
-
[NLIntent.ELVIS]: [
|
|
193
|
-
{
|
|
194
|
-
name: 'ELVIS-DEFAULT',
|
|
195
|
-
template: "#{root}.{field} ?: '{defaultValue}'",
|
|
196
|
-
conditions: {},
|
|
197
|
-
confidence: 0.8,
|
|
198
|
-
},
|
|
199
|
-
],
|
|
200
|
-
[NLIntent.ASSIGNMENT]: [
|
|
201
|
-
{
|
|
202
|
-
name: 'ASSIGN-SIMPLE',
|
|
203
|
-
template: '#{root}.{field} = {value}',
|
|
204
|
-
conditions: {},
|
|
205
|
-
confidence: 0.8,
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
[NLIntent.ARITHMETIC]: [
|
|
209
|
-
{
|
|
210
|
-
name: 'ARITH-OP',
|
|
211
|
-
template: '#{root}.{field1} {operator} #{root}.{field2}',
|
|
212
|
-
conditions: {},
|
|
213
|
-
confidence: 0.75,
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
};
|
|
217
|
-
export class TemplateEngine {
|
|
218
|
-
contextSchema;
|
|
219
|
-
constructor(contextSchema) {
|
|
220
|
-
this.contextSchema = contextSchema;
|
|
221
|
-
}
|
|
222
|
-
setContext(schema) {
|
|
223
|
-
this.contextSchema = schema;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Generate a SpEL expression based on intent classification results
|
|
227
|
-
*/
|
|
228
|
-
generate(input, intentResult) {
|
|
229
|
-
const templates = TEMPLATE_LIBRARY[intentResult.primaryIntent];
|
|
230
|
-
if (!templates || templates.length === 0)
|
|
231
|
-
return null;
|
|
232
|
-
const bestTemplate = this.selectBestTemplate(templates, intentResult, input);
|
|
233
|
-
if (!bestTemplate)
|
|
234
|
-
return null;
|
|
235
|
-
const { expression, unfilledSlots } = this.fillTemplate(bestTemplate.template, input, intentResult);
|
|
236
|
-
return {
|
|
237
|
-
expression,
|
|
238
|
-
intent: intentResult.primaryIntent,
|
|
239
|
-
templateName: bestTemplate.name,
|
|
240
|
-
confidence: bestTemplate.confidence * (intentResult.intents[0]?.confidence ?? 0.5),
|
|
241
|
-
unfilledSlots,
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
selectBestTemplate(templates, intentResult, input) {
|
|
245
|
-
let bestScore = -1;
|
|
246
|
-
let bestTemplate = null;
|
|
247
|
-
// Input-specific heuristics
|
|
248
|
-
const hasEmptyKeyword = /为空|empty|null/i.test(input);
|
|
249
|
-
const hasNotEmptyKeyword = /不为空|not empty|not null/i.test(input);
|
|
250
|
-
for (const template of templates) {
|
|
251
|
-
const conditions = template.conditions;
|
|
252
|
-
let score = 0;
|
|
253
|
-
if (conditions.hasComparison && intentResult.operators.length > 0)
|
|
254
|
-
score += 1;
|
|
255
|
-
if (conditions.hasLogical && intentResult.logicalConnectors.length > 0)
|
|
256
|
-
score += 1;
|
|
257
|
-
if (conditions.hasCollection)
|
|
258
|
-
score += 0.5;
|
|
259
|
-
if (conditions.hasNull)
|
|
260
|
-
score += 0.5;
|
|
261
|
-
if (conditions.hasString)
|
|
262
|
-
score += 1;
|
|
263
|
-
// Boost isEmpty template when input has empty keywords
|
|
264
|
-
if (template.name.includes('IS_EMPTY') && hasEmptyKeyword)
|
|
265
|
-
score += 2;
|
|
266
|
-
if (template.name.includes('IS_NOT_EMPTY') && hasNotEmptyKeyword)
|
|
267
|
-
score += 2;
|
|
268
|
-
if (conditions.entityCount) {
|
|
269
|
-
if (conditions.entityCount.min &&
|
|
270
|
-
intentResult.entities.length < conditions.entityCount.min) {
|
|
271
|
-
continue;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (score > bestScore) {
|
|
275
|
-
bestScore = score;
|
|
276
|
-
bestTemplate = template;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return bestTemplate;
|
|
280
|
-
}
|
|
281
|
-
fillTemplate(template, input, intentResult) {
|
|
282
|
-
let expression = template;
|
|
283
|
-
const unfilledSlots = [];
|
|
284
|
-
// Extract root name from contextSchema
|
|
285
|
-
let rootName = 'order';
|
|
286
|
-
let fieldName = 'field';
|
|
287
|
-
if (this.contextSchema?.root) {
|
|
288
|
-
rootName = this.contextSchema.root.name;
|
|
289
|
-
const fields = Object.keys(this.contextSchema.root.fields ?? {});
|
|
290
|
-
for (const f of fields) {
|
|
291
|
-
if (input.includes(f)) {
|
|
292
|
-
fieldName = f;
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
// Heuristic root name extraction
|
|
299
|
-
const rootMap = {
|
|
300
|
-
订单: 'order',
|
|
301
|
-
order: 'order',
|
|
302
|
-
用户: 'user',
|
|
303
|
-
user: 'user',
|
|
304
|
-
文件: 'file',
|
|
305
|
-
file: 'file',
|
|
306
|
-
账号: 'account',
|
|
307
|
-
account: 'account',
|
|
308
|
-
商品: 'item',
|
|
309
|
-
product: 'item',
|
|
310
|
-
};
|
|
311
|
-
for (const [key, val] of Object.entries(rootMap)) {
|
|
312
|
-
if (input.includes(key)) {
|
|
313
|
-
rootName = val;
|
|
314
|
-
break;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
// Fill root
|
|
319
|
-
expression = expression.replace(/\{root\}/g, rootName);
|
|
320
|
-
expression = expression.replace(/\{field\}/g, fieldName);
|
|
321
|
-
// Extract field entities for dual-field templates
|
|
322
|
-
const fieldEntities = intentResult.entities.filter((e) => e.type === 'field');
|
|
323
|
-
const field1Name = fieldEntities[0]?.text ?? fieldName;
|
|
324
|
-
const field2Name = fieldEntities[1]?.text ?? fieldName;
|
|
325
|
-
expression = expression.replace(/\{field1\}/g, field1Name);
|
|
326
|
-
expression = expression.replace(/\{field2\}/g, field2Name);
|
|
327
|
-
expression = expression.replace(/\{conditionField\}/g, 'condition');
|
|
328
|
-
expression = expression.replace(/\{list\}/g, 'items');
|
|
329
|
-
// Extract numeric entities
|
|
330
|
-
const numberEntities = intentResult.entities.filter((e) => e.type === 'value' && !isNaN(Number(e.text)));
|
|
331
|
-
const stringEntities = intentResult.entities.filter((e) => e.type === 'value' && isNaN(Number(e.text)));
|
|
332
|
-
// Fill numeric values
|
|
333
|
-
if (numberEntities.length > 0) {
|
|
334
|
-
expression = expression.replace(/\{value\}/, numberEntities[0].text);
|
|
335
|
-
expression = expression.replace(/\{value1\}/, numberEntities[0].text);
|
|
336
|
-
expression = expression.replace(/\{value2\}/, (numberEntities[1] ?? numberEntities[0]).text);
|
|
337
|
-
expression = expression.replace(/\{min\}/, numberEntities[0].text);
|
|
338
|
-
expression = expression.replace(/\{max\}/, (numberEntities[1] ?? numberEntities[0]).text);
|
|
339
|
-
expression = expression.replace(/\{conditionValue\}/, numberEntities[0].text);
|
|
340
|
-
}
|
|
341
|
-
// Fill string values
|
|
342
|
-
if (stringEntities.length > 0) {
|
|
343
|
-
expression = expression.replace(/\{substring\}/, stringEntities[0].text);
|
|
344
|
-
expression = expression.replace(/\{element\}/, stringEntities[0].text);
|
|
345
|
-
expression = expression.replace(/\{role\}/, stringEntities[0].text);
|
|
346
|
-
expression = expression.replace(/\{permission\}/, stringEntities[0].text);
|
|
347
|
-
expression = expression.replace(/\{prefix\}/, stringEntities[0].text);
|
|
348
|
-
expression = expression.replace(/\{suffix\}/, stringEntities[0].text);
|
|
349
|
-
expression = expression.replace(/\{pattern\}/, stringEntities[0].text);
|
|
350
|
-
expression = expression.replace(/\{defaultValue\}/, stringEntities[0].text);
|
|
351
|
-
expression = expression.replace(/\{date\}/, stringEntities[0].text);
|
|
352
|
-
expression = expression.replace(/\{typeName\}/, stringEntities[0].text);
|
|
353
|
-
}
|
|
354
|
-
// Operator filling
|
|
355
|
-
if (intentResult.operators.length > 0) {
|
|
356
|
-
expression = expression.replace(/\{operator\}/g, intentResult.operators[0]);
|
|
357
|
-
expression = expression.replace(/\{operator1\}/g, intentResult.operators[0]);
|
|
358
|
-
expression = expression.replace(/\{operator2\}/g, intentResult.operators[1] ?? intentResult.operators[0]);
|
|
359
|
-
expression = expression.replace(/\{conditionOp\}/g, intentResult.operators[0]);
|
|
360
|
-
}
|
|
361
|
-
// Logical connectors
|
|
362
|
-
if (intentResult.logicalConnectors.length > 0) {
|
|
363
|
-
expression = expression.replace(/\{logic\}/g, intentResult.logicalConnectors[0]);
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
expression = expression.replace(/\{logic\}/g, 'and');
|
|
367
|
-
}
|
|
368
|
-
// Detect unfilled slots
|
|
369
|
-
const unfilledMatches = expression.matchAll(/\{(\w+)\}/g);
|
|
370
|
-
for (const m of unfilledMatches) {
|
|
371
|
-
const slot = m[1];
|
|
372
|
-
unfilledSlots.push(slot);
|
|
373
|
-
expression = expression.replace(new RegExp(`\\{${slot}\\}`, 'g'), `\${${slot}}`);
|
|
374
|
-
}
|
|
375
|
-
return { expression, unfilledSlots };
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
//# sourceMappingURL=template-engine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-engine.js","sourceRoot":"","sources":["../../src/template/template-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAmC1C;;GAEG;AACH,MAAM,gBAAgB,GAAsC;IAC1D,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACrB;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,oCAAoC;YAC9C,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;YAC5D,UAAU,EAAE,GAAG;SAChB;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EACN,yFAAyF;YAC3F,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;YAC9E,UAAU,EAAE,GAAG;SAChB;KACF;IAED,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACrB;YACE,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE,yBAAyB;YACnC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YAC7B,UAAU,EAAE,IAAI;SACjB;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,yBAA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AAI,YAAY,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAE,CAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACN,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACvD,CAAC;QAED,wBAAwB;QACxB,MAAM,eAAe,GAAG,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC1D,KAAK,MAAM,CAAC,IAAI,eAAe,EAAE,CAAC;YAChC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;YACnB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzB,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,IAAI,GAAG,CAAC,CAAC;QACnF,CAAC;QAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chinese number parser — converts Chinese number strings to Arabic numerals.
|
|
3
|
-
*
|
|
4
|
-
* Supports:
|
|
5
|
-
* - Basic digits: 零一二三四五六七八九十百千万亿
|
|
6
|
-
* - Leading "十": "十五" → 15
|
|
7
|
-
* - Thousands/hundred-millions grouping: "一万二千三百四十五" → 12345
|
|
8
|
-
* - Zero padding: "一千零一" → 1001
|
|
9
|
-
*/
|
|
10
|
-
export declare class ChineseNumberParser {
|
|
11
|
-
private static readonly DIGITS;
|
|
12
|
-
private static readonly UNITS;
|
|
13
|
-
private static readonly CHINESE_NUM_PATTERN;
|
|
14
|
-
/**
|
|
15
|
-
* Check if a string is pure Chinese numbers
|
|
16
|
-
*/
|
|
17
|
-
static isChineseNumber(text: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Parse Chinese numbers → Arabic numerals
|
|
20
|
-
*
|
|
21
|
-
* @param text Chinese number string
|
|
22
|
-
* @returns Parsed number, returns NaN on failure
|
|
23
|
-
*/
|
|
24
|
-
static parse(text: string): number;
|
|
25
|
-
/**
|
|
26
|
-
* Safe parse: returns null if parsing fails
|
|
27
|
-
*/
|
|
28
|
-
static parseSafe(text: string): number | null;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=chinese-number-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chinese-number-parser.d.ts","sourceRoot":"","sources":["../../src/utils/chinese-number-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAY5B;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAM3B;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAA2B;IAEtE;;OAEG;WACW,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIpD;;;;;OAKG;WACW,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IA2CzC;;OAEG;WACW,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAIrD"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chinese number parser — converts Chinese number strings to Arabic numerals.
|
|
3
|
-
*
|
|
4
|
-
* Supports:
|
|
5
|
-
* - Basic digits: 零一二三四五六七八九十百千万亿
|
|
6
|
-
* - Leading "十": "十五" → 15
|
|
7
|
-
* - Thousands/hundred-millions grouping: "一万二千三百四十五" → 12345
|
|
8
|
-
* - Zero padding: "一千零一" → 1001
|
|
9
|
-
*/
|
|
10
|
-
export class ChineseNumberParser {
|
|
11
|
-
static DIGITS = {
|
|
12
|
-
零: 0,
|
|
13
|
-
一: 1,
|
|
14
|
-
二: 2,
|
|
15
|
-
三: 3,
|
|
16
|
-
四: 4,
|
|
17
|
-
五: 5,
|
|
18
|
-
六: 6,
|
|
19
|
-
七: 7,
|
|
20
|
-
八: 8,
|
|
21
|
-
九: 9,
|
|
22
|
-
两: 2,
|
|
23
|
-
};
|
|
24
|
-
static UNITS = {
|
|
25
|
-
十: 10,
|
|
26
|
-
百: 100,
|
|
27
|
-
千: 1000,
|
|
28
|
-
万: 10000,
|
|
29
|
-
亿: 100000000,
|
|
30
|
-
};
|
|
31
|
-
static CHINESE_NUM_PATTERN = /^[零一二三四五六七八九十百千万亿两]+$/;
|
|
32
|
-
/**
|
|
33
|
-
* Check if a string is pure Chinese numbers
|
|
34
|
-
*/
|
|
35
|
-
static isChineseNumber(text) {
|
|
36
|
-
return this.CHINESE_NUM_PATTERN.test(text);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Parse Chinese numbers → Arabic numerals
|
|
40
|
-
*
|
|
41
|
-
* @param text Chinese number string
|
|
42
|
-
* @returns Parsed number, returns NaN on failure
|
|
43
|
-
*/
|
|
44
|
-
static parse(text) {
|
|
45
|
-
if (!this.isChineseNumber(text)) {
|
|
46
|
-
return NaN;
|
|
47
|
-
}
|
|
48
|
-
// Handle leading "十" → "一十"
|
|
49
|
-
let s = text;
|
|
50
|
-
if (s.startsWith('十')) {
|
|
51
|
-
s = '一' + s;
|
|
52
|
-
}
|
|
53
|
-
let result = 0; // Accumulated result for hundreds-millions and above
|
|
54
|
-
let section = 0; // Ten-thousands segment
|
|
55
|
-
let current = 0; // Current digit (thousands and below)
|
|
56
|
-
for (const ch of s) {
|
|
57
|
-
const digit = this.DIGITS[ch];
|
|
58
|
-
if (digit !== undefined) {
|
|
59
|
-
// Digit character
|
|
60
|
-
current = digit;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
const unit = this.UNITS[ch];
|
|
64
|
-
if (unit === undefined)
|
|
65
|
-
continue;
|
|
66
|
-
if (unit >= 10000) {
|
|
67
|
-
// Hundreds-millions/ten-thousands segment: section has accumulated values below
|
|
68
|
-
// plus current digit, multiply by unit
|
|
69
|
-
// e.g. "十万" → section=10, current=0 → result += 10 * 10000 = 100000
|
|
70
|
-
// e.g. "十二万" → section=10, current=2 → result += 12 * 10000 = 120000
|
|
71
|
-
result += (section + current || 1) * unit;
|
|
72
|
-
section = 0;
|
|
73
|
-
current = 0;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
// Tens/hundreds/thousands
|
|
77
|
-
section += (current || 1) * unit;
|
|
78
|
-
current = 0;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return result + section + current;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Safe parse: returns null if parsing fails
|
|
86
|
-
*/
|
|
87
|
-
static parseSafe(text) {
|
|
88
|
-
const value = this.parse(text);
|
|
89
|
-
return Number.isNaN(value) ? null : value;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=chinese-number-parser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chinese-number-parser.js","sourceRoot":"","sources":["../../src/utils/chinese-number-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAAU,MAAM,GAA2B;QACvD,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC;IAEM,MAAM,CAAU,KAAK,GAA2B;QACtD,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,GAAG;QACN,C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G,IAAI,CAAC;oBAC1C,OAAO,GAAG,CAAC,CAAC;oBACZ,OAAO,GAAG,CAAC,CAAC;gBACd,CAAC;qBAAM,CAAC;oBACN,0BAA0B;oBAC1B,OAAO,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;oBACjC,OAAO,GAAG,CAAC,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,IAAY;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AutoFixer — automatically fixes common SpEL syntax errors from LLM output.
|
|
3
|
-
*/
|
|
4
|
-
export declare class AutoFixer {
|
|
5
|
-
fix(expression: string): AutoFixResult;
|
|
6
|
-
private fixAllBrackets;
|
|
7
|
-
}
|
|
8
|
-
export interface AutoFixResult {
|
|
9
|
-
expression: string;
|
|
10
|
-
wasFixed: boolean;
|
|
11
|
-
changes: string[];
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=auto-fixer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-fixer.d.ts","sourceRoot":"","sources":["../../src/validation/auto-fixer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,SAAS;IACb,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa;IA+F7C,OAAO,CAAC,cAAc;CAyBvB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AutoFixer — automatically fixes common SpEL syntax errors from LLM output.
|
|
3
|
-
*/
|
|
4
|
-
export class AutoFixer {
|
|
5
|
-
fix(expression) {
|
|
6
|
-
let fixed = expression;
|
|
7
|
-
const changes = [];
|
|
8
|
-
// Order matters: check specific patterns before generic replacements
|
|
9
|
-
// 1. undefined/null checks (BEFORE === → ==)
|
|
10
|
-
if (fixed.includes('=== undefined')) {
|
|
11
|
-
fixed = fixed.replace(/=== undefined/g, '== null');
|
|
12
|
-
changes.push('Replaced === undefined with == null');
|
|
13
|
-
}
|
|
14
|
-
if (fixed.includes('!== undefined')) {
|
|
15
|
-
fixed = fixed.replace(/!== undefined/g, '!= null');
|
|
16
|
-
changes.push('Replaced !== undefined with != null');
|
|
17
|
-
}
|
|
18
|
-
// 2. !== → != (BEFORE === → == to avoid double-processing)
|
|
19
|
-
if (fixed.includes('!==')) {
|
|
20
|
-
// `includes` check guarantees match is non-null
|
|
21
|
-
const count = fixed.match(/!==/g).length;
|
|
22
|
-
fixed = fixed.replace(/!==/g, '!=');
|
|
23
|
-
changes.push(`Replaced ${count}x !== with !=`);
|
|
24
|
-
}
|
|
25
|
-
// 3. === → ==
|
|
26
|
-
if (fixed.includes('===')) {
|
|
27
|
-
const count = fixed.match(/===/g).length;
|
|
28
|
-
fixed = fixed.replace(/===/g, '==');
|
|
29
|
-
changes.push(`Replaced ${count}x === with ==`);
|
|
30
|
-
}
|
|
31
|
-
// 4. && → and
|
|
32
|
-
if (fixed.includes('&&')) {
|
|
33
|
-
const count = fixed.match(/&&/g).length;
|
|
34
|
-
fixed = fixed.replace(/&&/g, 'and');
|
|
35
|
-
changes.push(`Replaced ${count}x && with and`);
|
|
36
|
-
}
|
|
37
|
-
// 5. || → or
|
|
38
|
-
if (fixed.includes('||')) {
|
|
39
|
-
const count = fixed.match(/\|\|/g).length;
|
|
40
|
-
fixed = fixed.replace(/\|\|/g, 'or');
|
|
41
|
-
changes.push(`Replaced ${count}x || with or`);
|
|
42
|
-
}
|
|
43
|
-
// 6. Unmatched single quotes
|
|
44
|
-
const singleQuoteCount = (fixed.match(/'/g) ?? []).length;
|
|
45
|
-
if (singleQuoteCount % 2 !== 0) {
|
|
46
|
-
// If last char is not already a quote, append one
|
|
47
|
-
if (!fixed.endsWith("'")) {
|
|
48
|
-
fixed = fixed + "'";
|
|
49
|
-
changes.push('Added missing closing single quote');
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// 7. Unmatched double quotes
|
|
53
|
-
const doubleQuoteCount = (fixed.match(/"/g) ?? []).length;
|
|
54
|
-
if (doubleQuoteCount % 2 !== 0) {
|
|
55
|
-
if (!fixed.endsWith('"')) {
|
|
56
|
-
fixed = fixed + '"';
|
|
57
|
-
changes.push('Added missing closing double quote');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// 8. Unbalanced parentheses (all bracket types)
|
|
61
|
-
const parenFix = this.fixAllBrackets(fixed);
|
|
62
|
-
if (parenFix !== fixed) {
|
|
63
|
-
changes.push('Fixed unbalanced brackets');
|
|
64
|
-
fixed = parenFix;
|
|
65
|
-
}
|
|
66
|
-
// 9. > == → >=
|
|
67
|
-
if (fixed.includes('> ==')) {
|
|
68
|
-
fixed = fixed.replace(/> ==/g, '>=');
|
|
69
|
-
changes.push('Replaced > == with >=');
|
|
70
|
-
}
|
|
71
|
-
if (fixed.includes('< ==')) {
|
|
72
|
-
fixed = fixed.replace(/< ==/g, '<=');
|
|
73
|
-
changes.push('Replaced < == with <=');
|
|
74
|
-
}
|
|
75
|
-
// 10. ? : → ?:
|
|
76
|
-
if (fixed.includes('? :')) {
|
|
77
|
-
fixed = fixed.replace(/\?\s*:\s*/g, ' ?: ');
|
|
78
|
-
changes.push('Fixed Elvis operator spacing');
|
|
79
|
-
}
|
|
80
|
-
const wasFixed = changes.length > 0;
|
|
81
|
-
return {
|
|
82
|
-
wasFixed,
|
|
83
|
-
expression: wasFixed ? fixed : expression,
|
|
84
|
-
changes,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
fixAllBrackets(expr) {
|
|
88
|
-
let result = expr;
|
|
89
|
-
// Fix parentheses: ( )
|
|
90
|
-
const openParen = (result.match(/\(/g) ?? []).length;
|
|
91
|
-
const closeParen = (result.match(/\)/g) ?? []).length;
|
|
92
|
-
if (openParen > closeParen) {
|
|
93
|
-
result += ')'.repeat(openParen - closeParen);
|
|
94
|
-
}
|
|
95
|
-
// Fix square brackets: [ ]
|
|
96
|
-
const openBracket = (result.match(/\[/g) ?? []).length;
|
|
97
|
-
const closeBracket = (result.match(/\]/g) ?? []).length;
|
|
98
|
-
if (openBracket > closeBracket) {
|
|
99
|
-
result += ']'.repeat(openBracket - closeBracket);
|
|
100
|
-
}
|
|
101
|
-
// Fix curly braces: { }
|
|
102
|
-
const openBrace = (result.match(/\{/g) ?? []).length;
|
|
103
|
-
const closeBrace = (result.match(/\}/g) ?? []).length;
|
|
104
|
-
if (openBrace > closeBrace) {
|
|
105
|
-
result += '}'.repeat(openBrace - closeBrace);
|
|
106
|
-
}
|
|
107
|
-
return result;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=auto-fixer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-fixer.js","sourceRoot":"","sources":["../../src/validation/auto-fixer.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,SAAS;IACb,GAAG,CAAC,UAAkB;QAC3B,IAAI,KAAK,GAAG,UAAU,CAAC;QACvB,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,qEAAqE;QAErE,6CAA6C;QAC7C,IAAI,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACpC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;YACnD,OAAO,CAAC,IAAI,CAAC,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