@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,262 +0,0 @@
|
|
|
1
|
-
# Apply Patch 工具快速验证序列
|
|
2
|
-
|
|
3
|
-
## 测试方法
|
|
4
|
-
通过实际应用补丁来验证工具功能,每个测试按顺序执行
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## TEST-01: 创建新文件并添加内容
|
|
9
|
-
|
|
10
|
-
### 步骤1: 创建空文件
|
|
11
|
-
```bash
|
|
12
|
-
touch tests/patch_verification/temp_test_files/test01.txt
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### 步骤2: 应用补丁添加内容
|
|
16
|
-
补丁内容:
|
|
17
|
-
```
|
|
18
|
-
*** Begin Patch
|
|
19
|
-
*** Update File: tests/patch_verification/temp_test_files/test01.txt
|
|
20
|
-
@@ -0,0 +1,3 @@
|
|
21
|
-
+Line 1
|
|
22
|
-
+Line 2
|
|
23
|
-
+Line 3
|
|
24
|
-
*** End Patch
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 步骤3: 验证
|
|
28
|
-
```bash
|
|
29
|
-
cat tests/patch_verification/temp_test_files/test01.txt
|
|
30
|
-
# 期望输出:
|
|
31
|
-
# Line 1
|
|
32
|
-
# Line 2
|
|
33
|
-
# Line 3
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## TEST-02: 简单文本替换
|
|
39
|
-
|
|
40
|
-
### 步骤1: 准备测试文件
|
|
41
|
-
```bash
|
|
42
|
-
mkdir -p tests/patch_verification/temp_test_files
|
|
43
|
-
echo "hello world" > tests/patch_verification/temp_test_files/test02.txt
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### 步骤2: 应用补丁
|
|
47
|
-
补丁内容:
|
|
48
|
-
```
|
|
49
|
-
*** Begin Patch
|
|
50
|
-
*** Update File: tests/patch_verification/temp_test_files/test02.txt
|
|
51
|
-
hello world
|
|
52
|
-
---
|
|
53
|
-
goodbye world
|
|
54
|
-
*** End Patch
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 步骤3: 验证
|
|
58
|
-
```bash
|
|
59
|
-
cat tests/patch_verification/temp_test_files/test02.txt
|
|
60
|
-
# 期望输出: goodbye world
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## TEST-03: 多行替换
|
|
66
|
-
|
|
67
|
-
### 步骤1: 准备测试文件
|
|
68
|
-
```bash
|
|
69
|
-
cat > tests/patch_verification/temp_test_files/test03.txt << 'TESTFILE'
|
|
70
|
-
line 1
|
|
71
|
-
line 2
|
|
72
|
-
line 3
|
|
73
|
-
line 4
|
|
74
|
-
line 5
|
|
75
|
-
TESTFILE
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 步骤2: 应用补丁(替换中间3行)
|
|
79
|
-
补丁内容:
|
|
80
|
-
```
|
|
81
|
-
*** Begin Patch
|
|
82
|
-
*** Update File: tests/patch_verification/temp_test_files/test03.txt
|
|
83
|
-
line 2
|
|
84
|
-
line 3
|
|
85
|
-
line 4
|
|
86
|
-
---
|
|
87
|
-
new line 2
|
|
88
|
-
new line 3
|
|
89
|
-
new line 4
|
|
90
|
-
*** End Patch
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### 步骤3: 验证
|
|
94
|
-
```bash
|
|
95
|
-
cat tests/patch_verification/temp_test_files/test03.txt
|
|
96
|
-
# 期望输出:
|
|
97
|
-
# line 1
|
|
98
|
-
# new line 2
|
|
99
|
-
# new line 3
|
|
100
|
-
# new line 4
|
|
101
|
-
# line 5
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## TEST-04: 代码函数替换
|
|
107
|
-
|
|
108
|
-
### 步骤1: 准备测试文件
|
|
109
|
-
```bash
|
|
110
|
-
cat > tests/patch_verification/temp_test_files/test04.ts << 'TESTFILE'
|
|
111
|
-
function greet(name: string) {
|
|
112
|
-
console.log("Hello, " + name);
|
|
113
|
-
return name;
|
|
114
|
-
}
|
|
115
|
-
TESTFILE
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### 步骤2: 应用补丁
|
|
119
|
-
补丁内容:
|
|
120
|
-
```
|
|
121
|
-
*** Begin Patch
|
|
122
|
-
*** Update File: tests/patch_verification/temp_test_files/test04.ts
|
|
123
|
-
function greet(name: string) {
|
|
124
|
-
console.log("Hello, " + name);
|
|
125
|
-
return name;
|
|
126
|
-
}
|
|
127
|
-
---
|
|
128
|
-
function greet(name: string) {
|
|
129
|
-
const message = `Hello, ${name}`;
|
|
130
|
-
console.log(message);
|
|
131
|
-
return message;
|
|
132
|
-
}
|
|
133
|
-
*** End Patch
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### 步骤3: 验证
|
|
137
|
-
```bash
|
|
138
|
-
cat tests/patch_verification/temp_test_files/test04.ts
|
|
139
|
-
# 期望看到新版本的函数实现
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## TEST-05: 添加import语句
|
|
145
|
-
|
|
146
|
-
### 步骤1: 准备测试文件
|
|
147
|
-
```bash
|
|
148
|
-
cat > tests/patch_verification/temp_test_files/test05.ts << 'TESTFILE'
|
|
149
|
-
import { foo } from './foo';
|
|
150
|
-
|
|
151
|
-
const x = foo();
|
|
152
|
-
TESTFILE
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### 步骤2: 应用补丁(在第一个import后添加新import)
|
|
156
|
-
补丁内容:
|
|
157
|
-
```
|
|
158
|
-
*** Begin Patch
|
|
159
|
-
*** Update File: tests/patch_verification/temp_test_files/test05.ts
|
|
160
|
-
import { foo } from './foo';
|
|
161
|
-
---
|
|
162
|
-
import { foo } from './foo';
|
|
163
|
-
import { bar } from './bar';
|
|
164
|
-
*** End Patch
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### 步骤3: 验证
|
|
168
|
-
```bash
|
|
169
|
-
cat tests/patch_verification/temp_test_files/test05.ts
|
|
170
|
-
# 期望输出:
|
|
171
|
-
# import { foo } from './foo';
|
|
172
|
-
# import { bar } from './bar';
|
|
173
|
-
#
|
|
174
|
-
# const x = foo();
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## TEST-06: 特殊字符处理
|
|
180
|
-
|
|
181
|
-
### 步骤1: 准备测试文件
|
|
182
|
-
```bash
|
|
183
|
-
cat > tests/patch_verification/temp_test_files/test06.txt << 'TESTFILE'
|
|
184
|
-
path: /usr/bin
|
|
185
|
-
quote: "hello"
|
|
186
|
-
backslash: \
|
|
187
|
-
TESTFILE
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### 步骤2: 应用补丁
|
|
191
|
-
补丁内容:
|
|
192
|
-
```
|
|
193
|
-
*** Begin Patch
|
|
194
|
-
*** Update File: tests/patch_verification/temp_test_files/test06.txt
|
|
195
|
-
path: /usr/bin
|
|
196
|
-
---
|
|
197
|
-
path: /usr/local/bin
|
|
198
|
-
*** End Patch
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### 步骤3: 验证
|
|
202
|
-
```bash
|
|
203
|
-
cat tests/patch_verification/temp_test_files/test06.txt
|
|
204
|
-
# 期望看到 path 被正确更新,其他特殊字符保持不变
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
## TEST-07: 错误处理 - 文件不存在
|
|
210
|
-
|
|
211
|
-
### 步骤: 尝试对不存在的文件应用补丁
|
|
212
|
-
补丁内容:
|
|
213
|
-
```
|
|
214
|
-
*** Begin Patch
|
|
215
|
-
*** Update File: tests/patch_verification/temp_test_files/nonexistent.txt
|
|
216
|
-
something
|
|
217
|
-
---
|
|
218
|
-
something else
|
|
219
|
-
*** End Patch
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### 期望结果
|
|
223
|
-
应该返回清晰的错误信息,提示文件不存在
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
## TEST-08: 错误处理 - 内容不匹配
|
|
228
|
-
|
|
229
|
-
### 步骤1: 准备测试文件
|
|
230
|
-
```bash
|
|
231
|
-
echo "actual content" > tests/patch_verification/temp_test_files/test08.txt
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### 步骤2: 尝试替换不存在的内容
|
|
235
|
-
补丁内容:
|
|
236
|
-
```
|
|
237
|
-
*** Begin Patch
|
|
238
|
-
*** Update File: tests/patch_verification/temp_test_files/test08.txt
|
|
239
|
-
nonexistent content
|
|
240
|
-
---
|
|
241
|
-
new content
|
|
242
|
-
*** End Patch
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### 期望结果
|
|
246
|
-
应该返回清晰的错误信息,提示找不到待替换的内容
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## 执行建议
|
|
251
|
-
|
|
252
|
-
1. 按顺序执行 TEST-01 到 TEST-08
|
|
253
|
-
2. 每个测试独立验证
|
|
254
|
-
3. 如果某个测试失败,记录失败原因
|
|
255
|
-
4. 优先修复基础测试(TEST-01 到 TEST-05)
|
|
256
|
-
5. 完成所有测试后清理临时文件
|
|
257
|
-
|
|
258
|
-
## 清理命令
|
|
259
|
-
```bash
|
|
260
|
-
rm -rf tests/patch_verification/temp_test_files
|
|
261
|
-
```
|
|
262
|
-
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
# Apply Patch 工具完整测试方案
|
|
2
|
-
|
|
3
|
-
## 概述
|
|
4
|
-
|
|
5
|
-
本测试方案旨在全面验证 `apply_patch` 工具的正确性和鲁棒性,覆盖从基础操作到复杂边界场景的所有情况。
|
|
6
|
-
|
|
7
|
-
## 文档结构
|
|
8
|
-
|
|
9
|
-
- `TEST_PLAN.md` - 详细的测试计划文档
|
|
10
|
-
- `test_cases_registry.mjs` - 所有测试用例的结构化定义
|
|
11
|
-
- `test_runner.mjs` - 自动化测试执行器
|
|
12
|
-
- `test_files/` - 测试输入文件
|
|
13
|
-
- `expected/` - 预期输出文件
|
|
14
|
-
- `actual/` - 实际执行结果
|
|
15
|
-
- `reports/` - 测试报告
|
|
16
|
-
|
|
17
|
-
## 快速开始
|
|
18
|
-
|
|
19
|
-
### 1. 查看测试计划
|
|
20
|
-
```bash
|
|
21
|
-
cat tests/patch_verification/TEST_PLAN.md
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### 2. 查看所有测试用例
|
|
25
|
-
```bash
|
|
26
|
-
node tests/patch_verification/test_cases_registry.mjs list
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### 3. 执行特定分类的测试
|
|
30
|
-
```bash
|
|
31
|
-
# 执行基础功能测试(阶段1)
|
|
32
|
-
node tests/patch_verification/test_runner.mjs --category=basic
|
|
33
|
-
|
|
34
|
-
# 执行代码编辑测试(阶段2)
|
|
35
|
-
node tests/patch_verification/test_runner.mjs --category=code_editing
|
|
36
|
-
|
|
37
|
-
# 执行边界条件测试(阶段3)
|
|
38
|
-
node tests/patch_verification/test_runner.mjs --category=edge_cases
|
|
39
|
-
|
|
40
|
-
# 执行复杂场景测试(阶段4)
|
|
41
|
-
node tests/patch_verification/test_runner.mjs --category=complex
|
|
42
|
-
|
|
43
|
-
# 执行错误处理测试(阶段5)
|
|
44
|
-
node tests/patch_verification/test_runner.mjs --category=error_handling
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 4. 执行所有测试
|
|
48
|
-
```bash
|
|
49
|
-
node tests/patch_verification/test_runner.mjs --all
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 5. 执行单个测试用例
|
|
53
|
-
```bash
|
|
54
|
-
node tests/patch_verification/test_runner.mjs --test=T1.1
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## 测试用例分类
|
|
58
|
-
|
|
59
|
-
### 阶段 1:基础功能测试 (6个用例)
|
|
60
|
-
- T1.1 - 简单文本替换
|
|
61
|
-
- T1.2 - 多行文本替换
|
|
62
|
-
- T1.3 - 单行插入(行首)
|
|
63
|
-
- T1.4 - 单行插入(行尾)
|
|
64
|
-
- T1.5 - 单行插入(中间)
|
|
65
|
-
- T1.6 - 单行删除
|
|
66
|
-
|
|
67
|
-
### 阶段 2:代码编辑测试 (5个用例)
|
|
68
|
-
- T2.1 - 函数内容替换
|
|
69
|
-
- T2.2 - 添加新函数
|
|
70
|
-
- T2.3 - 修改配置文件
|
|
71
|
-
- T2.4 - 导入语句添加
|
|
72
|
-
- T2.5 - 注释修改
|
|
73
|
-
|
|
74
|
-
### 阶段 3:边界条件测试 (6个用例)
|
|
75
|
-
- T3.1 - 空文件操作
|
|
76
|
-
- T3.2 - 大文件操作
|
|
77
|
-
- T3.3 - 特殊字符处理
|
|
78
|
-
- T3.4 - 重复文本处理
|
|
79
|
-
- T3.5 - 缩进处理
|
|
80
|
-
- T3.6 - 换行符处理
|
|
81
|
-
|
|
82
|
-
### 阶段 4:复杂场景测试 (5个用例)
|
|
83
|
-
- T4.1 - 多处修改
|
|
84
|
-
- T4.2 - 跨行块操作
|
|
85
|
-
- T4.3 - 代码重构场景
|
|
86
|
-
- T4.4 - 文档字符串修改
|
|
87
|
-
- T4.5 - 条件编译指令
|
|
88
|
-
|
|
89
|
-
### 阶段 5:错误处理测试 (5个用例)
|
|
90
|
-
- T5.1 - 文件不存在
|
|
91
|
-
- T5.2 - 内容不匹配
|
|
92
|
-
- T5.3 - 权限错误
|
|
93
|
-
- T5.4 - 语法破坏
|
|
94
|
-
- T5.5 - 并发修改
|
|
95
|
-
|
|
96
|
-
**总计:27 个测试用例**
|
|
97
|
-
|
|
98
|
-
## 执行顺序建议
|
|
99
|
-
|
|
100
|
-
1. **第一轮**:执行阶段1(基础功能测试)
|
|
101
|
-
- 目标:100% 通过
|
|
102
|
-
- 如有失败,优先修复
|
|
103
|
-
|
|
104
|
-
2. **第二轮**:执行阶段2(代码编辑测试)
|
|
105
|
-
- 目标:100% 通过
|
|
106
|
-
|
|
107
|
-
3. **第三轮**:执行阶段3(边界条件测试)
|
|
108
|
-
- 目标:≥90% 通过
|
|
109
|
-
- 记录失败用例及原因
|
|
110
|
-
|
|
111
|
-
4. **第四轮**:执行阶段4(复杂场景测试)
|
|
112
|
-
- 目标:≥80% 通过
|
|
113
|
-
- 记录性能数据
|
|
114
|
-
|
|
115
|
-
5. **第五轮**:执行阶段5(错误处理测试)
|
|
116
|
-
- 目标:正确识别和报告所有错误
|
|
117
|
-
|
|
118
|
-
6. **最终轮**:完整回归测试
|
|
119
|
-
- 执行所有测试用例
|
|
120
|
-
- 生成最终报告
|
|
121
|
-
|
|
122
|
-
## 成功标准
|
|
123
|
-
|
|
124
|
-
- ✅ 阶段1 + 阶段2:100% 通过
|
|
125
|
-
- ✅ 阶段3:≥90% 通过
|
|
126
|
-
- ✅ 阶段4:≥80% 通过
|
|
127
|
-
- ✅ 阶段5:所有错误都被正确识别
|
|
128
|
-
|
|
129
|
-
## 报告格式
|
|
130
|
-
|
|
131
|
-
测试完成后会生成:
|
|
132
|
-
- `reports/summary.md` - 整体摘要
|
|
133
|
-
- `reports/detailed_YYYYMMDD_HHMMSS.md` - 详细报告
|
|
134
|
-
- `reports/failures_YYYYMMDD_HHMMSS.md` - 失败用例详情
|
|
135
|
-
- `reports/performance.json` - 性能数据
|
|
136
|
-
|
|
137
|
-
## 下一步
|
|
138
|
-
|
|
139
|
-
1. 实现 `test_cases_registry.mjs`
|
|
140
|
-
2. 实现 `test_runner.mjs`
|
|
141
|
-
3. 准备测试数据文件
|
|
142
|
-
4. 按阶段执行测试
|
|
143
|
-
5. 分析结果并修复问题
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Codex apply_patch 工具验证测试
|
|
2
|
-
|
|
3
|
-
## 目标
|
|
4
|
-
验证 Codex 的 apply_patch 函数能够正确处理各种代码修改场景
|
|
5
|
-
|
|
6
|
-
## 测试方法
|
|
7
|
-
我会按顺序执行以下测试,每个测试会:
|
|
8
|
-
1. 准备测试文件
|
|
9
|
-
2. 调用 apply_patch
|
|
10
|
-
3. 验证结果
|
|
11
|
-
4. 报告状态
|
|
12
|
-
|
|
13
|
-
## 测试序列
|
|
14
|
-
|
|
15
|
-
### ✓ 准备工作
|
|
16
|
-
- 创建测试目录: tests/patch_verification/temp_test_files/
|
|
17
|
-
|
|
18
|
-
### TEST-01: 创建新文件
|
|
19
|
-
- 创建空白文件并添加3行内容
|
|
20
|
-
- 验证点: 文件被创建且内容正确
|
|
21
|
-
|
|
22
|
-
### TEST-02: 简单单行替换
|
|
23
|
-
- 原始: "hello world"
|
|
24
|
-
- 替换为: "goodbye world"
|
|
25
|
-
- 验证点: 内容被正确替换
|
|
26
|
-
|
|
27
|
-
### TEST-03: 多行替换
|
|
28
|
-
- 替换连续3行内容
|
|
29
|
-
- 验证点: 多行替换准确,前后行不受影响
|
|
30
|
-
|
|
31
|
-
### TEST-04: 函数内容替换
|
|
32
|
-
- 替换整个 TypeScript 函数实现
|
|
33
|
-
- 验证点: 函数体被完整替换,语法正确
|
|
34
|
-
|
|
35
|
-
### TEST-05: 添加 import 语句
|
|
36
|
-
- 在现有 import 后添加新的 import
|
|
37
|
-
- 验证点: 新 import 插入位置正确
|
|
38
|
-
|
|
39
|
-
### TEST-06: 特殊字符处理
|
|
40
|
-
- 包含路径、引号、反斜杠的内容
|
|
41
|
-
- 验证点: 特殊字符不被破坏
|
|
42
|
-
|
|
43
|
-
### TEST-07: 缩进保持
|
|
44
|
-
- 修改带缩进的代码
|
|
45
|
-
- 验证点: 缩进格式保持一致
|
|
46
|
-
|
|
47
|
-
### TEST-08: 错误处理 - 文件不存在
|
|
48
|
-
- 尝试修改不存在的文件
|
|
49
|
-
- 验证点: 返回清晰错误信息
|
|
50
|
-
|
|
51
|
-
### TEST-09: 错误处理 - 内容不匹配
|
|
52
|
-
- 尝试替换不存在的内容
|
|
53
|
-
- 验证点: 返回清晰错误信息
|
|
54
|
-
|
|
55
|
-
### ✓ 清理工作
|
|
56
|
-
- 删除测试目录
|
|
57
|
-
|
|
58
|
-
## 执行方式
|
|
59
|
-
我将逐个执行这些测试,实时报告结果。
|
|
60
|
-
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# Codex apply_patch 工具测试执行记录
|
|
2
|
-
|
|
3
|
-
## 测试开始时间
|
|
4
|
-
2025-01-18 17:30
|
|
5
|
-
|
|
6
|
-
## 格式验证成功
|
|
7
|
-
|
|
8
|
-
### ✓ TEST-01: 创建新文件
|
|
9
|
-
**格式**:
|
|
10
|
-
```
|
|
11
|
-
*** Begin Patch
|
|
12
|
-
*** Add File: path/to/file.txt
|
|
13
|
-
+Line 1
|
|
14
|
-
+Line 2
|
|
15
|
-
*** End Patch
|
|
16
|
-
```
|
|
17
|
-
**结果**: ✅ 通过
|
|
18
|
-
**文件**: test_add_02.txt
|
|
19
|
-
**验证**: 文件创建成功,内容正确
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## TEST-02: 单行替换 ✅
|
|
24
|
-
**格式**: 使用 `-` 和 `+` 前缀
|
|
25
|
-
**结果**: 成功替换
|
|
26
|
-
|
|
27
|
-
## TEST-03: 多行替换 ✅
|
|
28
|
-
**操作**: 替换连续3行
|
|
29
|
-
**结果**: 成功
|
|
30
|
-
|
|
31
|
-
## TEST-04: 函数替换 ✅
|
|
32
|
-
**操作**: 替换整个 TypeScript 函数
|
|
33
|
-
**结果**: 成功
|
|
34
|
-
|
|
35
|
-
## TEST-05: 添加 import ✅
|
|
36
|
-
**操作**: 在现有 import 后添加新 import
|
|
37
|
-
**结果**: 成功
|
|
38
|
-
|
|
39
|
-
## TEST-06: 特殊字符处理 ✅
|
|
40
|
-
**操作**: 处理路径、引号、反斜杠、正则表达式
|
|
41
|
-
**结果**: 特殊字符保持不变
|
|
42
|
-
|
|
43
|
-
## TEST-07: 缩进保持 ✅
|
|
44
|
-
**操作**: 修改带缩进的代码
|
|
45
|
-
**结果**: 缩进格式保持一致
|
|
46
|
-
|
|
47
|
-
## TEST-08: 错误处理 - 文件不存在 ✅
|
|
48
|
-
**操作**: 尝试修改不存在的文件
|
|
49
|
-
**结果**: 正确返回错误信息
|
|
50
|
-
|
|
51
|
-
## TEST-09: 错误处理 - 内容不匹配 ✅
|
|
52
|
-
**操作**: 尝试替换不存在的内容
|
|
53
|
-
**结果**: 正确返回错误信息
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## 测试总结
|
|
58
|
-
|
|
59
|
-
**测试通过**: 9/9 (100%)
|
|
60
|
-
|
|
61
|
-
### Phase 1: 基础操作
|
|
62
|
-
- ✅ 创建新文件
|
|
63
|
-
- ✅ 单行替换
|
|
64
|
-
- ✅ 多行替换
|
|
65
|
-
|
|
66
|
-
### Phase 2: 代码场景
|
|
67
|
-
- ✅ 函数替换
|
|
68
|
-
- ✅ 添加 import
|
|
69
|
-
|
|
70
|
-
### Phase 3: 边界场景
|
|
71
|
-
- ✅ 特殊字符
|
|
72
|
-
- ✅ 缩进保持
|
|
73
|
-
|
|
74
|
-
### Phase 4: 错误处理
|
|
75
|
-
- ✅ 文件不存在
|
|
76
|
-
- ✅ 内容不匹配
|
|
77
|
-
|
|
78
|
-
## 结论
|
|
79
|
-
|
|
80
|
-
✅ **Codex apply_patch 工具运行正常,可以安全用于代码修改**
|
|
81
|
-
|
|
82
|
-
### 核心格式总结
|
|
83
|
-
|
|
84
|
-
1. **创建新文件**:
|
|
85
|
-
```
|
|
86
|
-
*** Add File: path
|
|
87
|
-
然后用 + 前缀每一行
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
2. **修改现有文件**:
|
|
91
|
-
```
|
|
92
|
-
*** Update File: path
|
|
93
|
-
用 - 表示要删除的行
|
|
94
|
-
用 + 表示要添加的行
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
3. **错误处理**: 清晰准确的错误信息
|
|
98
|
-
|
|
99
|
-
### 测试环境清理
|