@remnic/core 9.3.645 → 9.3.647

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 (98) hide show
  1. package/dist/access-cli.js +18 -17
  2. package/dist/access-cli.js.map +1 -1
  3. package/dist/access-http.js +13 -13
  4. package/dist/access-mcp.js +10 -10
  5. package/dist/access-schema.js +3 -3
  6. package/dist/access-service.js +8 -8
  7. package/dist/adapters/index.js +4 -4
  8. package/dist/adapters/registry.js +2 -2
  9. package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-GWVG7LGC.js} +2 -2
  10. package/dist/{chunk-6YLJZ2EU.js → chunk-3D6L7CEP.js} +92 -29
  11. package/dist/chunk-3D6L7CEP.js.map +1 -0
  12. package/dist/{chunk-3SF7QNKF.js → chunk-6BNFVP7Y.js} +2 -2
  13. package/dist/{chunk-AGNBY3VG.js → chunk-APJQ6UEA.js} +4 -4
  14. package/dist/{chunk-HRXCPKN4.js → chunk-APWJRJFW.js} +2 -2
  15. package/dist/{chunk-VDX2J7OX.js → chunk-BUKK5SWA.js} +2 -2
  16. package/dist/{chunk-T22TZJWJ.js → chunk-DC66QVL2.js} +2 -2
  17. package/dist/chunk-EVWIEEKZ.js +315 -0
  18. package/dist/chunk-EVWIEEKZ.js.map +1 -0
  19. package/dist/{chunk-IZXOO6NP.js → chunk-FAYDM5WD.js} +2 -2
  20. package/dist/{chunk-Y2XKJJEI.js → chunk-IMWFHBG2.js} +10 -33
  21. package/dist/chunk-IMWFHBG2.js.map +1 -0
  22. package/dist/{chunk-W5ISYSIL.js → chunk-L7W5YW6Y.js} +4 -4
  23. package/dist/{chunk-DGNQRNLL.js → chunk-NT5TINK5.js} +2 -2
  24. package/dist/{chunk-BXLOS5AJ.js → chunk-OWHERGF2.js} +2 -2
  25. package/dist/{chunk-CDHRUNBX.js → chunk-QKE4LHNR.js} +2 -2
  26. package/dist/{chunk-BTRL6GG7.js → chunk-RAELB5NX.js} +5 -5
  27. package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
  28. package/dist/chunk-S4DDLTPX.js +140 -0
  29. package/dist/chunk-S4DDLTPX.js.map +1 -0
  30. package/dist/{chunk-MBT3ASYV.js → chunk-TA4LQ5SR.js} +12 -12
  31. package/dist/{chunk-KVUG7FF7.js → chunk-U55D5UD5.js} +7 -7
  32. package/dist/{chunk-DQEMWVMT.js → chunk-UVYI6VIX.js} +1 -1
  33. package/dist/{chunk-D2B22JDF.js → chunk-WEPMT6SC.js} +7 -7
  34. package/dist/{chunk-IHG27THY.js → chunk-XUGQQPGO.js} +77 -61
  35. package/dist/chunk-XUGQQPGO.js.map +1 -0
  36. package/dist/{chunk-YOXCJP3A.js → chunk-ZPPFKVSD.js} +3 -3
  37. package/dist/cli.js +30 -28
  38. package/dist/{first-start-migration-FF7YFGRP.js → first-start-migration-PG5HBC3K.js} +4 -4
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.js +77 -63
  41. package/dist/index.js.map +1 -1
  42. package/dist/lcm/engine.js +3 -3
  43. package/dist/lcm/index.js +11 -11
  44. package/dist/namespaces/migrate.js +5 -5
  45. package/dist/namespaces/search.js +4 -4
  46. package/dist/operator-toolkit.js +6 -6
  47. package/dist/orchestrator.js +14 -13
  48. package/dist/resume-bundles.js +3 -2
  49. package/dist/schemas.d.ts +22 -22
  50. package/dist/search/factory.js +3 -3
  51. package/dist/search/index.js +7 -7
  52. package/dist/session-identity.d.ts +118 -0
  53. package/dist/session-identity.js +21 -0
  54. package/dist/session-identity.js.map +1 -0
  55. package/dist/session-transcript-migration.d.ts +65 -0
  56. package/dist/session-transcript-migration.js +16 -0
  57. package/dist/session-transcript-migration.js.map +1 -0
  58. package/dist/summarizer.js +2 -1
  59. package/dist/transcript.d.ts +18 -6
  60. package/dist/transcript.js +2 -1
  61. package/dist/transfer/backup.js +2 -2
  62. package/dist/transfer/capsule-export.js +2 -2
  63. package/dist/transfer/capsule-import.js +2 -2
  64. package/dist/transfer/import-sqlite.js +2 -2
  65. package/dist/transfer/types.d.ts +12 -12
  66. package/package.json +1 -1
  67. package/src/cli.ts +79 -0
  68. package/src/index.ts +18 -0
  69. package/src/session-identity.test.ts +130 -0
  70. package/src/session-identity.ts +281 -0
  71. package/src/session-transcript-migration.test.ts +350 -0
  72. package/src/session-transcript-migration.ts +527 -0
  73. package/src/summarizer.ts +15 -35
  74. package/src/transcript-session-identity.test.ts +424 -0
  75. package/src/transcript.test.ts +110 -0
  76. package/src/transcript.ts +121 -73
  77. package/dist/chunk-6YLJZ2EU.js.map +0 -1
  78. package/dist/chunk-IHG27THY.js.map +0 -1
  79. package/dist/chunk-Y2XKJJEI.js.map +0 -1
  80. /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-GWVG7LGC.js.map} +0 -0
  81. /package/dist/{chunk-3SF7QNKF.js.map → chunk-6BNFVP7Y.js.map} +0 -0
  82. /package/dist/{chunk-AGNBY3VG.js.map → chunk-APJQ6UEA.js.map} +0 -0
  83. /package/dist/{chunk-HRXCPKN4.js.map → chunk-APWJRJFW.js.map} +0 -0
  84. /package/dist/{chunk-VDX2J7OX.js.map → chunk-BUKK5SWA.js.map} +0 -0
  85. /package/dist/{chunk-T22TZJWJ.js.map → chunk-DC66QVL2.js.map} +0 -0
  86. /package/dist/{chunk-IZXOO6NP.js.map → chunk-FAYDM5WD.js.map} +0 -0
  87. /package/dist/{chunk-W5ISYSIL.js.map → chunk-L7W5YW6Y.js.map} +0 -0
  88. /package/dist/{chunk-DGNQRNLL.js.map → chunk-NT5TINK5.js.map} +0 -0
  89. /package/dist/{chunk-BXLOS5AJ.js.map → chunk-OWHERGF2.js.map} +0 -0
  90. /package/dist/{chunk-CDHRUNBX.js.map → chunk-QKE4LHNR.js.map} +0 -0
  91. /package/dist/{chunk-BTRL6GG7.js.map → chunk-RAELB5NX.js.map} +0 -0
  92. /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
  93. /package/dist/{chunk-MBT3ASYV.js.map → chunk-TA4LQ5SR.js.map} +0 -0
  94. /package/dist/{chunk-KVUG7FF7.js.map → chunk-U55D5UD5.js.map} +0 -0
  95. /package/dist/{chunk-DQEMWVMT.js.map → chunk-UVYI6VIX.js.map} +0 -0
  96. /package/dist/{chunk-D2B22JDF.js.map → chunk-WEPMT6SC.js.map} +0 -0
  97. /package/dist/{chunk-YOXCJP3A.js.map → chunk-ZPPFKVSD.js.map} +0 -0
  98. /package/dist/{first-start-migration-FF7YFGRP.js.map → first-start-migration-PG5HBC3K.js.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  LcmEngine,
3
3
  extractLcmConfig
4
- } from "../chunk-D2B22JDF.js";
4
+ } from "../chunk-WEPMT6SC.js";
5
+ import "../chunk-5VDJMYTF.js";
6
+ import "../chunk-HP5FMB6L.js";
5
7
  import "../chunk-7N4KAIGN.js";
