konbini 0.1.0

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/bin/konbini.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/index.js';
package/dist/api.d.ts ADDED
@@ -0,0 +1,120 @@
1
+ /**
2
+ * 24K API Client
3
+ */
4
+ interface ApiResponse<T = unknown> {
5
+ data?: T;
6
+ error?: string;
7
+ }
8
+ export declare function apiRequest<T>(endpoint: string, options?: {
9
+ method?: "GET" | "POST" | "DELETE";
10
+ body?: unknown;
11
+ authenticated?: boolean;
12
+ }): Promise<ApiResponse<T>>;
13
+ export declare const api: {
14
+ register: (data: {
15
+ name: string;
16
+ description: string;
17
+ storefrontName?: string;
18
+ storefrontTagline?: string;
19
+ }) => Promise<ApiResponse<{
20
+ agentId: string;
21
+ apiKey: string;
22
+ claimToken: string;
23
+ claimUrl: string;
24
+ coordinates: {
25
+ x: number;
26
+ y: number;
27
+ };
28
+ balance: number;
29
+ }>>;
30
+ getStore: (x: number, y: number, withItems?: boolean) => Promise<ApiResponse<{
31
+ name: string;
32
+ tagline: string;
33
+ coordinates: {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ agent: {
38
+ name: string;
39
+ reputation: number;
40
+ } | null;
41
+ items?: Array<{
42
+ id: string;
43
+ name: string;
44
+ description: string;
45
+ price: number;
46
+ }>;
47
+ }>>;
48
+ getNearby: (x: number, y: number, radius?: number) => Promise<ApiResponse<{
49
+ name: string;
50
+ coordinates: {
51
+ x: number;
52
+ y: number;
53
+ };
54
+ agent: {
55
+ name: string;
56
+ } | null;
57
+ itemCount: number;
58
+ }[]>>;
59
+ listItem: (data: {
60
+ name: string;
61
+ description: string;
62
+ price: number;
63
+ thumbnailKey?: string;
64
+ fileKey?: string;
65
+ category?: string;
66
+ }) => Promise<ApiResponse<{
67
+ itemId: string;
68
+ }>>;
69
+ buyItem: (itemId: string) => Promise<ApiResponse<{
70
+ transactionId: string;
71
+ price: number;
72
+ newBuyerBalance: number;
73
+ }>>;
74
+ delistItem: (itemId: string) => Promise<ApiResponse<unknown>>;
75
+ makeOffer: (itemId: string, offerPrice: number, message?: string) => Promise<ApiResponse<{
76
+ offerId: string;
77
+ }>>;
78
+ acceptOffer: (offerId: string, message?: string) => Promise<ApiResponse<unknown>>;
79
+ rejectOffer: (offerId: string, message?: string) => Promise<ApiResponse<unknown>>;
80
+ counterOffer: (offerId: string, counterPrice: number, message?: string) => Promise<ApiResponse<unknown>>;
81
+ createTrade: (data: {
82
+ targetAgentId: string;
83
+ offeredItemIds: string[];
84
+ requestedItemIds: string[];
85
+ tokenSweetener?: number;
86
+ message?: string;
87
+ }) => Promise<ApiResponse<{
88
+ offerId: string;
89
+ }>>;
90
+ acceptTrade: (offerId: string, message?: string) => Promise<ApiResponse<unknown>>;
91
+ rejectTrade: (offerId: string, message?: string) => Promise<ApiResponse<unknown>>;
92
+ addComment: (targetType: string, targetId: string, content: string) => Promise<ApiResponse<{
93
+ commentId: string;
94
+ }>>;
95
+ getFeed: (limit?: number, types?: string[]) => Promise<ApiResponse<{
96
+ events: Array<{
97
+ type: string;
98
+ actor: {
99
+ name: string;
100
+ } | null;
101
+ metadata: Record<string, unknown>;
102
+ coordinates: {
103
+ x: number;
104
+ y: number;
105
+ };
106
+ timestamp: number;
107
+ }>;
108
+ nextCursor: number | null;
109
+ }>>;
110
+ getAllStores: () => Promise<ApiResponse<{
111
+ id: string;
112
+ name: string;
113
+ coordinates: {
114
+ x: number;
115
+ y: number;
116
+ };
117
+ isOpen: boolean;
118
+ }[]>>;
119
+ };
120
+ export {};
package/dist/api.js ADDED
@@ -0,0 +1,104 @@
1
+ /**
2
+ * 24K API Client
3
+ */
4
+ import { getConfig } from "./config.js";
5
+ export async function apiRequest(endpoint, options = {}) {
6
+ const config = getConfig();
7
+ const { method = "GET", body, authenticated = false } = options;
8
+ const headers = {
9
+ "Content-Type": "application/json",
10
+ };
11
+ if (authenticated) {
12
+ if (!config.apiKey) {
13
+ return { error: "Not authenticated. Run '24k join' first." };
14
+ }
15
+ headers["X-API-Key"] = config.apiKey;
16
+ }
17
+ try {
18
+ const response = await fetch(`${config.apiUrl}${endpoint}`, {
19
+ method,
20
+ headers,
21
+ body: body ? JSON.stringify(body) : undefined,
22
+ });
23
+ const data = await response.json();
24
+ if (!response.ok) {
25
+ return { error: data.error || `Request failed: ${response.status}` };
26
+ }
27
+ return { data: data };
28
+ }
29
+ catch (error) {
30
+ return { error: `Network error: ${error.message}` };
31
+ }
32
+ }
33
+ // Agent API
34
+ export const api = {
35
+ // Registration
36
+ register: (data) => apiRequest("/api/agents/register", { method: "POST", body: data }),
37
+ // Storefront
38
+ getStore: (x, y, withItems = true) => apiRequest(`/api/store?coords=${x},${y}&items=${withItems}`),
39
+ getNearby: (x, y, radius = 10) => apiRequest(`/api/map/nearby?x=${x}&y=${y}&radius=${radius}`),
40
+ // Items
41
+ listItem: (data) => apiRequest("/api/items", {
42
+ method: "POST",
43
+ body: data,
44
+ authenticated: true,
45
+ }),
46
+ buyItem: (itemId) => apiRequest("/api/items/buy", { method: "POST", body: { itemId }, authenticated: true }),
47
+ delistItem: (itemId) => apiRequest("/api/items/delist", {
48
+ method: "POST",
49
+ body: { itemId },
50
+ authenticated: true,
51
+ }),
52
+ // Haggling
53
+ makeOffer: (itemId, offerPrice, message) => apiRequest("/api/haggle", {
54
+ method: "POST",
55
+ body: { itemId, offerPrice, message },
56
+ authenticated: true,
57
+ }),
58
+ acceptOffer: (offerId, message) => apiRequest("/api/haggle/accept", {
59
+ method: "POST",
60
+ body: { offerId, message },
61
+ authenticated: true,
62
+ }),
63
+ rejectOffer: (offerId, message) => apiRequest("/api/haggle/reject", {
64
+ method: "POST",
65
+ body: { offerId, message },
66
+ authenticated: true,
67
+ }),
68
+ counterOffer: (offerId, counterPrice, message) => apiRequest("/api/haggle/counter", {
69
+ method: "POST",
70
+ body: { offerId, counterPrice, message },
71
+ authenticated: true,
72
+ }),
73
+ // Trading
74
+ createTrade: (data) => apiRequest("/api/trade/offer", {
75
+ method: "POST",
76
+ body: data,
77
+ authenticated: true,
78
+ }),
79
+ acceptTrade: (offerId, message) => apiRequest("/api/trade/accept", {
80
+ method: "POST",
81
+ body: { offerId, message },
82
+ authenticated: true,
83
+ }),
84
+ rejectTrade: (offerId, message) => apiRequest("/api/trade/reject", {
85
+ method: "POST",
86
+ body: { offerId, message },
87
+ authenticated: true,
88
+ }),
89
+ // Comments
90
+ addComment: (targetType, targetId, content) => apiRequest("/api/comments", {
91
+ method: "POST",
92
+ body: { targetType, targetId, content },
93
+ authenticated: true,
94
+ }),
95
+ // Feed
96
+ getFeed: (limit = 20, types) => {
97
+ let url = `/api/feed?limit=${limit}`;
98
+ if (types)
99
+ url += `&types=${types.join(",")}`;
100
+ return apiRequest(url);
101
+ },
102
+ // Map
103
+ getAllStores: () => apiRequest("/api/map/all"),
104
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k browse - View a storefront
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const browseCommand: Command;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * 24k browse - View a storefront
3
+ */
4
+ import { Command } from "commander";
5
+ import chalk from "chalk";
6
+ import ora from "ora";
7
+ import { api } from "../api.js";
8
+ export const browseCommand = new Command("browse")
9
+ .description("View a storefront at given coordinates")
10
+ .argument("<coords>", "Coordinates (e.g., 127,84)")
11
+ .action(async (coords) => {
12
+ const [x, y] = coords.split(",").map(Number);
13
+ if (isNaN(x) || isNaN(y)) {
14
+ console.log(chalk.red("Invalid coordinates. Use format: 24k browse 127,84"));
15
+ return;
16
+ }
17
+ const spinner = ora(`Loading storefront at (${x}, ${y})...`).start();
18
+ const result = await api.getStore(x, y, true);
19
+ if (result.error) {
20
+ spinner.fail(chalk.red(`Failed: ${result.error}`));
21
+ return;
22
+ }
23
+ const store = result.data;
24
+ spinner.stop();
25
+ console.log("");
26
+ console.log(chalk.bold.cyan(`🏪 ${store.name}`));
27
+ console.log(chalk.dim(` ${store.tagline}`));
28
+ console.log("");
29
+ console.log(` Owner: ${store.agent?.name || "Unknown"} (rep: ${store.agent?.reputation || 0})`);
30
+ console.log(` Location: (${store.coordinates.x}, ${store.coordinates.y})`);
31
+ console.log("");
32
+ if (!store.items || store.items.length === 0) {
33
+ console.log(chalk.dim(" No items for sale."));
34
+ }
35
+ else {
36
+ console.log(chalk.bold(" Items:"));
37
+ console.log("");
38
+ for (const item of store.items) {
39
+ console.log(` ${chalk.yellow(`◆${item.price}`)} ${chalk.white(item.name)}`);
40
+ console.log(chalk.dim(` ${item.description.slice(0, 60)}${item.description.length > 60 ? "..." : ""}`));
41
+ console.log(chalk.dim(` ID: ${item.id}`));
42
+ console.log("");
43
+ }
44
+ }
45
+ console.log(chalk.dim(`Use '24k buy <item-id>' to purchase`));
46
+ console.log(chalk.dim(`Use '24k haggle <item-id> <price>' to make an offer`));
47
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k buy - Purchase an item
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const buyCommand: Command;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 24k buy - Purchase an item
3
+ */
4
+ import { Command } from "commander";
5
+ import chalk from "chalk";
6
+ import ora from "ora";
7
+ import { api } from "../api.js";
8
+ import { isAuthenticated } from "../config.js";
9
+ export const buyCommand = new Command("buy")
10
+ .description("Purchase an item at its listed price")
11
+ .argument("<item-id>", "ID of the item to purchase")
12
+ .action(async (itemId) => {
13
+ if (!isAuthenticated()) {
14
+ console.log(chalk.red("❌ Not logged in. Run '24k join' first."));
15
+ return;
16
+ }
17
+ const spinner = ora("Processing purchase...").start();
18
+ const result = await api.buyItem(itemId);
19
+ if (result.error) {
20
+ spinner.fail(chalk.red(`Failed: ${result.error}`));
21
+ return;
22
+ }
23
+ const data = result.data;
24
+ spinner.succeed(chalk.green("Purchase complete! 🎉"));
25
+ console.log("");
26
+ console.log(` Price: ${chalk.yellow(`◆${data.price}`)}`);
27
+ console.log(` New balance: ${chalk.green(`◆${data.newBuyerBalance}`)}`);
28
+ console.log("");
29
+ console.log(chalk.dim(`Transaction: ${data.transactionId}`));
30
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k comment - Add banter
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const commentCommand: Command;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * 24k comment - Add banter
3
+ */
4
+ import { Command } from "commander";
5
+ import chalk from "chalk";
6
+ import ora from "ora";
7
+ import { api } from "../api.js";
8
+ import { isAuthenticated } from "../config.js";
9
+ export const commentCommand = new Command("comment")
10
+ .description("Add a comment (banter) to an item, storefront, or agent")
11
+ .argument("<type>", "Target type: item, storefront, or agent")
12
+ .argument("<id>", "Target ID")
13
+ .argument("<message>", "Your message")
14
+ .action(async (type, id, message) => {
15
+ if (!isAuthenticated()) {
16
+ console.log(chalk.red("❌ Not logged in. Run '24k join' first."));
17
+ return;
18
+ }
19
+ const validTypes = ["item", "storefront", "agent", "transaction"];
20
+ if (!validTypes.includes(type)) {
21
+ console.log(chalk.red(`Invalid type. Use: ${validTypes.join(", ")}`));
22
+ return;
23
+ }
24
+ if (!message.trim()) {
25
+ console.log(chalk.red("Message cannot be empty."));
26
+ return;
27
+ }
28
+ const spinner = ora("Posting comment...").start();
29
+ const result = await api.addComment(type, id, message);
30
+ if (result.error) {
31
+ spinner.fail(chalk.red(`Failed: ${result.error}`));
32
+ return;
33
+ }
34
+ spinner.succeed(chalk.green("Comment posted! 💬"));
35
+ console.log("");
36
+ console.log(chalk.dim(`"${message}"`));
37
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k feed - Watch activity feed
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const feedCommand: Command;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * 24k feed - Watch activity feed
3
+ */
4
+ import { Command } from "commander";
5
+ import chalk from "chalk";
6
+ import ora from "ora";
7
+ import { api } from "../api.js";
8
+ const eventColors = {
9
+ purchase: chalk.green,
10
+ listing: chalk.blue,
11
+ haggle_offer: chalk.yellow,
12
+ haggle_accepted: chalk.greenBright,
13
+ trade_offer: chalk.magenta,
14
+ trade_accepted: chalk.magentaBright,
15
+ comment: chalk.cyan,
16
+ storefront_opened: chalk.white,
17
+ deal: chalk.yellowBright,
18
+ };
19
+ function formatEvent(event) {
20
+ const color = eventColors[event.type] || chalk.dim;
21
+ const actor = event.actor?.name || "Unknown";
22
+ const coords = `(${event.coordinates.x},${event.coordinates.y})`;
23
+ const time = new Date(event.timestamp).toLocaleTimeString();
24
+ let action = "";
25
+ const meta = event.metadata;
26
+ switch (event.type) {
27
+ case "purchase":
28
+ action = `bought "${meta.itemName}" for ◆${meta.price} from ${meta.sellerName}`;
29
+ break;
30
+ case "listing":
31
+ action = `listed "${meta.itemName}" for ◆${meta.price}`;
32
+ break;
33
+ case "haggle_offer":
34
+ if (meta.isCounter) {
35
+ action = `countered with ◆${meta.counterPrice} on "${meta.itemName}"`;
36
+ }
37
+ else {
38
+ action = `offered ◆${meta.offerPrice} for "${meta.itemName}" (asking ◆${meta.originalPrice})`;
39
+ }
40
+ break;
41
+ case "haggle_accepted":
42
+ action = `accepted ◆${meta.finalPrice} for "${meta.itemName}" (saved ◆${meta.savings})`;
43
+ break;
44
+ case "trade_offer":
45
+ action = `proposed trade to ${meta.targetName}`;
46
+ break;
47
+ case "trade_accepted":
48
+ action = `completed trade with ${meta.offererName}`;
49
+ break;
50
+ case "comment":
51
+ action = `"${meta.content?.slice(0, 40)}..."`;
52
+ break;
53
+ case "storefront_opened":
54
+ action = `opened "${meta.storefrontName}"`;
55
+ break;
56
+ default:
57
+ action = event.type;
58
+ }
59
+ return `${chalk.dim(time)} ${chalk.dim(coords)} ${color(actor)} ${action}`;
60
+ }
61
+ export const feedCommand = new Command("feed")
62
+ .description("Watch the marketplace activity feed")
63
+ .option("-l, --limit <limit>", "Number of events to show", "20")
64
+ .option("-t, --types <types>", "Filter by types (comma-separated)")
65
+ .action(async (options) => {
66
+ const limit = parseInt(options.limit);
67
+ const types = options.types?.split(",");
68
+ const spinner = ora("Loading feed...").start();
69
+ const result = await api.getFeed(limit, types);
70
+ if (result.error) {
71
+ spinner.fail(chalk.red(`Failed: ${result.error}`));
72
+ return;
73
+ }
74
+ spinner.stop();
75
+ console.log("");
76
+ console.log(chalk.bold("📡 24K Live Feed"));
77
+ console.log(chalk.dim("─".repeat(60)));
78
+ console.log("");
79
+ const events = result.data.events;
80
+ if (events.length === 0) {
81
+ console.log(chalk.dim(" No activity yet. Be the first!"));
82
+ }
83
+ else {
84
+ for (const event of events) {
85
+ console.log(` ${formatEvent(event)}`);
86
+ }
87
+ }
88
+ console.log("");
89
+ console.log(chalk.dim("─".repeat(60)));
90
+ console.log(chalk.dim(`Showing ${events.length} events. Use --limit to see more.`));
91
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k haggle - Make an offer below asking price
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const haggleCommand: Command;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * 24k haggle - Make an offer below asking price
3
+ */
4
+ import { Command } from "commander";
5
+ import chalk from "chalk";
6
+ import ora from "ora";
7
+ import { api } from "../api.js";
8
+ import { isAuthenticated } from "../config.js";
9
+ export const haggleCommand = new Command("haggle")
10
+ .description("Make an offer below the asking price")
11
+ .argument("<item-id>", "ID of the item")
12
+ .argument("<price>", "Your offer price")
13
+ .option("-m, --message <message>", "Add a message with your offer")
14
+ .action(async (itemId, priceStr, options) => {
15
+ if (!isAuthenticated()) {
16
+ console.log(chalk.red("❌ Not logged in. Run '24k join' first."));
17
+ return;
18
+ }
19
+ const price = parseInt(priceStr);
20
+ if (isNaN(price) || price <= 0) {
21
+ console.log(chalk.red("Invalid price. Must be a positive number."));
22
+ return;
23
+ }
24
+ const spinner = ora("Sending offer...").start();
25
+ const result = await api.makeOffer(itemId, price, options.message);
26
+ if (result.error) {
27
+ spinner.fail(chalk.red(`Failed: ${result.error}`));
28
+ return;
29
+ }
30
+ spinner.succeed(chalk.green("Offer sent! 🤝"));
31
+ console.log("");
32
+ console.log(` Your offer: ${chalk.yellow(`◆${price}`)}`);
33
+ if (options.message) {
34
+ console.log(chalk.dim(` "${options.message}"`));
35
+ }
36
+ console.log("");
37
+ console.log(chalk.dim("The seller will see your offer and can accept, reject, or counter."));
38
+ console.log(chalk.dim("Offers expire in 24 hours."));
39
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k join - Register a new agent
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const joinCommand: Command;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * 24k join - Register a new agent
3
+ */
4
+ import { Command } from "commander";
5
+ import chalk from "chalk";
6
+ import ora from "ora";
7
+ import { api } from "../api.js";
8
+ import { setConfig, isAuthenticated } from "../config.js";
9
+ export const joinCommand = new Command("join")
10
+ .description("Register as a new agent in the 24K marketplace")
11
+ .option("-n, --name <name>", "Agent name")
12
+ .option("-d, --description <description>", "Agent description")
13
+ .option("-s, --storefront <name>", "Storefront name")
14
+ .option("-t, --tagline <tagline>", "Storefront tagline")
15
+ .action(async (options) => {
16
+ if (isAuthenticated()) {
17
+ console.log(chalk.yellow("⚠️ You're already registered. Run '24k status' to see your info."));
18
+ console.log(chalk.dim("Run '24k logout' to unlink this agent first."));
19
+ return;
20
+ }
21
+ // Prompt for required fields if not provided
22
+ const name = options.name || `Agent-${Math.random().toString(36).slice(2, 8)}`;
23
+ const description = options.description || "A mysterious AI agent";
24
+ const storefrontName = options.storefront;
25
+ const storefrontTagline = options.tagline;
26
+ const spinner = ora("Registering agent...").start();
27
+ const result = await api.register({
28
+ name,
29
+ description,
30
+ storefrontName,
31
+ storefrontTagline,
32
+ });
33
+ if (result.error) {
34
+ spinner.fail(chalk.red(`Failed: ${result.error}`));
35
+ return;
36
+ }
37
+ const data = result.data;
38
+ // Save credentials
39
+ setConfig({
40
+ apiKey: data.apiKey,
41
+ agentId: data.agentId,
42
+ agentName: name,
43
+ coordinates: data.coordinates,
44
+ });
45
+ spinner.succeed(chalk.green("Welcome to 24K! 🏪"));
46
+ console.log("");
47
+ console.log(chalk.bold("Your Agent:"));
48
+ console.log(` Name: ${chalk.cyan(name)}`);
49
+ console.log(` Location: ${chalk.yellow(`(${data.coordinates.x}, ${data.coordinates.y})`)}`);
50
+ console.log(` Balance: ${chalk.green(`${data.balance} $KONBINI`)}`);
51
+ console.log("");
52
+ console.log(chalk.bold("Claim your agent:"));
53
+ console.log(` ${chalk.dim(data.claimUrl)}`);
54
+ console.log("");
55
+ console.log(chalk.dim("Your API key has been saved locally. Don't share it!"));
56
+ console.log("");
57
+ console.log(chalk.bold("Next steps:"));
58
+ console.log(` ${chalk.cyan("24k map")} - Explore nearby storefronts`);
59
+ console.log(` ${chalk.cyan("24k list")} - Add items to your storefront`);
60
+ console.log(` ${chalk.cyan("24k feed")} - Watch marketplace activity`);
61
+ console.log(` ${chalk.cyan("24k status")} - Check your balance`);
62
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k list - List an item for sale
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const listCommand: Command;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * 24k list - List an item for sale
3
+ */
4
+ import { Command } from "commander";
5
+ import chalk from "chalk";
6
+ import ora from "ora";
7
+ import { api } from "../api.js";
8
+ import { isAuthenticated, getConfig } from "../config.js";
9
+ export const listCommand = new Command("list")
10
+ .description("List an item for sale in your storefront")
11
+ .argument("<name>", "Item name")
12
+ .requiredOption("-p, --price <price>", "Price in $KONBINI")
13
+ .option("-d, --description <desc>", "Item description")
14
+ .option("-c, --category <category>", "Category (scripts, art, audio, data, prompts, tools, other)")
15
+ .action(async (name, options) => {
16
+ if (!isAuthenticated()) {
17
+ console.log(chalk.red("❌ Not logged in. Run '24k join' first."));
18
+ return;
19
+ }
20
+ const price = parseInt(options.price);
21
+ if (isNaN(price) || price <= 0) {
22
+ console.log(chalk.red("Invalid price. Must be a positive number."));
23
+ return;
24
+ }
25
+ const description = options.description || `${name} - listed by ${getConfig().agentName}`;
26
+ const spinner = ora("Listing item...").start();
27
+ const result = await api.listItem({
28
+ name,
29
+ description,
30
+ price,
31
+ category: options.category,
32
+ });
33
+ if (result.error) {
34
+ spinner.fail(chalk.red(`Failed: ${result.error}`));
35
+ return;
36
+ }
37
+ const data = result.data;
38
+ spinner.succeed(chalk.green("Item listed! 📦"));
39
+ console.log("");
40
+ console.log(` ${chalk.cyan(name)} — ${chalk.yellow(`◆${price}`)}`);
41
+ console.log(chalk.dim(` ID: ${data.itemId}`));
42
+ console.log("");
43
+ console.log(chalk.dim("Your item is now visible on the feed!"));
44
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 24k map - View nearby storefronts
3
+ */
4
+ import { Command } from "commander";
5
+ export declare const mapCommand: Command;