@theokit/sdk 4.60.0 → 4.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/{agent-26RMDG4U.cjs → agent-M53C3PAA.cjs} +8 -8
  3. package/dist/{agent-26RMDG4U.cjs.map → agent-M53C3PAA.cjs.map} +1 -1
  4. package/dist/{agent-6ABK2DPG.js → agent-P42GA6RM.js} +7 -7
  5. package/dist/{agent-6ABK2DPG.js.map → agent-P42GA6RM.js.map} +1 -1
  6. package/dist/{chunk-KKK3FZ4A.cjs → chunk-2DG7KW4L.cjs} +3 -3
  7. package/dist/{chunk-KKK3FZ4A.cjs.map → chunk-2DG7KW4L.cjs.map} +1 -1
  8. package/dist/chunk-2UCFUSPW.cjs +468 -0
  9. package/dist/chunk-2UCFUSPW.cjs.map +1 -0
  10. package/dist/{chunk-E5MWNLRX.js → chunk-532CSLYU.js} +3 -3
  11. package/dist/{chunk-E5MWNLRX.js.map → chunk-532CSLYU.js.map} +1 -1
  12. package/dist/{chunk-3HDTP4ZO.cjs → chunk-5IT6DUOO.cjs} +4 -4
  13. package/dist/{chunk-3HDTP4ZO.cjs.map → chunk-5IT6DUOO.cjs.map} +1 -1
  14. package/dist/{chunk-Y2KJ7MYO.cjs → chunk-6OBIWHDR.cjs} +14 -14
  15. package/dist/{chunk-Y2KJ7MYO.cjs.map → chunk-6OBIWHDR.cjs.map} +1 -1
  16. package/dist/{chunk-76XTUTKY.js → chunk-GQZKDGZM.js} +167 -13
  17. package/dist/chunk-GQZKDGZM.js.map +1 -0
  18. package/dist/{chunk-43GFJ5SD.cjs → chunk-P5LCASTC.cjs} +19 -4
  19. package/dist/chunk-P5LCASTC.cjs.map +1 -0
  20. package/dist/{chunk-7OXXYBHD.js → chunk-QEKI3YKI.js} +3 -3
  21. package/dist/{chunk-7OXXYBHD.js.map → chunk-QEKI3YKI.js.map} +1 -1
  22. package/dist/{chunk-23GPJGRR.cjs → chunk-R7YIVL3K.cjs} +217 -63
  23. package/dist/chunk-R7YIVL3K.cjs.map +1 -0
  24. package/dist/chunk-WCLDJSMY.js +456 -0
  25. package/dist/chunk-WCLDJSMY.js.map +1 -0
  26. package/dist/{chunk-WG7R5W6R.js → chunk-YEXA3PGR.js} +3 -3
  27. package/dist/{chunk-WG7R5W6R.js.map → chunk-YEXA3PGR.js.map} +1 -1
  28. package/dist/{chunk-IACR5LEM.js → chunk-YXGAW7BB.js} +17 -2
  29. package/dist/chunk-YXGAW7BB.js.map +1 -0
  30. package/dist/{compact-session-YHFQIXV5.cjs → compact-session-GJXJD73F.cjs} +11 -11
  31. package/dist/{compact-session-YHFQIXV5.cjs.map → compact-session-GJXJD73F.cjs.map} +1 -1
  32. package/dist/{compact-session-QGDNP45U.js → compact-session-TSMQOIHO.js} +3 -3
  33. package/dist/{compact-session-QGDNP45U.js.map → compact-session-TSMQOIHO.js.map} +1 -1
  34. package/dist/cron.cjs +7 -7
  35. package/dist/cron.js +6 -6
  36. package/dist/eval.cjs +6 -6
  37. package/dist/eval.js +5 -5
  38. package/dist/{index-manager-KP2JAXKN.js → index-manager-AHAYJ33H.js} +4 -4
  39. package/dist/{index-manager-KP2JAXKN.js.map → index-manager-AHAYJ33H.js.map} +1 -1
  40. package/dist/{index-manager-YUORPS4G.cjs → index-manager-RHPFVFSC.cjs} +5 -5
  41. package/dist/{index-manager-YUORPS4G.cjs.map → index-manager-RHPFVFSC.cjs.map} +1 -1
  42. package/dist/index.cjs +69 -36
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.js +42 -9
  45. package/dist/index.js.map +1 -1
  46. package/dist/{inject-session-MLCJMYDG.cjs → inject-session-PPSO2IDD.cjs} +4 -4
  47. package/dist/{inject-session-MLCJMYDG.cjs.map → inject-session-PPSO2IDD.cjs.map} +1 -1
  48. package/dist/{inject-session-RBQZ45UM.js → inject-session-ZCQUB3IT.js} +3 -3
  49. package/dist/{inject-session-RBQZ45UM.js.map → inject-session-ZCQUB3IT.js.map} +1 -1
  50. package/dist/internal/memory/dreaming/phases.d.ts +21 -1
  51. package/dist/internal/memory/storage/index.cjs +10 -10
  52. package/dist/internal/memory/storage/index.js +1 -1
  53. package/dist/internal/memory/storage/memory-file.d.cts +41 -5
  54. package/dist/internal/memory/storage/memory-file.d.ts +41 -5
  55. package/dist/internal/memory/storage/threat-scan.d.cts +62 -0
  56. package/dist/internal/memory/storage/threat-scan.d.ts +62 -0
  57. package/dist/internal/memory/types.d.ts +28 -0
  58. package/dist/internal/runtime/memory/select-facts.d.ts +63 -0
  59. package/dist/internal/runtime/system-prompt/sources/memory-provider.d.ts +6 -1
  60. package/docs/error-codes.md +3 -2
  61. package/docs/harness-capability-map.md +9 -7
  62. package/docs/memory-decisions.md +207 -0
  63. package/package.json +1 -1
  64. package/dist/chunk-23GPJGRR.cjs.map +0 -1
  65. package/dist/chunk-43GFJ5SD.cjs.map +0 -1
  66. package/dist/chunk-76XTUTKY.js.map +0 -1
  67. package/dist/chunk-IACR5LEM.js.map +0 -1
  68. package/dist/chunk-JVERBPRD.js +0 -191
  69. package/dist/chunk-JVERBPRD.js.map +0 -1
  70. package/dist/chunk-NY25NBZB.cjs +0 -203
  71. package/dist/chunk-NY25NBZB.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk43GFJ5SD_cjs = require('./chunk-43GFJ5SD.cjs');
