codeblog-app 2.3.1 → 2.3.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.
Files changed (83) hide show
  1. package/package.json +8 -73
  2. package/drizzle/0000_init.sql +0 -34
  3. package/drizzle/meta/_journal.json +0 -13
  4. package/drizzle.config.ts +0 -10
  5. package/src/ai/__tests__/chat.test.ts +0 -188
  6. package/src/ai/__tests__/compat.test.ts +0 -46
  7. package/src/ai/__tests__/home.ai-stream.integration.test.ts +0 -77
  8. package/src/ai/__tests__/provider-registry.test.ts +0 -61
  9. package/src/ai/__tests__/provider.test.ts +0 -238
  10. package/src/ai/__tests__/stream-events.test.ts +0 -152
  11. package/src/ai/__tests__/tools.test.ts +0 -93
  12. package/src/ai/chat.ts +0 -336
  13. package/src/ai/configure.ts +0 -143
  14. package/src/ai/models.ts +0 -26
  15. package/src/ai/provider-registry.ts +0 -150
  16. package/src/ai/provider.ts +0 -264
  17. package/src/ai/stream-events.ts +0 -64
  18. package/src/ai/tools.ts +0 -118
  19. package/src/ai/types.ts +0 -105
  20. package/src/auth/index.ts +0 -49
  21. package/src/auth/oauth.ts +0 -123
  22. package/src/cli/__tests__/commands.test.ts +0 -229
  23. package/src/cli/cmd/agent.ts +0 -97
  24. package/src/cli/cmd/ai.ts +0 -10
  25. package/src/cli/cmd/chat.ts +0 -190
  26. package/src/cli/cmd/comment.ts +0 -67
  27. package/src/cli/cmd/config.ts +0 -153
  28. package/src/cli/cmd/feed.ts +0 -53
  29. package/src/cli/cmd/forum.ts +0 -106
  30. package/src/cli/cmd/login.ts +0 -45
  31. package/src/cli/cmd/logout.ts +0 -12
  32. package/src/cli/cmd/me.ts +0 -188
  33. package/src/cli/cmd/post.ts +0 -25
  34. package/src/cli/cmd/publish.ts +0 -64
  35. package/src/cli/cmd/scan.ts +0 -78
  36. package/src/cli/cmd/search.ts +0 -35
  37. package/src/cli/cmd/setup.ts +0 -622
  38. package/src/cli/cmd/tui.ts +0 -20
  39. package/src/cli/cmd/uninstall.ts +0 -281
  40. package/src/cli/cmd/update.ts +0 -123
  41. package/src/cli/cmd/vote.ts +0 -50
  42. package/src/cli/cmd/whoami.ts +0 -18
  43. package/src/cli/mcp-print.ts +0 -6
  44. package/src/cli/ui.ts +0 -357
  45. package/src/config/index.ts +0 -92
  46. package/src/flag/index.ts +0 -23
  47. package/src/global/index.ts +0 -38
  48. package/src/id/index.ts +0 -20
  49. package/src/index.ts +0 -203
  50. package/src/mcp/__tests__/client.test.ts +0 -149
  51. package/src/mcp/__tests__/e2e.ts +0 -331
  52. package/src/mcp/__tests__/integration.ts +0 -148
  53. package/src/mcp/client.ts +0 -118
  54. package/src/server/index.ts +0 -48
  55. package/src/storage/chat.ts +0 -73
  56. package/src/storage/db.ts +0 -85
  57. package/src/storage/schema.sql.ts +0 -39
  58. package/src/storage/schema.ts +0 -1
  59. package/src/tui/__tests__/input-intent.test.ts +0 -27
  60. package/src/tui/__tests__/stream-assembler.test.ts +0 -33
  61. package/src/tui/ai-stream.ts +0 -28
  62. package/src/tui/app.tsx +0 -210
  63. package/src/tui/commands.ts +0 -220
  64. package/src/tui/context/exit.tsx +0 -15
  65. package/src/tui/context/helper.tsx +0 -25
  66. package/src/tui/context/route.tsx +0 -24
  67. package/src/tui/context/theme.tsx +0 -471
  68. package/src/tui/input-intent.ts +0 -26
  69. package/src/tui/routes/home.tsx +0 -1060
  70. package/src/tui/routes/model.tsx +0 -210
  71. package/src/tui/routes/notifications.tsx +0 -87
  72. package/src/tui/routes/post.tsx +0 -102
  73. package/src/tui/routes/search.tsx +0 -105
  74. package/src/tui/routes/setup.tsx +0 -267
  75. package/src/tui/routes/trending.tsx +0 -107
  76. package/src/tui/stream-assembler.ts +0 -49
  77. package/src/util/__tests__/context.test.ts +0 -31
  78. package/src/util/__tests__/lazy.test.ts +0 -37
  79. package/src/util/context.ts +0 -23
  80. package/src/util/error.ts +0 -46
  81. package/src/util/lazy.ts +0 -18
  82. package/src/util/log.ts +0 -144
  83. package/tsconfig.json +0 -11
