@mastra/server 1.15.0-alpha.3 → 1.15.0-alpha.4

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 (28) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-IPQTQESA.cjs → chunk-26DWGZNJ.cjs} +434 -13
  3. package/dist/chunk-26DWGZNJ.cjs.map +1 -0
  4. package/dist/{chunk-OV64H74M.js → chunk-DVOXGNVI.js} +433 -12
  5. package/dist/chunk-DVOXGNVI.js.map +1 -0
  6. package/dist/{chunk-KH7BZQVQ.cjs → chunk-MJTEQGJT.cjs} +327 -25
  7. package/dist/chunk-MJTEQGJT.cjs.map +1 -0
  8. package/dist/{chunk-HPJ2CRVK.js → chunk-OVXPDSMT.js} +315 -27
  9. package/dist/chunk-OVXPDSMT.js.map +1 -0
  10. package/dist/docs/SKILL.md +1 -1
  11. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  12. package/dist/observational-memory-3XFCO6MX-WHVD3JTT.js +3 -0
  13. package/dist/{observational-memory-5NFPG6M3-MG2OMRFW.js.map → observational-memory-3XFCO6MX-WHVD3JTT.js.map} +1 -1
  14. package/dist/observational-memory-3XFCO6MX-WVUSRO35.cjs +108 -0
  15. package/dist/{observational-memory-5NFPG6M3-L7EU4ABW.cjs.map → observational-memory-3XFCO6MX-WVUSRO35.cjs.map} +1 -1
  16. package/dist/server/handlers/agent-builder.cjs +16 -16
  17. package/dist/server/handlers/agent-builder.js +1 -1
  18. package/dist/server/handlers.cjs +2 -2
  19. package/dist/server/handlers.js +1 -1
  20. package/dist/server/server-adapter/index.cjs +16 -16
  21. package/dist/server/server-adapter/index.js +1 -1
  22. package/package.json +5 -5
  23. package/dist/chunk-HPJ2CRVK.js.map +0 -1
  24. package/dist/chunk-IPQTQESA.cjs.map +0 -1
  25. package/dist/chunk-KH7BZQVQ.cjs.map +0 -1
  26. package/dist/chunk-OV64H74M.js.map +0 -1
  27. package/dist/observational-memory-5NFPG6M3-L7EU4ABW.cjs +0 -68
  28. package/dist/observational-memory-5NFPG6M3-MG2OMRFW.js +0 -3
@@ -10,7 +10,7 @@ var processors = require('@mastra/core/processors');
10
10
  var crypto$1 = require('crypto');
11
11
  var async_hooks = require('async_hooks');
12
12
 
13
- // ../memory/dist/chunk-5SMKVGJP.js
13
+ // ../memory/dist/chunk-JJBSFPC5.js
14
14
 
15
15
  // ../../node_modules/.pnpm/xxhash-wasm@1.1.0/node_modules/xxhash-wasm/esm/xxhash-wasm.js
