claude-memory-layer 1.0.30 → 1.0.32

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 (338) hide show
  1. package/README.md +12 -5
  2. package/dist/cli/index.js +4 -3
  3. package/dist/cli/index.js.map +2 -2
  4. package/dist/core/index.js +3 -2
  5. package/dist/core/index.js.map +2 -2
  6. package/dist/hooks/post-tool-use.js +3 -2
  7. package/dist/hooks/post-tool-use.js.map +2 -2
  8. package/dist/hooks/semantic-daemon.js +3 -2
  9. package/dist/hooks/semantic-daemon.js.map +2 -2
  10. package/dist/hooks/session-end.js +3 -2
  11. package/dist/hooks/session-end.js.map +2 -2
  12. package/dist/hooks/session-start.js +3 -2
  13. package/dist/hooks/session-start.js.map +2 -2
  14. package/dist/hooks/stop.js +3 -2
  15. package/dist/hooks/stop.js.map +2 -2
  16. package/dist/hooks/user-prompt-submit.js +3 -2
  17. package/dist/hooks/user-prompt-submit.js.map +2 -2
  18. package/dist/index.js +3 -2
  19. package/dist/index.js.map +2 -2
  20. package/dist/mcp/index.js +3 -2
  21. package/dist/mcp/index.js.map +2 -2
  22. package/dist/server/api/index.js +3 -2
  23. package/dist/server/api/index.js.map +2 -2
  24. package/dist/server/index.js +3 -2
  25. package/dist/server/index.js.map +2 -2
  26. package/dist/services/memory-service.js +3 -2
  27. package/dist/services/memory-service.js.map +2 -2
  28. package/package.json +10 -3
  29. package/scripts/postinstall-embedding-backend.cjs +18 -16
  30. package/AGENTS.md +0 -71
  31. package/CLAUDE.md +0 -30
  32. package/HANDOFF.md +0 -92
  33. package/Memo.txt +0 -558
  34. package/benchmarks/replay/anonymized-real-sessions.json +0 -48
  35. package/config/kpi-thresholds.json +0 -7
  36. package/context.md +0 -636
  37. package/docs/ARCHITECTURE_COMPARISON_AND_RECOMMENDATIONS.md +0 -627
  38. package/docs/HERMES_MEMORY_INGESTION_ANALYSIS.md +0 -440
  39. package/docs/MCP_MEMORY_SERVICE_COMPARATIVE_REVIEW.md +0 -271
  40. package/docs/MEMORY_USEFULNESS_AUDIT.md +0 -371
  41. package/docs/MEMORY_USEFULNESS_AUDIT_RAW.json +0 -80
  42. package/docs/MEMSEARCH_PROJECT_STRUCTURE_ANALYSIS.md +0 -333
  43. package/docs/MEMU_ADOPTION.md +0 -40
  44. package/docs/OPERATIONS.md +0 -18
  45. package/docs/PRODUCT_VALIDATION_MATRIX.md +0 -82
  46. package/docs/PROJECT_STRUCTURE_ANALYSIS.md +0 -421
  47. package/docs/REFACTORING_MILESTONES_AND_ISSUES.md +0 -501
  48. package/docs/REFACTORING_PLAN_THIN_CORE.md +0 -414
  49. package/docs/REFERENCE_PROJECT_ANALYSES.md +0 -25
  50. package/docs/SUPERLOCALMEMORY_PROJECT_STRUCTURE_ANALYSIS.md +0 -452
  51. package/docs/TARGET_ARCHITECTURE_AND_FOLDER_STRUCTURE.md +0 -446
  52. package/docs/architecture/comparison-index.md +0 -47
  53. package/docs/reports/codex-real-data-validation-20260505T040447Z.md +0 -46
  54. package/plan.md +0 -1642
  55. package/scripts/build.ts +0 -159
  56. package/scripts/bump-patch-version.sh +0 -18
  57. package/scripts/delete-unknown-projects.js +0 -154
  58. package/scripts/fix-sync-gap.js +0 -32
  59. package/scripts/generate-session-qrels.ts +0 -126
  60. package/scripts/heartbeat-memory-orchestrator.sh +0 -28
  61. package/scripts/replay-retrieval-benchmark.ts +0 -69
  62. package/scripts/report-sync-gap.js +0 -26
  63. package/scripts/review-queue-auto-resolve.js +0 -21
  64. package/scripts/sync-gap-auto-heal.sh +0 -17
  65. package/spec.md +0 -624
  66. package/specs/20260207-dashboard-upgrade/context.md +0 -38
  67. package/specs/20260207-dashboard-upgrade/spec.md +0 -96
  68. package/specs/citations-system/context.md +0 -243
  69. package/specs/citations-system/plan.md +0 -495
  70. package/specs/citations-system/spec.md +0 -371
  71. package/specs/endless-mode/context.md +0 -305
  72. package/specs/endless-mode/plan.md +0 -620
  73. package/specs/endless-mode/spec.md +0 -455
  74. package/specs/entity-edge-model/context.md +0 -401
  75. package/specs/entity-edge-model/plan.md +0 -459
  76. package/specs/entity-edge-model/spec.md +0 -391
  77. package/specs/evidence-aligner-v2/context.md +0 -401
  78. package/specs/evidence-aligner-v2/plan.md +0 -303
  79. package/specs/evidence-aligner-v2/spec.md +0 -312
  80. package/specs/mcp-desktop-integration/context.md +0 -278
  81. package/specs/mcp-desktop-integration/plan.md +0 -550
  82. package/specs/mcp-desktop-integration/spec.md +0 -494
  83. package/specs/memory-utilization-improvements/context.md +0 -145
  84. package/specs/memory-utilization-improvements/plan.md +0 -361
  85. package/specs/memory-utilization-improvements/spec.md +0 -361
  86. package/specs/post-tool-use-hook/context.md +0 -319
  87. package/specs/post-tool-use-hook/plan.md +0 -469
  88. package/specs/post-tool-use-hook/spec.md +0 -364
  89. package/specs/private-tags/context.md +0 -288
  90. package/specs/private-tags/plan.md +0 -412
  91. package/specs/private-tags/spec.md +0 -345
  92. package/specs/progressive-disclosure/context.md +0 -346
  93. package/specs/progressive-disclosure/plan.md +0 -663
  94. package/specs/progressive-disclosure/spec.md +0 -415
  95. package/specs/selective-tool-observation/context.md +0 -100
  96. package/specs/selective-tool-observation/plan.md +0 -158
  97. package/specs/selective-tool-observation/spec.md +0 -127
  98. package/specs/task-entity-system/context.md +0 -297
  99. package/specs/task-entity-system/plan.md +0 -301
  100. package/specs/task-entity-system/spec.md +0 -314
  101. package/specs/thin-core-refactor/context.md +0 -275
  102. package/specs/thin-core-refactor/plan.md +0 -536
  103. package/specs/thin-core-refactor/spec.md +0 -465
  104. package/specs/vector-outbox-v2/context.md +0 -470
  105. package/specs/vector-outbox-v2/plan.md +0 -562
  106. package/specs/vector-outbox-v2/spec.md +0 -466
  107. package/specs/web-viewer-ui/context.md +0 -384
  108. package/specs/web-viewer-ui/plan.md +0 -797
  109. package/specs/web-viewer-ui/spec.md +0 -516
  110. package/src/adapters/claude/capture/index.ts +0 -3
  111. package/src/adapters/claude/context/index.ts +0 -3
  112. package/src/adapters/claude/hooks/index.ts +0 -21
  113. package/src/adapters/claude/hooks/post-tool-use.ts +0 -239
  114. package/src/adapters/claude/hooks/prompt-injection-policy.ts +0 -104
  115. package/src/adapters/claude/hooks/semantic-daemon-client.ts +0 -209
  116. package/src/adapters/claude/hooks/semantic-daemon.ts +0 -283
  117. package/src/adapters/claude/hooks/session-end.ts +0 -59
  118. package/src/adapters/claude/hooks/session-start.ts +0 -73
  119. package/src/adapters/claude/hooks/stop.ts +0 -128
  120. package/src/adapters/claude/hooks/user-prompt-submit.ts +0 -361
  121. package/src/adapters/claude/index.ts +0 -4
  122. package/src/adapters/claude/transcript/index.ts +0 -4
  123. package/src/adapters/claude/transcript/transcript-reader.ts +0 -57
  124. package/src/adapters/claude/transcript/turn-reconstructor.ts +0 -65
  125. package/src/apps/cli/claude-settings-hooks.ts +0 -138
  126. package/src/apps/cli/codex-import-runner.ts +0 -125
  127. package/src/apps/cli/codex-validation-output.ts +0 -95
  128. package/src/apps/cli/hermes-import-runner.ts +0 -130
  129. package/src/apps/cli/hermes-validation-output.ts +0 -91
  130. package/src/apps/cli/index.ts +0 -1735
  131. package/src/apps/cli/mcp-install.ts +0 -106
  132. package/src/apps/cli/retrieval-disclosure-output.ts +0 -196
  133. package/src/apps/dashboard/assets/js/bootstrap.js +0 -244
  134. package/src/apps/dashboard/assets/js/chat.js +0 -373
  135. package/src/apps/dashboard/assets/js/disclosure.js +0 -232
  136. package/src/apps/dashboard/assets/js/modals.js +0 -298
  137. package/src/apps/dashboard/assets/js/overview.js +0 -655
  138. package/src/apps/dashboard/assets/js/state.js +0 -72
  139. package/src/apps/dashboard/assets/js/views.js +0 -468
  140. package/src/apps/dashboard/index.html +0 -543
  141. package/src/apps/dashboard/index.ts +0 -3
  142. package/src/apps/dashboard/style.css +0 -1750
  143. package/src/apps/index.ts +0 -5
  144. package/src/apps/server/api/chat.ts +0 -244
  145. package/src/apps/server/api/citations.ts +0 -105
  146. package/src/apps/server/api/events.ts +0 -137
  147. package/src/apps/server/api/health.ts +0 -53
  148. package/src/apps/server/api/index.ts +0 -26
  149. package/src/apps/server/api/projects.ts +0 -74
  150. package/src/apps/server/api/search.ts +0 -184
  151. package/src/apps/server/api/sessions.ts +0 -115
  152. package/src/apps/server/api/stats.ts +0 -723
  153. package/src/apps/server/api/turns.ts +0 -143
  154. package/src/apps/server/api/utils.ts +0 -65
  155. package/src/apps/server/index.ts +0 -111
  156. package/src/cli/index.ts +0 -3
  157. package/src/cli/retrieval-disclosure-output.ts +0 -2
  158. package/src/compat/index.ts +0 -5
  159. package/src/core/canonical-key.ts +0 -186
  160. package/src/core/citation-generator.ts +0 -63
  161. package/src/core/consolidated-store.ts +0 -356
  162. package/src/core/consolidation-worker.ts +0 -493
  163. package/src/core/context-formatter.ts +0 -276
  164. package/src/core/continuity-manager.ts +0 -341
  165. package/src/core/db-wrapper.ts +0 -64
  166. package/src/core/derive/fact-deriver.ts +0 -170
  167. package/src/core/derive/index.ts +0 -2
  168. package/src/core/derive/summary-deriver.ts +0 -76
  169. package/src/core/edge-repo.ts +0 -333
  170. package/src/core/embedder.ts +0 -4
  171. package/src/core/engine/embedding-maintenance-service.ts +0 -187
  172. package/src/core/engine/endless-memory-services.ts +0 -4
  173. package/src/core/engine/index.ts +0 -19
  174. package/src/core/engine/memory-engine-services.ts +0 -170
  175. package/src/core/engine/memory-ingest-service.ts +0 -317
  176. package/src/core/engine/memory-query-service.ts +0 -173
  177. package/src/core/engine/memory-runtime-service.ts +0 -162
  178. package/src/core/engine/memory-service-composition.ts +0 -231
  179. package/src/core/engine/retrieval-analytics-service.ts +0 -181
  180. package/src/core/engine/retrieval-disclosure-service.ts +0 -420
  181. package/src/core/engine/retrieval-orchestrator.ts +0 -377
  182. package/src/core/engine/retrieval-services.ts +0 -176
  183. package/src/core/engine/shared-memory-services.ts +0 -4
  184. package/src/core/entity-repo.ts +0 -349
  185. package/src/core/event-store.ts +0 -779
  186. package/src/core/evidence-aligner.ts +0 -635
  187. package/src/core/external-market-context.ts +0 -582
  188. package/src/core/graduation-worker.ts +0 -171
  189. package/src/core/graduation.ts +0 -377
  190. package/src/core/index.ts +0 -64
  191. package/src/core/ingest-interceptor.ts +0 -80
  192. package/src/core/markdown-mirror.ts +0 -70
  193. package/src/core/matcher.ts +0 -208
  194. package/src/core/md-mirror.ts +0 -92
  195. package/src/core/metadata-extractor.ts +0 -203
  196. package/src/core/model/memory-fact.ts +0 -30
  197. package/src/core/model/memory-rule.ts +0 -14
  198. package/src/core/model/memory-summary.ts +0 -21
  199. package/src/core/model/raw-event.ts +0 -28
  200. package/src/core/model/retrieval-result.ts +0 -35
  201. package/src/core/mongo-sync-config.ts +0 -165
  202. package/src/core/mongo-sync-worker.ts +0 -381
  203. package/src/core/privacy/filter.ts +0 -190
  204. package/src/core/privacy/index.ts +0 -20
  205. package/src/core/privacy/tag-parser.ts +0 -145
  206. package/src/core/product-validation-matrix.ts +0 -314
  207. package/src/core/progressive-retriever.ts +0 -414
  208. package/src/core/registry/project-path.ts +0 -54
  209. package/src/core/registry/session-registry.ts +0 -69
  210. package/src/core/replay-evaluator.ts +0 -625
  211. package/src/core/retrieval-benchmark.ts +0 -117
  212. package/src/core/retrieval-quality.ts +0 -109
  213. package/src/core/retriever.ts +0 -800
  214. package/src/core/session-qrels.ts +0 -360
  215. package/src/core/shared-event-store.ts +0 -114
  216. package/src/core/shared-promoter.ts +0 -249
  217. package/src/core/shared-store.ts +0 -289
  218. package/src/core/shared-vector-store.ts +0 -203
  219. package/src/core/sqlite-event-store.ts +0 -1846
  220. package/src/core/sqlite-wrapper.ts +0 -116
  221. package/src/core/sync-worker.ts +0 -228
  222. package/src/core/tag-taxonomy.ts +0 -51
  223. package/src/core/task/blocker-resolver.ts +0 -333
  224. package/src/core/task/index.ts +0 -9
  225. package/src/core/task/task-matcher.ts +0 -240
  226. package/src/core/task/task-projector.ts +0 -358
  227. package/src/core/task/task-resolver.ts +0 -421
  228. package/src/core/turn-state.ts +0 -207
  229. package/src/core/types.ts +0 -952
  230. package/src/core/vector-outbox.ts +0 -299
  231. package/src/core/vector-store.ts +0 -231
  232. package/src/core/vector-worker.ts +0 -521
  233. package/src/core/working-set-store.ts +0 -257
  234. package/src/extensions/endless-memory/endless-memory-services.ts +0 -350
  235. package/src/extensions/endless-memory/index.ts +0 -1
  236. package/src/extensions/index.ts +0 -5
  237. package/src/extensions/mcp/handlers.ts +0 -960
  238. package/src/extensions/mcp/index.ts +0 -48
  239. package/src/extensions/mcp/tools.ts +0 -252
  240. package/src/extensions/shared-memory/index.ts +0 -1
  241. package/src/extensions/shared-memory/shared-memory-services.ts +0 -211
  242. package/src/extensions/vector/embedder.ts +0 -233
  243. package/src/extensions/vector/index.ts +0 -1
  244. package/src/hooks/post-tool-use.ts +0 -9
  245. package/src/hooks/semantic-daemon-client.ts +0 -1
  246. package/src/hooks/semantic-daemon.ts +0 -11
  247. package/src/hooks/session-end.ts +0 -9
  248. package/src/hooks/session-start.ts +0 -9
  249. package/src/hooks/stop.ts +0 -9
  250. package/src/hooks/user-prompt-submit.ts +0 -9
  251. package/src/index.ts +0 -13
  252. package/src/mcp/handlers.ts +0 -2
  253. package/src/mcp/index.ts +0 -4
  254. package/src/mcp/tools.ts +0 -2
  255. package/src/server/api/chat.ts +0 -2
  256. package/src/server/api/citations.ts +0 -2
  257. package/src/server/api/events.ts +0 -2
  258. package/src/server/api/health.ts +0 -2
  259. package/src/server/api/index.ts +0 -2
  260. package/src/server/api/projects.ts +0 -2
  261. package/src/server/api/search.ts +0 -2
  262. package/src/server/api/sessions.ts +0 -2
  263. package/src/server/api/stats.ts +0 -2
  264. package/src/server/api/turns.ts +0 -2
  265. package/src/server/api/utils.ts +0 -2
  266. package/src/server/index.ts +0 -2
  267. package/src/services/bootstrap-organizer.ts +0 -463
  268. package/src/services/codex-session-history-importer.ts +0 -966
  269. package/src/services/hermes-session-history-importer.ts +0 -733
  270. package/src/services/memory-service-config.ts +0 -36
  271. package/src/services/memory-service-registry.ts +0 -150
  272. package/src/services/memory-service.ts +0 -688
  273. package/src/services/session-history-importer.ts +0 -629
  274. package/tests/README.md +0 -23
  275. package/tests/adapters/claude/claude-semantic-daemon-adapter.test.ts +0 -54
  276. package/tests/adapters/claude/claude-transcript-reconstructor.test.ts +0 -98
  277. package/tests/adapters/claude-hook-prompt-injection-policy.test.ts +0 -99
  278. package/tests/apps/app-layer-boundary.test.ts +0 -48
  279. package/tests/apps/claude-settings-hooks.test.ts +0 -107
  280. package/tests/apps/cli-disclosure-output.test.ts +0 -212
  281. package/tests/apps/codex-import-runner.test.ts +0 -99
  282. package/tests/apps/codex-validation-output.test.ts +0 -100
  283. package/tests/apps/hermes-import-runner.test.ts +0 -99
  284. package/tests/apps/mcp-install-command.test.ts +0 -59
  285. package/tests/apps/package-build-entrypoints.test.ts +0 -30
  286. package/tests/apps/postinstall-embedding-backend.test.ts +0 -175
  287. package/tests/apps/search-api-disclosure.test.ts +0 -162
  288. package/tests/apps/stats-api-lightweight.test.ts +0 -67
  289. package/tests/apps/ui-disclosure-output.test.ts +0 -140
  290. package/tests/core/bootstrap-organizer.test.ts +0 -111
  291. package/tests/core/canonical-key.test.ts +0 -101
  292. package/tests/core/codex-session-history-importer-validation.test.ts +0 -185
  293. package/tests/core/consolidation-worker.test.ts +0 -75
  294. package/tests/core/embedding-maintenance-service.test.ts +0 -282
  295. package/tests/core/evidence-aligner.test.ts +0 -152
  296. package/tests/core/external-market-context.test.ts +0 -209
  297. package/tests/core/fact-deriver.test.ts +0 -79
  298. package/tests/core/hermes-session-history-importer-validation.test.ts +0 -609
  299. package/tests/core/ingest-interceptor.test.ts +0 -38
  300. package/tests/core/markdown-mirror.test.ts +0 -85
  301. package/tests/core/matcher.test.ts +0 -112
  302. package/tests/core/md-mirror.test.ts +0 -50
  303. package/tests/core/memory-engine-services.test.ts +0 -240
  304. package/tests/core/memory-ingest-service.test.ts +0 -296
  305. package/tests/core/memory-query-service.test.ts +0 -129
  306. package/tests/core/memory-runtime-service.test.ts +0 -201
  307. package/tests/core/memory-service-composition.test.ts +0 -192
  308. package/tests/core/memory-service-config.test.ts +0 -41
  309. package/tests/core/memory-service-facade.test.ts +0 -30
  310. package/tests/core/memory-service-registry.test.ts +0 -206
  311. package/tests/core/product-validation-matrix.test.ts +0 -61
  312. package/tests/core/project-registry.test.ts +0 -78
  313. package/tests/core/replay-evaluator.test.ts +0 -181
  314. package/tests/core/retrieval-analytics-service.test.ts +0 -210
  315. package/tests/core/retrieval-benchmark.test.ts +0 -93
  316. package/tests/core/retrieval-disclosure-service.test.ts +0 -264
  317. package/tests/core/retrieval-orchestrator.test.ts +0 -403
  318. package/tests/core/retrieval-quality.test.ts +0 -31
  319. package/tests/core/retrieval-services.test.ts +0 -185
  320. package/tests/core/retriever-fallback-chain.test.ts +0 -223
  321. package/tests/core/retriever-strategy-scope.test.ts +0 -164
  322. package/tests/core/retriever.memu-adoption.test.ts +0 -122
  323. package/tests/core/session-history-importer-filter.test.ts +0 -78
  324. package/tests/core/session-qrels.test.ts +0 -250
  325. package/tests/core/sqlite-event-store-replication.test.ts +0 -127
  326. package/tests/core/summary-deriver.test.ts +0 -66
  327. package/tests/extensions/embedder-warning-suppression.test.ts +0 -83
  328. package/tests/extensions/endless-memory-extension-boundary.test.ts +0 -17
  329. package/tests/extensions/endless-memory-services.test.ts +0 -325
  330. package/tests/extensions/mcp-context-tools.test.ts +0 -905
  331. package/tests/extensions/mcp-extension-boundary.test.ts +0 -21
  332. package/tests/extensions/mcp-package-build.test.ts +0 -22
  333. package/tests/extensions/mcp-project-aware-tools.test.ts +0 -102
  334. package/tests/extensions/shared-memory-extension-boundary.test.ts +0 -24
  335. package/tests/extensions/shared-memory-services.test.ts +0 -309
  336. package/tests/extensions/vector-extension-boundary.test.ts +0 -21
  337. package/tsconfig.json +0 -24
  338. package/vitest.config.ts +0 -15
