keri-ts 0.2.3 → 0.3.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 (282) hide show
  1. package/README.md +57 -8
  2. package/esm/app/cli/agent.js +0 -19
  3. package/esm/app/cli/annotate.js +7 -2
  4. package/esm/app/cli/benchmark.js +210 -0
  5. package/esm/app/cli/cli.js +50 -52
  6. package/esm/app/cli/command-definitions.js +258 -6
  7. package/esm/app/cli/common/existing.js +40 -0
  8. package/esm/app/cli/common/parsing.js +20 -0
  9. package/esm/app/cli/export.js +51 -0
  10. package/esm/app/cli/incept.js +106 -0
  11. package/esm/app/cli/index.js +2 -0
  12. package/esm/app/cli/init.js +72 -41
  13. package/esm/app/configing.js +261 -0
  14. package/esm/app/habbing.js +386 -0
  15. package/esm/app/index.js +3 -0
  16. package/esm/app/keeping.js +321 -0
  17. package/esm/app/version.js +2 -2
  18. package/esm/db/basing.js +66 -1
  19. package/esm/db/core/lmdber.js +13 -7
  20. package/esm/db/core/path-manager.js +193 -169
  21. package/esm/db/index.js +1 -0
  22. package/esm/db/keeping.js +214 -0
  23. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js +12 -0
  24. package/esm/deps/jsr.io/@std/internal/1.0.12/os.js +5 -0
  25. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +7 -0
  26. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js +40 -0
  27. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.js +23 -0
  28. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js +46 -0
  29. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +8 -0
  30. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.js +19 -0
  31. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +9 -0
  32. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +235 -0
  33. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +8 -0
  34. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +77 -0
  35. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.js +9 -0
  36. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +19 -0
  37. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +15 -0
  38. package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +35 -0
  39. package/esm/deps/jsr.io/@std/path/1.1.4/common.js +33 -0
  40. package/esm/deps/jsr.io/@std/path/1.1.4/constants.js +17 -0
  41. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js +28 -0
  42. package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +28 -0
  43. package/esm/deps/jsr.io/@std/path/1.1.4/format.js +27 -0
  44. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js +28 -0
  45. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +83 -0
  46. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +28 -0
  47. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.js +42 -0
  48. package/esm/deps/jsr.io/@std/path/1.1.4/join.js +29 -0
  49. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js +34 -0
  50. package/esm/deps/jsr.io/@std/path/1.1.4/mod.js +216 -0
  51. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js +32 -0
  52. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +35 -0
  53. package/esm/deps/jsr.io/@std/path/1.1.4/parse.js +39 -0
  54. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js +8 -0
  55. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js +52 -0
  56. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.js +14 -0
  57. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +64 -0
  58. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js +93 -0
  59. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.js +28 -0
  60. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +21 -0
  61. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +82 -0
  62. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +23 -0
  63. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js +45 -0
  64. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +40 -0
  65. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +58 -0
  66. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +32 -0
  67. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.js +115 -0
  68. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.js +106 -0
  69. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +59 -0
  70. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +27 -0
  71. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +20 -0
  72. package/esm/deps/jsr.io/@std/path/1.1.4/relative.js +30 -0
  73. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js +30 -0
  74. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +28 -0
  75. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +29 -0
  76. package/esm/deps/jsr.io/@std/path/1.1.4/types.js +3 -0
  77. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js +15 -0
  78. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js +47 -0
  79. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.js +14 -0
  80. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +113 -0
  81. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js +82 -0
  82. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.js +28 -0
  83. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +30 -0
  84. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +82 -0
  85. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +38 -0
  86. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js +77 -0
  87. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +41 -0
  88. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +135 -0
  89. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +32 -0
  90. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.js +176 -0
  91. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.js +131 -0
  92. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +154 -0
  93. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +34 -0
  94. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +49 -0
  95. package/package.json +4 -2
  96. package/types/app/cli/agent.d.ts.map +1 -1
  97. package/types/app/cli/annotate.d.ts.map +1 -1
  98. package/types/app/cli/benchmark.d.ts +11 -0
  99. package/types/app/cli/benchmark.d.ts.map +1 -0
  100. package/types/app/cli/cli.d.ts.map +1 -1
  101. package/types/app/cli/command-definitions.d.ts +5 -2
  102. package/types/app/cli/command-definitions.d.ts.map +1 -1
  103. package/types/app/cli/command-types.d.ts +12 -0
  104. package/types/app/cli/command-types.d.ts.map +1 -1
  105. package/types/app/cli/common/existing.d.ts +4 -0
  106. package/types/app/cli/common/existing.d.ts.map +1 -0
  107. package/types/app/cli/common/parsing.d.ts +15 -0
  108. package/types/app/cli/common/parsing.d.ts.map +1 -0
  109. package/types/app/cli/export.d.ts +8 -0
  110. package/types/app/cli/export.d.ts.map +1 -0
  111. package/types/app/cli/incept.d.ts +8 -0
  112. package/types/app/cli/incept.d.ts.map +1 -0
  113. package/types/app/cli/index.d.ts +2 -0
  114. package/types/app/cli/index.d.ts.map +1 -1
  115. package/types/app/cli/init.d.ts +5 -0
  116. package/types/app/cli/init.d.ts.map +1 -1
  117. package/types/app/configing.d.ts +57 -0
  118. package/types/app/configing.d.ts.map +1 -0
  119. package/types/app/habbing.d.ts +107 -0
  120. package/types/app/habbing.d.ts.map +1 -0
  121. package/types/app/index.d.ts +3 -0
  122. package/types/app/index.d.ts.map +1 -1
  123. package/types/app/keeping.d.ts +72 -0
  124. package/types/app/keeping.d.ts.map +1 -0
  125. package/types/app/version.d.ts +2 -2
  126. package/types/db/basing.d.ts +16 -1
  127. package/types/db/basing.d.ts.map +1 -1
  128. package/types/db/core/lmdber.d.ts +8 -4
  129. package/types/db/core/lmdber.d.ts.map +1 -1
  130. package/types/db/core/path-manager.d.ts +88 -24
  131. package/types/db/core/path-manager.d.ts.map +1 -1
  132. package/types/db/index.d.ts +1 -0
  133. package/types/db/index.d.ts.map +1 -1
  134. package/types/db/keeping.d.ts +73 -0
  135. package/types/db/keeping.d.ts.map +1 -0
  136. package/types/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
  137. package/types/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
  138. package/types/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
  139. package/types/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
  140. package/types/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
  141. package/types/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
  142. package/types/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
  143. package/types/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
  144. package/types/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
  145. package/types/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
  146. package/types/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
  147. package/types/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
  148. package/types/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
  149. package/types/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
  150. package/types/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
  151. package/types/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
  152. package/types/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
  153. package/types/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
  154. package/types/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
  155. package/types/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
  156. package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
  157. package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
  158. package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
  159. package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
  160. package/types/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
  161. package/types/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
  162. package/types/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
  163. package/types/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
  164. package/types/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
  165. package/types/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
  166. package/types/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
  167. package/types/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
  168. package/types/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
  169. package/types/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
  170. package/types/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
  171. package/types/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
  172. package/types/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
  173. package/types/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
  174. package/types/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
  175. package/types/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
  176. package/types/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
  177. package/types/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
  178. package/types/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
  179. package/types/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
  180. package/types/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
  181. package/types/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
  182. package/types/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
  183. package/types/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
  184. package/types/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
  185. package/types/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
  186. package/types/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
  187. package/types/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
  188. package/types/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
  189. package/types/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
  190. package/types/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
  191. package/types/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
  192. package/types/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
  193. package/types/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
  194. package/types/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
  195. package/types/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
  196. package/types/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
  197. package/types/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
  198. package/types/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
  199. package/types/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
  200. package/types/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
  201. package/types/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
  202. package/types/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
  203. package/types/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
  204. package/types/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
  205. package/types/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
  206. package/types/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
  207. package/types/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
  208. package/types/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
  209. package/types/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
  210. package/types/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
  211. package/types/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
  212. package/types/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
  213. package/types/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
  214. package/types/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
  215. package/types/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
  216. package/types/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
  217. package/types/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
  218. package/types/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
  219. package/types/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
  220. package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
  221. package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
  222. package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
  223. package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
  224. package/types/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
  225. package/types/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
  226. package/types/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
  227. package/types/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
  228. package/types/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
  229. package/types/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
  230. package/types/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
  231. package/types/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
  232. package/types/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
  233. package/types/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
  234. package/types/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
  235. package/types/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
  236. package/types/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
  237. package/types/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
  238. package/types/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
  239. package/types/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
  240. package/types/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
  241. package/types/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
  242. package/types/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
  243. package/types/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
  244. package/types/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
  245. package/types/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
  246. package/types/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
  247. package/types/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
  248. package/types/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
  249. package/types/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
  250. package/types/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
  251. package/types/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
  252. package/types/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
  253. package/types/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
  254. package/types/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
  255. package/types/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
  256. package/types/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
  257. package/types/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
  258. package/types/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
  259. package/types/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
  260. package/types/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
  261. package/types/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
  262. package/types/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
  263. package/types/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
  264. package/types/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
  265. package/types/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
  266. package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
  267. package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
  268. package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
  269. package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
  270. package/types/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
  271. package/types/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
  272. package/types/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
  273. package/types/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
  274. package/types/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
  275. package/types/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
  276. package/types/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
  277. package/types/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
  278. package/types/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
  279. package/types/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
  280. package/esm/app/cli/stub-commands.js +0 -61
  281. package/types/app/cli/stub-commands.d.ts +0 -6
  282. package/types/app/cli/stub-commands.d.ts.map +0 -1
