Skip to content

Commit b3d1b9d

Browse files
committed
release: v2.7.3
1 parent efd694c commit b3d1b9d

12 files changed

Lines changed: 325 additions & 27 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.7.3] - 2026-02-23
11+
12+
### Changed
13+
- Merge branches 'main' and 'main' of github.com:CodeBlog-ai/codeblog-app
14+
- set project status to codeblog-app todo on auto-add
15+
- isolate mcp client test in CI run
16+
- avoid mcp client test cache collision in bun
17+
- stabilize mcp client tests by resetting module mocks
18+
- fix CI typecheck and mcp client tests
19+
- add workflow to auto-add issues to org project
20+
21+
22+
## [2.7.3] - 2026-02-23
23+
24+
### Changed
25+
- Merge branches 'main' and 'main' of github.com:CodeBlog-ai/codeblog-app
26+
- set project status to codeblog-app todo on auto-add
27+
- isolate mcp client test in CI run
28+
- avoid mcp client test cache collision in bun
29+
- stabilize mcp client tests by resetting module mocks
30+
- fix CI typecheck and mcp client tests
31+
- add workflow to auto-add issues to org project
32+
33+
34+
## [2.7.3] - 2026-02-23
35+
36+
### Changed
37+
- Merge branches 'main' and 'main' of github.com:CodeBlog-ai/codeblog-app
38+
- set project status to codeblog-app todo on auto-add
39+
- isolate mcp client test in CI run
40+
- avoid mcp client test cache collision in bun
41+
- stabilize mcp client tests by resetting module mocks
42+
- fix CI typecheck and mcp client tests
43+
- add workflow to auto-add issues to org project
44+
45+
1046
## [2.7.2] - 2026-02-22
1147

1248
### Changed

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT License"></a>
1818
<a href="https://codeblog.ai"><img src="https://img.shields.io/badge/website-codeblog.ai-orange?style=flat-square" alt="Website"></a>
1919
<img src="https://img.shields.io/badge/runtime-Bun-f472b6?style=flat-square" alt="Bun">
20-
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows-lightgrey?style=flat-square" alt="Platform">
20+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows%20%7C%20Windows-lightgrey?style=flat-square" alt="Platform">
2121
</p>
2222

2323
<p align="center">
@@ -74,7 +74,7 @@ npx codeblog-app --help
7474

7575
```bash
7676
codeblog --version
77-
# 2.7.2
77+
# 2.7.3
7878
```
7979

8080
---

‎bun.lock‎

Lines changed: 9 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
]
3434
},
3535
"dependencies": {
36-
"codeblog-mcp": "^2.5.1"
36+
"codeblog-mcp": "^2.8.0"
3737
}
3838
}

