@proteinjs/conversation 1.0.5 → 1.0.7
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/.eslintrc.js +20 -0
- package/.prettierrc +8 -0
- package/CHANGELOG.md +7 -4
- package/LICENSE +21 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +40 -28
- package/dist/src/CodegenConversation.d.ts +11 -11
- package/dist/src/CodegenConversation.d.ts.map +1 -1
- package/dist/src/CodegenConversation.js +294 -180
- package/dist/src/CodegenConversation.js.map +1 -1
- package/dist/src/Conversation.d.ts +52 -49
- package/dist/src/Conversation.d.ts.map +1 -1
- package/dist/src/Conversation.js +480 -274
- package/dist/src/Conversation.js.map +1 -1
- package/dist/src/ConversationModule.d.ts +6 -6
- package/dist/src/ConversationModule.js +3 -3
- package/dist/src/Function.d.ts +4 -4
- package/dist/src/Function.d.ts.map +1 -1
- package/dist/src/Function.js +3 -3
- package/dist/src/OpenAi.d.ts +42 -10
- package/dist/src/OpenAi.d.ts.map +1 -1
- package/dist/src/OpenAi.js +496 -289
- package/dist/src/OpenAi.js.map +1 -1
- package/dist/src/Paragraph.d.ts +4 -4
- package/dist/src/Paragraph.d.ts.map +1 -1
- package/dist/src/Paragraph.js +17 -16
- package/dist/src/Paragraph.js.map +1 -1
- package/dist/src/Sentence.d.ts +4 -4
- package/dist/src/Sentence.d.ts.map +1 -1
- package/dist/src/Sentence.js +21 -19
- package/dist/src/Sentence.js.map +1 -1
- package/dist/src/code_template/Code.d.ts +15 -15
- package/dist/src/code_template/Code.d.ts.map +1 -1
- package/dist/src/code_template/Code.js +167 -69
- package/dist/src/code_template/Code.js.map +1 -1
- package/dist/src/code_template/CodeTemplate.d.ts +11 -11
- package/dist/src/code_template/CodeTemplate.d.ts.map +1 -1
- package/dist/src/code_template/CodeTemplate.js +169 -79
- package/dist/src/code_template/CodeTemplate.js.map +1 -1
- package/dist/src/code_template/CodeTemplateModule.d.ts +6 -6
- package/dist/src/code_template/CodeTemplateModule.js +28 -26
- package/dist/src/code_template/Repo.d.ts +34 -38
- package/dist/src/code_template/Repo.d.ts.map +1 -1
- package/dist/src/code_template/Repo.js +291 -191
- package/dist/src/code_template/Repo.js.map +1 -1
- package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts +12 -12
- package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts.map +1 -1
- package/dist/src/fs/conversation_fs/ConversationFsModerator.js +111 -98
- package/dist/src/fs/conversation_fs/ConversationFsModerator.js.map +1 -1
- package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts +11 -11
- package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts.map +1 -1
- package/dist/src/fs/conversation_fs/ConversationFsModule.js +204 -99
- package/dist/src/fs/conversation_fs/ConversationFsModule.js.map +1 -1
- package/dist/src/fs/conversation_fs/FsFunctions.d.ts +58 -62
- package/dist/src/fs/conversation_fs/FsFunctions.d.ts.map +1 -1
- package/dist/src/fs/conversation_fs/FsFunctions.js +414 -266
- package/dist/src/fs/conversation_fs/FsFunctions.js.map +1 -1
- package/dist/src/fs/git/GitModule.d.ts +8 -8
- package/dist/src/fs/git/GitModule.d.ts.map +1 -1
- package/dist/src/fs/git/GitModule.js +163 -74
- package/dist/src/fs/git/GitModule.js.map +1 -1
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts +16 -18
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts.map +1 -1
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js +158 -58
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js.map +1 -1
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts +27 -26
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts.map +1 -1
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js +234 -133
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js.map +1 -1
- package/dist/src/fs/package/PackageFunctions.d.ts +54 -60
- package/dist/src/fs/package/PackageFunctions.d.ts.map +1 -1
- package/dist/src/fs/package/PackageFunctions.js +366 -223
- package/dist/src/fs/package/PackageFunctions.js.map +1 -1
- package/dist/src/fs/package/PackageModule.d.ts +24 -24
- package/dist/src/fs/package/PackageModule.d.ts.map +1 -1
- package/dist/src/fs/package/PackageModule.js +292 -163
- package/dist/src/fs/package/PackageModule.js.map +1 -1
- package/dist/src/history/MessageHistory.d.ts +12 -12
- package/dist/src/history/MessageHistory.d.ts.map +1 -1
- package/dist/src/history/MessageHistory.js +52 -43
- package/dist/src/history/MessageHistory.js.map +1 -1
- package/dist/src/history/MessageModerator.d.ts +2 -2
- package/dist/src/history/MessageModerator.js +3 -3
- package/dist/src/template/ConversationTemplate.d.ts +8 -8
- package/dist/src/template/ConversationTemplate.d.ts.map +1 -1
- package/dist/src/template/ConversationTemplate.js +3 -3
- package/dist/src/template/ConversationTemplateFunctions.d.ts +33 -35
- package/dist/src/template/ConversationTemplateFunctions.d.ts.map +1 -1
- package/dist/src/template/ConversationTemplateFunctions.js +176 -75
- package/dist/src/template/ConversationTemplateFunctions.js.map +1 -1
- package/dist/src/template/ConversationTemplateModule.d.ts +51 -48
- package/dist/src/template/ConversationTemplateModule.d.ts.map +1 -1
- package/dist/src/template/ConversationTemplateModule.js +211 -114
- package/dist/src/template/ConversationTemplateModule.js.map +1 -1
- package/dist/src/template/createApp/CreateAppTemplate.d.ts +1 -1
- package/dist/src/template/createApp/CreateAppTemplate.js +151 -59
- package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts +1 -1
- package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts.map +1 -1
- package/dist/src/template/createCode/CreateCodeConversationTemplate.js +183 -74
- package/dist/src/template/createCode/CreateCodeConversationTemplate.js.map +1 -1
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts +1 -1
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts.map +1 -1
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.js +174 -84
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.js.map +1 -1
- package/dist/src/template/createPackage/tsconfig.json +11 -11
- package/dist/test/createKeywordFilesIndex.test.d.ts +1 -1
- package/dist/test/createKeywordFilesIndex.test.js +132 -41
- package/dist/test/createKeywordFilesIndex.test.js.map +1 -1
- package/dist/test/openai/openai.generateList.test.d.ts +1 -1
- package/dist/test/openai/openai.generateList.test.js +136 -47
- package/dist/test/openai/openai.generateList.test.js.map +1 -1
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.d.ts +1 -1
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.js +15 -10
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.js.map +1 -1
- package/dist/test/repo/repo.test.d.ts +1 -1
- package/dist/test/repo/repo.test.js +127 -38
- package/dist/test/repo/repo.test.js.map +1 -1
- package/jest.config.js +2 -2
- package/package.json +11 -5
- package/src/CodegenConversation.ts +6 -4
- package/src/Conversation.ts +102 -33
- package/src/ConversationModule.ts +2 -2
- package/src/Function.ts +0 -1
- package/src/OpenAi.ts +128 -63
- package/src/Paragraph.ts +3 -2
- package/src/Sentence.ts +5 -3
- package/src/code_template/Code.ts +25 -19
- package/src/code_template/CodeTemplate.ts +8 -7
- package/src/code_template/CodeTemplateModule.ts +2 -2
- package/src/code_template/Repo.ts +25 -19
- package/src/fs/conversation_fs/ConversationFsModerator.ts +34 -20
- package/src/fs/conversation_fs/ConversationFsModule.ts +13 -7
- package/src/fs/conversation_fs/FsFunctions.ts +33 -44
- package/src/fs/git/GitModule.ts +2 -4
- package/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.ts +31 -31
- package/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.ts +19 -18
- package/src/fs/package/PackageFunctions.ts +34 -41
- package/src/fs/package/PackageModule.ts +33 -21
- package/src/history/MessageHistory.ts +7 -4
- package/src/history/MessageModerator.ts +1 -1
- package/src/template/ConversationTemplate.ts +9 -9
- package/src/template/ConversationTemplateFunctions.ts +8 -7
- package/src/template/ConversationTemplateModule.ts +24 -15
- package/src/template/createApp/CreateAppTemplate.ts +1 -1
- package/src/template/createCode/CreateCodeConversationTemplate.ts +9 -11
- package/src/template/createPackage/CreatePackageConversationTemplate.ts +2 -9
- package/src/template/createPackage/jest.config.js +2 -2
- package/test/createKeywordFilesIndex.test.ts +3 -3
- package/test/openai/openai.generateList.test.ts +5 -3
- package/test/openai/openai.parseCodeFromMarkdown.test.ts +10 -5
- package/test/repo/repo.test.ts +3 -4
- package/tsconfig.json +16 -20
|
@@ -1,208 +1,308 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __awaiter =
|
|
3
|
+
(this && this.__awaiter) ||
|
|
4
|
+
function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) {
|
|
6
|
+
return value instanceof P
|
|
7
|
+
? value
|
|
8
|
+
: new P(function (resolve) {
|
|
9
|
+
resolve(value);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
4
12
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
function fulfilled(value) {
|
|
14
|
+
try {
|
|
15
|
+
step(generator.next(value));
|
|
16
|
+
} catch (e) {
|
|
17
|
+
reject(e);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function rejected(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator['throw'](value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function step(result) {
|
|
28
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
|
+
}
|
|
30
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
31
|
});
|
|
10
|
-
};
|
|
11
|
-
var __generator =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
};
|
|
33
|
+
var __generator =
|
|
34
|
+
(this && this.__generator) ||
|
|
35
|
+
function (thisArg, body) {
|
|
36
|
+
var _ = {
|
|
37
|
+
label: 0,
|
|
38
|
+
sent: function () {
|
|
39
|
+
if (t[0] & 1) throw t[1];
|
|
40
|
+
return t[1];
|
|
41
|
+
},
|
|
42
|
+
trys: [],
|
|
43
|
+
ops: [],
|
|
44
|
+
},
|
|
45
|
+
f,
|
|
46
|
+
y,
|
|
47
|
+
t,
|
|
48
|
+
g;
|
|
49
|
+
return (
|
|
50
|
+
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
|
|
51
|
+
typeof Symbol === 'function' &&
|
|
52
|
+
(g[Symbol.iterator] = function () {
|
|
53
|
+
return this;
|
|
54
|
+
}),
|
|
55
|
+
g
|
|
56
|
+
);
|
|
57
|
+
function verb(n) {
|
|
58
|
+
return function (v) {
|
|
59
|
+
return step([n, v]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
15
62
|
function step(op) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
63
|
+
if (f) throw new TypeError('Generator is already executing.');
|
|
64
|
+
while ((g && ((g = 0), op[0] && (_ = 0)), _))
|
|
65
|
+
try {
|
|
66
|
+
if (
|
|
67
|
+
((f = 1),
|
|
68
|
+
y &&
|
|
69
|
+
(t = op[0] & 2 ? y['return'] : op[0] ? y['throw'] || ((t = y['return']) && t.call(y), 0) : y.next) &&
|
|
70
|
+
!(t = t.call(y, op[1])).done)
|
|
71
|
+
)
|
|
72
|
+
return t;
|
|
73
|
+
if (((y = 0), t)) op = [op[0] & 2, t.value];
|
|
74
|
+
switch (op[0]) {
|
|
75
|
+
case 0:
|
|
76
|
+
case 1:
|
|
77
|
+
t = op;
|
|
78
|
+
break;
|
|
79
|
+
case 4:
|
|
80
|
+
_.label++;
|
|
81
|
+
return { value: op[1], done: false };
|
|
82
|
+
case 5:
|
|
83
|
+
_.label++;
|
|
84
|
+
y = op[1];
|
|
85
|
+
op = [0];
|
|
86
|
+
continue;
|
|
87
|
+
case 7:
|
|
88
|
+
op = _.ops.pop();
|
|
89
|
+
_.trys.pop();
|
|
90
|
+
continue;
|
|
91
|
+
default:
|
|
92
|
+
if (!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && (op[0] === 6 || op[0] === 2)) {
|
|
93
|
+
_ = 0;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
97
|
+
_.label = op[1];
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
101
|
+
_.label = t[1];
|
|
102
|
+
t = op;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (t && _.label < t[2]) {
|
|
106
|
+
_.label = t[2];
|
|
107
|
+
_.ops.push(op);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (t[2]) _.ops.pop();
|
|
111
|
+
_.trys.pop();
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
op = body.call(thisArg, _);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
op = [6, e];
|
|
117
|
+
y = 0;
|
|
118
|
+
} finally {
|
|
119
|
+
f = t = 0;
|
|
120
|
+
}
|
|
121
|
+
if (op[0] & 5) throw op[1];
|
|
122
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
123
|
}
|
|
37
|
-
};
|
|
38
|
-
var __rest =
|
|
124
|
+
};
|
|
125
|
+
var __rest =
|
|
126
|
+
(this && this.__rest) ||
|
|
127
|
+
function (s, e) {
|
|
39
128
|
var t = {};
|
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
t[p[i]] = s[p[i]];
|
|
46
|
-
}
|
|
129
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
130
|
+
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
|
|
131
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
132
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
133
|
+
}
|
|
47
134
|
return t;
|
|
48
|
-
};
|
|
49
|
-
var __importDefault =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
135
|
+
};
|
|
136
|
+
var __importDefault =
|
|
137
|
+
(this && this.__importDefault) ||
|
|
138
|
+
function (mod) {
|
|
139
|
+
return mod && mod.__esModule ? mod : { default: mod };
|
|
140
|
+
};
|
|
141
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
53
142
|
exports.RepoFactory = exports.Repo = void 0;
|
|
54
|
-
var util_1 = require(
|
|
55
|
-
var util_node_1 = require(
|
|
56
|
-
var promises_1 = __importDefault(require(
|
|
57
|
-
var path_1 = __importDefault(require(
|
|
143
|
+
var util_1 = require('@proteinjs/util');
|
|
144
|
+
var util_node_1 = require('@proteinjs/util-node');
|
|
145
|
+
var promises_1 = __importDefault(require('fs/promises'));
|
|
146
|
+
var path_1 = __importDefault(require('path'));
|
|
58
147
|
var Repo = /** @class */ (function () {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
148
|
+
function Repo(params) {
|
|
149
|
+
this.logger = new util_1.Logger(this.constructor.name);
|
|
150
|
+
this.params = params;
|
|
151
|
+
}
|
|
152
|
+
Repo.prototype.packages = function () {
|
|
153
|
+
return this.params.packages;
|
|
154
|
+
};
|
|
155
|
+
Repo.prototype.slimPackages = function () {
|
|
156
|
+
return this.params.slimPackages;
|
|
157
|
+
};
|
|
158
|
+
Repo.prototype.tsFiles = function () {
|
|
159
|
+
return this.params.tsFiles;
|
|
160
|
+
};
|
|
161
|
+
Repo.prototype.keywordFilesIndex = function () {
|
|
162
|
+
return this.params.keywordFilesIndex;
|
|
163
|
+
};
|
|
164
|
+
Repo.prototype.searchFiles = function (params) {
|
|
165
|
+
this.logger.info('Searching for file, keyword: '.concat(params.keyword));
|
|
166
|
+
var filePaths = this.keywordFilesIndex()[params.keyword];
|
|
167
|
+
return filePaths || [];
|
|
168
|
+
};
|
|
169
|
+
Repo.prototype.getDeclarations = function (params) {
|
|
170
|
+
var queriedDeclarations = {};
|
|
171
|
+
for (var _i = 0, _a = params.tsFilePaths; _i < _a.length; _i++) {
|
|
172
|
+
var tsFilePath = _a[_i];
|
|
173
|
+
queriedDeclarations[tsFilePath] = this.params.tsFiles[tsFilePath].declaration;
|
|
174
|
+
this.logger.info('Accessed declaration: '.concat(tsFilePath));
|
|
62
175
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return this.params.slimPackages;
|
|
68
|
-
};
|
|
69
|
-
Repo.prototype.tsFiles = function () {
|
|
70
|
-
return this.params.tsFiles;
|
|
71
|
-
};
|
|
72
|
-
Repo.prototype.keywordFilesIndex = function () {
|
|
73
|
-
return this.params.keywordFilesIndex;
|
|
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];
|
|
78
|
-
return filePaths || [];
|
|
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];
|
|
84
|
-
queriedDeclarations[tsFilePath] = this.params.tsFiles[tsFilePath].declaration;
|
|
85
|
-
this.logger.info("Accessed declaration: ".concat(tsFilePath));
|
|
86
|
-
}
|
|
87
|
-
return queriedDeclarations;
|
|
88
|
-
};
|
|
89
|
-
return Repo;
|
|
90
|
-
}());
|
|
176
|
+
return queriedDeclarations;
|
|
177
|
+
};
|
|
178
|
+
return Repo;
|
|
179
|
+
})();
|
|
91
180
|
exports.Repo = Repo;
|
|
92
181
|
var RepoFactory = /** @class */ (function () {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
182
|
+
function RepoFactory() {}
|
|
183
|
+
RepoFactory.createRepo = function (dir) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
function traverse(dir) {
|
|
96
186
|
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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*/];
|
|
139
|
-
}
|
|
140
|
-
});
|
|
187
|
+
var childrenNames, hasPackageJson, packageContent, packageJSON, _i, childrenNames_1, dirent, childPath;
|
|
188
|
+
return __generator(this, function (_a) {
|
|
189
|
+
switch (_a.label) {
|
|
190
|
+
case 0:
|
|
191
|
+
return [4 /*yield*/, promises_1.default.readdir(dir, { withFileTypes: true })];
|
|
192
|
+
case 1:
|
|
193
|
+
childrenNames = _a.sent();
|
|
194
|
+
hasPackageJson = childrenNames.some(function (dirent) {
|
|
195
|
+
return dirent.name === 'package.json';
|
|
141
196
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
197
|
+
if (!hasPackageJson) return [3 /*break*/, 3];
|
|
198
|
+
return [4 /*yield*/, promises_1.default.readFile(path_1.default.join(dir, 'package.json'), 'utf-8')];
|
|
199
|
+
case 2:
|
|
200
|
+
packageContent = _a.sent();
|
|
201
|
+
packageJSON = JSON.parse(packageContent);
|
|
202
|
+
repoParams.packages[packageJSON.name] = {
|
|
203
|
+
packageJSON: packageJSON,
|
|
204
|
+
dirPath: dir,
|
|
205
|
+
fileDescriptors: [],
|
|
206
|
+
tsFiles: {},
|
|
207
|
+
};
|
|
208
|
+
_a.label = 3;
|
|
209
|
+
case 3:
|
|
210
|
+
(_i = 0), (childrenNames_1 = childrenNames);
|
|
211
|
+
_a.label = 4;
|
|
212
|
+
case 4:
|
|
213
|
+
if (!(_i < childrenNames_1.length)) return [3 /*break*/, 7];
|
|
214
|
+
dirent = childrenNames_1[_i];
|
|
215
|
+
if (!dirent.isDirectory()) {
|
|
216
|
+
return [3 /*break*/, 6];
|
|
161
217
|
}
|
|
162
|
-
|
|
163
|
-
|
|
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*/];
|
|
218
|
+
// Exclude directories 'node_modules' and 'dist' right at the beginning
|
|
219
|
+
if (dirent.name.includes('node_modules') || dirent.name.includes('dist')) {
|
|
220
|
+
return [3 /*break*/, 6];
|
|
200
221
|
}
|
|
201
|
-
|
|
222
|
+
childPath = path_1.default.join(dir, dirent.name);
|
|
223
|
+
return [4 /*yield*/, traverse(childPath)];
|
|
224
|
+
case 5:
|
|
225
|
+
_a.sent();
|
|
226
|
+
_a.label = 6;
|
|
227
|
+
case 6:
|
|
228
|
+
_i++;
|
|
229
|
+
return [3 /*break*/, 4];
|
|
230
|
+
case 7:
|
|
231
|
+
return [2 /*return*/];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
202
234
|
});
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
235
|
+
}
|
|
236
|
+
var repoParams;
|
|
237
|
+
return __generator(this, function (_a) {
|
|
238
|
+
switch (_a.label) {
|
|
239
|
+
case 0:
|
|
240
|
+
this.LOGGER.info('Creating repo for dir: '.concat(dir));
|
|
241
|
+
repoParams = { packages: {}, slimPackages: {}, tsFiles: {}, keywordFilesIndex: {} };
|
|
242
|
+
return [4 /*yield*/, traverse(dir)];
|
|
243
|
+
case 1:
|
|
244
|
+
_a.sent();
|
|
245
|
+
return [4 /*yield*/, RepoFactory.loadFiles(repoParams)];
|
|
246
|
+
case 2:
|
|
247
|
+
_a.sent();
|
|
248
|
+
Object.keys(repoParams.packages).forEach(function (packageName) {
|
|
249
|
+
var _a = repoParams.packages[packageName],
|
|
250
|
+
packageJSON = _a.packageJSON,
|
|
251
|
+
tsFiles = _a.tsFiles,
|
|
252
|
+
slimPackage = __rest(_a, ['packageJSON', 'tsFiles']);
|
|
253
|
+
repoParams.slimPackages[packageName] = slimPackage;
|
|
254
|
+
});
|
|
255
|
+
this.LOGGER.info('Created repo for dir: '.concat(dir));
|
|
256
|
+
return [2 /*return*/, new Repo(repoParams)];
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
RepoFactory.loadFiles = function (repoParams) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
263
|
+
var _i, _a, packageName, dirPath, _b, _c, _d, _e, _f, fileDescriptor, typescriptDeclaration, tsFile;
|
|
264
|
+
var _g;
|
|
265
|
+
return __generator(this, function (_h) {
|
|
266
|
+
switch (_h.label) {
|
|
267
|
+
case 0:
|
|
268
|
+
(_i = 0), (_a = Object.keys(repoParams.packages));
|
|
269
|
+
_h.label = 1;
|
|
270
|
+
case 1:
|
|
271
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
272
|
+
packageName = _a[_i];
|
|
273
|
+
this.LOGGER.info('Loading files for package: '.concat(packageName));
|
|
274
|
+
dirPath = repoParams.packages[packageName].dirPath;
|
|
275
|
+
if (!dirPath) return [3 /*break*/, 3];
|
|
276
|
+
_c = (_b = (_g = repoParams.packages[packageName].fileDescriptors).push).apply;
|
|
277
|
+
_d = [_g];
|
|
278
|
+
return [4 /*yield*/, util_node_1.Fs.getFilesInDirectory(dirPath, ['node_modules', 'dist'])];
|
|
279
|
+
case 2:
|
|
280
|
+
_c.apply(_b, _d.concat([_h.sent()]));
|
|
281
|
+
for (_e = 0, _f = repoParams.packages[packageName].fileDescriptors; _e < _f.length; _e++) {
|
|
282
|
+
fileDescriptor = _f[_e];
|
|
283
|
+
typescriptDeclaration = util_node_1.PackageUtil.generateTypescriptDeclarations({
|
|
284
|
+
tsFilePaths: [fileDescriptor.path],
|
|
285
|
+
})[fileDescriptor.path];
|
|
286
|
+
tsFile = Object.assign({ declaration: typescriptDeclaration }, fileDescriptor);
|
|
287
|
+
repoParams.packages[packageName].tsFiles[fileDescriptor.path] = tsFile;
|
|
288
|
+
repoParams.tsFiles[fileDescriptor.path] = tsFile;
|
|
289
|
+
if (!repoParams.keywordFilesIndex[fileDescriptor.nameWithoutExtension]) {
|
|
290
|
+
repoParams.keywordFilesIndex[fileDescriptor.nameWithoutExtension] = [];
|
|
291
|
+
}
|
|
292
|
+
repoParams.keywordFilesIndex[fileDescriptor.nameWithoutExtension].push(fileDescriptor.path);
|
|
293
|
+
}
|
|
294
|
+
_h.label = 3;
|
|
295
|
+
case 3:
|
|
296
|
+
_i++;
|
|
297
|
+
return [3 /*break*/, 1];
|
|
298
|
+
case 4:
|
|
299
|
+
return [2 /*return*/];
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
RepoFactory.LOGGER = new util_1.Logger('RepoFactory');
|
|
305
|
+
return RepoFactory;
|
|
306
|
+
})();
|
|
207
307
|
exports.RepoFactory = RepoFactory;
|
|
208
|
-
//# sourceMappingURL=Repo.js.map
|
|
308
|
+
//# sourceMappingURL=Repo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Repo.js","sourceRoot":"","sources":["../../../src/code_template/Repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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AU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,eAAe,EAAhD,cAAgD,EAAhD,IAAgD,EAAE;4BAApE,cAAc;4BACjB,qBAAqB,GAAG,uBAAW,CAAC,8BAA8B,CAAC;gCACvE,WAAW,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC;6BACnC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;4BAClB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,EAAE,cAAc,CAAC,CAAC;4BACrF,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;4BACvE,UAAU,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;4BACjD,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAAE;gCACtE,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,GAAG,EAAE,CAAC;6BACxE;4BAED,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;yBAC7F;;;wBAnBqB,IAAgC,CAAA;;;;;;KAsB3D;IArEc,kBAAM,GAAG,IAAI,aAAM,CAAC,aAAa,CAAC,CAAC;IA+FpD,kBAAC;CAAA,AAhGD,IAgGC;AAhGY,kCAAW"}
|
|
@@ -3,22 +3,22 @@ import { FileContentMap } from '@proteinjs/util-node';
|
|
|
3
3
|
import { ChatCompletionMessageParam } from 'openai/resources/chat';
|
|
4
4
|
import { MessageModerator } from '../../history/MessageModerator';
|
|
5
5
|
export interface ConversationFs {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
fileContentMap: FileContentMap;
|
|
7
|
+
order: string[];
|
|
8
8
|
}
|
|
9
9
|
export interface ConversationFsFactoryParams {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
maxFiles: number;
|
|
11
|
+
logLevel: LogLevel;
|
|
12
12
|
}
|
|
13
13
|
export declare class ConversationFsFactory {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
private logger;
|
|
15
|
+
private params;
|
|
16
|
+
constructor(params?: Partial<ConversationFsFactoryParams>);
|
|
17
|
+
merge(existingFs: ConversationFs, updates: FileContentMap): ConversationFs;
|
|
18
18
|
}
|
|
19
19
|
export declare class ConversationFsModerator implements MessageModerator {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
private logLevel;
|
|
21
|
+
constructor(logLevel?: LogLevel);
|
|
22
|
+
observe(messages: ChatCompletionMessageParam[]): ChatCompletionMessageParam[];
|
|
23
23
|
}
|
|
24
|
-
//# sourceMappingURL=ConversationFsModerator.d.ts.map
|
|
24
|
+
//# sourceMappingURL=ConversationFsModerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationFsModerator.d.ts","sourceRoot":"","sources":["../../../../src/fs/conversation_fs/ConversationFsModerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConversationFsModerator.d.ts","sourceRoot":"","sources":["../../../../src/fs/conversation_fs/ConversationFsModerator.ts"],"names":[],"mappings":"AACA,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;IAM/B,OAAO,CAAC,QAAQ,EAAE,0BAA0B,EAAE,GAAG,0BAA0B,EAAE;CAqE9E"}
|