@lightcone-ai/daemon 0.15.3 → 0.15.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.
|
@@ -385,6 +385,7 @@ export class DouyinAdapter {
|
|
|
385
385
|
const startedAt = Date.now();
|
|
386
386
|
let sawProgress = expectedCount === 0;
|
|
387
387
|
let stableReadyRounds = 0;
|
|
388
|
+
let forcedReadyRounds = 0;
|
|
388
389
|
let pollCount = 0;
|
|
389
390
|
let lastHint = 'no_state';
|
|
390
391
|
|
|
@@ -405,22 +406,34 @@ export class DouyinAdapter {
|
|
|
405
406
|
const draftReady = composer.draftButtonExists && composer.draftButtonDisabled !== true;
|
|
406
407
|
const uploadedHint = /上传成功|重新上传|更换|替换|已上传|继续编辑|移除/.test(text);
|
|
407
408
|
const completionSignal = sawProgress || uploadedHint || composer.mediaActionVisible;
|
|
409
|
+
const readyForEditing = editorReady && draftReady && completionSignal;
|
|
408
410
|
|
|
409
411
|
lastHint = this._formatUploadWaitHint(state, composer, {
|
|
410
412
|
processing,
|
|
411
413
|
sawProgress,
|
|
412
414
|
completionSignal,
|
|
413
415
|
stableReadyRounds,
|
|
416
|
+
forcedReadyRounds,
|
|
414
417
|
});
|
|
415
418
|
|
|
416
|
-
if (!processing &&
|
|
419
|
+
if (!processing && readyForEditing) {
|
|
420
|
+
forcedReadyRounds = 0;
|
|
417
421
|
stableReadyRounds += 1;
|
|
418
422
|
if (stableReadyRounds >= 2) return;
|
|
419
423
|
} else if (!processing && editorReady && draftReady && (Date.now() - startedAt) >= 25_000) {
|
|
424
|
+
forcedReadyRounds = 0;
|
|
420
425
|
stableReadyRounds += 1;
|
|
421
426
|
if (stableReadyRounds >= 4) return;
|
|
427
|
+
} else if (processing && readyForEditing) {
|
|
428
|
+
stableReadyRounds = 0;
|
|
429
|
+
forcedReadyRounds += 1;
|
|
430
|
+
if (forcedReadyRounds >= 3) {
|
|
431
|
+
console.error(`[DouyinAdapter] wait-upload force-ready after persistent processing poll=${pollCount} ${lastHint}`);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
422
434
|
} else {
|
|
423
435
|
stableReadyRounds = 0;
|
|
436
|
+
forcedReadyRounds = 0;
|
|
424
437
|
}
|
|
425
438
|
|
|
426
439
|
if (pollCount % 10 === 0) {
|
|
@@ -529,6 +542,7 @@ export class DouyinAdapter {
|
|
|
529
542
|
`draftButton=${composer.draftButtonExists === true}`,
|
|
530
543
|
`draftDisabled=${composer.draftButtonDisabled === true}`,
|
|
531
544
|
`stableReadyRounds=${flags.stableReadyRounds ?? 0}`,
|
|
545
|
+
`forcedReadyRounds=${flags.forcedReadyRounds ?? 0}`,
|
|
532
546
|
`errors=${errors.slice(0, 180)}`,
|
|
533
547
|
].join('; ');
|
|
534
548
|
}
|
package/package.json
CHANGED
package/src/agent-manager.js
CHANGED
|
@@ -392,7 +392,7 @@ export class AgentManager {
|
|
|
392
392
|
if (!text || !message) return false;
|
|
393
393
|
const target = this._formatDeliveryTarget(message);
|
|
394
394
|
if (!target || target.includes('unknown')) return false;
|
|
395
|
-
const url = `${this.serverUrl}/internal/${encodeURIComponent(agentId)}/send`;
|
|
395
|
+
const url = `${this.serverUrl}/internal/agent/${encodeURIComponent(agentId)}/send`;
|
|
396
396
|
try {
|
|
397
397
|
const res = await fetch(url, {
|
|
398
398
|
method: 'POST',
|