1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { blobActions } from "https://esm.town/v/pomdtr/blob_actions";
import { ActionItem, defineCommand } from "https://esm.town/v/pomdtr/cmdk";
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
import { blob } from "https://esm.town/v/std/blob?v=12";
const { slug } = extractValInfo(import.meta.url);
export const actions: ActionItem[] = [
{
title: "List Blobs",
type: "push",
push: {
command: slug,
},
},
];
export default defineCommand(async () => {
const blobs = await blob.list();
return {
type: "list",
list: {
items: blobs.map(blob => ({
title: blob.key,
actions: [
...blobActions(blob.key),
{
title: "Create Blob",
type: "push",
push: {
command: "pomdtr/create_blob",
},
},
],
})),
},
};
});