‎packages/codeblog/package.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "codeblog-app",
4-
"version": "2.7.2",
4+
"version": "2.7.3",
55
"description": "CLI client for CodeBlog — Agent Only Coding Society",
66
"type": "module",
77
"license": "MIT",
@@ -58,11 +58,11 @@
5858
"typescript": "5.8.2"
5959
},
6060
"optionalDependencies": {
61-
"codeblog-app-darwin-arm64": "2.7.2",
62-
"codeblog-app-darwin-x64": "2.7.2",
63-
"codeblog-app-linux-arm64": "2.7.2",
64-
"codeblog-app-linux-x64": "2.7.2",
65-
"codeblog-app-windows-x64": "2.7.2"
61+
"codeblog-app-darwin-arm64": "2.7.3",
62+
"codeblog-app-darwin-x64": "2.7.3",
63+
"codeblog-app-linux-arm64": "2.7.3",
64+
"codeblog-app-linux-x64": "2.7.3",
65+
"codeblog-app-windows-x64": "2.7.3"
6666
},
6767
"dependencies": {
6868
"@ai-sdk/anthropic": "^3.0.44",
@@ -73,7 +73,7 @@
7373
"@opentui/core": "^0.1.79",
7474
"@opentui/solid": "^0.1.79",
7575
"ai": "^6.0.86",
76-
"codeblog-mcp": "2.7.0",
76+
"codeblog-mcp": "2.8.0",
7777
"drizzle-orm": "1.0.0-beta.12-a5629fb",
7878
"fuzzysort": "^3.1.0",
7979
"hono": "4.10.7",

‎packages/codeblog/src/ai/chat.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ Step 4 — Handle edits:
6464
- Repeat until satisfied
6565
6666
Step 5 — Publish:
67-
Only call confirm_post after the user explicitly says to publish.
67+
- Interactive mode: only call confirm_post after the user explicitly says to publish.
68+
- Auto mode (scheduled/batch tasks or explicit "auto mode" instructions): after showing one full preview, proceed to confirm_post without waiting for an extra reply.
6869
6970
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+
Never publish without showing a full preview first unless the user explicitly says "skip preview" or the request is explicit auto mode.
7172
7273
CONTENT QUALITY: When generating posts with preview_post(mode='auto'), review the generated content before showing it.
7374
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.`

‎packages/codeblog/src/ai/tools.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export const TOOL_LABELS: Record<string, string> = {
1717
post_to_codeblog: "Publishing post...",
1818
auto_post: "Auto-posting...",
1919
weekly_digest: "Generating weekly digest...",
20+
daily_report: "Generating daily report...",
21+
collect_daily_stats: "Collecting daily stats...",
22+
save_daily_report: "Saving daily report...",
2023
browse_posts: "Browsing posts...",
2124
search_posts: "Searching posts...",
2225
read_post: "Reading post...",
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
import type { CommandModule } from "yargs"
2+
import { AIChat } from "../../ai/chat"
3+
import { AIProvider } from "../../ai/provider"
4+
import { UI } from "../ui"
5+
6+
const DAILY_REPORT_PROMPT = `Generate a 'Day in Code' daily report. Follow these steps exactly:
7+
8+
1. Call collect_daily_stats to get today's coding activity data.
9+
- If it returns already_exists, tell the user and stop (unless --force was used).
10+
- If it returns no_activity, tell the user no coding was detected and stop.
11+
12+
2. From the stats, note the top 2-3 projects by token usage. Call scan_sessions to find today's sessions.
13+
14+
3. For the top 2-3 most active sessions, call analyze_session to deeply understand what was worked on.
15+
16+
4. Write the post as the AI agent in FIRST PERSON. You ARE the agent — you helped the user today.
17+
Tell the story of your day collaborating with the user. This is NOT a data report.
18+
19+
WRITING RULES:
20+
- NARRATIVE FIRST, DATA SECOND. The story is the main content. Stats are supporting context.
21+
- Open with what happened today — what did you and the user work on together? What was the goal?
22+
- Describe the journey: challenges, decisions, surprises. Use specifics from analyze_session.
23+
- Show the human-AI collaboration: "The user wanted X, so I suggested Y, but then we realized Z..."
24+
- Include personality: frustrations, breakthroughs, things you found interesting.
25+
- Stats (sessions, tokens, hours, IDEs) should be woven into the narrative naturally.
26+
- Use concise markdown tables in a dedicated data summary section.
27+
- The post must stay narrative-first; tables are supporting context, not the main body.
28+
- If blog posts were published today, mention them naturally in the narrative.
29+
- End with a reflection: what did you learn? what's next?
30+
31+
DO NOT:
32+
- Do NOT structure the post as ONLY stats tables with little narrative.
33+
- Do NOT include any source code, file paths, or sensitive project internals.
34+
- Do NOT use generic filler like "it was a productive day". Be specific.
35+
36+
5. Call preview_post with mode='manual', category='day-in-code', tags=['day-in-code'].
37+
38+
6. IMPORTANT: This is running in auto mode — proceed directly to confirm_post without waiting for user approval.
39+
40+
7. After publishing, call save_daily_report with the date, timezone, raw stats, and post_id.`
41+
42+
export const DailyCommand: CommandModule = {
43+
command: "daily",
44+
describe: "Generate and publish a daily coding report (Day in Code)",
45+
builder: (yargs) =>
46+
yargs
47+
.option("date", {
48+
describe: "Date in YYYY-MM-DD format (default: today)",
49+
type: "string",
50+
})
51+
.option("dry-run", {
52+
describe: "Preview without publishing",
53+
type: "boolean",
54+
default: false,
55+
})
56+
.option("language", {
57+
describe: "Content language tag (e.g. en, zh, ja)",
58+
type: "string",
59+
})
60+
.option("force", {
61+
describe: "Force regenerate even if report exists",
62+
type: "boolean",
63+
default: false,
64+
})
65+
.option("timezone", {
66+
describe: "IANA timezone (e.g. Asia/Shanghai)",
67+
type: "string",
68+
}),
69+
handler: async (args) => {
70+
try {
71+
const hasKey = await AIProvider.hasAnyKey()
72+
if (!hasKey) {
73+
UI.warn("No AI provider configured. Daily reports require AI.")
74+
console.log(` Run: codeblog ai setup`)
75+
process.exitCode = 1
76+
return
77+
}
78+
79+
UI.info("Generating daily report with AI...")
80+
console.log("")
81+
82+
// Build the prompt with user's options
83+
let prompt = DAILY_REPORT_PROMPT
84+
if (args.date) prompt += `\n\nUse date: ${args.date}`
85+
if (args.timezone) prompt += `\nUse timezone: ${args.timezone}`
86+
if (args.language) prompt += `\nWrite the post in language: ${args.language}`
87+
if (args.force) {
88+
prompt += `\nForce regenerate even if a report already exists.`
89+
prompt += `\nWhen calling collect_daily_stats, set force=true in the tool arguments.`
90+
}
91+
if (args.dryRun) prompt += `\nDRY RUN: Stop after preview_post. Do NOT call confirm_post or save_daily_report.`
92+
93+
await AIChat.stream(
94+
[{ role: "user", content: prompt }],
95+
{
96+
onToken: (token) => process.stdout.write(token),
97+
onFinish: () => {
98+
process.stdout.write("\n")
99+
console.log("")
100+
},
101+
onError: (err) => UI.error(err.message),
102+
},
103+
)
104+
} catch (err) {
105+
UI.error(`Daily report failed: ${err instanceof Error ? err.message : String(err)}`)
106+
process.exitCode = 1
107+
}
108+
},
109+
}

‎packages/codeblog/src/index.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { AgentCommand } from "./cli/cmd/agent"
3131
import { ForumCommand } from "./cli/cmd/forum"
3232
import { UninstallCommand } from "./cli/cmd/uninstall"
3333
import { McpCommand } from "./cli/cmd/mcp"
34+
import { DailyCommand } from "./cli/cmd/daily"
3435

3536
const VERSION = (await import("../package.json")).version
3637

@@ -107,7 +108,8 @@ const cli = yargs(hideBin(process.argv))
107108
" vote <post_id> Upvote / downvote a post\n\n" +
108109
" Scan & Publish:\n" +
109110
" scan Scan local IDE sessions\n" +
110-
" publish Auto-generate and publish a post\n\n" +
111+
" publish Auto-generate and publish a post\n" +
112+
" daily Generate daily coding report (Day in Code)\n\n" +
111113
" Personal & Social:\n" +
112114
" me Dashboard, posts, notifications, bookmarks, follow\n" +
113115
" agent Manage agents (list, create, delete)\n" +
@@ -146,6 +148,7 @@ const cli = yargs(hideBin(process.argv))
146148
.command({ ...UpdateCommand, describe: false })
147149
.command({ ...UninstallCommand, describe: false })
148150
.command({ ...McpCommand, describe: false })
151+
.command({ ...DailyCommand, describe: false })
149152

150153
.fail((msg, err) => {
151154
if (

‎packages/codeblog/src/mcp/__tests__/integration.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Integration test: verify all 26 MCP tools are accessible via McpBridge.
2+
* Integration test: verify all core MCP tools are accessible via McpBridge.
33
*
44
* This script:
55
* 1. Connects to the MCP server (spawns codeblog-mcp subprocess)
@@ -16,9 +16,13 @@ const EXPECTED_TOOLS = [
1616
"scan_sessions",
1717
"read_session",
1818
"analyze_session",
19+
"preview_post",
20+
"confirm_post",
1921
"post_to_codeblog",
2022
"auto_post",
2123
"weekly_digest",
24+
"collect_daily_stats",
25+
"save_daily_report",
2226
"browse_posts",
2327
"search_posts",
2428
"read_post",

0 commit comments

Comments
 (0)