@eliceio/cdk-cli 1.7.2-sharedqa.0 → 1.8.1-documentqa.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.
Files changed (122) hide show
  1. package/README.md +24 -20
  2. package/assets/link-bridge.js +1 -0
  3. package/es/commands/create/index.js +6 -3
  4. package/es/commands/create/scaffold.d.ts +1 -1
  5. package/es/commands/create/scaffold.js +1 -1
  6. package/es/commands/dev/index.d.ts +1 -1
  7. package/es/commands/dev/index.js +1 -1
  8. package/es/commands/doctor/index.js +34 -1
  9. package/es/core/lesson-check.d.ts +7 -0
  10. package/es/core/lesson-check.js +87 -0
  11. package/es/core/templates.d.ts +2 -0
  12. package/es/core/templates.js +4 -1
  13. package/es/dev/host-page.js +17 -3
  14. package/es/dev/link-bridge.d.ts +27 -0
  15. package/es/dev/link-bridge.js +142 -0
  16. package/es/dev/server.d.ts +1 -1
  17. package/es/dev/server.js +4 -1
  18. package/es/rules/csp.d.ts +1 -1
  19. package/es/rules/csp.js +2 -2
  20. package/es/rules.json.js +1 -1
  21. package/package.json +3 -2
  22. package/rules.json +3 -3
  23. package/skills/_shared/always.md +1 -1
  24. package/skills/_shared/references/02-design-the-material.md +10 -9
  25. package/skills/_shared/references/03-create-the-project.md +12 -11
  26. package/skills/_shared/references/04-rules.md +1 -1
  27. package/skills/_shared/references/08-fix-check-errors.md +2 -1
  28. package/skills/_shared/references/12-upload-with-the-material-mcp.md +2 -2
  29. package/skills/_shared/references/17-using-the-entry-template.md +44 -5
  30. package/skills/_shared/references/18-using-the-lesson-template.md +207 -0
  31. package/skills/_shared/references/19-lesson-layouts.md +2132 -0
  32. package/skills/elice-content-create/SKILL.md +4 -3
  33. package/skills/elice-content-publish/SKILL.md +3 -3
  34. package/templates/blank/template.json +1 -1
  35. package/templates/board/package.json +1 -1
  36. package/templates/board/template.json +1 -1
  37. package/templates/board/ui/board.css +4 -1
  38. package/templates/board/ui/texts.js +3 -1
  39. package/templates/document/README.md +5 -3
  40. package/templates/document/core/viewer.js +4 -1
  41. package/templates/document/screens/learn.js +47 -2
  42. package/templates/document/styles.css +73 -0
  43. package/templates/document/template.json +1 -1
  44. package/templates/document/ui/templates/viewer.js +8 -3
  45. package/templates/document/ui/texts.js +2 -0
  46. package/templates/document/ui/theme.css +2 -0
  47. package/templates/lesson/README.md +71 -0
  48. package/templates/lesson/commentary.txt +7 -0
  49. package/templates/lesson/core/dom.d.ts +4 -0
  50. package/templates/lesson/core/dom.js +22 -0
  51. package/templates/lesson/core/engine.d.ts +23 -0
  52. package/templates/lesson/core/engine.js +169 -0
  53. package/templates/lesson/core/interact.d.ts +2 -0
  54. package/templates/lesson/core/interact.js +429 -0
  55. package/templates/lesson/core/layout-files.d.ts +4 -0
  56. package/templates/lesson/core/layout-files.js +9 -0
  57. package/templates/lesson/core/lesson.d.ts +95 -0
  58. package/templates/lesson/core/lesson.js +609 -0
  59. package/templates/lesson/core/sample.d.ts +4 -0
  60. package/templates/lesson/core/sample.js +128 -0
  61. package/templates/lesson/edit.html +21 -0
  62. package/templates/lesson/gitignore +4 -0
  63. package/templates/lesson/index.html +22 -0
  64. package/templates/lesson/layouts/_actions.html +1 -0
  65. package/templates/lesson/layouts/_cmp.html +1 -0
  66. package/templates/lesson/layouts/_deco-corner.html +1 -0
  67. package/templates/lesson/layouts/_deco-cover.html +1 -0
  68. package/templates/lesson/layouts/_deco-section.html +1 -0
  69. package/templates/lesson/layouts/_foot.html +1 -0
  70. package/templates/lesson/layouts/_head.html +1 -0
  71. package/templates/lesson/layouts/_media.html +1 -0
  72. package/templates/lesson/layouts/agenda.html +13 -0
  73. package/templates/lesson/layouts/bar-chart.html +14 -0
  74. package/templates/lesson/layouts/cards.html +12 -0
  75. package/templates/lesson/layouts/checklist.html +12 -0
  76. package/templates/lesson/layouts/choice-list.html +13 -0
  77. package/templates/lesson/layouts/closing.html +13 -0
  78. package/templates/lesson/layouts/compare.html +12 -0
  79. package/templates/lesson/layouts/cover-dark.html +13 -0
  80. package/templates/lesson/layouts/cover.html +15 -0
  81. package/templates/lesson/layouts/figures.html +12 -0
  82. package/templates/lesson/layouts/flow.html +13 -0
  83. package/templates/lesson/layouts/how-to.html +15 -0
  84. package/templates/lesson/layouts/image-bg.html +12 -0
  85. package/templates/lesson/layouts/image-pair.html +15 -0
  86. package/templates/lesson/layouts/image-split.html +12 -0
  87. package/templates/lesson/layouts/layers.html +12 -0
  88. package/templates/lesson/layouts/objectives.html +12 -0
  89. package/templates/lesson/layouts/ox-card.html +24 -0
  90. package/templates/lesson/layouts/ox-list.html +21 -0
  91. package/templates/lesson/layouts/process.html +14 -0
  92. package/templates/lesson/layouts/profile.html +13 -0
  93. package/templates/lesson/layouts/prompt-builder.html +18 -0
  94. package/templates/lesson/layouts/quiz.html +14 -0
  95. package/templates/lesson/layouts/quote.html +12 -0
  96. package/templates/lesson/layouts/scenario-rows.html +12 -0
  97. package/templates/lesson/layouts/section.html +14 -0
  98. package/templates/lesson/layouts/simulation.html +18 -0
  99. package/templates/lesson/layouts/stat.html +14 -0
  100. package/templates/lesson/layouts/statement.html +13 -0
  101. package/templates/lesson/layouts/stats.html +12 -0
  102. package/templates/lesson/layouts/stepper.html +13 -0
  103. package/templates/lesson/layouts/table.html +12 -0
  104. package/templates/lesson/layouts/tabs.html +13 -0
  105. package/templates/lesson/layouts/text-visual.html +16 -0
  106. package/templates/lesson/layouts/timeline.html +12 -0
  107. package/templates/lesson/layouts/toggle.html +16 -0
  108. package/templates/lesson/layouts/variables.html +14 -0
  109. package/templates/lesson/layouts/venn.html +15 -0
  110. package/templates/lesson/layouts/versus.html +12 -0
  111. package/templates/lesson/metadata.json +9 -0
  112. package/templates/lesson/package.json +15 -0
  113. package/templates/lesson/public/img/sample-chat.svg +21 -0
  114. package/templates/lesson/screens/edit.js +79 -0
  115. package/templates/lesson/screens/learn.js +56 -0
  116. package/templates/lesson/styles.css +27 -0
  117. package/templates/lesson/template.json +7 -0
  118. package/templates/lesson/ui/design.css +1103 -0
  119. package/templates/lesson/ui/fonts/PretendardVariable.woff2 +0 -0
  120. package/templates/lesson/ui/learn.css +64 -0
  121. package/templates/lesson/ui/mobile.css +492 -0
  122. package/templates/lesson/ui/reset.css +6 -0
