gitmem-mcp 1.0.3 → 1.0.5

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 (293) hide show
  1. package/CHANGELOG.md +14 -14
  2. package/dist/commands/check.d.ts +1 -1
  3. package/dist/commands/check.js +4 -3
  4. package/dist/diagnostics/anonymizer.d.ts +1 -1
  5. package/dist/diagnostics/anonymizer.js +1 -1
  6. package/dist/diagnostics/channels.d.ts +1 -1
  7. package/dist/diagnostics/channels.js +1 -1
  8. package/dist/diagnostics/collector.d.ts +1 -1
  9. package/dist/diagnostics/collector.js +1 -1
  10. package/dist/diagnostics/index.d.ts +1 -1
  11. package/dist/diagnostics/index.js +1 -1
  12. package/dist/hooks/quick-retrieve.js +2 -1
  13. package/dist/index.js +0 -0
  14. package/dist/schemas/active-sessions.d.ts +9 -9
  15. package/dist/schemas/active-sessions.js +1 -1
  16. package/dist/schemas/common.d.ts +2 -5
  17. package/dist/schemas/common.js +13 -7
  18. package/dist/schemas/create-learning.js +1 -1
  19. package/dist/schemas/session-close.d.ts +5 -8
  20. package/dist/schemas/session-close.js +7 -3
  21. package/dist/schemas/session-start.d.ts +4 -4
  22. package/dist/schemas/session-start.js +1 -1
  23. package/dist/schemas/thread.d.ts +1 -1
  24. package/dist/schemas/thread.js +1 -1
  25. package/dist/server.d.ts +2 -2
  26. package/dist/server.js +21 -10
  27. package/dist/services/active-sessions.js +3 -2
  28. package/dist/services/agent-briefing.d.ts +1 -1
  29. package/dist/services/agent-briefing.js +1 -1
  30. package/dist/services/agent-detection.d.ts +1 -0
  31. package/dist/services/agent-detection.js +21 -12
  32. package/dist/services/analytics.d.ts +1 -1
  33. package/dist/services/analytics.js +3 -3
  34. package/dist/services/behavioral-decay.js +2 -2
  35. package/dist/services/cache.d.ts +1 -1
  36. package/dist/services/cache.js +1 -1
  37. package/dist/services/compliance-validator.d.ts +1 -1
  38. package/dist/services/compliance-validator.js +5 -5
  39. package/dist/services/config.d.ts +1 -1
  40. package/dist/services/config.js +1 -1
  41. package/dist/services/file-lock.js +12 -0
  42. package/dist/services/gitmem-dir.d.ts +17 -4
  43. package/dist/services/gitmem-dir.js +43 -9
  44. package/dist/services/local-file-storage.d.ts +1 -1
  45. package/dist/services/local-file-storage.js +4 -3
  46. package/dist/services/local-vector-search.d.ts +1 -1
  47. package/dist/services/local-vector-search.js +2 -2
  48. package/dist/services/metrics.d.ts +6 -6
  49. package/dist/services/metrics.js +8 -8
  50. package/dist/services/session-state.d.ts +7 -7
  51. package/dist/services/session-state.js +19 -7
  52. package/dist/services/startup.d.ts +1 -1
  53. package/dist/services/startup.js +3 -2
  54. package/dist/services/supabase-client.d.ts +17 -6
  55. package/dist/services/supabase-client.js +44 -8
  56. package/dist/services/thread-manager.d.ts +1 -1
  57. package/dist/services/thread-manager.js +5 -5
  58. package/dist/services/thread-supabase.d.ts +1 -1
  59. package/dist/services/thread-supabase.js +2 -2
  60. package/dist/services/transcript-chunker.d.ts +1 -1
  61. package/dist/services/transcript-chunker.js +1 -1
  62. package/dist/services/variant-assignment.d.ts +6 -6
  63. package/dist/services/variant-assignment.js +9 -8
  64. package/dist/tools/analyze.d.ts +2 -2
  65. package/dist/tools/analyze.js +2 -2
  66. package/dist/tools/archive-learning.js +36 -22
  67. package/dist/tools/confirm-scars.js +1 -1
  68. package/dist/tools/create-decision.d.ts +1 -1
  69. package/dist/tools/create-decision.js +2 -2
  70. package/dist/tools/create-learning.d.ts +1 -1
  71. package/dist/tools/create-learning.js +4 -4
  72. package/dist/tools/create-linear-issue.d.ts +18 -0
  73. package/dist/tools/create-linear-issue.js +197 -0
  74. package/dist/tools/create-thread.d.ts +1 -1
  75. package/dist/tools/create-thread.js +2 -2
  76. package/dist/tools/definitions.js +50 -48
  77. package/dist/tools/get-transcript.d.ts +1 -1
  78. package/dist/tools/get-transcript.js +1 -1
  79. package/dist/tools/graph-traverse.d.ts +1 -1
  80. package/dist/tools/graph-traverse.js +18 -16
  81. package/dist/tools/list-threads.d.ts +2 -2
  82. package/dist/tools/list-threads.js +4 -4
  83. package/dist/tools/log.d.ts +1 -1
  84. package/dist/tools/log.js +1 -1
  85. package/dist/tools/prepare-context.d.ts +1 -1
  86. package/dist/tools/prepare-context.js +1 -1
  87. package/dist/tools/recall.d.ts +4 -4
  88. package/dist/tools/recall.js +25 -25
  89. package/dist/tools/record-scar-usage-batch.js +2 -2
  90. package/dist/tools/record-scar-usage.d.ts +1 -1
  91. package/dist/tools/record-scar-usage.js +3 -3
  92. package/dist/tools/resolve-thread.d.ts +2 -2
  93. package/dist/tools/resolve-thread.js +3 -3
  94. package/dist/tools/save-transcript.d.ts +1 -1
  95. package/dist/tools/save-transcript.js +1 -1
  96. package/dist/tools/search.d.ts +1 -1
  97. package/dist/tools/search.js +1 -1
  98. package/dist/tools/session-close.d.ts +1 -1
  99. package/dist/tools/session-close.js +31 -31
  100. package/dist/tools/session-start.d.ts +5 -5
  101. package/dist/tools/session-start.js +63 -61
  102. package/dist/types/index.d.ts +13 -13
  103. package/hooks/.claude-plugin/plugin.json +1 -1
  104. package/hooks/scripts/post-tool-use.sh +1 -1
  105. package/hooks/scripts/recall-check.sh +1 -1
  106. package/hooks/scripts/session-close-check.sh +1 -1
  107. package/hooks/scripts/session-start.sh +1 -1
  108. package/package.json +6 -3
  109. package/dist/commands/check.d.ts.map +0 -1
  110. package/dist/commands/check.js.map +0 -1
  111. package/dist/constants/closing-questions.d.ts.map +0 -1
  112. package/dist/constants/closing-questions.js.map +0 -1
  113. package/dist/diagnostics/anonymizer.d.ts.map +0 -1
  114. package/dist/diagnostics/anonymizer.js.map +0 -1
  115. package/dist/diagnostics/channels.d.ts.map +0 -1
  116. package/dist/diagnostics/channels.js.map +0 -1
  117. package/dist/diagnostics/collector.d.ts.map +0 -1
  118. package/dist/diagnostics/collector.js.map +0 -1
  119. package/dist/diagnostics/index.d.ts.map +0 -1
  120. package/dist/diagnostics/index.js.map +0 -1
  121. package/dist/hooks/format-utils.d.ts.map +0 -1
  122. package/dist/hooks/format-utils.js.map +0 -1
  123. package/dist/hooks/quick-retrieve.d.ts.map +0 -1
  124. package/dist/hooks/quick-retrieve.js.map +0 -1
  125. package/dist/index.d.ts.map +0 -1
  126. package/dist/index.js.map +0 -1
  127. package/dist/schemas/absorb-observations.d.ts.map +0 -1
  128. package/dist/schemas/absorb-observations.js.map +0 -1
  129. package/dist/schemas/active-sessions.d.ts.map +0 -1
  130. package/dist/schemas/active-sessions.js.map +0 -1
  131. package/dist/schemas/analyze.d.ts.map +0 -1
  132. package/dist/schemas/analyze.js.map +0 -1
  133. package/dist/schemas/common.d.ts.map +0 -1
  134. package/dist/schemas/common.js.map +0 -1
  135. package/dist/schemas/create-decision.d.ts.map +0 -1
  136. package/dist/schemas/create-decision.js.map +0 -1
  137. package/dist/schemas/create-learning.d.ts.map +0 -1
  138. package/dist/schemas/create-learning.js.map +0 -1
  139. package/dist/schemas/get-transcript.d.ts.map +0 -1
  140. package/dist/schemas/get-transcript.js.map +0 -1
  141. package/dist/schemas/index.d.ts.map +0 -1
  142. package/dist/schemas/index.js.map +0 -1
  143. package/dist/schemas/log.d.ts.map +0 -1
  144. package/dist/schemas/log.js.map +0 -1
  145. package/dist/schemas/prepare-context.d.ts.map +0 -1
  146. package/dist/schemas/prepare-context.js.map +0 -1
  147. package/dist/schemas/recall.d.ts.map +0 -1
  148. package/dist/schemas/recall.js.map +0 -1
  149. package/dist/schemas/record-scar-usage-batch.d.ts.map +0 -1
  150. package/dist/schemas/record-scar-usage-batch.js.map +0 -1
  151. package/dist/schemas/record-scar-usage.d.ts.map +0 -1
  152. package/dist/schemas/record-scar-usage.js.map +0 -1
  153. package/dist/schemas/registry.d.ts.map +0 -1
  154. package/dist/schemas/registry.js.map +0 -1
  155. package/dist/schemas/save-transcript.d.ts.map +0 -1
  156. package/dist/schemas/save-transcript.js.map +0 -1
  157. package/dist/schemas/search-transcripts.d.ts.map +0 -1
  158. package/dist/schemas/search-transcripts.js.map +0 -1
  159. package/dist/schemas/search.d.ts.map +0 -1
  160. package/dist/schemas/search.js.map +0 -1
  161. package/dist/schemas/session-close.d.ts.map +0 -1
  162. package/dist/schemas/session-close.js.map +0 -1
  163. package/dist/schemas/session-start.d.ts.map +0 -1
  164. package/dist/schemas/session-start.js.map +0 -1
  165. package/dist/schemas/thread.d.ts.map +0 -1
  166. package/dist/schemas/thread.js.map +0 -1
  167. package/dist/server.d.ts.map +0 -1
  168. package/dist/server.js.map +0 -1
  169. package/dist/services/active-sessions.d.ts.map +0 -1
  170. package/dist/services/active-sessions.js.map +0 -1
  171. package/dist/services/agent-briefing.d.ts.map +0 -1
  172. package/dist/services/agent-briefing.js.map +0 -1
  173. package/dist/services/agent-detection.d.ts.map +0 -1
  174. package/dist/services/agent-detection.js.map +0 -1
  175. package/dist/services/analytics.d.ts.map +0 -1
  176. package/dist/services/analytics.js.map +0 -1
  177. package/dist/services/behavioral-decay.d.ts.map +0 -1
  178. package/dist/services/behavioral-decay.js.map +0 -1
  179. package/dist/services/bm25.d.ts.map +0 -1
  180. package/dist/services/bm25.js.map +0 -1
  181. package/dist/services/cache.d.ts.map +0 -1
  182. package/dist/services/cache.js.map +0 -1
  183. package/dist/services/cache.test.d.ts +0 -8
  184. package/dist/services/cache.test.d.ts.map +0 -1
  185. package/dist/services/cache.test.js +0 -267
  186. package/dist/services/cache.test.js.map +0 -1
  187. package/dist/services/compliance-validator.d.ts.map +0 -1
  188. package/dist/services/compliance-validator.js.map +0 -1
  189. package/dist/services/config.d.ts.map +0 -1
  190. package/dist/services/config.js.map +0 -1
  191. package/dist/services/display-protocol.d.ts.map +0 -1
  192. package/dist/services/display-protocol.js.map +0 -1
  193. package/dist/services/effect-tracker.d.ts.map +0 -1
  194. package/dist/services/effect-tracker.js.map +0 -1
  195. package/dist/services/embedding.d.ts.map +0 -1
  196. package/dist/services/embedding.js.map +0 -1
  197. package/dist/services/file-lock.d.ts.map +0 -1
  198. package/dist/services/file-lock.js.map +0 -1
  199. package/dist/services/gitmem-dir.d.ts.map +0 -1
  200. package/dist/services/gitmem-dir.js.map +0 -1
  201. package/dist/services/local-file-storage.d.ts.map +0 -1
  202. package/dist/services/local-file-storage.js.map +0 -1
  203. package/dist/services/local-vector-search.d.ts.map +0 -1
  204. package/dist/services/local-vector-search.js.map +0 -1
  205. package/dist/services/metrics.d.ts.map +0 -1
  206. package/dist/services/metrics.js.map +0 -1
  207. package/dist/services/session-state.d.ts.map +0 -1
  208. package/dist/services/session-state.js.map +0 -1
  209. package/dist/services/startup.d.ts.map +0 -1
  210. package/dist/services/startup.js.map +0 -1
  211. package/dist/services/storage.d.ts.map +0 -1
  212. package/dist/services/storage.js.map +0 -1
  213. package/dist/services/supabase-client.d.ts.map +0 -1
  214. package/dist/services/supabase-client.js.map +0 -1
  215. package/dist/services/thread-dedup.d.ts.map +0 -1
  216. package/dist/services/thread-dedup.js.map +0 -1
  217. package/dist/services/thread-manager.d.ts.map +0 -1
  218. package/dist/services/thread-manager.js.map +0 -1
  219. package/dist/services/thread-suggestions.d.ts.map +0 -1
  220. package/dist/services/thread-suggestions.js.map +0 -1
  221. package/dist/services/thread-supabase.d.ts.map +0 -1
  222. package/dist/services/thread-supabase.js.map +0 -1
  223. package/dist/services/thread-vitality.d.ts.map +0 -1
  224. package/dist/services/thread-vitality.js.map +0 -1
  225. package/dist/services/tier.d.ts.map +0 -1
  226. package/dist/services/tier.js.map +0 -1
  227. package/dist/services/timezone.d.ts.map +0 -1
  228. package/dist/services/timezone.js.map +0 -1
  229. package/dist/services/transcript-chunker.d.ts.map +0 -1
  230. package/dist/services/transcript-chunker.js.map +0 -1
  231. package/dist/services/triple-writer.d.ts.map +0 -1
  232. package/dist/services/triple-writer.js.map +0 -1
  233. package/dist/services/variant-assignment.d.ts.map +0 -1
  234. package/dist/services/variant-assignment.js.map +0 -1
  235. package/dist/services/variant-generation.d.ts.map +0 -1
  236. package/dist/services/variant-generation.js.map +0 -1
  237. package/dist/tools/absorb-observations.d.ts.map +0 -1
  238. package/dist/tools/absorb-observations.js.map +0 -1
  239. package/dist/tools/analyze.d.ts.map +0 -1
  240. package/dist/tools/analyze.js.map +0 -1
  241. package/dist/tools/archive-learning.d.ts.map +0 -1
  242. package/dist/tools/archive-learning.js.map +0 -1
  243. package/dist/tools/cleanup-threads.d.ts.map +0 -1
  244. package/dist/tools/cleanup-threads.js.map +0 -1
  245. package/dist/tools/confirm-scars.d.ts.map +0 -1
  246. package/dist/tools/confirm-scars.js.map +0 -1
  247. package/dist/tools/create-decision.d.ts.map +0 -1
  248. package/dist/tools/create-decision.js.map +0 -1
  249. package/dist/tools/create-learning.d.ts.map +0 -1
  250. package/dist/tools/create-learning.js.map +0 -1
  251. package/dist/tools/create-thread.d.ts.map +0 -1
  252. package/dist/tools/create-thread.js.map +0 -1
  253. package/dist/tools/definitions.d.ts.map +0 -1
  254. package/dist/tools/definitions.js.map +0 -1
  255. package/dist/tools/dismiss-suggestion.d.ts.map +0 -1
  256. package/dist/tools/dismiss-suggestion.js.map +0 -1
  257. package/dist/tools/get-transcript.d.ts.map +0 -1
  258. package/dist/tools/get-transcript.js.map +0 -1
  259. package/dist/tools/graph-traverse.d.ts.map +0 -1
  260. package/dist/tools/graph-traverse.js.map +0 -1
  261. package/dist/tools/list-threads.d.ts.map +0 -1
  262. package/dist/tools/list-threads.js.map +0 -1
  263. package/dist/tools/log.d.ts.map +0 -1
  264. package/dist/tools/log.js.map +0 -1
  265. package/dist/tools/prepare-context.d.ts.map +0 -1
  266. package/dist/tools/prepare-context.js.map +0 -1
  267. package/dist/tools/promote-suggestion.d.ts.map +0 -1
  268. package/dist/tools/promote-suggestion.js.map +0 -1
  269. package/dist/tools/recall.d.ts.map +0 -1
  270. package/dist/tools/recall.js.map +0 -1
  271. package/dist/tools/recall.test.d.ts +0 -5
  272. package/dist/tools/recall.test.d.ts.map +0 -1
  273. package/dist/tools/recall.test.js +0 -155
  274. package/dist/tools/recall.test.js.map +0 -1
  275. package/dist/tools/record-scar-usage-batch.d.ts.map +0 -1
  276. package/dist/tools/record-scar-usage-batch.js.map +0 -1
  277. package/dist/tools/record-scar-usage.d.ts.map +0 -1
  278. package/dist/tools/record-scar-usage.js.map +0 -1
  279. package/dist/tools/resolve-thread.d.ts.map +0 -1
  280. package/dist/tools/resolve-thread.js.map +0 -1
  281. package/dist/tools/save-transcript.d.ts.map +0 -1
  282. package/dist/tools/save-transcript.js.map +0 -1
  283. package/dist/tools/search-transcripts.d.ts.map +0 -1
  284. package/dist/tools/search-transcripts.js.map +0 -1
  285. package/dist/tools/search.d.ts.map +0 -1
  286. package/dist/tools/search.js.map +0 -1
  287. package/dist/tools/session-close.d.ts.map +0 -1
  288. package/dist/tools/session-close.js.map +0 -1
  289. package/dist/tools/session-start.d.ts.map +0 -1
  290. package/dist/tools/session-start.js.map +0 -1
  291. package/dist/types/index.d.ts.map +0 -1
  292. package/dist/types/index.js.map +0 -1
  293. package/hooks/tests/test-hooks.sh +0 -577