16
16
  var t = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 48, 8, 96, 3, 127, 127, 127, 1, 127, 96, 3, 127, 127, 127, 0, 96, 2, 127, 127, 0, 96, 1, 127, 1, 127, 96, 3, 127, 127, 126, 1, 126, 96, 3, 126, 127, 127, 1, 126, 96, 2, 127, 126, 0, 96, 1, 127, 1, 126, 3, 11, 10, 0, 0, 2, 1, 3, 4, 5, 6, 1, 7, 5, 3, 1, 0, 1, 7, 85, 9, 3, 109, 101, 109, 2, 0, 5, 120, 120, 104, 51, 50, 0, 0, 6, 105, 110, 105, 116, 51, 50, 0, 2, 8, 117, 112, 100, 97, 116, 101, 51, 50, 0, 3, 8, 100, 105, 103, 101, 115, 116, 51, 50, 0, 4, 5, 120, 120, 104, 54, 52, 0, 5, 6, 105, 110, 105, 116, 54, 52, 0, 7, 8, 117, 112, 100, 97, 116, 101, 54, 52, 0, 8, 8, 100, 105, 103, 101, 115, 116, 54, 52, 0, 9, 10, 251, 22, 10, 242, 1, 1, 4, 127, 32, 0, 32, 1, 106, 33, 3, 32, 1, 65, 16, 79, 4, 127, 32, 3, 65, 16, 107, 33, 6, 32, 2, 65, 168, 136, 141, 161, 2, 106, 33, 3, 32, 2, 65, 137, 235, 208, 208, 7, 107, 33, 4, 32, 2, 65, 207, 140, 162, 142, 6, 106, 33, 5, 3, 64, 32, 3, 32, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 3, 32, 4, 32, 0, 65, 4, 106, 34, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 4, 32, 2, 32, 0, 65, 4, 106, 34, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 2, 32, 5, 32, 0, 65, 4, 106, 34, 0, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 5, 32, 6, 32, 0, 65, 4, 106, 34, 0, 79, 13, 0, 11, 32, 2, 65, 12, 119, 32, 5, 65, 18, 119, 106, 32, 4, 65, 7, 119, 106, 32, 3, 65, 1, 119, 106, 5, 32, 2, 65, 177, 207, 217, 178, 1, 106, 11, 32, 1, 106, 32, 0, 32, 1, 65, 15, 113, 16, 1, 11, 146, 1, 0, 32, 1, 32, 2, 106, 33, 2, 3, 64, 32, 1, 65, 4, 106, 32, 2, 75, 69, 4, 64, 32, 0, 32, 1, 40, 2, 0, 65, 189, 220, 202, 149, 124, 108, 106, 65, 17, 119, 65, 175, 214, 211, 190, 2, 108, 33, 0, 32, 1, 65, 4, 106, 33, 1, 12, 1, 11, 11, 3, 64, 32, 1, 32, 2, 79, 69, 4, 64, 32, 0, 32, 1, 45, 0, 0, 65, 177, 207, 217, 178, 1, 108, 106, 65, 11, 119, 65, 177, 243, 221, 241, 121, 108, 33, 0, 32, 1, 65, 1, 106, 33, 1, 12, 1, 11, 11, 32, 0, 32, 0, 65, 15, 118, 115, 65, 247, 148, 175, 175, 120, 108, 34, 0, 65, 13, 118, 32, 0, 115, 65, 189, 220, 202, 149, 124, 108, 34, 0, 65, 16, 118, 32, 0, 115, 11, 63, 0, 32, 0, 65, 8, 106, 32, 1, 65, 168, 136, 141, 161, 2, 106, 54, 2, 0, 32, 0, 65, 12, 106, 32, 1, 65, 137, 235, 208, 208, 7, 107, 54, 2, 0, 32, 0, 65, 16, 106, 32, 1, 54, 2, 0, 32, 0, 65, 20, 106, 32, 1, 65, 207, 140, 162, 142, 6, 106, 54, 2, 0, 11, 195, 4, 1, 6, 127, 32, 1, 32, 2, 106, 33, 6, 32, 0, 65, 24, 106, 33, 4, 32, 0, 65, 40, 106, 40, 2, 0, 33, 3, 32, 0, 32, 0, 40, 2, 0, 32, 2, 106, 54, 2, 0, 32, 0, 65, 4, 106, 34, 5, 32, 5, 40, 2, 0, 32, 2, 65, 16, 79, 32, 0, 40, 2, 0, 65, 16, 79, 114, 114, 54, 2, 0, 32, 2, 32, 3, 106, 65, 16, 73, 4, 64, 32, 3, 32, 4, 106, 32, 1, 32, 2, 252, 10, 0, 0, 32, 0, 65, 40, 106, 32, 2, 32, 3, 106, 54, 2, 0, 15, 11, 32, 3, 4, 64, 32, 3, 32, 4, 106, 32, 1, 65, 16, 32, 3, 107, 34, 2, 252, 10, 0, 0, 32, 0, 65, 8, 106, 34, 3, 32, 3, 40, 2, 0, 32, 4, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 54, 2, 0, 32, 0, 65, 12, 106, 34, 3, 32, 3, 40, 2, 0, 32, 4, 65, 4, 106, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 54, 2, 0, 32, 0, 65, 16, 106, 34, 3, 32, 3, 40, 2, 0, 32, 4, 65, 8, 106, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 54, 2, 0, 32, 0, 65, 20, 106, 34, 3, 32, 3, 40, 2, 0, 32, 4, 65, 12, 106, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 54, 2, 0, 32, 0, 65, 40, 106, 65, 0, 54, 2, 0, 32, 1, 32, 2, 106, 33, 1, 11, 32, 1, 32, 6, 65, 16, 107, 77, 4, 64, 32, 6, 65, 16, 107, 33, 8, 32, 0, 65, 8, 106, 40, 2, 0, 33, 2, 32, 0, 65, 12, 106, 40, 2, 0, 33, 3, 32, 0, 65, 16, 106, 40, 2, 0, 33, 5, 32, 0, 65, 20, 106, 40, 2, 0, 33, 7, 3, 64, 32, 2, 32, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 2, 32, 3, 32, 1, 65, 4, 106, 34, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 3, 32, 5, 32, 1, 65, 4, 106, 34, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 5, 32, 7, 32, 1, 65, 4, 106, 34, 1, 40, 2, 0, 65, 247, 148, 175, 175, 120, 108, 106, 65, 13, 119, 65, 177, 243, 221, 241, 121, 108, 33, 7, 32, 8, 32, 1, 65, 4, 106, 34, 1, 79, 13, 0, 11, 32, 0, 65, 8, 106, 32, 2, 54, 2, 0, 32, 0, 65, 12, 106, 32, 3, 54, 2, 0, 32, 0, 65, 16, 106, 32, 5, 54, 2, 0, 32, 0, 65, 20, 106, 32, 7, 54, 2, 0, 11, 32, 1, 32, 6, 73, 4, 64, 32, 4, 32, 1, 32, 6, 32, 1, 107, 34, 1, 252, 10, 0, 0, 32, 0, 65, 40, 106, 32, 1, 54, 2, 0, 11, 11, 97, 1, 1, 127, 32, 0, 65, 16, 106, 40, 2, 0, 33, 1, 32, 0, 65, 4, 106, 40, 2, 0, 4, 127, 32, 1, 65, 12, 119, 32, 0, 65, 20, 106, 40, 2, 0, 65, 18, 119, 106, 32, 0, 65, 12, 106, 40, 2, 0, 65, 7, 119, 106, 32, 0, 65, 8, 106, 40, 2, 0, 65, 1, 119, 106, 5, 32, 1, 65, 177, 207, 217, 178, 1, 106, 11, 32, 0, 40, 2, 0, 106, 32, 0, 65, 24, 106, 32, 0, 65, 40, 106, 40, 2, 0, 16, 1, 11, 255, 3, 2, 3, 126, 1, 127, 32, 0, 32, 1, 106, 33, 6, 32, 1, 65, 32, 79, 4, 126, 32, 6, 65, 32, 107, 33, 6, 32, 2, 66, 214, 235, 130, 238, 234, 253, 137, 245, 224, 0, 124, 33, 3, 32, 2, 66, 177, 169, 172, 193, 173, 184, 212, 166, 61, 125, 33, 4, 32, 2, 66, 249, 234, 208, 208, 231, 201, 161, 228, 225, 0, 124, 33, 5, 3, 64, 32, 3, 32, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 3, 32, 4, 32, 0, 65, 8, 106, 34, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 4, 32, 2, 32, 0, 65, 8, 106, 34, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 2, 32, 5, 32, 0, 65, 8, 106, 34, 0, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 5, 32, 6, 32, 0, 65, 8, 106, 34, 0, 79, 13, 0, 11, 32, 2, 66, 12, 137, 32, 5, 66, 18, 137, 124, 32, 4, 66, 7, 137, 124, 32, 3, 66, 1, 137, 124, 32, 3, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 32, 4, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 32, 2, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 32, 5, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 5, 32, 2, 66, 197, 207, 217, 178, 241, 229, 186, 234, 39, 124, 11, 32, 1, 173, 124, 32, 0, 32, 1, 65, 31, 113, 16, 6, 11, 134, 2, 0, 32, 1, 32, 2, 106, 33, 2, 3, 64, 32, 2, 32, 1, 65, 8, 106, 79, 4, 64, 32, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 32, 0, 133, 66, 27, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 33, 0, 32, 1, 65, 8, 106, 33, 1, 12, 1, 11, 11, 32, 1, 65, 4, 106, 32, 2, 77, 4, 64, 32, 0, 32, 1, 53, 2, 0, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 23, 137, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 249, 243, 221, 241, 153, 246, 153, 171, 22, 124, 33, 0, 32, 1, 65, 4, 106, 33, 1, 11, 3, 64, 32, 1, 32, 2, 73, 4, 64, 32, 0, 32, 1, 49, 0, 0, 66, 197, 207, 217, 178, 241, 229, 186, 234, 39, 126, 133, 66, 11, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 0, 32, 1, 65, 1, 106, 33, 1, 12, 1, 11, 11, 32, 0, 32, 0, 66, 33, 136, 133, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 34, 0, 32, 0, 66, 29, 136, 133, 66, 249, 243, 221, 241, 153, 246, 153, 171, 22, 126, 34, 0, 32, 0, 66, 32, 136, 133, 11, 77, 0, 32, 0, 65, 8, 106, 32, 1, 66, 214, 235, 130, 238, 234, 253, 137, 245, 224, 0, 124, 55, 3, 0, 32, 0, 65, 16, 106, 32, 1, 66, 177, 169, 172, 193, 173, 184, 212, 166, 61, 125, 55, 3, 0, 32, 0, 65, 24, 106, 32, 1, 55, 3, 0, 32, 0, 65, 32, 106, 32, 1, 66, 249, 234, 208, 208, 231, 201, 161, 228, 225, 0, 124, 55, 3, 0, 11, 244, 4, 2, 3, 127, 4, 126, 32, 1, 32, 2, 106, 33, 5, 32, 0, 65, 40, 106, 33, 4, 32, 0, 65, 200, 0, 106, 40, 2, 0, 33, 3, 32, 0, 32, 0, 41, 3, 0, 32, 2, 173, 124, 55, 3, 0, 32, 2, 32, 3, 106, 65, 32, 73, 4, 64, 32, 3, 32, 4, 106, 32, 1, 32, 2, 252, 10, 0, 0, 32, 0, 65, 200, 0, 106, 32, 2, 32, 3, 106, 54, 2, 0, 15, 11, 32, 3, 4, 64, 32, 3, 32, 4, 106, 32, 1, 65, 32, 32, 3, 107, 34, 2, 252, 10, 0, 0, 32, 0, 65, 8, 106, 34, 3, 32, 3, 41, 3, 0, 32, 4, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 55, 3, 0, 32, 0, 65, 16, 106, 34, 3, 32, 3, 41, 3, 0, 32, 4, 65, 8, 106, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 55, 3, 0, 32, 0, 65, 24, 106, 34, 3, 32, 3, 41, 3, 0, 32, 4, 65, 16, 106, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 55, 3, 0, 32, 0, 65, 32, 106, 34, 3, 32, 3, 41, 3, 0, 32, 4, 65, 24, 106, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 55, 3, 0, 32, 0, 65, 200, 0, 106, 65, 0, 54, 2, 0, 32, 1, 32, 2, 106, 33, 1, 11, 32, 1, 65, 32, 106, 32, 5, 77, 4, 64, 32, 5, 65, 32, 107, 33, 2, 32, 0, 65, 8, 106, 41, 3, 0, 33, 6, 32, 0, 65, 16, 106, 41, 3, 0, 33, 7, 32, 0, 65, 24, 106, 41, 3, 0, 33, 8, 32, 0, 65, 32, 106, 41, 3, 0, 33, 9, 3, 64, 32, 6, 32, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 6, 32, 7, 32, 1, 65, 8, 106, 34, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 7, 32, 8, 32, 1, 65, 8, 106, 34, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 8, 32, 9, 32, 1, 65, 8, 106, 34, 1, 41, 3, 0, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 124, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 33, 9, 32, 2, 32, 1, 65, 8, 106, 34, 1, 79, 13, 0, 11, 32, 0, 65, 8, 106, 32, 6, 55, 3, 0, 32, 0, 65, 16, 106, 32, 7, 55, 3, 0, 32, 0, 65, 24, 106, 32, 8, 55, 3, 0, 32, 0, 65, 32, 106, 32, 9, 55, 3, 0, 11, 32, 1, 32, 5, 73, 4, 64, 32, 4, 32, 1, 32, 5, 32, 1, 107, 34, 1, 252, 10, 0, 0, 32, 0, 65, 200, 0, 106, 32, 1, 54, 2, 0, 11, 11, 188, 2, 1, 5, 126, 32, 0, 65, 24, 106, 41, 3, 0, 33, 1, 32, 0, 41, 3, 0, 34, 2, 66, 32, 90, 4, 126, 32, 0, 65, 8, 106, 41, 3, 0, 34, 3, 66, 1, 137, 32, 0, 65, 16, 106, 41, 3, 0, 34, 4, 66, 7, 137, 124, 32, 1, 66, 12, 137, 32, 0, 65, 32, 106, 41, 3, 0, 34, 5, 66, 18, 137, 124, 124, 32, 3, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 32, 4, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 32, 1, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 32, 5, 66, 207, 214, 211, 190, 210, 199, 171, 217, 66, 126, 66, 31, 137, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 133, 66, 135, 149, 175, 175, 152, 182, 222, 155, 158, 127, 126, 66, 157, 163, 181, 234, 131, 177, 141, 138, 250, 0, 125, 5, 32, 1, 66, 197, 207, 217, 178, 241, 229, 186, 234, 39, 124, 11, 32, 2, 124, 32, 0, 65, 40, 106, 32, 2, 66, 31, 131, 167, 16, 6, 11]);
