@proteinjs/conversation 1.0.7 → 1.0.8

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.
Files changed (69) hide show
  1. package/.eslintrc.js +1 -1
  2. package/.prettierignore +4 -0
  3. package/CHANGELOG.md +11 -0
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +28 -40
  6. package/dist/src/CodegenConversation.d.ts +11 -11
  7. package/dist/src/CodegenConversation.js +180 -294
  8. package/dist/src/Conversation.d.ts +49 -52
  9. package/dist/src/Conversation.js +288 -478
  10. package/dist/src/ConversationModule.d.ts +6 -6
  11. package/dist/src/ConversationModule.js +3 -3
  12. package/dist/src/Function.d.ts +4 -4
  13. package/dist/src/Function.js +3 -3
  14. package/dist/src/OpenAi.d.ts +10 -42
  15. package/dist/src/OpenAi.js +305 -495
  16. package/dist/src/Paragraph.d.ts +4 -4
  17. package/dist/src/Paragraph.js +17 -17
  18. package/dist/src/Sentence.d.ts +4 -4
  19. package/dist/src/Sentence.js +21 -21
  20. package/dist/src/code_template/Code.d.ts +15 -15
  21. package/dist/src/code_template/Code.js +73 -167
  22. package/dist/src/code_template/CodeTemplate.d.ts +11 -11
  23. package/dist/src/code_template/CodeTemplate.js +80 -169
  24. package/dist/src/code_template/CodeTemplateModule.d.ts +6 -6
  25. package/dist/src/code_template/CodeTemplateModule.js +26 -28
  26. package/dist/src/code_template/Repo.d.ts +38 -34
  27. package/dist/src/code_template/Repo.js +195 -291
  28. package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts +12 -12
  29. package/dist/src/fs/conversation_fs/ConversationFsModerator.js +108 -110
  30. package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts +11 -11
  31. package/dist/src/fs/conversation_fs/ConversationFsModule.js +97 -204
  32. package/dist/src/fs/conversation_fs/FsFunctions.d.ts +62 -58
  33. package/dist/src/fs/conversation_fs/FsFunctions.js +252 -414
  34. package/dist/src/fs/git/GitModule.d.ts +8 -8
  35. package/dist/src/fs/git/GitModule.js +74 -163
  36. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts +18 -16
  37. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js +58 -158
  38. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts +26 -27
  39. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js +131 -234
  40. package/dist/src/fs/package/PackageFunctions.d.ts +60 -54
  41. package/dist/src/fs/package/PackageFunctions.js +213 -366
  42. package/dist/src/fs/package/PackageModule.d.ts +24 -24
  43. package/dist/src/fs/package/PackageModule.js +170 -292
  44. package/dist/src/history/MessageHistory.d.ts +12 -12
  45. package/dist/src/history/MessageHistory.js +46 -52
  46. package/dist/src/history/MessageModerator.d.ts +2 -2
  47. package/dist/src/history/MessageModerator.js +3 -3
  48. package/dist/src/template/ConversationTemplate.d.ts +8 -8
  49. package/dist/src/template/ConversationTemplate.js +3 -3
  50. package/dist/src/template/ConversationTemplateFunctions.d.ts +35 -33
  51. package/dist/src/template/ConversationTemplateFunctions.js +75 -176
  52. package/dist/src/template/ConversationTemplateModule.d.ts +48 -51
  53. package/dist/src/template/ConversationTemplateModule.js +116 -211
  54. package/dist/src/template/createApp/CreateAppTemplate.d.ts +1 -1
  55. package/dist/src/template/createApp/CreateAppTemplate.js +59 -151
  56. package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts +1 -1
  57. package/dist/src/template/createCode/CreateCodeConversationTemplate.js +67 -183
  58. package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts +1 -1
  59. package/dist/src/template/createPackage/CreatePackageConversationTemplate.js +77 -174
  60. package/dist/src/template/createPackage/tsconfig.json +11 -11
  61. package/dist/test/createKeywordFilesIndex.test.d.ts +1 -1
  62. package/dist/test/createKeywordFilesIndex.test.js +41 -132
  63. package/dist/test/openai/openai.generateList.test.d.ts +1 -1
  64. package/dist/test/openai/openai.generateList.test.js +47 -136
  65. package/dist/test/openai/openai.parseCodeFromMarkdown.test.d.ts +1 -1
  66. package/dist/test/openai/openai.parseCodeFromMarkdown.test.js +12 -13
  67. package/dist/test/repo/repo.test.d.ts +1 -1
  68. package/dist/test/repo/repo.test.js +38 -127
  69. package/package.json +2 -2