@@ -0,0 +1,197 @@
1
+ /**
2
+ * create_linear_issue Tool (OD-611)
3
+ *
4
+ * Proxy Linear issue creation via GraphQL API.
5
+ * Returns slim response (~50 tokens) instead of Linear MCP's ~1400 tokens.
6
+ *
7
+ * Pattern: File-based payload handoff (same as session_close).
8
+ * Agent writes description to .gitmem/issue-payload.json, then calls this
9
+ * tool with title + teamId inline. Tool reads, merges, calls Linear, deletes file.
10
+ *
11
+ * Performance target: <2000ms (one network call)
12
+ */
13
+ import * as fs from "fs";
14
+ import { v4 as uuidv4 } from "uuid";
15
+ import { getGitmemPath } from "../services/gitmem-dir.js";
16
+ import { Timer, buildPerformanceData, recordMetrics, } from "../services/metrics.js";
17
+ import { getEffectTracker } from "../services/effect-tracker.js";
18
+ const LINEAR_API_URL = "https://api.linear.app/graphql";
19
+ /** GraphQL mutation — request only the fields needed for the slim response */
20
+ const ISSUE_CREATE_MUTATION = `
21
+ mutation IssueCreate($input: IssueCreateInput!) {
22
+ issueCreate(input: $input) {
23
+ success
24
+ issue {
25
+ id
26
+ identifier
27
+ url
28
+ state {
29
+ name
30
+ }
31
+ }
32
+ }
33
+ }
34
+ `;
35
+ /**
36
+ * Create a Linear issue via GraphQL API with slim response.
37
+ */
38
+ export async function createLinearIssue(params) {
39
+ const timer = new Timer();
40
+ const metricsId = uuidv4();
41
+ // 1. Check LINEAR_API_KEY
42
+ const apiKey = process.env.LINEAR_API_KEY;
43
+ if (!apiKey) {
44
+ const latencyMs = timer.stop();
45
+ return {
46
+ success: false,
47
+ error: "LINEAR_API_KEY environment variable is not set. Add it to your MCP server configuration.",
48
+ performance: buildPerformanceData("create_linear_issue", latencyMs, 0),
49
+ };
50
+ }
51
+ // 2. Load file-based payload (same pattern as session_close)
52
+ const payloadPath = params.payload_path || getGitmemPath("issue-payload.json");
53
+ let filePayload = {};
54
+ try {
55
+ if (fs.existsSync(payloadPath)) {
56
+ filePayload = JSON.parse(fs.readFileSync(payloadPath, "utf-8"));
57
+ console.error(`[create_linear_issue] Loaded payload from ${payloadPath}`);
58
+ // Clean up payload file after reading
59
+ try {
60
+ fs.unlinkSync(payloadPath);
61
+ }
62
+ catch {
63
+ /* ignore cleanup errors */
64
+ }
65
+ }
66
+ }
67
+ catch (error) {
68
+ console.error("[create_linear_issue] Failed to read issue-payload.json:", error);
69
+ }
70
+ // 3. Merge: inline params override file payload
71
+ const teamId = params.teamId || filePayload.teamId;
72
+ const title = params.title || filePayload.title;
73
+ if (!teamId || !title) {
74
+ const latencyMs = timer.stop();
75
+ return {
76
+ success: false,
77
+ error: "teamId and title are required. Provide inline or in .gitmem/issue-payload.json.",
78
+ performance: buildPerformanceData("create_linear_issue", latencyMs, 0),
79
+ };
80
+ }
81
+ // 4. Build IssueCreateInput for GraphQL
82
+ const input = {
83
+ teamId,
84
+ title,
85
+ };
86
+ // Description only comes from file payload (the large field)
87
+ if (filePayload.description) {
88
+ input.description = filePayload.description;
89
+ }
90
+ // Merge optional fields — inline overrides file
91
+ if (params.priority !== undefined || filePayload.priority !== undefined) {
92
+ input.priority = params.priority ?? filePayload.priority;
93
+ }
94
+ if (params.labelIds?.length || filePayload.labelIds?.length) {
95
+ input.labelIds = params.labelIds || filePayload.labelIds;
96
+ }
97
+ if (params.projectId || filePayload.projectId) {
98
+ input.projectId = params.projectId || filePayload.projectId;
99
+ }
100
+ if (params.assigneeId || filePayload.assigneeId) {
101
+ input.assigneeId = params.assigneeId || filePayload.assigneeId;
102
+ }
103
+ if (params.parentId || filePayload.parentId) {
104
+ input.parentId = params.parentId || filePayload.parentId;
105
+ }
106
+ if (params.stateId || filePayload.stateId) {
107
+ input.stateId = params.stateId || filePayload.stateId;
108
+ }
109
+ if (params.estimate !== undefined || filePayload.estimate !== undefined) {
110
+ input.estimate = params.estimate ?? filePayload.estimate;
111
+ }
112
+ // 5. Call Linear GraphQL API
113
+ try {
114
+ const response = await fetch(LINEAR_API_URL, {
115
+ method: "POST",
116
+ headers: {
117
+ "Content-Type": "application/json",
118
+ Authorization: apiKey,
119
+ },
120
+ body: JSON.stringify({
121
+ query: ISSUE_CREATE_MUTATION,
122
+ variables: { input },
123
+ }),
124
+ });
125
+ if (!response.ok) {
126
+ const text = await response.text();
127
+ const latencyMs = timer.stop();
128
+ return {
129
+ success: false,
130
+ error: `Linear API HTTP ${response.status}: ${text.slice(0, 200)}`,
131
+ performance: buildPerformanceData("create_linear_issue", latencyMs, 0),
132
+ };
133
+ }
134
+ const data = (await response.json());
135
+ // Handle GraphQL errors
136
+ if (data.errors?.length) {
137
+ const latencyMs = timer.stop();
138
+ return {
139
+ success: false,
140
+ error: `Linear GraphQL error: ${data.errors.map((e) => e.message).join("; ")}`,
141
+ performance: buildPerformanceData("create_linear_issue", latencyMs, 0),
142
+ };
143
+ }
144
+ const issueCreate = data.data?.issueCreate;
145
+ if (!issueCreate?.success || !issueCreate.issue) {
146
+ const latencyMs = timer.stop();
147
+ return {
148
+ success: false,
149
+ error: "Linear API returned unsuccessful issueCreate",
150
+ performance: buildPerformanceData("create_linear_issue", latencyMs, 0),
151
+ };
152
+ }
153
+ const issue = issueCreate.issue;
154
+ const latencyMs = timer.stop();
155
+ // 6. Fire-and-forget metrics recording
156
+ getEffectTracker().track("metrics", "create_linear_issue", () => recordMetrics({
157
+ id: metricsId,
158
+ tool_name: "create_linear_issue",
159
+ latency_ms: latencyMs,
160
+ result_count: 1,
161
+ metadata: {
162
+ identifier: issue.identifier,
163
+ teamId,
164
+ has_description: !!filePayload.description,
165
+ },
166
+ }));
167
+ // 7. Return slim response (~50 tokens vs ~1400)
168
+ return {
169
+ success: true,
170
+ identifier: issue.identifier,
171
+ url: issue.url,
172
+ id: issue.id,
173
+ state: issue.state?.name,
174
+ performance: buildPerformanceData("create_linear_issue", latencyMs, 1, {
175
+ breakdown: {
176
+ upsert: {
177
+ latency_ms: latencyMs,
178
+ source: "supabase",
179
+ cache_status: "not_applicable",
180
+ network_call: true,
181
+ },
182
+ },
183
+ }),
184
+ };
185
+ }
186
+ catch (error) {
187
+ const errorMessage = error instanceof Error ? error.message : String(error);
188
+ console.error("[create_linear_issue] Failed:", error);
189
+ const latencyMs = timer.stop();
190
+ return {
191
+ success: false,
192
+ error: `Linear API call failed: ${errorMessage}`,
193
+ performance: buildPerformanceData("create_linear_issue", latencyMs, 0),
194
+ };
195
+ }
196
+ }
197
+ //# sourceMappingURL=create-linear-issue.js.map
@@ -4,7 +4,7 @@
4
4
  * Create an open thread outside of session close. Threads track
