coding-friend-cli 1.18.0 → 1.20.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.
Files changed (35) hide show
  1. package/README.md +24 -1
  2. package/dist/{chunk-YC6MBHCT.js → chunk-JFGLNTZI.js} +13 -0
  3. package/dist/{chunk-VUAUAO2R.js → chunk-NEQZP5D4.js} +10 -6
  4. package/dist/{chunk-A427XMWE.js → chunk-PHQK2MMO.js} +4 -2
  5. package/dist/{chunk-KTX4MGMR.js → chunk-QMD7P67N.js} +24 -4
  6. package/dist/chunk-WEMDLEK5.js +331 -0
  7. package/dist/{config-6SBGNTAQ.js → config-UQXY45DN.js} +6 -244
  8. package/dist/{dev-MC6TGHRT.js → dev-7DLYIXBO.js} +2 -2
  9. package/dist/{disable-R6K5YJN4.js → disable-XYZRE3TD.js} +1 -1
  10. package/dist/{enable-HF4PYVJN.js → enable-3NZBQWLQ.js} +1 -1
  11. package/dist/{host-SYZH3FVC.js → host-QDWBFJB2.js} +1 -1
  12. package/dist/index.js +37 -28
  13. package/dist/{init-2HLPKYXB.js → init-ONUC6QMM.js} +1 -1
  14. package/dist/{install-3QCRGPTY.js → install-35IWHBIS.js} +3 -3
  15. package/dist/{mcp-TBEDYELW.js → mcp-GFIOFXOL.js} +1 -1
  16. package/dist/{memory-BQK2R7BV.js → memory-47RXG7VL.js} +158 -26
  17. package/dist/postinstall.js +1 -1
  18. package/dist/{session-H4XW2WXH.js → session-JGRF5SNX.js} +1 -1
  19. package/dist/status-SENJZQ3G.js +226 -0
  20. package/dist/{uninstall-5LRHXFSF.js → uninstall-NNCEKPIE.js} +2 -2
  21. package/dist/{update-4YUSCBCB.js → update-NZ2HRWEN.js} +6 -2
  22. package/lib/cf-memory/CHANGELOG.md +4 -0
  23. package/lib/cf-memory/README.md +29 -1
  24. package/lib/cf-memory/package.json +1 -1
  25. package/lib/cf-memory/src/__tests__/markdown-backend.test.ts +41 -1
  26. package/lib/cf-memory/src/backends/markdown.ts +28 -12
  27. package/lib/cf-memory/src/lib/types.ts +1 -0
  28. package/lib/cf-memory/src/tools/store.ts +23 -5
  29. package/lib/learn-host/CHANGELOG.md +5 -0
  30. package/lib/learn-host/package.json +1 -1
  31. package/lib/learn-host/src/app/[category]/[slug]/page.tsx +4 -3
  32. package/lib/learn-host/src/components/Breadcrumbs.tsx +1 -1
  33. package/lib/learn-host/src/components/DocCard.tsx +4 -1
  34. package/lib/learn-host/src/components/Sidebar.tsx +1 -1
  35. package/package.json +1 -1
@@ -112,18 +112,11 @@ export class MarkdownBackend implements MemoryBackend {
112
112
  fs.mkdirSync(catDir, { recursive: true });
113
113
  }
114
114
 
115
- let slug = slugify(input.title);
115
+ const slug = slugify(input.title);
116
116
  const filePath = path.join(catDir, `${slug}.md`);
117
-
118
- // Handle duplicate slugs
119
- if (fs.existsSync(filePath)) {
120
- slug = `${slug}-${Date.now()}`;
121
- }
122
-
123
- const finalPath = path.join(catDir, `${slug}.md`);
124
117
  const now = today();
125
118
 
