@polka-codes/cli-shared 0.10.23 → 0.10.25
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/dist/index.js +1913 -7
- package/package.json +2 -2
- package/dist/config.js +0 -202
- package/dist/config.js.map +0 -1
- package/dist/config.parameters.test.js +0 -240
- package/dist/config.parameters.test.js.map +0 -1
- package/dist/config.rules.test.js +0 -92
- package/dist/config.rules.test.js.map +0 -1
- package/dist/config.test.js +0 -311
- package/dist/config.test.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/memory-manager.js +0 -76
- package/dist/memory-manager.js.map +0 -1
- package/dist/project-scope.js +0 -67
- package/dist/project-scope.js.map +0 -1
- package/dist/provider.js +0 -366
- package/dist/provider.js.map +0 -1
- package/dist/provider.test.js +0 -21
- package/dist/provider.test.js.map +0 -1
- package/dist/sqlite-memory-store.js +0 -911
- package/dist/sqlite-memory-store.js.map +0 -1
- package/dist/sqlite-memory-store.test.js +0 -661
- package/dist/sqlite-memory-store.test.js.map +0 -1
- package/dist/utils/__tests__/parameterSimplifier.test.js +0 -137
- package/dist/utils/__tests__/parameterSimplifier.test.js.map +0 -1
- package/dist/utils/checkRipgrep.js +0 -22
- package/dist/utils/checkRipgrep.js.map +0 -1
- package/dist/utils/eventHandler.js +0 -199
- package/dist/utils/eventHandler.js.map +0 -1
- package/dist/utils/eventHandler.test.js +0 -50
- package/dist/utils/eventHandler.test.js.map +0 -1
- package/dist/utils/index.js +0 -7
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/listFiles.js +0 -136
- package/dist/utils/listFiles.js.map +0 -1
- package/dist/utils/listFiles.test.js +0 -64
- package/dist/utils/listFiles.test.js.map +0 -1
- package/dist/utils/parameterSimplifier.js +0 -65
- package/dist/utils/parameterSimplifier.js.map +0 -1
- package/dist/utils/readMultiline.js +0 -19
- package/dist/utils/readMultiline.js.map +0 -1
- package/dist/utils/search.constants.js +0 -8
- package/dist/utils/search.constants.js.map +0 -1
- package/dist/utils/searchFiles.js +0 -72
- package/dist/utils/searchFiles.js.map +0 -1
- package/dist/utils/searchFiles.test.js +0 -140
- package/dist/utils/searchFiles.test.js.map +0 -1
package/dist/provider.js
DELETED
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process';
|
|
2
|
-
import { mkdir, readFile, rename, unlink, writeFile } from 'node:fs/promises';
|
|
3
|
-
import { dirname, normalize, resolve } from 'node:path';
|
|
4
|
-
import { vertex } from '@ai-sdk/google-vertex';
|
|
5
|
-
import { input, select } from '@inquirer/prompts';
|
|
6
|
-
import { generateText, stepCountIs } from 'ai';
|
|
7
|
-
import ignore from 'ignore';
|
|
8
|
-
import { lookup } from 'mime-types';
|
|
9
|
-
import { checkRipgrep } from './utils/checkRipgrep.js';
|
|
10
|
-
import { listFiles } from './utils/listFiles.js';
|
|
11
|
-
import { searchFiles } from './utils/searchFiles.js';
|
|
12
|
-
export class InMemoryStore {
|
|
13
|
-
#data;
|
|
14
|
-
async read() {
|
|
15
|
-
return this.#data;
|
|
16
|
-
}
|
|
17
|
-
async write(data) {
|
|
18
|
-
this.#data = data;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Helper function to detect if memoryStore is an IMemoryStore
|
|
23
|
-
*/
|
|
24
|
-
function isIMemoryStore(store) {
|
|
25
|
-
return 'readMemory' in store && 'updateMemory' in store;
|
|
26
|
-
}
|
|
27
|
-
export const getProvider = (options = {}) => {
|
|
28
|
-
const ig = ignore().add(options.excludeFiles ?? []);
|
|
29
|
-
const memoryStore = options.memoryStore ?? new InMemoryStore();
|
|
30
|
-
const todoItemStore = options.todoItemStore ?? new InMemoryStore();
|
|
31
|
-
const defaultMemoryTopic = ':default:';
|
|
32
|
-
const searchModel = options.getModel?.('search');
|
|
33
|
-
// Helper functions for memory operations that work with both store types
|
|
34
|
-
const readMemoryKV = async (topic) => {
|
|
35
|
-
if (!isIMemoryStore(memoryStore)) {
|
|
36
|
-
const data = (await memoryStore.read()) ?? {};
|
|
37
|
-
return data[topic];
|
|
38
|
-
}
|
|
39
|
-
// For IMemoryStore, topic is the "name" parameter
|
|
40
|
-
return memoryStore.readMemory(topic);
|
|
41
|
-
};
|
|
42
|
-
const updateMemoryKV = async (operation, topic, content) => {
|
|
43
|
-
if (!isIMemoryStore(memoryStore)) {
|
|
44
|
-
const data = (await memoryStore.read()) ?? {};
|
|
45
|
-
switch (operation) {
|
|
46
|
-
case 'append':
|
|
47
|
-
if (content === undefined) {
|
|
48
|
-
throw new Error('Content is required for append operation.');
|
|
49
|
-
}
|
|
50
|
-
data[topic] = `${data[topic] || ''}\n${content}`;
|
|
51
|
-
break;
|
|
52
|
-
case 'replace':
|
|
53
|
-
if (content === undefined) {
|
|
54
|
-
throw new Error('Content is required for replace operation.');
|
|
55
|
-
}
|
|
56
|
-
data[topic] = content;
|
|
57
|
-
break;
|
|
58
|
-
case 'remove':
|
|
59
|
-
delete data[topic];
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
await memoryStore.write(data);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
// Use IMemoryStore API
|
|
66
|
-
await memoryStore.updateMemory(operation, topic, content);
|
|
67
|
-
};
|
|
68
|
-
const listMemoryTopicsKV = async () => {
|
|
69
|
-
if (!isIMemoryStore(memoryStore)) {
|
|
70
|
-
const data = (await memoryStore.read()) ?? {};
|
|
71
|
-
return Object.keys(data);
|
|
72
|
-
}
|
|
73
|
-
// For IMemoryStore, we need to query for all names in the current scope
|
|
74
|
-
const entries = await memoryStore.queryMemory({});
|
|
75
|
-
if (Array.isArray(entries)) {
|
|
76
|
-
return entries.map((e) => e.name);
|
|
77
|
-
}
|
|
78
|
-
return [];
|
|
79
|
-
};
|
|
80
|
-
const provider = {
|
|
81
|
-
listTodoItems: async (id, status) => {
|
|
82
|
-
const todoItems = (await todoItemStore.read()) ?? [];
|
|
83
|
-
let items;
|
|
84
|
-
if (!id) {
|
|
85
|
-
items = todoItems.filter((i) => !i.id.includes('.'));
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
const parent = todoItems.find((i) => i.id === id);
|
|
89
|
-
if (!parent) {
|
|
90
|
-
throw new Error(`To-do item with id ${id} not found`);
|
|
91
|
-
}
|
|
92
|
-
items = todoItems.filter((i) => i.id.startsWith(`${id}.`) && i.id.split('.').length === id.split('.').length + 1);
|
|
93
|
-
}
|
|
94
|
-
if (status) {
|
|
95
|
-
items = items.filter((item) => item.status === status);
|
|
96
|
-
}
|
|
97
|
-
items.sort((a, b) => {
|
|
98
|
-
const aParts = a.id.split('.');
|
|
99
|
-
const bParts = b.id.split('.');
|
|
100
|
-
const len = Math.min(aParts.length, bParts.length);
|
|
101
|
-
for (let i = 0; i < len; i++) {
|
|
102
|
-
const comparison = aParts[i].localeCompare(bParts[i], undefined, { numeric: true });
|
|
103
|
-
if (comparison !== 0) {
|
|
104
|
-
return comparison;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return aParts.length - bParts.length;
|
|
108
|
-
});
|
|
109
|
-
return items;
|
|
110
|
-
},
|
|
111
|
-
getTodoItem: async (id) => {
|
|
112
|
-
const todoItems = (await todoItemStore.read()) ?? [];
|
|
113
|
-
const item = todoItems.find((i) => i.id === id);
|
|
114
|
-
if (!item) {
|
|
115
|
-
throw new Error(`To-do item with id ${id} not found`);
|
|
116
|
-
}
|
|
117
|
-
const subItems = todoItems
|
|
118
|
-
.filter((i) => i.id.startsWith(`${id}.`) && i.id.split('.').length === id.split('.').length + 1)
|
|
119
|
-
.map(({ id, title }) => ({ id, title }));
|
|
120
|
-
return { ...item, subItems };
|
|
121
|
-
},
|
|
122
|
-
updateTodoItem: async (input) => {
|
|
123
|
-
const todoItems = (await todoItemStore.read()) ?? [];
|
|
124
|
-
if (input.operation === 'add') {
|
|
125
|
-
const { parentId, title, description, status } = input;
|
|
126
|
-
if (!title) {
|
|
127
|
-
throw new Error('Title is required for add operation');
|
|
128
|
-
}
|
|
129
|
-
let newId;
|
|
130
|
-
if (parentId) {
|
|
131
|
-
const parent = todoItems.find((i) => i.id === parentId);
|
|
132
|
-
if (!parent) {
|
|
133
|
-
throw new Error(`Parent to-do item with id ${parentId} not found`);
|
|
134
|
-
}
|
|
135
|
-
const childItems = todoItems.filter((i) => i.id.startsWith(`${parentId}.`) && i.id.split('.').length === parentId.split('.').length + 1);
|
|
136
|
-
const maxId = childItems.reduce((max, item) => {
|
|
137
|
-
const parts = item.id.split('.');
|
|
138
|
-
const lastPart = parseInt(parts[parts.length - 1], 10);
|
|
139
|
-
return Math.max(max, lastPart);
|
|
140
|
-
}, 0);
|
|
141
|
-
newId = `${parentId}.${maxId + 1}`;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
const rootItems = todoItems.filter((i) => !i.id.includes('.'));
|
|
145
|
-
const maxId = rootItems.reduce((max, item) => {
|
|
146
|
-
const idNum = parseInt(item.id, 10);
|
|
147
|
-
return Math.max(max, idNum);
|
|
148
|
-
}, 0);
|
|
149
|
-
newId = `${maxId + 1}`;
|
|
150
|
-
}
|
|
151
|
-
const newItem = {
|
|
152
|
-
id: newId,
|
|
153
|
-
title,
|
|
154
|
-
description: description ?? '',
|
|
155
|
-
status: status ?? 'open',
|
|
156
|
-
};
|
|
157
|
-
await todoItemStore.write([...todoItems, newItem]);
|
|
158
|
-
return { id: newId };
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
// update
|
|
162
|
-
const { id } = input;
|
|
163
|
-
if (!id) {
|
|
164
|
-
throw new Error('ID is required for update operation');
|
|
165
|
-
}
|
|
166
|
-
const item = todoItems.find((i) => i.id === id);
|
|
167
|
-
if (!item) {
|
|
168
|
-
throw new Error(`To-do item with id ${id} not found`);
|
|
169
|
-
}
|
|
170
|
-
if (input.title != null) {
|
|
171
|
-
item.title = input.title;
|
|
172
|
-
}
|
|
173
|
-
if (input.description != null) {
|
|
174
|
-
item.description = input.description ?? '';
|
|
175
|
-
}
|
|
176
|
-
if (input.status != null) {
|
|
177
|
-
item.status = input.status;
|
|
178
|
-
}
|
|
179
|
-
await todoItemStore.write(todoItems);
|
|
180
|
-
return { id };
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
listMemoryTopics: async () => {
|
|
184
|
-
return listMemoryTopicsKV();
|
|
185
|
-
},
|
|
186
|
-
readMemory: async (topic = defaultMemoryTopic) => {
|
|
187
|
-
return readMemoryKV(topic);
|
|
188
|
-
},
|
|
189
|
-
updateMemory: async (operation, topic, content) => {
|
|
190
|
-
const memoryTopic = topic ?? defaultMemoryTopic;
|
|
191
|
-
await updateMemoryKV(operation, memoryTopic, content);
|
|
192
|
-
},
|
|
193
|
-
readFile: async (path, includeIgnored) => {
|
|
194
|
-
if (!includeIgnored && ig.ignores(path)) {
|
|
195
|
-
throw new Error(`Not allow to access file ${path}`);
|
|
196
|
-
}
|
|
197
|
-
try {
|
|
198
|
-
return await readFile(path, 'utf8');
|
|
199
|
-
}
|
|
200
|
-
catch (_e) {
|
|
201
|
-
return undefined;
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
writeFile: async (path, content) => {
|
|
205
|
-
if (ig.ignores(path)) {
|
|
206
|
-
throw new Error(`Not allow to access file ${path}`);
|
|
207
|
-
}
|
|
208
|
-
// generate parent directories if they don't exist
|
|
209
|
-
await mkdir(dirname(path), { recursive: true });
|
|
210
|
-
return await writeFile(path, content, 'utf8');
|
|
211
|
-
},
|
|
212
|
-
removeFile: async (path) => {
|
|
213
|
-
if (ig.ignores(path)) {
|
|
214
|
-
throw new Error(`Not allow to access file ${path}`);
|
|
215
|
-
}
|
|
216
|
-
return await unlink(path);
|
|
217
|
-
},
|
|
218
|
-
renameFile: async (sourcePath, targetPath) => {
|
|
219
|
-
if (ig.ignores(sourcePath) || ig.ignores(targetPath)) {
|
|
220
|
-
throw new Error(`Not allow to access file ${sourcePath} or ${targetPath}`);
|
|
221
|
-
}
|
|
222
|
-
return await rename(sourcePath, targetPath);
|
|
223
|
-
},
|
|
224
|
-
listFiles: async (path, recursive, maxCount, includeIgnored) => {
|
|
225
|
-
return await listFiles(path, recursive, maxCount, process.cwd(), options.excludeFiles, includeIgnored);
|
|
226
|
-
},
|
|
227
|
-
readBinaryFile: async (url) => {
|
|
228
|
-
if (url.startsWith('file://')) {
|
|
229
|
-
const filePath = decodeURIComponent(url.substring('file://'.length));
|
|
230
|
-
const resolvedPath = normalize(resolve(process.cwd(), filePath));
|
|
231
|
-
if (!resolvedPath.startsWith(process.cwd())) {
|
|
232
|
-
throw new Error(`Access to file path "${filePath}" is restricted.`);
|
|
233
|
-
}
|
|
234
|
-
const data = await readFile(resolvedPath);
|
|
235
|
-
const mediaType = lookup(resolvedPath) || 'application/octet-stream';
|
|
236
|
-
return {
|
|
237
|
-
base64Data: data.toString('base64'),
|
|
238
|
-
mediaType,
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
const response = await fetch(url);
|
|
242
|
-
if (!response.ok) {
|
|
243
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
244
|
-
}
|
|
245
|
-
const data = await response.arrayBuffer();
|
|
246
|
-
const mediaType = lookup(url) || 'application/octet-stream';
|
|
247
|
-
return {
|
|
248
|
-
base64Data: Buffer.from(data).toString('base64'),
|
|
249
|
-
mediaType,
|
|
250
|
-
};
|
|
251
|
-
},
|
|
252
|
-
executeCommand: (command, _needApprove) => {
|
|
253
|
-
// TODO: add timeout
|
|
254
|
-
return new Promise((resolve, reject) => {
|
|
255
|
-
// spawn a shell to execute the command
|
|
256
|
-
options.command?.onStarted(command);
|
|
257
|
-
const child = spawn(command, [], {
|
|
258
|
-
shell: true,
|
|
259
|
-
stdio: 'pipe',
|
|
260
|
-
});
|
|
261
|
-
let stdoutText = '';
|
|
262
|
-
let stderrText = '';
|
|
263
|
-
child.stdout.on('data', (data) => {
|
|
264
|
-
const dataStr = data.toString();
|
|
265
|
-
options.command?.onStdout(dataStr);
|
|
266
|
-
stdoutText += dataStr;
|
|
267
|
-
});
|
|
268
|
-
child.stderr.on('data', (data) => {
|
|
269
|
-
const dataStr = data.toString();
|
|
270
|
-
options.command?.onStderr(dataStr);
|
|
271
|
-
stderrText += dataStr;
|
|
272
|
-
});
|
|
273
|
-
child.on('close', async (code) => {
|
|
274
|
-
options.command?.onExit(code ?? 0);
|
|
275
|
-
const totalLength = stdoutText.length + stderrText.length;
|
|
276
|
-
if (totalLength > (options.summaryThreshold ?? 5000) && options.summarizeOutput) {
|
|
277
|
-
try {
|
|
278
|
-
const summary = await options.summarizeOutput(stdoutText, stderrText);
|
|
279
|
-
if (summary) {
|
|
280
|
-
resolve({
|
|
281
|
-
summary,
|
|
282
|
-
stdout: stdoutText,
|
|
283
|
-
stderr: stderrText,
|
|
284
|
-
exitCode: code ?? 0,
|
|
285
|
-
});
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
catch (_e) {
|
|
290
|
-
console.error('Summarization failed:', _e);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
resolve({
|
|
294
|
-
stdout: stdoutText,
|
|
295
|
-
stderr: stderrText,
|
|
296
|
-
exitCode: code ?? 0,
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
child.on('error', (err) => {
|
|
300
|
-
options.command?.onError(err);
|
|
301
|
-
reject(err);
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
},
|
|
305
|
-
askFollowupQuestion: async (question, answerOptions) => {
|
|
306
|
-
if (options.yes) {
|
|
307
|
-
if (answerOptions.length > 0) {
|
|
308
|
-
return answerOptions[0];
|
|
309
|
-
}
|
|
310
|
-
return '';
|
|
311
|
-
}
|
|
312
|
-
if (answerOptions.length === 0) {
|
|
313
|
-
return await input({ message: question });
|
|
314
|
-
}
|
|
315
|
-
const otherMessage = 'Other (enter text)';
|
|
316
|
-
answerOptions.push(otherMessage);
|
|
317
|
-
const answer = await select({
|
|
318
|
-
message: question,
|
|
319
|
-
choices: answerOptions.map((option) => ({ name: option, value: option })),
|
|
320
|
-
});
|
|
321
|
-
if (answer === otherMessage) {
|
|
322
|
-
return await input({ message: 'Enter your answer:' });
|
|
323
|
-
}
|
|
324
|
-
return answer;
|
|
325
|
-
},
|
|
326
|
-
fetchUrl: async (url) => {
|
|
327
|
-
const isRaw = url.startsWith('https://raw.githubusercontent.com/');
|
|
328
|
-
const urlToFetch = isRaw ? url : `https://r.jina.ai/${url}`;
|
|
329
|
-
try {
|
|
330
|
-
const response = await fetch(urlToFetch);
|
|
331
|
-
if (!response.ok) {
|
|
332
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
333
|
-
}
|
|
334
|
-
return await response.text();
|
|
335
|
-
}
|
|
336
|
-
catch (error) {
|
|
337
|
-
console.error('Error fetching URL:', error);
|
|
338
|
-
throw error;
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
search: searchModel &&
|
|
342
|
-
(async (query) => {
|
|
343
|
-
const googleSearchTool = vertex.tools.googleSearch({});
|
|
344
|
-
const resp = await generateText({
|
|
345
|
-
model: searchModel,
|
|
346
|
-
system: 'You are a web search assistant. When searching for information, provide comprehensive and detailed results. Include relevant facts, statistics, dates, and key details from the search results. Synthesize information from multiple sources when available. Structure your response clearly with the most relevant information first. Reference or cite sources when presenting specific claims or data.',
|
|
347
|
-
tools: {
|
|
348
|
-
google_search: googleSearchTool,
|
|
349
|
-
},
|
|
350
|
-
prompt: query,
|
|
351
|
-
stopWhen: stepCountIs(5),
|
|
352
|
-
});
|
|
353
|
-
return resp.text;
|
|
354
|
-
}),
|
|
355
|
-
};
|
|
356
|
-
if (checkRipgrep()) {
|
|
357
|
-
provider.searchFiles = async (path, regex, filePattern) => {
|
|
358
|
-
return await searchFiles(path, regex, filePattern, process.cwd(), options.excludeFiles);
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
console.error('Error: ripgrep (rg) is not installed. Search file tool is disabled. Please install it from https://github.com/BurntSushi/ripgrep#installation');
|
|
363
|
-
}
|
|
364
|
-
return provider;
|
|
365
|
-
};
|
|
366
|
-
//# sourceMappingURL=provider.js.map
|
package/dist/provider.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,CAAA;AAC9C,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAYpD,MAAM,OAAO,aAAa;IACxB,KAAK,CAAe;IAEpB,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAO;QACjB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;CACF;AAkBD;;GAEG;AACH,SAAS,cAAc,CAAC,KAA+D;IACrF,OAAO,YAAY,IAAI,KAAK,IAAI,cAAc,IAAI,KAAK,CAAA;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,UAA2B,EAAE,EAAgB,EAAE;IACzE,MAAM,EAAE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ACH,CAAC;QACD,MAAM,EACJ,WAAW;YACX,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;gBACvB,MAAM,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;gBACtD,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC;oBAC9B,KAAK,EAAE,WAAW;oBAClB,MAAM,EACJ,2YAA2Y;oBAC7Y,KAAK,EAAE;wBACL,aAAa,EAAE,gBAAgB;qBAChC;oBACD,MAAM,EAAE,KAAK;oBACb,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;iBACzB,CAAC,CAAA;gBACF,OAAO,IAAI,CAAC,IAAI,CAAA;YAClB,CAAC,CAAC;KACL,CAAA;IAED,IAAI,YAAY,EAAE,EAAE,CAAC;QACnB,QAAQ,CAAC,WAAW,GAAG,KAAK,EAAE,IAAY,EAAE,KAAa,EAAE,WAAmB,EAAqB,EAAE;YACnG,OAAO,MAAM,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;QACzF,CAAC,CAAA;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CACX,+IAA+I,CAChJ,CAAA;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
|
package/dist/provider.test.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test';
|
|
2
|
-
import { getProvider } from './provider';
|
|
3
|
-
describe('getProvider', () => {
|
|
4
|
-
describe('askFollowupQuestion', () => {
|
|
5
|
-
it('should return first option when yes is true and options are provided', async () => {
|
|
6
|
-
const provider = getProvider({ yes: true });
|
|
7
|
-
if (!provider.askFollowupQuestion)
|
|
8
|
-
throw new Error('askFollowupQuestion not defined');
|
|
9
|
-
const result = await provider.askFollowupQuestion('Question?', ['Option 1', 'Option 2']);
|
|
10
|
-
expect(result).toBe('Option 1');
|
|
11
|
-
});
|
|
12
|
-
it('should return empty string when yes is true and no options are provided', async () => {
|
|
13
|
-
const provider = getProvider({ yes: true });
|
|
14
|
-
if (!provider.askFollowupQuestion)
|
|
15
|
-
throw new Error('askFollowupQuestion not defined');
|
|
16
|
-
const result = await provider.askFollowupQuestion('Question?', []);
|
|
17
|
-
expect(result).toBe('');
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=provider.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.test.js","sourceRoot":"","sources":["../src/provider.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;YACpF,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;YAC3C,IAAI,CAAC,QAAQ,CAAC,mBAAmB;gBAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;YACrF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAA;YACxF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,yEAAyE,EAAE,KAAK,IAAI,EAAE;YACvF,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;YAC3C,IAAI,CAAC,QAAQ,CAAC,mBAAmB;gBAAE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