memory-journal-mcp 4.4.2 → 5.0.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 (291) hide show
  1. package/.github/workflows/codeql.yml +1 -6
  2. package/.github/workflows/docker-publish.yml +15 -49
  3. package/.github/workflows/lint-and-test.yml +1 -1
  4. package/.github/workflows/secrets-scanning.yml +4 -3
  5. package/.github/workflows/security-update.yml +3 -3
  6. package/CHANGELOG.md +213 -0
  7. package/CONTRIBUTING.md +132 -97
  8. package/DOCKER_README.md +184 -235
  9. package/Dockerfile +27 -24
  10. package/README.md +218 -190
  11. package/SECURITY.md +27 -35
  12. package/dist/cli.js +16 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/constants/ServerInstructions.d.ts +5 -1
  15. package/dist/constants/ServerInstructions.d.ts.map +1 -1
  16. package/dist/constants/ServerInstructions.js +133 -73
  17. package/dist/constants/ServerInstructions.js.map +1 -1
  18. package/dist/constants/icons.d.ts +2 -2
  19. package/dist/constants/icons.d.ts.map +1 -1
  20. package/dist/constants/icons.js +7 -6
  21. package/dist/constants/icons.js.map +1 -1
  22. package/dist/database/SqliteAdapter.d.ts +37 -24
  23. package/dist/database/SqliteAdapter.d.ts.map +1 -1
  24. package/dist/database/SqliteAdapter.js +319 -157
  25. package/dist/database/SqliteAdapter.js.map +1 -1
  26. package/dist/database/schema.d.ts +45 -0
  27. package/dist/database/schema.d.ts.map +1 -0
  28. package/dist/database/schema.js +92 -0
  29. package/dist/database/schema.js.map +1 -0
  30. package/dist/filtering/ToolFilter.d.ts +1 -1
  31. package/dist/filtering/ToolFilter.d.ts.map +1 -1
  32. package/dist/filtering/ToolFilter.js +13 -2
  33. package/dist/filtering/ToolFilter.js.map +1 -1
  34. package/dist/github/GitHubIntegration.d.ts.map +1 -1
  35. package/dist/github/GitHubIntegration.js +1 -3
  36. package/dist/github/GitHubIntegration.js.map +1 -1
  37. package/dist/handlers/prompts/github.d.ts +12 -0
  38. package/dist/handlers/prompts/github.d.ts.map +1 -0
  39. package/dist/handlers/prompts/github.js +178 -0
  40. package/dist/handlers/prompts/github.js.map +1 -0
  41. package/dist/handlers/prompts/index.d.ts +23 -2
  42. package/dist/handlers/prompts/index.d.ts.map +1 -1
  43. package/dist/handlers/prompts/index.js +7 -432
  44. package/dist/handlers/prompts/index.js.map +1 -1
  45. package/dist/handlers/prompts/workflow.d.ts +12 -0
  46. package/dist/handlers/prompts/workflow.d.ts.map +1 -0
  47. package/dist/handlers/prompts/workflow.js +277 -0
  48. package/dist/handlers/prompts/workflow.js.map +1 -0
  49. package/dist/handlers/resources/core.d.ts +11 -0
  50. package/dist/handlers/resources/core.d.ts.map +1 -0
  51. package/dist/handlers/resources/core.js +433 -0
  52. package/dist/handlers/resources/core.js.map +1 -0
  53. package/dist/handlers/resources/github.d.ts +11 -0
  54. package/dist/handlers/resources/github.d.ts.map +1 -0
  55. package/dist/handlers/resources/github.js +314 -0
  56. package/dist/handlers/resources/github.js.map +1 -0
  57. package/dist/handlers/resources/graph.d.ts +11 -0
  58. package/dist/handlers/resources/graph.d.ts.map +1 -0
  59. package/dist/handlers/resources/graph.js +204 -0
  60. package/dist/handlers/resources/graph.js.map +1 -0
  61. package/dist/handlers/resources/index.d.ts +5 -20
  62. package/dist/handlers/resources/index.d.ts.map +1 -1
  63. package/dist/handlers/resources/index.js +16 -1278
  64. package/dist/handlers/resources/index.js.map +1 -1
  65. package/dist/handlers/resources/shared.d.ts +60 -0
  66. package/dist/handlers/resources/shared.d.ts.map +1 -0
  67. package/dist/handlers/resources/shared.js +49 -0
  68. package/dist/handlers/resources/shared.js.map +1 -0
  69. package/dist/handlers/resources/team.d.ts +13 -0
  70. package/dist/handlers/resources/team.d.ts.map +1 -0
  71. package/dist/handlers/resources/team.js +119 -0
  72. package/dist/handlers/resources/team.js.map +1 -0
  73. package/dist/handlers/resources/templates.d.ts +13 -0
  74. package/dist/handlers/resources/templates.d.ts.map +1 -0
  75. package/dist/handlers/resources/templates.js +310 -0
  76. package/dist/handlers/resources/templates.js.map +1 -0
  77. package/dist/handlers/tools/admin.d.ts +8 -0
  78. package/dist/handlers/tools/admin.d.ts.map +1 -0
  79. package/dist/handlers/tools/admin.js +270 -0
  80. package/dist/handlers/tools/admin.js.map +1 -0
  81. package/dist/handlers/tools/analytics.d.ts +8 -0
  82. package/dist/handlers/tools/analytics.d.ts.map +1 -0
  83. package/dist/handlers/tools/analytics.js +256 -0
  84. package/dist/handlers/tools/analytics.js.map +1 -0
  85. package/dist/handlers/tools/backup.d.ts +8 -0
  86. package/dist/handlers/tools/backup.d.ts.map +1 -0
  87. package/dist/handlers/tools/backup.js +224 -0
  88. package/dist/handlers/tools/backup.js.map +1 -0
  89. package/dist/handlers/tools/core.d.ts +9 -0
  90. package/dist/handlers/tools/core.d.ts.map +1 -0
  91. package/dist/handlers/tools/core.js +326 -0
  92. package/dist/handlers/tools/core.js.map +1 -0
  93. package/dist/handlers/tools/export.d.ts +8 -0
  94. package/dist/handlers/tools/export.d.ts.map +1 -0
  95. package/dist/handlers/tools/export.js +89 -0
  96. package/dist/handlers/tools/export.js.map +1 -0
  97. package/dist/handlers/tools/github/helpers.d.ts +34 -0
  98. package/dist/handlers/tools/github/helpers.d.ts.map +1 -0
  99. package/dist/handlers/tools/github/helpers.js +52 -0
  100. package/dist/handlers/tools/github/helpers.js.map +1 -0
  101. package/dist/handlers/tools/github/insights-tools.d.ts +8 -0
  102. package/dist/handlers/tools/github/insights-tools.d.ts.map +1 -0
  103. package/dist/handlers/tools/github/insights-tools.js +104 -0
  104. package/dist/handlers/tools/github/insights-tools.js.map +1 -0
  105. package/dist/handlers/tools/github/issue-tools.d.ts +8 -0
  106. package/dist/handlers/tools/github/issue-tools.d.ts.map +1 -0
  107. package/dist/handlers/tools/github/issue-tools.js +359 -0
  108. package/dist/handlers/tools/github/issue-tools.js.map +1 -0
  109. package/dist/handlers/tools/github/kanban-tools.d.ts +8 -0
  110. package/dist/handlers/tools/github/kanban-tools.d.ts.map +1 -0
  111. package/dist/handlers/tools/github/kanban-tools.js +108 -0
  112. package/dist/handlers/tools/github/kanban-tools.js.map +1 -0
  113. package/dist/handlers/tools/github/milestone-tools.d.ts +9 -0
  114. package/dist/handlers/tools/github/milestone-tools.d.ts.map +1 -0
  115. package/dist/handlers/tools/github/milestone-tools.js +302 -0
  116. package/dist/handlers/tools/github/milestone-tools.js.map +1 -0
  117. package/dist/handlers/tools/github/mutation-tools.d.ts +12 -0
  118. package/dist/handlers/tools/github/mutation-tools.d.ts.map +1 -0
  119. package/dist/handlers/tools/github/mutation-tools.js +15 -0
  120. package/dist/handlers/tools/github/mutation-tools.js.map +1 -0
  121. package/dist/handlers/tools/github/read-tools.d.ts +8 -0
  122. package/dist/handlers/tools/github/read-tools.d.ts.map +1 -0
  123. package/dist/handlers/tools/github/read-tools.js +260 -0
  124. package/dist/handlers/tools/github/read-tools.js.map +1 -0
  125. package/dist/handlers/tools/github/schemas.d.ts +467 -0
  126. package/dist/handlers/tools/github/schemas.d.ts.map +1 -0
  127. package/dist/handlers/tools/github/schemas.js +335 -0
  128. package/dist/handlers/tools/github/schemas.js.map +1 -0
  129. package/dist/handlers/tools/github.d.ts +14 -0
  130. package/dist/handlers/tools/github.d.ts.map +1 -0
  131. package/dist/handlers/tools/github.js +28 -0
  132. package/dist/handlers/tools/github.js.map +1 -0
  133. package/dist/handlers/tools/index.d.ts +15 -20
  134. package/dist/handlers/tools/index.d.ts.map +1 -1
  135. package/dist/handlers/tools/index.js +117 -2909
  136. package/dist/handlers/tools/index.js.map +1 -1
  137. package/dist/handlers/tools/relationships.d.ts +8 -0
  138. package/dist/handlers/tools/relationships.d.ts.map +1 -0
  139. package/dist/handlers/tools/relationships.js +308 -0
  140. package/dist/handlers/tools/relationships.js.map +1 -0
  141. package/dist/handlers/tools/schemas.d.ts +108 -0
  142. package/dist/handlers/tools/schemas.d.ts.map +1 -0
  143. package/dist/handlers/tools/schemas.js +122 -0
  144. package/dist/handlers/tools/schemas.js.map +1 -0
  145. package/dist/handlers/tools/search.d.ts +8 -0
  146. package/dist/handlers/tools/search.d.ts.map +1 -0
  147. package/dist/handlers/tools/search.js +282 -0
  148. package/dist/handlers/tools/search.js.map +1 -0
  149. package/dist/handlers/tools/team.d.ts +11 -0
  150. package/dist/handlers/tools/team.d.ts.map +1 -0
  151. package/dist/handlers/tools/team.js +239 -0
  152. package/dist/handlers/tools/team.js.map +1 -0
  153. package/dist/server/McpServer.d.ts +4 -0
  154. package/dist/server/McpServer.d.ts.map +1 -1
  155. package/dist/server/McpServer.js +48 -297
  156. package/dist/server/McpServer.js.map +1 -1
  157. package/dist/server/Scheduler.d.ts +91 -0
  158. package/dist/server/Scheduler.d.ts.map +1 -0
  159. package/dist/server/Scheduler.js +201 -0
  160. package/dist/server/Scheduler.js.map +1 -0
  161. package/dist/transports/http.d.ts +66 -0
  162. package/dist/transports/http.d.ts.map +1 -0
  163. package/dist/transports/http.js +519 -0
  164. package/dist/transports/http.js.map +1 -0
  165. package/dist/types/entities.d.ts +101 -0
  166. package/dist/types/entities.d.ts.map +1 -0
  167. package/dist/types/entities.js +5 -0
  168. package/dist/types/entities.js.map +1 -0
  169. package/dist/types/filtering.d.ts +34 -0
  170. package/dist/types/filtering.d.ts.map +1 -0
  171. package/dist/types/filtering.js +5 -0
  172. package/dist/types/filtering.js.map +1 -0
  173. package/dist/types/github.d.ts +166 -0
  174. package/dist/types/github.d.ts.map +1 -0
  175. package/dist/types/github.js +5 -0
  176. package/dist/types/github.js.map +1 -0
  177. package/dist/types/index.d.ts +35 -292
  178. package/dist/types/index.d.ts.map +1 -1
  179. package/dist/types/index.js +2 -2
  180. package/dist/types/index.js.map +1 -1
  181. package/dist/utils/error-helpers.d.ts +37 -0
  182. package/dist/utils/error-helpers.d.ts.map +1 -0
  183. package/dist/utils/error-helpers.js +47 -0
  184. package/dist/utils/error-helpers.js.map +1 -0
  185. package/dist/utils/logger.d.ts.map +1 -1
  186. package/dist/utils/logger.js +6 -3
  187. package/dist/utils/logger.js.map +1 -1
  188. package/dist/utils/security-utils.d.ts +0 -21
  189. package/dist/utils/security-utils.d.ts.map +1 -1
  190. package/dist/utils/security-utils.js +0 -47
  191. package/dist/utils/security-utils.js.map +1 -1
  192. package/dist/vector/VectorSearchManager.d.ts.map +1 -1
  193. package/dist/vector/VectorSearchManager.js +9 -32
  194. package/dist/vector/VectorSearchManager.js.map +1 -1
  195. package/docker-compose.yml +11 -2
  196. package/hooks/README.md +107 -0
  197. package/hooks/cursor/hooks.json +10 -0
  198. package/hooks/cursor/memory-journal.mdc +22 -0
  199. package/hooks/cursor/session-end.sh +19 -0
  200. package/hooks/kilo-code/session-end-mode.json +11 -0
  201. package/hooks/kiro/session-end.md +13 -0
  202. package/mcp-config-example.json +1 -0
  203. package/package.json +11 -9
  204. package/playwright.config.ts +29 -0
  205. package/releases/v4.5.0.md +116 -0
  206. package/releases/v5.0.0.md +105 -0
  207. package/scripts/generate-server-instructions.ts +176 -0
  208. package/scripts/server-instructions-function-body.ts +77 -0
  209. package/server.json +3 -3
  210. package/src/cli.ts +45 -1
  211. package/src/constants/ServerInstructions.ts +133 -73
  212. package/src/constants/icons.ts +8 -7
  213. package/src/constants/server-instructions.md +268 -0
  214. package/src/database/SqliteAdapter.ts +358 -192
  215. package/src/database/schema.ts +125 -0
  216. package/src/filtering/ToolFilter.ts +13 -2
  217. package/src/github/GitHubIntegration.ts +1 -3
  218. package/src/handlers/prompts/github.ts +209 -0
  219. package/src/handlers/prompts/index.ts +10 -499
  220. package/src/handlers/prompts/workflow.ts +314 -0
  221. package/src/handlers/resources/core.ts +528 -0
  222. package/src/handlers/resources/github.ts +358 -0
  223. package/src/handlers/resources/graph.ts +254 -0
  224. package/src/handlers/resources/index.ts +23 -1570
  225. package/src/handlers/resources/shared.ts +103 -0
  226. package/src/handlers/resources/team.ts +133 -0
  227. package/src/handlers/resources/templates.ts +374 -0
  228. package/src/handlers/tools/admin.ts +285 -0
  229. package/src/handlers/tools/analytics.ts +301 -0
  230. package/src/handlers/tools/backup.ts +242 -0
  231. package/src/handlers/tools/core.ts +350 -0
  232. package/src/handlers/tools/export.ts +115 -0
  233. package/src/handlers/tools/github/helpers.ts +86 -0
  234. package/src/handlers/tools/github/insights-tools.ts +119 -0
  235. package/src/handlers/tools/github/issue-tools.ts +439 -0
  236. package/src/handlers/tools/github/kanban-tools.ts +134 -0
  237. package/src/handlers/tools/github/milestone-tools.ts +392 -0
  238. package/src/handlers/tools/github/mutation-tools.ts +17 -0
  239. package/src/handlers/tools/github/read-tools.ts +328 -0
  240. package/src/handlers/tools/github/schemas.ts +369 -0
  241. package/src/handlers/tools/github.ts +36 -0
  242. package/src/handlers/tools/index.ts +144 -3325
  243. package/src/handlers/tools/relationships.ts +358 -0
  244. package/src/handlers/tools/schemas.ts +132 -0
  245. package/src/handlers/tools/search.ts +343 -0
  246. package/src/handlers/tools/team.ts +273 -0
  247. package/src/server/McpServer.ts +63 -358
  248. package/src/server/Scheduler.ts +278 -0
  249. package/src/transports/http.ts +635 -0
  250. package/src/types/entities.ts +145 -0
  251. package/src/types/filtering.ts +54 -0
  252. package/src/types/github.ts +180 -0
  253. package/src/types/index.ts +67 -375
  254. package/src/utils/error-helpers.ts +52 -0
  255. package/src/utils/logger.ts +6 -3
  256. package/src/utils/security-utils.ts +0 -52
  257. package/src/vector/VectorSearchManager.ts +9 -33
  258. package/tests/constants/icons.test.ts +1 -2
  259. package/tests/constants/server-instructions.test.ts +30 -4
  260. package/tests/database/sqlite-adapter.test.ts +91 -7
  261. package/tests/e2e/auth.spec.ts +154 -0
  262. package/tests/e2e/health.spec.ts +63 -0
  263. package/tests/e2e/protocols.spec.ts +134 -0
  264. package/tests/e2e/resources.spec.ts +103 -0
  265. package/tests/e2e/scheduler.spec.ts +79 -0
  266. package/tests/e2e/security.spec.ts +91 -0
  267. package/tests/e2e/sessions.spec.ts +95 -0
  268. package/tests/e2e/stateless.spec.ts +121 -0
  269. package/tests/e2e/tools.spec.ts +111 -0
  270. package/tests/filtering/tool-filter.test.ts +46 -0
  271. package/tests/handlers/error-path-coverage.test.ts +324 -0
  272. package/tests/handlers/github-resource-handlers.test.ts +453 -0
  273. package/tests/handlers/github-tool-handlers.test.ts +899 -0
  274. package/tests/handlers/prompt-handler-coverage.test.ts +106 -0
  275. package/tests/handlers/prompt-handlers.test.ts +40 -0
  276. package/tests/handlers/resource-handler-coverage.test.ts +181 -0
  277. package/tests/handlers/resource-handlers.test.ts +33 -9
  278. package/tests/handlers/search-tool-handlers.test.ts +272 -0
  279. package/tests/handlers/targeted-gap-closure.test.ts +387 -0
  280. package/tests/handlers/team-resource-handlers.test.ts +156 -0
  281. package/tests/handlers/team-tool-handlers.test.ts +301 -0
  282. package/tests/handlers/tool-handler-coverage.test.ts +469 -0
  283. package/tests/handlers/tool-handlers.test.ts +2 -2
  284. package/tests/security/sql-injection.test.ts +3 -54
  285. package/tests/server/mcp-server.test.ts +503 -8
  286. package/tests/server/scheduler.test.ts +400 -0
  287. package/tests/transports/http-transport.test.ts +620 -0
  288. package/tests/vector/vector-search-manager.test.ts +60 -0
  289. package/vitest.config.ts +4 -1
  290. package/.memory-journal-team.db +0 -0
  291. package/.vscode/settings.json +0 -84
