@eliceio/cdk-cli 0.1.0-alpha.3 → 0.1.0-alpha.5

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.
Files changed (120) hide show
  1. package/README.md +288 -200
  2. package/es/cli.js +70 -66
  3. package/es/commands/build/index.d.ts +1 -1
  4. package/es/commands/build/index.js +27 -15
  5. package/es/commands/create/index.d.ts +5 -1
  6. package/es/commands/create/index.js +34 -15
  7. package/es/commands/create/install.d.ts +17 -0
  8. package/es/commands/create/install.js +53 -0
  9. package/es/commands/create/scaffold.d.ts +4 -1
  10. package/es/commands/create/scaffold.js +19 -13
  11. package/es/commands/dev/index.d.ts +1 -1
  12. package/es/commands/dev/index.js +5 -5
  13. package/es/commands/doctor/index.d.ts +29 -2
  14. package/es/commands/doctor/index.js +253 -55
  15. package/es/commands/mcp/index.d.ts +0 -12
  16. package/es/commands/mcp/index.js +6 -57
  17. package/es/commands/setup/index.d.ts +11 -3
  18. package/es/commands/setup/index.js +112 -37
  19. package/es/commands/skill/index.d.ts +46 -8
  20. package/es/commands/skill/index.js +151 -35
  21. package/es/commands/uninstall/index.d.ts +54 -0
  22. package/es/commands/uninstall/index.js +304 -0
  23. package/es/commands/update/index.d.ts +59 -0
  24. package/es/commands/update/index.js +251 -0
  25. package/es/commands/validate/index.d.ts +18 -0
  26. package/es/commands/{check → validate}/index.js +16 -10
  27. package/es/core/collect.d.ts +5 -2
  28. package/es/core/config.d.ts +99 -50
  29. package/es/core/config.js +244 -91
  30. package/es/core/latest.d.ts +21 -0
  31. package/es/core/latest.js +43 -0
  32. package/es/core/manifest.d.ts +2 -1
  33. package/es/core/manifest.js +2 -1
  34. package/es/core/minify.js +2 -2
  35. package/es/core/prepare.d.ts +18 -2
  36. package/es/core/prepare.js +48 -16
  37. package/es/core/project-check.d.ts +19 -8
  38. package/es/core/project-check.js +36 -9
  39. package/es/core/sandbox.js +2 -2
  40. package/es/core/sdk.d.ts +39 -0
  41. package/es/core/sdk.js +95 -0
  42. package/es/core/templates.d.ts +2 -4
  43. package/es/core/templates.js +2 -5
  44. package/es/dev/grading.d.ts +7 -8
  45. package/es/dev/grading.js +6 -16
  46. package/es/dev/host-page.d.ts +1 -1
  47. package/es/dev/host-page.js +12 -10
  48. package/es/dev/mock-api.d.ts +13 -18
  49. package/es/dev/mock-api.js +56 -66
  50. package/es/dev/server.js +52 -52
  51. package/es/rules/check.js +43 -31
  52. package/es/rules/index.d.ts +1 -1
  53. package/es/rules/index.js +1 -1
  54. package/es/rules/manifest.d.ts +28 -20
  55. package/es/rules/manifest.js +58 -55
  56. package/es/rules/types.d.ts +18 -20
  57. package/es/rules.json.js +2 -2
  58. package/es/test-packages.d.ts +7 -0
  59. package/package.json +3 -4
  60. package/rules.json +27 -43
  61. package/skills/_shared/always.md +4 -4
  62. package/skills/elice-content-check/SKILL.md +11 -8
  63. package/skills/elice-content-create/SKILL.md +8 -7
  64. package/skills/elice-content-guide/SKILL.md +42 -0
  65. package/skills/elice-content-guide/topics/00-what-the-person-decides.md +11 -0
  66. package/skills/elice-content-guide/topics/01-check-the-environment.md +10 -0
  67. package/skills/elice-content-guide/topics/02-design-the-material.md +35 -0
  68. package/skills/elice-content-guide/topics/03-create-the-project.md +22 -0
  69. package/skills/elice-content-guide/topics/04-rules.md +12 -0
  70. package/skills/elice-content-guide/topics/05-screen-code.md +101 -0
  71. package/skills/elice-content-guide/topics/06-using-the-quiz-template.md +22 -0
  72. package/skills/elice-content-guide/topics/07-move-existing-html.md +10 -0
  73. package/skills/elice-content-guide/topics/08-fix-check-errors.md +24 -0
  74. package/skills/elice-content-guide/topics/09-check.md +10 -0
  75. package/skills/elice-content-guide/topics/10-build.md +8 -0
  76. package/skills/elice-content-guide/topics/11-more.md +4 -0
  77. package/skills/elice-content-guide/topics/12-upload-with-the-material-mcp.md +41 -0
  78. package/skills/elice-content-migrate/SKILL.md +8 -7
  79. package/skills/elice-content-publish/SKILL.md +8 -7
  80. package/templates/_shared/lib/cdk-mock.d.ts +5 -13
  81. package/templates/_shared/lib/cdk-mock.js +49 -144
  82. package/templates/_shared/lib/elice-content.css +68 -1
  83. package/templates/_shared/lib/elice-content.d.ts +11 -38
  84. package/templates/_shared/lib/elice-content.js +43 -248
  85. package/templates/blank/README.md +12 -10
  86. package/templates/blank/metadata.json +9 -0
  87. package/templates/blank/package.json +13 -0
  88. package/templates/blank/screens/edit.js +1 -1
  89. package/templates/blank/screens/instructor.js +12 -5
  90. package/templates/blank/screens/learn.js +16 -11
  91. package/templates/blank/template.json +2 -2
  92. package/templates/quiz/README.md +15 -12
  93. package/templates/quiz/core/behaviors.js +4 -1
  94. package/templates/quiz/core/editor.d.ts +21 -10
  95. package/templates/quiz/core/editor.js +44 -31
  96. package/templates/quiz/core/model.d.ts +14 -0
  97. package/templates/quiz/core/model.js +76 -4
  98. package/templates/quiz/metadata.json +9 -0
  99. package/templates/quiz/package.json +13 -0
  100. package/templates/quiz/screens/edit.js +101 -34
  101. package/templates/quiz/screens/instructor.js +18 -12
  102. package/templates/quiz/screens/learn.js +45 -36
  103. package/templates/quiz/styles.css +65 -22
  104. package/templates/quiz/template.json +2 -2
  105. package/templates/quiz/ui/templates/edit.d.ts +1 -0
  106. package/templates/quiz/ui/templates/edit.js +65 -19
  107. package/templates/quiz/ui/templates/group.js +10 -2
  108. package/templates/quiz/ui/texts.js +11 -11
  109. package/es/commands/check/index.d.ts +0 -15
  110. package/es/commands/guide/index.d.ts +0 -29
  111. package/es/commands/guide/index.js +0 -120
  112. package/guides/content-development.md +0 -294
  113. package/templates/_shared/lib/cdk.js +0 -3
  114. package/templates/blank/completion.html +0 -15
  115. package/templates/blank/content.json +0 -4
  116. package/templates/blank/elice.config.json +0 -10
  117. package/templates/blank/screens/completion.js +0 -7
  118. package/templates/quiz/content.json +0 -35
  119. package/templates/quiz/elice.config.json +0 -9
  120. package/templates/quiz/grading.json +0 -4
