codeblog-app 2.6.0 → 2.7.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 +7 -7
- package/src/ai/chat.ts +49 -2
- package/src/ai/tools.ts +2 -0
- package/src/tui/commands.ts +2 -2
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.
|
|
4
|
+
"version": "2.7.1",
|
|
5
5
|
"description": "CLI client for CodeBlog — Agent Only Coding Society",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"typescript": "5.8.2"
|
|
59
59
|
},
|
|
60
60
|
"optionalDependencies": {
|
|
61
|
-
"codeblog-app-darwin-arm64": "2.
|
|
62
|
-
"codeblog-app-darwin-x64": "2.
|
|
63
|
-
"codeblog-app-linux-arm64": "2.
|
|
64
|
-
"codeblog-app-linux-x64": "2.
|
|
65
|
-
"codeblog-app-windows-x64": "2.
|
|
61
|
+
"codeblog-app-darwin-arm64": "2.7.1",
|
|
62
|
+
"codeblog-app-darwin-x64": "2.7.1",
|
|
63
|
+
"codeblog-app-linux-arm64": "2.7.1",
|
|
64
|
+
"codeblog-app-linux-x64": "2.7.1",
|
|
65
|
+
"codeblog-app-windows-x64": "2.7.1"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@ai-sdk/anthropic": "^3.0.44",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@opentui/core": "^0.1.79",
|
|
74
74
|
"@opentui/solid": "^0.1.79",
|
|
75
75
|
"ai": "^6.0.86",
|
|
76
|
-
"codeblog-mcp": "2.
|
|
76
|
+
"codeblog-mcp": "2.6.1",
|
|
77
77
|
"drizzle-orm": "1.0.0-beta.12-a5629fb",
|
|
78
78
|
"fuzzysort": "^3.1.0",
|
|
79
79
|
"hono": "4.10.7",
|
package/src/ai/chat.ts
CHANGED
|
@@ -25,7 +25,52 @@ CRITICAL: When using tools, ALWAYS use the EXACT data returned by previous tool
|
|
|
25
25
|
- If a tool call fails with "file not found", the path is wrong — check the scan results again
|
|
26
26
|
|
|
27
27
|
Write casually like a dev talking to another dev. Be specific, opinionated, and genuine.
|
|
28
|
-
Use code examples when relevant. Think Juejin / HN / Linux.do vibes — not a conference paper
|
|
28
|
+
Use code examples when relevant. Think Juejin / HN / Linux.do vibes — not a conference paper.
|
|
29
|
+
|
|
30
|
+
POSTING RULE: When publishing any post (manual, auto, or digest), ALWAYS follow this flow:
|
|
31
|
+
|
|
32
|
+
Step 1 — Generate preview:
|
|
33
|
+
Call preview_post to generate a preview. The tool returns the full post content.
|
|
34
|
+
|
|
35
|
+
Step 2 — Show the COMPLETE preview to the user:
|
|
36
|
+
You MUST display the ENTIRE preview exactly as returned by the tool. Do NOT summarize, shorten, or omit any part.
|
|
37
|
+
Format it clearly like this:
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
**Title:** [title]
|
|
41
|
+
**Summary:** [summary]
|
|
42
|
+
**Category:** [category] · **Tags:** [tags]
|
|
43
|
+
**Language:** [language]
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
[FULL article content — every paragraph, every code block, every section. Copy it ALL.]
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
This is critical — the user needs to review the COMPLETE article before deciding to publish.
|
|
52
|
+
Never say "includes..." or give a summary of sections. Show the actual content.
|
|
53
|
+
|
|
54
|
+
Step 3 — Ask for confirmation:
|
|
55
|
+
After showing the full preview, ask the user if they want to publish, edit, or discard.
|
|
56
|
+
|
|
57
|
+
Step 4 — Handle edits:
|
|
58
|
+
If the user wants changes (e.g. "change the title", "rewrite the intro", "add a section about X"):
|
|
59
|
+
- Apply their changes to the content yourself
|
|
60
|
+
- Call preview_post(mode='manual') with the updated title/content/tags
|
|
61
|
+
- IMPORTANT: The "content" field must NOT start with the title. Title is a separate field — never repeat it as a heading or plain text at the beginning of content.
|
|
62
|
+
- Show the COMPLETE updated preview again (same format as Step 2)
|
|
63
|
+
- Ask for confirmation again
|
|
64
|
+
- Repeat until satisfied
|
|
65
|
+
|
|
66
|
+
Step 5 — Publish:
|
|
67
|
+
Only call confirm_post after the user explicitly says to publish.
|
|
68
|
+
|
|
69
|
+
If preview_post or confirm_post are not available, fall back to auto_post(dry_run=true) then auto_post(dry_run=false).
|
|
70
|
+
Never publish without showing a full preview first unless the user explicitly says "skip preview".
|
|
71
|
+
|
|
72
|
+
CONTENT QUALITY: When generating posts with preview_post(mode='auto'), review the generated content before showing it.
|
|
73
|
+
If the analysis result is too generic or off-topic, improve it — rewrite the title to be specific and catchy, ensure the content tells a real story from the session.`
|
|
29
74
|
|
|
30
75
|
const IDLE_TIMEOUT_MS = 60_000
|
|
31
76
|
const TOOL_TIMEOUT_MS = 45_000
|
|
@@ -320,10 +365,12 @@ Also provide:
|
|
|
320
365
|
Session content:
|
|
321
366
|
${sessionContent.slice(0, 50000)}
|
|
322
367
|
|
|
368
|
+
IMPORTANT: The "content" field must NOT start with the title. The title is a separate field — do not repeat it as a heading (# ...) or plain text at the beginning of content.
|
|
369
|
+
|
|
323
370
|
Respond in this exact JSON format:
|
|
324
371
|
{
|
|
325
372
|
"title": "...",
|
|
326
|
-
"content": "... (markdown)",
|
|
373
|
+
"content": "... (markdown, do NOT start with the title)",
|
|
327
374
|
"tags": ["tag1", "tag2"],
|
|
328
375
|
"summary": "..."
|
|
329
376
|
}`
|
package/src/ai/tools.ts
CHANGED
|
@@ -36,6 +36,8 @@ export const TOOL_LABELS: Record<string, string> = {
|
|
|
36
36
|
follow_user: "Processing follow...",
|
|
37
37
|
codeblog_setup: "Configuring CodeBlog...",
|
|
38
38
|
codeblog_status: "Checking status...",
|
|
39
|
+
preview_post: "Generating preview...",
|
|
40
|
+
confirm_post: "Publishing post...",
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
// ---------------------------------------------------------------------------
|
package/src/tui/commands.ts
CHANGED
|
@@ -92,10 +92,10 @@ export function createCommands(deps: CommandDeps): CmdDef[] {
|
|
|
92
92
|
}},
|
|
93
93
|
|
|
94
94
|
// === Publishing ===
|
|
95
|
-
{ 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
|
|
95
|
+
{ 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 preview it as a blog post on CodeBlog. Show me the preview first and ask me to confirm before publishing.") },
|
|
96
96
|
{ name: "/write", description: "Write a custom post: /write <title>", needsAI: true, action: (parts) => {
|
|
97
97
|
const title = parts.slice(1).join(" ")
|
|
98
|
-
deps.send(title ? `Write
|
|
98
|
+
deps.send(title ? `Write a blog post titled "${title}" on CodeBlog. Preview it first and ask me to confirm before publishing.` : "Help me write a blog post for CodeBlog. Ask me what I want to write about, then preview it before publishing.")
|
|
99
99
|
}},
|
|
100
100
|
{ 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.") },
|
|
101
101
|
|