3
+ var chunkP5LCASTC_cjs = require('./chunk-P5LCASTC.cjs');
4
4
  require('./chunk-F3YZMOAU.cjs');
5
5
  require('./chunk-4OTIXDMU.cjs');
6
6
  require('./chunk-DQKERTND.cjs');
@@ -25,35 +25,35 @@ require('./chunk-NUKRL3I6.cjs');
25
25
 
26
26
  Object.defineProperty(exports, "COMPACT_SUMMARY_MARKER", {
27
27
  enumerable: true,
28
- get: function () { return chunk43GFJ5SD_cjs.COMPACT_SUMMARY_MARKER; }
28
+ get: function () { return chunkP5LCASTC_cjs.COMPACT_SUMMARY_MARKER; }
29
29
  });
30
30
  Object.defineProperty(exports, "COMPACT_USER_MESSAGE_MAX_TOKENS", {
31
31
  enumerable: true,
32
- get: function () { return chunk43GFJ5SD_cjs.COMPACT_USER_MESSAGE_MAX_TOKENS; }
32
+ get: function () { return chunkP5LCASTC_cjs.COMPACT_USER_MESSAGE_MAX_TOKENS; }
33
33
  });
34
34
  Object.defineProperty(exports, "autoCompactIfNeeded", {
35
35
  enumerable: true,
36
- get: function () { return chunk43GFJ5SD_cjs.autoCompactIfNeeded; }
36
+ get: function () { return chunkP5LCASTC_cjs.autoCompactIfNeeded; }
37
37
  });
38
38
  Object.defineProperty(exports, "buildDefaultSummarizer", {
39
39
  enumerable: true,
40
- get: function () { return chunk43GFJ5SD_cjs.buildDefaultSummarizer; }
40
+ get: function () { return chunkP5LCASTC_cjs.buildDefaultSummarizer; }
41
41
  });
42
42
  Object.defineProperty(exports, "compactSessionTranscript", {
43
43
  enumerable: true,
44
- get: function () { return chunk43GFJ5SD_cjs.compactSessionTranscript; }
44
+ get: function () { return chunkP5LCASTC_cjs.compactSessionTranscript; }
45
45
  });
46
46
  Object.defineProperty(exports, "isCompactSummary", {
47
47
  enumerable: true,
48
- get: function () { return chunk43GFJ5SD_cjs.isCompactSummary; }
48
+ get: function () { return chunkP5LCASTC_cjs.isCompactSummary; }
49
49
  });
50
50
  Object.defineProperty(exports, "resolveSummarizerRoute", {
51
51
  enumerable: true,
52
- get: function () { return chunk43GFJ5SD_cjs.resolveSummarizerRoute; }
52
+ get: function () { return chunkP5LCASTC_cjs.resolveSummarizerRoute; }
53
53
  });
54
54
  Object.defineProperty(exports, "shouldAutoCompact", {
55
55
  enumerable: true,
56
- get: function () { return chunk43GFJ5SD_cjs.shouldAutoCompact; }
56
+ get: function () { return chunkP5LCASTC_cjs.shouldAutoCompact; }
57
57
  });