@@ -1,479 +1,317 @@
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
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
4
  return new (P || (P = Promise))(function (resolve, reject) {
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());
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
9
  });
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
- }
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]); }; }
62
15
  function step(op) {
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 };
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 };
123
36
  }
124
- };
125
- Object.defineProperty(exports, '__esModule', { value: true });
126
- exports.fsFunctions =
127
- exports.moveFunctionName =
128
- exports.copyFunctionName =
129
- exports.renameFunctionName =
130
- exports.getFilePathsMatchingGlobFunctionName =
131
- exports.fileOrDirectoryExistsFunction =
132
- exports.fileOrDirectoryExistsFunctionName =
133
- exports.getRecentlyAccessedFilePathsFunction =
134
- exports.getRecentlyAccessedFilePathsFunctionName =
135
- exports.writeFilesFunction =
136
- exports.writeFilesFunctionName =
137
- exports.readFilesFunction =
138
- exports.readFilesFunctionName =
139
- void 0;
140
- var util_node_1 = require('@proteinjs/util-node');
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.fsFunctions = exports.moveFunctionName = exports.copyFunctionName = exports.renameFunctionName = exports.getFilePathsMatchingGlobFunctionName = exports.fileOrDirectoryExistsFunction = exports.fileOrDirectoryExistsFunctionName = exports.getRecentlyAccessedFilePathsFunction = exports.getRecentlyAccessedFilePathsFunctionName = exports.writeFilesFunction = exports.writeFilesFunctionName = exports.readFilesFunction = exports.readFilesFunctionName = void 0;
40
+ var util_node_1 = require("@proteinjs/util-node");
141
41
  exports.readFilesFunctionName = 'readFiles';
142
42
  function readFilesFunction(fsModule) {
143
- var _this = this;
144
- return {
145
- definition: {
146
- name: exports.readFilesFunctionName,
147
- description: 'Get the content of files',
148
- parameters: {
149
- type: 'object',
150
- properties: {
151
- filePaths: {
152
- type: 'array',
153
- description: 'Paths to the files',
154
- items: {
155
- type: 'string',
43
+ var _this = this;
44
+ return {
45
+ definition: {
46
+ name: exports.readFilesFunctionName,
47
+ description: 'Get the content of files',
48
+ parameters: {
49
+ type: 'object',
50
+ properties: {
51
+ filePaths: {
52
+ type: 'array',
53
+ description: 'Paths to the files',
54
+ items: {
55
+ type: 'string',
56
+ },
57
+ },
58
+ },
59
+ required: ['filePaths'],
156
60
  },
157
- },
158
61
  },
159
- required: ['filePaths'],
160
- },
161
- },
162
- call: function (params) {
163
- return __awaiter(_this, void 0, void 0, function () {
164
- return __generator(this, function (_a) {
165
- switch (_a.label) {
166
- case 0:
167
- fsModule.pushRecentlyAccessedFilePath(params.filePaths);
168
- return [4 /*yield*/, util_node_1.Fs.readFiles(params.filePaths)];
169
- case 1:
170
- return [2 /*return*/, _a.sent()];
171
- }
172
- });
173
- });
174
- },
175
- instructions: [
176
- 'To read files from the local file system, use the '.concat(exports.readFilesFunctionName, ' function'),
177
- ],
178
- };
62
+ call: function (params) { return __awaiter(_this, void 0, void 0, function () {
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0:
66
+ fsModule.pushRecentlyAccessedFilePath(params.filePaths);
67
+ return [4 /*yield*/, util_node_1.Fs.readFiles(params.filePaths)];
68
+ case 1: return [2 /*return*/, _a.sent()];
69
+ }
70
+ });
71
+ }); },
72
+ instructions: ["To read files from the local file system, use the ".concat(exports.readFilesFunctionName, " function")],
73
+ };
179
74
  }
180
75
  exports.readFilesFunction = readFilesFunction;
181
76
  exports.writeFilesFunctionName = 'writeFiles';
