@web-auto/webauto 0.1.17 → 0.1.19
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/README.md +122 -53
- package/apps/desktop-console/dist/main/index.mjs +229 -14
- package/apps/desktop-console/dist/renderer/index.js +237 -8
- package/apps/desktop-console/entry/ui-cli.mjs +290 -21
- package/apps/desktop-console/entry/ui-console.mjs +46 -15
- package/apps/webauto/entry/account.mjs +126 -27
- package/apps/webauto/entry/lib/account-detect.mjs +399 -9
- package/apps/webauto/entry/lib/account-store.mjs +201 -109
- package/apps/webauto/entry/lib/iflow-reply.mjs +194 -0
- package/apps/webauto/entry/lib/profile-policy.mjs +48 -0
- package/apps/webauto/entry/lib/profilepool.mjs +12 -0
- package/apps/webauto/entry/lib/schedule-store.mjs +29 -2
- package/apps/webauto/entry/lib/session-init.mjs +227 -0
- package/apps/webauto/entry/lib/upgrade-check.mjs +269 -0
- package/apps/webauto/entry/lib/xhs-unified-blocks.mjs +160 -0
- package/apps/webauto/entry/lib/xhs-unified-output-blocks.mjs +83 -0
- package/apps/webauto/entry/lib/xhs-unified-plan-blocks.mjs +55 -0
- package/apps/webauto/entry/lib/xhs-unified-profile-blocks.mjs +542 -0
- package/apps/webauto/entry/lib/xhs-unified-runtime-blocks.mjs +436 -0
- package/apps/webauto/entry/profilepool.mjs +56 -9
- package/apps/webauto/entry/smart-reply-cli.mjs +267 -0
- package/apps/webauto/entry/weibo-unified.mjs +84 -11
- package/apps/webauto/entry/xhs-orchestrate.mjs +43 -1
- package/apps/webauto/entry/xhs-unified.mjs +92 -997
- package/bin/webauto.mjs +22 -4
- package/dist/modules/camo-backend/src/index.js +33 -0
- package/dist/modules/camo-backend/src/internal/BrowserSession.js +232 -49
- package/dist/modules/camo-backend/src/internal/engine-manager.js +14 -13
- package/dist/modules/camo-backend/src/internal/ws-server.js +16 -19
- package/dist/modules/camo-runtime/src/utils/browser-service.mjs +38 -6
- package/dist/modules/workflow/blocks/EnsureSession.js +0 -8
- package/dist/modules/workflow/blocks/WeiboCollectFromLinksBlock.js +78 -6
- package/dist/modules/workflow/blocks/WeiboCollectSearchLinksBlock.js +266 -192
- package/dist/modules/workflow/definitions/weibo-search-workflow-v1.js +2 -0
- package/dist/modules/workflow/src/runner.js +2 -0
- package/dist/modules/xiaohongshu/app/src/blocks/ReplyInteractBlock.js +150 -37
- package/dist/modules/xiaohongshu/app/src/blocks/SmartReplyBlock.js +491 -0
- package/modules/camo-backend/src/index.ts +31 -0
- package/modules/camo-backend/src/internal/BrowserSession.ts +224 -53
- package/modules/camo-backend/src/internal/engine-manager.ts +14 -15
- package/modules/camo-backend/src/internal/ws-server.ts +17 -17
- package/modules/camo-runtime/src/autoscript/action-providers/xhs/common.mjs +12 -2
- package/modules/camo-runtime/src/autoscript/action-providers/xhs/persistence.mjs +57 -0
- package/modules/camo-runtime/src/autoscript/action-providers/xhs.mjs +2475 -243
- package/modules/camo-runtime/src/autoscript/runtime.mjs +35 -30
- package/modules/camo-runtime/src/autoscript/xhs-unified-template.mjs +80 -443
- package/modules/camo-runtime/src/container/runtime-core/checkpoint.mjs +39 -6
- package/modules/camo-runtime/src/container/runtime-core/operations/index.mjs +206 -39
- package/modules/camo-runtime/src/container/runtime-core/operations/tab-pool.mjs +0 -79
- package/modules/camo-runtime/src/container/runtime-core/operations/viewport.mjs +46 -0
- package/modules/camo-runtime/src/utils/browser-service.mjs +41 -6
- package/modules/camo-runtime/src/utils/js-policy.mjs +28 -0
- package/modules/workflow/blocks/EnsureSession.ts +0 -4
- package/modules/workflow/blocks/WeiboCollectFromLinksBlock.ts +81 -6
- package/modules/workflow/blocks/WeiboCollectSearchLinksBlock.ts +316 -0
- package/modules/workflow/definitions/weibo-search-workflow-v1.ts +2 -0
- package/modules/workflow/src/runner.ts +2 -0
- package/modules/xiaohongshu/app/src/blocks/ReplyInteractBlock.ts +198 -53
- package/modules/xiaohongshu/app/src/blocks/SmartReplyBlock.ts +706 -0
- package/package.json +2 -2
- package/modules/camo-runtime/src/autoscript/action-providers/xhs/comments.mjs +0 -498
- package/modules/camo-runtime/src/autoscript/action-providers/xhs/detail.mjs +0 -181
- package/modules/camo-runtime/src/autoscript/action-providers/xhs/interaction.mjs +0 -691
- package/modules/camo-runtime/src/autoscript/action-providers/xhs/search.mjs +0 -388
- package/modules/camo-runtime/src/container/runtime-core/operations/selector-scripts.mjs +0 -135
|
@@ -536,7 +536,12 @@ export class AutoscriptRunner {
|
|
|
536
536
|
return { ok: false, code: post.code || 'VALIDATION_FAILED', message: post.message || 'post validation failed', data: { phase: 'post', detail: post } };
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
return {
|
|
539
|
+
return {
|
|
540
|
+
ok: true,
|
|
541
|
+
code: execution.code || 'OPERATION_DONE',
|
|
542
|
+
message: execution.message || 'operation done',
|
|
543
|
+
data: execution.data || execution,
|
|
544
|
+
};
|
|
540
545
|
}
|
|
541
546
|
|
|
542
547
|
async applyPacingBeforeAttempt(operation, attempt) {
|
|
@@ -717,6 +722,35 @@ export class AutoscriptRunner {
|
|
|
717
722
|
}),
|
|
718
723
|
);
|
|
719
724
|
const latencyMs = Date.now() - startedAt;
|
|
725
|
+
const terminalDoneCode = extractTerminalDoneCode(result);
|
|
726
|
+
if (terminalDoneCode) {
|
|
727
|
+
this.operationState.set(operation.id, {
|
|
728
|
+
status: 'done',
|
|
729
|
+
runs: Number(this.operationState.get(operation.id)?.runs || 0) + 1,
|
|
730
|
+
lastError: null,
|
|
731
|
+
updatedAt: nowIso(),
|
|
732
|
+
result: { terminalDoneCode },
|
|
733
|
+
});
|
|
734
|
+
this.log('autoscript:operation_terminal', {
|
|
735
|
+
operationId: operation.id,
|
|
736
|
+
action: operation.action,
|
|
737
|
+
attempt,
|
|
738
|
+
latencyMs,
|
|
739
|
+
code: terminalDoneCode,
|
|
740
|
+
});
|
|
741
|
+
this.stop('script_complete');
|
|
742
|
+
return {
|
|
743
|
+
ok: true,
|
|
744
|
+
terminalState: 'done_terminal',
|
|
745
|
+
result: {
|
|
746
|
+
ok: true,
|
|
747
|
+
code: terminalDoneCode,
|
|
748
|
+
message: 'autoscript completed',
|
|
749
|
+
data: { terminalDoneCode },
|
|
750
|
+
},
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
|
|
720
754
|
if (result.ok) {
|
|
721
755
|
if (this.isNavigationAction(operation?.action)) {
|
|
722
756
|
this.lastNavigationAt = Date.now();
|
|
@@ -778,35 +812,6 @@ export class AutoscriptRunner {
|
|
|
778
812
|
};
|
|
779
813
|
}
|
|
780
814
|
|
|
781
|
-
const terminalDoneCode = extractTerminalDoneCode(result);
|
|
782
|
-
if (terminalDoneCode) {
|
|
783
|
-
this.operationState.set(operation.id, {
|
|
784
|
-
status: 'done',
|
|
785
|
-
runs: Number(this.operationState.get(operation.id)?.runs || 0) + 1,
|
|
786
|
-
lastError: null,
|
|
787
|
-
updatedAt: nowIso(),
|
|
788
|
-
result: { terminalDoneCode },
|
|
789
|
-
});
|
|
790
|
-
this.log('autoscript:operation_terminal', {
|
|
791
|
-
operationId: operation.id,
|
|
792
|
-
action: operation.action,
|
|
793
|
-
attempt,
|
|
794
|
-
latencyMs,
|
|
795
|
-
code: terminalDoneCode,
|
|
796
|
-
});
|
|
797
|
-
this.stop('script_complete');
|
|
798
|
-
return {
|
|
799
|
-
ok: true,
|
|
800
|
-
terminalState: 'done_terminal',
|
|
801
|
-
result: {
|
|
802
|
-
ok: true,
|
|
803
|
-
code: terminalDoneCode,
|
|
804
|
-
message: 'autoscript completed',
|
|
805
|
-
data: { terminalDoneCode },
|
|
806
|
-
},
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
|
|
810
815
|
const failureStatus = operation?.onFailure === 'continue' ? 'skipped' : 'failed';
|
|
811
816
|
this.operationState.set(operation.id, {
|
|
812
817
|
status: failureStatus,
|