ccjk 5.2.1 → 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 +57 -57
- 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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ansis__default from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import { i18n } from './index2.mjs';
|
|
4
4
|
import * as nodeFs from 'node:fs';
|
|
@@ -1534,11 +1534,11 @@ async function notificationCommand(action = "menu", args) {
|
|
|
1534
1534
|
break;
|
|
1535
1535
|
case "enable":
|
|
1536
1536
|
await enableNotifications();
|
|
1537
|
-
console.log(
|
|
1537
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:status.enabled")}`));
|
|
1538
1538
|
break;
|
|
1539
1539
|
case "disable":
|
|
1540
1540
|
await disableNotifications();
|
|
1541
|
-
console.log(
|
|
1541
|
+
console.log(ansis__default.yellow(`\u23F8\uFE0F ${i18n.t("notification:status.disabled")}`));
|
|
1542
1542
|
break;
|
|
1543
1543
|
case "channels":
|
|
1544
1544
|
await manageChannels();
|
|
@@ -1572,19 +1572,19 @@ async function showNotificationMenu() {
|
|
|
1572
1572
|
const enabledChannels = await getEnabledChannels();
|
|
1573
1573
|
const cloudBound = isDeviceBound();
|
|
1574
1574
|
console.log("");
|
|
1575
|
-
console.log(
|
|
1575
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:menu.title")));
|
|
1576
1576
|
console.log("");
|
|
1577
|
-
const statusText = config.enabled ?
|
|
1578
|
-
console.log(` ${
|
|
1579
|
-
const cloudStatusText = cloudBound ?
|
|
1580
|
-
console.log(` ${
|
|
1577
|
+
const statusText = config.enabled ? ansis__default.green(i18n.t("notification:status.enabled")) : ansis__default.yellow(i18n.t("notification:status.disabled"));
|
|
1578
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:menu.statusLabel"))} ${statusText}`);
|
|
1579
|
+
const cloudStatusText = cloudBound ? ansis__default.green(i18n.t("notification:cloud.bound")) : ansis__default.yellow(i18n.t("notification:cloud.notBound"));
|
|
1580
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:cloud.statusLabel"))} ${cloudStatusText}`);
|
|
1581
1581
|
if (enabledChannels.length > 0) {
|
|
1582
1582
|
const channelNames = enabledChannels.map((ch) => i18n.t(`notification:channels.${ch}`)).join(", ");
|
|
1583
|
-
console.log(` ${
|
|
1583
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:menu.channelsLabel"))} ${channelNames}`);
|
|
1584
1584
|
} else {
|
|
1585
|
-
console.log(` ${
|
|
1585
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:menu.channelsLabel"))} ${ansis__default.yellow(i18n.t("notification:channels.noChannels"))}`);
|
|
1586
1586
|
}
|
|
1587
|
-
console.log(` ${
|
|
1587
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:menu.thresholdLabel"))} ${config.threshold} ${i18n.t("notification:config.threshold.minutes", { count: config.threshold })}`);
|
|
1588
1588
|
console.log("");
|
|
1589
1589
|
const choices = [];
|
|
1590
1590
|
if (!cloudBound) {
|
|
@@ -1621,27 +1621,27 @@ async function showNotificationMenu() {
|
|
|
1621
1621
|
}
|
|
1622
1622
|
async function runConfigWizard() {
|
|
1623
1623
|
console.log("");
|
|
1624
|
-
console.log(
|
|
1625
|
-
console.log(
|
|
1624
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:config.wizard.title")));
|
|
1625
|
+
console.log(ansis__default.dim(i18n.t("notification:config.wizard.welcome")));
|
|
1626
1626
|
console.log("");
|
|
1627
|
-
console.log(
|
|
1627
|
+
console.log(ansis__default.yellow(i18n.t("notification:config.wizard.step1")));
|
|
1628
1628
|
const config = await initializeNotificationConfig();
|
|
1629
|
-
console.log(
|
|
1629
|
+
console.log(ansis__default.green(i18n.t("notification:config.wizard.tokenGenerated", { token: maskToken(config.deviceToken) })));
|
|
1630
1630
|
console.log("");
|
|
1631
|
-
console.log(
|
|
1631
|
+
console.log(ansis__default.yellow(i18n.t("notification:config.wizard.step2")));
|
|
1632
1632
|
const channels = await selectChannels();
|
|
1633
1633
|
console.log("");
|
|
1634
1634
|
if (channels.length > 0) {
|
|
1635
|
-
console.log(
|
|
1635
|
+
console.log(ansis__default.yellow(i18n.t("notification:config.wizard.step3")));
|
|
1636
1636
|
for (const channel of channels) {
|
|
1637
1637
|
await configureChannel(channel);
|
|
1638
1638
|
}
|
|
1639
1639
|
console.log("");
|
|
1640
1640
|
}
|
|
1641
|
-
console.log(
|
|
1641
|
+
console.log(ansis__default.yellow(i18n.t("notification:config.wizard.step4")));
|
|
1642
1642
|
await configureThreshold();
|
|
1643
1643
|
console.log("");
|
|
1644
|
-
console.log(
|
|
1644
|
+
console.log(ansis__default.yellow(i18n.t("notification:config.wizard.step5")));
|
|
1645
1645
|
await updateNotificationConfig({ enabled: true });
|
|
1646
1646
|
const { shouldTest } = await inquirer.prompt([{
|
|
1647
1647
|
type: "confirm",
|
|
@@ -1653,7 +1653,7 @@ async function runConfigWizard() {
|
|
|
1653
1653
|
await sendTestNotification();
|
|
1654
1654
|
}
|
|
1655
1655
|
console.log("");
|
|
1656
|
-
console.log(
|
|
1656
|
+
console.log(ansis__default.bold.green(i18n.t("notification:config.wizard.complete")));
|
|
1657
1657
|
console.log("");
|
|
1658
1658
|
}
|
|
1659
1659
|
async function selectChannels() {
|
|
@@ -1679,7 +1679,7 @@ async function selectChannels() {
|
|
|
1679
1679
|
}
|
|
1680
1680
|
async function configureChannel(channel) {
|
|
1681
1681
|
console.log("");
|
|
1682
|
-
console.log(
|
|
1682
|
+
console.log(ansis__default.green(`\u914D\u7F6E ${i18n.t(`notification:channels.${channel}`)}:`));
|
|
1683
1683
|
switch (channel) {
|
|
1684
1684
|
case "feishu":
|
|
1685
1685
|
await configureFeishu();
|
|
@@ -1718,7 +1718,7 @@ async function configureFeishu() {
|
|
|
1718
1718
|
...secret && { secret }
|
|
1719
1719
|
};
|
|
1720
1720
|
await enableChannel("feishu", config);
|
|
1721
|
-
console.log(
|
|
1721
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:channels.feishu")} ${i18n.t("notification:status.configured")}`));
|
|
1722
1722
|
}
|
|
1723
1723
|
async function configureWechat() {
|
|
1724
1724
|
const { corpId } = await inquirer.prompt([{
|
|
@@ -1746,7 +1746,7 @@ async function configureWechat() {
|
|
|
1746
1746
|
secret
|
|
1747
1747
|
};
|
|
1748
1748
|
await enableChannel("wechat", config);
|
|
1749
|
-
console.log(
|
|
1749
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:channels.wechat")} ${i18n.t("notification:status.configured")}`));
|
|
1750
1750
|
}
|
|
1751
1751
|
async function configureEmail() {
|
|
1752
1752
|
const { address } = await inquirer.prompt([{
|
|
@@ -1765,7 +1765,7 @@ async function configureEmail() {
|
|
|
1765
1765
|
address
|
|
1766
1766
|
};
|
|
1767
1767
|
await enableChannel("email", config);
|
|
1768
|
-
console.log(
|
|
1768
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:channels.email")} ${i18n.t("notification:status.configured")}`));
|
|
1769
1769
|
}
|
|
1770
1770
|
async function configureSms() {
|
|
1771
1771
|
const { phone } = await inquirer.prompt([{
|
|
@@ -1791,15 +1791,15 @@ async function configureSms() {
|
|
|
1791
1791
|
countryCode
|
|
1792
1792
|
};
|
|
1793
1793
|
await enableChannel("sms", config);
|
|
1794
|
-
console.log(
|
|
1794
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:channels.sms")} ${i18n.t("notification:status.configured")}`));
|
|
1795
1795
|
}
|
|
1796
1796
|
async function manageChannels() {
|
|
1797
1797
|
const enabledChannels = await getEnabledChannels();
|
|
1798
1798
|
console.log("");
|
|
1799
|
-
console.log(
|
|
1799
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:channels.title")));
|
|
1800
1800
|
console.log("");
|
|
1801
1801
|
if (enabledChannels.length === 0) {
|
|
1802
|
-
console.log(
|
|
1802
|
+
console.log(ansis__default.yellow(i18n.t("notification:channels.noChannels")));
|
|
1803
1803
|
} else {
|
|
1804
1804
|
console.log(i18n.t("notification:channels.enabledCount", { count: enabledChannels.length }));
|
|
1805
1805
|
for (const channel of enabledChannels) {
|
|
@@ -1824,7 +1824,7 @@ async function manageChannels() {
|
|
|
1824
1824
|
const allChannels = ["feishu", "wechat", "email", "sms"];
|
|
1825
1825
|
const availableChannels = allChannels.filter((ch) => !enabledChannels.includes(ch));
|
|
1826
1826
|
if (availableChannels.length === 0) {
|
|
1827
|
-
console.log(
|
|
1827
|
+
console.log(ansis__default.yellow("\u6240\u6709\u6E20\u9053\u90FD\u5DF2\u542F\u7528"));
|
|
1828
1828
|
return;
|
|
1829
1829
|
}
|
|
1830
1830
|
const { channel } = await inquirer.prompt([{
|
|
@@ -1839,7 +1839,7 @@ async function manageChannels() {
|
|
|
1839
1839
|
await configureChannel(channel);
|
|
1840
1840
|
} else if (action === "remove") {
|
|
1841
1841
|
if (enabledChannels.length === 0) {
|
|
1842
|
-
console.log(
|
|
1842
|
+
console.log(ansis__default.yellow("\u6CA1\u6709\u5DF2\u542F\u7528\u7684\u6E20\u9053"));
|
|
1843
1843
|
return;
|
|
1844
1844
|
}
|
|
1845
1845
|
const { channel } = await inquirer.prompt([{
|
|
@@ -1852,13 +1852,13 @@ async function manageChannels() {
|
|
|
1852
1852
|
}))
|
|
1853
1853
|
}]);
|
|
1854
1854
|
await disableChannel(channel);
|
|
1855
|
-
console.log(
|
|
1855
|
+
console.log(ansis__default.green(`\u2705 \u5DF2\u79FB\u9664 ${i18n.t(`notification:channels.${channel}`)}`));
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
1858
|
async function configureThreshold() {
|
|
1859
1859
|
const config = await loadNotificationConfig();
|
|
1860
1860
|
console.log("");
|
|
1861
|
-
console.log(
|
|
1861
|
+
console.log(ansis__default.dim(i18n.t("notification:config.threshold.description")));
|
|
1862
1862
|
console.log("");
|
|
1863
1863
|
const { threshold } = await inquirer.prompt([{
|
|
1864
1864
|
type: "list",
|
|
@@ -1890,23 +1890,23 @@ async function configureThreshold() {
|
|
|
1890
1890
|
finalThreshold = Number.parseInt(customValue, 10);
|
|
1891
1891
|
}
|
|
1892
1892
|
await setThreshold(finalThreshold);
|
|
1893
|
-
console.log(
|
|
1893
|
+
console.log(ansis__default.green(`\u2705 \u9608\u503C\u5DF2\u8BBE\u7F6E\u4E3A ${finalThreshold} \u5206\u949F`));
|
|
1894
1894
|
}
|
|
1895
1895
|
async function showStatus() {
|
|
1896
1896
|
const summary = await getConfigSummary();
|
|
1897
1897
|
const validation = await validateCurrentConfig();
|
|
1898
1898
|
console.log("");
|
|
1899
|
-
console.log(
|
|
1899
|
+
console.log(ansis__default.bold.cyan("\u{1F4CA} \u901A\u77E5\u7CFB\u7EDF\u72B6\u6001"));
|
|
1900
1900
|
console.log("");
|
|
1901
1901
|
const statusIcon = summary.enabled ? "\u2705" : "\u23F8\uFE0F";
|
|
1902
|
-
const statusText = summary.enabled ?
|
|
1902
|
+
const statusText = summary.enabled ? ansis__default.green(i18n.t("notification:status.enabled")) : ansis__default.yellow(i18n.t("notification:status.disabled"));
|
|
1903
1903
|
console.log(` ${statusIcon} \u72B6\u6001: ${statusText}`);
|
|
1904
|
-
console.log(` \u{1F511} \u8BBE\u5907\u4EE4\u724C: ${
|
|
1904
|
+
console.log(` \u{1F511} \u8BBE\u5907\u4EE4\u724C: ${ansis__default.dim(summary.deviceToken)}`);
|
|
1905
1905
|
console.log(` \u23F1\uFE0F \u9608\u503C: ${summary.threshold} \u5206\u949F`);
|
|
1906
1906
|
console.log("");
|
|
1907
|
-
console.log(
|
|
1907
|
+
console.log(ansis__default.bold(" \u{1F4F1} \u901A\u77E5\u6E20\u9053:"));
|
|
1908
1908
|
if (summary.enabledChannels.length === 0) {
|
|
1909
|
-
console.log(` ${
|
|
1909
|
+
console.log(` ${ansis__default.yellow(i18n.t("notification:channels.noChannels"))}`);
|
|
1910
1910
|
} else {
|
|
1911
1911
|
for (const channel of summary.enabledChannels) {
|
|
1912
1912
|
console.log(` \u2705 ${i18n.t(`notification:channels.${channel}`)}`);
|
|
@@ -1918,14 +1918,14 @@ async function showStatus() {
|
|
|
1918
1918
|
}
|
|
1919
1919
|
if (!validation.valid) {
|
|
1920
1920
|
console.log("");
|
|
1921
|
-
console.log(
|
|
1921
|
+
console.log(ansis__default.bold.red(" \u26A0\uFE0F \u914D\u7F6E\u95EE\u9898:"));
|
|
1922
1922
|
for (const error of validation.errors) {
|
|
1923
1923
|
console.log(` \u274C ${error.message}`);
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
1926
|
if (validation.warnings.length > 0) {
|
|
1927
1927
|
console.log("");
|
|
1928
|
-
console.log(
|
|
1928
|
+
console.log(ansis__default.bold.yellow(" \u26A0\uFE0F \u8B66\u544A:"));
|
|
1929
1929
|
for (const warning of validation.warnings) {
|
|
1930
1930
|
console.log(` \u26A0\uFE0F ${warning}`);
|
|
1931
1931
|
}
|
|
@@ -1935,11 +1935,11 @@ async function showStatus() {
|
|
|
1935
1935
|
async function sendTestNotification() {
|
|
1936
1936
|
const enabledChannels = await getEnabledChannels();
|
|
1937
1937
|
if (enabledChannels.length === 0) {
|
|
1938
|
-
console.log(
|
|
1938
|
+
console.log(ansis__default.yellow(i18n.t("notification:errors.noChannels")));
|
|
1939
1939
|
return;
|
|
1940
1940
|
}
|
|
1941
1941
|
console.log("");
|
|
1942
|
-
console.log(
|
|
1942
|
+
console.log(ansis__default.green(i18n.t("notification:test.sending")));
|
|
1943
1943
|
try {
|
|
1944
1944
|
const client = CloudClient.getInstance();
|
|
1945
1945
|
await client.initialize();
|
|
@@ -1950,40 +1950,40 @@ async function sendTestNotification() {
|
|
|
1950
1950
|
for (const result of results) {
|
|
1951
1951
|
const channelName = i18n.t(`notification:channels.${result.channel}`);
|
|
1952
1952
|
if (result.success) {
|
|
1953
|
-
console.log(
|
|
1953
|
+
console.log(ansis__default.green(`\u2705 ${channelName}: ${i18n.t("notification:test.success")}`));
|
|
1954
1954
|
hasSuccess = true;
|
|
1955
1955
|
} else {
|
|
1956
|
-
console.log(
|
|
1956
|
+
console.log(ansis__default.red(`\u274C ${channelName}: ${result.error || i18n.t("notification:test.failed")}`));
|
|
1957
1957
|
hasFailure = true;
|
|
1958
1958
|
}
|
|
1959
1959
|
}
|
|
1960
1960
|
console.log("");
|
|
1961
1961
|
if (hasSuccess) {
|
|
1962
|
-
console.log(
|
|
1962
|
+
console.log(ansis__default.dim(i18n.t("notification:test.checkDevice")));
|
|
1963
1963
|
}
|
|
1964
1964
|
if (hasFailure) {
|
|
1965
|
-
console.log(
|
|
1965
|
+
console.log(ansis__default.yellow(i18n.t("notification:test.partialFailure")));
|
|
1966
1966
|
}
|
|
1967
1967
|
} catch (error) {
|
|
1968
1968
|
console.log("");
|
|
1969
|
-
console.log(
|
|
1969
|
+
console.log(ansis__default.red(`\u274C ${i18n.t("notification:errors.sendFailed")}`));
|
|
1970
1970
|
if (error instanceof Error) {
|
|
1971
|
-
console.log(
|
|
1971
|
+
console.log(ansis__default.dim(error.message));
|
|
1972
1972
|
}
|
|
1973
1973
|
console.log("");
|
|
1974
|
-
console.log(
|
|
1975
|
-
console.log(
|
|
1976
|
-
console.log(
|
|
1977
|
-
console.log(
|
|
1974
|
+
console.log(ansis__default.yellow(i18n.t("notification:test.troubleshooting")));
|
|
1975
|
+
console.log(ansis__default.dim(` 1. ${i18n.t("notification:test.checkConnection")}`));
|
|
1976
|
+
console.log(ansis__default.dim(` 2. ${i18n.t("notification:test.checkConfig")}`));
|
|
1977
|
+
console.log(ansis__default.dim(` 3. ${i18n.t("notification:test.checkToken")}`));
|
|
1978
1978
|
}
|
|
1979
1979
|
console.log("");
|
|
1980
1980
|
}
|
|
1981
1981
|
async function handleBind(code) {
|
|
1982
1982
|
console.log("");
|
|
1983
|
-
console.log(
|
|
1983
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:cloud.bindTitle")));
|
|
1984
1984
|
console.log("");
|
|
1985
1985
|
if (isDeviceBound()) {
|
|
1986
|
-
console.log(
|
|
1986
|
+
console.log(ansis__default.yellow(i18n.t("notification:cloud.alreadyBound")));
|
|
1987
1987
|
console.log("");
|
|
1988
1988
|
const { confirmRebind } = await inquirer.prompt([{
|
|
1989
1989
|
type: "confirm",
|
|
@@ -1998,7 +1998,7 @@ async function handleBind(code) {
|
|
|
1998
1998
|
}
|
|
1999
1999
|
let bindingCode = code;
|
|
2000
2000
|
if (!bindingCode) {
|
|
2001
|
-
console.log(
|
|
2001
|
+
console.log(ansis__default.dim(i18n.t("notification:cloud.bindInstructions")));
|
|
2002
2002
|
console.log("");
|
|
2003
2003
|
const { inputCode } = await inquirer.prompt([{
|
|
2004
2004
|
type: "input",
|
|
@@ -2017,14 +2017,14 @@ async function handleBind(code) {
|
|
|
2017
2017
|
bindingCode = inputCode.trim();
|
|
2018
2018
|
}
|
|
2019
2019
|
console.log("");
|
|
2020
|
-
console.log(
|
|
2020
|
+
console.log(ansis__default.green(i18n.t("notification:cloud.binding")));
|
|
2021
2021
|
try {
|
|
2022
2022
|
const result = await bindDevice(bindingCode);
|
|
2023
2023
|
if (result.success) {
|
|
2024
2024
|
console.log("");
|
|
2025
|
-
console.log(
|
|
2025
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:cloud.bindSuccess")}`));
|
|
2026
2026
|
console.log("");
|
|
2027
|
-
console.log(
|
|
2027
|
+
console.log(ansis__default.dim(i18n.t("notification:cloud.deviceId", { id: result.deviceId || "N/A" })));
|
|
2028
2028
|
console.log("");
|
|
2029
2029
|
const { sendTest } = await inquirer.prompt([{
|
|
2030
2030
|
type: "confirm",
|
|
@@ -2037,19 +2037,19 @@ async function handleBind(code) {
|
|
|
2037
2037
|
}
|
|
2038
2038
|
} else {
|
|
2039
2039
|
console.log("");
|
|
2040
|
-
console.log(
|
|
2041
|
-
console.log(
|
|
2040
|
+
console.log(ansis__default.red(`\u274C ${i18n.t("notification:cloud.bindFailed")}`));
|
|
2041
|
+
console.log(ansis__default.dim(result.error || i18n.t("notification:cloud.unknownError")));
|
|
2042
2042
|
console.log("");
|
|
2043
|
-
console.log(
|
|
2044
|
-
console.log(
|
|
2045
|
-
console.log(
|
|
2046
|
-
console.log(
|
|
2043
|
+
console.log(ansis__default.yellow(i18n.t("notification:cloud.bindTroubleshooting")));
|
|
2044
|
+
console.log(ansis__default.dim(` 1. ${i18n.t("notification:cloud.checkCode")}`));
|
|
2045
|
+
console.log(ansis__default.dim(` 2. ${i18n.t("notification:cloud.checkExpiry")}`));
|
|
2046
|
+
console.log(ansis__default.dim(` 3. ${i18n.t("notification:cloud.checkNetwork")}`));
|
|
2047
2047
|
}
|
|
2048
2048
|
} catch (error) {
|
|
2049
2049
|
console.log("");
|
|
2050
|
-
console.log(
|
|
2050
|
+
console.log(ansis__default.red(`\u274C ${i18n.t("notification:cloud.bindError")}`));
|
|
2051
2051
|
if (error instanceof Error) {
|
|
2052
|
-
console.log(
|
|
2052
|
+
console.log(ansis__default.dim(error.message));
|
|
2053
2053
|
}
|
|
2054
2054
|
}
|
|
2055
2055
|
console.log("");
|
|
@@ -2057,7 +2057,7 @@ async function handleBind(code) {
|
|
|
2057
2057
|
async function handleUnbind() {
|
|
2058
2058
|
console.log("");
|
|
2059
2059
|
if (!isDeviceBound()) {
|
|
2060
|
-
console.log(
|
|
2060
|
+
console.log(ansis__default.yellow(i18n.t("notification:cloud.notBoundYet")));
|
|
2061
2061
|
console.log("");
|
|
2062
2062
|
return;
|
|
2063
2063
|
}
|
|
@@ -2068,44 +2068,44 @@ async function handleUnbind() {
|
|
|
2068
2068
|
default: false
|
|
2069
2069
|
}]);
|
|
2070
2070
|
if (!confirmUnbind) {
|
|
2071
|
-
console.log(
|
|
2071
|
+
console.log(ansis__default.dim(i18n.t("notification:cloud.unbindCancelled")));
|
|
2072
2072
|
console.log("");
|
|
2073
2073
|
return;
|
|
2074
2074
|
}
|
|
2075
2075
|
unbindDevice();
|
|
2076
|
-
console.log(
|
|
2076
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:cloud.unbindSuccess")}`));
|
|
2077
2077
|
console.log("");
|
|
2078
2078
|
}
|
|
2079
2079
|
async function showCloudStatus() {
|
|
2080
2080
|
console.log("");
|
|
2081
|
-
console.log(
|
|
2081
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:cloud.statusTitle")));
|
|
2082
2082
|
console.log("");
|
|
2083
2083
|
const status = await getBindingStatus();
|
|
2084
2084
|
if (!status.bound) {
|
|
2085
|
-
console.log(` ${
|
|
2085
|
+
console.log(` ${ansis__default.yellow("\u26A0\uFE0F")} ${i18n.t("notification:cloud.notBound")}`);
|
|
2086
2086
|
console.log("");
|
|
2087
|
-
console.log(
|
|
2087
|
+
console.log(ansis__default.dim(i18n.t("notification:cloud.bindHint")));
|
|
2088
2088
|
console.log("");
|
|
2089
2089
|
return;
|
|
2090
2090
|
}
|
|
2091
|
-
console.log(` ${
|
|
2091
|
+
console.log(` ${ansis__default.green("\u2705")} ${i18n.t("notification:cloud.bound")}`);
|
|
2092
2092
|
console.log("");
|
|
2093
2093
|
if (status.deviceId) {
|
|
2094
|
-
console.log(` ${
|
|
2094
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:cloud.deviceIdLabel"))} ${status.deviceId}`);
|
|
2095
2095
|
}
|
|
2096
2096
|
if (status.deviceInfo) {
|
|
2097
|
-
console.log(` ${
|
|
2098
|
-
console.log(` ${
|
|
2097
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:cloud.deviceNameLabel"))} ${status.deviceInfo.name}`);
|
|
2098
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:cloud.platformLabel"))} ${status.deviceInfo.platform}`);
|
|
2099
2099
|
}
|
|
2100
2100
|
if (status.lastUsed) {
|
|
2101
2101
|
const lastUsedDate = new Date(status.lastUsed);
|
|
2102
|
-
console.log(` ${
|
|
2102
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:cloud.lastUsedLabel"))} ${lastUsedDate.toLocaleString()}`);
|
|
2103
2103
|
}
|
|
2104
2104
|
console.log("");
|
|
2105
2105
|
}
|
|
2106
2106
|
async function sendCloudTestNotification() {
|
|
2107
2107
|
console.log("");
|
|
2108
|
-
console.log(
|
|
2108
|
+
console.log(ansis__default.green(i18n.t("notification:cloud.sendingTest")));
|
|
2109
2109
|
try {
|
|
2110
2110
|
const result = await sendNotification({
|
|
2111
2111
|
title: i18n.t("notification:cloud.testTitle"),
|
|
@@ -2113,16 +2113,16 @@ async function sendCloudTestNotification() {
|
|
|
2113
2113
|
type: "success"
|
|
2114
2114
|
});
|
|
2115
2115
|
if (result.success) {
|
|
2116
|
-
console.log(
|
|
2117
|
-
console.log(
|
|
2116
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:cloud.testSuccess")}`));
|
|
2117
|
+
console.log(ansis__default.dim(i18n.t("notification:cloud.checkPhone")));
|
|
2118
2118
|
} else {
|
|
2119
|
-
console.log(
|
|
2120
|
-
console.log(
|
|
2119
|
+
console.log(ansis__default.red(`\u274C ${i18n.t("notification:cloud.testFailed")}`));
|
|
2120
|
+
console.log(ansis__default.dim(result.error || i18n.t("notification:cloud.unknownError")));
|
|
2121
2121
|
}
|
|
2122
2122
|
} catch (error) {
|
|
2123
|
-
console.log(
|
|
2123
|
+
console.log(ansis__default.red(`\u274C ${i18n.t("notification:cloud.testError")}`));
|
|
2124
2124
|
if (error instanceof Error) {
|
|
2125
|
-
console.log(
|
|
2125
|
+
console.log(ansis__default.dim(error.message));
|
|
2126
2126
|
}
|
|
2127
2127
|
}
|
|
2128
2128
|
console.log("");
|
|
@@ -2131,23 +2131,23 @@ async function configureLocalNotification() {
|
|
|
2131
2131
|
const config = await loadLocalNotificationConfig();
|
|
2132
2132
|
const shortcutsAvailable = await isShortcutsAvailable();
|
|
2133
2133
|
console.log("");
|
|
2134
|
-
console.log(
|
|
2135
|
-
console.log(
|
|
2134
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:local.title")));
|
|
2135
|
+
console.log(ansis__default.dim(i18n.t("notification:local.description")));
|
|
2136
2136
|
console.log("");
|
|
2137
|
-
console.log(
|
|
2137
|
+
console.log(ansis__default.bold(i18n.t("notification:local.currentStatus")));
|
|
2138
2138
|
if (shortcutsAvailable) {
|
|
2139
|
-
const shortcutsStatus = config.shortcutName ?
|
|
2139
|
+
const shortcutsStatus = config.shortcutName ? ansis__default.green(i18n.t("notification:status.enabled")) : ansis__default.yellow(i18n.t("notification:status.disabled"));
|
|
2140
2140
|
console.log(` \u{1F34E} ${i18n.t("notification:local.shortcuts.name")}: ${shortcutsStatus}`);
|
|
2141
2141
|
if (config.shortcutName) {
|
|
2142
|
-
console.log(` ${
|
|
2142
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:local.shortcuts.currentShortcut", { name: config.shortcutName }))}`);
|
|
2143
2143
|
}
|
|
2144
2144
|
} else {
|
|
2145
|
-
console.log(` \u{1F34E} ${i18n.t("notification:local.shortcuts.name")}: ${
|
|
2145
|
+
console.log(` \u{1F34E} ${i18n.t("notification:local.shortcuts.name")}: ${ansis__default.dim(i18n.t("notification:local.shortcuts.notAvailable"))}`);
|
|
2146
2146
|
}
|
|
2147
|
-
const barkStatus = config.barkUrl ?
|
|
2147
|
+
const barkStatus = config.barkUrl ? ansis__default.green(i18n.t("notification:status.enabled")) : ansis__default.yellow(i18n.t("notification:status.disabled"));
|
|
2148
2148
|
console.log(` \u{1F4F1} ${i18n.t("notification:local.bark.name")}: ${barkStatus}`);
|
|
2149
2149
|
if (config.barkUrl) {
|
|
2150
|
-
console.log(` ${
|
|
2150
|
+
console.log(` ${ansis__default.dim(i18n.t("notification:local.bark.currentServer", { url: config.barkUrl }))}`);
|
|
2151
2151
|
}
|
|
2152
2152
|
console.log("");
|
|
2153
2153
|
const choices = [];
|
|
@@ -2188,18 +2188,18 @@ async function configureLocalNotification() {
|
|
|
2188
2188
|
}
|
|
2189
2189
|
async function configureShortcuts() {
|
|
2190
2190
|
console.log("");
|
|
2191
|
-
console.log(
|
|
2192
|
-
console.log(
|
|
2191
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:local.shortcuts.title")));
|
|
2192
|
+
console.log(ansis__default.dim(i18n.t("notification:local.shortcuts.description")));
|
|
2193
2193
|
console.log("");
|
|
2194
|
-
console.log(
|
|
2194
|
+
console.log(ansis__default.dim(i18n.t("notification:local.shortcuts.scanning")));
|
|
2195
2195
|
const shortcuts = await listShortcuts();
|
|
2196
2196
|
if (shortcuts.length === 0) {
|
|
2197
|
-
console.log(
|
|
2198
|
-
console.log(
|
|
2197
|
+
console.log(ansis__default.yellow(i18n.t("notification:local.shortcuts.noShortcuts")));
|
|
2198
|
+
console.log(ansis__default.dim(i18n.t("notification:local.shortcuts.createHint")));
|
|
2199
2199
|
console.log("");
|
|
2200
2200
|
return;
|
|
2201
2201
|
}
|
|
2202
|
-
console.log(
|
|
2202
|
+
console.log(ansis__default.green(i18n.t("notification:local.shortcuts.found", { count: shortcuts.length })));
|
|
2203
2203
|
console.log("");
|
|
2204
2204
|
const { shortcutName } = await inquirer.prompt([{
|
|
2205
2205
|
type: "list",
|
|
@@ -2213,7 +2213,7 @@ async function configureShortcuts() {
|
|
|
2213
2213
|
}]);
|
|
2214
2214
|
if (shortcutName === "__disable__") {
|
|
2215
2215
|
await saveLocalNotificationConfig({ shortcutName: "" });
|
|
2216
|
-
console.log(
|
|
2216
|
+
console.log(ansis__default.yellow(`\u23F8\uFE0F ${i18n.t("notification:local.shortcuts.disabled")}`));
|
|
2217
2217
|
return;
|
|
2218
2218
|
}
|
|
2219
2219
|
let finalShortcutName = shortcutName;
|
|
@@ -2227,7 +2227,7 @@ async function configureShortcuts() {
|
|
|
2227
2227
|
finalShortcutName = manualName.trim();
|
|
2228
2228
|
}
|
|
2229
2229
|
await saveLocalNotificationConfig({ shortcutName: finalShortcutName });
|
|
2230
|
-
console.log(
|
|
2230
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:local.shortcuts.configured", { name: finalShortcutName })}`));
|
|
2231
2231
|
const { shouldTest } = await inquirer.prompt([{
|
|
2232
2232
|
type: "confirm",
|
|
2233
2233
|
name: "shouldTest",
|
|
@@ -2240,8 +2240,8 @@ async function configureShortcuts() {
|
|
|
2240
2240
|
}
|
|
2241
2241
|
async function configureBark() {
|
|
2242
2242
|
console.log("");
|
|
2243
|
-
console.log(
|
|
2244
|
-
console.log(
|
|
2243
|
+
console.log(ansis__default.bold.cyan(i18n.t("notification:local.bark.title")));
|
|
2244
|
+
console.log(ansis__default.dim(i18n.t("notification:local.bark.description")));
|
|
2245
2245
|
console.log("");
|
|
2246
2246
|
const config = await loadLocalNotificationConfig();
|
|
2247
2247
|
const { action } = await inquirer.prompt([{
|
|
@@ -2259,7 +2259,7 @@ async function configureBark() {
|
|
|
2259
2259
|
}
|
|
2260
2260
|
if (action === "disable") {
|
|
2261
2261
|
await saveLocalNotificationConfig({ barkUrl: "" });
|
|
2262
|
-
console.log(
|
|
2262
|
+
console.log(ansis__default.yellow(`\u23F8\uFE0F ${i18n.t("notification:local.bark.disabled")}`));
|
|
2263
2263
|
return;
|
|
2264
2264
|
}
|
|
2265
2265
|
const { barkUrl } = await inquirer.prompt([{
|
|
@@ -2275,7 +2275,7 @@ async function configureBark() {
|
|
|
2275
2275
|
}
|
|
2276
2276
|
}]);
|
|
2277
2277
|
await saveLocalNotificationConfig({ barkUrl });
|
|
2278
|
-
console.log(
|
|
2278
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:local.bark.configured")}`));
|
|
2279
2279
|
const { shouldTest } = await inquirer.prompt([{
|
|
2280
2280
|
type: "confirm",
|
|
2281
2281
|
name: "shouldTest",
|
|
@@ -2289,7 +2289,7 @@ async function configureBark() {
|
|
|
2289
2289
|
async function testLocalNotification() {
|
|
2290
2290
|
const config = await loadLocalNotificationConfig();
|
|
2291
2291
|
console.log("");
|
|
2292
|
-
console.log(
|
|
2292
|
+
console.log(ansis__default.green(i18n.t("notification:local.testing")));
|
|
2293
2293
|
console.log("");
|
|
2294
2294
|
let hasAnyEnabled = false;
|
|
2295
2295
|
if (config.shortcutName) {
|
|
@@ -2301,35 +2301,35 @@ async function testLocalNotification() {
|
|
|
2301
2301
|
await testBarkNotification(config.barkUrl);
|
|
2302
2302
|
}
|
|
2303
2303
|
if (!hasAnyEnabled) {
|
|
2304
|
-
console.log(
|
|
2305
|
-
console.log(
|
|
2304
|
+
console.log(ansis__default.yellow(i18n.t("notification:local.noLocalEnabled")));
|
|
2305
|
+
console.log(ansis__default.dim(i18n.t("notification:local.configureFirst")));
|
|
2306
2306
|
}
|
|
2307
2307
|
console.log("");
|
|
2308
2308
|
}
|
|
2309
2309
|
async function testShortcutsNotification(shortcutName) {
|
|
2310
|
-
console.log(
|
|
2310
|
+
console.log(ansis__default.dim(`${i18n.t("notification:local.shortcuts.testing", { name: shortcutName })}...`));
|
|
2311
2311
|
try {
|
|
2312
2312
|
const service = await getLocalNotificationService();
|
|
2313
2313
|
await service.sendShortcutNotification(shortcutName, {
|
|
2314
2314
|
title: i18n.t("notification:local.testTitle"),
|
|
2315
2315
|
body: i18n.t("notification:local.testBody")
|
|
2316
2316
|
});
|
|
2317
|
-
console.log(
|
|
2317
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:local.shortcuts.name")}: ${i18n.t("notification:test.success")}`));
|
|
2318
2318
|
} catch (error) {
|
|
2319
|
-
console.log(
|
|
2319
|
+
console.log(ansis__default.red(`\u274C ${i18n.t("notification:local.shortcuts.name")}: ${error instanceof Error ? error.message : i18n.t("notification:test.failed")}`));
|
|
2320
2320
|
}
|
|
2321
2321
|
}
|
|
2322
2322
|
async function testBarkNotification(barkUrl) {
|
|
2323
|
-
console.log(
|
|
2323
|
+
console.log(ansis__default.dim(`${i18n.t("notification:local.bark.testing")}...`));
|
|
2324
2324
|
try {
|
|
2325
2325
|
const service = await getLocalNotificationService();
|
|
2326
2326
|
await service.sendBarkNotification(barkUrl, {
|
|
2327
2327
|
title: i18n.t("notification:local.testTitle"),
|
|
2328
2328
|
body: i18n.t("notification:local.testBody")
|
|
2329
2329
|
});
|
|
2330
|
-
console.log(
|
|
2330
|
+
console.log(ansis__default.green(`\u2705 ${i18n.t("notification:local.bark.name")}: ${i18n.t("notification:test.success")}`));
|
|
2331
2331
|
} catch (error) {
|
|
2332
|
-
console.log(
|
|
2332
|
+
console.log(ansis__default.red(`\u274C ${i18n.t("notification:local.bark.name")}: ${error instanceof Error ? error.message : i18n.t("notification:test.failed")}`));
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
2335
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync, mkdirSync, statSync } from 'node:fs';
|
|
2
2
|
import process__default from 'node:process';
|
|
3
|
-
import
|
|
3
|
+
import ansis__default from 'ansis';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
import { join, basename } from 'pathe';
|
|
8
8
|
import { CCJK_CONFIG_DIR } from './constants.mjs';
|
|
9
9
|
import { d as detectProject, g as getProjectSummary, a as generateSuggestions } from '../shared/ccjk.CcGtObYC.mjs';
|
|
10
|
-
import { b as boxify, t as theme, S as STATUS } from '../shared/ccjk.
|
|
10
|
+
import { b as boxify, t as theme, S as STATUS } from '../shared/ccjk.DjD9Rzxq.mjs';
|
|
11
11
|
import { writeFileAtomic } from './fs-operations.mjs';
|
|
12
12
|
import 'node:os';
|
|
13
13
|
import './index2.mjs';
|
|
@@ -222,7 +222,7 @@ async function runOnboarding(projectDir = process__default.cwd()) {
|
|
|
222
222
|
result.projectDetected = true;
|
|
223
223
|
console.log("");
|
|
224
224
|
console.log(theme.secondary("\u{1F4C1} Project Info:"));
|
|
225
|
-
console.log(
|
|
225
|
+
console.log(ansis__default.gray(getProjectSummary(project)));
|
|
226
226
|
console.log("");
|
|
227
227
|
spinner.start("Looking for CLAUDE.md...");
|
|
228
228
|
const claudeMd = scanClaudeMd(projectDir);
|
|
@@ -339,14 +339,14 @@ async function runOnboarding(projectDir = process__default.cwd()) {
|
|
|
339
339
|
if (result.recommendations.length > 0) {
|
|
340
340
|
console.log(theme.secondary("\u{1F4A1} Recommendations:"));
|
|
341
341
|
for (const rec of result.recommendations) {
|
|
342
|
-
console.log(
|
|
342
|
+
console.log(ansis__default.gray(` \u2022 ${rec}`));
|
|
343
343
|
}
|
|
344
344
|
console.log("");
|
|
345
345
|
}
|
|
346
346
|
console.log(theme.secondary("\u{1F4CC} Next Steps:"));
|
|
347
|
-
console.log(
|
|
348
|
-
console.log(
|
|
349
|
-
console.log(
|
|
347
|
+
console.log(ansis__default.gray(" \u2022 Run `ccjk` to open the main menu"));
|
|
348
|
+
console.log(ansis__default.gray(" \u2022 Run `ccjk doctor` to check environment"));
|
|
349
|
+
console.log(ansis__default.gray(" \u2022 Run `ccjk groups enable typescript-dev` for TypeScript support"));
|
|
350
350
|
console.log("");
|
|
351
351
|
result.success = true;
|
|
352
352
|
return result;
|
package/dist/chunks/package.mjs
CHANGED