@intend-it/core 2.0.3 → 2.0.5
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.js +13 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -168803,7 +168803,7 @@ class TypeScriptGenerator {
|
|
|
168803
168803
|
`;
|
|
168804
168804
|
code += `if (import.meta.main) {
|
|
168805
168805
|
`;
|
|
168806
|
-
code += ` ${intent.name}().catch((err: any) => console.error(err));
|
|
168806
|
+
code += ` Promise.resolve(${intent.name}()).catch((err: any) => console.error(err));
|
|
168807
168807
|
`;
|
|
168808
168808
|
code += `}
|
|
168809
168809
|
`;
|
|
@@ -168894,9 +168894,14 @@ class TypeScriptGenerator {
|
|
|
168894
168894
|
}
|
|
168895
168895
|
if (step.resultVariable) {
|
|
168896
168896
|
const decl = step.variableKind || "const";
|
|
168897
|
+
let declaration = `${decl} ${step.resultVariable}`;
|
|
168898
|
+
if (step.resultType) {
|
|
168899
|
+
declaration += `: ${step.resultType}`;
|
|
168900
|
+
}
|
|
168901
|
+
declaration += ` = null as any; // PLACEHOLDER`;
|
|
168897
168902
|
blocks.push({
|
|
168898
168903
|
type: "statement",
|
|
168899
|
-
content:
|
|
168904
|
+
content: declaration,
|
|
168900
168905
|
indent: 1
|
|
168901
168906
|
});
|
|
168902
168907
|
}
|
|
@@ -169235,11 +169240,14 @@ Generate ONLY the TypeScript code for this step (no explanations, no markdown).`
|
|
|
169235
169240
|
}
|
|
169236
169241
|
lines.push(`Implementation Steps (in order):`);
|
|
169237
169242
|
context.steps.forEach((step, i) => {
|
|
169243
|
+
let line = `${i + 1}. "${step.instruction}"`;
|
|
169238
169244
|
if (step.resultVariable) {
|
|
169239
|
-
|
|
169240
|
-
|
|
169241
|
-
|
|
169245
|
+
line += ` => const ${step.resultVariable}`;
|
|
169246
|
+
if (step.resultType) {
|
|
169247
|
+
line += `: ${step.resultType}`;
|
|
169248
|
+
}
|
|
169242
169249
|
}
|
|
169250
|
+
lines.push(line);
|
|
169243
169251
|
});
|
|
169244
169252
|
lines.push("");
|
|
169245
169253
|
if (context.ensures.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intend-it/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "Core compiler and AI integration for the Intend programming language",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@intend-it/parser": "^1.1.
|
|
38
|
+
"@intend-it/parser": "^1.1.5",
|
|
39
39
|
"@google/generative-ai": "^0.21.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"typescript": "^5.0.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@intend-it/parser": ">=1.1.
|
|
46
|
+
"@intend-it/parser": ">=1.1.5"
|
|
47
47
|
}
|
|
48
48
|
}
|