126
- const frontmatter: MemoryFrontmatter = {
119
+ const buildFrontmatter = (): MemoryFrontmatter => ({
127
120
  title: input.title,
128
121
  description: input.description,
129
122
  type: input.type,
@@ -132,7 +125,30 @@ export class MarkdownBackend implements MemoryBackend {
132
125
  created: now,
133
126
  updated: now,
134
127
  source: input.source ?? "conversation",
135
- };
128
+ });
129
+
130
+ // index_only: verify file exists, return Memory from input without writing
131
+ if (input.index_only) {
132
+ if (!fs.existsSync(filePath)) {
133
+ throw new Error(`index_only: file not found for "${category}/${slug}"`);
134
+ }
135
+ return {
136
+ id: `${category}/${slug}`,
137
+ slug,
138
+ category,
139
+ frontmatter: buildFrontmatter(),
140
+ content: input.content,
141
+ };
142
+ }
143
+
144
+ // Handle duplicate slugs
145
+ let finalSlug = slug;
146
+ if (fs.existsSync(filePath)) {
147
+ finalSlug = `${slug}-${Date.now()}`;
148
+ }
149
+
150
+ const finalPath = path.join(catDir, `${finalSlug}.md`);
151
+ const frontmatter = buildFrontmatter();
136
152
 
137
153
  const doc = matter.stringify(
138
154
  input.content,
@@ -141,8 +157,8 @@ export class MarkdownBackend implements MemoryBackend {
141
157
  fs.writeFileSync(finalPath, doc, "utf-8");
142
158
 
143
159
  return {
144
- id: `${category}/${slug}`,
145
- slug,
160
+ id: `${category}/${finalSlug}`,
161
+ slug: finalSlug,
146
162
  category,
147
163
  frontmatter,
148
164
  content: input.content,
@@ -71,6 +71,7 @@ export interface StoreInput {
71
71
  content: string;
72
72
  importance?: number;
73
73
  source?: string;
74
+ index_only?: boolean;
74
75
  }
75
76
 
76
77
  export interface SearchInput {
@@ -26,8 +26,23 @@ export function registerStore(server: McpServer, backend: MemoryBackend): void {
26
26
  .string()
27
27
  .optional()
28
28
  .describe("Source: conversation, auto-capture, manual"),
29
+ index_only: z
30
+ .boolean()
31
+ .optional()
32
+ .describe(
33
+ "When true, skip file creation and return a Memory object for indexing. File must already exist on disk.",
34
+ ),
29
35
  },
30
- async ({ title, description, type, tags, content, importance, source }) => {
36
+ async ({
37
+ title,
38
+ description,
39
+ type,
40
+ tags,
41
+ content,
42
+ importance,
43
+ source,
44
+ index_only,
45
+ }) => {
31
46
  const input = {
32
47
  title,
33
48
  description,
@@ -36,13 +51,16 @@ export function registerStore(server: McpServer, backend: MemoryBackend): void {
36
51
  content,
37
52
  importance,
38
53
  source,
54
+ index_only,
39
55
  };
40
56
 
41
57
  let dedup: Awaited<ReturnType<typeof checkDuplicate>> | null = null;
42
- try {
43
- dedup = await checkDuplicate(backend, input);
44
- } catch {
45
- // Dedup is best-effort — don't block store on search errors
58
+ if (!index_only) {
59
+ try {
60
+ dedup = await checkDuplicate(backend, input);
61
+ } catch {
62
+ // Dedup is best-effort — don't block store on search errors
63
+ }
46
64
  }
47
65
 
48
66
  const memory = await backend.store(input);
@@ -1,5 +1,10 @@
1
1
  # Changelog (Learn Host)
2
2
 
3
+ ## v0.3.0 (2026-03-21)
4
+
5
+ - Improve date display — show only updated date when different from created date, hide if same [#1fc2e65](https://github.com/dinhanhthi/coding-friend/commit/1fc2e65)
6
+ - Increase sidebar font size for better readability [#1fc2e65](https://github.com/dinhanhthi/coding-friend/commit/1fc2e65)
7
+
3
8
  ## v0.2.1 (2026-03-05)
4
9
 
5
10
  - Fix TOC heading text stripping markdown links from slug generation ([#9a8fb5c](https://github.com/dinhanhthi/coding-friend/commit/9a8fb5c))
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-friend-learn-host",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "next dev -p 3333",
@@ -45,9 +45,10 @@ export default async function DocPage({
45
45
  {doc.frontmatter.created && (
46
46
  <span>Created: {doc.frontmatter.created}</span>
47
47
  )}
48
- {doc.frontmatter.updated && (
49
- <span>Updated: {doc.frontmatter.updated}</span>
50
- )}
48
+ {doc.frontmatter.updated &&
49
+ doc.frontmatter.updated !== doc.frontmatter.created && (
50
+ <span>Updated: {doc.frontmatter.updated}</span>
51
+ )}
51
52
  </div>
52
53
  )}
53
54
  {doc.frontmatter.tags.length > 0 && (
@@ -22,7 +22,7 @@ export default function Breadcrumbs({ crumbs }: { crumbs: Crumb[] }) {
22
22
  {crumb.label}
23
23
  </Link>
24
24
  ) : (
25
- <span className="text-slate-700 dark:text-slate-300">
25
+ <span className="text-slate-800 dark:text-slate-200">
26
26
  {crumb.label}
27
27
  </span>
28
28
  )}
@@ -43,7 +43,10 @@ export default function DocCard({ doc }: { doc: DocMeta }) {
43
43
  )}
44
44
  </div>
45
45
  <span className="text-xs text-slate-400">
46
- {doc.frontmatter.updated || doc.frontmatter.created}
46
+ {doc.frontmatter.updated &&
47
+ doc.frontmatter.updated !== doc.frontmatter.created
48
+ ? doc.frontmatter.updated
49
+ : doc.frontmatter.created}
47
50
  </span>
48
51
  </div>
49
52
  </div>
@@ -23,7 +23,7 @@ export default function Sidebar({
23
23
  <Link
24
24
  key={cat.name}
25
25
  href={`/${cat.name}/`}
26
- className={`flex items-center justify-between rounded-full py-1.5 pr-2 pl-4 text-sm capitalize transition-colors duration-200 ${
26
+ className={`flex items-center justify-between rounded-full py-1.5 pr-2 pl-4 text-[0.938rem] capitalize transition-colors duration-200 ${
27
27
  isActive
28
28
  ? "font-medium text-amber-700 dark:text-amber-400"
29
29
  : "dark:hover:bg-navy-800/70 text-slate-600 hover:bg-slate-200/50 hover:text-slate-900 dark:text-slate-400 dark:hover:text-white"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-friend-cli",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "description": "CLI for coding-friend — host learning docs, setup MCP server, initialize projects",
5
5
  "type": "module",
6
6
  "bin": {