@lightcone-ai/daemon 0.15.15 → 0.15.17

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.
@@ -53,6 +53,8 @@ export class KuaishouAdapter {
53
53
  if (!redirectUrl.includes('cp.kuaishou.com/article/publish')) {
54
54
  throw new Error(`LOGIN_EXPIRED: 快手登录已过期,请重新扫码连接 (redirected to: ${redirectUrl})`);
55
55
  }
56
+ await this._clickByText('放弃');
57
+ await sleep(500);
56
58
  try { await this._cdp.send('Runtime.evaluate', { expression: 'window.scrollTo(0, 300)', returnByValue: false }); } catch {}
57
59
  await this._waitForSelector('input[type="file"], [class*="upload"], [class*="Upload"]', 45000);
58
60
 
@@ -89,6 +91,10 @@ export class KuaishouAdapter {
89
91
  if (!redirectUrl.includes('cp.kuaishou.com/article/publish')) {
90
92
  throw new Error(`LOGIN_EXPIRED: 快手登录已过期,请重新扫码连接 (redirected to: ${redirectUrl})`);
91
93
  }
94
+ // Dismiss "continue previous draft?" dialog if present (appears when session is reused)
95
+ await this._clickByText('放弃');
96
+ await sleep(500);
97
+
92
98
  // Scroll once to trigger any lazy-rendered upload widgets, then wait
93
99
  try { await this._cdp.send('Runtime.evaluate', { expression: 'window.scrollTo(0, 300)', returnByValue: false }); } catch {}
94
100
  await this._waitForSelector('input[type="file"], [class*="upload"], [class*="Upload"]', 45000);
@@ -97,15 +103,16 @@ export class KuaishouAdapter {
97
103
  if (!loggedIn) throw new Error('LOGIN_EXPIRED: 快手登录已过期,请重新扫码连接');
98
104
 
99
105
  await this._uploadFiles([video], 'video');
100
- // Wait for upload to complete: title field appears only after upload finishes
101
- await this._waitForSelector('[placeholder*="标题"]', 120000);
106
+ // Wait for publish form: description field appears after upload; id=work-description-edit is reliable
107
+ await this._waitForSelector('#work-description-edit, [placeholder*="描述"], [contenteditable="true"]', 120000);
102
108
 
109
+ // Kuaishou video publish has no dedicated title input; skip if field not found
103
110
  if (title) {
104
111
  await this._fillField('[placeholder*="标题"]', title);
105
112
  }
106
113
 
107
114
  const fullText = formatTextWithTags(text, tags);
108
- await this._fillField('[placeholder*="描述"], [contenteditable]', fullText);
115
+ await this._fillField('#work-description-edit, [placeholder*="描述"], [contenteditable]', fullText);
109
116
 
110
117
  await sleep(1000);
111
118
  await this._clickByText('发布');
@@ -175,7 +182,9 @@ export class KuaishouAdapter {
175
182
  el.dispatchEvent(new Event('input', { bubbles: true }));
176
183
  el.dispatchEvent(new Event('change', { bubbles: true }));
177
184
  } else {
178
- el.innerText = ${JSON.stringify(value)};
185
+ // contenteditable (React/Vue): execCommand keeps framework state in sync
186
+ document.execCommand('selectAll', false);
187
+ document.execCommand('insertText', false, ${JSON.stringify(value)});
179
188
  el.dispatchEvent(new InputEvent('input', { bubbles: true }));
180
189
  }
181
190
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightcone-ai/daemon",
3
- "version": "0.15.15",
3
+ "version": "0.15.17",
4
4
  "type": "module",
5
5
  "main": "src/index.js",
6
6
  "bin": {