ccjk 5.2.0 → 5.2.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/api.mjs +6 -6
- package/dist/chunks/auto-updater.mjs +80 -133
- package/dist/chunks/ccm.mjs +7 -7
- package/dist/chunks/ccr.mjs +7 -4
- package/dist/chunks/ccu.mjs +6 -6
- package/dist/chunks/check-updates.mjs +3 -3
- package/dist/chunks/claude-code-incremental-manager.mjs +38 -38
- package/dist/chunks/cloud-v5.mjs +1651 -0
- package/dist/chunks/codex.mjs +70 -70
- package/dist/chunks/commands.mjs +25 -25
- package/dist/chunks/commit.mjs +16 -16
- package/dist/chunks/config-consolidator.mjs +9 -9
- package/dist/chunks/config-switch.mjs +39 -39
- package/dist/chunks/config.mjs +5 -5
- package/dist/chunks/config2.mjs +85 -85
- package/dist/chunks/context.mjs +2 -2
- package/dist/chunks/doctor.mjs +31 -31
- package/dist/chunks/features.mjs +84 -83
- package/dist/chunks/help.mjs +116 -116
- package/dist/chunks/index4.mjs +46 -46
- package/dist/chunks/init.mjs +214 -191
- package/dist/chunks/interview.mjs +102 -102
- package/dist/chunks/manager.mjs +238 -0
- package/dist/chunks/marketplace.mjs +59 -59
- package/dist/chunks/mcp.mjs +82 -82
- package/dist/chunks/menu.mjs +441 -379
- package/dist/chunks/notification.mjs +112 -112
- package/dist/chunks/onboarding.mjs +7 -7
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/permission-manager.mjs +8 -8
- package/dist/chunks/plugin.mjs +100 -100
- package/dist/chunks/prompts.mjs +15 -15
- package/dist/chunks/providers.mjs +65 -65
- package/dist/chunks/session.mjs +83 -83
- package/dist/chunks/skills-sync.mjs +72 -72
- package/dist/chunks/skills.mjs +88 -88
- package/dist/chunks/team.mjs +6 -6
- package/dist/chunks/uninstall.mjs +35 -35
- package/dist/chunks/update.mjs +6 -6
- package/dist/chunks/upgrade-manager.mjs +4 -4
- package/dist/chunks/workflows2.mjs +13 -13
- package/dist/cli.mjs +21 -0
- package/dist/i18n/locales/en/menu.json +16 -1
- package/dist/i18n/locales/en/skills.json +29 -0
- package/dist/i18n/locales/zh-CN/menu.json +16 -1
- package/dist/i18n/locales/zh-CN/skills.json +29 -0
- package/dist/index.mjs +4 -4
- package/dist/shared/{ccjk.f40us0yY.mjs → ccjk.BiJujy5w.mjs} +4 -4
- package/dist/shared/{ccjk.CQzwtnZ1.mjs → ccjk.C_3BYaWc.mjs} +50 -50
- package/dist/shared/{ccjk.Zwx-YR_P.mjs → ccjk.DjD9Rzxq.mjs} +32 -32
- package/dist/shared/{ccjk.DtWIPt8E.mjs → ccjk.XgW1H2t3.mjs} +68 -68
- package/dist/shared/{ccjk.BlPCiSHj.mjs → ccjk.tI4PJA0c.mjs} +30 -30
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync, mkdirSync } from 'node:fs';
|
|
2
|
-
import
|
|
2
|
+
import ansis__default from 'ansis';
|
|
3
3
|
import { join } from 'pathe';
|
|
4
4
|
import { SETTINGS_FILE, CCJK_CONFIG_DIR } from './constants.mjs';
|
|
5
|
-
import { S as STATUS } from '../shared/ccjk.
|
|
5
|
+
import { S as STATUS } from '../shared/ccjk.DjD9Rzxq.mjs';
|
|
6
6
|
import { writeFileAtomic } from './fs-operations.mjs';
|
|
7
7
|
import 'node:os';
|
|
8
8
|
import './index2.mjs';
|
|
@@ -165,17 +165,17 @@ function getCurrentTemplateId() {
|
|
|
165
165
|
function displayPermissions() {
|
|
166
166
|
const permissions = readPermissions();
|
|
167
167
|
const templateId = getCurrentTemplateId();
|
|
168
|
-
console.log(
|
|
169
|
-
console.log(
|
|
168
|
+
console.log(ansis__default.green("\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 Claude Code Permissions \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n"));
|
|
169
|
+
console.log(ansis__default.white.bold("Trusted Directories:"));
|
|
170
170
|
if (permissions.trustedDirectories.length === 0) {
|
|
171
|
-
console.log(
|
|
171
|
+
console.log(ansis__default.gray(" (none)"));
|
|
172
172
|
} else {
|
|
173
173
|
for (const dir of permissions.trustedDirectories) {
|
|
174
174
|
console.log(STATUS.success(dir));
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
console.log("");
|
|
178
|
-
console.log(
|
|
178
|
+
console.log(ansis__default.white.bold("Pre-authorized Operations:"));
|
|
179
179
|
const allPermissions = [
|
|
180
180
|
"file-read",
|
|
181
181
|
"file-write",
|
|
@@ -200,9 +200,9 @@ function displayPermissions() {
|
|
|
200
200
|
console.log("");
|
|
201
201
|
if (templateId) {
|
|
202
202
|
const template = PERMISSION_TEMPLATES.find((t) => t.id === templateId);
|
|
203
|
-
console.log(
|
|
203
|
+
console.log(ansis__default.gray(`Template: ${ansis__default.green(template?.name || templateId)}`));
|
|
204
204
|
} else {
|
|
205
|
-
console.log(
|
|
205
|
+
console.log(ansis__default.gray("Template: custom"));
|
|
206
206
|
}
|
|
207
207
|
console.log("");
|
|
208
208
|
}
|
package/dist/chunks/plugin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
|
-
import
|
|
2
|
+
import ansis__default from 'ansis';
|
|
3
3
|
import { Buffer } from 'node:buffer';
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, readdirSync, statSync, rmSync } from 'node:fs';
|
|
5
5
|
import { join } from 'pathe';
|
|
@@ -1572,8 +1572,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1572
1572
|
case "i":
|
|
1573
1573
|
case "add":
|
|
1574
1574
|
if (args.length === 0) {
|
|
1575
|
-
console.log(
|
|
1576
|
-
console.log(
|
|
1575
|
+
console.log(ansis__default.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u8981\u5B89\u88C5\u7684\u63D2\u4EF6 ID" : "\u274C Please specify a plugin ID to install"));
|
|
1576
|
+
console.log(ansis__default.gray(isZh ? "\u7528\u6CD5: /plugin install <plugin-id>" : "Usage: /plugin install <plugin-id>"));
|
|
1577
1577
|
process__default.exit(1);
|
|
1578
1578
|
}
|
|
1579
1579
|
await installPlugin(args[0], options);
|
|
@@ -1582,8 +1582,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1582
1582
|
case "remove":
|
|
1583
1583
|
case "rm":
|
|
1584
1584
|
if (args.length === 0) {
|
|
1585
|
-
console.log(
|
|
1586
|
-
console.log(
|
|
1585
|
+
console.log(ansis__default.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u8981\u5378\u8F7D\u7684\u63D2\u4EF6 ID" : "\u274C Please specify a plugin ID to uninstall"));
|
|
1586
|
+
console.log(ansis__default.gray(isZh ? "\u7528\u6CD5: /plugin uninstall <plugin-id>" : "Usage: /plugin uninstall <plugin-id>"));
|
|
1587
1587
|
process__default.exit(1);
|
|
1588
1588
|
}
|
|
1589
1589
|
await uninstallPlugin(args[0]);
|
|
@@ -1592,8 +1592,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1592
1592
|
case "s":
|
|
1593
1593
|
case "find":
|
|
1594
1594
|
if (args.length === 0) {
|
|
1595
|
-
console.log(
|
|
1596
|
-
console.log(
|
|
1595
|
+
console.log(ansis__default.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u641C\u7D22\u5173\u952E\u8BCD" : "\u274C Please specify a search query"));
|
|
1596
|
+
console.log(ansis__default.gray(isZh ? "\u7528\u6CD5: /plugin search <\u5173\u952E\u8BCD>" : "Usage: /plugin search <query>"));
|
|
1597
1597
|
process__default.exit(1);
|
|
1598
1598
|
}
|
|
1599
1599
|
await searchPlugins(args.join(" "), options);
|
|
@@ -1602,8 +1602,8 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1602
1602
|
case "show":
|
|
1603
1603
|
case "details":
|
|
1604
1604
|
if (args.length === 0) {
|
|
1605
|
-
console.log(
|
|
1606
|
-
console.log(
|
|
1605
|
+
console.log(ansis__default.red(isZh ? "\u274C \u8BF7\u6307\u5B9A\u63D2\u4EF6 ID" : "\u274C Please specify a plugin ID"));
|
|
1606
|
+
console.log(ansis__default.gray(isZh ? "\u7528\u6CD5: /plugin info <plugin-id>" : "Usage: /plugin info <plugin-id>"));
|
|
1607
1607
|
process__default.exit(1);
|
|
1608
1608
|
}
|
|
1609
1609
|
await showPluginInfo(args[0]);
|
|
@@ -1627,13 +1627,13 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1627
1627
|
showHelp();
|
|
1628
1628
|
break;
|
|
1629
1629
|
default:
|
|
1630
|
-
console.log(
|
|
1630
|
+
console.log(ansis__default.red(isZh ? `\u274C \u672A\u77E5\u547D\u4EE4: ${action}` : `\u274C Unknown command: ${action}`));
|
|
1631
1631
|
showHelp();
|
|
1632
1632
|
process__default.exit(1);
|
|
1633
1633
|
}
|
|
1634
1634
|
} catch (error) {
|
|
1635
1635
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1636
|
-
console.log(
|
|
1636
|
+
console.log(ansis__default.red(`
|
|
1637
1637
|
\u274C ${isZh ? "\u9519\u8BEF" : "Error"}: ${errorMessage}`));
|
|
1638
1638
|
if (options.verbose) {
|
|
1639
1639
|
console.error(error);
|
|
@@ -1644,75 +1644,75 @@ async function pluginCommand(action = "list", args = [], options = {}) {
|
|
|
1644
1644
|
async function listPlugins(options) {
|
|
1645
1645
|
const isZh = i18n.language === "zh-CN";
|
|
1646
1646
|
const manager = getCloudPluginManager();
|
|
1647
|
-
console.log(
|
|
1647
|
+
console.log(ansis__default.green.bold(`
|
|
1648
1648
|
\u{1F4E6} ${isZh ? "\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6" : "Installed Plugins"}
|
|
1649
1649
|
`));
|
|
1650
1650
|
const installed = manager.getInstalledPlugins();
|
|
1651
1651
|
if (installed.length === 0) {
|
|
1652
|
-
console.log(
|
|
1653
|
-
console.log(
|
|
1652
|
+
console.log(ansis__default.gray(isZh ? "\u6682\u65E0\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6" : "No plugins installed"));
|
|
1653
|
+
console.log(ansis__default.gray(`
|
|
1654
1654
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin search <\u5173\u952E\u8BCD> \u641C\u7D22\u63D2\u4EF6" : "Use /plugin search <query> to find plugins"}`));
|
|
1655
1655
|
return;
|
|
1656
1656
|
}
|
|
1657
1657
|
for (const plugin of installed) {
|
|
1658
|
-
console.log(` ${
|
|
1659
|
-
console.log(` ${
|
|
1658
|
+
console.log(` ${ansis__default.green("\u25CF")} ${ansis__default.bold(getPluginName(plugin))} ${ansis__default.gray(`v${plugin.version}`)}`);
|
|
1659
|
+
console.log(` ${ansis__default.gray(getPluginDescription(plugin))}`);
|
|
1660
1660
|
if (options.verbose && plugin.author) {
|
|
1661
|
-
console.log(` ${
|
|
1661
|
+
console.log(` ${ansis__default.gray(`by ${plugin.author}`)}`);
|
|
1662
1662
|
}
|
|
1663
1663
|
console.log("");
|
|
1664
1664
|
}
|
|
1665
|
-
console.log(
|
|
1665
|
+
console.log(ansis__default.gray(`${isZh ? "\u5171" : "Total"} ${installed.length} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"}`));
|
|
1666
1666
|
}
|
|
1667
1667
|
async function installPlugin(pluginId, options) {
|
|
1668
1668
|
const isZh = i18n.language === "zh-CN";
|
|
1669
1669
|
const manager = getCloudPluginManager();
|
|
1670
|
-
console.log(
|
|
1670
|
+
console.log(ansis__default.green(`
|
|
1671
1671
|
\u23F3 ${isZh ? "\u6B63\u5728\u83B7\u53D6\u63D2\u4EF6\u4FE1\u606F..." : "Fetching plugin info..."}`));
|
|
1672
1672
|
const pluginInfo = await manager.getPluginInfo(pluginId);
|
|
1673
1673
|
if (!pluginInfo) {
|
|
1674
|
-
console.log(
|
|
1674
|
+
console.log(ansis__default.red(`
|
|
1675
1675
|
\u274C ${isZh ? "\u63D2\u4EF6\u672A\u627E\u5230" : "Plugin not found"}: ${pluginId}`));
|
|
1676
|
-
console.log(
|
|
1676
|
+
console.log(ansis__default.gray(`
|
|
1677
1677
|
\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
1678
|
const searchResult = await manager.searchPlugins({ query: pluginId, pageSize: 3 });
|
|
1679
1679
|
if (searchResult.success && searchResult.data && searchResult.data.length > 0) {
|
|
1680
|
-
console.log(
|
|
1680
|
+
console.log(ansis__default.yellow(`
|
|
1681
1681
|
${isZh ? "\u60A8\u662F\u5426\u5728\u627E:" : "Did you mean:"}`));
|
|
1682
1682
|
for (const p of searchResult.data) {
|
|
1683
|
-
console.log(` - ${
|
|
1683
|
+
console.log(` - ${ansis__default.green(p.id)} - ${getPluginName(p)}`);
|
|
1684
1684
|
}
|
|
1685
1685
|
}
|
|
1686
1686
|
process__default.exit(1);
|
|
1687
1687
|
}
|
|
1688
1688
|
const isInstalled = manager.isPluginInstalled(pluginId);
|
|
1689
1689
|
if (isInstalled && !options.force) {
|
|
1690
|
-
console.log(
|
|
1690
|
+
console.log(ansis__default.yellow(`
|
|
1691
1691
|
\u26A0\uFE0F ${isZh ? "\u63D2\u4EF6\u5DF2\u5B89\u88C5" : "Plugin already installed"}: ${getPluginName(pluginInfo)}`));
|
|
1692
|
-
console.log(
|
|
1692
|
+
console.log(ansis__default.gray(`\u{1F4A1} ${isZh ? "\u4F7F\u7528 --force \u5F3A\u5236\u91CD\u65B0\u5B89\u88C5" : "Use --force to reinstall"}`));
|
|
1693
1693
|
return;
|
|
1694
1694
|
}
|
|
1695
|
-
console.log(
|
|
1695
|
+
console.log(ansis__default.green.bold(`
|
|
1696
1696
|
\u{1F4E6} ${getPluginName(pluginInfo)}`));
|
|
1697
|
-
console.log(
|
|
1698
|
-
console.log(
|
|
1697
|
+
console.log(ansis__default.gray(` ${getPluginDescription(pluginInfo)}`));
|
|
1698
|
+
console.log(ansis__default.gray(` ${isZh ? "\u7248\u672C" : "Version"}: ${pluginInfo.version}`));
|
|
1699
1699
|
if (pluginInfo.author) {
|
|
1700
|
-
console.log(
|
|
1700
|
+
console.log(ansis__default.gray(` ${isZh ? "\u4F5C\u8005" : "Author"}: ${pluginInfo.author}`));
|
|
1701
1701
|
}
|
|
1702
1702
|
console.log("");
|
|
1703
|
-
console.log(
|
|
1703
|
+
console.log(ansis__default.green(`\u23F3 ${isZh ? "\u6B63\u5728\u5B89\u88C5..." : "Installing..."}`));
|
|
1704
1704
|
const result = await manager.installPlugin(pluginId, {
|
|
1705
1705
|
force: options.force
|
|
1706
1706
|
});
|
|
1707
1707
|
if (result.success) {
|
|
1708
|
-
console.log(
|
|
1708
|
+
console.log(ansis__default.green(`
|
|
1709
1709
|
\u2705 ${isZh ? "\u5B89\u88C5\u6210\u529F" : "Installation successful"}!`));
|
|
1710
|
-
console.log(
|
|
1710
|
+
console.log(ansis__default.gray(` ${isZh ? "\u8DEF\u5F84" : "Path"}: ${result.installedPath}`));
|
|
1711
1711
|
if (result.dependencies && result.dependencies.length > 0) {
|
|
1712
|
-
console.log(
|
|
1712
|
+
console.log(ansis__default.gray(` ${isZh ? "\u4F9D\u8D56" : "Dependencies"}: ${result.dependencies.join(", ")}`));
|
|
1713
1713
|
}
|
|
1714
1714
|
} else {
|
|
1715
|
-
console.log(
|
|
1715
|
+
console.log(ansis__default.red(`
|
|
1716
1716
|
\u274C ${isZh ? "\u5B89\u88C5\u5931\u8D25" : "Installation failed"}: ${result.error}`));
|
|
1717
1717
|
process__default.exit(1);
|
|
1718
1718
|
}
|
|
@@ -1722,18 +1722,18 @@ async function uninstallPlugin(pluginId) {
|
|
|
1722
1722
|
const manager = getCloudPluginManager();
|
|
1723
1723
|
const isInstalled = manager.isPluginInstalled(pluginId);
|
|
1724
1724
|
if (!isInstalled) {
|
|
1725
|
-
console.log(
|
|
1725
|
+
console.log(ansis__default.yellow(`
|
|
1726
1726
|
\u26A0\uFE0F ${isZh ? "\u63D2\u4EF6\u672A\u5B89\u88C5" : "Plugin not installed"}: ${pluginId}`));
|
|
1727
1727
|
return;
|
|
1728
1728
|
}
|
|
1729
|
-
console.log(
|
|
1729
|
+
console.log(ansis__default.green(`
|
|
1730
1730
|
\u23F3 ${isZh ? "\u6B63\u5728\u5378\u8F7D..." : "Uninstalling..."}`));
|
|
1731
1731
|
const result = await manager.uninstallPlugin(pluginId);
|
|
1732
1732
|
if (result.success) {
|
|
1733
|
-
console.log(
|
|
1733
|
+
console.log(ansis__default.green(`
|
|
1734
1734
|
\u2705 ${isZh ? "\u5378\u8F7D\u6210\u529F" : "Uninstallation successful"}!`));
|
|
1735
1735
|
} else {
|
|
1736
|
-
console.log(
|
|
1736
|
+
console.log(ansis__default.red(`
|
|
1737
1737
|
\u274C ${isZh ? "\u5378\u8F7D\u5931\u8D25" : "Uninstallation failed"}: ${result.error}`));
|
|
1738
1738
|
process__default.exit(1);
|
|
1739
1739
|
}
|
|
@@ -1741,35 +1741,35 @@ async function uninstallPlugin(pluginId) {
|
|
|
1741
1741
|
async function searchPlugins(query, options) {
|
|
1742
1742
|
const isZh = i18n.language === "zh-CN";
|
|
1743
1743
|
const manager = getCloudPluginManager();
|
|
1744
|
-
console.log(
|
|
1744
|
+
console.log(ansis__default.green(`
|
|
1745
1745
|
\u{1F50D} ${isZh ? "\u641C\u7D22" : "Searching"}: "${query}"
|
|
1746
1746
|
`));
|
|
1747
1747
|
const result = await manager.searchPlugins({ query, pageSize: 20 });
|
|
1748
1748
|
if (!result.success || !result.data || result.data.length === 0) {
|
|
1749
|
-
console.log(
|
|
1750
|
-
console.log(
|
|
1749
|
+
console.log(ansis__default.yellow(isZh ? "\u672A\u627E\u5230\u5339\u914D\u7684\u63D2\u4EF6" : "No plugins found"));
|
|
1750
|
+
console.log(ansis__default.gray(`
|
|
1751
1751
|
\u{1F4A1} ${isZh ? "\u5C1D\u8BD5\u4F7F\u7528\u4E0D\u540C\u7684\u5173\u952E\u8BCD" : "Try different keywords"}`));
|
|
1752
1752
|
return;
|
|
1753
1753
|
}
|
|
1754
|
-
console.log(
|
|
1754
|
+
console.log(ansis__default.bold(isZh ? "\u641C\u7D22\u7ED3\u679C:" : "Search Results:"));
|
|
1755
1755
|
console.log("");
|
|
1756
1756
|
for (const plugin of result.data) {
|
|
1757
1757
|
const installed = manager.isPluginInstalled(plugin.id);
|
|
1758
|
-
const statusIcon = installed ?
|
|
1759
|
-
console.log(` ${statusIcon} ${
|
|
1760
|
-
console.log(` ${
|
|
1758
|
+
const statusIcon = installed ? ansis__default.green("\u25CF") : ansis__default.gray("\u25CB");
|
|
1759
|
+
console.log(` ${statusIcon} ${ansis__default.bold(getPluginName(plugin))} ${ansis__default.gray(`(${plugin.id})`)} ${ansis__default.gray(`v${plugin.version}`)}`);
|
|
1760
|
+
console.log(` ${ansis__default.gray(getPluginDescription(plugin))}`);
|
|
1761
1761
|
if (options.verbose) {
|
|
1762
1762
|
if (plugin.downloads) {
|
|
1763
|
-
console.log(` ${
|
|
1763
|
+
console.log(` ${ansis__default.gray(`\u2B07\uFE0F ${plugin.downloads.toLocaleString()} downloads`)}`);
|
|
1764
1764
|
}
|
|
1765
1765
|
if (plugin.rating) {
|
|
1766
|
-
console.log(` ${
|
|
1766
|
+
console.log(` ${ansis__default.gray(`\u2B50 ${plugin.rating.toFixed(1)}`)}`);
|
|
1767
1767
|
}
|
|
1768
1768
|
}
|
|
1769
1769
|
console.log("");
|
|
1770
1770
|
}
|
|
1771
|
-
console.log(
|
|
1772
|
-
console.log(
|
|
1771
|
+
console.log(ansis__default.gray(`${isZh ? "\u5171\u627E\u5230" : "Found"} ${result.data.length} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"}`));
|
|
1772
|
+
console.log(ansis__default.gray(`
|
|
1773
1773
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin install <id> \u5B89\u88C5\u63D2\u4EF6" : "Use /plugin install <id> to install a plugin"}`));
|
|
1774
1774
|
}
|
|
1775
1775
|
async function showPluginInfo(pluginId) {
|
|
@@ -1777,36 +1777,36 @@ async function showPluginInfo(pluginId) {
|
|
|
1777
1777
|
const manager = getCloudPluginManager();
|
|
1778
1778
|
const plugin = await manager.getPluginInfo(pluginId);
|
|
1779
1779
|
if (!plugin) {
|
|
1780
|
-
console.log(
|
|
1780
|
+
console.log(ansis__default.red(`
|
|
1781
1781
|
\u274C ${isZh ? "\u63D2\u4EF6\u672A\u627E\u5230" : "Plugin not found"}: ${pluginId}`));
|
|
1782
1782
|
process__default.exit(1);
|
|
1783
1783
|
}
|
|
1784
1784
|
const installed = manager.isPluginInstalled(pluginId);
|
|
1785
|
-
console.log(
|
|
1785
|
+
console.log(ansis__default.green.bold(`
|
|
1786
1786
|
\u{1F4E6} ${getPluginName(plugin)}`));
|
|
1787
|
-
console.log(
|
|
1788
|
-
console.log(`${
|
|
1789
|
-
console.log(`${
|
|
1790
|
-
console.log(`${
|
|
1791
|
-
console.log(`${
|
|
1787
|
+
console.log(ansis__default.dim("\u2500".repeat(50)));
|
|
1788
|
+
console.log(`${ansis__default.bold(isZh ? "\u63CF\u8FF0" : "Description")}: ${getPluginDescription(plugin)}`);
|
|
1789
|
+
console.log(`${ansis__default.bold("ID")}: ${plugin.id}`);
|
|
1790
|
+
console.log(`${ansis__default.bold(isZh ? "\u7248\u672C" : "Version")}: ${plugin.version}`);
|
|
1791
|
+
console.log(`${ansis__default.bold(isZh ? "\u72B6\u6001" : "Status")}: ${installed ? ansis__default.green(isZh ? "\u5DF2\u5B89\u88C5" : "Installed") : ansis__default.gray(isZh ? "\u672A\u5B89\u88C5" : "Not installed")}`);
|
|
1792
1792
|
if (plugin.author) {
|
|
1793
|
-
console.log(`${
|
|
1793
|
+
console.log(`${ansis__default.bold(isZh ? "\u4F5C\u8005" : "Author")}: ${plugin.author}`);
|
|
1794
1794
|
}
|
|
1795
1795
|
if (plugin.category) {
|
|
1796
|
-
console.log(`${
|
|
1796
|
+
console.log(`${ansis__default.bold(isZh ? "\u5206\u7C7B" : "Category")}: ${plugin.category}`);
|
|
1797
1797
|
}
|
|
1798
1798
|
if (plugin.tags && plugin.tags.length > 0) {
|
|
1799
|
-
console.log(`${
|
|
1799
|
+
console.log(`${ansis__default.bold(isZh ? "\u6807\u7B7E" : "Tags")}: ${plugin.tags.join(", ")}`);
|
|
1800
1800
|
}
|
|
1801
1801
|
if (plugin.downloads) {
|
|
1802
|
-
console.log(`${
|
|
1802
|
+
console.log(`${ansis__default.bold(isZh ? "\u4E0B\u8F7D\u91CF" : "Downloads")}: ${plugin.downloads.toLocaleString()}`);
|
|
1803
1803
|
}
|
|
1804
1804
|
if (plugin.rating) {
|
|
1805
|
-
console.log(`${
|
|
1805
|
+
console.log(`${ansis__default.bold(isZh ? "\u8BC4\u5206" : "Rating")}: \u2B50 ${plugin.rating.toFixed(1)}`);
|
|
1806
1806
|
}
|
|
1807
|
-
console.log(
|
|
1807
|
+
console.log(ansis__default.dim("\u2500".repeat(50)));
|
|
1808
1808
|
if (!installed) {
|
|
1809
|
-
console.log(
|
|
1809
|
+
console.log(ansis__default.gray(`
|
|
1810
1810
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin install" : "Use /plugin install"} ${pluginId} ${isZh ? "\u5B89\u88C5\u6B64\u63D2\u4EF6" : "to install this plugin"}`));
|
|
1811
1811
|
}
|
|
1812
1812
|
}
|
|
@@ -1814,38 +1814,38 @@ async function updatePlugins(pluginId) {
|
|
|
1814
1814
|
const isZh = i18n.language === "zh-CN";
|
|
1815
1815
|
const manager = getCloudPluginManager();
|
|
1816
1816
|
if (pluginId) {
|
|
1817
|
-
console.log(
|
|
1817
|
+
console.log(ansis__default.green(`
|
|
1818
1818
|
\u23F3 ${isZh ? "\u6B63\u5728\u66F4\u65B0" : "Updating"} ${pluginId}...`));
|
|
1819
1819
|
const result = await manager.updatePlugin(pluginId);
|
|
1820
1820
|
if (result.success) {
|
|
1821
1821
|
if (result.updated) {
|
|
1822
|
-
console.log(
|
|
1822
|
+
console.log(ansis__default.green(`
|
|
1823
1823
|
\u2705 ${isZh ? "\u66F4\u65B0\u6210\u529F" : "Update successful"}! ${result.oldVersion} \u2192 ${result.newVersion}`));
|
|
1824
1824
|
} else {
|
|
1825
|
-
console.log(
|
|
1825
|
+
console.log(ansis__default.gray(`
|
|
1826
1826
|
\u2713 ${isZh ? "\u5DF2\u662F\u6700\u65B0\u7248\u672C" : "Already up to date"}`));
|
|
1827
1827
|
}
|
|
1828
1828
|
} else {
|
|
1829
|
-
console.log(
|
|
1829
|
+
console.log(ansis__default.red(`
|
|
1830
1830
|
\u274C ${isZh ? "\u66F4\u65B0\u5931\u8D25" : "Update failed"}: ${result.error}`));
|
|
1831
1831
|
process__default.exit(1);
|
|
1832
1832
|
}
|
|
1833
1833
|
} else {
|
|
1834
|
-
console.log(
|
|
1834
|
+
console.log(ansis__default.green(`
|
|
1835
1835
|
\u23F3 ${isZh ? "\u6B63\u5728\u68C0\u67E5\u66F4\u65B0..." : "Checking for updates..."}`));
|
|
1836
1836
|
const results = await manager.updateAllPlugins();
|
|
1837
1837
|
let updatedCount = 0;
|
|
1838
1838
|
for (const result of results) {
|
|
1839
1839
|
if (result.success && result.updated) {
|
|
1840
|
-
console.log(
|
|
1840
|
+
console.log(ansis__default.green(` \u2705 ${result.pluginId}: ${result.oldVersion} \u2192 ${result.newVersion}`));
|
|
1841
1841
|
updatedCount++;
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
if (updatedCount === 0) {
|
|
1845
|
-
console.log(
|
|
1845
|
+
console.log(ansis__default.gray(`
|
|
1846
1846
|
\u2713 ${isZh ? "\u6240\u6709\u63D2\u4EF6\u5DF2\u662F\u6700\u65B0\u7248\u672C" : "All plugins are up to date"}`));
|
|
1847
1847
|
} else {
|
|
1848
|
-
console.log(
|
|
1848
|
+
console.log(ansis__default.green(`
|
|
1849
1849
|
\u2705 ${isZh ? "\u5DF2\u66F4\u65B0" : "Updated"} ${updatedCount} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"}`));
|
|
1850
1850
|
}
|
|
1851
1851
|
}
|
|
@@ -1853,69 +1853,69 @@ async function updatePlugins(pluginId) {
|
|
|
1853
1853
|
async function listCategories() {
|
|
1854
1854
|
const isZh = i18n.language === "zh-CN";
|
|
1855
1855
|
const manager = getCloudPluginManager();
|
|
1856
|
-
console.log(
|
|
1856
|
+
console.log(ansis__default.green.bold(`
|
|
1857
1857
|
\u{1F4C2} ${isZh ? "\u63D2\u4EF6\u5206\u7C7B" : "Plugin Categories"}
|
|
1858
1858
|
`));
|
|
1859
1859
|
const result = await manager.getCategories();
|
|
1860
1860
|
if (!result.success || !result.data || result.data.length === 0) {
|
|
1861
|
-
console.log(
|
|
1861
|
+
console.log(ansis__default.gray(isZh ? "\u6682\u65E0\u5206\u7C7B\u4FE1\u606F" : "No categories available"));
|
|
1862
1862
|
return;
|
|
1863
1863
|
}
|
|
1864
1864
|
for (const cat of result.data) {
|
|
1865
1865
|
const name = isZh ? cat.name["zh-CN"] || cat.name.en : cat.name.en;
|
|
1866
|
-
console.log(` \u{1F4E6} ${
|
|
1866
|
+
console.log(` \u{1F4E6} ${ansis__default.bold(name)} ${ansis__default.gray(`(${cat.count} ${isZh ? "\u4E2A\u63D2\u4EF6" : "plugins"})`)}`);
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
1869
|
async function showFeaturedPlugins() {
|
|
1870
1870
|
const isZh = i18n.language === "zh-CN";
|
|
1871
1871
|
const manager = getCloudPluginManager();
|
|
1872
|
-
console.log(
|
|
1872
|
+
console.log(ansis__default.green.bold(`
|
|
1873
1873
|
\u2B50 ${isZh ? "\u7CBE\u9009\u63D2\u4EF6" : "Featured Plugins"}
|
|
1874
1874
|
`));
|
|
1875
1875
|
const featured = await manager.getFeaturedPlugins();
|
|
1876
1876
|
if (!featured || featured.length === 0) {
|
|
1877
|
-
console.log(
|
|
1877
|
+
console.log(ansis__default.gray(isZh ? "\u6682\u65E0\u7CBE\u9009\u63D2\u4EF6" : "No featured plugins available"));
|
|
1878
1878
|
return;
|
|
1879
1879
|
}
|
|
1880
1880
|
for (const plugin of featured) {
|
|
1881
1881
|
const installed = manager.isPluginInstalled(plugin.id);
|
|
1882
|
-
const statusIcon = installed ?
|
|
1883
|
-
console.log(` ${statusIcon} ${
|
|
1884
|
-
console.log(` ${
|
|
1882
|
+
const statusIcon = installed ? ansis__default.green("\u25CF") : ansis__default.gray("\u25CB");
|
|
1883
|
+
console.log(` ${statusIcon} ${ansis__default.bold(getPluginName(plugin))} ${ansis__default.gray(`v${plugin.version}`)}`);
|
|
1884
|
+
console.log(` ${ansis__default.gray(getPluginDescription(plugin))}`);
|
|
1885
1885
|
console.log("");
|
|
1886
1886
|
}
|
|
1887
|
-
console.log(
|
|
1887
|
+
console.log(ansis__default.gray(`
|
|
1888
1888
|
\u{1F4A1} ${isZh ? "\u4F7F\u7528 /plugin install <id> \u5B89\u88C5\u63D2\u4EF6" : "Use /plugin install <id> to install a plugin"}`));
|
|
1889
1889
|
}
|
|
1890
1890
|
function showHelp() {
|
|
1891
1891
|
const isZh = i18n.language === "zh-CN";
|
|
1892
|
-
console.log(
|
|
1892
|
+
console.log(ansis__default.green.bold(`
|
|
1893
1893
|
\u{1F4E6} ${isZh ? "CCJK \u63D2\u4EF6\u7BA1\u7406" : "CCJK Plugin Manager"}
|
|
1894
1894
|
`));
|
|
1895
|
-
console.log(
|
|
1895
|
+
console.log(ansis__default.dim("\u2500".repeat(50)));
|
|
1896
1896
|
console.log("");
|
|
1897
|
-
console.log(
|
|
1897
|
+
console.log(ansis__default.bold(isZh ? "\u7528\u6CD5:" : "Usage:"));
|
|
1898
1898
|
console.log(" /plugin <command> [options]");
|
|
1899
1899
|
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(` ${
|
|
1900
|
+
console.log(ansis__default.bold(isZh ? "\u547D\u4EE4:" : "Commands:"));
|
|
1901
|
+
console.log(` ${ansis__default.green("list")} ${isZh ? "\u5217\u51FA\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6" : "List installed plugins"}`);
|
|
1902
|
+
console.log(` ${ansis__default.green("install")} <id> ${isZh ? "\u5B89\u88C5\u63D2\u4EF6" : "Install a plugin"}`);
|
|
1903
|
+
console.log(` ${ansis__default.green("uninstall")} <id> ${isZh ? "\u5378\u8F7D\u63D2\u4EF6" : "Uninstall a plugin"}`);
|
|
1904
|
+
console.log(` ${ansis__default.green("search")} <query> ${isZh ? "\u641C\u7D22\u63D2\u4EF6" : "Search for plugins"}`);
|
|
1905
|
+
console.log(` ${ansis__default.green("info")} <id> ${isZh ? "\u663E\u793A\u63D2\u4EF6\u8BE6\u60C5" : "Show plugin details"}`);
|
|
1906
|
+
console.log(` ${ansis__default.green("update")} [id] ${isZh ? "\u66F4\u65B0\u63D2\u4EF6" : "Update plugin(s)"}`);
|
|
1907
|
+
console.log(` ${ansis__default.green("categories")} ${isZh ? "\u5217\u51FA\u63D2\u4EF6\u5206\u7C7B" : "List plugin categories"}`);
|
|
1908
|
+
console.log(` ${ansis__default.green("featured")} ${isZh ? "\u663E\u793A\u7CBE\u9009\u63D2\u4EF6" : "Show featured plugins"}`);
|
|
1909
|
+
console.log(` ${ansis__default.green("help")} ${isZh ? "\u663E\u793A\u5E2E\u52A9" : "Show this help"}`);
|
|
1910
1910
|
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 ${
|
|
1911
|
+
console.log(ansis__default.bold(isZh ? "\u793A\u4F8B:" : "Examples:"));
|
|
1912
|
+
console.log(` /plugin search git ${ansis__default.gray(isZh ? "# \u641C\u7D22 git \u76F8\u5173\u63D2\u4EF6" : "# Search for git plugins")}`);
|
|
1913
|
+
console.log(` /plugin install code-simplifier ${ansis__default.gray(isZh ? "# \u5B89\u88C5\u63D2\u4EF6" : "# Install a plugin")}`);
|
|
1914
|
+
console.log(` /plugin info code-simplifier ${ansis__default.gray(isZh ? "# \u67E5\u770B\u63D2\u4EF6\u8BE6\u60C5" : "# View plugin details")}`);
|
|
1915
|
+
console.log(` /plugin update ${ansis__default.gray(isZh ? "# \u66F4\u65B0\u6240\u6709\u63D2\u4EF6" : "# Update all plugins")}`);
|
|
1916
1916
|
console.log("");
|
|
1917
|
-
console.log(
|
|
1918
|
-
console.log(
|
|
1917
|
+
console.log(ansis__default.dim("\u2500".repeat(50)));
|
|
1918
|
+
console.log(ansis__default.gray(`${isZh ? "\u63D2\u4EF6\u5E02\u573A" : "Plugin Marketplace"}: https://claudehome.cn/plugins`));
|
|
1919
1919
|
}
|
|
1920
1920
|
async function handlePluginCommand(args) {
|
|
1921
1921
|
const action = args[0] || "list";
|
package/dist/chunks/prompts.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import process__default from 'node:process';
|
|
2
|
-
import
|
|
2
|
+
import ansis__default from 'ansis';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
4
|
import { version } from './package.mjs';
|
|
5
5
|
import { LANG_LABELS, getAiOutputLanguageLabel, SUPPORTED_LANGS, AI_OUTPUT_LANGUAGES } from './constants.mjs';
|
|
@@ -22,7 +22,7 @@ import 'inquirer-toggle';
|
|
|
22
22
|
|
|
23
23
|
async function selectAiOutputLanguage(defaultLang) {
|
|
24
24
|
ensureI18nInitialized();
|
|
25
|
-
console.log(
|
|
25
|
+
console.log(ansis__default.dim(`
|
|
26
26
|
${i18n.t("language:aiOutputLangHint")}
|
|
27
27
|
`));
|
|
28
28
|
const aiLangChoices = Object.entries(AI_OUTPUT_LANGUAGES).map(([key]) => ({
|
|
@@ -41,7 +41,7 @@ async function selectAiOutputLanguage(defaultLang) {
|
|
|
41
41
|
default: defaultChoice
|
|
42
42
|
});
|
|
43
43
|
if (!lang) {
|
|
44
|
-
console.log(
|
|
44
|
+
console.log(ansis__default.yellow(i18n.t("common:cancelled")));
|
|
45
45
|
process__default.exit(0);
|
|
46
46
|
}
|
|
47
47
|
const aiOutputLang = lang;
|
|
@@ -53,7 +53,7 @@ async function selectAiOutputLanguage(defaultLang) {
|
|
|
53
53
|
validate: async (value) => !!value || i18n.t("language:languageRequired") || "Language is required"
|
|
54
54
|
});
|
|
55
55
|
if (!customLang) {
|
|
56
|
-
console.log(
|
|
56
|
+
console.log(ansis__default.yellow(i18n.t("common:cancelled")));
|
|
57
57
|
process__default.exit(0);
|
|
58
58
|
}
|
|
59
59
|
return customLang;
|
|
@@ -82,7 +82,7 @@ async function selectScriptLanguage(currentLang) {
|
|
|
82
82
|
})))
|
|
83
83
|
});
|
|
84
84
|
if (!lang) {
|
|
85
|
-
console.log(
|
|
85
|
+
console.log(ansis__default.yellow(LANGUAGE_SELECTION_MESSAGES.operationCancelled));
|
|
86
86
|
process__default.exit(0);
|
|
87
87
|
}
|
|
88
88
|
const scriptLang = lang;
|
|
@@ -102,13 +102,13 @@ async function resolveAiOutputLanguage(scriptLang, commandLineOption, savedConfi
|
|
|
102
102
|
return savedConfig.aiOutputLang;
|
|
103
103
|
}
|
|
104
104
|
const currentLanguageLabel = getAiOutputLanguageLabel(savedConfig.aiOutputLang) || savedConfig.aiOutputLang;
|
|
105
|
-
console.log(
|
|
105
|
+
console.log(ansis__default.green(`${i18n.t("language:currentConfigFound")}: ${currentLanguageLabel}`));
|
|
106
106
|
const shouldModify = await promptBoolean({
|
|
107
107
|
message: i18n.t("language:modifyConfigPrompt"),
|
|
108
108
|
defaultValue: false
|
|
109
109
|
});
|
|
110
110
|
if (!shouldModify) {
|
|
111
|
-
console.log(
|
|
111
|
+
console.log(ansis__default.gray(`\u2714 ${i18n.t("language:aiOutputLangHint")}: ${currentLanguageLabel}`));
|
|
112
112
|
return savedConfig.aiOutputLang;
|
|
113
113
|
}
|
|
114
114
|
return await selectAiOutputLanguage(scriptLang);
|
|
@@ -136,7 +136,7 @@ async function selectTemplateLanguage() {
|
|
|
136
136
|
)
|
|
137
137
|
});
|
|
138
138
|
if (!lang) {
|
|
139
|
-
console.log(
|
|
139
|
+
console.log(ansis__default.yellow(i18n.t("common:cancelled")));
|
|
140
140
|
process__default.exit(0);
|
|
141
141
|
}
|
|
142
142
|
return lang;
|
|
@@ -151,13 +151,13 @@ async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPromp
|
|
|
151
151
|
return savedConfig.templateLang;
|
|
152
152
|
}
|
|
153
153
|
const currentLanguageLabel = LANG_LABELS[savedConfig.templateLang];
|
|
154
|
-
console.log(
|
|
154
|
+
console.log(ansis__default.green(`${i18n.t("language:currentTemplateLanguageFound")}: ${currentLanguageLabel}`));
|
|
155
155
|
const shouldModify = await promptBoolean({
|
|
156
156
|
message: i18n.t("language:modifyTemplateLanguagePrompt"),
|
|
157
157
|
defaultValue: false
|
|
158
158
|
});
|
|
159
159
|
if (!shouldModify) {
|
|
160
|
-
console.log(
|
|
160
|
+
console.log(ansis__default.gray(`\u2714 ${i18n.t("language:selectConfigLang")}: ${currentLanguageLabel}`));
|
|
161
161
|
return savedConfig.templateLang;
|
|
162
162
|
}
|
|
163
163
|
return await selectTemplateLanguage();
|
|
@@ -166,7 +166,7 @@ async function resolveTemplateLanguage(commandLineOption, savedConfig, skipPromp
|
|
|
166
166
|
if (skipPrompt) {
|
|
167
167
|
return savedConfig.preferredLang;
|
|
168
168
|
}
|
|
169
|
-
console.log(
|
|
169
|
+
console.log(ansis__default.yellow(`${i18n.t("language:usingFallbackTemplate")}: ${LANG_LABELS[savedConfig.preferredLang]}`));
|
|
170
170
|
const shouldModify = await promptBoolean({
|
|
171
171
|
message: i18n.t("language:modifyTemplateLanguagePrompt"),
|
|
172
172
|
defaultValue: false
|
|
@@ -193,13 +193,13 @@ async function resolveSystemPromptStyle(availablePrompts, commandLineOption, sav
|
|
|
193
193
|
if (skipPrompt) {
|
|
194
194
|
return currentStyleId;
|
|
195
195
|
}
|
|
196
|
-
console.log(
|
|
196
|
+
console.log(ansis__default.green(`${i18n.t("language:currentSystemPromptFound")}: ${currentStyle.name}`));
|
|
197
197
|
const shouldModify = await promptBoolean({
|
|
198
198
|
message: i18n.t("language:modifySystemPromptPrompt"),
|
|
199
199
|
defaultValue: false
|
|
200
200
|
});
|
|
201
201
|
if (!shouldModify) {
|
|
202
|
-
console.log(
|
|
202
|
+
console.log(ansis__default.gray(`\u2714 ${i18n.t("language:currentSystemPromptFound")}: ${currentStyle.name}`));
|
|
203
203
|
return currentStyleId;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -212,14 +212,14 @@ async function resolveSystemPromptStyle(availablePrompts, commandLineOption, sav
|
|
|
212
212
|
name: "systemPrompt",
|
|
213
213
|
message: i18n.t("codex:systemPromptPrompt"),
|
|
214
214
|
choices: addNumbersToChoices(availablePrompts.map((style) => ({
|
|
215
|
-
name: `${style.name} - ${
|
|
215
|
+
name: `${style.name} - ${ansis__default.gray(style.description)}`,
|
|
216
216
|
value: style.id
|
|
217
217
|
}))),
|
|
218
218
|
default: "senior-architect"
|
|
219
219
|
// Default to senior-architect
|
|
220
220
|
}]);
|
|
221
221
|
if (!systemPrompt) {
|
|
222
|
-
console.log(
|
|
222
|
+
console.log(ansis__default.yellow(i18n.t("common:cancelled")));
|
|
223
223
|
process__default.exit(0);
|
|
224
224
|
}
|
|
225
225
|
return systemPrompt;
|