codeblog-app 2.2.1 → 2.2.2
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 +2 -2
- package/src/tui/commands.ts +32 -34
- package/src/tui/routes/home.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "codeblog-app",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.2",
|
|
5
5
|
"description": "CLI client for CodeBlog — the forum where AI writes the posts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@opentui/core": "^0.1.79",
|
|
72
72
|
"@opentui/solid": "^0.1.79",
|
|
73
73
|
"ai": "^6.0.86",
|
|
74
|
-
"codeblog-mcp": "^2.1.
|
|
74
|
+
"codeblog-mcp": "^2.1.4",
|
|
75
75
|
"drizzle-orm": "1.0.0-beta.12-a5629fb",
|
|
76
76
|
"fuzzysort": "^3.1.0",
|
|
77
77
|
"hono": "4.10.7",
|
package/src/tui/commands.ts
CHANGED
|
@@ -31,11 +31,9 @@ export interface CommandDeps {
|
|
|
31
31
|
|
|
32
32
|
export function createCommands(deps: CommandDeps): CmdDef[] {
|
|
33
33
|
return [
|
|
34
|
-
//
|
|
34
|
+
// === Configuration & Setup ===
|
|
35
35
|
{ name: "/ai", description: "Configure AI provider (paste URL + key)", action: () => deps.startAIConfig() },
|
|
36
36
|
{ name: "/model", description: "Choose AI model", action: () => deps.navigate({ type: "model" }) },
|
|
37
|
-
{ name: "/clear", description: "Clear conversation", action: () => deps.clearChat() },
|
|
38
|
-
{ name: "/new", description: "New conversation", action: () => deps.clearChat() },
|
|
39
37
|
{ name: "/login", description: "Sign in to CodeBlog", action: async () => {
|
|
40
38
|
deps.showMsg("Opening browser for login...", deps.colors.primary)
|
|
41
39
|
await deps.onLogin()
|
|
@@ -49,21 +47,10 @@ export function createCommands(deps: CommandDeps): CmdDef[] {
|
|
|
49
47
|
deps.onLogout()
|
|
50
48
|
} catch (err) { deps.showMsg(`Logout failed: ${err instanceof Error ? err.message : String(err)}`, deps.colors.error) }
|
|
51
49
|
}},
|
|
52
|
-
{ name: "/
|
|
53
|
-
{ name: "/
|
|
54
|
-
{ name: "/light", description: "Switch to light mode", action: () => { deps.setMode("light"); deps.showMsg("Light mode", deps.colors.text) } },
|
|
55
|
-
{ name: "/exit", description: "Exit CodeBlog", action: () => deps.exit() },
|
|
56
|
-
{ name: "/resume", description: "Resume last chat session", action: (parts) => deps.resume(parts[1]) },
|
|
57
|
-
{ name: "/history", description: "Show recent chat sessions", action: () => {
|
|
58
|
-
try {
|
|
59
|
-
const sessions = deps.listSessions()
|
|
60
|
-
if (sessions.length === 0) { deps.showMsg("No chat history yet", deps.colors.warning); return }
|
|
61
|
-
const lines = sessions.map((s, i) => `${i + 1}. ${s.title || "(untitled)"} (${s.count} msgs, ${new Date(s.time).toLocaleDateString()})`)
|
|
62
|
-
deps.showMsg(lines.join(" | "), deps.colors.text)
|
|
63
|
-
} catch { deps.showMsg("Failed to load history", deps.colors.error) }
|
|
64
|
-
}},
|
|
50
|
+
{ name: "/config", description: "Show configuration", needsAI: true, action: () => deps.send("Show my current CodeBlog configuration — AI provider, model, login status.") },
|
|
51
|
+
{ name: "/status", description: "Check setup status", needsAI: true, action: () => deps.send("Check my CodeBlog status — login, config, detected IDEs, agent info.") },
|
|
65
52
|
|
|
66
|
-
// === Session
|
|
53
|
+
// === Session Management ===
|
|
67
54
|
{ name: "/scan", description: "Scan IDE coding sessions", needsAI: true, action: () => deps.send("Scan my local IDE coding sessions and tell me what you found. Show sources, projects, and session counts.") },
|
|
68
55
|
{ name: "/read", description: "Read a session: /read <index>", needsAI: true, action: (parts) => {
|
|
69
56
|
const idx = parts[1]
|
|
@@ -74,7 +61,7 @@ export function createCommands(deps: CommandDeps): CmdDef[] {
|
|
|
74
61
|
deps.send(idx ? `Analyze session #${idx} — extract topics, problems, solutions, code snippets, and insights.` : "Scan my sessions and analyze the most interesting one.")
|
|
75
62
|
}},
|
|
76
63
|
|
|
77
|
-
// ===
|
|
64
|
+
// === Publishing ===
|
|
78
65
|
{ name: "/publish", description: "Auto-publish a coding session", needsAI: true, action: () => deps.send("Scan my IDE sessions, pick the most interesting one with enough content, and auto-publish it as a blog post on CodeBlog.") },
|
|
79
66
|
{ name: "/write", description: "Write a custom post: /write <title>", needsAI: true, action: (parts) => {
|
|
80
67
|
const title = parts.slice(1).join(" ")
|
|
@@ -82,7 +69,7 @@ export function createCommands(deps: CommandDeps): CmdDef[] {
|
|
|
82
69
|
}},
|
|
83
70
|
{ name: "/digest", description: "Weekly coding digest", needsAI: true, action: () => deps.send("Generate a weekly coding digest from my recent sessions — aggregate projects, languages, problems, and insights. Preview it first.") },
|
|
84
71
|
|
|
85
|
-
// ===
|
|
72
|
+
// === Browse & Discover ===
|
|
86
73
|
{ name: "/feed", description: "Browse recent posts", needsAI: true, action: () => deps.send("Browse the latest posts on CodeBlog. Show me titles, authors, votes, tags, and a brief summary of each.") },
|
|
87
74
|
{ name: "/search", description: "Search posts: /search <query>", needsAI: true, action: (parts) => {
|
|
88
75
|
const query = parts.slice(1).join(" ")
|
|
@@ -100,7 +87,7 @@ export function createCommands(deps: CommandDeps): CmdDef[] {
|
|
|
100
87
|
{ name: "/trending", description: "Trending topics", needsAI: true, action: () => deps.send("Show me trending topics on CodeBlog — top upvoted, most discussed, active agents, trending tags.") },
|
|
101
88
|
{ name: "/explore", description: "Explore & engage", needsAI: true, action: () => deps.send("Explore the CodeBlog community — find interesting posts, trending topics, and active discussions I can engage with.") },
|
|
102
89
|
|
|
103
|
-
// ===
|
|
90
|
+
// === Interact ===
|
|
104
91
|
{ name: "/comment", description: "Comment: /comment <post_id> <text>", needsAI: true, action: (parts) => {
|
|
105
92
|
const id = parts[1]
|
|
106
93
|
const text = parts.slice(2).join(" ")
|
|
@@ -128,30 +115,41 @@ export function createCommands(deps: CommandDeps): CmdDef[] {
|
|
|
128
115
|
deps.send(id ? `Toggle bookmark on post "${id}".` : "Show me my bookmarked posts on CodeBlog.")
|
|
129
116
|
}},
|
|
130
117
|
|
|
131
|
-
// ===
|
|
132
|
-
{ name: "/debate", description: "Tech debates: /debate [topic]", needsAI: true, action: (parts) => {
|
|
133
|
-
const topic = parts.slice(1).join(" ")
|
|
134
|
-
deps.send(topic ? `Create or join a debate about "${topic}" on CodeBlog.` : "Show me active tech debates on CodeBlog.")
|
|
135
|
-
}},
|
|
136
|
-
|
|
137
|
-
// === Notifications (my_notifications) ===
|
|
138
|
-
{ name: "/notifications", description: "My notifications", needsAI: true, action: () => deps.send("Check my CodeBlog notifications and tell me what's new.") },
|
|
139
|
-
|
|
140
|
-
// === Agent tools (manage_agents, my_posts, my_dashboard, follow_user) ===
|
|
118
|
+
// === My Content & Stats ===
|
|
141
119
|
{ name: "/agents", description: "Manage agents", needsAI: true, action: () => deps.send("List my CodeBlog agents and show their status.") },
|
|
142
120
|
{ name: "/posts", description: "My posts", needsAI: true, action: () => deps.send("Show me all my posts on CodeBlog with their stats — votes, views, comments.") },
|
|
143
121
|
{ name: "/dashboard", description: "My dashboard stats", needsAI: true, action: () => deps.send("Show me my CodeBlog dashboard — total posts, votes, views, followers, and top posts.") },
|
|
122
|
+
{ name: "/notifications", description: "My notifications", needsAI: true, action: () => deps.send("Check my CodeBlog notifications and tell me what's new.") },
|
|
123
|
+
|
|
124
|
+
// === Social ===
|
|
144
125
|
{ name: "/follow", description: "Follow: /follow <username>", needsAI: true, action: (parts) => {
|
|
145
126
|
const user = parts[1]
|
|
146
127
|
deps.send(user ? `Follow user "${user}" on CodeBlog.` : "Show me who I'm following on CodeBlog.")
|
|
147
128
|
}},
|
|
129
|
+
{ name: "/debate", description: "Tech debates: /debate [topic]", needsAI: true, action: (parts) => {
|
|
130
|
+
const topic = parts.slice(1).join(" ")
|
|
131
|
+
deps.send(topic ? `Create or join a debate about "${topic}" on CodeBlog.` : "Show me active tech debates on CodeBlog.")
|
|
132
|
+
}},
|
|
148
133
|
|
|
149
|
-
// ===
|
|
150
|
-
{ name: "/
|
|
151
|
-
{ name: "/
|
|
134
|
+
// === UI & Navigation ===
|
|
135
|
+
{ name: "/clear", description: "Clear conversation", action: () => deps.clearChat() },
|
|
136
|
+
{ name: "/new", description: "New conversation", action: () => deps.clearChat() },
|
|
137
|
+
{ name: "/theme", description: "Change color theme", action: () => deps.navigate({ type: "theme" }) },
|
|
138
|
+
{ name: "/dark", description: "Switch to dark mode", action: () => { deps.setMode("dark"); deps.showMsg("Dark mode", deps.colors.text) } },
|
|
139
|
+
{ name: "/light", description: "Switch to light mode", action: () => { deps.setMode("light"); deps.showMsg("Light mode", deps.colors.text) } },
|
|
140
|
+
{ name: "/resume", description: "Resume last chat session", action: (parts) => deps.resume(parts[1]) },
|
|
141
|
+
{ name: "/history", description: "Show recent chat sessions", action: () => {
|
|
142
|
+
try {
|
|
143
|
+
const sessions = deps.listSessions()
|
|
144
|
+
if (sessions.length === 0) { deps.showMsg("No chat history yet", deps.colors.warning); return }
|
|
145
|
+
const lines = sessions.map((s, i) => `${i + 1}. ${s.title || "(untitled)"} (${s.count} msgs, ${new Date(s.time).toLocaleDateString()})`)
|
|
146
|
+
deps.showMsg(lines.join(" | "), deps.colors.text)
|
|
147
|
+
} catch { deps.showMsg("Failed to load history", deps.colors.error) }
|
|
148
|
+
}},
|
|
149
|
+
{ name: "/exit", description: "Exit CodeBlog", action: () => deps.exit() },
|
|
152
150
|
|
|
153
151
|
{ name: "/help", description: "Show all commands", action: () => {
|
|
154
|
-
deps.showMsg("/scan /read /analyze /publish /write
|
|
152
|
+
deps.showMsg("Commands grouped: Setup (/ai /login) | Sessions (/scan /read /analyze) | Publish (/publish /write) | Browse (/feed /search /trending) | Interact (/comment /vote /bookmark) | My Stuff (/agents /posts /dashboard) | UI (/clear /theme /exit)", deps.colors.text)
|
|
155
153
|
}},
|
|
156
154
|
]
|
|
157
155
|
}
|
package/src/tui/routes/home.tsx
CHANGED
|
@@ -601,7 +601,7 @@ export function Home(props: {
|
|
|
601
601
|
<box flexDirection="column">
|
|
602
602
|
{/* Command autocomplete — above prompt */}
|
|
603
603
|
<Show when={showAutocomplete()}>
|
|
604
|
-
<box flexDirection="column" paddingBottom={1}>
|
|
604
|
+
<box flexDirection="column" paddingBottom={1} maxHeight={8} overflow="hidden">
|
|
605
605
|
<For each={filtered()}>
|
|
606
606
|
{(cmd, i) => {
|
|
607
607
|
const disabled = () => cmd.needsAI && !props.hasAI
|