182
77
  function writeFilesFunction(fsModule) {
183
- var _this = this;
184
- return {
185
- definition: {
186
- name: exports.writeFilesFunctionName,
187
- description: 'Write files to the file system',
188
- parameters: {
189
- type: 'object',
190
- properties: {
191
- files: {
192
- type: 'array',
193
- description: 'Files to write',
194
- items: {
195
- type: 'object',
196
- properties: {
197
- path: {
198
- type: 'string',
199
- description: 'the file path',
78
+ var _this = this;
79
+ return {
80
+ definition: {
81
+ name: exports.writeFilesFunctionName,
82
+ description: 'Write files to the file system',
83
+ parameters: {
84
+ type: 'object',
85
+ properties: {
86
+ files: {
87
+ type: 'array',
88
+ description: 'Files to write',
89
+ items: {
90
+ type: 'object',
91
+ properties: {
92
+ path: {
93
+ type: 'string',
94
+ description: 'the file path',
95
+ },
96
+ content: {
97
+ type: 'string',
98
+ description: 'the content to write to the file',
99
+ },
100
+ },
101
+ },
102
+ },
200
103
  },
201
- content: {
202
- type: 'string',
203
- description: 'the content to write to the file',
204
- },
205
- },
104
+ required: ['files'],
206
105
  },
207
- },
208
106
  },
209
- required: ['files'],
210
- },
211
- },
212
- call: function (params) {
213
- return __awaiter(_this, void 0, void 0, function () {
214
- return __generator(this, function (_a) {
215
- switch (_a.label) {
216
- case 0:
217
- fsModule.pushRecentlyAccessedFilePath(
218
- params.files.map(function (file) {
219
- return file.path;
220
- })
221
- );
222
- return [4 /*yield*/, util_node_1.Fs.writeFiles(params.files)];
223
- case 1:
224
- return [2 /*return*/, _a.sent()];
225
- }
226
- });
227
- });
228
- },
229
- instructions: [
230
- 'To write files to the local file system, use the '.concat(exports.writeFilesFunctionName, ' function'),
231
- ],
232
- };
107
+ call: function (params) { return __awaiter(_this, void 0, void 0, function () {
108
+ return __generator(this, function (_a) {
109
+ switch (_a.label) {
110
+ case 0:
111
+ fsModule.pushRecentlyAccessedFilePath(params.files.map(function (file) { return file.path; }));
112
+ return [4 /*yield*/, util_node_1.Fs.writeFiles(params.files)];
113
+ case 1: return [2 /*return*/, _a.sent()];
114
+ }
115
+ });
116
+ }); },
117
+ instructions: ["To write files to the local file system, use the ".concat(exports.writeFilesFunctionName, " function")],
118
+ };
233
119
  }
234
120
  exports.writeFilesFunction = writeFilesFunction;
235
121
  exports.getRecentlyAccessedFilePathsFunctionName = 'getRecentlyAccessedFilePaths';
236
122
  function getRecentlyAccessedFilePathsFunction(fsModule) {
237
- var _this = this;
238
- return {
239
- definition: {
240
- name: exports.getRecentlyAccessedFilePathsFunctionName,
241
- description: 'Get paths of files accessed during this conversation, in order from oldest to newest',
242
- parameters: {
243
- type: 'object',
244
- properties: {},
245
- required: [],
246
- },
247
- },
248
- call: function () {
249
- return __awaiter(_this, void 0, void 0, function () {
250
- return __generator(this, function (_a) {
251
- return [2 /*return*/, fsModule.getRecentlyAccessedFilePaths()];
252
- });
253
- });
254
- },
255
- };
123
+ var _this = this;
124
+ return {
125
+ definition: {
126
+ name: exports.getRecentlyAccessedFilePathsFunctionName,
127
+ description: 'Get paths of files accessed during this conversation, in order from oldest to newest',
128
+ parameters: {
129
+ type: 'object',
130
+ properties: {},
131
+ required: [],
132
+ },
133
+ },
134
+ call: function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
135
+ return [2 /*return*/, fsModule.getRecentlyAccessedFilePaths()];
136
+ }); }); },
137
+ };
256
138
  }
257
139
  exports.getRecentlyAccessedFilePathsFunction = getRecentlyAccessedFilePathsFunction;
258
140
  var createFolderFunctionName = 'createFolder';