5
5
  * unresolved work items that carry across sessions.
6
6
  *
7
- * OD-620: Writes to Supabase (source of truth) + local file (cache).
7
+ * Writes to Supabase (source of truth) + local file (cache).
8
8
  * Falls back to local-only if Supabase is unavailable.
9
9
  *
10
10
  * Phase 3: Semantic dedup gate — before creating, checks existing open
@@ -4,7 +4,7 @@
4
4
  * Create an open thread outside of session close. Threads track
5
5
  * unresolved work items that carry across sessions.
6
6
  *
7
- * OD-620: Writes to Supabase (source of truth) + local file (cache).
7
+ * Writes to Supabase (source of truth) + local file (cache).
8
8
  * Falls back to local-only if Supabase is unavailable.
9
9
  *
10
10
  * Phase 3: Semantic dedup gate — before creating, checks existing open
@@ -123,7 +123,7 @@ export async function createThread(params) {
123
123
  created_at: new Date().toISOString(),
124
124
  ...(sessionId && { source_session: sessionId }),
125
125
  };
126
- // OD-620: Write to Supabase (source of truth) with embedding — non-blocking on failure
126
+ // Write to Supabase (source of truth) with embedding — non-blocking on failure
127
127
  let supabaseSynced = false;
128
128
  const embeddingJson = newEmbedding ? JSON.stringify(newEmbedding) : null;
