agent-work-loop 0.6.31 → 0.6.34
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/README.md +6 -0
- package/dist/{brief-ZZSQ6RQS.js → brief-2UCDBAB6.js} +5 -5
- package/dist/{changelog-JWLVVHZL.js → changelog-AICBEFUV.js} +5 -5
- package/dist/{chunk-SV4D72NX.js → chunk-3R52QFNQ.js} +2 -2
- package/dist/{chunk-Q7V3WVKT.js → chunk-4Q4FDZXN.js} +4 -4
- package/dist/{chunk-RNZCRXE3.js → chunk-EPVWUYXP.js} +5 -5
- package/dist/{chunk-2DAP3QBU.js → chunk-N5QEEXCO.js} +231 -129
- package/dist/{chunk-7NOHUUXV.js → chunk-O7V4DHPZ.js} +73 -12
- package/dist/{chunk-DIRYW77S.js → chunk-QFHXKTV6.js} +5 -5
- package/dist/{chunk-RRQYSRRT.js → chunk-RG6FT7I2.js} +5 -5
- package/dist/{chunk-3UPF7LZT.js → chunk-SDNJULFU.js} +5 -5
- package/dist/{chunk-45X7T64Y.js → chunk-SUF5ISJM.js} +63 -20
- package/dist/{chunk-JPFGMDQ4.js → chunk-SZQNXMYU.js} +62 -42
- package/dist/{chunk-22SUY5RE.js → chunk-TUV6NSTM.js} +6 -6
- package/dist/{chunk-77EZYCLF.js → chunk-VKLSQMAW.js} +2 -2
- package/dist/{chunk-5APWNDRG.js → chunk-VR74OBHK.js} +2 -2
- package/dist/{chunk-TTZY2GLK.js → chunk-W2AMCPKI.js} +1 -1
- package/dist/{chunk-Z3QCPOOA.js → chunk-WL674RWY.js} +2 -2
- package/dist/{chunk-YP4VCWPV.js → chunk-WPZK7LJU.js} +3 -3
- package/dist/cli.js +122 -51
- package/dist/{commit-3UZE7XJM.js → commit-PQE62KLZ.js} +6 -6
- package/dist/{config-DAD4LIWR.js → config-LHWI2J4M.js} +3 -3
- package/dist/{doctor-AW65MZKN.js → doctor-MEYI2ROW.js} +8 -8
- package/dist/{evolve-K4WKRA6U.js → evolve-KSUWIZCY.js} +7 -7
- package/dist/{feedback-3C33YHKF.js → feedback-633KAKEZ.js} +5 -5
- package/dist/{gotchas-IGEQILOO.js → gotchas-R236D2U2.js} +7 -7
- package/dist/{hold-recheck-THSJKF5G.js → hold-recheck-7D47ITAP.js} +16 -16
- package/dist/{init-MRJEU7IR.js → init-U7F6ECXI.js} +12 -2
- package/dist/lane-2OZBXFKL.js +41 -0
- package/dist/{loop-summary-MPEKQ2EC.js → loop-summary-HBADJTOZ.js} +6 -6
- package/dist/{metrics-64WBBQQX.js → metrics-WI2GOPGG.js} +4 -4
- package/dist/{record-GAWMF7KL.js → record-CEEEHNNF.js} +5 -5
- package/dist/{remove-ELP4MFVE.js → remove-GWSIRW36.js} +25 -15
- package/dist/{review-A5Q7NSOD.js → review-F6Y2TD5B.js} +13 -13
- package/dist/{rules-BEQT7YVN.js → rules-A7YTU3HV.js} +8 -8
- package/dist/{state-RDKIOU25.js → state-KHZNSJRS.js} +4 -4
- package/dist/status-HU3RLDSB.js +40 -0
- package/dist/{update-7RQQJ2TH.js → update-7BLNEJ52.js} +5 -5
- package/dist/{verify-UUJ6KD37.js → verify-WJNFIF4Y.js} +10 -10
- package/dist/version-check-DFNWGNLY.js +14 -0
- package/dist/work-LDPAHEPH.js +60 -0
- package/engine/version.json +1 -1
- package/package.json +1 -1
- package/dist/lane-ZQVD7EDE.js +0 -41
- package/dist/status-FP73XOZS.js +0 -40
- package/dist/version-check-H2T3WW3I.js +0 -14
- package/dist/work-HWJSUWBR.js +0 -50
|
@@ -7,32 +7,32 @@ import {
|
|
|
7
7
|
isCheckPassed,
|
|
8
8
|
runVerifyChecks,
|
|
9
9
|
writeVerifyBaseline
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RG6FT7I2.js";
|
|
11
11
|
import {
|
|
12
12
|
gitBranch
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TUV6NSTM.js";
|
|
14
14
|
import {
|
|
15
15
|
parseRuleFile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WL674RWY.js";
|
|
17
17
|
import {
|
|
18
18
|
nextGotchaId
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QFHXKTV6.js";
|
|
20
20
|
import {
|
|
21
21
|
loadProjectName
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WPZK7LJU.js";
|
|
23
23
|
import {
|
|
24
24
|
loadState,
|
|
25
25
|
migrateState,
|
|
26
26
|
writeState
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VKLSQMAW.js";
|
|
28
28
|
import {
|
|
29
29
|
loadConfig,
|
|
30
30
|
resolveProjectRoot,
|
|
31
31
|
run
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-SZQNXMYU.js";
|
|
33
33
|
import {
|
|
34
34
|
installClaudeSkill
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-N5QEEXCO.js";
|
|
36
36
|
import {
|
|
37
37
|
caps,
|
|
38
38
|
feedback,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
makeTokens,
|
|
43
43
|
sectionBox,
|
|
44
44
|
signal
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-SUF5ISJM.js";
|
|
46
46
|
|
|
47
47
|
// src/commands/work.ts
|
|
48
48
|
import fs2 from "fs";
|
|
@@ -662,17 +662,65 @@ function runWorkList(opts) {
|
|
|
662
662
|
function sanitizeForGit(s) {
|
|
663
663
|
return s.trim().replace(/[^A-Za-z0-9._-]/g, "_").replace(/\.{2,}/g, "_");
|
|
664
664
|
}
|
|
665
|
+
var DEFAULT_GIT_WORKTREE_TIMEOUT_MS = 18e4;
|
|
666
|
+
function resolveGitWorktreeTimeoutMs(env) {
|
|
667
|
+
const raw = env.AWL_GIT_WORKTREE_TIMEOUT_MS;
|
|
668
|
+
if (raw === void 0 || raw.trim() === "") {
|
|
669
|
+
return DEFAULT_GIT_WORKTREE_TIMEOUT_MS;
|
|
670
|
+
}
|
|
671
|
+
const n = Number.parseInt(raw, 10);
|
|
672
|
+
return Number.isFinite(n) && n > 0 ? n : DEFAULT_GIT_WORKTREE_TIMEOUT_MS;
|
|
673
|
+
}
|
|
674
|
+
function buildWorktreeError(raw, timedOut, timeoutMs) {
|
|
675
|
+
const trimmed = raw.trim();
|
|
676
|
+
if (!timedOut) {
|
|
677
|
+
return trimmed;
|
|
678
|
+
}
|
|
679
|
+
const seconds = Math.round(timeoutMs / 1e3);
|
|
680
|
+
const hint = `git worktree add \uAC00 ${seconds}\uCD08 \uC548\uC5D0 \uB05D\uB098\uC9C0 \uC54A\uC544 \uAC15\uC81C \uC885\uB8CC\uD588\uC2B5\uB2C8\uB2E4(\uB300\uD615 \uC800\uC7A5\uC18C\uB294 \uCCB4\uD06C\uC544\uC6C3\uC774 \uC624\uB798 \uAC78\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4). AWL_GIT_WORKTREE_TIMEOUT_MS=<ms> \uB85C \uD0C0\uC784\uC544\uC6C3\uC744 \uB298\uB824 \uB2E4\uC2DC \uC2DC\uB3C4\uD558\uC138\uC694(\uAE30\uBCF8\uAC12 ${DEFAULT_GIT_WORKTREE_TIMEOUT_MS}ms).`;
|
|
681
|
+
return trimmed ? `${trimmed}
|
|
682
|
+
${hint}` : hint;
|
|
683
|
+
}
|
|
684
|
+
function readDiskAvailable(targetPath) {
|
|
685
|
+
try {
|
|
686
|
+
if (typeof fs2.statfsSync !== "function") {
|
|
687
|
+
return null;
|
|
688
|
+
}
|
|
689
|
+
const st = fs2.statfsSync(targetPath);
|
|
690
|
+
return st.bavail * st.bsize;
|
|
691
|
+
} catch {
|
|
692
|
+
return null;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
function formatWorktreeReport(r) {
|
|
696
|
+
const seconds = (r.durationMs / 1e3).toFixed(1);
|
|
697
|
+
if (r.diskBeforeBytes === null || r.diskAfterBytes === null) {
|
|
698
|
+
return `\uC18C\uC694\uC2DC\uAC04 ${seconds}\uCD08 \xB7 \uB514\uC2A4\uD06C \uC5EC\uC720\uACF5\uAC04 \uCE21\uC815 \uBD88\uAC00`;
|
|
699
|
+
}
|
|
700
|
+
const deltaGB = (r.diskAfterBytes - r.diskBeforeBytes) / 1e9;
|
|
701
|
+
const sign = deltaGB >= 0 ? "+" : "";
|
|
702
|
+
return `\uC18C\uC694\uC2DC\uAC04 ${seconds}\uCD08 \xB7 \uB514\uC2A4\uD06C \uC5EC\uC720\uACF5\uAC04 ${(r.diskAfterBytes / 1e9).toFixed(1)}GB (\u0394 ${sign}${deltaGB.toFixed(1)}GB)`;
|
|
703
|
+
}
|
|
665
704
|
async function createGitWorktree(root, targetPath, branchName) {
|
|
705
|
+
const timeoutMs = resolveGitWorktreeTimeoutMs(process.env);
|
|
706
|
+
const diskBeforeBytes = readDiskAvailable(root);
|
|
666
707
|
const r = await run({
|
|
667
708
|
cmd: "git",
|
|
668
709
|
args: ["worktree", "add", targetPath, "-b", branchName],
|
|
669
710
|
cwd: root,
|
|
670
|
-
timeoutMs
|
|
711
|
+
timeoutMs
|
|
671
712
|
});
|
|
713
|
+
const diskAfterBytes = readDiskAvailable(root);
|
|
672
714
|
if (r.exitCode !== 0) {
|
|
673
|
-
return {
|
|
715
|
+
return {
|
|
716
|
+
ok: false,
|
|
717
|
+
error: buildWorktreeError(r.stderr || r.stdout, r.timedOut, timeoutMs),
|
|
718
|
+
durationMs: r.durationMs,
|
|
719
|
+
diskBeforeBytes,
|
|
720
|
+
diskAfterBytes
|
|
721
|
+
};
|
|
674
722
|
}
|
|
675
|
-
return { ok: true };
|
|
723
|
+
return { ok: true, durationMs: r.durationMs, diskBeforeBytes, diskAfterBytes };
|
|
676
724
|
}
|
|
677
725
|
async function removeGitWorktree(root, targetPath, branchName) {
|
|
678
726
|
const rm = await run({
|
|
@@ -727,11 +775,15 @@ async function runWorkNew(id, description, opts = {}) {
|
|
|
727
775
|
`);
|
|
728
776
|
process.exit(1);
|
|
729
777
|
}
|
|
778
|
+
let worktreeReport;
|
|
730
779
|
if (opts.worktree && worktreePath && branchName) {
|
|
731
780
|
const created = await createGitWorktree(root, worktreePath, branchName);
|
|
781
|
+
worktreeReport = created;
|
|
732
782
|
if (!created.ok) {
|
|
733
783
|
process.stderr.write(`
|
|
734
784
|
\uC6CC\uD06C\uD2B8\uB9AC\uB97C \uB9CC\uB4E4\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${created.error}
|
|
785
|
+
`);
|
|
786
|
+
process.stderr.write(` ${formatWorktreeReport(created)}
|
|
735
787
|
`);
|
|
736
788
|
process.exit(1);
|
|
737
789
|
}
|
|
@@ -779,6 +831,10 @@ ${feedback(c, "ok", `\uC6CC\uD06C\uC544\uC774\uD15C \uC0DD\uC131 ${color.bold(i
|
|
|
779
831
|
if (worktreePath) {
|
|
780
832
|
process.stdout.write(` ${color.dim(`\uC6CC\uD06C\uD2B8\uB9AC ${worktreePath}`)}
|
|
781
833
|
`);
|
|
834
|
+
if (worktreeReport) {
|
|
835
|
+
process.stdout.write(` ${color.dim(formatWorktreeReport(worktreeReport))}
|
|
836
|
+
`);
|
|
837
|
+
}
|
|
782
838
|
try {
|
|
783
839
|
if (installClaudeSkill(worktreePath)) {
|
|
784
840
|
process.stdout.write(` ${color.dim("\uC2A4\uD0AC \uC7AC\uC124\uCE58 .claude/skills/ (engine)")}
|
|
@@ -991,6 +1047,11 @@ export {
|
|
|
991
1047
|
removeWorkitemFromState,
|
|
992
1048
|
runWorkList,
|
|
993
1049
|
sanitizeForGit,
|
|
1050
|
+
DEFAULT_GIT_WORKTREE_TIMEOUT_MS,
|
|
1051
|
+
resolveGitWorktreeTimeoutMs,
|
|
1052
|
+
buildWorktreeError,
|
|
1053
|
+
readDiskAvailable,
|
|
1054
|
+
formatWorktreeReport,
|
|
994
1055
|
removeGitWorktree,
|
|
995
1056
|
withCostAtStart,
|
|
996
1057
|
runWorkNew,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computeDurationMs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VR74OBHK.js";
|
|
4
4
|
import {
|
|
5
5
|
computeCoverage,
|
|
6
6
|
readRecords
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WPZK7LJU.js";
|
|
8
8
|
import {
|
|
9
9
|
loadState
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VKLSQMAW.js";
|
|
11
11
|
import {
|
|
12
12
|
requireConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SZQNXMYU.js";
|
|
14
14
|
import {
|
|
15
15
|
caps,
|
|
16
16
|
generationsDir,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
lockFile,
|
|
20
20
|
makeColors,
|
|
21
21
|
signal
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SUF5ISJM.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/evolve.ts
|
|
25
25
|
import fs from "fs";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
protectedFilesMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W2AMCPKI.js";
|
|
4
4
|
import {
|
|
5
5
|
gitDirtyFiles
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TUV6NSTM.js";
|
|
7
7
|
import {
|
|
8
8
|
applyVerificationAttempts,
|
|
9
9
|
loadState,
|
|
10
10
|
writeState
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VKLSQMAW.js";
|
|
12
12
|
import {
|
|
13
13
|
CommandNotFoundError,
|
|
14
14
|
VERIFY_ORDER,
|
|
15
15
|
requireConfig,
|
|
16
16
|
run
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SZQNXMYU.js";
|
|
18
18
|
import {
|
|
19
19
|
caps,
|
|
20
20
|
makeColors,
|
|
21
21
|
sectionBox,
|
|
22
22
|
signal
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-SUF5ISJM.js";
|
|
24
24
|
|
|
25
25
|
// src/commands/verify.ts
|
|
26
26
|
import fs from "fs";
|
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
runWorkNew,
|
|
6
6
|
sanitizeForGit,
|
|
7
7
|
worktreeDirtyTracked
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-O7V4DHPZ.js";
|
|
9
9
|
import {
|
|
10
10
|
loadProjectName
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WPZK7LJU.js";
|
|
12
12
|
import {
|
|
13
13
|
loadState,
|
|
14
14
|
writeState
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VKLSQMAW.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveProjectRoot,
|
|
18
18
|
run
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SZQNXMYU.js";
|
|
20
20
|
import {
|
|
21
21
|
caps,
|
|
22
22
|
feedback,
|
|
23
23
|
makeColors,
|
|
24
24
|
sectionBox,
|
|
25
25
|
signal
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-SUF5ISJM.js";
|
|
27
27
|
|
|
28
28
|
// src/commands/lane.ts
|
|
29
29
|
import fs from "fs";
|
|
@@ -356,7 +356,15 @@ var UNICODE_SYMBOLS = {
|
|
|
356
356
|
radioOn: "\u25CF",
|
|
357
357
|
radioOff: "\u25CB",
|
|
358
358
|
checkOn: "\u2611",
|
|
359
|
-
checkOff: "\u2610"
|
|
359
|
+
checkOff: "\u2610",
|
|
360
|
+
flowStart: "\u250C",
|
|
361
|
+
flowStep: "\u25C7",
|
|
362
|
+
// radioOn 과 같은 문자(●)를 재사용한다 — "사용자가 고름"이라는 의미가 실제로
|
|
363
|
+
// 같고(체크된 라디오), ASCII 대체는 폭이 달라(radioOn 은 3칸 "(*)") 별도 필드로 둔다.
|
|
364
|
+
flowSelect: "\u25CF",
|
|
365
|
+
flowActive: "\u25C6",
|
|
366
|
+
flowLine: "\u2502",
|
|
367
|
+
flowEnd: "\u2514"
|
|
360
368
|
};
|
|
361
369
|
var ASCII_SYMBOLS = {
|
|
362
370
|
boxTL: "+",
|
|
@@ -373,7 +381,13 @@ var ASCII_SYMBOLS = {
|
|
|
373
381
|
radioOn: "(*)",
|
|
374
382
|
radioOff: "( )",
|
|
375
383
|
checkOn: "[x]",
|
|
376
|
-
checkOff: "[ ]"
|
|
384
|
+
checkOff: "[ ]",
|
|
385
|
+
flowStart: "+",
|
|
386
|
+
flowStep: "o",
|
|
387
|
+
flowSelect: "*",
|
|
388
|
+
flowActive: ">",
|
|
389
|
+
flowLine: "|",
|
|
390
|
+
flowEnd: "+"
|
|
377
391
|
};
|
|
378
392
|
function makeSymbols(c) {
|
|
379
393
|
return c.unicode ? UNICODE_SYMBOLS : ASCII_SYMBOLS;
|
|
@@ -390,27 +404,50 @@ function viewportWidth() {
|
|
|
390
404
|
}
|
|
391
405
|
return HARD_MAX_WIDTH;
|
|
392
406
|
}
|
|
393
|
-
|
|
407
|
+
var FLOW_PAD = 2;
|
|
408
|
+
function flowMaxInner(minInnerWidth) {
|
|
409
|
+
return Math.max(minInnerWidth, Math.min(HARD_MAX_WIDTH, viewportWidth() - (2 + FLOW_PAD * 2)));
|
|
410
|
+
}
|
|
411
|
+
function flowBodyRows(lines, c, minInnerWidth) {
|
|
394
412
|
const s = makeSymbols(c);
|
|
395
413
|
const t = makeTokens(c);
|
|
396
|
-
const
|
|
397
|
-
const maxInner = Math.max(
|
|
398
|
-
minInnerWidth,
|
|
399
|
-
Math.min(HARD_MAX_WIDTH, viewportWidth() - (2 + pad * 2))
|
|
400
|
-
);
|
|
414
|
+
const maxInner = flowMaxInner(minInnerWidth);
|
|
401
415
|
const wrapped = lines.flatMap((line) => wrapToWidth(line, maxInner, { hanging: true }));
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
416
|
+
return wrapped.map((text) => `${t.frame(s.flowLine)}${" ".repeat(FLOW_PAD)}${text}`);
|
|
417
|
+
}
|
|
418
|
+
function flowOpen(title, c = caps(), minInnerWidth = 0) {
|
|
419
|
+
const s = makeSymbols(c);
|
|
420
|
+
const t = makeTokens(c);
|
|
421
|
+
const safeTitle = truncateToWidth(title, flowMaxInner(minInnerWidth));
|
|
422
|
+
return `${t.frame(s.flowStart)}${" ".repeat(FLOW_PAD)}${t.emphasis(t.accent(safeTitle))}`;
|
|
423
|
+
}
|
|
424
|
+
function flowStepLine(title, c = caps()) {
|
|
425
|
+
const s = makeSymbols(c);
|
|
426
|
+
return `${makeTokens(c).frame(s.flowStep)}${" ".repeat(FLOW_PAD)}${title}`;
|
|
427
|
+
}
|
|
428
|
+
function flowSelectLine(title, c = caps()) {
|
|
429
|
+
const s = makeSymbols(c);
|
|
430
|
+
return `${makeTokens(c).frame(s.flowSelect)}${" ".repeat(FLOW_PAD)}${title}`;
|
|
431
|
+
}
|
|
432
|
+
function flowConnector(c = caps()) {
|
|
433
|
+
return makeTokens(c).frame(makeSymbols(c).flowLine);
|
|
434
|
+
}
|
|
435
|
+
function flowClose(c = caps()) {
|
|
436
|
+
return makeTokens(c).frame(makeSymbols(c).flowEnd);
|
|
437
|
+
}
|
|
438
|
+
function flowActiveNode(title, lines, c = caps(), minInnerWidth = 0) {
|
|
439
|
+
const s = makeSymbols(c);
|
|
440
|
+
const t = makeTokens(c);
|
|
441
|
+
const safeTitle = truncateToWidth(title, flowMaxInner(minInnerWidth));
|
|
442
|
+
const header = `${t.frame(s.flowActive)}${" ".repeat(FLOW_PAD)}${t.emphasis(t.accent(safeTitle))}`;
|
|
443
|
+
return [header, ...flowBodyRows(lines, c, minInnerWidth)].join("\n");
|
|
444
|
+
}
|
|
445
|
+
function sectionBox(title, lines, c = caps(), minInnerWidth = 0) {
|
|
446
|
+
return [
|
|
447
|
+
flowOpen(title, c, minInnerWidth),
|
|
448
|
+
...flowBodyRows(lines, c, minInnerWidth),
|
|
449
|
+
flowClose(c)
|
|
450
|
+
].join("\n");
|
|
414
451
|
}
|
|
415
452
|
var RESET = "\x1B[0m";
|
|
416
453
|
function ansi(code, str, enabled) {
|
|
@@ -512,6 +549,12 @@ export {
|
|
|
512
549
|
clipToWidth,
|
|
513
550
|
padEndDisplay,
|
|
514
551
|
makeSymbols,
|
|
552
|
+
flowOpen,
|
|
553
|
+
flowStepLine,
|
|
554
|
+
flowSelectLine,
|
|
555
|
+
flowConnector,
|
|
556
|
+
flowClose,
|
|
557
|
+
flowActiveNode,
|
|
515
558
|
sectionBox,
|
|
516
559
|
makeTokens,
|
|
517
560
|
signal,
|
|
@@ -2,18 +2,26 @@ import {
|
|
|
2
2
|
LANG_OPTIONS,
|
|
3
3
|
LANG_VALUES,
|
|
4
4
|
ask,
|
|
5
|
-
|
|
5
|
+
characterScreenLines,
|
|
6
|
+
closeFlow,
|
|
7
|
+
detectVerify,
|
|
8
|
+
langScreenLines,
|
|
9
|
+
openFlow,
|
|
6
10
|
promptNumber,
|
|
7
|
-
selectMulti
|
|
8
|
-
|
|
11
|
+
selectMulti,
|
|
12
|
+
step,
|
|
13
|
+
verifyStepLines
|
|
14
|
+
} from "./chunk-N5QEEXCO.js";
|
|
9
15
|
import {
|
|
10
16
|
caps,
|
|
11
17
|
findProjectRoot,
|
|
18
|
+
flowActiveNode,
|
|
19
|
+
flowConnector,
|
|
12
20
|
makeColors,
|
|
13
21
|
makeSymbols,
|
|
14
22
|
sectionBox,
|
|
15
23
|
signal
|
|
16
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-SUF5ISJM.js";
|
|
17
25
|
|
|
18
26
|
// src/commands/config.ts
|
|
19
27
|
import fs from "fs";
|
|
@@ -489,15 +497,16 @@ function writeConfigFile(projectRoot, config) {
|
|
|
489
497
|
`);
|
|
490
498
|
}
|
|
491
499
|
var EDIT_MENU = ["\uADF8\uB300\uB85C \uB454\uB2E4", "\uC8FC \uC5B8\uC5B4", "\uAC80\uC99D \uBA85\uB839\uC5B4", "\uC131\uACA9", "\uD504\uB85C\uC81D\uD2B8 \uC774\uB984"];
|
|
492
|
-
async function editVerifyCommands(rl, config, projectRoot, c) {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
${
|
|
496
|
-
`
|
|
500
|
+
async function editVerifyCommands(rl, config, projectRoot, c, flow) {
|
|
501
|
+
process.stdout.write(
|
|
502
|
+
`${flowConnector(c)}
|
|
503
|
+
${flowActiveNode("\uAC80\uC99D \uBA85\uB839\uC5B4", verifyStepLines(detectVerify(projectRoot)), c)}
|
|
504
|
+
`
|
|
505
|
+
);
|
|
497
506
|
for (const name of VERIFY_ORDER) {
|
|
498
507
|
const cur = config.verify[name];
|
|
499
508
|
const shown = cur ? cur.cmd : "(\uC5C6\uC74C)";
|
|
500
|
-
const answer = (await ask(rl,
|
|
509
|
+
const answer = (await ask(rl, `${flowConnector(c)} ${name} [${shown}]: `)).trim();
|
|
501
510
|
if (answer === "") {
|
|
502
511
|
continue;
|
|
503
512
|
}
|
|
@@ -508,17 +517,23 @@ ${screens.verify}
|
|
|
508
517
|
answer,
|
|
509
518
|
{ force: false }
|
|
510
519
|
);
|
|
511
|
-
|
|
512
|
-
`);
|
|
520
|
+
step(flow, outcome.message);
|
|
513
521
|
}
|
|
514
522
|
}
|
|
515
|
-
async function editMainLanguage(rl, config, projectRoot, c) {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
523
|
+
async function editMainLanguage(rl, config, projectRoot, c, flow) {
|
|
524
|
+
process.stdout.write(
|
|
525
|
+
`${flowConnector(c)}
|
|
526
|
+
${flowActiveNode(
|
|
527
|
+
"\uC8FC \uC5B8\uC5B4",
|
|
528
|
+
[
|
|
529
|
+
`\uD604\uC7AC \uC124\uC815: ${config.mainLanguage.join(", ") || "(\uC5C6\uC74C)"}`,
|
|
530
|
+
"",
|
|
531
|
+
...langScreenLines(projectRoot)
|
|
532
|
+
],
|
|
533
|
+
c
|
|
534
|
+
)}
|
|
535
|
+
`
|
|
536
|
+
);
|
|
522
537
|
const curIndices = config.mainLanguage.map((lang) => LANG_VALUES.indexOf(lang)).filter((i) => i >= 0);
|
|
523
538
|
const checked = await selectMulti(
|
|
524
539
|
rl,
|
|
@@ -531,7 +546,7 @@ async function editMainLanguage(rl, config, projectRoot, c) {
|
|
|
531
546
|
const manualIdx = LANG_OPTIONS.length - 1;
|
|
532
547
|
const values = checked.filter((i) => i !== manualIdx).map((i) => LANG_VALUES[i]).filter((v) => typeof v === "string" && v !== "");
|
|
533
548
|
if (checked.includes(manualIdx)) {
|
|
534
|
-
const typed = (await ask(rl,
|
|
549
|
+
const typed = (await ask(rl, `${flowConnector(c)} \uC8FC \uC5B8\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694: `)).trim();
|
|
535
550
|
if (typed) {
|
|
536
551
|
values.push(typed);
|
|
537
552
|
}
|
|
@@ -543,53 +558,58 @@ async function editMainLanguage(rl, config, projectRoot, c) {
|
|
|
543
558
|
values.join(","),
|
|
544
559
|
{ force: false }
|
|
545
560
|
);
|
|
546
|
-
|
|
547
|
-
`);
|
|
561
|
+
step(flow, outcome.message);
|
|
548
562
|
}
|
|
549
|
-
async function editCharacter(rl, config, projectRoot, c) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
${
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
563
|
+
async function editCharacter(rl, config, projectRoot, c, flow) {
|
|
564
|
+
process.stdout.write(
|
|
565
|
+
`${flowConnector(c)}
|
|
566
|
+
${flowActiveNode(
|
|
567
|
+
"\uADDC\uCE59\uACFC \uC774 \uD504\uB85C\uC81D\uD2B8\uC758 \uC131\uACA9",
|
|
568
|
+
[`\uD604\uC7AC: ${config.character || "(\uBE44\uC6C0)"}`, "", ...characterScreenLines()],
|
|
569
|
+
c
|
|
570
|
+
)}
|
|
571
|
+
`
|
|
572
|
+
);
|
|
573
|
+
const answer = await ask(rl, `${flowConnector(c)} > `);
|
|
557
574
|
const outcome = await applyConfigValue(config, projectRoot, { kind: "character" }, answer, {
|
|
558
575
|
force: false
|
|
559
576
|
});
|
|
560
|
-
|
|
561
|
-
`);
|
|
577
|
+
step(flow, outcome.message);
|
|
562
578
|
}
|
|
563
|
-
async function editProjectName(rl, config, projectRoot) {
|
|
564
|
-
const answer = (await ask(rl,
|
|
579
|
+
async function editProjectName(rl, config, projectRoot, c, flow) {
|
|
580
|
+
const answer = (await ask(rl, `${flowConnector(c)} \uD504\uB85C\uC81D\uD2B8 \uC774\uB984 [${config.project}]: `)).trim();
|
|
565
581
|
if (answer === "") {
|
|
566
582
|
return;
|
|
567
583
|
}
|
|
568
584
|
const outcome = await applyConfigValue(config, projectRoot, { kind: "project" }, answer, {
|
|
569
585
|
force: false
|
|
570
586
|
});
|
|
571
|
-
|
|
572
|
-
`);
|
|
587
|
+
step(flow, outcome.message);
|
|
573
588
|
}
|
|
574
589
|
async function interactiveEditMenu(rl, config, projectRoot, c) {
|
|
575
|
-
|
|
590
|
+
const flow = openFlow("\uC124\uC815 \uC218\uC815", c);
|
|
591
|
+
process.stdout.write(`${flowConnector(c)}
|
|
592
|
+
${flowActiveNode("\uC218\uC815\uD560 \uD56D\uBAA9\uC744 \uACE0\uB974\uC138\uC694", [], c)}
|
|
593
|
+
`);
|
|
576
594
|
for (let i = 0; i < EDIT_MENU.length; i++) {
|
|
577
|
-
process.stdout.write(
|
|
595
|
+
process.stdout.write(`${flowConnector(c)} ${i + 1} ${EDIT_MENU[i]}
|
|
578
596
|
`);
|
|
579
597
|
}
|
|
580
598
|
const idx = await promptNumber(rl, 0, EDIT_MENU.length);
|
|
581
599
|
if (idx === 0) {
|
|
600
|
+
closeFlow(flow);
|
|
582
601
|
return false;
|
|
583
602
|
}
|
|
584
603
|
if (idx === 1) {
|
|
585
|
-
await editMainLanguage(rl, config, projectRoot, c);
|
|
604
|
+
await editMainLanguage(rl, config, projectRoot, c, flow);
|
|
586
605
|
} else if (idx === 2) {
|
|
587
|
-
await editVerifyCommands(rl, config, projectRoot, c);
|
|
606
|
+
await editVerifyCommands(rl, config, projectRoot, c, flow);
|
|
588
607
|
} else if (idx === 3) {
|
|
589
|
-
await editCharacter(rl, config, projectRoot, c);
|
|
608
|
+
await editCharacter(rl, config, projectRoot, c, flow);
|
|
590
609
|
} else if (idx === 4) {
|
|
591
|
-
await editProjectName(rl, config, projectRoot);
|
|
610
|
+
await editProjectName(rl, config, projectRoot, c, flow);
|
|
592
611
|
}
|
|
612
|
+
closeFlow(flow);
|
|
593
613
|
return true;
|
|
594
614
|
}
|
|
595
615
|
async function runConfig() {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
gatherVersionInputs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4Q4FDZXN.js";
|
|
4
4
|
import {
|
|
5
5
|
checkVersions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3R52QFNQ.js";
|
|
7
7
|
import {
|
|
8
8
|
loadProjectName,
|
|
9
9
|
readRecords
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WPZK7LJU.js";
|
|
11
11
|
import {
|
|
12
12
|
loadState,
|
|
13
13
|
readStateLock
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VKLSQMAW.js";
|
|
15
15
|
import {
|
|
16
16
|
CommandNotFoundError,
|
|
17
17
|
run,
|
|
18
18
|
tokenize
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SZQNXMYU.js";
|
|
20
20
|
import {
|
|
21
21
|
caps,
|
|
22
22
|
clipToWidth,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
sectionBox,
|
|
33
33
|
signal,
|
|
34
34
|
visibleWidth
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-SUF5ISJM.js";
|
|
36
36
|
|
|
37
37
|
// src/commands/doctor.ts
|
|
38
38
|
import fs from "fs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveProjectRoot
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SZQNXMYU.js";
|
|
4
4
|
import {
|
|
5
5
|
caps,
|
|
6
6
|
makeColors,
|
|
7
7
|
sectionBox
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SUF5ISJM.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/state.ts
|
|
11
11
|
import fs from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SZQNXMYU.js";
|
|
4
4
|
import {
|
|
5
5
|
caps,
|
|
6
6
|
generationsDir,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
padEndDisplay,
|
|
9
9
|
sectionBox,
|
|
10
10
|
stringWidth
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SUF5ISJM.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/metrics.ts
|
|
14
14
|
import fs from "fs";
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
acquireLock,
|
|
3
3
|
loadGotchaList,
|
|
4
4
|
releaseLock
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QFHXKTV6.js";
|
|
6
6
|
import {
|
|
7
7
|
caps,
|
|
8
8
|
makeColors,
|
|
9
9
|
rulesDir,
|
|
10
10
|
sectionBox,
|
|
11
11
|
signal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SUF5ISJM.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/rules.ts
|
|
15
15
|
import { spawnSync } from "child_process";
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
getCriterion,
|
|
3
3
|
loadState,
|
|
4
4
|
writeState
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VKLSQMAW.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveProjectRoot,
|
|
8
8
|
run
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SZQNXMYU.js";
|
|
10
10
|
import {
|
|
11
11
|
caps,
|
|
12
12
|
makeColors,
|
|
13
13
|
recordsDir,
|
|
14
14
|
sectionBox,
|
|
15
15
|
signal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SUF5ISJM.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/record.ts
|
|
19
19
|
import crypto from "crypto";
|