6
8
  import "../chunk-TPDBFYEG.js";
7
9
  import "../chunk-KCYE2MZM.js";
8
10
  import "../chunk-MAV46GWQ.js";
9
- import "../chunk-5VDJMYTF.js";
10
- import "../chunk-HP5FMB6L.js";
11
11
  import "../chunk-4RA3C3EV.js";
12
12
  import "../chunk-CI7RKSRE.js";
13
13
  import "../chunk-6KYMPV2O.js";
package/dist/lcm/index.js CHANGED
@@ -1,8 +1,18 @@
1
1
  import "../chunk-HHLLAQGZ.js";
2
+ import {
3
+ registerLcmTools
4
+ } from "../chunk-UWK5OXUJ.js";
2
5
  import {
3
6
  LcmEngine,
4
7
  extractLcmConfig
5
- } from "../chunk-D2B22JDF.js";
8
+ } from "../chunk-WEPMT6SC.js";
9
+ import {
10
+ LcmSummarizer
11
+ } from "../chunk-5VDJMYTF.js";
12
+ import {
13
+ LcmArchive,
14
+ estimateTokens
15
+ } from "../chunk-HP5FMB6L.js";
6
16
  import {
7
17
  LcmDag
8
18
  } from "../chunk-7N4KAIGN.js";
@@ -14,16 +24,6 @@ import {
14
24
  ensureLcmStateDir,
15
25
  openLcmDatabase
16
26
  } from "../chunk-MAV46GWQ.js";
17
- import {
18
- LcmSummarizer
19
- } from "../chunk-5VDJMYTF.js";
20
- import {
21
- registerLcmTools
22
- } from "../chunk-UWK5OXUJ.js";
23
- import {
24
- LcmArchive,
25
- estimateTokens
26
- } from "../chunk-HP5FMB6L.js";
27
27
  import "../chunk-4RA3C3EV.js";
