@ontos-ai/knowhere-claw 0.1.4 → 0.1.5
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 +3 -0
- package/dist/_virtual/_rolldown/runtime.js +2 -1
- package/dist/config.js +115 -1
- package/dist/connect-builder.js +181 -0
- package/dist/graph-builder.js +204 -0
- package/dist/index.js +15 -3
- package/dist/kg-service.js +249 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js +212 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js +35 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.js +2609 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/napi.js +142 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js +103 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js +199 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/package.js +67 -0
- package/dist/node_modules/.pnpm/abbrev@1.1.1/node_modules/abbrev/abbrev.js +59 -0
- package/dist/node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js +11 -0
- package/dist/node_modules/.pnpm/aproba@2.1.0/node_modules/aproba/index.js +119 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/index.js +13 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker-base.js +16 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker-group.js +98 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker-stream.js +37 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker.js +32 -0
- package/dist/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js +53 -0
- package/dist/node_modules/.pnpm/brace-expansion@1.1.12/node_modules/brace-expansion/index.js +132 -0
- package/dist/node_modules/.pnpm/color-support@1.1.3/node_modules/color-support/browser.js +18 -0
- package/dist/node_modules/.pnpm/concat-map@0.0.1/node_modules/concat-map/index.js +19 -0
- package/dist/node_modules/.pnpm/console-control-strings@1.1.0/node_modules/console-control-strings/index.js +104 -0
- package/dist/node_modules/.pnpm/delegates@1.0.0/node_modules/delegates/index.js +104 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/detect-libc.js +221 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/elf.js +26 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/filesystem.js +48 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/process.js +24 -0
- package/dist/node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js +10 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy-sync.js +120 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy.js +100 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/index.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/empty/index.js +43 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/file.js +53 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/index.js +27 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/link.js +56 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-paths.js +89 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-type.js +35 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink.js +81 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/fs/index.js +113 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/index.js +29 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/index.js +22 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/jsonfile.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json-sync.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/index.js +20 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/make-dir.js +33 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/utils.js +17 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/move/index.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move-sync.js +56 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move.js +49 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/output-file/index.js +30 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/path-exists/index.js +18 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/remove/index.js +27 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/util/async.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/util/stat.js +131 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/util/utimes.js +34 -0
- package/dist/node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js +51 -0
- package/dist/node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js +171 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/base-theme.js +21 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/error.js +27 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/has-color.js +9 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/index.js +224 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/plumbing.js +48 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/process.js +8 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/progress-bar.js +46 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/render-template.js +155 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/set-immediate.js +14 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/set-interval.js +8 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/spin.js +10 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/template-item.js +58 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/theme-set.js +99 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/themes.js +67 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/wide-truncate.js +22 -0
- package/dist/node_modules/.pnpm/glob@7.2.3/node_modules/glob/common.js +162 -0
- package/dist/node_modules/.pnpm/glob@7.2.3/node_modules/glob/glob.js +451 -0
- package/dist/node_modules/.pnpm/glob@7.2.3/node_modules/glob/sync.js +280 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js +20 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js +362 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js +92 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js +255 -0
- package/dist/node_modules/.pnpm/has-unicode@2.0.1/node_modules/has-unicode/index.js +14 -0
- package/dist/node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js +45 -0
- package/dist/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js +27 -0
- package/dist/node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js +14 -0
- package/dist/node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/index.js +68 -0
- package/dist/node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/utils.js +19 -0
- package/dist/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js +578 -0
- package/dist/node_modules/.pnpm/nodejieba@2.6.0/node_modules/nodejieba/index.js +46 -0
- package/dist/node_modules/.pnpm/nopt@5.0.0/node_modules/nopt/lib/nopt.js +330 -0
- package/dist/node_modules/.pnpm/npmlog@5.0.1/node_modules/npmlog/log.js +305 -0
- package/dist/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +54 -0
- package/dist/node_modules/.pnpm/once@1.4.0/node_modules/once/once.js +44 -0
- package/dist/node_modules/.pnpm/path-is-absolute@1.0.1/node_modules/path-is-absolute/index.js +19 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors-browser.js +88 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js +75 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js +19 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js +666 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js +89 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js +423 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js +172 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js +243 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js +77 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +87 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from-browser.js +10 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js +80 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js +21 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream-browser.js +8 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable-browser.js +23 -0
- package/dist/node_modules/.pnpm/rimraf@3.0.2/node_modules/rimraf/rimraf.js +229 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js +79 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js +282 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js +186 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js +14 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js +41 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js +34 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js +15 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js +32 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js +22 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js +19 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js +14 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js +18 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js +14 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js +99 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js +28 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js +8 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js +23 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js +36 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js +15 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js +84 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js +15 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js +31 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js +31 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js +45 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js +64 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js +35 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js +102 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js +17 -0
- package/dist/node_modules/.pnpm/set-blocking@2.0.0/node_modules/set-blocking/index.js +12 -0
- package/dist/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +130 -0
- package/dist/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +16 -0
- package/dist/node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js +30 -0
- package/dist/node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js +10 -0
- package/dist/node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js +26 -0
- package/dist/node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/browser.js +59 -0
- package/dist/node_modules/.pnpm/wide-align@1.1.5/node_modules/wide-align/align.js +52 -0
- package/dist/node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js +26 -0
- package/dist/tools.js +163 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +15 -6
- package/skills/knowhere/SKILL.md +1 -1
- package/dist/__tests__/channel-route.test.d.ts +0 -1
- package/dist/__tests__/ingest-tool.test.d.ts +0 -1
- package/dist/__tests__/read-result-file-tool.test.d.ts +0 -1
- package/dist/__tests__/tracker-progress.test.d.ts +0 -1
- package/dist/channel-delivery.d.ts +0 -21
- package/dist/client.d.ts +0 -33
- package/dist/config.d.ts +0 -12
- package/dist/error-message.d.ts +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/parser.d.ts +0 -16
- package/dist/session.d.ts +0 -11
- package/dist/store.d.ts +0 -79
- package/dist/text.d.ts +0 -10
- package/dist/tools.d.ts +0 -8
- package/dist/tracker-progress.d.ts +0 -10
- package/dist/types.d.ts +0 -248
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/error.js
|
|
3
|
+
var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
var util = __require("util");
|
|
5
|
+
var User = exports.User = function User(msg) {
|
|
6
|
+
var err = new Error(msg);
|
|
7
|
+
Error.captureStackTrace(err, User);
|
|
8
|
+
err.code = "EGAUGE";
|
|
9
|
+
return err;
|
|
10
|
+
};
|
|
11
|
+
exports.MissingTemplateValue = function MissingTemplateValue(item, values) {
|
|
12
|
+
var err = new User(util.format("Missing template value \"%s\"", item.type));
|
|
13
|
+
Error.captureStackTrace(err, MissingTemplateValue);
|
|
14
|
+
err.template = item;
|
|
15
|
+
err.values = values;
|
|
16
|
+
return err;
|
|
17
|
+
};
|
|
18
|
+
exports.Internal = function Internal(msg) {
|
|
19
|
+
var err = new Error(msg);
|
|
20
|
+
Error.captureStackTrace(err, Internal);
|
|
21
|
+
err.code = "EGAUGEINTERNAL";
|
|
22
|
+
return err;
|
|
23
|
+
};
|
|
24
|
+
}));
|
|
25
|
+
//#endregion
|
|
26
|
+
export default require_error();
|
|
27
|
+
export { require_error };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_browser } from "../../../color-support@1.1.3/node_modules/color-support/browser.js";
|
|
3
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/has-color.js
|
|
4
|
+
var require_has_color = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
module.exports = require_browser()().hasBasic;
|
|
6
|
+
}));
|
|
7
|
+
//#endregion
|
|
8
|
+
export default require_has_color();
|
|
9
|
+
export { require_has_color };
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_plumbing } from "./plumbing.js";
|
|
3
|
+
import { require_has_unicode } from "../../../has-unicode@2.0.1/node_modules/has-unicode/index.js";
|
|
4
|
+
import { require_has_color } from "./has-color.js";
|
|
5
|
+
import { require_signal_exit } from "../../../signal-exit@3.0.7/node_modules/signal-exit/index.js";
|
|
6
|
+
import { require_themes } from "./themes.js";
|
|
7
|
+
import { require_set_interval } from "./set-interval.js";
|
|
8
|
+
import { require_process } from "./process.js";
|
|
9
|
+
import { require_set_immediate } from "./set-immediate.js";
|
|
10
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/index.js
|
|
11
|
+
var require_gauge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12
|
+
var Plumbing = require_plumbing();
|
|
13
|
+
var hasUnicode = require_has_unicode();
|
|
14
|
+
var hasColor = require_has_color();
|
|
15
|
+
var onExit = require_signal_exit();
|
|
16
|
+
var defaultThemes = require_themes();
|
|
17
|
+
var setInterval = require_set_interval();
|
|
18
|
+
var process = require_process();
|
|
19
|
+
var setImmediate = require_set_immediate();
|
|
20
|
+
module.exports = Gauge;
|
|
21
|
+
function callWith(obj, method) {
|
|
22
|
+
return function() {
|
|
23
|
+
return method.call(obj);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function Gauge(arg1, arg2) {
|
|
27
|
+
var options, writeTo;
|
|
28
|
+
if (arg1 && arg1.write) {
|
|
29
|
+
writeTo = arg1;
|
|
30
|
+
options = arg2 || {};
|
|
31
|
+
} else if (arg2 && arg2.write) {
|
|
32
|
+
writeTo = arg2;
|
|
33
|
+
options = arg1 || {};
|
|
34
|
+
} else {
|
|
35
|
+
writeTo = process.stderr;
|
|
36
|
+
options = arg1 || arg2 || {};
|
|
37
|
+
}
|
|
38
|
+
this._status = {
|
|
39
|
+
spun: 0,
|
|
40
|
+
section: "",
|
|
41
|
+
subsection: ""
|
|
42
|
+
};
|
|
43
|
+
this._paused = false;
|
|
44
|
+
this._disabled = true;
|
|
45
|
+
this._showing = false;
|
|
46
|
+
this._onScreen = false;
|
|
47
|
+
this._needsRedraw = false;
|
|
48
|
+
this._hideCursor = options.hideCursor == null ? true : options.hideCursor;
|
|
49
|
+
this._fixedFramerate = options.fixedFramerate == null ? !/^v0\.8\./.test(process.version) : options.fixedFramerate;
|
|
50
|
+
this._lastUpdateAt = null;
|
|
51
|
+
this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval;
|
|
52
|
+
this._themes = options.themes || defaultThemes;
|
|
53
|
+
this._theme = options.theme;
|
|
54
|
+
var theme = this._computeTheme(options.theme);
|
|
55
|
+
var template = options.template || [
|
|
56
|
+
{
|
|
57
|
+
type: "progressbar",
|
|
58
|
+
length: 20
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "activityIndicator",
|
|
62
|
+
kerning: 1,
|
|
63
|
+
length: 1
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "section",
|
|
67
|
+
kerning: 1,
|
|
68
|
+
default: ""
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "subsection",
|
|
72
|
+
kerning: 1,
|
|
73
|
+
default: ""
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
this.setWriteTo(writeTo, options.tty);
|
|
77
|
+
this._gauge = new (options.Plumbing || Plumbing)(theme, template, this.getWidth());
|
|
78
|
+
this._$$doRedraw = callWith(this, this._doRedraw);
|
|
79
|
+
this._$$handleSizeChange = callWith(this, this._handleSizeChange);
|
|
80
|
+
this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit;
|
|
81
|
+
this._removeOnExit = null;
|
|
82
|
+
if (options.enabled || options.enabled == null && this._tty && this._tty.isTTY) this.enable();
|
|
83
|
+
else this.disable();
|
|
84
|
+
}
|
|
85
|
+
Gauge.prototype = {};
|
|
86
|
+
Gauge.prototype.isEnabled = function() {
|
|
87
|
+
return !this._disabled;
|
|
88
|
+
};
|
|
89
|
+
Gauge.prototype.setTemplate = function(template) {
|
|
90
|
+
this._gauge.setTemplate(template);
|
|
91
|
+
if (this._showing) this._requestRedraw();
|
|
92
|
+
};
|
|
93
|
+
Gauge.prototype._computeTheme = function(theme) {
|
|
94
|
+
if (!theme) theme = {};
|
|
95
|
+
if (typeof theme === "string") theme = this._themes.getTheme(theme);
|
|
96
|
+
else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) {
|
|
97
|
+
var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode;
|
|
98
|
+
var useColor = theme.hasColor == null ? hasColor : theme.hasColor;
|
|
99
|
+
theme = this._themes.getDefault({
|
|
100
|
+
hasUnicode: useUnicode,
|
|
101
|
+
hasColor: useColor,
|
|
102
|
+
platform: theme.platform
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return theme;
|
|
106
|
+
};
|
|
107
|
+
Gauge.prototype.setThemeset = function(themes) {
|
|
108
|
+
this._themes = themes;
|
|
109
|
+
this.setTheme(this._theme);
|
|
110
|
+
};
|
|
111
|
+
Gauge.prototype.setTheme = function(theme) {
|
|
112
|
+
this._gauge.setTheme(this._computeTheme(theme));
|
|
113
|
+
if (this._showing) this._requestRedraw();
|
|
114
|
+
this._theme = theme;
|
|
115
|
+
};
|
|
116
|
+
Gauge.prototype._requestRedraw = function() {
|
|
117
|
+
this._needsRedraw = true;
|
|
118
|
+
if (!this._fixedFramerate) this._doRedraw();
|
|
119
|
+
};
|
|
120
|
+
Gauge.prototype.getWidth = function() {
|
|
121
|
+
return (this._tty && this._tty.columns || 80) - 1;
|
|
122
|
+
};
|
|
123
|
+
Gauge.prototype.setWriteTo = function(writeTo, tty) {
|
|
124
|
+
var enabled = !this._disabled;
|
|
125
|
+
if (enabled) this.disable();
|
|
126
|
+
this._writeTo = writeTo;
|
|
127
|
+
this._tty = tty || writeTo === process.stderr && process.stdout.isTTY && process.stdout || writeTo.isTTY && writeTo || this._tty;
|
|
128
|
+
if (this._gauge) this._gauge.setWidth(this.getWidth());
|
|
129
|
+
if (enabled) this.enable();
|
|
130
|
+
};
|
|
131
|
+
Gauge.prototype.enable = function() {
|
|
132
|
+
if (!this._disabled) return;
|
|
133
|
+
this._disabled = false;
|
|
134
|
+
if (this._tty) this._enableEvents();
|
|
135
|
+
if (this._showing) this.show();
|
|
136
|
+
};
|
|
137
|
+
Gauge.prototype.disable = function() {
|
|
138
|
+
if (this._disabled) return;
|
|
139
|
+
if (this._showing) {
|
|
140
|
+
this._lastUpdateAt = null;
|
|
141
|
+
this._showing = false;
|
|
142
|
+
this._doRedraw();
|
|
143
|
+
this._showing = true;
|
|
144
|
+
}
|
|
145
|
+
this._disabled = true;
|
|
146
|
+
if (this._tty) this._disableEvents();
|
|
147
|
+
};
|
|
148
|
+
Gauge.prototype._enableEvents = function() {
|
|
149
|
+
if (this._cleanupOnExit) this._removeOnExit = onExit(callWith(this, this.disable));
|
|
150
|
+
this._tty.on("resize", this._$$handleSizeChange);
|
|
151
|
+
if (this._fixedFramerate) {
|
|
152
|
+
this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval);
|
|
153
|
+
if (this.redrawTracker.unref) this.redrawTracker.unref();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
Gauge.prototype._disableEvents = function() {
|
|
157
|
+
this._tty.removeListener("resize", this._$$handleSizeChange);
|
|
158
|
+
if (this._fixedFramerate) clearInterval(this.redrawTracker);
|
|
159
|
+
if (this._removeOnExit) this._removeOnExit();
|
|
160
|
+
};
|
|
161
|
+
Gauge.prototype.hide = function(cb) {
|
|
162
|
+
if (this._disabled) return cb && process.nextTick(cb);
|
|
163
|
+
if (!this._showing) return cb && process.nextTick(cb);
|
|
164
|
+
this._showing = false;
|
|
165
|
+
this._doRedraw();
|
|
166
|
+
cb && setImmediate(cb);
|
|
167
|
+
};
|
|
168
|
+
Gauge.prototype.show = function(section, completed) {
|
|
169
|
+
this._showing = true;
|
|
170
|
+
if (typeof section === "string") this._status.section = section;
|
|
171
|
+
else if (typeof section === "object") {
|
|
172
|
+
var sectionKeys = Object.keys(section);
|
|
173
|
+
for (var ii = 0; ii < sectionKeys.length; ++ii) {
|
|
174
|
+
var key = sectionKeys[ii];
|
|
175
|
+
this._status[key] = section[key];
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (completed != null) this._status.completed = completed;
|
|
179
|
+
if (this._disabled) return;
|
|
180
|
+
this._requestRedraw();
|
|
181
|
+
};
|
|
182
|
+
Gauge.prototype.pulse = function(subsection) {
|
|
183
|
+
this._status.subsection = subsection || "";
|
|
184
|
+
this._status.spun++;
|
|
185
|
+
if (this._disabled) return;
|
|
186
|
+
if (!this._showing) return;
|
|
187
|
+
this._requestRedraw();
|
|
188
|
+
};
|
|
189
|
+
Gauge.prototype._handleSizeChange = function() {
|
|
190
|
+
this._gauge.setWidth(this._tty.columns - 1);
|
|
191
|
+
this._requestRedraw();
|
|
192
|
+
};
|
|
193
|
+
Gauge.prototype._doRedraw = function() {
|
|
194
|
+
if (this._disabled || this._paused) return;
|
|
195
|
+
if (!this._fixedFramerate) {
|
|
196
|
+
var now = Date.now();
|
|
197
|
+
if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return;
|
|
198
|
+
this._lastUpdateAt = now;
|
|
199
|
+
}
|
|
200
|
+
if (!this._showing && this._onScreen) {
|
|
201
|
+
this._onScreen = false;
|
|
202
|
+
var result = this._gauge.hide();
|
|
203
|
+
if (this._hideCursor) result += this._gauge.showCursor();
|
|
204
|
+
return this._writeTo.write(result);
|
|
205
|
+
}
|
|
206
|
+
if (!this._showing && !this._onScreen) return;
|
|
207
|
+
if (this._showing && !this._onScreen) {
|
|
208
|
+
this._onScreen = true;
|
|
209
|
+
this._needsRedraw = true;
|
|
210
|
+
if (this._hideCursor) this._writeTo.write(this._gauge.hideCursor());
|
|
211
|
+
}
|
|
212
|
+
if (!this._needsRedraw) return;
|
|
213
|
+
if (!this._writeTo.write(this._gauge.show(this._status))) {
|
|
214
|
+
this._paused = true;
|
|
215
|
+
this._writeTo.on("drain", callWith(this, function() {
|
|
216
|
+
this._paused = false;
|
|
217
|
+
this._doRedraw();
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
}));
|
|
222
|
+
//#endregion
|
|
223
|
+
export default require_gauge();
|
|
224
|
+
export { require_gauge };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_console_control_strings } from "../../../console-control-strings@1.1.0/node_modules/console-control-strings/index.js";
|
|
3
|
+
import { require_aproba } from "../../../aproba@2.1.0/node_modules/aproba/index.js";
|
|
4
|
+
import { require_render_template } from "./render-template.js";
|
|
5
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/plumbing.js
|
|
6
|
+
var require_plumbing = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
7
|
+
var consoleControl = require_console_control_strings();
|
|
8
|
+
var renderTemplate = require_render_template();
|
|
9
|
+
var validate = require_aproba();
|
|
10
|
+
var Plumbing = module.exports = function(theme, template, width) {
|
|
11
|
+
if (!width) width = 80;
|
|
12
|
+
validate("OAN", [
|
|
13
|
+
theme,
|
|
14
|
+
template,
|
|
15
|
+
width
|
|
16
|
+
]);
|
|
17
|
+
this.showing = false;
|
|
18
|
+
this.theme = theme;
|
|
19
|
+
this.width = width;
|
|
20
|
+
this.template = template;
|
|
21
|
+
};
|
|
22
|
+
Plumbing.prototype = {};
|
|
23
|
+
Plumbing.prototype.setTheme = function(theme) {
|
|
24
|
+
validate("O", [theme]);
|
|
25
|
+
this.theme = theme;
|
|
26
|
+
};
|
|
27
|
+
Plumbing.prototype.setTemplate = function(template) {
|
|
28
|
+
validate("A", [template]);
|
|
29
|
+
this.template = template;
|
|
30
|
+
};
|
|
31
|
+
Plumbing.prototype.setWidth = function(width) {
|
|
32
|
+
validate("N", [width]);
|
|
33
|
+
this.width = width;
|
|
34
|
+
};
|
|
35
|
+
Plumbing.prototype.hide = function() {
|
|
36
|
+
return consoleControl.gotoSOL() + consoleControl.eraseLine();
|
|
37
|
+
};
|
|
38
|
+
Plumbing.prototype.hideCursor = consoleControl.hideCursor;
|
|
39
|
+
Plumbing.prototype.showCursor = consoleControl.showCursor;
|
|
40
|
+
Plumbing.prototype.show = function(status) {
|
|
41
|
+
var values = Object.create(this.theme);
|
|
42
|
+
for (var key in status) values[key] = status[key];
|
|
43
|
+
return renderTemplate(this.width, this.template, values).trim() + consoleControl.color("reset") + consoleControl.eraseLine() + consoleControl.gotoSOL();
|
|
44
|
+
};
|
|
45
|
+
}));
|
|
46
|
+
//#endregion
|
|
47
|
+
export default require_plumbing();
|
|
48
|
+
export { require_plumbing };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/process.js
|
|
3
|
+
var require_process = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = process;
|
|
5
|
+
}));
|
|
6
|
+
//#endregion
|
|
7
|
+
export default require_process();
|
|
8
|
+
export { require_process };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_string_width } from "../../../string-width@4.2.3/node_modules/string-width/index.js";
|
|
3
|
+
import { require_aproba } from "../../../aproba@2.1.0/node_modules/aproba/index.js";
|
|
4
|
+
import { require_wide_truncate } from "./wide-truncate.js";
|
|
5
|
+
import { require_render_template } from "./render-template.js";
|
|
6
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/progress-bar.js
|
|
7
|
+
var require_progress_bar = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8
|
+
var validate = require_aproba();
|
|
9
|
+
var renderTemplate = require_render_template();
|
|
10
|
+
var wideTruncate = require_wide_truncate();
|
|
11
|
+
var stringWidth = require_string_width();
|
|
12
|
+
module.exports = function(theme, width, completed) {
|
|
13
|
+
validate("ONN", [
|
|
14
|
+
theme,
|
|
15
|
+
width,
|
|
16
|
+
completed
|
|
17
|
+
]);
|
|
18
|
+
if (completed < 0) completed = 0;
|
|
19
|
+
if (completed > 1) completed = 1;
|
|
20
|
+
if (width <= 0) return "";
|
|
21
|
+
var sofar = Math.round(width * completed);
|
|
22
|
+
var rest = width - sofar;
|
|
23
|
+
return renderTemplate(width, [{
|
|
24
|
+
type: "complete",
|
|
25
|
+
value: repeat(theme.complete, sofar),
|
|
26
|
+
length: sofar
|
|
27
|
+
}, {
|
|
28
|
+
type: "remaining",
|
|
29
|
+
value: repeat(theme.remaining, rest),
|
|
30
|
+
length: rest
|
|
31
|
+
}], theme);
|
|
32
|
+
};
|
|
33
|
+
function repeat(string, width) {
|
|
34
|
+
var result = "";
|
|
35
|
+
var n = width;
|
|
36
|
+
do {
|
|
37
|
+
if (n % 2) result += string;
|
|
38
|
+
n = Math.floor(n / 2);
|
|
39
|
+
string += string;
|
|
40
|
+
} while (n && stringWidth(result) < width);
|
|
41
|
+
return wideTruncate(result, width);
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
//#endregion
|
|
45
|
+
export default require_progress_bar();
|
|
46
|
+
export { require_progress_bar };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_align } from "../../../wide-align@1.1.5/node_modules/wide-align/align.js";
|
|
3
|
+
import { require_aproba } from "../../../aproba@2.1.0/node_modules/aproba/index.js";
|
|
4
|
+
import { require_wide_truncate } from "./wide-truncate.js";
|
|
5
|
+
import { require_error } from "./error.js";
|
|
6
|
+
import { require_template_item } from "./template-item.js";
|
|
7
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/render-template.js
|
|
8
|
+
var require_render_template = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9
|
+
var align = require_align();
|
|
10
|
+
var validate = require_aproba();
|
|
11
|
+
var wideTruncate = require_wide_truncate();
|
|
12
|
+
var error = require_error();
|
|
13
|
+
var TemplateItem = require_template_item();
|
|
14
|
+
function renderValueWithValues(values) {
|
|
15
|
+
return function(item) {
|
|
16
|
+
return renderValue(item, values);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
var renderTemplate = module.exports = function(width, template, values) {
|
|
20
|
+
var rendered = prepareItems(width, template, values).map(renderValueWithValues(values)).join("");
|
|
21
|
+
return align.left(wideTruncate(rendered, width), width);
|
|
22
|
+
};
|
|
23
|
+
function preType(item) {
|
|
24
|
+
return "pre" + (item.type[0].toUpperCase() + item.type.slice(1));
|
|
25
|
+
}
|
|
26
|
+
function postType(item) {
|
|
27
|
+
return "post" + (item.type[0].toUpperCase() + item.type.slice(1));
|
|
28
|
+
}
|
|
29
|
+
function hasPreOrPost(item, values) {
|
|
30
|
+
if (!item.type) return;
|
|
31
|
+
return values[preType(item)] || values[postType(item)];
|
|
32
|
+
}
|
|
33
|
+
function generatePreAndPost(baseItem, parentValues) {
|
|
34
|
+
var item = Object.assign({}, baseItem);
|
|
35
|
+
var values = Object.create(parentValues);
|
|
36
|
+
var template = [];
|
|
37
|
+
var pre = preType(item);
|
|
38
|
+
var post = postType(item);
|
|
39
|
+
if (values[pre]) {
|
|
40
|
+
template.push({ value: values[pre] });
|
|
41
|
+
values[pre] = null;
|
|
42
|
+
}
|
|
43
|
+
item.minLength = null;
|
|
44
|
+
item.length = null;
|
|
45
|
+
item.maxLength = null;
|
|
46
|
+
template.push(item);
|
|
47
|
+
values[item.type] = values[item.type];
|
|
48
|
+
if (values[post]) {
|
|
49
|
+
template.push({ value: values[post] });
|
|
50
|
+
values[post] = null;
|
|
51
|
+
}
|
|
52
|
+
return function($1, $2, length) {
|
|
53
|
+
return renderTemplate(length, template, values);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function prepareItems(width, template, values) {
|
|
57
|
+
function cloneAndObjectify(item, index, arr) {
|
|
58
|
+
var cloned = new TemplateItem(item, width);
|
|
59
|
+
var type = cloned.type;
|
|
60
|
+
if (cloned.value == null) if (!(type in values)) if (cloned.default == null) throw new error.MissingTemplateValue(cloned, values);
|
|
61
|
+
else cloned.value = cloned.default;
|
|
62
|
+
else cloned.value = values[type];
|
|
63
|
+
if (cloned.value == null || cloned.value === "") return null;
|
|
64
|
+
cloned.index = index;
|
|
65
|
+
cloned.first = index === 0;
|
|
66
|
+
cloned.last = index === arr.length - 1;
|
|
67
|
+
if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values);
|
|
68
|
+
return cloned;
|
|
69
|
+
}
|
|
70
|
+
var output = template.map(cloneAndObjectify).filter(function(item) {
|
|
71
|
+
return item != null;
|
|
72
|
+
});
|
|
73
|
+
var remainingSpace = width;
|
|
74
|
+
var variableCount = output.length;
|
|
75
|
+
function consumeSpace(length) {
|
|
76
|
+
if (length > remainingSpace) length = remainingSpace;
|
|
77
|
+
remainingSpace -= length;
|
|
78
|
+
}
|
|
79
|
+
function finishSizing(item, length) {
|
|
80
|
+
if (item.finished) throw new error.Internal("Tried to finish template item that was already finished");
|
|
81
|
+
if (length === Infinity) throw new error.Internal("Length of template item cannot be infinity");
|
|
82
|
+
if (length != null) item.length = length;
|
|
83
|
+
item.minLength = null;
|
|
84
|
+
item.maxLength = null;
|
|
85
|
+
--variableCount;
|
|
86
|
+
item.finished = true;
|
|
87
|
+
if (item.length == null) item.length = item.getBaseLength();
|
|
88
|
+
if (item.length == null) throw new error.Internal("Finished template items must have a length");
|
|
89
|
+
consumeSpace(item.getLength());
|
|
90
|
+
}
|
|
91
|
+
output.forEach(function(item) {
|
|
92
|
+
if (!item.kerning) return;
|
|
93
|
+
var prevPadRight = item.first ? 0 : output[item.index - 1].padRight;
|
|
94
|
+
if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight;
|
|
95
|
+
if (!item.last) item.padRight = item.kerning;
|
|
96
|
+
});
|
|
97
|
+
output.forEach(function(item) {
|
|
98
|
+
if (item.getBaseLength() == null) return;
|
|
99
|
+
finishSizing(item);
|
|
100
|
+
});
|
|
101
|
+
var resized = 0;
|
|
102
|
+
var resizing;
|
|
103
|
+
var hunkSize;
|
|
104
|
+
do {
|
|
105
|
+
resizing = false;
|
|
106
|
+
hunkSize = Math.round(remainingSpace / variableCount);
|
|
107
|
+
output.forEach(function(item) {
|
|
108
|
+
if (item.finished) return;
|
|
109
|
+
if (!item.maxLength) return;
|
|
110
|
+
if (item.getMaxLength() < hunkSize) {
|
|
111
|
+
finishSizing(item, item.maxLength);
|
|
112
|
+
resizing = true;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
} while (resizing && resized++ < output.length);
|
|
116
|
+
if (resizing) throw new error.Internal("Resize loop iterated too many times while determining maxLength");
|
|
117
|
+
resized = 0;
|
|
118
|
+
do {
|
|
119
|
+
resizing = false;
|
|
120
|
+
hunkSize = Math.round(remainingSpace / variableCount);
|
|
121
|
+
output.forEach(function(item) {
|
|
122
|
+
if (item.finished) return;
|
|
123
|
+
if (!item.minLength) return;
|
|
124
|
+
if (item.getMinLength() >= hunkSize) {
|
|
125
|
+
finishSizing(item, item.minLength);
|
|
126
|
+
resizing = true;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
} while (resizing && resized++ < output.length);
|
|
130
|
+
if (resizing) throw new error.Internal("Resize loop iterated too many times while determining minLength");
|
|
131
|
+
hunkSize = Math.round(remainingSpace / variableCount);
|
|
132
|
+
output.forEach(function(item) {
|
|
133
|
+
if (item.finished) return;
|
|
134
|
+
finishSizing(item, hunkSize);
|
|
135
|
+
});
|
|
136
|
+
return output;
|
|
137
|
+
}
|
|
138
|
+
function renderFunction(item, values, length) {
|
|
139
|
+
validate("OON", arguments);
|
|
140
|
+
if (item.type) return item.value(values, values[item.type + "Theme"] || {}, length);
|
|
141
|
+
else return item.value(values, {}, length);
|
|
142
|
+
}
|
|
143
|
+
function renderValue(item, values) {
|
|
144
|
+
var length = item.getBaseLength();
|
|
145
|
+
var value = typeof item.value === "function" ? renderFunction(item, values, length) : item.value;
|
|
146
|
+
if (value == null || value === "") return "";
|
|
147
|
+
var alignWith = align[item.align] || align.left;
|
|
148
|
+
var leftPadding = item.padLeft ? align.left("", item.padLeft) : "";
|
|
149
|
+
var rightPadding = item.padRight ? align.right("", item.padRight) : "";
|
|
150
|
+
return leftPadding + alignWith(wideTruncate(String(value), length), length) + rightPadding;
|
|
151
|
+
}
|
|
152
|
+
}));
|
|
153
|
+
//#endregion
|
|
154
|
+
export default require_render_template();
|
|
155
|
+
export { require_render_template };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_process } from "./process.js";
|
|
3
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/set-immediate.js
|
|
4
|
+
var require_set_immediate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
var process = require_process();
|
|
6
|
+
try {
|
|
7
|
+
module.exports = setImmediate;
|
|
8
|
+
} catch (ex) {
|
|
9
|
+
module.exports = process.nextTick;
|
|
10
|
+
}
|
|
11
|
+
}));
|
|
12
|
+
//#endregion
|
|
13
|
+
export default require_set_immediate();
|
|
14
|
+
export { require_set_immediate };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/set-interval.js
|
|
3
|
+
var require_set_interval = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = setInterval;
|
|
5
|
+
}));
|
|
6
|
+
//#endregion
|
|
7
|
+
export default require_set_interval();
|
|
8
|
+
export { require_set_interval };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/spin.js
|
|
3
|
+
var require_spin = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = function spin(spinstr, spun) {
|
|
5
|
+
return spinstr[spun % spinstr.length];
|
|
6
|
+
};
|
|
7
|
+
}));
|
|
8
|
+
//#endregion
|
|
9
|
+
export default require_spin();
|
|
10
|
+
export { require_spin };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_string_width } from "../../../string-width@4.2.3/node_modules/string-width/index.js";
|
|
3
|
+
//#region node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/template-item.js
|
|
4
|
+
var require_template_item = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
var stringWidth = require_string_width();
|
|
6
|
+
module.exports = TemplateItem;
|
|
7
|
+
function isPercent(num) {
|
|
8
|
+
if (typeof num !== "string") return false;
|
|
9
|
+
return num.slice(-1) === "%";
|
|
10
|
+
}
|
|
11
|
+
function percent(num) {
|
|
12
|
+
return Number(num.slice(0, -1)) / 100;
|
|
13
|
+
}
|
|
14
|
+
function TemplateItem(values, outputLength) {
|
|
15
|
+
this.overallOutputLength = outputLength;
|
|
16
|
+
this.finished = false;
|
|
17
|
+
this.type = null;
|
|
18
|
+
this.value = null;
|
|
19
|
+
this.length = null;
|
|
20
|
+
this.maxLength = null;
|
|
21
|
+
this.minLength = null;
|
|
22
|
+
this.kerning = null;
|
|
23
|
+
this.align = "left";
|
|
24
|
+
this.padLeft = 0;
|
|
25
|
+
this.padRight = 0;
|
|
26
|
+
this.index = null;
|
|
27
|
+
this.first = null;
|
|
28
|
+
this.last = null;
|
|
29
|
+
if (typeof values === "string") this.value = values;
|
|
30
|
+
else for (var prop in values) this[prop] = values[prop];
|
|
31
|
+
if (isPercent(this.length)) this.length = Math.round(this.overallOutputLength * percent(this.length));
|
|
32
|
+
if (isPercent(this.minLength)) this.minLength = Math.round(this.overallOutputLength * percent(this.minLength));
|
|
33
|
+
if (isPercent(this.maxLength)) this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength));
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
TemplateItem.prototype = {};
|
|
37
|
+
TemplateItem.prototype.getBaseLength = function() {
|
|
38
|
+
var length = this.length;
|
|
39
|
+
if (length == null && typeof this.value === "string" && this.maxLength == null && this.minLength == null) length = stringWidth(this.value);
|
|
40
|
+
return length;
|
|
41
|
+
};
|
|
42
|
+
TemplateItem.prototype.getLength = function() {
|
|
43
|
+
var length = this.getBaseLength();
|
|
44
|
+
if (length == null) return null;
|
|
45
|
+
return length + this.padLeft + this.padRight;
|
|
46
|
+
};
|
|
47
|
+
TemplateItem.prototype.getMaxLength = function() {
|
|
48
|
+
if (this.maxLength == null) return null;
|
|
49
|
+
return this.maxLength + this.padLeft + this.padRight;
|
|
50
|
+
};
|
|
51
|
+
TemplateItem.prototype.getMinLength = function() {
|
|
52
|
+
if (this.minLength == null) return null;
|
|
53
|
+
return this.minLength + this.padLeft + this.padRight;
|
|
54
|
+
};
|
|
55
|
+
}));
|
|
56
|
+
//#endregion
|
|
57
|
+
export default require_template_item();
|
|
58
|
+
export { require_template_item };
|