@web-auto/webauto 0.1.1 → 0.1.2
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/apps/desktop-console/default-settings.json +1 -0
- package/apps/desktop-console/dist/main/index.mjs +1618 -0
- package/apps/desktop-console/{src → dist}/main/preload.mjs +10 -0
- package/apps/desktop-console/dist/renderer/index.js +3063 -0
- package/apps/desktop-console/entry/ui-console.mjs +299 -0
- package/apps/webauto/entry/account.mjs +356 -0
- package/apps/webauto/entry/lib/account-detect.mjs +160 -0
- package/apps/webauto/entry/lib/account-store.mjs +587 -0
- package/apps/webauto/entry/lib/profilepool.mjs +1 -1
- package/apps/webauto/entry/xhs-install.mjs +27 -3
- package/apps/webauto/entry/xhs-status.mjs +152 -0
- package/apps/webauto/entry/xhs-unified.mjs +595 -17
- package/bin/webauto.mjs +247 -12
- package/dist/apps/webauto/server.js +66 -0
- package/dist/modules/camo-backend/src/index.js +575 -0
- package/dist/modules/camo-backend/src/internal/BrowserSession.js +817 -0
- package/dist/modules/camo-backend/src/internal/ElementRegistry.js +61 -0
- package/dist/modules/camo-backend/src/internal/ProfileLock.js +85 -0
- package/dist/modules/camo-backend/src/internal/SessionManager.js +172 -0
- package/dist/modules/camo-backend/src/internal/container-matcher.js +852 -0
- package/dist/modules/camo-backend/src/internal/engine-manager.js +258 -0
- package/dist/modules/camo-backend/src/internal/fingerprint.js +203 -0
- package/dist/modules/camo-backend/src/internal/pageRuntime.js +29 -0
- package/dist/modules/camo-backend/src/internal/runtimeInjector.js +30 -0
- package/dist/modules/camo-backend/src/internal/state-bus.js +46 -0
- package/dist/modules/camo-backend/src/internal/storage-paths.js +36 -0
- package/dist/modules/camo-backend/src/internal/ws-server.js +1202 -0
- package/dist/modules/camo-runtime/src/utils/browser-service.mjs +423 -0
- package/dist/modules/camo-runtime/src/utils/config.mjs +77 -0
- package/dist/modules/container-registry/src/index.js +184 -0
- package/dist/modules/logging/src/index.js +92 -0
- package/dist/modules/operations/src/builtin.js +27 -0
- package/dist/modules/operations/src/container-binding.js +75 -0
- package/dist/modules/operations/src/executor.js +146 -0
- package/dist/modules/operations/src/operations/click.js +167 -0
- package/dist/modules/operations/src/operations/extract.js +204 -0
- package/dist/modules/operations/src/operations/find-child.js +17 -0
- package/dist/modules/operations/src/operations/highlight.js +138 -0
- package/dist/modules/operations/src/operations/key.js +61 -0
- package/dist/modules/operations/src/operations/navigate.js +148 -0
- package/dist/modules/operations/src/operations/scroll.js +126 -0
- package/dist/modules/operations/src/operations/type.js +190 -0
- package/dist/modules/operations/src/queue.js +100 -0
- package/dist/modules/operations/src/registry.js +11 -0
- package/dist/modules/operations/src/system/mouse.js +33 -0
- package/dist/modules/state/src/atomic-json.js +33 -0
- package/dist/modules/workflow/blocks/AnchorVerificationBlock.js +71 -0
- package/dist/modules/workflow/blocks/BehaviorRandomizer.js +26 -0
- package/dist/modules/workflow/blocks/CallWorkflowBlock.js +38 -0
- package/dist/modules/workflow/blocks/CloseDetailBlock.js +209 -0
- package/dist/modules/workflow/blocks/CollectBatch.js +137 -0
- package/dist/modules/workflow/blocks/CollectCommentsBlock.js +415 -0
- package/dist/modules/workflow/blocks/CollectSearchListBlock.js +599 -0
- package/dist/modules/workflow/blocks/CollectWeiboPosts.js +229 -0
- package/dist/modules/workflow/blocks/DetectPageStateBlock.js +259 -0
- package/dist/modules/workflow/blocks/EnsureLoginBlock.js +162 -0
- package/dist/modules/workflow/blocks/EnsureSession.js +426 -0
- package/dist/modules/workflow/blocks/ErrorClassifier.js +164 -0
- package/dist/modules/workflow/blocks/ErrorRecoveryBlock.js +319 -0
- package/dist/modules/workflow/blocks/ExpandCommentsBlock.js +1032 -0
- package/dist/modules/workflow/blocks/ExtractDetailBlock.js +310 -0
- package/dist/modules/workflow/blocks/ExtractPostFields.js +88 -0
- package/dist/modules/workflow/blocks/GenerateSmartReplyBlock.js +68 -0
- package/dist/modules/workflow/blocks/GoToSearchBlock.js +497 -0
- package/dist/modules/workflow/blocks/GracefulFallbackBlock.js +104 -0
- package/dist/modules/workflow/blocks/HighlightBlock.js +66 -0
- package/dist/modules/workflow/blocks/InitAutoScroll.js +65 -0
- package/dist/modules/workflow/blocks/LoadContainerDefinition.js +50 -0
- package/dist/modules/workflow/blocks/LoadContainerIndex.js +43 -0
- package/dist/modules/workflow/blocks/LocateAndGuardBlock.js +176 -0
- package/dist/modules/workflow/blocks/LoginRecoveryBlock.js +242 -0
- package/dist/modules/workflow/blocks/MatchContainers.js +64 -0
- package/dist/modules/workflow/blocks/MonitoringBlock.js +190 -0
- package/dist/modules/workflow/blocks/OpenDetailBlock.js +1240 -0
- package/dist/modules/workflow/blocks/OrganizeXhsNotesBlock.js +117 -0
- package/dist/modules/workflow/blocks/PersistXhsNoteBlock.js +270 -0
- package/dist/modules/workflow/blocks/PickSinglePost.js +69 -0
- package/dist/modules/workflow/blocks/ProgressTracker.js +125 -0
- package/dist/modules/workflow/blocks/RecordFixtureBlock.js +44 -0
- package/dist/modules/workflow/blocks/RenderMarkdown.js +48 -0
- package/dist/modules/workflow/blocks/SaveFile.js +54 -0
- package/dist/modules/workflow/blocks/ScrollNextBatch.js +72 -0
- package/dist/modules/workflow/blocks/SessionHealthBlock.js +73 -0
- package/dist/modules/workflow/blocks/StartBrowserService.js +45 -0
- package/dist/modules/workflow/blocks/ValidateContainerDefinition.js +67 -0
- package/dist/modules/workflow/blocks/ValidateExtract.js +35 -0
- package/dist/modules/workflow/blocks/WaitSearchPermitBlock.js +162 -0
- package/dist/modules/workflow/blocks/WaitStable.js +74 -0
- package/dist/modules/workflow/blocks/WarmupCommentsBlock.js +120 -0
- package/dist/modules/workflow/blocks/WorkflowExecutor.js +156 -0
- package/dist/modules/workflow/blocks/XiaohongshuCollectFromLinksBlock.js +1004 -0
- package/dist/modules/workflow/blocks/XiaohongshuCollectLinksBlock.js +1049 -0
- package/dist/modules/workflow/blocks/XiaohongshuFullCollectBlock.js +782 -0
- package/dist/modules/workflow/blocks/helpers/anchorVerify.js +198 -0
- package/dist/modules/workflow/blocks/helpers/asyncWorkQueue.js +53 -0
- package/dist/modules/workflow/blocks/helpers/commentScroller.js +334 -0
- package/dist/modules/workflow/blocks/helpers/commentSectionLocator.js +126 -0
- package/dist/modules/workflow/blocks/helpers/containerAnchors.js +301 -0
- package/dist/modules/workflow/blocks/helpers/debugArtifacts.js +6 -0
- package/dist/modules/workflow/blocks/helpers/downloadPaths.js +29 -0
- package/dist/modules/workflow/blocks/helpers/expandCommentsController.js +53 -0
- package/dist/modules/workflow/blocks/helpers/expandCommentsExtractor.js +129 -0
- package/dist/modules/workflow/blocks/helpers/macosVisionOcrPlugin.js +116 -0
- package/dist/modules/workflow/blocks/helpers/mergeXhsMarkdown.js +109 -0
- package/dist/modules/workflow/blocks/helpers/openDetailController.js +56 -0
- package/dist/modules/workflow/blocks/helpers/openDetailTypes.js +7 -0
- package/dist/modules/workflow/blocks/helpers/openDetailViewport.js +474 -0
- package/dist/modules/workflow/blocks/helpers/openDetailWaiter.js +104 -0
- package/dist/modules/workflow/blocks/helpers/operationLogger.js +195 -0
- package/dist/modules/workflow/blocks/helpers/persistedNotes.js +107 -0
- package/dist/modules/workflow/blocks/helpers/replyExpander.js +260 -0
- package/dist/modules/workflow/blocks/helpers/scrollIntoView.js +138 -0
- package/dist/modules/workflow/blocks/helpers/searchExecutor.js +328 -0
- package/dist/modules/workflow/blocks/helpers/searchGate.js +46 -0
- package/dist/modules/workflow/blocks/helpers/searchPageState.js +164 -0
- package/dist/modules/workflow/blocks/helpers/searchResultWaiter.js +64 -0
- package/dist/modules/workflow/blocks/helpers/simpleAnchor.js +134 -0
- package/dist/modules/workflow/blocks/helpers/smartReply.js +40 -0
- package/dist/modules/workflow/blocks/helpers/systemInput.js +635 -0
- package/dist/modules/workflow/blocks/helpers/targetCountMode.js +9 -0
- package/dist/modules/workflow/blocks/helpers/xhsCliArgs.js +80 -0
- package/dist/modules/workflow/blocks/helpers/xhsCommentDom.js +805 -0
- package/dist/modules/workflow/blocks/helpers/xhsNoteOrganizer.js +140 -0
- package/dist/modules/workflow/blocks/restore/RestorePhaseBlock.js +204 -0
- package/dist/modules/workflow/config/workflowRegistry.js +32 -0
- package/dist/modules/workflow/definitions/batch-collect-workflow.js +63 -0
- package/dist/modules/workflow/definitions/scroll-extract-workflow.js +74 -0
- package/dist/modules/workflow/definitions/xiaohongshu-collect-workflow-v2.js +81 -0
- package/dist/modules/workflow/definitions/xiaohongshu-collect-workflow.js +57 -0
- package/dist/modules/workflow/definitions/xiaohongshu-full-collect-workflow-v3.js +68 -0
- package/dist/modules/workflow/definitions/xiaohongshu-note-collect.js +49 -0
- package/dist/modules/workflow/definitions/xiaohongshu-phase1-workflow-v3.js +30 -0
- package/dist/modules/workflow/definitions/xiaohongshu-phase2-links-workflow-v3.js +40 -0
- package/dist/modules/workflow/definitions/xiaohongshu-phase3-collect-workflow-v1.js +54 -0
- package/dist/modules/workflow/definitions/xiaohongshu-phase34-from-links-workflow-v3.js +25 -0
- package/dist/modules/workflow/src/WeiboEventDrivenWorkflowRunner.js +308 -0
- package/dist/modules/workflow/src/context.js +70 -0
- package/dist/modules/workflow/src/index.js +5 -0
- package/dist/modules/workflow/src/orchestrator.js +230 -0
- package/dist/modules/workflow/src/runner.js +55 -0
- package/dist/modules/workflow/src/runtime.js +70 -0
- package/dist/modules/workflow/workflows/WeiboFeedExtractionWorkflow.js +359 -0
- package/dist/modules/workflow/workflows/XiaohongshuLoginWorkflow.js +110 -0
- package/dist/modules/xiaohongshu/app/src/blocks/MatchCommentsBlock.js +139 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase1EnsureServicesBlock.js +36 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase1MonitorCookieBlock.js +213 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase1StartProfileBlock.js +121 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase2CollectLinksBlock.js +1249 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase2SearchBlock.js +703 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34CloseDetailBlock.js +41 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34CloseTabsBlock.js +44 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34CollectCommentsBlock.js +150 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34ExtractDetailBlock.js +117 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34OpenDetailBlock.js +102 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34OpenTabsBlock.js +109 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34PersistDetailBlock.js +117 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34ProcessSingleNoteBlock.js +114 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase34ValidateLinksBlock.js +90 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase3InteractBlock.js +1009 -0
- package/dist/modules/xiaohongshu/app/src/blocks/Phase4MultiTabHarvestBlock.js +233 -0
- package/dist/modules/xiaohongshu/app/src/blocks/ReplyInteractBlock.js +291 -0
- package/dist/modules/xiaohongshu/app/src/blocks/XhsDiscoverFallbackBlock.js +240 -0
- package/dist/modules/xiaohongshu/app/src/blocks/helpers/commentMatchDsl.js +126 -0
- package/dist/modules/xiaohongshu/app/src/blocks/helpers/commentMatcher.js +99 -0
- package/dist/modules/xiaohongshu/app/src/blocks/helpers/evidence.js +27 -0
- package/dist/modules/xiaohongshu/app/src/blocks/helpers/sharding.js +42 -0
- package/dist/modules/xiaohongshu/app/src/blocks/helpers/xhsComments.js +270 -0
- package/dist/modules/xiaohongshu/app/src/index.js +9 -0
- package/dist/modules/xiaohongshu/app/src/utils/checkpoints.js +222 -0
- package/dist/modules/xiaohongshu/app/src/utils/controllerAction.js +43 -0
- package/dist/services/controller/src/controller.js +1476 -0
- package/dist/services/controller/src/index.js +2 -0
- package/dist/services/controller/src/payload-normalizer.js +129 -0
- package/dist/services/shared/heartbeat.js +120 -0
- package/dist/services/shared/lib/errorHandler.js +2 -0
- package/dist/services/shared/serviceProcessLogger.js +139 -0
- package/dist/services/unified-api/RemoteBrowserSession.js +176 -0
- package/dist/services/unified-api/RemoteSessionManager.js +148 -0
- package/dist/services/unified-api/container-operations-handler.js +115 -0
- package/dist/services/unified-api/server.js +652 -0
- package/dist/services/unified-api/state-registry.js +274 -0
- package/dist/services/unified-api/task-persistence.js +66 -0
- package/dist/services/unified-api/task-state.js +130 -0
- package/modules/camo-runtime/src/autoscript/action-providers/xhs/search.mjs +12 -5
- package/modules/xiaohongshu/app/pnpm-lock.yaml +24 -0
- package/package.json +37 -9
- package/.beads/README.md +0 -81
- package/.beads/config.yaml +0 -67
- package/.beads/interactions.jsonl +0 -0
- package/.beads/issues.jsonl +0 -180
- package/.beads/metadata.json +0 -4
- package/.claude/settings.local.json +0 -10
- package/.github/workflows/ci.yml +0 -55
- package/AGENTS.md +0 -253
- package/apps/desktop-console/README.md +0 -27
- package/apps/desktop-console/package-lock.json +0 -897
- package/apps/desktop-console/package.json +0 -20
- package/apps/desktop-console/scripts/build-and-install.mjs +0 -19
- package/apps/desktop-console/scripts/build.mjs +0 -45
- package/apps/desktop-console/scripts/test-preload.mjs +0 -13
- package/apps/desktop-console/src/main/config.mts +0 -26
- package/apps/desktop-console/src/main/core-daemon-manager.mts +0 -131
- package/apps/desktop-console/src/main/desktop-settings.mts +0 -267
- package/apps/desktop-console/src/main/heartbeat-watchdog.mts +0 -50
- package/apps/desktop-console/src/main/heartbeat-watchdog.test.mts +0 -68
- package/apps/desktop-console/src/main/index-streaming.test.mts +0 -20
- package/apps/desktop-console/src/main/index.mts +0 -980
- package/apps/desktop-console/src/main/profile-store.mts +0 -239
- package/apps/desktop-console/src/main/profile-store.test.mts +0 -54
- package/apps/desktop-console/src/main/state-bridge.mts +0 -114
- package/apps/desktop-console/src/main/task-state-types.ts +0 -32
- package/apps/desktop-console/src/renderer/hooks/use-task-state.mts +0 -120
- package/apps/desktop-console/src/renderer/index.mts +0 -133
- package/apps/desktop-console/src/renderer/index.test.mts +0 -34
- package/apps/desktop-console/src/renderer/path-helpers.mts +0 -46
- package/apps/desktop-console/src/renderer/path-helpers.test.mts +0 -14
- package/apps/desktop-console/src/renderer/tabs/debug.mts +0 -48
- package/apps/desktop-console/src/renderer/tabs/debug.test.mts +0 -22
- package/apps/desktop-console/src/renderer/tabs/logs.mts +0 -421
- package/apps/desktop-console/src/renderer/tabs/logs.test.mts +0 -27
- package/apps/desktop-console/src/renderer/tabs/preflight.mts +0 -486
- package/apps/desktop-console/src/renderer/tabs/preflight.test.mts +0 -33
- package/apps/desktop-console/src/renderer/tabs/profile-pool.mts +0 -213
- package/apps/desktop-console/src/renderer/tabs/results.mts +0 -171
- package/apps/desktop-console/src/renderer/tabs/run.test.mts +0 -63
- package/apps/desktop-console/src/renderer/tabs/runtime.mts +0 -151
- package/apps/desktop-console/src/renderer/tabs/settings.mts +0 -146
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu/account-flow.mts +0 -486
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu/guide-browser-check.mts +0 -56
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu/helpers.mts +0 -262
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu/layout-block.mts +0 -430
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu/live-stats.mts +0 -847
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu/run-flow.mts +0 -443
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu-state.mts +0 -425
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu.mts +0 -497
- package/apps/desktop-console/src/renderer/tabs/xiaohongshu.test.mts +0 -291
- package/apps/desktop-console/src/renderer/ui-components.mts +0 -31
- package/docs/README_camoufox_chinese.md +0 -141
- package/docs/USAGE_V3.md +0 -163
- package/docs/arch/OCR_MACOS_PLUGIN.md +0 -39
- package/docs/arch/PORTS.md +0 -40
- package/docs/arch/REGRESSION_CHECKLIST.md +0 -121
- package/docs/arch/SEARCH_GATE.md +0 -224
- package/docs/arch/VIEWPORT_SAFETY.md +0 -182
- package/docs/arch/XIAOHONGSHU_OFFLINE_MOCK_DESIGN.md +0 -267
- package/docs/xiaohongshu-container-driven-summary.md +0 -221
- package/docs/xiaohongshu-full-collect-runbook.md +0 -134
- package/docs/xiaohongshu-next-steps.md +0 -228
- package/docs/xiaohongshu-quickstart.md +0 -73
- package/docs/xiaohongshu-workflow-summary.md +0 -227
- package/modules/container-registry/tests/container-registry.test.ts +0 -16
- package/modules/logging/tests/logging.test.ts +0 -38
- package/modules/operations/tests/operations.test.ts +0 -22
- package/modules/operations/tests/viewport-filter.test.ts +0 -161
- package/modules/operations/tests/visible-only.test.ts +0 -250
- package/modules/session-manager/tests/session-manager.test.ts +0 -23
- package/modules/state/src/atomic-json.test.ts +0 -30
- package/modules/state/src/paths.test.ts +0 -59
- package/modules/state/src/xiaohongshu-collect-state.test.ts +0 -259
- package/modules/workflow/blocks/AnchorVerificationBlock.d.ts.map +0 -1
- package/modules/workflow/blocks/AnchorVerificationBlock.js.map +0 -1
- package/modules/workflow/blocks/DetectPageStateBlock.d.ts.map +0 -1
- package/modules/workflow/blocks/DetectPageStateBlock.js.map +0 -1
- package/modules/workflow/blocks/ErrorRecoveryBlock.d.ts.map +0 -1
- package/modules/workflow/blocks/ErrorRecoveryBlock.js.map +0 -1
- package/modules/workflow/blocks/WaitSearchPermitBlock.d.ts.map +0 -1
- package/modules/workflow/blocks/WaitSearchPermitBlock.js.map +0 -1
- package/modules/workflow/blocks/helpers/containerAnchors.d.ts.map +0 -1
- package/modules/workflow/blocks/helpers/containerAnchors.js.map +0 -1
- package/modules/workflow/blocks/helpers/downloadPaths.test.ts +0 -62
- package/modules/workflow/blocks/helpers/mergeXhsMarkdown.test.ts +0 -121
- package/modules/workflow/blocks/helpers/operationLogger.d.ts.map +0 -1
- package/modules/workflow/blocks/helpers/operationLogger.js.map +0 -1
- package/modules/workflow/blocks/helpers/persistedNotes.test.ts +0 -268
- package/modules/workflow/blocks/helpers/searchPageState.d.ts.map +0 -1
- package/modules/workflow/blocks/helpers/searchPageState.js.map +0 -1
- package/modules/workflow/blocks/helpers/targetCountMode.test.ts +0 -29
- package/modules/workflow/blocks/helpers/xhsCliArgs.test.ts +0 -75
- package/modules/workflow/tests/smartReply.test.ts +0 -32
- package/modules/xiaohongshu/app/src/blocks/Phase3Interact.matcher.test.ts +0 -33
- package/modules/xiaohongshu/app/src/utils/__tests__/checkpoints.test.ts +0 -141
- package/modules/xiaohongshu/app/tests/commentMatchDsl.test.ts +0 -50
- package/modules/xiaohongshu/app/tests/commentMatcher.test.ts +0 -46
- package/modules/xiaohongshu/app/tests/sharding.test.ts +0 -31
- package/package-scripts.json +0 -8
- package/runtime/infra/utils/README.md +0 -13
- package/runtime/infra/utils/scripts/README.md +0 -0
- package/runtime/infra/utils/scripts/development/eval-in-session.mjs +0 -40
- package/runtime/infra/utils/scripts/development/highlight-search-containers.mjs +0 -35
- package/runtime/infra/utils/scripts/service/kill-port.mjs +0 -24
- package/runtime/infra/utils/scripts/service/start-api.mjs +0 -39
- package/runtime/infra/utils/scripts/service/start-browser-service.mjs +0 -106
- package/runtime/infra/utils/scripts/service/stop-api.mjs +0 -18
- package/runtime/infra/utils/scripts/service/stop-browser-service.mjs +0 -104
- package/runtime/infra/utils/scripts/test-services.mjs +0 -94
- package/services/shared/heartbeat.test.ts +0 -102
- package/services/unified-api/__tests__/task-state.test.ts +0 -95
- package/sitecustomize.py +0 -19
- package/tests/README.md +0 -194
- package/tests/e2e/workflows/weibo-feed-extraction.test.ts +0 -171
- package/tests/fixtures/data/container-definitions.json +0 -67
- package/tests/fixtures/pages/simple-page.html +0 -69
- package/tests/integration/01-test-container-match.mjs +0 -188
- package/tests/integration/02-test-dom-branch.mjs +0 -161
- package/tests/integration/03-test-container-operation-system.mjs +0 -91
- package/tests/integration/05-test-container-lifecycle-events.mjs +0 -224
- package/tests/integration/05-test-container-lifecycle-with-events.mjs +0 -250
- package/tests/integration/06-test-container-dom-tree-drawing.mjs +0 -256
- package/tests/integration/07-test-weibo-container-lifecycle.mjs +0 -355
- package/tests/integration/08-test-weibo-feed-workflow.test.mjs +0 -164
- package/tests/integration/10-test-visual-analyzer.mjs +0 -312
- package/tests/integration/11-test-visual-loop.mjs +0 -284
- package/tests/integration/12-test-simple-visual-loop.mjs +0 -242
- package/tests/integration/13-test-visual-robust.mjs +0 -185
- package/tests/integration/14-test-visual-highlight-loop.mjs +0 -271
- package/tests/integration/inspect-page.mjs +0 -50
- package/tests/integration/run-all-tests.mjs +0 -95
- package/tests/patch_verification/CODEX_PATCH_TEST.md +0 -103
- package/tests/patch_verification/PHASE2_ANALYSIS.md +0 -179
- package/tests/patch_verification/PHASE2_OPTIMIZATION_REPORT.md +0 -55
- package/tests/patch_verification/PHASE2_TO_PHASE4_SUMMARY.md +0 -126
- package/tests/patch_verification/QUICK_TEST_SEQUENCE.md +0 -262
- package/tests/patch_verification/README.md +0 -143
- package/tests/patch_verification/RUN_TESTS.md +0 -60
- package/tests/patch_verification/TEST_EXECUTION.md +0 -99
- package/tests/patch_verification/TEST_PLAN.md +0 -328
- package/tests/patch_verification/TEST_RESULTS.md +0 -34
- package/tests/patch_verification/TOOL_TEST_PLAN.md +0 -48
- package/tests/patch_verification/run-tool-test.mjs +0 -121
- package/tests/patch_verification/temp_test_files/test01.txt +0 -1
- package/tests/patch_verification/temp_test_files/test02.txt +0 -3
- package/tests/patch_verification/temp_test_files/test02_gnu.txt +0 -3
- package/tests/patch_verification/temp_test_files/test03.txt +0 -1
- package/tests/patch_verification/temp_test_files/test03_multiline.txt +0 -5
- package/tests/patch_verification/temp_test_files/test04_function.ts +0 -5
- package/tests/patch_verification/temp_test_files/test05_import.ts +0 -4
- package/tests/patch_verification/temp_test_files/test06_special_chars.txt +0 -4
- package/tests/patch_verification/temp_test_files/test07_indentation.ts +0 -5
- package/tests/patch_verification/temp_test_files/test08_mismatch.txt +0 -1
- package/tests/patch_verification/temp_test_files/test_add_02.txt +0 -3
- package/tests/patch_verification/temp_test_files/test_simple.txt +0 -1
- package/tests/runner/TestReporter.mjs +0 -57
- package/tests/runner/TestRunner.mjs +0 -244
- package/tests/unit/commands/profile.test.mjs +0 -10
- package/tests/unit/container/change-notifier.test.mjs +0 -181
- package/tests/unit/lifecycle/session-registry.test.mjs +0 -135
- package/tests/unit/operations/registry.test.ts +0 -73
- package/tests/unit/utils/browser-service.test.mjs +0 -153
- package/tests/unit/utils/config.test.mjs +0 -166
- package/tests/unit/utils/fingerprint.test.mjs +0 -166
- package/tsconfig.json +0 -31
- package/tsconfig.services.json +0 -26
- /package/apps/desktop-console/{src → dist}/renderer/index.html +0 -0
- /package/apps/desktop-console/{src/renderer/tabs → dist/renderer}/run.mts +0 -0
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { describe, it, beforeEach, afterEach } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import os from 'node:os';
|
|
6
|
-
|
|
7
|
-
// Mock fetch for testing
|
|
8
|
-
const originalFetch = global.fetch;
|
|
9
|
-
|
|
10
|
-
describe('browser-service utilities', () => {
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
// Mock fetch
|
|
13
|
-
global.fetch = async (url, options) => {
|
|
14
|
-
if (url.includes('/health')) {
|
|
15
|
-
return { ok: true, status: 200 };
|
|
16
|
-
}
|
|
17
|
-
if (url.includes('/command')) {
|
|
18
|
-
const body = JSON.parse(options.body);
|
|
19
|
-
if (body.action === 'getStatus') {
|
|
20
|
-
return {
|
|
21
|
-
ok: true,
|
|
22
|
-
json: async () => ({ sessions: [] }),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
ok: true,
|
|
27
|
-
json: async () => ({ ok: true }),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return { ok: true, json: async () => ({}) };
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
afterEach(() => {
|
|
35
|
-
global.fetch = originalFetch;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('module exports', () => {
|
|
39
|
-
it('should export required functions', async () => {
|
|
40
|
-
const bs = await import('../../../src/utils/browser-service.mjs');
|
|
41
|
-
assert.strictEqual(typeof bs.callAPI, 'function');
|
|
42
|
-
assert.strictEqual(typeof bs.getSessionByProfile, 'function');
|
|
43
|
-
assert.strictEqual(typeof bs.checkBrowserService, 'function');
|
|
44
|
-
assert.strictEqual(typeof bs.detectCamoufoxPath, 'function');
|
|
45
|
-
assert.strictEqual(typeof bs.ensureCamoufox, 'function');
|
|
46
|
-
assert.strictEqual(typeof bs.ensureBrowserService, 'function');
|
|
47
|
-
assert.strictEqual(typeof bs.findRepoRootCandidate, 'function');
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
describe('checkBrowserService', () => {
|
|
52
|
-
it('should return true when service is healthy', async () => {
|
|
53
|
-
const { checkBrowserService } = await import('../../../src/utils/browser-service.mjs');
|
|
54
|
-
const result = await checkBrowserService();
|
|
55
|
-
assert.strictEqual(result, true);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('should return false when service is not running', async () => {
|
|
59
|
-
global.fetch = async () => { throw new Error('Connection refused'); };
|
|
60
|
-
const { checkBrowserService } = await import('../../../src/utils/browser-service.mjs');
|
|
61
|
-
const result = await checkBrowserService();
|
|
62
|
-
assert.strictEqual(result, false);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('callAPI', () => {
|
|
67
|
-
it('should call fetch with correct parameters', async () => {
|
|
68
|
-
let calledUrl = null;
|
|
69
|
-
let calledOptions = null;
|
|
70
|
-
global.fetch = async (url, options) => {
|
|
71
|
-
calledUrl = url;
|
|
72
|
-
calledOptions = options;
|
|
73
|
-
return { ok: true, json: async () => ({ result: 'ok' }) };
|
|
74
|
-
};
|
|
75
|
-
const { callAPI } = await import('../../../src/utils/browser-service.mjs');
|
|
76
|
-
const result = await callAPI('/test-action', { foo: 'bar' });
|
|
77
|
-
assert.ok(calledUrl.includes('/command'));
|
|
78
|
-
assert.strictEqual(calledOptions.method, 'POST');
|
|
79
|
-
assert.strictEqual(result.result, 'ok');
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('should throw on HTTP error', async () => {
|
|
83
|
-
global.fetch = async () => ({
|
|
84
|
-
ok: false,
|
|
85
|
-
status: 500,
|
|
86
|
-
text: async () => 'Internal Server Error',
|
|
87
|
-
});
|
|
88
|
-
const { callAPI } = await import('../../../src/utils/browser-service.mjs');
|
|
89
|
-
await assert.rejects(
|
|
90
|
-
async () => callAPI('/error-action', {}),
|
|
91
|
-
/HTTP 500/
|
|
92
|
-
);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('should throw on error response', async () => {
|
|
96
|
-
global.fetch = async () => ({
|
|
97
|
-
ok: false,
|
|
98
|
-
status: 400,
|
|
99
|
-
json: async () => ({ error: 'Bad request' }),
|
|
100
|
-
});
|
|
101
|
-
const { callAPI } = await import('../../../src/utils/browser-service.mjs');
|
|
102
|
-
await assert.rejects(
|
|
103
|
-
async () => callAPI('/error-action', {}),
|
|
104
|
-
/Bad request/
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
describe('getSessionByProfile', () => {
|
|
110
|
-
it('should return session when found', async () => {
|
|
111
|
-
global.fetch = async () => ({
|
|
112
|
-
ok: true,
|
|
113
|
-
json: async () => ({
|
|
114
|
-
sessions: [
|
|
115
|
-
{ profileId: 'profile-a', sessionId: 'sid-a' },
|
|
116
|
-
{ profileId: 'profile-b', sessionId: 'sid-b' },
|
|
117
|
-
],
|
|
118
|
-
}),
|
|
119
|
-
});
|
|
120
|
-
const { getSessionByProfile } = await import('../../../src/utils/browser-service.mjs');
|
|
121
|
-
const session = await getSessionByProfile('profile-a');
|
|
122
|
-
assert.strictEqual(session.profileId, 'profile-a');
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('should return null when not found', async () => {
|
|
126
|
-
global.fetch = async () => ({
|
|
127
|
-
ok: true,
|
|
128
|
-
json: async () => ({ sessions: [] }),
|
|
129
|
-
});
|
|
130
|
-
const { getSessionByProfile } = await import('../../../src/utils/browser-service.mjs');
|
|
131
|
-
const session = await getSessionByProfile('nonexistent');
|
|
132
|
-
assert.strictEqual(session, null);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe('detectCamoufoxPath', () => {
|
|
137
|
-
it('should return null when camoufox not installed', async () => {
|
|
138
|
-
const { detectCamoufoxPath } = await import('../../../src/utils/browser-service.mjs');
|
|
139
|
-
// This will likely return null in test environment
|
|
140
|
-
const result = detectCamoufoxPath();
|
|
141
|
-
// Just verify it returns something (null or string)
|
|
142
|
-
assert.ok(result === null || typeof result === 'string');
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
describe('findRepoRootCandidate', () => {
|
|
147
|
-
it('should return null or a valid path', async () => {
|
|
148
|
-
const { findRepoRootCandidate } = await import('../../../src/utils/browser-service.mjs');
|
|
149
|
-
const result = findRepoRootCandidate();
|
|
150
|
-
assert.ok(result === null || typeof result === 'string');
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
});
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import os from 'node:os';
|
|
6
|
-
|
|
7
|
-
// We need to test the actual config module which uses ~/.webauto
|
|
8
|
-
// So we'll test the pure functions that don't require file system state
|
|
9
|
-
|
|
10
|
-
describe('config utilities', () => {
|
|
11
|
-
describe('module exports', () => {
|
|
12
|
-
it('should export required functions', async () => {
|
|
13
|
-
const config = await import('../../../src/utils/config.mjs');
|
|
14
|
-
assert.strictEqual(typeof config.ensureDir, 'function');
|
|
15
|
-
assert.strictEqual(typeof config.readJson, 'function');
|
|
16
|
-
assert.strictEqual(typeof config.writeJson, 'function');
|
|
17
|
-
assert.strictEqual(typeof config.loadConfig, 'function');
|
|
18
|
-
assert.strictEqual(typeof config.saveConfig, 'function');
|
|
19
|
-
assert.strictEqual(typeof config.listProfiles, 'function');
|
|
20
|
-
assert.strictEqual(typeof config.isValidProfileId, 'function');
|
|
21
|
-
assert.strictEqual(typeof config.createProfile, 'function');
|
|
22
|
-
assert.strictEqual(typeof config.deleteProfile, 'function');
|
|
23
|
-
assert.strictEqual(typeof config.setDefaultProfile, 'function');
|
|
24
|
-
assert.strictEqual(typeof config.getDefaultProfile, 'function');
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('isValidProfileId', () => {
|
|
29
|
-
it('should accept valid profile IDs', async () => {
|
|
30
|
-
const { isValidProfileId } = await import('../../../src/utils/config.mjs');
|
|
31
|
-
assert.strictEqual(isValidProfileId('profile123'), true);
|
|
32
|
-
assert.strictEqual(isValidProfileId('my_profile'), true);
|
|
33
|
-
assert.strictEqual(isValidProfileId('my-profile'), true);
|
|
34
|
-
assert.strictEqual(isValidProfileId('my.profile'), true);
|
|
35
|
-
assert.strictEqual(isValidProfileId('Profile_123.test'), true);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should reject invalid profile IDs', async () => {
|
|
39
|
-
const { isValidProfileId } = await import('../../../src/utils/config.mjs');
|
|
40
|
-
assert.strictEqual(isValidProfileId('profile/with/slash'), false);
|
|
41
|
-
assert.strictEqual(isValidProfileId('profile:with:colon'), false);
|
|
42
|
-
assert.strictEqual(isValidProfileId(''), false);
|
|
43
|
-
assert.strictEqual(isValidProfileId(null), false);
|
|
44
|
-
assert.strictEqual(isValidProfileId(undefined), false);
|
|
45
|
-
assert.strictEqual(isValidProfileId(123), false);
|
|
46
|
-
assert.strictEqual(isValidProfileId('profile with space'), false);
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe('ensureDir', () => {
|
|
51
|
-
it('should create nested directories', async () => {
|
|
52
|
-
const { ensureDir } = await import('../../../src/utils/config.mjs');
|
|
53
|
-
const testDir = path.join(os.tmpdir(), 'camo-test-ensureDir-' + Date.now(), 'nested', 'path');
|
|
54
|
-
ensureDir(testDir);
|
|
55
|
-
assert.strictEqual(fs.existsSync(testDir), true);
|
|
56
|
-
fs.rmSync(path.dirname(path.dirname(path.dirname(testDir))), { recursive: true, force: true });
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should not throw for existing directories', async () => {
|
|
60
|
-
const { ensureDir } = await import('../../../src/utils/config.mjs');
|
|
61
|
-
const testDir = path.join(os.tmpdir(), 'camo-test-ensureDir2-' + Date.now());
|
|
62
|
-
fs.mkdirSync(testDir, { recursive: true });
|
|
63
|
-
assert.doesNotThrow(() => ensureDir(testDir));
|
|
64
|
-
fs.rmSync(testDir, { recursive: true, force: true });
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
describe('readJson/writeJson', () => {
|
|
69
|
-
it('should write and read JSON correctly', async () => {
|
|
70
|
-
const { writeJson, readJson } = await import('../../../src/utils/config.mjs');
|
|
71
|
-
const testFile = path.join(os.tmpdir(), 'camo-test-json-' + Date.now() + '.json');
|
|
72
|
-
const data = { foo: 'bar', num: 42, nested: { a: 1 } };
|
|
73
|
-
writeJson(testFile, data);
|
|
74
|
-
const read = readJson(testFile);
|
|
75
|
-
assert.deepStrictEqual(read, data);
|
|
76
|
-
fs.unlinkSync(testFile);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should return null for non-existent file', async () => {
|
|
80
|
-
const { readJson } = await import('../../../src/utils/config.mjs');
|
|
81
|
-
const result = readJson('/nonexistent/path/file.json');
|
|
82
|
-
assert.strictEqual(result, null);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('should return null for invalid JSON', async () => {
|
|
86
|
-
const { readJson } = await import('../../../src/utils/config.mjs');
|
|
87
|
-
const testFile = path.join(os.tmpdir(), 'camo-test-invalid-' + Date.now() + '.json');
|
|
88
|
-
fs.writeFileSync(testFile, 'not valid json {');
|
|
89
|
-
const result = readJson(testFile);
|
|
90
|
-
assert.strictEqual(result, null);
|
|
91
|
-
fs.unlinkSync(testFile);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
describe('listProfiles', () => {
|
|
96
|
-
it('should return an array', async () => {
|
|
97
|
-
const { listProfiles } = await import('../../../src/utils/config.mjs');
|
|
98
|
-
const profiles = listProfiles();
|
|
99
|
-
assert.ok(Array.isArray(profiles));
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
describe('loadConfig/saveConfig', () => {
|
|
104
|
-
it('should load config with defaults', async () => {
|
|
105
|
-
const { loadConfig } = await import('../../../src/utils/config.mjs');
|
|
106
|
-
const cfg = loadConfig();
|
|
107
|
-
assert.ok(cfg !== null);
|
|
108
|
-
assert.ok('defaultProfile' in cfg);
|
|
109
|
-
assert.ok('repoRoot' in cfg);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
describe('createProfile/deleteProfile', () => {
|
|
114
|
-
it('should create and delete profile', async () => {
|
|
115
|
-
const { createProfile, deleteProfile, listProfiles } = await import('../../../src/utils/config.mjs');
|
|
116
|
-
const profileId = 'test-profile-' + Date.now();
|
|
117
|
-
|
|
118
|
-
// Create
|
|
119
|
-
createProfile(profileId);
|
|
120
|
-
const profilesAfterCreate = listProfiles();
|
|
121
|
-
assert.ok(profilesAfterCreate.includes(profileId));
|
|
122
|
-
|
|
123
|
-
// Delete
|
|
124
|
-
deleteProfile(profileId);
|
|
125
|
-
const profilesAfterDelete = listProfiles();
|
|
126
|
-
assert.ok(!profilesAfterDelete.includes(profileId));
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('should throw for invalid profile ID on create', async () => {
|
|
130
|
-
const { createProfile } = await import('../../../src/utils/config.mjs');
|
|
131
|
-
assert.throws(() => createProfile('invalid/id'), /Invalid profileId/);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it('should throw for non-existent profile on delete', async () => {
|
|
135
|
-
const { deleteProfile } = await import('../../../src/utils/config.mjs');
|
|
136
|
-
assert.throws(() => deleteProfile('non-existent-profile-' + Date.now()), /Profile not found/);
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
describe('setDefaultProfile/getDefaultProfile', () => {
|
|
141
|
-
it('should set and get default profile', async () => {
|
|
142
|
-
const { createProfile, setDefaultProfile, getDefaultProfile, deleteProfile } = await import('../../../src/utils/config.mjs');
|
|
143
|
-
const profileId = 'test-default-' + Date.now();
|
|
144
|
-
|
|
145
|
-
createProfile(profileId);
|
|
146
|
-
setDefaultProfile(profileId);
|
|
147
|
-
const def = getDefaultProfile();
|
|
148
|
-
assert.strictEqual(def, profileId);
|
|
149
|
-
|
|
150
|
-
// Can set to null
|
|
151
|
-
setDefaultProfile(null);
|
|
152
|
-
|
|
153
|
-
deleteProfile(profileId);
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
describe('constants', () => {
|
|
158
|
-
it('should export required constants', async () => {
|
|
159
|
-
const config = await import('../../../src/utils/config.mjs');
|
|
160
|
-
assert.ok(config.CONFIG_DIR);
|
|
161
|
-
assert.ok(config.PROFILES_DIR);
|
|
162
|
-
assert.ok(config.CONFIG_FILE);
|
|
163
|
-
assert.ok(config.BROWSER_SERVICE_URL);
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
});
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import {
|
|
4
|
-
GEOIP_REGIONS,
|
|
5
|
-
OS_OPTIONS,
|
|
6
|
-
hasGeoIP,
|
|
7
|
-
getGeoIPPath,
|
|
8
|
-
generateFingerprint,
|
|
9
|
-
listAvailableRegions,
|
|
10
|
-
listAvailableOS,
|
|
11
|
-
} from '../../../src/utils/fingerprint.mjs';
|
|
12
|
-
|
|
13
|
-
describe('fingerprint utilities', () => {
|
|
14
|
-
describe('GEOIP_REGIONS', () => {
|
|
15
|
-
it('should contain expected regions', () => {
|
|
16
|
-
assert.ok(GEOIP_REGIONS['us']);
|
|
17
|
-
assert.ok(GEOIP_REGIONS['uk']);
|
|
18
|
-
assert.ok(GEOIP_REGIONS['jp']);
|
|
19
|
-
assert.strictEqual(GEOIP_REGIONS['us'].country, 'United States');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should have required fields for each region', () => {
|
|
23
|
-
for (const [key, config] of Object.entries(GEOIP_REGIONS)) {
|
|
24
|
-
assert.ok(config.country, `${key} should have country`);
|
|
25
|
-
assert.ok(config.timezone, `${key} should have timezone`);
|
|
26
|
-
assert.ok(config.locale, `${key} should have locale`);
|
|
27
|
-
assert.ok(config.city, `${key} should have city`);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
describe('OS_OPTIONS', () => {
|
|
33
|
-
it('should contain expected OS options', () => {
|
|
34
|
-
assert.ok(OS_OPTIONS['mac']);
|
|
35
|
-
assert.ok(OS_OPTIONS['windows']);
|
|
36
|
-
assert.ok(OS_OPTIONS['linux']);
|
|
37
|
-
assert.strictEqual(OS_OPTIONS['mac'].platform, 'darwin');
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('should have required fields for each OS', () => {
|
|
41
|
-
for (const [key, config] of Object.entries(OS_OPTIONS)) {
|
|
42
|
-
assert.ok(config.platform, `${key} should have platform`);
|
|
43
|
-
assert.ok(config.os, `${key} should have os`);
|
|
44
|
-
assert.ok(config.osVersion, `${key} should have osVersion`);
|
|
45
|
-
assert.ok(config.cpuCores, `${key} should have cpuCores`);
|
|
46
|
-
assert.ok(config.memory, `${key} should have memory`);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
describe('hasGeoIP', () => {
|
|
52
|
-
it('should return boolean', () => {
|
|
53
|
-
const result = hasGeoIP();
|
|
54
|
-
assert.strictEqual(typeof result, 'boolean');
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
describe('getGeoIPPath', () => {
|
|
59
|
-
it('should return a string path', () => {
|
|
60
|
-
const path = getGeoIPPath();
|
|
61
|
-
assert.strictEqual(typeof path, 'string');
|
|
62
|
-
assert.ok(path.includes('geoip'));
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('generateFingerprint', () => {
|
|
67
|
-
it('should generate fingerprint with default options', () => {
|
|
68
|
-
const fp = generateFingerprint();
|
|
69
|
-
assert.ok(fp.os);
|
|
70
|
-
assert.ok(fp.platform);
|
|
71
|
-
assert.ok(fp.screen);
|
|
72
|
-
assert.ok(fp.webgl);
|
|
73
|
-
assert.ok(fp.userAgent);
|
|
74
|
-
assert.ok(fp.timezone);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('should use specified OS', () => {
|
|
78
|
-
const fp = generateFingerprint({ os: 'windows' });
|
|
79
|
-
assert.strictEqual(fp.platform, 'win32');
|
|
80
|
-
assert.strictEqual(fp.os, 'Windows');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should use specified region', () => {
|
|
84
|
-
const fp = generateFingerprint({ region: 'jp' });
|
|
85
|
-
assert.strictEqual(fp.country, 'Japan');
|
|
86
|
-
assert.strictEqual(fp.timezone, 'Asia/Tokyo');
|
|
87
|
-
assert.strictEqual(fp.locale, 'ja-JP');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should have valid screen dimensions', () => {
|
|
91
|
-
const fp = generateFingerprint();
|
|
92
|
-
assert.ok(fp.screen.width > 0);
|
|
93
|
-
assert.ok(fp.screen.height > 0);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('should have webgl vendor and renderer', () => {
|
|
97
|
-
const fp = generateFingerprint();
|
|
98
|
-
assert.ok(fp.webgl.vendor);
|
|
99
|
-
assert.ok(fp.webgl.renderer);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('should generate valid user agent for mac', () => {
|
|
103
|
-
const fp = generateFingerprint({ os: 'mac' });
|
|
104
|
-
assert.ok(fp.userAgent.includes('Macintosh'));
|
|
105
|
-
assert.ok(fp.userAgent.includes('Chrome'));
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('should generate valid user agent for windows', () => {
|
|
109
|
-
const fp = generateFingerprint({ os: 'windows' });
|
|
110
|
-
assert.ok(fp.userAgent.includes('Windows'));
|
|
111
|
-
assert.ok(fp.userAgent.includes('Chrome'));
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should generate valid user agent for linux', () => {
|
|
115
|
-
const fp = generateFingerprint({ os: 'linux' });
|
|
116
|
-
assert.ok(fp.userAgent.includes('Linux'));
|
|
117
|
-
assert.ok(fp.userAgent.includes('Chrome'));
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it('should fallback to defaults for invalid os', () => {
|
|
121
|
-
const fp = generateFingerprint({ os: 'invalid' });
|
|
122
|
-
assert.ok(fp.os); // Should still have valid OS
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('should fallback to defaults for invalid region', () => {
|
|
126
|
-
const fp = generateFingerprint({ region: 'invalid' });
|
|
127
|
-
assert.ok(fp.country); // Should still have valid country
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
describe('listAvailableRegions', () => {
|
|
132
|
-
it('should return array of regions', () => {
|
|
133
|
-
const regions = listAvailableRegions();
|
|
134
|
-
assert.ok(Array.isArray(regions));
|
|
135
|
-
assert.ok(regions.length > 0);
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
it('should have required fields in each region', () => {
|
|
139
|
-
const regions = listAvailableRegions();
|
|
140
|
-
for (const r of regions) {
|
|
141
|
-
assert.ok(r.key);
|
|
142
|
-
assert.ok(r.country);
|
|
143
|
-
assert.ok(r.city);
|
|
144
|
-
assert.ok(r.timezone);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
describe('listAvailableOS', () => {
|
|
150
|
-
it('should return array of OS options', () => {
|
|
151
|
-
const osList = listAvailableOS();
|
|
152
|
-
assert.ok(Array.isArray(osList));
|
|
153
|
-
assert.ok(osList.length > 0);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('should have required fields in each OS', () => {
|
|
157
|
-
const osList = listAvailableOS();
|
|
158
|
-
for (const o of osList) {
|
|
159
|
-
assert.ok(o.key);
|
|
160
|
-
assert.ok(o.platform);
|
|
161
|
-
assert.ok(o.os);
|
|
162
|
-
assert.ok(o.osVersion);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"strict": false,
|
|
11
|
-
"forceConsistentCasingInFileNames": false,
|
|
12
|
-
"moduleResolution": "nodenext",
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"isolatedModules": false,
|
|
15
|
-
"noEmit": false,
|
|
16
|
-
"declaration": false,
|
|
17
|
-
"sourceMap": true,
|
|
18
|
-
"outDir": "./dist",
|
|
19
|
-
"baseUrl": ".",
|
|
20
|
-
"noImplicitAny": true,
|
|
21
|
-
"strictNullChecks": false,
|
|
22
|
-
"downlevelIteration": true
|
|
23
|
-
},
|
|
24
|
-
"include": [
|
|
25
|
-
"apps/webauto/server.ts"
|
|
26
|
-
],
|
|
27
|
-
"exclude": [
|
|
28
|
-
"node_modules",
|
|
29
|
-
"dist"
|
|
30
|
-
]
|
|
31
|
-
}
|
package/tsconfig.services.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist",
|
|
5
|
-
"noEmit": false,
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"allowImportingTsExtensions": false,
|
|
8
|
-
"rootDir": "."
|
|
9
|
-
},
|
|
10
|
-
"include": [
|
|
11
|
-
"services/unified-api/**/*.ts",
|
|
12
|
-
"services/shared/**/*.ts",
|
|
13
|
-
"services/**/*.d.ts",
|
|
14
|
-
"services/shared/**/*.d.ts",
|
|
15
|
-
"modules/container-registry/**/*.ts",
|
|
16
|
-
"modules/camo-backend/**/*.ts",
|
|
17
|
-
"modules/workflow/**/*.ts",
|
|
18
|
-
"modules/xiaohongshu/app/**/*.ts",
|
|
19
|
-
"apps/webauto/server.ts",
|
|
20
|
-
"services/controller/**/*.ts"
|
|
21
|
-
],
|
|
22
|
-
"exclude": [
|
|
23
|
-
"node_modules",
|
|
24
|
-
"dist"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
File without changes
|
|
File without changes
|