@accordproject/template-engine 5.0.0 → 5.2.0
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/README.md +39 -0
- package/lib/JavaScriptEvaluator.js +18 -17
- package/lib/JavaScriptEvaluator.js.map +1 -1
- package/lib/TemplateArchiveProcessor.d.ts +26 -1
- package/lib/TemplateArchiveProcessor.js +72 -8
- package/lib/TemplateArchiveProcessor.js.map +1 -1
- package/lib/TemplateMarkInterpreter.d.ts +12 -1
- package/lib/TemplateMarkInterpreter.js +133 -29
- package/lib/TemplateMarkInterpreter.js.map +1 -1
- package/lib/TemplateMarkToJavaScriptCompiler.d.ts +32 -1
- package/lib/TemplateMarkToJavaScriptCompiler.js +54 -6
- package/lib/TemplateMarkToJavaScriptCompiler.js.map +1 -1
- package/lib/TypeScriptCompilationContext.d.ts +2 -1
- package/lib/TypeScriptCompilationContext.js +12 -1
- package/lib/TypeScriptCompilationContext.js.map +1 -1
- package/lib/TypeScriptToJavaScriptCompiler.d.ts +7 -2
- package/lib/TypeScriptToJavaScriptCompiler.js +99 -35
- package/lib/TypeScriptToJavaScriptCompiler.js.map +1 -1
- package/lib/UserLogic.d.ts +59 -0
- package/lib/UserLogic.js +129 -0
- package/lib/UserLogic.js.map +1 -0
- package/lib/drafting/Double/format.js +5 -1
- package/lib/drafting/Double/format.js.map +1 -1
- package/lib/drafting/Integer/format.js +5 -1
- package/lib/drafting/Integer/format.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/llm/LLMConfig.d.ts +50 -0
- package/lib/llm/LLMConfig.js +68 -1
- package/lib/llm/LLMConfig.js.map +1 -1
- package/lib/llm/LLMExecutor.d.ts +3 -1
- package/lib/llm/LLMExecutor.js +3 -2
- package/lib/llm/LLMExecutor.js.map +1 -1
- package/lib/llm/Reasoners.d.ts +83 -10
- package/lib/llm/Reasoners.js +127 -73
- package/lib/llm/Reasoners.js.map +1 -1
- package/lib/llm/index.d.ts +15 -0
- package/lib/llm/index.js +50 -0
- package/lib/llm/index.js.map +1 -0
- package/lib/runtime/typescriptLibs.d.ts +2 -0
- package/lib/runtime/typescriptLibs.js +21 -0
- package/lib/runtime/typescriptLibs.js.map +1 -0
- package/lib/utils.d.ts +29 -1
- package/lib/utils.js +62 -2
- package/lib/utils.js.map +1 -1
- package/package.json +29 -3
- package/umd/template-engine.js +5 -5
- package/umd/template-engine.js.LICENSE.txt +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescriptLibs.js","sourceRoot":"","sources":["../../src/runtime/typescriptLibs.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;;;AAEH,2BAA2B;AAC3B,2DAA2D;AAG9C,QAAA,uBAAuB,GAAG,OAAO,CAAC;AAClC,QAAA,eAAe,GAA2B,EAAC,kBAAkB,EAAC,ioCAAioC,EAAC,kBAAkB,EAAC,mjCAAmjC,EAAC,kBAAkB,EAAC,ouCAAouC,EAAC,kBAAkB,EAAC,ylCAAylC,EAAC,kBAAkB,EAAC,0mCAA0mC,EAAC,kBAAkB,EAAC,0rCAA0rC,EAAC,kBAAkB,EAAC,s+BAAs+B,EAAC,kBAAkB,EAAC,+wCAA+wC,EAAC,eAAe,EAAC,owyNAAowyN,EAAC,sBAAsB,EAAC,gyaAAgya,EAAC,6BAA6B,EAAC,00CAA00C,EAAC,uBAAuB,EAAC,+7tBAA+7tB,EAAC,6BAA6B,EAAC,swKAAswK,EAAC,2BAA2B,EAAC,63kBAA63kB,EAAC,yBAAyB,EAAC,qqDAAqqD,EAAC,4BAA4B,EAAC,klFAAklF,EAAC,0BAA0B,EAAC,utGAAutG,EAAC,wBAAwB,EAAC,ywKAAywK,EAAC,0BAA0B,EAAC,m/MAAm/M,EAAC,mCAAmC,EAAC,inWAAinW,EAAC,gCAAgC,EAAC,8sKAA8sK,EAAC,uBAAuB,EAAC,i/CAAi/C,EAAC,8BAA8B,EAAC,86BAA86B,EAAC,uBAAuB,EAAC,i6DAAi6D,EAAC,uBAAuB,EAAC,29CAA29C,EAAC,yBAAyB,EAAC,g+EAAg+E,EAAC,+BAA+B,EAAC,+rOAA+rO,EAAC,yBAAyB,EAAC,i4EAAi4E,EAAC,8BAA8B,EAAC,ikDAAikD,EAAC,gCAAgC,EAAC,gxEAAgxE,EAAC,iCAAiC,EAAC,ytFAAytF,EAAC,0BAA0B,EAAC,62CAA62C,EAAC,yBAAyB,EAAC,2vCAA2vC,EAAC,uBAAuB,EAAC,8jGAA8jG,EAAC,wBAAwB,EAAC,orGAAorG,EAAC,yBAAyB,EAAC,0+CAA0+C,EAAC,yBAAyB,EAAC,miDAAmiD,EAAC,yBAAyB,EAAC,4gCAA4gC,EAAC,uBAAuB,EAAC,29BAA29B,EAAC,yBAAyB,EAAC,8lsCAA8lsC,EAAC,uBAAuB,EAAC,wltBAAwltB,EAAC,uBAAuB,EAAC,87FAA87F,EAAC,yBAAyB,EAAC,ulDAAulD,EAAC,0BAA0B,EAAC,o0DAAo0D,EAAC,+BAA+B,EAAC,+nKAA+nK,EAAC,yBAAyB,EAAC,ojFAAojF,EAAC,mCAAmC,EAAC,ynDAAynD,EAAC,0BAA0B,EAAC,4wEAA4wE,EAAC,yBAAyB,EAAC,+lDAA+lD,EAAC,0BAA0B,EAAC,6rGAA6rG,EAAC,uBAAuB,EAAC,i0QAAi0Q,EAAC,wBAAwB,EAAC,msJAAmsJ,EAAC,wBAAwB,EAAC,85EAA85E,EAAC,uBAAuB,EAAC,orMAAorM,EAAC,yBAAyB,EAAC,6lCAA6lC,EAAC,yBAAyB,EAAC,g2CAAg2C,EAAC,yBAAyB,EAAC,kqCAAkqC,EAAC,CAAC"}
|
package/lib/utils.d.ts
CHANGED
|
@@ -30,6 +30,34 @@ export declare function getAssignableConcreteTypes(modelManager: ModelManager, b
|
|
|
30
30
|
export declare function isAssignableTo(modelManager: ModelManager, fqn: string, baseFqn: string): boolean;
|
|
31
31
|
export declare function ensureDirSync(path: string): void;
|
|
32
32
|
export declare function removeSync(path: string): void;
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Writes user code (a formula or condition) as a TypeScript function.
|
|
35
|
+
* @param {ClassDeclaration} templateClass - the template model class
|
|
36
|
+
* @param {string} functionName - the name of the generated function
|
|
37
|
+
* @param {string} returnType - the TypeScript return type of the generated function
|
|
38
|
+
* @param {string} code - the user code
|
|
39
|
+
* @param {any} [tsModule] - the typescript module. When supplied, a bare trailing
|
|
40
|
+
* expression is wrapped with `return` (see wrapExpressionWithReturn). It is passed in,
|
|
41
|
+
* rather than imported here, so that loading utils does not load the TypeScript compiler.
|
|
42
|
+
* @returns {string} the TypeScript source of the function
|
|
43
|
+
*/
|
|
44
|
+
export declare function writeFunctionToString(templateClass: ClassDeclaration, functionName: string, returnType: string, code: string, tsModule?: any): string;
|
|
45
|
+
/**
|
|
46
|
+
* Wraps user-supplied formula/condition code with `return` when the user did
|
|
47
|
+
* not write an explicit `return`, so that an inline expression like
|
|
48
|
+
* `{{% amount / 2.0 %}}` produces a value rather than an undefined result that
|
|
49
|
+
* fails downstream validation.
|
|
50
|
+
*
|
|
51
|
+
* Uses the TypeScript AST to inspect only top-level statements, so a nested
|
|
52
|
+
* function/arrow that contains its own `return` does not confuse the outer
|
|
53
|
+
* detection (e.g. `[1,2,3].map(x => { return x*2 })[0]`).
|
|
54
|
+
*
|
|
55
|
+
* Code with syntax errors is returned unchanged, so that the compiler reports
|
|
56
|
+
* those errors against the user's original code.
|
|
57
|
+
*
|
|
58
|
+
* The typescript module is passed in so that it is only loaded on the
|
|
59
|
+
* compilation path (see TypeScriptToJavaScriptCompiler).
|
|
60
|
+
*/
|
|
61
|
+
export declare function wrapExpressionWithReturn(ts: any, code: string): string;
|
|
34
62
|
export declare function nameUserCode(templateMarkDom: any): any;
|
|
35
63
|
export declare function getTemplateClassDeclaration(modelManager: ModelManager, templateConceptFqn?: string): ClassDeclaration;
|
package/lib/utils.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.isAssignableTo = isAssignableTo;
|
|
|
22
22
|
exports.ensureDirSync = ensureDirSync;
|
|
23
23
|
exports.removeSync = removeSync;
|
|
24
24
|
exports.writeFunctionToString = writeFunctionToString;
|
|
25
|
+
exports.wrapExpressionWithReturn = wrapExpressionWithReturn;
|
|
25
26
|
exports.nameUserCode = nameUserCode;
|
|
26
27
|
exports.getTemplateClassDeclaration = getTemplateClassDeclaration;
|
|
27
28
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -86,7 +87,18 @@ function ensureDirSync(path) {
|
|
|
86
87
|
function removeSync(path) {
|
|
87
88
|
(0, fs_1.rmSync)(path, { recursive: true, force: true });
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Writes user code (a formula or condition) as a TypeScript function.
|
|
92
|
+
* @param {ClassDeclaration} templateClass - the template model class
|
|
93
|
+
* @param {string} functionName - the name of the generated function
|
|
94
|
+
* @param {string} returnType - the TypeScript return type of the generated function
|
|
95
|
+
* @param {string} code - the user code
|
|
96
|
+
* @param {any} [tsModule] - the typescript module. When supplied, a bare trailing
|
|
97
|
+
* expression is wrapped with `return` (see wrapExpressionWithReturn). It is passed in,
|
|
98
|
+
* rather than imported here, so that loading utils does not load the TypeScript compiler.
|
|
99
|
+
* @returns {string} the TypeScript source of the function
|
|
100
|
+
*/
|
|
101
|
+
function writeFunctionToString(templateClass, functionName, returnType, code, tsModule) {
|
|
90
102
|
let result = '';
|
|
91
103
|
result += '/// ---cut---\n';
|
|
92
104
|
result += `export function ${functionName}(data:TemplateModel.I${templateClass.getName()}, library:any, options:GenerationOptions) : ${returnType} {\n`;
|
|
@@ -95,11 +107,59 @@ function writeFunctionToString(templateClass, functionName, returnType, code) {
|
|
|
95
107
|
templateClass.getProperties().forEach((p) => {
|
|
96
108
|
result += ` const ${p.getName()} = data.${p.getName()};\n`;
|
|
97
109
|
});
|
|
98
|
-
result += ' ' + code
|
|
110
|
+
result += ' ' + (tsModule ? wrapExpressionWithReturn(tsModule, code) : code) + '\n';
|
|
99
111
|
result += '}\n';
|
|
100
112
|
result += '\n';
|
|
101
113
|
return result;
|
|
102
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Wraps user-supplied formula/condition code with `return` when the user did
|
|
117
|
+
* not write an explicit `return`, so that an inline expression like
|
|
118
|
+
* `{{% amount / 2.0 %}}` produces a value rather than an undefined result that
|
|
119
|
+
* fails downstream validation.
|
|
120
|
+
*
|
|
121
|
+
* Uses the TypeScript AST to inspect only top-level statements, so a nested
|
|
122
|
+
* function/arrow that contains its own `return` does not confuse the outer
|
|
123
|
+
* detection (e.g. `[1,2,3].map(x => { return x*2 })[0]`).
|
|
124
|
+
*
|
|
125
|
+
* Code with syntax errors is returned unchanged, so that the compiler reports
|
|
126
|
+
* those errors against the user's original code.
|
|
127
|
+
*
|
|
128
|
+
* The typescript module is passed in so that it is only loaded on the
|
|
129
|
+
* compilation path (see TypeScriptToJavaScriptCompiler).
|
|
130
|
+
*/
|
|
131
|
+
function wrapExpressionWithReturn(ts, code) {
|
|
132
|
+
const trimmed = code.trim();
|
|
133
|
+
if (trimmed.length === 0) {
|
|
134
|
+
return trimmed;
|
|
135
|
+
}
|
|
136
|
+
const sourceFile = ts.createSourceFile('formula.ts', trimmed, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS);
|
|
137
|
+
// parseDiagnostics is internal to the TypeScript API, but is the only way to
|
|
138
|
+
// get syntax errors from createSourceFile without creating a Program
|
|
139
|
+
const parseDiagnostics = sourceFile.parseDiagnostics;
|
|
140
|
+
if (parseDiagnostics && parseDiagnostics.length > 0) {
|
|
141
|
+
return trimmed;
|
|
142
|
+
}
|
|
143
|
+
const statements = sourceFile.statements;
|
|
144
|
+
if (statements.length === 0) {
|
|
145
|
+
return trimmed;
|
|
146
|
+
}
|
|
147
|
+
for (const stmt of statements) {
|
|
148
|
+
if (ts.isReturnStatement(stmt)) {
|
|
149
|
+
return trimmed;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const last = statements[statements.length - 1];
|
|
153
|
+
if (!ts.isExpressionStatement(last)) {
|
|
154
|
+
return trimmed;
|
|
155
|
+
}
|
|
156
|
+
const prefix = statements
|
|
157
|
+
.slice(0, -1)
|
|
158
|
+
.map((s) => s.getText(sourceFile))
|
|
159
|
+
.join('\n');
|
|
160
|
+
const expr = last.expression.getText(sourceFile);
|
|
161
|
+
return prefix.length > 0 ? `${prefix}\nreturn ${expr};` : `return ${expr};`;
|
|
162
|
+
}
|
|
103
163
|
function nameUserCode(templateMarkDom) {
|
|
104
164
|
return (0, traverse_1.default)(templateMarkDom).map(function (x) {
|
|
105
165
|
if (x && ((x.$class === `${markdown_common_1.TemplateMarkModel.NAMESPACE}.ConditionalDefinition` && x.condition) ||
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;AAqCH,gEASC;AAUD,wCAGC;AAED,sCAIC;AAED,gCAEC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;AAqCH,gEASC;AAUD,wCAGC;AAED,sCAIC;AAED,gCAEC;AAaD,sDAcC;AAkBD,4DA+BC;AAED,oCAQC;AAED,kEASC;AApKD,uDAAuD;AAEvD,gEAAsG;AACtG,oEAAmE;AACnE,wEAAoE;AAEpE,2BAAmD;AACnD,wDAAgC;AAEhC,uFAAuF;AACvF,4FAA4F;AAC5F,yFAAyF;AACzF,uFAAuF;AACvF,sFAAsF;AACtF,qBAAqB;AACR,QAAA,iBAAiB,GAAG,uCAAuC,CAAC;AAC5D,QAAA,mBAAmB,GAAG,yCAAyC,CAAC;AAChE,QAAA,oBAAoB,GAAG,0CAA0C,CAAC;AAClE,QAAA,cAAc,GAAG,sBAAsB,CA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CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACxD,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAgB,2BAA2B,CAAC,YAA0B,EAAE,kBAA2B;IAC/F,MAAM,YAAY,GAAG,IAAI,4BAAY,CAAC,YAAY,CAAC,CAAC;IACpD,IAAI,CAAC;QACD,OAAO,oCAAgB,CAAC,mBAAmB,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC5F,CAAC;IACD,OAAM,GAAG,EAAE,CAAC;QACR,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,MAAM,GAAG,CAAC;IACd,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accordproject/template-engine",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Generation of AgreementMark from TemplateMark + JSON Data",
|
|
5
5
|
"homepage": "https://github.com/accordproject",
|
|
6
6
|
"engines": {
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"tar": "^7.4.3",
|
|
61
61
|
"to-words": "^4.4.0",
|
|
62
62
|
"traverse": "^0.6.11",
|
|
63
|
-
"typescript": "
|
|
63
|
+
"typescript": "5.8.2"
|
|
64
64
|
},
|
|
65
|
-
"
|
|
65
|
+
"peerDependencies": {
|
|
66
66
|
"@anthropic-ai/sdk": "^0.100.1",
|
|
67
67
|
"@google/genai": "^2.10.0",
|
|
68
68
|
"@mistralai/mistralai": "^2.4.0",
|
|
@@ -70,11 +70,35 @@
|
|
|
70
70
|
"groq-sdk": "^1.3.0",
|
|
71
71
|
"openai": "^6.42.0"
|
|
72
72
|
},
|
|
73
|
+
"peerDependenciesMeta": {
|
|
74
|
+
"@anthropic-ai/sdk": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"@google/genai": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"@mistralai/mistralai": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"@openrouter/sdk": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"groq-sdk": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
89
|
+
"openai": {
|
|
90
|
+
"optional": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
73
93
|
"devDependencies": {
|
|
74
94
|
"@accordproject/markdown-html": "^1.1.0",
|
|
95
|
+
"@anthropic-ai/sdk": "^0.100.1",
|
|
75
96
|
"@cucumber/cucumber": "^13.2.1",
|
|
76
97
|
"@eslint/eslintrc": "^3.3.1",
|
|
77
98
|
"@eslint/js": "^9.23.0",
|
|
99
|
+
"@google/genai": "^2.10.0",
|
|
100
|
+
"@mistralai/mistralai": "^2.4.0",
|
|
101
|
+
"@openrouter/sdk": "^0.13.22",
|
|
78
102
|
"@types/jest": "^29.5.14",
|
|
79
103
|
"@types/jsonpath": "^0.2.4",
|
|
80
104
|
"@types/semver": "7.7.0",
|
|
@@ -87,11 +111,13 @@
|
|
|
87
111
|
"eslint": "^9.23.0",
|
|
88
112
|
"events": "^3.3.0",
|
|
89
113
|
"globals": "^16.0.0",
|
|
114
|
+
"groq-sdk": "^1.3.0",
|
|
90
115
|
"jest": "^29.7.0",
|
|
91
116
|
"license-check-and-add": "2.3.6",
|
|
92
117
|
"mkdirp": "^3.0.1",
|
|
93
118
|
"node-fetch": "^3.3.2",
|
|
94
119
|
"npm-run-all2": "^8.0.4",
|
|
120
|
+
"openai": "^6.42.0",
|
|
95
121
|
"path-browserify": "^1.0.1",
|
|
96
122
|
"process": "^0.11.10",
|
|
97
123
|
"rimraf": "6.0.1",
|