@myrialabs/clopen 0.4.25 → 0.4.27

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 (96) hide show
  1. package/backend/auth/permissions.ts +21 -0
  2. package/backend/bootstrap.ts +18 -1
  3. package/backend/chat/engine-handoff.test.ts +229 -0
  4. package/backend/chat/engine-handoff.ts +439 -0
  5. package/backend/chat/stream-manager.ts +200 -16
  6. package/backend/database/migrations/066_create_memory_graph.ts +369 -0
  7. package/backend/database/migrations/index.ts +7 -0
  8. package/backend/database/queries/audit-log-queries.test.ts +10 -1
  9. package/backend/database/queries/graph-queries.ts +1764 -0
  10. package/backend/database/queries/index.ts +2 -0
  11. package/backend/database/queries/memory-queue-queries.ts +381 -0
  12. package/backend/database/queries/snapshot-queries.ts +20 -0
  13. package/backend/engine/README.md +45 -2
  14. package/backend/engine/adapters/copilot/stream.ts +37 -1
  15. package/backend/engine/adapters/pi/models.ts +19 -7
  16. package/backend/engine/adapters/pi/stream.ts +2 -1
  17. package/backend/engine/docs/adapter-contract.md +25 -8
  18. package/backend/engine/docs/adding-an-engine.md +40 -4
  19. package/backend/engine/docs/frontend-and-chat.md +66 -1
  20. package/backend/engine/docs/lessons-learned.md +165 -6
  21. package/backend/engine/docs/quick-reference.md +10 -0
  22. package/backend/engine/docs/stack.md +10 -0
  23. package/backend/engine/docs/websocket-routes.md +15 -1
  24. package/backend/engine/engine-setup.ts +1 -1
  25. package/backend/engine/index.test.ts +186 -0
  26. package/backend/engine/index.ts +117 -71
  27. package/backend/engine/install-recipes.test.ts +105 -0
  28. package/backend/engine/install-recipes.ts +4 -1
  29. package/backend/index.ts +9 -0
  30. package/backend/mcp/internal/config.ts +6 -0
  31. package/backend/mcp/internal/servers/index.ts +2 -0
  32. package/backend/mcp/internal/servers/memory-graph/description.ts +33 -0
  33. package/backend/mcp/internal/servers/memory-graph/format.ts +45 -0
  34. package/backend/mcp/internal/servers/memory-graph/index.ts +52 -0
  35. package/backend/mcp/internal/servers/memory-graph/runner.ts +342 -0
  36. package/backend/mcp/internal/servers/memory-graph/schema.ts +140 -0
  37. package/backend/memory/README.md +432 -0
  38. package/backend/memory/bootstrap.ts +101 -0
  39. package/backend/memory/compose.test.ts +198 -0
  40. package/backend/memory/compose.ts +343 -0
  41. package/backend/memory/config.ts +100 -0
  42. package/backend/memory/consolidate.ts +280 -0
  43. package/backend/memory/context.test.ts +321 -0
  44. package/backend/memory/context.ts +451 -0
  45. package/backend/memory/embedding/embedder.test.ts +141 -0
  46. package/backend/memory/embedding/embedder.ts +269 -0
  47. package/backend/memory/embedding/index.ts +17 -0
  48. package/backend/memory/embedding/install.ts +254 -0
  49. package/backend/memory/embedding/paths.ts +101 -0
  50. package/backend/memory/embedding/vector-cache.ts +270 -0
  51. package/backend/memory/extract/episodic.ts +725 -0
  52. package/backend/memory/extract/index.ts +133 -0
  53. package/backend/memory/extract/languages.ts +176 -0
  54. package/backend/memory/extract/scheduler.test.ts +352 -0
  55. package/backend/memory/extract/scheduler.ts +406 -0
  56. package/backend/memory/extract/structural.test.ts +215 -0
  57. package/backend/memory/extract/structural.ts +364 -0
  58. package/backend/memory/index.ts +37 -0
  59. package/backend/memory/indexer.ts +150 -0
  60. package/backend/memory/invalidate.ts +134 -0
  61. package/backend/memory/judge.ts +285 -0
  62. package/backend/memory/maintenance.ts +132 -0
  63. package/backend/memory/model.ts +91 -0
  64. package/backend/memory/notify.ts +102 -0
  65. package/backend/memory/readiness.ts +74 -0
  66. package/backend/memory/redact.test.ts +101 -0
  67. package/backend/memory/redact.ts +133 -0
  68. package/backend/memory/retention.ts +139 -0
  69. package/backend/memory/retrieval.eval.test.ts +301 -0
  70. package/backend/memory/retrieval.test.ts +1023 -0
  71. package/backend/memory/retrieval.ts +707 -0
  72. package/backend/memory/revise.test.ts +693 -0
  73. package/backend/memory/revise.ts +400 -0
  74. package/backend/memory/time.ts +31 -0
  75. package/backend/memory/view.ts +164 -0
  76. package/backend/shipped-runtime-imports.test.ts +228 -0
  77. package/backend/ws/index.ts +5 -1
  78. package/backend/ws/memory/crud.ts +631 -0
  79. package/backend/ws/memory/index.ts +41 -0
  80. package/backend/ws/sessions/crud.ts +10 -0
  81. package/backend/ws/snapshot/content.ts +85 -0
  82. package/backend/ws/snapshot/index.ts +4 -1
  83. package/backend/ws/snapshot/restore.ts +38 -4
  84. package/dist/assets/graph-layout.worker-CRFqN7ZQ.js +1 -0
  85. package/dist/assets/{index-KBGloYDk.js → index-BCv5HlPk.js} +1 -1
  86. package/dist/assets/{index-C4PD7B-x.js → index-BTGcf_Vy.js} +1 -1
  87. package/dist/assets/main-BrqMMMRX.css +1 -0
  88. package/dist/assets/main-CgmAFpU3.js +1036 -0
  89. package/dist/index.html +2 -2
  90. package/package.json +8 -2
  91. package/shared/types/database/connection.ts +9 -0
  92. package/shared/types/memory.ts +519 -0
  93. package/shared/utils/logger.ts +1 -0
  94. package/dist/assets/main-B0AA-88X.js +0 -622
  95. package/dist/assets/main-OsjA5Ab5.css +0 -1
  96. package/shared/utils/anonymous-user.ts +0 -168
