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
@@ -0,0 +1,321 @@
1
+ import { blake3 } from "@noble/hashes/blake3";
2
+ import { argon2id } from "@noble/hashes/argon2";
3
+ import { ed25519 } from "@noble/curves/ed25519";
4
+ import { parseMatter } from "cesr-ts";
5
+ const B64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
6
+ export var Algos;
7
+ (function (Algos) {
8
+ Algos["randy"] = "randy";
9
+ Algos["salty"] = "salty";
10
+ Algos["group"] = "group";
11
+ Algos["extern"] = "extern";
12
+ })(Algos || (Algos = {}));
13
+ function toBase64Url(bytes) {
14
+ let s = "";
15
+ for (const b of bytes)
16
+ s += String.fromCharCode(b);
17
+ return btoa(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
18
+ }
19
+ function fromBase64Url(text) {
20
+ const padded = text + "=".repeat((4 - (text.length % 4 || 4)) % 4);
21
+ const b64 = padded.replace(/-/g, "+").replace(/_/g, "/");
22
+ const decoded = atob(b64);
23
+ const out = new Uint8Array(decoded.length);
24
+ for (let i = 0; i < decoded.length; i++)
25
+ out[i] = decoded.charCodeAt(i);
26
+ return out;
27
+ }
28
+ function intToB64(value, length = 1) {
29
+ let v = value;
30
+ const out = new Array(length).fill("A");
31
+ for (let i = length - 1; i >= 0; i--) {
32
+ out[i] = B64_ALPHABET[v & 0x3f];
33
+ v = Math.floor(v / 64);
34
+ }
35
+ return out.join("");
36
+ }
37
+ function parseQb64Raw(qb64) {
38
+ return parseMatter(new TextEncoder().encode(qb64), "txt").raw;
39
+ }
40
+ function encodeFixedMatter(code, raw) {
41
+ const cs = code.length;
42
+ const ps = cs % 4;
43
+ const body = toBase64Url(new Uint8Array(ps + raw.length).map((_, i) => i < ps ? 0 : raw[i - ps]));
44
+ return `${code}${body.slice(ps)}`;
45
+ }
46
+ function encodeIndexerEd25519Sig(rawSig, index, ondex = index) {
47
+ const code = ondex === index ? "A" : "2A";
48
+ if (code !== "A") {
49
+ throw new Error("Only compact single-sig indexer encoding is implemented.");
50
+ }
51
+ const both = `${code}${intToB64(index, 1)}`;
52
+ const ps = (3 - (rawSig.length % 3)) % 3;
53
+ const body = toBase64Url(new Uint8Array(ps + rawSig.length).map((_, i) => i < ps ? 0 : rawSig[i - ps]));
54
+ return `${both}${body.slice(ps)}`;
55
+ }
56
+ function blake3Qb64(raw, code = "E") {
57
+ return encodeFixedMatter(code, blake3(raw));
58
+ }
59
+ function randomSaltQb64() {
60
+ const raw = crypto.getRandomValues(new Uint8Array(16));
61
+ return encodeFixedMatter("0A", raw);
62
+ }
63
+ function pathToBytes(path) {
64
+ return new TextEncoder().encode(path);
65
+ }
66
+ function tierParams(tier, temp) {
67
+ if (temp) {
68
+ return { t: 1, m: 8 };
69
+ }
70
+ if (tier === "low")
71
+ return { t: 2, m: 65536 };
72
+ if (tier === "med")
73
+ return { t: 3, m: 262144 };
74
+ if (tier === "high")
75
+ return { t: 4, m: 1048576 };
76
+ throw new Error(`Unsupported security tier=${tier}`);
77
+ }
78
+ function deriveSeedFromSalt(saltQb64, path, tier, temp) {
79
+ const saltRaw = parseQb64Raw(saltQb64);
80
+ const params = tierParams(tier, temp);
81
+ return argon2id(pathToBytes(path), saltRaw, {
82
+ p: 1,
83
+ t: params.t,
84
+ m: params.m,
85
+ dkLen: 32,
86
+ version: 0x13,
87
+ });
88
+ }
89
+ export function saltySigner(saltQb64, path, transferable, tier, temp) {
90
+ const seedRaw = deriveSeedFromSalt(saltQb64, path, tier, temp);
91
+ const seedQb64 = encodeFixedMatter("A", seedRaw);
92
+ const pubRaw = ed25519.getPublicKey(seedRaw);
93
+ const verferQb64 = encodeFixedMatter(transferable ? "D" : "B", pubRaw);
94
+ return { seedQb64, verferQb64 };
95
+ }
96
+ function pubsKey(pre, ridx) {
97
+ return `${pre}.${ridx.toString(16).padStart(32, "0")}`;
98
+ }
99
+ export class Manager {
100
+ constructor(args) {
101
+ Object.defineProperty(this, "_seed", {
102
+ enumerable: true,
103
+ configurable: true,
104
+ writable: true,
105
+ value: void 0
106
+ });
107
+ Object.defineProperty(this, "_ks", {
108
+ enumerable: true,
109
+ configurable: true,
110
+ writable: true,
111
+ value: void 0
112
+ });
113
+ const { ks, seed = "", aeid = "", pidx = 0, algo = Algos.salty, salt = randomSaltQb64(), tier = "low", } = args;
114
+ this._ks = ks;
115
+ this._seed = seed;
116
+ if (this.pidx === null)
117
+ this.pidx = pidx;
118
+ if (this.algo === null)
119
+ this.algo = algo;
120
+ if (this.salt === null)
121
+ this.salt = salt;
122
+ if (this.tier === null)
123
+ this.tier = tier;
124
+ this.setup(aeid, seed);
125
+ }
126
+ get ks() {
127
+ return this._ks;
128
+ }
129
+ get seed() {
130
+ return this._seed;
131
+ }
132
+ get aeid() {
133
+ return this.ks.getGbls("aeid") ?? "";
134
+ }
135
+ get pidx() {
136
+ const val = this.ks.getGbls("pidx");
137
+ if (val === null)
138
+ return null;
139
+ return parseInt(val, 16);
140
+ }
141
+ set pidx(pidx) {
142
+ this.ks.pinGbls("pidx", pidx.toString(16));
143
+ }
144
+ get algo() {
145
+ const val = this.ks.getGbls("algo");
146
+ if (val === null)
147
+ return null;
148
+ return val;
149
+ }
150
+ set algo(algo) {
151
+ this.ks.pinGbls("algo", algo);
152
+ }
153
+ get salt() {
154
+ return this.ks.getGbls("salt");
155
+ }
156
+ set salt(salt) {
157
+ this.ks.pinGbls("salt", salt);
158
+ }
159
+ get tier() {
160
+ return this.ks.getGbls("tier");
161
+ }
162
+ set tier(tier) {
163
+ this.ks.pinGbls("tier", tier);
164
+ }
165
+ setup(aeid = "", seed = "") {
166
+ this.updateAeid(aeid, seed);
167
+ }
168
+ updateAeid(aeid, seed) {
169
+ if (aeid) {
170
+ if (!seed) {
171
+ throw new Error("Seed required when aeid is set.");
172
+ }
173
+ const seedRaw = parseQb64Raw(seed);
174
+ const derivedAeid = encodeFixedMatter("B", ed25519.getPublicKey(seedRaw));
175
+ if (derivedAeid !== aeid) {
176
+ throw new Error(`Seed missing or provided seed not associated with aeid=${aeid}.`);
177
+ }
178
+ }
179
+ this.ks.pinGbls("aeid", aeid);
180
+ this._seed = seed;
181
+ }
182
+ incept(args = {}) {
183
+ const { icount = 1, ncount = 1, dcode = "E", stem = "", transferable = true, algo, salt, tier, rooted = true, temp = false, } = args;
184
+ const usedAlgo = rooted
185
+ ? (algo ?? this.algo ?? Algos.salty)
186
+ : (algo ?? Algos.salty);
187
+ if (usedAlgo !== Algos.salty) {
188
+ throw new Error(`Unsupported key creation algorithm=${usedAlgo}`);
189
+ }
190
+ const usedSalt = rooted ? (salt ?? this.salt ?? "") : (salt ?? "");
191
+ const usedTier = rooted ? (tier ?? this.tier ?? "low") : (tier ?? "low");
192
+ const pidx = this.pidx ?? 0;
193
+ const verfers = [];
194
+ const digers = [];
195
+ const rootStem = stem || `${pidx.toString(16)}`;
196
+ for (let i = 0; i < icount; i++) {
197
+ const path = `${rootStem}${(0).toString(16)}${i.toString(16)}`;
198
+ const signer = saltySigner(usedSalt, path, transferable, usedTier, temp);
199
+ verfers.push({ qb64: signer.verferQb64 });
200
+ this.ks.putPris(signer.verferQb64, signer.seedQb64);
201
+ }
202
+ for (let i = 0; i < ncount; i++) {
203
+ const path = `${rootStem}${(1).toString(16)}${(icount + i).toString(16)}`;
204
+ const signer = saltySigner(usedSalt, path, transferable, usedTier, temp);
205
+ const dig = blake3Qb64(new TextEncoder().encode(signer.verferQb64), dcode);
206
+ digers.push({ qb64: dig });
207
+ this.ks.putPris(signer.verferQb64, signer.seedQb64);
208
+ }
209
+ const pp = {
210
+ pidx,
211
+ algo: usedAlgo,
212
+ salt: usedSalt,
213
+ stem,
214
+ tier: usedTier,
215
+ };
216
+ const dt = new Date().toISOString();
217
+ const ps = {
218
+ old: { pubs: [], ridx: 0, kidx: 0, dt },
219
+ new: {
220
+ pubs: verfers.map((v) => v.qb64),
221
+ ridx: 0,
222
+ kidx: 0,
223
+ dt,
224
+ },
225
+ nxt: {
226
+ pubs: digers.map((d) => d.qb64),
227
+ ridx: 1,
228
+ kidx: icount,
229
+ dt,
230
+ },
231
+ };
232
+ const opre = verfers[0].qb64;
233
+ if (!this.ks.putPres(opre, opre)) {
234
+ throw new Error(`Already incepted pre=${opre}.`);
235
+ }
236
+ if (!this.ks.putPrms(opre, pp)) {
237
+ throw new Error(`Already incepted prm for pre=${opre}.`);
238
+ }
239
+ if (!this.ks.putSits(opre, ps)) {
240
+ throw new Error(`Already incepted sit for pre=${opre}.`);
241
+ }
242
+ this.ks.putPubs(pubsKey(opre, 0), { pubs: ps.new.pubs });
243
+ this.ks.putPubs(pubsKey(opre, 1), { pubs: ps.nxt.pubs });
244
+ this.pidx = pidx + 1;
245
+ return [verfers, digers];
246
+ }
247
+ move(oldPre, newPre) {
248
+ if (oldPre === newPre)
249
+ return;
250
+ if (!this.ks.getPres(oldPre)) {
251
+ throw new Error(`Nonexistent old pre=${oldPre}, nothing to assign.`);
252
+ }
253
+ if (this.ks.getPres(newPre)) {
254
+ throw new Error(`Preexistent new pre=${newPre} may not clobber.`);
255
+ }
256
+ const prm = this.ks.getPrms(oldPre);
257
+ const sit = this.ks.getSits(oldPre);
258
+ if (!prm || !sit) {
259
+ throw new Error(`Missing records to move from old pre=${oldPre}.`);
260
+ }
261
+ this.ks.putPrms(newPre, prm);
262
+ this.ks.putSits(newPre, sit);
263
+ let ri = 0;
264
+ while (true) {
265
+ const oldKey = pubsKey(oldPre, ri);
266
+ const newKey = pubsKey(newPre, ri);
267
+ const ps = this.ks.getPubs(oldKey);
268
+ if (ps === null)
269
+ break;
270
+ this.ks.putPubs(newKey, ps);
271
+ ri += 1;
272
+ }
273
+ this.ks.pinPres(oldPre, newPre);
274
+ this.ks.putPres(newPre, newPre);
275
+ }
276
+ sign(ser, pubs, indexed = true) {
277
+ return pubs.map((pub, idx) => {
278
+ const seedQb64 = this.ks.getPris(pub);
279
+ if (!seedQb64)
280
+ throw new Error(`Missing prikey in db for pubkey=${pub}`);
281
+ const seedRaw = parseQb64Raw(seedQb64);
282
+ const sigRaw = ed25519.sign(ser, seedRaw);
283
+ return indexed
284
+ ? encodeIndexerEd25519Sig(sigRaw, idx, idx)
285
+ : encodeFixedMatter("0B", sigRaw);
286
+ });
287
+ }
288
+ }
289
+ export function normalizeSaltQb64(salt) {
290
+ return salt ? encodeFixedMatter("0A", parseQb64Raw(salt)) : randomSaltQb64();
291
+ }
292
+ export function branToSaltQb64(bran) {
293
+ if (bran.length < 21) {
294
+ throw new Error("Bran (passcode seed material) too short.");
295
+ }
296
+ return `0AA${bran.slice(0, 21)}`;
297
+ }
298
+ export function encodeDateTimeToDater(dts) {
299
+ return `1AAG${dts.replace(/:/g, "c").replace(/\./g, "d").replace(/\+/g, "p")}`;
300
+ }
301
+ export function encodeCounterV1(code, count) {
302
+ return `${code}${intToB64(count, 2)}`;
303
+ }
304
+ export function encodeHugeNumber(num) {
305
+ const raw = new Uint8Array(16);
306
+ let value = BigInt(num);
307
+ for (let i = 15; i >= 0; i--) {
308
+ raw[i] = Number(value & 0xffn);
309
+ value >>= 8n;
310
+ }
311
+ return encodeFixedMatter("0A", raw);
312
+ }
313
+ export function normalizeQb64Code(qb64) {
314
+ return encodeFixedMatter(parseMatter(new TextEncoder().encode(qb64), "txt").code, parseQb64Raw(qb64));
315
+ }
316
+ export function makeSaider(raw) {
317
+ return blake3Qb64(raw, "E");
318
+ }
319
+ export function b64DecodeUrl(text) {
320
+ return fromBase64Url(text);
321
+ }
@@ -2,8 +2,8 @@
2
2
  * Generated by scripts/generate_versions.ts.
3
3
  * Do not edit by hand.
4
4
  */
5
- export const PACKAGE_VERSION = "0.2.3";
6
- export const BUILD_METADATA = "build.2.ae619744";
5
+ export const PACKAGE_VERSION = "0.3.0";
6
+ export const BUILD_METADATA = "build.3.9b643722";
7
7
  export const DISPLAY_VERSION = BUILD_METADATA
8
8
  ? `${PACKAGE_VERSION}+${BUILD_METADATA}`
9
9
  : PACKAGE_VERSION;
package/esm/db/basing.js CHANGED
@@ -32,6 +32,24 @@ export class Baser {
32
32
  writable: true,
33
33
  value: void 0
34
34
  }); // Events sub-database (dgKey: serialized KEL events)
