@feiyoug/skill-lab 0.0.1 → 0.0.2
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 +20 -21
- package/esm/analyzer/astgrep/client.d.ts +20 -8
- package/esm/analyzer/astgrep/client.d.ts.map +1 -1
- package/esm/analyzer/astgrep/client.js +58 -31
- package/esm/analyzer/config/default.d.ts +8 -0
- package/esm/analyzer/config/default.d.ts.map +1 -0
- package/esm/analyzer/config/default.js +91 -0
- package/esm/analyzer/config/helpers.d.ts +8 -0
- package/esm/analyzer/config/helpers.d.ts.map +1 -0
- package/esm/analyzer/config/helpers.js +72 -0
- package/esm/analyzer/config/mod.d.ts +4 -0
- package/esm/analyzer/config/mod.d.ts.map +1 -0
- package/esm/analyzer/config/mod.js +3 -0
- package/esm/analyzer/config/types.d.ts +58 -0
- package/esm/analyzer/config/types.d.ts.map +1 -0
- package/esm/analyzer/{config.js → config/types.js} +0 -28
- package/esm/analyzer/logging.d.ts +3 -0
- package/esm/analyzer/logging.d.ts.map +1 -0
- package/esm/analyzer/logging.js +6 -0
- package/esm/analyzer/mod.d.ts +12 -5
- package/esm/analyzer/mod.d.ts.map +1 -1
- package/esm/analyzer/mod.js +25 -12
- package/esm/analyzer/result.d.ts +35 -0
- package/esm/analyzer/result.d.ts.map +1 -0
- package/esm/analyzer/result.js +311 -0
- package/esm/analyzer/rules/bash/commands/mod.d.ts +1 -0
- package/esm/analyzer/rules/bash/commands/mod.d.ts.map +1 -1
- package/esm/analyzer/rules/bash/commands/mod.js +3 -0
- package/esm/analyzer/rules/bash/commands/pip.d.ts +3 -0
- package/esm/analyzer/rules/bash/commands/pip.d.ts.map +1 -0
- package/esm/analyzer/rules/bash/commands/pip.js +14 -0
- package/esm/analyzer/rules/bash/extractFileRefs.d.ts +1 -1
- package/esm/analyzer/rules/bash/extractFileRefs.d.ts.map +1 -1
- package/esm/analyzer/rules/bash/extractFileRefs.js +2 -2
- package/esm/analyzer/rules/bash/inline-command-classifier.d.ts +1 -1
- package/esm/analyzer/rules/bash/inline-command-classifier.d.ts.map +1 -1
- package/esm/analyzer/rules/bash/inline-command-classifier.js +4 -4
- package/esm/analyzer/rules/javascript/extractFileRefs.d.ts +3 -4
- package/esm/analyzer/rules/javascript/extractFileRefs.d.ts.map +1 -1
- package/esm/analyzer/rules/javascript/extractFileRefs.js +3 -4
- package/esm/analyzer/rules/markdown/extractCodeBlocks.d.ts.map +1 -1
- package/esm/analyzer/rules/markdown/extractCodeBlocks.js +6 -3
- package/esm/analyzer/rules/markdown/extractFileRefs.d.ts.map +1 -1
- package/esm/analyzer/rules/markdown/extractFileRefs.js +2 -0
- package/esm/analyzer/rules/python/extractFileRefs.d.ts +1 -1
- package/esm/analyzer/rules/python/extractFileRefs.d.ts.map +1 -1
- package/esm/analyzer/rules/python/extractFileRefs.js +2 -2
- package/esm/analyzer/steps/001-discovery/discover-files.d.ts +4 -0
- package/esm/analyzer/steps/001-discovery/discover-files.d.ts.map +1 -1
- package/esm/analyzer/steps/001-discovery/discover-files.js +18 -2
- package/esm/analyzer/steps/001-discovery/mod.d.ts.map +1 -1
- package/esm/analyzer/steps/001-discovery/mod.js +39 -9
- package/esm/analyzer/steps/002-permissions/mod.d.ts.map +1 -1
- package/esm/analyzer/steps/002-permissions/mod.js +156 -73
- package/esm/analyzer/steps/002-permissions/scan-file.d.ts +1 -1
- package/esm/analyzer/steps/002-permissions/scan-file.d.ts.map +1 -1
- package/esm/analyzer/steps/002-permissions/scan-file.js +40 -5
- package/esm/analyzer/steps/002-permissions/seed-frontmatter.js +2 -2
- package/esm/analyzer/steps/003-risks/dep-risks.d.ts +3 -0
- package/esm/analyzer/steps/003-risks/dep-risks.d.ts.map +1 -0
- package/esm/analyzer/steps/003-risks/dep-risks.js +74 -0
- package/esm/analyzer/steps/003-risks/helpers.d.ts +1 -0
- package/esm/analyzer/steps/003-risks/helpers.d.ts.map +1 -1
- package/esm/analyzer/steps/003-risks/helpers.js +1 -0
- package/esm/analyzer/steps/003-risks/mod.d.ts +3 -2
- package/esm/analyzer/steps/003-risks/mod.d.ts.map +1 -1
- package/esm/analyzer/steps/003-risks/mod.js +41 -4
- package/esm/analyzer/steps/003-risks/policy.d.ts +7 -0
- package/esm/analyzer/steps/003-risks/policy.d.ts.map +1 -0
- package/esm/analyzer/steps/003-risks/policy.js +23 -0
- package/esm/analyzer/steps/003-risks/rule-mapped.d.ts +2 -2
- package/esm/analyzer/steps/003-risks/rule-mapped.d.ts.map +1 -1
- package/esm/analyzer/steps/003-risks/rule-mapped.js +83 -2
- package/esm/analyzer/steps/003-risks/scoring.d.ts +9 -1
- package/esm/analyzer/steps/003-risks/scoring.d.ts.map +1 -1
- package/esm/analyzer/steps/003-risks/scoring.js +55 -42
- package/esm/analyzer/treesitter/client.d.ts +31 -0
- package/esm/analyzer/treesitter/client.d.ts.map +1 -0
- package/esm/analyzer/{treesiter → treesitter}/client.js +43 -39
- package/esm/analyzer/treesitter/registry.d.ts +73 -0
- package/esm/analyzer/treesitter/registry.d.ts.map +1 -0
- package/esm/analyzer/treesitter/registry.js +165 -0
- package/esm/analyzer/types.d.ts +14 -28
- package/esm/analyzer/types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/deps.d.ts +3 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/deps.d.ts.map +1 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/deps.js +3 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/mod.d.ts +93 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/mod.js +297 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/multi.d.ts +84 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/multi.d.ts.map +1 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/multi.js +268 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/time.d.ts +18 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/time.d.ts.map +1 -0
- package/esm/deps/jsr.io/@deno-library/progress/1.5.1/time.js +45 -0
- package/esm/deps/jsr.io/@std/fmt/1.0.3/colors.d.ts +700 -0
- package/esm/deps/jsr.io/@std/fmt/1.0.3/colors.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fmt/1.0.3/colors.js +903 -0
- package/esm/deps/jsr.io/@std/io/0.225.0/types.d.ts +146 -0
- package/esm/deps/jsr.io/@std/io/0.225.0/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.0/types.js +15 -0
- package/esm/deps/jsr.io/@std/io/0.225.0/write_all.d.ts +51 -0
- package/esm/deps/jsr.io/@std/io/0.225.0/write_all.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.0/write_all.js +61 -0
- package/esm/shared/deep_merge.d.ts +12 -0
- package/esm/shared/deep_merge.d.ts.map +1 -0
- package/esm/shared/deep_merge.js +49 -0
- package/esm/shared/mod.d.ts +1 -0
- package/esm/shared/mod.d.ts.map +1 -1
- package/esm/shared/mod.js +1 -0
- package/esm/shared/types/filetypes.d.ts +2 -2
- package/esm/shared/types/filetypes.d.ts.map +1 -1
- package/esm/shared/types/permissions.d.ts +1 -1
- package/esm/shared/types/permissions.d.ts.map +1 -1
- package/esm/shared/types/risks.d.ts +4 -1
- package/esm/shared/types/risks.d.ts.map +1 -1
- package/esm/skillreader/types.d.ts +2 -2
- package/esm/skillreader/types.d.ts.map +1 -1
- package/esm/skillreader/types.js +2 -2
- package/package.json +1 -1
- package/script/analyzer/astgrep/client.d.ts +20 -8
- package/script/analyzer/astgrep/client.d.ts.map +1 -1
- package/script/analyzer/astgrep/client.js +58 -64
- package/script/analyzer/config/default.d.ts +8 -0
- package/script/analyzer/config/default.d.ts.map +1 -0
- package/script/analyzer/config/default.js +94 -0
- package/script/analyzer/config/helpers.d.ts +8 -0
- package/script/analyzer/config/helpers.d.ts.map +1 -0
- package/script/analyzer/config/helpers.js +76 -0
- package/script/analyzer/config/mod.d.ts +4 -0
- package/script/analyzer/config/mod.d.ts.map +1 -0
- package/script/analyzer/config/mod.js +21 -0
- package/script/analyzer/config/types.d.ts +58 -0
- package/script/analyzer/config/types.d.ts.map +1 -0
- package/script/analyzer/{config.js → config/types.js} +1 -29
- package/script/analyzer/logging.d.ts +3 -0
- package/script/analyzer/logging.d.ts.map +1 -0
- package/script/analyzer/logging.js +9 -0
- package/script/analyzer/mod.d.ts +12 -5
- package/script/analyzer/mod.d.ts.map +1 -1
- package/script/analyzer/mod.js +35 -20
- package/script/analyzer/result.d.ts +35 -0
- package/script/analyzer/result.d.ts.map +1 -0
- package/script/analyzer/result.js +315 -0
- package/script/analyzer/rules/bash/commands/mod.d.ts +1 -0
- package/script/analyzer/rules/bash/commands/mod.d.ts.map +1 -1
- package/script/analyzer/rules/bash/commands/mod.js +3 -0
- package/script/analyzer/rules/bash/commands/pip.d.ts +3 -0
- package/script/analyzer/rules/bash/commands/pip.d.ts.map +1 -0
- package/script/analyzer/rules/bash/commands/pip.js +17 -0
- package/script/analyzer/rules/bash/extractFileRefs.d.ts +1 -1
- package/script/analyzer/rules/bash/extractFileRefs.d.ts.map +1 -1
- package/script/analyzer/rules/bash/extractFileRefs.js +2 -2
- package/script/analyzer/rules/bash/inline-command-classifier.d.ts +1 -1
- package/script/analyzer/rules/bash/inline-command-classifier.d.ts.map +1 -1
- package/script/analyzer/rules/bash/inline-command-classifier.js +4 -4
- package/script/analyzer/rules/javascript/extractFileRefs.d.ts +3 -4
- package/script/analyzer/rules/javascript/extractFileRefs.d.ts.map +1 -1
- package/script/analyzer/rules/javascript/extractFileRefs.js +3 -4
- package/script/analyzer/rules/markdown/extractCodeBlocks.d.ts.map +1 -1
- package/script/analyzer/rules/markdown/extractCodeBlocks.js +6 -3
- package/script/analyzer/rules/markdown/extractFileRefs.d.ts.map +1 -1
- package/script/analyzer/rules/markdown/extractFileRefs.js +2 -0
- package/script/analyzer/rules/python/extractFileRefs.d.ts +1 -1
- package/script/analyzer/rules/python/extractFileRefs.d.ts.map +1 -1
- package/script/analyzer/rules/python/extractFileRefs.js +2 -2
- package/script/analyzer/steps/001-discovery/discover-files.d.ts +4 -0
- package/script/analyzer/steps/001-discovery/discover-files.d.ts.map +1 -1
- package/script/analyzer/steps/001-discovery/discover-files.js +18 -2
- package/script/analyzer/steps/001-discovery/mod.d.ts.map +1 -1
- package/script/analyzer/steps/001-discovery/mod.js +77 -11
- package/script/analyzer/steps/002-permissions/mod.d.ts.map +1 -1
- package/script/analyzer/steps/002-permissions/mod.js +194 -75
- package/script/analyzer/steps/002-permissions/scan-file.d.ts +1 -1
- package/script/analyzer/steps/002-permissions/scan-file.d.ts.map +1 -1
- package/script/analyzer/steps/002-permissions/scan-file.js +40 -5
- package/script/analyzer/steps/002-permissions/seed-frontmatter.js +3 -3
- package/script/analyzer/steps/003-risks/dep-risks.d.ts +3 -0
- package/script/analyzer/steps/003-risks/dep-risks.d.ts.map +1 -0
- package/script/analyzer/steps/003-risks/dep-risks.js +77 -0
- package/script/analyzer/steps/003-risks/helpers.d.ts +1 -0
- package/script/analyzer/steps/003-risks/helpers.d.ts.map +1 -1
- package/script/analyzer/steps/003-risks/helpers.js +1 -0
- package/script/analyzer/steps/003-risks/mod.d.ts +3 -2
- package/script/analyzer/steps/003-risks/mod.d.ts.map +1 -1
- package/script/analyzer/steps/003-risks/mod.js +77 -4
- package/script/analyzer/steps/003-risks/policy.d.ts +7 -0
- package/script/analyzer/steps/003-risks/policy.d.ts.map +1 -0
- package/script/analyzer/steps/003-risks/policy.js +29 -0
- package/script/analyzer/steps/003-risks/rule-mapped.d.ts +2 -2
- package/script/analyzer/steps/003-risks/rule-mapped.d.ts.map +1 -1
- package/script/analyzer/steps/003-risks/rule-mapped.js +83 -2
- package/script/analyzer/steps/003-risks/scoring.d.ts +9 -1
- package/script/analyzer/steps/003-risks/scoring.d.ts.map +1 -1
- package/script/analyzer/steps/003-risks/scoring.js +55 -42
- package/script/analyzer/treesitter/client.d.ts +31 -0
- package/script/analyzer/treesitter/client.d.ts.map +1 -0
- package/script/analyzer/treesitter/client.js +136 -0
- package/script/analyzer/treesitter/registry.d.ts +73 -0
- package/script/analyzer/treesitter/registry.d.ts.map +1 -0
- package/script/analyzer/treesitter/registry.js +206 -0
- package/script/analyzer/types.d.ts +14 -28
- package/script/analyzer/types.d.ts.map +1 -1
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/deps.d.ts +3 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/deps.d.ts.map +1 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/deps.js +10 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/mod.d.ts +93 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/mod.js +334 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/multi.d.ts +84 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/multi.d.ts.map +1 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/multi.js +305 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/time.d.ts +18 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/time.d.ts.map +1 -0
- package/script/deps/jsr.io/@deno-library/progress/1.5.1/time.js +48 -0
- package/script/deps/jsr.io/@std/fmt/1.0.3/colors.d.ts +700 -0
- package/script/deps/jsr.io/@std/fmt/1.0.3/colors.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fmt/1.0.3/colors.js +986 -0
- package/script/deps/jsr.io/@std/io/0.225.0/types.d.ts +146 -0
- package/script/deps/jsr.io/@std/io/0.225.0/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.0/types.js +18 -0
- package/script/deps/jsr.io/@std/io/0.225.0/write_all.d.ts +51 -0
- package/script/deps/jsr.io/@std/io/0.225.0/write_all.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.0/write_all.js +65 -0
- package/script/shared/deep_merge.d.ts +12 -0
- package/script/shared/deep_merge.d.ts.map +1 -0
- package/script/shared/deep_merge.js +53 -0
- package/script/shared/mod.d.ts +1 -0
- package/script/shared/mod.d.ts.map +1 -1
- package/script/shared/mod.js +1 -0
- package/script/shared/types/filetypes.d.ts +2 -2
- package/script/shared/types/filetypes.d.ts.map +1 -1
- package/script/shared/types/permissions.d.ts +1 -1
- package/script/shared/types/permissions.d.ts.map +1 -1
- package/script/shared/types/risks.d.ts +4 -1
- package/script/shared/types/risks.d.ts.map +1 -1
- package/script/skillreader/types.d.ts +2 -2
- package/script/skillreader/types.d.ts.map +1 -1
- package/script/skillreader/types.js +2 -2
- package/src/_dnt.polyfills.ts +27 -0
- package/src/_dnt.shims.ts +64 -0
- package/src/analyzer/astgrep/client.ts +184 -0
- package/src/analyzer/astgrep/mod.ts +2 -0
- package/src/analyzer/config/default.ts +98 -0
- package/src/analyzer/config/helpers.ts +107 -0
- package/src/analyzer/config/mod.ts +3 -0
- package/src/analyzer/config/types.ts +103 -0
- package/src/analyzer/logging.ts +8 -0
- package/src/analyzer/mod.ts +118 -0
- package/src/analyzer/result.ts +393 -0
- package/src/analyzer/rules/bash/astTypes.ts +5 -0
- package/src/analyzer/rules/bash/commands/bd.ts +23 -0
- package/src/analyzer/rules/bash/commands/cron.ts +21 -0
- package/src/analyzer/rules/bash/commands/docker.ts +37 -0
- package/src/analyzer/rules/bash/commands/eval.ts +52 -0
- package/src/analyzer/rules/bash/commands/generic.ts +16 -0
- package/src/analyzer/rules/bash/commands/gh.ts +21 -0
- package/src/analyzer/rules/bash/commands/git.ts +28 -0
- package/src/analyzer/rules/bash/commands/mod.ts +38 -0
- package/src/analyzer/rules/bash/commands/node.ts +64 -0
- package/src/analyzer/rules/bash/commands/openspec.ts +16 -0
- package/src/analyzer/rules/bash/commands/pip.ts +16 -0
- package/src/analyzer/rules/bash/commands/sudo.ts +21 -0
- package/src/analyzer/rules/bash/destructive.ts +28 -0
- package/src/analyzer/rules/bash/extractFileRefs.ts +101 -0
- package/src/analyzer/rules/bash/filesystem.ts +50 -0
- package/src/analyzer/rules/bash/injection.ts +21 -0
- package/src/analyzer/rules/bash/inline-command-classifier.ts +94 -0
- package/src/analyzer/rules/bash/mod.ts +23 -0
- package/src/analyzer/rules/bash/network.ts +64 -0
- package/src/analyzer/rules/bash/secret-detection.ts +43 -0
- package/src/analyzer/rules/javascript/astTypes.ts +8 -0
- package/src/analyzer/rules/javascript/extractFileRefs.ts +131 -0
- package/src/analyzer/rules/javascript/filesystem.ts +28 -0
- package/src/analyzer/rules/javascript/injection.ts +21 -0
- package/src/analyzer/rules/javascript/mod.ts +26 -0
- package/src/analyzer/rules/javascript/network.ts +27 -0
- package/src/analyzer/rules/javascript/secret-detection.ts +68 -0
- package/src/analyzer/rules/javascript/subprocess.ts +16 -0
- package/src/analyzer/rules/markdown/astTypes.ts +35 -0
- package/src/analyzer/rules/markdown/extractCodeBlocks.ts +101 -0
- package/src/analyzer/rules/markdown/extractFileRefs.ts +179 -0
- package/src/analyzer/rules/markdown/mod.ts +12 -0
- package/src/analyzer/rules/mod.ts +77 -0
- package/src/analyzer/rules/python/astTypes.ts +9 -0
- package/src/analyzer/rules/python/extractFileRefs.ts +92 -0
- package/src/analyzer/rules/python/mod.ts +15 -0
- package/src/analyzer/rules/python/network.ts +26 -0
- package/src/analyzer/rules/python/secret-detection.ts +30 -0
- package/src/analyzer/rules/shared/file-refs.ts +38 -0
- package/src/analyzer/rules/shared/network-evaluators.ts +107 -0
- package/src/analyzer/rules/shared/prompt-injection.ts +48 -0
- package/src/analyzer/rules/shared/secret-evaluators.ts +13 -0
- package/src/analyzer/rules/text/mod.ts +12 -0
- package/src/analyzer/rules/typescript/mod.ts +7 -0
- package/src/analyzer/steps/001-discovery/discover-files.ts +211 -0
- package/src/analyzer/steps/001-discovery/filter-files.ts +72 -0
- package/src/analyzer/steps/001-discovery/mod.ts +103 -0
- package/src/analyzer/steps/002-permissions/mod.ts +329 -0
- package/src/analyzer/steps/002-permissions/scan-file.ts +258 -0
- package/src/analyzer/steps/002-permissions/seed-frontmatter.ts +66 -0
- package/src/analyzer/steps/002-permissions/synthesize.ts +42 -0
- package/src/analyzer/steps/003-risks/dep-risks.ts +89 -0
- package/src/analyzer/steps/003-risks/helpers.ts +41 -0
- package/src/analyzer/steps/003-risks/mod.ts +86 -0
- package/src/analyzer/steps/003-risks/policy.ts +38 -0
- package/src/analyzer/steps/003-risks/rule-mapped.ts +206 -0
- package/src/analyzer/steps/003-risks/scoring.ts +117 -0
- package/src/analyzer/steps/mod.ts +3 -0
- package/src/analyzer/treesitter/client.ts +120 -0
- package/src/analyzer/treesitter/registry.ts +198 -0
- package/src/analyzer/types.ts +78 -0
- package/src/analyzer/utils/code-block-path.ts +33 -0
- package/src/analyzer/utils/id-generator.ts +59 -0
- package/src/analyzer/utils/secret-validator.ts +29 -0
- package/src/analyzer/utils/url-parser.ts +25 -0
- package/src/deps/jsr.io/@deno-library/progress/1.5.1/deps.ts +3 -0
- package/src/deps/jsr.io/@deno-library/progress/1.5.1/mod.ts +265 -0
- package/src/deps/jsr.io/@deno-library/progress/1.5.1/multi.ts +250 -0
- package/src/deps/jsr.io/@deno-library/progress/1.5.1/time.ts +69 -0
- package/src/deps/jsr.io/@std/fmt/1.0.3/colors.ts +1004 -0
- package/src/deps/jsr.io/@std/internal/1.0.12/_os.ts +15 -0
- package/src/deps/jsr.io/@std/internal/1.0.12/os.ts +7 -0
- package/src/deps/jsr.io/@std/io/0.225.0/types.ts +157 -0
- package/src/deps/jsr.io/@std/io/0.225.0/write_all.ts +65 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/assert_path.ts +10 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/basename.ts +53 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/common.ts +26 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/constants.ts +49 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/dirname.ts +9 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/format.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.ts +12 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.ts +295 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/normalize.ts +9 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.ts +74 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/relative.ts +10 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.ts +17 -0
- package/src/deps/jsr.io/@std/path/1.1.4/basename.ts +37 -0
- package/src/deps/jsr.io/@std/path/1.1.4/common.ts +35 -0
- package/src/deps/jsr.io/@std/path/1.1.4/constants.ts +18 -0
- package/src/deps/jsr.io/@std/path/1.1.4/dirname.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.1.4/extname.ts +29 -0
- package/src/deps/jsr.io/@std/path/1.1.4/format.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.1.4/from_file_url.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.ts +94 -0
- package/src/deps/jsr.io/@std/path/1.1.4/is_absolute.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.1.4/is_glob.ts +49 -0
- package/src/deps/jsr.io/@std/path/1.1.4/join.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.1.4/join_globs.ts +42 -0
- package/src/deps/jsr.io/@std/path/1.1.4/mod.ts +217 -0
- package/src/deps/jsr.io/@std/path/1.1.4/normalize.ts +33 -0
- package/src/deps/jsr.io/@std/path/1.1.4/normalize_glob.ts +45 -0
- package/src/deps/jsr.io/@std/path/1.1.4/parse.ts +44 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/_util.ts +10 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/basename.ts +62 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/constants.ts +15 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/dirname.ts +72 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/extname.ts +96 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/format.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.ts +94 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.ts +25 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/join.ts +46 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/join_globs.ts +45 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/normalize.ts +63 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.ts +43 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/parse.ts +121 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/relative.ts +103 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/resolve.ts +71 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.ts +32 -0
- package/src/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.ts +21 -0
- package/src/deps/jsr.io/@std/path/1.1.4/relative.ts +32 -0
- package/src/deps/jsr.io/@std/path/1.1.4/resolve.ts +32 -0
- package/src/deps/jsr.io/@std/path/1.1.4/to_file_url.ts +30 -0
- package/src/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.1.4/types.ts +40 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/_util.ts +28 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/basename.ts +54 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/constants.ts +15 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/dirname.ts +118 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/extname.ts +90 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/format.ts +31 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.ts +34 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.ts +92 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.ts +40 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/join.ts +78 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/join_globs.ts +46 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/normalize.ts +136 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.ts +43 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/parse.ts +184 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/relative.ts +128 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/resolve.ts +178 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.ts +38 -0
- package/src/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.ts +60 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_chars.ts +55 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_dumper_state.ts +841 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_loader_state.ts +1780 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_schema.ts +183 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/binary.ts +127 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/bool.ts +37 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/float.ts +112 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/int.ts +174 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/map.ts +17 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/merge.ts +13 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/nil.ts +27 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/omap.ts +30 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/pairs.ts +22 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/regexp.ts +33 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/seq.ts +13 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/set.ts +17 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/str.ts +12 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/timestamp.ts +101 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type/undefined.ts +23 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_type.ts +49 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/_utils.ts +16 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/mod.ts +54 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/parse.ts +128 -0
- package/src/deps/jsr.io/@std/yaml/1.0.11/stringify.ts +118 -0
- package/src/shared/deep_merge.ts +73 -0
- package/src/shared/mod.ts +2 -0
- package/src/shared/types/filetypes.ts +101 -0
- package/src/shared/types/findings.ts +7 -0
- package/src/shared/types/mod.ts +6 -0
- package/src/shared/types/permissions.ts +17 -0
- package/src/shared/types/references.ts +62 -0
- package/src/shared/types/risks.ts +72 -0
- package/src/shared/types/syntaxNode.ts +7 -0
- package/src/skillreader/cloudStorage/mod.ts +170 -0
- package/src/skillreader/factory.ts +71 -0
- package/src/skillreader/fs/git.ts +153 -0
- package/src/skillreader/fs/mod.ts +84 -0
- package/src/skillreader/github/base.ts +162 -0
- package/src/skillreader/github/githubApi.ts +40 -0
- package/src/skillreader/github/githubRaw.ts +24 -0
- package/src/skillreader/github/mod.ts +45 -0
- package/src/skillreader/github/utils.ts +40 -0
- package/src/skillreader/manifest.ts +67 -0
- package/src/skillreader/mod.ts +26 -0
- package/src/skillreader/types.ts +150 -0
- package/src/skillreader/utils/frontmatter-parser.ts +72 -0
- package/src/skillreader/utils/http-range.ts +38 -0
- package/src/skillreader/utils/mod.ts +12 -0
- package/esm/analyzer/astgrep/registry.d.ts +0 -18
- package/esm/analyzer/astgrep/registry.d.ts.map +0 -1
- package/esm/analyzer/astgrep/registry.js +0 -71
- package/esm/analyzer/config.d.ts +0 -27
- package/esm/analyzer/config.d.ts.map +0 -1
- package/esm/analyzer/steps/003-risks/output.d.ts +0 -3
- package/esm/analyzer/steps/003-risks/output.d.ts.map +0 -1
- package/esm/analyzer/steps/003-risks/output.js +0 -16
- package/esm/analyzer/treesiter/client.d.ts +0 -26
- package/esm/analyzer/treesiter/client.d.ts.map +0 -1
- package/script/analyzer/astgrep/registry.d.ts +0 -18
- package/script/analyzer/astgrep/registry.d.ts.map +0 -1
- package/script/analyzer/astgrep/registry.js +0 -109
- package/script/analyzer/config.d.ts +0 -27
- package/script/analyzer/config.d.ts.map +0 -1
- package/script/analyzer/steps/003-risks/output.d.ts +0 -3
- package/script/analyzer/steps/003-risks/output.d.ts.map +0 -1
- package/script/analyzer/steps/003-risks/output.js +0 -19
- package/script/analyzer/treesiter/client.d.ts +0 -26
- package/script/analyzer/treesiter/client.d.ts.map +0 -1
- package/script/analyzer/treesiter/client.js +0 -165
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
2
|
+
import { type prettyTimeOptions } from "./time.js";
|
|
3
|
+
interface constructorOptions {
|
|
4
|
+
title?: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
complete?: string;
|
|
7
|
+
incomplete?: string;
|
|
8
|
+
clear?: boolean;
|
|
9
|
+
interval?: number;
|
|
10
|
+
display?: string;
|
|
11
|
+
prettyTime?: boolean;
|
|
12
|
+
output?: typeof dntShim.Deno.stdout | typeof dntShim.Deno.stderr;
|
|
13
|
+
}
|
|
14
|
+
interface renderOptions {
|
|
15
|
+
completed: number;
|
|
16
|
+
text?: string;
|
|
17
|
+
total?: number;
|
|
18
|
+
complete?: string;
|
|
19
|
+
incomplete?: string;
|
|
20
|
+
prettyTimeOptions?: prettyTimeOptions;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* MultiProgressBar multiple progress bars.
|
|
24
|
+
*/
|
|
25
|
+
export declare class MultiProgressBar {
|
|
26
|
+
#private;
|
|
27
|
+
width: number;
|
|
28
|
+
complete: string;
|
|
29
|
+
incomplete: string;
|
|
30
|
+
clear: boolean;
|
|
31
|
+
interval: number;
|
|
32
|
+
display: string;
|
|
33
|
+
prettyTime: boolean;
|
|
34
|
+
private lastStr;
|
|
35
|
+
private start;
|
|
36
|
+
private lastRenderTime;
|
|
37
|
+
private encoder;
|
|
38
|
+
private writer;
|
|
39
|
+
/**
|
|
40
|
+
* Title, total, complete, incomplete, can also be set or changed in the render method
|
|
41
|
+
*
|
|
42
|
+
* - title Progress bar title, default: ''
|
|
43
|
+
* - width the displayed width of the progress, default: 50
|
|
44
|
+
* - complete completion character, default: colors.bgGreen(' '), can use any string
|
|
45
|
+
* - incomplete incomplete character, default: colors.bgWhite(' '), can use any string
|
|
46
|
+
* - clear clear the bar on completion, default: false
|
|
47
|
+
* - interval minimum time between updates in milliseconds, default: 16
|
|
48
|
+
* - display What is displayed and display order, default: ':bar :text :percent :time :completed/:total'
|
|
49
|
+
* - prettyTime Whether to pretty print time and eta
|
|
50
|
+
* - output Output stream, can be Deno.stdout or Deno.stderr, default is Deno.stdout
|
|
51
|
+
*/
|
|
52
|
+
constructor({ title, width, complete, incomplete, clear, interval, display, prettyTime, output, }?: constructorOptions);
|
|
53
|
+
/**
|
|
54
|
+
* "render" the progress bar
|
|
55
|
+
*
|
|
56
|
+
* - `bars` progress bars
|
|
57
|
+
* - `completed` completed value
|
|
58
|
+
* - `total` optional, total number of ticks to complete, default: 100
|
|
59
|
+
* - `text` optional, text displayed per ProgressBar, default: ''
|
|
60
|
+
* - `complete` - optional, completion character
|
|
61
|
+
* - `incomplete` - optional, incomplete character
|
|
62
|
+
* - `prettyTimeOptions` - prettyTime options
|
|
63
|
+
*/
|
|
64
|
+
render(bars: Array<renderOptions>): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* end: end a progress bar.
|
|
67
|
+
* No need to call in most cases, unless you want to end before 100%
|
|
68
|
+
*/
|
|
69
|
+
end(): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* interrupt the progress bar and write a message above it
|
|
72
|
+
*
|
|
73
|
+
* @param message The message to write
|
|
74
|
+
*/
|
|
75
|
+
console(message: string | number): Promise<void>;
|
|
76
|
+
private write;
|
|
77
|
+
private resetScreen;
|
|
78
|
+
private get ttyColumns();
|
|
79
|
+
private breakLine;
|
|
80
|
+
private stdoutWrite;
|
|
81
|
+
private showCursor;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=multi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@deno-library/progress/1.5.1/multi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAIxD,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI/D,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;CAClE;AAED,UAAU,aAAa;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAQD;;GAEG;AACH,qBAAa,gBAAgB;;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IAMpB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,OAAO,CAAqB;IAGpC,OAAO,CAAC,MAAM,CAA0D;IAExE;;;;;;;;;;;;OAYG;gBACS,EACV,KAAU,EACV,KAAU,EACV,QAAuB,EACvB,UAAyB,EACzB,KAAa,EACb,QAAQ,EACR,OAAO,EACP,UAAkB,EAClB,MAA4B,GAC7B,GAAE,kBAAuB;IAgB1B;;;;;;;;;;OAUG;IACG,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAqFvD;;;OAGG;IACG,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAY1B;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOtD,OAAO,CAAC,KAAK;YAIC,WAAW;IAMzB,OAAO,KAAK,UAAU,GAGrB;IAED,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,UAAU;CAGnB"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _MultiProgressBar_end, _MultiProgressBar_startIndex, _MultiProgressBar_lastRows, _MultiProgressBar_bars;
|
|
13
|
+
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
14
|
+
import { bgGreen, bgWhite, stripAnsiCode } from "./deps.js";
|
|
15
|
+
import { writeAll } from "./deps.js";
|
|
16
|
+
// import type { Writer } from "./deps.ts";
|
|
17
|
+
import { prettyTime } from "./time.js";
|
|
18
|
+
const isTerminal = dntShim.Deno.stdout.isTerminal;
|
|
19
|
+
/**
|
|
20
|
+
* MultiProgressBar multiple progress bars.
|
|
21
|
+
*/
|
|
22
|
+
export class MultiProgressBar {
|
|
23
|
+
/**
|
|
24
|
+
* Title, total, complete, incomplete, can also be set or changed in the render method
|
|
25
|
+
*
|
|
26
|
+
* - title Progress bar title, default: ''
|
|
27
|
+
* - width the displayed width of the progress, default: 50
|
|
28
|
+
* - complete completion character, default: colors.bgGreen(' '), can use any string
|
|
29
|
+
* - incomplete incomplete character, default: colors.bgWhite(' '), can use any string
|
|
30
|
+
* - clear clear the bar on completion, default: false
|
|
31
|
+
* - interval minimum time between updates in milliseconds, default: 16
|
|
32
|
+
* - display What is displayed and display order, default: ':bar :text :percent :time :completed/:total'
|
|
33
|
+
* - prettyTime Whether to pretty print time and eta
|
|
34
|
+
* - output Output stream, can be Deno.stdout or Deno.stderr, default is Deno.stdout
|
|
35
|
+
*/
|
|
36
|
+
constructor({ title = "", width = 50, complete = bgGreen(" "), incomplete = bgWhite(" "), clear = false, interval, display, prettyTime = false, output = dntShim.Deno.stdout, } = {}) {
|
|
37
|
+
Object.defineProperty(this, "width", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: void 0
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(this, "complete", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(this, "incomplete", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: void 0
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(this, "clear", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
value: void 0
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(this, "interval", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
configurable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
value: void 0
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(this, "display", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: void 0
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(this, "prettyTime", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: void 0
|
|
78
|
+
});
|
|
79
|
+
_MultiProgressBar_end.set(this, false);
|
|
80
|
+
_MultiProgressBar_startIndex.set(this, 0);
|
|
81
|
+
_MultiProgressBar_lastRows.set(this, 0);
|
|
82
|
+
_MultiProgressBar_bars.set(this, []);
|
|
83
|
+
Object.defineProperty(this, "lastStr", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
configurable: true,
|
|
86
|
+
writable: true,
|
|
87
|
+
value: ""
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(this, "start", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
configurable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
value: Date.now()
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(this, "lastRenderTime", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
writable: true,
|
|
99
|
+
value: 0
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(this, "encoder", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
configurable: true,
|
|
104
|
+
writable: true,
|
|
105
|
+
value: new TextEncoder()
|
|
106
|
+
});
|
|
107
|
+
// private writer: WritableStreamDefaultWriter<Uint8Array>;
|
|
108
|
+
// private writer: Writer;
|
|
109
|
+
Object.defineProperty(this, "writer", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
configurable: true,
|
|
112
|
+
writable: true,
|
|
113
|
+
value: void 0
|
|
114
|
+
});
|
|
115
|
+
if (title != "") {
|
|
116
|
+
__classPrivateFieldGet(this, _MultiProgressBar_bars, "f").push({ str: title });
|
|
117
|
+
__classPrivateFieldSet(this, _MultiProgressBar_startIndex, 1, "f");
|
|
118
|
+
}
|
|
119
|
+
this.width = width;
|
|
120
|
+
this.complete = complete;
|
|
121
|
+
this.incomplete = incomplete;
|
|
122
|
+
this.clear = clear;
|
|
123
|
+
this.interval = interval ?? 16;
|
|
124
|
+
this.display = display ?? ":bar :text :percent :time :completed/:total";
|
|
125
|
+
this.prettyTime = prettyTime;
|
|
126
|
+
// this.writer = output.writable.getWriter();
|
|
127
|
+
this.writer = output;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* "render" the progress bar
|
|
131
|
+
*
|
|
132
|
+
* - `bars` progress bars
|
|
133
|
+
* - `completed` completed value
|
|
134
|
+
* - `total` optional, total number of ticks to complete, default: 100
|
|
135
|
+
* - `text` optional, text displayed per ProgressBar, default: ''
|
|
136
|
+
* - `complete` - optional, completion character
|
|
137
|
+
* - `incomplete` - optional, incomplete character
|
|
138
|
+
* - `prettyTimeOptions` - prettyTime options
|
|
139
|
+
*/
|
|
140
|
+
async render(bars) {
|
|
141
|
+
if (__classPrivateFieldGet(this, _MultiProgressBar_end, "f") || !isTerminal)
|
|
142
|
+
return;
|
|
143
|
+
const now = Date.now();
|
|
144
|
+
const ms = now - this.lastRenderTime;
|
|
145
|
+
this.lastRenderTime = now;
|
|
146
|
+
let end = true;
|
|
147
|
+
let index = __classPrivateFieldGet(this, _MultiProgressBar_startIndex, "f");
|
|
148
|
+
for (const { completed, total = 100, text = "", ...options } of bars) {
|
|
149
|
+
if (completed < 0) {
|
|
150
|
+
throw new Error(`completed must greater than or equal to 0`);
|
|
151
|
+
}
|
|
152
|
+
if (!Number.isInteger(total))
|
|
153
|
+
throw new Error(`total must be 'number'`);
|
|
154
|
+
if (__classPrivateFieldGet(this, _MultiProgressBar_bars, "f")[index] && __classPrivateFieldGet(this, _MultiProgressBar_bars, "f")[index].end) {
|
|
155
|
+
index++;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
end = false;
|
|
159
|
+
const percent = ((completed / total) * 100).toFixed(2) + "%";
|
|
160
|
+
const time = this.prettyTime
|
|
161
|
+
? prettyTime(now - this.start, options.prettyTimeOptions)
|
|
162
|
+
: ((now - this.start) / 1000).toFixed(1) + "s";
|
|
163
|
+
const msEta = completed >= total
|
|
164
|
+
? 0
|
|
165
|
+
: (total / completed - 1) * (now - this.start);
|
|
166
|
+
const eta = completed == 0
|
|
167
|
+
? "-"
|
|
168
|
+
: this.prettyTime
|
|
169
|
+
? prettyTime(msEta, options.prettyTimeOptions)
|
|
170
|
+
: (msEta / 1000).toFixed(1) + "s";
|
|
171
|
+
// :bar :text :percent :time :completed/:total
|
|
172
|
+
let str = this.display
|
|
173
|
+
.replace(":text", text)
|
|
174
|
+
.replace(":time", time)
|
|
175
|
+
.replace(":eta", eta)
|
|
176
|
+
.replace(":percent", percent)
|
|
177
|
+
.replace(":completed", completed + "")
|
|
178
|
+
.replace(":total", total + "");
|
|
179
|
+
// compute the available space (non-zero) for the bar
|
|
180
|
+
const availableSpace = Math.max(0, this.ttyColumns - stripAnsiCode(str.replace(":bar", "")).length);
|
|
181
|
+
const width = Math.min(this.width, availableSpace);
|
|
182
|
+
// :bar
|
|
183
|
+
const completeLength = Math.round((width * completed) / total);
|
|
184
|
+
const complete = new Array(completeLength)
|
|
185
|
+
.fill(options.complete ?? this.complete)
|
|
186
|
+
.join("");
|
|
187
|
+
const incomplete = new Array(width - completeLength)
|
|
188
|
+
.fill(options.incomplete ?? this.incomplete)
|
|
189
|
+
.join("");
|
|
190
|
+
str = str.replace(":bar", complete + incomplete);
|
|
191
|
+
const strLen = stripAnsiCode(str).length;
|
|
192
|
+
if (__classPrivateFieldGet(this, _MultiProgressBar_bars, "f")[index] && str != __classPrivateFieldGet(this, _MultiProgressBar_bars, "f")[index].str) {
|
|
193
|
+
const lastStrLen = __classPrivateFieldGet(this, _MultiProgressBar_bars, "f")[index].strLen;
|
|
194
|
+
if (strLen < lastStrLen) {
|
|
195
|
+
str += " ".repeat(lastStrLen - strLen);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
__classPrivateFieldGet(this, _MultiProgressBar_bars, "f")[index++] = {
|
|
199
|
+
str,
|
|
200
|
+
strLen,
|
|
201
|
+
end: completed >= total,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (ms < this.interval && !end)
|
|
205
|
+
return;
|
|
206
|
+
const str = __classPrivateFieldGet(this, _MultiProgressBar_bars, "f").map((v) => v.str).join("\n");
|
|
207
|
+
if (str !== this.lastStr) {
|
|
208
|
+
await this.resetScreen();
|
|
209
|
+
await this.write(str);
|
|
210
|
+
this.lastStr = str;
|
|
211
|
+
__classPrivateFieldSet(this, _MultiProgressBar_lastRows, __classPrivateFieldGet(this, _MultiProgressBar_bars, "f").length, "f");
|
|
212
|
+
}
|
|
213
|
+
if (end)
|
|
214
|
+
await this.end();
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* end: end a progress bar.
|
|
218
|
+
* No need to call in most cases, unless you want to end before 100%
|
|
219
|
+
*/
|
|
220
|
+
async end() {
|
|
221
|
+
if (__classPrivateFieldGet(this, _MultiProgressBar_end, "f"))
|
|
222
|
+
return;
|
|
223
|
+
__classPrivateFieldSet(this, _MultiProgressBar_end, true, "f");
|
|
224
|
+
if (this.clear) {
|
|
225
|
+
await this.resetScreen();
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
await this.breakLine();
|
|
229
|
+
}
|
|
230
|
+
await this.showCursor();
|
|
231
|
+
// this.writer.releaseLock();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* interrupt the progress bar and write a message above it
|
|
235
|
+
*
|
|
236
|
+
* @param message The message to write
|
|
237
|
+
*/
|
|
238
|
+
async console(message) {
|
|
239
|
+
await this.resetScreen();
|
|
240
|
+
await this.write(`${message}`);
|
|
241
|
+
await this.breakLine();
|
|
242
|
+
await this.write(this.lastStr);
|
|
243
|
+
}
|
|
244
|
+
write(msg) {
|
|
245
|
+
return this.stdoutWrite(`${msg}\x1b[?25l`);
|
|
246
|
+
}
|
|
247
|
+
async resetScreen() {
|
|
248
|
+
if (__classPrivateFieldGet(this, _MultiProgressBar_lastRows, "f") > 0) {
|
|
249
|
+
await this.stdoutWrite("\x1b[" + (__classPrivateFieldGet(this, _MultiProgressBar_lastRows, "f") - 1) + "A\r\x1b[?0J");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
get ttyColumns() {
|
|
253
|
+
if (!dntShim.Deno.stdout.isTerminal())
|
|
254
|
+
return 100;
|
|
255
|
+
return dntShim.Deno.consoleSize().columns;
|
|
256
|
+
}
|
|
257
|
+
breakLine() {
|
|
258
|
+
return this.stdoutWrite("\n");
|
|
259
|
+
}
|
|
260
|
+
stdoutWrite(msg) {
|
|
261
|
+
// return this.writer.write(this.encoder.encode(msg));
|
|
262
|
+
return writeAll(this.writer, this.encoder.encode(msg));
|
|
263
|
+
}
|
|
264
|
+
showCursor() {
|
|
265
|
+
return this.stdoutWrite("\x1b[?25h");
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
_MultiProgressBar_end = new WeakMap(), _MultiProgressBar_startIndex = new WeakMap(), _MultiProgressBar_lastRows = new WeakMap(), _MultiProgressBar_bars = new WeakMap();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prettyTime options
|
|
3
|
+
* - withSpaces Whether to use spaces to separate times, `1d2h3m5s` or `1d 2h 3m 5s`, default false
|
|
4
|
+
* - toFixedVal value pass to toFixed for seconds, default 1
|
|
5
|
+
* - longFormat Whether to use a long format, default false, `1d2h3m5s` or `1days 2hours 3minutes 5seconds`
|
|
6
|
+
*/
|
|
7
|
+
export interface prettyTimeOptions {
|
|
8
|
+
withSpaces?: boolean;
|
|
9
|
+
toFixedVal?: number;
|
|
10
|
+
longFormat?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert time duration to a human readable string: 5d1h20m30s
|
|
14
|
+
*
|
|
15
|
+
* - milliseconds The number to format, unit milliseconds
|
|
16
|
+
*/
|
|
17
|
+
export declare function prettyTime(milliseconds: number, options?: prettyTimeOptions): string;
|
|
18
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@deno-library/progress/1.5.1/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,iBAIR,GACA,MAAM,CA2BR"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert time duration to a human readable string: 5d1h20m30s
|
|
3
|
+
*
|
|
4
|
+
* - milliseconds The number to format, unit milliseconds
|
|
5
|
+
*/
|
|
6
|
+
export function prettyTime(milliseconds, options = {
|
|
7
|
+
withSpaces: false,
|
|
8
|
+
toFixedVal: 1,
|
|
9
|
+
longFormat: false,
|
|
10
|
+
}) {
|
|
11
|
+
let second = milliseconds / 1000;
|
|
12
|
+
if (second < 60) {
|
|
13
|
+
return unitToString(second, 0, options);
|
|
14
|
+
}
|
|
15
|
+
let minute = Math.floor(second / 60);
|
|
16
|
+
second %= 60;
|
|
17
|
+
if (minute < 60) {
|
|
18
|
+
return unitToString(minute, 1, options) + unitToString(second, 0, options);
|
|
19
|
+
}
|
|
20
|
+
let hour = Math.floor(minute / 60);
|
|
21
|
+
minute %= 60;
|
|
22
|
+
if (hour < 24) {
|
|
23
|
+
return (unitToString(hour, 2, options) +
|
|
24
|
+
unitToString(minute, 1, options) +
|
|
25
|
+
unitToString(second, 0, options));
|
|
26
|
+
}
|
|
27
|
+
const day = Math.floor(hour / 24);
|
|
28
|
+
hour %= 24;
|
|
29
|
+
return (unitToString(day, 3, options) +
|
|
30
|
+
unitToString(hour, 2, options) +
|
|
31
|
+
unitToString(minute, 1, options) +
|
|
32
|
+
unitToString(second, 0, options));
|
|
33
|
+
}
|
|
34
|
+
function unitToString(val, i, { withSpaces = false, toFixedVal = 1, longFormat = false }) {
|
|
35
|
+
const units = longFormat
|
|
36
|
+
? ["second", "minute", "hour", "day"]
|
|
37
|
+
: ["s", "m", "h", "d"];
|
|
38
|
+
const unit = longFormat && (val >= 2 || (val > 1 && toFixedVal > 0))
|
|
39
|
+
? units[i] + "s"
|
|
40
|
+
: units[i];
|
|
41
|
+
if (i == 0) {
|
|
42
|
+
return val.toFixed(toFixedVal) + unit;
|
|
43
|
+
}
|
|
44
|
+
return val + (withSpaces ? unit + " " : unit);
|
|
45
|
+
}
|