@@ -0,0 +1,59 @@
1
+ import { type LatestResult } from '../../core/latest.js';
2
+ import type { CommandResult } from '../../types.js';
3
+ export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk update [--check] [--yes] [--json]\n\n npm latest \uD0DC\uADF8\uC758 ecdk\uB85C \uC62C\uB9B0\uB2E4. \uCC28\uB840\uB85C:\n 1. CLI \uC124\uCE58: npm install -g @eliceio/cdk-cli@<latest> (npx\uB85C \uC2E4\uD589 \uC911\uC774\uBA74 \uAC74\uB108\uB700)\n 2. \uC2A4\uD0AC \uAC31\uC2E0: \uC0C8\uB85C \uC124\uCE58\uD55C ecdk\uB85C ecdk setup --only skills (npx\uBA74 npx -y @eliceio/cdk-cli@<latest> setup --only skills)\n \uC190\uC73C\uB85C \uACE0\uCE5C \uC2A4\uD0AC\uC740 \uADF8\uB300\uB85C \uB460, \uBC14\uAFB8\uB824\uBA74 ecdk setup --only skills --force\n 3. \uD504\uB85C\uC81D\uD2B8 SDK: \uD604\uC7AC \uD3F4\uB354\uAC00 @eliceio/cdk\uB97C \uC4F0\uB294 \uD504\uB85C\uC81D\uD2B8\uBA74 npm update @eliceio/cdk (\uD654\uBA74 \u00B7 \uD15C\uD50C\uB9BF \uCF54\uB4DC\uB294 \uBC14\uAFB8\uC9C0 \uC54A\uC74C)\n \uC9C0\uAE08 \uBC84\uC804\uC774 latest\uC640 \uAC19\uAC70\uB098 \uB354 \uC0C8 \uBC84\uC804\uC774\uBA74 \uC544\uBB34\uAC83\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4 (\uB0B4\uB9AC\uC9C0 \uC54A\uC74C).\n --check \uD655\uC778\uB9CC (\uC9C0\uAE08 \u00B7 \uCD5C\uC2E0 \uBC84\uC804\uACFC \uC2E4\uD589\uD560 \uBA85\uB839)\n --yes \uBB3B\uC9C0 \uC54A\uACE0 \uC2E4\uD589 (\uC9C0\uAE08\uC740 \uB298 \uBB3B\uC9C0 \uC54A\uC74C, \uC2A4\uD06C\uB9BD\uD2B8\uC6A9)\n\n\uC885\uB8CC \uCF54\uB4DC: 0 \uCD5C\uC2E0\uC774\uAC70\uB098 \uC5C5\uB370\uC774\uD2B8\uD568 \u00B7 1 \uCD5C\uC2E0 \uBC84\uC804 \uD655\uC778 \uC2E4\uD328 \u00B7 \uB2E8\uACC4 \uC2E4\uD328 \u00B7 2 \uC798\uBABB\uB41C \uC0AC\uC6A9";
4
+ export type StepId = 'cli.install' | 'skill.install' | 'project.sdk';
5
+ export type StepStatus = 'planned' | 'done' | 'warn' | 'skipped' | 'failed' | 'not-run';
6
+ export interface UpdateStep {
7
+ id: StepId;
8
+ status: StepStatus;
9
+ /** 실행한(할) 명령. 없으면 실행하지 않는 단계 */
10
+ command?: string | undefined;
11
+ message?: string | undefined;
12
+ }
13
+ export interface UpdateResult {
14
+ ok: boolean;
15
+ current: string;
16
+ /** npm latest. 확인하지 못하면 null */
17
+ latest: string | null;
18
+ upToDate: boolean;
19
+ /** npx 캐시에서 실행 중 (전역 설치를 건너뜀) */
20
+ npx: boolean;
21
+ steps: UpdateStep[];
22
+ notes: string[];
23
+ /** 스킬 갱신 전에 ~/.claude/skills가 없어 이번에 만듦 (이미 열린 Claude Code 세션은 /reload-skills 한 번) */
24
+ skillsDirCreated: boolean;
25
+ error?: string | undefined;
26
+ }
27
+ export interface RunOutput {
28
+ code: number;
29
+ output: string;
30
+ }
31
+ /** 바깥 세계(npm · 명령 실행 · 현재 폴더)를 바꿔 끼울 수 있게 (테스트는 네트워크 · 전역 설치를 하지 않음) */
32
+ export interface UpdateEnv {
33
+ latest(timeoutMs: number): LatestResult;
34
+ /** 지금 실행 중인 CLI 파일 (npx 캐시면 경로에 _npx가 들어 있음) */
35
+ scriptPath: string;
36
+ cwd: string;
37
+ /** 스킬을 설치할 홈 (없으면 os.homedir(), 테스트는 임시 폴더) */
38
+ home?: string | undefined;
39
+ /** 명령 실행. 출력은 stderr로 흘려 보내고(--json 출력에 섞이지 않게) 같이 돌려준다. quiet면 흘려 보내지 않음 */
40
+ run(command: string, args: string[], opts?: {
41
+ cwd?: string;
42
+ quiet?: boolean;
43
+ }): Promise<RunOutput>;
44
+ /** 진행 줄 (stderr) */
45
+ log(line: string): void;
46
+ }
47
+ export declare function defaultUpdateEnv(): UpdateEnv;
48
+ export declare const isNpx: (scriptPath: string) => boolean;
49
+ /** README "문제 해결 · 설치"의 EACCES 안내와 같은 문구 */
50
+ export declare const PERMISSION_HINT = "`sudo` \uB300\uC2E0 `npx`\uB85C \uC2E4\uD589, \uB610\uB294 fnm \u00B7 Homebrew\uB85C Node.js \uC7AC\uC124\uCE58";
51
+ export declare function update(env: UpdateEnv, opts: {
52
+ check: boolean;
53
+ current?: string | undefined;
54
+ }): Promise<UpdateResult>;
55
+ export declare function formatText(r: UpdateResult, check: boolean): string;
56
+ export declare function run(args: {
57
+ check: boolean;
58
+ json: boolean;
59
+ }, env?: UpdateEnv, current?: string): Promise<CommandResult>;
@@ -0,0 +1,251 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { existsSync } from 'node:fs';
3
+ import { resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { loadConfig } from '../../core/config.js';
6
+ import { CLI_PACKAGE, LATEST_UPDATE_TIMEOUT_MS, isNewer, npmLatest } from '../../core/latest.js';
7
+ import { SDK_PACKAGE, UPDATE_COMMAND, readProjectSdk } from '../../core/sdk.js';
8
+ import { listTemplates } from '../../core/templates.js';
9
+ import { VERSION } from '../../version.js';
10
+ import { templateNotice } from '../doctor/index.js';
11
+ import { skillsDir, reloadNotes } from '../skill/index.js';
12
+
13
+ const usage = `사용법: ecdk update [--check] [--yes] [--json]
14
+
15
+ npm latest 태그의 ecdk로 올린다. 차례로:
16
+ 1. CLI 설치: npm install -g ${CLI_PACKAGE}@<latest> (npx로 실행 중이면 건너뜀)
17
+ 2. 스킬 갱신: 새로 설치한 ecdk로 ecdk setup --only skills (npx면 npx -y ${CLI_PACKAGE}@<latest> setup --only skills)
18
+ 손으로 고친 스킬은 그대로 둠, 바꾸려면 ecdk setup --only skills --force
19
+ 3. 프로젝트 SDK: 현재 폴더가 ${SDK_PACKAGE}를 쓰는 프로젝트면 ${UPDATE_COMMAND} (화면 · 템플릿 코드는 바꾸지 않음)
20
+ 지금 버전이 latest와 같거나 더 새 버전이면 아무것도 하지 않는다 (내리지 않음).
21
+ --check 확인만 (지금 · 최신 버전과 실행할 명령)
22
+ --yes 묻지 않고 실행 (지금은 늘 묻지 않음, 스크립트용)
23
+
24
+ 종료 코드: 0 최신이거나 업데이트함 · 1 최신 버전 확인 실패 · 단계 실패 · 2 잘못된 사용`;
25
+ /** 실행 못 함(명령 없음 등)은 code -1 */
26
+ function runCommand(command, args, opts = {}) {
27
+ return new Promise(done => {
28
+ const child = spawn(command, args, {
29
+ cwd: opts.cwd,
30
+ stdio: ['ignore', 'pipe', 'pipe'],
31
+ shell: process.platform === 'win32'
32
+ });
33
+ let output = '';
34
+ const tee = chunk => {
35
+ output += chunk.toString();
36
+ if (!opts.quiet) process.stderr.write(chunk);
37
+ };
38
+ child.stdout.on('data', tee);
39
+ child.stderr.on('data', tee);
40
+ child.on('error', e => done({
41
+ code: -1,
42
+ output: `${output}${e.message}`
43
+ }));
44
+ child.on('close', code => done({
45
+ code: code ?? 1,
46
+ output
47
+ }));
48
+ });
49
+ }
50
+ function defaultUpdateEnv() {
51
+ return {
52
+ latest: npmLatest,
53
+ scriptPath: fileURLToPath(import.meta.url),
54
+ cwd: process.cwd(),
55
+ run: runCommand,
56
+ log: line => process.stderr.write(`${line}\n`)
57
+ };
58
+ }
59
+ const isNpx = scriptPath => /[\\/]_npx[\\/]/.test(scriptPath);
60
+ const PERMISSION = /\bEACCES\b|\bEPERM\b|permission denied/i;
61
+ /** README "문제 해결 · 설치"의 EACCES 안내와 같은 문구 */
62
+ const PERMISSION_HINT = '`sudo` 대신 `npx`로 실행, 또는 fnm · Homebrew로 Node.js 재설치';
63
+ const HELPY_NOTE = "Helpy Code 데스크톱(macOS)에서 ecdk · npm을 찾지 못하면 로그인 셸로 실행합니다: zsh -ilc 'ecdk update'";
64
+ const cliCommand = latest => `npm install -g ${CLI_PACKAGE}@${latest}`;
65
+ const SKILL_ARGS = ['setup', '--only', 'skills'];
66
+ const SKILL_COMMAND = `ecdk ${SKILL_ARGS.join(' ')}`;
67
+ /**
68
+ * npx로 실행 중이면 이 프로세스(옛 캐시일 수 있음)가 아니라 latest 버전으로 스킬을 설치한다.
69
+ * 옛 ecdk의 update도 새로 설치한 ecdk를 실행하므로 새 명령(setup --only skills)을 써도 된다
70
+ */
71
+ const npxSkillArgs = latest => ['-y', `${CLI_PACKAGE}@${latest}`, ...SKILL_ARGS];
72
+ const skillCommand = (latest, npx) => npx ? ['npx', ...npxSkillArgs(latest)].join(' ') : SKILL_COMMAND;
73
+ /** 프로젝트 SDK 단계: 현재 폴더 package.json에 @eliceio/cdk가 있을 때만 */
74
+ async function projectStep(cwd) {
75
+ if (!(await readProjectSdk(cwd))) return {
76
+ id: 'project.sdk',
77
+ status: 'skipped',
78
+ message: `현재 폴더가 ${SDK_PACKAGE}를 쓰는 프로젝트가 아님`
79
+ };
80
+ return {
81
+ id: 'project.sdk',
82
+ status: 'planned',
83
+ command: UPDATE_COMMAND
84
+ };
85
+ }
86
+ /** 할 일 (아직 실행하지 않음) */
87
+ async function plan(env, latest, npx) {
88
+ return [npx ? {
89
+ id: 'cli.install',
90
+ status: 'skipped',
91
+ message: `npx로 실행 중이라 전역 설치하지 않음 (다음에 npx ${CLI_PACKAGE}@latest로 실행하면 새 버전)`
92
+ } : {
93
+ id: 'cli.install',
94
+ status: 'planned',
95
+ command: cliCommand(latest)
96
+ }, {
97
+ id: 'skill.install',
98
+ status: 'planned',
99
+ command: skillCommand(latest, npx),
100
+ message: npx ? `npx로 ${latest} ecdk를 받아 설치` : '새로 설치한 ecdk로 설치'
101
+ }, await projectStep(env.cwd)];
102
+ }
103
+ /** 새로 설치한 ecdk의 템플릿 목록. 읽지 못하면 undefined (안내만 빠짐) */
104
+ async function installedTemplates(env) {
105
+ const r = await env.run('ecdk', ['create', '--list', '--json'], {
106
+ quiet: true
107
+ });
108
+ if (r.code !== 0) return undefined;
109
+ try {
110
+ return JSON.parse(r.output.slice(r.output.indexOf('{'))).templates;
111
+ } catch {
112
+ return undefined;
113
+ }
114
+ }
115
+ async function update(env, opts) {
116
+ const current = opts.current ?? VERSION;
117
+ const npx = isNpx(env.scriptPath);
118
+ // JSON 필드 순서를 늘 같게
119
+ const make = fields => ({
120
+ ok: fields.ok,
121
+ current,
122
+ latest: fields.latest,
123
+ upToDate: fields.upToDate,
124
+ npx,
125
+ steps: fields.steps ?? [],
126
+ notes: [],
127
+ skillsDirCreated: false,
128
+ ...(fields.error ? {
129
+ error: fields.error
130
+ } : {})
131
+ });
132
+ const latest = env.latest(LATEST_UPDATE_TIMEOUT_MS);
133
+ if (!latest.ok) return make({
134
+ ok: false,
135
+ latest: null,
136
+ upToDate: false,
137
+ error: `npm에서 ${CLI_PACKAGE} 최신 버전을 확인하지 못했습니다 (${latest.error}). 네트워크 · 프록시(npm config get registry)를 확인해 주세요. 아무것도 바꾸지 않았습니다.`
138
+ });
139
+ if (!isNewer(latest.version, current)) return make({
140
+ ok: true,
141
+ latest: latest.version,
142
+ upToDate: true
143
+ });
144
+ const steps = await plan(env, latest.version, npx);
145
+ const result = make({
146
+ ok: true,
147
+ latest: latest.version,
148
+ upToDate: false,
149
+ steps
150
+ });
151
+ if (opts.check) return result;
152
+ const [cli, skills, project] = steps;
153
+ const stop = from => {
154
+ for (const s of from) if (s.status === 'planned') s.status = 'not-run';
155
+ result.ok = false;
156
+ return result;
157
+ };
158
+ // 1. CLI
159
+ if (cli.status === 'planned') {
160
+ env.log(`[1/3] CLI 설치: ${cli.command}`);
161
+ const r = await env.run('npm', ['install', '-g', `${CLI_PACKAGE}@${latest.version}`]);
162
+ if (r.code !== 0) {
163
+ cli.status = 'failed';
164
+ cli.message = PERMISSION.test(r.output) ? `권한이 없어 전역 설치하지 못했습니다 (EACCES). 직접 실행해 주세요: ${cli.command} (${PERMISSION_HINT})` : `설치하지 못했습니다 (${r.code < 0 ? r.output.trim() : `종료 코드 ${r.code}`}). 직접 실행해 주세요: ${cli.command}`;
165
+ return stop([skills, project]);
166
+ }
167
+ cli.status = 'done';
168
+ } else env.log(`[1/3] CLI 설치 건너뜀: ${cli.message}`);
169
+ // 2. 스킬: 새 스킬은 새 버전에 들어 있으므로 새 ecdk로 설치한다 (PATH의 새 ecdk, npx면 npx로 latest를 받아서)
170
+ // 이 프로세스(npx 옛 캐시일 수 있음)에서 설치하면 옛 스킬을 깔고 완료로 알리게 되므로 하지 않는다
171
+ const skillCmd = skills.command ?? SKILL_COMMAND;
172
+ // 새 ecdk가 쓰기 전에 본다 (새 ecdk의 안내는 옛 ecdk와 다를 수 있어 여기서 다시 알린다)
173
+ const userSkills = skillsDir({
174
+ project: false,
175
+ home: env.home
176
+ });
177
+ const skillsDirExisted = existsSync(userSkills);
178
+ env.log(`[2/3] 스킬 갱신: ${skillCmd}`);
179
+ const sr = npx ? await env.run('npx', npxSkillArgs(latest.version)) : await env.run('ecdk', SKILL_ARGS);
180
+ if (sr.code === 0) skills.status = 'done';else if (sr.code === 1) {
181
+ skills.status = 'warn';
182
+ skills.message = `손으로 고친 스킬은 그대로 둠 (바꾸려면 ${SKILL_COMMAND} --force)`;
183
+ } else {
184
+ skills.status = 'failed';
185
+ const why = PERMISSION.test(sr.output) ? `권한이 없어 설치하지 못했습니다 (EACCES). ${PERMISSION_HINT}` : `새 ecdk를 실행하지 못했습니다 (${sr.code < 0 ? sr.output.trim() : `종료 코드 ${sr.code}`})`;
186
+ skills.message = npx ? `${why}. 직접 실행해 주세요: ${skillCmd}` : `${why}. 터미널을 새로 연 뒤 ${skillCmd}`;
187
+ }
188
+ result.skillsDirCreated = skills.status !== 'failed' && !skillsDirExisted && existsSync(userSkills);
189
+ // 3. 프로젝트 SDK (화면 · 템플릿 코드는 건드리지 않고 안내만)
190
+ if (project.status === 'planned') {
191
+ env.log(`[3/3] 프로젝트 SDK: ${UPDATE_COMMAND} (${env.cwd})`);
192
+ const r = await env.run('npm', ['update', SDK_PACKAGE], {
193
+ cwd: env.cwd
194
+ });
195
+ project.status = r.code === 0 ? 'done' : 'failed';
196
+ if (r.code !== 0) project.message = `실패 (종료 코드 ${r.code}). 프로젝트 폴더에서 직접 ${UPDATE_COMMAND}`;
197
+ try {
198
+ const templates = npx ? listTemplates() : await installedTemplates(env);
199
+ const notice = templates && templateNotice(await loadConfig(env.cwd), templates);
200
+ if (notice) result.notes.push(`프로젝트 템플릿 ${notice}`);
201
+ } catch {
202
+ // 설정을 읽지 못하면 안내만 빠진다 (ecdk doctor가 알림)
203
+ }
204
+ } else env.log(`[3/3] 프로젝트 SDK 건너뜀: ${project.message}`);
205
+ result.ok = !steps.some(s => s.status === 'failed');
206
+ return result;
207
+ }
208
+ const STATUS = {
209
+ planned: '할 일',
210
+ done: '완료',
211
+ warn: '완료 (확인할 것 있음)',
212
+ skipped: '건너뜀',
213
+ failed: '실패',
214
+ 'not-run': '실행 안 함'
215
+ };
216
+ const STEP_NAME = {
217
+ 'cli.install': 'CLI 설치',
218
+ 'skill.install': '스킬 갱신',
219
+ 'project.sdk': '프로젝트 SDK'
220
+ };
221
+ function formatText(r, check) {
222
+ if (r.error) return r.error;
223
+ const lines = [`ecdk ${r.current} · npm latest ${r.latest ?? '-'}`];
224
+ if (r.upToDate) {
225
+ lines.push(r.latest === r.current ? '최신입니다.' : `최신입니다 (지금 버전이 npm latest보다 새 버전이라 내리지 않음).`);
226
+ return lines.join('\n');
227
+ }
228
+ if (check) lines.push('새 버전이 있습니다. ecdk update가 할 일:');
229
+ r.steps.forEach((s, i) => {
230
+ const detail = [s.command, s.message].filter(Boolean).join(' · ');
231
+ lines.push(` ${i + 1}. ${STEP_NAME[s.id]}: ${check ? detail : `${STATUS[s.status]}${detail ? ` · ${detail}` : ''}`}`);
232
+ });
233
+ for (const n of r.notes) lines.push('', n);
234
+ if (check) lines.push('', '실행: ecdk update');else if (r.ok) lines.push('', ...reloadNotes(r.skillsDirCreated), HELPY_NOTE);else lines.push('', '업데이트가 끝나지 않았습니다. 위 실패 단계의 명령을 직접 실행해 주세요.');
235
+ return lines.join('\n');
236
+ }
237
+ async function run(args, env = defaultUpdateEnv(), current) {
238
+ const result = await update({
239
+ ...env,
240
+ cwd: resolve(env.cwd)
241
+ }, {
242
+ check: args.check,
243
+ current
244
+ });
245
+ return {
246
+ exitCode: result.ok ? 0 : 1,
247
+ output: args.json ? JSON.stringify(result, null, 2) : formatText(result, args.check)
248
+ };
249
+ }
250
+
251
+ export { PERMISSION_HINT, defaultUpdateEnv, formatText, isNpx, run, update, usage };
@@ -0,0 +1,18 @@
1
+ import type { CheckResult } from '../../rules/index.js';
2
+ import type { CommandResult } from '../../types.js';
3
+ export declare const usage = "\uC0AC\uC6A9\uBC95: ecdk validate [\uACBD\uB85C] [--json]\n\n \uACBD\uB85C \uD3F4\uB354, .zip, .html (\uAE30\uBCF8\uAC12: \uD604\uC7AC \uD3F4\uB354)\n ecdk \uD504\uB85C\uC81D\uD2B8 \uD3F4\uB354(package.json\uC5D0 \"ecdk\" \uD0A4\uB098 @eliceio/cdk \uC758\uC874\uC131, \uC61B elice.config.json)\uB294\n ecdk build\uAC00 \uB9CC\uB4E4 zip \uAE30\uC900\uC73C\uB85C \uAC80\uC0AC\uD55C\uB2E4\n (\uC815\uB2F5 \u00B7 \uC124\uC815 \u00B7 \uAC1C\uBC1C\uC6A9 \uD30C\uC77C\uC744 \uBE7C\uACE0 metadata.json\uC744 \uB9CC\uB4E0 \uB4A4). \uADF8 \uBC16\uC758 \uD3F4\uB354\uB294 \uADF8\uB300\uB85C \uC62C\uB9B4 zip\uC73C\uB85C \uBCF8\uB2E4\n --json \uAE30\uACC4\uC6A9 \uCD9C\uB825 (Claude \uC2A4\uD0AC\u00B7CI)\n\n\uC885\uB8CC \uCF54\uB4DC: 0 \uD1B5\uACFC \u00B7 1 \uC624\uB958 \uC788\uC74C \u00B7 2 \uC798\uBABB\uB41C \uC0AC\uC6A9";
4
+ /** 검사 방식: project = build가 만들 zip 기준, path = 주어진 폴더 · zip · html을 그대로 */
5
+ export type CheckMode = 'project' | 'path';
6
+ /**
7
+ * ecdk 프로젝트 폴더인지 (ADR 0011): package.json에 "ecdk" 키가 있거나 @eliceio/cdk(SDK) · @eliceio/cdk-cli를 쓴다.
8
+ * 옛 elice.config.json이 있는 폴더도 프로젝트로 본다 (옮기라는 경고를 보이려고)
9
+ */
10
+ export declare function isProjectDir(dir: string): Promise<boolean>;
11
+ /** build와 같은 준비(제외 · metadata.json)를 거친 파일로 검사한다. 모듈 묶기는 build가 하므로 module-src는 보지 않는다 */
12
+ export declare function checkProject(dir: string): Promise<CheckResult>;
13
+ export declare function formatIssues(r: CheckResult): string[];
14
+ export declare function formatText(target: string, r: CheckResult, mode?: CheckMode): string;
15
+ export declare function run(args: {
16
+ target: string;
17
+ json: boolean;
18
+ }): Promise<CommandResult>;
@@ -1,44 +1,50 @@
1
1
  import { stat, readFile, access } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
- import { CONFIG_FILE, loadConfig, loadGradingFile } from '../../core/config.js';
3
+ import { CONFIG_FILE, PACKAGE_FILE, PACKAGE_CONFIG_KEY, loadConfig } from '../../core/config.js';
4
4
  import { prepareContent } from '../../core/prepare.js';
5
5
  import { projectCheckOptions } from '../../core/project-check.js';
6
+ import { SDK_PACKAGE } from '../../core/sdk.js';
6
7
  import { createZip } from '../../core/zip.js';
7
8
  import { checkFiles } from '../../rules/check.js';
8
9
  import '../../rules/spec.js';
9
10
  import 'fflate';
10
11
  import { checkPath } from '../../rules/node.js';
11
12
 
12
- const usage = `사용법: ecdk check [경로] [--json]
13
+ const usage = `사용법: ecdk validate [경로] [--json]
13
14
 
14
15
  경로 폴더, .zip, .html (기본값: 현재 폴더)
15
- ecdk 프로젝트 폴더(elice.config.json이 있음)는 ecdk build가 만들 zip 기준으로 검사한다
16
+ ecdk 프로젝트 폴더(package.json에 "ecdk" 키나 @eliceio/cdk 의존성, 옛 elice.config.json)는
17
+ ecdk build가 만들 zip 기준으로 검사한다
16
18
  (정답 · 설정 · 개발용 파일을 빼고 metadata.json을 만든 뒤). 그 밖의 폴더는 그대로 올릴 zip으로 본다
17
19
  --json 기계용 출력 (Claude 스킬·CI)
18
20
 
19
21
  종료 코드: 0 통과 · 1 오류 있음 · 2 잘못된 사용`;
20
22
  const exists = p => access(p).then(() => true, () => false);
21
- /** ecdk 프로젝트 폴더인지: elice.config.json이 있거나 package.json이 @eliceio/cdk-cli를 쓴다 */
23
+ /**
24
+ * ecdk 프로젝트 폴더인지 (ADR 0011): package.json에 "ecdk" 키가 있거나 @eliceio/cdk(SDK) · @eliceio/cdk-cli를 쓴다.
25
+ * 옛 elice.config.json이 있는 폴더도 프로젝트로 본다 (옮기라는 경고를 보이려고)
26
+ */
22
27
  async function isProjectDir(dir) {
23
28
  if (!(await stat(dir)).isDirectory()) return false;
24
29
  if (await exists(join(dir, CONFIG_FILE))) return true;
25
30
  try {
26
- const pkg = JSON.parse(await readFile(join(dir, 'package.json'), 'utf8'));
27
- return ['dependencies', 'devDependencies'].some(k => pkg[k]?.['@eliceio/cdk-cli'] !== undefined);
31
+ const pkg = JSON.parse(await readFile(join(dir, PACKAGE_FILE), 'utf8'));
32
+ if (pkg[PACKAGE_CONFIG_KEY] !== undefined) return true;
33
+ return ['dependencies', 'devDependencies'].some(k => PROJECT_PACKAGES.some(name => pkg[k]?.[name] !== undefined));
28
34
  } catch {
29
35
  return false;
30
36
  }
31
37
  }
38
+ /** 이 의존성이 있으면 ecdk 프로젝트 */
39
+ const PROJECT_PACKAGES = [SDK_PACKAGE, '@eliceio/cdk-cli'];
32
40
  /** build와 같은 준비(제외 · metadata.json)를 거친 파일로 검사한다. 모듈 묶기는 build가 하므로 module-src는 보지 않는다 */
33
41
  async function checkProject(dir) {
34
42
  const config = await loadConfig(dir);
35
43
  const {
36
44
  files
37
45
  } = await prepareContent(dir, config);
38
- const grading = config.kind === 'description' ? undefined : await loadGradingFile(dir);
39
- return checkFiles(files, projectCheckOptions(config, {
40
- zipBytes: createZip(files).byteLength,
41
- grading
46
+ return checkFiles(files, await projectCheckOptions(dir, config, {
47
+ zipBytes: createZip(files).byteLength
42
48
  }));
43
49
  }
44
50
  function formatIssues(r) {
@@ -4,8 +4,11 @@ export interface SourceFile {
4
4
  }
5
5
  export interface Excluded {
6
6
  path: string;
7
- /** link: 심볼릭 링크 등 일반 파일 · 폴더가 아닌 항목 (따라가지 않고 빼되 보고는 한다) */
8
- reason: 'secret' | 'dev' | 'junk' | 'project' | 'config' | 'link';
7
+ /**
8
+ * link: 심볼릭 링크 등 일반 파일 · 폴더가 아닌 항목 (따라가지 않고 빼되 보고는 한다).
9
+ * sdk: 옛 lib/cdk.js 복사본. package.json의 @eliceio/cdk(설치된 SDK)를 대신 넣는다
10
+ */
11
+ reason: 'secret' | 'dev' | 'junk' | 'project' | 'config' | 'link' | 'sdk';
9
12
  }
10
13
  /**
11
14
  * 원본 폴더에서 콘텐츠 파일만 모은다. 정답·비밀·개발용·OS 파일, 프로젝트 파일, 산출물 폴더, 설정의 exclude를 뺀다.
@@ -1,25 +1,18 @@
1
1
  /**
2
- * 완료 정책 (ADR 0009). 원본은 rules.json `manifest.completionPolicies`이고, 타입 검사를 위해 여기 리터럴로 둔다.
3
- * 둘이 같은지는 docs.test.ts가 대조한다. 수동 채점 manual · 채점 없음 none은 Custom HTML에서 쓰지 않음.
4
- * 자료가 지원하는 완료 정책은 metadata `completionPolicies`(서버가 첫 값으로 정함), 바꾸기는 완료 정책 화면 · SDK
5
- * `saveCompletionPolicy`(PATCH completion_policy). settings.grading에는 없다
6
- */
7
- export declare const COMPLETION_POLICIES: readonly ["on_access", "on_submit", "on_graded"];
8
- /**
9
- * 채점 방식 = `settings.grading.type` (on_graded일 때만). 원본은 rules.json `manifest.graderTypes`.
10
- * pattern: 정답 정규식 · rubric: AI 평가 기준. code_exec는 이번 범위 밖
2
+ * 채점 방식 = `settings.grading.type`. 원본은 rules.json `manifest.graderTypes`.
3
+ * pattern: 정답 정규식 · rubric: AI 평가 기준. code_exec는 이번 범위 밖.
4
+ * 완료 정책(on_access · on_submit · on_graded)은 LXP에 올린 뒤 설정 탭에서 교육자가 고른다 (ADR 0012). 패키지 · CLI는 다루지 않는다
11
5
  */
12
6
  export declare const GRADER_TYPES: readonly ["pattern", "rubric"];
13
- export type CompletionPolicy = (typeof COMPLETION_POLICIES)[number];
14
7
  export type GraderType = (typeof GRADER_TYPES)[number];
15
8
  /**
16
9
  * 채점 설정 = 운영 `settings.grading` (서버 §5.1 스키마, 2026-11-11 결정). 편집 화면이 saveSettings로 저장한다.
17
- * 로컬은 프로젝트 맨 위 `grading.json`이고 `ecdk dev`의 편집 화면이 저장하면 이 파일에 쓴다. zip에는 들어가지 않는다 (정답).
10
+ * 로컬은 `ecdk dev`의 편집 화면이 저장한 settings(`.ecdk/settings.json`)의 grading뿐이다 (grading.json은 없앰, ADR 0011).
18
11
  *
19
12
  * { "type": "pattern", "answer_key": "^q1=b;q2=a,d$" } // 정규식 하나. 답 문자열 앞뒤 공백을 자르고 전체 일치
20
13
  * { "type": "rubric", "rubric": "핵심 개념 2개 이상 언급하면 만점" }
21
14
  *
22
- * on_access · on_submit은 grading에서 빠졌다 (완료 정책은 completion_policy, 2026-11-11).
15
+ * 완료 정책(on_access · on_submit · on_graded)은 grading에 없다: LXP 설정 탭에서 교육자가 고른다 (ADR 0012).
23
16
  */
24
17
  export interface GradingConfig {
25
18
  type: GraderType;
@@ -28,25 +21,29 @@ export interface GradingConfig {
28
21
  /** rubric: 평가 기준 */
29
22
  rubric?: string;
30
23
  }
31
- /** 로컬 채점 흉내에 쓰는 값: 완료 정책(로컬 `.ecdk/completion.json` · completionPolicies 첫 값)과 채점 설정(grading.json) */
24
+ /**
25
+ * 로컬 채점 흉내에 쓰는 값: 저장한 settings의 채점 설정(`.ecdk/settings.json` grading). 채점 설정이 있으면 채점하고,
26
+ * 없으면 제출만 받는다 (완료 정책은 LXP 설정이라 dev는 흉내 내지 않는다, ADR 0012)
27
+ */
32
28
  export interface LocalGrading {
33
- completion_policy: CompletionPolicy;
34
- /** grading.json (없으면 null) */
29
+ /** `ecdk dev` 편집 화면이 저장한 settings.grading (없으면 null) */
35
30
  grading: GradingConfig | null;
36
31
  }
37
- export declare const GRADING_DATA_FILE = "grading.json";
38
32
  /**
39
- * 로컬 완료 정책 (dev 전용): `ecdk dev` 완료 정책 화면의 saveCompletionPolicy를 흉내 서버가 여기에 쓴다.
40
- * 운영은 서버 material_version.completion_policy. 프로젝트의 점(.) 폴더라 zip에 들어가지 않는다
33
+ * 로컬 settings (dev 전용): `ecdk dev` 편집 화면의 saveSettings(PATCH /draft settings)를 흉내 서버가 통째로(내용 + grading) 여기에 쓴다.
34
+ * 운영은 서버 material_version.settings. 프로젝트의 점(.) 폴더라 zip에 들어가지 않는다. build · check는 읽지 않는다
41
35
  */
42
- export declare const COMPLETION_DATA_FILE = ".ecdk/completion.json";
43
- /** completionPolicies가 없을 때(검사 오류) ecdk dev가 흉내 내는 정책 (제출하면 완료) */
44
- export declare const DEFAULT_COMPLETION_POLICY: CompletionPolicy;
36
+ export declare const SETTINGS_DATA_FILE = ".ecdk/settings.json";
45
37
  /**
46
- * 채점 설정 값 검사 (grading.json · 편집 화면이 저장한 settings.grading). 문제가 있으면 문장, 없으면 GradingConfig.
38
+ * 채점 설정 값 검사 (편집 화면이 저장한 settings.grading). 문제가 있으면 문장, 없으면 GradingConfig.
47
39
  * 옛 모양(`type: on_access · on_submit`, `completion_policy` · `grader_type`, `match` · 객체 정답)은 바꾸는 법을 알려 준다.
48
40
  */
49
41
  export declare function parseGrading(data: unknown): GradingConfig | string;
42
+ /**
43
+ * 프로젝트 설정 (ADR 0011). 빌드 옵션은 package.json `"ecdk"` 키, 플랫폼 필드(kind · screens · commentary)는 작성자가
44
+ * 쓰는 원본의 metadata.json(build가 그대로 복사하고 build만 채움)에 둔다.
45
+ * kind는 dev · doctor가 쓰도록 metadata.json에서 읽어 둔 값이다 (옛 프로젝트는 elice.config.json에서).
46
+ */
50
47
  export interface ContentConfig {
51
48
  /** 콘텐츠 원본 폴더 (프로젝트 기준). 기본 '.' */
52
49
  root: string;
@@ -54,46 +51,98 @@ export interface ContentConfig {
54
51
  outDir: string;
55
52
  /** 추가로 뺄 파일·폴더 (basename glob `*` 또는 프로젝트 기준 경로 접두사) */
56
53
  exclude: string[];
57
- /** 용도 → metadata.json `kind`. material: 자료 본문(기본) · description: 다른 자료(실습 등)의 문제 설명 */
58
- kind?: 'material' | 'description';
59
- /** 화면별 진입 파일 → build가 metadata.json로 만든다. 없으면 원본의 metadata.json, 그것도 없으면 { learn: 'index.html' } */
60
- screens?: Record<string, string>;
61
- /**
62
- * 지원하는 완료 정책 → metadata.json `completionPolicies` (ADR 0009 2026-11-11 결정 2). 서버는 첫 값으로 완료 정책을 정한다.
63
- * 하나면 고정(퀴즈 ["on_graded"]), 여럿이면 완료 정책 화면(screens.completionPolicy)이 그 안에서 바꾼다. 자료 본문은 필수
64
- */
65
- completionPolicies?: CompletionPolicy[];
66
- /**
67
- * @deprecated 2026-11-10 삭제 (ADR 0008 · 0009). 완료 정책은 completionPolicies · 완료 정책 화면이, 채점 방식은 편집 화면이 정한다.
68
- * 남아 있으면 build · doctor가 경고만 하고 metadata.json에 옮기지 않는다
69
- */
70
- gradingTypes?: unknown;
71
54
  /** true면 build가 JS · CSS · JSON을 줄여 zip에 넣는다 (용량 줄이기). 기본 false */
72
55
  minify?: boolean;
73
- /**
74
- * 학습 참고 내용 파일 이름 (원본 최상위 .txt). 기본 rules.json `manifest.commentaryFile`(commentary.txt)이 있으면 그것.
75
- * zip에 그대로 들어가고 build가 metadata.json `commentary`에 이름을 적는다
76
- */
77
- commentary?: string;
78
56
  /** minify와 함께: 줄인 JS · CSS마다 .map을 zip에 넣어 운영에서도 원본 위치로 오류를 본다 (용량이 늘어남) */
79
57
  sourcemap?: boolean;
80
- /** ecdk create가 적는 템플릿과 버전 (예: "quiz@0.1.0"). metadata.json build.template으로 */
58
+ /** ecdk create가 적는 템플릿과 버전 (예: "quiz@1.0.0"). metadata.json build.template으로 */
81
59
  template?: string;
60
+ /** 설정을 읽은 파일. 없으면 기본값 (프로젝트 설정 없음) */
61
+ configFile?: typeof PACKAGE_FILE | typeof CONFIG_FILE;
62
+ /** metadata.json `kind` (dev · doctor용으로 읽어 둔 값). material: 자료 본문(기본) · description: 문제 설명 */
63
+ kind?: 'material' | 'description';
64
+ /**
65
+ * 옛 elice.config.json에서 읽은 플랫폼 필드 (ADR 0011 전). 있으면 build가 이것으로 metadata.json을 만들고
66
+ * project.legacy-file이 옮기는 법을 알린다 (`ecdk doctor --fix`). 새 프로젝트에는 없다
67
+ */
68
+ legacy?: LegacyPlatformFields;
69
+ }
70
+ /** 옛 elice.config.json의 플랫폼 필드 (metadata.json으로 옮길 것) */
71
+ export interface LegacyPlatformFields {
72
+ kind?: 'material' | 'description';
73
+ /** 켤 화면만 파일 이름으로: { "learn": "index.html" } */
74
+ screens?: Record<string, string>;
75
+ /** 학습 참고 내용 파일 이름. 없으면 commentary.txt가 있을 때 그것 */
76
+ commentary?: string;
77
+ /** @deprecated 2026-11-10 삭제 (ADR 0008 · 0009). 경고만 하고 옮기지 않는다 */
78
+ gradingTypes?: unknown;
79
+ /** @deprecated 2026-11-12 삭제 (ADR 0012). 남아 있던 완료 정책 필드 · 화면 이름. 경고만 하고 옮기지 않는다 */
80
+ completion?: string[];
82
81
  }
82
+ /** 옛 설정 파일 (ADR 0011에서 없앰). 있으면 경고하고 `ecdk doctor --fix`가 옮긴다. zip에는 들어가지 않는다 */
83
83
  export declare const CONFIG_FILE = "elice.config.json";
84
- /** 1단계는 JSON만. `.ts` 설정은 Node 20의 TS 실행 지원 문제로 엔진 작업(3단계)과 함께 결정. */
84
+ export declare const PACKAGE_FILE = "package.json";
85
+ /** package.json에서 ecdk 빌드 옵션을 담는 키 */
86
+ export declare const PACKAGE_CONFIG_KEY = "ecdk";
87
+ /** package.json "ecdk"에 적을 수 있는 키 */
88
+ export declare const BUILD_OPTION_KEYS: readonly ["template", "root", "outDir", "exclude", "minify", "sourcemap"];
89
+ /** metadata.json에 적는 플랫폼 필드 (package.json "ecdk" · 옛 elice.config.json에 있으면 옮기라고 알림) */
90
+ export declare const PLATFORM_KEYS: readonly ["kind", "screens", "commentary"];
91
+ /** package.json을 읽는다 (없으면 null). JSON 형식이 틀리면 오류 */
92
+ export declare function readPackageJson(projectDir: string): Promise<Record<string, unknown> | null>;
93
+ /**
94
+ * 프로젝트 설정 (ADR 0011): package.json "ecdk"(빌드 옵션) → 없으면 옛 elice.config.json → 없으면 기본값.
95
+ * kind는 원본 metadata.json에서 읽는다 (옛 elice.config.json이면 거기서).
96
+ * 둘 다 있으면 package.json "ecdk"를 쓰고 elice.config.json은 남은 옛 파일로 경고만 한다
97
+ */
85
98
  export declare function loadConfig(projectDir: string): Promise<ContentConfig>;
99
+ /** 옮기기 계획 (ecdk doctor --fix). 옮길 수 없으면 reason */
100
+ export interface LegacyMigration {
101
+ /** 옮길 수 있는지. 아니면 reason에 이유 */
102
+ ok: boolean;
103
+ reason?: string;
104
+ /** package.json "ecdk"에 더할 빌드 옵션 */
105
+ ecdk: Record<string, unknown>;
106
+ /** 새로 쓸 metadata.json (원본 폴더 기준 경로 · 내용). 이미 있으면 null */
107
+ metadata: {
108
+ path: string;
109
+ text: string;
110
+ } | null;
111
+ /** 옮기지 않고 버리는 것 (gradingTypes · 완료 정책) */
112
+ dropped: string[];
113
+ }
114
+ /**
115
+ * 옛 elice.config.json을 metadata.json + package.json "ecdk"로 옮기는 계획 (ADR 0011). 디스크는 바꾸지 않는다.
116
+ * 플랫폼 필드는 build가 만들던 것과 같은 metadata.json으로(학습 참고 내용은 commentary.txt가 있으면), 빌드 옵션 · template은
117
+ * package.json "ecdk"로 (이미 있는 키는 그대로). 원본에 metadata.json이 이미 있는데 플랫폼 필드도 있으면 옮기지 않는다
118
+ */
119
+ export declare function planLegacyMigration(projectDir: string): Promise<LegacyMigration>;
120
+ /**
121
+ * 계획대로 옮긴다: metadata.json을 쓰고, package.json "ecdk"에 빌드 옵션을 더하고(package.json이 없으면 만듦),
122
+ * elice.config.json을 지운다. 옮긴 파일 목록을 돌려준다
123
+ */
124
+ export declare function applyLegacyMigration(projectDir: string, plan: LegacyMigration): Promise<string[]>;
86
125
  /** elice.config.json에 옛 `gradingTypes`가 남아 있을 때 build · doctor가 보여 줄 경고. 없으면 null */
87
126
  export declare function legacyGradingTypesWarning(config: ContentConfig): string | null;
127
+ /** elice.config.json에 옛 완료 정책 필드 · 화면이 남아 있을 때 build · doctor가 보여 줄 경고. 없으면 null */
128
+ export declare function legacyCompletionWarning(config: ContentConfig): string | null;
88
129
  /**
89
- * 로컬 완료 정책 (ecdk dev 흉내): `.ecdk/completion.json`(ecdk dev 완료 정책 화면이 저장)이 completionPolicies 안에
90
- * 있으면 그것, 아니면 completionPolicies 첫 값(서버가 업로드 때 정하는 값), 없으면 on_submit.
91
- * completionPolicies가 바뀌어 저장해 둔 값이 목록에서 빠졌으면 첫 값으로 돌아간다
130
+ * `ecdk dev` 편집 화면이 저장한 settings (`.ecdk/settings.json`, 없으면 {}). 흉내 서버가 시작할 때 읽어 다시 열어도 남는다.
131
+ * 형식이 틀리면 오류
92
132
  */
93
- export declare function loadCompletionPolicy(projectDir: string, config: ContentConfig): Promise<CompletionPolicy>;
94
- /** grading.json (없으면 null). 문제가 있으면 오류 */
95
- export declare function loadGradingFile(projectDir: string): Promise<GradingConfig | null>;
133
+ export declare function loadSavedSettings(projectDir: string): Promise<Record<string, unknown>>;
134
+ /** 저장한 settings의 grading (없으면 null). 형식이 틀리면 오류 */
135
+ export declare function savedGrading(settings: Record<string, unknown>): GradingConfig | null;
96
136
  /**
97
- * 로컬 채점 흉내용 값: 완료 정책 + grading.json. 문제 설명(채점 없음)은 undefined
137
+ * 로컬 채점 흉내용 값: `.ecdk/settings.json`의 grading. 문제 설명(채점 없음)은 undefined
98
138
  */
99
139
  export declare function loadGrading(projectDir: string, config: ContentConfig): Promise<LocalGrading | undefined>;
140
+ /**
141
+ * 더 쓰지 않는 프로젝트 파일 (ADR 0011). 있으면 build · check가 경고(project.legacy-file)하고 옮기는 법을 알려 준다.
142
+ * content.json은 원본 폴더(root), 그 밖은 프로젝트 맨 위
143
+ */
144
+ export declare const LEGACY_FILES: Readonly<{
145
+ config: "elice.config.json";
146
+ content: "content.json";
147
+ grading: "grading.json";
148
+ }>;