58
- //# sourceMappingURL=compact-session-YHFQIXV5.cjs.map
59
- //# sourceMappingURL=compact-session-YHFQIXV5.cjs.map
58
+ //# sourceMappingURL=compact-session-GJXJD73F.cjs.map
59
+ //# sourceMappingURL=compact-session-GJXJD73F.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-YHFQIXV5.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-GJXJD73F.cjs"}
@@ -1,4 +1,4 @@
1
- export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, isCompactSummary, resolveSummarizerRoute, shouldAutoCompact } from './chunk-IACR5LEM.js';
1
+ export { COMPACT_SUMMARY_MARKER, COMPACT_USER_MESSAGE_MAX_TOKENS, autoCompactIfNeeded, buildDefaultSummarizer, compactSessionTranscript, isCompactSummary, resolveSummarizerRoute, shouldAutoCompact } from './chunk-YXGAW7BB.js';
2
2
  import './chunk-3E77SX4H.js';
3
3
  import './chunk-WTMU7J4U.js';
4
4
  import './chunk-5JLFFPCH.js';
@@ -18,5 +18,5 @@ import './chunk-3OR54XG4.js';
18
18
  import './chunk-IDCKSLYH.js';
19
19
  import './chunk-T7XEKOVW.js';
20
20
  import './chunk-T7O6K6PX.js';
21
- //# sourceMappingURL=compact-session-QGDNP45U.js.map
22
- //# sourceMappingURL=compact-session-QGDNP45U.js.map
21
+ //# sourceMappingURL=compact-session-TSMQOIHO.js.map
22
+ //# sourceMappingURL=compact-session-TSMQOIHO.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-QGDNP45U.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"compact-session-TSMQOIHO.js"}
package/dist/cron.cjs CHANGED
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunk3HDTP4ZO_cjs = require('./chunk-3HDTP4ZO.cjs');
4
- require('./chunk-23GPJGRR.cjs');
3
+ var chunk5IT6DUOO_cjs = require('./chunk-5IT6DUOO.cjs');
4
+ require('./chunk-R7YIVL3K.cjs');
5
5
  require('./chunk-NGESVVJN.cjs');
6
- require('./chunk-KKK3FZ4A.cjs');
6
+ require('./chunk-2DG7KW4L.cjs');
7
7
  require('./chunk-BUUUWQMB.cjs');
8
- require('./chunk-Y2KJ7MYO.cjs');
8
+ require('./chunk-6OBIWHDR.cjs');
9
9
  require('./chunk-P6H23T43.cjs');
10
10
  require('./chunk-BV2MWEMV.cjs');
11
11
  require('./chunk-EI2Q7SJ5.cjs');
12
12
  require('./chunk-GHX4P3V2.cjs');
13
- require('./chunk-NY25NBZB.cjs');
13
+ require('./chunk-2UCFUSPW.cjs');
14
14
  require('./chunk-QI7WE46I.cjs');
15
- require('./chunk-43GFJ5SD.cjs');
15
+ require('./chunk-P5LCASTC.cjs');
16
16
  require('./chunk-F3YZMOAU.cjs');
17
17
  require('./chunk-4OTIXDMU.cjs');
18
18
  require('./chunk-DQKERTND.cjs');
@@ -59,7 +59,7 @@ require('./chunk-NUKRL3I6.cjs');
59
59
 
60
60
  Object.defineProperty(exports, "Cron", {
61
61
  enumerable: true,
62
- get: function () { return chunk3HDTP4ZO_cjs.Cron; }
62
+ get: function () { return chunk5IT6DUOO_cjs.Cron; }
63
63
  });
64
64
  //# sourceMappingURL=cron.cjs.map
65
65
  //# sourceMappingURL=cron.cjs.map
package/dist/cron.js CHANGED
@@ -1,16 +1,16 @@
1
- export { Cron } from './chunk-E5MWNLRX.js';
2
- import './chunk-76XTUTKY.js';
1
+ export { Cron } from './chunk-532CSLYU.js';
2
+ import './chunk-GQZKDGZM.js';
3
3
  import './chunk-SUKXXLWD.js';
4
- import './chunk-WG7R5W6R.js';
4
+ import './chunk-YEXA3PGR.js';
5
5
  import './chunk-K2BQQ445.js';
6
- import './chunk-7OXXYBHD.js';
6
+ import './chunk-QEKI3YKI.js';
7
7
  import './chunk-MZ2FGBLZ.js';
8
8
  import './chunk-2SFBB54R.js';
9
9
  import './chunk-XN7NOENA.js';
10
10
  import './chunk-H73MEMQB.js';
