ccjk 12.0.1 → 12.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/dist/chunks/agent-teams.mjs +17 -18
- package/dist/chunks/agent.mjs +105 -102
- package/dist/chunks/agents.mjs +87 -77
- package/dist/chunks/api-cli.mjs +41 -27
- package/dist/chunks/api-providers.mjs +2 -4
- package/dist/chunks/api.mjs +22 -11
- package/dist/chunks/auto-bootstrap.mjs +3 -5
- package/dist/chunks/auto-init.mjs +3 -4
- package/dist/chunks/auto-updater.mjs +103 -91
- package/dist/chunks/banner.mjs +41 -42
- package/dist/chunks/boost.mjs +30 -31
- package/dist/chunks/ccjk-agents.mjs +6 -9
- package/dist/chunks/ccjk-all.mjs +703 -85
- package/dist/chunks/ccjk-config.mjs +6 -6
- package/dist/chunks/ccjk-hooks.mjs +20 -9
- package/dist/chunks/ccjk-mcp.mjs +64 -52
- package/dist/chunks/ccjk-setup.mjs +35 -25
- package/dist/chunks/ccjk-skills.mjs +51 -41
- package/dist/chunks/ccr.mjs +42 -32
- package/dist/chunks/ccu.mjs +16 -12
- package/dist/chunks/check-updates.mjs +30 -19
- package/dist/chunks/claude-code-config-manager.mjs +25 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
- package/dist/chunks/claude-config.mjs +2 -2
- package/dist/chunks/claude-wrapper.mjs +9 -6
- package/dist/chunks/cleanup-migration.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +10 -3
- package/dist/chunks/cloud-sync.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +58 -45
- package/dist/chunks/codex-provider-manager.mjs +29 -16
- package/dist/chunks/codex-uninstaller.mjs +5 -6
- package/dist/chunks/codex.mjs +89 -89
- package/dist/chunks/commands.mjs +28 -29
- package/dist/chunks/commands2.mjs +4 -3
- package/dist/chunks/commit.mjs +42 -23
- package/dist/chunks/completion.mjs +46 -47
- package/dist/chunks/config-consolidator.mjs +12 -13
- package/dist/chunks/config-switch.mjs +66 -53
- package/dist/chunks/config.mjs +10 -10
- package/dist/chunks/config2.mjs +53 -42
- package/dist/chunks/config3.mjs +107 -93
- package/dist/chunks/constants.mjs +2 -4
- package/dist/chunks/context-loader.mjs +5 -4
- package/dist/chunks/context.mjs +77 -76
- package/dist/chunks/convoy-manager.mjs +4 -4
- package/dist/chunks/dashboard.mjs +28 -29
- package/dist/chunks/doctor.mjs +68 -54
- package/dist/chunks/evolution.mjs +37 -38
- package/dist/chunks/features.mjs +103 -92
- package/dist/chunks/fs-operations.mjs +1 -1
- package/dist/chunks/health-alerts.mjs +1 -1
- package/dist/chunks/health-check.mjs +1 -1
- package/dist/chunks/help.mjs +117 -116
- package/dist/chunks/hook-installer.mjs +3 -2
- package/dist/chunks/index.mjs +20 -6
- package/dist/chunks/index10.mjs +1171 -0
- package/dist/chunks/index11.mjs +1008 -0
- package/dist/chunks/index12.mjs +193 -0
- package/dist/chunks/index13.mjs +218 -0
- package/dist/chunks/index14.mjs +663 -0
- package/dist/chunks/index2.mjs +19 -10
- package/dist/chunks/index3.mjs +19079 -164
- package/dist/chunks/index4.mjs +8 -1171
- package/dist/chunks/index5.mjs +7479 -884
- package/dist/chunks/index6.mjs +160 -184
- package/dist/chunks/index7.mjs +3573 -653
- package/dist/chunks/index8.mjs +19 -0
- package/dist/chunks/index9.mjs +616 -0
- package/dist/chunks/init.mjs +173 -173
- package/dist/chunks/installer.mjs +92 -82
- package/dist/chunks/installer2.mjs +3 -2
- package/dist/chunks/interview.mjs +118 -107
- package/dist/chunks/json-config.mjs +3 -2
- package/dist/chunks/linux.mjs +3863 -0
- package/dist/chunks/macos.mjs +69 -0
- package/dist/chunks/main.mjs +635 -0
- package/dist/chunks/marketplace.mjs +69 -66
- package/dist/chunks/mcp-cli.mjs +61 -48
- package/dist/chunks/mcp.mjs +140 -127
- package/dist/chunks/menu.mjs +85 -85
- package/dist/chunks/metrics-display.mjs +41 -40
- package/dist/chunks/migrator.mjs +4 -5
- package/dist/chunks/monitor.mjs +95 -95
- package/dist/chunks/notification.mjs +151 -141
- package/dist/chunks/onboarding.mjs +26 -15
- package/dist/chunks/paradigm.mjs +24 -23
- package/dist/chunks/permission-manager.mjs +10 -11
- package/dist/chunks/permissions.mjs +72 -57
- package/dist/chunks/persistence-manager.mjs +97 -84
- package/dist/chunks/persistence.mjs +1 -1
- package/dist/chunks/platform.mjs +29 -29
- package/dist/chunks/plugin.mjs +104 -105
- package/dist/chunks/prompts.mjs +36 -25
- package/dist/chunks/providers.mjs +68 -69
- package/dist/chunks/quick-actions.mjs +71 -72
- package/dist/chunks/quick-provider.mjs +56 -40
- package/dist/chunks/quick-setup.mjs +71 -60
- package/dist/chunks/remote.mjs +21 -12
- package/dist/chunks/session.mjs +116 -103
- package/dist/chunks/sessions.mjs +29 -28
- package/dist/chunks/silent-updater.mjs +8 -10
- package/dist/chunks/simple-config.mjs +13 -10
- package/dist/chunks/skill.mjs +8560 -103
- package/dist/chunks/skills-sync.mjs +5212 -79
- package/dist/chunks/skills.mjs +105 -94
- package/dist/chunks/slash-commands.mjs +36 -37
- package/dist/chunks/smart-defaults.mjs +7 -3
- package/dist/chunks/smart-guide.mjs +1 -1
- package/dist/chunks/startup.mjs +2 -4
- package/dist/chunks/stats.mjs +41 -42
- package/dist/chunks/status.mjs +49 -50
- package/dist/chunks/team.mjs +24 -12
- package/dist/chunks/thinking.mjs +74 -63
- package/dist/chunks/trace.mjs +20 -19
- package/dist/chunks/uninstall.mjs +69 -56
- package/dist/chunks/update.mjs +39 -28
- package/dist/chunks/upgrade-manager.mjs +24 -18
- package/dist/chunks/version-checker.mjs +45 -41
- package/dist/chunks/vim.mjs +81 -69
- package/dist/chunks/windows.mjs +14 -0
- package/dist/chunks/workflows.mjs +15 -15
- package/dist/chunks/wsl.mjs +129 -0
- package/dist/chunks/zero-config.mjs +45 -34
- package/dist/cli.mjs +20 -20
- package/dist/index.mjs +41 -31
- package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
- package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
- package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
- package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
- package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
- package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
- package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
- package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
- package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
- package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
- package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
- package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
- package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
- package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
- package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
- package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
- package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
- package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
- package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
- package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
- package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
- package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
- package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
- package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
- package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
- package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
- package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
- package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
- package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
- package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
- package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
- package/package.json +31 -29
- package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
- package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
package/dist/chunks/plugin.mjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
|
-
import
|
|
2
|
+
import a from './index2.mjs';
|
|
3
3
|
import { Buffer } from 'node:buffer';
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, readdirSync, statSync, rmSync } from 'node:fs';
|
|
5
|
-
import { join } from 'pathe';
|
|
6
5
|
import { CCJK_CLOUD_PLUGINS_DIR, CCJK_CLOUD_PLUGINS_CACHE_DIR, CCJK_CLOUD_PLUGINS_INSTALLED_DIR } from './constants.mjs';
|
|
7
|
-
import { i18n } from './
|
|
6
|
+
import { i18n } from './index5.mjs';
|
|
8
7
|
import { writeFileAtomic } from './fs-operations.mjs';
|
|
9
8
|
import { homedir } from 'node:os';
|
|
10
|
-
import {
|
|
9
|
+
import { j as join } from '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
10
|
+
import { d as detectProject } from '../shared/ccjk.hoqrwWdN.mjs';
|
|
11
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
11
12
|
import 'node:url';
|
|
12
|
-
import 'i18next';
|
|
13
|
-
import 'i18next-fs-backend';
|
|
14
13
|
import 'node:crypto';
|
|
15
14
|
import 'node:fs/promises';
|
|
16
15
|
|
|
@@ -1572,8 +1571,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1572
1571
|
case "i":
|
|
1573
1572
|
case "add":
|
|
1574
1573
|
if (args.length === 0) {
|
|
1575
|
-
console.log(
|
|
1576
|
-
console.log(
|
|
1574
|
+
console.log(a.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u8981\u5B89\u88C5\u7684\u63D2\u4EF6 ID" : "\u274C Please specify a plugin ID to install"));
|
|
1575
|
+
console.log(a.gray(isZh ? "\u7528\u6CD5: /plugin install <plugin-id>" : "Usage: /plugin install <plugin-id>"));
|
|
1577
1576
|
process__default.exit(1);
|
|
1578
1577
|
}
|
|
1579
1578
|
await installPlugin(args[0], options);
|
|
@@ -1582,8 +1581,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1582
1581
|
case "remove":
|
|
1583
1582
|
case "rm":
|
|
1584
1583
|
if (args.length === 0) {
|
|
1585
|
-
console.log(
|
|
1586
|
-
console.log(
|
|
1584
|
+
console.log(a.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u8981\u5378\u8F7D\u7684\u63D2\u4EF6 ID" : "\u274C Please specify a plugin ID to uninstall"));
|
|
1585
|
+
console.log(a.gray(isZh ? "\u7528\u6CD5: /plugin uninstall <plugin-id>" : "Usage: /plugin uninstall <plugin-id>"));
|
|
1587
1586
|
process__default.exit(1);
|
|
1588
1587
|
}
|
|
1589
1588
|
await uninstallPlugin(args[0]);
|
|
@@ -1592,8 +1591,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1592
1591
|
case "s":
|
|
1593
1592
|
case "find":
|
|
1594
1593
|
if (args.length === 0) {
|
|
1595
|
-
console.log(
|
|
1596
|
-
console.log(
|
|
1594
|
+
console.log(a.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u641C\u7D22\u5173\u952E\u8BCD" : "\u274C Please specify a search query"));
|
|
1595
|
+
console.log(a.gray(isZh ? "\u7528\u6CD5: /plugin search <\u5173\u952E\u8BCD>" : "Usage: /plugin search <query>"));
|
|
1597
1596
|
process__default.exit(1);
|
|
1598
1597
|
}
|
|
1599
1598
|
await searchPlugins(args.join(" "), options);
|
|
@@ -1602,8 +1601,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1602
1601
|
case "show":
|
|
1603
1602
|
case "details":
|
|
1604
1603
|
if (args.length === 0) {
|
|
1605
|
-
console.log(
|
|
1606
|
-
console.log(
|
|
1604
|
+
console.log(a.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u63D2\u4EF6 ID" : "\u274C Please specify a plugin ID"));
|
|
1605
|
+
console.log(a.gray(isZh ? "\u7528\u6CD5: /plugin info <plugin-id>" : "Usage: /plugin info <plugin-id>"));
|
|
1607
1606
|
process__default.exit(1);
|
|
1608
1607
|
}
|
|
1609
1608
|
await showPluginInfo(args[0]);
|
|
@@ -1627,13 +1626,13 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1627
1626
|
showHelp();
|
|
1628
1627
|
break;
|
|
1629
1628
|
default:
|
|
1630
|
-
console.log(
|
|
1629
|
+
console.log(a.red(isZh ? `\u274C \u672A\u77E5\u547D\u4EE4: ${action}` : `\u274C Unknown command: ${action}`));
|
|
1631
1630
|
showHelp();
|
|
1632
1631
|
process__default.exit(1);
|
|
1633
1632
|
}
|
|
1634
1633
|
} catch (error) {
|
|
1635
1634
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1636
|
-
console.log(
|
|
1635
|
+
console.log(a.red(`
|
|
1637
1636
|
\u274C ${isZh ? "\u9519\u8BEF" : "Error"}: ${errorMessage}`));
|
|
1638
1637
|
if (options.verbose) {
|
|
1639
1638
|
console.error(error);
|
|
@@ -1644,75 +1643,75 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1644
1643
|
async function listPlugins(options) {
|
|
1645
1644
|
const isZh = i18n.language === "zh-CN";
|
|
1646
1645
|
const manager = getCloudPluginManager();
|
|
1647
|
-
console.log(
|
|
1646
|
+
console.log(a.green.bold(`
|
|
1648
1647
|
\u{1F4E6} ${isZh ? "\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6" : "Installed Plugins"}
|
|
1649
1648
|
`));
|
|
1650
1649
|
const installed = manager.getInstalledPlugins();
|
|
1651
1650
|
if (installed.length === 0) {
|
|
1652
|
-
console.log(
|
|
1653
|
-
console.log(
|
|
1651
|
+
console.log(a.gray(isZh ? "\u6682\u65E0\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6" : "No plugins installed"));
|
|
1652
|
+
console.log(a.gray(`
|
|
1654
1653
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin search <\u5173\u952E\u8BCD> \u641C\u7D22\u63D2\u4EF6" : "Use /plugin search <query> to find plugins"}`));
|
|
1655
1654
|
return;
|
|
1656
1655
|
}
|
|
1657
1656
|
for (const plugin of installed) {
|
|
1658
|
-
console.log(` ${
|
|
1659
|
-
console.log(` ${
|
|
1657
|
+
console.log(` ${a.green("\u25CF")} ${a.bold(getPluginName(plugin))} ${a.gray(`v${plugin.version}`)}`);
|
|
1658
|
+
console.log(` ${a.gray(getPluginDescription(plugin))}`);
|
|
1660
1659
|
if (options.verbose && plugin.author) {
|
|
1661
|
-
console.log(` ${
|
|
1660
|
+
console.log(` ${a.gray(`by ${plugin.author}`)}`);
|
|
1662
1661
|
}
|
|
1663
1662
|
console.log("");
|
|
1664
1663
|
}
|
|
1665
|
-
console.log(
|
|
1664
|
+
console.log(a.gray(`${isZh ? "\u5171" : "Total"} ${installed.length} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"}`));
|
|
1666
1665
|
}
|
|
1667
1666
|
async function installPlugin(pluginId, options) {
|
|
1668
1667
|
const isZh = i18n.language === "zh-CN";
|
|
1669
1668
|
const manager = getCloudPluginManager();
|
|
1670
|
-
console.log(
|
|
1669
|
+
console.log(a.green(`
|
|
1671
1670
|
\u23F3 ${isZh ? "\u6B63\u5728\u83B7\u53D6\u63D2\u4EF6\u4FE1\u606F..." : "Fetching plugin info..."}`));
|
|
1672
1671
|
const pluginInfo = await manager.getPluginInfo(pluginId);
|
|
1673
1672
|
if (!pluginInfo) {
|
|
1674
|
-
console.log(
|
|
1673
|
+
console.log(a.red(`
|
|
1675
1674
|
\u274C ${isZh ? "\u63D2\u4EF6\u672A\u627E\u5230" : "Plugin not found"}: ${pluginId}`));
|
|
1676
|
-
console.log(
|
|
1675
|
+
console.log(a.gray(`
|
|
1677
1676
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin search <\u5173\u952E\u8BCD> \u641C\u7D22\u53EF\u7528\u63D2\u4EF6" : "Use /plugin search <query> to find available plugins"}`));
|
|
1678
1677
|
const searchResult = await manager.searchPlugins({ query: pluginId, pageSize: 3 });
|
|
1679
1678
|
if (searchResult.success && searchResult.data && searchResult.data.length > 0) {
|
|
1680
|
-
console.log(
|
|
1679
|
+
console.log(a.yellow(`
|
|
1681
1680
|
${isZh ? "\u60A8\u662F\u5426\u5728\u627E:" : "Did you mean:"}`));
|
|
1682
1681
|
for (const p of searchResult.data) {
|
|
1683
|
-
console.log(` - ${
|
|
1682
|
+
console.log(` - ${a.green(p.id)} - ${getPluginName(p)}`);
|
|
1684
1683
|
}
|
|
1685
1684
|
}
|
|
1686
1685
|
process__default.exit(1);
|
|
1687
1686
|
}
|
|
1688
1687
|
const isInstalled = manager.isPluginInstalled(pluginId);
|
|
1689
1688
|
if (isInstalled && !options.force) {
|
|
1690
|
-
console.log(
|
|
1689
|
+
console.log(a.yellow(`
|
|
1691
1690
|
\u26A0\uFE0F ${isZh ? "\u63D2\u4EF6\u5DF2\u5B89\u88C5" : "Plugin already installed"}: ${getPluginName(pluginInfo)}`));
|
|
1692
|
-
console.log(
|
|
1691
|
+
console.log(a.gray(`\u{1F4A1} ${isZh ? "\u4F7F\u7528 --force \u5F3A\u5236\u91CD\u65B0\u5B89\u88C5" : "Use --force to reinstall"}`));
|
|
1693
1692
|
return;
|
|
1694
1693
|
}
|
|
1695
|
-
console.log(
|
|
1694
|
+
console.log(a.green.bold(`
|
|
1696
1695
|
\u{1F4E6} ${getPluginName(pluginInfo)}`));
|
|
1697
|
-
console.log(
|
|
1698
|
-
console.log(
|
|
1696
|
+
console.log(a.gray(` ${getPluginDescription(pluginInfo)}`));
|
|
1697
|
+
console.log(a.gray(` ${isZh ? "\u7248\u672C" : "Version"}: ${pluginInfo.version}`));
|
|
1699
1698
|
if (pluginInfo.author) {
|
|
1700
|
-
console.log(
|
|
1699
|
+
console.log(a.gray(` ${isZh ? "\u4F5C\u8005" : "Author"}: ${pluginInfo.author}`));
|
|
1701
1700
|
}
|
|
1702
1701
|
console.log("");
|
|
1703
|
-
console.log(
|
|
1702
|
+
console.log(a.green(`\u23F3 ${isZh ? "\u6B63\u5728\u5B89\u88C5..." : "Installing..."}`));
|
|
1704
1703
|
const result = await manager.installPlugin(pluginId, {
|
|
1705
1704
|
force: options.force
|
|
1706
1705
|
});
|
|
1707
1706
|
if (result.success) {
|
|
1708
|
-
console.log(
|
|
1707
|
+
console.log(a.green(`
|
|
1709
1708
|
\u2705 ${isZh ? "\u5B89\u88C5\u6210\u529F" : "Installation successful"}!`));
|
|
1710
|
-
console.log(
|
|
1709
|
+
console.log(a.gray(` ${isZh ? "\u8DEF\u5F84" : "Path"}: ${result.installedPath}`));
|
|
1711
1710
|
if (result.dependencies && result.dependencies.length > 0) {
|
|
1712
|
-
console.log(
|
|
1711
|
+
console.log(a.gray(` ${isZh ? "\u4F9D\u8D56" : "Dependencies"}: ${result.dependencies.join(", ")}`));
|
|
1713
1712
|
}
|
|
1714
1713
|
} else {
|
|
1715
|
-
console.log(
|
|
1714
|
+
console.log(a.red(`
|
|
1716
1715
|
\u274C ${isZh ? "\u5B89\u88C5\u5931\u8D25" : "Installation failed"}: ${result.error}`));
|
|
1717
1716
|
process__default.exit(1);
|
|
1718
1717
|
}
|
|
@@ -1722,18 +1721,18 @@ async function uninstallPlugin(pluginId) {
|
|
|
1722
1721
|
const manager = getCloudPluginManager();
|
|
1723
1722
|
const isInstalled = manager.isPluginInstalled(pluginId);
|
|
1724
1723
|
if (!isInstalled) {
|
|
1725
|
-
console.log(
|
|
1724
|
+
console.log(a.yellow(`
|
|
1726
1725
|
\u26A0\uFE0F ${isZh ? "\u63D2\u4EF6\u672A\u5B89\u88C5" : "Plugin not installed"}: ${pluginId}`));
|
|
1727
1726
|
return;
|
|
1728
1727
|
}
|
|
1729
|
-
console.log(
|
|
1728
|
+
console.log(a.green(`
|
|
1730
1729
|
\u23F3 ${isZh ? "\u6B63\u5728\u5378\u8F7D..." : "Uninstalling..."}`));
|
|
1731
1730
|
const result = await manager.uninstallPlugin(pluginId);
|
|
1732
1731
|
if (result.success) {
|
|
1733
|
-
console.log(
|
|
1732
|
+
console.log(a.green(`
|
|
1734
1733
|
\u2705 ${isZh ? "\u5378\u8F7D\u6210\u529F" : "Uninstallation successful"}!`));
|
|
1735
1734
|
} else {
|
|
1736
|
-
console.log(
|
|
1735
|
+
console.log(a.red(`
|
|
1737
1736
|
\u274C ${isZh ? "\u5378\u8F7D\u5931\u8D25" : "Uninstallation failed"}: ${result.error}`));
|
|
1738
1737
|
process__default.exit(1);
|
|
1739
1738
|
}
|
|
@@ -1741,35 +1740,35 @@ async function uninstallPlugin(pluginId) {
|
|
|
1741
1740
|
async function searchPlugins(query, options) {
|
|
1742
1741
|
const isZh = i18n.language === "zh-CN";
|
|
1743
1742
|
const manager = getCloudPluginManager();
|
|
1744
|
-
console.log(
|
|
1743
|
+
console.log(a.green(`
|
|
1745
1744
|
\u{1F50D} ${isZh ? "\u641C\u7D22" : "Searching"}: "${query}"
|
|
1746
1745
|
`));
|
|
1747
1746
|
const result = await manager.searchPlugins({ query, pageSize: 20 });
|
|
1748
1747
|
if (!result.success || !result.data || result.data.length === 0) {
|
|
1749
|
-
console.log(
|
|
1750
|
-
console.log(
|
|
1748
|
+
console.log(a.yellow(isZh ? "\u672A\u627E\u5230\u5339\u914D\u7684\u63D2\u4EF6" : "No plugins found"));
|
|
1749
|
+
console.log(a.gray(`
|
|
1751
1750
|
\u{1F4A1} ${isZh ? "\u5C1D\u8BD5\u4F7F\u7528\u4E0D\u540C\u7684\u5173\u952E\u8BCD" : "Try different keywords"}`));
|
|
1752
1751
|
return;
|
|
1753
1752
|
}
|
|
1754
|
-
console.log(
|
|
1753
|
+
console.log(a.bold(isZh ? "\u641C\u7D22\u7ED3\u679C:" : "Search Results:"));
|
|
1755
1754
|
console.log("");
|
|
1756
1755
|
for (const plugin of result.data) {
|
|
1757
1756
|
const installed = manager.isPluginInstalled(plugin.id);
|
|
1758
|
-
const statusIcon = installed ?
|
|
1759
|
-
console.log(` ${statusIcon} ${
|
|
1760
|
-
console.log(` ${
|
|
1757
|
+
const statusIcon = installed ? a.green("\u25CF") : a.gray("\u25CB");
|
|
1758
|
+
console.log(` ${statusIcon} ${a.bold(getPluginName(plugin))} ${a.gray(`(${plugin.id})`)} ${a.gray(`v${plugin.version}`)}`);
|
|
1759
|
+
console.log(` ${a.gray(getPluginDescription(plugin))}`);
|
|
1761
1760
|
if (options.verbose) {
|
|
1762
1761
|
if (plugin.downloads) {
|
|
1763
|
-
console.log(` ${
|
|
1762
|
+
console.log(` ${a.gray(`\u2B07\uFE0F ${plugin.downloads.toLocaleString()} downloads`)}`);
|
|
1764
1763
|
}
|
|
1765
1764
|
if (plugin.rating) {
|
|
1766
|
-
console.log(` ${
|
|
1765
|
+
console.log(` ${a.gray(`\u2B50 ${plugin.rating.toFixed(1)}`)}`);
|
|
1767
1766
|
}
|
|
1768
1767
|
}
|
|
1769
1768
|
console.log("");
|
|
1770
1769
|
}
|
|
1771
|
-
console.log(
|
|
1772
|
-
console.log(
|
|
1770
|
+
console.log(a.gray(`${isZh ? "\u5171\u627E\u5230" : "Found"} ${result.data.length} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"}`));
|
|
1771
|
+
console.log(a.gray(`
|
|
1773
1772
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin install <id> \u5B89\u88C5\u63D2\u4EF6" : "Use /plugin install <id> to install a plugin"}`));
|
|
1774
1773
|
}
|
|
1775
1774
|
async function showPluginInfo(pluginId) {
|
|
@@ -1777,36 +1776,36 @@ async function showPluginInfo(pluginId) {
|
|
|
1777
1776
|
const manager = getCloudPluginManager();
|
|
1778
1777
|
const plugin = await manager.getPluginInfo(pluginId);
|
|
1779
1778
|
if (!plugin) {
|
|
1780
|
-
console.log(
|
|
1779
|
+
console.log(a.red(`
|
|
1781
1780
|
\u274C ${isZh ? "\u63D2\u4EF6\u672A\u627E\u5230" : "Plugin not found"}: ${pluginId}`));
|
|
1782
1781
|
process__default.exit(1);
|
|
1783
1782
|
}
|
|
1784
1783
|
const installed = manager.isPluginInstalled(pluginId);
|
|
1785
|
-
console.log(
|
|
1784
|
+
console.log(a.green.bold(`
|
|
1786
1785
|
\u{1F4E6} ${getPluginName(plugin)}`));
|
|
1787
|
-
console.log(
|
|
1788
|
-
console.log(`${
|
|
1789
|
-
console.log(`${
|
|
1790
|
-
console.log(`${
|
|
1791
|
-
console.log(`${
|
|
1786
|
+
console.log(a.dim("\u2500".repeat(50)));
|
|
1787
|
+
console.log(`${a.bold(isZh ? "\u63CF\u8FF0" : "Description")}: ${getPluginDescription(plugin)}`);
|
|
1788
|
+
console.log(`${a.bold("ID")}: ${plugin.id}`);
|
|
1789
|
+
console.log(`${a.bold(isZh ? "\u7248\u672C" : "Version")}: ${plugin.version}`);
|
|
1790
|
+
console.log(`${a.bold(isZh ? "\u72B6\u6001" : "Status")}: ${installed ? a.green(isZh ? "\u5DF2\u5B89\u88C5" : "Installed") : a.gray(isZh ? "\u672A\u5B89\u88C5" : "Not installed")}`);
|
|
1792
1791
|
if (plugin.author) {
|
|
1793
|
-
console.log(`${
|
|
1792
|
+
console.log(`${a.bold(isZh ? "\u4F5C\u8005" : "Author")}: ${plugin.author}`);
|
|
1794
1793
|
}
|
|
1795
1794
|
if (plugin.category) {
|
|
1796
|
-
console.log(`${
|
|
1795
|
+
console.log(`${a.bold(isZh ? "\u5206\u7C7B" : "Category")}: ${plugin.category}`);
|
|
1797
1796
|
}
|
|
1798
1797
|
if (plugin.tags && plugin.tags.length > 0) {
|
|
1799
|
-
console.log(`${
|
|
1798
|
+
console.log(`${a.bold(isZh ? "\u6807\u7B7E" : "Tags")}: ${plugin.tags.join(", ")}`);
|
|
1800
1799
|
}
|
|
1801
1800
|
if (plugin.downloads) {
|
|
1802
|
-
console.log(`${
|
|
1801
|
+
console.log(`${a.bold(isZh ? "\u4E0B\u8F7D\u91CF" : "Downloads")}: ${plugin.downloads.toLocaleString()}`);
|
|
1803
1802
|
}
|
|
1804
1803
|
if (plugin.rating) {
|
|
1805
|
-
console.log(`${
|
|
1804
|
+
console.log(`${a.bold(isZh ? "\u8BC4\u5206" : "Rating")}: \u2B50 ${plugin.rating.toFixed(1)}`);
|
|
1806
1805
|
}
|
|
1807
|
-
console.log(
|
|
1806
|
+
console.log(a.dim("\u2500".repeat(50)));
|
|
1808
1807
|
if (!installed) {
|
|
1809
|
-
console.log(
|
|
1808
|
+
console.log(a.gray(`
|
|
1810
1809
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin install" : "Use /plugin install"} ${pluginId} ${isZh ? "\u5B89\u88C5\u6B64\u63D2\u4EF6" : "to install this plugin"}`));
|
|
1811
1810
|
}
|
|
1812
1811
|
}
|
|
@@ -1814,38 +1813,38 @@ async function updatePlugins(pluginId) {
|
|
|
1814
1813
|
const isZh = i18n.language === "zh-CN";
|
|
1815
1814
|
const manager = getCloudPluginManager();
|
|
1816
1815
|
if (pluginId) {
|
|
1817
|
-
console.log(
|
|
1816
|
+
console.log(a.green(`
|
|
1818
1817
|
\u23F3 ${isZh ? "\u6B63\u5728\u66F4\u65B0" : "Updating"} ${pluginId}...`));
|
|
1819
1818
|
const result = await manager.updatePlugin(pluginId);
|
|
1820
1819
|
if (result.success) {
|
|
1821
1820
|
if (result.updated) {
|
|
1822
|
-
console.log(
|
|
1821
|
+
console.log(a.green(`
|
|
1823
1822
|
\u2705 ${isZh ? "\u66F4\u65B0\u6210\u529F" : "Update successful"}! ${result.oldVersion} \u2192 ${result.newVersion}`));
|
|
1824
1823
|
} else {
|
|
1825
|
-
console.log(
|
|
1824
|
+
console.log(a.gray(`
|
|
1826
1825
|
\u2713 ${isZh ? "\u5DF2\u662F\u6700\u65B0\u7248\u672C" : "Already up to date"}`));
|
|
1827
1826
|
}
|
|
1828
1827
|
} else {
|
|
1829
|
-
console.log(
|
|
1828
|
+
console.log(a.red(`
|
|
1830
1829
|
\u274C ${isZh ? "\u66F4\u65B0\u5931\u8D25" : "Update failed"}: ${result.error}`));
|
|
1831
1830
|
process__default.exit(1);
|
|
1832
1831
|
}
|
|
1833
1832
|
} else {
|
|
1834
|
-
console.log(
|
|
1833
|
+
console.log(a.green(`
|
|
1835
1834
|
\u23F3 ${isZh ? "\u6B63\u5728\u68C0\u67E5\u66F4\u65B0..." : "Checking for updates..."}`));
|
|
1836
1835
|
const results = await manager.updateAllPlugins();
|
|
1837
1836
|
let updatedCount = 0;
|
|
1838
1837
|
for (const result of results) {
|
|
1839
1838
|
if (result.success && result.updated) {
|
|
1840
|
-
console.log(
|
|
1839
|
+
console.log(a.green(` \u2705 ${result.pluginId}: ${result.oldVersion} \u2192 ${result.newVersion}`));
|
|
1841
1840
|
updatedCount++;
|
|
1842
1841
|
}
|
|
1843
1842
|
}
|
|
1844
1843
|
if (updatedCount === 0) {
|
|
1845
|
-
console.log(
|
|
1844
|
+
console.log(a.gray(`
|
|
1846
1845
|
\u2713 ${isZh ? "\u6240\u6709\u63D2\u4EF6\u5DF2\u662F\u6700\u65B0\u7248\u672C" : "All plugins are up to date"}`));
|
|
1847
1846
|
} else {
|
|
1848
|
-
console.log(
|
|
1847
|
+
console.log(a.green(`
|
|
1849
1848
|
\u2705 ${isZh ? "\u5DF2\u66F4\u65B0" : "Updated"} ${updatedCount} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"}`));
|
|
1850
1849
|
}
|
|
1851
1850
|
}
|
|
@@ -1853,69 +1852,69 @@ async function updatePlugins(pluginId) {
|
|
|
1853
1852
|
async function listCategories() {
|
|
1854
1853
|
const isZh = i18n.language === "zh-CN";
|
|
1855
1854
|
const manager = getCloudPluginManager();
|
|
1856
|
-
console.log(
|
|
1855
|
+
console.log(a.green.bold(`
|
|
1857
1856
|
\u{1F4C2} ${isZh ? "\u63D2\u4EF6\u5206\u7C7B" : "Plugin Categories"}
|
|
1858
1857
|
`));
|
|
1859
1858
|
const result = await manager.getCategories();
|
|
1860
1859
|
if (!result.success || !result.data || result.data.length === 0) {
|
|
1861
|
-
console.log(
|
|
1860
|
+
console.log(a.gray(isZh ? "\u6682\u65E0\u5206\u7C7B\u4FE1\u606F" : "No categories available"));
|
|
1862
1861
|
return;
|
|
1863
1862
|
}
|
|
1864
1863
|
for (const cat of result.data) {
|
|
1865
1864
|
const name = isZh ? cat.name["zh-CN"] || cat.name.en : cat.name.en;
|
|
1866
|
-
console.log(` \u{1F4E6} ${
|
|
1865
|
+
console.log(` \u{1F4E6} ${a.bold(name)} ${a.gray(`(${cat.count} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"})`)}`);
|
|
1867
1866
|
}
|
|
1868
1867
|
}
|
|
1869
1868
|
async function showFeaturedPlugins() {
|
|
1870
1869
|
const isZh = i18n.language === "zh-CN";
|
|
1871
1870
|
const manager = getCloudPluginManager();
|
|
1872
|
-
console.log(
|
|
1871
|
+
console.log(a.green.bold(`
|
|
1873
1872
|
\u2B50 ${isZh ? "\u7CBE\u9009\u63D2\u4EF6" : "Featured Plugins"}
|
|
1874
1873
|
`));
|
|
1875
1874
|
const featured = await manager.getFeaturedPlugins();
|
|
1876
1875
|
if (!featured || featured.length === 0) {
|
|
1877
|
-
console.log(
|
|
1876
|
+
console.log(a.gray(isZh ? "\u6682\u65E0\u7CBE\u9009\u63D2\u4EF6" : "No featured plugins available"));
|
|
1878
1877
|
return;
|
|
1879
1878
|
}
|
|
1880
1879
|
for (const plugin of featured) {
|
|
1881
1880
|
const installed = manager.isPluginInstalled(plugin.id);
|
|
1882
|
-
const statusIcon = installed ?
|
|
1883
|
-
console.log(` ${statusIcon} ${
|
|
1884
|
-
console.log(` ${
|
|
1881
|
+
const statusIcon = installed ? a.green("\u25CF") : a.gray("\u25CB");
|
|
1882
|
+
console.log(` ${statusIcon} ${a.bold(getPluginName(plugin))} ${a.gray(`v${plugin.version}`)}`);
|
|
1883
|
+
console.log(` ${a.gray(getPluginDescription(plugin))}`);
|
|
1885
1884
|
console.log("");
|
|
1886
1885
|
}
|
|
1887
|
-
console.log(
|
|
1886
|
+
console.log(a.gray(`
|
|
1888
1887
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin install <id> \u5B89\u88C5\u63D2\u4EF6" : "Use /plugin install <id> to install a plugin"}`));
|
|
1889
1888
|
}
|
|
1890
1889
|
function showHelp() {
|
|
1891
1890
|
const isZh = i18n.language === "zh-CN";
|
|
1892
|
-
console.log(
|
|
1891
|
+
console.log(a.green.bold(`
|
|
1893
1892
|
\u{1F4E6} ${isZh ? "CCJK \u63D2\u4EF6\u7BA1\u7406" : "CCJK Plugin Manager"}
|
|
1894
1893
|
`));
|
|
1895
|
-
console.log(
|
|
1894
|
+
console.log(a.dim("\u2500".repeat(50)));
|
|
1896
1895
|
console.log("");
|
|
1897
|
-
console.log(
|
|
1896
|
+
console.log(a.bold(isZh ? "\u7528\u6CD5:" : "Usage:"));
|
|
1898
1897
|
console.log(" /plugin <command> [options]");
|
|
1899
1898
|
console.log("");
|
|
1900
|
-
console.log(
|
|
1901
|
-
console.log(` ${
|
|
1902
|
-
console.log(` ${
|
|
1903
|
-
console.log(` ${
|
|
1904
|
-
console.log(` ${
|
|
1905
|
-
console.log(` ${
|
|
1906
|
-
console.log(` ${
|
|
1907
|
-
console.log(` ${
|
|
1908
|
-
console.log(` ${
|
|
1909
|
-
console.log(` ${
|
|
1899
|
+
console.log(a.bold(isZh ? "\u547D\u4EE4:" : "Commands:"));
|
|
1900
|
+
console.log(` ${a.green("list")} ${isZh ? "\u5217\u51FA\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6" : "List installed plugins"}`);
|
|
1901
|
+
console.log(` ${a.green("install")} <id> ${isZh ? "\u5B89\u88C5\u63D2\u4EF6" : "Install a plugin"}`);
|
|
1902
|
+
console.log(` ${a.green("uninstall")} <id> ${isZh ? "\u5378\u8F7D\u63D2\u4EF6" : "Uninstall a plugin"}`);
|
|
1903
|
+
console.log(` ${a.green("search")} <query> ${isZh ? "\u641C\u7D22\u63D2\u4EF6" : "Search for plugins"}`);
|
|
1904
|
+
console.log(` ${a.green("info")} <id> ${isZh ? "\u663E\u793A\u63D2\u4EF6\u8BE6\u60C5" : "Show plugin details"}`);
|
|
1905
|
+
console.log(` ${a.green("update")} [id] ${isZh ? "\u66F4\u65B0\u63D2\u4EF6" : "Update plugin(s)"}`);
|
|
1906
|
+
console.log(` ${a.green("categories")} ${isZh ? "\u5217\u51FA\u63D2\u4EF6\u5206\u7C7B" : "List plugin categories"}`);
|
|
1907
|
+
console.log(` ${a.green("featured")} ${isZh ? "\u663E\u793A\u7CBE\u9009\u63D2\u4EF6" : "Show featured plugins"}`);
|
|
1908
|
+
console.log(` ${a.green("help")} ${isZh ? "\u663E\u793A\u5E2E\u52A9" : "Show this help"}`);
|
|
1910
1909
|
console.log("");
|
|
1911
|
-
console.log(
|
|
1912
|
-
console.log(` /plugin search git ${
|
|
1913
|
-
console.log(` /plugin install code-simplifier ${
|
|
1914
|
-
console.log(` /plugin info code-simplifier ${
|
|
1915
|
-
console.log(` /plugin update ${
|
|
1910
|
+
console.log(a.bold(isZh ? "\u793A\u4F8B:" : "Examples:"));
|
|
1911
|
+
console.log(` /plugin search git ${a.gray(isZh ? "# \u641C\u7D22 git \u76F8\u5173\u63D2\u4EF6" : "# Search for git plugins")}`);
|
|
1912
|
+
console.log(` /plugin install code-simplifier ${a.gray(isZh ? "# \u5B89\u88C5\u63D2\u4EF6" : "# Install a plugin")}`);
|
|
1913
|
+
console.log(` /plugin info code-simplifier ${a.gray(isZh ? "# \u67E5\u770B\u63D2\u4EF6\u8BE6\u60C5" : "# View plugin details")}`);
|
|
1914
|
+
console.log(` /plugin update ${a.gray(isZh ? "# \u66F4\u65B0\u6240\u6709\u63D2\u4EF6" : "# Update all plugins")}`);
|
|
1916
1915
|
console.log("");
|
|
1917
|
-
console.log(
|
|
1918
|
-
console.log(
|
|
1916
|
+
console.log(a.dim("\u2500".repeat(50)));
|
|
1917
|
+
console.log(a.gray(`${isZh ? "\u63D2\u4EF6\u5E02\u573A" : "Plugin Marketplace"}: https://claudehome.cn/plugins`));
|
|
1919
1918
|
}
|
|
1920
1919
|
async function handlePluginCommand(args) {
|
|
1921
1920
|
const action = args[0] || "list";
|
package/dist/chunks/prompts.mjs
CHANGED
|
@@ -1,29 +1,40 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
|
-
import
|
|
3
|
-
import inquirer from '
|
|
2
|
+
import a from './index2.mjs';
|
|
3
|
+
import { i as inquirer } from './index3.mjs';
|
|
4
4
|
import { version } from './package.mjs';
|
|
5
5
|
import { LANG_LABELS, getAiOutputLanguageLabel, SUPPORTED_LANGS, AI_OUTPUT_LANGUAGES } from './constants.mjs';
|
|
6
|
-
import { ensureI18nInitialized, i18n } from './
|
|
6
|
+
import { ensureI18nInitialized, i18n } from './index5.mjs';
|
|
7
7
|
import { readZcfConfig, updateZcfConfig } from './ccjk-config.mjs';
|
|
8
8
|
import { a as addNumbersToChoices } from '../shared/ccjk.BFQ7yr5S.mjs';
|
|
9
|
-
import { p as promptBoolean } from '../shared/ccjk.
|
|
9
|
+
import { p as promptBoolean } from '../shared/ccjk.DOwtZMk8.mjs';
|
|
10
|
+
import '../shared/ccjk.BAGoDD49.mjs';
|
|
11
|
+
import 'node:readline';
|
|
12
|
+
import 'stream';
|
|
13
|
+
import 'node:tty';
|
|
14
|
+
import 'node:async_hooks';
|
|
15
|
+
import '../shared/ccjk.Cjgrln_h.mjs';
|
|
16
|
+
import 'node:util';
|
|
17
|
+
import 'tty';
|
|
18
|
+
import 'fs';
|
|
19
|
+
import 'child_process';
|
|
20
|
+
import 'node:path';
|
|
10
21
|
import 'node:os';
|
|
11
|
-
import '
|
|
22
|
+
import 'node:crypto';
|
|
23
|
+
import 'buffer';
|
|
24
|
+
import 'string_decoder';
|
|
25
|
+
import '../shared/ccjk.bQ7Dh1g4.mjs';
|
|
12
26
|
import 'node:fs';
|
|
13
27
|
import 'node:url';
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import 'smol-toml';
|
|
28
|
+
import '../shared/ccjk.BBtCGd_g.mjs';
|
|
29
|
+
import './index6.mjs';
|
|
17
30
|
import './fs-operations.mjs';
|
|
18
|
-
import 'node:crypto';
|
|
19
31
|
import 'node:fs/promises';
|
|
20
32
|
import './json-config.mjs';
|
|
21
|
-
import '
|
|
22
|
-
import 'inquirer-toggle';
|
|
33
|
+
import '../shared/ccjk.RyizuzOI.mjs';
|
|
23
34
|
|
|
24
35
|
async function selectAiOutputLanguage(defaultLang) {
|
|
25
36
|
ensureI18nInitialized();
|
|
26
|
-
console.log(
|
|
37
|
+
console.log(a.dim(`
|
|
27
38
|
${i18n.t("language:aiOutputLangHint")}
|
|
28
39
|
`));
|
|
29
40
|
const aiLangChoices = Object.entries(AI_OUTPUT_LANGUAGES).map(([key]) => ({
|
|
@@ -42,7 +53,7 @@ async function selectAiOutputLanguage(defaultLang) {
|
|
|
42
53
|
default: defaultChoice
|
|
43
54
|
});
|
|
44
55
|
if (!lang) {
|
|
45
|
-
console.log(
|
|
56
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
46
57
|
process__default.exit(0);
|
|
47
58
|
}
|
|
48
59
|
const aiOutputLang = lang;
|
|
@@ -54,7 +65,7 @@ async function selectAiOutputLanguage(defaultLang) {
|
|
|
54
65
|
validate: async (value) => !!value || i18n.t("language:languageRequired") || "Language is required"
|
|
55
66
|
});
|
|
56
67
|
if (!customLang) {
|
|
57
|
-
console.log(
|
|
68
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
58
69
|
process__default.exit(0);
|
|
59
70
|
}
|
|
60
71
|
return customLang;
|
|
@@ -83,7 +94,7 @@ async function selectScriptLanguage(currentLang) {
|
|
|
83
94
|
})))
|
|
84
95
|
});
|
|
85
96
|
if (!lang) {
|
|
86
|
-
console.log(
|
|
97
|
+
console.log(a.yellow(LANGUAGE_SELECTION_MESSAGES.operationCancelled));
|
|
87
98
|
process__default.exit(0);
|
|
88
99
|
}
|
|
89
100
|
const scriptLang = lang;
|
|
@@ -103,13 +114,13 @@ async function resolveAiOutputLanguage(scriptLang, commandLineOption, savedConfi
|
|
|
103
114
|
return savedConfig.aiOutputLang;
|
|
104
115
|
}
|
|
105
116
|
const currentLanguageLabel = getAiOutputLanguageLabel(savedConfig.aiOutputLang) || savedConfig.aiOutputLang;
|
|
106
|
-
console.log(
|
|
117
|
+
console.log(a.green(`${i18n.t("language:currentConfigFound")}: ${currentLanguageLabel}`));
|
|
107
118
|
const shouldModify = await promptBoolean({
|
|
108
119
|
message: i18n.t("language:modifyConfigPrompt"),
|
|
109
120
|
defaultValue: false
|
|
110
121
|
});
|
|
111
122
|
if (!shouldModify) {
|
|
112
|
-
console.log(
|
|
123
|
+
console.log(a.gray(`\u2714 ${i18n.t("language:aiOutputLangHint")}: ${currentLanguageLabel}`));
|
|
113
124
|
return savedConfig.aiOutputLang;
|
|
114
125
|
}
|
|
115
126
|
return await selectAiOutputLanguage(scriptLang);
|
|
@@ -137,7 +148,7 @@ async function selectTemplateLanguage() {
|
|
|
137
148
|
)
|
|
138
149
|
});
|
|
139
150
|
if (!lang) {
|
|
140
|
-
console.log(
|
|
151
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
141
152
|
process__default.exit(0);
|
|
142
153
|
}
|
|
143
154
|
return lang;
|
|
@@ -152,13 +163,13 @@ async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPromp
|
|
|
152
163
|
return savedConfig.templateLang;
|
|
153
164
|
}
|
|
154
165
|
const currentLanguageLabel = LANG_LABELS[savedConfig.templateLang];
|
|
155
|
-
console.log(
|
|
166
|
+
console.log(a.green(`${i18n.t("language:currentTemplateLanguageFound")}: ${currentLanguageLabel}`));
|
|
156
167
|
const shouldModify = await promptBoolean({
|
|
157
168
|
message: i18n.t("language:modifyTemplateLanguagePrompt"),
|
|
158
169
|
defaultValue: false
|
|
159
170
|
});
|
|
160
171
|
if (!shouldModify) {
|
|
161
|
-
console.log(
|
|
172
|
+
console.log(a.gray(`\u2714 ${i18n.t("language:selectConfigLang")}: ${currentLanguageLabel}`));
|
|
162
173
|
return savedConfig.templateLang;
|
|
163
174
|
}
|
|
164
175
|
return await selectTemplateLanguage();
|
|
@@ -167,7 +178,7 @@ async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPromp
|
|
|
167
178
|
if (skipPrompt) {
|
|
168
179
|
return savedConfig.preferredLang;
|
|
169
180
|
}
|
|
170
|
-
console.log(
|
|
181
|
+
console.log(a.yellow(`${i18n.t("language:usingFallbackTemplate")}: ${LANG_LABELS[savedConfig.preferredLang]}`));
|
|
171
182
|
const shouldModify = await promptBoolean({
|
|
172
183
|
message: i18n.t("language:modifyTemplateLanguagePrompt"),
|
|
173
184
|
defaultValue: false
|
|
@@ -194,13 +205,13 @@ async function resolveSystemPromptStyle(availablePrompts, commandLineOption, sav
|
|
|
194
205
|
if (skipPrompt) {
|
|
195
206
|
return currentStyleId;
|
|
196
207
|
}
|
|
197
|
-
console.log(
|
|
208
|
+
console.log(a.green(`${i18n.t("language:currentSystemPromptFound")}: ${currentStyle.name}`));
|
|
198
209
|
const shouldModify = await promptBoolean({
|
|
199
210
|
message: i18n.t("language:modifySystemPromptPrompt"),
|
|
200
211
|
defaultValue: false
|
|
201
212
|
});
|
|
202
213
|
if (!shouldModify) {
|
|
203
|
-
console.log(
|
|
214
|
+
console.log(a.gray(`\u2714 ${i18n.t("language:currentSystemPromptFound")}: ${currentStyle.name}`));
|
|
204
215
|
return currentStyleId;
|
|
205
216
|
}
|
|
206
217
|
}
|
|
@@ -213,14 +224,14 @@ async function resolveSystemPromptStyle(availablePrompts, commandLineOption, sav
|
|
|
213
224
|
name: "systemPrompt",
|
|
214
225
|
message: i18n.t("codex:systemPromptPrompt"),
|
|
215
226
|
choices: addNumbersToChoices(availablePrompts.map((style) => ({
|
|
216
|
-
name: `${style.name} - ${
|
|
227
|
+
name: `${style.name} - ${a.gray(style.description)}`,
|
|
217
228
|
value: style.id
|
|
218
229
|
}))),
|
|
219
230
|
default: "senior-architect"
|
|
220
231
|
// Default to senior-architect
|
|
221
232
|
}]);
|
|
222
233
|
if (!systemPrompt) {
|
|
223
|
-
console.log(
|
|
234
|
+
console.log(a.yellow(i18n.t("common:cancelled")));
|
|
224
235
|
process__default.exit(0);
|
|
225
236
|
}
|
|
226
237
|
return systemPrompt;
|