@web-auto/webauto 0.1.18 → 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.
Files changed (65) hide show
  1. package/README.md +122 -53
  2. package/apps/desktop-console/dist/main/index.mjs +227 -12
  3. package/apps/desktop-console/dist/renderer/index.js +237 -8
  4. package/apps/desktop-console/entry/ui-cli.mjs +282 -16
  5. package/apps/desktop-console/entry/ui-console.mjs +46 -15
  6. package/apps/webauto/entry/account.mjs +126 -27
  7. package/apps/webauto/entry/lib/account-detect.mjs +399 -9
  8. package/apps/webauto/entry/lib/account-store.mjs +201 -109
  9. package/apps/webauto/entry/lib/iflow-reply.mjs +194 -0
  10. package/apps/webauto/entry/lib/profile-policy.mjs +48 -0
  11. package/apps/webauto/entry/lib/profilepool.mjs +12 -0
  12. package/apps/webauto/entry/lib/schedule-store.mjs +29 -2
  13. package/apps/webauto/entry/lib/session-init.mjs +227 -0
  14. package/apps/webauto/entry/lib/upgrade-check.mjs +269 -0
  15. package/apps/webauto/entry/lib/xhs-unified-blocks.mjs +160 -0
  16. package/apps/webauto/entry/lib/xhs-unified-output-blocks.mjs +83 -0
  17. package/apps/webauto/entry/lib/xhs-unified-plan-blocks.mjs +55 -0
  18. package/apps/webauto/entry/lib/xhs-unified-profile-blocks.mjs +542 -0
  19. package/apps/webauto/entry/lib/xhs-unified-runtime-blocks.mjs +436 -0
  20. package/apps/webauto/entry/profilepool.mjs +56 -9
  21. package/apps/webauto/entry/smart-reply-cli.mjs +267 -0
  22. package/apps/webauto/entry/weibo-unified.mjs +84 -11
  23. package/apps/webauto/entry/xhs-orchestrate.mjs +43 -1
  24. package/apps/webauto/entry/xhs-unified.mjs +92 -997
  25. package/bin/webauto.mjs +22 -4
  26. package/dist/modules/camo-backend/src/index.js +33 -0
  27. package/dist/modules/camo-backend/src/internal/BrowserSession.js +232 -49
  28. package/dist/modules/camo-backend/src/internal/engine-manager.js +14 -13
  29. package/dist/modules/camo-backend/src/internal/ws-server.js +16 -19
  30. package/dist/modules/camo-runtime/src/utils/browser-service.mjs +38 -6
  31. package/dist/modules/workflow/blocks/EnsureSession.js +0 -8
  32. package/dist/modules/workflow/blocks/WeiboCollectFromLinksBlock.js +78 -6
  33. package/dist/modules/workflow/blocks/WeiboCollectSearchLinksBlock.js +266 -192
  34. package/dist/modules/workflow/definitions/weibo-search-workflow-v1.js +2 -0
  35. package/dist/modules/workflow/src/runner.js +2 -0
  36. package/dist/modules/xiaohongshu/app/src/blocks/ReplyInteractBlock.js +150 -37
  37. package/dist/modules/xiaohongshu/app/src/blocks/SmartReplyBlock.js +491 -0
  38. package/modules/camo-backend/src/index.ts +31 -0
  39. package/modules/camo-backend/src/internal/BrowserSession.ts +224 -53
  40. package/modules/camo-backend/src/internal/engine-manager.ts +14 -15
  41. package/modules/camo-backend/src/internal/ws-server.ts +17 -17
  42. package/modules/camo-runtime/src/autoscript/action-providers/xhs/common.mjs +12 -2
  43. package/modules/camo-runtime/src/autoscript/action-providers/xhs/persistence.mjs +57 -0
  44. package/modules/camo-runtime/src/autoscript/action-providers/xhs.mjs +2475 -243
  45. package/modules/camo-runtime/src/autoscript/runtime.mjs +35 -30
  46. package/modules/camo-runtime/src/autoscript/xhs-unified-template.mjs +80 -443
  47. package/modules/camo-runtime/src/container/runtime-core/checkpoint.mjs +39 -6
  48. package/modules/camo-runtime/src/container/runtime-core/operations/index.mjs +206 -39
  49. package/modules/camo-runtime/src/container/runtime-core/operations/tab-pool.mjs +0 -79
  50. package/modules/camo-runtime/src/container/runtime-core/operations/viewport.mjs +46 -0
  51. package/modules/camo-runtime/src/utils/browser-service.mjs +41 -6
  52. package/modules/camo-runtime/src/utils/js-policy.mjs +28 -0
  53. package/modules/workflow/blocks/EnsureSession.ts +0 -4
  54. package/modules/workflow/blocks/WeiboCollectFromLinksBlock.ts +81 -6
  55. package/modules/workflow/blocks/WeiboCollectSearchLinksBlock.ts +316 -0
  56. package/modules/workflow/definitions/weibo-search-workflow-v1.ts +2 -0
  57. package/modules/workflow/src/runner.ts +2 -0
  58. package/modules/xiaohongshu/app/src/blocks/ReplyInteractBlock.ts +198 -53
  59. package/modules/xiaohongshu/app/src/blocks/SmartReplyBlock.ts +706 -0
  60. package/package.json +2 -2
  61. package/modules/camo-runtime/src/autoscript/action-providers/xhs/comments.mjs +0 -498
  62. package/modules/camo-runtime/src/autoscript/action-providers/xhs/detail.mjs +0 -181
  63. package/modules/camo-runtime/src/autoscript/action-providers/xhs/interaction.mjs +0 -691
  64. package/modules/camo-runtime/src/autoscript/action-providers/xhs/search.mjs +0 -388
  65. 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 { ok: true, code: 'OPERATION_DONE', message: 'operation done', data: execution.data || execution };
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,