@@ -1041,7 +1041,7 @@ function imageSize(input) {
1041
1041
  throw new TypeError(`unsupported file type: ${type}`);
1042
1042
  }
1043
1043
 
1044
- // ../memory/dist/chunk-5SMKVGJP.js
1044
+ // ../memory/dist/chunk-JJBSFPC5.js
1045
1045
  function formatRelativeTime(date, currentDate) {
1046
1046
  const diffMs = currentDate.getTime() - date.getTime();
1047
1047
  const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
@@ -1338,6 +1338,220 @@ function createThreadUpdateMarker(params) {
1338
1338
  }
1339
1339
  };
1340
1340
  }
1341
+ var OBSERVATION_GROUP_PATTERN = /<observation-group\s([^>]*)>([\s\S]*?)<\/observation-group>/g;
1342
+ var ATTRIBUTE_PATTERN = /([\w][\w-]*)="([^"]*)"/g;
1343
+ var REFLECTION_GROUP_SPLIT_PATTERN = /^##\s+Group\s+/m;
1344
+ function parseObservationGroupAttributes(attributeString) {
1345
+ const attributes = {};
1346
+ for (const match of attributeString.matchAll(ATTRIBUTE_PATTERN)) {
1347
+ const [, key, value] = match;
1348
+ if (key && value !== void 0) {
1349
+ attributes[key] = value;
1350
+ }
1351
+ }
1352
+ return attributes;
1353
+ }
1354
+ function parseReflectionObservationGroupSections(content) {
1355
+ const normalizedContent = content.trim();
1356
+ if (!normalizedContent || !REFLECTION_GROUP_SPLIT_PATTERN.test(normalizedContent)) {
1357
+ return [];
1358
+ }
1359
+ return normalizedContent.split(REFLECTION_GROUP_SPLIT_PATTERN).map((section) => section.trim()).filter(Boolean).map((section) => {
1360
+ const newlineIndex = section.indexOf("\n");
1361
+ const heading = (newlineIndex >= 0 ? section.slice(0, newlineIndex) : section).trim();
1362
+ const body = (newlineIndex >= 0 ? section.slice(newlineIndex + 1) : "").trim();
1363
+ return {
1364
+ heading,
1365
+ body: stripReflectionGroupMetadata(body)
1366
+ };
1367
+ });
1368
+ }
1369
+ function stripReflectionGroupMetadata(body) {
1370
+ return body.replace(/^_range:\s*`[^`]*`_\s*\n?/m, "").trim();
1371
+ }
1372
+ function generateAnchorId() {
1373
+ return crypto$1.randomBytes(8).toString("hex");
1374
+ }
1375
+ function wrapInObservationGroup(observations, range, id = generateAnchorId(), sourceGroupIds) {
1376
+ const content = observations.trim();
1377
+ const sourceGroupIdsAttr = sourceGroupIds?.length ? ` source-group-ids="${sourceGroupIds.join(",")}"` : "";
1378
+ return `<observation-group id="${id}" range="${range}"${sourceGroupIdsAttr}>
1379
+ ${content}
1380
+ </observation-group>`;
1381
+ }
1382
+ function parseObservationGroups(observations) {
1383
+ if (!observations) {
1384
+ return [];
1385
+ }
1386
+ const groups = [];
1387
+ let match;
1388
+ while ((match = OBSERVATION_GROUP_PATTERN.exec(observations)) !== null) {
1389
+ const attributes = parseObservationGroupAttributes(match[1] ?? "");
1390
+ const id = attributes.id;
1391
+ const range = attributes.range;
1392
+ if (!id || !range) {
1393
+ continue;
1394
+ }
1395
+ groups.push({
1396
+ id,
1397
+ range,
1398
+ content: match[2].trim(),
1399
+ sourceGroupIds: attributes["source-group-ids"]?.split(",").map((part) => part.trim()).filter(Boolean)
1400
+ });
1401
+ }
1402
+ return groups;
1403
+ }
1404
+ function stripObservationGroups(observations) {
1405
+ if (!observations) {
1406
+ return observations;
1407
+ }
1408
+ return observations.replace(OBSERVATION_GROUP_PATTERN, (_match, _attributes, content) => content.trim()).replace(/\n{3,}/g, "\n\n").trim();
1409
+ }
1410
+ function combineObservationGroupRanges(groups) {
1411
+ return Array.from(
1412
+ new Set(
1413
+ groups.flatMap((group) => group.range.split(",")).map((range) => range.trim()).filter(Boolean)
1414
+ )
1415
+ ).join(",");
1416
+ }
1417
+ function renderObservationGroupsForReflection(observations) {
1418
+ const groups = parseObservationGroups(observations);
1419
+ if (groups.length === 0) {
1420
+ return null;
1421
+ }
1422
+ const groupsByContent = new Map(groups.map((g) => [g.content.trim(), g]));
1423
+ const result = observations.replace(OBSERVATION_GROUP_PATTERN, (_match, _attrs, content) => {
1424
+ const group = groupsByContent.get(content.trim());
1425
+ if (!group) return content.trim();
1426
+ return `## Group \`${group.id}\`
1427
+ _range: \`${group.range}\`_
1428
+
1429
+ ${group.content}`;
1430
+ });
1431
+ return result.replace(/\n{3,}/g, "\n\n").trim();
1432
+ }
1433
+ function getCanonicalGroupId(sectionHeading, fallbackIndex) {
1434
+ const match = sectionHeading.match(/`([^`]+)`/);
1435
+ return match?.[1]?.trim() || `derived-group-${fallbackIndex + 1}`;
1436
+ }
1437
+ function deriveObservationGroupProvenance(content, groups) {
1438
+ const sections = parseReflectionObservationGroupSections(content);
1439
+ if (sections.length === 0 || groups.length === 0) {
1440
+ return [];
1441
+ }
1442
+ return sections.map((section, index) => {
1443
+ const bodyLines = new Set(
1444
+ section.body.split("\n").map((line) => line.trim()).filter(Boolean)
1445
+ );
1446
+ const matchingGroups = groups.filter((group) => {
1447
+ const groupLines = group.content.split("\n").map((line) => line.trim()).filter(Boolean);
1448
+ return groupLines.some((line) => bodyLines.has(line));
1449
+ });
1450
+ const fallbackGroup = groups[Math.min(index, groups.length - 1)];
1451
+ const resolvedGroups = matchingGroups.length > 0 ? matchingGroups : fallbackGroup ? [fallbackGroup] : [];
1452
+ const sourceGroupIds = Array.from(
1453
+ new Set(resolvedGroups.flatMap((group) => [group.id, ...group.sourceGroupIds ?? []]))
1454
+ );
1455
+ const canonicalGroupId = getCanonicalGroupId(section.heading, index);
1456
+ return {
1457
+ id: canonicalGroupId,
1458
+ range: combineObservationGroupRanges(resolvedGroups),
1459
+ content: section.body,
1460
+ sourceGroupIds
1461
+ };
1462
+ });
1463
+ }
1464
+ function reconcileObservationGroupsFromReflection(content, sourceObservations) {
1465
+ const sourceGroups = parseObservationGroups(sourceObservations);
1466
+ if (sourceGroups.length === 0) {
1467
+ return null;
1468
+ }
1469
+ const normalizedContent = content.trim();
1470
+ if (!normalizedContent) {
1471
+ return "";
1472
+ }
1473
+ const derivedGroups = deriveObservationGroupProvenance(normalizedContent, sourceGroups);
1474
+ if (derivedGroups.length > 0) {
1475
+ return derivedGroups.map((group) => wrapInObservationGroup(group.content, group.range, group.id, group.sourceGroupIds)).join("\n\n");
1476
+ }
1477
+ return wrapInObservationGroup(
1478
+ normalizedContent,
1479
+ combineObservationGroupRanges(sourceGroups),
1480
+ generateAnchorId(),
1481
+ Array.from(new Set(sourceGroups.flatMap((group) => [group.id, ...group.sourceGroupIds ?? []])))
1482
+ );
1483
+ }
1484
+ var ANCHOR_ID_PATTERN = /^\[(O\d+(?:-N\d+)?)\]\s*/;
1485
+ var OBSERVATION_DATE_HEADER_PATTERN = /^\s*Date:\s+/;
1486
+ var XML_TAG_PATTERN = /^\s*<\/?[a-z][^>]*>\s*$/i;
1487
+ var MARKDOWN_GROUP_HEADING_PATTERN = /^\s*##\s+Group\s+`[^`]+`\s*$/;
1488
+ var MARKDOWN_GROUP_METADATA_PATTERN = /^\s*_range:\s*`[^`]*`_\s*$/;
1489
+ function buildEphemeralAnchorId(topLevelCounter, nestedCounter) {
1490
+ return nestedCounter === 0 ? `O${topLevelCounter}` : `O${topLevelCounter}-N${nestedCounter}`;
1491
+ }
1492
+ function parseAnchorId(line) {
1493
+ const match = line.match(ANCHOR_ID_PATTERN);
1494
+ return match?.[1] ?? null;
1495
+ }
1496
+ function shouldAnchorLine(line) {
1497
+ const trimmed = line.trim();
1498
+ if (!trimmed) {
1499
+ return false;
1500
+ }
1501
+ if (parseAnchorId(trimmed)) {
1502
+ return false;
1503
+ }
1504
+ if (OBSERVATION_DATE_HEADER_PATTERN.test(trimmed)) {
1505
+ return false;
1506
+ }
1507
+ if (XML_TAG_PATTERN.test(trimmed)) {
1508
+ return false;
1509
+ }
1510
+ if (MARKDOWN_GROUP_HEADING_PATTERN.test(trimmed) || MARKDOWN_GROUP_METADATA_PATTERN.test(trimmed)) {
1511
+ return false;
1512
+ }
1513
+ return true;
1514
+ }
1515
+ function getIndentationDepth(line) {
1516
+ const leadingWhitespace = line.match(/^\s*/)?.[0] ?? "";
1517
+ return Math.floor(leadingWhitespace.replace(/\t/g, " ").length / 2);
1518
+ }
1519
+ function injectAnchorIds(observations) {
1520
+ if (!observations) {
1521
+ return observations;
1522
+ }
1523
+ const lines = observations.split("\n");
1524
+ let topLevelCounter = 0;
1525
+ let nestedCounter = 0;
1526
+ let changed = false;
1527
+ for (let i = 0; i < lines.length; i++) {
1528
+ const line = lines[i];
1529
+ if (!shouldAnchorLine(line)) {
1530
+ continue;
1531
+ }
1532
+ const indentationDepth = getIndentationDepth(line);
1533
+ if (indentationDepth === 0) {
1534
+ topLevelCounter += 1;
1535
+ nestedCounter = 0;
1536
+ } else {
1537
+ if (topLevelCounter === 0) {
1538
+ topLevelCounter = 1;
1539
+ }
1540
+ nestedCounter += 1;
1541
+ }
1542
+ const anchorId = buildEphemeralAnchorId(topLevelCounter, nestedCounter);
1543
+ const leadingWhitespace = line.match(/^\s*/)?.[0] ?? "";
1544
+ lines[i] = `${leadingWhitespace}[${anchorId}] ${line.slice(leadingWhitespace.length)}`;
1545
+ changed = true;
1546
+ }
1547
+ return changed ? lines.join("\n") : observations;
1548
+ }
1549
+ function stripEphemeralAnchorIds(observations) {
1550
+ if (!observations) {
1551
+ return observations;
1552
+ }
1553
+ return observations.replace(/(^|\n)([^\S\n]*)\[(O\d+(?:-N\d+)?)\][^\S\n]*/g, "$1$2");
1554
+ }
1341
1555
  var ENCRYPTED_CONTENT_KEY = "encryptedContent";
1342
1556
  var ENCRYPTED_CONTENT_REDACTION_THRESHOLD = 256;
1343
1557
  var DEFAULT_OBSERVER_TOOL_RESULT_MAX_TOKENS = 1e4;
@@ -1404,9 +1618,8 @@ function truncateStringByTokens(text, maxTokens) {
1404
1618
  }
1405
1619
  const buildCandidate = (sliceEnd) => {
1406
1620
  const visible = text.slice(0, sliceEnd);
1407
- const omittedChars = text.length - sliceEnd;
1408
1621
  return `${visible}
