@nalvietnam/avatar-cli 1.3.1 → 1.3.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/index.js
CHANGED
|
@@ -968,24 +968,8 @@ async function commitWorkspace(workspaceRoot, opts) {
|
|
|
968
968
|
}
|
|
969
969
|
return { sha, pushed };
|
|
970
970
|
}
|
|
971
|
-
function warnIfOtherTargetDirty(workspaceRoot, requestedTarget) {
|
|
972
|
-
if (requestedTarget === "all") return;
|
|
973
|
-
const srcDirty = isDirty(join7(workspaceRoot, "src"));
|
|
974
|
-
const workspaceDirty = isDirty(workspaceRoot);
|
|
975
|
-
if (requestedTarget === "src" && workspaceDirty) {
|
|
976
|
-
log.warn(
|
|
977
|
-
"Workspace c\u0169ng c\xF3 changes ch\u01B0a commit. Ch\u1EA1y 'avatar commit workspace' (ho\u1EB7c 'avatar commit all') \u0111\u1EC3 commit lu\xF4n."
|
|
978
|
-
);
|
|
979
|
-
}
|
|
980
|
-
if (requestedTarget === "workspace" && srcDirty) {
|
|
981
|
-
log.warn(
|
|
982
|
-
"src/ c\u0169ng c\xF3 changes ch\u01B0a commit. Ch\u1EA1y 'avatar commit src' (ho\u1EB7c 'avatar commit all') \u0111\u1EC3 commit lu\xF4n."
|
|
983
|
-
);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
971
|
async function executeCommitWithTargetSelection(args) {
|
|
987
972
|
assertAvatarWorkspaceRoot(args.workspaceRoot);
|
|
988
|
-
warnIfOtherTargetDirty(args.workspaceRoot, args.target);
|
|
989
973
|
const result = { target: args.target, skipped: [] };
|
|
990
974
|
if (args.target === "src" || args.target === "all") {
|
|
991
975
|
const srcOutcome = await commitSrc(args.workspaceRoot, args.options);
|
|
@@ -1004,18 +988,12 @@ async function executeCommitWithTargetSelection(args) {
|
|
|
1004
988
|
|
|
1005
989
|
// src/commands/commit.ts
|
|
1006
990
|
function registerCommitCommand(program2) {
|
|
1007
|
-
const commit = program2.command("commit").description("Commit code
|
|
991
|
+
const commit = program2.command("commit").description("Commit code kh\xE1ch trong src/ (Avatar state do admin sync) (M07)");
|
|
1008
992
|
commit.command("src").description("Commit src/ \u2192 push l\xEAn client repo remote").option("-m, --message <msg>", "Commit message").option("--push", "Auto push sau commit (default: ch\u1EC9 commit)").action(async (opts) => {
|
|
1009
|
-
await
|
|
1010
|
-
});
|
|
1011
|
-
commit.command("workspace").description("Commit workspace root \u2192 push l\xEAn team remote (Avatar state)").option("-m, --message <msg>", "Commit message").option("--push", "Auto push sau commit (default: ch\u1EC9 commit)").action(async (opts) => {
|
|
1012
|
-
await runCommit("workspace", opts);
|
|
1013
|
-
});
|
|
1014
|
-
commit.command("all").description("Commit c\u1EA3 src/ v\xE0 workspace (src tr\u01B0\u1EDBc, gitlink update, workspace sau)").option("-m, --message <msg>", "Commit message").option("--push", "Auto push sau commit (default: ch\u1EC9 commit)").action(async (opts) => {
|
|
1015
|
-
await runCommit("all", opts);
|
|
993
|
+
await runCommitSrc(opts);
|
|
1016
994
|
});
|
|
1017
995
|
}
|
|
1018
|
-
async function
|
|
996
|
+
async function runCommitSrc(opts) {
|
|
1019
997
|
try {
|
|
1020
998
|
const message = opts.message ?? await input2({
|
|
1021
999
|
message: "Commit message:",
|
|
@@ -1023,17 +1001,12 @@ async function runCommit(target, opts) {
|
|
|
1023
1001
|
});
|
|
1024
1002
|
const result = await executeCommitWithTargetSelection({
|
|
1025
1003
|
workspaceRoot: process.cwd(),
|
|
1026
|
-
target,
|
|
1004
|
+
target: "src",
|
|
1027
1005
|
options: { message, push: opts.push }
|
|
1028
1006
|
});
|
|
1029
1007
|
if (result.srcCommitSha) {
|
|
1030
1008
|
log.success(`src/: ${result.srcCommitSha.slice(0, 7)}${result.srcPushed ? " (pushed)" : ""}`);
|
|
1031
1009
|
}
|
|
1032
|
-
if (result.workspaceCommitSha) {
|
|
1033
|
-
log.success(
|
|
1034
|
-
`workspace: ${result.workspaceCommitSha.slice(0, 7)}${result.workspacePushed ? " (pushed)" : ""}`
|
|
1035
|
-
);
|
|
1036
|
-
}
|
|
1037
1010
|
if (result.skipped && result.skipped.length > 0) {
|
|
1038
1011
|
log.dim(`Skipped (nothing to commit): ${result.skipped.join(", ")}`);
|
|
1039
1012
|
}
|
|
@@ -3555,7 +3528,7 @@ async function removeSubmoduleEntry(gitmodulesPath, submodulePath) {
|
|
|
3555
3528
|
}
|
|
3556
3529
|
|
|
3557
3530
|
// src/commands/uninstall.ts
|
|
3558
|
-
var CLI_VERSION = "1.3.
|
|
3531
|
+
var CLI_VERSION = "1.3.2";
|
|
3559
3532
|
function registerUninstallCommand(program2) {
|
|
3560
3533
|
program2.command("uninstall").description("G\u1EE1 Avatar kh\u1ECFi project \u2014 backup t\u1EF1 \u0111\u1ED9ng (M11)").option("--yes", "Skip confirm prompt").option("--no-backup", "Kh\xF4ng t\u1EA1o backup tr\u01B0\u1EDBc khi x\xF3a (nguy hi\u1EC3m)").option("--keep-submodule", "Gi\u1EEF submodule .claude/pack/").option("--keep-hooks", "Gi\u1EEF git hooks post-merge, pre-push").option("--dry-run", "Hi\u1EC3n th\u1ECB danh s\xE1ch s\u1EBD x\xF3a, kh\xF4ng th\u1EF1c thi").action(async (opts) => {
|
|
3561
3534
|
try {
|
|
@@ -3637,7 +3610,7 @@ function printUninstallSuccessBox(backupPath) {
|
|
|
3637
3610
|
}
|
|
3638
3611
|
|
|
3639
3612
|
// src/index.ts
|
|
3640
|
-
var CLI_VERSION2 = "1.3.
|
|
3613
|
+
var CLI_VERSION2 = "1.3.2";
|
|
3641
3614
|
var program = new Command();
|
|
3642
3615
|
program.name("avatar").description("AI harness CLI for NAL Vietnam engineering").version(CLI_VERSION2, "-v, --version", "Hi\u1EC3n th\u1ECB phi\xEAn b\u1EA3n Avatar CLI").addHelpText(
|
|
3643
3616
|
"beforeAll",
|