sns-auto-builder 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sns-auto-builder",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "인스타 카드뉴스 자동 제작 빌더. Claude Code + ChatGPT 웹을 그대로 써서 API 키 없이 돌아갑니다.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -161,13 +161,22 @@ async function waitForComposer(page) {
161
161
  // 조용히 틀리느니 시끄럽게 멈추는 게 낫다.
162
162
  async function attachRef(page, refPaths) {
163
163
  const want = refPaths.length;
164
- // 파일 입력이 여러 개다. 컴포저(form) 안에 있는 것이 첨부용이다.
164
+ // 화면에 input[type=file] 개쯤 있다. **accept 고른다.**
165
+ //
166
+ // 예전에는 "form 안에 있는 것"을 골랐는데, ChatGPT 가 이미지 업로드 input 을
167
+ // form 밖으로 옮기면서 form 안에는 accept 없는 다른 input 만 남았다. 거기에
168
+ // 파일을 넣으면 아무 일도 안 일어나고, 썸네일을 2분 기다리다 실패한다
169
+ // (증상: "크롬은 떴는데 프롬프트를 입력하지 않는다").
165
170
  const pickInput = async () => {
166
- const handles = await page.$$('input[type="file"]');
167
- for (const h of handles) {
168
- if (await h.evaluate((el) => !!el.closest('form'))) return h;
171
+ for (const sel of [
172
+ 'input[type="file"][data-testid="upload-photos-input"]', // 현재 ChatGPT
173
+ 'input[type="file"][accept*="image"]', // testid 바뀌어도 살아남는 조건
174
+ 'input[type="file"]',
175
+ ]) {
176
+ const h = await page.$(sel);
177
+ if (h) return h;
169
178
  }
170
- return handles[0] || null;
179
+ return null;
171
180
  };
172
181
 
173
182
  for (let attempt = 1; attempt <= 2; attempt++) {