@jvittechs/j 1.0.59 → 1.0.61
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/{chunk-3MKBSVAL.js → chunk-5RDBJYO2.js} +31 -3
- package/dist/chunk-5RDBJYO2.js.map +1 -0
- package/dist/{chunk-SDYQQ4ZY.js → chunk-F6GY6L6O.js} +15 -84
- package/dist/chunk-F6GY6L6O.js.map +1 -0
- package/dist/{chunk-BMDRQFY7.js → chunk-OJYJGHQX.js} +78 -7
- package/dist/chunk-OJYJGHQX.js.map +1 -0
- package/dist/cli.js +172 -40
- package/dist/cli.js.map +1 -1
- package/dist/show-LDL5KXZ6.js +8 -0
- package/dist/{summary-FIUGSB65.js → summary-KFXQDFG6.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-3MKBSVAL.js.map +0 -1
- package/dist/chunk-BMDRQFY7.js.map +0 -1
- package/dist/chunk-SDYQQ4ZY.js.map +0 -1
- package/dist/show-FGCDTIU7.js +0 -8
- /package/dist/{show-FGCDTIU7.js.map → show-LDL5KXZ6.js.map} +0 -0
- /package/dist/{summary-FIUGSB65.js.map → summary-KFXQDFG6.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -8,19 +8,20 @@ import {
|
|
|
8
8
|
} from "./chunk-XZ7VS36G.js";
|
|
9
9
|
import {
|
|
10
10
|
createSettingsShowCommand
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5RDBJYO2.js";
|
|
12
12
|
import {
|
|
13
13
|
BLOCKED_ICON,
|
|
14
|
-
|
|
14
|
+
CloudTaskProvider,
|
|
15
15
|
PRIORITY_ICONS,
|
|
16
16
|
PRIORITY_LABELS,
|
|
17
17
|
STATUS_ICONS,
|
|
18
18
|
TaskService,
|
|
19
19
|
createTaskSummaryCommand
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-F6GY6L6O.js";
|
|
21
21
|
import {
|
|
22
|
+
ConfigService,
|
|
22
23
|
SettingsService
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-OJYJGHQX.js";
|
|
24
25
|
|
|
25
26
|
// src/utils/node-version-check.ts
|
|
26
27
|
import chalk from "chalk";
|
|
@@ -156,7 +157,7 @@ import { basename as basename5 } from "path";
|
|
|
156
157
|
// package.json
|
|
157
158
|
var package_default = {
|
|
158
159
|
name: "@jvittechs/j",
|
|
159
|
-
version: "1.0.
|
|
160
|
+
version: "1.0.61",
|
|
160
161
|
description: "A unified CLI tool for JV-IT TECHS developers to manage Jai1 Framework. Supports both `j` and `jai1` commands. Please contact TeamAI for usage instructions.",
|
|
161
162
|
type: "module",
|
|
162
163
|
bin: {
|
|
@@ -11361,17 +11362,118 @@ import { Command as Command61 } from "commander";
|
|
|
11361
11362
|
// src/commands/settings/init.ts
|
|
11362
11363
|
import { Command as Command58 } from "commander";
|
|
11363
11364
|
import chalk31 from "chalk";
|
|
11365
|
+
import { confirm as confirm11 } from "@inquirer/prompts";
|
|
11366
|
+
async function checkAuthStatus() {
|
|
11367
|
+
try {
|
|
11368
|
+
const config = await new ConfigService().load();
|
|
11369
|
+
if (config?.apiUrl && config?.accessKey) {
|
|
11370
|
+
return { ok: true, config };
|
|
11371
|
+
}
|
|
11372
|
+
return { ok: false };
|
|
11373
|
+
} catch {
|
|
11374
|
+
return { ok: false };
|
|
11375
|
+
}
|
|
11376
|
+
}
|
|
11377
|
+
async function registerProject(config, projectId, repoUrl, silent) {
|
|
11378
|
+
try {
|
|
11379
|
+
const provider = new CloudTaskProvider(config, projectId);
|
|
11380
|
+
const registeredId = await provider.ensureProjectRegistered(repoUrl);
|
|
11381
|
+
if (!silent) {
|
|
11382
|
+
console.log(chalk31.green(" \u2713 Project registered on server"));
|
|
11383
|
+
}
|
|
11384
|
+
return registeredId;
|
|
11385
|
+
} catch (error) {
|
|
11386
|
+
if (!silent) {
|
|
11387
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
11388
|
+
console.log(chalk31.yellow(` \u26A0\uFE0F Register failed: ${msg}`));
|
|
11389
|
+
console.log(chalk31.dim(" Project s\u1EBD \u0111\u01B0\u1EE3c \u0111\u0103ng k\xFD l\u1EA1i khi ch\u1EA1y l\u1EC7nh task \u0111\u1EA7u ti\xEAn."));
|
|
11390
|
+
}
|
|
11391
|
+
return null;
|
|
11392
|
+
}
|
|
11393
|
+
}
|
|
11364
11394
|
function createSettingsInitCommand() {
|
|
11365
|
-
return new Command58("init").description("
|
|
11395
|
+
return new Command58("init").description("Kh\u1EDFi t\u1EA1o .jai1/settings.yaml").option("-f, --force", "Ghi \u0111\xE8 file c\u0169 n\u1EBFu \u0111\xE3 t\u1ED3n t\u1EA1i").option("--cloud", "Enable cloud task sync (non-interactive)").option("--no-interactive", "Kh\xF4ng h\u1ECFi, d\xF9ng flags/defaults").option("-j, --json", "Output JSON").action(async (options) => {
|
|
11366
11396
|
try {
|
|
11367
11397
|
const service = new SettingsService();
|
|
11368
|
-
|
|
11398
|
+
if (service.exists() && !options.force) {
|
|
11399
|
+
throw new Error("Settings file \u0111\xE3 t\u1ED3n t\u1EA1i. D\xF9ng --force \u0111\u1EC3 ghi \u0111\xE8.");
|
|
11400
|
+
}
|
|
11401
|
+
let enableCloud = options.cloud || false;
|
|
11402
|
+
let authResult = { ok: false };
|
|
11403
|
+
if (options.interactive !== false && !options.json) {
|
|
11404
|
+
const repoUrl = service.resolveGitRepoUrl();
|
|
11405
|
+
console.log(chalk31.bold("\u{1F4CB} Kh\u1EDFi t\u1EA1o Project Settings"));
|
|
11406
|
+
console.log("");
|
|
11407
|
+
if (repoUrl) {
|
|
11408
|
+
console.log(` ${chalk31.dim("Repo:")} ${repoUrl}`);
|
|
11409
|
+
console.log("");
|
|
11410
|
+
}
|
|
11411
|
+
enableCloud = await confirm11({
|
|
11412
|
+
message: "B\u1EADt cloud task sync? (\u0111\u1ED3ng b\u1ED9 tasks qua server)",
|
|
11413
|
+
default: false
|
|
11414
|
+
});
|
|
11415
|
+
if (enableCloud) {
|
|
11416
|
+
authResult = await checkAuthStatus();
|
|
11417
|
+
if (!authResult.ok) {
|
|
11418
|
+
console.log("");
|
|
11419
|
+
console.log(chalk31.yellow("\u26A0\uFE0F Ch\u01B0a \u0111\u0103ng nh\u1EADp Jai1."));
|
|
11420
|
+
console.log(chalk31.dim(" Ch\u1EA1y: j auth"));
|
|
11421
|
+
console.log("");
|
|
11422
|
+
const proceed = await confirm11({
|
|
11423
|
+
message: "V\u1EABn b\u1EADt cloud? (c\u1EA7n j auth tr\u01B0\u1EDBc khi d\xF9ng tasks)",
|
|
11424
|
+
default: false
|
|
11425
|
+
});
|
|
11426
|
+
if (!proceed) enableCloud = false;
|
|
11427
|
+
} else {
|
|
11428
|
+
console.log(chalk31.green(" \u2713 Auth OK"));
|
|
11429
|
+
}
|
|
11430
|
+
}
|
|
11431
|
+
} else if (enableCloud) {
|
|
11432
|
+
authResult = await checkAuthStatus();
|
|
11433
|
+
if (!authResult.ok && !options.json) {
|
|
11434
|
+
console.log(chalk31.yellow("\u26A0\uFE0F Ch\u01B0a \u0111\u0103ng nh\u1EADp. Ch\u1EA1y j auth tr\u01B0\u1EDBc khi d\xF9ng cloud tasks."));
|
|
11435
|
+
}
|
|
11436
|
+
}
|
|
11437
|
+
await service.init(true);
|
|
11438
|
+
if (enableCloud) {
|
|
11439
|
+
await service.set("tasks.cloud", true);
|
|
11440
|
+
}
|
|
11441
|
+
let registeredProjectId = null;
|
|
11442
|
+
if (enableCloud && authResult.ok && authResult.config) {
|
|
11443
|
+
const repoUrl = service.resolveGitRepoUrl();
|
|
11444
|
+
const projectId = service.getProjectId();
|
|
11445
|
+
if (repoUrl && projectId) {
|
|
11446
|
+
registeredProjectId = await registerProject(
|
|
11447
|
+
authResult.config,
|
|
11448
|
+
projectId,
|
|
11449
|
+
repoUrl,
|
|
11450
|
+
!!options.json
|
|
11451
|
+
);
|
|
11452
|
+
if (registeredProjectId && registeredProjectId !== projectId) {
|
|
11453
|
+
await service.set("tasks.projectId", registeredProjectId);
|
|
11454
|
+
}
|
|
11455
|
+
}
|
|
11456
|
+
}
|
|
11457
|
+
const finalSettings = service.load();
|
|
11369
11458
|
if (options.json) {
|
|
11370
|
-
console.log(JSON.stringify({
|
|
11459
|
+
console.log(JSON.stringify({
|
|
11460
|
+
success: true,
|
|
11461
|
+
path: service.getSettingsPath(),
|
|
11462
|
+
settings: finalSettings,
|
|
11463
|
+
registered: !!registeredProjectId
|
|
11464
|
+
}, null, 2));
|
|
11371
11465
|
return;
|
|
11372
11466
|
}
|
|
11467
|
+
console.log("");
|
|
11373
11468
|
console.log(chalk31.green("\u2705 Settings initialized"));
|
|
11374
11469
|
console.log(` ${chalk31.dim("Path:")} ${service.getSettingsPath()}`);
|
|
11470
|
+
console.log(` ${chalk31.dim("Cloud:")} ${enableCloud ? chalk31.green("enabled") : chalk31.dim("disabled")}`);
|
|
11471
|
+
if (enableCloud) {
|
|
11472
|
+
const projectId = service.getProjectId();
|
|
11473
|
+
if (projectId) {
|
|
11474
|
+
console.log(` ${chalk31.dim("Project ID:")} ${projectId}`);
|
|
11475
|
+
}
|
|
11476
|
+
}
|
|
11375
11477
|
} catch (error) {
|
|
11376
11478
|
if (options.json) {
|
|
11377
11479
|
console.log(JSON.stringify({ success: false, error: error instanceof Error ? error.message : String(error) }));
|
|
@@ -11391,7 +11493,10 @@ function createSettingsSetCommand() {
|
|
|
11391
11493
|
try {
|
|
11392
11494
|
const service = new SettingsService();
|
|
11393
11495
|
if (!service.exists()) {
|
|
11394
|
-
|
|
11496
|
+
await service.init(false);
|
|
11497
|
+
if (!options.json) {
|
|
11498
|
+
console.log(chalk32.dim("\u{1F4CB} Auto-created settings.yaml"));
|
|
11499
|
+
}
|
|
11395
11500
|
}
|
|
11396
11501
|
const settings = await service.set(key, value);
|
|
11397
11502
|
if (options.json) {
|
|
@@ -11399,6 +11504,33 @@ function createSettingsSetCommand() {
|
|
|
11399
11504
|
return;
|
|
11400
11505
|
}
|
|
11401
11506
|
console.log(chalk32.green(`\u2705 ${key} = ${JSON.stringify(service.get(key))}`));
|
|
11507
|
+
if (key === "tasks.cloud" && service.get(key) === true) {
|
|
11508
|
+
const config = await new ConfigService().load();
|
|
11509
|
+
if (!config?.apiUrl || !config?.accessKey) {
|
|
11510
|
+
console.log(chalk32.yellow("\u26A0\uFE0F Ch\u01B0a \u0111\u0103ng nh\u1EADp. Ch\u1EA1y j auth tr\u01B0\u1EDBc khi d\xF9ng cloud tasks."));
|
|
11511
|
+
} else {
|
|
11512
|
+
console.log(chalk32.dim(" Auth: \u2713 OK"));
|
|
11513
|
+
const repoUrl = service.resolveGitRepoUrl();
|
|
11514
|
+
const projectId = service.getProjectId();
|
|
11515
|
+
if (repoUrl && projectId) {
|
|
11516
|
+
try {
|
|
11517
|
+
const provider = new CloudTaskProvider(config, projectId);
|
|
11518
|
+
const registeredId = await provider.ensureProjectRegistered(repoUrl);
|
|
11519
|
+
console.log(chalk32.green(" \u2713 Project registered on server"));
|
|
11520
|
+
if (registeredId && registeredId !== projectId) {
|
|
11521
|
+
await service.set("tasks.projectId", registeredId);
|
|
11522
|
+
console.log(chalk32.dim(` Project ID: ${registeredId}`));
|
|
11523
|
+
} else {
|
|
11524
|
+
console.log(chalk32.dim(` Project: ${projectId}`));
|
|
11525
|
+
}
|
|
11526
|
+
} catch (error) {
|
|
11527
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
11528
|
+
console.log(chalk32.yellow(` \u26A0\uFE0F Register failed: ${msg}`));
|
|
11529
|
+
console.log(chalk32.dim(" Project s\u1EBD \u0111\u01B0\u1EE3c \u0111\u0103ng k\xFD l\u1EA1i khi ch\u1EA1y l\u1EC7nh task \u0111\u1EA7u ti\xEAn."));
|
|
11530
|
+
}
|
|
11531
|
+
}
|
|
11532
|
+
}
|
|
11533
|
+
}
|
|
11402
11534
|
} catch (error) {
|
|
11403
11535
|
if (options.json) {
|
|
11404
11536
|
console.log(JSON.stringify({ success: false, error: error instanceof Error ? error.message : String(error) }));
|
|
@@ -11446,7 +11578,7 @@ function createSettingsCommand() {
|
|
|
11446
11578
|
cmd.addCommand(createSettingsSetCommand());
|
|
11447
11579
|
cmd.addCommand(createSettingsGetCommand());
|
|
11448
11580
|
cmd.action(async () => {
|
|
11449
|
-
const { createSettingsShowCommand: showCmd } = await import("./show-
|
|
11581
|
+
const { createSettingsShowCommand: showCmd } = await import("./show-LDL5KXZ6.js");
|
|
11450
11582
|
const show = showCmd();
|
|
11451
11583
|
await show.parseAsync([], { from: "user" });
|
|
11452
11584
|
});
|
|
@@ -11711,7 +11843,7 @@ function createTaskShowCommand() {
|
|
|
11711
11843
|
// src/commands/tasks/pick.ts
|
|
11712
11844
|
import { Command as Command67 } from "commander";
|
|
11713
11845
|
import chalk39 from "chalk";
|
|
11714
|
-
import { confirm as
|
|
11846
|
+
import { confirm as confirm12 } from "@inquirer/prompts";
|
|
11715
11847
|
function createTaskPickCommand() {
|
|
11716
11848
|
return new Command67("pick").description("Claim the next available task").option("-j, --json", "Output JSON").action(async (options) => {
|
|
11717
11849
|
const service = new TaskService();
|
|
@@ -11741,7 +11873,7 @@ function createTaskPickCommand() {
|
|
|
11741
11873
|
console.log(chalk39.dim(`
|
|
11742
11874
|
+${ready.length - 1} more tasks ready`));
|
|
11743
11875
|
}
|
|
11744
|
-
const proceed = await
|
|
11876
|
+
const proceed = await confirm12({
|
|
11745
11877
|
message: "Claim this task?",
|
|
11746
11878
|
default: true
|
|
11747
11879
|
});
|
|
@@ -12035,7 +12167,7 @@ function createTaskParentsCommand() {
|
|
|
12035
12167
|
// src/commands/tasks/cancel.ts
|
|
12036
12168
|
import { Command as Command73 } from "commander";
|
|
12037
12169
|
import chalk45 from "chalk";
|
|
12038
|
-
import { confirm as
|
|
12170
|
+
import { confirm as confirm13 } from "@inquirer/prompts";
|
|
12039
12171
|
function createTaskCancelCommand() {
|
|
12040
12172
|
return new Command73("cancel").description("Cancel a task (with dependency impact check)").argument("<id>", "Task ID (e.g. T-001)").option("-y, --yes", "Skip confirmation").option("-j, --json", "Output JSON").action(async (id, options) => {
|
|
12041
12173
|
const service = new TaskService();
|
|
@@ -12076,7 +12208,7 @@ function createTaskCancelCommand() {
|
|
|
12076
12208
|
console.log();
|
|
12077
12209
|
}
|
|
12078
12210
|
if (!options.yes) {
|
|
12079
|
-
const proceed = await
|
|
12211
|
+
const proceed = await confirm13({
|
|
12080
12212
|
message: `Cancel task ${id}?`,
|
|
12081
12213
|
default: false
|
|
12082
12214
|
});
|
|
@@ -12103,7 +12235,7 @@ function createTaskCancelCommand() {
|
|
|
12103
12235
|
// src/commands/tasks/delete.ts
|
|
12104
12236
|
import { Command as Command74 } from "commander";
|
|
12105
12237
|
import chalk46 from "chalk";
|
|
12106
|
-
import { confirm as
|
|
12238
|
+
import { confirm as confirm14 } from "@inquirer/prompts";
|
|
12107
12239
|
function printTaskList(tasks, indent = " ") {
|
|
12108
12240
|
for (const t of tasks) {
|
|
12109
12241
|
const icon = STATUS_ICONS[t.status] || "\u{1F4CB}";
|
|
@@ -12199,7 +12331,7 @@ function createTaskDeleteCommand() {
|
|
|
12199
12331
|
printImpactSummary(tasksToDelete, allDependents);
|
|
12200
12332
|
if (!options.yes) {
|
|
12201
12333
|
const label = options.group ? `Xo\xE1 v\u0129nh vi\u1EC5n group "${options.group}" (${tasksToDelete.length} tasks)?` : tasksToDelete.length === 1 ? `Xo\xE1 v\u0129nh vi\u1EC5n task ${tasksToDelete[0].id}?` : `Xo\xE1 v\u0129nh vi\u1EC5n ${tasksToDelete.length} task(s)?`;
|
|
12202
|
-
const proceed = await
|
|
12334
|
+
const proceed = await confirm14({
|
|
12203
12335
|
message: label,
|
|
12204
12336
|
default: false
|
|
12205
12337
|
});
|
|
@@ -12264,7 +12396,7 @@ function createTasksCommand() {
|
|
|
12264
12396
|
cmd.addCommand(createTaskDeleteCommand());
|
|
12265
12397
|
cmd.addCommand(createTaskGuideCommand());
|
|
12266
12398
|
cmd.action(async () => {
|
|
12267
|
-
const { handleTaskSummary } = await import("./summary-
|
|
12399
|
+
const { handleTaskSummary } = await import("./summary-KFXQDFG6.js");
|
|
12268
12400
|
await handleTaskSummary({ json: false });
|
|
12269
12401
|
});
|
|
12270
12402
|
return cmd;
|
|
@@ -12788,7 +12920,7 @@ function createRulesListCommand() {
|
|
|
12788
12920
|
import { Command as Command81 } from "commander";
|
|
12789
12921
|
import { promises as fs21 } from "fs";
|
|
12790
12922
|
import { join as join12 } from "path";
|
|
12791
|
-
import { select as select4, confirm as
|
|
12923
|
+
import { select as select4, confirm as confirm15 } from "@inquirer/prompts";
|
|
12792
12924
|
|
|
12793
12925
|
// src/services/project-config.service.ts
|
|
12794
12926
|
import { promises as fs20 } from "fs";
|
|
@@ -12972,7 +13104,7 @@ function createRulesInitCommand() {
|
|
|
12972
13104
|
});
|
|
12973
13105
|
}
|
|
12974
13106
|
if (!options.yes) {
|
|
12975
|
-
const proceed = await
|
|
13107
|
+
const proceed = await confirm15({
|
|
12976
13108
|
message: `Apply preset '${bundle.preset.name}' to current directory?`,
|
|
12977
13109
|
default: true
|
|
12978
13110
|
});
|
|
@@ -13045,7 +13177,7 @@ async function applyAgentsMdFormat(bundle) {
|
|
|
13045
13177
|
import { Command as Command82 } from "commander";
|
|
13046
13178
|
import { promises as fs23 } from "fs";
|
|
13047
13179
|
import { join as join14 } from "path";
|
|
13048
|
-
import { search, confirm as
|
|
13180
|
+
import { search, confirm as confirm16, checkbox as checkbox5 } from "@inquirer/prompts";
|
|
13049
13181
|
|
|
13050
13182
|
// src/services/rules-generator.service.ts
|
|
13051
13183
|
var RulesGeneratorService = class {
|
|
@@ -13712,7 +13844,7 @@ function createRulesApplyCommand() {
|
|
|
13712
13844
|
if (backupPath) {
|
|
13713
13845
|
console.log(` Backup: ${backupPath}`);
|
|
13714
13846
|
}
|
|
13715
|
-
const proceed = await
|
|
13847
|
+
const proceed = await confirm16({
|
|
13716
13848
|
message: "Apply these rules to the current directory?",
|
|
13717
13849
|
default: true
|
|
13718
13850
|
});
|
|
@@ -13853,7 +13985,7 @@ function createRulesApplyCommand() {
|
|
|
13853
13985
|
// src/commands/rules/restore.ts
|
|
13854
13986
|
import { Command as Command83 } from "commander";
|
|
13855
13987
|
import { join as join15 } from "path";
|
|
13856
|
-
import { select as select5, confirm as
|
|
13988
|
+
import { select as select5, confirm as confirm17 } from "@inquirer/prompts";
|
|
13857
13989
|
function createRulesRestoreCommand() {
|
|
13858
13990
|
return new Command83("restore").description("Restore rules from a backup").option("--latest", "Restore the most recent backup").option("-y, --yes", "Skip confirmation").action(async (options) => {
|
|
13859
13991
|
const backupService = new BackupService();
|
|
@@ -13888,7 +14020,7 @@ function createRulesRestoreCommand() {
|
|
|
13888
14020
|
console.log(` IDEs: ${selectedBackup.ides.join(", ")}`);
|
|
13889
14021
|
console.log(` Files: ${selectedBackup.files.length}`);
|
|
13890
14022
|
if (!options.yes) {
|
|
13891
|
-
const proceed = await
|
|
14023
|
+
const proceed = await confirm17({
|
|
13892
14024
|
message: "This will overwrite current rules. Continue?",
|
|
13893
14025
|
default: false
|
|
13894
14026
|
});
|
|
@@ -13927,7 +14059,7 @@ function formatTimestamp(timestamp) {
|
|
|
13927
14059
|
import { Command as Command84 } from "commander";
|
|
13928
14060
|
import { promises as fs24 } from "fs";
|
|
13929
14061
|
import { join as join16 } from "path";
|
|
13930
|
-
import { checkbox as checkbox6, confirm as
|
|
14062
|
+
import { checkbox as checkbox6, confirm as confirm18, Separator } from "@inquirer/prompts";
|
|
13931
14063
|
function createRulesSyncCommand() {
|
|
13932
14064
|
return new Command84("sync").description("Regenerate rule outputs for all configured IDEs").option("--ides <ides>", "Comma-separated list of IDEs to sync (default: all configured)").option("--detect", "Auto-detect active IDEs instead of using config").option("-y, --yes", "Skip confirmations").action(async (options) => {
|
|
13933
14065
|
const rulePresetDir = join16(process.cwd(), ".jai1", "rule-preset");
|
|
@@ -13978,7 +14110,7 @@ Detected ${detected.length} active IDE(s):
|
|
|
13978
14110
|
console.log(` ${confidence} ${d.name} - ${d.ruleCount} rules`);
|
|
13979
14111
|
});
|
|
13980
14112
|
if (!options.yes) {
|
|
13981
|
-
const proceed = await
|
|
14113
|
+
const proceed = await confirm18({
|
|
13982
14114
|
message: "\nSync these detected IDEs?",
|
|
13983
14115
|
default: true
|
|
13984
14116
|
});
|
|
@@ -14860,7 +14992,7 @@ function createSkillsInfoCommand() {
|
|
|
14860
14992
|
// src/commands/skills/sync.ts
|
|
14861
14993
|
import { Command as Command91 } from "commander";
|
|
14862
14994
|
import chalk55 from "chalk";
|
|
14863
|
-
import { confirm as
|
|
14995
|
+
import { confirm as confirm20, checkbox as checkbox8 } from "@inquirer/prompts";
|
|
14864
14996
|
function createSkillsSyncCommand() {
|
|
14865
14997
|
return new Command91("sync").description("Sync skills from .jai1/skills/ to IDE directories").option("--ides <ides...>", "Target IDEs (cursor, windsurf, antigravity, claudecode, opencode)").option("--skills <skills...>", "Specific skill slugs to sync (default: all)").option("--all", "Select all available IDEs").option("--dry-run", "Preview changes without writing files").option("-y, --yes", "Headless mode (skip all prompts)").action(async (options) => {
|
|
14866
14998
|
const skillsService = new SkillsService();
|
|
@@ -14921,7 +15053,7 @@ function createSkillsSyncCommand() {
|
|
|
14921
15053
|
return;
|
|
14922
15054
|
}
|
|
14923
15055
|
if (!headless) {
|
|
14924
|
-
const confirmed = await
|
|
15056
|
+
const confirmed = await confirm20({
|
|
14925
15057
|
message: "Ti\u1EBFp t\u1EE5c sync?",
|
|
14926
15058
|
default: true
|
|
14927
15059
|
});
|
|
@@ -14990,7 +15122,7 @@ function createSkillsCommand() {
|
|
|
14990
15122
|
|
|
14991
15123
|
// src/commands/upgrade.ts
|
|
14992
15124
|
import { Command as Command93 } from "commander";
|
|
14993
|
-
import { confirm as
|
|
15125
|
+
import { confirm as confirm21 } from "@inquirer/prompts";
|
|
14994
15126
|
import { execSync as execSync5 } from "child_process";
|
|
14995
15127
|
var colors2 = {
|
|
14996
15128
|
yellow: "\x1B[33m",
|
|
@@ -15050,7 +15182,7 @@ ${colors2.bold}Current version:${colors2.reset} ${currentVersion}`);
|
|
|
15050
15182
|
return;
|
|
15051
15183
|
}
|
|
15052
15184
|
if (!options.force) {
|
|
15053
|
-
const shouldUpdate = await
|
|
15185
|
+
const shouldUpdate = await confirm21({
|
|
15054
15186
|
message: "Update to the latest version now?",
|
|
15055
15187
|
default: true
|
|
15056
15188
|
});
|
|
@@ -15155,7 +15287,7 @@ function getInstallCommand(packageManager2) {
|
|
|
15155
15287
|
|
|
15156
15288
|
// src/commands/clean.ts
|
|
15157
15289
|
import { Command as Command94 } from "commander";
|
|
15158
|
-
import { confirm as
|
|
15290
|
+
import { confirm as confirm22, select as select6 } from "@inquirer/prompts";
|
|
15159
15291
|
import { promises as fs27 } from "fs";
|
|
15160
15292
|
import { join as join20 } from "path";
|
|
15161
15293
|
import { existsSync as existsSync4 } from "fs";
|
|
@@ -15302,7 +15434,7 @@ async function cleanTarget(target, skipConfirm) {
|
|
|
15302
15434
|
}
|
|
15303
15435
|
const countStr = info.count ? ` (${info.count} items)` : "";
|
|
15304
15436
|
if (!skipConfirm) {
|
|
15305
|
-
const confirmed = await
|
|
15437
|
+
const confirmed = await confirm22({
|
|
15306
15438
|
message: `Delete ${target.name}${countStr}?`,
|
|
15307
15439
|
default: false
|
|
15308
15440
|
});
|
|
@@ -16270,7 +16402,7 @@ async function getProjectStatus2() {
|
|
|
16270
16402
|
|
|
16271
16403
|
// src/commands/self-update.ts
|
|
16272
16404
|
import { Command as Command99 } from "commander";
|
|
16273
|
-
import { confirm as
|
|
16405
|
+
import { confirm as confirm23 } from "@inquirer/prompts";
|
|
16274
16406
|
import { execSync as execSync6 } from "child_process";
|
|
16275
16407
|
var colors3 = {
|
|
16276
16408
|
yellow: "\x1B[33m",
|
|
@@ -16325,7 +16457,7 @@ ${colors3.bold}Current version:${colors3.reset} ${currentVersion}`);
|
|
|
16325
16457
|
return;
|
|
16326
16458
|
}
|
|
16327
16459
|
if (!options.force) {
|
|
16328
|
-
const shouldUpdate = await
|
|
16460
|
+
const shouldUpdate = await confirm23({
|
|
16329
16461
|
message: "Update to the latest version now?",
|
|
16330
16462
|
default: true
|
|
16331
16463
|
});
|
|
@@ -16422,7 +16554,7 @@ function getInstallCommand2(packageManager2) {
|
|
|
16422
16554
|
|
|
16423
16555
|
// src/commands/clear-backups.ts
|
|
16424
16556
|
import { Command as Command100 } from "commander";
|
|
16425
|
-
import { confirm as
|
|
16557
|
+
import { confirm as confirm24 } from "@inquirer/prompts";
|
|
16426
16558
|
function createClearBackupsCommand() {
|
|
16427
16559
|
return new Command100("clear-backups").description("Clear backup files").option("-y, --yes", "Skip confirmation").action(async (options) => {
|
|
16428
16560
|
const service = new ComponentsService();
|
|
@@ -16440,7 +16572,7 @@ function createClearBackupsCommand() {
|
|
|
16440
16572
|
}
|
|
16441
16573
|
console.log();
|
|
16442
16574
|
if (!options.yes) {
|
|
16443
|
-
const ok = await
|
|
16575
|
+
const ok = await confirm24({ message: "Delete all backups?", default: false });
|
|
16444
16576
|
if (!ok) return;
|
|
16445
16577
|
}
|
|
16446
16578
|
await service.clearBackups(process.cwd());
|
|
@@ -16450,7 +16582,7 @@ function createClearBackupsCommand() {
|
|
|
16450
16582
|
|
|
16451
16583
|
// src/commands/vscode/index.ts
|
|
16452
16584
|
import { Command as Command101 } from "commander";
|
|
16453
|
-
import { checkbox as checkbox9, confirm as
|
|
16585
|
+
import { checkbox as checkbox9, confirm as confirm25, select as select7 } from "@inquirer/prompts";
|
|
16454
16586
|
import fs29 from "fs/promises";
|
|
16455
16587
|
import path12 from "path";
|
|
16456
16588
|
import { existsSync as existsSync5 } from "fs";
|
|
@@ -16695,7 +16827,7 @@ async function applyGroups2(groupKeys, action) {
|
|
|
16695
16827
|
console.log("\u{1F4C4} \u0110\xE3 \u0111\u1ECDc c\xE0i \u0111\u1EB7t hi\u1EC7n t\u1EA1i t\u1EEB settings.json");
|
|
16696
16828
|
} catch {
|
|
16697
16829
|
console.warn("\u26A0\uFE0F Kh\xF4ng th\u1EC3 \u0111\u1ECDc settings.json (c\xF3 th\u1EC3 ch\u1EE9a comments).");
|
|
16698
|
-
const confirmOverwrite = await
|
|
16830
|
+
const confirmOverwrite = await confirm25({
|
|
16699
16831
|
message: "Ghi \u0111\xE8 file settings.json hi\u1EC7n t\u1EA1i?",
|
|
16700
16832
|
default: false
|
|
16701
16833
|
});
|
|
@@ -16742,7 +16874,7 @@ async function resetSettings2(groupKeys) {
|
|
|
16742
16874
|
console.log("\n\u26A0\uFE0F Kh\xF4ng t\xECm th\u1EA5y file settings.json");
|
|
16743
16875
|
return;
|
|
16744
16876
|
}
|
|
16745
|
-
const confirmReset = await
|
|
16877
|
+
const confirmReset = await confirm25({
|
|
16746
16878
|
message: groupKeys.length === 0 ? "Reset T\u1EA4T C\u1EA2 settings v\u1EC1 m\u1EB7c \u0111\u1ECBnh (x\xF3a to\xE0n b\u1ED9 file)?" : `Reset c\xE1c nh\xF3m: ${groupKeys.join(", ")}?`,
|
|
16747
16879
|
default: false
|
|
16748
16880
|
});
|
|
@@ -16761,7 +16893,7 @@ async function resetSettings2(groupKeys) {
|
|
|
16761
16893
|
|
|
16762
16894
|
// src/commands/migrate-ide.ts
|
|
16763
16895
|
import { Command as Command102 } from "commander";
|
|
16764
|
-
import { checkbox as checkbox10, confirm as
|
|
16896
|
+
import { checkbox as checkbox10, confirm as confirm26 } from "@inquirer/prompts";
|
|
16765
16897
|
function createMigrateIdeCommand() {
|
|
16766
16898
|
const cmd = new Command102("migrate-ide").description("Migrate .jai1 rules v\xE0 workflows sang IDEs (Cursor, Windsurf, Claude Code, etc.)").option("--ide <ides...>", "Target IDEs (cursor, windsurf, antigravity, claudecode, opencode)").option("--type <types...>", "Content types (rules, workflows, commands)").option("--dry-run", "Preview changes without writing files").action(async (options) => {
|
|
16767
16899
|
await runMigrateIde(options);
|
|
@@ -16834,7 +16966,7 @@ async function runMigrateIde(options) {
|
|
|
16834
16966
|
if (options.dryRun) {
|
|
16835
16967
|
console.log("\u{1F50D} DRY RUN - No files will be written\n");
|
|
16836
16968
|
}
|
|
16837
|
-
const confirmed = await
|
|
16969
|
+
const confirmed = await confirm26({
|
|
16838
16970
|
message: "Proceed with migration?",
|
|
16839
16971
|
default: true
|
|
16840
16972
|
});
|