1409
- ... [truncated ~${totalTokens - estimateTokenCount(visible)} tokens / ${omittedChars} characters]`;
1622
+ ... [truncated ~${totalTokens - estimateTokenCount(visible)} tokens]`;
1410
1623
  };
1411
1624
  let low = 0;
1412
1625
  let high = text.length;
@@ -2403,7 +2616,7 @@ function extractCurrentTask(observations) {
2403
2616
  return content || null;
2404
2617
  }
2405
2618
  function optimizeObservationsForContext(observations) {
2406
- let optimized = observations;
2619
+ let optimized = stripEphemeralAnchorIds(observations);
2407
2620
  optimized = optimized.replace(/🟡\s*/g, "");
2408
2621
  optimized = optimized.replace(/🟢\s*/g, "");
2409
2622
  optimized = optimized.replace(/\[(?![\d\s]*items collapsed)[^\]]+\]/g, "");
@@ -2589,9 +2802,11 @@ Your current detail level was a 10/10, lets aim for a 4/10 detail level.
2589
2802
  };
2590
2803
  function buildReflectorPrompt(observations, manualPrompt, compressionLevel, skipContinuationHints) {
2591
2804
  const level = typeof compressionLevel === "number" ? compressionLevel : compressionLevel ? 1 : 0;
2805
+ const reflectionView = renderObservationGroupsForReflection(observations) ?? observations;
2806
+ const anchoredObservations = injectAnchorIds(reflectionView);
2592
2807
  let prompt = `## OBSERVATIONS TO REFLECT ON
2593
2808
 
2594
- ${observations}
2809
+ ${anchoredObservations}
2595
2810
 
2596
2811
  ---
2597
2812
 
@@ -2616,7 +2831,7 @@ IMPORTANT: Do NOT include <current-task> or <suggested-response> sections in you
2616
2831
  }
2617
2832
  return prompt;
2618
2833
  }
2619
- function parseReflectorOutput(output) {
2834
+ function parseReflectorOutput(output, sourceObservations) {
2620
2835
  if (detectDegenerateRepetition(output)) {
2621
2836
  return {
2622
2837
  observations: "",
@@ -2624,9 +2839,10 @@ function parseReflectorOutput(output) {
2624
2839
  };
2625
2840
  }
2626
2841
  const parsed = parseReflectorSectionXml(output);
2627
- const observations = sanitizeObservationLines(parsed.observations || "");
2842
+ const sanitizedObservations = sanitizeObservationLines(stripEphemeralAnchorIds(parsed.observations || ""));
2843
+ const reconciledObservations = sourceObservations ? reconcileObservationGroupsFromReflection(sanitizedObservations, sourceObservations) : null;
2628
2844
  return {
2629
- observations,
2845
+ observations: reconciledObservations ?? sanitizedObservations,
2630
2846
  suggestedContinuation: parsed.suggestedResponse || void 0
2631
2847
  // Note: Reflector's currentTask is not used - thread metadata preserves per-thread tasks
2632
2848
  };
@@ -4118,7 +4334,24 @@ if (OM_DEBUG_LOG) {
4118
4334
  _origConsoleError.apply(console, args);
4119
4335
  };
4120
4336
  }
4337
+ function messageHasVisibleContent(msg) {
4338
+ const content = msg.content;
4339
+ if (content?.parts && Array.isArray(content.parts)) {
4340
+ return content.parts.some((p) => {
4341
+ const t2 = p?.type;
4342
+ return t2 && !t2.startsWith("data-") && t2 !== "step-start";
4343
+ });
4344
+ }
4345
+ if (content?.content) return true;
4346
+ return false;
4347
+ }
4348
+ function buildMessageRange(messages) {
4349
+ const first = messages.find(messageHasVisibleContent) ?? messages[0];
4350
+ const last = [...messages].reverse().find(messageHasVisibleContent) ?? messages[messages.length - 1];
4351
+ return `${first.id}:${last.id}`;
4352
+ }
4121
4353
  var OBSERVATIONAL_MEMORY_DEFAULTS = {
4354
+ retrieval: false,
4122
4355
  observation: {
4123
4356
  model: "google/gemini-2.5-flash",
4124
4357
  messageTokens: 3e4,
@@ -4173,12 +4406,54 @@ KNOWLEDGE UPDATES: When asked about current state (e.g., "where do I currently..
4173
4406
  PLANNED ACTIONS: If the user stated they planned to do something (e.g., "I'm going to...", "I'm looking forward to...", "I will...") and the date they planned to do it is now in the past (check the relative time like "3 weeks ago"), assume they completed the action unless there's evidence they didn't. For example, if someone said "I'll start my new diet on Monday" and that was 2 weeks ago, assume they started the diet.
4174
4407
 
4175
4408
  MOST RECENT USER INPUT: Treat the most recent user message as the highest-priority signal for what to do next. Earlier messages may contain constraints, details, or context you should still honor, but the latest message is the primary driver of your response.`;
4409
+ var OBSERVATION_RETRIEVAL_INSTRUCTIONS = `## Recall \u2014 looking up source messages
4410
+
4411
+ Your memory is comprised of observations which are sometimes wrapped in <observation-group> xml tags containing ranges like <observation-group range="startId:endId">. These ranges point back to the raw messages that each observation group was derived from. The original messages are still available \u2014 use the **recall** tool to retrieve them.
4412
+
4413
+ ### When to use recall
4414
+ - The user asks you to **repeat, show, or reproduce** something from a past conversation
4415
+ - The user asks for **exact content** \u2014 code, text, quotes, error messages, URLs, file paths, specific numbers
4416
+ - Your observations mention something but your memory lacks the detail needed to fully answer (e.g. you know a blog post was shared but only have a summary of it)
4417
+ - You want to **verify or expand on** an observation before responding
4418
+
4419
+ **Default to using recall when the user references specific past content.** Your observations capture the gist, not the details. If there's any doubt whether your memory is complete enough, use recall.
4420
+
4421
+ ### How to use recall
4422
+ Each range has the format \`startId:endId\` where both are message IDs separated by a colon.
4423
+
4424
+ 1. Find the observation group relevant to the user's question and extract the start or end ID from its range.
4425
+ 2. Call \`recall\` with that ID as the \`cursor\`.
4426
+ 3. Use \`page: 1\` (or omit) to read forward from the cursor, \`page: -1\` to read backward.
4427
+ 4. If the first page doesn't have what you need, increment the page number to keep paginating.
4428
+ 5. Check \`hasNextPage\`/\`hasPrevPage\` in the result to know if more pages exist in each direction.
4429
+
4430
+ ### Detail levels
4431
+ By default recall returns **low** detail: truncated text and tool names only. Each message shows its ID and each part has a positional index like \`[p0]\`, \`[p1]\`, etc.
4432
+
4433
+ - Use \`detail: "high"\` to get full message content including tool arguments and results. This will only return the high detail version of a single message part at a time.
4434
+ - Use \`partIndex\` with a cursor to fetch a single part at full detail \u2014 for example, to read one specific tool result or code block without loading every part.
4435
+
4436
+ If the result says \`truncated: true\`, the output was cut to fit the token budget. You can paginate or use \`partIndex\` to target specific content.
4437
+
4438
+ ### Following up on truncated parts
4439
+ Low-detail results may include truncation hints like:
4440
+ \`[truncated \u2014 call recall cursor="..." partIndex=N detail="high" for full content]\`
4441
+
4442
+ **When you see these hints and need the full content, make the exact call described in the hint.** This is the normal workflow: first recall at low detail to scan, then drill into specific parts at high detail. Do not stop at the low-detail result if the user asked for exact content.
4443
+
4444
+ ### When recall is NOT needed
4445
+ - The user is asking for a high-level summary and your observations already cover it
4446
+ - The question is about general preferences or facts that don't require source text
4447
+ - There is no relevant range in your observations for the topic
4448
+
4449
+ Observation groups with range IDs and your recall tool allows you to think back and remember details you're fuzzy on.`;
4176
4450
  var ObservationalMemory = class _ObservationalMemory {
4177
4451
  id = "observational-memory";
4178
4452
  name = "Observational Memory";
4179
4453
  storage;
4180
4454
  tokenCounter;
4181
4455
  scope;
4456
+ retrieval = false;
4182
4457
  observationConfig;
4183
4458
  reflectionConfig;
4184
4459
  onDebugEvent;
@@ -4491,6 +4766,7 @@ var ObservationalMemory = class _ObservationalMemory {
4491
4766
  this.shouldObscureThreadIds = config.obscureThreadIds || false;
4492
4767
  this.storage = config.storage;
4493
4768
  this.scope = config.scope ?? "thread";
4769
+ this.retrieval = this.scope === "thread" && (config.retrieval ?? OBSERVATIONAL_MEMORY_DEFAULTS.retrieval);
4494
4770
  const resolveModel = (m) => m === "default" ? OBSERVATIONAL_MEMORY_DEFAULTS.observation.model : m;
4495
4771
  const observationModel = resolveModel(config.model) ?? resolveModel(config.observation?.model) ?? resolveModel(config.reflection?.model);
4496
4772
  const reflectionModel = resolveModel(config.model) ?? resolveModel(config.reflection?.model) ?? resolveModel(config.observation?.model);
@@ -4594,6 +4870,7 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
4594
4870
  get config() {
4595
4871
  return {
4596
4872
  scope: this.scope,
4873
+ retrieval: this.retrieval,
4597
4874
  observation: {
4598
4875
  messageTokens: this.observationConfig.messageTokens,
4599
4876
  previousObserverTokens: this.observationConfig.previousObserverTokens
@@ -4850,7 +5127,8 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
4850
5127
  config: {
4851
5128
  observation: this.observationConfig,
4852
5129
  reflection: this.reflectionConfig,
4853
- scope: this.scope
5130
+ scope: this.scope,
5131
+ retrieval: this.retrieval
4854
5132
  },
4855
5133
  observedTimezone
4856
5134
  });
@@ -5491,7 +5769,7 @@ ${unreflectedContent}` : bufferedReflection;
5491
5769
  totalUsage.outputTokens += usage.outputTokens ?? 0;
5492
5770
  totalUsage.totalTokens += usage.totalTokens ?? 0;
5493
5771
  }
5494
- parsed = parseReflectorOutput(result.text);
5772
+ parsed = parseReflectorOutput(result.text, observations);
5495
5773
  if (parsed.degenerate) {
5496
5774
  omDebug(
5497
5775
  `[OM:callReflector] attempt #${attemptNumber}: degenerate repetition detected, treating as compression failure`
@@ -5558,14 +5836,18 @@ ${unreflectedContent}` : bufferedReflection;
5558
5836
  * @param suggestedResponse - Thread-specific suggested response (from thread metadata)
5559
5837
  * @param unobservedContextBlocks - Formatted <unobserved-context> blocks from other threads
5560
5838
  */
5561
- formatObservationsForContext(observations, currentTask, suggestedResponse, unobservedContextBlocks, currentDate) {
5562
- let optimized = optimizeObservationsForContext(observations);
5839
+ formatObservationsForContext(observations, currentTask, suggestedResponse, unobservedContextBlocks, currentDate, retrieval = false) {
5840
+ let optimized = retrieval ? renderObservationGroupsForReflection(observations) ?? observations : optimizeObservationsForContext(observations);
5563
5841
  if (currentDate) {
5564
5842
  optimized = addRelativeTimeToObservations(optimized, currentDate);
5565
5843
  }
5566
- const messages = [`${OBSERVATION_CONTEXT_PROMPT}
5844
+ const messages = [
5845
+ `${OBSERVATION_CONTEXT_PROMPT}
5567
5846
 
5568
- ${OBSERVATION_CONTEXT_INSTRUCTIONS}`];
5847
+ ${OBSERVATION_CONTEXT_INSTRUCTIONS}${retrieval ? `
5848
+
5849
+ ${OBSERVATION_RETRIEVAL_INSTRUCTIONS}` : ""}`
5850
+ ];
5569
5851
  if (unobservedContextBlocks) {
5570
5852
  messages.push(
5571
5853
  `The following content is from OTHER conversations different from the current conversation, they're here for reference, but they're not necessarily your focus:
@@ -6050,7 +6332,8 @@ ${suggestedResponse}
6050
6332
  currentTask,
6051
6333
  suggestedResponse,
6052
6334
  unobservedContextBlocks,
6053
- currentDate
6335
+ currentDate,
6336
+ this.retrieval
6054
6337
  );
6055
6338
  messageList.clearSystemMessages("observational-memory");
6056
6339
  messageList.addSystem(observationSystemMessages, "observational-memory");
@@ -6718,11 +7001,12 @@ ${formattedMessages}
6718
7001
  * Wrap observations in a thread attribution tag.
6719
7002
  * Used in resource scope to track which thread observations came from.
6720
7003
  */
6721
- async wrapWithThreadTag(threadId, observations) {
7004
+ async wrapWithThreadTag(threadId, observations, messageRange) {
6722
7005
  const cleanObservations = this.stripThreadTags(observations);
7006
+ const groupedObservations = this.retrieval && messageRange ? wrapInObservationGroup(cleanObservations, messageRange) : cleanObservations;
6723
7007
  const obscuredId = await this.representThreadIDInContext(threadId);
6724
7008
  return `<thread id="${obscuredId}">
6725
- ${cleanObservations}
7009
+ ${groupedObservations}
6726
7010
  </thread>`;
6727
7011
  }
6728
7012
  /**
@@ -6859,9 +7143,10 @@ ${threadClose}`;
6859
7143
  });
6860
7144
  const lastObservedAt = this.getMaxMessageTimestamp(messagesToObserve);
6861
7145
  const existingObservations = freshRecord?.activeObservations ?? record.activeObservations ?? "";
7146
+ const messageRange = this.retrieval ? buildMessageRange(messagesToObserve) : void 0;
6862
7147
  let newObservations;
6863
7148
  if (this.scope === "resource") {
6864
- const threadSection = await this.wrapWithThreadTag(threadId, result.observations);
7149
+ const threadSection = await this.wrapWithThreadTag(threadId, result.observations, messageRange);
6865
7150
  newObservations = this.replaceOrAppendThreadSection(
6866
7151
  existingObservations,
6867
7152
  threadId,
@@ -6869,7 +7154,8 @@ ${threadClose}`;
6869
7154
  lastObservedAt
6870
7155
  );
6871
7156
  } else {
6872
- newObservations = existingObservations ? `${existingObservations}${_ObservationalMemory.createMessageBoundary(lastObservedAt)}${result.observations}` : result.observations;
7157
+ const groupedObservations = this.retrieval && messageRange ? wrapInObservationGroup(result.observations, messageRange) : result.observations;
7158
+ newObservations = existingObservations ? `${existingObservations}${_ObservationalMemory.createMessageBoundary(lastObservedAt)}${groupedObservations}` : groupedObservations;
6873
7159
  }
6874
7160
  let totalTokenCount = this.tokenCounter.countObservations(newObservations);
6875
7161
  const cycleObservationTokens = this.tokenCounter.countObservations(result.observations);
@@ -7177,11 +7463,12 @@ ${threadClose}`;
7177
7463
  }
7178
7464
  }
7179
7465
  }
7466
+ const messageRange = this.retrieval ? buildMessageRange(messagesToBuffer) : void 0;
7180
7467
  let newObservations;
7181
7468
  if (this.scope === "resource") {
7182
- newObservations = await this.wrapWithThreadTag(threadId, result.observations);
7469
+ newObservations = await this.wrapWithThreadTag(threadId, result.observations, messageRange);
7183
7470
  } else {
7184
- newObservations = result.observations;
7471
+ newObservations = this.retrieval && messageRange ? wrapInObservationGroup(result.observations, messageRange) : result.observations;
7185
7472
  }
7186
7473
  const newTokenCount = this.tokenCounter.countObservations(newObservations);
7187
7474
  const newMessageIds = messagesToBuffer.map((m) => m.id);
@@ -7807,7 +8094,8 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
7807
8094
  const { threadId, threadMessages, result } = obsResult;
7808
8095
  cycleObservationTokens += this.tokenCounter.countObservations(result.observations);
7809
8096
  const threadLastObservedAt = this.getMaxMessageTimestamp(threadMessages);
7810
- const threadSection = await this.wrapWithThreadTag(threadId, result.observations);
8097
+ const messageRange = this.retrieval ? buildMessageRange(threadMessages) : void 0;
8098
+ const threadSection = await this.wrapWithThreadTag(threadId, result.observations, messageRange);
7811
8099
  currentObservations = this.replaceOrAppendThreadSection(
7812
8100
  currentObservations,
7813
8101
  threadId,
@@ -8296,12 +8584,26 @@ exports.ObservationalMemory = ObservationalMemory;
8296
8584
  exports.TokenCounter = TokenCounter;
8297
8585
  exports.buildObserverPrompt = buildObserverPrompt;
8298
8586
  exports.buildObserverSystemPrompt = buildObserverSystemPrompt;
8587
+ exports.combineObservationGroupRanges = combineObservationGroupRanges;
8588
+ exports.deriveObservationGroupProvenance = deriveObservationGroupProvenance;
8299
8589
  exports.e = e;
8590
+ exports.estimateTokenCount = estimateTokenCount;
8300
8591
  exports.extractCurrentTask = extractCurrentTask;
8301
8592
  exports.formatMessagesForObserver = formatMessagesForObserver;
8593
+ exports.formatToolResultForObserver = formatToolResultForObserver;
8302
8594
  exports.getObservationsAsOf = getObservationsAsOf;
8303
8595
  exports.hasCurrentTaskSection = hasCurrentTaskSection;
8596
+ exports.injectAnchorIds = injectAnchorIds;
8304
8597
  exports.optimizeObservationsForContext = optimizeObservationsForContext;
8598
+ exports.parseAnchorId = parseAnchorId;
8599
+ exports.parseObservationGroups = parseObservationGroups;
8305
8600
  exports.parseObserverOutput = parseObserverOutput;
8306
- //# sourceMappingURL=chunk-KH7BZQVQ.cjs.map
8307
- //# sourceMappingURL=chunk-KH7BZQVQ.cjs.map
8601
+ exports.reconcileObservationGroupsFromReflection = reconcileObservationGroupsFromReflection;
8602
+ exports.renderObservationGroupsForReflection = renderObservationGroupsForReflection;
8603
+ exports.resolveToolResultValue = resolveToolResultValue;
8604
+ exports.stripEphemeralAnchorIds = stripEphemeralAnchorIds;
8605
+ exports.stripObservationGroups = stripObservationGroups;
8606
+ exports.truncateStringByTokens = truncateStringByTokens;
8607
+ exports.wrapInObservationGroup = wrapInObservationGroup;
8608
+ //# sourceMappingURL=chunk-MJTEQGJT.cjs.map
8609
+ //# sourceMappingURL=chunk-MJTEQGJT.cjs.map