28
28
  import "../chunk-CI7RKSRE.js";
29
29
  import "../chunk-6KYMPV2O.js";
@@ -2,16 +2,16 @@ import {
2
2
  listNamespaces,
3
3
  runNamespaceMigration,
4
4
  verifyNamespaces
5
- } from "../chunk-IZXOO6NP.js";
5
+ } from "../chunk-FAYDM5WD.js";
6
6
  import "../chunk-D6WVJIS3.js";
7
- import "../chunk-HRXCPKN4.js";
8
- import "../chunk-KVUG7FF7.js";
7
+ import "../chunk-APWJRJFW.js";
8
+ import "../chunk-U55D5UD5.js";
9
+ import "../chunk-CYEPCZN5.js";
10
+ import "../chunk-DCGT4FPP.js";
9
11
  import "../chunk-JOASJWQR.js";
10
12
  import "../chunk-RN7MUWON.js";
11
13
  import "../chunk-3MAONBX3.js";
12
14
  import "../chunk-RG3LBSGH.js";
13
- import "../chunk-CYEPCZN5.js";
14
- import "../chunk-DCGT4FPP.js";
15
15
  import "../chunk-Q4CAQGKQ.js";
16
16
  import "../chunk-CINZGPSJ.js";
17
17
  import "../chunk-ZFXCQPNO.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  NamespaceSearchRouter,
3
3
  namespaceCollectionName
4
- } from "../chunk-HRXCPKN4.js";
5
- import "../chunk-KVUG7FF7.js";
4
+ } from "../chunk-APWJRJFW.js";
5
+ import "../chunk-U55D5UD5.js";
6
+ import "../chunk-CYEPCZN5.js";
7
+ import "../chunk-DCGT4FPP.js";
6
8
  import "../chunk-JOASJWQR.js";
7
9
  import "../chunk-RN7MUWON.js";
8
10
  import "../chunk-3MAONBX3.js";
9
11
  import "../chunk-RG3LBSGH.js";
10
- import "../chunk-CYEPCZN5.js";
11
- import "../chunk-DCGT4FPP.js";
12
12
  import "../chunk-Q4CAQGKQ.js";
13
13
  import "../chunk-CINZGPSJ.js";
14
14
  import "../chunk-ZFXCQPNO.js";
@@ -11,8 +11,8 @@ import {
11
11
  summarizeMemoryWorthLegacyCounters,
12
12
  summarizeObservationThroughput,
13
13
  summarizeTierDistribution
14
- } from "./chunk-T22TZJWJ.js";
15
- import "./chunk-IZXOO6NP.js";
14
+ } from "./chunk-DC66QVL2.js";
15
+ import "./chunk-FAYDM5WD.js";
16
16
  import "./chunk-AL4RAJL5.js";
17
17
  import "./chunk-YBPYIAA5.js";
18
18
  import "./chunk-D6WVJIS3.js";
@@ -26,14 +26,14 @@ import "./chunk-PHK3HARR.js";
26
26
  import "./chunk-NDAH7BJ5.js";
27
27
  import "./chunk-Z5LAYHGJ.js";
28
28
  import "./chunk-UMTG2BN2.js";
29
- import "./chunk-HRXCPKN4.js";
30
- import "./chunk-KVUG7FF7.js";
29
+ import "./chunk-APWJRJFW.js";
30
+ import "./chunk-U55D5UD5.js";
31
+ import "./chunk-CYEPCZN5.js";
32
+ import "./chunk-DCGT4FPP.js";
31
33
  import "./chunk-JOASJWQR.js";
32
34
  import "./chunk-RN7MUWON.js";
33
35
  import "./chunk-3MAONBX3.js";
34
36
  import "./chunk-RG3LBSGH.js";
35
- import "./chunk-CYEPCZN5.js";
36
- import "./chunk-DCGT4FPP.js";
37
37
  import "./chunk-Q4CAQGKQ.js";
38
38
  import "./chunk-CINZGPSJ.js";
39
39
  import "./chunk-ZFXCQPNO.js";
@@ -28,33 +28,33 @@ import {
28
28
  sanitizeSessionKeyForFilename,
29
29
  shouldFilterLifecycleRecallCandidate,
30
30
  summarizeGraphShadowComparison
31
- } from "./chunk-MBT3ASYV.js";
31
+ } from "./chunk-TA4LQ5SR.js";
32
32
  import "./chunk-DDRNDPX4.js";
33
33
  import "./chunk-7HYPN2GC.js";
34
34
  import "./chunk-666A3MOW.js";
35
35
  import "./chunk-HHLLAQGZ.js";
36
- import "./chunk-D2B22JDF.js";
36
+ import "./chunk-UWK5OXUJ.js";
37
+ import "./chunk-WEPMT6SC.js";
38
+ import "./chunk-5VDJMYTF.js";
39
+ import "./chunk-HP5FMB6L.js";
37
40
  import "./chunk-7N4KAIGN.js";
38
41
  import "./chunk-TPDBFYEG.js";
39
42
  import "./chunk-KCYE2MZM.js";