259
141
  var createFolderFunction = {
260
- definition: {
261
- name: createFolderFunctionName,
262
- description: 'Create a folder/directory',
263
- parameters: {
264
- type: 'object',
265
- properties: {
266
- path: {
267
- type: 'string',
268
- description: 'Path of the new directory',
142
+ definition: {
143
+ name: createFolderFunctionName,
144
+ description: 'Create a folder/directory',
145
+ parameters: {
146
+ type: 'object',
147
+ properties: {
148
+ path: {
149
+ type: 'string',
150
+ description: 'Path of the new directory',
151
+ },
152
+ },
153
+ required: ['path'],
269
154
  },
270
- },
271
- required: ['path'],
272
155
  },
273
- },
274
- call: function (params) {
275
- return __awaiter(void 0, void 0, void 0, function () {
276
- return __generator(this, function (_a) {
156
+ call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
277
157
  switch (_a.label) {
278
- case 0:
279
- return [4 /*yield*/, util_node_1.Fs.createFolder(params.path)];
280
- case 1:
281
- return [2 /*return*/, _a.sent()];
158
+ case 0: return [4 /*yield*/, util_node_1.Fs.createFolder(params.path)];
159
+ case 1: return [2 /*return*/, _a.sent()];
282
160
  }
283
- });
284
- });
285
- },
286
- instructions: ['To create a folder on the local file system, use the '.concat(createFolderFunctionName, ' function')],
161
+ }); }); },
162
+ instructions: ["To create a folder on the local file system, use the ".concat(createFolderFunctionName, " function")],
287
163
  };
288
164
  exports.fileOrDirectoryExistsFunctionName = 'fileOrDirectoryExists';
289
165
  exports.fileOrDirectoryExistsFunction = {
290
- definition: {
291
- name: exports.fileOrDirectoryExistsFunctionName,
292
- description: 'Check if a file or directory exists',
293
- parameters: {
294
- type: 'object',
295
- properties: {
296
- path: {
297
- type: 'string',
298
- description: 'Path of the file or directory',
166
+ definition: {
167
+ name: exports.fileOrDirectoryExistsFunctionName,
168
+ description: 'Check if a file or directory exists',
169
+ parameters: {
170
+ type: 'object',
171
+ properties: {
172
+ path: {
173
+ type: 'string',
174
+ description: 'Path of the file or directory',
175
+ },
176
+ },
177
+ required: ['path'],
299
178
  },
300
- },
301
- required: ['path'],
302
179
  },
303
- },
304
- call: function (params) {
305
- return __awaiter(void 0, void 0, void 0, function () {
306
- return __generator(this, function (_a) {
180
+ call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
307
181
  switch (_a.label) {
308
- case 0:
309
- return [4 /*yield*/, util_node_1.Fs.exists(params.path)];
310
- case 1:
311
- return [2 /*return*/, _a.sent()];
182
+ case 0: return [4 /*yield*/, util_node_1.Fs.exists(params.path)];
183
+ case 1: return [2 /*return*/, _a.sent()];
312
184
  }
313
- });
314
- });
315
- },
316
- instructions: [
317
- 'To check if a file or folder exists on the local file system, use the '.concat(
318
- exports.fileOrDirectoryExistsFunctionName,
319
- ' function'
320
- ),
321
- ],
185
+ }); }); },
186
+ instructions: [
187
+ "To check if a file or folder exists on the local file system, use the ".concat(exports.fileOrDirectoryExistsFunctionName, " function"),
188
+ ],
322
189
  };
323
190
  exports.getFilePathsMatchingGlobFunctionName = 'getFilePathsMatchingGlob';