@@ -0,0 +1,142 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { fileURLToPath } from 'node:url';
3
+
4
+ /**
5
+ * 링크 브리지: 콘텐츠의 외부 링크(다른 출처 http · https) 클릭을 가로채 부모 창에 `open-external`을 보내는 스크립트.
6
+ * sandbox iframe의 팝업은 sandbox를 물려받아 외부 페이지(로그인 · COOP 페이지)가 깨지므로, LXP가 sandbox 밖에서
7
+ * noopener 새 탭으로 연다. 운영은 콘텐츠 서버가 HTML 응답에 넣고, `ecdk dev`도 같은 조건 · 같은 자리에 넣는다.
8
+ * zip · 저장 파일은 바뀌지 않는다.
9
+ *
10
+ * 원본은 콘텐츠 서버 저장소의 `app/core/link_bridge.js` (넣는 자리 규칙은 같은 폴더 `link_bridge.py`).
11
+ * `packages/eliceio-cdk-cli/assets/link-bridge.js`는 바이트 그대로의 사본이다: 손으로 고치지 말고 원본을 바꾼 뒤 복사하고,
12
+ * `dev-link-bridge.test.ts`의 해시를 바꾼다.
13
+ */
14
+ const SOURCE = readFileSync(fileURLToPath(new URL('../../assets/link-bridge.js', import.meta.url)));
15
+ // 어떤 페이지 인코딩에서도 같은 뜻이 되도록 ASCII만 (서버는 테스트에서 검사)
16
+ if (SOURCE.some(b => b > 0x7f)) throw new Error('link-bridge.js는 ASCII여야 합니다');
17
+ /** 브리지 버전: 넣은 응답의 ETag 접미사 (서버 `LINK_BRIDGE_VERSION`) */
18
+ const LINK_BRIDGE_VERSION = 'b1';
19
+ const LINK_BRIDGE_TAG = Buffer.concat([Buffer.from('<script>'), SOURCE, Buffer.from('</script>')]);
20
+ const BOM = Buffer.from([0xef, 0xbb, 0xbf]);
21
+ const DOCTYPE = Buffer.from('<!doctype');
22
+ const COMMENT_OPEN = Buffer.from('<!--');
23
+ const COMMENT_CLOSE = Buffer.from('-->');
24
+ const ASCII_WHITESPACE = new Set([0x20, 0x09, 0x0a, 0x0c, 0x0d]);
25
+ /** 자리를 찾는 범위 (서버 `_PREFIX_BYTES`) */
26
+ const PREFIX_BYTES = 4096;
27
+ const PAGE_FETCH_DESTS = new Set(['document', 'iframe', 'frame']);
28
+ const startsWith = (a, b) => a.length >= b.length && a.subarray(0, b.length).equals(b);
29
+ /**
30
+ * `prefix`에서 브리지를 넣을 바이트 위치. UTF-8 BOM은 맨 앞에 둔다. 앞에 ASCII 공백과 `<!-- -->` 주석만 있고
31
+ * `<!DOCTYPE`(대소문자 무시)이면 그 doctype을 닫는 `>` 바로 뒤 (quirks 모드가 되지 않게), 아니면 맨 앞(BOM 뒤).
32
+ * 빈 주석 `<!-->` · `<!--->`는 HTML 파서처럼 그 `>`에서 끝난다. `prefix` 끝까지 닫히지 않은 주석 · doctype은
33
+ * 맨 앞이다. 서버 `find_bridge_offset`과 같은 결과여야 한다
34
+ */
35
+ function findBridgeOffset(prefix) {
36
+ const start = startsWith(prefix, BOM) ? BOM.length : 0;
37
+ let position = start;
38
+ for (;;) {
39
+ while (position < prefix.length && ASCII_WHITESPACE.has(prefix[position])) position++;
40
+ const rest = Buffer.from(prefix.subarray(position, position + DOCTYPE.length).toString('latin1').toLowerCase(), 'latin1');
41
+ if (startsWith(rest, COMMENT_OPEN)) {
42
+ // 둘째 바이트부터 찾아 <!--> · <!---> (파서가 거기서 닫는 빈 주석)도 파서와 같은 곳에서 끝난다
43
+ const commentEnd = prefix.indexOf(COMMENT_CLOSE, position + 2);
44
+ if (commentEnd < 0) return start;
45
+ position = commentEnd + COMMENT_CLOSE.length;
46
+ continue;
47
+ }
48
+ if (rest.equals(DOCTYPE)) {
49
+ const doctypeEnd = prefix.indexOf('>', position + DOCTYPE.length);
50
+ if (doctypeEnd < 0) return start;
51
+ return doctypeEnd + 1;
52
+ }
53
+ return start;
54
+ }
55
+ }
56
+ /** 본문 전체에 브리지를 넣는다. 서버처럼 앞 4096바이트만 한 번 보고 자리를 찾는다 */
57
+ function insertLinkBridge(body) {
58
+ const offset = findBridgeOffset(body.subarray(0, PREFIX_BYTES));
59
+ return Buffer.concat([body.subarray(0, offset), LINK_BRIDGE_TAG, body.subarray(offset)]);
60
+ }
61
+ /** ETag 따옴표 안에 `-b1`을 붙인다. 약한 `W/"…"`는 약한 그대로, 따옴표가 없으면 끝에 붙인다 (서버와 같음) */
62
+ function bridgedEtag(etag) {
63
+ const suffix = `-${LINK_BRIDGE_VERSION}`;
64
+ const m = /^(W\/)?"([^"]*)"$/.exec(etag);
65
+ return m ? `${m[1] ?? ''}"${m[2]}${suffix}"` : etag + suffix;
66
+ }
67
+ /**
68
+ * 브리지를 넣는 요청: 브라우저가 페이지로 여는 것 (GET · HEAD, `Sec-Fetch-Dest`가 없거나 document · iframe · frame).
69
+ * 콘텐츠가 fetch로 읽는 HTML(`empty`)은 원본 그대로
70
+ */
71
+ function isLinkBridged(req) {
72
+ if (req.method !== 'GET' && req.method !== 'HEAD') return false;
73
+ const dest = req.headers['sec-fetch-dest'];
74
+ return dest === undefined || PAGE_FETCH_DESTS.has(dest.trim().toLowerCase());
75
+ }
76
+ /**
77
+ * 콘텐츠 응답이 HTML(200 · text/html)이면 `Vary: Sec-Fetch-Dest`를 붙이고, 페이지 요청(`isLinkBridged`)이면 브리지를
78
+ * 넣는다 (서버처럼 Range · If-None-Match는 보지 않고 늘 200 전체라 Accept-Ranges를 빼고, Content-Length 다시 계산,
79
+ * ETag에 `-b1`).
80
+ * Vite(HTML 변환 · 정적 파일)가 쓰기 전에 응답을 감싼다. HTML이 아닌 응답은 그대로 흘려보낸다
81
+ */
82
+ function bridgeContentResponse(req, res) {
83
+ const bridged = isLinkBridged(req);
84
+ if (bridged) {
85
+ delete req.headers.range;
86
+ delete req.headers['if-none-match'];
87
+ // HEAD도 본문을 만들어 길이를 센다. 응답은 요청이 HEAD라 Node가 본문을 보내지 않는다
88
+ if (req.method === 'HEAD') req.method = 'GET';
89
+ }
90
+ const write = res.write.bind(res);
91
+ const end = res.end.bind(res);
92
+ const chunks = [];
93
+ let html;
94
+ const isHtml = () => {
95
+ html ??= res.statusCode === 200 && /^text\/html\b/i.test(String(res.getHeader('content-type') ?? ''));
96
+ return html;
97
+ };
98
+ const toBuffer = (chunk, encoding) => typeof chunk === 'string' ? Buffer.from(chunk, typeof encoding === 'string' ? encoding : 'utf8') : Buffer.from(chunk);
99
+ // 헤더는 setHeader로 옮겨 두어 끝에서 길이 · ETag를 고칠 수 있게 한다. 실제로 쓰기 직전에 원래 writeHead로
100
+ // 되돌린다: Node가 본문을 쓸 때 부르는 암묵 헤더(_implicitHeader)가 res.writeHead를 부르기 때문
101
+ const writeHead = res.writeHead;
102
+ const restore = () => {
103
+ res.writeHead = writeHead;
104
+ };
105
+ res.writeHead = (status, ...rest) => {
106
+ res.statusCode = status;
107
+ if (typeof rest[0] === 'string') res.statusMessage = rest[0];
108
+ const headers = rest.find(r => r && typeof r === 'object');
109
+ if (headers) for (const [k, v] of Object.entries(headers)) if (v !== undefined) res.setHeader(k, v);
110
+ return res;
111
+ };
112
+ res.write = (chunk, encoding, cb) => {
113
+ if (!isHtml()) {
114
+ restore();
115
+ return write(chunk, encoding, cb);
116
+ }
117
+ chunks.push(toBuffer(chunk, encoding));
118
+ const done = typeof encoding === 'function' ? encoding : cb;
119
+ if (typeof done === 'function') queueMicrotask(() => done());
120
+ return true;
121
+ };
122
+ res.end = (chunk, encoding, cb) => {
123
+ restore();
124
+ if (!isHtml()) return end(chunk, encoding, cb);
125
+ // end(cb) · end(chunk, cb) · end(chunk, encoding, cb)
126
+ const done = [chunk, encoding, cb].find(a => typeof a === 'function');
127
+ if (typeof chunk === 'string' || chunk instanceof Uint8Array) chunks.push(toBuffer(chunk, encoding));
128
+ let body = Buffer.concat(chunks);
129
+ res.setHeader('Vary', 'Sec-Fetch-Dest');
130
+ if (bridged) {
131
+ body = insertLinkBridge(body);
132
+ const etag = res.getHeader('etag');
133
+ if (typeof etag === 'string') res.setHeader('ETag', bridgedEtag(etag));
134
+ res.removeHeader('content-range');
135
+ res.removeHeader('accept-ranges');
136
+ }
137
+ res.setHeader('Content-Length', body.length);
138
+ return end(body, done);
139
+ };
140
+ }
141
+
142
+ export { LINK_BRIDGE_TAG, LINK_BRIDGE_VERSION, bridgeContentResponse, bridgedEtag, findBridgeOffset, insertLinkBridge, isLinkBridged };
@@ -36,7 +36,7 @@ export declare const devOnlyConnectSrc: (contentOrigin: string) => string[];
36
36
  * - 호스트(localhost): LXP 흉내 화면 + elice-material 흉내 API(/api) + 콘솔 수집
37
37
  * - 콘텐츠(127.0.0.1, 다른 출처): Vite dev 서버(ecdk 플러그인, engines/vite)가 원본을 주고 SDK 등 npm 의존성을 풀어 준다
38
38
  * (HMR은 Vite 기본). zip에서 빠지는 파일은 주지 않는다. 운영 콘텐츠 CSP 초안(rules/csp.ts, 서버 수정 제안 1번과 같은 값,
39
- * sandbox allow-scripts allow-same-origin)으로 응답하고, connect-src에만 Vite HMR 웹소켓(같은 콘텐츠 출처)과 올린 파일 경로를 더한다.
39
+ * sandbox allow-scripts allow-same-origin allow-downloads)으로 응답하고, connect-src에만 Vite HMR 웹소켓(같은 콘텐츠 출처)과 올린 파일 경로를 더한다.
40
40
  * 콘텐츠는 제 출처(127.0.0.1:<port+1>)로 돌아 저장소는 호스트와 따로 쓰고, 제 파일 요청은 같은 출처라 막히지 않는다.
41
41
  * 외부 이미지 · 글꼴 · fetch 등은 LXP에서처럼 막히고, 막힌 요청은 dev 스크립트가 화면 기록 · 터미널에 "막힌 외부 요청"으로
42
42
  * 알린다. LXP 자료 파일 서버처럼 CORS 헤더는 주지 않는다
package/es/dev/server.js CHANGED
@@ -18,6 +18,7 @@ import { hostPage } from './host-page.js';
18
18
  import { closePublicKv } from './kv-public-mock.js';
19
19
  import { handleLearnerBlobPut, serveLearnerFile, learnerFolderUrl, createLearnerUploadUrl, removeLearnerFiles } from './learner-files.js';
20
20
  import { serveLearnerShare, deleteLearnerShare, learnerSharesUrl, createSharedUploadUrl, removeLearnerShares } from './learner-shares.js';
21
+ import { bridgeContentResponse } from './link-bridge.js';
21
22
  import { DEV_MATERIAL_ID, handleMockApi, isTokenScenario, issueToken, createState } from './mock-api.js';
22
23
 
23
24
  /** 운영 콘텐츠 경로(/s/{exp}.{sig}/materials/{id}/{draft}/…)와 같은 모양. SDK가 여기서 자료 id를 읽는다 */