40
43
  import "./chunk-MAV46GWQ.js";
41
- import "./chunk-5VDJMYTF.js";
42
- import "./chunk-UWK5OXUJ.js";
43
44
  import "./chunk-TECVW3JP.js";
44
45
  import "./chunk-T2PO5MUF.js";
45
- import "./chunk-HP5FMB6L.js";
46
46
  import "./chunk-Z3PZRDLW.js";
47
47
  import "./chunk-DRD2Q7HQ.js";
48
48
  import "./chunk-LXOM6IQU.js";
49
+ import "./chunk-VOUOLGIP.js";
49
50
  import "./chunk-S75M5ZRK.js";
50
51
  import "./chunk-ECZU5BJH.js";
51
52
  import "./chunk-UHGBNIOS.js";
53
+ import "./chunk-IMWFHBG2.js";
54
+ import "./chunk-XJNBEDFE.js";
52
55
  import "./chunk-VWT3F4IV.js";
53
56
  import "./chunk-YTWNKQ2G.js";
54
57
  import "./chunk-MDYG7VI7.js";
55
- import "./chunk-VOUOLGIP.js";
56
- import "./chunk-Y2XKJJEI.js";
57
- import "./chunk-XJNBEDFE.js";
58
58
  import "./chunk-MHQC2WU2.js";
59
59
  import "./chunk-OZKZ2TRP.js";
60
60
  import "./chunk-6GC5SGFE.js";
@@ -107,7 +107,8 @@ import "./chunk-UMKPSD35.js";
107
107
  import "./chunk-W4RVMTHR.js";
108
108
  import "./chunk-4BISW7RX.js";
109
109
  import "./chunk-ZRWB5D4H.js";
110
- import "./chunk-IHG27THY.js";
110
+ import "./chunk-XUGQQPGO.js";
111
+ import "./chunk-S4DDLTPX.js";
111
112
  import "./chunk-SFQ6QNL7.js";
112
113
  import "./chunk-D6WVJIS3.js";
113
114
  import "./chunk-KFY3SGN7.js";
@@ -145,14 +146,14 @@ import "./chunk-5RIRL3XL.js";
145
146
  import "./chunk-JGSKJHF7.js";
146
147
  import "./chunk-FF4KLI5W.js";
147
148
  import "./chunk-BEMWL2FZ.js";
148
- import "./chunk-HRXCPKN4.js";
149
- import "./chunk-KVUG7FF7.js";
149
+ import "./chunk-APWJRJFW.js";
150
+ import "./chunk-U55D5UD5.js";
151
+ import "./chunk-CYEPCZN5.js";
152
+ import "./chunk-DCGT4FPP.js";
150
153
  import "./chunk-JOASJWQR.js";
151
154
  import "./chunk-RN7MUWON.js";
152
155
  import "./chunk-3MAONBX3.js";
153
156
  import "./chunk-RG3LBSGH.js";
154
- import "./chunk-CYEPCZN5.js";
155
- import "./chunk-DCGT4FPP.js";
156
157
  import "./chunk-Q4CAQGKQ.js";
157
158
  import "./chunk-CINZGPSJ.js";
158
159
  import "./chunk-ZFXCQPNO.js";
@@ -4,9 +4,10 @@ import {
4
4
  recordResumeBundle,
5
5
  resolveResumeBundleDir,
6
6
  validateResumeBundle
7
- } from "./chunk-3SF7QNKF.js";
7
+ } from "./chunk-6BNFVP7Y.js";
8
8
  import "./chunk-ZRWB5D4H.js";
9
- import "./chunk-IHG27THY.js";
9
+ import "./chunk-XUGQQPGO.js";
10
+ import "./chunk-S4DDLTPX.js";
10
11
  import "./chunk-KFY3SGN7.js";
11
12
  import "./chunk-LMDRGRJ2.js";
12
13
  import "./chunk-C63WC454.js";
package/dist/schemas.d.ts CHANGED
@@ -275,12 +275,12 @@ declare const EntityMentionSchema: z.ZodObject<{
275
275
  title: z.ZodString;
276
276
  facts: z.ZodArray<z.ZodString, "many">;
277
277
  }, "strip", z.ZodTypeAny, {
278
- title: string;
279
278
  key: string;
279
+ title: string;
280
280
  facts: string[];
281
281
  }, {
282
- title: string;
283
282
  key: string;
283
+ title: string;
284
284
  facts: string[];
285
285
  }>, "many">>>;
