@genrtl/grtl 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/index.js +61 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,13 +21,13 @@ $env:GRTL_API_KEY = "gtr_live_your_api_key"
|
|
|
21
21
|
Configure hosted MCP and install the MCP-oriented Skill for your coding agent:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
grtl setup --
|
|
25
|
-
grtl setup --
|
|
24
|
+
grtl setup --codex
|
|
25
|
+
grtl setup --cursor --project
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
search, and CBB detail lookup are
|
|
30
|
-
CLI commands.
|
|
28
|
+
MCP + Skill is the default setup mode. Use `--cli` only when you explicitly want
|
|
29
|
+
the CLI-only Skill. Knowledge retrieval, CBB search, and CBB detail lookup are
|
|
30
|
+
supported through MCP tools only, not through CLI commands.
|
|
31
31
|
|
|
32
32
|
Installing a newer npm package does not modify Skills already written to an
|
|
33
33
|
agent configuration directory. Run setup again after an upgrade to refresh the
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import pc6 from "picocolors";
|
|
|
6
6
|
import figlet from "figlet";
|
|
7
7
|
|
|
8
8
|
// src/commands/setup.ts
|
|
9
|
-
import { select } from "@inquirer/prompts";
|
|
10
9
|
import { dirname as dirname4, join as join2 } from "path";
|
|
11
10
|
import { mkdir as mkdir3, readFile as readFile2, writeFile as writeFile3 } from "fs/promises";
|
|
12
11
|
import ora from "ora";
|
|
@@ -669,27 +668,7 @@ async function resolveMode(options) {
|
|
|
669
668
|
return null;
|
|
670
669
|
}
|
|
671
670
|
if (options.cli) return "cli";
|
|
672
|
-
|
|
673
|
-
try {
|
|
674
|
-
return await select({
|
|
675
|
-
message: "How should your coding agent access GenRTL?",
|
|
676
|
-
choices: [
|
|
677
|
-
{
|
|
678
|
-
name: "CLI Skill",
|
|
679
|
-
value: "cli",
|
|
680
|
-
description: "The agent runs the installed grtl command."
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
name: "MCP Server + Skill",
|
|
684
|
-
value: "mcp",
|
|
685
|
-
description: "The agent calls the four hosted GenRTL MCP tools."
|
|
686
|
-
}
|
|
687
|
-
]
|
|
688
|
-
});
|
|
689
|
-
} catch {
|
|
690
|
-
log.warn("Setup cancelled");
|
|
691
|
-
return null;
|
|
692
|
-
}
|
|
671
|
+
return "mcp";
|
|
693
672
|
}
|
|
694
673
|
async function promptAgents() {
|
|
695
674
|
try {
|
|
@@ -1419,7 +1398,7 @@ function registerCbbCommands(program2) {
|
|
|
1419
1398
|
}
|
|
1420
1399
|
|
|
1421
1400
|
// src/commands/upgrade.ts
|
|
1422
|
-
import { confirm } from "@inquirer/prompts";
|
|
1401
|
+
import { confirm, select } from "@inquirer/prompts";
|
|
1423
1402
|
import { spawn } from "child_process";
|
|
1424
1403
|
import pc5 from "picocolors";
|
|
1425
1404
|
|
|
@@ -1591,11 +1570,24 @@ async function shouldShowUpdateNotification(info, options = {}) {
|
|
|
1591
1570
|
const now = options.now ?? Date.now();
|
|
1592
1571
|
const cooldownMs = options.cooldownMs ?? DEFAULT_CACHE_TTL_MS;
|
|
1593
1572
|
const state = await readUpdateState(options.stateFile);
|
|
1573
|
+
if (state.ignoredVersion === info.latestVersion) {
|
|
1574
|
+
return false;
|
|
1575
|
+
}
|
|
1594
1576
|
if (state.notifiedVersion === info.latestVersion && state.lastNotifiedAt && now - state.lastNotifiedAt < cooldownMs) {
|
|
1595
1577
|
return false;
|
|
1596
1578
|
}
|
|
1597
1579
|
return true;
|
|
1598
1580
|
}
|
|
1581
|
+
async function markUpdateNotificationIgnored(latestVersion, options = {}) {
|
|
1582
|
+
const state = await readUpdateState(options.stateFile);
|
|
1583
|
+
await writeUpdateState(
|
|
1584
|
+
{
|
|
1585
|
+
...state,
|
|
1586
|
+
ignoredVersion: latestVersion
|
|
1587
|
+
},
|
|
1588
|
+
options.stateFile
|
|
1589
|
+
);
|
|
1590
|
+
}
|
|
1599
1591
|
async function markUpdateNotificationShown(latestVersion, options = {}) {
|
|
1600
1592
|
const now = options.now ?? Date.now();
|
|
1601
1593
|
const state = await readUpdateState(options.stateFile);
|
|
@@ -1613,6 +1605,7 @@ function shouldSkipUpdateNotifier(argv = process.argv) {
|
|
|
1613
1605
|
}
|
|
1614
1606
|
|
|
1615
1607
|
// src/commands/upgrade.ts
|
|
1608
|
+
var RELEASE_NOTES_URL = "https://github.com/xroting/grtl/releases/latest";
|
|
1616
1609
|
function registerUpgradeCommand(program2) {
|
|
1617
1610
|
program2.command("upgrade").description("Check for a newer grtl version and upgrade when possible").option("-y, --yes", "Run the suggested upgrade command without prompting").option("--check", "Only check for updates without running the upgrade command").action(async (options) => {
|
|
1618
1611
|
await upgradeCommand(options);
|
|
@@ -1656,33 +1649,62 @@ async function maybeShowUpgradeNotice(options = {}) {
|
|
|
1656
1649
|
if (!info || !info.updateAvailable || !await shouldShowUpdateNotification(info)) {
|
|
1657
1650
|
return;
|
|
1658
1651
|
}
|
|
1652
|
+
const choices = [];
|
|
1659
1653
|
log.blank();
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1654
|
+
log.plain(`${pc5.dim("Release notes:")} ${pc5.underline(pc5.dim(RELEASE_NOTES_URL))}`);
|
|
1655
|
+
if (info.upgradePlan.canRun) {
|
|
1656
|
+
choices.push({
|
|
1657
|
+
name: `Update now (runs \`${info.upgradePlan.displayCommand}\`)`,
|
|
1658
|
+
value: "update"
|
|
1659
|
+
});
|
|
1660
|
+
} else {
|
|
1661
|
+
const verb = info.upgradePlan.needsExplicitVersion ? "Use" : "Run";
|
|
1662
|
+
log.info(`${verb} ${pc5.cyan(info.upgradePlan.displayCommand)} to update.`);
|
|
1663
|
+
}
|
|
1664
|
+
choices.push(
|
|
1665
|
+
{ name: "Skip", value: "skip" },
|
|
1666
|
+
{
|
|
1667
|
+
name: "Skip until next version",
|
|
1668
|
+
value: "skip-version",
|
|
1669
|
+
description: `Do not show this prompt again for v${info.latestVersion}.`
|
|
1670
|
+
}
|
|
1671
|
+
);
|
|
1672
|
+
let choice;
|
|
1673
|
+
try {
|
|
1674
|
+
choice = await select({
|
|
1675
|
+
message: `Update available: v${info.currentVersion} -> v${info.latestVersion}`,
|
|
1676
|
+
choices
|
|
1677
|
+
});
|
|
1678
|
+
} catch {
|
|
1665
1679
|
await markUpdateNotificationShown(info.latestVersion);
|
|
1666
1680
|
log.blank();
|
|
1667
1681
|
return;
|
|
1668
1682
|
}
|
|
1669
|
-
if (
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1683
|
+
if (choice === "skip-version") {
|
|
1684
|
+
await markUpdateNotificationIgnored(info.latestVersion);
|
|
1685
|
+
log.blank();
|
|
1686
|
+
return;
|
|
1687
|
+
}
|
|
1688
|
+
if (choice === "skip") {
|
|
1675
1689
|
await markUpdateNotificationShown(info.latestVersion);
|
|
1676
1690
|
log.blank();
|
|
1677
1691
|
return;
|
|
1678
1692
|
}
|
|
1679
|
-
log.box([
|
|
1680
|
-
`${pc5.white(pc5.bold("Update available:"))} ${pc5.green(pc5.bold(`v${info.currentVersion}`))} ${pc5.dim("->")} ${pc5.green(pc5.bold(`v${info.latestVersion}`))}`,
|
|
1681
|
-
`${pc5.white("Run")} ${pc5.yellow(pc5.bold("grtl upgrade"))} ${pc5.white("to update now")}`,
|
|
1682
|
-
`${pc5.white("Or run")} ${pc5.yellow(info.upgradePlan.displayCommand)}`
|
|
1683
|
-
]);
|
|
1684
1693
|
await markUpdateNotificationShown(info.latestVersion);
|
|
1685
1694
|
log.blank();
|
|
1695
|
+
const exitCode = await runUpgradePlan(info.upgradePlan);
|
|
1696
|
+
if (exitCode === 0) {
|
|
1697
|
+
log.blank();
|
|
1698
|
+
log.success("Upgrade complete.");
|
|
1699
|
+
log.info(`Restart your terminal or run ${pc5.cyan("grtl --version")} to verify.`);
|
|
1700
|
+
log.blank();
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
log.blank();
|
|
1704
|
+
log.error(`Upgrade command exited with code ${exitCode ?? "unknown"}.`);
|
|
1705
|
+
showUpgradeFailureHelp(info.upgradePlan);
|
|
1706
|
+
process.exitCode = 1;
|
|
1707
|
+
log.blank();
|
|
1686
1708
|
}
|
|
1687
1709
|
async function upgradeCommand(options) {
|
|
1688
1710
|
trackEvent("command", { name: "upgrade" });
|