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