@@ -0,0 +1,277 @@
1
+ /**
2
+ * Memory Journal MCP Server - Workflow Prompt Definitions
3
+ *
4
+ * Prompts: find-related, prepare-standup, prepare-retro, weekly-digest,
5
+ * analyze-period, goal-tracker, get-context-bundle, get-recent-entries, confirm-briefing
6
+ */
7
+ import { ICON_PROMPT } from '../../constants/icons.js';
8
+ import { execQuery } from './index.js';
9
+ /**
10
+ * Get workflow prompt definitions
11
+ */
12
+ export function getWorkflowPromptDefinitions() {
13
+ return [
14
+ {
15
+ name: 'find-related',
16
+ description: 'Discover connected entries via semantic similarity',
17
+ icons: [ICON_PROMPT],
18
+ arguments: [
19
+ {
20
+ name: 'query',
21
+ description: 'Search query for finding related entries',
22
+ required: true,
23
+ },
24
+ ],
25
+ handler: (args, db) => {
26
+ const query = args['query'] ?? '';
27
+ const entries = db.searchEntries(query, { limit: 5 });
28
+ return {
29
+ messages: [
30
+ {
31
+ role: 'user',
32
+ content: {
33
+ type: 'text',
34
+ text: `Find entries related to: "${query}"\n\nRecent matching entries:\n${entries.map((e) => `- [${String(e.id)}] ${e.content.slice(0, 100)}...`).join('\n')}`,
35
+ },
36
+ },
37
+ ],
38
+ };
39
+ },
40
+ },
41
+ {
42
+ name: 'prepare-standup',
43
+ description: 'Daily standup summaries',
44
+ icons: [ICON_PROMPT],
45
+ arguments: [],
46
+ handler: (_args, db) => {
47
+ const today = new Date().toISOString().split('T')[0] ?? '';
48
+ const yesterday = new Date(Date.now() - 86400000).toISOString().split('T')[0] ?? '';
49
+ const entries = db.searchByDateRange(yesterday, today);
50
+ return {
51
+ messages: [
52
+ {
53
+ role: 'user',
54
+ content: {
55
+ type: 'text',
56
+ text: `Prepare a standup summary based on these recent entries:\n\n${entries.map((e) => `[${e.timestamp}] ${e.entryType}: ${e.content}`).join('\n\n')}\n\nFormat as:\n- Yesterday: <summary>\n- Today: <planned work>\n- Blockers: <any blockers>`,
57
+ },
58
+ },
59
+ ],
60
+ };
61
+ },
62
+ },
63
+ {
64
+ name: 'prepare-retro',
65
+ description: 'Sprint retrospectives',
66
+ icons: [ICON_PROMPT],
67
+ arguments: [
68
+ {
69
+ name: 'days',
70
+ description: 'Number of days to include (default: 14)',
71
+ required: false,
72
+ },
73
+ ],
74
+ handler: (args, db) => {
75
+ const days = parseInt(args['days'] ?? '14', 10);
76
+ const endDate = new Date().toISOString().split('T')[0] ?? '';
77
+ const startDate = new Date(Date.now() - days * 86400000).toISOString().split('T')[0] ?? '';
78
+ const entries = db.searchByDateRange(startDate, endDate);
79
+ return {
80
+ messages: [
81
+ {
82
+ role: 'user',
83
+ content: {
84
+ type: 'text',
85
+ text: `Prepare a retrospective for the last ${String(days)} days based on these entries:\n\n${entries
86
+ .slice(0, 20)
87
+ .map((e) => `[${e.timestamp}] ${e.entryType}: ${e.content.slice(0, 200)}`)
88
+ .join('\n\n')}\n\nFormat as:\n- What went well\n- What could improve\n- Action items`,
89
+ },
90
+ },
91
+ ],
92
+ };
93
+ },
94
+ },
95
+ {
96
+ name: 'weekly-digest',
97
+ description: 'Day-by-day weekly summaries',
98
+ icons: [ICON_PROMPT],
99
+ arguments: [],
100
+ handler: (_args, db) => {
101
+ const endDate = new Date().toISOString().split('T')[0] ?? '';
102
+ const startDate = new Date(Date.now() - 7 * 86400000).toISOString().split('T')[0] ?? '';
103
+ const entries = db.searchByDateRange(startDate, endDate);
104
+ return {
105
+ messages: [
106
+ {
107
+ role: 'user',
108
+ content: {
109
+ type: 'text',
110
+ text: `Create a weekly digest from these entries:\n\n${entries.map((e) => `[${e.timestamp}] ${e.entryType}: ${e.content.slice(0, 150)}`).join('\n\n')}\n\nFormat as day-by-day summary with highlights.`,
111
+ },
112
+ },
113
+ ],
114
+ };
115
+ },
116
+ },
117
+ {
118
+ name: 'analyze-period',
119
+ description: 'Deep period analysis with insights',
120
+ icons: [ICON_PROMPT],
121
+ arguments: [
122
+ { name: 'start_date', description: 'Start date (YYYY-MM-DD)', required: true },
123
+ { name: 'end_date', description: 'End date (YYYY-MM-DD)', required: true },
124
+ ],
125
+ handler: (args, db) => {
126
+ const startDate = args['start_date'] ?? '';
127
+ const endDate = args['end_date'] ?? '';
128
+ const entries = db.searchByDateRange(startDate, endDate);
129
+ const stats = db.getStatistics('day');
130
+ return {
131
+ messages: [
132
+ {
133
+ role: 'user',
134
+ content: {
135
+ type: 'text',
136
+ text: `Analyze the period ${startDate} to ${endDate}:\n\nStatistics: ${JSON.stringify(stats, null, 2)}\n\nEntries (${String(entries.length)} total):\n${entries
137
+ .slice(0, 15)
138
+ .map((e) => `[${e.timestamp}] ${e.entryType}: ${e.content.slice(0, 100)}`)
139
+ .join('\n')}\n\nProvide insights on patterns, productivity, and recommendations.`,
140
+ },
141
+ },
142
+ ],
143
+ };
144
+ },
145
+ },
146
+ {
147
+ name: 'goal-tracker',
148
+ description: 'Milestone and achievement tracking',
149
+ icons: [ICON_PROMPT],
150
+ arguments: [],
151
+ handler: (_args, db) => {
152
+ const entries = execQuery(db, `
153
+ SELECT * FROM memory_journal
154
+ WHERE significance_type IS NOT NULL
155
+ AND deleted_at IS NULL
156
+ ORDER BY timestamp DESC
157
+ LIMIT 20
158
+ `);
159
+ return {
160
+ messages: [
161
+ {
162
+ role: 'user',
163
+ content: {
164
+ type: 'text',
165
+ text: `Track goals and milestones based on significant entries:\n\n${JSON.stringify(entries, null, 2)}\n\nSummarize progress toward goals and highlight achievements.`,
166
+ },
167
+ },
168
+ ],
169
+ };
170
+ },
171
+ },
172
+ {
173
+ name: 'get-context-bundle',
174
+ description: 'Project context with recent entries, statistics, and GitHub status hints',
175
+ icons: [ICON_PROMPT],
176
+ arguments: [],
177
+ handler: (_args, db) => {
178
+ const recent = db.getRecentEntries(5);
179
+ const stats = db.getStatistics('week');
180
+ const entrySummaries = recent.map((e) => ({
181
+ id: e.id,
182
+ type: e.entryType,
183
+ timestamp: e.timestamp,
184
+ preview: e.content.slice(0, 60) + (e.content.length > 60 ? '...' : ''),
185
+ }));
186
+ return {
187
+ messages: [
188
+ {
189
+ role: 'user',
190
+ content: {
191
+ type: 'text',
192
+ text: `Project context bundle:
193
+
194
+ **Recent Entries (${String(recent.length)}):**
195
+ ${entrySummaries.map((e) => `- #${String(e.id)} (${e.type}) ${e.preview}`).join('\n')}
196
+
197
+ **Statistics:** ${JSON.stringify(stats)}
198
+
199
+ **For full GitHub status:** Fetch \`memory://github/status\`
200
+ **For full entry details:** Use \`get_entry_by_id\` with entry ID`,
201
+ },
202
+ },
203
+ ],
204
+ };
205
+ },
206
+ },
207
+ {
208
+ name: 'get-recent-entries',
209
+ description: 'Formatted recent entries',
210
+ icons: [ICON_PROMPT],
211
+ arguments: [
212
+ { name: 'limit', description: 'Number of entries (default: 10)', required: false },
213
+ ],
214
+ handler: (args, db) => {
215
+ const limit = parseInt(args['limit'] ?? '10', 10);
216
+ const entries = db.getRecentEntries(limit);
217
+ return {
218
+ messages: [
219
+ {
220
+ role: 'user',
221
+ content: {
222
+ type: 'text',
223
+ text: `Recent ${String(limit)} entries:\n\n${entries.map((e) => `## ${e.timestamp} (${e.entryType})\n\n${e.content}\n\nTags: ${e.tags.join(', ') || 'none'}`).join('\n\n---\n\n')}`,
224
+ },
225
+ },
226
+ ],
227
+ };
228
+ },
229
+ },
230
+ {
231
+ name: 'confirm-briefing',
232
+ description: 'Acknowledge session context received from memory://briefing to inform the user',
233
+ icons: [ICON_PROMPT],
234
+ arguments: [],
235
+ handler: (_args, db) => {
236
+ const recent = db.getRecentEntries(3);
237
+ const stats = db.getStatistics('week');
238
+ const totalEntries = stats.totalEntries ?? 0;
239
+ const entrySummary = recent.length > 0
240
+ ? recent
241
+ .map((e) => ` - #${String(e.id)} (${e.entryType}) ${e.content.slice(0, 40)}...`)
242
+ .join('\n')
243
+ : ' - No entries yet';
244
+ return {
245
+ messages: [
246
+ {
247
+ role: 'user',
248
+ content: {
249
+ type: 'text',
250
+ text: `Generate a briefing acknowledgment for the user with this context:
251
+
252
+ **Session Context Received:**
253
+ - **Journal**: ${String(totalEntries)} total entries
254
+ - **Latest Entries**:
255
+ ${entrySummary}
256
+
257
+ **My Behaviors:**
258
+ - Create entries for: implementations, decisions, bug fixes, milestones
259
+ - Search before: major decisions, referencing prior work
260
+ - Link entries: implementation→spec, bugfix→issue
261
+
262
+ **For More Context:**
263
+ - Full entries: \`memory://recent\` or \`get_entry_by_id(ID)\`
264
+ - GitHub status: \`memory://github/status\`
265
+ - Repo insights: \`memory://github/insights\` (stars, traffic, clones)
266
+ - Full health: \`memory://health\`
267
+
268
+ Please confirm this context to the user in a concise, friendly format. Use a table if helpful.`,
269
+ },
270
+ },
271
+ ],
272
+ };
273
+ },
274
+ },
275
+ ];
276
+ }
277
+ //# sourceMappingURL=workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../src/handlers/prompts/workflow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B,CAAC,CAAC,oBAAoB,CAAA;gBAE9B,OAAO;oBACH,QAAQ,EAAE;wBACN;4BACI,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE;gCACL,IAAI,EAAE,MAAM;gCACZ,IAAI,EAAE;;;iBAGrB,MAAM,CAAC,YAAY,CAAC;;EAEnC,YAAY;;;;;;;;;;;;;+FAaiF;6BAClE;yBACJ;qBACJ;iBACJ,CAAA;YACL,CAAC;SACJ;KACJ,CAAA;AACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Memory Journal MCP Server - Core Resource Definitions
3
+ *
4
+ * Resources: briefing, instructions, recent, significant, tags, statistics, health
5
+ */
6
+ import type { InternalResourceDef } from './shared.js';
7
+ /**
8
+ * Get core resource definitions
9
+ */
10
+ export declare function getCoreResourceDefinitions(): InternalResourceDef[];
11
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/handlers/resources/core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,KAAK,EAAE,mBAAmB,EAAmC,MAAM,aAAa,CAAA;AAUvF;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,mBAAmB,EAAE,CA+elE"}