lystbot 0.3.0 โ 0.3.1
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/package.json +1 -1
- package/src/index.js +32 -0
- package/src/mcp.js +11 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -323,6 +323,38 @@ program
|
|
|
323
323
|
console.log(`๐๏ธ Removed: ${item.text}`);
|
|
324
324
|
});
|
|
325
325
|
|
|
326
|
+
// โโ clear โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
327
|
+
program
|
|
328
|
+
.command('clear <list>')
|
|
329
|
+
.description('Remove all checked (completed) items from a list')
|
|
330
|
+
.option('--force', 'Skip confirmation')
|
|
331
|
+
.action(async (listQuery, options) => {
|
|
332
|
+
config.getApiKey();
|
|
333
|
+
const { list, detail } = await api.resolveList(listQuery, { withItems: true });
|
|
334
|
+
const checked = (detail.items || []).filter(i => i.checked);
|
|
335
|
+
|
|
336
|
+
if (checked.length === 0) {
|
|
337
|
+
console.log(`โจ No checked items in ${list.emoji || '๐'} ${list.title || list.name}`);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (!options.force) {
|
|
342
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
343
|
+
const answer = await new Promise(resolve =>
|
|
344
|
+
rl.question(`๐งน Remove ${checked.length} checked item(s) from '${list.emoji || ''} ${list.title || list.name}'? (y/N) `, resolve)
|
|
345
|
+
);
|
|
346
|
+
rl.close();
|
|
347
|
+
|
|
348
|
+
if (answer.toLowerCase() !== 'y') {
|
|
349
|
+
console.log('Cancelled.');
|
|
350
|
+
process.exit(0);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const result = await api.request('DELETE', `/lists/${list.id}/items/checked`);
|
|
355
|
+
console.log(`๐งน Cleared ${result.deleted_count} checked item(s) from ${list.emoji || '๐'} ${list.title || list.name}`);
|
|
356
|
+
});
|
|
357
|
+
|
|
326
358
|
// โโ create โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
327
359
|
program
|
|
328
360
|
.command('create <name>')
|
package/src/mcp.js
CHANGED
|
@@ -203,6 +203,17 @@ async function startMcpServer() {
|
|
|
203
203
|
return { content: [{ type: 'text', text: `๐๏ธ Removed: ${found.text}` }] };
|
|
204
204
|
});
|
|
205
205
|
|
|
206
|
+
server.tool('clear_checked', 'Remove all checked (completed) items from a list', {
|
|
207
|
+
list: { type: 'string', description: 'List name or ID' },
|
|
208
|
+
}, async ({ list: query }) => {
|
|
209
|
+
const all = await api('GET', '/lists');
|
|
210
|
+
const match = findList(all.lists || all, query);
|
|
211
|
+
if (!match) throw new Error(`List "${query}" not found`);
|
|
212
|
+
|
|
213
|
+
const data = await api('DELETE', `/lists/${match.id}/items/checked`);
|
|
214
|
+
return { content: [{ type: 'text', text: `๐งน Cleared ${data.deleted_count} checked item(s) from ${match.emoji || '๐'} ${match.title}` }] };
|
|
215
|
+
});
|
|
216
|
+
|
|
206
217
|
server.tool('share_list', 'Generate a share code for a list', {
|
|
207
218
|
list: { type: 'string', description: 'List name or ID' },
|
|
208
219
|
}, async ({ list: query }) => {
|