@rockcarver/frodo-cli 4.0.0-24 → 4.0.0-25
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/CHANGELOG.md +4 -1
- package/dist/app.cjs +248 -42
- package/dist/app.cjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.0.0-24] - 2026-03-21
|
|
11
|
+
|
|
10
12
|
## [4.0.0-23] - 2026-03-21
|
|
11
13
|
|
|
12
14
|
## [4.0.0-22] - 2026-03-20
|
|
@@ -2209,7 +2211,8 @@ Frodo CLI 2.x automatically refreshes session and access tokens before they expi
|
|
|
2209
2211
|
- Fixed problem with adding connection profiles
|
|
2210
2212
|
- Miscellaneous bug fixes
|
|
2211
2213
|
|
|
2212
|
-
[unreleased]: https://github.com/rockcarver/frodo-cli/compare/v4.0.0-
|
|
2214
|
+
[unreleased]: https://github.com/rockcarver/frodo-cli/compare/v4.0.0-24...HEAD
|
|
2215
|
+
[4.0.0-24]: https://github.com/rockcarver/frodo-cli/compare/v4.0.0-23...v4.0.0-24
|
|
2213
2216
|
[4.0.0-23]: https://github.com/rockcarver/frodo-cli/compare/v4.0.0-22...v4.0.0-23
|
|
2214
2217
|
[4.0.0-22]: https://github.com/rockcarver/frodo-cli/compare/v4.0.0-21...v4.0.0-22
|
|
2215
2218
|
[4.0.0-21]: https://github.com/rockcarver/frodo-cli/compare/v4.0.0-20...v4.0.0-21
|
package/dist/app.cjs
CHANGED
|
@@ -9539,7 +9539,7 @@ var require_yesno = _chunkI43EENNMcjs.__commonJS.call(void 0, {
|
|
|
9539
9539
|
"node_modules/yesno/yesno.js"(exports2, module2) {
|
|
9540
9540
|
"use strict";
|
|
9541
9541
|
_chunkI43EENNMcjs.init_cjs_shims.call(void 0, );
|
|
9542
|
-
var
|
|
9542
|
+
var readline2 = _chunkI43EENNMcjs.__require.call(void 0, "readline");
|
|
9543
9543
|
var options = {
|
|
9544
9544
|
yes: ["yes", "y"],
|
|
9545
9545
|
no: ["no", "n"]
|
|
@@ -9556,7 +9556,7 @@ var require_yesno = _chunkI43EENNMcjs.__commonJS.call(void 0, {
|
|
|
9556
9556
|
invalid = defaultInvalidHandler;
|
|
9557
9557
|
var yValues = (yesValues || options.yes).map((v) => v.toLowerCase());
|
|
9558
9558
|
var nValues = (noValues || options.no).map((v) => v.toLowerCase());
|
|
9559
|
-
const rl =
|
|
9559
|
+
const rl = readline2.createInterface({
|
|
9560
9560
|
input: process.stdin,
|
|
9561
9561
|
output: process.stdout
|
|
9562
9562
|
});
|
|
@@ -238572,10 +238572,147 @@ function setup270() {
|
|
|
238572
238572
|
|
|
238573
238573
|
// src/cli/shell/shell.ts
|
|
238574
238574
|
_chunkI43EENNMcjs.init_cjs_shims.call(void 0, );
|
|
238575
|
+
var _readline = require('readline'); var _readline2 = _interopRequireDefault2(_readline);
|
|
238575
238576
|
var _repl = require('repl'); var _repl2 = _interopRequireDefault2(_repl);
|
|
238576
238577
|
|
|
238577
238578
|
var _vm = require('vm'); var _vm2 = _interopRequireDefault2(_vm);
|
|
238578
238579
|
|
|
238580
|
+
// src/ops/ShellAutoCompleteOps.ts
|
|
238581
|
+
_chunkI43EENNMcjs.init_cjs_shims.call(void 0, );
|
|
238582
|
+
function getHelpMetadataFromInstance(frodoInstance) {
|
|
238583
|
+
const candidate = frodoInstance["utils"];
|
|
238584
|
+
if (!candidate || typeof candidate !== "object") return [];
|
|
238585
|
+
const getHelpMetadata2 = candidate["getHelpMetadata"];
|
|
238586
|
+
if (typeof getHelpMetadata2 !== "function") return [];
|
|
238587
|
+
const result = getHelpMetadata2();
|
|
238588
|
+
return Array.isArray(result) ? result : [];
|
|
238589
|
+
}
|
|
238590
|
+
function getValueAtPath(root4, pathSegments) {
|
|
238591
|
+
let current = root4;
|
|
238592
|
+
for (const segment of pathSegments) {
|
|
238593
|
+
if (!current || typeof current !== "object") return void 0;
|
|
238594
|
+
current = current[segment];
|
|
238595
|
+
}
|
|
238596
|
+
return current;
|
|
238597
|
+
}
|
|
238598
|
+
function normalizeName(value) {
|
|
238599
|
+
return value.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
238600
|
+
}
|
|
238601
|
+
function findBestDoc(methodName, moduleSegments, docsByMethod) {
|
|
238602
|
+
const docs = _nullishCoalesce(docsByMethod.get(methodName), () => ( []));
|
|
238603
|
+
if (docs.length === 0) return void 0;
|
|
238604
|
+
const normalizedModuleSegments = moduleSegments.map(normalizeName);
|
|
238605
|
+
const exactMatch = docs.find(
|
|
238606
|
+
(d3) => normalizedModuleSegments.includes(normalizeName(d3.typeName))
|
|
238607
|
+
);
|
|
238608
|
+
return _nullishCoalesce(exactMatch, () => ( docs[0]));
|
|
238609
|
+
}
|
|
238610
|
+
function buildMethodScaffold(moduleSegments, methodName, docsByMethod) {
|
|
238611
|
+
const doc = findBestDoc(methodName, moduleSegments, docsByMethod);
|
|
238612
|
+
if (!doc) return "()";
|
|
238613
|
+
const paramNames = (_nullishCoalesce(doc.params, () => ( []))).map((p) => p.name.trim()).filter((name) => name.length > 0);
|
|
238614
|
+
if (paramNames.length === 0) return "()";
|
|
238615
|
+
return `(${paramNames.join(", ")})`;
|
|
238616
|
+
}
|
|
238617
|
+
function abbrevType(type) {
|
|
238618
|
+
const t = type.trim();
|
|
238619
|
+
if (!t) return t;
|
|
238620
|
+
if (t.includes("=>") || t.startsWith("(")) return "fn";
|
|
238621
|
+
if (t.endsWith("[]")) return abbrevType(t.slice(0, -2)) + "[]";
|
|
238622
|
+
switch (t) {
|
|
238623
|
+
case "string":
|
|
238624
|
+
return "str";
|
|
238625
|
+
case "boolean":
|
|
238626
|
+
return "bool";
|
|
238627
|
+
case "number":
|
|
238628
|
+
return "num";
|
|
238629
|
+
default:
|
|
238630
|
+
return t;
|
|
238631
|
+
}
|
|
238632
|
+
}
|
|
238633
|
+
function buildHintLine(fullPath, doc) {
|
|
238634
|
+
const params = (_nullishCoalesce(doc.params, () => ( []))).map((p) => {
|
|
238635
|
+
const name = p.name.trim();
|
|
238636
|
+
const type = abbrevType(p.type);
|
|
238637
|
+
return name && type ? `${name}: ${type}` : name;
|
|
238638
|
+
}).filter((s4) => s4.length > 0).join(", ");
|
|
238639
|
+
return `// ${fullPath}(${params})`;
|
|
238640
|
+
}
|
|
238641
|
+
function createFrodoCompleter(rootBindings, docsByMethod, onMethodHint) {
|
|
238642
|
+
return (line) => {
|
|
238643
|
+
const tokenMatch = line.match(
|
|
238644
|
+
/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\.?$)/
|
|
238645
|
+
);
|
|
238646
|
+
const token2 = _nullishCoalesce(_optionalChain([tokenMatch, 'optionalAccess', _580 => _580[1]]), () => ( ""));
|
|
238647
|
+
if (!token2) return [[], line];
|
|
238648
|
+
const rootCandidates = Object.keys(rootBindings).filter(
|
|
238649
|
+
(rootName2) => rootName2.startsWith(token2)
|
|
238650
|
+
);
|
|
238651
|
+
if (!token2.includes(".")) {
|
|
238652
|
+
const rootCompletions = rootCandidates.sort((a, b) => a.localeCompare(b));
|
|
238653
|
+
return [rootCompletions, token2];
|
|
238654
|
+
}
|
|
238655
|
+
const segments = token2.split(".");
|
|
238656
|
+
const rootName = segments[0];
|
|
238657
|
+
const root4 = rootBindings[rootName];
|
|
238658
|
+
if (!root4) return [[], token2];
|
|
238659
|
+
const hasTrailingDot = token2.endsWith(".");
|
|
238660
|
+
const parentSegments = hasTrailingDot ? segments.slice(1, -1) : segments.slice(1, -1);
|
|
238661
|
+
const partial = hasTrailingDot ? "" : segments[segments.length - 1];
|
|
238662
|
+
const targetObj = getValueAtPath(root4, parentSegments);
|
|
238663
|
+
if (!targetObj || typeof targetObj !== "object") return [[], token2];
|
|
238664
|
+
const completions = Object.keys(targetObj).filter((k2) => k2.startsWith(partial)).sort((a, b) => a.localeCompare(b)).map((k2) => {
|
|
238665
|
+
const value = targetObj[k2];
|
|
238666
|
+
const prefix = `${rootName}.${[...parentSegments, k2].join(".")}`;
|
|
238667
|
+
if (typeof value !== "function") return prefix;
|
|
238668
|
+
return `${prefix}${buildMethodScaffold(parentSegments, k2, docsByMethod)}`;
|
|
238669
|
+
});
|
|
238670
|
+
if (onMethodHint && completions.length === 1) {
|
|
238671
|
+
const completion = completions[0];
|
|
238672
|
+
const parenIdx = completion.indexOf("(");
|
|
238673
|
+
if (parenIdx !== -1) {
|
|
238674
|
+
const dotIdx = completion.lastIndexOf(".", parenIdx);
|
|
238675
|
+
const resolvedMethodName = completion.slice(dotIdx + 1, parenIdx);
|
|
238676
|
+
const doc = findBestDoc(
|
|
238677
|
+
resolvedMethodName,
|
|
238678
|
+
parentSegments,
|
|
238679
|
+
docsByMethod
|
|
238680
|
+
);
|
|
238681
|
+
if (doc) {
|
|
238682
|
+
const fullPath = completion.slice(0, parenIdx);
|
|
238683
|
+
setImmediate(() => onMethodHint(buildHintLine(fullPath, doc)));
|
|
238684
|
+
}
|
|
238685
|
+
}
|
|
238686
|
+
}
|
|
238687
|
+
return [completions, token2];
|
|
238688
|
+
};
|
|
238689
|
+
}
|
|
238690
|
+
function buildDocsByMethod(frodoInstance) {
|
|
238691
|
+
const helpDocs = getHelpMetadataFromInstance(frodoInstance);
|
|
238692
|
+
const docsByMethod = /* @__PURE__ */ new Map();
|
|
238693
|
+
for (const doc of helpDocs) {
|
|
238694
|
+
if (!docsByMethod.has(doc.methodName)) docsByMethod.set(doc.methodName, []);
|
|
238695
|
+
docsByMethod.get(doc.methodName).push(doc);
|
|
238696
|
+
}
|
|
238697
|
+
return docsByMethod;
|
|
238698
|
+
}
|
|
238699
|
+
function registerOpenParenHint(replServer, rootBindings, docsByMethod, onHint) {
|
|
238700
|
+
process.stdin.on("keypress", (_char, key) => {
|
|
238701
|
+
if (_optionalChain([key, 'optionalAccess', _581 => _581.sequence]) !== "(") return;
|
|
238702
|
+
const currentLine = _nullishCoalesce(replServer["line"], () => ( ""));
|
|
238703
|
+
const match2 = currentLine.match(
|
|
238704
|
+
/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+)$/
|
|
238705
|
+
);
|
|
238706
|
+
if (!match2) return;
|
|
238707
|
+
const parts = match2[1].split(".");
|
|
238708
|
+
if (!rootBindings[parts[0]]) return;
|
|
238709
|
+
const methodName = parts[parts.length - 1];
|
|
238710
|
+
const parentSegments = parts.slice(1, -1);
|
|
238711
|
+
const doc = findBestDoc(methodName, parentSegments, docsByMethod);
|
|
238712
|
+
if (doc) onHint(buildHintLine(match2[1], doc));
|
|
238713
|
+
});
|
|
238714
|
+
}
|
|
238715
|
+
|
|
238579
238716
|
// src/ops/ShellHelpOps.ts
|
|
238580
238717
|
_chunkI43EENNMcjs.init_cjs_shims.call(void 0, );
|
|
238581
238718
|
var BOLD = "\x1B[1m";
|
|
@@ -238585,7 +238722,7 @@ var YELLOW = "\x1B[33m";
|
|
|
238585
238722
|
var GREEN = "\x1B[32m";
|
|
238586
238723
|
var DIM = "\x1B[2m";
|
|
238587
238724
|
var cachedIndex = null;
|
|
238588
|
-
function
|
|
238725
|
+
function getHelpMetadataFromInstance2(frodoInstance) {
|
|
238589
238726
|
const candidate = frodoInstance["utils"];
|
|
238590
238727
|
if (!candidate || typeof candidate !== "object") return [];
|
|
238591
238728
|
const getHelpMetadata2 = candidate["getHelpMetadata"];
|
|
@@ -238637,13 +238774,37 @@ function findModulePath(root4, target, prefix = "frodo") {
|
|
|
238637
238774
|
}
|
|
238638
238775
|
function createHelpContext(frodoInstance) {
|
|
238639
238776
|
const alphaSort = (a, b) => a.localeCompare(b);
|
|
238640
|
-
const metadata =
|
|
238777
|
+
const metadata = getHelpMetadataFromInstance2(frodoInstance);
|
|
238641
238778
|
cachedIndex = null;
|
|
238642
238779
|
function getMethodNames(obj) {
|
|
238643
238780
|
return Object.keys(obj).filter(
|
|
238644
238781
|
(k2) => typeof obj[k2] === "function"
|
|
238645
238782
|
);
|
|
238646
238783
|
}
|
|
238784
|
+
function getSubModuleNames(obj) {
|
|
238785
|
+
return Object.keys(obj).filter((k2) => {
|
|
238786
|
+
const value = obj[k2];
|
|
238787
|
+
return typeof value === "object" && value !== null;
|
|
238788
|
+
});
|
|
238789
|
+
}
|
|
238790
|
+
function getCountParts(methodCount, subModuleCount) {
|
|
238791
|
+
const parts = [];
|
|
238792
|
+
if (methodCount > 0)
|
|
238793
|
+
parts.push(`${methodCount} ${methodCount === 1 ? "method" : "methods"}`);
|
|
238794
|
+
if (subModuleCount > 0)
|
|
238795
|
+
parts.push(
|
|
238796
|
+
`${subModuleCount} ${subModuleCount === 1 ? "module" : "modules"}`
|
|
238797
|
+
);
|
|
238798
|
+
return parts;
|
|
238799
|
+
}
|
|
238800
|
+
function formatCountSuffix(methodCount, subModuleCount) {
|
|
238801
|
+
const parts = getCountParts(methodCount, subModuleCount);
|
|
238802
|
+
return parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
238803
|
+
}
|
|
238804
|
+
function formatCountLabel(methodCount, subModuleCount) {
|
|
238805
|
+
const parts = getCountParts(methodCount, subModuleCount);
|
|
238806
|
+
return parts.length > 0 ? ` - ${parts.join(", ")}` : "";
|
|
238807
|
+
}
|
|
238647
238808
|
function help(target) {
|
|
238648
238809
|
const idx = getMethodIndex(metadata);
|
|
238649
238810
|
if (target === void 0) {
|
|
@@ -238658,31 +238819,28 @@ function createHelpContext(frodoInstance) {
|
|
|
238658
238819
|
const sortedMods = [...mods].sort(alphaSort);
|
|
238659
238820
|
console.log(`${BOLD}${CYAN}Frodo Shell - Help System${RESET}`);
|
|
238660
238821
|
console.log("");
|
|
238822
|
+
console.log(` ${GREEN}help()${RESET} ${DIM}this overview${RESET}`);
|
|
238661
238823
|
console.log(
|
|
238662
|
-
` ${GREEN}help()${RESET}
|
|
238663
|
-
);
|
|
238664
|
-
console.log(
|
|
238665
|
-
` ${GREEN}help(frodo.<sub-module>)${RESET} -> list all methods in <sub-module>`
|
|
238824
|
+
` ${GREEN}help(frodo.<module>)${RESET} ${DIM}list all methods and modules in <module>${RESET}`
|
|
238666
238825
|
);
|
|
238667
238826
|
console.log(
|
|
238668
|
-
` ${GREEN}help(frodo.<
|
|
238827
|
+
` ${GREEN}help(frodo.<module>.<method>)${RESET} ${DIM}full signature + docs for a method${RESET}`
|
|
238669
238828
|
);
|
|
238670
238829
|
console.log(
|
|
238671
|
-
` ${GREEN}help("methodName")${RESET}
|
|
238830
|
+
` ${GREEN}help("methodName")${RESET} ${DIM}search for a method across all modules${RESET}`
|
|
238672
238831
|
);
|
|
238673
238832
|
console.log("");
|
|
238674
|
-
|
|
238833
|
+
const modulesCountLabel = sortedMods.length > 0 ? ` (${sortedMods.length} ${sortedMods.length === 1 ? "module" : "modules"})` : "";
|
|
238834
|
+
console.log(`${BOLD}Modules${modulesCountLabel}:${RESET}`);
|
|
238675
238835
|
for (const k2 of sortedMods) {
|
|
238676
238836
|
const val = frodoInstance[k2];
|
|
238677
238837
|
if (typeof val === "object" && val !== null) {
|
|
238678
|
-
const
|
|
238679
|
-
|
|
238680
|
-
|
|
238681
|
-
|
|
238682
|
-
|
|
238683
|
-
|
|
238684
|
-
console.log(` frodo.${GREEN}${k2}${RESET}`);
|
|
238685
|
-
}
|
|
238838
|
+
const methodCount = getMethodNames(val).length;
|
|
238839
|
+
const subModuleCount = getSubModuleNames(val).length;
|
|
238840
|
+
const countSuffix = formatCountSuffix(methodCount, subModuleCount);
|
|
238841
|
+
console.log(
|
|
238842
|
+
` frodo.${GREEN}${k2}${RESET}${countSuffix ? ` ${DIM}${countSuffix}${RESET}` : ""}`
|
|
238843
|
+
);
|
|
238686
238844
|
}
|
|
238687
238845
|
}
|
|
238688
238846
|
if (sortedFns.length > 0) {
|
|
@@ -238690,7 +238848,7 @@ function createHelpContext(frodoInstance) {
|
|
|
238690
238848
|
console.log(`${BOLD}Factory helpers:${RESET}`);
|
|
238691
238849
|
for (const fn of sortedFns) {
|
|
238692
238850
|
const docs = idx.get(fn);
|
|
238693
|
-
const sigHint = _optionalChain([docs, 'optionalAccess',
|
|
238851
|
+
const sigHint = _optionalChain([docs, 'optionalAccess', _582 => _582.length]) ? ` ${DIM}${docs[0].signature}${RESET}` : "";
|
|
238694
238852
|
console.log(` frodo.${GREEN}${fn}${RESET}${sigHint}`);
|
|
238695
238853
|
}
|
|
238696
238854
|
}
|
|
@@ -238740,21 +238898,36 @@ function createHelpContext(frodoInstance) {
|
|
|
238740
238898
|
}
|
|
238741
238899
|
if (typeof target === "object" && target !== null) {
|
|
238742
238900
|
const methods = getMethodNames(target);
|
|
238743
|
-
const subMods =
|
|
238744
|
-
const v = target[k2];
|
|
238745
|
-
return typeof v === "object" && v !== null;
|
|
238746
|
-
});
|
|
238901
|
+
const subMods = getSubModuleNames(target);
|
|
238747
238902
|
const sortedMethods = [...methods].sort(alphaSort);
|
|
238748
238903
|
const sortedSubMods = [...subMods].sort(alphaSort);
|
|
238904
|
+
const methodCount = sortedMethods.length;
|
|
238905
|
+
const subModuleCount = sortedSubMods.length;
|
|
238906
|
+
const moduleType = _optionalChain([findModulePath, 'call', _583 => _583(frodoInstance, target), 'optionalAccess', _584 => _584.replace, 'call', _585 => _585(
|
|
238907
|
+
/^frodo\./,
|
|
238908
|
+
""
|
|
238909
|
+
)]) || "Module";
|
|
238910
|
+
console.log(
|
|
238911
|
+
`${BOLD}${CYAN}${moduleType}${formatCountLabel(methodCount, subModuleCount)}${RESET}`
|
|
238912
|
+
);
|
|
238913
|
+
console.log("");
|
|
238749
238914
|
if (sortedMethods.length === 0) {
|
|
238750
238915
|
if (sortedSubMods.length > 0) {
|
|
238751
|
-
console.log(
|
|
238916
|
+
console.log(
|
|
238917
|
+
`${BOLD}Modules (${subModuleCount} ${subModuleCount === 1 ? "module" : "modules"}):${RESET}`
|
|
238918
|
+
);
|
|
238752
238919
|
for (const subModule of sortedSubMods) {
|
|
238753
|
-
|
|
238920
|
+
const subModuleObj = target[subModule];
|
|
238921
|
+
const subMethods = typeof subModuleObj === "object" && subModuleObj !== null ? getMethodNames(subModuleObj).length : 0;
|
|
238922
|
+
const nestedSubMods = typeof subModuleObj === "object" && subModuleObj !== null ? getSubModuleNames(subModuleObj).length : 0;
|
|
238923
|
+
const countSuffix = formatCountSuffix(subMethods, nestedSubMods);
|
|
238924
|
+
console.log(
|
|
238925
|
+
` ${GREEN}${subModule}${RESET}${countSuffix ? ` ${DIM}${countSuffix}${RESET}` : ""}`
|
|
238926
|
+
);
|
|
238754
238927
|
}
|
|
238755
238928
|
const subModPath = _nullishCoalesce(findModulePath(frodoInstance, target), () => ( "frodo.X"));
|
|
238756
238929
|
console.log(
|
|
238757
|
-
`Use ${GREEN}help(${subModPath}.<
|
|
238930
|
+
`Use ${GREEN}help(${subModPath}.<module>)${RESET} to explore further.`
|
|
238758
238931
|
);
|
|
238759
238932
|
} else {
|
|
238760
238933
|
console.log(`${YELLOW}No methods found on this object.${RESET}`);
|
|
@@ -238776,19 +238949,27 @@ function createHelpContext(frodoInstance) {
|
|
|
238776
238949
|
}
|
|
238777
238950
|
}
|
|
238778
238951
|
if (sortedSubMods.length > 0) {
|
|
238779
|
-
console.log(
|
|
238952
|
+
console.log(
|
|
238953
|
+
`${BOLD}Modules (${subModuleCount} ${subModuleCount === 1 ? "module" : "modules"}):${RESET}`
|
|
238954
|
+
);
|
|
238780
238955
|
for (const subModule of sortedSubMods) {
|
|
238781
|
-
|
|
238956
|
+
const subModuleObj = target[subModule];
|
|
238957
|
+
const subMethods = typeof subModuleObj === "object" && subModuleObj !== null ? getMethodNames(subModuleObj).length : 0;
|
|
238958
|
+
const nestedSubMods = typeof subModuleObj === "object" && subModuleObj !== null ? getSubModuleNames(subModuleObj).length : 0;
|
|
238959
|
+
const countSuffix = formatCountSuffix(subMethods, nestedSubMods);
|
|
238960
|
+
console.log(
|
|
238961
|
+
` ${GREEN}${subModule}${RESET}${countSuffix ? ` ${DIM}${countSuffix}${RESET}` : ""}`
|
|
238962
|
+
);
|
|
238782
238963
|
}
|
|
238783
238964
|
console.log("");
|
|
238784
238965
|
}
|
|
238785
238966
|
console.log(
|
|
238786
|
-
`${BOLD}${CYAN}${bestType ||
|
|
238967
|
+
`${BOLD}${CYAN}${bestType || moduleType}${formatCountLabel(methodCount, subModuleCount)}:${RESET}`
|
|
238787
238968
|
);
|
|
238788
238969
|
console.log("");
|
|
238789
238970
|
for (const methodName of sortedMethods) {
|
|
238790
238971
|
const docs = idx.get(methodName);
|
|
238791
|
-
const doc = _nullishCoalesce(_optionalChain([docs, 'optionalAccess',
|
|
238972
|
+
const doc = _nullishCoalesce(_optionalChain([docs, 'optionalAccess', _586 => _586.find, 'call', _587 => _587((d3) => d3.typeName === bestType)]), () => ( _optionalChain([docs, 'optionalAccess', _588 => _588[0]])));
|
|
238792
238973
|
if (doc) {
|
|
238793
238974
|
const sig = doc.signature.length > 100 ? doc.signature.slice(0, 97) + "..." : doc.signature;
|
|
238794
238975
|
console.log(` ${YELLOW}${sig}${RESET}`);
|
|
@@ -238808,7 +238989,7 @@ function createHelpContext(frodoInstance) {
|
|
|
238808
238989
|
return;
|
|
238809
238990
|
}
|
|
238810
238991
|
console.log(
|
|
238811
|
-
`${YELLOW}Usage: help() | help(frodo.<
|
|
238992
|
+
`${YELLOW}Usage: help() | help(frodo.<module>) | help(frodo.<module>.<method name>) | help("methodName")${RESET}`
|
|
238812
238993
|
);
|
|
238813
238994
|
}
|
|
238814
238995
|
return { help };
|
|
@@ -238896,12 +239077,33 @@ var ShellHistory = class {
|
|
|
238896
239077
|
};
|
|
238897
239078
|
|
|
238898
239079
|
// src/cli/shell/shell.ts
|
|
239080
|
+
function printHintAbovePrompt(replServer, hint) {
|
|
239081
|
+
if (!replServer) return;
|
|
239082
|
+
if (process.stdout.isTTY) {
|
|
239083
|
+
_readline2.default.clearLine(process.stdout, 0);
|
|
239084
|
+
_readline2.default.cursorTo(process.stdout, 0);
|
|
239085
|
+
}
|
|
239086
|
+
process.stdout.write(`
|
|
239087
|
+
${hint}
|
|
239088
|
+
`);
|
|
239089
|
+
replServer.displayPrompt(true);
|
|
239090
|
+
}
|
|
238899
239091
|
async function startRepl(allowAwait = false, host) {
|
|
239092
|
+
const docsByMethod = buildDocsByMethod(frodo);
|
|
239093
|
+
const rootBindings = {
|
|
239094
|
+
frodo,
|
|
239095
|
+
frodoLib: frodo
|
|
239096
|
+
};
|
|
239097
|
+
let _replServer;
|
|
239098
|
+
const completer = createFrodoCompleter(rootBindings, docsByMethod, (hint) => {
|
|
239099
|
+
printHintAbovePrompt(_replServer, hint);
|
|
239100
|
+
});
|
|
238900
239101
|
const baseConfig = {
|
|
238901
239102
|
prompt: "> ",
|
|
238902
239103
|
ignoreUndefined: true,
|
|
238903
239104
|
useGlobal: true,
|
|
238904
239105
|
useColors: true,
|
|
239106
|
+
completer,
|
|
238905
239107
|
writer: function(output) {
|
|
238906
239108
|
if (typeof output === "object" && output !== null) {
|
|
238907
239109
|
return _util2.default.inspect(output, {
|
|
@@ -238919,11 +239121,15 @@ async function startRepl(allowAwait = false, host) {
|
|
|
238919
239121
|
callback(null, await _vm2.default.runInNewContext(cmd, context));
|
|
238920
239122
|
}
|
|
238921
239123
|
};
|
|
238922
|
-
|
|
239124
|
+
_replServer = _repl2.default.start(allowAwait ? baseConfig : configWithoutAwait);
|
|
239125
|
+
const replServer = _replServer;
|
|
238923
239126
|
replServer.context.frodoLib = frodo;
|
|
238924
239127
|
replServer.context.frodo = frodo;
|
|
238925
239128
|
const { help } = createHelpContext(frodo);
|
|
238926
239129
|
replServer.context.help = help;
|
|
239130
|
+
registerOpenParenHint(replServer, rootBindings, docsByMethod, (hint) => {
|
|
239131
|
+
printHintAbovePrompt(replServer, hint);
|
|
239132
|
+
});
|
|
238927
239133
|
const shellHistory = new ShellHistory(host);
|
|
238928
239134
|
replServer.history = shellHistory.getLines();
|
|
238929
239135
|
replServer.defineCommand("history", {
|
|
@@ -238973,33 +239179,33 @@ async function startRepl(allowAwait = false, host) {
|
|
|
238973
239179
|
console.log("");
|
|
238974
239180
|
console.log(`${BOLD2}Explore the Frodo API:${RESET2}`);
|
|
238975
239181
|
console.log(
|
|
238976
|
-
` ${GREEN2}help()${RESET2}
|
|
239182
|
+
` ${GREEN2}help()${RESET2} ${DIM2}browse all modules and methods${RESET2}`
|
|
238977
239183
|
);
|
|
238978
239184
|
console.log(
|
|
238979
|
-
` ${GREEN2}help(frodo
|
|
239185
|
+
` ${GREEN2}help(frodo.<module>)${RESET2} ${DIM2}list all methods in module X${RESET2}`
|
|
238980
239186
|
);
|
|
238981
239187
|
console.log(
|
|
238982
|
-
` ${GREEN2}help(frodo
|
|
239188
|
+
` ${GREEN2}help(frodo.<module>.<method>)${RESET2} ${DIM2}show full signature and docs${RESET2}`
|
|
238983
239189
|
);
|
|
238984
239190
|
console.log(
|
|
238985
|
-
` ${GREEN2}help("methodName")${RESET2}
|
|
239191
|
+
` ${GREEN2}help("methodName")${RESET2} ${DIM2}search for a method across all modules${RESET2}`
|
|
238986
239192
|
);
|
|
238987
239193
|
console.log("");
|
|
238988
239194
|
console.log(`${BOLD2}Sample commands:${RESET2}`);
|
|
238989
239195
|
console.log(
|
|
238990
|
-
` ${GREEN2}frodo.info.getInfo()${RESET2}
|
|
239196
|
+
` ${GREEN2}frodo.info.getInfo()${RESET2} ${DIM2}print info about the connected environment${RESET2}`
|
|
238991
239197
|
);
|
|
238992
239198
|
console.log(
|
|
238993
|
-
` ${GREEN2}frodo.login.getTokens()${RESET2}
|
|
239199
|
+
` ${GREEN2}frodo.login.getTokens()${RESET2} ${DIM2}get fresh or cached tokens${RESET2}`
|
|
238994
239200
|
);
|
|
238995
239201
|
console.log(
|
|
238996
|
-
` ${GREEN2}frodo${RESET2}
|
|
239202
|
+
` ${GREEN2}frodo${RESET2} ${DIM2}show a hierarchy of all Frodo Library commands${RESET2}`
|
|
238997
239203
|
);
|
|
238998
239204
|
console.log("");
|
|
238999
239205
|
console.log(`${BOLD2}Shell dot-commands:${RESET2}`);
|
|
239000
239206
|
const commands = replServer.commands;
|
|
239001
239207
|
for (const name of Object.keys(commands).sort()) {
|
|
239002
|
-
const helpText = _nullishCoalesce(_optionalChain([commands, 'access',
|
|
239208
|
+
const helpText = _nullishCoalesce(_optionalChain([commands, 'access', _589 => _589[name], 'optionalAccess', _590 => _590.help]), () => ( ""));
|
|
239003
239209
|
console.log(` ${GREEN2}.${name}${RESET2} ${DIM2}${helpText}${RESET2}`);
|
|
239004
239210
|
}
|
|
239005
239211
|
this.displayPrompt();
|
|
@@ -239407,7 +239613,7 @@ var compareVersions = (v12, v2) => {
|
|
|
239407
239613
|
// package.json
|
|
239408
239614
|
var package_default2 = {
|
|
239409
239615
|
name: "@rockcarver/frodo-cli",
|
|
239410
|
-
version: "4.0.0-
|
|
239616
|
+
version: "4.0.0-25",
|
|
239411
239617
|
type: "module",
|
|
239412
239618
|
description: "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
239413
239619
|
keywords: [
|