@proteinjs/conversation 1.0.6 → 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 +9 -3
- 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,125 +1,222 @@
|
|
|
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
|
-
Object.defineProperty(exports,
|
|
124
|
+
};
|
|
125
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
39
126
|
exports.ConversationTemplateModuleFactory = exports.ConversationTemplateModule = void 0;
|
|
40
|
-
var util_1 = require(
|
|
41
|
-
var CreatePackageConversationTemplate_1 = require(
|
|
42
|
-
var ConversationTemplateFunctions_1 = require(
|
|
43
|
-
var CreateCodeConversationTemplate_1 = require(
|
|
44
|
-
var CreateAppTemplate_1 = require(
|
|
127
|
+
var util_1 = require('@proteinjs/util');
|
|
128
|
+
var CreatePackageConversationTemplate_1 = require('./createPackage/CreatePackageConversationTemplate');
|
|
129
|
+
var ConversationTemplateFunctions_1 = require('./ConversationTemplateFunctions');
|
|
130
|
+
var CreateCodeConversationTemplate_1 = require('./createCode/CreateCodeConversationTemplate');
|
|
131
|
+
var CreateAppTemplate_1 = require('./createApp/CreateAppTemplate');
|
|
45
132
|
var conversationTemplates = [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
133
|
+
CreatePackageConversationTemplate_1.createPackageConversationTemplate,
|
|
134
|
+
CreateCodeConversationTemplate_1.createCodeConversationTemplate,
|
|
135
|
+
CreateAppTemplate_1.createAppTemplate,
|
|
49
136
|
];
|
|
50
137
|
var ConversationTemplateModule = /** @class */ (function () {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
138
|
+
function ConversationTemplateModule(params) {
|
|
139
|
+
this.logger = new util_1.Logger(this.constructor.name);
|
|
140
|
+
this.params = params;
|
|
141
|
+
}
|
|
142
|
+
ConversationTemplateModule.prototype.getName = function () {
|
|
143
|
+
return 'Conversation Template';
|
|
144
|
+
};
|
|
145
|
+
ConversationTemplateModule.prototype.searchConversationTemplates = function (keyword) {
|
|
146
|
+
this.logger.info('Searching for conversation template, keyword: '.concat(keyword));
|
|
147
|
+
var conversationNames = this.params.conversationTemplateKeywordIndex[keyword];
|
|
148
|
+
return conversationNames || [];
|
|
149
|
+
};
|
|
150
|
+
ConversationTemplateModule.prototype.getConversationTemplate = function (conversationTemplateName) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
var conversationTemplate, instructions;
|
|
153
|
+
return __generator(this, function (_a) {
|
|
154
|
+
switch (_a.label) {
|
|
155
|
+
case 0:
|
|
156
|
+
conversationTemplate = this.params.conversationTemplates[conversationTemplateName];
|
|
157
|
+
if (!conversationTemplate) {
|
|
158
|
+
return [2 /*return*/, {}];
|
|
159
|
+
}
|
|
160
|
+
return [4 /*yield*/, conversationTemplate.instructions()];
|
|
161
|
+
case 1:
|
|
162
|
+
instructions = _a.sent();
|
|
163
|
+
return [2 /*return*/, Object.assign(conversationTemplate, { instructions: instructions })];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
ConversationTemplateModule.prototype.getSystemMessages = function () {
|
|
169
|
+
return [
|
|
170
|
+
'Whenever the user wants to create or talk about something, fisrt use the '.concat(
|
|
171
|
+
ConversationTemplateFunctions_1.searchConversationTemplatesFunctionName,
|
|
172
|
+
' function to identify if there are relevant conversation templates to use'
|
|
173
|
+
),
|
|
174
|
+
'Use the '.concat(
|
|
175
|
+
ConversationTemplateFunctions_1.getConversationTemplateFunctionName,
|
|
176
|
+
' function to get the conversation template'
|
|
177
|
+
),
|
|
178
|
+
"Once you've identified a conversation template that's relevant to the conversation, ask the user if they'd like to use that conversation template",
|
|
179
|
+
"If they want to engage in the templated conversation, ask only the conversation template questions (template.questions), then use the user's answers to carry out the conversation template instructions (template.instructions)",
|
|
180
|
+
];
|
|
181
|
+
};
|
|
182
|
+
ConversationTemplateModule.prototype.getFunctions = function () {
|
|
183
|
+
return [
|
|
184
|
+
(0, ConversationTemplateFunctions_1.searchConversationTemplatesFunction)(this),
|
|
185
|
+
(0, ConversationTemplateFunctions_1.getConversationTemplateFunction)(this),
|
|
186
|
+
];
|
|
187
|
+
};
|
|
188
|
+
ConversationTemplateModule.prototype.getMessageModerators = function () {
|
|
189
|
+
return [];
|
|
190
|
+
};
|
|
191
|
+
return ConversationTemplateModule;
|
|
192
|
+
})();
|
|
99
193
|
exports.ConversationTemplateModule = ConversationTemplateModule;
|
|
100
194
|
var ConversationTemplateModuleFactory = /** @class */ (function () {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
195
|
+
function ConversationTemplateModuleFactory() {}
|
|
196
|
+
ConversationTemplateModuleFactory.prototype.createModule = function (repoPath) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
+
var params, _i, conversationTemplates_1, conversationTemplate, _a, _b, keyword;
|
|
199
|
+
return __generator(this, function (_c) {
|
|
200
|
+
params = {
|
|
201
|
+
conversationTemplates: {},
|
|
202
|
+
conversationTemplateKeywordIndex: {},
|
|
203
|
+
};
|
|
204
|
+
for (_i = 0, conversationTemplates_1 = conversationTemplates; _i < conversationTemplates_1.length; _i++) {
|
|
205
|
+
conversationTemplate = conversationTemplates_1[_i];
|
|
206
|
+
params.conversationTemplates[conversationTemplate.name] = conversationTemplate;
|
|
207
|
+
for (_a = 0, _b = conversationTemplate.keywords; _a < _b.length; _a++) {
|
|
208
|
+
keyword = _b[_a];
|
|
209
|
+
if (!params.conversationTemplateKeywordIndex[keyword]) {
|
|
210
|
+
params.conversationTemplateKeywordIndex[keyword] = [];
|
|
211
|
+
}
|
|
212
|
+
params.conversationTemplateKeywordIndex[keyword].push(conversationTemplate.name);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return [2 /*return*/, new ConversationTemplateModule(params)];
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
return ConversationTemplateModuleFactory;
|
|
220
|
+
})();
|
|
124
221
|
exports.ConversationTemplateModuleFactory = ConversationTemplateModuleFactory;
|
|
125
|
-
//# sourceMappingURL=ConversationTemplateModule.js.map
|
|
222
|
+
//# sourceMappingURL=ConversationTemplateModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationTemplateModule.js","sourceRoot":"","sources":["../../../src/template/ConversationTemplateModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyC;AAEzC,uGAAsG;AAEtG,
|
|
1
|
+
{"version":3,"file":"ConversationTemplateModule.js","sourceRoot":"","sources":["../../../src/template/ConversationTemplateModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAyC;AAEzC,uGAAsG;AAEtG,iFAKyC;AACzC,8FAA6F;AAC7F,mEAAkE;AAElE,IAAM,qBAAqB,GAA2B;IACpD,qEAAiC;IACjC,+DAA8B;IAC9B,qCAAiB;CAClB,CAAC;AAOF;IAIE,oCAAY,MAAwC;QAH5C,WAAM,GAAG,IAAI,aAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAIjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,4CAAO,GAAP;QACE,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,gEAA2B,GAA3B,UAA4B,OAAe;QACzC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wDAAiD,OAAO,CAAE,CAAC,CAAC;QAC7E,IAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC;QAChF,OAAO,iBAAiB,IAAI,EAAE,CAAC;IACjC,CAAC;IAEK,4DAAuB,GAA7B,UACE,wBAAgC;;;;;;wBAE1B,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;wBACzF,IAAI,CAAC,oBAAoB,EAAE;4BACzB,sBAAO,EAAS,EAAC;yBAClB;wBAEoB,qBAAM,oBAAoB,CAAC,YAAY,EAAE,EAAA;;wBAAxD,YAAY,GAAG,SAAyC;wBAC9D,sBAAO,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,EAAE,YAAY,cAAA,EAAE,CAAC,EAAC;;;;KAC9D;IAED,sDAAiB,GAAjB;QACE,OAAO;YACL,mFAA4E,uEAAuC,8EAA2E;YAC9L,kBAAW,mEAAmC,+CAA4C;YAC1F,mJAAmJ;YACnJ,kOAAkO;SACnO,CAAC;IACJ,CAAC;IAED,iDAAY,GAAZ;QACE,OAAO,CAAC,IAAA,mEAAmC,EAAC,IAAI,CAAC,EAAE,IAAA,+DAA+B,EAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,CAAC;IAED,yDAAoB,GAApB;QACE,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,iCAAC;AAAD,CAAC,AA9CD,IA8CC;AA9CY,gEAA0B;AAgDvC;IAAA;IAmBA,CAAC;IAlBO,wDAAY,GAAlB,UAAmB,QAAgB;;;;gBAC3B,MAAM,GAAqC;oBAC/C,qBAAqB,EAAE,EAAE;oBACzB,gCAAgC,EAAE,EAAE;iBACrC,CAAC;gBACF,WAAwD,EAArB,+CAAqB,EAArB,mCAAqB,EAArB,IAAqB,EAAE;oBAA/C,oBAAoB;oBAC7B,MAAM,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC;oBAC/E,WAAmD,EAA7B,KAAA,oBAAoB,CAAC,QAAQ,EAA7B,cAA6B,EAA7B,IAA6B,EAAE;wBAA1C,OAAO;wBAChB,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,OAAO,CAAC,EAAE;4BACrD,MAAM,CAAC,gCAAgC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;yBACvD;wBAED,MAAM,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;qBAClF;iBACF;gBAED,sBAAO,IAAI,0BAA0B,CAAC,MAAM,CAAC,EAAC;;;KAC/C;IACH,wCAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,8EAAiC"}
|
|
@@ -1,70 +1,162 @@
|
|
|
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
|
-
Object.defineProperty(exports,
|
|
124
|
+
};
|
|
125
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
39
126
|
exports.createAppTemplate = void 0;
|
|
40
127
|
var createAppQuestions = [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
128
|
+
{
|
|
129
|
+
text: 'What is the name of the app you want to create?',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
text: 'Which directory would you like to create the app in?',
|
|
133
|
+
},
|
|
47
134
|
];
|
|
48
|
-
var createAppInstructions = function () {
|
|
135
|
+
var createAppInstructions = function () {
|
|
136
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
49
137
|
return __generator(this, function (_a) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
138
|
+
// Here we would implement the instructions based on the user's answers to the questions
|
|
139
|
+
return [
|
|
140
|
+
2 /*return*/,
|
|
141
|
+
[
|
|
142
|
+
'create a directory for the app (if it doesnt already exist), with the same name as the app (replace ` ` with `-`)',
|
|
143
|
+
'cloneAppTemplatePackages on the app directory',
|
|
144
|
+
'update the package.json files of the packages you just cloned, set the package names to be app-name-ui and app-name-server',
|
|
145
|
+
"update the ui/src/Container.tsx and ui/src/SplashPage.tsx files to replace the occurrences of 'appName' with their app name in each file",
|
|
146
|
+
'npmInstall each newly cloned package',
|
|
147
|
+
'runPackageScript(`build`, cwd) each newly cloned package',
|
|
148
|
+
'describe the packages',
|
|
149
|
+
'tell the user they can start the server by calling `npm run dev` in the server package',
|
|
150
|
+
],
|
|
151
|
+
];
|
|
61
152
|
});
|
|
62
|
-
});
|
|
153
|
+
});
|
|
154
|
+
};
|
|
63
155
|
exports.createAppTemplate = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
156
|
+
name: 'Create App',
|
|
157
|
+
keywords: ['create', 'app', 'create app', 'create new app'],
|
|
158
|
+
description: 'This template will guide you through the process of creating a new app.',
|
|
159
|
+
questions: createAppQuestions,
|
|
160
|
+
instructions: createAppInstructions,
|
|
69
161
|
};
|
|
70
|
-
//# sourceMappingURL=CreateAppTemplate.js.map
|
|
162
|
+
//# sourceMappingURL=CreateAppTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateCodeConversationTemplate.d.ts","sourceRoot":"","sources":["../../../../src/template/createCode/CreateCodeConversationTemplate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreateCodeConversationTemplate.d.ts","sourceRoot":"","sources":["../../../../src/template/createCode/CreateCodeConversationTemplate.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,eAAO,MAAM,8BAA8B,EAAE,oBA6B5C,CAAC"}
|