package/scripts/build.ts DELETED
@@ -1,159 +0,0 @@
1
- /**
2
- * Build script for claude-memory-layer plugin
3
- * Uses esbuild for fast bundling
4
- */
5
-
6
- import * as esbuild from 'esbuild';
7
- import * as fs from 'fs';
8
- import * as path from 'path';
9
-
10
- const outdir = 'dist';
11
- const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf-8')) as { version?: string };
12
- const appVersion = packageJson.version ?? '0.0.0';
13
-
14
- // Clean output directory
15
- if (fs.existsSync(outdir)) {
16
- fs.rmSync(outdir, { recursive: true });
17
- }
18
- fs.mkdirSync(outdir, { recursive: true });
19
-
20
- // Common build options
21
- const commonOptions: esbuild.BuildOptions = {
22
- bundle: true,
23
- platform: 'node',
24
- target: 'node18',
25
- format: 'esm',
26
- sourcemap: true,
27
- external: [
28
- '@hono/node-server',
29
- '@hono/node-server/serve-static',
30
- '@lancedb/lancedb',
31
- '@xenova/transformers',
32
- '@huggingface/transformers',
33
- 'duckdb',
34
- 'better-sqlite3',
35
- 'commander',
36
- 'mongodb',
37
- 'zod',
38
- 'hono',
39
- 'hono/cors',
40
- 'hono/logger'
41
- ],
42
- define: {
43
- 'process.env.CLAUDE_MEMORY_LAYER_VERSION': JSON.stringify(appVersion)
44
- },
45
- banner: {
46
- js: `import { createRequire } from 'module';
47
- import { fileURLToPath } from 'url';
48
- import { dirname } from 'path';
49
- const require = createRequire(import.meta.url);
50
- const __filename = fileURLToPath(import.meta.url);
51
- const __dirname = dirname(__filename);`
52
- }
53
- };
54
-
55
- async function build() {
56
- console.log('🔨 Building claude-memory-layer plugin...\n');
57
-
58
- // Build CLI app
59
- console.log('📦 Building CLI...');
60
- await esbuild.build({
61
- ...commonOptions,
62
- entryPoints: ['src/apps/cli/index.ts'],
63
- outfile: 'dist/cli/index.js'
64
- });
65
-
66
- // Build MCP stdio server bin
67
- console.log('📦 Building MCP server...');
68
- await esbuild.build({
69
- ...commonOptions,
70
- entryPoints: ['src/mcp/index.ts'],
71
- outfile: 'dist/mcp/index.js'
72
- });
73
-
74
- // Build hooks
75
- console.log('📦 Building hooks...');
76
- const hooks = [
77
- 'session-start',
78
- 'user-prompt-submit',
79
- 'post-tool-use',
80
- 'stop',
81
- 'session-end',
82
- 'semantic-daemon'
83
- ];
84
-
85
- for (const hook of hooks) {
86
- await esbuild.build({
87
- ...commonOptions,
88
- entryPoints: [`src/hooks/${hook}.ts`],
89
- outfile: `dist/hooks/${hook}.js`
90
- });
91
- }
92
-
93
- // Build core modules as library
94
- console.log('📦 Building core modules...');
95
- await esbuild.build({
96
- ...commonOptions,
97
- entryPoints: ['src/index.ts'],
98
- outfile: 'dist/index.js'
99
- });
100
-
101
- await esbuild.build({
102
- ...commonOptions,
103
- entryPoints: ['src/core/index.ts'],
104
- outfile: 'dist/core/index.js'
105
- });
106
-
107
- // Build services
108
- console.log('📦 Building services...');
109
- await esbuild.build({
110
- ...commonOptions,
111
- entryPoints: ['src/services/memory-service.ts'],
112
- outfile: 'dist/services/memory-service.js'
113
- });
114
-
115
- // Build server
116
- console.log('📦 Building server...');
117
- await esbuild.build({
118
- ...commonOptions,
119
- entryPoints: ['src/apps/server/index.ts'],
120
- outfile: 'dist/server/index.js',
121
- external: [...(commonOptions.external || []), 'hono']
122
- });
123
-
124
- // Build server API
125
- await esbuild.build({
126
- ...commonOptions,
127
- entryPoints: ['src/apps/server/api/index.ts'],
128
- outfile: 'dist/server/api/index.js',
129
- external: [...(commonOptions.external || []), 'hono']
130
- });
131
-
132
- // Copy plugin manifest
133
- console.log('📋 Copying plugin files...');
134
- fs.cpSync('.claude-plugin', path.join(outdir, '.claude-plugin'), { recursive: true });
135
-
136
- // Copy dashboard static files
137
- console.log('📋 Copying dashboard files...');
138
- const dashboardPath = 'src/apps/dashboard';
139
- if (fs.existsSync(dashboardPath)) {
140
- fs.cpSync(dashboardPath, path.join(outdir, 'ui'), { recursive: true });
141
- }
142
-
143
- console.log('\n✅ Build complete!');
144
- console.log(`\nOutput: ${outdir}/`);
145
- console.log(' - cli/index.js');
146
- console.log(' - mcp/index.js');
147
- console.log(' - index.js');
148
- console.log(' - hooks/*.js');
149
- console.log(' - core/index.js');
150
- console.log(' - services/memory-service.js');
151
- console.log(' - server/index.js');
152
- console.log(' - ui/index.html');
153
- console.log(' - .claude-plugin/');
154
- }
155
-
156
- build().catch((err) => {
157
- console.error('Build failed:', err);
158
- process.exit(1);
159
- });
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
- ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
6
-
7
- cd "${ROOT_DIR}"
8
-
9
- if [[ ! -f package.json ]]; then
10
- echo "Error: package.json not found in ${ROOT_DIR}" >&2
11
- exit 1
12
- fi
13
-
14
- old_version="$(node -p "require('./package.json').version")"
15
- npm version patch --no-git-tag-version >/dev/null
16
- new_version="$(node -p "require('./package.json').version")"
17
-
18
- echo "Version bumped: ${old_version} -> ${new_version}"
@@ -1,154 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs';
3
- import os from 'node:os';
4
- import path from 'node:path';
5
-
6
- function parseArgs(argv) {
7
- const result = {
8
- apply: false,
9
- hashes: []
10
- };
11
-
12
- for (let i = 0; i < argv.length; i += 1) {
13
- const arg = argv[i];
14
- if (arg === '--apply') {
15
- result.apply = true;
16
- continue;
17
- }
18
- if (arg === '--hash' && i + 1 < argv.length) {
19
- result.hashes.push(String(argv[i + 1]).trim().toLowerCase());
20
- i += 1;
21
- continue;
22
- }
23
- if (arg.startsWith('--hash=')) {
24
- result.hashes.push(arg.slice('--hash='.length).trim().toLowerCase());
25
- }
26
- }
27
-
28
- return result;
29
- }
30
-
31
- function loadRegistryHashes(registryPath) {
32
- if (!fs.existsSync(registryPath)) return new Set();
33
- try {
34
- const raw = JSON.parse(fs.readFileSync(registryPath, 'utf8'));
35
- const sessions = raw && typeof raw === 'object' ? raw.sessions : null;
36
- if (!sessions || typeof sessions !== 'object') return new Set();
37
-
38
- const hashes = new Set();
39
- for (const entry of Object.values(sessions)) {
40
- if (!entry || typeof entry !== 'object') continue;
41
- const hash = entry.projectHash;
42
- if (typeof hash === 'string' && /^[a-f0-9]{8}$/.test(hash)) {
43
- hashes.add(hash);
44
- }
45
- }
46
- return hashes;
47
- } catch {
48
- return new Set();
49
- }
50
- }
51
-
52
- function getDirSizeBytes(targetPath) {
53
- if (!fs.existsSync(targetPath)) return 0;
54
- const stat = fs.statSync(targetPath);
55
- if (stat.isFile()) return stat.size;
56
- if (!stat.isDirectory()) return 0;
57
-
58
- let total = 0;
59
- const entries = fs.readdirSync(targetPath, { withFileTypes: true });
60
- for (const entry of entries) {
61
- const child = path.join(targetPath, entry.name);
62
- if (entry.isDirectory()) {
63
- total += getDirSizeBytes(child);
64
- } else if (entry.isFile()) {
65
- total += fs.statSync(child).size;
66
- }
67
- }
68
- return total;
69
- }
70
-
71
- function formatBytes(bytes) {
72
- if (bytes <= 0) return '0 B';
73
- const units = ['B', 'KB', 'MB', 'GB', 'TB'];
74
- let value = bytes;
75
- let unitIdx = 0;
76
- while (value >= 1024 && unitIdx < units.length - 1) {
77
- value /= 1024;
78
- unitIdx += 1;
79
- }
80
- return `${value.toFixed(1)} ${units[unitIdx]}`;
81
- }
82
-
83
- function main() {
84
- const args = parseArgs(process.argv.slice(2));
85
- const memoryRoot = process.env.CML_MEMORY_ROOT || path.join(os.homedir(), '.claude-code', 'memory');
86
- const projectsDir = path.join(memoryRoot, 'projects');
87
- const registryPath = path.join(memoryRoot, 'session-registry.json');
88
-
89
- if (!fs.existsSync(projectsDir)) {
90
- console.log(JSON.stringify({
91
- status: 'skip',
92
- reason: 'projects_dir_not_found',
93
- projectsDir
94
- }, null, 2));
95
- process.exit(0);
96
- }
97
-
98
- const knownHashes = loadRegistryHashes(registryPath);
99
- const filterHashes = new Set(
100
- args.hashes.filter((h) => /^[a-f0-9]{8}$/.test(h))
101
- );
102
-
103
- const candidates = fs.readdirSync(projectsDir, { withFileTypes: true })
104
- .filter((entry) => entry.isDirectory())
105
- .map((entry) => entry.name)
106
- .filter((name) => /^[a-f0-9]{8}$/.test(name))
107
- .filter((hash) => !knownHashes.has(hash))
108
- .filter((hash) => filterHashes.size === 0 || filterHashes.has(hash));
109
-
110
- const projectInfo = candidates.map((hash) => {
111
- const fullPath = path.join(projectsDir, hash);
112
- const sizeBytes = getDirSizeBytes(fullPath);
113
- return {
114
- hash,
115
- path: fullPath,
116
- sizeBytes,
117
- sizeHuman: formatBytes(sizeBytes)
118
- };
119
- });
120
-
121
- const totalBytes = projectInfo.reduce((sum, item) => sum + item.sizeBytes, 0);
122
-
123
- if (!args.apply) {
124
- console.log(JSON.stringify({
125
- status: 'dry-run',
126
- message: 'Run with --apply to delete the directories below.',
127
- memoryRoot,
128
- projectsDir,
129
- registryPath,
130
- unknownCount: projectInfo.length,
131
- totalSizeBytes: totalBytes,
132
- totalSizeHuman: formatBytes(totalBytes),
133
- projects: projectInfo
134
- }, null, 2));
135
- process.exit(0);
136
- }
137
-
138
- let deleted = 0;
139
- for (const item of projectInfo) {
140
- fs.rmSync(item.path, { recursive: true, force: true });
141
- deleted += 1;
142
- }
143
-
144
- console.log(JSON.stringify({
145
- status: 'ok',
146
- mode: 'apply',
147
- deletedCount: deleted,
148
- deletedSizeBytes: totalBytes,
149
- deletedSizeHuman: formatBytes(totalBytes),
150
- deletedHashes: projectInfo.map((item) => item.hash)
151
- }, null, 2));
152
- }
153
-
154
- main();
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs';
3
- import os from 'node:os';
4
- import path from 'node:path';
5
- import Database from 'better-sqlite3';
6
-
7
- const dbPath = process.env.CML_DB_PATH || path.join(os.homedir(), '.claude-code', 'memory', 'events.sqlite');
8
- if (!fs.existsSync(dbPath)) {
9
- console.log(JSON.stringify({ status: 'skip', reason: 'db_not_found', dbPath }, null, 2));
10
- process.exit(0);
11
- }
12
-
13
- const db = new Database(dbPath);
14
- const hasTable = (name) => !!db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(name);
15
-
16
- let inserted = { changes: 0 };
17
- if (hasTable('events') && hasTable('memory_levels')) {
18
- inserted = db.prepare(`
19
- INSERT OR IGNORE INTO memory_levels (event_id, level, promoted_at)
20
- SELECT e.id, 'L0', datetime('now')
21
- FROM events e
22
- LEFT JOIN memory_levels ml ON e.id = ml.event_id
23
- WHERE ml.event_id IS NULL
24
- `).run();
25
- }
26
-
27
- let recovered = { changes: 0 };
28
- if (hasTable('vector_outbox')) {
29
- recovered = db.prepare(`UPDATE vector_outbox SET status='pending', updated_at=datetime('now') WHERE status='processing'`).run();
30
- }
31
-
32
- console.log(JSON.stringify({ status: 'ok', dbPath, leveledInserted: Number(inserted.changes||0), recoveredProcessingOutbox: Number(recovered.changes||0) }, null, 2));
@@ -1,126 +0,0 @@
1
- #!/usr/bin/env tsx
2
- import { mkdir, readFile, writeFile } from 'node:fs/promises';
3
- import { homedir } from 'node:os';
4
- import * as path from 'node:path';
5
- import {
6
- buildSessionQrelsFixtureFromJsonl,
7
- collectClaudeSessionJsonlFiles,
8
- summarizeSessionQrelsFixture,
9
- type SessionQrelsNoMatchQueryInput
10
- } from '../src/core/session-qrels.js';
11
-
12
- const args = process.argv.slice(2);
13
-
14
- void main(args);
15
-
16
- async function main(argv: string[]): Promise<void> {
17
- const sessions: string[] = [];
18
- const sessionDirs: string[] = [];
19
- let outPath = '';
20
- let summaryOutPath = '';
21
- let name = 'session-qrels-fixture';
22
- let ks = [1, 3, 5];
23
- let maxQueries: number | undefined;
24
- let maxFiles: number | undefined;
25
- let minBytes = 0;
26
- let redactContent = false;
27
- let includeSubagents = false;
28
- const noMatchQueries: SessionQrelsNoMatchQueryInput[] = [];
29
-
30
- for (let i = 0; i < argv.length; i += 1) {
31
- const arg = argv[i];
32
- if (arg === '--session') {
33
- const value = argv[++i];
34
- if (value) sessions.push(value);
35
- } else if (arg === '--sessions-dir' || arg === '--session-dir') {
36
- const value = argv[++i];
37
- if (value) sessionDirs.push(value);
38
- } else if (arg === '--out') {
39
- outPath = argv[++i] ?? '';
40
- } else if (arg === '--summary-out') {
41
- summaryOutPath = argv[++i] ?? '';
42
- } else if (arg === '--name') {
43
- name = argv[++i] ?? name;
44
- } else if (arg === '--ks') {
45
- ks = (argv[++i] ?? '').split(',').map((value) => Number(value.trim())).filter(Number.isFinite);
46
- } else if (arg === '--max-queries') {
47
- const parsed = Number(argv[++i]);
48
- maxQueries = Number.isFinite(parsed) ? parsed : undefined;
49
- } else if (arg === '--max-files') {
50
- const parsed = Number(argv[++i]);
51
- maxFiles = Number.isFinite(parsed) ? parsed : undefined;
52
- } else if (arg === '--min-bytes') {
53
- const parsed = Number(argv[++i]);
54
- minBytes = Number.isFinite(parsed) ? parsed : minBytes;
55
- } else if (arg === '--redact-content') {
56
- redactContent = true;
57
- } else if (arg === '--include-subagents') {
58
- includeSubagents = true;
59
- } else if (arg === '--no-match-query' || arg === '--negative-query') {
60
- const query = argv[++i];
61
- if (query) noMatchQueries.push({ query });
62
- } else if (arg === '--no-match-forbidden-ids' || arg === '--negative-forbidden-ids') {
63
- const value = argv[++i] ?? '';
64
- const forbiddenIds = value.split(',').map((id) => id.trim()).filter(Boolean);
65
- const last = noMatchQueries[noMatchQueries.length - 1];
66
- if (last) last.forbiddenIds = forbiddenIds;
67
- } else if (!arg.startsWith('--')) {
68
- sessions.push(arg);
69
- }
70
- }
71
-
72
- for (const sessionDir of sessionDirs) {
73
- const discovered = await collectClaudeSessionJsonlFiles(expandUserPath(sessionDir), {
74
- includeSubagents,
75
- maxFiles,
76
- minBytes
77
- });
78
- sessions.push(...discovered);
79
- }
80
-
81
- const uniqueSessions = Array.from(new Set(sessions.map(expandUserPath)));
82
-
83
- if (uniqueSessions.length === 0) {
84
- console.error('Usage: tsx scripts/generate-session-qrels.ts --session <claude.jsonl> [--session <more.jsonl>] [--sessions-dir ~/.claude/projects] [--max-files 50] [--out fixture.json] [--summary-out summary.json] [--ks 1,3,5] [--redact-content] [--no-match-query "query" --no-match-forbidden-ids id1,id2]');
85
- process.exit(2);
86
- }
87
-
88
- if (!redactContent) {
89
- console.error('WARNING: generated qrels include raw user prompts and assistant responses. Review before committing or sharing, or pass --redact-content for shareable metadata.');
90
- }
91
-
92
- const generatedAt = new Date().toISOString();
93
- const jsonl = (await Promise.all(uniqueSessions.map((session) => readFile(session, 'utf8')))).join('\n');
94
- const fixture = buildSessionQrelsFixtureFromJsonl(jsonl, {
95
- name,
96
- ks,
97
- maxQueries,
98
- redactContent,
99
- sourceFileCount: uniqueSessions.length,
100
- rawContentIncluded: !redactContent,
101
- generatedAt,
102
- noMatchQueries
103
- });
104
- const output = `${JSON.stringify(fixture, null, 2)}\n`;
105
- const summary = summarizeSessionQrelsFixture(fixture);
106
-
107
- if (outPath) {
108
- await mkdir(path.dirname(expandUserPath(outPath)), { recursive: true });
109
- await writeFile(expandUserPath(outPath), output, 'utf8');
110
- } else {
111
- process.stdout.write(output);
112
- }
113
-
114
- if (summaryOutPath) {
115
- await mkdir(path.dirname(expandUserPath(summaryOutPath)), { recursive: true });
116
- await writeFile(expandUserPath(summaryOutPath), `${JSON.stringify(summary, null, 2)}\n`, 'utf8');
117
- }
118
-
119
- console.error(`Generated ${summary.queryCount} qrels from ${uniqueSessions.length} Claude JSONL file(s).`);
120
- }
121
-
122
- function expandUserPath(value: string): string {
123
- if (value === '~') return homedir();
124
- if (value.startsWith('~/')) return path.join(homedir(), value.slice(2));
125
- return value;
126
- }
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- TMP_REPORT=$(mktemp)
5
- TMP_HEAL=$(mktemp)
6
- TMP_REVIEW=$(mktemp)
7
- trap 'rm -f "$TMP_REPORT" "$TMP_HEAL" "$TMP_REVIEW"' EXIT
8
-
9
- node scripts/report-sync-gap.js >"$TMP_REPORT" || echo '{"status":"error","reason":"report_failed"}' >"$TMP_REPORT"
10
- bash scripts/sync-gap-auto-heal.sh >"$TMP_HEAL" || echo '{"status":"error","reason":"heal_failed"}' >"$TMP_HEAL"
11
- node scripts/review-queue-auto-resolve.js >"$TMP_REVIEW" || echo '{"status":"error","reason":"review_failed"}' >"$TMP_REVIEW"
12
-
13
- node - <<'EOF' "$TMP_REPORT" "$TMP_HEAL" "$TMP_REVIEW"
14
- const fs = require('fs');
15
- const safe = (p) => { try { return JSON.parse(fs.readFileSync(p,'utf8')); } catch { return { status:'error', reason:'parse_failed' }; } };
16
- const [r,h,v] = process.argv.slice(2);
17
- const report = safe(r);
18
- const heal = safe(h);
19
- const review = safe(v);
20
- const after = heal.after || {};
21
- const needsAttention = (report.outboxFailedCount||0) > 0 || (after.inEventsNotLeveledCount||0) > 0 || report.status === 'error' || heal.status === 'error';
22
- console.log(JSON.stringify({
23
- status: needsAttention ? 'needs-attention' : 'ok',
24
- report,
25
- heal,
26
- review
27
- }, null, 2));
28
- EOF
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env tsx
2
- import { readFile, writeFile } from 'node:fs/promises';
3
- import * as path from 'node:path';
4
- import {
5
- evaluateReplayFixture,
6
- formatReplayEvaluationMarkdown,
7
- type ReplayEvaluationFixture
8
- } from '../src/core/replay-evaluator.js';
9
- import type { RetrievalStrategy } from '../src/core/retriever.js';
10
-
11
- const args = process.argv.slice(2);
12
-
13
- void main(args);
14
-
15
- async function main(argv: string[]): Promise<void> {
16
- let fixturePath = path.join('benchmarks', 'replay', 'anonymized-real-sessions.json');
17
- let outPath = '';
18
- let format: 'json' | 'markdown' = 'json';
19
- let includePerQuery = true;
20
- let strategy: RetrievalStrategy | undefined;
21
- let topK: number | undefined;
22
- let minScore: number | undefined;
23
- let positionalFixtureConsumed = false;
24
-
25
- for (let i = 0; i < argv.length; i += 1) {
26
- const arg = argv[i];
27
- if (arg === '--fixture') {
28
- fixturePath = argv[++i] ?? fixturePath;
29
- } else if (arg === '--out' || arg === '--report-out') {
30
- outPath = argv[++i] ?? '';
31
- } else if (arg === '--format') {
32
- const parsed = argv[++i];
33
- if (parsed === 'markdown' || parsed === 'json') format = parsed;
34
- } else if (arg === '--no-per-query') {
35
- includePerQuery = false;
36
- } else if (arg === '--strategy') {
37
- const parsed = argv[++i];
38
- if (parsed === 'auto' || parsed === 'fast' || parsed === 'deep') strategy = parsed;
39
- } else if (arg === '--top-k' || arg === '--topK') {
40
- const parsed = Number(argv[++i]);
41
- topK = Number.isFinite(parsed) ? parsed : undefined;
42
- } else if (arg === '--min-score') {
43
- const parsed = Number(argv[++i]);
44
- minScore = Number.isFinite(parsed) ? parsed : undefined;
45
- } else if (!arg.startsWith('--') && !positionalFixtureConsumed) {
46
- fixturePath = arg;
47
- positionalFixtureConsumed = true;
48
- }
49
- }
50
-
51
- const fixture = JSON.parse(await readFile(fixturePath, 'utf8')) as ReplayEvaluationFixture;
52
- const report = await evaluateReplayFixture(fixture, {
53
- includePerQuery,
54
- topK,
55
- retrievalOptions: {
56
- ...(strategy ? { strategy } : {}),
57
- ...(minScore !== undefined ? { minScore } : {})
58
- }
59
- });
60
- const output = format === 'markdown'
61
- ? formatReplayEvaluationMarkdown(report, { qrelsPath: fixturePath })
62
- : `${JSON.stringify(report, null, 2)}\n`;
63
-
64
- if (outPath) {
65
- await writeFile(outPath, output, 'utf8');
66
- } else {
67
- process.stdout.write(output);
68
- }
69
- }
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs';
3
- import os from 'node:os';
4
- import path from 'node:path';
5
- import Database from 'better-sqlite3';
6
-
7
- const dbPath = process.env.CML_DB_PATH || path.join(os.homedir(), '.claude-code', 'memory', 'events.sqlite');
8
- if (!fs.existsSync(dbPath)) {
9
- console.log(JSON.stringify({ status: 'skip', reason: 'db_not_found', dbPath }, null, 2));
10
- process.exit(0);
11
- }
12
-
13
- const db = new Database(dbPath, { readonly: true });
14
- const total = db.prepare('SELECT COUNT(*) as c FROM events').get();
15
- const noLevel = db.prepare(`SELECT COUNT(*) as c FROM events e LEFT JOIN memory_levels ml ON e.id=ml.event_id WHERE ml.event_id IS NULL`).get();
16
- const outboxPending = db.prepare(`SELECT COUNT(*) as c FROM vector_outbox WHERE status='pending'`).get();
17
- const outboxFailed = db.prepare(`SELECT COUNT(*) as c FROM vector_outbox WHERE status='failed'`).get();
18
-
19
- console.log(JSON.stringify({
20
- status: 'ok',
21
- dbPath,
22
- totalEvents: total.c,
23
- inEventsNotLeveledCount: noLevel.c,
24
- outboxPendingCount: outboxPending.c,
25
- outboxFailedCount: outboxFailed.c,
26
- }, null, 2));
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- import fs from 'node:fs';
3
- import os from 'node:os';
4
- import path from 'node:path';
5
- import Database from 'better-sqlite3';
6
-
7
- const dbPath = process.env.CML_DB_PATH || path.join(os.homedir(), '.claude-code', 'memory', 'events.sqlite');
8
- if (!fs.existsSync(dbPath)) {
9
- console.log(JSON.stringify({ status: 'skip', reason: 'db_not_found', dbPath }, null, 2));
10
- process.exit(0);
11
- }
12
-
13
- const db = new Database(dbPath);
14
- const table = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='candidate_memories'").get();
15
- if (!table) {
16
- console.log(JSON.stringify({ status: 'skip', reason: 'candidate_memories_table_missing', dbPath }, null, 2));
17
- process.exit(0);
18
- }
19
-
20
- const res = db.prepare(`UPDATE candidate_memories SET status='resolved', updated_at=datetime('now') WHERE status='pending' AND confidence >= 0.9`).run();
21
- console.log(JSON.stringify({ status: 'ok', resolved: Number(res.changes || 0) }, null, 2));
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- REPORT=$(node scripts/report-sync-gap.js)
5
- PENDING=$(echo "$REPORT" | node -e 'const o=JSON.parse(require("fs").readFileSync(0,"utf8")); process.stdout.write(String(o.outboxPendingCount||0));')
6
- FAILED=$(echo "$REPORT" | node -e 'const o=JSON.parse(require("fs").readFileSync(0,"utf8")); process.stdout.write(String(o.outboxFailedCount||0));')
7
- NOLEVEL=$(echo "$REPORT" | node -e 'const o=JSON.parse(require("fs").readFileSync(0,"utf8")); process.stdout.write(String(o.inEventsNotLeveledCount||0));')
8
-
9
- AUTO=0
10
- if [[ "$FAILED" -gt 0 || "$NOLEVEL" -gt 0 ]]; then
11
- AUTO=1
12
- node scripts/fix-sync-gap.js >/dev/null
13
- fi
14
-
15
- AFTER=$(node scripts/report-sync-gap.js)
16
-
17
- node -e 'const before=JSON.parse(process.argv[1]); const after=JSON.parse(process.argv[2]); const auto=Number(process.argv[3]); console.log(JSON.stringify({status:"ok",autoFixApplied:auto,before,after},null,2));' "$REPORT" "$AFTER" "$AUTO"