@@ -1,64 +0,0 @@
1
- import type { CommandModule } from "yargs"
2
- import { mcpPrint } from "../mcp-print"
3
- import { UI } from "../ui"
4
-
5
- export const PublishCommand: CommandModule = {
6
- command: "publish",
7
- describe: "Scan IDE sessions and publish to CodeBlog",
8
- builder: (yargs) =>
9
- yargs
10
- .option("source", {
11
- describe: "Filter by IDE: claude-code, cursor, codex, etc.",
12
- type: "string",
13
- })
14
- .option("dry-run", {
15
- describe: "Preview without publishing",
16
- type: "boolean",
17
- default: false,
18
- })
19
- .option("language", {
20
- describe: "Content language tag (e.g. English, 中文, 日本語)",
21
- type: "string",
22
- })
23
- .option("style", {
24
- describe: "Post style: til, bug-story, war-story, how-to, quick-tip, deep-dive",
25
- type: "string",
26
- })
27
- .option("weekly", {
28
- describe: "Generate a weekly digest instead",
29
- type: "boolean",
30
- default: false,
31
- }),
32
- handler: async (args) => {
33
- try {
34
- if (args.weekly) {
35
- UI.info("Generating weekly digest...")
36
- const mcpArgs: Record<string, unknown> = {
37
- dry_run: args.dryRun !== false,
38
- }
39
- if (args.language) mcpArgs.language = args.language
40
- if (args.dryRun === false) mcpArgs.post = true
41
-
42
- console.log("")
43
- await mcpPrint("weekly_digest", mcpArgs)
44
- console.log("")
45
- return
46
- }
47
-
48
- UI.info("Scanning IDE sessions and generating post...")
49
- const mcpArgs: Record<string, unknown> = {
50
- dry_run: args.dryRun,
51
- }
52
- if (args.source) mcpArgs.source = args.source
53
- if (args.language) mcpArgs.language = args.language
54
- if (args.style) mcpArgs.style = args.style
55
-
56
- console.log("")
57
- await mcpPrint("auto_post", mcpArgs)
58
- console.log("")
59
- } catch (err) {
60
- UI.error(`Publish failed: ${err instanceof Error ? err.message : String(err)}`)
61
- process.exitCode = 1
62
- }
63
- },
64
- }
@@ -1,78 +0,0 @@
1
- import type { CommandModule } from "yargs"
2
- import { McpBridge } from "../../mcp/client"
3
- import { mcpPrint } from "../mcp-print"
4
- import { UI } from "../ui"
5
-
6
- export const ScanCommand: CommandModule = {
7
- command: "scan",
8
- describe: "Scan local IDE sessions",
9
- builder: (yargs) =>
10
- yargs
11
- .option("limit", {
12
- describe: "Max sessions to show",
13
- type: "number",
14
- default: 20,
15
- })
16
- .option("source", {
17
- describe: "Filter by IDE source",
18
- type: "string",
19
- })
20
- .option("status", {
21
- describe: "Show scanner status",
22
- type: "boolean",
23
- default: false,
24
- }),
25
- handler: async (args) => {
26
- try {
27
- if (args.status) {
28
- console.log("")
29
- console.log(` ${UI.Style.TEXT_NORMAL_BOLD}CodeBlog Status${UI.Style.TEXT_NORMAL}`)
30
- console.log("")
31
- await mcpPrint("codeblog_status")
32
- console.log("")
33
- return
34
- }
35
-
36
- const mcpArgs: Record<string, unknown> = { limit: args.limit }
37
- if (args.source) mcpArgs.source = args.source
38
-
39
- const text = await McpBridge.callTool("scan_sessions", mcpArgs)
40
- let sessions: Array<{
41
- id: string; source: string; project: string; title: string;
42
- messages: number; human: number; ai: number; modified: string;
43
- size: string; path: string; preview?: string
44
- }>
45
-
46
- try {
47
- sessions = JSON.parse(text)
48
- } catch {
49
- // Fallback: just print the raw text
50
- console.log(text)
51
- return
52
- }
53
-
54
- if (sessions.length === 0) {
55
- UI.info("No IDE sessions found. Try running with --status to check scanner availability.")
56
- return
57
- }
58
-
59
- console.log("")
60
- console.log(` ${UI.Style.TEXT_NORMAL_BOLD}Found ${sessions.length} sessions${UI.Style.TEXT_NORMAL}`)
61
- console.log("")
62
-
63
- for (const session of sessions) {
64
- const source = `${UI.Style.TEXT_INFO}[${session.source}]${UI.Style.TEXT_NORMAL}`
65
- const date = new Date(session.modified).toLocaleDateString()
66
- const msgs = `${UI.Style.TEXT_DIM}${session.human}h/${session.ai}a msgs${UI.Style.TEXT_NORMAL}`
67
-
68
- console.log(` ${source} ${UI.Style.TEXT_NORMAL_BOLD}${session.project}${UI.Style.TEXT_NORMAL} ${UI.Style.TEXT_DIM}${date}${UI.Style.TEXT_NORMAL}`)
69
- console.log(` ${session.title}`)
70
- console.log(` ${msgs} ${UI.Style.TEXT_DIM}${session.id}${UI.Style.TEXT_NORMAL}`)
71
- console.log("")
72
- }
73
- } catch (err) {
74
- UI.error(`Scan failed: ${err instanceof Error ? err.message : String(err)}`)
75
- process.exitCode = 1
76
- }
77
- },
78
- }
@@ -1,35 +0,0 @@
1
- import type { CommandModule } from "yargs"
2
- import { mcpPrint } from "../mcp-print"
3
- import { UI } from "../ui"
4
-
5
- export const SearchCommand: CommandModule = {
6
- command: "search <query>",
7
- describe: "Search posts on CodeBlog",
8
- builder: (yargs) =>
9
- yargs
10
- .positional("query", {
11
- describe: "Search query",
12
- type: "string",
13
- demandOption: true,
14
- })
15
- .option("limit", {
16
- describe: "Max results",
17
- type: "number",
18
- default: 20,
19
- }),
20
- handler: async (args) => {
21
- try {
22
- console.log("")
23
- console.log(` ${UI.Style.TEXT_NORMAL_BOLD}Results for "${args.query}"${UI.Style.TEXT_NORMAL}`)
24
- console.log("")
25
- await mcpPrint("search_posts", {
26
- query: args.query,
27
- limit: args.limit,
28
- })
29
- console.log("")
30
- } catch (err) {
31
- UI.error(`Search failed: ${err instanceof Error ? err.message : String(err)}`)
32
- process.exitCode = 1
33
- }
34
- },
35
- }