129
129
  const supabaseResult = await createThreadInSupabase(thread, project, embeddingJson);
@@ -11,7 +11,7 @@ import { hasBatchOperations, hasTranscripts, hasCacheManagement, hasSupabase, ha
11
11
  export const TOOLS = [
12
12
  {
13
13
  name: "recall",
14
- description: "Check institutional memory for relevant scars before taking action. Returns matching scars and their lessons. OD-525: Integrates variant assignment when issue_id provided.",
14
+ description: "Check institutional memory for relevant scars before taking action. Returns matching scars and their lessons. Integrates variant assignment when issue_id provided.",
15
15
  inputSchema: {
16
16
  type: "object",
17
17
  properties: {
@@ -29,7 +29,7 @@ export const TOOLS = [
29
29
  },
30
30
  issue_id: {
31
31
  type: "string",
32
- description: "Linear issue identifier for variant assignment (e.g., 'OD-525'). When provided, scars with variants will be randomly assigned and formatted accordingly.",
32
+ description: "Linear issue identifier for variant assignment (e.g., 'PROJ-123'). When provided, scars with variants will be randomly assigned and formatted accordingly.",
33
33
  },
34
34
  similarity_threshold: {
35
35
  type: "number",
@@ -85,12 +85,12 @@ export const TOOLS = [
85
85
  properties: {
86
86
  agent_identity: {
87
87
  type: "string",
88
- enum: ["CLI", "DAC", "CODA-1", "Brain_Local", "Brain_Cloud"],
88
+ enum: ["cli", "desktop", "autonomous", "local", "cloud"],
89
89
  description: "Override agent identity (auto-detects if not provided)",
90
90
  },
91
91
  linear_issue: {
92
92
  type: "string",
93
- description: "Current Linear issue identifier (e.g., OD-XXX)",
93
+ description: "Current Linear issue identifier (e.g., PROJ-123)",
94
94
  },
95
95
  issue_title: {
96
96
  type: "string",
@@ -111,7 +111,7 @@ export const TOOLS = [
111
111
  },
112
112
  force: {
113
113
  type: "boolean",
114
- description: "Force create new session even if one already exists (OD-558)",
114
+ description: "Force create new session even if one already exists",
115
115
  },
116
116
  },
117
117
  },
@@ -290,7 +290,7 @@ export const TOOLS = [
290
290
  },
291
291
  issue_identifier: {
292
292
  type: "string",
293
- description: "Linear issue identifier (e.g., OD-XXX)",
293
+ description: "Linear issue identifier (e.g., PROJ-123)",
294
294
  },
295
295
  surfaced_at: {
296
296
  type: "string",
@@ -319,7 +319,7 @@ export const TOOLS = [
319
319
  },
320
320
  agent: {
321
321
  type: "string",
322
- description: "Agent identity (CLI, DAC, CODA-1, etc.)",
322
+ description: "Agent identity (e.g., cli, desktop, autonomous)",
323
323
  },
324
324
  variant_id: {
325
325
  type: "string",
@@ -350,7 +350,7 @@ export const TOOLS = [
350
350
  },
351
351
  issue_identifier: {
352
352
  type: "string",
353
- description: "Linear issue identifier (e.g., OD-XXX)",
353
+ description: "Linear issue identifier (e.g., PROJ-123)",
354
354
  },
355
355
  surfaced_at: {
356
356
  type: "string",
@@ -379,7 +379,7 @@ export const TOOLS = [
379
379
  },
380
380
  agent: {
381
381
  type: "string",
382
- description: "Agent identity (CLI, DAC, CODA-1, etc.)",
382
+ description: "Agent identity (e.g., cli, desktop, autonomous)",
383
383
  },
384
384
  },
385
385
  required: ["scar_identifier", "surfaced_at", "reference_type", "reference_context"],
@@ -396,7 +396,7 @@ export const TOOLS = [
396
396
  },
397
397
  {
398
398
  name: "save_transcript",
399
- description: "Save full session transcript to storage for training data and post-mortems (OD-467)",
399
+ description: "Save full session transcript to storage for training data and post-mortems",
400
400
  inputSchema: {
401
401
  type: "object",
402
402
  properties: {
@@ -423,7 +423,7 @@ export const TOOLS = [
423
423
  },
424
424
  {
425
425
  name: "get_transcript",
426
- description: "Retrieve a session transcript from storage (OD-467)",
426
+ description: "Retrieve a session transcript from storage",
427
427
  inputSchema: {
428
428
  type: "object",
429
429
  properties: {
@@ -462,7 +462,7 @@ export const TOOLS = [
462
462
  },
463
463
  },
464
464
  // ============================================================================
465
- // SEARCH & LOG TOOLS (OD-560, OD-561)
465
+ // SEARCH & LOG TOOLS
466
466
  // ============================================================================
467
467
  {
468
468
  name: "search",
@@ -528,7 +528,7 @@ export const TOOLS = [
528
528
  },
529
529
  },
530
530
  // ============================================================================
531
- // PREPARE CONTEXT (GitMem v2 Phase 1 — OD-593)
531
+ // PREPARE CONTEXT
532
532
  // ============================================================================
533
533
  {
534
534
  name: "prepare_context",
@@ -592,7 +592,7 @@ export const TOOLS = [
592
592
  required: ["observations"],
593
593
  },
594
594
  },
595
- // --- Thread Lifecycle Tools (OD-thread-lifecycle) ---
595
+ // --- Thread Lifecycle Tools () ---
596
596
  {
597
597
  name: "list_threads",
598
598
  description: "List open threads across recent sessions. Shows unresolved work items that carry over between sessions, with IDs for resolution. Use resolve_thread to mark threads as done.",
@@ -648,7 +648,7 @@ export const TOOLS = [
648
648
  },
649
649
  linear_issue: {
650
650
  type: "string",
651
- description: "Associated Linear issue (e.g., OD-XXX)",
651
+ description: "Associated Linear issue (e.g., PROJ-123)",
652
652
  },
653
653
  },
654
654
  required: ["text"],
@@ -776,12 +776,12 @@ export const TOOLS = [
776
776
  properties: {
777
777
  agent_identity: {
778
778
  type: "string",
779
- enum: ["CLI", "DAC", "CODA-1", "Brain_Local", "Brain_Cloud"],
779
+ enum: ["cli", "desktop", "autonomous", "local", "cloud"],
780
780
  description: "Override agent identity (auto-detects if not provided)",
781
781
  },
782
782
  linear_issue: {
783
783
  type: "string",
784
- description: "Current Linear issue identifier (e.g., OD-XXX)",
784
+ description: "Current Linear issue identifier (e.g., PROJ-123)",
785
785
  },
786
786
  issue_title: {
787
787
  type: "string",
@@ -802,7 +802,7 @@ export const TOOLS = [
802
802
  },
803
803
  force: {
804
804
  type: "boolean",
805
- description: "Force create new session even if one already exists (OD-558)",
805
+ description: "Force create new session even if one already exists",
806
806
  },
807
807
  },
808
808
  },
@@ -981,7 +981,7 @@ export const TOOLS = [
981
981
  },
982
982
  issue_identifier: {
983
983
  type: "string",
984
- description: "Linear issue identifier (e.g., OD-XXX)",
984
+ description: "Linear issue identifier (e.g., PROJ-123)",
985
985
  },
986
986
  surfaced_at: {
987
987
  type: "string",
@@ -1010,7 +1010,7 @@ export const TOOLS = [
1010
1010
  },
1011
1011
  agent: {
1012
1012
  type: "string",
1013
- description: "Agent identity (CLI, DAC, CODA-1, etc.)",
1013
+ description: "Agent identity (e.g., cli, desktop, autonomous)",
1014
1014
  },
1015
1015
  variant_id: {
1016
1016
  type: "string",
@@ -1041,7 +1041,7 @@ export const TOOLS = [
1041
1041
  },
1042
1042
  issue_identifier: {
1043
1043
  type: "string",
1044
- description: "Linear issue identifier (e.g., OD-XXX)",
1044
+ description: "Linear issue identifier (e.g., PROJ-123)",
1045
1045
  },
1046
1046
  surfaced_at: {
1047
1047
  type: "string",
@@ -1070,7 +1070,7 @@ export const TOOLS = [
1070
1070
  },
1071
1071
  agent: {
1072
1072
  type: "string",
1073
- description: "Agent identity (CLI, DAC, CODA-1, etc.)",
1073
+ description: "Agent identity (e.g., cli, desktop, autonomous)",
1074
1074
  },
1075
1075
  },
1076
1076
  required: ["scar_identifier", "surfaced_at", "reference_type", "reference_context"],
@@ -1179,7 +1179,7 @@ export const TOOLS = [
1179
1179
  required: ["query"],
1180
1180
  },
1181
1181
  },
1182
- // gitmem-search (OD-560)
1182
+ // gitmem-search
1183
1183
  {
1184
1184
  name: "gitmem-search",
1185
1185
  description: "gitmem-search (search) - Search institutional memory by query (exploration, no side effects)",
@@ -1212,7 +1212,7 @@ export const TOOLS = [
1212
1212
  required: ["query"],
1213
1213
  },
1214
1214
  },
1215
- // gitmem-log (OD-561)
1215
+ // gitmem-log
1216
1216
  {
1217
1217
  name: "gitmem-log",
1218
1218
  description: "gitmem-log (log) - List recent learnings chronologically",
@@ -1244,7 +1244,7 @@ export const TOOLS = [
1244
1244
  },
1245
1245
  },
1246
1246
  },
1247
- // gitmem-pc (prepare_context) — OD-593
1247
+ // gitmem-pc (prepare_context)
1248
1248
  {
1249
1249
  name: "gitmem-pc",
1250
1250
  description: "gitmem-pc (prepare_context) - Generate portable memory payload for sub-agent injection",
@@ -1302,7 +1302,7 @@ export const TOOLS = [
1302
1302
  required: ["observations"],
1303
1303
  },
1304
1304
  },
1305
- // gitmem-lt (list_threads) — OD-thread-lifecycle
1305
+ // gitmem-lt (list_threads) —
1306
1306
  {
1307
1307
  name: "gitmem-lt",
1308
1308
  description: "gitmem-lt (list_threads) - List open threads across sessions",
@@ -1315,7 +1315,7 @@ export const TOOLS = [
1315
1315
  },
1316
1316
  },
1317
1317
  },
1318
- // gitmem-rt (resolve_thread) — OD-thread-lifecycle
1318
+ // gitmem-rt (resolve_thread) —
1319
1319
  {
1320
1320
  name: "gitmem-rt",
1321
1321
  description: "gitmem-rt (resolve_thread) - Mark a thread as resolved",
@@ -1400,12 +1400,12 @@ export const TOOLS = [
1400
1400
  properties: {
1401
1401
  agent_identity: {
1402
1402
  type: "string",
1403
- enum: ["CLI", "DAC", "CODA-1", "Brain_Local", "Brain_Cloud"],
1403
+ enum: ["cli", "desktop", "autonomous", "local", "cloud"],
1404
1404
  description: "Override agent identity (auto-detects if not provided)",
1405
1405
  },
1406
1406
  linear_issue: {
1407
1407
  type: "string",
1408
- description: "Current Linear issue identifier (e.g., OD-XXX)",
1408
+ description: "Current Linear issue identifier (e.g., PROJ-123)",
1409
1409
  },
1410
1410
  issue_title: {
1411
1411
  type: "string",
@@ -1426,7 +1426,7 @@ export const TOOLS = [
1426
1426
  },
1427
1427
  force: {
1428
1428
  type: "boolean",
1429
- description: "Force create new session even if one already exists (OD-558)",
1429
+ description: "Force create new session even if one already exists",
1430
1430
  },
1431
1431
  },
1432
1432
  },
@@ -1563,7 +1563,7 @@ export const TOOLS = [
1563
1563
  required: ["learning_type", "title", "description"],
1564
1564
  },
1565
1565
  },
1566
- // gm-search (OD-560)
1566
+ // gm-search
1567
1567
  {
1568
1568
  name: "gm-search",
1569
1569
  description: "gm-search (search) - Search institutional memory by query",
@@ -1596,7 +1596,7 @@ export const TOOLS = [
1596
1596
  required: ["query"],
1597
1597
  },
1598
1598
  },
1599
- // gm-log (OD-561)
1599
+ // gm-log
1600
1600
  {
1601
1601
  name: "gm-log",
1602
1602
  description: "gm-log (log) - List recent learnings chronologically",
@@ -1628,7 +1628,7 @@ export const TOOLS = [
1628
1628
  },
1629
1629
  },
1630
1630
  },
1631
- // gm-pc (prepare_context) — OD-593
1631
+ // gm-pc (prepare_context)
1632
1632
  {
1633
1633
  name: "gm-pc",
1634
1634
  description: "gm-pc (prepare_context) - Generate portable memory payload for sub-agents",
@@ -1686,7 +1686,7 @@ export const TOOLS = [
1686
1686
  required: ["observations"],
1687
1687
  },
1688
1688
  },
1689
- // gm-threads (list_threads) — OD-thread-lifecycle
1689
+ // gm-threads (list_threads) —
1690
1690
  {
1691
1691
  name: "gm-threads",
1692
1692
  description: "gm-threads (list_threads) - List open threads",
@@ -1699,7 +1699,7 @@ export const TOOLS = [
1699
1699
  },
1700
1700
  },
1701
1701
  },
1702
- // gm-resolve (resolve_thread) — OD-thread-lifecycle
1702
+ // gm-resolve (resolve_thread) —
1703
1703
  {
1704
1704
  name: "gm-resolve",
1705
1705
  description: "gm-resolve (resolve_thread) - Resolve a thread",
@@ -1774,7 +1774,7 @@ export const TOOLS = [
1774
1774
  },
1775
1775
  },
1776
1776
  // ============================================================================
1777
- // ANALYTICS TOOLS (OD-567)
1777
+ // ANALYTICS TOOLS
1778
1778
  // ============================================================================
1779
1779
  {
1780
1780
  name: "analyze",
@@ -1797,7 +1797,7 @@ export const TOOLS = [
1797
1797
  },
1798
1798
  agent: {
1799
1799
  type: "string",
1800
- description: "Filter by agent identity (e.g., CLI, DAC, CODA-1)",
1800
+ description: "Filter by agent identity (e.g., cli, desktop, autonomous)",
1801
1801
  },
1802
1802
  format: {
1803
1803
  type: "string",
@@ -1807,7 +1807,7 @@ export const TOOLS = [
1807
1807
  },
1808
1808
  },
1809
1809
  },
1810
- // gitmem-analyze alias (OD-567)
1810
+ // gitmem-analyze alias
1811
1811
  {
1812
1812
  name: "gitmem-analyze",
1813
1813
  description: "gitmem-analyze (analyze) - Session analytics. Returns formatted markdown by default.",
@@ -1829,7 +1829,7 @@ export const TOOLS = [
1829
1829
  },
1830
1830
  agent: {
1831
1831
  type: "string",
1832
- description: "Filter by agent identity (e.g., CLI, DAC, CODA-1)",
1832
+ description: "Filter by agent identity (e.g., cli, desktop, autonomous)",
1833
1833
  },
1834
1834
  format: {
1835
1835
  type: "string",
@@ -1839,7 +1839,7 @@ export const TOOLS = [
1839
1839
  },
1840
1840
  },
1841
1841
  },
1842
- // gm-analyze ultra-short alias (OD-567)
1842
+ // gm-analyze ultra-short alias
1843
1843
  {
1844
1844
  name: "gm-analyze",
1845
1845
  description: "gm-analyze (analyze) - Session analytics. Returns formatted markdown by default.",
@@ -1861,7 +1861,7 @@ export const TOOLS = [
1861
1861
  },
1862
1862
  agent: {
1863
1863
  type: "string",
1864
- description: "Filter by agent identity (e.g., CLI, DAC, CODA-1)",
1864
+ description: "Filter by agent identity (e.g., cli, desktop, autonomous)",
1865
1865
  },
1866
1866
  format: {
1867
1867
  type: "string",
@@ -1880,7 +1880,7 @@ export const TOOLS = [
1880
1880
  },
1881
1881
  },
1882
1882
  // ============================================================================
1883
- // CACHE MANAGEMENT TOOLS (OD-473)
1883
+ // CACHE MANAGEMENT TOOLS
1884
1884
  // ============================================================================
1885
1885
  {
1886
1886
  name: "gitmem-cache-status",
@@ -1973,7 +1973,7 @@ export const TOOLS = [
1973
1973
  },
1974
1974
  reason: {
1975
1975
  type: "string",
1976
- description: "Optional reason for archiving (e.g., 'superseded by OD-XXX', 'no longer relevant')",
1976
+ description: "Optional reason for archiving (e.g., 'superseded by PROJ-123', 'no longer relevant')",
1977
1977
  },
1978
1978
  },
1979
1979
  required: ["id"],
@@ -2018,7 +2018,7 @@ export const TOOLS = [
2018
2018
  // --- Knowledge Graph Traversal (Phase 3) ---
2019
2019
  {
2020
2020
  name: "graph_traverse",
2021
- description: "Traverse the knowledge graph over institutional memory triples. Answers: 'show me everything connected to OD-466', 'what did CLI produce', 'trace this decision back', 'which issues produced the most learnings'. Four lenses: connected_to, produced_by, provenance, stats.",
2021
+ description: "Traverse the knowledge graph over institutional memory triples. Answers: 'show me everything connected to this issue', 'what did this agent produce', 'trace this decision back', 'which issues produced the most learnings'. Four lenses: connected_to, produced_by, provenance, stats.",
2022
2022
  inputSchema: {
2023
2023
  type: "object",
2024
2024
  properties: {
@@ -2029,7 +2029,7 @@ export const TOOLS = [
2029
2029
  },
2030
2030
  node: {
2031
2031
  type: "string",
2032
- description: "Starting node. Examples: 'OD-466', 'CLI', 'Scar: Done ≠ Deployed'. Required for all lenses except stats.",
2032
+ description: "Starting node. Examples: 'PROJ-123', 'cli', 'Scar: Done ≠ Deployed'. Required for all lenses except stats.",
2033
2033
  },
2034
2034
  predicate: {
2035
2035
  type: "string",
@@ -2065,7 +2065,7 @@ export const TOOLS = [
2065
2065
  },
2066
2066
  node: {
2067
2067
  type: "string",
2068
- description: "Starting node (e.g., 'OD-466', 'CLI')",
2068
+ description: "Starting node (e.g., 'PROJ-123', 'cli')",
2069
2069
  },
2070
2070
  predicate: {
2071
2071
  type: "string",
@@ -2171,7 +2171,7 @@ export const ARCHIVE_TOOL_NAMES = new Set([
2171
2171
  export function getRegisteredTools() {
2172
2172
  const showAliases = hasFullAliases();
2173
2173
  return TOOLS.filter(tool => {
2174
- // Filter aliases unless GITMEM_FULL_ALIASES=1 (OD-691)
2174
+ // Filter aliases unless GITMEM_FULL_ALIASES=1
2175
2175
  if (!showAliases && ALIAS_TOOL_NAMES.has(tool.name)) {
2176
2176
  return false;
2177
2177
  }
@@ -2190,7 +2190,9 @@ export function getRegisteredTools() {
2190
2190
  if (GRAPH_TOOL_NAMES.has(tool.name)) {
2191
2191
  return hasSupabase();
2192
2192
  }
2193
- if (ARCHIVE_TOOL_NAMES.has(tool.name)) {
2193
+ // archive_learning works on both free (local JSON) and pro (Supabase) tiers
2194
+ // Only gate the aliases
2195
+ if (ARCHIVE_TOOL_NAMES.has(tool.name) && tool.name !== "archive_learning") {
2194
2196
  return hasSupabase();
2195
2197
  }
2196
2198
  return true;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Retrieve a session transcript from Supabase storage.
5
5
  *
6
- * Issue: OD-467
6
+ *
7
7
  */
8
8
  import type { PerformanceData } from "../types/index.js";
9
9
  export interface GetTranscriptParams {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Retrieve a session transcript from Supabase storage.
5
5
  *
6
- * Issue: OD-467
6
+ *
7
7
  */
8
8
  import * as supabase from "../services/supabase-client.js";
9
9
  import { Timer, buildPerformanceData } from "../services/metrics.js";
@@ -14,7 +14,7 @@ import type { Project, PerformanceData } from "../types/index.js";
14
14
  export type GraphTraverseLens = "connected_to" | "produced_by" | "provenance" | "stats";
15
15
  export interface GraphTraverseParams {
16
16
  lens: GraphTraverseLens;
17
- /** Starting node. Examples: "OD-466", "CLI", "Scar: Done ≠ Deployed" */
17
+ /** Starting node. Examples: "PROJ-123", "cli", "Scar: Done ≠ Deployed" */
18
18
  node?: string;
19
19
  /** Filter by predicate */
20
20
  predicate?: string;