11
- import './chunk-JVERBPRD.js';
11
+ import './chunk-WCLDJSMY.js';
12
12
  import './chunk-YJDH3CKG.js';
13
- import './chunk-IACR5LEM.js';
13
+ import './chunk-YXGAW7BB.js';
14
14
  import './chunk-3E77SX4H.js';
15
15
  import './chunk-WTMU7J4U.js';
16
16
  import './chunk-5JLFFPCH.js';
package/dist/eval.cjs CHANGED
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkJ24VJOH3_cjs = require('./chunk-J24VJOH3.cjs');
4
- var chunk23GPJGRR_cjs = require('./chunk-23GPJGRR.cjs');
4
+ var chunkR7YIVL3K_cjs = require('./chunk-R7YIVL3K.cjs');
5
5
  require('./chunk-NGESVVJN.cjs');
6
- require('./chunk-KKK3FZ4A.cjs');
6
+ require('./chunk-2DG7KW4L.cjs');
7
7
  var chunkBUUUWQMB_cjs = require('./chunk-BUUUWQMB.cjs');
8
- require('./chunk-Y2KJ7MYO.cjs');
8
+ require('./chunk-6OBIWHDR.cjs');
9
9
  require('./chunk-P6H23T43.cjs');
10
10
  require('./chunk-BV2MWEMV.cjs');
11
11
  require('./chunk-EI2Q7SJ5.cjs');
12
12
  require('./chunk-GHX4P3V2.cjs');
13
- require('./chunk-NY25NBZB.cjs');
13
+ require('./chunk-2UCFUSPW.cjs');
14
14
  require('./chunk-QI7WE46I.cjs');
15
- require('./chunk-43GFJ5SD.cjs');
15
+ require('./chunk-P5LCASTC.cjs');
16
16
  require('./chunk-F3YZMOAU.cjs');
17
17
  require('./chunk-4OTIXDMU.cjs');
18
18
  require('./chunk-DQKERTND.cjs');