324
191
  var getFilePathsMatchingGlobFunction = {
325
- definition: {
326
- name: exports.getFilePathsMatchingGlobFunctionName,
327
- description: 'Get file paths matching a glob',
328
- parameters: {
329
- type: 'object',
330
- properties: {
331
- dirPrefix: {
332
- type: 'string',
333
- description: 'Directory to recursively search for files',
334
- },
335
- glob: {
336
- type: 'string',
337
- description: 'File matching pattern',
338
- },
339
- globIgnorePatterns: {
340
- type: 'array',
341
- description: 'Directories to ignore',
342
- items: {
343
- type: 'string',
344
- },
192
+ definition: {
193
+ name: exports.getFilePathsMatchingGlobFunctionName,
194
+ description: 'Get file paths matching a glob',
195
+ parameters: {
196
+ type: 'object',
197
+ properties: {
198
+ dirPrefix: {
199
+ type: 'string',
200
+ description: 'Directory to recursively search for files',
201
+ },
202
+ glob: {
203
+ type: 'string',
204
+ description: 'File matching pattern',
205
+ },
206
+ globIgnorePatterns: {
207
+ type: 'array',
208
+ description: 'Directories to ignore',
209
+ items: {
210
+ type: 'string',
211
+ },
212
+ },
213
+ },
214
+ required: ['dirPrefix', 'glob'],
345
215
  },
346
- },
347
- required: ['dirPrefix', 'glob'],
348
216
  },
349
- },
350
- call: function (params) {
351
- return __awaiter(void 0, void 0, void 0, function () {
352
- return __generator(this, function (_a) {
217
+ call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
353
218
  switch (_a.label) {
354
- case 0:
355
- return [
356
- 4 /*yield*/,
357
- util_node_1.Fs.getFilePathsMatchingGlob(params.dirPrefix, params.glob, params.globIgnorePatterns),
358
- ];
359
- case 1:
360
- return [2 /*return*/, _a.sent()];
219
+ case 0: return [4 /*yield*/, util_node_1.Fs.getFilePathsMatchingGlob(params.dirPrefix, params.glob, params.globIgnorePatterns)];
220
+ case 1: return [2 /*return*/, _a.sent()];
361
221
  }
362
- });
363
- });
364
- },
365
- instructions: [
366
- 'To get file paths matching a glob, use the '.concat(exports.getFilePathsMatchingGlobFunctionName, ' function'),
367
- ],
222
+ }); }); },
223
+ instructions: ["To get file paths matching a glob, use the ".concat(exports.getFilePathsMatchingGlobFunctionName, " function")],
368
224
  };
369
225
  exports.renameFunctionName = 'renameFileOrDirectory';
370
226
  var renameFunction = {
371
- definition: {
372
- name: exports.renameFunctionName,
373
- description: 'Rename a file or directory',
374
- parameters: {
375
- type: 'object',
376
- properties: {
377
- oldPath: {
378
- type: 'string',
379
- description: 'Original path of the file or directory',
380
- },
381
- newName: {
382
- type: 'string',
383
- description: 'New name for the file or directory',
227
+ definition: {
228
+ name: exports.renameFunctionName,
229
+ description: 'Rename a file or directory',
230
+ parameters: {
231
+ type: 'object',
232
+ properties: {
233
+ oldPath: {
234
+ type: 'string',
235
+ description: 'Original path of the file or directory',
236
+ },
237
+ newName: {
238
+ type: 'string',
239
+ description: 'New name for the file or directory',
240
+ },
241
+ },
242
+ required: ['oldPath', 'newName'],
384
243
  },
385
- },
386
- required: ['oldPath', 'newName'],
387
244
  },
388
- },
389
- call: function (params) {
390
- return __awaiter(void 0, void 0, void 0, function () {
391
- return __generator(this, function (_a) {
245
+ call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
392
246
  switch (_a.label) {
393
- case 0:
394
- return [4 /*yield*/, util_node_1.Fs.rename(params.oldPath, params.newName)];
395
- case 1:
396
- return [2 /*return*/, _a.sent()];
247
+ case 0: return [4 /*yield*/, util_node_1.Fs.rename(params.oldPath, params.newName)];
248
+ case 1: return [2 /*return*/, _a.sent()];
397
249
  }
398
- });
399
- });
400
- },
401
- instructions: ['To rename a file or directory, use the '.concat(exports.renameFunctionName, ' function')],
250
+ }); }); },
251
+ instructions: ["To rename a file or directory, use the ".concat(exports.renameFunctionName, " function")],
402
252
  };
403
253
  exports.copyFunctionName = 'copyFileOrDirectory';