@@ -64,6 +64,7 @@ import * as migration062 from './062_add_session_source';
64
64
  import * as migration063 from './063_add_invite_project_ids';
65
65
  import * as migration064 from './064_create_messages_fts';
66
66
  import * as migration065 from './065_add_session_reasoning_effort';
67
+ import * as migration066 from './066_create_memory_graph';
67
68
 
68
69
  // Export all migrations in order
69
70
  export const migrations = [
@@ -456,6 +457,12 @@ export const migrations = [
456
457
  description: migration065.description,
457
458
  up: migration065.up,
458
459
  down: migration065.down
460
+ },
461
+ {
462
+ id: '066',
463
+ description: migration066.description,
464
+ up: migration066.up,
465
+ down: migration066.down
459
466
  }
460
467
  ];
461
468
 
@@ -86,9 +86,18 @@ mock.module('../index', () => ({
86
86
  getDatabase: () => mockDb
87
87
  }));
88
88
 
89
+ // Every method, not just the one this file asserts on. `mock.module` replaces the
90
+ // module for the WHOLE test process, so a partial stub here leaves any file that
91
+ // runs afterwards with a `debug` missing `log`/`warn`/etc — which fails as
92
+ // "debug.log is not a function" inside unrelated code, a long way from this line.
89
93
  mock.module('$shared/utils/logger', () => ({
90
94
  debug: {
91
- error: mockDebugError
95
+ log: () => {},
96
+ info: () => {},
97
+ warn: () => {},
98
+ error: mockDebugError,
99
+ debug: () => {},
100
+ trace: () => {}
92
101
  }
93
102
  }));
94
103