286
286
  }, "strip", z.ZodTypeAny, {
@@ -288,8 +288,8 @@ declare const EntityMentionSchema: z.ZodObject<{
288
288
  name: string;
289
289
  facts: string[];
290
290
  structuredSections?: {
291
- title: string;
292
291
  key: string;
292
+ title: string;
293
293
  facts: string[];
294
294
  }[] | null | undefined;
295
295
  promptedByQuestion?: string | null | undefined;
@@ -298,8 +298,8 @@ declare const EntityMentionSchema: z.ZodObject<{
298
298
  name: string;
299
299
  facts: string[];
300
300
  structuredSections?: {
301
- title: string;
302
301
  key: string;
302
+ title: string;
303
303
  facts: string[];
304
304
  }[] | null | undefined;
305
305
  promptedByQuestion?: string | null | undefined;
@@ -584,12 +584,12 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
584
584
  title: z.ZodString;
585
585
  facts: z.ZodArray<z.ZodString, "many">;
586
586
  }, "strip", z.ZodTypeAny, {
587
- title: string;
588
587
  key: string;
588
+ title: string;
589
589
  facts: string[];
590
590
  }, {
591
- title: string;
592
591
  key: string;
592
+ title: string;
593
593
  facts: string[];
594
594
  }>, "many">>>;
595
595
  }, "strip", z.ZodTypeAny, {
@@ -597,8 +597,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
597
597
  name: string;
598
598
  facts: string[];
599
599
  structuredSections?: {
600
- title: string;
601
600
  key: string;
601
+ title: string;
602
602
  facts: string[];
603
603
  }[] | null | undefined;
604
604
  promptedByQuestion?: string | null | undefined;
@@ -607,8 +607,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
607
607
  name: string;
608
608
  facts: string[];
609
609
  structuredSections?: {
610
- title: string;
611
610
  key: string;
611
+ title: string;
612
612
  facts: string[];
613
613
  }[] | null | undefined;
614
614
  promptedByQuestion?: string | null | undefined;
@@ -665,8 +665,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
665
665
  name: string;
666
666
  facts: string[];
667
667
  structuredSections?: {
668
- title: string;
669
668
  key: string;
669
+ title: string;
670
670
  facts: string[];
671
671
  }[] | null | undefined;
672
672
  promptedByQuestion?: string | null | undefined;
@@ -714,8 +714,8 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
714
714
  name: string;
715
715
  facts: string[];
716
716
  structuredSections?: {
717
- title: string;
718
717
  key: string;
718
+ title: string;
719
719
  facts: string[];
720
720
  }[] | null | undefined;
721
721
  promptedByQuestion?: string | null | undefined;
@@ -952,12 +952,12 @@ declare const ExtractionResultSchema: z.ZodObject<{
952
952
  title: z.ZodString;
953
953
  facts: z.ZodArray<z.ZodString, "many">;
954
954
  }, "strip", z.ZodTypeAny, {
955
- title: string;
956
955
  key: string;
956
+ title: string;
957
957
  facts: string[];
958
958
  }, {
959
- title: string;
960
959
  key: string;
960
+ title: string;
961
961
  facts: string[];
962
962
  }>, "many">>>;
963
963
  }, "strip", z.ZodTypeAny, {
@@ -965,8 +965,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
965
965
  name: string;
966
966
  facts: string[];
967
967
  structuredSections?: {
968
- title: string;
969
968
  key: string;
969
+ title: string;
970
970
  facts: string[];
971
971
  }[] | null | undefined;
972
972
  promptedByQuestion?: string | null | undefined;
@@ -975,8 +975,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
975
975
  name: string;
976
976
  facts: string[];
977
977
  structuredSections?: {
978
- title: string;
979
978
  key: string;
979
+ title: string;
980
980
  facts: string[];
981
981
  }[] | null | undefined;
982
982
  promptedByQuestion?: string | null | undefined;
@@ -1047,8 +1047,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
1047
1047
  name: string;
1048
1048
  facts: string[];
1049
1049
  structuredSections?: {
1050
- title: string;
1051
1050
  key: string;
1051
+ title: string;
1052
1052
  facts: string[];
1053
1053
  }[] | null | undefined;
1054
1054
  promptedByQuestion?: string | null | undefined;
@@ -1102,8 +1102,8 @@ declare const ExtractionResultSchema: z.ZodObject<{
1102
1102
  name: string;
1103
1103
  facts: string[];
1104
1104
  structuredSections?: {
1105
- title: string;
1106
1105
  key: string;
1106
+ title: string;
1107
1107
  facts: string[];
1108
1108
  }[] | null | undefined;
1109
1109
  promptedByQuestion?: string | null | undefined;
@@ -1172,12 +1172,12 @@ declare const ConsolidationResultSchema: z.ZodObject<{
1172
1172
  title: z.ZodString;
1173
1173
  facts: z.ZodArray<z.ZodString, "many">;
1174
1174
  }, "strip", z.ZodTypeAny, {
1175
- title: string;
1176
1175
  key: string;
1176
+ title: string;
1177
1177
  facts: string[];
1178
1178
  }, {
1179
- title: string;
1180
1179
  key: string;
1180
+ title: string;
1181
1181
  facts: string[];
1182
1182
  }>, "many">>>;
1183
1183
  }, "strip", z.ZodTypeAny, {
@@ -1185,8 +1185,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
1185
1185
  name: string;
1186
1186
  facts: string[];
1187
1187
  structuredSections?: {
1188
- title: string;
1189
1188
  key: string;
1189
+ title: string;
1190
1190
  facts: string[];
1191
1191
  }[] | null | undefined;
1192
1192
  promptedByQuestion?: string | null | undefined;
@@ -1195,8 +1195,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
1195
1195
  name: string;
1196
1196
  facts: string[];
1197
1197
  structuredSections?: {
1198
- title: string;
1199
1198
  key: string;
1199
+ title: string;
1200
1200
  facts: string[];
1201
1201
  }[] | null | undefined;
1202
1202
  promptedByQuestion?: string | null | undefined;
@@ -1215,8 +1215,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
1215
1215
  name: string;
1216
1216
  facts: string[];
1217
1217
  structuredSections?: {
1218
- title: string;
1219
1218
  key: string;
1219
+ title: string;
1220
1220
  facts: string[];
1221
1221
  }[] | null | undefined;
1222
1222
  promptedByQuestion?: string | null | undefined;
@@ -1235,8 +1235,8 @@ declare const ConsolidationResultSchema: z.ZodObject<{
1235
1235
  name: string;
1236
1236
  facts: string[];
1237
1237
  structuredSections?: {
1238
- title: string;
1239
1238
  key: string;
1239
+ title: string;
1240
1240
  facts: string[];
1241
1241
  }[] | null | undefined;
1242
1242
  promptedByQuestion?: string | null | undefined;
@@ -2,13 +2,13 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-KVUG7FF7.js";
5
+ } from "../chunk-U55D5UD5.js";
6
+ import "../chunk-CYEPCZN5.js";
7
+ import "../chunk-DCGT4FPP.js";
6
8
  import "../chunk-JOASJWQR.js";
7
9
  import "../chunk-RN7MUWON.js";
8
10
  import "../chunk-3MAONBX3.js";
9
11
  import "../chunk-RG3LBSGH.js";
10
- import "../chunk-CYEPCZN5.js";
11
- import "../chunk-DCGT4FPP.js";
12
12
  import "../chunk-Q4CAQGKQ.js";
13
13
  import "../chunk-CINZGPSJ.js";
14
14
  import "../chunk-7OGJQP7T.js";
@@ -2,7 +2,13 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-KVUG7FF7.js";
5
+ } from "../chunk-U55D5UD5.js";
6
+ import {
7
+ NoopSearchBackend
8
+ } from "../chunk-CYEPCZN5.js";
9
+ import {
10
+ OramaBackend
11
+ } from "../chunk-DCGT4FPP.js";
6
12
  import {
7
13
  RemoteSearchBackend
8
14
  } from "../chunk-JOASJWQR.js";
@@ -15,12 +21,6 @@ import {
15
21
  import {
16
22
  MeilisearchBackend
17
23
  } from "../chunk-RG3LBSGH.js";
18
- import {
19
- NoopSearchBackend
20
- } from "../chunk-CYEPCZN5.js";
21
- import {
22
- OramaBackend
23
- } from "../chunk-DCGT4FPP.js";
24
24
  import {
25
25
  scanMemoryDir
26
26
  } from "../chunk-Q4CAQGKQ.js";
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Shared session-identity / transcript-pathing layer (issue #1496).
3
+ *
4
+ * This module is the SINGLE source of truth for turning a `sessionKey` into a
5
+ * channel identity and a set of deterministic, collision-resistant storage
6
+ * paths. Every subsystem that previously re-parsed session keys (transcript
7
+ * pathing, tool-usage pathing, hourly summaries, session auditing, conversation
8
+ * indexing) MUST route through `parseSessionIdentity()` / `sessionStoragePaths()`
9
+ * so behavior stays identical across paths (rule #22, #39).
10
+ *
11
+ * Two shapes are recognized:
12
+ *
13
+ * 1. Legacy `agent:<agentId>:<channelType>:...` keys keep their existing
14
+ * readable channel identity:
15
+ * - agent:<id>:main → type="main", id="default"
16
+ * - agent:<id>:discord:channel:<chanId> → type="discord", id="<chanId>"
17
+ * - agent:<id>:slack:channel:<chanId> → type="slack", id="<chanId>"
18
+ * - agent:<id>:cron:<jobId> → type="cron", id="<jobId>"
19
+ * - agent:<id>:<other>[:<id>] → type="<other>", id="<id?>"
20
+ *
21
+ * 2. Arbitrary / non-legacy keys (e.g. `pi-geek:abc123`) become first-class
22
+ * from the FIRST write — they NEVER start life under `other/default`:
23
+ * channelType = "session"
24
+ * channelId = storagePathHash(sessionKey) (collision-resistant)
25
+ * yielding `transcripts/session/<hash>/YYYY-MM-DD.jsonl`.
26
+ *
27
+ * The reserved `"session"` channel type is what makes arbitrary keys isolated
28
+ * and auditable. Legacy data under `other/default` (and any legacy channel
29
+ * directory) remains READABLE via `legacyDir` / `alternateDir` candidates.
30
+ */
31
+ /** Channel type reserved for first-class arbitrary (non-legacy) session keys. */
32
+ declare const SESSION_CHANNEL_TYPE = "session";
33
+ /** Legacy fallback channel identity for un-parseable keys (read-back only). */
34
+ declare const LEGACY_FALLBACK_CHANNEL_TYPE = "other";
35
+ declare const LEGACY_FALLBACK_CHANNEL_ID = "default";
36
+ interface SessionIdentity {
37
+ /** Channel type — legacy channel type for known shapes, else `"session"`. */
38
+ channelType: string;
39
+ /** Channel id — legacy channel id for known shapes, else the key hash. */
40
+ channelId: string;
41
+ /** Human-readable, non-authoritative label derived from the raw key. */
42
+ displayLabel: string;
43
+ /** The original session key, unchanged. */
44
+ canonicalSessionKey: string;
45
+ /** True when the key matched a known legacy `agent:<id>:...` shape. */
46
+ legacy: boolean;
47
+ }
48
+ interface SessionStoragePaths {
49
+ /** Channel type (mirrors {@link SessionIdentity.channelType}). */
50
+ channelType: string;
51
+ /** Channel id (mirrors {@link SessionIdentity.channelId}). */
52
+ channelId: string;
53
+ /** Primary encoded storage subdirectory: `<encodedType>/<encodedId>`. */
54
+ dir: string;
55
+ /**
56
+ * Collision-resistant alternate subdirectory that always embeds the full
57
+ * session-key hash. Used both as a write-time collision escape hatch and as a
58
+ * read-back candidate for data written before this layer existed.
59
+ */
60
+ alternateDir: string;
61
+ /**
62
+ * Un-encoded `<type>/<id>` directory for reading data written by older
63
+ * builds that did not URL-encode path segments. Undefined when it would be
64
+ * identical to `dir` or when either segment is path-unsafe.
65
+ */
66
+ legacyDir?: string;
67
+ /**
68
+ * Ordered, de-duplicated list of READ-BACK-ONLY directories where an older
69
+ * build may have stranded this key's data. NEW writes never target these —
70
+ * they exist purely so pre-#1496 transcripts/tool-usage stay discoverable
71
+ * (and migratable). Populated only for non-legacy keys. Includes:
72
+ * 1. the shared `other/default` fallback (every arbitrary key landed here);
73
+ * 2. the directory the OLD `parts.length >= 3` parser would have chosen
74
+ * (e.g. `foo:bar:baz` → `baz/default`, `foo:bar:baz:qux` → `baz/qux`).
75
+ * See {@link legacyParserReadbackDir}.
76
+ */
77
+ readbackDirs: string[];
78
+ }
79
+ /**
80
+ * Parse a session key into a stable channel identity.
81
+ *
82
+ * Pure and deterministic — no filesystem access. Same input always yields the
83
+ * same identity, which is what makes arbitrary keys collision-resistant from
84
+ * the first write.
85
+ */
86
+ declare function parseSessionIdentity(sessionKey: string): SessionIdentity;
87
+ /**
88
+ * Resolve the storage path pieces for a session key. Wraps
89
+ * {@link parseSessionIdentity} so transcript, tool-usage, and summary writers
90
+ * share one implementation (rule #22).
91
+ */
92
+ declare function sessionStoragePaths(sessionKey: string): SessionStoragePaths;
93
+ /**
94
+ * The shared `other/default` directory every arbitrary key was routed into by
95
+ * builds predating issue #1496. Exposed so transcript/tool-usage/summary read
96
+ * paths and the migration scanner all agree on the same fallback location.
97
+ */
98
+ declare const OTHER_DEFAULT_READBACK_DIR: string;
99
+ /**
100
+ * Reconstruct the transcript/tool-usage directory the OLD `getTranscriptPath`
101
+ * parser (pre-#1496) would have produced for a key the NEW parser reclassifies
102
+ * as a first-class `session/<hash>` identity.
103
+ *
104
+ * The OLD parser treated ANY key with `parts.length >= 3` as legacy — it did
105
+ * NOT require a leading `agent` segment — so an arbitrary key like
106
+ * `foo:bar:baz` was stored under `baz/default` and `foo:bar:baz:qux` under
107
+ * `baz/qux`. Those directories must stay readable (and migratable) for existing
108
+ * installs even though the key now writes to `session/<hash>` (Thread B / codex
109
+ * review on PR #1504). Path segments are encoded exactly as the old `dir` was
110
+ * built (`encodeStoragePathSegment`) so the candidate matches the bytes on disk.
111
+ *
112
+ * Returns `undefined` when the key has fewer than three colon parts (the old
113
+ * parser would have used the `other/default` fallback, already covered), when
114
+ * the channel type is empty, or when the result is unsafe.
115
+ */
116
+ declare function legacyParserReadbackDir(sessionKey: string): string | undefined;
117
+
118
+ export { LEGACY_FALLBACK_CHANNEL_ID, LEGACY_FALLBACK_CHANNEL_TYPE, OTHER_DEFAULT_READBACK_DIR, SESSION_CHANNEL_TYPE, type SessionIdentity, type SessionStoragePaths, legacyParserReadbackDir, parseSessionIdentity, sessionStoragePaths };
@@ -0,0 +1,21 @@
1
+ import {
2
+ LEGACY_FALLBACK_CHANNEL_ID,
3
+ LEGACY_FALLBACK_CHANNEL_TYPE,
4
+ OTHER_DEFAULT_READBACK_DIR,
5
+ SESSION_CHANNEL_TYPE,
6
+ legacyParserReadbackDir,
7
+ parseSessionIdentity,
8
+ sessionStoragePaths
9
+ } from "./chunk-S4DDLTPX.js";
10
+ import "./chunk-FF4KLI5W.js";
11
+ import "./chunk-PZ5AY32C.js";
12
+ export {
13
+ LEGACY_FALLBACK_CHANNEL_ID,
14
+ LEGACY_FALLBACK_CHANNEL_TYPE,
15
+ OTHER_DEFAULT_READBACK_DIR,
16
+ SESSION_CHANNEL_TYPE,
17
+ legacyParserReadbackDir,
18
+ parseSessionIdentity,
19
+ sessionStoragePaths
20
+ };
21
+ //# sourceMappingURL=session-identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,65 @@
1
+ interface SessionMigrationEntryGroup {
2
+ /** The distinct session key these lines belong to. */
3
+ sessionKey: string;
4
+ /** Whether this key is a recognized legacy `agent:<id>:...` shape. */
5
+ legacy: boolean;
6
+ /** Destination directory (relative to the transcripts root). */
7
+ destDir: string;
8
+ /** Number of JSONL entries that will move. */
9
+ entryCount: number;
10
+ }
11
+ interface SessionMigrationFilePlan {
12
+ /** Source file path (relative to transcripts root). */
13
+ sourceRelPath: string;
14
+ /** The date-stamped file name (e.g. `2026-06-29.jsonl`). */
15
+ fileName: string;
16
+ /** Distinct session groups discovered inside this source file. */
17
+ groups: SessionMigrationEntryGroup[];
18
+ /** Lines that could not be parsed as JSON or lacked a sessionKey. */
19
+ unmovableLines: number;
20
+ /**
21
+ * True when EVERY entry in the file already belongs in the source directory
22
+ * (nothing to do). Such files are skipped.
23
+ */
24
+ alreadyHomed: boolean;
25
+ }
26
+ interface SessionMigrationPlan {
27
+ generatedAt: string;
28
+ dryRun: boolean;
29
+ transcriptsDir: string;
30
+ /** Per-file plans that have at least one entry to move. */
31
+ files: SessionMigrationFilePlan[];
32
+ /** Distinct destination session keys across all files. */
33
+ distinctSessions: number;
34
+ /** Total entries that will be re-homed. */
35
+ movedEntries: number;
36
+ }
37
+ interface SessionMigrationResult {
38
+ plan: SessionMigrationPlan;
39
+ applied: boolean;
40
+ filesRewritten: number;
41
+ filesRemoved: number;
42
+ errors: string[];
43
+ manifestPath?: string;
44
+ }
45
+ interface MigrateSessionTranscriptsOptions {
46
+ /** The memory directory root (transcripts live under `<memoryDir>/transcripts`). */
47
+ memoryDir: string;
48
+ /** When true, perform the migration; otherwise produce a dry-run plan only. */
49
+ apply?: boolean;
50
+ }
51
+ /**
52
+ * Compute the migration plan without modifying anything.
53
+ */
54
+ declare function planSessionTranscriptMigration(options: MigrateSessionTranscriptsOptions): Promise<SessionMigrationPlan>;
55
+ /**
56
+ * Run the migration. Dry-run by default; pass `apply: true` to mutate.
57
+ */
58
+ declare function migrateSessionTranscripts(options: MigrateSessionTranscriptsOptions): Promise<SessionMigrationResult>;
59
+ /** Best-effort byte-size summary for reporting (used by CLI output). */
60
+ declare function summarizeMigrationSources(memoryDir: string): Promise<{
61
+ files: number;
62
+ bytes: number;
63
+ }>;
64
+
65
+ export { type MigrateSessionTranscriptsOptions, type SessionMigrationEntryGroup, type SessionMigrationFilePlan, type SessionMigrationPlan, type SessionMigrationResult, migrateSessionTranscripts, planSessionTranscriptMigration, summarizeMigrationSources };
@@ -0,0 +1,16 @@
1
+ import {
2
+ migrateSessionTranscripts,
3
+ planSessionTranscriptMigration,
4
+ summarizeMigrationSources
5
+ } from "./chunk-EVWIEEKZ.js";
6
+ import "./chunk-S4DDLTPX.js";
7
+ import "./chunk-FF4KLI5W.js";
8
+ import "./chunk-6KYMPV2O.js";
9
+ import "./chunk-2ODBA7MQ.js";
10
+ import "./chunk-PZ5AY32C.js";
11
+ export {
12
+ migrateSessionTranscripts,
13
+ planSessionTranscriptMigration,
14
+ summarizeMigrationSources
15
+ };
16
+ //# sourceMappingURL=session-transcript-migration.js.map