@jixo/cli 0.23.5 → 0.23.6
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/bundle/index.js +114 -124
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +83 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/daemon.d.ts +5 -0
- package/dist/commands/daemon.d.ts.map +1 -0
- package/dist/commands/daemon.js +20 -0
- package/dist/commands/daemon.js.map +1 -0
- package/dist/commands/doctor/config.d.ts +3 -0
- package/dist/commands/doctor/config.d.ts.map +1 -0
- package/dist/commands/doctor/config.js +17 -0
- package/dist/commands/doctor/config.js.map +1 -0
- package/dist/commands/doctor/doctor.d.ts +3 -0
- package/dist/commands/doctor/doctor.d.ts.map +1 -0
- package/dist/commands/doctor/doctor.js +158 -0
- package/dist/commands/doctor/doctor.js.map +1 -0
- package/dist/commands/doctor/doctor.test.d.ts +2 -0
- package/dist/commands/doctor/doctor.test.d.ts.map +1 -0
- package/dist/commands/doctor/doctor.test.js +14 -0
- package/dist/commands/doctor/doctor.test.js.map +1 -0
- package/dist/commands/doctor/index.d.ts +2 -0
- package/dist/commands/doctor/index.d.ts.map +1 -0
- package/dist/commands/doctor/index.js +8 -0
- package/dist/commands/doctor/index.js.map +1 -0
- package/dist/commands/doctor/types.d.ts +45 -0
- package/dist/commands/doctor/types.d.ts.map +1 -0
- package/dist/commands/doctor/types.js +3 -0
- package/dist/commands/doctor/types.js.map +1 -0
- package/dist/commands/google-aistudio.d.ts.map +1 -1
- package/dist/commands/google-aistudio.js +12 -3
- package/dist/commands/google-aistudio.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +40 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/tasks/run.d.ts +10 -0
- package/dist/commands/tasks/run.d.ts.map +1 -0
- package/dist/commands/tasks/run.js +44 -0
- package/dist/commands/tasks/run.js.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -0
- package/dist/env.d.ts +6 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +16 -0
- package/dist/env.js.map +1 -0
- package/dist/prompts.json +14 -2
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -1275,14 +1275,14 @@ var YargsParser = class {
|
|
|
1275
1275
|
function applyEnvVars(argv$1, configOnly) {
|
|
1276
1276
|
if (typeof envPrefix === "undefined") return;
|
|
1277
1277
|
const prefix = typeof envPrefix === "string" ? envPrefix : "";
|
|
1278
|
-
const env$
|
|
1279
|
-
Object.keys(env$
|
|
1278
|
+
const env$1 = mixin.env();
|
|
1279
|
+
Object.keys(env$1).forEach(function(envVar) {
|
|
1280
1280
|
if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) {
|
|
1281
1281
|
const keys = envVar.split("__").map(function(key$1, i$2) {
|
|
1282
1282
|
if (i$2 === 0) key$1 = key$1.substring(prefix.length);
|
|
1283
1283
|
return camelCase(key$1);
|
|
1284
1284
|
});
|
|
1285
|
-
if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey(argv$1, keys)) setArg(keys.join("."), env$
|
|
1285
|
+
if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey(argv$1, keys)) setArg(keys.join("."), env$1[envVar]);
|
|
1286
1286
|
}
|
|
1287
1287
|
});
|
|
1288
1288
|
}
|
|
@@ -1544,12 +1544,12 @@ if (nodeVersion) {
|
|
|
1544
1544
|
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
|
|
1545
1545
|
if (major < minNodeVersion) throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
|
1546
1546
|
}
|
|
1547
|
-
const env
|
|
1547
|
+
const env = process ? process.env : {};
|
|
1548
1548
|
const require$3 = createRequire ? createRequire(import.meta.url) : void 0;
|
|
1549
1549
|
const parser$1 = new YargsParser({
|
|
1550
1550
|
cwd: process.cwd,
|
|
1551
1551
|
env: () => {
|
|
1552
|
-
return env
|
|
1552
|
+
return env;
|
|
1553
1553
|
},
|
|
1554
1554
|
format,
|
|
1555
1555
|
normalize,
|
|
@@ -1770,7 +1770,7 @@ var import_get_caller_file = __toESM$1(require_get_caller_file(), 1);
|
|
|
1770
1770
|
const __dirname$1 = fileURLToPath$1(import.meta.url);
|
|
1771
1771
|
const mainFilename = __dirname$1.substring(0, __dirname$1.lastIndexOf("node_modules"));
|
|
1772
1772
|
const require$2 = createRequire(import.meta.url);
|
|
1773
|
-
var esm_default$
|
|
1773
|
+
var esm_default$4 = {
|
|
1774
1774
|
assert: {
|
|
1775
1775
|
notStrictEqual,
|
|
1776
1776
|
strictEqual
|
|
@@ -4682,13 +4682,13 @@ function isYargsInstance(y$2) {
|
|
|
4682
4682
|
|
|
4683
4683
|
//#endregion
|
|
4684
4684
|
//#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/index.mjs
|
|
4685
|
-
const Yargs = YargsFactory(esm_default$
|
|
4685
|
+
const Yargs = YargsFactory(esm_default$4);
|
|
4686
4686
|
var yargs_default = Yargs;
|
|
4687
4687
|
|
|
4688
4688
|
//#endregion
|
|
4689
4689
|
//#region package.json
|
|
4690
4690
|
var name = "@jixo/cli";
|
|
4691
|
-
var version$1 = "0.23.
|
|
4691
|
+
var version$1 = "0.23.6";
|
|
4692
4692
|
var type = "module";
|
|
4693
4693
|
var bin = { "jixo": "./bundle/index.js" };
|
|
4694
4694
|
var files = [
|
|
@@ -4757,7 +4757,7 @@ var package_default = {
|
|
|
4757
4757
|
};
|
|
4758
4758
|
|
|
4759
4759
|
//#endregion
|
|
4760
|
-
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@
|
|
4760
|
+
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@gau_ac796b2c5c73dab9bab91ba9e75b6834/node_modules/@gaubee/nodekit/esm/_dnt.shims.js
|
|
4761
4761
|
const dntGlobals = {};
|
|
4762
4762
|
const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
4763
4763
|
function createMergeProxy(baseObj, extObj) {
|
|
@@ -4805,7 +4805,7 @@ function createMergeProxy(baseObj, extObj) {
|
|
|
4805
4805
|
}
|
|
4806
4806
|
|
|
4807
4807
|
//#endregion
|
|
4808
|
-
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@
|
|
4808
|
+
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@gau_ac796b2c5c73dab9bab91ba9e75b6834/node_modules/@gaubee/nodekit/esm/deps/jsr.io/@std/fmt/1.0.8/colors.js
|
|
4809
4809
|
const { Deno } = dntGlobalThis;
|
|
4810
4810
|
const noColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : false;
|
|
4811
4811
|
let enabled = !noColor;
|
|
@@ -6014,7 +6014,7 @@ const createResolverByRootFile = (fromPath = process$1.cwd(), rootFilename = "pa
|
|
|
6014
6014
|
};
|
|
6015
6015
|
|
|
6016
6016
|
//#endregion
|
|
6017
|
-
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@
|
|
6017
|
+
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@gau_ac796b2c5c73dab9bab91ba9e75b6834/node_modules/@gaubee/nodekit/esm/deps/jsr.io/@std/jsonc/1.0.2/parse.js
|
|
6018
6018
|
/**
|
|
6019
6019
|
* Converts a JSON with Comments (JSONC) string into an object.
|
|
6020
6020
|
*
|
|
@@ -6240,7 +6240,7 @@ function buildErrorMessage({ type: type$1, sourceText, position: position$1 }) {
|
|
|
6240
6240
|
}
|
|
6241
6241
|
|
|
6242
6242
|
//#endregion
|
|
6243
|
-
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@
|
|
6243
|
+
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@gau_ac796b2c5c73dab9bab91ba9e75b6834/node_modules/@gaubee/nodekit/esm/config_file.js
|
|
6244
6244
|
/**
|
|
6245
6245
|
* read json or jsonc file
|
|
6246
6246
|
*/
|
|
@@ -9144,7 +9144,7 @@ var require_gray_matter = __commonJS$2({ "../../node_modules/.pnpm/gray-matter@4
|
|
|
9144
9144
|
} });
|
|
9145
9145
|
|
|
9146
9146
|
//#endregion
|
|
9147
|
-
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@
|
|
9147
|
+
//#region ../../node_modules/.pnpm/@gaubee+nodekit@0.12.0_@gau_ac796b2c5c73dab9bab91ba9e75b6834/node_modules/@gaubee/nodekit/esm/markdown_file.js
|
|
9148
9148
|
var import_gray_matter = __toESM$1(require_gray_matter(), 1);
|
|
9149
9149
|
|
|
9150
9150
|
//#endregion
|
|
@@ -9395,6 +9395,7 @@ var require_ignore$1 = __commonJS$2({ "../../node_modules/.pnpm/ignore@7.0.5/nod
|
|
|
9395
9395
|
const isUpKey = (key$1) => key$1.name === "up" || key$1.name === "k" || key$1.ctrl && key$1.name === "p";
|
|
9396
9396
|
const isDownKey = (key$1) => key$1.name === "down" || key$1.name === "j" || key$1.ctrl && key$1.name === "n";
|
|
9397
9397
|
const isSpaceKey = (key$1) => key$1.name === "space";
|
|
9398
|
+
const isBackspaceKey = (key$1) => key$1.name === "backspace";
|
|
9398
9399
|
const isNumberKey = (key$1) => "1234567890".includes(key$1.name);
|
|
9399
9400
|
const isEnterKey = (key$1) => key$1.name === "enter" || key$1.name === "return";
|
|
9400
9401
|
|
|
@@ -9552,8 +9553,8 @@ function useEffect(cb, depArray) {
|
|
|
9552
9553
|
//#endregion
|
|
9553
9554
|
//#region ../../node_modules/.pnpm/yoctocolors-cjs@2.1.2/node_modules/yoctocolors-cjs/index.js
|
|
9554
9555
|
var require_yoctocolors_cjs = __commonJS$2({ "../../node_modules/.pnpm/yoctocolors-cjs@2.1.2/node_modules/yoctocolors-cjs/index.js"(exports, module) {
|
|
9555
|
-
const tty$
|
|
9556
|
-
const hasColors = tty$
|
|
9556
|
+
const tty$1 = __require$1("node:tty");
|
|
9557
|
+
const hasColors = tty$1?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
9557
9558
|
const format$1 = (open, close) => {
|
|
9558
9559
|
if (!hasColors) return (input) => input;
|
|
9559
9560
|
const openCode = `\u001B[${open}m`;
|
|
@@ -9902,7 +9903,7 @@ const fallbackSymbols = {
|
|
|
9902
9903
|
};
|
|
9903
9904
|
const shouldUseMain = isUnicodeSupported();
|
|
9904
9905
|
const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
9905
|
-
var esm_default$
|
|
9906
|
+
var esm_default$2 = figures;
|
|
9906
9907
|
const replacements = Object.entries(specialMainSymbols);
|
|
9907
9908
|
|
|
9908
9909
|
//#endregion
|
|
@@ -9911,7 +9912,7 @@ var import_yoctocolors_cjs$2 = __toESM$1(require_yoctocolors_cjs(), 1);
|
|
|
9911
9912
|
const defaultTheme = {
|
|
9912
9913
|
prefix: {
|
|
9913
9914
|
idle: import_yoctocolors_cjs$2.default.blue("?"),
|
|
9914
|
-
done: import_yoctocolors_cjs$2.default.green(esm_default$
|
|
9915
|
+
done: import_yoctocolors_cjs$2.default.green(esm_default$2.tick)
|
|
9915
9916
|
},
|
|
9916
9917
|
spinner: {
|
|
9917
9918
|
interval: 80,
|
|
@@ -12721,7 +12722,7 @@ var import_yoctocolors_cjs$1 = __toESM$1(require_yoctocolors_cjs(), 1);
|
|
|
12721
12722
|
* Used to space/separate choices group
|
|
12722
12723
|
*/
|
|
12723
12724
|
var Separator = class {
|
|
12724
|
-
separator = import_yoctocolors_cjs$1.default.dim(Array.from({ length: 15 }).join(esm_default$
|
|
12725
|
+
separator = import_yoctocolors_cjs$1.default.dim(Array.from({ length: 15 }).join(esm_default$2.line));
|
|
12725
12726
|
type = "separator";
|
|
12726
12727
|
constructor(separator) {
|
|
12727
12728
|
if (separator) this.separator = separator;
|
|
@@ -12737,9 +12738,9 @@ var import_yoctocolors_cjs = __toESM$1(require_yoctocolors_cjs(), 1);
|
|
|
12737
12738
|
var import_ansi_escapes = __toESM$1(require_ansi_escapes(), 1);
|
|
12738
12739
|
const checkboxTheme = {
|
|
12739
12740
|
icon: {
|
|
12740
|
-
checked: import_yoctocolors_cjs.default.green(esm_default$
|
|
12741
|
-
unchecked: esm_default$
|
|
12742
|
-
cursor: esm_default$
|
|
12741
|
+
checked: import_yoctocolors_cjs.default.green(esm_default$2.circleFilled),
|
|
12742
|
+
unchecked: esm_default$2.circle,
|
|
12743
|
+
cursor: esm_default$2.pointer
|
|
12743
12744
|
},
|
|
12744
12745
|
style: {
|
|
12745
12746
|
disabledChoice: (text$2) => import_yoctocolors_cjs.default.dim(`- ${text$2}`),
|
|
@@ -12790,7 +12791,7 @@ function normalizeChoices(choices) {
|
|
|
12790
12791
|
return normalizedChoice;
|
|
12791
12792
|
});
|
|
12792
12793
|
}
|
|
12793
|
-
var esm_default$
|
|
12794
|
+
var esm_default$3 = createPrompt((config$1, done) => {
|
|
12794
12795
|
const { instructions, pageSize = 7, loop = true, required: required$1, validate: validate$1 = () => true } = config$1;
|
|
12795
12796
|
const shortcuts = {
|
|
12796
12797
|
all: "a",
|
|
@@ -12918,7 +12919,7 @@ function getBooleanValue(value, defaultValue) {
|
|
|
12918
12919
|
function boolToString(value) {
|
|
12919
12920
|
return value ? "Yes" : "No";
|
|
12920
12921
|
}
|
|
12921
|
-
var esm_default = createPrompt((config$1, done) => {
|
|
12922
|
+
var esm_default$1 = createPrompt((config$1, done) => {
|
|
12922
12923
|
const { transformer = boolToString } = config$1;
|
|
12923
12924
|
const [status, setStatus] = useState("idle");
|
|
12924
12925
|
const [value, setValue] = useState("");
|
|
@@ -12948,6 +12949,69 @@ var esm_default = createPrompt((config$1, done) => {
|
|
|
12948
12949
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
12949
12950
|
});
|
|
12950
12951
|
|
|
12952
|
+
//#endregion
|
|
12953
|
+
//#region ../../node_modules/.pnpm/@inquirer+input@4.2.1_@types+node@24.1.0/node_modules/@inquirer/input/dist/esm/index.js
|
|
12954
|
+
const inputTheme = { validationFailureMode: "keep" };
|
|
12955
|
+
var esm_default = createPrompt((config$1, done) => {
|
|
12956
|
+
const { required: required$1, validate: validate$1 = () => true, prefill = "tab" } = config$1;
|
|
12957
|
+
const theme = makeTheme(inputTheme, config$1.theme);
|
|
12958
|
+
const [status, setStatus] = useState("idle");
|
|
12959
|
+
const [defaultValue = "", setDefaultValue] = useState(config$1.default);
|
|
12960
|
+
const [errorMsg, setError] = useState();
|
|
12961
|
+
const [value, setValue] = useState("");
|
|
12962
|
+
const prefix = usePrefix({
|
|
12963
|
+
status,
|
|
12964
|
+
theme
|
|
12965
|
+
});
|
|
12966
|
+
useKeypress(async (key$1, rl) => {
|
|
12967
|
+
if (status !== "idle") return;
|
|
12968
|
+
if (isEnterKey(key$1)) {
|
|
12969
|
+
const answer = value || defaultValue;
|
|
12970
|
+
setStatus("loading");
|
|
12971
|
+
const isValid = required$1 && !answer ? "You must provide a value" : await validate$1(answer);
|
|
12972
|
+
if (isValid === true) {
|
|
12973
|
+
setValue(answer);
|
|
12974
|
+
setStatus("done");
|
|
12975
|
+
done(answer);
|
|
12976
|
+
} else {
|
|
12977
|
+
if (theme.validationFailureMode === "clear") setValue("");
|
|
12978
|
+
else rl.write(value);
|
|
12979
|
+
setError(isValid || "You must provide a valid value");
|
|
12980
|
+
setStatus("idle");
|
|
12981
|
+
}
|
|
12982
|
+
} else if (isBackspaceKey(key$1) && !value) setDefaultValue(void 0);
|
|
12983
|
+
else if (key$1.name === "tab" && !value) {
|
|
12984
|
+
setDefaultValue(void 0);
|
|
12985
|
+
rl.clearLine(0);
|
|
12986
|
+
rl.write(defaultValue);
|
|
12987
|
+
setValue(defaultValue);
|
|
12988
|
+
} else {
|
|
12989
|
+
setValue(rl.line);
|
|
12990
|
+
setError(void 0);
|
|
12991
|
+
}
|
|
12992
|
+
});
|
|
12993
|
+
useEffect((rl) => {
|
|
12994
|
+
if (prefill === "editable" && defaultValue) {
|
|
12995
|
+
rl.write(defaultValue);
|
|
12996
|
+
setValue(defaultValue);
|
|
12997
|
+
}
|
|
12998
|
+
}, []);
|
|
12999
|
+
const message = theme.style.message(config$1.message, status);
|
|
13000
|
+
let formattedValue = value;
|
|
13001
|
+
if (typeof config$1.transformer === "function") formattedValue = config$1.transformer(value, { isFinal: status === "done" });
|
|
13002
|
+
else if (status === "done") formattedValue = theme.style.answer(value);
|
|
13003
|
+
let defaultStr;
|
|
13004
|
+
if (defaultValue && status !== "done" && !value) defaultStr = theme.style.defaultAnswer(defaultValue);
|
|
13005
|
+
let error$41 = "";
|
|
13006
|
+
if (errorMsg) error$41 = theme.style.error(errorMsg);
|
|
13007
|
+
return [[
|
|
13008
|
+
prefix,
|
|
13009
|
+
message,
|
|
13010
|
+
defaultStr,
|
|
13011
|
+
formattedValue
|
|
13012
|
+
].filter((v$1) => v$1 !== void 0).join(" "), error$41];
|
|
13013
|
+
});
|
|
13014
|
+
|
|
12951
13015
|
//#endregion
|
|
12952
13016
|
//#region ../../node_modules/.pnpm/@sindresorhus+merge-streams@2.3.0/node_modules/@sindresorhus/merge-streams/index.js
|
|
12953
13017
|
function mergeStreams(streams) {
|
|
@@ -13159,9 +13223,9 @@ var require_fs$4 = __commonJS$2({ "../../node_modules/.pnpm/fast-glob@3.3.3/node
|
|
|
13159
13223
|
var require_path$1 = __commonJS$2({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js"(exports) {
|
|
13160
13224
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13161
13225
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
|
13162
|
-
const os$
|
|
13226
|
+
const os$1 = __require$1("os");
|
|
13163
13227
|
const path$11 = __require$1("path");
|
|
13164
|
-
const IS_WINDOWS_PLATFORM = os$
|
|
13228
|
+
const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
|
|
13165
13229
|
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
13166
13230
|
/**
|
|
13167
13231
|
* All non-escaped special characters.
|
|
@@ -18569,12 +18633,12 @@ var require_settings$1 = __commonJS$2({ "../../node_modules/.pnpm/fast-glob@3.3.
|
|
|
18569
18633
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18570
18634
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
18571
18635
|
const fs$2 = __require$1("fs");
|
|
18572
|
-
const os
|
|
18636
|
+
const os = __require$1("os");
|
|
18573
18637
|
/**
|
|
18574
18638
|
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
18575
18639
|
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
|
|
18576
18640
|
*/
|
|
18577
|
-
const CPU_COUNT = Math.max(os
|
|
18641
|
+
const CPU_COUNT = Math.max(os.cpus().length, 1);
|
|
18578
18642
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
18579
18643
|
lstat: fs$2.lstat,
|
|
18580
18644
|
lstatSync: fs$2.lstatSync,
|
|
@@ -19130,7 +19194,7 @@ var require_common$1 = __commonJS$2({ "../../node_modules/.pnpm/debug@4.4.1/node
|
|
|
19130
19194
|
* This is the common logic for both the Node.js and web browser
|
|
19131
19195
|
* implementations of `debug()`.
|
|
19132
19196
|
*/
|
|
19133
|
-
function setup(env$
|
|
19197
|
+
function setup(env$1) {
|
|
19134
19198
|
createDebug.debug = createDebug;
|
|
19135
19199
|
createDebug.default = createDebug;
|
|
19136
19200
|
createDebug.coerce = coerce;
|
|
@@ -19139,8 +19203,8 @@ var require_common$1 = __commonJS$2({ "../../node_modules/.pnpm/debug@4.4.1/node
|
|
|
19139
19203
|
createDebug.enabled = enabled$1;
|
|
19140
19204
|
createDebug.humanize = require_ms();
|
|
19141
19205
|
createDebug.destroy = destroy;
|
|
19142
|
-
Object.keys(env$
|
|
19143
|
-
createDebug[key$1] = env$
|
|
19206
|
+
Object.keys(env$1).forEach((key$1) => {
|
|
19207
|
+
createDebug[key$1] = env$1[key$1];
|
|
19144
19208
|
});
|
|
19145
19209
|
/**
|
|
19146
19210
|
* The currently active debug mode names, and names to skip.
|
|
@@ -19525,87 +19589,6 @@ var require_browser = __commonJS$2({ "../../node_modules/.pnpm/debug@4.4.1/node_
|
|
|
19525
19589
|
};
|
|
19526
19590
|
} });
|
|
19527
19591
|
|
|
19528
|
-
//#endregion
|
|
19529
|
-
//#region ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
19530
|
-
var require_has_flag = __commonJS$2({ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
|
|
19531
|
-
module.exports = (flag, argv = process.argv) => {
|
|
19532
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
19533
|
-
const position$1 = argv.indexOf(prefix + flag);
|
|
19534
|
-
const terminatorPosition = argv.indexOf("--");
|
|
19535
|
-
return position$1 !== -1 && (terminatorPosition === -1 || position$1 < terminatorPosition);
|
|
19536
|
-
};
|
|
19537
|
-
} });
|
|
19538
|
-
|
|
19539
|
-
//#endregion
|
|
19540
|
-
//#region ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
19541
|
-
var require_supports_color = __commonJS$2({ "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
|
|
19542
|
-
const os = __require$1("os");
|
|
19543
|
-
const tty$1 = __require$1("tty");
|
|
19544
|
-
const hasFlag = require_has_flag();
|
|
19545
|
-
const { env } = process;
|
|
19546
|
-
let forceColor;
|
|
19547
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) forceColor = 0;
|
|
19548
|
-
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) forceColor = 1;
|
|
19549
|
-
if ("FORCE_COLOR" in env) if (env.FORCE_COLOR === "true") forceColor = 1;
|
|
19550
|
-
else if (env.FORCE_COLOR === "false") forceColor = 0;
|
|
19551
|
-
else forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
19552
|
-
function translateLevel(level) {
|
|
19553
|
-
if (level === 0) return false;
|
|
19554
|
-
return {
|
|
19555
|
-
level,
|
|
19556
|
-
hasBasic: true,
|
|
19557
|
-
has256: level >= 2,
|
|
19558
|
-
has16m: level >= 3
|
|
19559
|
-
};
|
|
19560
|
-
}
|
|
19561
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
19562
|
-
if (forceColor === 0) return 0;
|
|
19563
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
19564
|
-
if (hasFlag("color=256")) return 2;
|
|
19565
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
19566
|
-
const min = forceColor || 0;
|
|
19567
|
-
if (env.TERM === "dumb") return min;
|
|
19568
|
-
if (process.platform === "win32") {
|
|
19569
|
-
const osRelease = os.release().split(".");
|
|
19570
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
19571
|
-
return 1;
|
|
19572
|
-
}
|
|
19573
|
-
if ("CI" in env) {
|
|
19574
|
-
if ([
|
|
19575
|
-
"TRAVIS",
|
|
19576
|
-
"CIRCLECI",
|
|
19577
|
-
"APPVEYOR",
|
|
19578
|
-
"GITLAB_CI",
|
|
19579
|
-
"GITHUB_ACTIONS",
|
|
19580
|
-
"BUILDKITE"
|
|
19581
|
-
].some((sign$1) => sign$1 in env) || env.CI_NAME === "codeship") return 1;
|
|
19582
|
-
return min;
|
|
19583
|
-
}
|
|
19584
|
-
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
19585
|
-
if (env.COLORTERM === "truecolor") return 3;
|
|
19586
|
-
if ("TERM_PROGRAM" in env) {
|
|
19587
|
-
const version$2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
19588
|
-
switch (env.TERM_PROGRAM) {
|
|
19589
|
-
case "iTerm.app": return version$2 >= 3 ? 3 : 2;
|
|
19590
|
-
case "Apple_Terminal": return 2;
|
|
19591
|
-
}
|
|
19592
|
-
}
|
|
19593
|
-
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
19594
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
19595
|
-
if ("COLORTERM" in env) return 1;
|
|
19596
|
-
return min;
|
|
19597
|
-
}
|
|
19598
|
-
function getSupportLevel(stream$1) {
|
|
19599
|
-
const level = supportsColor(stream$1, stream$1 && stream$1.isTTY);
|
|
19600
|
-
return translateLevel(level);
|
|
19601
|
-
}
|
|
19602
|
-
module.exports = {
|
|
19603
|
-
supportsColor: getSupportLevel,
|
|
19604
|
-
stdout: translateLevel(supportsColor(true, tty$1.isatty(1))),
|
|
19605
|
-
stderr: translateLevel(supportsColor(true, tty$1.isatty(2)))
|
|
19606
|
-
};
|
|
19607
|
-
} });
|
|
19608
|
-
|
|
19609
19592
|
//#endregion
|
|
19610
19593
|
//#region ../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js
|
|
19611
19594
|
var require_node = __commonJS$2({ "../../node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js"(exports, module) {
|
|
@@ -19636,8 +19619,8 @@ var require_node = __commonJS$2({ "../../node_modules/.pnpm/debug@4.4.1/node_mod
|
|
|
19636
19619
|
1
|
|
19637
19620
|
];
|
|
19638
19621
|
try {
|
|
19639
|
-
const supportsColor
|
|
19640
|
-
if (supportsColor
|
|
19622
|
+
const supportsColor = __require$1("supports-color");
|
|
19623
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
|
|
19641
19624
|
20,
|
|
19642
19625
|
21,
|
|
19643
19626
|
26,
|
|
@@ -24654,9 +24637,9 @@ var require_path = __commonJS({ "node_modules/fast-glob/out/utils/path.js"(expor
|
|
|
24654
24637
|
"use strict";
|
|
24655
24638
|
Object.defineProperty(exports$2, "__esModule", { value: true });
|
|
24656
24639
|
exports$2.convertPosixPathToPattern = exports$2.convertWindowsPathToPattern = exports$2.convertPathToPattern = exports$2.escapePosixPath = exports$2.escapeWindowsPath = exports$2.escape = exports$2.removeLeadingDotSegment = exports$2.makeAbsolute = exports$2.unixify = void 0;
|
|
24657
|
-
var os$
|
|
24640
|
+
var os$2 = __require("os");
|
|
24658
24641
|
var path14 = __require("path");
|
|
24659
|
-
var IS_WINDOWS_PLATFORM$1 = os$
|
|
24642
|
+
var IS_WINDOWS_PLATFORM$1 = os$2.platform() === "win32";
|
|
24660
24643
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT$1 = 2;
|
|
24661
24644
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE$1 = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
24662
24645
|
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE$1 = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
@@ -29100,8 +29083,8 @@ var require_settings4 = __commonJS({ "node_modules/fast-glob/out/settings.js"(ex
|
|
|
29100
29083
|
Object.defineProperty(exports$2, "__esModule", { value: true });
|
|
29101
29084
|
exports$2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
29102
29085
|
var fs4 = __require("fs");
|
|
29103
|
-
var os$
|
|
29104
|
-
var CPU_COUNT$1 = Math.max(os$
|
|
29086
|
+
var os$2 = __require("os");
|
|
29087
|
+
var CPU_COUNT$1 = Math.max(os$2.cpus().length, 1);
|
|
29105
29088
|
exports$2.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
29106
29089
|
lstat: fs4.lstat,
|
|
29107
29090
|
lstatSync: fs4.lstatSync,
|
|
@@ -29245,8 +29228,8 @@ var require_out4 = __commonJS({ "node_modules/fast-glob/out/index.js"(exports$2,
|
|
|
29245
29228
|
var require_picocolors = __commonJS({ "node_modules/picocolors/picocolors.js"(exports$2, module$1) {
|
|
29246
29229
|
var p$1 = process || {};
|
|
29247
29230
|
var argv = p$1.argv || [];
|
|
29248
|
-
var env$
|
|
29249
|
-
var isColorSupported = !(!!env$
|
|
29231
|
+
var env$1 = p$1.env || {};
|
|
29232
|
+
var isColorSupported = !(!!env$1.NO_COLOR || argv.includes("--no-color")) && (!!env$1.FORCE_COLOR || argv.includes("--color") || p$1.platform === "win32" || (p$1.stdout || {}).isTTY && env$1.TERM !== "dumb" || !!env$1.CI);
|
|
29250
29233
|
var formatter = (open, close, replace = open) => (input) => {
|
|
29251
29234
|
let string$7 = "" + input, index$1 = string$7.indexOf(close, open.length);
|
|
29252
29235
|
return ~index$1 ? open + replaceClose(string$7, close, replace, index$1) + close : open + string$7 + close;
|
|
@@ -41025,7 +41008,7 @@ async function confirmAction(filesToUpdate, options$1) {
|
|
|
41025
41008
|
checked: file$1.safe || !!options$1.allowUnsafe
|
|
41026
41009
|
});
|
|
41027
41010
|
}
|
|
41028
|
-
const selectedFiles = await esm_default$
|
|
41011
|
+
const selectedFiles = await esm_default$3({
|
|
41029
41012
|
message: [options$1.topMessage, "The following files will be overwritten:\n"].filter(Boolean).join("\n"),
|
|
41030
41013
|
choices,
|
|
41031
41014
|
pageSize: process.stdout.rows > 0 ? process.stdout.rows - 4 : filesToUpdate.length
|
|
@@ -63685,7 +63668,7 @@ const doInit = async ({ dir, force }) => {
|
|
|
63685
63668
|
return;
|
|
63686
63669
|
}
|
|
63687
63670
|
if (force == null) {
|
|
63688
|
-
const overwrite = await esm_default({
|
|
63671
|
+
const overwrite = await esm_default$1({
|
|
63689
63672
|
message: [`the same file(s) name already exists. Are you sure you want to overwrite?`, ...logPaths()].join("\n"),
|
|
63690
63673
|
default: false
|
|
63691
63674
|
});
|
|
@@ -63747,15 +63730,22 @@ const initCommand = {
|
|
|
63747
63730
|
describe: "init an browser-kit directory for aistudio.google.com",
|
|
63748
63731
|
builder: (yargs) => yargs.positional("dir", {
|
|
63749
63732
|
describe: "Directory for aistudio input/output contents",
|
|
63750
|
-
type: "string"
|
|
63751
|
-
default: path.resolve(process.cwd(), ".ai")
|
|
63733
|
+
type: "string"
|
|
63752
63734
|
}).option("force", {
|
|
63753
63735
|
alias: "F",
|
|
63754
63736
|
type: "boolean",
|
|
63755
63737
|
describe: "override exits files"
|
|
63756
63738
|
}),
|
|
63757
63739
|
handler: async (argv) => {
|
|
63758
|
-
|
|
63740
|
+
let { dir } = argv;
|
|
63741
|
+
if (dir == null) dir = await esm_default({
|
|
63742
|
+
message: "No directory specified. Do you want to use the default '.ai' directory?",
|
|
63743
|
+
default: ".ai"
|
|
63744
|
+
});
|
|
63745
|
+
doInit({
|
|
63746
|
+
...argv,
|
|
63747
|
+
dir
|
|
63748
|
+
});
|
|
63759
63749
|
}
|
|
63760
63750
|
};
|
|
63761
63751
|
/**
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,GAAU,OAAM,MAAM,EAAiB,kBA+FzD,CAAC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cwdResolver } from "@gaubee/node";
|
|
2
|
+
import yargs from "yargs";
|
|
3
|
+
import { hideBin } from "yargs/helpers";
|
|
4
|
+
import packageJson from "../package.json" with { type: "json" };
|
|
5
|
+
import { restartDaemon, startDaemon, statusDaemon, stopDaemon } from "./commands/daemon.js";
|
|
6
|
+
import { doctor } from "./commands/doctor/index.js";
|
|
7
|
+
import { init } from "./commands/init.js";
|
|
8
|
+
import { run } from "./commands/tasks/run.js";
|
|
9
|
+
export const runCli = async (args = process.argv) => {
|
|
10
|
+
const cli = await yargs(hideBin(args))
|
|
11
|
+
.scriptName("jixo")
|
|
12
|
+
.version(packageJson.version)
|
|
13
|
+
.command("doctor", "Check the requirements and health of the JIXO environment", (yargs) => yargs, () => {
|
|
14
|
+
doctor();
|
|
15
|
+
})
|
|
16
|
+
.command("init [dir]", "Create a new JIXO project configuration", (yargs) => {
|
|
17
|
+
return yargs.positional("dir", {
|
|
18
|
+
describe: "The directory to create the JIXO config",
|
|
19
|
+
default: "./",
|
|
20
|
+
});
|
|
21
|
+
}, (argv) => {
|
|
22
|
+
init(cwdResolver(argv.dir));
|
|
23
|
+
})
|
|
24
|
+
.command("run <goal>", "Run a JIXO job with a specific goal", (yargs) => {
|
|
25
|
+
return yargs
|
|
26
|
+
.positional("goal", {
|
|
27
|
+
describe: "The high-level goal for the job",
|
|
28
|
+
type: "string",
|
|
29
|
+
demandOption: true,
|
|
30
|
+
})
|
|
31
|
+
.option("dir", {
|
|
32
|
+
alias: "D",
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "The project directory to run in",
|
|
35
|
+
default: process.cwd(),
|
|
36
|
+
})
|
|
37
|
+
.option("loop", {
|
|
38
|
+
alias: "L",
|
|
39
|
+
type: "number",
|
|
40
|
+
description: "The max loop times for the job",
|
|
41
|
+
default: 20,
|
|
42
|
+
});
|
|
43
|
+
}, (argv) => {
|
|
44
|
+
run({
|
|
45
|
+
jobGoal: argv.goal,
|
|
46
|
+
workDir: cwdResolver(argv.dir),
|
|
47
|
+
maxLoops: argv.loop,
|
|
48
|
+
});
|
|
49
|
+
})
|
|
50
|
+
.command("daemon <action>", "Manage the JIXO Core daemon", (yargs) => {
|
|
51
|
+
return yargs.positional("action", {
|
|
52
|
+
describe: "The action to perform on the daemon",
|
|
53
|
+
type: "string",
|
|
54
|
+
choices: ["start", "stop", "status", "restart"],
|
|
55
|
+
demandOption: true,
|
|
56
|
+
});
|
|
57
|
+
}, (argv) => {
|
|
58
|
+
switch (argv.action) {
|
|
59
|
+
case "start":
|
|
60
|
+
startDaemon();
|
|
61
|
+
break;
|
|
62
|
+
case "stop":
|
|
63
|
+
stopDaemon();
|
|
64
|
+
break;
|
|
65
|
+
case "status":
|
|
66
|
+
statusDaemon();
|
|
67
|
+
break;
|
|
68
|
+
case "restart":
|
|
69
|
+
restartDaemon();
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
.demandCommand(1, "You need at least one command before moving on")
|
|
74
|
+
.strict()
|
|
75
|
+
.help();
|
|
76
|
+
const argv = await cli.parse();
|
|
77
|
+
if (argv._.length === 0) {
|
|
78
|
+
cli.showHelp();
|
|
79
|
+
console.log(" " + "─".repeat(Math.max(4, process.stdout.columns - 2)));
|
|
80
|
+
await doctor();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"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","sourcesContent":["import {cwdResolver} from \"@gaubee/node\";\nimport yargs from \"yargs\";\nimport {hideBin} from \"yargs/helpers\";\nimport packageJson from \"../package.json\" with {type: \"json\"};\nimport {restartDaemon, startDaemon, statusDaemon, stopDaemon} from \"./commands/daemon.js\";\nimport {doctor} from \"./commands/doctor/index.js\";\nimport {init} from \"./commands/init.js\";\nimport {run} from \"./commands/tasks/run.js\";\n\nexport const runCli = async (args: string[] = process.argv) => {\n const cli = await yargs(hideBin(args))\n .scriptName(\"jixo\")\n .version(packageJson.version)\n .command(\n \"doctor\",\n \"Check the requirements and health of the JIXO environment\",\n (yargs) => yargs,\n () => {\n doctor();\n },\n )\n .command(\n \"init [dir]\",\n \"Create a new JIXO project configuration\",\n (yargs) => {\n return yargs.positional(\"dir\", {\n describe: \"The directory to create the JIXO config\",\n default: \"./\",\n });\n },\n (argv) => {\n init(cwdResolver(argv.dir));\n },\n )\n .command(\n \"run <goal>\",\n \"Run a JIXO job with a specific goal\",\n (yargs) => {\n return yargs\n .positional(\"goal\", {\n describe: \"The high-level goal for the job\",\n type: \"string\",\n demandOption: true,\n })\n .option(\"dir\", {\n alias: \"D\",\n type: \"string\",\n description: \"The project directory to run in\",\n default: process.cwd(),\n })\n .option(\"loop\", {\n alias: \"L\",\n type: \"number\",\n description: \"The max loop times for the job\",\n default: 20,\n });\n },\n (argv) => {\n run({\n jobGoal: argv.goal,\n workDir: cwdResolver(argv.dir),\n maxLoops: argv.loop,\n });\n },\n )\n .command(\n \"daemon <action>\",\n \"Manage the JIXO Core daemon\",\n (yargs) => {\n return yargs.positional(\"action\", {\n describe: \"The action to perform on the daemon\",\n type: \"string\",\n choices: [\"start\", \"stop\", \"status\", \"restart\"],\n demandOption: true,\n });\n },\n (argv) => {\n switch (argv.action) {\n case \"start\":\n startDaemon();\n break;\n case \"stop\":\n stopDaemon();\n break;\n case \"status\":\n statusDaemon();\n break;\n case \"restart\":\n restartDaemon();\n break;\n }\n },\n )\n .demandCommand(1, \"You need at least one command before moving on\")\n .strict()\n .help();\n\n const argv = await cli.parse();\n\n if (argv._.length === 0) {\n cli.showHelp();\n console.log(\" \" + \"─\".repeat(Math.max(4, process.stdout.columns - 2)));\n await doctor();\n }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../../src/commands/daemon.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,YAGvB,CAAC;AAEF,eAAO,MAAM,UAAU,YAEtB,CAAC;AAEF,eAAO,MAAM,YAAY,YAGxB,CAAC;AAEF,eAAO,MAAM,aAAa,YAIzB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { green, red, yellow } from "@gaubee/nodekit";
|
|
2
|
+
// NOTE: This is a placeholder implementation. A robust solution would use
|
|
3
|
+
// libraries like 'pm2', 'forever', or manage PID files directly.
|
|
4
|
+
export const startDaemon = () => {
|
|
5
|
+
console.log(green("Starting JIXO Core service in the background... (stub)"));
|
|
6
|
+
console.log(yellow("In a real implementation, this would spawn the core service process."));
|
|
7
|
+
};
|
|
8
|
+
export const stopDaemon = () => {
|
|
9
|
+
console.log(red("Stopping JIXO Core service... (stub)"));
|
|
10
|
+
};
|
|
11
|
+
export const statusDaemon = () => {
|
|
12
|
+
console.log(yellow("Checking JIXO Core service status... (stub)"));
|
|
13
|
+
console.log("Service is not running (default stub response).");
|
|
14
|
+
};
|
|
15
|
+
export const restartDaemon = () => {
|
|
16
|
+
console.log(yellow("Restarting JIXO Core service... (stub)"));
|
|
17
|
+
stopDaemon();
|
|
18
|
+
startDaemon();
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=daemon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../src/commands/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAEnD,0EAA0E;AAC1E,iEAAiE;AAEjE,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,sEAAsE,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAC,CAAC;IAC9D,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import {green, red, yellow} from \"@gaubee/nodekit\";\n\n// NOTE: This is a placeholder implementation. A robust solution would use\n// libraries like 'pm2', 'forever', or manage PID files directly.\n\nexport const startDaemon = () => {\n console.log(green(\"Starting JIXO Core service in the background... (stub)\"));\n console.log(yellow(\"In a real implementation, this would spawn the core service process.\"));\n};\n\nexport const stopDaemon = () => {\n console.log(red(\"Stopping JIXO Core service... (stub)\"));\n};\n\nexport const statusDaemon = () => {\n console.log(yellow(\"Checking JIXO Core service status... (stub)\"));\n console.log(\"Service is not running (default stub response).\");\n};\n\nexport const restartDaemon = () => {\n console.log(yellow(\"Restarting JIXO Core service... (stub)\"));\n stopDaemon();\n startDaemon();\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,YAc5B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { blue, green } from "@gaubee/nodekit";
|
|
2
|
+
export const myDoctorConfig = [
|
|
3
|
+
{
|
|
4
|
+
id: "jixo-core-service",
|
|
5
|
+
displayName: "JIXO Core Service",
|
|
6
|
+
installationHint: `Ensure the JIXO Core service is running. You can start it with 'jixo daemon start'.`,
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
id: "pnpm",
|
|
10
|
+
displayName: "PNPM Package Manager",
|
|
11
|
+
versionCommand: "pnpm --version",
|
|
12
|
+
versionParseRegex: /(\d+\.\d+\.\d+)/, // Assumes pnpm --version outputs just the version or "X.Y.Z ..."
|
|
13
|
+
minVersion: "10.9.0",
|
|
14
|
+
installationHint: `Install pnpm via npm: ${green("npm install -g pnpm")}. Or visit ${blue("https://pnpm.io/installation")}`,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/commands/doctor/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C;QACE,EAAE,EAAE,mBAAmB;QACvB,WAAW,EAAE,mBAAmB;QAChC,gBAAgB,EAAE,qFAAqF;KACxG;IACD;QACE,EAAE,EAAE,MAAM;QACV,WAAW,EAAE,sBAAsB;QACnC,cAAc,EAAE,gBAAgB;QAChC,iBAAiB,EAAE,iBAAiB,EAAE,iEAAiE;QACvG,UAAU,EAAE,QAAQ;QACpB,gBAAgB,EAAE,yBAAyB,KAAK,CAAC,qBAAqB,CAAC,cAAc,IAAI,CAAC,8BAA8B,CAAC,EAAE;KAC5H;CACF,CAAC","sourcesContent":["import {blue, green} from \"@gaubee/nodekit\";\nimport type {DoctorConfig} from \"./types.js\";\n\nexport const myDoctorConfig: DoctorConfig = [\n {\n id: \"jixo-core-service\",\n displayName: \"JIXO Core Service\",\n installationHint: `Ensure the JIXO Core service is running. You can start it with 'jixo daemon start'.`,\n },\n {\n id: \"pnpm\",\n displayName: \"PNPM Package Manager\",\n versionCommand: \"pnpm --version\",\n versionParseRegex: /(\\d+\\.\\d+\\.\\d+)/, // Assumes pnpm --version outputs just the version or \"X.Y.Z ...\"\n minVersion: \"10.9.0\",\n installationHint: `Install pnpm via npm: ${green(\"npm install -g pnpm\")}. Or visit ${blue(\"https://pnpm.io/installation\")}`,\n },\n];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/doctor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAkB,MAAM,YAAY,CAAC;AA4C5E,wBAAsB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,GAAE,OAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAkHtG"}
|