35
+ Object.defineProperty(this, "habs", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: void 0
40
+ }); // Habitat records keyed by pre
41
+ Object.defineProperty(this, "names", {
42
+ enumerable: true,
43
+ configurable: true,
44
+ writable: true,
45
+ value: void 0
46
+ }); // (ns,name) -> pre
47
+ Object.defineProperty(this, "hbys", {
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true,
51
+ value: void 0
52
+ }); // Habery-scoped values such as __signatory__
35
53
  this.logger = options.logger ?? consoleLogger;
36
54
  // Create LMDBer with composition
37
55
  this.lmdber = new LMDBer(options, {
@@ -71,6 +89,9 @@ export class Baser {
71
89
  // Names end with "." to avoid namespace collisions with Base64 identifier prefixes
72
90
  try {
73
91
  this.evts = this.lmdber.openDB("evts.", false);
92
+ this.habs = this.lmdber.openDB("habs.", false);
93
+ this.names = this.lmdber.openDB("names.", false);
94
+ this.hbys = this.lmdber.openDB("hbys.", false);
74
95
  return this.opened;
75
96
  }
76
97
  catch (error) {
@@ -135,6 +156,50 @@ export class Baser {
135
156
  *getAllEvtsIter(top = new Uint8Array(0)) {
136
157
  yield* this.lmdber.getTopItemIter(this.evts, top);
137
158
  }
159
+ encodeText(text) {
160
+ return new TextEncoder().encode(text);
161
+ }
162
+ decodeText(bytes) {
163
+ if (bytes === null)
164
+ return null;
165
+ return new TextDecoder().decode(bytes);
166
+ }
167
+ encodeJson(value) {
168
+ return this.encodeText(JSON.stringify(value));
169
+ }
170
+ decodeJson(bytes) {
171
+ const text = this.decodeText(bytes);
172
+ if (text === null)
173
+ return null;
174
+ return JSON.parse(text);
175
+ }
176
+ putHab(pre, record) {
177
+ return this.lmdber.putVal(this.habs, this.encodeText(pre), this.encodeJson(record));
178
+ }
179
+ pinHab(pre, record) {
180
+ return this.lmdber.setVal(this.habs, this.encodeText(pre), this.encodeJson(record));
181
+ }
182
+ getHab(pre) {
183
+ return this.decodeJson(this.lmdber.getVal(this.habs, this.encodeText(pre)));
184
+ }
185
+ putName(ns, name, pre) {
186
+ const key = `${ns}:${name}`;
187
+ return this.lmdber.putVal(this.names, this.encodeText(key), this.encodeText(pre));
188
+ }
189
+ pinName(ns, name, pre) {
190
+ const key = `${ns}:${name}`;
191
+ return this.lmdber.setVal(this.names, this.encodeText(key), this.encodeText(pre));
192
+ }
193
+ getName(ns, name) {
194
+ const key = `${ns}:${name}`;
195
+ return this.decodeText(this.lmdber.getVal(this.names, this.encodeText(key)));
196
+ }
197
+ pinHby(name, value) {
198
+ return this.lmdber.setVal(this.hbys, this.encodeText(name), this.encodeText(value));
199
+ }
200
+ getHby(name) {
201
+ return this.decodeText(this.lmdber.getVal(this.hbys, this.encodeText(name)));
202
+ }
138
203
  }
139
204
  // Class constants
140
205
  Object.defineProperty(Baser, "TailDirPath", {
@@ -147,7 +212,7 @@ Object.defineProperty(Baser, "AltTailDirPath", {
147
212
  enumerable: true,
148
213
  configurable: true,
149
214
  writable: true,
150
- value: ".keri/db"
215
+ value: ".tufa/db"
151
216
  });
152
217
  Object.defineProperty(Baser, "TempPrefix", {
153
218
  enumerable: true,
@@ -23,8 +23,8 @@ export const LMDBER_DEFAULTS = {
23
23
  tailDirPath: "keri/db",
24
24
  cleanTailDirPath: "keri/clean/db",
25
25
  altHeadDirPath: "~",
26
- altTailDirPath: ".keri/db",
27
- altCleanTailDirPath: ".keri/clean/db",
26
+ altTailDirPath: ".tufa/db",
27
+ altCleanTailDirPath: ".tufa/clean/db",
28
28
  tempHeadDir: "/tmp",
29
29
  tempPrefix: "keri_lmdb_",
30
30
  tempSuffix: "_test",
@@ -111,7 +111,9 @@ export class LMDBer {
111
111
  });
112
112
  }
113
113
  /**
114
- * Reopen the LMDB database
114
+ * Reopen the LMDB database. LMDBer relies on PathManager to create the containing directory and
115
+ * then the LMDB library creates the data.mdb and lock.mdb files.
116
+ *
115
117
  * Closes existing database if open before opening a new one to prevent double-free errors
116
118
  */
117
119
  *reopen(options = {}) {
@@ -192,14 +194,18 @@ export class LMDBer {
192
194
  }
193
195
  }
194
196
  /**
195
- * Check if database already exists by checking for database files
197
+ * Check if database files exist in the path directory
198
+ * LMDB creates data.mdb and lock.mdb files. lock.mdb might not exist if there are no active transactions
199
+ * Returns Effection Operation with true if data.mdb exists
196
200
  */
197
201
  *checkDatabaseExists() {
198
202
  if (!this.pathManager.path) {
199
203
  return false;
200
204
  }
201
205
  // Check if database files exist (now an Effection operation)
202
- return yield* this.pathManager.databaseFilesExist();
206
+ const dataMdbPath = `${this.path}/data.mdb`;
207
+ const pathStat = yield* this.pathManager.statFileOp(dataMdbPath);
208
+ return pathStat.isFile ?? false;
203
209
  }
204
210
  /**
205
211
  * Close the LMDB database
@@ -440,13 +446,13 @@ Object.defineProperty(LMDBer, "AltTailDirPath", {
440
446
  enumerable: true,
441
447
  configurable: true,
442
448
  writable: true,
443
- value: ".keri/db"
449
+ value: ".tufa/db"
444
450
  });
445
451
  Object.defineProperty(LMDBer, "AltCleanTailDirPath", {
446
452
  enumerable: true,
447
453
  configurable: true,
448
454
  writable: true,
449
- value: ".keri/clean/db"
455
+ value: ".tufa/clean/db"
450
456
  });
451
457
  Object.defineProperty(LMDBer, "TempHeadDir", {
452
458
  enumerable: true,