@mcpeak/cli 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/commands.cjs +58 -9
- package/dist/commands.d.cts +42 -3
- package/dist/commands.d.mts +42 -3
- package/dist/commands.mjs +45 -2
- package/dist/{repair-command-8GUlJJ47.d.mts → index-CBFNkZgR.d.mts} +147 -3
- package/dist/{repair-command-CVFqxU6V.d.cts → index-_hQ_Ohu-.d.cts} +146 -2
- package/dist/index.cjs +6 -219
- package/dist/index.d.cts +2 -16
- package/dist/index.d.mts +2 -16
- package/dist/index.mjs +2 -217
- package/dist/{test-command-1m3myzTS.cjs → src-BBBK_BXs.cjs} +6739 -5202
- package/dist/{test-command-P8_uaAIy.mjs → src-CRsYPuu_.mjs} +6715 -5202
- package/package.json +17 -7
package/dist/cli.cjs
CHANGED
package/dist/cli.mjs
CHANGED
package/dist/commands.cjs
CHANGED
|
@@ -1,10 +1,59 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
const require_src = require("./src-BBBK_BXs.cjs");
|
|
3
|
+
//#region src/auto-review-io.ts
|
|
4
|
+
function autoReviewIO(sink) {
|
|
5
|
+
let menuSeen = false;
|
|
6
|
+
let cancelled = false;
|
|
7
|
+
const note = (question, answer) => {
|
|
8
|
+
sink.write(`▸ 자동 승인: ${summarize(question)} → ${answer}\n`);
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
interactive: true,
|
|
12
|
+
get cancelled() {
|
|
13
|
+
return cancelled;
|
|
14
|
+
},
|
|
15
|
+
write: (text) => sink.write(text),
|
|
16
|
+
async choose(message, choices) {
|
|
17
|
+
if (message === "검토 메뉴") {
|
|
18
|
+
const answer = menuSeen ? "cancel" : "save";
|
|
19
|
+
if (menuSeen) cancelled = true;
|
|
20
|
+
menuSeen = true;
|
|
21
|
+
note(message, answer);
|
|
22
|
+
return answer;
|
|
23
|
+
}
|
|
24
|
+
const answer = choices[0] ?? "";
|
|
25
|
+
note(message, answer);
|
|
26
|
+
return answer;
|
|
27
|
+
},
|
|
28
|
+
async confirm(message) {
|
|
29
|
+
const answer = !/그래도 적용합니까/.test(message);
|
|
30
|
+
note(message, answer ? "예" : "아니오");
|
|
31
|
+
return answer;
|
|
32
|
+
},
|
|
33
|
+
async input(message) {
|
|
34
|
+
const answer = /^\s*선택:\s*$/.test(message) ? "s" : "";
|
|
35
|
+
note(message, answer === "" ? "(엔터)" : answer);
|
|
36
|
+
return answer;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** 로그 한 줄에 들어갈 만큼만 남긴다. 질문 본문은 이미 화면에 찍혀 있다. */
|
|
41
|
+
function summarize(question) {
|
|
42
|
+
const oneLine = question.replace(/\s+/g, " ").trim();
|
|
43
|
+
return oneLine.length > 60 ? `${oneLine.slice(0, 57)}...` : oneLine;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
exports.REVIEW_BACK_VALUE = require_src.REVIEW_BACK_VALUE;
|
|
47
|
+
exports.autoReviewIO = autoReviewIO;
|
|
48
|
+
exports.nodeAuditDependencies = require_src.nodeAuditDependencies;
|
|
49
|
+
exports.nodeGenerateDependencies = require_src.nodeGenerateDependencies;
|
|
50
|
+
exports.nodeReviewIO = require_src.nodeReviewIO;
|
|
51
|
+
exports.parseAuditCommand = require_src.parseAuditCommand;
|
|
52
|
+
exports.parseOptimizeCommand = require_src.parseOptimizeCommand;
|
|
53
|
+
exports.parseRepairCommand = require_src.parseRepairCommand;
|
|
54
|
+
exports.parseTestCommand = require_src.parseTestCommand;
|
|
55
|
+
exports.runAuditCommand = require_src.runAuditCommand;
|
|
56
|
+
exports.runCli = require_src.runCli;
|
|
57
|
+
exports.runGenerateCommand = require_src.runGenerateCommand;
|
|
58
|
+
exports.runOptimizeCommand = require_src.runOptimizeCommand;
|
|
59
|
+
exports.runRepairCommand = require_src.runRepairCommand;
|
package/dist/commands.d.cts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as AuditCommandInput, E as ConnectTarget, S as AuditCommandDependencies, T as runAuditCommand, _ as REVIEW_BACK_VALUE, b as nodeReviewIO, c as RepairCommandInput, d as OptimizeCommandDependencies, f as OptimizeCommandInput, g as GenerateCommandInput, h as GenerateCommandDependencies, l as parseRepairCommand, m as runOptimizeCommand, p as parseOptimizeCommand, r as nodeAuditDependencies, s as RepairCommandDependencies, u as runRepairCommand, v as ReviewIO, w as parseAuditCommand, x as runGenerateCommand, y as nodeGenerateDependencies } from "./index-_hQ_Ohu-.cjs";
|
|
2
2
|
import { McpHttpConnection, McpStdioConnection } from "@mcpeak/core";
|
|
3
|
-
import { CheckDeterminismOptions, DeterminismResult, FinalizeRunnerExecutionOptions, InputContractOptions, RunSuiteOptions, RunnerExecution, RunnerReport, SpecFindingsResult, SuiteValidationIssue, SuiteValidationResult, TestSuiteSpec } from "@mcpeak/runner";
|
|
3
|
+
import { CheckDeterminismOptions, DeterminismResult, FinalizeRunnerExecutionOptions, InputContractOptions, RunSuiteOptions, RunnerExecution, RunnerReport, SpecFinding, SpecFindingsResult, SuiteValidationIssue, SuiteValidationResult, TestSuiteSpec } from "@mcpeak/runner";
|
|
4
4
|
import "@mcpeak/record/external";
|
|
5
|
+
//#region src/auto-review-io.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* `generate` 의 승인 질문에 정해진 정책으로 답하는 ReviewIO.
|
|
8
|
+
*
|
|
9
|
+
* 사람용 승인 화면(전송·시험 실행·재검증·저장 확인, 실패 분류, 교정 값 입력)을 에이전트나
|
|
10
|
+
* 대시보드의 "한 번에 검증" 이 사람 개입 없이 지나가게 한다. 판정 로직은 없다. 질문마다 어떤
|
|
11
|
+
* 답을 고르는지만 여기 있고, 고른 답은 `sink` 에 한 줄씩 남겨 무엇이 자동으로 결정됐는지
|
|
12
|
+
* 화면에서 읽을 수 있게 한다.
|
|
13
|
+
*
|
|
14
|
+
* 정책:
|
|
15
|
+
* - 검토 메뉴: 처음은 `save`, 그 뒤는 `cancel`. 저장이 되돌아오면(재검증 실패 등) 같은 답을
|
|
16
|
+
* 되풀이하지 않고 끝낸다.
|
|
17
|
+
* - 확인: 전부 예. 단 "그래도 적용합니까" 처럼 선언 위반이 남은 후보의 적용은 아니오.
|
|
18
|
+
* - 실패 분류(`선택: `): `s`(서버 결함). 교정 뒤에도 남은 실패는 명세가 옳고 서버가 틀린 것으로
|
|
19
|
+
* 기록한다. 보류(`?`)는 저장을 막으므로 쓰지 않는다.
|
|
20
|
+
* - 교정 값 입력(`엔터 = …`): 빈 문자열. 제안이 있으면 제안 값, 없으면 현재 값을 그대로 둔다.
|
|
21
|
+
* - 그 밖의 입력: 빈 문자열. 저장 경로에서는 나오지 않는다.
|
|
22
|
+
*/
|
|
23
|
+
interface AutoReviewIO extends ReviewIO {
|
|
24
|
+
/**
|
|
25
|
+
* 검토 메뉴에 두 번째로 닿아 `cancel` 로 끝냈는가. 저장이 되돌아왔다는 뜻이고, 그때 generate
|
|
26
|
+
* 는 저장 없이 0 을 돌려준다. 호출자는 이 값으로 "저장 성공" 과 "취소" 를 가른다.
|
|
27
|
+
*/
|
|
28
|
+
readonly cancelled: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare function autoReviewIO(sink: {
|
|
31
|
+
write(text: string): void;
|
|
32
|
+
}): AutoReviewIO;
|
|
33
|
+
//#endregion
|
|
5
34
|
//#region src/test-command.d.ts
|
|
6
35
|
interface TestCommandInput {
|
|
7
36
|
readonly suitePath: string;
|
|
@@ -63,8 +92,13 @@ interface TestCommandDependencies {
|
|
|
63
92
|
readEnv?(name: string): string | undefined;
|
|
64
93
|
startRunner(options: RunSuiteOptions): RunnerExecution;
|
|
65
94
|
finalize(options: FinalizeRunnerExecutionOptions): Promise<RunnerReport>;
|
|
95
|
+
/**
|
|
96
|
+
* `specApproved` 는 명세에 approval 블록이 있는지다. 거절 근거 미확인 고지가 generate 승인
|
|
97
|
+
* 화면을 가리킬지 `--json` 의 rejectionBody 를 가리킬지 가른다. 설계 문서(경쟁 도구 비교) §3.4.
|
|
98
|
+
*/
|
|
66
99
|
renderReport(report: RunnerReport, options?: {
|
|
67
100
|
color?: boolean;
|
|
101
|
+
specApproved?: boolean;
|
|
68
102
|
}): string;
|
|
69
103
|
/**
|
|
70
104
|
* runner 의 `renderJUnit`. 두 번째 인자를 선언하지 않는다 — CLI 는 `suiteName` 을 넘길 이유가
|
|
@@ -79,6 +113,11 @@ interface TestCommandDependencies {
|
|
|
79
113
|
*/
|
|
80
114
|
checkInputContract?(options: InputContractOptions): SpecFindingsResult;
|
|
81
115
|
checkAssertionSubstance?(suite: TestSuiteSpec): SpecFindingsResult;
|
|
116
|
+
/**
|
|
117
|
+
* 거절 기대 케이스에서 억제된 선언 위반. 위 두 필드와 같은 이유로 선택 사항이다. 생략하면
|
|
118
|
+
* `runner` 의 `acceptedViolations` 다. 설계 문서(경쟁 도구 비교) §3.2.
|
|
119
|
+
*/
|
|
120
|
+
acceptedViolations?(options: InputContractOptions): ReadonlyMap<string, readonly SpecFinding[]>;
|
|
82
121
|
/**
|
|
83
122
|
* 결정론성 비교와 초기화 명령의 주입 지점. 위 두 필드와 같은 이유로 선택 사항이다.
|
|
84
123
|
* 생략하면 각각 `runner` 의 `checkDeterminism` 과 `reset-hook.ts` 의 `runResetCommand` 다.
|
|
@@ -102,4 +141,4 @@ declare function parseTestCommand(argv: readonly string[]): TestCommandInput;
|
|
|
102
141
|
*/
|
|
103
142
|
declare function runCli(argv: readonly string[], dependencies: TestCommandDependencies): Promise<number>;
|
|
104
143
|
//#endregion
|
|
105
|
-
export { type CliErrorCode, type CliFailure, type GenerateCommandDependencies, type GenerateCommandInput, REVIEW_BACK_VALUE, type RepairCommandDependencies, type RepairCommandInput, type ReviewIO, type TestCommandDependencies, type TestCommandInput, nodeGenerateDependencies, nodeReviewIO, parseRepairCommand, parseTestCommand, runCli, runGenerateCommand, runRepairCommand };
|
|
144
|
+
export { type AuditCommandDependencies, type AuditCommandInput, type AutoReviewIO, type CliErrorCode, type CliFailure, type GenerateCommandDependencies, type GenerateCommandInput, type OptimizeCommandDependencies, type OptimizeCommandInput, REVIEW_BACK_VALUE, type RepairCommandDependencies, type RepairCommandInput, type ReviewIO, type TestCommandDependencies, type TestCommandInput, autoReviewIO, nodeAuditDependencies, nodeGenerateDependencies, nodeReviewIO, parseAuditCommand, parseOptimizeCommand, parseRepairCommand, parseTestCommand, runAuditCommand, runCli, runGenerateCommand, runOptimizeCommand, runRepairCommand };
|
package/dist/commands.d.mts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CheckDeterminismOptions, DeterminismResult, FinalizeRunnerExecutionOptions, InputContractOptions, RunSuiteOptions, RunnerExecution, RunnerReport, SpecFindingsResult, SuiteValidationIssue, SuiteValidationResult, TestSuiteSpec } from "@mcpeak/runner";
|
|
1
|
+
import { C as AuditCommandInput, E as ConnectTarget, S as AuditCommandDependencies, T as runAuditCommand, _ as REVIEW_BACK_VALUE, b as nodeReviewIO, c as RepairCommandInput, d as OptimizeCommandDependencies, f as OptimizeCommandInput, g as GenerateCommandInput, h as GenerateCommandDependencies, l as parseRepairCommand, m as runOptimizeCommand, p as parseOptimizeCommand, r as nodeAuditDependencies, s as RepairCommandDependencies, u as runRepairCommand, v as ReviewIO, w as parseAuditCommand, x as runGenerateCommand, y as nodeGenerateDependencies } from "./index-CBFNkZgR.mjs";
|
|
2
|
+
import { CheckDeterminismOptions, DeterminismResult, FinalizeRunnerExecutionOptions, InputContractOptions, RunSuiteOptions, RunnerExecution, RunnerReport, SpecFinding, SpecFindingsResult, SuiteValidationIssue, SuiteValidationResult, TestSuiteSpec } from "@mcpeak/runner";
|
|
3
3
|
import { McpHttpConnection, McpStdioConnection } from "@mcpeak/core";
|
|
4
4
|
import "@mcpeak/record/external";
|
|
5
|
+
//#region src/auto-review-io.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* `generate` 의 승인 질문에 정해진 정책으로 답하는 ReviewIO.
|
|
8
|
+
*
|
|
9
|
+
* 사람용 승인 화면(전송·시험 실행·재검증·저장 확인, 실패 분류, 교정 값 입력)을 에이전트나
|
|
10
|
+
* 대시보드의 "한 번에 검증" 이 사람 개입 없이 지나가게 한다. 판정 로직은 없다. 질문마다 어떤
|
|
11
|
+
* 답을 고르는지만 여기 있고, 고른 답은 `sink` 에 한 줄씩 남겨 무엇이 자동으로 결정됐는지
|
|
12
|
+
* 화면에서 읽을 수 있게 한다.
|
|
13
|
+
*
|
|
14
|
+
* 정책:
|
|
15
|
+
* - 검토 메뉴: 처음은 `save`, 그 뒤는 `cancel`. 저장이 되돌아오면(재검증 실패 등) 같은 답을
|
|
16
|
+
* 되풀이하지 않고 끝낸다.
|
|
17
|
+
* - 확인: 전부 예. 단 "그래도 적용합니까" 처럼 선언 위반이 남은 후보의 적용은 아니오.
|
|
18
|
+
* - 실패 분류(`선택: `): `s`(서버 결함). 교정 뒤에도 남은 실패는 명세가 옳고 서버가 틀린 것으로
|
|
19
|
+
* 기록한다. 보류(`?`)는 저장을 막으므로 쓰지 않는다.
|
|
20
|
+
* - 교정 값 입력(`엔터 = …`): 빈 문자열. 제안이 있으면 제안 값, 없으면 현재 값을 그대로 둔다.
|
|
21
|
+
* - 그 밖의 입력: 빈 문자열. 저장 경로에서는 나오지 않는다.
|
|
22
|
+
*/
|
|
23
|
+
interface AutoReviewIO extends ReviewIO {
|
|
24
|
+
/**
|
|
25
|
+
* 검토 메뉴에 두 번째로 닿아 `cancel` 로 끝냈는가. 저장이 되돌아왔다는 뜻이고, 그때 generate
|
|
26
|
+
* 는 저장 없이 0 을 돌려준다. 호출자는 이 값으로 "저장 성공" 과 "취소" 를 가른다.
|
|
27
|
+
*/
|
|
28
|
+
readonly cancelled: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare function autoReviewIO(sink: {
|
|
31
|
+
write(text: string): void;
|
|
32
|
+
}): AutoReviewIO;
|
|
33
|
+
//#endregion
|
|
5
34
|
//#region src/test-command.d.ts
|
|
6
35
|
interface TestCommandInput {
|
|
7
36
|
readonly suitePath: string;
|
|
@@ -63,8 +92,13 @@ interface TestCommandDependencies {
|
|
|
63
92
|
readEnv?(name: string): string | undefined;
|
|
64
93
|
startRunner(options: RunSuiteOptions): RunnerExecution;
|
|
65
94
|
finalize(options: FinalizeRunnerExecutionOptions): Promise<RunnerReport>;
|
|
95
|
+
/**
|
|
96
|
+
* `specApproved` 는 명세에 approval 블록이 있는지다. 거절 근거 미확인 고지가 generate 승인
|
|
97
|
+
* 화면을 가리킬지 `--json` 의 rejectionBody 를 가리킬지 가른다. 설계 문서(경쟁 도구 비교) §3.4.
|
|
98
|
+
*/
|
|
66
99
|
renderReport(report: RunnerReport, options?: {
|
|
67
100
|
color?: boolean;
|
|
101
|
+
specApproved?: boolean;
|
|
68
102
|
}): string;
|
|
69
103
|
/**
|
|
70
104
|
* runner 의 `renderJUnit`. 두 번째 인자를 선언하지 않는다 — CLI 는 `suiteName` 을 넘길 이유가
|
|
@@ -79,6 +113,11 @@ interface TestCommandDependencies {
|
|
|
79
113
|
*/
|
|
80
114
|
checkInputContract?(options: InputContractOptions): SpecFindingsResult;
|
|
81
115
|
checkAssertionSubstance?(suite: TestSuiteSpec): SpecFindingsResult;
|
|
116
|
+
/**
|
|
117
|
+
* 거절 기대 케이스에서 억제된 선언 위반. 위 두 필드와 같은 이유로 선택 사항이다. 생략하면
|
|
118
|
+
* `runner` 의 `acceptedViolations` 다. 설계 문서(경쟁 도구 비교) §3.2.
|
|
119
|
+
*/
|
|
120
|
+
acceptedViolations?(options: InputContractOptions): ReadonlyMap<string, readonly SpecFinding[]>;
|
|
82
121
|
/**
|
|
83
122
|
* 결정론성 비교와 초기화 명령의 주입 지점. 위 두 필드와 같은 이유로 선택 사항이다.
|
|
84
123
|
* 생략하면 각각 `runner` 의 `checkDeterminism` 과 `reset-hook.ts` 의 `runResetCommand` 다.
|
|
@@ -102,4 +141,4 @@ declare function parseTestCommand(argv: readonly string[]): TestCommandInput;
|
|
|
102
141
|
*/
|
|
103
142
|
declare function runCli(argv: readonly string[], dependencies: TestCommandDependencies): Promise<number>;
|
|
104
143
|
//#endregion
|
|
105
|
-
export { type CliErrorCode, type CliFailure, type GenerateCommandDependencies, type GenerateCommandInput, REVIEW_BACK_VALUE, type RepairCommandDependencies, type RepairCommandInput, type ReviewIO, type TestCommandDependencies, type TestCommandInput, nodeGenerateDependencies, nodeReviewIO, parseRepairCommand, parseTestCommand, runCli, runGenerateCommand, runRepairCommand };
|
|
144
|
+
export { type AuditCommandDependencies, type AuditCommandInput, type AutoReviewIO, type CliErrorCode, type CliFailure, type GenerateCommandDependencies, type GenerateCommandInput, type OptimizeCommandDependencies, type OptimizeCommandInput, REVIEW_BACK_VALUE, type RepairCommandDependencies, type RepairCommandInput, type ReviewIO, type TestCommandDependencies, type TestCommandInput, autoReviewIO, nodeAuditDependencies, nodeGenerateDependencies, nodeReviewIO, parseAuditCommand, parseOptimizeCommand, parseRepairCommand, parseTestCommand, runAuditCommand, runCli, runGenerateCommand, runOptimizeCommand, runRepairCommand };
|
package/dist/commands.mjs
CHANGED
|
@@ -1,2 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { _ as runCli, c as parseOptimizeCommand, d as nodeGenerateDependencies, f as nodeReviewIO, g as parseTestCommand, h as runAuditCommand, l as runOptimizeCommand, m as parseAuditCommand, n as nodeAuditDependencies, o as parseRepairCommand, p as runGenerateCommand, s as runRepairCommand, u as REVIEW_BACK_VALUE } from "./src-CRsYPuu_.mjs";
|
|
2
|
+
//#region src/auto-review-io.ts
|
|
3
|
+
function autoReviewIO(sink) {
|
|
4
|
+
let menuSeen = false;
|
|
5
|
+
let cancelled = false;
|
|
6
|
+
const note = (question, answer) => {
|
|
7
|
+
sink.write(`▸ 자동 승인: ${summarize(question)} → ${answer}\n`);
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
interactive: true,
|
|
11
|
+
get cancelled() {
|
|
12
|
+
return cancelled;
|
|
13
|
+
},
|
|
14
|
+
write: (text) => sink.write(text),
|
|
15
|
+
async choose(message, choices) {
|
|
16
|
+
if (message === "검토 메뉴") {
|
|
17
|
+
const answer = menuSeen ? "cancel" : "save";
|
|
18
|
+
if (menuSeen) cancelled = true;
|
|
19
|
+
menuSeen = true;
|
|
20
|
+
note(message, answer);
|
|
21
|
+
return answer;
|
|
22
|
+
}
|
|
23
|
+
const answer = choices[0] ?? "";
|
|
24
|
+
note(message, answer);
|
|
25
|
+
return answer;
|
|
26
|
+
},
|
|
27
|
+
async confirm(message) {
|
|
28
|
+
const answer = !/그래도 적용합니까/.test(message);
|
|
29
|
+
note(message, answer ? "예" : "아니오");
|
|
30
|
+
return answer;
|
|
31
|
+
},
|
|
32
|
+
async input(message) {
|
|
33
|
+
const answer = /^\s*선택:\s*$/.test(message) ? "s" : "";
|
|
34
|
+
note(message, answer === "" ? "(엔터)" : answer);
|
|
35
|
+
return answer;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** 로그 한 줄에 들어갈 만큼만 남긴다. 질문 본문은 이미 화면에 찍혀 있다. */
|
|
40
|
+
function summarize(question) {
|
|
41
|
+
const oneLine = question.replace(/\s+/g, " ").trim();
|
|
42
|
+
return oneLine.length > 60 ? `${oneLine.slice(0, 57)}...` : oneLine;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { REVIEW_BACK_VALUE, autoReviewIO, nodeAuditDependencies, nodeGenerateDependencies, nodeReviewIO, parseAuditCommand, parseOptimizeCommand, parseRepairCommand, parseTestCommand, runAuditCommand, runCli, runGenerateCommand, runOptimizeCommand, runRepairCommand };
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { AuthoringExecutionSnapshot, AuthoringSessionView, BaselineGenerationResult, FixtureFile, PreFillProvider } from "@mcpeak/generate";
|
|
2
1
|
import { SuiteValidationResult, TestSuiteSpec } from "@mcpeak/runner";
|
|
3
|
-
import { McpHttpConnection, McpStdioConnection, ToolDef } from "@mcpeak/core";
|
|
2
|
+
import { AdvertiseOptions, HttpConnectOptions, McpHttpConnection, McpServerInfo, McpServerSurface, McpStdioConnection, ToolDef } from "@mcpeak/core";
|
|
3
|
+
import { AuthoringExecutionSnapshot, AuthoringSessionView, BaselineGenerationResult, FixtureFile, PreFillProvider } from "@mcpeak/generate";
|
|
4
|
+
import { ProbePolicy, SandboxBackend } from "@mcpeak/audit";
|
|
5
|
+
//#region src/audit-sandbox-target.d.ts
|
|
6
|
+
interface SandboxTargetFs {
|
|
7
|
+
/** 경로가 가리키는 것. 없거나 볼 수 없으면 undefined 다. 던지지 않는다. */
|
|
8
|
+
stat(path: string): Promise<"file" | "directory" | undefined>;
|
|
9
|
+
readFile(path: string): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
4
12
|
//#region src/connect-target.d.ts
|
|
5
13
|
/** 파서가 확정한 연결 대상. */
|
|
6
14
|
type ConnectTarget = {
|
|
@@ -24,6 +32,78 @@ type ConnectTarget = {
|
|
|
24
32
|
readonly headerEnv: Readonly<Record<string, string>>;
|
|
25
33
|
};
|
|
26
34
|
//#endregion
|
|
35
|
+
//#region src/audit-command.d.ts
|
|
36
|
+
/** `--sandbox` 와 그 하위 옵션. 경로는 사용자가 쓴 글자 그대로다. 실행할 때 푼다. */
|
|
37
|
+
interface AuditSandboxInput {
|
|
38
|
+
readonly session?: {
|
|
39
|
+
readonly mode: "record" | "replay";
|
|
40
|
+
readonly path: string;
|
|
41
|
+
};
|
|
42
|
+
/** `--allow-host` 값. 준 순서 그대로다. */
|
|
43
|
+
readonly allowHosts: readonly string[];
|
|
44
|
+
readonly compareHost: boolean;
|
|
45
|
+
/** `--sandbox-mount` 값. */
|
|
46
|
+
readonly mountPath?: string;
|
|
47
|
+
}
|
|
48
|
+
interface AuditCommandInput {
|
|
49
|
+
readonly target: ConnectTarget;
|
|
50
|
+
/** 격리가 켜지지 않은 실행의 호출 정책. 사용자가 주지 않았으면 `readonly` 다. */
|
|
51
|
+
readonly probe: ProbePolicy;
|
|
52
|
+
/**
|
|
53
|
+
* 사용자가 `--probe` 를 직접 주었는가. 격리가 실제로 켜진 실행은 주지 않았을 때만 `all` 로 돈다
|
|
54
|
+
* (ADR-0107). 준 값은 어느 쪽에서도 그대로다.
|
|
55
|
+
*/
|
|
56
|
+
readonly probeExplicit: boolean;
|
|
57
|
+
readonly baselinePath?: string;
|
|
58
|
+
readonly updateBaseline: boolean;
|
|
59
|
+
readonly json: boolean;
|
|
60
|
+
/** `--sandbox` 를 준 실행에만 있다. */
|
|
61
|
+
readonly sandbox?: AuditSandboxInput;
|
|
62
|
+
}
|
|
63
|
+
/** `--sandbox` 실행에만 쓰는 의존성. 호스트의 파일 시스템과 Docker 를 만지는 유일한 통로다. */
|
|
64
|
+
interface AuditSandboxDependencies {
|
|
65
|
+
/**
|
|
66
|
+
* 격리 백엔드를 만든다. `--sandbox` 를 준 실행에서만 불린다. `progress` 는 백엔드의 진행 문장
|
|
67
|
+
* (이미지를 처음 만들 때의 한 줄)을 받는다.
|
|
68
|
+
*/
|
|
69
|
+
createBackend(progress: (line: string) => void): SandboxBackend;
|
|
70
|
+
stat: SandboxTargetFs["stat"];
|
|
71
|
+
/** 서버 인자의 상대 경로를 푸는 기준이자 서버의 작업 디렉터리. */
|
|
72
|
+
readonly cwd: string;
|
|
73
|
+
/** 사용자 홈 디렉터리. 마운트 범위가 이것이면 거절한다. */
|
|
74
|
+
readonly home: string;
|
|
75
|
+
}
|
|
76
|
+
/** 감사가 쓰는 연결. core 의 connectStdio·connectHttp 반환이 이 꼴이다. */
|
|
77
|
+
type StdioAuditConnection = McpStdioConnection & McpServerInfo & McpServerSurface;
|
|
78
|
+
type HttpAuditConnection = McpHttpConnection & McpServerInfo & McpServerSurface;
|
|
79
|
+
interface AuditCommandDependencies {
|
|
80
|
+
connectStdio(options: {
|
|
81
|
+
command: string;
|
|
82
|
+
args: readonly string[];
|
|
83
|
+
env?: Readonly<Record<string, string>>;
|
|
84
|
+
advertise?: AdvertiseOptions;
|
|
85
|
+
connectTimeoutMs?: number;
|
|
86
|
+
}): Promise<StdioAuditConnection>;
|
|
87
|
+
connectHttp(options: HttpConnectOptions): Promise<HttpAuditConnection>;
|
|
88
|
+
/** `--env`·`--header-env` 가 가리키는 환경변수를 읽는 유일한 지점이다. */
|
|
89
|
+
readEnv(name: string): string | undefined;
|
|
90
|
+
/** 기준 파일을 읽는다. 없으면 `code: "ENOENT"` 인 오류를 던진다(node:fs 그대로). */
|
|
91
|
+
readFile(path: string): Promise<string>;
|
|
92
|
+
writeFile(path: string, text: string): Promise<void>;
|
|
93
|
+
readonly audit: typeof import("@mcpeak/audit").audit;
|
|
94
|
+
readonly renderReport: typeof import("@mcpeak/audit").renderReport;
|
|
95
|
+
/** 리포트의 `generator.version`. `@mcpeak/audit` 의 패키지 버전이다. */
|
|
96
|
+
readonly generatorVersion: string;
|
|
97
|
+
writeStdout(text: string): void;
|
|
98
|
+
writeStderr(text: string): void;
|
|
99
|
+
readonly fetch: typeof globalThis.fetch;
|
|
100
|
+
/** 카나리 값 하나. 16자 소문자 hex 이고 호출마다 다르다. */
|
|
101
|
+
random(): string;
|
|
102
|
+
readonly sandbox: AuditSandboxDependencies;
|
|
103
|
+
}
|
|
104
|
+
declare function parseAuditCommand(argv: readonly string[]): AuditCommandInput;
|
|
105
|
+
declare function runAuditCommand(argv: readonly string[], deps: AuditCommandDependencies): Promise<number>;
|
|
106
|
+
//#endregion
|
|
27
107
|
//#region src/reset-hook.d.ts
|
|
28
108
|
/**
|
|
29
109
|
* 초기화가 실제로 무엇을 했는가. `--reset-cmd` 가 0 으로 끝난 것을 "초기 상태" 라고
|
|
@@ -194,6 +274,35 @@ declare function runGenerateCommand(argv: readonly string[], deps: GenerateComma
|
|
|
194
274
|
declare const nodeGenerateDependencies: () => Omit<GenerateCommandDependencies, "connect" | "createBaselineSuite" | "createAuthoringSession" | "finalizeAuthoringDraft" | "getAuthoringExecutionSuite" | "validateSuite">;
|
|
195
275
|
declare function nodeReviewIO(input?: NodeJS.ReadableStream, output?: NodeJS.WritableStream): ReviewIO;
|
|
196
276
|
//#endregion
|
|
277
|
+
//#region src/optimize-command.d.ts
|
|
278
|
+
interface OptimizeCommandInput {
|
|
279
|
+
readonly outPath: string;
|
|
280
|
+
readonly target: ConnectTarget;
|
|
281
|
+
readonly json: boolean;
|
|
282
|
+
}
|
|
283
|
+
interface OptimizeCommandDependencies {
|
|
284
|
+
/**
|
|
285
|
+
* 반환에 `McpServerInfo` 가 실려 있어야 한다. `instructions` 와 광고한 능력 키가 오버레이의
|
|
286
|
+
* 입력이기 때문이다. `core.connectStdio` 가 그 모양이다.
|
|
287
|
+
*/
|
|
288
|
+
connectStdio(options: {
|
|
289
|
+
command: string;
|
|
290
|
+
args: readonly string[];
|
|
291
|
+
env?: Readonly<Record<string, string>>;
|
|
292
|
+
}): Promise<McpStdioConnection & McpServerInfo>;
|
|
293
|
+
connectHttp?(options: HttpConnectOptions): Promise<McpHttpConnection & McpServerInfo>;
|
|
294
|
+
readEnv?(name: string): string | undefined;
|
|
295
|
+
readonly optimize: typeof import("@mcpeak/optimize").optimize;
|
|
296
|
+
readonly renderReport: typeof import("@mcpeak/optimize").renderReport;
|
|
297
|
+
/** 오버레이의 `generator.version`. `@mcpeak/optimize` 의 패키지 버전이다. */
|
|
298
|
+
readonly generatorVersion: string;
|
|
299
|
+
writeFile(path: string, text: string): Promise<void>;
|
|
300
|
+
writeStdout(text: string): void;
|
|
301
|
+
writeStderr(text: string): void;
|
|
302
|
+
}
|
|
303
|
+
declare function parseOptimizeCommand(argv: readonly string[]): OptimizeCommandInput;
|
|
304
|
+
declare function runOptimizeCommand(argv: readonly string[], deps: OptimizeCommandDependencies): Promise<number>;
|
|
305
|
+
//#endregion
|
|
197
306
|
//#region src/repair-command.d.ts
|
|
198
307
|
interface RepairCommandInput {
|
|
199
308
|
readonly bundlePath: string;
|
|
@@ -225,4 +334,39 @@ interface RepairCommandDependencies {
|
|
|
225
334
|
declare function parseRepairCommand(argv: readonly string[]): RepairCommandInput;
|
|
226
335
|
declare function runRepairCommand(argv: readonly string[], deps: RepairCommandDependencies): Promise<number>;
|
|
227
336
|
//#endregion
|
|
228
|
-
|
|
337
|
+
//#region src/index.d.ts
|
|
338
|
+
type Command = (argv: string[]) => Promise<number>;
|
|
339
|
+
declare const COMMANDS: readonly ["test", "generate", "repair", "record", "mock", "optimize", "audit"];
|
|
340
|
+
/**
|
|
341
|
+
* `repair` 실행 의존성. 함수로 빼 둔 이유는 **주입 자체를 테스트가 단언할 수 있게** 하기
|
|
342
|
+
* 위해서다. 분기 안에 리터럴로 두면 `reviewIO` 를 빠뜨려도 아무 테스트도 안 깨진다.
|
|
343
|
+
* 실제로 그렇게 한 번 빠뜨렸다(T10 보고서).
|
|
344
|
+
*
|
|
345
|
+
* 대화형 판정은 `generate` 와 같은 기준이다. 같은 `nodeReviewIO()` 를 쓰고, 그 구현이
|
|
346
|
+
* stdin·stdout 이 둘 다 TTY 일 때만 `interactive` 를 참으로 만든다.
|
|
347
|
+
*/
|
|
348
|
+
declare function nodeRepairDependencies(generate: typeof import("@mcpeak/generate")): RepairCommandDependencies;
|
|
349
|
+
/**
|
|
350
|
+
* `optimize` 실행 의존성. `nodeRepairDependencies` 와 같은 이유로 함수로 뺀다. 주입 자체를
|
|
351
|
+
* 테스트가 단언할 수 있어야 `connectHttp` 나 `readEnv` 를 빠뜨린 배선이 초록으로 남지 않는다.
|
|
352
|
+
*
|
|
353
|
+
* `generatorVersion` 은 오버레이의 `generator` 가 `@mcpeak/optimize` 이므로 그 패키지의 버전이다.
|
|
354
|
+
* 그 패키지의 `exports` 가 `package.json` 을 열지 않아 상대 경로로 읽는다. 빌드가 값으로 싣고,
|
|
355
|
+
* 릴리스는 `changeset version` 뒤에 빌드하므로 발행되는 두 패키지의 버전이 맞는다.
|
|
356
|
+
*/
|
|
357
|
+
declare function nodeOptimizeDependencies(core: typeof import("@mcpeak/core"), optimize: typeof import("@mcpeak/optimize")): OptimizeCommandDependencies;
|
|
358
|
+
/**
|
|
359
|
+
* `audit` 실행 의존성. `nodeOptimizeDependencies` 와 같은 이유로 함수로 뺀다. 주입 자체를 테스트가
|
|
360
|
+
* 단언할 수 있어야 `connectHttp`·`readEnv`·`fetch` 를 빠뜨린 배선이 초록으로 남지 않는다.
|
|
361
|
+
*
|
|
362
|
+
* `random` 은 카나리 값이다. 출력에 쓰지 않으므로 무작위여도 `--json` 의 바이트 결정론을 깨지
|
|
363
|
+
* 않는다. 서버가 값을 예측해 숨길 수 없게 암호학적 난수를 쓴다. `generatorVersion` 은 리포트의
|
|
364
|
+
* `generator` 가 `@mcpeak/audit` 이므로 그 패키지의 버전이고, 읽는 방식은 optimize 와 같다.
|
|
365
|
+
*
|
|
366
|
+
* `sandbox.createBackend` 는 `--sandbox` 를 준 실행에서만 불린다. 그 밖의 실행은 Docker 를 찾지도
|
|
367
|
+
* 부르지도 않는다.
|
|
368
|
+
*/
|
|
369
|
+
declare function nodeAuditDependencies(core: typeof import("@mcpeak/core"), audit: typeof import("@mcpeak/audit")): AuditCommandDependencies;
|
|
370
|
+
declare function run(argv: string[]): Promise<number>;
|
|
371
|
+
//#endregion
|
|
372
|
+
export { AuditCommandInput as C, ConnectTarget as E, AuditCommandDependencies as S, runAuditCommand as T, REVIEW_BACK_VALUE as _, nodeRepairDependencies as a, nodeReviewIO as b, RepairCommandInput as c, OptimizeCommandDependencies as d, OptimizeCommandInput as f, GenerateCommandInput as g, GenerateCommandDependencies as h, nodeOptimizeDependencies as i, parseRepairCommand as l, runOptimizeCommand as m, Command as n, run as o, parseOptimizeCommand as p, nodeAuditDependencies as r, RepairCommandDependencies as s, COMMANDS as t, runRepairCommand as u, ReviewIO as v, parseAuditCommand as w, runGenerateCommand as x, nodeGenerateDependencies as y };
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProbePolicy, SandboxBackend } from "@mcpeak/audit";
|
|
2
|
+
import { AdvertiseOptions, HttpConnectOptions, McpHttpConnection, McpServerInfo, McpServerSurface, McpStdioConnection, ToolDef } from "@mcpeak/core";
|
|
2
3
|
import { AuthoringExecutionSnapshot, AuthoringSessionView, BaselineGenerationResult, FixtureFile, PreFillProvider } from "@mcpeak/generate";
|
|
3
4
|
import { SuiteValidationResult, TestSuiteSpec } from "@mcpeak/runner";
|
|
5
|
+
//#region src/audit-sandbox-target.d.ts
|
|
6
|
+
interface SandboxTargetFs {
|
|
7
|
+
/** 경로가 가리키는 것. 없거나 볼 수 없으면 undefined 다. 던지지 않는다. */
|
|
8
|
+
stat(path: string): Promise<"file" | "directory" | undefined>;
|
|
9
|
+
readFile(path: string): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
4
12
|
//#region src/connect-target.d.ts
|
|
5
13
|
/** 파서가 확정한 연결 대상. */
|
|
6
14
|
type ConnectTarget = {
|
|
@@ -24,6 +32,78 @@ type ConnectTarget = {
|
|
|
24
32
|
readonly headerEnv: Readonly<Record<string, string>>;
|
|
25
33
|
};
|
|
26
34
|
//#endregion
|
|
35
|
+
//#region src/audit-command.d.ts
|
|
36
|
+
/** `--sandbox` 와 그 하위 옵션. 경로는 사용자가 쓴 글자 그대로다. 실행할 때 푼다. */
|
|
37
|
+
interface AuditSandboxInput {
|
|
38
|
+
readonly session?: {
|
|
39
|
+
readonly mode: "record" | "replay";
|
|
40
|
+
readonly path: string;
|
|
41
|
+
};
|
|
42
|
+
/** `--allow-host` 값. 준 순서 그대로다. */
|
|
43
|
+
readonly allowHosts: readonly string[];
|
|
44
|
+
readonly compareHost: boolean;
|
|
45
|
+
/** `--sandbox-mount` 값. */
|
|
46
|
+
readonly mountPath?: string;
|
|
47
|
+
}
|
|
48
|
+
interface AuditCommandInput {
|
|
49
|
+
readonly target: ConnectTarget;
|
|
50
|
+
/** 격리가 켜지지 않은 실행의 호출 정책. 사용자가 주지 않았으면 `readonly` 다. */
|
|
51
|
+
readonly probe: ProbePolicy;
|
|
52
|
+
/**
|
|
53
|
+
* 사용자가 `--probe` 를 직접 주었는가. 격리가 실제로 켜진 실행은 주지 않았을 때만 `all` 로 돈다
|
|
54
|
+
* (ADR-0107). 준 값은 어느 쪽에서도 그대로다.
|
|
55
|
+
*/
|
|
56
|
+
readonly probeExplicit: boolean;
|
|
57
|
+
readonly baselinePath?: string;
|
|
58
|
+
readonly updateBaseline: boolean;
|
|
59
|
+
readonly json: boolean;
|
|
60
|
+
/** `--sandbox` 를 준 실행에만 있다. */
|
|
61
|
+
readonly sandbox?: AuditSandboxInput;
|
|
62
|
+
}
|
|
63
|
+
/** `--sandbox` 실행에만 쓰는 의존성. 호스트의 파일 시스템과 Docker 를 만지는 유일한 통로다. */
|
|
64
|
+
interface AuditSandboxDependencies {
|
|
65
|
+
/**
|
|
66
|
+
* 격리 백엔드를 만든다. `--sandbox` 를 준 실행에서만 불린다. `progress` 는 백엔드의 진행 문장
|
|
67
|
+
* (이미지를 처음 만들 때의 한 줄)을 받는다.
|
|
68
|
+
*/
|
|
69
|
+
createBackend(progress: (line: string) => void): SandboxBackend;
|
|
70
|
+
stat: SandboxTargetFs["stat"];
|
|
71
|
+
/** 서버 인자의 상대 경로를 푸는 기준이자 서버의 작업 디렉터리. */
|
|
72
|
+
readonly cwd: string;
|
|
73
|
+
/** 사용자 홈 디렉터리. 마운트 범위가 이것이면 거절한다. */
|
|
74
|
+
readonly home: string;
|
|
75
|
+
}
|
|
76
|
+
/** 감사가 쓰는 연결. core 의 connectStdio·connectHttp 반환이 이 꼴이다. */
|
|
77
|
+
type StdioAuditConnection = McpStdioConnection & McpServerInfo & McpServerSurface;
|
|
78
|
+
type HttpAuditConnection = McpHttpConnection & McpServerInfo & McpServerSurface;
|
|
79
|
+
interface AuditCommandDependencies {
|
|
80
|
+
connectStdio(options: {
|
|
81
|
+
command: string;
|
|
82
|
+
args: readonly string[];
|
|
83
|
+
env?: Readonly<Record<string, string>>;
|
|
84
|
+
advertise?: AdvertiseOptions;
|
|
85
|
+
connectTimeoutMs?: number;
|
|
86
|
+
}): Promise<StdioAuditConnection>;
|
|
87
|
+
connectHttp(options: HttpConnectOptions): Promise<HttpAuditConnection>;
|
|
88
|
+
/** `--env`·`--header-env` 가 가리키는 환경변수를 읽는 유일한 지점이다. */
|
|
89
|
+
readEnv(name: string): string | undefined;
|
|
90
|
+
/** 기준 파일을 읽는다. 없으면 `code: "ENOENT"` 인 오류를 던진다(node:fs 그대로). */
|
|
91
|
+
readFile(path: string): Promise<string>;
|
|
92
|
+
writeFile(path: string, text: string): Promise<void>;
|
|
93
|
+
readonly audit: typeof import("@mcpeak/audit").audit;
|
|
94
|
+
readonly renderReport: typeof import("@mcpeak/audit").renderReport;
|
|
95
|
+
/** 리포트의 `generator.version`. `@mcpeak/audit` 의 패키지 버전이다. */
|
|
96
|
+
readonly generatorVersion: string;
|
|
97
|
+
writeStdout(text: string): void;
|
|
98
|
+
writeStderr(text: string): void;
|
|
99
|
+
readonly fetch: typeof globalThis.fetch;
|
|
100
|
+
/** 카나리 값 하나. 16자 소문자 hex 이고 호출마다 다르다. */
|
|
101
|
+
random(): string;
|
|
102
|
+
readonly sandbox: AuditSandboxDependencies;
|
|
103
|
+
}
|
|
104
|
+
declare function parseAuditCommand(argv: readonly string[]): AuditCommandInput;
|
|
105
|
+
declare function runAuditCommand(argv: readonly string[], deps: AuditCommandDependencies): Promise<number>;
|
|
106
|
+
//#endregion
|
|
27
107
|
//#region src/reset-hook.d.ts
|
|
28
108
|
/**
|
|
29
109
|
* 초기화가 실제로 무엇을 했는가. `--reset-cmd` 가 0 으로 끝난 것을 "초기 상태" 라고
|
|
@@ -194,6 +274,35 @@ declare function runGenerateCommand(argv: readonly string[], deps: GenerateComma
|
|
|
194
274
|
declare const nodeGenerateDependencies: () => Omit<GenerateCommandDependencies, "connect" | "createBaselineSuite" | "createAuthoringSession" | "finalizeAuthoringDraft" | "getAuthoringExecutionSuite" | "validateSuite">;
|
|
195
275
|
declare function nodeReviewIO(input?: NodeJS.ReadableStream, output?: NodeJS.WritableStream): ReviewIO;
|
|
196
276
|
//#endregion
|
|
277
|
+
//#region src/optimize-command.d.ts
|
|
278
|
+
interface OptimizeCommandInput {
|
|
279
|
+
readonly outPath: string;
|
|
280
|
+
readonly target: ConnectTarget;
|
|
281
|
+
readonly json: boolean;
|
|
282
|
+
}
|
|
283
|
+
interface OptimizeCommandDependencies {
|
|
284
|
+
/**
|
|
285
|
+
* 반환에 `McpServerInfo` 가 실려 있어야 한다. `instructions` 와 광고한 능력 키가 오버레이의
|
|
286
|
+
* 입력이기 때문이다. `core.connectStdio` 가 그 모양이다.
|
|
287
|
+
*/
|
|
288
|
+
connectStdio(options: {
|
|
289
|
+
command: string;
|
|
290
|
+
args: readonly string[];
|
|
291
|
+
env?: Readonly<Record<string, string>>;
|
|
292
|
+
}): Promise<McpStdioConnection & McpServerInfo>;
|
|
293
|
+
connectHttp?(options: HttpConnectOptions): Promise<McpHttpConnection & McpServerInfo>;
|
|
294
|
+
readEnv?(name: string): string | undefined;
|
|
295
|
+
readonly optimize: typeof import("@mcpeak/optimize").optimize;
|
|
296
|
+
readonly renderReport: typeof import("@mcpeak/optimize").renderReport;
|
|
297
|
+
/** 오버레이의 `generator.version`. `@mcpeak/optimize` 의 패키지 버전이다. */
|
|
298
|
+
readonly generatorVersion: string;
|
|
299
|
+
writeFile(path: string, text: string): Promise<void>;
|
|
300
|
+
writeStdout(text: string): void;
|
|
301
|
+
writeStderr(text: string): void;
|
|
302
|
+
}
|
|
303
|
+
declare function parseOptimizeCommand(argv: readonly string[]): OptimizeCommandInput;
|
|
304
|
+
declare function runOptimizeCommand(argv: readonly string[], deps: OptimizeCommandDependencies): Promise<number>;
|
|
305
|
+
//#endregion
|
|
197
306
|
//#region src/repair-command.d.ts
|
|
198
307
|
interface RepairCommandInput {
|
|
199
308
|
readonly bundlePath: string;
|
|
@@ -225,4 +334,39 @@ interface RepairCommandDependencies {
|
|
|
225
334
|
declare function parseRepairCommand(argv: readonly string[]): RepairCommandInput;
|
|
226
335
|
declare function runRepairCommand(argv: readonly string[], deps: RepairCommandDependencies): Promise<number>;
|
|
227
336
|
//#endregion
|
|
228
|
-
|
|
337
|
+
//#region src/index.d.ts
|
|
338
|
+
type Command = (argv: string[]) => Promise<number>;
|
|
339
|
+
declare const COMMANDS: readonly ["test", "generate", "repair", "record", "mock", "optimize", "audit"];
|
|
340
|
+
/**
|
|
341
|
+
* `repair` 실행 의존성. 함수로 빼 둔 이유는 **주입 자체를 테스트가 단언할 수 있게** 하기
|
|
342
|
+
* 위해서다. 분기 안에 리터럴로 두면 `reviewIO` 를 빠뜨려도 아무 테스트도 안 깨진다.
|
|
343
|
+
* 실제로 그렇게 한 번 빠뜨렸다(T10 보고서).
|
|
344
|
+
*
|
|
345
|
+
* 대화형 판정은 `generate` 와 같은 기준이다. 같은 `nodeReviewIO()` 를 쓰고, 그 구현이
|
|
346
|
+
* stdin·stdout 이 둘 다 TTY 일 때만 `interactive` 를 참으로 만든다.
|
|
347
|
+
*/
|
|
348
|
+
declare function nodeRepairDependencies(generate: typeof import("@mcpeak/generate")): RepairCommandDependencies;
|
|
349
|
+
/**
|
|
350
|
+
* `optimize` 실행 의존성. `nodeRepairDependencies` 와 같은 이유로 함수로 뺀다. 주입 자체를
|
|
351
|
+
* 테스트가 단언할 수 있어야 `connectHttp` 나 `readEnv` 를 빠뜨린 배선이 초록으로 남지 않는다.
|
|
352
|
+
*
|
|
353
|
+
* `generatorVersion` 은 오버레이의 `generator` 가 `@mcpeak/optimize` 이므로 그 패키지의 버전이다.
|
|
354
|
+
* 그 패키지의 `exports` 가 `package.json` 을 열지 않아 상대 경로로 읽는다. 빌드가 값으로 싣고,
|
|
355
|
+
* 릴리스는 `changeset version` 뒤에 빌드하므로 발행되는 두 패키지의 버전이 맞는다.
|
|
356
|
+
*/
|
|
357
|
+
declare function nodeOptimizeDependencies(core: typeof import("@mcpeak/core"), optimize: typeof import("@mcpeak/optimize")): OptimizeCommandDependencies;
|
|
358
|
+
/**
|
|
359
|
+
* `audit` 실행 의존성. `nodeOptimizeDependencies` 와 같은 이유로 함수로 뺀다. 주입 자체를 테스트가
|
|
360
|
+
* 단언할 수 있어야 `connectHttp`·`readEnv`·`fetch` 를 빠뜨린 배선이 초록으로 남지 않는다.
|
|
361
|
+
*
|
|
362
|
+
* `random` 은 카나리 값이다. 출력에 쓰지 않으므로 무작위여도 `--json` 의 바이트 결정론을 깨지
|
|
363
|
+
* 않는다. 서버가 값을 예측해 숨길 수 없게 암호학적 난수를 쓴다. `generatorVersion` 은 리포트의
|
|
364
|
+
* `generator` 가 `@mcpeak/audit` 이므로 그 패키지의 버전이고, 읽는 방식은 optimize 와 같다.
|
|
365
|
+
*
|
|
366
|
+
* `sandbox.createBackend` 는 `--sandbox` 를 준 실행에서만 불린다. 그 밖의 실행은 Docker 를 찾지도
|
|
367
|
+
* 부르지도 않는다.
|
|
368
|
+
*/
|
|
369
|
+
declare function nodeAuditDependencies(core: typeof import("@mcpeak/core"), audit: typeof import("@mcpeak/audit")): AuditCommandDependencies;
|
|
370
|
+
declare function run(argv: string[]): Promise<number>;
|
|
371
|
+
//#endregion
|
|
372
|
+
export { AuditCommandInput as C, ConnectTarget as E, AuditCommandDependencies as S, runAuditCommand as T, REVIEW_BACK_VALUE as _, nodeRepairDependencies as a, nodeReviewIO as b, RepairCommandInput as c, OptimizeCommandDependencies as d, OptimizeCommandInput as f, GenerateCommandInput as g, GenerateCommandDependencies as h, nodeOptimizeDependencies as i, parseRepairCommand as l, runOptimizeCommand as m, Command as n, run as o, parseOptimizeCommand as p, nodeAuditDependencies as r, RepairCommandDependencies as s, COMMANDS as t, runRepairCommand as u, ReviewIO as v, parseAuditCommand as w, runGenerateCommand as x, nodeGenerateDependencies as y };
|