@@ -6,15 +6,17 @@
6
6
  */
7
7
  import * as dntShim from "../../_dnt.shims.js";
8
8
  import { action } from "effection";
9
+ import { isAbsolute, join } from "../../deps/jsr.io/@std/path/1.1.4/mod.js";
9
10
  import { InvalidPathNameError, PathError } from "../../core/errors.js";
10
11
  import { consoleLogger } from "../../core/logger.js";
12
+ /** Defaults for the path manager */
11
13
  export const PATH_DEFAULTS = {
12
14
  headDirPath: "/usr/local/var",
13
15
  tailDirPath: "keri/db",
14
16
  cleanTailDirPath: "keri/clean/db",
15
17
  altHeadDirPath: "~",
16
- altTailDirPath: ".keri/db",
17
- altCleanTailDirPath: ".keri/clean/db",
18
+ altTailDirPath: ".tufa/db",
19
+ altCleanTailDirPath: ".tufa/clean/db",
18
20
  tempHeadDir: "/tmp",
19
21
  tempPrefix: "keri_lmdb_",
20
22
  tempSuffix: "_test",
@@ -24,11 +26,31 @@ export const PATH_DEFAULTS = {
24
26
  };
25
27
  /**
26
28
  * PathManager manages file and directory paths
29
+ *
30
+ * Main file paths:
31
+ * - persistent path: /{head}/{tail} /{base}/{name}
32
+ * - clean path: /{head}/{tail}/clean/{base}/{name}
33
+ * - alt path: /{altHead}/{altTail}/{base}/{name}
34
+ * - HOME (alt) path: ~/{altTail}/{base}/{name}
35
+ *
36
+ * Temp files:
37
+ * - temp path: /{tempPrefix}/{tempSuffix}{tempHead}
38
+ *
39
+ * The path manager will use the persistent path by default.
40
+ * If the persistent path does not exist, the path manager will use the alt path.
41
+ * If the alt path does not exist, the path manager will use the temp path.
42
+ *
43
+ * Temp files:
44
+ * If the temp path does not exist, the path manager will create it.
45
+ * If the temp path exists, the path manager will use it.
46
+ * If the temp path exists and is not a directory, the path manager will throw an error.
47
+ * If the temp path exists and is a directory, the path manager will use it.
48
+ * If the temp path exists and is a directory, the path manager will use it.
27
49
  */
28
50
  export class PathManager {
29
51
  constructor(options = {}, defaults) {
30
- // name of the path, dir or file name
31
- Object.defineProperty(this, "_name", {
52
+ // head directory path
53
+ Object.defineProperty(this, "headDirPath", {
32
54
  enumerable: true,
33
55
  configurable: true,
34
56
  writable: true,
@@ -41,15 +63,15 @@ export class PathManager {
41
63
  writable: true,
42
64
  value: void 0
43
65
  });
44
- // temporary directory flag
45
- Object.defineProperty(this, "temp", {
66
+ // name of the path, dir or file name
67
+ Object.defineProperty(this, "_name", {
46
68
  enumerable: true,
47
69
  configurable: true,
48
70
  writable: true,
49
71
  value: void 0
50
72
  });
51
- // head directory path
52
- Object.defineProperty(this, "headDirPath", {
73
+ // temporary directory flag
74
+ Object.defineProperty(this, "temp", {
53
75
  enumerable: true,
54
76
  configurable: true,
55
77
  writable: true,
@@ -62,48 +84,56 @@ export class PathManager {
62
84
  writable: true,
63
85
  value: void 0
64
86
  });
87
+ // numeric os dir permissions for database directory and database files
65
88
  Object.defineProperty(this, "perm", {
66
89
  enumerable: true,
67
90
  configurable: true,
68
91
  writable: true,
69
92
  value: void 0
70
93
  });
94
+ // true means path ends in file, false means path ends in directory
71
95
  Object.defineProperty(this, "filed", {
72
96
  enumerable: true,
73
97
  configurable: true,
74
98
  writable: true,
75
99
  value: void 0
76
100
  });
101
+ // true means ensure path ends with extension, false means do not ensure path ends with extension
77
102
  Object.defineProperty(this, "extensioned", {
78
103
  enumerable: true,
79
104
  configurable: true,
80
105
  writable: true,
81
106
  value: void 0
82
107
  });
108
+ // file open mode if filed
83
109
  Object.defineProperty(this, "mode", {
84
110
  enumerable: true,
85
111
  configurable: true,
86
112
  writable: true,
87
113
  value: void 0
88
114
  });
115
+ // file extension if filed
89
116
  Object.defineProperty(this, "fext", {
90
117
  enumerable: true,
91
118
  configurable: true,
92
119
  writable: true,
93
120
  value: void 0
94
121
  });
122
+ // true means directory created and if filed then file is opened
95
123
  Object.defineProperty(this, "opened", {
96
124
  enumerable: true,
97
125
  configurable: true,
98
126
  writable: true,
99
127
  value: void 0
100
128
  });
129
+ // defaults for the path manager
101
130
  Object.defineProperty(this, "defaults", {
102
131
  enumerable: true,
103
132
  configurable: true,
104
133
  writable: true,
105
134
  value: void 0
106
135
  });
136
+ // logger instance for logging
107
137
  Object.defineProperty(this, "logger", {
108
138
  enumerable: true,
109
139
  configurable: true,
@@ -131,8 +161,10 @@ export class PathManager {
131
161
  }
132
162
  set name(value) {
133
163
  // Check if path is absolute
134
- if (value.startsWith("/") || value.includes(":")) {
135
- throw new InvalidPathNameError(`Not relative name=${value} path.`, { name: value });
164
+ if (isAbsolute(value) || /^[a-zA-Z]:[\\/]/.test(value)) {
165
+ throw new InvalidPathNameError(`Not relative name=${value} path.`, {
166
+ name: value,
167
+ });
136
168
  }
137
169
  this._name = value;
138
170
  }
@@ -140,11 +172,29 @@ export class PathManager {
140
172
  const tempDir = dntShim.Deno.env.get("TMPDIR") || dntShim.Deno.env.get("TMP") ||
141
173
  dntShim.Deno.env.get("TEMP") || "/tmp";
142
174
  const tempName = `${this.defaults.tempPrefix}${this.name}${this.defaults.tempSuffix}`;
143
- return `${tempDir}/${tempName}`;
175
+ return join(tempDir, tempName);
176
+ }
177
+ /** Resolve user home directory with a Windows-aware fallback chain. */
178
+ _resolveHomeDir() {
179
+ const home = dntShim.Deno.env.get("HOME");
180
+ if (home) {
181
+ return home;
182
+ }
183
+ // Windows common environment variables
184
+ const userProfile = dntShim.Deno.env.get("USERPROFILE");
185
+ if (userProfile) {
186
+ return userProfile;
187
+ }
188
+ const homeDrive = dntShim.Deno.env.get("HOMEDRIVE");
189
+ const homePath = dntShim.Deno.env.get("HOMEPATH");
190
+ if (homeDrive && homePath) {
191
+ return `${homeDrive}${homePath}`;
192
+ }
193
+ return "~";
144
194
  }
145
195
  _pathExpandTilde(path) {
146
- if (path === "~" || path.startsWith("~/")) {
147
- const home = dntShim.Deno.env.get("HOME") || "~";
196
+ if (path === "~" || /^~[\\/]/.test(path)) {
197
+ const home = this._resolveHomeDir();
148
198
  return path === "~" ? home : path.replace("~", home);
149
199
  }
150
200
  return path;
@@ -161,12 +211,9 @@ export class PathManager {
161
211
  else {
162
212
  tail = this.defaults.tailDirPath;
163
213
  }
164
- const parts = [head, tail];
165
- if (this.base)
166
- parts.push(this.base);
167
- parts.push(this.name);
168
- const path = parts.join("/");
169
- return path;
214
+ return this.base
215
+ ? join(head, tail, this.base, this.name)
216
+ : join(head, tail, this.name);
170
217
  }
171
218
  _getAltPath(clean) {
172
219
  // HOME or ~ / tail / base / name
@@ -179,12 +226,9 @@ export class PathManager {
179
226
  else {
180
227
  tail = this.defaults.altTailDirPath;
181
228
  }
182
- const altParts = [head, tail];
183
- if (this.base)
184
- altParts.push(this.base);
185
- altParts.push(this.name);
186
- const path = altParts.join("/");
187
- return path;
229
+ return this.base
230
+ ? join(head, tail, this.base, this.name)
231
+ : join(head, tail, this.name);
188
232
  }
189
233
  /*
190
234
  * Creates a file path based on head, tail, base, and name. Ensure path is created and optionally reuse it.
@@ -207,7 +251,7 @@ export class PathManager {
207
251
  * Helper: Convert Promise-based file system operations to Effection operations
208
252
  * This ensures proper structured concurrency and cancellation support
209
253
  */
210
- *_statOp(path) {
254
+ *statOp(path) {
211
255
  return yield* action((resolve, reject) => {
212
256
  dntShim.Deno.stat(path)
213
257
  .then(() => resolve(true))
@@ -222,7 +266,7 @@ export class PathManager {
222
266
  return () => { };
223
267
  });
224
268
  }
225
- *_accessOp(path) {
269
+ *accessOp(path) {
226
270
  return yield* action((resolve, reject) => {
227
271
  // In Deno, we check access by stating or trying to read/write.
228
272
  // Simplified to checking existence and relying on OS permissions for now
@@ -232,7 +276,7 @@ export class PathManager {
232
276
  return () => { };
233
277
  });
234
278
  }
235
- *_mkdirOp(path, perm) {
279
+ *mkdirOp(path, perm) {
236
280
  return yield* action((resolve, reject) => {
237
281
  dntShim.Deno.mkdir(path, { recursive: true, mode: perm })
238
282
  .then(() => resolve(true))
@@ -247,7 +291,7 @@ export class PathManager {
247
291
  return () => { };
248
292
  });
249
293
  }
250
- *_rmOp(path) {
294
+ *rmOp(path) {
251
295
  return yield* action((resolve, reject) => {
252
296
  dntShim.Deno.remove(path, { recursive: true })
253
297
  .then(() => resolve(undefined))
@@ -262,7 +306,7 @@ export class PathManager {
262
306
  return () => { };
263
307
  });
264
308
  }
265
- *_statFileOp(path) {
309
+ *statFileOp(path) {
266
310
  return yield* action((resolve, reject) => {
267
311
  dntShim.Deno.stat(path)
268
312
  .then((stats) => {
@@ -286,148 +330,142 @@ export class PathManager {
286
330
  });
287
331
  }
288
332
  /**
289
- * Reopen/create the directory or file path
333
+ * Reopen/create the directory or file path.
290
334
  * Replicates KERIpy/HIO Filer.remake logic:
291
335
  * - Tries primary path (/usr/local/var/keri/*) first
292
- * - Falls back to alt path (~/.keri/*) on OS errors or access issues
336
+ * - Falls back to alt path (~/.tufa/*) on OS errors or access issues
293
337
  *
294
- * Uses Effection for structured concurrency:
295
- * - All file system operations are cancellable
296
- * - No dangling promises - operations tracked in Effection task tree
297
- * - Automatic cleanup if parent operation is halted
338
+ * Returns Effection Operation with true if path is created and accessible, false otherwise.
298
339
  */
299
340
  *reopen(options = {}) {
300
- const temp = options.temp ?? this.temp;
301
- let headDirPath = options.headDirPath ?? this.headDirPath;
302
- const perm = options.perm ?? this.perm;
303
- const clear = options.clear || false;
304
- const reuse = options.reuse || false;
341
+ this._applyOptions(options);
342
+ const headDirPath = options.headDirPath ?? this.headDirPath;
305
343
  const clean = options.clean || false;
306
- const mode = options.mode ?? this.mode;
307
- const fext = options.fext ?? this.fext;
308
- this.temp = temp;
309
- this.perm = perm;
310
- this.mode = mode;
311
- this.fext = fext;
312
- let path;
344
+ const reuse = options.reuse || false;
345
+ const clear = options.clear || false;
313
346
  const [primary, alt, tempPath] = this._getPaths({
314
347
  ...options,
315
348
  headDirPath,
316
349
  clean,
317
350
  });
318
- if (temp) {
319
- // Use temporary directory
320
- path = tempPath;
321
- }
322
- else {
323
- // Use persistent directory - try primary first, fall back to alt on error
324
- path = primary;
325
- let useAltPath = false;
326
- // Only attempt fallback if using default headDirPath (not a custom one)
327
- const usingDefaultHeadDir = headDirPath === this.defaults.headDirPath;
328
- if (!reuse && usingDefaultHeadDir) {
329
- // Check if path exists using Effection operation
330
- const pathExists = yield* this._statOp(path);
331
- if (!pathExists) {
332
- // Path doesn't exist, try to create it
333
- this.logger.info(`Creating directory at ${path}`);
334
- const created = yield* this._mkdirOp(path, perm);
335
- if (!created) {
336
- // Creation failed (e.g., EACCES) - fall back to alt path
337
- this.logger.warn(`Failed to create primary path, falling back to alt path`);
338
- useAltPath = true;
339
- path = alt;
340
- headDirPath = this.defaults.altHeadDirPath;
341
- }
342
- }
343
- // If we're using alt path, ensure it exists
344
- if (useAltPath) {
345
- const altPathExists = yield* this._statOp(path);
346
- if (!altPathExists) {
347
- // Alt path doesn't exist, create it
348
- this.logger.info(`Creating alt directory at ${path}`);
349
- const created = yield* this._mkdirOp(path, perm);
350
- if (!created) {
351
- // Even alt path creation failed - this is unexpected, but we'll continue
352
- this.logger.error(`Failed to create alt directory at ${path}`);
353
- throw new PathError(`Failed to create alt directory at ${path}`, { path });
354
- }
355
- }
356
- else {
357
- // Path exists, verify access
358
- const altHasAccess = yield* this._accessOp(path);
359
- if (!altHasAccess) {
360
- // Path exists but no access - this shouldn't happen for alt path, but log it
361
- this.logger.error(`Alt path exists but is not accessible: ${path}`);
362
- throw new PathError(`Alt path exists but is not accessible: ${path}`, { path });
363
- }
364
- }
365
- }
366
- }
367
- else if (reuse) {
368
- // Reuse mode - just verify the path exists and is accessible
369
- const pathExists = yield* this._statOp(path);
370
- const hasAccess = pathExists ? yield* this._accessOp(path) : false;
371
- if (!pathExists || !hasAccess) {
372
- // If reuse path doesn't work and we're using default, try alt
373
- if (usingDefaultHeadDir) {
374
- this.logger.info(`Reuse path not accessible, trying alt path`);
375
- path = alt;
376
- headDirPath = this.defaults.altHeadDirPath;
377
- const altPathExists = yield* this._statOp(path);
378
- const altHasAccess = altPathExists
379
- ? yield* this._accessOp(path)
380
- : false;
381
- if (!altPathExists) {
382
- // Alt path doesn't exist, create it
383
- this.logger.info(`Creating alt directory at ${path}`);
384
- const created = yield* this._mkdirOp(path, perm);
385
- if (!created) {
386
- this.logger.warn(`Warning: Failed to create alt directory at ${path}`);
387
- }
388
- }
389
- else if (!altHasAccess) {
390
- // Alt path exists but not accessible - unexpected but continue
391
- this.logger.warn(`Warning: Alt path exists but is not accessible: ${path}`);
392
- }
393
- }
394
- }
395
- }
396
- }
397
- // Update headDirPath if we fell back to alt
398
- this.headDirPath = headDirPath;
399
- // Clear if requested
351
+ const resolved = yield* this._resolvePath({
352
+ primary,
353
+ alt,
354
+ tempPath,
355
+ headDirPath,
356
+ reuse,
357
+ });
358
+ this.headDirPath = resolved.headDirPath;
400
359
  if (clear) {
401
- const pathStat = yield* this._statFileOp(path);
402
- if (pathStat && (pathStat.isDirectory || pathStat.isFile)) {
403
- yield* this._rmOp(path);
404
- }
360
+ yield* this._clearPath(resolved.path);
405
361
  }
406
- // Create directory if it doesn't exist (final check)
407
362
  if (!this.filed) {
408
- const pathExists = yield* this._statOp(path);
409
- if (!pathExists) {
410
- // Path doesn't exist, create it
411
- this.logger.info(`Creating directory at ${path}`);
412
- const created = yield* this._mkdirOp(path, perm);
413
- if (!created) {
414
- // Creation failed - this is unexpected at this point, but log it
415
- this.logger.warn(`Warning: Failed to create directory at ${path}`);
416
- }
417
- }
418
- else {
419
- // Path exists, verify we can access it
420
- const hasAccess = yield* this._accessOp(path);
421
- if (!hasAccess) {
422
- // Path exists but not accessible - unexpected but continue
423
- this.logger.warn(`Warning: Path exists but is not accessible: ${path}`);
424
- }
425
- }
363
+ yield* this._ensureDirectoryExists(resolved.path);
426
364
  }
427
- this.path = path;
365
+ this.path = resolved.path;
428
366
  this.opened = true;
429
367
  return this.opened;
430
368
  }
369
+ /** Update instance fields from caller-provided options. */
370
+ _applyOptions(options) {
371
+ this.temp = options.temp ?? this.temp;
372
+ this.perm = options.perm ?? this.perm;
373
+ this.mode = options.mode ?? this.mode;
374
+ this.fext = options.fext ?? this.fext;
375
+ }
376
+ /**
377
+ * Select which concrete path to use: temp, primary with alt fallback,
378
+ * reuse with alt fallback, or primary directly (custom headDirPath).
379
+ */
380
+ *_resolvePath(params) {
381
+ if (this.temp) {
382
+ return { path: params.tempPath, headDirPath: params.headDirPath };
383
+ }
384
+ if (params.reuse) {
385
+ return yield* this._reuseOrFallback(params.primary, params.alt, params.headDirPath);
386
+ }
387
+ return yield* this._createOrFallback(params.primary, params.alt, params.headDirPath);
388
+ }
389
+ /**
390
+ * Try to use or create the primary path. If creation fails (e.g. EACCES),
391
+ * fall back to the alt path. Throws if alt path also fails.
392
+ */
393
+ *_createOrFallback(primary, alt, headDirPath) {
394
+ const exists = yield* this.statOp(primary);
395
+ if (exists) {
396
+ return { path: primary, headDirPath };
397
+ }
398
+ this.logger.info(`Creating directory at ${primary}`);
399
+ const created = yield* this.mkdirOp(primary, this.perm);
400
+ if (created) {
401
+ return { path: primary, headDirPath };
402
+ }
403
+ this.logger.warn(`Failed to create primary path, falling back to alt path`);
404
+ const altReady = yield* this._ensurePathAccessible(alt);
405
+ if (!altReady) {
406
+ this.logger.error(`Alt path not available at ${alt}`);
407
+ throw new PathError(`Alt path not available at ${alt}`, { path: alt });
408
+ }
409
+ return { path: alt, headDirPath: this.defaults.altHeadDirPath };
410
+ }
411
+ /**
412
+ * Verify the primary path exists and is accessible for reuse.
413
+ * If not accessible and using the default head dir, fall back to alt.
414
+ */
415
+ *_reuseOrFallback(primary, alt, headDirPath) {
416
+ const exists = yield* this.statOp(primary);
417
+ const accessible = exists ? yield* this.accessOp(primary) : false;
418
+ if (exists && accessible) {
419
+ return { path: primary, headDirPath };
420
+ }
421
+ this.logger.info(`Reuse path unavailable, attempting to (re)create primary path`);
422
+ const primaryReady = yield* this._ensurePathAccessible(primary);
423
+ if (primaryReady) {
424
+ return { path: primary, headDirPath };
425
+ }
426
+ this.logger.info(`Primary path unavailable, trying alt path`);
427
+ const altReady = yield* this._ensurePathAccessible(alt);
428
+ if (!altReady) {
429
+ this.logger.warn(`Alt path not available: ${alt}`);
430
+ }
431
+ return { path: alt, headDirPath: this.defaults.altHeadDirPath };
432
+ }
433
+ /**
434
+ * Ensure a path exists and is accessible, creating it if necessary.
435
+ * Returns true if the path is ready for use.
436
+ */
437
+ *_ensurePathAccessible(path) {
438
+ const exists = yield* this.statOp(path);
439
+ if (!exists) {
440
+ this.logger.info(`Creating directory at ${path}`);
441
+ return yield* this.mkdirOp(path, this.perm);
442
+ }
443
+ return yield* this.accessOp(path);
444
+ }
445
+ /** Remove existing file or directory at path. */
446
+ *_clearPath(path) {
447
+ const stat = yield* this.statFileOp(path);
448
+ if (stat.isDirectory || stat.isFile) {
449
+ yield* this.rmOp(path);
450
+ }
451
+ }
452
+ /** Ensure the directory at path exists and is accessible, creating it if needed. */
453
+ *_ensureDirectoryExists(path) {
454
+ const exists = yield* this.statOp(path);
455
+ if (!exists) {
456
+ this.logger.info(`Creating directory at ${path}`);
457
+ const created = yield* this.mkdirOp(path, this.perm);
458
+ if (!created) {
459
+ this.logger.warn(`Failed to create directory at ${path}`);
460
+ }
461
+ }
462
+ else {
463
+ const accessible = yield* this.accessOp(path);
464
+ if (!accessible) {
465
+ this.logger.warn(`Path exists but is not accessible: ${path}`);
466
+ }
467
+ }
468
+ }
431
469
  /**
432
470
  * Close the path manager
433
471
  * If clear is true, removes the directory/file
@@ -435,24 +473,10 @@ export class PathManager {
435
473
  */
436
474
  *close(clear = false) {
437
475
  if (clear && this.path) {
438
- yield* this._rmOp(this.path);
476
+ yield* this.rmOp(this.path);
439
477
  }
440
478
  this.path = null;
441
479
  this.opened = false;
442
480
  return true;
443
481
  }
444
- /**
445
- * Check if database files exist in the path directory
446
- * LMDB creates data.mdb and lock.mdb files
447
- * Returns true if data.mdb exists (lock.mdb might not exist if no active transactions)
448
- * Uses Effection for structured concurrency
449
- */
450
- *databaseFilesExist() {
451
- if (!this.path) {
452
- return false;
453
- }
454
- const dataMdbPath = `${this.path}/data.mdb`;
455
- const pathStat = yield* this._statFileOp(dataMdbPath);
456
- return pathStat.isFile ?? false;
457
- }
458
482
  }
package/esm/db/index.js CHANGED
@@ -2,3 +2,4 @@
2
2
  * Database module exports
3
3
  */
4
4
  export * from "./basing.js";
5
+ export * from "./keeping.js";