editcodewithai 2.1.0 → 2.3.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/dist/index.d.ts +4 -2
- package/dist/index.js +11 -1
- package/dist/prompt.js +3 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { PerformAiEditParams, PerformAiEditResult } from "./types";
|
|
2
|
-
import { FORMAT_INSTRUCTIONS } from "./prompt";
|
|
2
|
+
import { PROMPT_TEMPLATE_VERSION, assembleFullPrompt, FORMAT_INSTRUCTIONS } from "./prompt";
|
|
3
|
+
import { getGenerationMetadata } from "./metadata";
|
|
4
|
+
import { prepareFilesForPrompt, mergeFileChanges, parseDiffs, applyDiffs, parseDiffFenced, parseUdiffs, applyUdiffs } from "./fileUtils";
|
|
3
5
|
export type { LlmFunction, PerformAiEditParams, PerformAiEditResult, EditFormat, } from "./types";
|
|
4
|
-
export { FORMAT_INSTRUCTIONS };
|
|
6
|
+
export { FORMAT_INSTRUCTIONS, mergeFileChanges, prepareFilesForPrompt, parseDiffs, applyDiffs, parseDiffFenced, parseUdiffs, applyUdiffs, assembleFullPrompt, getGenerationMetadata, PROMPT_TEMPLATE_VERSION, };
|
|
5
7
|
/**
|
|
6
8
|
* Core AI logic for:
|
|
7
9
|
* - Building the prompt (including context)
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FORMAT_INSTRUCTIONS = void 0;
|
|
3
|
+
exports.PROMPT_TEMPLATE_VERSION = exports.getGenerationMetadata = exports.assembleFullPrompt = exports.applyUdiffs = exports.parseUdiffs = exports.parseDiffFenced = exports.applyDiffs = exports.parseDiffs = exports.prepareFilesForPrompt = exports.mergeFileChanges = exports.FORMAT_INSTRUCTIONS = void 0;
|
|
4
4
|
exports.performAiEdit = performAiEdit;
|
|
5
5
|
const llm_code_format_1 = require("llm-code-format");
|
|
6
6
|
const prompt_1 = require("./prompt");
|
|
7
|
+
Object.defineProperty(exports, "PROMPT_TEMPLATE_VERSION", { enumerable: true, get: function () { return prompt_1.PROMPT_TEMPLATE_VERSION; } });
|
|
8
|
+
Object.defineProperty(exports, "assembleFullPrompt", { enumerable: true, get: function () { return prompt_1.assembleFullPrompt; } });
|
|
7
9
|
Object.defineProperty(exports, "FORMAT_INSTRUCTIONS", { enumerable: true, get: function () { return prompt_1.FORMAT_INSTRUCTIONS; } });
|
|
8
10
|
const metadata_1 = require("./metadata");
|
|
11
|
+
Object.defineProperty(exports, "getGenerationMetadata", { enumerable: true, get: function () { return metadata_1.getGenerationMetadata; } });
|
|
9
12
|
const fileUtils_1 = require("./fileUtils");
|
|
13
|
+
Object.defineProperty(exports, "prepareFilesForPrompt", { enumerable: true, get: function () { return fileUtils_1.prepareFilesForPrompt; } });
|
|
14
|
+
Object.defineProperty(exports, "mergeFileChanges", { enumerable: true, get: function () { return fileUtils_1.mergeFileChanges; } });
|
|
15
|
+
Object.defineProperty(exports, "parseDiffs", { enumerable: true, get: function () { return fileUtils_1.parseDiffs; } });
|
|
16
|
+
Object.defineProperty(exports, "applyDiffs", { enumerable: true, get: function () { return fileUtils_1.applyDiffs; } });
|
|
17
|
+
Object.defineProperty(exports, "parseDiffFenced", { enumerable: true, get: function () { return fileUtils_1.parseDiffFenced; } });
|
|
18
|
+
Object.defineProperty(exports, "parseUdiffs", { enumerable: true, get: function () { return fileUtils_1.parseUdiffs; } });
|
|
19
|
+
Object.defineProperty(exports, "applyUdiffs", { enumerable: true, get: function () { return fileUtils_1.applyUdiffs; } });
|
|
10
20
|
const debug = false;
|
|
11
21
|
/**
|
|
12
22
|
* Core AI logic for:
|
package/dist/prompt.js
CHANGED
|
@@ -22,7 +22,9 @@ exports.FORMAT_INSTRUCTIONS = {
|
|
|
22
22
|
"**fileToDelete.js**\n\n```\n```\n\n",
|
|
23
23
|
"For D3 logic, make sure it remains idempotent (use data joins), ",
|
|
24
24
|
"and prefer function signatures like `someFunction(selection, options)` ",
|
|
25
|
-
"where `selection` is a D3 selection and `options` is an object
|
|
25
|
+
"where `selection` is a D3 selection and `options` is an object. ",
|
|
26
|
+
'Only import from the top-level `"d3"` module, not from submodules ',
|
|
27
|
+
'(e.g. imports from `"d3-scale"` or `"d3-shape"` are not supported).\n\n',
|
|
26
28
|
].join(""),
|
|
27
29
|
diff: [
|
|
28
30
|
"## Formatting Instructions\n\n",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "editcodewithai",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Edit Code With AI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@vizhub/viz-types": "^0.3.0",
|
|
44
44
|
"@vizhub/viz-utils": "^1.3.0",
|
|
45
45
|
"dotenv": "^17.2.0",
|
|
46
|
-
"llm-code-format": "^
|
|
46
|
+
"llm-code-format": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@langchain/core": "^0.3.66",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"langchain": "^0.3.30",
|
|
52
52
|
"cors": "^2.8.5",
|
|
53
53
|
"express": "^5.1.0",
|
|
54
|
-
"npm-check-updates": "^18.0.
|
|
54
|
+
"npm-check-updates": "^18.0.2",
|
|
55
55
|
"prettier": "^3.6.2",
|
|
56
|
-
"puppeteer": "^24.
|
|
56
|
+
"puppeteer": "^24.15.0",
|
|
57
57
|
"ts-node": "^10.9.2",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vitest": "^3.2.4"
|