404
254
  var copyFunction = {
405
- definition: {
406
- name: exports.copyFunctionName,
407
- description: 'Copy a file or directory',
408
- parameters: {
409
- type: 'object',
410
- properties: {
411
- sourcePath: {
412
- type: 'string',
413
- description: 'Path of the source file or directory',
414
- },
415
- destinationPath: {
416
- type: 'string',
417
- description: 'Destination path for the copied file or directory',
255
+ definition: {
256
+ name: exports.copyFunctionName,
257
+ description: 'Copy a file or directory',
258
+ parameters: {
259
+ type: 'object',
260
+ properties: {
261
+ sourcePath: {
262
+ type: 'string',
263
+ description: 'Path of the source file or directory',
264
+ },
265
+ destinationPath: {
266
+ type: 'string',
267
+ description: 'Destination path for the copied file or directory',
268
+ },
269
+ },
270
+ required: ['sourcePath', 'destinationPath'],
418
271
  },
419
- },
420
- required: ['sourcePath', 'destinationPath'],
421
272
  },
422
- },
423
- call: function (params) {
424
- return __awaiter(void 0, void 0, void 0, function () {
425
- return __generator(this, function (_a) {
273
+ call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
426
274
  switch (_a.label) {
427
- case 0:
428
- return [4 /*yield*/, util_node_1.Fs.copy(params.sourcePath, params.destinationPath)];
429
- case 1:
430
- return [2 /*return*/, _a.sent()];
275
+ case 0: return [4 /*yield*/, util_node_1.Fs.copy(params.sourcePath, params.destinationPath)];
276
+ case 1: return [2 /*return*/, _a.sent()];
431
277
  }
432
- });
433
- });
434
- },
435
- instructions: ['To copy a file or directory, use the '.concat(exports.copyFunctionName, ' function')],
278
+ }); }); },
279
+ instructions: ["To copy a file or directory, use the ".concat(exports.copyFunctionName, " function")],
436
280
  };
437
281
  exports.moveFunctionName = 'moveFileOrDirectory';
438
282
  var moveFunction = {
439
- definition: {
440
- name: exports.moveFunctionName,
441
- description: 'Move a file or directory',
442
- parameters: {
443
- type: 'object',
444
- properties: {
445
- sourcePath: {
446
- type: 'string',
447
- description: 'Path of the source file or directory',
448
- },
449
- destinationPath: {
450
- type: 'string',
451
- description: 'Destination path for the moved file or directory',
283
+ definition: {
284
+ name: exports.moveFunctionName,
285
+ description: 'Move a file or directory',
286
+ parameters: {
287
+ type: 'object',
288
+ properties: {
289
+ sourcePath: {
290
+ type: 'string',
291
+ description: 'Path of the source file or directory',
292
+ },
293
+ destinationPath: {
294
+ type: 'string',
295
+ description: 'Destination path for the moved file or directory',
296
+ },
297
+ },
298
+ required: ['sourcePath', 'destinationPath'],
452
299
  },
453
- },
454
- required: ['sourcePath', 'destinationPath'],
455
300
  },
456
- },
457
- call: function (params) {
458
- return __awaiter(void 0, void 0, void 0, function () {
459
- return __generator(this, function (_a) {
301
+ call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
460
302
  switch (_a.label) {
461
- case 0:
462
- return [4 /*yield*/, util_node_1.Fs.move(params.sourcePath, params.destinationPath)];
463
- case 1:
464
- return [2 /*return*/, _a.sent()];
303
+ case 0: return [4 /*yield*/, util_node_1.Fs.move(params.sourcePath, params.destinationPath)];
304
+ case 1: return [2 /*return*/, _a.sent()];
465
305
  }
466
- });
467
- });
468
- },
469
- instructions: ['To move a file or directory, use the '.concat(exports.moveFunctionName, ' function')],
306
+ }); }); },
307
+ instructions: ["To move a file or directory, use the ".concat(exports.moveFunctionName, " function")],
470
308
  };
471
309
  exports.fsFunctions = [
472
- createFolderFunction,
473
- exports.fileOrDirectoryExistsFunction,
474
- getFilePathsMatchingGlobFunction,
475
- renameFunction,
476
- copyFunction,
477
- moveFunction,
310
+ createFolderFunction,
311
+ exports.fileOrDirectoryExistsFunction,
312
+ getFilePathsMatchingGlobFunction,
313
+ renameFunction,
314
+ copyFunction,
315
+ moveFunction,
478
316
  ];
479
- //# sourceMappingURL=FsFunctions.js.map
317
+ //# sourceMappingURL=FsFunctions.js.map