@jvittechs/jai1-cli 0.1.63 → 0.1.65
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/cli.js +163 -12
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var NetworkError = class extends Jai1Error {
|
|
|
33
33
|
// package.json
|
|
34
34
|
var package_default = {
|
|
35
35
|
name: "@jvittechs/jai1-cli",
|
|
36
|
-
version: "0.1.
|
|
36
|
+
version: "0.1.65",
|
|
37
37
|
description: "Unified CLI for Jai1 Framework Management and Redmine Context Sync",
|
|
38
38
|
type: "module",
|
|
39
39
|
bin: {
|
|
@@ -5716,9 +5716,156 @@ Examples:
|
|
|
5716
5716
|
return cmd;
|
|
5717
5717
|
}
|
|
5718
5718
|
|
|
5719
|
+
// src/commands/utils/interactive.ts
|
|
5720
|
+
import React28 from "react";
|
|
5721
|
+
import { render as render5 } from "ink";
|
|
5722
|
+
|
|
5723
|
+
// src/ui/utils/UtilsApp.tsx
|
|
5724
|
+
import React27, { useState as useState14 } from "react";
|
|
5725
|
+
import { Box as Box17, Text as Text18, useInput as useInput12, useApp as useApp5 } from "ink";
|
|
5726
|
+
var MENU_ITEMS2 = [
|
|
5727
|
+
{ id: "password", icon: "\u{1F510}", label: "Password", description: "Generate secure passwords" },
|
|
5728
|
+
{ id: "uuid", icon: "\u{1F194}", label: "UUID", description: "Generate UUID v4" },
|
|
5729
|
+
{ id: "hash", icon: "\u{1F512}", label: "Hash", description: "Hash with MD5/SHA/bcrypt" },
|
|
5730
|
+
{ id: "base64-encode", icon: "\u{1F4DD}", label: "Base64 Encode", description: "Encode to Base64" },
|
|
5731
|
+
{ id: "base64-decode", icon: "\u{1F4DD}", label: "Base64 Decode", description: "Decode Base64" },
|
|
5732
|
+
{ id: "http", icon: "\u{1F310}", label: "HTTP Request", description: "Make HTTP requests" },
|
|
5733
|
+
{ id: "jwt", icon: "\u{1F511}", label: "JWT", description: "Decode/encode JWT" },
|
|
5734
|
+
{ id: "unix-time", icon: "\u{1F552}", label: "Unix Time", description: "Convert timestamps" },
|
|
5735
|
+
{ id: "timezone", icon: "\u{1F30D}", label: "Timezone", description: "Convert timezones" },
|
|
5736
|
+
{ id: "url-encode", icon: "\u{1F517}", label: "URL Encode", description: "Encode URLs" },
|
|
5737
|
+
{ id: "url-decode", icon: "\u{1F517}", label: "URL Decode", description: "Decode URLs" },
|
|
5738
|
+
{ id: "cron", icon: "\u23F0", label: "Cron Parser", description: "Parse cron expressions" },
|
|
5739
|
+
{ id: "markdown", icon: "\u{1F4C4}", label: "Markdown", description: "Preview markdown" }
|
|
5740
|
+
];
|
|
5741
|
+
var UtilsApp = ({ onExit }) => {
|
|
5742
|
+
const [selectedIndex, setSelectedIndex] = useState14(0);
|
|
5743
|
+
const [activeView, setActiveView] = useState14(null);
|
|
5744
|
+
const { exit } = useApp5();
|
|
5745
|
+
useInput12((input, key) => {
|
|
5746
|
+
if (activeView) {
|
|
5747
|
+
if (key.escape) {
|
|
5748
|
+
setActiveView(null);
|
|
5749
|
+
}
|
|
5750
|
+
return;
|
|
5751
|
+
}
|
|
5752
|
+
if (key.upArrow || input === "k") {
|
|
5753
|
+
setSelectedIndex((prev) => prev > 0 ? prev - 1 : MENU_ITEMS2.length - 1);
|
|
5754
|
+
} else if (key.downArrow || input === "j") {
|
|
5755
|
+
setSelectedIndex((prev) => prev < MENU_ITEMS2.length - 1 ? prev + 1 : 0);
|
|
5756
|
+
} else if (key.return) {
|
|
5757
|
+
setActiveView(MENU_ITEMS2[selectedIndex].id);
|
|
5758
|
+
} else if (input === "q" || key.escape) {
|
|
5759
|
+
onExit();
|
|
5760
|
+
exit();
|
|
5761
|
+
}
|
|
5762
|
+
});
|
|
5763
|
+
return /* @__PURE__ */ React27.createElement(Box17, { flexDirection: "column", width: "100%", height: "100%" }, /* @__PURE__ */ React27.createElement(
|
|
5764
|
+
Box17,
|
|
5765
|
+
{
|
|
5766
|
+
borderStyle: "single",
|
|
5767
|
+
borderColor: "cyan",
|
|
5768
|
+
paddingX: 2,
|
|
5769
|
+
paddingY: 0,
|
|
5770
|
+
marginBottom: 1
|
|
5771
|
+
},
|
|
5772
|
+
/* @__PURE__ */ React27.createElement(Text18, { bold: true, color: "cyan" }, "\u{1F6E0}\uFE0F Developer Utilities - Interactive Mode"),
|
|
5773
|
+
/* @__PURE__ */ React27.createElement(Box17, { marginLeft: "auto" }, /* @__PURE__ */ React27.createElement(Text18, { dimColor: true }, "Press 'q' to quit"))
|
|
5774
|
+
), /* @__PURE__ */ React27.createElement(Box17, { flexGrow: 1 }, /* @__PURE__ */ React27.createElement(
|
|
5775
|
+
Box17,
|
|
5776
|
+
{
|
|
5777
|
+
flexDirection: "column",
|
|
5778
|
+
width: 30,
|
|
5779
|
+
borderStyle: "single",
|
|
5780
|
+
borderColor: "gray",
|
|
5781
|
+
paddingX: 1,
|
|
5782
|
+
paddingY: 1,
|
|
5783
|
+
marginRight: 1
|
|
5784
|
+
},
|
|
5785
|
+
/* @__PURE__ */ React27.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React27.createElement(Text18, { bold: true, color: "yellow" }, "Select Utility:")),
|
|
5786
|
+
MENU_ITEMS2.map((item, index) => /* @__PURE__ */ React27.createElement(Box17, { key: item.id, marginBottom: 0 }, /* @__PURE__ */ React27.createElement(
|
|
5787
|
+
Text18,
|
|
5788
|
+
{
|
|
5789
|
+
color: selectedIndex === index && !activeView ? "green" : void 0,
|
|
5790
|
+
bold: selectedIndex === index && !activeView,
|
|
5791
|
+
dimColor: activeView !== null && activeView !== item.id
|
|
5792
|
+
},
|
|
5793
|
+
selectedIndex === index && !activeView ? "\u25B6 " : " ",
|
|
5794
|
+
item.icon,
|
|
5795
|
+
" ",
|
|
5796
|
+
item.label
|
|
5797
|
+
))),
|
|
5798
|
+
/* @__PURE__ */ React27.createElement(Box17, { marginTop: 1, borderStyle: "single", borderColor: "gray", paddingX: 1 }, /* @__PURE__ */ React27.createElement(Text18, { dimColor: true, fontSize: 10 }, "\u2191/\u2193: Navigate", "\n", "Enter: Select", "\n", "Esc: Back/Quit"))
|
|
5799
|
+
), /* @__PURE__ */ React27.createElement(
|
|
5800
|
+
Box17,
|
|
5801
|
+
{
|
|
5802
|
+
flexDirection: "column",
|
|
5803
|
+
flexGrow: 1,
|
|
5804
|
+
borderStyle: "single",
|
|
5805
|
+
borderColor: "gray",
|
|
5806
|
+
paddingX: 2,
|
|
5807
|
+
paddingY: 1
|
|
5808
|
+
},
|
|
5809
|
+
activeView ? /* @__PURE__ */ React27.createElement(ActiveUtilityView, { utilityType: activeView }) : /* @__PURE__ */ React27.createElement(WelcomeView, { selectedItem: MENU_ITEMS2[selectedIndex] })
|
|
5810
|
+
)), /* @__PURE__ */ React27.createElement(
|
|
5811
|
+
Box17,
|
|
5812
|
+
{
|
|
5813
|
+
borderStyle: "single",
|
|
5814
|
+
borderColor: "gray",
|
|
5815
|
+
paddingX: 2,
|
|
5816
|
+
marginTop: 1
|
|
5817
|
+
},
|
|
5818
|
+
/* @__PURE__ */ React27.createElement(Text18, { dimColor: true }, "jai1-cli v0.1.63 | Use arrow keys to navigate")
|
|
5819
|
+
));
|
|
5820
|
+
};
|
|
5821
|
+
var WelcomeView = ({ selectedItem }) => {
|
|
5822
|
+
return /* @__PURE__ */ React27.createElement(Box17, { flexDirection: "column" }, /* @__PURE__ */ React27.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React27.createElement(Text18, { bold: true, color: "cyan" }, "Welcome to Developer Utilities")), /* @__PURE__ */ React27.createElement(Box17, { marginBottom: 2 }, /* @__PURE__ */ React27.createElement(Text18, null, "Select a utility from the left menu to get started.")), /* @__PURE__ */ React27.createElement(
|
|
5823
|
+
Box17,
|
|
5824
|
+
{
|
|
5825
|
+
borderStyle: "single",
|
|
5826
|
+
borderColor: "yellow",
|
|
5827
|
+
paddingX: 2,
|
|
5828
|
+
paddingY: 1,
|
|
5829
|
+
marginBottom: 2
|
|
5830
|
+
},
|
|
5831
|
+
/* @__PURE__ */ React27.createElement(Box17, { flexDirection: "column" }, /* @__PURE__ */ React27.createElement(Text18, { bold: true, color: "yellow" }, selectedItem.icon, " ", selectedItem.label), /* @__PURE__ */ React27.createElement(Text18, { dimColor: true }, selectedItem.description))
|
|
5832
|
+
), /* @__PURE__ */ React27.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React27.createElement(Text18, { bold: true }, "Quick Actions:")), /* @__PURE__ */ React27.createElement(Box17, { flexDirection: "column", marginLeft: 2 }, /* @__PURE__ */ React27.createElement(Text18, null, "\u2022 Press ", /* @__PURE__ */ React27.createElement(Text18, { color: "green" }, "Enter"), " to open selected utility"), /* @__PURE__ */ React27.createElement(Text18, null, "\u2022 Use ", /* @__PURE__ */ React27.createElement(Text18, { color: "green" }, "\u2191/\u2193"), " or ", /* @__PURE__ */ React27.createElement(Text18, { color: "green" }, "j/k"), " to navigate"), /* @__PURE__ */ React27.createElement(Text18, null, "\u2022 Press ", /* @__PURE__ */ React27.createElement(Text18, { color: "green" }, "Esc"), " to go back or quit"), /* @__PURE__ */ React27.createElement(Text18, null, "\u2022 Press ", /* @__PURE__ */ React27.createElement(Text18, { color: "green" }, "q"), " to quit anytime")), /* @__PURE__ */ React27.createElement(Box17, { marginTop: 2 }, /* @__PURE__ */ React27.createElement(Text18, { dimColor: true }, "\u{1F4A1} Tip: Each utility provides an interactive interface for easy usage.")));
|
|
5833
|
+
};
|
|
5834
|
+
var ActiveUtilityView = ({ utilityType }) => {
|
|
5835
|
+
const service = new UtilsService();
|
|
5836
|
+
return /* @__PURE__ */ React27.createElement(Box17, { flexDirection: "column" }, /* @__PURE__ */ React27.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React27.createElement(Text18, { bold: true, color: "cyan" }, MENU_ITEMS2.find((item) => item.id === utilityType)?.icon, " ", MENU_ITEMS2.find((item) => item.id === utilityType)?.label)), /* @__PURE__ */ React27.createElement(Box17, { borderStyle: "single", borderColor: "gray", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React27.createElement(Text18, null, "This utility interface is under construction.", "\n", "\n", "For now, use the command-line version:", "\n", /* @__PURE__ */ React27.createElement(Text18, { color: "green" }, "$ jai1 utils ", utilityType, " --help"), "\n", "\n", "Press ", /* @__PURE__ */ React27.createElement(Text18, { color: "yellow" }, "Esc"), " to return to the menu.")));
|
|
5837
|
+
};
|
|
5838
|
+
|
|
5839
|
+
// src/commands/utils/interactive.ts
|
|
5840
|
+
async function runInteractiveMode() {
|
|
5841
|
+
return new Promise((resolve3) => {
|
|
5842
|
+
const { unmount, waitUntilExit } = render5(
|
|
5843
|
+
React28.createElement(UtilsApp, {
|
|
5844
|
+
onExit: () => {
|
|
5845
|
+
unmount();
|
|
5846
|
+
resolve3();
|
|
5847
|
+
}
|
|
5848
|
+
})
|
|
5849
|
+
);
|
|
5850
|
+
waitUntilExit().then(() => {
|
|
5851
|
+
resolve3();
|
|
5852
|
+
});
|
|
5853
|
+
});
|
|
5854
|
+
}
|
|
5855
|
+
|
|
5719
5856
|
// src/commands/utils/index.ts
|
|
5720
5857
|
function createUtilsCommand() {
|
|
5721
|
-
const utilsCommand = new Command27("utils").description("Developer utilities for common tasks")
|
|
5858
|
+
const utilsCommand = new Command27("utils").description("Developer utilities for common tasks").option("-i, --interactive", "Run in interactive mode").addHelpText("after", `
|
|
5859
|
+
Interactive Mode:
|
|
5860
|
+
$ jai1 utils --interactive
|
|
5861
|
+
$ jai1 utils -i
|
|
5862
|
+
|
|
5863
|
+
Quick Usage:
|
|
5864
|
+
$ jai1 utils password --length 24
|
|
5865
|
+
$ jai1 utils uuid --count 5
|
|
5866
|
+
$ jai1 utils hash "text" --algorithm sha256
|
|
5867
|
+
$ jai1 utils http https://api.example.com
|
|
5868
|
+
`);
|
|
5722
5869
|
utilsCommand.addCommand(createPasswordCommand());
|
|
5723
5870
|
utilsCommand.addCommand(createUuidCommand());
|
|
5724
5871
|
utilsCommand.addCommand(createHashCommand());
|
|
@@ -5732,8 +5879,12 @@ function createUtilsCommand() {
|
|
|
5732
5879
|
utilsCommand.addCommand(createUrlDecodeCommand());
|
|
5733
5880
|
utilsCommand.addCommand(createCronCommand());
|
|
5734
5881
|
utilsCommand.addCommand(createMarkdownPreviewCommand());
|
|
5735
|
-
utilsCommand.action(() => {
|
|
5736
|
-
|
|
5882
|
+
utilsCommand.action(async (options) => {
|
|
5883
|
+
if (options.interactive) {
|
|
5884
|
+
await runInteractiveMode();
|
|
5885
|
+
} else {
|
|
5886
|
+
utilsCommand.help();
|
|
5887
|
+
}
|
|
5737
5888
|
});
|
|
5738
5889
|
return utilsCommand;
|
|
5739
5890
|
}
|
|
@@ -7446,13 +7597,13 @@ async function resetSettings2(groupKeys) {
|
|
|
7446
7597
|
}
|
|
7447
7598
|
|
|
7448
7599
|
// src/commands/guide.ts
|
|
7449
|
-
import
|
|
7450
|
-
import { render as
|
|
7600
|
+
import React29 from "react";
|
|
7601
|
+
import { render as render6 } from "ink";
|
|
7451
7602
|
import { Command as Command37 } from "commander";
|
|
7452
7603
|
function createGuideCommand() {
|
|
7453
7604
|
const cmd = new Command37("guide").description("Interactive guide center for Agentic Coding").option("--topic <topic>", "Open specific topic (intro, rules, workflows, prompts, skills)").action(async (options) => {
|
|
7454
|
-
const { waitUntilExit } =
|
|
7455
|
-
|
|
7605
|
+
const { waitUntilExit } = render6(
|
|
7606
|
+
React29.createElement(GuideApp, {
|
|
7456
7607
|
initialTopic: options.topic,
|
|
7457
7608
|
onExit: () => {
|
|
7458
7609
|
process.exit(0);
|
|
@@ -7465,8 +7616,8 @@ function createGuideCommand() {
|
|
|
7465
7616
|
}
|
|
7466
7617
|
|
|
7467
7618
|
// src/commands/context.ts
|
|
7468
|
-
import
|
|
7469
|
-
import { render as
|
|
7619
|
+
import React30 from "react";
|
|
7620
|
+
import { render as render7 } from "ink";
|
|
7470
7621
|
import { Command as Command38 } from "commander";
|
|
7471
7622
|
function createContextCommand() {
|
|
7472
7623
|
const cmd = new Command38("context").description("Kh\xE1m ph\xE1 v\xE0 qu\u1EA3n l\xFD context d\u1EF1 \xE1n cho c\xE1c IDE").option("--ide <ide>", "M\u1EDF tr\u1EF1c ti\u1EBFp IDE c\u1EE5 th\u1EC3 (cursor, windsurf, antigravity, jai1)").option("--type <type>", "Hi\u1EC3n th\u1ECB lo\u1EA1i context c\u1EE5 th\u1EC3 (rules, workflows, skills, agents, prompts)").option("--stats", "Hi\u1EC3n th\u1ECB th\u1ED1ng k\xEA context (non-interactive)").action(async (options) => {
|
|
@@ -7494,8 +7645,8 @@ function createContextCommand() {
|
|
|
7494
7645
|
await printStats2();
|
|
7495
7646
|
return;
|
|
7496
7647
|
}
|
|
7497
|
-
const { waitUntilExit } =
|
|
7498
|
-
|
|
7648
|
+
const { waitUntilExit } = render7(
|
|
7649
|
+
React30.createElement(ContextApp, {
|
|
7499
7650
|
initialIDE,
|
|
7500
7651
|
initialType,
|
|
7501
7652
|
onExit: () => {
|