@@ -60,7 +61,7 @@ const listen = (server, port) => new Promise((ok, fail) => {
60
61
  * - 호스트(localhost): LXP 흉내 화면 + elice-material 흉내 API(/api) + 콘솔 수집
61
62
  * - 콘텐츠(127.0.0.1, 다른 출처): Vite dev 서버(ecdk 플러그인, engines/vite)가 원본을 주고 SDK 등 npm 의존성을 풀어 준다
62
63
  * (HMR은 Vite 기본). zip에서 빠지는 파일은 주지 않는다. 운영 콘텐츠 CSP 초안(rules/csp.ts, 서버 수정 제안 1번과 같은 값,
63
- * sandbox allow-scripts allow-same-origin)으로 응답하고, connect-src에만 Vite HMR 웹소켓(같은 콘텐츠 출처)과 올린 파일 경로를 더한다.
64
+ * sandbox allow-scripts allow-same-origin allow-downloads)으로 응답하고, connect-src에만 Vite HMR 웹소켓(같은 콘텐츠 출처)과 올린 파일 경로를 더한다.
64
65
  * 콘텐츠는 제 출처(127.0.0.1:<port+1>)로 돌아 저장소는 호스트와 따로 쓰고, 제 파일 요청은 같은 출처라 막히지 않는다.
65
66
  * 외부 이미지 · 글꼴 · fetch 등은 LXP에서처럼 막히고, 막힌 요청은 dev 스크립트가 화면 기록 · 터미널에 "막힌 외부 요청"으로
66
67
  * 알린다. LXP 자료 파일 서버처럼 CORS 헤더는 주지 않는다
@@ -197,6 +198,8 @@ async function startDevServer(opts) {
197
198
  res.writeHead(503).end('starting');
198
199
  return;
199
200
  }
201
+ // 링크 브리지: 페이지로 여는 HTML에 서버와 같은 조건 · 자리로 넣는다 (dev/link-bridge.ts)
202
+ bridgeContentResponse(req, res);
200
203
  vite.middlewares(req, res, () => {
201
204
  log(`[404] ${url.pathname.slice(CONTENT_PREFIX.length)} (zip에 없는 파일)`);
202
205
  res.writeHead(404).end('not found');
package/es/rules/csp.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { RulesSpec } from './types.js';
3
3
  * 운영 콘텐츠 응답 CSP 초안 (서버에 제안한 값).
4
4
  * 서버 CSP가 확정되면 이 목록을 맞춘다. `ecdk dev` 콘텐츠 서버가 이 값으로 응답하고, CLI README가 같은 글을 보인다
5
5
  * (`docs.test.ts`가 대조). 허용 외부 출처는 rules.json `externalAllow` 한 곳에서 해당 지시어에 더한다.
6
- * - sandbox는 `allow-same-origin`까지 (LXP iframe 속성과 같게, 콘텐츠는 제 하위 도메인 출처로 돈다)
6
+ * - sandbox는 `allow-same-origin`(콘텐츠는 제 하위 도메인 출처로 돈다) · `allow-downloads`(문서 템플릿 내려받기, 서버 · LXP iframe과 같게)
7
7
  * - `'self'` 대신 호스트를 직접 적는다 (헤더에 allow-same-origin이 없는 서버에서는 출처가 null이라 'self' 해석이 브라우저마다 다를 수 있음)
8
8
  * - `webrtc 'block'`은 지원하는 브라우저에서만 (모르는 브라우저는 무시)
9
9
  */
package/es/rules/csp.js CHANGED
@@ -4,11 +4,11 @@ import { rules } from './spec.js';
4
4
  * 운영 콘텐츠 응답 CSP 초안 (서버에 제안한 값).
5
5
  * 서버 CSP가 확정되면 이 목록을 맞춘다. `ecdk dev` 콘텐츠 서버가 이 값으로 응답하고, CLI README가 같은 글을 보인다
6
6
  * (`docs.test.ts`가 대조). 허용 외부 출처는 rules.json `externalAllow` 한 곳에서 해당 지시어에 더한다.
7
- * - sandbox는 `allow-same-origin`까지 (LXP iframe 속성과 같게, 콘텐츠는 제 하위 도메인 출처로 돈다)
7
+ * - sandbox는 `allow-same-origin`(콘텐츠는 제 하위 도메인 출처로 돈다) · `allow-downloads`(문서 템플릿 내려받기, 서버 · LXP iframe과 같게)
8
8
  * - `'self'` 대신 호스트를 직접 적는다 (헤더에 allow-same-origin이 없는 서버에서는 출처가 null이라 'self' 해석이 브라우저마다 다를 수 있음)
9
9
  * - `webrtc 'block'`은 지원하는 브라우저에서만 (모르는 브라우저는 무시)
10
10
  */
11
- const CONTENT_CSP = [['sandbox', 'allow-scripts', 'allow-same-origin'], ['default-src', "'none'"], ['script-src', '{CONTENT_HOST}', "'unsafe-inline'", "'unsafe-eval'", 'blob:'], ['style-src', '{CONTENT_HOST}', "'unsafe-inline'"],
11
+ const CONTENT_CSP = [['sandbox', 'allow-scripts', 'allow-same-origin', 'allow-downloads'], ['default-src', "'none'"], ['script-src', '{CONTENT_HOST}', "'unsafe-inline'", "'unsafe-eval'", 'blob:'], ['style-src', '{CONTENT_HOST}', "'unsafe-inline'"],
12
12
  // 엔트리 AI 채점 피드백의 블록 그림 출처 (서버 CONTENT_CSP_IMG_ORIGINS, 모든 환경). img-src에만, 운영 호스트는 서버가 AI팀과 확인 중
13
13
  ['img-src', '{CONTENT_HOST}', 'data:', 'blob:', 'https://datahub-central-01.elice.io'], ['font-src', '{CONTENT_HOST}', 'data:'], ['media-src', '{CONTENT_HOST}', 'data:', 'blob:'], ['connect-src', '{MATERIAL_API}'], ['worker-src', 'blob:'], ['frame-src', "'none'"], ['form-action', "'none'"], ['object-src', "'none'"], ['base-uri', '{CONTENT_HOST}'], ['webrtc', "'block'"], ['frame-ancestors', '{LXP_ORIGINS}']];
14
14
  /** 콘텐츠 CSP 헤더 값. values가 없으면 자리표시({CONTENT_HOST} 등) 그대로 (문서용) */
package/es/rules.json.js CHANGED
@@ -1,3 +1,3 @@
1
- const version="0.22.0";const manifest={file:"metadata.json",kinds:["material","description"],defaultKind:"material",modes:["learn","instructor","edit"],required:["learn"],kindModes:{material:["learn","instructor","edit"],description:["learn"]},graderTypes:["pattern","partial_pattern","rubric","entry"],commentaryFile:"commentary.txt",defaultEntry:"index.html"};const externalAllow={"style-src":[],"font-src":[],"frame-src":["https://entry-workspace.elice.io"]};const minVersions={sdk:"1.0.0-alpha.4"};const layouts={content:["single","split","stage","media"],regions:["main","aside","stage","controls","readout","actions"]};const limits={maxZipBytes:20971520,maxUnpackedBytes:209715200,maxFiles:300,maxEntries:3000,warnRatio:0.8,maxImageBytes:1048576,maxScreenBytes:1572864};const allowedExtensions=["html","htm","css","js","mjs","json","map","txt","md","csv","xml","vtt","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","mp3","wav","ogg","m4a","mp4","webm","woff","woff2","ttf","otf","glb","gltf","bin","wasm","pdf"];const imageExtensions=["png","jpg","jpeg","gif","webp","avif","bmp","svg"];const excluded={secret:{level:"error",files:[".env",".env.*","elice.config.*","grading.json","answers.*","*.pem","*.key"],dirs:[]},dev:{level:"error",files:[],dirs:[".git","node_modules",".ecdk"]},junk:{level:"warn",files:[".DS_Store","Thumbs.db","desktop.ini"],dirs:["__MACOSX"]}};const forbiddenApis=[{id:"api.parent-access",pattern:"\\bwindow\\.(?:top|parent)\\b|\\b(?:top|parent)\\.(?:document|location)\\b",title:"부모 창 직접 접근 (다른 출처라 막힘, SDK 사용)"},{id:"api.cookie",pattern:"\\bdocument\\.cookie\\b",title:"쿠키 사용 (이 브라우저에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.storage",pattern:"\\b(?:localStorage|sessionStorage|indexedDB)\\b",title:"브라우저 저장소 사용 (이 브라우저 · 기기에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.eval",pattern:"\\beval\\s*\\(|\\bnew\\s+Function\\s*\\(|\\bset(?:Timeout|Interval)\\s*\\(\\s*[\"'`]",title:"eval · new Function · 문자열 setTimeout 사용"},{id:"api.dialog",pattern:"\\b(?:alert|confirm|prompt)\\s*\\(",title:"alert · confirm · prompt 사용 (sandbox에서 막힘, 화면 안 메시지로)"},{id:"api.window-open",pattern:"\\bwindow\\.open\\s*\\(",title:"새 창 열기 (sandbox에서 막힘)"},{id:"api.external-send",pattern:"(?<!\\bmlapi\\??\\.)\\b(?:fetch|sendBeacon|EventSource|WebSocket)\\s*\\(\\s*['\"`](?:https?|wss?):\\/\\/|\\.open\\(\\s*['\"`][A-Za-z]+['\"`]\\s*,\\s*['\"`]https?:\\/\\/",title:"외부 주소로 요청을 보냄 (학생 정보 유출 위험)"},{id:"sec.html-injection",pattern:"\\.(?:inner|outer)HTML\\s*\\+?=(?!=)(?!\\s*(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`$\\n]*`)\\s*(?:[;,)}\\n]|$))|\\.insertAdjacentHTML\\s*\\(|\\bdocument\\.write(?:ln)?\\s*\\(|\\bdangerouslySetInnerHTML\\b",title:"HTML 문자열을 그대로 넣음 (XSS 위험, textContent나 이스케이프 사용)"},{id:"sec.redirect",pattern:"\\blocation(?:\\.href)?\\s*=(?!=)(?!\\s*[\"'`][^\"'`$]*[\"'`])|\\blocation\\.(?:replace|assign)\\s*\\((?!\\s*[\"'`][^\"'`$]*[\"'`]\\s*\\))",title:"주소를 값으로 바꿈 (열린 리디렉션 · javascript: XSS 위험)"},{id:"sec.postmessage-wildcard",pattern:"\\.postMessage\\s*\\([^;]*?,\\s*[\"'`]\\*[\"'`]",title:"postMessage 대상이 * (아무 창이나 받을 수 있음)"},{id:"sandbox.fetch-local",pattern:"(?<!\\bmlapi\\??\\.)\\bfetch\\(\\s*(['\"`])(?![a-z][a-z0-9+.-]*:|//)[^'\"`]*(?<!\\.json)\\1|\\bimport\\(\\s*(?!['\"`])[A-Za-z_$]|\\bnew\\s+(?:Shared)?Worker\\(\\s*['\"`](?![a-z][a-z0-9+.-]*:|//)",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음 (콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없으면 CORS로 막힘)"}];const secretPatterns=[{source:"elice-hardcoded-private-key · detected-private-key · detected-pgp-private-key-block",title:"개인키",pattern:"-----BEGIN[ A-Z0-9_-]*PRIVATE KEY(?: BLOCK)?-----"},{source:"elice-hardcoded-secret",title:"하드코딩된 비밀 값",pattern:"(?:secret|token|api[_-]?key|access[_-]?key|password|passwd)\\s*[:=]\\s*[\"'][A-Za-z0-9_\\-/+]{16,}[\"']",flags:"i",not:"os\\.environ|getenv|process\\.env|dotenv|\\$\\{|<[a-z_]+>|example|dummy|placeholder|changeme|xxxx|your[_-]"},{source:"detected-aws-access-key-id-value",title:"AWS 액세스 키",pattern:"\\b(?:A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\\b",not:"example|sample|test|fake"},{source:"detected-aws-secret-access-key",title:"AWS 비밀 키",pattern:"[\"'`]?aws_?\\w*secret_?\\w*[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?[A-Za-z0-9/+=]{40}",flags:"i",not:"example|sample|test|fake|xxxxxx"},{source:"detected-aws-session-token",title:"AWS 세션 토큰",pattern:"AWS_SESSION_TOKEN\\s*(?::|=>|=)\\s*[A-Za-z0-9/+=]{16,}",flags:"i",not:"example|sample|test|fake"},{source:"detected-aws-appsync-graphql-key",title:"AWS AppSync 키",pattern:"da2-[a-z0-9]{26}"},{source:"detected-amazon-mws-auth-token",title:"Amazon MWS 토큰",pattern:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{source:"detected-artifactory-token",title:"Artifactory 토큰",pattern:"\\bAKC[a-zA-Z0-9]{10,}\\n",not:"sha(?:128|256|512)"},{source:"detected-artifactory-password",title:"Artifactory 비밀번호",pattern:"[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy].*\\bAP[\\dA-F][a-zA-Z0-9]{8,}|\\bAP[\\dA-F][a-zA-Z0-9]{8,}.*[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy]",not:"sha(?:1|2|3|118|256|512)"},{source:"detected-bcrypt-hash",title:"bcrypt 해시",pattern:"\\$2[aby]?\\$\\d+\\$[./A-Za-z0-9]{53}"},{source:"detected-codeclimate",title:"Code Climate 토큰",pattern:"codeclima.{0,50}[\"'`]?[0-9a-f]{64}",flags:"i"},{source:"detected-etc-shadow",title:"/etc/shadow 내용",pattern:"^\\s*root:[x!*]*:\\d*:\\d*",flags:"m"},{source:"detected-facebook-access-token",title:"Facebook 액세스 토큰",pattern:"EAACEdEose0cBA[0-9A-Za-z]+|EAAAACZAVC6ygB[0-9A-Za-z]+|EAAAAZAw4[0-9A-Za-z]+"},{source:"detected-facebook-oauth",title:"Facebook OAuth 비밀",pattern:"[fF][aA][cC][eE][bB][oO][oO][kK].*[tT][oO][kK][eE][nN].*[\"'`]?[0-9a-f]{32}"},{source:"detected-google-gcm-service-account",title:"Google 서비스 계정 키",pattern:"[\"'`]?type[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?service_account"},{source:"detected-google-oauth-access-token",title:"Google OAuth 토큰",pattern:"ya29\\.[0-9A-Za-z_-]+"},{source:"detected-heroku-api-key",title:"Heroku API 키",pattern:"[hH][eE][rR][oO][kK][uU].*[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"},{source:"detected-hockeyapp",title:"HockeyApp 토큰",pattern:"hockey.{0,50}[\"'`]?[0-9a-f]{32}",flags:"i"},{source:"detected-mailchimp-api-key",title:"Mailchimp API 키",pattern:"[0-9a-f]{32}-us\\d{1,2}"},{source:"detected-mailgun-api-key",title:"Mailgun API 키",pattern:"key-[0-9a-zA-Z]{32}"},{source:"detected-onfido-live-api-token",title:"Onfido API 토큰",pattern:"api_live(?:_[a-zA-Z]{2})?\\.[a-zA-Z0-9_-]{11}\\.[a-zA-Z0-9_-]{32}"},{source:"detected-outlook-team",title:"Outlook 웹훅",pattern:"https://outlook\\.office\\.com/webhook/[0-9a-f-]{36}"},{source:"detected-paypal-braintree-access-token",title:"PayPal Braintree 토큰",pattern:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-z]{32}"},{source:"detected-picatic-api-key",title:"Picatic API 키",pattern:"sk_live_[0-9a-z]{32}"},{source:"detected-sauce-token",title:"Sauce Labs 토큰",pattern:"sauce.{0,50}[\"'`]?[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}",flags:"i"},{source:"detected-slack-token",title:"Slack 토큰",pattern:"xox[pboa]-\\d{12}-\\d{12}-\\d{12}-[a-z0-9]{32}|xox.-\\d{12}-\\d{12}-[0-9a-zA-Z]{24}"},{source:"detected-slack-webhook",title:"Slack 웹훅",pattern:"https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,10}/[a-zA-Z0-9_]{24}",not:"T00000000/B00000000/X{24}"},{source:"detected-sonarqube-docs-api-key",title:"SonarQube 토큰",pattern:"sonar[a-z0-9_.-]{0,30}(?:token|key|login|password|pass|secret|auth)?\\s*[:=]\\s*\\\\?[\"'`]?[0-9a-f]{40}\\b",flags:"i"},{source:"detected-square-access-token",title:"Square 액세스 토큰",pattern:"sq0atp-[0-9A-Za-z_-]{22}"},{source:"detected-square-oauth-secret",title:"Square OAuth 비밀",pattern:"sq0csp-[0-9A-Za-z\\\\_-]{43}"},{source:"detected-ssh-password",title:"sshpass 비밀번호",pattern:"sshpass[ ]-p\\s*['\"]"},{source:"detected-stripe-api-key",title:"Stripe API 키",pattern:"sk_live_[0-9a-zA-Z]{24}"},{source:"detected-stripe-restricted-api-key",title:"Stripe 제한 키",pattern:"rk_live_[0-9a-zA-Z]{24}"},{source:"detected-telegram-bot-api-key",title:"Telegram 봇 토큰",pattern:"\\d+:AA[0-9A-Za-z_-]{33}",not:"go\\.mod|v\\d+\\.\\d+\\.\\d+"},{source:"detected-twilio-api-key",title:"Twilio API 키",pattern:"SK[0-9a-fA-F]{32}"},{source:"detected-username-and-password-in-uri",title:"주소에 들어 있는 아이디 · 비밀번호",pattern:"[A-Za-z0-9+.-]*(?:http|sql|ftp|smtp)[A-Za-z0-9+.-]*://\\{?[A-Za-z][A-Za-z0-9_-]{5,31}\\}?:(?=[^\\s@/]*\\d)(?=[^\\s@/]*[a-z])(?=[^\\s@/]*[A-Z])(?=[^\\s@/]*[!-.:-?\\[-`{-~])[^\\s@/]{6,32}@"}];const rules=[{id:"manifest.missing",level:"error",scope:"server",title:"metadata.json 없음"},{id:"manifest.invalid",level:"error",scope:"server",title:"metadata.json 형식 오류"},{id:"manifest.entry-missing",level:"error",scope:"server",title:"metadata.json에 적은 파일(진입 파일 · 학습 참고 내용)이 없음"},{id:"manifest.commentary-missing",level:"error",scope:"server",title:"학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"},{id:"manifest.grading-types",level:"warn",scope:"server",title:"쓰지 않는 gradingTypes (완료 정책은 LXP 설정, 채점 방식은 편집 화면)"},{id:"manifest.completion-policies-ignored",level:"warn",scope:"client",title:"쓰지 않는 completionPolicies · 완료 정책 화면(screens.completionPolicy) (완료 정책은 LXP 설정, build가 zip에서 뺌)"},{id:"entry.missing",level:"error",scope:"server",title:"학생 화면 진입 파일 없음"},{id:"entry.nested",level:"error",scope:"server",title:"폴더째 묶은 zip (metadata.json이 최상위에 없음)"},{id:"input.not-zip",level:"error",scope:"server",title:"zip이 아닌 업로드 (HTML 파일 하나 등)"},{id:"limit.zip-size",level:"error",scope:"server",title:"zip 크기 한도 초과"},{id:"limit.file-count",level:"error",scope:"server",title:"파일 개수 한도 초과"},{id:"limit.unpacked-size",level:"error",scope:"server",title:"풀면 너무 큰 zip (압축 폭탄 의심)"},{id:"limit.near",level:"warn",scope:"client",title:"한도에 가까움"},{id:"limit.screen-size",level:"warn",scope:"client",title:"화면 하나를 열 때 받는 JS · CSS가 큼 (기준 limits.maxScreenBytes, 큰 라이브러리는 import()로)"},{id:"path.unsafe",level:"error",scope:"server",title:"안전하지 않은 경로 (절대경로, .., 역슬래시, 정규화 안 됨)"},{id:"path.case-collision",level:"error",scope:"server",title:"대소문자만 다른 경로"},{id:"path.non-ascii",level:"warn",scope:"client",title:"공백·한글 등 ASCII 밖 문자가 든 경로"},{id:"file.extension",level:"error",scope:"server",title:"허용하지 않는 확장자"},{id:"file.secret",level:"error",scope:"server",title:"정답·비밀 파일 포함"},{id:"file.dev",level:"error",scope:"server",title:"개발용 폴더 포함"},{id:"file.junk",level:"warn",scope:"server",title:"운영체제가 만든 불필요한 파일"},{id:"file.large-image",level:"warn",scope:"client",title:"1MB 넘는 이미지"},{id:"file.encoding",level:"error",scope:"client",title:"UTF-8이 아닌 텍스트 파일 (한글이 깨짐)"},{id:"file.bom",level:"warn",scope:"client",title:"학습 참고 내용 맨 앞의 BOM (보이지 않는 글자)"},{id:"content.answer-key",level:"warn",scope:"client",title:"학생에게 내려가는 JSON에 정답처럼 보이는 키"},{id:"grading.no-submit",level:"warn",scope:"client",title:"편집 화면이 채점 설정을 저장하는데 화면 코드에 제출이 없음"},{id:"grading.client-score",level:"warn",scope:"client",title:"제출하는 답에 화면에서 계산한 점수(score · scores · points key)를 넣음 (서버는 답 안 점수를 쓰지 않음, settings.grading rubric · pattern으로 채점)"},{id:"grading.ai-without-grading",level:"warn",scope:"client",title:"화면이 AI(mlapi.fetch)를 부르고 제출하는데 편집 화면이 채점 설정(settings.grading)을 저장하지 않음 (on_graded면 0점 · 미완료, on_submit이면 늘 100점. AI 평가는 rubric으로)"},{id:"edit.no-save",level:"warn",scope:"client",title:"편집 화면인데 저장이 없음"},{id:"project.legacy-file",level:"warn",scope:"client",title:"더 쓰지 않는 프로젝트 파일(elice.config.json · content.json · grading.json)이 남아 있음 (프로젝트 검사만, ADR 0011)"},{id:"build.template-unknown",level:"warn",scope:"client",title:"metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"},{id:"layout.unknown",level:"warn",scope:"client",title:"data-ec-layout · data-ec-region에 키트가 모르는 값 (single · split · stage · media, main · aside · stage · controls · readout · actions)"},{id:"layout.own-step-nav",level:"warn",scope:"client",title:"화면 코드가 이전 · 다음 버튼을 직접 그림 (LXP 이전 · 다음 막대와 헷갈림, 키트 app.useStepper)"},{id:"ref.missing",level:"error",scope:"client",title:"참조한 파일이 없음"},{id:"ref.case-mismatch",level:"error",scope:"client",title:"참조 경로의 대소문자가 실제 파일과 다름"},{id:"ref.root-absolute",level:"error",scope:"client",title:"/로 시작하는 경로 · 자기 폴더가 아닌 <base href> (배포 주소 /s/{서명}/ 아래에서 깨짐)"},{id:"ref.external-script",level:"error",scope:"client",title:"외부 스크립트 (zip 안에 넣고 상대경로로)"},{id:"ref.external-request",level:"error",scope:"client",title:"외부 리소스 요청 (이미지 · 글꼴 · 영상 · CSS, 콘텐츠 CSP가 막음: zip 안에 넣기)"},{id:"ref.external-font",level:"warn",scope:"client",title:"허용 목록(externalAllow)의 외부 글꼴 (망분리 기관에서는 받지 못해 기본 글꼴로 보일 수 있음)"},{id:"ref.insecure",level:"error",scope:"client",title:"http:// 외부 리소스 (https 페이지 · 콘텐츠 CSP가 막음)"},{id:"ref.vendor-external-url",level:"warn",scope:"client",title:"라이브러리 파일 안의 외부 주소 (실행 중 외부를 부르면 콘텐츠 CSP가 막음, ecdk dev 로그 확인)"},{id:"ref.script-not-public",level:"error",scope:"client",title:"type=\"module\" 없는 <script src>가 public/ 밖 파일 (프로젝트 검사만. build가 묶지 않고 zip에도 넣지 않음, type=\"module\"을 붙이거나 public/으로)"},{id:"sandbox.module-src",level:"warn",scope:"client",title:"모듈 스크립트 파일(<script type=\"module\" src>): 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막혀 화면이 뜨지 않음 (ecdk build가 HTML 안에 묶음)"},{id:"sandbox.fetch-local",level:"warn",scope:"client",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음: 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막힘 (JSON fetch · 문자열 import()는 ecdk build가 처리)"},{id:"html.img-alt",level:"warn",scope:"client",title:"대체 텍스트 없는 이미지"},{id:"html.iframe",level:"error",scope:"client",title:"src로 띄우는 iframe · frame, object · embed (콘텐츠 CSP가 막음, 영상은 Elice 비디오 자료로, srcdoc 미리보기 · 허용 목록(externalAllow frame-src) 출처의 iframe은 통과)"},{id:"html.form",level:"warn",scope:"client",title:"form 제출 (sandbox · CSP form-action이 막음, 버튼 click으로 처리)"},{id:"api.external-send",level:"error",scope:"client",title:"외부 주소로 요청 보냄"},{id:"api.parent-access",level:"warn",scope:"client",title:"부모 창 직접 접근"},{id:"api.cookie",level:"warn",scope:"client",title:"쿠키 사용 (학습 기록이 아님)"},{id:"api.storage",level:"warn",scope:"client",title:"브라우저 저장소 사용 (학습 기록이 아님)"},{id:"api.eval",level:"warn",scope:"client",title:"eval · new Function 사용"},{id:"api.dialog",level:"error",scope:"client",title:"alert · confirm · prompt 사용"},{id:"api.window-open",level:"error",scope:"client",title:"새 창 열기"},{id:"sec.secret",level:"error",scope:"server",title:"비밀 값 (키 · 토큰 · 비밀번호)"},{id:"sec.answer-in-bundle",level:"warn",scope:"client",title:"편집 화면에 저장한 정답(.ecdk/settings.json 채점 설정)과 같은 글이 zip에 들어갈 파일에 있음 (프로젝트 검사만)"},{id:"sec.html-injection",level:"warn",scope:"client",title:"HTML 문자열 삽입"},{id:"sec.redirect",level:"warn",scope:"client",title:"주소를 값으로 바꿈"},{id:"sec.postmessage-wildcard",level:"warn",scope:"client",title:"postMessage 대상 *"},{id:"privacy.personal-field",level:"warn",scope:"client",title:"학습자 개인정보를 받는 입력 칸(전화 · 이메일 · 이름 autocomplete 등)이나 개인정보 · 학습자 이름(account.fullname)을 제출 · 저장 · AI 호출로 보냄 (익명 id account.anonymousId, 이름은 보여 주기만)"},{id:"sdk.outdated",level:"error",scope:"client",title:"SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk. alpha.3 이하는 LXP 편집 화면 저장(초안) 실패, npm update @eliceio/cdk)"},{id:"sdk.lib-copy",level:"error",scope:"client",title:"SDK 복사본 lib/cdk.js (zip에 넣지 않음, 프로젝트 검사만. SDK는 package.json 의존성 @eliceio/cdk를 build가 번들로 묶음)"}];var rulesJson = {version:version,manifest:manifest,externalAllow:externalAllow,minVersions:minVersions,layouts:layouts,limits:limits,allowedExtensions:allowedExtensions,imageExtensions:imageExtensions,excluded:excluded,forbiddenApis:forbiddenApis,secretPatterns:secretPatterns,rules:rules};
1
+ const version="0.23.0";const manifest={file:"metadata.json",kinds:["material","description"],defaultKind:"material",modes:["learn","instructor","edit"],required:["learn"],kindModes:{material:["learn","instructor","edit"],description:["learn"]},graderTypes:["pattern","partial_pattern","rubric","entry"],commentaryFile:"commentary.txt",defaultEntry:"index.html"};const externalAllow={"style-src":[],"font-src":[],"frame-src":["https://entry-workspace.elice.io"]};const minVersions={sdk:"1.0.0-alpha.4"};const layouts={content:["single","split","stage","media"],regions:["main","aside","stage","controls","readout","actions"]};const limits={maxZipBytes:20971520,maxUnpackedBytes:209715200,maxFiles:300,maxEntries:3000,warnRatio:0.8,maxImageBytes:1048576,maxScreenBytes:1572864};const allowedExtensions=["html","htm","css","js","mjs","json","map","txt","md","csv","xml","vtt","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","mp3","wav","ogg","m4a","mp4","webm","woff","woff2","ttf","otf","glb","gltf","bin","wasm","pdf"];const imageExtensions=["png","jpg","jpeg","gif","webp","avif","bmp","svg"];const excluded={secret:{level:"error",files:[".env",".env.*","elice.config.*","grading.json","answers.*","*.pem","*.key"],dirs:[]},dev:{level:"error",files:[],dirs:[".git","node_modules",".ecdk"]},junk:{level:"warn",files:[".DS_Store","Thumbs.db","desktop.ini"],dirs:["__MACOSX"]}};const forbiddenApis=[{id:"api.parent-access",pattern:"\\bwindow\\.(?:top|parent)\\b|\\b(?:top|parent)\\.(?:document|location)\\b",title:"부모 창 직접 접근 (다른 출처라 막힘, SDK 사용)"},{id:"api.cookie",pattern:"\\bdocument\\.cookie\\b",title:"쿠키 사용 (이 브라우저에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.storage",pattern:"\\b(?:localStorage|sessionStorage|indexedDB)\\b",title:"브라우저 저장소 사용 (이 브라우저 · 기기에만 남고 학습 기록이 아님, 남길 입력값은 SDK로 저장)"},{id:"api.eval",pattern:"\\beval\\s*\\(|\\bnew\\s+Function\\s*\\(|\\bset(?:Timeout|Interval)\\s*\\(\\s*[\"'`]",title:"eval · new Function · 문자열 setTimeout 사용"},{id:"api.dialog",pattern:"\\b(?:alert|confirm|prompt)\\s*\\(",title:"alert · confirm · prompt 사용 (sandbox에서 막힘, 화면 안 메시지로)"},{id:"api.window-open",pattern:"\\bwindow\\.open\\s*\\(",title:"window.open 새 창 (sandbox 팝업이라 외부 페이지가 깨짐, 외부 링크는 <a href>로 두면 LXP가 새 탭으로 엶)"},{id:"api.external-send",pattern:"(?<!\\bmlapi\\??\\.)\\b(?:fetch|sendBeacon|EventSource|WebSocket)\\s*\\(\\s*['\"`](?:https?|wss?):\\/\\/|\\.open\\(\\s*['\"`][A-Za-z]+['\"`]\\s*,\\s*['\"`]https?:\\/\\/",title:"외부 주소로 요청을 보냄 (학생 정보 유출 위험)"},{id:"sec.html-injection",pattern:"\\.(?:inner|outer)HTML\\s*\\+?=(?!=)(?!\\s*(?:'[^'\\n]*'|\"[^\"\\n]*\"|`[^`$\\n]*`)\\s*(?:[;,)}\\n]|$))|\\.insertAdjacentHTML\\s*\\(|\\bdocument\\.write(?:ln)?\\s*\\(|\\bdangerouslySetInnerHTML\\b",title:"HTML 문자열을 그대로 넣음 (XSS 위험, textContent나 이스케이프 사용)"},{id:"sec.redirect",pattern:"\\blocation(?:\\.href)?\\s*=(?!=)(?!\\s*[\"'`][^\"'`$]*[\"'`])|\\blocation\\.(?:replace|assign)\\s*\\((?!\\s*[\"'`][^\"'`$]*[\"'`]\\s*\\))",title:"주소를 값으로 바꿈 (열린 리디렉션 · javascript: XSS 위험)"},{id:"sec.postmessage-wildcard",pattern:"\\.postMessage\\s*\\([^;]*?,\\s*[\"'`]\\*[\"'`]",title:"postMessage 대상이 * (아무 창이나 받을 수 있음)"},{id:"sandbox.fetch-local",pattern:"(?<!\\bmlapi\\??\\.)\\bfetch\\(\\s*(['\"`])(?![a-z][a-z0-9+.-]*:|//)[^'\"`]*(?<!\\.json)\\1|\\bimport\\(\\s*(?!['\"`])[A-Za-z_$]|\\bnew\\s+(?:Shared)?Worker\\(\\s*['\"`](?![a-z][a-z0-9+.-]*:|//)",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음 (콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없으면 CORS로 막힘)"}];const secretPatterns=[{source:"elice-hardcoded-private-key · detected-private-key · detected-pgp-private-key-block",title:"개인키",pattern:"-----BEGIN[ A-Z0-9_-]*PRIVATE KEY(?: BLOCK)?-----"},{source:"elice-hardcoded-secret",title:"하드코딩된 비밀 값",pattern:"(?:secret|token|api[_-]?key|access[_-]?key|password|passwd)\\s*[:=]\\s*[\"'][A-Za-z0-9_\\-/+]{16,}[\"']",flags:"i",not:"os\\.environ|getenv|process\\.env|dotenv|\\$\\{|<[a-z_]+>|example|dummy|placeholder|changeme|xxxx|your[_-]"},{source:"detected-aws-access-key-id-value",title:"AWS 액세스 키",pattern:"\\b(?:A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}\\b",not:"example|sample|test|fake"},{source:"detected-aws-secret-access-key",title:"AWS 비밀 키",pattern:"[\"'`]?aws_?\\w*secret_?\\w*[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?[A-Za-z0-9/+=]{40}",flags:"i",not:"example|sample|test|fake|xxxxxx"},{source:"detected-aws-session-token",title:"AWS 세션 토큰",pattern:"AWS_SESSION_TOKEN\\s*(?::|=>|=)\\s*[A-Za-z0-9/+=]{16,}",flags:"i",not:"example|sample|test|fake"},{source:"detected-aws-appsync-graphql-key",title:"AWS AppSync 키",pattern:"da2-[a-z0-9]{26}"},{source:"detected-amazon-mws-auth-token",title:"Amazon MWS 토큰",pattern:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{source:"detected-artifactory-token",title:"Artifactory 토큰",pattern:"\\bAKC[a-zA-Z0-9]{10,}\\n",not:"sha(?:128|256|512)"},{source:"detected-artifactory-password",title:"Artifactory 비밀번호",pattern:"[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy].*\\bAP[\\dA-F][a-zA-Z0-9]{8,}|\\bAP[\\dA-F][a-zA-Z0-9]{8,}.*[Aa][Rr][Tt][Ii][-_]?[Ff][Aa][Cc][Tt][Oo][Rr][Yy]",not:"sha(?:1|2|3|118|256|512)"},{source:"detected-bcrypt-hash",title:"bcrypt 해시",pattern:"\\$2[aby]?\\$\\d+\\$[./A-Za-z0-9]{53}"},{source:"detected-codeclimate",title:"Code Climate 토큰",pattern:"codeclima.{0,50}[\"'`]?[0-9a-f]{64}",flags:"i"},{source:"detected-etc-shadow",title:"/etc/shadow 내용",pattern:"^\\s*root:[x!*]*:\\d*:\\d*",flags:"m"},{source:"detected-facebook-access-token",title:"Facebook 액세스 토큰",pattern:"EAACEdEose0cBA[0-9A-Za-z]+|EAAAACZAVC6ygB[0-9A-Za-z]+|EAAAAZAw4[0-9A-Za-z]+"},{source:"detected-facebook-oauth",title:"Facebook OAuth 비밀",pattern:"[fF][aA][cC][eE][bB][oO][oO][kK].*[tT][oO][kK][eE][nN].*[\"'`]?[0-9a-f]{32}"},{source:"detected-google-gcm-service-account",title:"Google 서비스 계정 키",pattern:"[\"'`]?type[\"'`]?\\s{0,50}(?::|=>|=)\\s{0,50}[\"'`]?service_account"},{source:"detected-google-oauth-access-token",title:"Google OAuth 토큰",pattern:"ya29\\.[0-9A-Za-z_-]+"},{source:"detected-heroku-api-key",title:"Heroku API 키",pattern:"[hH][eE][rR][oO][kK][uU].*[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"},{source:"detected-hockeyapp",title:"HockeyApp 토큰",pattern:"hockey.{0,50}[\"'`]?[0-9a-f]{32}",flags:"i"},{source:"detected-mailchimp-api-key",title:"Mailchimp API 키",pattern:"[0-9a-f]{32}-us\\d{1,2}"},{source:"detected-mailgun-api-key",title:"Mailgun API 키",pattern:"key-[0-9a-zA-Z]{32}"},{source:"detected-onfido-live-api-token",title:"Onfido API 토큰",pattern:"api_live(?:_[a-zA-Z]{2})?\\.[a-zA-Z0-9_-]{11}\\.[a-zA-Z0-9_-]{32}"},{source:"detected-outlook-team",title:"Outlook 웹훅",pattern:"https://outlook\\.office\\.com/webhook/[0-9a-f-]{36}"},{source:"detected-paypal-braintree-access-token",title:"PayPal Braintree 토큰",pattern:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-z]{32}"},{source:"detected-picatic-api-key",title:"Picatic API 키",pattern:"sk_live_[0-9a-z]{32}"},{source:"detected-sauce-token",title:"Sauce Labs 토큰",pattern:"sauce.{0,50}[\"'`]?[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}",flags:"i"},{source:"detected-slack-token",title:"Slack 토큰",pattern:"xox[pboa]-\\d{12}-\\d{12}-\\d{12}-[a-z0-9]{32}|xox.-\\d{12}-\\d{12}-[0-9a-zA-Z]{24}"},{source:"detected-slack-webhook",title:"Slack 웹훅",pattern:"https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,10}/[a-zA-Z0-9_]{24}",not:"T00000000/B00000000/X{24}"},{source:"detected-sonarqube-docs-api-key",title:"SonarQube 토큰",pattern:"sonar[a-z0-9_.-]{0,30}(?:token|key|login|password|pass|secret|auth)?\\s*[:=]\\s*\\\\?[\"'`]?[0-9a-f]{40}\\b",flags:"i"},{source:"detected-square-access-token",title:"Square 액세스 토큰",pattern:"sq0atp-[0-9A-Za-z_-]{22}"},{source:"detected-square-oauth-secret",title:"Square OAuth 비밀",pattern:"sq0csp-[0-9A-Za-z\\\\_-]{43}"},{source:"detected-ssh-password",title:"sshpass 비밀번호",pattern:"sshpass[ ]-p\\s*['\"]"},{source:"detected-stripe-api-key",title:"Stripe API 키",pattern:"sk_live_[0-9a-zA-Z]{24}"},{source:"detected-stripe-restricted-api-key",title:"Stripe 제한 키",pattern:"rk_live_[0-9a-zA-Z]{24}"},{source:"detected-telegram-bot-api-key",title:"Telegram 봇 토큰",pattern:"\\d+:AA[0-9A-Za-z_-]{33}",not:"go\\.mod|v\\d+\\.\\d+\\.\\d+"},{source:"detected-twilio-api-key",title:"Twilio API 키",pattern:"SK[0-9a-fA-F]{32}"},{source:"detected-username-and-password-in-uri",title:"주소에 들어 있는 아이디 · 비밀번호",pattern:"[A-Za-z0-9+.-]*(?:http|sql|ftp|smtp)[A-Za-z0-9+.-]*://\\{?[A-Za-z][A-Za-z0-9_-]{5,31}\\}?:(?=[^\\s@/]*\\d)(?=[^\\s@/]*[a-z])(?=[^\\s@/]*[A-Z])(?=[^\\s@/]*[!-.:-?\\[-`{-~])[^\\s@/]{6,32}@"}];const rules=[{id:"manifest.missing",level:"error",scope:"server",title:"metadata.json 없음"},{id:"manifest.invalid",level:"error",scope:"server",title:"metadata.json 형식 오류"},{id:"manifest.entry-missing",level:"error",scope:"server",title:"metadata.json에 적은 파일(진입 파일 · 학습 참고 내용)이 없음"},{id:"manifest.commentary-missing",level:"error",scope:"server",title:"학습 참고 내용 파일(commentary.txt) 없음 (LXP 업로드가 거절함)"},{id:"manifest.grading-types",level:"warn",scope:"server",title:"쓰지 않는 gradingTypes (완료 정책은 LXP 설정, 채점 방식은 편집 화면)"},{id:"manifest.completion-policies-ignored",level:"warn",scope:"client",title:"쓰지 않는 completionPolicies · 완료 정책 화면(screens.completionPolicy) (완료 정책은 LXP 설정, build가 zip에서 뺌)"},{id:"entry.missing",level:"error",scope:"server",title:"학생 화면 진입 파일 없음"},{id:"entry.nested",level:"error",scope:"server",title:"폴더째 묶은 zip (metadata.json이 최상위에 없음)"},{id:"input.not-zip",level:"error",scope:"server",title:"zip이 아닌 업로드 (HTML 파일 하나 등)"},{id:"limit.zip-size",level:"error",scope:"server",title:"zip 크기 한도 초과"},{id:"limit.file-count",level:"error",scope:"server",title:"파일 개수 한도 초과"},{id:"limit.unpacked-size",level:"error",scope:"server",title:"풀면 너무 큰 zip (압축 폭탄 의심)"},{id:"limit.near",level:"warn",scope:"client",title:"한도에 가까움"},{id:"limit.screen-size",level:"warn",scope:"client",title:"화면 하나를 열 때 받는 JS · CSS가 큼 (기준 limits.maxScreenBytes, 큰 라이브러리는 import()로)"},{id:"path.unsafe",level:"error",scope:"server",title:"안전하지 않은 경로 (절대경로, .., 역슬래시, 정규화 안 됨)"},{id:"path.case-collision",level:"error",scope:"server",title:"대소문자만 다른 경로"},{id:"path.non-ascii",level:"warn",scope:"client",title:"공백·한글 등 ASCII 밖 문자가 든 경로"},{id:"file.extension",level:"error",scope:"server",title:"허용하지 않는 확장자"},{id:"file.secret",level:"error",scope:"server",title:"정답·비밀 파일 포함"},{id:"file.dev",level:"error",scope:"server",title:"개발용 폴더 포함"},{id:"file.junk",level:"warn",scope:"server",title:"운영체제가 만든 불필요한 파일"},{id:"file.large-image",level:"warn",scope:"client",title:"1MB 넘는 이미지"},{id:"file.encoding",level:"error",scope:"client",title:"UTF-8이 아닌 텍스트 파일 (한글이 깨짐)"},{id:"file.bom",level:"warn",scope:"client",title:"학습 참고 내용 맨 앞의 BOM (보이지 않는 글자)"},{id:"content.answer-key",level:"warn",scope:"client",title:"학생에게 내려가는 JSON에 정답처럼 보이는 키"},{id:"grading.no-submit",level:"warn",scope:"client",title:"편집 화면이 채점 설정을 저장하는데 화면 코드에 제출이 없음"},{id:"grading.client-score",level:"warn",scope:"client",title:"제출하는 답에 화면에서 계산한 점수(score · scores · points key)를 넣음 (서버는 답 안 점수를 쓰지 않음, settings.grading rubric · pattern으로 채점)"},{id:"grading.ai-without-grading",level:"warn",scope:"client",title:"화면이 AI(mlapi.fetch)를 부르고 제출하는데 편집 화면이 채점 설정(settings.grading)을 저장하지 않음 (on_graded면 0점 · 미완료, on_submit이면 늘 100점. AI 평가는 rubric으로)"},{id:"edit.no-save",level:"warn",scope:"client",title:"편집 화면인데 저장이 없음"},{id:"project.legacy-file",level:"warn",scope:"client",title:"더 쓰지 않는 프로젝트 파일(elice.config.json · content.json · grading.json)이 남아 있음 (프로젝트 검사만, ADR 0011)"},{id:"build.template-unknown",level:"warn",scope:"client",title:"metadata.json build.template이 이 ecdk가 모르는 템플릿이거나 더 새 템플릿 버전"},{id:"layout.unknown",level:"warn",scope:"client",title:"data-ec-layout · data-ec-region에 키트가 모르는 값 (single · split · stage · media, main · aside · stage · controls · readout · actions)"},{id:"layout.own-step-nav",level:"warn",scope:"client",title:"화면 코드가 이전 · 다음 버튼을 직접 그림 (LXP 이전 · 다음 막대와 헷갈림, 키트 app.useStepper)"},{id:"ref.missing",level:"error",scope:"client",title:"참조한 파일이 없음"},{id:"ref.case-mismatch",level:"error",scope:"client",title:"참조 경로의 대소문자가 실제 파일과 다름"},{id:"ref.root-absolute",level:"error",scope:"client",title:"/로 시작하는 경로 · 자기 폴더가 아닌 <base href> (배포 주소 /s/{서명}/ 아래에서 깨짐)"},{id:"ref.external-script",level:"error",scope:"client",title:"외부 스크립트 (zip 안에 넣고 상대경로로)"},{id:"ref.external-request",level:"error",scope:"client",title:"외부 리소스 요청 (이미지 · 글꼴 · 영상 · CSS, 콘텐츠 CSP가 막음: zip 안에 넣기)"},{id:"ref.external-font",level:"warn",scope:"client",title:"허용 목록(externalAllow)의 외부 글꼴 (망분리 기관에서는 받지 못해 기본 글꼴로 보일 수 있음)"},{id:"ref.insecure",level:"error",scope:"client",title:"http:// 외부 리소스 (https 페이지 · 콘텐츠 CSP가 막음)"},{id:"ref.vendor-external-url",level:"warn",scope:"client",title:"라이브러리 파일 안의 외부 주소 (실행 중 외부를 부르면 콘텐츠 CSP가 막음, ecdk dev 로그 확인)"},{id:"ref.script-not-public",level:"error",scope:"client",title:"type=\"module\" 없는 <script src>가 public/ 밖 파일 (프로젝트 검사만. build가 묶지 않고 zip에도 넣지 않음, type=\"module\"을 붙이거나 public/으로)"},{id:"sandbox.module-src",level:"warn",scope:"client",title:"모듈 스크립트 파일(<script type=\"module\" src>): 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막혀 화면이 뜨지 않음 (ecdk build가 HTML 안에 묶음)"},{id:"sandbox.fetch-local",level:"warn",scope:"client",title:"zip 안 파일을 fetch · 변수 import() · Worker로 읽음: 콘텐츠 서버의 sandbox 헤더에 allow-same-origin이 없는 LXP에서는 CORS로 막힘 (JSON fetch · 문자열 import()는 ecdk build가 처리)"},{id:"html.img-alt",level:"warn",scope:"client",title:"대체 텍스트 없는 이미지"},{id:"html.iframe",level:"error",scope:"client",title:"src로 띄우는 iframe · frame, object · embed (콘텐츠 CSP가 막음, 영상은 Elice 비디오 자료로, srcdoc 미리보기 · 허용 목록(externalAllow frame-src) 출처의 iframe은 통과)"},{id:"html.form",level:"warn",scope:"client",title:"form 제출 (sandbox · CSP form-action이 막음, 버튼 click으로 처리)"},{id:"api.external-send",level:"error",scope:"client",title:"외부 주소로 요청 보냄"},{id:"api.parent-access",level:"warn",scope:"client",title:"부모 창 직접 접근"},{id:"api.cookie",level:"warn",scope:"client",title:"쿠키 사용 (학습 기록이 아님)"},{id:"api.storage",level:"warn",scope:"client",title:"브라우저 저장소 사용 (학습 기록이 아님)"},{id:"api.eval",level:"warn",scope:"client",title:"eval · new Function 사용"},{id:"api.dialog",level:"error",scope:"client",title:"alert · confirm · prompt 사용"},{id:"api.window-open",level:"error",scope:"client",title:"window.open 새 창 (sandbox 팝업)"},{id:"sec.secret",level:"error",scope:"server",title:"비밀 값 (키 · 토큰 · 비밀번호)"},{id:"sec.answer-in-bundle",level:"warn",scope:"client",title:"편집 화면에 저장한 정답(.ecdk/settings.json 채점 설정)과 같은 글이 zip에 들어갈 파일에 있음 (프로젝트 검사만)"},{id:"sec.html-injection",level:"warn",scope:"client",title:"HTML 문자열 삽입"},{id:"sec.redirect",level:"warn",scope:"client",title:"주소를 값으로 바꿈"},{id:"sec.postmessage-wildcard",level:"warn",scope:"client",title:"postMessage 대상 *"},{id:"privacy.personal-field",level:"warn",scope:"client",title:"학습자 개인정보를 받는 입력 칸(전화 · 이메일 · 이름 autocomplete 등)이나 개인정보 · 학습자 이름(account.fullname)을 제출 · 저장 · AI 호출로 보냄 (익명 id account.anonymousId, 이름은 보여 주기만)"},{id:"sdk.outdated",level:"error",scope:"client",title:"SDK가 최소 버전보다 낮음 (metadata.json build.sdk < rules.json minVersions.sdk. alpha.3 이하는 LXP 편집 화면 저장(초안) 실패, npm update @eliceio/cdk)"},{id:"sdk.lib-copy",level:"error",scope:"client",title:"SDK 복사본 lib/cdk.js (zip에 넣지 않음, 프로젝트 검사만. SDK는 package.json 의존성 @eliceio/cdk를 build가 번들로 묶음)"}];var rulesJson = {version:version,manifest:manifest,externalAllow:externalAllow,minVersions:minVersions,layouts:layouts,limits:limits,allowedExtensions:allowedExtensions,imageExtensions:imageExtensions,excluded:excluded,forbiddenApis:forbiddenApis,secretPatterns:secretPatterns,rules:rules};
2
2
 
3
3
  export { allowedExtensions, rulesJson as default, excluded, externalAllow, forbiddenApis, imageExtensions, layouts, limits, manifest, minVersions, rules, secretPatterns, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eliceio/cdk-cli",
3
- "version": "1.7.2-sharedqa.0",
3
+ "version": "1.8.1-documentqa.0",
4
4
  "description": "교육자용 Custom HTML 콘텐츠 CLI",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -18,6 +18,7 @@
18
18
  "access": "public"
19
19
  },
20
20
  "files": [
21
+ "assets",
21
22
  "es",
22
23
  "rules.json",
23
24
  "skills",
@@ -47,7 +48,7 @@
47
48
  "rollup": "4.62.4",
48
49
  "tslib": "2.8.1",
49
50
  "typescript": "6.0.3",
50
- "@eliceio/cdk": "^1.7.2-sharedqa.0"
51
+ "@eliceio/cdk": "^1.8.1-documentqa.0"
51
52
  },
52
53
  "scripts": {
53
54
  "prebuild": "del-cli \"buildcache/*\" \"es/*\"",
package/rules.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.22.0",
2
+ "version": "0.23.0",
3
3
  "manifest": {
4
4
  "file": "metadata.json",
5
5
  "kinds": ["material", "description"],
@@ -120,7 +120,7 @@
120
120
  {
121
121
  "id": "api.window-open",
122
122
  "pattern": "\\bwindow\\.open\\s*\\(",
123
- "title": "새 창 열기 (sandbox에서 막힘)"
123
+ "title": "window.open 새 창 (sandbox 팝업이라 외부 페이지가 깨짐, 외부 링크는 <a href>로 두면 LXP가 새 탭으로 엶)"
124
124
  },
125
125
  {
126
126
  "id": "api.external-send",
@@ -669,7 +669,7 @@
669
669
  "id": "api.window-open",
670
670
  "level": "error",
671
671
  "scope": "client",
672
- "title": "새 창 열기"
672
+ "title": "window.open 새 창 (sandbox 팝업)"
673
673
  },
674
674
  {
675
675
  "id": "sec.secret",
@@ -1,7 +1,7 @@
1
1
  ## Always
2
2
 
3
3
  - **Never ask for, store or send a learner's personal data (name, phone number, email, address, date of birth, student number, resident registration number, bank account, face photo, location, or anything else that identifies a person): not in a submission (`submit` · `useSubmit`), `kvstore`, `saveSettings` (`useSave`), a file upload (`assets`) or an AI call (`mlapi`). If the request needs it, ask the person before you build.** Why and what to use instead: `references/02-design-the-material.md` "Personal data".
4
- - Answer the person in their language. The reference files are in English: `references/` next to this SKILL.md, read only the ones you need with the Read tool: 00 what the person decides · 01 environment · 02 design · 03 create the project · 04 sandbox rules · 05 screen code and kit API · 06 quiz template · 07 move existing HTML · 08 error ids · 09 check · 10 build and report · 11 more · 12 upload · 13 edit screen design · 14 layouts and stepper · 15 edit settings by hand · 16 survey template · 17 Entry template.
4
+ - Answer the person in their language. The reference files are in English: `references/` next to this SKILL.md, read only the ones you need with the Read tool: 00 what the person decides · 01 environment · 02 design · 03 create the project · 04 sandbox rules · 05 screen code and kit API · 06 quiz template · 07 move existing HTML · 08 error ids · 09 check · 10 build and report · 11 more · 12 upload · 13 edit screen design · 14 layouts and stepper · 15 edit settings by hand · 16 survey template · 17 Entry template · 18 lesson template (the default learning material) · 19 lesson layouts.
5
5
  - Never put correct answers in the content zip. The edit screen saves them to `settings.grading` (locally `.ecdk/settings.json` from `ecdk dev`, which stays local unless the person agrees to send it with the upload, `references/12-upload-with-the-material-mcp.md`).
6
6
  - The completion policy is not in the project or the zip: it is a setting of the LXP page. Say which one fits (`references/02-design-the-material.md` ②); the elice-content-publish skill sets it with the upload after the person agrees (`on_graded` only with grading saved), otherwise the instructor picks it in the '설정' panel at the top of the LXP edit page. Only `on_graded` grades: `on_submit` completes on any submission without grading (`is_correct: null`, the kit shows "제출했어요."), `on_access` completes on open.
7
7
  - The content runs in a sandboxed iframe on its own origin: use the SDK (`app.useSubmit`, `app.useSave`) for anything that must be kept (storage and cookies stay only in that browser), and in-page UI instead of `alert`/`confirm`, new windows, the parent window or external requests.
@@ -15,15 +15,16 @@ Read or watch / change values and observe (simulation, visualization) / follow s
15
15
 
16
16
  **② Submission and grading** (the completion policy is a setting of the LXP page, not in the package, ADR 0012; since 2026-11-12 the publish skill sets it with the upload after the person agrees, otherwise the instructor picks it in the '설정' panel at the top of the LXP edit page. The grading settings `settings.grading` hold the grader `type` and its answers)
17
17
 
18
- | Material | Policy to propose (LXP setting) | Grading (`type`) | Student screen |
19
- | ----------------------------------------------------------- | ----------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
20
- | Something to read or watch, such as a simulation | `on_access` (done on open) | - | No submission |
21
- | A survey (decided 2026-11-25; may change) | `on_access` (done on open) | - | Submit the answers with `useSubmit` (the survey template, [16](16-using-the-survey-template.md)); submissions are still recorded |
22
- | Done when the activity ends (results, self-check) | `on_submit` (done on submit) | - | Submit the result with `useSubmit` |
23
- | One correct answer or one set of answers | `on_graded` (done when it passes) | `pattern` (one regex) | `useSubmit` |
24
- | Several questions with a score per question (partial score) | `on_graded` | `partial_pattern` | `useSubmit` with a string array |
25
- | Writing or assignments graded against a rubric (AI grading) | `on_graded` | `rubric` (the criteria) | `useSubmit`, the score comes back at once |
26
- | Block coding in Entry (the Entry template) | `on_graded` (`on_submit` without grading) | `entry` (general or AI) | The template submits the project ([17](17-using-the-entry-template.md)) |
18
+ | Material | Policy to propose (LXP setting) | Grading (`type`) | Student screen |
19
+ | ------------------------------------------------------------------------------------------------ | ----------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
20
+ | Something to read or watch, such as a simulation | `on_access` (done on open) | - | No submission |
21
+ | A lesson-template learning material (the lesson template, [18](18-using-the-lesson-template.md)) | `on_access` (done on open) | - | No submission; its quizzes are self-check on the page |
22
+ | A survey (decided 2026-11-25; may change) | `on_access` (done on open) | - | Submit the answers with `useSubmit` (the survey template, [16](16-using-the-survey-template.md)); submissions are still recorded |
23
+ | Done when the activity ends (results, self-check) | `on_submit` (done on submit) | - | Submit the result with `useSubmit` |
24
+ | One correct answer or one set of answers | `on_graded` (done when it passes) | `pattern` (one regex) | `useSubmit` |
25
+ | Several questions with a score per question (partial score) | `on_graded` | `partial_pattern` | `useSubmit` with a string array |
26
+ | Writing or assignments graded against a rubric (AI grading) | `on_graded` | `rubric` (the criteria) | `useSubmit`, the score comes back at once |
27
+ | Block coding in Entry (the Entry template) | `on_graded` (`on_submit` without grading) | `entry` (general or AI) | The template submits the project ([17](17-using-the-entry-template.md)) |
27
28
 
28
29
  > **Personal data: never collect it.** A material never asks for, stores or sends a learner's personal data: name, phone number, email, address, date of birth, student number, resident registration number, bank account, face photo, location, or anything else that identifies a person. Not in a submission (`useSubmit` · `submit`), `kvstore`, the content the edit screen saves (`useSave` · `saveSettings`), a file upload (`assets`) or an AI call (`mlapi`).
29
30
  >
@@ -2,17 +2,18 @@
2
2
 
3
3
  Run `ecdk create --list` first: it prints each template with its own version (`quiz@1.5.0`), what it is for and its screens. Pick the template from that list. `ecdk create` records the template and version in `package.json` `"ecdk"` (`template`), `ecdk build` copies it to `metadata.json` `build.template`, and `ecdk doctor` says when the installed ecdk ships a newer version of that template (nothing changes on its own).
4
4
 
5
- | Case | Start with |
6
- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
- | A quiz (up to 20 questions per quiz material) | `ecdk create <folder>` (quiz template: starts with no question; the edit screen adds questions of any of the five types with "+ 문제 추가"; answers set on the edit screen; `pattern` or `partial_pattern` grading, `on_graded` picked in LXP) |
8
- | A survey (course feedback: scale, single or multiple choice with "other", free text; no answers or grading) | `ecdk create <folder> --template survey` (edit screen builds the questions; the student submits and sees a thank-you screen, reopening shows it and lets them change the answers; no instructor screen; no `grading`; suggest `on_access` (decided 2026-11-25; may change); then [16](16-using-the-survey-template.md)) |
9
- | Any other material | `ecdk create <folder> --template blank` (three screens with a small example to replace, "예측하고 확인하기", and the kit content editor on the edit screen: see 5) |
10
- | A material in several steps (intro → experiment → summary, slides) | `ecdk create <folder> --template steps` (kit stepper `app.useStepper` and a different content layout per step, example "진자의 주기", content editor on the edit screen: see [14](14-layouts.md)) |
11
- | One document to read (PDF or PPTX, completion on opening) | `ecdk create <folder> --template document` (the edit screen uploads a `.pdf` or `.pptx` and edits PPTX slide text in place; the student screen pages through it; `on_access` picked in LXP; `.ppt` · `.pps` · `.ppsx` must be saved as `.pptx` or `.pdf` first; in `ecdk dev` the file stays in `.ecdk/assets/`; for a page on LXP upload it with the MCP `create_asset_upload`, [12](12-upload-with-the-material-mcp.md) "Images and documents") |
12
- | Block coding or Entry Python practice in Entry, AI blocks included | `ecdk create <folder> --template entry` (the Entry workspace in an iframe, so it works only where the server's content CSP allows the workspace; the person builds the start and answer projects on the edit screen; general or AI grading; then [17](17-using-the-entry-template.md)) |
13
- | A dark screen | Add `--theme dark` to the above |
14
- | A problem description | Create with blank, set `metadata.json` to `{ "kind": "description", "screens": { "learn": { "enabled": true, "entry": "index.html" } }, "commentary": "commentary.txt" }`, delete the other screen files |
15
- | An existing HTML page | [7. Move existing HTML](07-move-existing-html.md) |
5
+ | Case | Start with |
6
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
+ | A quiz (up to 20 questions per quiz material) | `ecdk create <folder>` (quiz template: starts with no question; the edit screen adds questions of any of the five types with "+ 문제 추가"; answers set on the edit screen; `pattern` or `partial_pattern` grading, `on_graded` picked in LXP) |
8
+ | A survey (course feedback: scale, single or multiple choice with "other", free text; no answers or grading) | `ecdk create <folder> --template survey` (edit screen builds the questions; the student submits and sees a thank-you screen, reopening shows it and lets them change the answers; no instructor screen; no `grading`; suggest `on_access` (decided 2026-11-25; may change); then [16](16-using-the-survey-template.md)) |
9
+ | A learning material to read and practice (explanation, guided practice, workshop, self-check) when the person gives no screen layout: **the default** for anything that is not a type template above or below | `ecdk create <folder> --template lesson` (39 fixed page layouts in the designer's style; you write only the content `{ meta, slides }` and the edit screen checks it; quizzes are self-check, no grading; suggest `on_access`; then [18](18-using-the-lesson-template.md) and [19](19-lesson-layouts.md)) |
10
+ | The person designs the screens, or an interaction the lesson layouts cannot do (live simulation, game, custom visualization) | `ecdk create <folder> --template blank` (three screens with a small example to replace, "예측하고 확인하기", and the kit content editor on the edit screen: see 5) |
11
+ | A material in several steps (intro → experiment → summary, slides) | `ecdk create <folder> --template steps` (kit stepper `app.useStepper` and a different content layout per step, example "진자의 주기", content editor on the edit screen: see [14](14-layouts.md)) |
12
+ | One document to read (PDF or PPTX, completion on opening) | `ecdk create <folder> --template document` (the edit screen uploads a `.pdf` or `.pptx` and edits PPTX slide text in place; the student screen pages through it; `on_access` picked in LXP; `.ppt` · `.pps` · `.ppsx` must be saved as `.pptx` or `.pdf` first; in `ecdk dev` the file stays in `.ecdk/assets/`; for a page on LXP upload it with the MCP `create_asset_upload`, [12](12-upload-with-the-material-mcp.md) "Images and documents") |
13
+ | Block coding or Entry Python practice in Entry, AI blocks included | `ecdk create <folder> --template entry` (the Entry workspace in an iframe, so it works only where the server's content CSP allows the workspace; the person builds the start and answer projects on the edit screen; general or AI grading; then [17](17-using-the-entry-template.md)) |
14
+ | A dark screen | Add `--theme dark` to the above |
15
+ | A problem description | Create with blank, set `metadata.json` to `{ "kind": "description", "screens": { "learn": { "enabled": true, "entry": "index.html" } }, "commentary": "commentary.txt" }`, delete the other screen files |
16
+ | An existing HTML page | [7. Move existing HTML](07-move-existing-html.md) |
16
17
 
17
18
  `create` refuses a folder that is not empty. Use a new subfolder. It then runs `npm install` in the project (the SDK `@eliceio/cdk` comes from npm through `package.json`; `--no-install` skips it). When the install fails, the project stays: run `npm install` in it (network or proxy problem; tell the user).
18
19
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  1. **Never put correct answers in the content**: not in a data JSON file, the screen code, or comments. They reach the student's browser. Answers go only in `settings.grading` through the edit screen (the server never sends it to students; `ecdk dev` keeps it in `.ecdk/settings.json`, left out of the zip).
4
4
  2. **Screen code calls only `lib/elice-content.js` (the kit).** Do not edit `lib/`. Do not call the SDK (`@eliceio/cdk`, imported by the kit and bundled by `ecdk build`) directly.
5
- 3. **Do not use blocked features**: `alert`/`confirm`/`prompt` · `window.open` · `<form>` submission · access to `window.parent`/`top` · `fetch`/`WebSocket` to external addresses (an AI call to mlapi goes through `sdk.mlapi.fetch`, which the check allows) · external `<script src>`. `localStorage` · `sessionStorage` · `indexedDB` · `document.cookie` work, but they stay only in that browser and device and are not the learner's record: to keep progress, submit it (`useSubmit`); to keep content, save it from the edit screen.
5
+ 3. **Do not use blocked features**: `alert`/`confirm`/`prompt` · `window.open` (the popup inherits the sandbox, so login or video pages break in it; for an external page use a plain `<a href="https://…">` link, which the platform opens in a new tab outside the sandbox) · `<form>` submission · access to `window.parent`/`top` · `fetch`/`WebSocket` to external addresses (an AI call to mlapi goes through `sdk.mlapi.fetch`, which the check allows) · external `<script src>`. `localStorage` · `sessionStorage` · `indexedDB` · `document.cookie` work, but they stay only in that browser and device and are not the learner's record: to keep progress, submit it (`useSubmit`); to keep content, save it from the edit screen.
6
6
  - **Never collect a learner's personal data** (name, phone number, email, address, date of birth, student number, resident registration number, bank account, face photo, location …) through any of these: a submission, `kvstore`, the edit screen's content (`settings`, sent to every viewer), a file upload (`assets`) or an AI call (`mlapi`, sent to an outside model). Submissions and `kvstore` values stay on the server where instructors and operators read them. Use `app.account.anonymousId` to tell learners apart ([2](02-design-the-material.md) "Personal data").
7
7
  - The check warns about it (`privacy.personal-field`): an input that takes personal data (`type="tel"` · `type="email"`, an `autocomplete` of name · tel · email · address · birthday · card, or an input whose `name` · `id` · `placeholder` · `<label>` says 전화 · 이메일 · 학번 · 주민 · phone · email …), a personal key (`phone` · `email` · `studentId` · `연락처` …) in `submit` · `useSubmit` · `kvstore.post`, or `account.fullname` inside `submit` · `useSubmit` · `kvstore.post` · `saveSettings` · `useSave` · `mlapi.fetch` · `assets.post`. Remove the field or the value; do not silence it. Only code that never stores or sends the value (a regex lab that checks an email format on screen) may use `ecdk-ignore-next-line privacy.personal-field` with the reason.
8
8
  4. **Libraries and media go inside the zip.** Download libraries for charts, visualization or physics (for example Chart.js, D3, p5.js) into `vendor/` and load them by relative path instead of a CDN. Fonts, images and sounds also go in the zip. Limits: zip 20 MB, 300 files. Upload long videos separately as Elice video materials.
@@ -11,7 +11,7 @@ Read `check.issues[]` (`id` · `level` · `path` · `line` · `message`) from `e
11
11
  | `ref.external-font` (warn) | A font from a host in `rules.json` `externalAllow` (empty for now): closed-network schools cannot reach it, so put a font that matters in the zip |
12
12
  | `ref.vendor-external-url` (warn) | A library file holds outside addresses: run `ecdk dev`, look for "막힌 외부 요청", put what it loads in the zip and set the library to a relative path |
13
13
  | `api.storage` · `api.cookie` (warn) | Browser storage and cookies stay only in that browser and device and are not the learner's record. Submit results; save content from the edit screen |
14
- | `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit` |
14
+ | `api.dialog` · `api.window-open` · `html.form` | An in-page message · the same view · a button click + `useSubmit` · an external page as a plain `<a href="https://…">` (opened in a new tab) |
15
15
  | `api.external-send` | Remove the external send. An AI call to mlapi goes through `sdk.mlapi.fetch` (the check allows it, also with the absolute `https://mlapi.run/…` address) |
16
16
  | `sec.answer-in-bundle` | A correct answer saved on the edit screen (`.ecdk/settings.json` grading) appears as is in screen code, a data JSON or `commentary.txt`, which students can read from the zip. Remove it there; answers live only in the grading settings |
17
17
  | `privacy.personal-field` (warn) | Learner personal data: an input for it (`type="tel"` · `"email"`, a personal `autocomplete`, a name · id · placeholder · label saying phone · email · 학번 …), a personal key in `submit` · `kvstore.post`, or `account.fullname` in a submit · save · upload · `mlapi` call. Remove it: tell learners apart with `app.account.anonymousId`, only show `fullname`, make surveys anonymous ([2](02-design-the-material.md) "Personal data"). `ecdk-ignore` only for code that never stores or sends the value, with the reason |
@@ -26,6 +26,7 @@ Read `check.issues[]` (`id` · `level` · `path` · `line` · `message`) from `e
26
26
  | `project.deps` (doctor) · "@eliceio/cdk 패키지를 찾지 못했습니다" | The SDK package is not installed in the project: run `npm install` in the project, then build again |
27
27
  | `project.grading` (doctor) | The saved `.ecdk/settings.json` `grading` breaks the server's save rules or does not match the public `gradingType`. Have the person open the edit view in `ecdk dev`, fix the marked field (points, answers) and save again; if you edited the file by hand, correct those values ([15](15-edit-settings-by-hand.md)). Never delete the file: the content goes with it. It warns when the settings hold AI evaluation config (`criteria` · `apiId`) but no `grading`: save a `rubric` with the edit screen's `getGrading` ([5](05-screen-code.md) "AI grading") |
28
28
  | `project.quiz` (doctor, quiz template) | The saved questions, answers or points do not pass the quiz edit screen's own checks (run with the project's `core/model.js`): answers or scores left in the old question order, `points` ≠ `scores`, an answer pointing at a deleted option, a missing `gradingType`, a regex the edit screen cannot read (a text answer in the wrong shape for the project's template version), quiz 1.10.0+: a regex answer not in the stored shape or with a blocked syntax, an answer regex over 500 characters, `answerFormat` · `requires` · `answerMode` the project's template does not know, text answers that look as typed (or a regex question) but `answerFormat` is missing, `answerFormat` 2 with URL-encoded text answers (saved again by a 1.9.x edit screen) - for these two, students typing 한글, spaces or `%` are marked wrong: have the person press "초안으로 저장" once in the edit view and the answers are saved again in the right shape. A warning (`warn`): tags written in snake_case (`answer_format` · `answer_mode`). Fix as [15](15-edit-settings-by-hand.md) says, run `ecdk doctor` again, then have the person save once in the edit view ("초안으로 저장") |
29
+ | `project.lesson` (doctor, lesson template) | The saved slides do not pass the lesson edit screen's checks (run with the project's `core/lesson.js`). Errors: a missing required slot, a list with too few or too many items, a value outside the allowed list, an unknown layout, a quiz `answer` that is not an option number (`ox-*`: not `O`/`X`), an external image URL (the content CSP blocks it) or an image file missing from `public/`, a wrong `meta` value. Warnings: over the character limit, writing style, the same layout three times in a row, an empty image place. Fix as [18](18-using-the-lesson-template.md) and [19](19-lesson-layouts.md) say (shorten or split a page, never shrink the font), run `ecdk doctor` again, then have the person save once in the edit view |
29
30
  | `build.template-unknown` (warn) | The material was made with a template or template version this ecdk does not know. Update ecdk (`npm i -g @eliceio/cdk-cli`) or check `template` in `package.json` `"ecdk"` |
30
31
  | `manifest.*` · `entry.*` | Check `screens` and `kind` in `metadata.json` |
31
32
  | `limit.*` · `file.large-image` | Shrink images (longest side 2048px, WebP 85, [6](06-using-the-quiz-template.md) "Adding images") and video, drop unused files (build output: "files not referenced anywhere") |
@@ -58,13 +58,13 @@ Next time, read it, confirm the page with the person as above (기관 · 과목
58
58
  - **Merge, then show.** `settings` replaces the whole object: start from the page's current settings (`get_material`, or `get_draft` before the first save), keep every `asset:` reference already there exactly as it is, add the new keys, and write the result to `.ecdk/settings.json` as well. Before saving, show the person which file goes where (question number or the document, file name, size after shrinking, alt text) and wait for a yes. The draft preview does not show these settings before the save, and `ecdk dev` cannot show a server file: check on the LXP page after saving.
59
59
  - **Nothing changes until a save.** An uploaded file that no saved settings point at is unused; there is no MCP tool to delete it. If the person says no, do not save.
60
60
 
61
- **Fallback (the server has no `settings`, the person said no, or there is no file)**: upload the zip only, without content or `grading`, and without `on_graded` (see "Completion policy"). After saving, tell the person to open the LXP edit page, enter the content and answers on the edit screen (`settings`, with `settings.grading` for `on_graded`) and save with the edit screen's own button (the quiz template: "초안으로 저장"). That saves to the draft; learners see it only after '수업 자료에 반영' at the top of the LXP edit page.
61
+ **Fallback (the server has no `settings`, the person said no, or there is no file)**: upload the zip only, without content or `grading`, and without `on_graded` (see "Completion policy"). After saving, tell the person to open the LXP edit page, enter the content and answers on the edit screen (`settings`, with `settings.grading` for `on_graded`) and save with the edit screen's own button (the quiz template: "초안으로 저장"). That saves to the draft; learners see it only after '수업 자료에 반영' at the top of the LXP edit page. The Entry template always ends here when no person saved its edit view (never write its settings yourself), and that to-do goes in the final report ([17](17-using-the-entry-template.md) "Runs without a person").
62
62
 
63
63
  **Uploading a zip by hand in LXP**: on the LXP edit page, ⋮ › '다른 파일로 변경', pick the zip, then '수업 자료에 반영'.
64
64
 
65
65
  **Completion policy** (2026-11-12: the upload can set it)
66
66
 
67
- The completion policy is not in the project or the zip (ADR 0012): it is a setting of the LXP page, independent of versions, and it applies as soon as it is set. The publish skill proposes one and sets it with the save after the person agrees, when the save tool takes it. Detect support like `settings`: use `completion_policy` only when the input schema of `save_draft` (or `update_material`) lists it in `payload`. If no tool has it, tell the person after saving which one to pick in the '설정' panel opened from the top of the LXP edit page (choosing applies at once). The templates carry a default that the server sets when the template is applied to a page that has never been saved (quiz `on_graded`; survey, document and video `on_access`); a saved page keeps its policy, so still check `get_material` and propose as below.
67
+ The completion policy is not in the project or the zip (ADR 0012): it is a setting of the LXP page, independent of versions, and it applies as soon as it is set. The publish skill proposes one and sets it with the save after the person agrees, when the save tool takes it. Detect support like `settings`: use `completion_policy` only when the input schema of `save_draft` (or `update_material`) lists it in `payload`. If no tool has it, tell the person after saving which one to pick in the '설정' panel opened from the top of the LXP edit page (choosing applies at once). The templates carry a default that the server sets when the template is applied to a page that has never been saved (quiz and Entry `on_graded`; survey, document, video and board `on_access`); a saved page keeps its policy, so still check `get_material` and propose as below.
68
68
 
69
69
  | The material | Propose |
70
70
  | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |