ok-script 3.0.6__tar.gz → 3.0.8__tar.gz
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.
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/develop/SKILL.md +1 -1
- {ok_script-3.0.6/ok_script.egg-info → ok_script-3.0.8}/PKG-INFO +1 -3
- {ok_script-3.0.6 → ok_script-3.0.8}/README.md +0 -2
- {ok_script-3.0.6 → ok_script-3.0.8}/docs/mcp.md +21 -1
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/mcp_runner.py +138 -59
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/mcp_server.py +14 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/task/TaskExecutor.py +4 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/__init__.py +2 -1
- ok_script-3.0.8/ok/ui/qt/kit/table.py +312 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/tasks_page.py +3 -19
- {ok_script-3.0.6 → ok_script-3.0.8/ok_script.egg-info}/PKG-INFO +1 -3
- {ok_script-3.0.6 → ok_script-3.0.8}/ok_script.egg-info/SOURCES.txt +1 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_executor_jobs.py +24 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_kit.py +86 -3
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_mcp_runner.py +67 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_mcp_server.py +10 -1
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_tasks_page.py +2 -1
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/develop/agents/openai.yaml +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/develop/references/windows-input.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/generate-templates/SKILL.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/reload-tasks/SKILL.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/reload-tasks/agents/openai.yaml +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/setup-env/SKILL.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/setup-env/agents/openai.yaml +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/setup-env/assets/ok-script-develop/SKILL.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/setup-project/SKILL.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/setup-project/agents/openai.yaml +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/use_venv/SKILL.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/write-test/SKILL.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/.agents/skills/write-test/agents/openai.yaml +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/LICENSE.txt +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/MANIFEST.in +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/diagnostics/qq_trace.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/docs/agent-setup.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/docs/feature-crops.md +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/examples/mcp_observe.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/__main__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/alas/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/alas/emulator_base.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/alas/emulator_windows.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/alas/platform_windows.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/alas/utils.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/assets/default-icon.png +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/deep.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/minitouch.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/nemu_ipc.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/nemu_utils.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/pool.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/timer.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/adb/util.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/windows/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/windows/d3d11.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/capture/windows/dump.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/cli.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/capture_labels.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/code_runner.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/config_schema.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/downloads.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/events.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/icons.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/notifications.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/plugin_staging.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/plugins.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/screenshot.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/script_editing.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/script_packager.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/script_templates.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/skills.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/start_controller.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/task_manager.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/template_store.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/translation.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/core/ui_config.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/DeviceManager.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/browser_audio.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/adb.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/base.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/bitblt.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/bitblt_utils.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/browser.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/desktop_duplication.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/hwnd_window.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/image.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/nemu_ipc.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/types.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/update.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/windows_graphics.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/capture_methods/windows_graphics_hdr.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/adb.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/base.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/browser.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/do_nothing.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/foreground_post_message.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/genshin.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/keys.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/post_message.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/pydirect.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/pynput.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/interaction_methods/swipe.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/device/intercation.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/feature/Box.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/feature/Feature.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/feature/FeatureSet.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/feature/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/gui/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/gui/util/pyappify_startup.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/manager.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/messenger_images.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/pipeline.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/ppocr.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/providers.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/system.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/notification/windows_messenger.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ocr/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ocr/download_paddle_model.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/UI/ViewManagement/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/UI/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/Windows/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/delegate.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/export.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/idldsl.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/inspectable.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/roapi.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/types.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/rotypes/winstring.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/task/DiagnosisTask.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/task/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/task/exceptions.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/task/task.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/test/OKTestRunner.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/test/RunTests.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/test/TaskTestCase.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/test/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/third_party/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/third_party/paperclip.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/overlay/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/overlay/win32_gdi.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/Communicate.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/MainWindow.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/MessageWindow.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/StartController.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/about/AboutTab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/about/UpdateCard.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/about/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/common/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/common/config.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/debug/OverlayWidget.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/debug/Screenshot.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/debug/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/debug/diagnosis_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/events.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/GettextTranslator.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/en_US.qm +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/en_US.ts +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/es_ES.qm +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/es_ES.ts +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/ja_JP.qm +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/ja_JP.ts +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/ko_KR.qm +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/ko_KR.ts +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/path.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/update.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/zh_CN.qm +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/zh_CN.ts +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/zh_TW.qm +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/i18n/zh_TW.ts +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/buttons.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/cards.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/dialogs.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/feedback.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/gallery.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/icons.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/inputs.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/labels.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/layout.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/mica.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/motion.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/navigation.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/options.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/popover.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/qss.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/switch.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/tabs.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/theme.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/kit/window.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/overlay/OverlayWindow.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/overlay/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/plugins/PluginTab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/plugins/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/plugins/imported_tabs.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/qt.qrc +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/resources.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/settings/GlobalConfigTab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/settings/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/settings/config_section.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/settings/settings_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/shell/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/shell/connection.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/shell/diagnostics.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/shell/lazy_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/shell/log_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/shell/nav_icons.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/shell/run_bar.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/start/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/EditTaskTab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/MarkUpWindow.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/ModifyListDialog.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/PythonHighlighter.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/RecordScript.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/ScheduleTaskTab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/ScriptPackager.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/TaskManger.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/TaskOpButton.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/TemplateFactory.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/TemplateTab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/config_editors.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/config_form.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/mouse_buttons.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/tasks/schedule_index_sync.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/Alert.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/InitWorker.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/app.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/download.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/pip_util.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/pyappify_startup.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/touch_scroll.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/util/windows_thumbnail.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/Card.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/CustomTab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/FlowLayout.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/ImageWidget.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/ImportWarningDialog.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/ListTableWidgetItem.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/NumericTableWidgetItem.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/SortingTableWidgetItem.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/StartLoadingDialog.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/Tab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/TabWidget.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/UpdateConfigWidgetItem.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/YesNonWidgetItem.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/ui/qt/widget/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/update/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/update/copy_ok_folder.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/update/inline_ok_requirements.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/Analytics.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/GlobalConfig.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/__init__.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/blur.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/clazz.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/collection.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/color.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/config.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/explorer.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/file.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/gpu_driver_settings.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/handler.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/i18n.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/logger.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/partial_sync_repo.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/print_hwnd.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/process.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/shortcut.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/version.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/window.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok/util/windows_schedule.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok_script.egg-info/entry_points.txt +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok_script.egg-info/not-zip-safe +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok_script.egg-info/requires.txt +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/ok_script.egg-info/top_level.txt +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/pyproject.toml +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/setup.cfg +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/setup.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_app.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_base_interaction.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_blur.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_box.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_browser_audio.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_browser_audio_playwright.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_browser_geometry.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_browser_launch_options.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_browser_pointer_lock_playwright.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_capture_update.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_cli.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_core_events.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_core_ui_services.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_device_manager.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_diagnosis_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_explorer.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_global_config.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_gpu_driver_settings.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_handler.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_headless_imports.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_inline_ok_requirements.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_lazy_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_log_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_logger.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_main_window_notifications.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_main_window_startup_tab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_main_window_system_theme.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_markup_window.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_mcp_cleanup.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_mcp_setting.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_missing_frame.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_mouse_buttons.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_navigation_state.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_nemu_ipc_capture.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_notifications.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_ok_mutex.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_overlay_custom_draw.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_overlay_lifecycle.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_package_metadata.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_plugin_staging.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_plugin_tabs.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_plugins.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_process.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_process_mutex.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_pyappify_startup_update.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_qt_events.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_qt_page_layout.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_runtime_startup.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_schedule_startup.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_schedule_task_index_sync.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_screenshot_naming.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_screenshot_rendering.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_settings_page.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_shell.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_shortcut.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_skills.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_start_controller.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_task_executor_next_frame.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_task_executor_queue.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_task_reloading.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_template_compression.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_template_generation.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_template_tab.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_touch_scroll.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_translation_fallback.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_ui_config.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_version.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_windows_graphics_capture.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_windows_graphics_hdr.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_windows_schedule_target_parse.py +0 -0
- {ok_script-3.0.6 → ok_script-3.0.8}/tests/test_windows_schedule_xml.py +0 -0
|
@@ -29,7 +29,7 @@ Use the project's venv and existing development launcher. Without a custom launc
|
|
|
29
29
|
|
|
30
30
|
Read the configured artifact directory's `connection.json` (normally `logs/mcp/connection.json`) for URL, bearer token, and PID. Check that PID and listener are live; the file can outlast its server. Connect with the supplied URL and `Authorization: Bearer <token>` header. Keep tokens out of normal output. Use a native MCP connection when available, or the installed official SDK and a local client script when it is not.
|
|
31
31
|
|
|
32
|
-
The tools are `list_tasks()`, `reload_tasks(task_ids=None)`, `run_task(file_path)`, `get_run_status(run_id)`, `stop_task(run_id)`, and `screenshot()`. Reloads return run IDs tracked by the same status and stop tools. Pass an absolute path to `run_task`; keep task logic in files. Read logs and edit files locally rather than adding
|
|
32
|
+
The tools are `list_tasks()`, `reload_tasks(task_ids=None)`, `run_task(file_path)`, `run_code(source)`, `get_run_status(run_id)`, `stop_task(run_id)`, and `screenshot()`. Reloads and code runs return run IDs tracked by the same status and stop tools. Pass an absolute path to `run_task`; keep task logic in files. `run_code` runs a probing snippet with `self` bound to a fresh task (for example `self.click(123, 456)` or `self.send_key('esc')`); it skips reset and verification, a trailing expression's repr becomes the result, and `get_task(task_id)` returns a registered task. Use it only to probe input, coordinates, or detection, never as evidence that a task works. Read logs and edit files locally rather than adding file-editing or log-reading tools.
|
|
33
33
|
|
|
34
34
|
## Define recovery and success before iterating
|
|
35
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ok-script
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.8
|
|
4
4
|
Summary: Vibe Coding Automation Framework
|
|
5
5
|
Author-email: ok-oldking <firedcto@gmail.com>
|
|
6
6
|
License: ok-script License
|
|
@@ -246,9 +246,7 @@ python -m venv .venv
|
|
|
246
246
|
- [卡厄思梦境](https://github.com/baoxin1100/ok-kes)
|
|
247
247
|
- [蓝色星原:旅谣](https://github.com/longer-sausage/OK-AzurPromilia)
|
|
248
248
|
- [阴阳师](https://github.com/YunLiuZ/ok-Onmyoji)
|
|
249
|
-
- [原神](https://github.com/ok-oldking/ok-genshin-impact)(停止维护,后台过剧情仍可用)
|
|
250
249
|
- [白荆回廊](https://github.com/ok-oldking/ok-baijing)(停止维护)
|
|
251
|
-
- [崩坏:星穹铁道](https://github.com/Shasnow/ok-starrailassistant)(停止维护)
|
|
252
250
|
|
|
253
251
|
## 开发 ok-script
|
|
254
252
|
|
|
@@ -122,9 +122,7 @@ python -m venv .venv
|
|
|
122
122
|
- [卡厄思梦境](https://github.com/baoxin1100/ok-kes)
|
|
123
123
|
- [蓝色星原:旅谣](https://github.com/longer-sausage/OK-AzurPromilia)
|
|
124
124
|
- [阴阳师](https://github.com/YunLiuZ/ok-Onmyoji)
|
|
125
|
-
- [原神](https://github.com/ok-oldking/ok-genshin-impact)(停止维护,后台过剧情仍可用)
|
|
126
125
|
- [白荆回廊](https://github.com/ok-oldking/ok-baijing)(停止维护)
|
|
127
|
-
- [崩坏:星穹铁道](https://github.com/Shasnow/ok-starrailassistant)(停止维护)
|
|
128
126
|
|
|
129
127
|
## 开发 ok-script
|
|
130
128
|
|
|
@@ -145,6 +145,7 @@ Clients supporting MCP resources can also discover these skills through
|
|
|
145
145
|
| `list_tasks` | None | Registered task IDs, names, absolute source paths, types and plugin ownership. |
|
|
146
146
|
| `reload_tasks` | Optional `task_ids` list | Immediately returns a run ID for reloading selected registered tasks, or all tasks/plugins when omitted. |
|
|
147
147
|
| `run_task` | `file_path` | Immediately returns a run ID, source hash and absolute artifact paths. |
|
|
148
|
+
| `run_code` | `source` | Runs a probing snippet with `self` bound to a fresh task; returns a run ID like `run_task`. |
|
|
148
149
|
| `get_run_status` | `run_id` | Execution state, phase, brief error and artifact paths. |
|
|
149
150
|
| `stop_task` | `run_id` | Requests cancellation and returns the current state. |
|
|
150
151
|
| `exit_process` | Nonempty `reason` | Returns `state: exiting`, this runtime's `pid`, and the reason; schedules process shutdown with a forced-exit fallback. |
|
|
@@ -186,7 +187,26 @@ the actual GUI task card or a thin `run_task` harness that calls the registered
|
|
|
186
187
|
implementation with `self.get_task_by_class(ExistingTask)`. Keep behavior changes
|
|
187
188
|
in the existing task source instead of copying it into a temporary task.
|
|
188
189
|
|
|
189
|
-
|
|
190
|
+
## Probe with code snippets
|
|
191
|
+
|
|
192
|
+
`run_code(source)` runs a short Python snippet on the executor with `self`
|
|
193
|
+
bound to a fresh `BaseTask`, for one-off probes such as checking an input
|
|
194
|
+
method or a coordinate:
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
run_code("self.click(123, 456)\nself.sleep(0.5)\nself.send_key('esc')")
|
|
198
|
+
run_code("self.find_one('start_button')") # result: the Box repr, or None
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The snippet skips `reset_to_start()` and `verify_start_state()`, so it proves
|
|
202
|
+
nothing about a task's baseline or success. If the last statement is an
|
|
203
|
+
expression, its `repr` becomes the run's `result`. `get_task(task_id)` returns
|
|
204
|
+
a registered task by an ID from `list_tasks`. The source is saved as
|
|
205
|
+
`source.py` in the run's artifact directory, and tracebacks refer to its lines.
|
|
206
|
+
Put finished behavior into task files and validate it with `run_task` or the
|
|
207
|
+
GUI.
|
|
208
|
+
|
|
209
|
+
File runs, code runs and reloads share the same active-run slot and exclusive executor
|
|
190
210
|
ownership. Wait for the previous run and cleanup to finish before reloading.
|
|
191
211
|
Reload requests stop scheduled one-time tasks and suspend triggers until
|
|
192
212
|
completion; they do not restart stopped one-time tasks. `stop_task` can cancel a
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""File-based development runs and registered-task reloads, independent of MCP and Qt."""
|
|
2
2
|
|
|
3
|
+
import ast
|
|
3
4
|
import hashlib
|
|
4
5
|
import importlib.util
|
|
5
6
|
import inspect
|
|
@@ -25,6 +26,41 @@ TERMINAL_STATES = {'succeeded', 'failed', 'cancelled'}
|
|
|
25
26
|
logger = Logger.get_logger(__name__)
|
|
26
27
|
|
|
27
28
|
|
|
29
|
+
class _CodeResult:
|
|
30
|
+
"""Wrap a snippet's value so a falsy result is not read as ``run()`` failing."""
|
|
31
|
+
|
|
32
|
+
def __init__(self, value):
|
|
33
|
+
self.value = value
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class CodeTask(BaseTask):
|
|
37
|
+
"""Run a source snippet with ``self`` bound to this task instance.
|
|
38
|
+
|
|
39
|
+
Probing runs skip the baseline contract: reset and verification succeed
|
|
40
|
+
without acting. A trailing expression's value becomes the run result.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
source = ''
|
|
44
|
+
filename = '<mcp:run_code>'
|
|
45
|
+
get_task = None
|
|
46
|
+
|
|
47
|
+
def reset_to_start(self):
|
|
48
|
+
return True
|
|
49
|
+
|
|
50
|
+
def verify_start_state(self):
|
|
51
|
+
return True
|
|
52
|
+
|
|
53
|
+
def run(self):
|
|
54
|
+
tree = ast.parse(self.source, self.filename)
|
|
55
|
+
last = tree.body.pop() if tree.body and isinstance(tree.body[-1], ast.Expr) else None
|
|
56
|
+
namespace = {'__name__': '__mcp_code__', 'self': self, 'get_task': self.get_task}
|
|
57
|
+
exec(compile(tree, self.filename, 'exec'), namespace)
|
|
58
|
+
if last is None:
|
|
59
|
+
return None
|
|
60
|
+
expression = ast.Expression(last.value)
|
|
61
|
+
return _CodeResult(eval(compile(expression, self.filename, 'eval'), namespace))
|
|
62
|
+
|
|
63
|
+
|
|
28
64
|
class McpTaskRunner:
|
|
29
65
|
"""Run one development file or registered-task reload at a time.
|
|
30
66
|
|
|
@@ -133,6 +169,39 @@ class McpTaskRunner:
|
|
|
133
169
|
{'operation': 'run_task', 'file_path': str(path),
|
|
134
170
|
'source_sha256': hashlib.sha256(source).hexdigest(), 'phase': 'loading'})
|
|
135
171
|
|
|
172
|
+
def run_code(self, source: str):
|
|
173
|
+
"""Run a Python snippet with ``self`` bound to a fresh task; return its run ID.
|
|
174
|
+
|
|
175
|
+
Probing only: no reset or start-state verification. ``get_task(task_id)``
|
|
176
|
+
returns a registered task by an ID from list_tasks.
|
|
177
|
+
"""
|
|
178
|
+
if not isinstance(source, str) or not source.strip():
|
|
179
|
+
raise ValueError('source must be nonempty Python code')
|
|
180
|
+
encoded = source.encode('utf-8')
|
|
181
|
+
|
|
182
|
+
def execute(run_id):
|
|
183
|
+
directory = Path(self._runs[run_id]['record']['artifact_directory'])
|
|
184
|
+
saved = directory / 'source.py'
|
|
185
|
+
# Tracebacks read lines from this file, so they match the snippet.
|
|
186
|
+
saved.write_bytes(encoded)
|
|
187
|
+
cls = type('CodeTask', (CodeTask,), {
|
|
188
|
+
'source': source, 'filename': str(saved), 'get_task': staticmethod(self._get_task)})
|
|
189
|
+
return self._run_task(run_id, lambda: cls, directory)
|
|
190
|
+
|
|
191
|
+
return self._submit(execute, 'mcp:run_code', {
|
|
192
|
+
'operation': 'run_code', 'source_sha256': hashlib.sha256(encoded).hexdigest(),
|
|
193
|
+
'phase': 'loading'})
|
|
194
|
+
|
|
195
|
+
def _registered_tasks(self):
|
|
196
|
+
return {f'{type(task).__module__}.{type(task).__qualname__}': task
|
|
197
|
+
for task in self.executor.get_all_tasks()}
|
|
198
|
+
|
|
199
|
+
def _get_task(self, task_id):
|
|
200
|
+
task = self._registered_tasks().get(task_id)
|
|
201
|
+
if task is None:
|
|
202
|
+
raise KeyError(f'Unknown task ID {task_id!r}; use an ID from list_tasks')
|
|
203
|
+
return task
|
|
204
|
+
|
|
136
205
|
def _require_task_manager(self):
|
|
137
206
|
if self.task_manager is None:
|
|
138
207
|
raise RuntimeError('No registered task manager is available in this runtime')
|
|
@@ -173,8 +242,7 @@ class McpTaskRunner:
|
|
|
173
242
|
if task_ids is not None:
|
|
174
243
|
if not isinstance(task_ids, list) or any(not isinstance(item, str) for item in task_ids):
|
|
175
244
|
raise TypeError('task_ids must be a list of IDs from list_tasks')
|
|
176
|
-
registered =
|
|
177
|
-
for task in self.executor.get_all_tasks()}
|
|
245
|
+
registered = self._registered_tasks()
|
|
178
246
|
unknown = [task_id for task_id in task_ids if task_id not in registered]
|
|
179
247
|
if unknown:
|
|
180
248
|
raise ValueError(f'Unknown task IDs: {", ".join(unknown)}; call list_tasks first')
|
|
@@ -231,71 +299,82 @@ class McpTaskRunner:
|
|
|
231
299
|
module_name = f'_ok_mcp_task_{run_id}'
|
|
232
300
|
# Keep sibling imports available through run() and on_destroy(), too.
|
|
233
301
|
added_path = str(path.parent) not in sys.path
|
|
234
|
-
task = None
|
|
235
302
|
if added_path:
|
|
236
303
|
sys.path.insert(0, str(path.parent))
|
|
304
|
+
|
|
305
|
+
def load():
|
|
306
|
+
spec = importlib.util.spec_from_file_location(module_name, path)
|
|
307
|
+
module = importlib.util.module_from_spec(spec)
|
|
308
|
+
sys.modules[module_name] = module
|
|
309
|
+
# Compile the bytes directly: same-size edits within a second must
|
|
310
|
+
# not pick up stale .pyc files on the next attempt.
|
|
311
|
+
exec(compile(source, str(path), 'exec'), module.__dict__)
|
|
312
|
+
cls = getattr(module, 'Task', None)
|
|
313
|
+
if (not isinstance(cls, type) or cls.__module__ != module_name
|
|
314
|
+
or not issubclass(cls, BaseTask) or issubclass(cls, TriggerTask)):
|
|
315
|
+
raise TypeError('File must define class Task(BaseTask), not a TriggerTask')
|
|
316
|
+
for method in ('reset_to_start', 'verify_start_state', 'run'):
|
|
317
|
+
fn = getattr(cls, method, None)
|
|
318
|
+
if (not callable(fn) or inspect.iscoroutinefunction(fn)
|
|
319
|
+
or inspect.isgeneratorfunction(fn) or inspect.isasyncgenfunction(fn)):
|
|
320
|
+
raise TypeError(f'Task must implement synchronous {method}()')
|
|
321
|
+
if cls.run is BaseTask.run:
|
|
322
|
+
raise TypeError('Task must implement run()')
|
|
323
|
+
return cls
|
|
324
|
+
|
|
237
325
|
try:
|
|
238
|
-
|
|
239
|
-
with capture_output(output.write):
|
|
240
|
-
try:
|
|
241
|
-
self._phase(run_id, 'loading')
|
|
242
|
-
spec = importlib.util.spec_from_file_location(module_name, path)
|
|
243
|
-
module = importlib.util.module_from_spec(spec)
|
|
244
|
-
sys.modules[module_name] = module
|
|
245
|
-
# Compile the bytes directly: same-size edits within a second must
|
|
246
|
-
# not pick up stale .pyc files on the next attempt.
|
|
247
|
-
exec(compile(source, str(path), 'exec'), module.__dict__)
|
|
248
|
-
cls = getattr(module, 'Task', None)
|
|
249
|
-
if (not isinstance(cls, type) or cls.__module__ != module_name
|
|
250
|
-
or not issubclass(cls, BaseTask) or issubclass(cls, TriggerTask)):
|
|
251
|
-
raise TypeError('File must define class Task(BaseTask), not a TriggerTask')
|
|
252
|
-
for method in ('reset_to_start', 'verify_start_state', 'run'):
|
|
253
|
-
fn = getattr(cls, method, None)
|
|
254
|
-
if (not callable(fn) or inspect.iscoroutinefunction(fn)
|
|
255
|
-
or inspect.isgeneratorfunction(fn) or inspect.isasyncgenfunction(fn)):
|
|
256
|
-
raise TypeError(f'Task must implement synchronous {method}()')
|
|
257
|
-
if cls.run is BaseTask.run:
|
|
258
|
-
raise TypeError('Task must implement run()')
|
|
259
|
-
task = cls(executor=self.executor, app=self.app)
|
|
260
|
-
task.artifact_directory = directory
|
|
261
|
-
task.after_init(executor=self.executor, scene=self.executor.scene)
|
|
262
|
-
task.post_init()
|
|
263
|
-
task._enabled = True
|
|
264
|
-
task.running = True
|
|
265
|
-
task.start_time = time.time()
|
|
266
|
-
self.executor.current_task = task
|
|
267
|
-
self._phase(run_id, 'preparing')
|
|
268
|
-
if self.prepare is not None:
|
|
269
|
-
self.prepare()
|
|
270
|
-
task.ensure_capture()
|
|
271
|
-
self.executor._prepare_task_for_run(is_trigger_task=False)
|
|
272
|
-
self._phase(run_id, 'resetting')
|
|
273
|
-
if task.reset_to_start() is False:
|
|
274
|
-
raise RuntimeError('reset_to_start() returned False')
|
|
275
|
-
self._phase(run_id, 'verifying_start')
|
|
276
|
-
verified = task.verify_start_state()
|
|
277
|
-
if verified is not None and verified is not True:
|
|
278
|
-
raise RuntimeError('verify_start_state() must assert or return True')
|
|
279
|
-
self._phase(run_id, 'running')
|
|
280
|
-
result = task.run()
|
|
281
|
-
if result is False:
|
|
282
|
-
raise RuntimeError('Task.run() returned False')
|
|
283
|
-
self.executor.check_enabled()
|
|
284
|
-
return None if result is None else repr(result)[:2000]
|
|
285
|
-
finally:
|
|
286
|
-
if self.executor.current_task is task:
|
|
287
|
-
self.executor.current_task = None
|
|
288
|
-
if task is not None:
|
|
289
|
-
task.running = False
|
|
290
|
-
task._enabled = False
|
|
291
|
-
# Cleanup must finish before the job resolves and ownership
|
|
292
|
-
# is released, including when reset or verification failed.
|
|
293
|
-
task.on_destroy()
|
|
326
|
+
return self._run_task(run_id, load, directory)
|
|
294
327
|
finally:
|
|
295
328
|
sys.modules.pop(module_name, None)
|
|
296
329
|
if added_path:
|
|
297
330
|
sys.path.remove(str(path.parent))
|
|
298
331
|
|
|
332
|
+
def _run_task(self, run_id, load, directory):
|
|
333
|
+
"""Load a task class, then prepare, reset, verify, run and destroy one instance."""
|
|
334
|
+
task = None
|
|
335
|
+
with (directory / 'run.log').open('a', encoding='utf-8', buffering=1) as output:
|
|
336
|
+
with capture_output(output.write):
|
|
337
|
+
try:
|
|
338
|
+
self._phase(run_id, 'loading')
|
|
339
|
+
cls = load()
|
|
340
|
+
task = cls(executor=self.executor, app=self.app)
|
|
341
|
+
task.artifact_directory = directory
|
|
342
|
+
task.after_init(executor=self.executor, scene=self.executor.scene)
|
|
343
|
+
task.post_init()
|
|
344
|
+
task._enabled = True
|
|
345
|
+
task.running = True
|
|
346
|
+
task.start_time = time.time()
|
|
347
|
+
self.executor.current_task = task
|
|
348
|
+
self._phase(run_id, 'preparing')
|
|
349
|
+
if self.prepare is not None:
|
|
350
|
+
self.prepare()
|
|
351
|
+
task.ensure_capture()
|
|
352
|
+
self.executor._prepare_task_for_run(is_trigger_task=False)
|
|
353
|
+
self._phase(run_id, 'resetting')
|
|
354
|
+
if task.reset_to_start() is False:
|
|
355
|
+
raise RuntimeError('reset_to_start() returned False')
|
|
356
|
+
self._phase(run_id, 'verifying_start')
|
|
357
|
+
verified = task.verify_start_state()
|
|
358
|
+
if verified is not None and verified is not True:
|
|
359
|
+
raise RuntimeError('verify_start_state() must assert or return True')
|
|
360
|
+
self._phase(run_id, 'running')
|
|
361
|
+
result = task.run()
|
|
362
|
+
if result is False:
|
|
363
|
+
raise RuntimeError('Task.run() returned False')
|
|
364
|
+
self.executor.check_enabled()
|
|
365
|
+
if isinstance(result, _CodeResult):
|
|
366
|
+
return repr(result.value)[:2000]
|
|
367
|
+
return None if result is None else repr(result)[:2000]
|
|
368
|
+
finally:
|
|
369
|
+
if self.executor.current_task is task:
|
|
370
|
+
self.executor.current_task = None
|
|
371
|
+
if task is not None:
|
|
372
|
+
task.running = False
|
|
373
|
+
task._enabled = False
|
|
374
|
+
# Cleanup must finish before the job resolves and ownership
|
|
375
|
+
# is released, including when reset or verification failed.
|
|
376
|
+
task.on_destroy()
|
|
377
|
+
|
|
299
378
|
def _finished(self, run_id, owner, future):
|
|
300
379
|
with self._lock:
|
|
301
380
|
record = self._runs[run_id]['record']
|
|
@@ -126,6 +126,8 @@ def create_mcp_app(runner, token, port, request_exit=None):
|
|
|
126
126
|
'until the reload finishes before testing. Read the reload-tasks skill for this workflow. '
|
|
127
127
|
'Write a local Python file defining class Task(BaseTask) with reset_to_start(), '
|
|
128
128
|
'verify_start_state(), and run(). Call run_task with its absolute path. '
|
|
129
|
+
'For quick probes such as one click or key press, call run_code with a snippet '
|
|
130
|
+
'using self (a fresh BaseTask); it skips reset and verification. '
|
|
129
131
|
'Read logs and screenshots directly from the returned local paths. '
|
|
130
132
|
'Use assertions in run() to verify success. A stopping run still owns the executor. '
|
|
131
133
|
'If runtime state cannot be cleared or reset, code is stuck, or cached dependencies '
|
|
@@ -181,6 +183,18 @@ def create_mcp_app(runner, token, port, request_exit=None):
|
|
|
181
183
|
"""
|
|
182
184
|
return await asyncio.to_thread(runner.run_task, file_path)
|
|
183
185
|
|
|
186
|
+
@mcp.tool()
|
|
187
|
+
async def run_code(source: str) -> dict[str, Any]:
|
|
188
|
+
"""Run a Python snippet for probing, with self bound to a fresh BaseTask.
|
|
189
|
+
|
|
190
|
+
Example: self.click(123, 456); self.send_key('esc'). Skips reset and
|
|
191
|
+
start-state verification. A trailing expression's repr becomes the result.
|
|
192
|
+
get_task(task_id) returns a registered task by an ID from list_tasks.
|
|
193
|
+
Returns a run ID immediately; source is saved as source.py in the artifacts.
|
|
194
|
+
Put finished behavior in task files, not snippets.
|
|
195
|
+
"""
|
|
196
|
+
return await asyncio.to_thread(runner.run_code, source)
|
|
197
|
+
|
|
184
198
|
@mcp.tool()
|
|
185
199
|
async def get_run_status(run_id: str) -> dict[str, Any]:
|
|
186
200
|
"""Return state, phase, brief error, and local artifact paths for a run."""
|
|
@@ -830,6 +830,10 @@ class TaskExecutor:
|
|
|
830
830
|
communicate.quit.emit()
|
|
831
831
|
except TaskDisabledException:
|
|
832
832
|
logger.info(f"TaskDisabledException, continue {task}")
|
|
833
|
+
if not is_trigger_task:
|
|
834
|
+
# A one-time task that raised TaskDisabledException itself
|
|
835
|
+
# is finished; trigger tasks keep their enabled setting.
|
|
836
|
+
task.disable()
|
|
833
837
|
self._finish_task(task, is_trigger_task)
|
|
834
838
|
communicate.notification.emit('Stopped', task.name, False,
|
|
835
839
|
False, None, None, None)
|
|
@@ -18,6 +18,7 @@ from ok.ui.qt.kit.navigation import NavigationView, NavItem
|
|
|
18
18
|
from ok.ui.qt.kit.options import OptionCard, OptionGroup
|
|
19
19
|
from ok.ui.qt.kit.popover import Popover
|
|
20
20
|
from ok.ui.qt.kit.switch import Switch
|
|
21
|
+
from ok.ui.qt.kit.table import Table
|
|
21
22
|
from ok.ui.qt.kit.tabs import TabItem, TabStrip
|
|
22
23
|
from ok.ui.qt.kit.theme import Theme, theme
|
|
23
24
|
from ok.ui.qt.kit.window import ContentLayer, KitWindow, TitleBar
|
|
@@ -26,6 +27,6 @@ __all__ = [
|
|
|
26
27
|
"AnimatedStackedWidget", "Button", "Card", "ComboBox", "ContentLayer", "Dialog", "FlowLayout", "ICON_NAMES", "KitWindow", "Label",
|
|
27
28
|
"NavItem",
|
|
28
29
|
"NavigationView", "NumberBox", "OptionCard", "OptionGroup", "Pill", "Popover", "ProgressRing", "SettingGroup",
|
|
29
|
-
"SettingRow", "StatusDot", "Switch", "TabItem", "TabStrip", "Theme", "TitleBar", "Toast", "confirm", "icon",
|
|
30
|
+
"SettingRow", "StatusDot", "Switch", "TabItem", "TabStrip", "Table", "Theme", "TitleBar", "Toast", "confirm", "icon",
|
|
30
31
|
"load_icon", "set_toast_anchor", "set_toast_top_margin", "show_toast", "theme",
|
|
31
32
|
]
|