@proteinjs/conversation 1.0.1 → 1.0.3
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/CHANGELOG.md +16 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/src/CodegenConversation.d.ts +13 -0
- package/dist/src/CodegenConversation.d.ts.map +1 -0
- package/dist/src/CodegenConversation.js +128 -57
- package/dist/src/CodegenConversation.js.map +1 -0
- package/dist/src/Conversation.d.ts +60 -0
- package/dist/src/Conversation.d.ts.map +1 -0
- package/dist/src/Conversation.js +202 -102
- package/dist/src/Conversation.js.map +1 -0
- package/dist/src/ConversationModule.d.ts +12 -0
- package/dist/src/ConversationModule.d.ts.map +1 -0
- package/dist/src/ConversationModule.js +1 -0
- package/dist/src/ConversationModule.js.map +1 -0
- package/dist/src/Function.d.ts +7 -0
- package/dist/src/Function.d.ts.map +1 -0
- package/dist/src/Function.js +1 -0
- package/dist/src/Function.js.map +1 -0
- package/dist/src/OpenAi.d.ts +18 -0
- package/dist/src/OpenAi.d.ts.map +1 -0
- package/dist/src/OpenAi.js +265 -169
- package/dist/src/OpenAi.js.map +1 -0
- package/dist/src/Paragraph.d.ts +7 -0
- package/dist/src/Paragraph.d.ts.map +1 -0
- package/dist/src/Paragraph.js +9 -7
- package/dist/src/Paragraph.js.map +1 -0
- package/dist/src/Sentence.d.ts +6 -0
- package/dist/src/Sentence.d.ts.map +1 -0
- package/dist/src/Sentence.js +10 -8
- package/dist/src/Sentence.js.map +1 -0
- package/dist/src/code_template/Code.d.ts +24 -0
- package/dist/src/code_template/Code.d.ts.map +1 -0
- package/dist/src/code_template/Code.js +57 -22
- package/dist/src/code_template/Code.js.map +1 -0
- package/dist/src/code_template/CodeTemplate.d.ts +18 -0
- package/dist/src/code_template/CodeTemplate.d.ts.map +1 -0
- package/dist/src/code_template/CodeTemplate.js +68 -20
- package/dist/src/code_template/CodeTemplate.js.map +1 -0
- package/dist/src/code_template/CodeTemplateModule.d.ts +11 -0
- package/dist/src/code_template/CodeTemplateModule.d.ts.map +1 -0
- package/dist/src/code_template/CodeTemplateModule.js +20 -16
- package/dist/src/code_template/CodeTemplateModule.js.map +1 -0
- package/dist/src/code_template/Repo.d.ts +50 -0
- package/dist/src/code_template/Repo.d.ts.map +1 -0
- package/dist/src/code_template/Repo.js +161 -80
- package/dist/src/code_template/Repo.js.map +1 -0
- package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts +24 -0
- package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts.map +1 -0
- package/dist/src/fs/conversation_fs/ConversationFsModerator.js +45 -36
- package/dist/src/fs/conversation_fs/ConversationFsModerator.js.map +1 -0
- package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts +18 -0
- package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts.map +1 -0
- package/dist/src/fs/conversation_fs/ConversationFsModule.js +84 -41
- package/dist/src/fs/conversation_fs/ConversationFsModule.js.map +1 -0
- package/dist/src/fs/conversation_fs/FsFunctions.d.ts +82 -0
- package/dist/src/fs/conversation_fs/FsFunctions.d.ts.map +1 -0
- package/dist/src/fs/conversation_fs/FsFunctions.js +105 -30
- package/dist/src/fs/conversation_fs/FsFunctions.js.map +1 -0
- package/dist/src/fs/git/GitModule.d.ts +14 -0
- package/dist/src/fs/git/GitModule.d.ts.map +1 -0
- package/dist/src/fs/git/GitModule.js +65 -24
- package/dist/src/fs/git/GitModule.js.map +1 -0
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts +23 -0
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts.map +1 -0
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js +35 -5
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js.map +1 -0
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts +34 -0
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts.map +1 -0
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js +107 -50
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js.map +1 -0
- package/dist/src/fs/package/PackageFunctions.d.ts +79 -0
- package/dist/src/fs/package/PackageFunctions.d.ts.map +1 -0
- package/dist/src/fs/package/PackageFunctions.js +78 -16
- package/dist/src/fs/package/PackageFunctions.js.map +1 -0
- package/dist/src/fs/package/PackageModule.d.ts +34 -0
- package/dist/src/fs/package/PackageModule.d.ts.map +1 -0
- package/dist/src/fs/package/PackageModule.js +135 -62
- package/dist/src/fs/package/PackageModule.js.map +1 -0
- package/dist/src/history/MessageHistory.d.ts +17 -0
- package/dist/src/history/MessageHistory.d.ts.map +1 -0
- package/dist/src/history/MessageHistory.js +25 -22
- package/dist/src/history/MessageHistory.js.map +1 -0
- package/dist/src/history/MessageModerator.d.ts +5 -0
- package/dist/src/history/MessageModerator.d.ts.map +1 -0
- package/dist/src/history/MessageModerator.js +1 -0
- package/dist/src/history/MessageModerator.js.map +1 -0
- package/dist/src/template/ConversationTemplate.d.ts +12 -0
- package/dist/src/template/ConversationTemplate.d.ts.map +1 -0
- package/dist/src/template/ConversationTemplate.js +1 -0
- package/dist/src/template/ConversationTemplate.js.map +1 -0
- package/dist/src/template/ConversationTemplateFunctions.d.ts +44 -0
- package/dist/src/template/ConversationTemplateFunctions.d.ts.map +1 -0
- package/dist/src/template/ConversationTemplateFunctions.js +39 -4
- package/dist/src/template/ConversationTemplateFunctions.js.map +1 -0
- package/dist/src/template/ConversationTemplateModule.d.ts +65 -0
- package/dist/src/template/ConversationTemplateModule.d.ts.map +1 -0
- package/dist/src/template/ConversationTemplateModule.js +92 -47
- package/dist/src/template/ConversationTemplateModule.js.map +1 -0
- package/dist/src/template/createApp/CreateAppTemplate.d.ts +3 -0
- package/dist/src/template/createApp/CreateAppTemplate.d.ts.map +1 -0
- package/dist/src/template/createApp/CreateAppTemplate.js +44 -14
- package/dist/src/template/createApp/CreateAppTemplate.js.map +1 -0
- package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts +3 -0
- package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts.map +1 -0
- package/dist/src/template/createCode/CreateCodeConversationTemplate.js +56 -26
- package/dist/src/template/createCode/CreateCodeConversationTemplate.js.map +1 -0
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts +3 -0
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts.map +1 -0
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.js +63 -26
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.js.map +1 -0
- package/dist/test/createKeywordFilesIndex.test.d.ts +2 -0
- package/dist/test/createKeywordFilesIndex.test.d.ts.map +1 -0
- package/dist/test/createKeywordFilesIndex.test.js +37 -6
- package/dist/test/createKeywordFilesIndex.test.js.map +1 -0
- package/dist/test/openai/openai.generateList.test.d.ts +2 -0
- package/dist/test/openai/openai.generateList.test.d.ts.map +1 -0
- package/dist/test/openai/openai.generateList.test.js +43 -5
- package/dist/test/openai/openai.generateList.test.js.map +1 -0
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.d.ts +2 -0
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.d.ts.map +1 -0
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.js +11 -10
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.js.map +1 -0
- package/dist/test/repo/repo.test.d.ts +2 -0
- package/dist/test/repo/repo.test.d.ts.map +1 -0
- package/dist/test/repo/repo.test.js +33 -4
- package/dist/test/repo/repo.test.js.map +1 -0
- package/package.json +4 -3
- package/tsconfig.json +20 -106
- package/dist/jest.config.js +0 -10
- package/dist/src/template/createPackage/jest.config.js +0 -10
- package/dist/test/setup.js +0 -1
|
@@ -8,6 +8,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
11
38
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
39
|
var t = {};
|
|
13
40
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -24,104 +51,158 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
51
|
};
|
|
25
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
53
|
exports.RepoFactory = exports.Repo = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
var util_1 = require("@proteinjs/util");
|
|
55
|
+
var util_node_1 = require("@proteinjs/util-node");
|
|
56
|
+
var promises_1 = __importDefault(require("fs/promises"));
|
|
57
|
+
var path_1 = __importDefault(require("path"));
|
|
58
|
+
var Repo = /** @class */ (function () {
|
|
59
|
+
function Repo(params) {
|
|
33
60
|
this.logger = new util_1.Logger(this.constructor.name);
|
|
34
61
|
this.params = params;
|
|
35
62
|
}
|
|
36
|
-
packages() {
|
|
63
|
+
Repo.prototype.packages = function () {
|
|
37
64
|
return this.params.packages;
|
|
38
|
-
}
|
|
39
|
-
slimPackages() {
|
|
65
|
+
};
|
|
66
|
+
Repo.prototype.slimPackages = function () {
|
|
40
67
|
return this.params.slimPackages;
|
|
41
|
-
}
|
|
42
|
-
tsFiles() {
|
|
68
|
+
};
|
|
69
|
+
Repo.prototype.tsFiles = function () {
|
|
43
70
|
return this.params.tsFiles;
|
|
44
|
-
}
|
|
45
|
-
keywordFilesIndex() {
|
|
71
|
+
};
|
|
72
|
+
Repo.prototype.keywordFilesIndex = function () {
|
|
46
73
|
return this.params.keywordFilesIndex;
|
|
47
|
-
}
|
|
48
|
-
searchFiles(params) {
|
|
49
|
-
this.logger.info(
|
|
50
|
-
|
|
74
|
+
};
|
|
75
|
+
Repo.prototype.searchFiles = function (params) {
|
|
76
|
+
this.logger.info("Searching for file, keyword: ".concat(params.keyword));
|
|
77
|
+
var filePaths = this.keywordFilesIndex()[params.keyword];
|
|
51
78
|
return filePaths || [];
|
|
52
|
-
}
|
|
53
|
-
getDeclarations(params) {
|
|
54
|
-
|
|
55
|
-
for (
|
|
79
|
+
};
|
|
80
|
+
Repo.prototype.getDeclarations = function (params) {
|
|
81
|
+
var queriedDeclarations = {};
|
|
82
|
+
for (var _i = 0, _a = params.tsFilePaths; _i < _a.length; _i++) {
|
|
83
|
+
var tsFilePath = _a[_i];
|
|
56
84
|
queriedDeclarations[tsFilePath] = this.params.tsFiles[tsFilePath].declaration;
|
|
57
|
-
this.logger.info(
|
|
85
|
+
this.logger.info("Accessed declaration: ".concat(tsFilePath));
|
|
58
86
|
}
|
|
59
87
|
return queriedDeclarations;
|
|
60
|
-
}
|
|
61
|
-
|
|
88
|
+
};
|
|
89
|
+
return Repo;
|
|
90
|
+
}());
|
|
62
91
|
exports.Repo = Repo;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
92
|
+
var RepoFactory = /** @class */ (function () {
|
|
93
|
+
function RepoFactory() {
|
|
94
|
+
}
|
|
95
|
+
RepoFactory.createRepo = function (dir) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
68
97
|
function traverse(dir) {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
98
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
99
|
+
var childrenNames, hasPackageJson, packageContent, packageJSON, _i, childrenNames_1, dirent, childPath;
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
switch (_a.label) {
|
|
102
|
+
case 0: return [4 /*yield*/, promises_1.default.readdir(dir, { withFileTypes: true })];
|
|
103
|
+
case 1:
|
|
104
|
+
childrenNames = _a.sent();
|
|
105
|
+
hasPackageJson = childrenNames.some(function (dirent) { return dirent.name === 'package.json'; });
|
|
106
|
+
if (!hasPackageJson) return [3 /*break*/, 3];
|
|
107
|
+
return [4 /*yield*/, promises_1.default.readFile(path_1.default.join(dir, 'package.json'), 'utf-8')];
|
|
108
|
+
case 2:
|
|
109
|
+
packageContent = _a.sent();
|
|
110
|
+
packageJSON = JSON.parse(packageContent);
|
|
111
|
+
repoParams.packages[packageJSON.name] = {
|
|
112
|
+
packageJSON: packageJSON,
|
|
113
|
+
dirPath: dir,
|
|
114
|
+
fileDescriptors: [],
|
|
115
|
+
tsFiles: {},
|
|
116
|
+
};
|
|
117
|
+
_a.label = 3;
|
|
118
|
+
case 3:
|
|
119
|
+
_i = 0, childrenNames_1 = childrenNames;
|
|
120
|
+
_a.label = 4;
|
|
121
|
+
case 4:
|
|
122
|
+
if (!(_i < childrenNames_1.length)) return [3 /*break*/, 7];
|
|
123
|
+
dirent = childrenNames_1[_i];
|
|
124
|
+
if (!dirent.isDirectory())
|
|
125
|
+
return [3 /*break*/, 6];
|
|
126
|
+
// Exclude directories 'node_modules' and 'dist' right at the beginning
|
|
127
|
+
if (dirent.name.includes('node_modules') || dirent.name.includes('dist')) {
|
|
128
|
+
return [3 /*break*/, 6];
|
|
129
|
+
}
|
|
130
|
+
childPath = path_1.default.join(dir, dirent.name);
|
|
131
|
+
return [4 /*yield*/, traverse(childPath)];
|
|
132
|
+
case 5:
|
|
133
|
+
_a.sent();
|
|
134
|
+
_a.label = 6;
|
|
135
|
+
case 6:
|
|
136
|
+
_i++;
|
|
137
|
+
return [3 /*break*/, 4];
|
|
138
|
+
case 7: return [2 /*return*/];
|
|
88
139
|
}
|
|
89
|
-
|
|
90
|
-
const childPath = path_1.default.join(dir, dirent.name);
|
|
91
|
-
yield traverse(childPath);
|
|
92
|
-
}
|
|
140
|
+
});
|
|
93
141
|
});
|
|
94
142
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
143
|
+
var repoParams;
|
|
144
|
+
return __generator(this, function (_a) {
|
|
145
|
+
switch (_a.label) {
|
|
146
|
+
case 0:
|
|
147
|
+
this.LOGGER.info("Creating repo for dir: ".concat(dir));
|
|
148
|
+
repoParams = { packages: {}, slimPackages: {}, tsFiles: {}, keywordFilesIndex: {} };
|
|
149
|
+
return [4 /*yield*/, traverse(dir)];
|
|
150
|
+
case 1:
|
|
151
|
+
_a.sent();
|
|
152
|
+
return [4 /*yield*/, RepoFactory.loadFiles(repoParams)];
|
|
153
|
+
case 2:
|
|
154
|
+
_a.sent();
|
|
155
|
+
Object.keys(repoParams.packages).forEach(function (packageName) {
|
|
156
|
+
var _a = repoParams.packages[packageName], packageJSON = _a.packageJSON, tsFiles = _a.tsFiles, slimPackage = __rest(_a, ["packageJSON", "tsFiles"]);
|
|
157
|
+
repoParams.slimPackages[packageName] = slimPackage;
|
|
158
|
+
});
|
|
159
|
+
this.LOGGER.info("Created repo for dir: ".concat(dir));
|
|
160
|
+
return [2 /*return*/, new Repo(repoParams)];
|
|
161
|
+
}
|
|
100
162
|
});
|
|
101
|
-
this.LOGGER.info(`Created repo for dir: ${dir}`);
|
|
102
|
-
return new Repo(repoParams);
|
|
103
163
|
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return __awaiter(this, void 0, void 0, function
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
164
|
+
};
|
|
165
|
+
RepoFactory.loadFiles = function (repoParams) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
167
|
+
var _i, _a, packageName, dirPath, _b, _c, _d, _e, _f, fileDescriptor, typescriptDeclaration, tsFile;
|
|
168
|
+
var _g;
|
|
169
|
+
return __generator(this, function (_h) {
|
|
170
|
+
switch (_h.label) {
|
|
171
|
+
case 0:
|
|
172
|
+
_i = 0, _a = Object.keys(repoParams.packages);
|
|
173
|
+
_h.label = 1;
|
|
174
|
+
case 1:
|
|
175
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
176
|
+
packageName = _a[_i];
|
|
177
|
+
this.LOGGER.info("Loading files for package: ".concat(packageName));
|
|
178
|
+
dirPath = repoParams.packages[packageName].dirPath;
|
|
179
|
+
if (!dirPath) return [3 /*break*/, 3];
|
|
180
|
+
_c = (_b = (_g = repoParams.packages[packageName].fileDescriptors).push).apply;
|
|
181
|
+
_d = [_g];
|
|
182
|
+
return [4 /*yield*/, util_node_1.Fs.getFilesInDirectory(dirPath, ['node_modules', 'dist'])];
|
|
183
|
+
case 2:
|
|
184
|
+
_c.apply(_b, _d.concat([_h.sent()]));
|
|
185
|
+
for (_e = 0, _f = repoParams.packages[packageName].fileDescriptors; _e < _f.length; _e++) {
|
|
186
|
+
fileDescriptor = _f[_e];
|
|
187
|
+
typescriptDeclaration = util_node_1.PackageUtil.generateTypescriptDeclarations({ tsFilePaths: [fileDescriptor.path] })[fileDescriptor.path];
|
|
188
|
+
tsFile = Object.assign({ declaration: typescriptDeclaration }, fileDescriptor);
|
|
189
|
+
repoParams.packages[packageName].tsFiles[fileDescriptor.path] = tsFile;
|
|
190
|
+
repoParams.tsFiles[fileDescriptor.path] = tsFile;
|
|
191
|
+
if (!repoParams.keywordFilesIndex[fileDescriptor.nameWithoutExtension])
|
|
192
|
+
repoParams.keywordFilesIndex[fileDescriptor.nameWithoutExtension] = [];
|
|
193
|
+
repoParams.keywordFilesIndex[fileDescriptor.nameWithoutExtension].push(fileDescriptor.path);
|
|
194
|
+
}
|
|
195
|
+
_h.label = 3;
|
|
196
|
+
case 3:
|
|
197
|
+
_i++;
|
|
198
|
+
return [3 /*break*/, 1];
|
|
199
|
+
case 4: return [2 /*return*/];
|
|
121
200
|
}
|
|
122
|
-
}
|
|
201
|
+
});
|
|
123
202
|
});
|
|
124
|
-
}
|
|
125
|
-
|
|
203
|
+
};
|
|
204
|
+
RepoFactory.LOGGER = new util_1.Logger('RepoFactory');
|
|
205
|
+
return RepoFactory;
|
|
206
|
+
}());
|
|
126
207
|
exports.RepoFactory = RepoFactory;
|
|
127
|
-
|
|
208
|
+
//# sourceMappingURL=Repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Repo.js","sourceRoot":"","sources":["../../../src/code_template/Repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyC;AACzC,kDAAuE;AACvE,yDAA6B;AAC7B,8CAAwB;AAsBxB;IAIE,cAAY,MAAkB;QAHtB,WAAM,GAAG,IAAI,aAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAIjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,uBAAQ,GAAR;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED,2BAAY,GAAZ;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;IAClC,CAAC;IAED,sBAAO,GAAP;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IAC7B,CAAC;IAED,gCAAiB,GAAjB;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAED,0BAAW,GAAX,UAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAgC,MAAM,CAAC,OAAO,CAAE,CAAC,CAAC;QACnE,IAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC,OAA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C,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC;gCACpE,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,GAAG,EAAE,CAAC;4BAEzE,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;yBAC7F;;;wBAdmB,IAAgC,CAAA;;;;;;KAiBzD;IA/Dc,kBAAM,GAAG,IAAI,aAAM,CAAC,aAAa,CAAC,CAAC;IAyFpD,kBAAC;CAAA,AA1FD,IA0FC;AA1FY,kCAAW"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LogLevel } from '@proteinjs/util';
|
|
2
|
+
import { FileContentMap } from '@proteinjs/util-node';
|
|
3
|
+
import { ChatCompletionMessageParam } from 'openai/resources/chat';
|
|
4
|
+
import { MessageModerator } from '../../history/MessageModerator';
|
|
5
|
+
export interface ConversationFs {
|
|
6
|
+
fileContentMap: FileContentMap;
|
|
7
|
+
order: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface ConversationFsFactoryParams {
|
|
10
|
+
maxFiles: number;
|
|
11
|
+
logLevel: LogLevel;
|
|
12
|
+
}
|
|
13
|
+
export declare class ConversationFsFactory {
|
|
14
|
+
private logger;
|
|
15
|
+
private params;
|
|
16
|
+
constructor(params?: Partial<ConversationFsFactoryParams>);
|
|
17
|
+
merge(existingFs: ConversationFs, updates: FileContentMap): ConversationFs;
|
|
18
|
+
}
|
|
19
|
+
export declare class ConversationFsModerator implements MessageModerator {
|
|
20
|
+
private logLevel;
|
|
21
|
+
constructor(logLevel?: LogLevel);
|
|
22
|
+
observe(messages: ChatCompletionMessageParam[]): ChatCompletionMessageParam[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ConversationFsModerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationFsModerator.d.ts","sourceRoot":"","sources":["../../../../src/fs/conversation_fs/ConversationFsModerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAA8B;gBAEhC,MAAM,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC;IAKzD,KAAK,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,GAAG,cAAc;CA6B3E;AAED,qBAAa,uBAAwB,YAAW,gBAAgB;IAC9D,OAAO,CAAC,QAAQ,CAAoB;gBAExB,QAAQ,CAAC,EAAE,QAAQ;IAK/B,OAAO,CAAC,QAAQ,EAAE,0BAA0B,EAAE,GAAG,0BAA0B,EAAE;CAyD9E"}
|
|
@@ -1,58 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConversationFsModerator = exports.ConversationFsFactory = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var util_1 = require("@proteinjs/util");
|
|
5
|
+
var ConversationFsFactory = /** @class */ (function () {
|
|
6
|
+
function ConversationFsFactory(params) {
|
|
7
7
|
this.params = Object.assign({ maxFiles: 3, logLevel: 'info' }, params);
|
|
8
8
|
this.logger = new util_1.Logger(this.constructor.name, this.params.logLevel);
|
|
9
9
|
}
|
|
10
|
-
merge(existingFs, updates) {
|
|
11
|
-
|
|
10
|
+
ConversationFsFactory.prototype.merge = function (existingFs, updates) {
|
|
11
|
+
var _loop_1 = function (filePath) {
|
|
12
12
|
// if the file already exists in the fs
|
|
13
13
|
if (existingFs.fileContentMap[filePath]) {
|
|
14
|
-
|
|
14
|
+
this_1.logger.debug("Updating existing file: ".concat(filePath));
|
|
15
15
|
existingFs.fileContentMap[filePath] = updates[filePath];
|
|
16
|
-
|
|
16
|
+
var oldIndex = existingFs.order.findIndex(function (item) { return item == filePath; });
|
|
17
17
|
existingFs.order.splice(oldIndex, 1);
|
|
18
18
|
existingFs.order.push(filePath);
|
|
19
|
-
continue;
|
|
19
|
+
return "continue";
|
|
20
20
|
}
|
|
21
21
|
// if we have less than the max number of files in the fs
|
|
22
|
-
if (Object.keys(existingFs.fileContentMap).length <
|
|
23
|
-
|
|
22
|
+
if (Object.keys(existingFs.fileContentMap).length < this_1.params.maxFiles) {
|
|
23
|
+
this_1.logger.debug("Adding new file (under limit): ".concat(filePath));
|
|
24
24
|
existingFs.fileContentMap[filePath] = updates[filePath];
|
|
25
25
|
existingFs.order.push(filePath);
|
|
26
|
-
continue;
|
|
26
|
+
return "continue";
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
this_1.logger.debug("Adding new file (over limit): ".concat(filePath));
|
|
30
|
+
var removedFilePath = existingFs.order.splice(0, 1)[0];
|
|
31
31
|
delete existingFs.fileContentMap[removedFilePath];
|
|
32
32
|
existingFs.fileContentMap[filePath] = updates[filePath];
|
|
33
33
|
existingFs.order.push(filePath);
|
|
34
34
|
}
|
|
35
|
+
};
|
|
36
|
+
var this_1 = this;
|
|
37
|
+
for (var _i = 0, _a = Object.keys(updates); _i < _a.length; _i++) {
|
|
38
|
+
var filePath = _a[_i];
|
|
39
|
+
_loop_1(filePath);
|
|
35
40
|
}
|
|
36
41
|
return existingFs;
|
|
37
|
-
}
|
|
38
|
-
|
|
42
|
+
};
|
|
43
|
+
return ConversationFsFactory;
|
|
44
|
+
}());
|
|
39
45
|
exports.ConversationFsFactory = ConversationFsFactory;
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
var ConversationFsModerator = /** @class */ (function () {
|
|
47
|
+
function ConversationFsModerator(logLevel) {
|
|
42
48
|
this.logLevel = 'info';
|
|
43
49
|
if (logLevel)
|
|
44
50
|
this.logLevel = logLevel;
|
|
45
51
|
}
|
|
46
|
-
observe(messages) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (
|
|
53
|
-
|
|
52
|
+
ConversationFsModerator.prototype.observe = function (messages) {
|
|
53
|
+
var conversationFileSystemMessageIndex = -1;
|
|
54
|
+
var conversationFileSystem;
|
|
55
|
+
var readFilesFunctionCallMessageIndexes = [];
|
|
56
|
+
var writeFilesFunctionCallMessageIndexes = [];
|
|
57
|
+
var readFilesConsolidatedOutput = {}; // newest version of file wins
|
|
58
|
+
for (var i = 0; i < messages.length; i++) {
|
|
59
|
+
var message = messages[i];
|
|
54
60
|
if (message.role == 'system' && message.content) {
|
|
55
|
-
|
|
61
|
+
var parsedContent = void 0;
|
|
56
62
|
try {
|
|
57
63
|
parsedContent = JSON.parse(message.content);
|
|
58
64
|
}
|
|
@@ -64,14 +70,15 @@ class ConversationFsModerator {
|
|
|
64
70
|
continue;
|
|
65
71
|
}
|
|
66
72
|
if (message.role == 'function' && message.name == 'readFiles' && message.content) {
|
|
67
|
-
|
|
73
|
+
var parsedContent = void 0;
|
|
68
74
|
try {
|
|
69
75
|
parsedContent = JSON.parse(message.content);
|
|
70
76
|
}
|
|
71
77
|
catch (error) { }
|
|
72
78
|
if (!parsedContent)
|
|
73
79
|
continue;
|
|
74
|
-
for (
|
|
80
|
+
for (var _i = 0, _a = Object.keys(parsedContent); _i < _a.length; _i++) {
|
|
81
|
+
var filePath = _a[_i];
|
|
75
82
|
readFilesConsolidatedOutput[filePath] = parsedContent[filePath];
|
|
76
83
|
}
|
|
77
84
|
readFilesFunctionCallMessageIndexes.push(i);
|
|
@@ -82,18 +89,20 @@ class ConversationFsModerator {
|
|
|
82
89
|
}
|
|
83
90
|
if (conversationFileSystem) {
|
|
84
91
|
conversationFileSystem = new ConversationFsFactory({ logLevel: this.logLevel }).merge(conversationFileSystem, readFilesConsolidatedOutput);
|
|
85
|
-
|
|
92
|
+
var content = JSON.stringify({ fileSystem: conversationFileSystem });
|
|
86
93
|
messages[conversationFileSystemMessageIndex].content = content;
|
|
87
94
|
}
|
|
88
95
|
else {
|
|
89
96
|
conversationFileSystem = { fileContentMap: readFilesConsolidatedOutput, order: Object.keys(readFilesConsolidatedOutput) };
|
|
90
|
-
messages.push({ role: 'system', content:
|
|
91
|
-
|
|
92
|
-
messages.push({ role: 'system', content });
|
|
97
|
+
messages.push({ role: 'system', content: "Whenever you make a call to readFiles, the file content will be loaded into the { fileSystem } object in the message history. Do not respond with fileSystem's content in a message." });
|
|
98
|
+
var content = JSON.stringify({ fileSystem: conversationFileSystem });
|
|
99
|
+
messages.push({ role: 'system', content: content });
|
|
93
100
|
}
|
|
94
|
-
|
|
95
|
-
.filter((message, i)
|
|
101
|
+
var moderatedMessages = messages
|
|
102
|
+
.filter(function (message, i) { return !readFilesFunctionCallMessageIndexes.includes(i) && !writeFilesFunctionCallMessageIndexes.includes(i); });
|
|
96
103
|
return moderatedMessages;
|
|
97
|
-
}
|
|
98
|
-
|
|
104
|
+
};
|
|
105
|
+
return ConversationFsModerator;
|
|
106
|
+
}());
|
|
99
107
|
exports.ConversationFsModerator = ConversationFsModerator;
|
|
108
|
+
//# sourceMappingURL=ConversationFsModerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationFsModerator.js","sourceRoot":"","sources":["../../../../src/fs/conversation_fs/ConversationFsModerator.ts"],"names":[],"mappings":";;;AAAA,wCAAmD;AAenD;IAIE,+BAAY,MAA6C;QACvD,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E,sBAAsB,EAAE,CAAC,CAAC;YACvE,QAAQ,CAAC,kCAAkC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC;SAChE;aAAM;YACL,sBAAsB,GAAG,EAAE,cAAc,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC;YAC1H,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,sLAAsL,EAAE,CAAC,CAAC;YACnO,IAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,sBAAsB,EAAE,CAAC,CAAC;YACvE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;SAC5C;QAED,IAAM,iBAAiB,GAAG,QAAQ;aAC/B,MAAM,CAAC,UAAC,OAAO,EAAE,CAAC,IAAK,OAAA,CAAC,mCAAmC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,oCAAoC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAArG,CAAqG,CAAC,CAC/H;QACD,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACH,8BAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,0DAAuB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConversationModule, ConversationModuleFactory } from '../../ConversationModule';
|
|
2
|
+
import { Function } from '../../Function';
|
|
3
|
+
import { ConversationFsModerator } from './ConversationFsModerator';
|
|
4
|
+
export declare class ConversationFsModule implements ConversationModule {
|
|
5
|
+
private repoPath;
|
|
6
|
+
private recentlyAccessedFilePaths;
|
|
7
|
+
constructor(repoPath: string);
|
|
8
|
+
getName(): string;
|
|
9
|
+
getSystemMessages(): string[];
|
|
10
|
+
getFunctions(): Function[];
|
|
11
|
+
getMessageModerators(): ConversationFsModerator[];
|
|
12
|
+
pushRecentlyAccessedFilePath(filePaths: string[]): void;
|
|
13
|
+
getRecentlyAccessedFilePaths(): string[];
|
|
14
|
+
}
|
|
15
|
+
export declare class ConversationFsModuleFactory implements ConversationModuleFactory {
|
|
16
|
+
createModule(repoPath: string): Promise<ConversationFsModule>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ConversationFsModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationFsModule.d.ts","sourceRoot":"","sources":["../../../../src/fs/conversation_fs/ConversationFsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,yBAAyB,CAAgB;gBAErC,QAAQ,EAAE,MAAM;IAI5B,OAAO,IAAI,MAAM;IAIjB,iBAAiB,IAAI,MAAM,EAAE;IAgB7B,YAAY,IAAI,QAAQ,EAAE;IAS1B,oBAAoB;IAMpB,4BAA4B,CAAC,SAAS,EAAE,MAAM,EAAE;IAIhD,4BAA4B;CAG7B;AAED,qBAAa,2BAA4B,YAAW,yBAAyB;IACrE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAGpE"}
|