@@ -782,7 +782,7 @@ function makeDefaultEmbedder(opts) {
782
782
  let runtime;
783
783
  return (texts) => {
784
784
  if (runtime === void 0) {
785
- runtime = chunk23GPJGRR_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
785
+ runtime = chunkR7YIVL3K_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
786
786
  }
787
787
  return runtime.then((rt) => rt.embed(texts));
788
788
  };
package/dist/eval.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { shellEscapePosix, LocalSandbox } from './chunk-2D34UTDC.js';
2
- import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-76XTUTKY.js';
2
+ import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-GQZKDGZM.js';
3
3
  import './chunk-SUKXXLWD.js';
4
- import './chunk-WG7R5W6R.js';
4
+ import './chunk-YEXA3PGR.js';
5
5
  import { getTracer } from './chunk-K2BQQ445.js';
6
- import './chunk-7OXXYBHD.js';
6
+ import './chunk-QEKI3YKI.js';
7
7
  import './chunk-MZ2FGBLZ.js';
8
8
  import './chunk-2SFBB54R.js';
9
9
  import './chunk-XN7NOENA.js';
10
10
  import './chunk-H73MEMQB.js';
11
- import './chunk-JVERBPRD.js';
11
+ import './chunk-WCLDJSMY.js';
12
12
  import './chunk-YJDH3CKG.js';
13
- import './chunk-IACR5LEM.js';
13
+ import './chunk-YXGAW7BB.js';
14
14
  import './chunk-3E77SX4H.js';
15
15
  import './chunk-WTMU7J4U.js';
16
16
  import './chunk-5JLFFPCH.js';
@@ -1,6 +1,6 @@
1
- export { IndexManager } from './chunk-7OXXYBHD.js';
1
+ export { IndexManager } from './chunk-QEKI3YKI.js';
2
2
  import './chunk-H73MEMQB.js';
3
- import './chunk-JVERBPRD.js';
3
+ import './chunk-WCLDJSMY.js';
4
4
  import './chunk-KVNWIAO4.js';
5
5
  import './chunk-FD2UT76F.js';
6
6
  import './chunk-QARJGQSA.js';
@@ -12,5 +12,5 @@ import './chunk-VF7EWVDG.js';
12
12
  import './chunk-IDCKSLYH.js';
13
13
  import './chunk-T7XEKOVW.js';
14
14
  import './chunk-T7O6K6PX.js';
15
- //# sourceMappingURL=index-manager-KP2JAXKN.js.map
16
- //# sourceMappingURL=index-manager-KP2JAXKN.js.map
15
+ //# sourceMappingURL=index-manager-AHAYJ33H.js.map
16
+ //# sourceMappingURL=index-manager-AHAYJ33H.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-KP2JAXKN.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-AHAYJ33H.js"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkY2KJ7MYO_cjs = require('./chunk-Y2KJ7MYO.cjs');
3
+ var chunk6OBIWHDR_cjs = require('./chunk-6OBIWHDR.cjs');
4
4
  require('./chunk-GHX4P3V2.cjs');
5
- require('./chunk-NY25NBZB.cjs');
5
+ require('./chunk-2UCFUSPW.cjs');
6
6
  require('./chunk-KRD3GQAA.cjs');
7
7
  require('./chunk-MUUQ2WFJ.cjs');
8
8
  require('./chunk-R3UPQFKK.cjs');
@@ -19,7 +19,7 @@ require('./chunk-NUKRL3I6.cjs');
19
19
 
20
20
  Object.defineProperty(exports, "IndexManager", {
21
21
  enumerable: true,
22
- get: function () { return chunkY2KJ7MYO_cjs.IndexManager; }
22
+ get: function () { return chunk6OBIWHDR_cjs.IndexManager; }
23
23
  });
24
- //# sourceMappingURL=index-manager-YUORPS4G.cjs.map
25
- //# sourceMappingURL=index-manager-YUORPS4G.cjs.map
24
+ //# sourceMappingURL=index-manager-RHPFVFSC.cjs.map
25
+ //# sourceMappingURL=index-manager-RHPFVFSC.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-YUORPS4G.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index-manager-RHPFVFSC.cjs"}
package/dist/index.cjs CHANGED
@@ -8,19 +8,19 @@ require('./chunk-QDED6YO6.cjs');
8
8
  var chunk6SBW4QR2_cjs = require('./chunk-6SBW4QR2.cjs');
9
9
  require('./chunk-XWL6O3SW.cjs');
10
10
  require('./chunk-VTYY7XL5.cjs');
11
- var chunk3HDTP4ZO_cjs = require('./chunk-3HDTP4ZO.cjs');
12
- var chunk23GPJGRR_cjs = require('./chunk-23GPJGRR.cjs');
11
+ var chunk5IT6DUOO_cjs = require('./chunk-5IT6DUOO.cjs');
12
+ var chunkR7YIVL3K_cjs = require('./chunk-R7YIVL3K.cjs');
13
13
  var chunkNGESVVJN_cjs = require('./chunk-NGESVVJN.cjs');
14
- require('./chunk-KKK3FZ4A.cjs');
14
+ require('./chunk-2DG7KW4L.cjs');
15
15
  require('./chunk-BUUUWQMB.cjs');
16
- var chunkY2KJ7MYO_cjs = require('./chunk-Y2KJ7MYO.cjs');
16
+ var chunk6OBIWHDR_cjs = require('./chunk-6OBIWHDR.cjs');
17
17
  require('./chunk-P6H23T43.cjs');
18
18
  require('./chunk-BV2MWEMV.cjs');
19
19
  require('./chunk-EI2Q7SJ5.cjs');
20
20
  require('./chunk-GHX4P3V2.cjs');
21
- var chunkNY25NBZB_cjs = require('./chunk-NY25NBZB.cjs');
21
+ var chunk2UCFUSPW_cjs = require('./chunk-2UCFUSPW.cjs');
22
22
  require('./chunk-QI7WE46I.cjs');
23
- var chunk43GFJ5SD_cjs = require('./chunk-43GFJ5SD.cjs');
23
+ var chunkP5LCASTC_cjs = require('./chunk-P5LCASTC.cjs');
24
24
  require('./chunk-F3YZMOAU.cjs');
25
25
  require('./chunk-4OTIXDMU.cjs');
26
26
  require('./chunk-DQKERTND.cjs');
@@ -71,8 +71,8 @@ var fs = require('fs');
71
71
  // src/agent-factory.ts
72
72
  function createAgentFactory(common) {
73
73
  return {
74
- forSession: (agentId, overrides) => chunk23GPJGRR_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
75
- getOrCreate: (agentId, overrides) => chunk23GPJGRR_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
74
+ forSession: (agentId, overrides) => chunkR7YIVL3K_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
75
+ getOrCreate: (agentId, overrides) => chunkR7YIVL3K_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
76
76
  };
77
77
  }
78
78
  function mergeAgentOptions(common, overrides, agentId) {
@@ -1020,7 +1020,7 @@ function foldLayers(entries, accumulatingKeys = []) {
1020
1020
  return combined;
1021
1021
  }
1022
1022
  function diaryPath(cwd) {
1023
- return path.join(chunkNY25NBZB_cjs.memoryDir(cwd), "dream-diary.md");
1023
+ return path.join(chunk2UCFUSPW_cjs.memoryDir(cwd), "dream-diary.md");
1024
1024
  }
1025
1025
  function renderDiaryEntry(entry) {
1026
1026
  const stamp = new Date(entry.timestampMs).toISOString();
@@ -1064,7 +1064,40 @@ function entryHash(entry) {
1064
1064
  // src/internal/memory/dreaming/phases.ts
1065
1065
  var DEFAULT_DEDUP_THRESHOLD = 0.95;
1066
1066
  var DEFAULT_CLUSTER_THRESHOLD = 0.75;
1067
+ var CONSOLIDATABLE_KINDS = /* @__PURE__ */ new Set(["project", "session"]);
1068
+ var ATOMIC_KINDS = /* @__PURE__ */ new Set(["user", "feedback", "reference"]);
1069
+ function dedupPolicy(fact) {
1070
+ if (fact.kind === void 0) return "exact";
1071
+ if (ATOMIC_KINDS.has(fact.kind)) return "never";
1072
+ return CONSOLIDATABLE_KINDS.has(fact.kind) ? "similar" : "never";
1073
+ }
1074
+ function normalizeForExactMatch(text) {
1075
+ return text.trim().toLowerCase().replace(/\s+/g, " ").replace(/[.!?]+$/, "");
1076
+ }
1067
1077
  async function lightPhase(facts, embedding, threshold = DEFAULT_DEDUP_THRESHOLD) {
1078
+ if (facts.length <= 1) return { kept: [...facts], duplicatesRemoved: 0 };
1079
+ const never = facts.filter((f) => dedupPolicy(f) === "never");
1080
+ const exact = facts.filter((f) => dedupPolicy(f) === "exact");
1081
+ const similar = facts.filter((f) => dedupPolicy(f) === "similar");
1082
+ const seen = /* @__PURE__ */ new Set();
1083
+ const exactKept = [];
1084
+ let removed = 0;
1085
+ for (const f of exact) {
1086
+ const key = normalizeForExactMatch(f.text);
1087
+ if (seen.has(key)) {
1088
+ removed += 1;
1089
+ continue;
1090
+ }
1091
+ seen.add(key);
1092
+ exactKept.push(f);
1093
+ }
1094
+ const sim = similar.length > 1 ? await dedupCandidates(similar, embedding, threshold) : { kept: [...similar], duplicatesRemoved: 0 };
1095
+ return {
1096
+ kept: [...never, ...exactKept, ...sim.kept],
1097
+ duplicatesRemoved: removed + sim.duplicatesRemoved
1098
+ };
1099
+ }
1100
+ async function dedupCandidates(facts, embedding, threshold) {
1068
1101
  if (facts.length <= 1) return { kept: [...facts], duplicatesRemoved: 0 };
1069
1102
  const vectors = await embedding.embed(facts.map((f) => f.text));
1070
1103
  const keptIdx = [];
@@ -1167,7 +1200,7 @@ async function runInner(options) {
1167
1200
  const now = options.now ?? Date.now;
1168
1201
  const timestampMs = now();
1169
1202
  try {
1170
- const facts = await chunkNY25NBZB_cjs.readFactsFromMarkdown(options.cwd);
1203
+ const facts = await chunk2UCFUSPW_cjs.readFactsFromMarkdown(options.cwd);
1171
1204
  if (facts.length === 0) {
1172
1205
  return emptyResult("skipped");
1173
1206
  }
@@ -1201,7 +1234,7 @@ async function runInner(options) {
1201
1234
  }
1202
1235
  async function writeConsolidatedNotes(cwd, clusters, timestampMs) {
1203
1236
  if (clusters.length === 0) return 0;
1204
- const notesDir = path.join(chunkNY25NBZB_cjs.memoryDir(cwd), "notes");
1237
+ const notesDir = path.join(chunk2UCFUSPW_cjs.memoryDir(cwd), "notes");
1205
1238
  await promises.mkdir(notesDir, { recursive: true });
1206
1239
  const isoSlug = new Date(timestampMs).toISOString().replace(/[^\dT]/g, "-");
1207
1240
  const file = path.join(notesDir, `dreamed-${isoSlug}.md`);
@@ -1267,8 +1300,8 @@ var Memory = {
1267
1300
  openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
1268
1301
  return await peer.IndexManager.open(openArgs);
1269
1302
  }
1270
- const { IndexManager } = await import('./index-manager-YUORPS4G.cjs');
1271
- openArgs.embedding = await resolveEmbedding(opts.embedding, chunk23GPJGRR_cjs.MEMORY_EMBEDDING_ADAPTERS);
1303
+ const { IndexManager } = await import('./index-manager-RHPFVFSC.cjs');
1304
+ openArgs.embedding = await resolveEmbedding(opts.embedding, chunkR7YIVL3K_cjs.MEMORY_EMBEDDING_ADAPTERS);
1272
1305
  return await IndexManager.open(openArgs);
1273
1306
  },
1274
1307
  /**
@@ -1279,7 +1312,7 @@ var Memory = {
1279
1312
  */
1280
1313
  async runDreamingSweep(opts) {
1281
1314
  const peer = await tryLoadSdkMemoryPeer();
1282
- const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunk23GPJGRR_cjs.MEMORY_EMBEDDING_ADAPTERS;
1315
+ const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkR7YIVL3K_cjs.MEMORY_EMBEDDING_ADAPTERS;
1283
1316
  const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
1284
1317
  const result = peer !== null ? (
1285
1318
  // biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
@@ -1345,9 +1378,9 @@ function extractRawId(id, expectedAdapterId) {
1345
1378
  return id.slice(prefix.length);
1346
1379
  }
1347
1380
  async function readAllSqliteFacts(cwd) {
1348
- const dbPath = chunkY2KJ7MYO_cjs.defaultIndexPath(cwd);
1381
+ const dbPath = chunk6OBIWHDR_cjs.defaultIndexPath(cwd);
1349
1382
  if (!fs.existsSync(dbPath)) return [];
1350
- const db = await chunkY2KJ7MYO_cjs.openMemoryDb({ filePath: dbPath });
1383
+ const db = await chunk6OBIWHDR_cjs.openMemoryDb({ filePath: dbPath });
1351
1384
  try {
1352
1385
  const stmt = db.prepare("SELECT id, path, source, start_line, end_line, text FROM chunks");
1353
1386
  const rows = stmt.all();
@@ -1366,7 +1399,7 @@ function nfcEqual(a, b) {
1366
1399
  }
1367
1400
  async function migrateSqliteToLance(opts) {
1368
1401
  const cwd = opts.cwd;
1369
- const finalPath = chunkY2KJ7MYO_cjs.lanceStoragePath(cwd);
1402
+ const finalPath = chunk6OBIWHDR_cjs.lanceStoragePath(cwd);
1370
1403
  const newPath = path.join(cwd, ".theokit", "memory", "lance-new");
1371
1404
  const rawLog = opts.logger ?? ((m) => console.log(m));
1372
1405
  const log = (m) => rawLog(chunkJTB5Q42C_cjs.redactSecrets(m));
@@ -1410,7 +1443,7 @@ async function migrateSqliteToLance(opts) {
1410
1443
  };
1411
1444
  fs.mkdirSync(newPath, { recursive: true });
1412
1445
  log(`Writing Lance index to ${newPath} ...`);
1413
- const lance = await chunkY2KJ7MYO_cjs.LanceIndex.open({
1446
+ const lance = await chunk6OBIWHDR_cjs.LanceIndex.open({
1414
1447
  cwd,
1415
1448
  embedding: placeholderEmbedding,
1416
1449
  storagePath: newPath
@@ -1841,7 +1874,7 @@ function isBuiltAgent(m) {
1841
1874
  return typeof m.send === "function";
1842
1875
  }
1843
1876
  async function materialize(def, index) {
1844
- const { Agent: Agent2 } = await import('./agent-26RMDG4U.cjs');
1877
+ const { Agent: Agent2 } = await import('./agent-M53C3PAA.cjs');
1845
1878
  return Agent2.create({
1846
1879
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1847
1880
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -1983,7 +2016,7 @@ var FIXTURE_USER = {
1983
2016
  };
1984
2017
  var FIXTURE_MODELS = [
1985
2018
  {
1986
- id: chunk23GPJGRR_cjs.DEFAULT_AGENTIC_MODEL_ID,
2019
+ id: chunkR7YIVL3K_cjs.DEFAULT_AGENTIC_MODEL_ID,
1987
2020
  name: "Gemini 2.0 Flash",
1988
2021
  displayName: "Gemini 2.0 Flash",
1989
2022
  parameters: [
@@ -2059,7 +2092,7 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
2059
2092
  try {
2060
2093
  response = await fetch(url, { method: "GET" });
2061
2094
  } catch (fetchErr) {
2062
- const mapped = chunk43GFJ5SD_cjs.mapOllamaTransportError({
2095
+ const mapped = chunkP5LCASTC_cjs.mapOllamaTransportError({
2063
2096
  providerId: "ollama",
2064
2097
  cause: fetchErr,
2065
2098
  endpoint: "/v1/models"
@@ -2071,8 +2104,8 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
2071
2104
  );
2072
2105
  }
2073
2106
  if (!response.ok) {
2074
- const body = await chunk43GFJ5SD_cjs.readErrorResponseBody(response);
2075
- const mapped = chunk43GFJ5SD_cjs.mapOllamaHttpError({
2107
+ const body = await chunkP5LCASTC_cjs.readErrorResponseBody(response);
2108
+ const mapped = chunkP5LCASTC_cjs.mapOllamaHttpError({
2076
2109
  providerId: "ollama",
2077
2110
  status: response.status,
2078
2111
  body,
@@ -2186,7 +2219,7 @@ var Theokit = class {
2186
2219
  envVars: p.envVars
2187
2220
  }));
2188
2221
  },
2189
- embeddingAdapters: () => Object.entries(chunk23GPJGRR_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
2222
+ embeddingAdapters: () => Object.entries(chunkR7YIVL3K_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
2190
2223
  id,
2191
2224
  transport: adapter.transport,
2192
2225
  defaultModel: adapter.defaultModel
@@ -2204,7 +2237,7 @@ var Theokit = class {
2204
2237
  };
2205
2238
  async function maybeListLocalModels(providerName) {
2206
2239
  chunkNIRE5CNO_cjs.registerBuiltins();
2207
- await chunk43GFJ5SD_cjs.discoverProviderPlugins();
2240
+ await chunkP5LCASTC_cjs.discoverProviderPlugins();
2208
2241
  const profile = chunkNIRE5CNO_cjs.getProviderProfile(providerName);
2209
2242
  if (profile === void 0) return void 0;
2210
2243
  if (profile.authType !== "none") return void 0;
@@ -2222,13 +2255,13 @@ async function executeCatalogRequest(request) {
2222
2255
  if (apiKey === void 0) {
2223
2256
  throw new chunkK3FW2XZD_cjs.AuthenticationError("Missing API key", { code: "missing_api_key" });
2224
2257
  }
2225
- if (chunk43GFJ5SD_cjs.shouldUseFixtureMode(apiKey)) {
2258
+ if (chunkP5LCASTC_cjs.shouldUseFixtureMode(apiKey)) {
2226
2259
  return request.fixture;
2227
2260
  }
2228
- if (!chunk43GFJ5SD_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
2261
+ if (!chunkP5LCASTC_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
2229
2262
  throw new chunkK3FW2XZD_cjs.AuthenticationError("Invalid API key", { code: "authentication_error" });
2230
2263
  }
2231
- return chunk43GFJ5SD_cjs.httpRequest(request.path, { apiKey });
2264
+ return chunkP5LCASTC_cjs.httpRequest(request.path, { apiKey });
2232
2265
  }
2233
2266
 
2234
2267
  // src/tool-blast-radius.ts
@@ -2405,35 +2438,35 @@ Object.defineProperty(exports, "fn", {
2405
2438
  });
2406
2439
  Object.defineProperty(exports, "Cron", {
2407
2440
  enumerable: true,
2408
- get: function () { return chunk3HDTP4ZO_cjs.Cron; }
2441
+ get: function () { return chunk5IT6DUOO_cjs.Cron; }
2409
2442
  });
2410
2443
  Object.defineProperty(exports, "Agent", {
2411
2444
  enumerable: true,
2412
- get: function () { return chunk23GPJGRR_cjs.Agent; }
2445
+ get: function () { return chunkR7YIVL3K_cjs.Agent; }
2413
2446
  });
2414
2447
  Object.defineProperty(exports, "AgentBuilder", {
2415
2448
  enumerable: true,
2416
- get: function () { return chunk23GPJGRR_cjs.AgentBuilder; }
2449
+ get: function () { return chunkR7YIVL3K_cjs.AgentBuilder; }
2417
2450
  });
2418
2451
  Object.defineProperty(exports, "Tool", {
2419
2452
  enumerable: true,
2420
- get: function () { return chunk23GPJGRR_cjs.Tool; }
2453
+ get: function () { return chunkR7YIVL3K_cjs.Tool; }
2421
2454
  });
2422
2455
  Object.defineProperty(exports, "ToolError", {
2423
2456
  enumerable: true,
2424
- get: function () { return chunk23GPJGRR_cjs.ToolError; }
2457
+ get: function () { return chunkR7YIVL3K_cjs.ToolError; }
2425
2458
  });
2426
2459
  Object.defineProperty(exports, "UsageAccumulator", {
2427
2460
  enumerable: true,
2428
- get: function () { return chunk23GPJGRR_cjs.UsageAccumulator; }
2461
+ get: function () { return chunkR7YIVL3K_cjs.UsageAccumulator; }
2429
2462
  });
2430
2463
  Object.defineProperty(exports, "computeCost", {
2431
2464
  enumerable: true,
2432
- get: function () { return chunk23GPJGRR_cjs.computeCost; }
2465
+ get: function () { return chunkR7YIVL3K_cjs.computeCost; }
2433
2466
  });
2434
2467
  Object.defineProperty(exports, "getPricingEntry", {
2435
2468
  enumerable: true,
2436
- get: function () { return chunk23GPJGRR_cjs.getPricingEntry; }
2469
+ get: function () { return chunkR7YIVL3K_cjs.getPricingEntry; }
2437
2470
  });
2438
2471
  Object.defineProperty(exports, "emitRunEvent", {
2439
2472
  enumerable: true,