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.
- package/README.md +57 -8
- package/esm/app/cli/agent.js +0 -19
- package/esm/app/cli/annotate.js +7 -2
- package/esm/app/cli/benchmark.js +210 -0
- package/esm/app/cli/cli.js +50 -52
- package/esm/app/cli/command-definitions.js +258 -6
- package/esm/app/cli/common/existing.js +40 -0
- package/esm/app/cli/common/parsing.js +20 -0
- package/esm/app/cli/export.js +51 -0
- package/esm/app/cli/incept.js +106 -0
- package/esm/app/cli/index.js +2 -0
- package/esm/app/cli/init.js +72 -41
- package/esm/app/configing.js +261 -0
- package/esm/app/habbing.js +386 -0
- package/esm/app/index.js +3 -0
- package/esm/app/keeping.js +321 -0
- package/esm/app/version.js +2 -2
- package/esm/db/basing.js +66 -1
- package/esm/db/core/lmdber.js +13 -7
- package/esm/db/core/path-manager.js +193 -169
- package/esm/db/index.js +1 -0
- package/esm/db/keeping.js +214 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js +12 -0
- package/esm/deps/jsr.io/@std/internal/1.0.12/os.js +5 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +7 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js +40 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.js +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js +46 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.js +19 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +235 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +77 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.js +9 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +19 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +35 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/common.js +33 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/constants.js +17 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/format.js +27 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +83 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.js +42 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js +34 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/mod.js +216 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js +32 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +35 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/parse.js +39 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js +8 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js +52 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.js +14 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +64 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js +93 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +21 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +23 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js +45 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +40 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +58 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +32 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.js +115 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.js +106 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +59 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +27 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +20 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/relative.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +29 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/types.js +3 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js +15 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js +47 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.js +14 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +113 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.js +28 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +30 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +82 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +38 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js +77 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +41 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +135 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +32 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.js +176 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.js +131 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +154 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +34 -0
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +49 -0
- package/package.json +4 -2
- package/types/app/cli/agent.d.ts.map +1 -1
- package/types/app/cli/annotate.d.ts.map +1 -1
- package/types/app/cli/benchmark.d.ts +11 -0
- package/types/app/cli/benchmark.d.ts.map +1 -0
- package/types/app/cli/cli.d.ts.map +1 -1
- package/types/app/cli/command-definitions.d.ts +5 -2
- package/types/app/cli/command-definitions.d.ts.map +1 -1
- package/types/app/cli/command-types.d.ts +12 -0
- package/types/app/cli/command-types.d.ts.map +1 -1
- package/types/app/cli/common/existing.d.ts +4 -0
- package/types/app/cli/common/existing.d.ts.map +1 -0
- package/types/app/cli/common/parsing.d.ts +15 -0
- package/types/app/cli/common/parsing.d.ts.map +1 -0
- package/types/app/cli/export.d.ts +8 -0
- package/types/app/cli/export.d.ts.map +1 -0
- package/types/app/cli/incept.d.ts +8 -0
- package/types/app/cli/incept.d.ts.map +1 -0
- package/types/app/cli/index.d.ts +2 -0
- package/types/app/cli/index.d.ts.map +1 -1
- package/types/app/cli/init.d.ts +5 -0
- package/types/app/cli/init.d.ts.map +1 -1
- package/types/app/configing.d.ts +57 -0
- package/types/app/configing.d.ts.map +1 -0
- package/types/app/habbing.d.ts +107 -0
- package/types/app/habbing.d.ts.map +1 -0
- package/types/app/index.d.ts +3 -0
- package/types/app/index.d.ts.map +1 -1
- package/types/app/keeping.d.ts +72 -0
- package/types/app/keeping.d.ts.map +1 -0
- package/types/app/version.d.ts +2 -2
- package/types/db/basing.d.ts +16 -1
- package/types/db/basing.d.ts.map +1 -1
- package/types/db/core/lmdber.d.ts +8 -4
- package/types/db/core/lmdber.d.ts.map +1 -1
- package/types/db/core/path-manager.d.ts +88 -24
- package/types/db/core/path-manager.d.ts.map +1 -1
- package/types/db/index.d.ts +1 -0
- package/types/db/index.d.ts.map +1 -1
- package/types/db/keeping.d.ts +73 -0
- package/types/db/keeping.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
- package/types/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
- package/types/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
- package/types/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
- package/types/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
- package/types/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
- package/types/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
- package/types/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
- package/types/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
- package/types/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
- package/types/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
- package/types/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
- package/types/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
- package/types/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
- package/types/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
- package/types/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
- package/types/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
- package/types/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
- package/esm/app/cli/stub-commands.js +0 -61
- package/types/app/cli/stub-commands.d.ts +0 -6
- package/types/app/cli/stub-commands.d.ts.map +0 -1
|
@@ -1,22 +1,70 @@
|
|
|
1
1
|
import { agentCommand } from "./agent.js";
|
|
2
2
|
import { annotateCommand } from "./annotate.js";
|
|
3
|
+
import { benchmarkCommand } from "./benchmark.js";
|
|
3
4
|
import { dumpEvts } from "./db-dump.js";
|
|
5
|
+
import { exportCommand } from "./export.js";
|
|
6
|
+
import { inceptCommand } from "./incept.js";
|
|
4
7
|
import { initCommand } from "./init.js";
|
|
5
8
|
import { DISPLAY_VERSION } from "../version.js";
|
|
6
|
-
export function
|
|
9
|
+
export function createCmdHandlers() {
|
|
7
10
|
return new Map([
|
|
8
11
|
["init", (args) => initCommand(args)],
|
|
12
|
+
["incept", (args) => inceptCommand(args)],
|
|
13
|
+
["export", (args) => exportCommand(args)],
|
|
9
14
|
["agent", (args) => agentCommand(args)],
|
|
10
15
|
["annotate", (args) => annotateCommand(args)],
|
|
16
|
+
["benchmark.cesr", (args) => benchmarkCommand(args)],
|
|
11
17
|
["db.dump", (args) => dumpEvts(args)],
|
|
18
|
+
["interact", interactCommand],
|
|
19
|
+
["witness", witnessCommand],
|
|
12
20
|
]);
|
|
13
21
|
}
|
|
14
|
-
|
|
22
|
+
/**
|
|
23
|
+
* registers core commands with the program
|
|
24
|
+
*/
|
|
25
|
+
export function registerCmds(program, dispatch) {
|
|
26
|
+
// top level commands
|
|
27
|
+
regVersionCmd(program);
|
|
28
|
+
regInitCmd(program, dispatch);
|
|
29
|
+
regInceptCmd(program, dispatch);
|
|
30
|
+
regExportCmd(program, dispatch);
|
|
31
|
+
regAnnotateCmd(program, dispatch);
|
|
32
|
+
regAgentCmd(program, dispatch);
|
|
33
|
+
regBenchmarkSubCmd(program, dispatch);
|
|
34
|
+
// sub commands
|
|
35
|
+
regDbDumpSubCmd(program, dispatch);
|
|
36
|
+
regExperimentalSubCmd(program, dispatch);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Registers the version command with the program.
|
|
40
|
+
* Equivalent to `kli version` from KERIpy.
|
|
41
|
+
*
|
|
42
|
+
* @param program The tufa Commander program instance
|
|
43
|
+
* @param dispatch The command dispatch function
|
|
44
|
+
*/
|
|
45
|
+
function regVersionCmd(program) {
|
|
46
|
+
program
|
|
47
|
+
.command("version")
|
|
48
|
+
.description("Show tufa version")
|
|
49
|
+
.action(() => {
|
|
50
|
+
console.log(DISPLAY_VERSION);
|
|
51
|
+
return Promise.resolve();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Registers the init command with the program.
|
|
56
|
+
* Equivalent to `kli init` from KERIpy.
|
|
57
|
+
*
|
|
58
|
+
* @param program The tufa Commander program instance
|
|
59
|
+
* @param dispatch The command dispatch function
|
|
60
|
+
*/
|
|
61
|
+
function regInitCmd(program, dispatch) {
|
|
15
62
|
program
|
|
16
63
|
.command("init")
|
|
17
64
|
.description("Create a database and keystore")
|
|
18
65
|
.option("-n, --name <name>", "Keystore name and file location of KERI keystore (required)")
|
|
19
66
|
.option("-b, --base <base>", "Additional optional prefix to file location of KERI keystore")
|
|
67
|
+
.option("--head-dir <dir>", "Directory override for database and keystore root (default fallback: ~/.tufa)")
|
|
20
68
|
.option("-t, --temp", "Create a temporary keystore, used for testing")
|
|
21
69
|
.option("-s, --salt <salt>", "Qualified base64 salt for creating key pairs")
|
|
22
70
|
.option("-c, --config-dir <dir>", "Directory override for configuration data")
|
|
@@ -31,6 +79,7 @@ export function registerCoreCommands(program, dispatch) {
|
|
|
31
79
|
args: {
|
|
32
80
|
name: options.name,
|
|
33
81
|
base: options.base,
|
|
82
|
+
headDirPath: options.headDir,
|
|
34
83
|
temp: options.temp || false,
|
|
35
84
|
salt: options.salt,
|
|
36
85
|
configDir: options.configDir,
|
|
@@ -43,6 +92,106 @@ export function registerCoreCommands(program, dispatch) {
|
|
|
43
92
|
});
|
|
44
93
|
return Promise.resolve();
|
|
45
94
|
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Registers the incept command with the program.
|
|
98
|
+
* Equivalent to `kli incept` from KERIpy.
|
|
99
|
+
*
|
|
100
|
+
* @param program The tufa Commander program instance
|
|
101
|
+
* @param dispatch The command dispatch function
|
|
102
|
+
*/
|
|
103
|
+
function regInceptCmd(program, dispatch) {
|
|
104
|
+
program
|
|
105
|
+
.command("incept")
|
|
106
|
+
.description("Initialize a prefix")
|
|
107
|
+
.requiredOption("-n, --name <name>", "Keystore name and file location of KERI keystore")
|
|
108
|
+
.option("-b, --base <base>", "Additional optional prefix to file location of KERI keystore")
|
|
109
|
+
.option("--head-dir <dir>", "Directory override for database and keystore root (default fallback: ~/.tufa)")
|
|
110
|
+
.option("-p, --passcode <passcode>", "Encryption passcode for keystore")
|
|
111
|
+
.requiredOption("-a, --alias <alias>", "Human readable alias for the new identifier prefix")
|
|
112
|
+
.option("-f, --file <file>", "Filename to use to create the identifier", "")
|
|
113
|
+
.option("-tf, --transferable", "Whether the prefix is transferable or non-transferable")
|
|
114
|
+
.option("-w, --wits <prefix>", "New set of witnesses, replaces all existing witnesses", (value, prev = []) => {
|
|
115
|
+
prev.push(value);
|
|
116
|
+
return prev;
|
|
117
|
+
}, [])
|
|
118
|
+
.option("-t, --toad <toad>", "Witness threshold (threshold of accountable duplicity)", (value) => Number(value))
|
|
119
|
+
.option("-ic, --icount <count>", "Incepting key count for number of keys used for inception", (value) => Number(value))
|
|
120
|
+
.option("-s, --isith <isith>", "Signing threshold for the inception event")
|
|
121
|
+
.option("-nc, --ncount <count>", "Next key count for number of next keys used on first rotation", (value) => Number(value))
|
|
122
|
+
.option("-x, --nsith <nsith>", "Signing threshold for the next rotation")
|
|
123
|
+
.option("-e, --est-only", "Only allow establishment events in KEL")
|
|
124
|
+
.option("-d, --data <data>", "Anchor data, '@' allowed", (value, prev = []) => {
|
|
125
|
+
prev.push(value);
|
|
126
|
+
return prev;
|
|
127
|
+
}, [])
|
|
128
|
+
.option("-di, --delpre <prefix>", "Delegator AID for delegated identifiers")
|
|
129
|
+
.action((options) => {
|
|
130
|
+
dispatch({
|
|
131
|
+
name: "incept",
|
|
132
|
+
args: {
|
|
133
|
+
name: options.name,
|
|
134
|
+
base: options.base,
|
|
135
|
+
headDirPath: options.headDir,
|
|
136
|
+
passcode: options.passcode,
|
|
137
|
+
alias: options.alias,
|
|
138
|
+
file: options.file,
|
|
139
|
+
transferable: options.transferable || false,
|
|
140
|
+
wits: options.wits || [],
|
|
141
|
+
toad: options.toad,
|
|
142
|
+
icount: options.icount,
|
|
143
|
+
isith: options.isith,
|
|
144
|
+
ncount: options.ncount,
|
|
145
|
+
nsith: options.nsith,
|
|
146
|
+
estOnly: options.estOnly || false,
|
|
147
|
+
data: options.data || [],
|
|
148
|
+
delpre: options.delpre,
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
return Promise.resolve();
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Registers the export command with the program.
|
|
156
|
+
* Equivalent to `kli export` from KERIpy.
|
|
157
|
+
*
|
|
158
|
+
* @param program The tufa Commander program instance
|
|
159
|
+
* @param dispatch The command dispatch function
|
|
160
|
+
*/
|
|
161
|
+
function regExportCmd(program, dispatch) {
|
|
162
|
+
program
|
|
163
|
+
.command("export")
|
|
164
|
+
.description("Export key events in CESR stream format")
|
|
165
|
+
.requiredOption("-n, --name <name>", "Keystore name")
|
|
166
|
+
.requiredOption("-a, --alias <alias>", "Human readable alias for identifier to export")
|
|
167
|
+
.option("-b, --base <base>", "Optional base path prefix")
|
|
168
|
+
.option("--head-dir <dir>", "Directory override for database and keystore root (default fallback: ~/.tufa)")
|
|
169
|
+
.option("-p, --passcode <passcode>", "Encryption passcode for keystore")
|
|
170
|
+
.option("--files", "Export artifacts to individual files")
|
|
171
|
+
.option("--ends", "Export service end points")
|
|
172
|
+
.action((options) => {
|
|
173
|
+
dispatch({
|
|
174
|
+
name: "export",
|
|
175
|
+
args: {
|
|
176
|
+
name: options.name,
|
|
177
|
+
alias: options.alias,
|
|
178
|
+
base: options.base,
|
|
179
|
+
headDirPath: options.headDir,
|
|
180
|
+
passcode: options.passcode,
|
|
181
|
+
files: options.files || false,
|
|
182
|
+
ends: options.ends || false,
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
return Promise.resolve();
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Registers the annotate command with the program.
|
|
190
|
+
*
|
|
191
|
+
* @param program The tufa Commander program instance
|
|
192
|
+
* @param dispatch The command dispatch function
|
|
193
|
+
*/
|
|
194
|
+
function regAnnotateCmd(program, dispatch) {
|
|
46
195
|
program
|
|
47
196
|
.command("annotate")
|
|
48
197
|
.description("Annotate CESR stream from file or stdin")
|
|
@@ -62,6 +211,14 @@ export function registerCoreCommands(program, dispatch) {
|
|
|
62
211
|
});
|
|
63
212
|
return Promise.resolve();
|
|
64
213
|
});
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Registers the agent command with the program.
|
|
217
|
+
*
|
|
218
|
+
* @param program The tufa Commander program instance
|
|
219
|
+
* @param dispatch The command dispatch function
|
|
220
|
+
*/
|
|
221
|
+
function regAgentCmd(program, dispatch) {
|
|
65
222
|
program
|
|
66
223
|
.command("agent")
|
|
67
224
|
.description("Start the KERI agent server")
|
|
@@ -76,7 +233,69 @@ export function registerCoreCommands(program, dispatch) {
|
|
|
76
233
|
});
|
|
77
234
|
return Promise.resolve();
|
|
78
235
|
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Registers benchmark subcommands with the program.
|
|
239
|
+
*
|
|
240
|
+
* @param program The tufa Commander program instance
|
|
241
|
+
* @param dispatch The command dispatch function
|
|
242
|
+
*/
|
|
243
|
+
function regBenchmarkSubCmd(program, dispatch) {
|
|
244
|
+
const benchmarkCommand = program.command("benchmark").description("Benchmark operations");
|
|
245
|
+
regBenchmarkCesrCmd(benchmarkCommand, dispatch);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Registers the CESR benchmark command.
|
|
249
|
+
*
|
|
250
|
+
* @param benchmarkCommand The benchmark sub-command instance
|
|
251
|
+
* @param dispatch The command dispatch function
|
|
252
|
+
*/
|
|
253
|
+
function regBenchmarkCesrCmd(benchmarkCommand, dispatch) {
|
|
254
|
+
benchmarkCommand
|
|
255
|
+
.command("cesr")
|
|
256
|
+
.description("Benchmark CESR parser from file or stdin")
|
|
257
|
+
.option("--in <path>", "Input file path (defaults to stdin)")
|
|
258
|
+
.option("--iterations <count>", "Measured benchmark iterations", (value) => Number(value), 50)
|
|
259
|
+
.option("--warmup <count>", "Warmup iterations before measurement", (value) => Number(value), 5)
|
|
260
|
+
.option("--chunk-size <bytes>", "Chunk size for simulated streaming input", (value) => Number(value), 0)
|
|
261
|
+
.option("--framed", "Use framed parser mode")
|
|
262
|
+
.option("--compat", "Use compat attachment dispatch mode")
|
|
263
|
+
.option("--allow-errors", "Do not fail benchmark if parse errors are emitted")
|
|
264
|
+
.option("--json", "Emit benchmark result as one JSON line")
|
|
265
|
+
.action((options) => {
|
|
266
|
+
dispatch({
|
|
267
|
+
name: "benchmark.cesr",
|
|
268
|
+
args: {
|
|
269
|
+
inPath: options.in,
|
|
270
|
+
iterations: options.iterations,
|
|
271
|
+
warmupIterations: options.warmup,
|
|
272
|
+
chunkSize: options.chunkSize,
|
|
273
|
+
framed: options.framed || false,
|
|
274
|
+
compat: options.compat || false,
|
|
275
|
+
allowErrors: options.allowErrors || false,
|
|
276
|
+
json: options.json || false,
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
return Promise.resolve();
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Registers the db dump sub command with the program.
|
|
284
|
+
*
|
|
285
|
+
* @param program The tufa Commander program instance
|
|
286
|
+
* @param dispatch The command dispatch function
|
|
287
|
+
*/
|
|
288
|
+
function regDbDumpSubCmd(program, dispatch) {
|
|
79
289
|
const dbCommand = program.command("db").description("Database operations");
|
|
290
|
+
regDbDumpCmd(dbCommand, dispatch);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Registers the db dump command with the program.
|
|
294
|
+
*
|
|
295
|
+
* @param dbCommand The db sub-command instance
|
|
296
|
+
* @param dispatch The command dispatch function
|
|
297
|
+
*/
|
|
298
|
+
function regDbDumpCmd(dbCommand, dispatch) {
|
|
80
299
|
dbCommand
|
|
81
300
|
.command("dump")
|
|
82
301
|
.description("Dump database contents")
|
|
@@ -94,11 +313,44 @@ export function registerCoreCommands(program, dispatch) {
|
|
|
94
313
|
});
|
|
95
314
|
return Promise.resolve();
|
|
96
315
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Registers the experimental sub command with the program.
|
|
319
|
+
* This is for commands not yet implemented, finished, or supported by tufa.
|
|
320
|
+
*
|
|
321
|
+
* @param program The tufa Commander program instance
|
|
322
|
+
* @param dispatch The command dispatch function
|
|
323
|
+
*/
|
|
324
|
+
function regExperimentalSubCmd(program, dispatch) {
|
|
325
|
+
const experimentalCommand = program
|
|
326
|
+
.command("experimental")
|
|
327
|
+
.description("Experimental or placeholder commands");
|
|
328
|
+
regInteractCmd(experimentalCommand, dispatch);
|
|
329
|
+
regWitnessCmd(experimentalCommand, dispatch);
|
|
330
|
+
}
|
|
331
|
+
function regInteractCmd(experimentalCommand, dispatch) {
|
|
332
|
+
experimentalCommand
|
|
333
|
+
.command("interact")
|
|
334
|
+
.description("Create an interaction event (placeholder)")
|
|
100
335
|
.action(() => {
|
|
101
|
-
|
|
336
|
+
dispatch({ name: "interact", args: {} });
|
|
102
337
|
return Promise.resolve();
|
|
103
338
|
});
|
|
104
339
|
}
|
|
340
|
+
function regWitnessCmd(experimentalCommand, dispatch) {
|
|
341
|
+
experimentalCommand
|
|
342
|
+
.command("witness")
|
|
343
|
+
.description("Start a witness server (placeholder)")
|
|
344
|
+
.action(() => {
|
|
345
|
+
dispatch({ name: "witness", args: {} });
|
|
346
|
+
return Promise.resolve();
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
// deno-lint-ignore require-yield
|
|
350
|
+
function* interactCommand(_args) {
|
|
351
|
+
console.log("tufa experimental interact command - coming soon!");
|
|
352
|
+
}
|
|
353
|
+
// deno-lint-ignore require-yield
|
|
354
|
+
function* witnessCommand(_args) {
|
|
355
|
+
console.log("tufa experimental witness command - coming soon!");
|
|
356
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createKeeper } from "../../../db/keeping.js";
|
|
2
|
+
import { createHabery } from "../../habbing.js";
|
|
3
|
+
export function* setupHby(name, base = "", bran, temp = false, headDirPath) {
|
|
4
|
+
const ks = yield* createKeeper({
|
|
5
|
+
name,
|
|
6
|
+
base,
|
|
7
|
+
temp,
|
|
8
|
+
headDirPath,
|
|
9
|
+
reopen: true,
|
|
10
|
+
readonly: true,
|
|
11
|
+
});
|
|
12
|
+
const aeid = ks.getGbls("aeid");
|
|
13
|
+
yield* ks.close();
|
|
14
|
+
if (aeid === null) {
|
|
15
|
+
throw new Error("Keystore must already exist, exiting");
|
|
16
|
+
}
|
|
17
|
+
let retries = 0;
|
|
18
|
+
let passcode = bran;
|
|
19
|
+
while (true) {
|
|
20
|
+
try {
|
|
21
|
+
retries += 1;
|
|
22
|
+
return yield* createHabery({
|
|
23
|
+
name,
|
|
24
|
+
base,
|
|
25
|
+
temp,
|
|
26
|
+
headDirPath,
|
|
27
|
+
bran: passcode?.replaceAll("-", ""),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (retries >= 3) {
|
|
32
|
+
throw new Error("too many attempts");
|
|
33
|
+
}
|
|
34
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
35
|
+
console.log(message);
|
|
36
|
+
console.log("Valid passcode required, try again...");
|
|
37
|
+
passcode = prompt("Passcode: ") ?? undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
export function parseDataItems(items) {
|
|
3
|
+
if (!items || items.length === 0)
|
|
4
|
+
return [];
|
|
5
|
+
const out = [];
|
|
6
|
+
for (const item of items) {
|
|
7
|
+
if (item.startsWith("@")) {
|
|
8
|
+
const file = item.slice(1);
|
|
9
|
+
const text = dntShim.Deno.readTextFileSync(file);
|
|
10
|
+
out.push(JSON.parse(text));
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
out.push(JSON.parse(item));
|
|
14
|
+
}
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
export function loadInceptFileOptions(path) {
|
|
18
|
+
const text = dntShim.Deno.readTextFileSync(path);
|
|
19
|
+
return JSON.parse(text);
|
|
20
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createQueue, spawn } from "effection";
|
|
2
|
+
import { ValidationError } from "../../core/errors.js";
|
|
3
|
+
import { setupHby } from "./common/existing.js";
|
|
4
|
+
/**
|
|
5
|
+
* Implements `tufa export`.
|
|
6
|
+
*
|
|
7
|
+
* Exports CESR-formatted KEL events for a named local AID.
|
|
8
|
+
*/
|
|
9
|
+
export function* exportCommand(args) {
|
|
10
|
+
const exportArgs = {
|
|
11
|
+
name: args.name,
|
|
12
|
+
base: args.base,
|
|
13
|
+
headDirPath: args.headDirPath,
|
|
14
|
+
passcode: args.passcode,
|
|
15
|
+
alias: args.alias,
|
|
16
|
+
files: args.files,
|
|
17
|
+
ends: args.ends,
|
|
18
|
+
};
|
|
19
|
+
if (!exportArgs.name) {
|
|
20
|
+
throw new ValidationError("Name is required and cannot be empty");
|
|
21
|
+
}
|
|
22
|
+
if (!exportArgs.alias) {
|
|
23
|
+
throw new ValidationError("Alias is required and cannot be empty");
|
|
24
|
+
}
|
|
25
|
+
const cues = createQueue();
|
|
26
|
+
const doer = yield* spawn(function* () {
|
|
27
|
+
const hby = yield* setupHby(exportArgs.name, exportArgs.base ?? "", exportArgs.passcode, false, exportArgs.headDirPath);
|
|
28
|
+
try {
|
|
29
|
+
const hab = hby.habByName(exportArgs.alias);
|
|
30
|
+
if (!hab || !hab.pre) {
|
|
31
|
+
throw new ValidationError(`No local AID found for alias ${exportArgs.alias}`);
|
|
32
|
+
}
|
|
33
|
+
const encoder = new TextEncoder();
|
|
34
|
+
const keyPrefix = encoder.encode(`${hab.pre}:`);
|
|
35
|
+
const decoder = new TextDecoder();
|
|
36
|
+
let count = 0;
|
|
37
|
+
for (const [, value] of hby.db.getAllEvtsIter(keyPrefix)) {
|
|
38
|
+
console.log(decoder.decode(value));
|
|
39
|
+
count += 1;
|
|
40
|
+
}
|
|
41
|
+
cues.add({ kin: "export", count, mode: "native" });
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
yield* hby.close();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
yield* doer;
|
|
48
|
+
const cue = yield* cues.next();
|
|
49
|
+
if (cue.done)
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createQueue, spawn } from "effection";
|
|
2
|
+
import { ValidationError } from "../../core/errors.js";
|
|
3
|
+
import { setupHby } from "./common/existing.js";
|
|
4
|
+
import { loadInceptFileOptions, parseDataItems, } from "./common/parsing.js";
|
|
5
|
+
/**
|
|
6
|
+
* Loads incept options from a file and overlays explicit CLI values.
|
|
7
|
+
*/
|
|
8
|
+
function mergeWithFile(args) {
|
|
9
|
+
let opts = {};
|
|
10
|
+
if (args.file && args.file !== "") {
|
|
11
|
+
opts = loadInceptFileOptions(args.file);
|
|
12
|
+
}
|
|
13
|
+
if (args.transferable !== undefined)
|
|
14
|
+
opts.transferable = args.transferable;
|
|
15
|
+
if (args.wits && args.wits.length > 0)
|
|
16
|
+
opts.wits = args.wits;
|
|
17
|
+
if (args.icount !== undefined)
|
|
18
|
+
opts.icount = Number(args.icount);
|
|
19
|
+
if (args.isith !== undefined)
|
|
20
|
+
opts.isith = args.isith;
|
|
21
|
+
if (args.ncount !== undefined)
|
|
22
|
+
opts.ncount = Number(args.ncount);
|
|
23
|
+
if (args.nsith !== undefined)
|
|
24
|
+
opts.nsith = args.nsith;
|
|
25
|
+
if (args.toad !== undefined)
|
|
26
|
+
opts.toad = Number(args.toad);
|
|
27
|
+
if (args.estOnly !== undefined)
|
|
28
|
+
opts.estOnly = args.estOnly;
|
|
29
|
+
if (args.delpre !== undefined)
|
|
30
|
+
opts.delpre = args.delpre;
|
|
31
|
+
if (args.data !== undefined)
|
|
32
|
+
opts.data = parseDataItems(args.data);
|
|
33
|
+
return opts;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Implements `tufa incept`.
|
|
37
|
+
*
|
|
38
|
+
* Creates a single-sig identifier locally.
|
|
39
|
+
*/
|
|
40
|
+
export function* inceptCommand(args) {
|
|
41
|
+
const inceptArgs = {
|
|
42
|
+
name: args.name,
|
|
43
|
+
base: args.base,
|
|
44
|
+
headDirPath: args.headDirPath,
|
|
45
|
+
temp: args.temp,
|
|
46
|
+
passcode: args.passcode,
|
|
47
|
+
alias: args.alias,
|
|
48
|
+
endpoint: args.endpoint,
|
|
49
|
+
proxy: args.proxy,
|
|
50
|
+
file: args.file,
|
|
51
|
+
transferable: args.transferable,
|
|
52
|
+
wits: args.wits,
|
|
53
|
+
toad: args.toad,
|
|
54
|
+
icount: args.icount,
|
|
55
|
+
isith: args.isith,
|
|
56
|
+
ncount: args.ncount,
|
|
57
|
+
nsith: args.nsith,
|
|
58
|
+
estOnly: args.estOnly,
|
|
59
|
+
data: args.data,
|
|
60
|
+
delpre: args.delpre,
|
|
61
|
+
};
|
|
62
|
+
if (!inceptArgs.name) {
|
|
63
|
+
throw new ValidationError("Name is required and cannot be empty");
|
|
64
|
+
}
|
|
65
|
+
if (!inceptArgs.alias) {
|
|
66
|
+
throw new ValidationError("Alias is required and cannot be empty");
|
|
67
|
+
}
|
|
68
|
+
if (inceptArgs.endpoint) {
|
|
69
|
+
throw new ValidationError("Witness endpoint receipting is not available in single-sig local phase");
|
|
70
|
+
}
|
|
71
|
+
if (inceptArgs.proxy) {
|
|
72
|
+
throw new ValidationError("Delegation proxy flow is not available in single-sig local phase");
|
|
73
|
+
}
|
|
74
|
+
const opts = mergeWithFile(inceptArgs);
|
|
75
|
+
const cues = createQueue();
|
|
76
|
+
const doer = yield* spawn(function* () {
|
|
77
|
+
const hby = yield* setupHby(inceptArgs.name, inceptArgs.base ?? "", inceptArgs.passcode, inceptArgs.temp ?? false, inceptArgs.headDirPath);
|
|
78
|
+
try {
|
|
79
|
+
const hab = hby.makeHab(inceptArgs.alias, undefined, {
|
|
80
|
+
transferable: opts.transferable ?? false,
|
|
81
|
+
wits: opts.wits ?? [],
|
|
82
|
+
toad: opts.toad ?? 0,
|
|
83
|
+
icount: opts.icount ?? 1,
|
|
84
|
+
isith: opts.isith,
|
|
85
|
+
ncount: opts.ncount ?? 1,
|
|
86
|
+
nsith: opts.nsith,
|
|
87
|
+
estOnly: opts.estOnly ?? false,
|
|
88
|
+
data: opts.data ?? [],
|
|
89
|
+
delpre: opts.delpre,
|
|
90
|
+
});
|
|
91
|
+
console.log(`Prefix ${hab.pre}`);
|
|
92
|
+
for (const [idx, key] of (hab.kever?.verfers ?? []).entries()) {
|
|
93
|
+
console.log(`\tPublic key ${idx + 1}: ${key}`);
|
|
94
|
+
}
|
|
95
|
+
console.log("");
|
|
96
|
+
cues.add({ kin: "incept", pre: hab.pre, mode: "native" });
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
yield* hby.close();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
yield* doer;
|
|
103
|
+
const cue = yield* cues.next();
|
|
104
|
+
if (cue.done)
|
|
105
|
+
return;
|
|
106
|
+
}
|
package/esm/app/cli/index.js
CHANGED
package/esm/app/cli/init.js
CHANGED
|
@@ -1,36 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
--base, -b <base> Additional optional prefix to file location of KERI keystore
|
|
11
|
-
--temp, -t Create a temporary keystore, used for testing
|
|
12
|
-
--salt, -s <salt> Qualified base64 salt for creating key pairs
|
|
13
|
-
--config-dir, -c <dir> Directory override for configuration data
|
|
14
|
-
--config-file <file> Configuration filename override
|
|
15
|
-
--passcode, -p <passcode> 22 character encryption passcode for keystore (is not saved)
|
|
16
|
-
--nopasscode Create an unencrypted keystore
|
|
17
|
-
--aeid, -a <aeid> Qualified base64 of non-transferable identifier prefix for authentication and encryption of secrets in keystore
|
|
18
|
-
--seed, -e <seed> Qualified base64 private-signing key (seed) for the aeid from which the private decryption key may be derived
|
|
19
|
-
--help, -h Show this help message
|
|
20
|
-
`);
|
|
21
|
-
}
|
|
22
|
-
// TODO remove this ignore once init is finished
|
|
23
|
-
// deno-lint-ignore require-yield
|
|
1
|
+
import { createQueue, spawn } from "effection";
|
|
2
|
+
import { PathError, ValidationError } from "../../core/errors.js";
|
|
3
|
+
import { createConfiger } from "../configing.js";
|
|
4
|
+
import { createHabery } from "../habbing.js";
|
|
5
|
+
/**
|
|
6
|
+
* Implements `tufa init`.
|
|
7
|
+
*
|
|
8
|
+
* Creates/open a habery keystore and database.
|
|
9
|
+
*/
|
|
24
10
|
export function* initCommand(args) {
|
|
25
|
-
//
|
|
26
|
-
if (args.help || args.h) {
|
|
27
|
-
printInitHelp();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// Extract values from args (already parsed by Cliffy or test mocks)
|
|
11
|
+
// Extract values from args
|
|
31
12
|
const initArgs = {
|
|
32
13
|
name: args.name,
|
|
33
14
|
base: args.base,
|
|
15
|
+
headDirPath: args.headDirPath,
|
|
34
16
|
temp: args.temp,
|
|
35
17
|
salt: args.salt,
|
|
36
18
|
configDir: args.configDir,
|
|
@@ -46,10 +28,9 @@ export function* initCommand(args) {
|
|
|
46
28
|
throw new ValidationError("Name is required and cannot be empty");
|
|
47
29
|
}
|
|
48
30
|
const base = initArgs.base || "";
|
|
31
|
+
const headDirPath = initArgs.headDirPath;
|
|
49
32
|
const temp = initArgs.temp || false;
|
|
50
33
|
let bran = initArgs.passcode;
|
|
51
|
-
const configFile = initArgs.configFile;
|
|
52
|
-
const configDir = initArgs.configDir;
|
|
53
34
|
const nopasscode = initArgs.nopasscode || false;
|
|
54
35
|
// Handle passcode input if not provided and not using nopasscode
|
|
55
36
|
if (!nopasscode && !bran) {
|
|
@@ -63,14 +44,64 @@ export function* initCommand(args) {
|
|
|
63
44
|
}
|
|
64
45
|
bran = passcode || undefined;
|
|
65
46
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
47
|
+
const cues = createQueue();
|
|
48
|
+
const doer = yield* spawn(function* () {
|
|
49
|
+
const cf = initArgs.configFile
|
|
50
|
+
? (yield* createConfiger({
|
|
51
|
+
name: initArgs.configFile,
|
|
52
|
+
base: "",
|
|
53
|
+
temp: false,
|
|
54
|
+
headDirPath: initArgs.configDir,
|
|
55
|
+
reopen: true,
|
|
56
|
+
clear: false,
|
|
57
|
+
}))
|
|
58
|
+
: undefined;
|
|
59
|
+
let hby;
|
|
60
|
+
try {
|
|
61
|
+
hby = yield* createHabery({
|
|
62
|
+
name,
|
|
63
|
+
base,
|
|
64
|
+
headDirPath,
|
|
65
|
+
temp,
|
|
66
|
+
cf,
|
|
67
|
+
bran: bran ?? undefined,
|
|
68
|
+
aeid: initArgs.aeid,
|
|
69
|
+
seed: initArgs.seed,
|
|
70
|
+
salt: initArgs.salt,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if (temp || !(error instanceof PathError)) {
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
console.log("Persistent keystore path unavailable, retrying with temporary keystore mode.");
|
|
78
|
+
hby = yield* createHabery({
|
|
79
|
+
name,
|
|
80
|
+
base,
|
|
81
|
+
headDirPath,
|
|
82
|
+
temp: true,
|
|
83
|
+
cf,
|
|
84
|
+
bran: bran ?? undefined,
|
|
85
|
+
aeid: initArgs.aeid,
|
|
86
|
+
seed: initArgs.seed,
|
|
87
|
+
salt: initArgs.salt,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
console.log("KERI Keystore created at:", hby.ks.path);
|
|
92
|
+
console.log("KERI Database created at:", hby.db.path);
|
|
93
|
+
console.log("KERI Credential Store created at:", hby.db.path);
|
|
94
|
+
if (hby.mgr.aeid) {
|
|
95
|
+
console.log("\taeid:", hby.mgr.aeid);
|
|
96
|
+
}
|
|
97
|
+
cues.add({ kin: "init", mode: "native", name });
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
yield* hby.close();
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
yield* doer;
|
|
104
|
+
const cue = yield* cues.next();
|
|
105
|
+
if (cue.done)
|
|
106
|
+
return;
|
|
76
107
|
}
|