oh-my-opencode 4.19.4 → 5.0.0-beta.10
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/.agents/command/publish.md +44 -16
- package/.agents/skills/publish/SKILL.md +44 -16
- package/.agents/skills/work-with-pr/SKILL.md +37 -23
- package/.opencode/command/publish.md +44 -16
- package/.opencode/skills/work-with-pr/SKILL.md +37 -23
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +18 -6
- package/README.ru.md +1 -1
- package/README.zh-cn.md +1 -1
- package/bin/oh-my-opencode.js +14 -1
- package/bin/oh-my-opencode.test.ts +21 -0
- package/dist/agents/atlas/agent.d.ts +0 -1
- package/dist/agents/sisyphus/grok-4.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +2 -0
- package/dist/agents/sisyphus-agent-config.d.ts +6 -0
- package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
- package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +15 -4
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +1888 -807
- package/dist/cli/run/on-complete-hook.d.ts +2 -0
- package/dist/cli-node/index.js +1888 -807
- package/dist/config/schema/agent-overrides.d.ts +528 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +495 -0
- package/dist/features/monitor/batcher.d.ts +3 -1
- package/dist/features/monitor/manager-internals.d.ts +1 -0
- package/dist/features/monitor/output-injector-types.d.ts +2 -0
- package/dist/features/monitor/output-injector.d.ts +6 -0
- package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/unrecoverable-request-error.d.ts +9 -0
- package/dist/hooks/tool-pair-validator/hook.test-support.d.ts +29 -0
- package/dist/hooks/tool-pair-validator/tool-part-ids.d.ts +14 -5
- package/dist/hooks/tool-pair-validator/tool-result-repair.d.ts +4 -3
- package/dist/hooks/tool-pair-validator/types.d.ts +5 -22
- package/dist/index.js +3139 -2232
- package/dist/mcp/lsp.d.ts +1 -0
- package/dist/oh-my-opencode.schema.json +1466 -131
- package/dist/shared/normalize-sdk-response.d.ts +1 -0
- package/dist/shared/shell-env.d.ts +1 -1
- package/dist/shared/tmux/constants.d.ts +1 -1
- package/dist/skills/ast-grep/SOURCE +1 -1
- package/dist/skills/ast-grep/install.ps1 +2 -2
- package/dist/skills/ast-grep/install.sh +1 -1
- package/dist/skills/ast-grep/references/install.md +2 -2
- package/dist/skills/ast-grep/tests/smoke.sh +1 -1
- package/dist/skills/coding-agent-sessions/SKILL.md +3 -2
- package/dist/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/dist/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/dist/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/dist/skills/frontend/SKILL.md +10 -7
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/stylegallery.md +80 -0
- package/dist/skills/start-work/SKILL.md +54 -9
- package/dist/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/dist/skills/ultimate-browsing/SKILL.md +2 -2
- package/dist/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/dist/skills/ultimate-browsing/engine/__main__.py +8 -1
- package/dist/skills/ultimate-browsing/engine/bias_check.py +11 -0
- package/dist/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
- package/dist/skills/ultimate-browsing/engine/result_schema.py +10 -1
- package/dist/skills/ultimate-browsing/engine/surrogate.py +214 -0
- package/dist/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
- package/dist/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
- package/dist/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
- package/dist/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
- package/dist/skills/ultimate-browsing/engine/validators.py +46 -0
- package/dist/skills/ultimate-browsing/engine/waf_detector.py +1 -1
- package/dist/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
- package/dist/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/dist/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/dist/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
- package/dist/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
- package/dist/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
- package/dist/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
- package/dist/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
- package/dist/skills/ulw-plan/SKILL.md +3 -3
- package/dist/skills/ulw-plan/references/full-workflow.md +30 -6
- package/dist/skills/ulw-plan/references/intent-clear.md +2 -1
- package/dist/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/dist/skills/ulw-research/SKILL.md +15 -10
- package/dist/tui.js +477 -36
- package/docs/reference/web-terminal-visual-qa.md +1 -1
- package/package.json +34 -24
- package/packages/lsp-core/src/lsp/client-diagnostics-concurrency.integration.test.ts +44 -0
- package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +0 -28
- package/packages/lsp-core/src/lsp/client-wrapper.test.ts +60 -7
- package/packages/lsp-core/src/lsp/client-wrapper.ts +69 -16
- package/packages/lsp-core/src/lsp/connection.ts +1 -1
- package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +20 -1
- package/packages/lsp-core/src/tools/diagnostics.ts +3 -3
- package/packages/lsp-core/src/tools/navigation.ts +4 -2
- package/packages/lsp-core/src/tools/rename.ts +4 -2
- package/packages/lsp-core/src/tools/symbols.ts +1 -1
- package/packages/lsp-daemon/dist/cli.js +108 -40
- package/packages/lsp-daemon/dist/client.js +123 -55
- package/packages/lsp-daemon/dist/ensure-daemon.d.ts +1 -0
- package/packages/lsp-daemon/dist/ensure-daemon.js +18 -5
- package/packages/lsp-daemon/dist/index.js +111 -43
- package/packages/lsp-tools-mcp/dist/cli.js +77 -23
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +1 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +77 -23
- package/packages/lsp-tools-mcp/dist/tools.js +77 -23
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +268 -92
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +7 -7
- package/packages/omo-codex/plugin/components/bootstrap/src/worker.ts +3 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +220 -10
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +220 -10
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +135 -67
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
- package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
- package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
- package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +4 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/README.md +5 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +2 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +18 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +21 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +0 -3
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +107 -16
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +24 -12
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +24 -12
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/CHANGELOG.md +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-low.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +9 -2
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +9 -2
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +30 -6
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
- package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +11 -11
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +9 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +9 -9
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +66 -66
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +5 -4
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +23 -25
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +9 -9
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-helpers.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-kind-guidance.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +7 -40
- package/packages/omo-codex/plugin/components/ulw-loop/test/plan-io.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +20 -20
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +4 -4
- package/packages/omo-codex/plugin/skills/ast-grep/SOURCE +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +2 -2
- package/packages/omo-codex/plugin/skills/ast-grep/install.sh +1 -1
- package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +2 -2
- package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.sh +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +10 -7
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +54 -9
- package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +8 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/bias_check.py +11 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/result_schema.py +10 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/surrogate.py +214 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/validators.py +46 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_detector.py +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +9 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +5 -4
- package/packages/omo-codex/plugin/skills/ulw-loop/references/define-goal.md +108 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +23 -25
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +30 -6
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +15 -10
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
- package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
- package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
- package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +12 -12
- package/packages/omo-codex/plugin/test/bootstrap-orchestration.test.mjs +36 -4
- package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
- package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
- package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
- package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +4 -4
- package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
- package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
- package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
- package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
- package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
- package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
- package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
- package/packages/omo-codex/scripts/install-bin-links.test.mjs +56 -2
- package/packages/omo-codex/scripts/install-delegated-command.test.mjs +6 -6
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +170 -78
- package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
- package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +4 -4
- package/packages/omo-codex/scripts/install-local.test.mjs +5 -2
- package/packages/shared-skills/index.mjs +19 -1
- package/packages/shared-skills/skills/ast-grep/SOURCE +1 -1
- package/packages/shared-skills/skills/ast-grep/install.ps1 +2 -2
- package/packages/shared-skills/skills/ast-grep/install.sh +1 -1
- package/packages/shared-skills/skills/ast-grep/references/install.md +2 -2
- package/packages/shared-skills/skills/ast-grep/tests/smoke.sh +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +3 -2
- package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +1 -1
- package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +4 -4
- package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +1 -1
- package/packages/shared-skills/skills/frontend/SKILL.md +10 -7
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/stylegallery.md +80 -0
- package/packages/shared-skills/skills/start-work/SKILL.md +54 -9
- package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +37 -10
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +2 -2
- package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +179 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +8 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/bias_check.py +11 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/fetch_chain.py +90 -52
- package/packages/shared-skills/skills/ultimate-browsing/engine/result_schema.py +10 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/surrogate.py +214 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/surrogates.yaml +60 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/amp_redirect_stub.html +7 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/search_interstitial.html +19 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/wayback_available.json +1 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/fixtures/wayback_snapshot.html +1128 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_surrogate.py +252 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_surrogate_validators.py +78 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/validators.py +46 -0
- package/packages/shared-skills/skills/ultimate-browsing/engine/waf_detector.py +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/engine/waf_profiles.yaml +10 -5
- package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/social.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +13 -11
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +4 -4
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/cache-archive.md +51 -50
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/fallback.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/jina.md +8 -2
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/naver.md +1 -1
- package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/twitter.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +30 -6
- package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +2 -1
- package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +3 -3
- package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +1 -1
- package/packages/shared-skills/skills/ulw-research/SKILL.md +15 -10
- package/postinstall.mjs +6 -0
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
- package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
|
@@ -37,7 +37,7 @@ Read the matching reference before acting: [`references/insane-search/README.md`
|
|
|
37
37
|
## Tier 1 — insane-search (headless extraction)
|
|
38
38
|
|
|
39
39
|
**When**: content extraction, blocked-URL bypass, media metadata — no browser UI needed.
|
|
40
|
-
**Why first**: ~10x faster than a browser, no process spin-up; handles most "fetch this blocked page" requests via curl_cffi TLS impersonation, yt-dlp (1858 sites),
|
|
40
|
+
**Why first**: ~10x faster than a browser, no process spin-up; handles most "fetch this blocked page" requests via curl_cffi TLS impersonation, yt-dlp (1858 sites), official public APIs, mobile URL transforms, **Phase-2.5 surrogate archives** (Wayback / archive.today snapshots, provenance-tagged — see [`references/insane-search/cache-archive.md`](references/insane-search/cache-archive.md)), a key-gated Jina Reader (`JINA_API_KEY`), and a Playwright real-Chrome fallback. The engine lives **inside this skill** at `engine/` and is invoked as a module. Surrogate results are dated COPIES: a result whose `provenance` is `snapshot` must be reported with its `snapshot_timestamp`, never presented as the live page.
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
# Core command — auto-detects WAF, runs the full fetch grid (run from the skill dir):
|
|
@@ -60,7 +60,7 @@ The full engine harness (rules R1-R7, the Phase 0 official-API index, the no-sit
|
|
|
60
60
|
|
|
61
61
|
## Tier 1.5 — agent-reach (platform-native readers)
|
|
62
62
|
|
|
63
|
-
**When**: the target is a platform with a first-class API/CLI that beats generic fetching — especially Chinese platforms that stealth browsers still cannot reach cleanly. Several channels are zero-config (Douyin,
|
|
63
|
+
**When**: the target is a platform with a first-class API/CLI that beats generic fetching — especially Chinese platforms that stealth browsers still cannot reach cleanly. Several channels are zero-config (Douyin, V2EX, Reddit, RSS, YouTube); others need a one-time auth you supply via environment variables if you have access (`JINA_API_KEY` for Jina Reader — anonymous access is dead, see `references/insane-search/jina.md`; `TWITTER_*` for X; a transcription key for podcasts).
|
|
64
64
|
|
|
65
65
|
| Category | Platforms | Entry |
|
|
66
66
|
|---|---|---|
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# ultimate-browsing/engine — Generic WAF-Profile Fetch Chain (Python)
|
|
2
|
+
|
|
3
|
+
**Generated:** 2026-08-10 / 38d268995
|
|
4
|
+
|
|
5
|
+
## UPSTREAM BASELINE AND VERSION POLICY
|
|
6
|
+
|
|
7
|
+
**READ THIS BEFORE TOUCHING `engine/**` OR PROPOSING AN UPSTREAM SYNC.**
|
|
8
|
+
|
|
9
|
+
This engine is NOT project-original code. It is a vendored-and-modified snapshot of
|
|
10
|
+
[fivetaku/insane-search](https://github.com/fivetaku/insane-search), and the version
|
|
11
|
+
we run on is a deliberate choice, not an accident of neglect.
|
|
12
|
+
|
|
13
|
+
### The pin
|
|
14
|
+
|
|
15
|
+
| Fact | Value |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Upstream project | `https://github.com/fivetaku/insane-search` |
|
|
18
|
+
| Vendoring commit | `a4e4ed797` (2026-06-21) `feat(ultimate-browsing): vendor insane-search engine (junk-excluded)` |
|
|
19
|
+
| De-personalization | `4743199a5` (2026-06-21) |
|
|
20
|
+
| Pinned upstream baseline | upstream state as of 2026-06-21, **pre-0.7.0** (0.7.0 is dated 2026-06-22) |
|
|
21
|
+
| Re-vendors since | none — every later change here is ours |
|
|
22
|
+
|
|
23
|
+
We intentionally track a **pinned baseline plus local divergence**, not upstream HEAD.
|
|
24
|
+
There is no submodule and no automated drift check for this engine (unlike the
|
|
25
|
+
`frontend` skill's upstream submodules): the vendored files ARE the source of truth,
|
|
26
|
+
and upstream is a reference we port FROM, deliberately, file by file.
|
|
27
|
+
|
|
28
|
+
### Why we do not blind-rebase onto upstream HEAD
|
|
29
|
+
|
|
30
|
+
1. **Upstream reset its public history.** On 2026-08-06 upstream published a single
|
|
31
|
+
squashed commit, `019ee16 refactor: reset public history at 0.14.0`, discarding the
|
|
32
|
+
prior public history through 0.13.x. There is no upstream commit graph to rebase onto and no
|
|
33
|
+
way to cherry-pick an individual upstream change by sha — only whole-file diffing
|
|
34
|
+
against a moving HEAD.
|
|
35
|
+
2. **Upstream 0.14.0 REMOVED capability.** The endpoint-mining / internal-API
|
|
36
|
+
auto-derivation / site-recipe subsystems that upstream carried publicly between
|
|
37
|
+
0.12.0 and 0.14.0 are gone from upstream HEAD. Syncing to HEAD is therefore not
|
|
38
|
+
strictly an upgrade: parts of it are a downgrade relative to the intermediate
|
|
39
|
+
versions, and none of it is recoverable from the reset history.
|
|
40
|
+
3. **Our tree diverged on purpose.** The KEEP list below is functionality upstream
|
|
41
|
+
never had. A wholesale overwrite with upstream HEAD would silently delete it.
|
|
42
|
+
4. **Different threat model.** Our engine ships inside a published npm package and a
|
|
43
|
+
public marketplace mirror, under a CI no-site-name gate and a de-personalization
|
|
44
|
+
deny-list. Upstream carries neither constraint, so upstream code is not
|
|
45
|
+
drop-in-shippable here.
|
|
46
|
+
|
|
47
|
+
### KEEP — our divergences a re-vendor MUST NOT regress
|
|
48
|
+
|
|
49
|
+
These exist only in our tree. Any upstream sync that removes or bypasses one of them
|
|
50
|
+
is a regression, not an upgrade:
|
|
51
|
+
|
|
52
|
+
- **Phase 2.5 surrogate retrieval** (`surrogate.py`, `surrogates.yaml`) — archive /
|
|
53
|
+
reader / proxy routes tried before paying for a browser spin-up, with per-entry
|
|
54
|
+
`last_verified` staleness handling and `--allow-proxy` gating.
|
|
55
|
+
- **Provenance / trust contract** (`result_schema.py`) — `Provenance` and `Trust`
|
|
56
|
+
literals on every result, so a snapshot can never be reported as the live page.
|
|
57
|
+
- **Surrogate dead-end validation** (L1.5 in `validators.py`) — interstitial titles and
|
|
58
|
+
AMP-style redirect stubs rejected instead of returned as content.
|
|
59
|
+
- **The no-site-name rule and its CI gate** (`bias_check.py`) — zero hard-coded site
|
|
60
|
+
names, brands, or target domains in `engine/**`.
|
|
61
|
+
- **Module split of the fetch chain** — `curl_probe` / `referers` / `url_transforms` /
|
|
62
|
+
`waf_detector` / `validators` / `executor` / `summary` as separate modules rather than
|
|
63
|
+
one monolith.
|
|
64
|
+
- **The Python test suite** under `engine/tests/` with its HTML/JSON fixtures.
|
|
65
|
+
- **De-personalization** — no personal absolute paths, no personal auth token literals,
|
|
66
|
+
no personal browser choice; enforced by `depersonalization-gate.test.ts`.
|
|
67
|
+
- **Skill-level layering** — the engine is Tier 1 under a router that also owns Tier 1.5
|
|
68
|
+
(agent-reach) and Tier 2 (CloakBrowser + agent-browser). Upstream has no such tiering.
|
|
69
|
+
|
|
70
|
+
### WANT — upstream improvements worth porting forward
|
|
71
|
+
|
|
72
|
+
Our snapshot predates these; they are wanted, and each must be ported as a reviewed,
|
|
73
|
+
site-agnostic change that preserves every KEEP item above. Port individually; never as
|
|
74
|
+
a tree overwrite:
|
|
75
|
+
|
|
76
|
+
- **Content quality**: dedicated markdown conversion of fetched HTML, main-content
|
|
77
|
+
extraction, PDF text extraction, and JSON-LD rescue when the HTML body is thin.
|
|
78
|
+
- **Transient-failure retry** and **render-merge** of statically fetched HTML with the
|
|
79
|
+
browser-rendered DOM.
|
|
80
|
+
- **Differential block classification** — distinguishing a bot-detection block from an
|
|
81
|
+
infrastructure or authentication failure, instead of collapsing both into `challenge`.
|
|
82
|
+
- **Additional stealth fetch backends** beyond the current Playwright templates, and
|
|
83
|
+
additional WAF vendor profiles.
|
|
84
|
+
- **Per-host route learning** — remembering which route succeeded for a host, with a TTL
|
|
85
|
+
and a bounded store. Must stay runtime state, never committed site knowledge (R4).
|
|
86
|
+
- **Engine-level Phase 0 routing** — the official-public-API preference is currently only
|
|
87
|
+
a documented rule (R5) the agent can skip; upstream moved it into code so it cannot be
|
|
88
|
+
skipped. Worth adopting.
|
|
89
|
+
|
|
90
|
+
### OUT OF SCOPE
|
|
91
|
+
|
|
92
|
+
- **The removed upstream endpoint-mining / internal-API auto-derivation / site-recipe
|
|
93
|
+
subsystems.** They are absent from upstream HEAD and are not reconstructed here. They
|
|
94
|
+
also sit against R3/R4 and R7's anti-bias rule: discovered internal endpoints are
|
|
95
|
+
runtime findings, never committed engine knowledge.
|
|
96
|
+
- **Any upstream code carrying site-specific selectors, domains, or brand names.** It
|
|
97
|
+
fails `bias_check.py` at the door; re-derive it site-agnostically or leave it out.
|
|
98
|
+
- **Automated upstream tracking.** No submodule, no drift check, no auto-bump. Syncing is
|
|
99
|
+
a deliberate, reviewed, human-initiated act.
|
|
100
|
+
|
|
101
|
+
### THE SYNC RULE
|
|
102
|
+
|
|
103
|
+
Any future upstream sync preserves BOTH sides. Concretely:
|
|
104
|
+
|
|
105
|
+
1. Diff the specific upstream capability you want against our tree — do not overwrite
|
|
106
|
+
files wholesale, and never `git checkout` upstream over `engine/`.
|
|
107
|
+
2. Port it as its own reviewed change, keeping every KEEP item intact.
|
|
108
|
+
3. Re-run `python3 engine/bias_check.py` and the `engine/tests/` suite; a port that
|
|
109
|
+
introduces a site name or breaks a fixture does not ship.
|
|
110
|
+
4. Update the pin table above (baseline, date, what was ported) in the same change, plus
|
|
111
|
+
the provenance section of [`../ATTRIBUTION.md`](../ATTRIBUTION.md).
|
|
112
|
+
5. If a port must drop a KEEP item, say so explicitly in the PR and get it agreed first —
|
|
113
|
+
silent regressions of the KEEP list are the failure mode this policy exists to prevent.
|
|
114
|
+
|
|
115
|
+
## OVERVIEW
|
|
116
|
+
|
|
117
|
+
A 17-module Python package embedded in the `ultimate-browsing` skill: a site-agnostic fetch chain that escalates from a cheap curl probe to a real browser, with declarative WAF and surrogate registries. Not "optional scripts" — it has its own CLI entry (`python3 -m engine URL`), two YAML config schemas, a 4-file test suite, and a standalone CI guard. Package exports (`__init__.py`): `fetch`, `FetchResult`, `Attempt`, `Verdict`, `ValidationResult`, `validate`, `CHALLENGE_MARKERS`, `detect`, `TRANSFORMS`, `apply_transform`.
|
|
118
|
+
|
|
119
|
+
## THE NO-SITE-NAME RULE (enforced in CI)
|
|
120
|
+
|
|
121
|
+
`engine/**` must contain **zero** hard-coded site names, brands, or target domains. Site specifics belong to runtime hints or observations, never to code. `bias_check.py` is a standalone scanner enforcing this: a brand denylist, a URL regex scan, an allowlist for genuine infrastructure hosts (archive.org, r.jina.ai, google.com, httpbin.org, relay.invalid), and a `# NOTE-BIAS-OK` comment convention for legitimate exemptions such as test fixtures.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
python3 engine/bias_check.py # fails on any site-specific leak
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## FETCH CHAIN PHASES
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
fetch(url, ...) # fetch_chain.py
|
|
131
|
+
Phase 1 curl_probe.py — curl_cffi TLS-impersonation probe
|
|
132
|
+
Phase 2 grid — referer/transform/device attempt grid
|
|
133
|
+
Phase 2.5 surrogate.py — third-party archive/reader/proxy routes
|
|
134
|
+
Phase 3 executor.py — capability-matched Playwright fallback
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Ordering is **not** hardcoded: each `waf_profiles.yaml` profile carries a `fallback_when_challenge` list that drives the ladder. `surrogate_wayback` precedes browser executors in every profile, so archives are tried before paying for a browser spin-up.
|
|
138
|
+
|
|
139
|
+
## PROVENANCE / TRUST CONTRACT
|
|
140
|
+
|
|
141
|
+
`result_schema.py` puts two literals on every `FetchResult`:
|
|
142
|
+
|
|
143
|
+
- `Provenance = "live" | "snapshot" | "proxy"`
|
|
144
|
+
- `Trust = "origin" | "archive" | "untrusted"`
|
|
145
|
+
|
|
146
|
+
A `snapshot` result carries `snapshot_timestamp` and **must** be cited with that timestamp — never presented as the live page. `surrogates.yaml` `kind` fixes these values: `archive` -> snapshot/archive, `reader` -> live, `proxy` -> proxy/untrusted.
|
|
147
|
+
|
|
148
|
+
## SURROGATE REGISTRY (`surrogates.yaml`)
|
|
149
|
+
|
|
150
|
+
Site-agnostic infrastructure only. Every entry carries `last_verified` (ISO date); entries older than 90 days are deprioritized and flagged, because surrogate routes rot (a 2026-08 probe found 4 of 6 known routes dead or stubbed). `proxy` routes are MITM by construction: they require the explicit `--allow-proxy` flag and never receive `Cookie` or `Authorization` headers. Every surrogate response is re-validated with `target_url` set, so an interstitial or a redirect stub is rejected instead of returned as content.
|
|
151
|
+
|
|
152
|
+
## VALIDATOR LAYERS (`validators.py`)
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
L1 challenge markers (CHALLENGE_MARKERS)
|
|
156
|
+
L1.5 surrogate dead ends — interstitial titles + AMP-style redirect stubs
|
|
157
|
+
(is_redirect_stub(), needs target_url)
|
|
158
|
+
L2 size/shape fingerprints
|
|
159
|
+
L3+ content checks
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## CLI
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
python3 -m engine URL [--selector S] [--device auto|desktop|mobile]
|
|
166
|
+
[--timeout 25] [--max-attempts 12]
|
|
167
|
+
[--no-playwright] [--allow-proxy] [--json] [--trace]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## TESTS
|
|
171
|
+
|
|
172
|
+
`tests/` — `test_surrogate.py` (staleness, proxy gating, short-circuit), `test_surrogate_validators.py`, `test_fetch_chain.py`, `test_playwright_templates.py`, plus HTML/JSON fixtures under `tests/fixtures/`.
|
|
173
|
+
|
|
174
|
+
## NOTES
|
|
175
|
+
|
|
176
|
+
- `summary.py` emits an **R7 API-first hint** after >=3 challenge verdicts against a known WAF profile: look for `/api/`, `/graphql`, or `.json` endpoints, which usually carry weaker WAF protection than the HTML surface.
|
|
177
|
+
- `templates/` holds the Playwright JS templates (`playwright_real_chrome.js`, `playwright_mobile_chrome.js`) the executor drives.
|
|
178
|
+
- `url_transforms.py` transforms stay domain-agnostic (`mobile_subdomain`, `am_prefix`, `drop_www`).
|
|
179
|
+
- Parent: [`packages/shared-skills/AGENTS.md`](../../../AGENTS.md).
|
|
@@ -39,6 +39,10 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
39
39
|
help="Upper bound across all phases (default 12).")
|
|
40
40
|
p.add_argument("--no-playwright", action="store_true",
|
|
41
41
|
help="Skip Playwright fallback (curl-only).")
|
|
42
|
+
p.add_argument("--allow-proxy", action="store_true",
|
|
43
|
+
help=("Enable kind=proxy surrogate entries (raw relay routes; "
|
|
44
|
+
"MITM by construction — never citable alone, never "
|
|
45
|
+
"receives cookies/auth headers). Off by default."))
|
|
42
46
|
p.add_argument("--json", action="store_true",
|
|
43
47
|
help="Emit FetchResult as JSON to stdout (content omitted).")
|
|
44
48
|
p.add_argument("--trace", action="store_true",
|
|
@@ -56,6 +60,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
56
60
|
timeout=args.timeout,
|
|
57
61
|
max_attempts=args.max_attempts,
|
|
58
62
|
enable_playwright=not args.no_playwright,
|
|
63
|
+
allow_surrogate_proxy=args.allow_proxy,
|
|
59
64
|
)
|
|
60
65
|
except Exception as e:
|
|
61
66
|
print(f"engine fatal: {type(e).__name__}: {e}", file=sys.stderr)
|
|
@@ -96,7 +101,9 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
96
101
|
# Default: HTML to stdout, status to stderr.
|
|
97
102
|
print(result.content, end="")
|
|
98
103
|
print(f"\n[engine] ok={result.ok} verdict={result.verdict} "
|
|
99
|
-
f"profile={result.profile_used} attempts={len(result.trace)}"
|
|
104
|
+
f"profile={result.profile_used} attempts={len(result.trace)} "
|
|
105
|
+
f"provenance={result.provenance}"
|
|
106
|
+
+ (f" snapshot_ts={result.snapshot_timestamp}" if result.snapshot_timestamp else ""),
|
|
100
107
|
file=sys.stderr)
|
|
101
108
|
|
|
102
109
|
return 0 if result.ok else 1
|
|
@@ -54,6 +54,14 @@ URL_ALLOWLIST = {
|
|
|
54
54
|
"www.google.com", "google.com",
|
|
55
55
|
# Generic HTTP test endpoint for infrastructure / transport tests.
|
|
56
56
|
"httpbin.org",
|
|
57
|
+
# Surrogate-tier infrastructure (engine/surrogates.yaml): archives/relays
|
|
58
|
+
# that serve a copy of ANY target URL. Same no-site-preference category as
|
|
59
|
+
# the google.com Referer — they are not target sites.
|
|
60
|
+
"archive.org", "web.archive.org",
|
|
61
|
+
"r.jina.ai",
|
|
62
|
+
# Placeholder host in the proxy-entry shape example; "canonical non-routable
|
|
63
|
+
# doc domain" (.invalid TLD), can never be a real target.
|
|
64
|
+
"relay.invalid",
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
# Files / dirs that must be clean.
|
|
@@ -80,6 +88,9 @@ EXPLICIT_ALLOW_FILES = {
|
|
|
80
88
|
# None right now — add if needed with justification.
|
|
81
89
|
}
|
|
82
90
|
|
|
91
|
+
# NOTE-BIAS-OK convention for surrogate tests: fixture URLs (stub/interstitial
|
|
92
|
+
# captures from third-party services) carry the marker on the flagged line.
|
|
93
|
+
|
|
83
94
|
|
|
84
95
|
def _line_is_exempt(line: str, ext: str) -> bool:
|
|
85
96
|
markers = COMMENT_OK_MARKERS.get(ext, ())
|
|
@@ -40,6 +40,7 @@ def fetch(
|
|
|
40
40
|
timeout: int = 25,
|
|
41
41
|
max_attempts: int = 12,
|
|
42
42
|
enable_playwright: bool = True, # hook left for executor module
|
|
43
|
+
allow_surrogate_proxy: bool = False, # opt-in: kind=proxy registry entries
|
|
43
44
|
) -> FetchResult:
|
|
44
45
|
"""Fetch `url` using the generic grid.
|
|
45
46
|
|
|
@@ -175,73 +176,110 @@ def fetch(
|
|
|
175
176
|
if att.verdict in (Verdict.STRONG_OK.value, Verdict.WEAK_OK.value):
|
|
176
177
|
return _build_result(resp, att, trace, profile_used=profile_id)
|
|
177
178
|
|
|
178
|
-
# -------- Phase 3:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
179
|
+
# -------- Phase 2.5 + 3: fallback ladder (profile-driven order) ---------
|
|
180
|
+
# Surrogate routes are NOT browser work, so they run even when the caller
|
|
181
|
+
# disabled Playwright; only browser executors honour `enable_playwright`.
|
|
182
|
+
try:
|
|
183
|
+
# Honour profile's `fallback_when_challenge` list — iterate the
|
|
184
|
+
# caller-declared order instead of capability-inferred single pick.
|
|
185
|
+
fb_profile = load_profile(profile_used or "unknown_challenge", profiles=profiles)
|
|
186
|
+
fb_order = fb_profile.get("fallback_when_challenge") or ["playwright_real_chrome"]
|
|
187
|
+
pw_attempt = None
|
|
188
|
+
pw_content = ""
|
|
189
|
+
for fb_name in fb_order:
|
|
190
|
+
if fb_name == "curl_grid_exhaust":
|
|
191
|
+
# Already performed in Phase 2; nothing more to do here.
|
|
192
|
+
continue
|
|
193
|
+
if fb_name.startswith("surrogate_"):
|
|
194
|
+
# Phase 2.5: archive/reader/proxy routes serving a copy of
|
|
195
|
+
# the target. Cheaper than a browser; provenance-labeled.
|
|
196
|
+
from . import surrogate as surrogate_mod
|
|
197
|
+
s_atts, s_meta, s_content = surrogate_mod.run_surrogate(
|
|
193
198
|
url,
|
|
194
|
-
|
|
199
|
+
registry=surrogate_mod.load_surrogates(),
|
|
200
|
+
allow_proxy=allow_surrogate_proxy,
|
|
201
|
+
timeout=timeout,
|
|
195
202
|
success_selectors=success_selectors,
|
|
196
|
-
device_class=device_class,
|
|
197
|
-
force_executor=fb_name,
|
|
198
203
|
)
|
|
199
|
-
trace.
|
|
200
|
-
|
|
204
|
+
trace.extend(s_atts)
|
|
205
|
+
s_att = s_atts[-1]
|
|
206
|
+
if s_att.verdict in (Verdict.STRONG_OK.value, Verdict.WEAK_OK.value):
|
|
201
207
|
return FetchResult(
|
|
202
208
|
ok=True,
|
|
203
|
-
content=
|
|
204
|
-
final_url=
|
|
205
|
-
verdict=
|
|
209
|
+
content=s_content,
|
|
210
|
+
final_url=s_att.url,
|
|
211
|
+
verdict=s_att.verdict,
|
|
206
212
|
profile_used=profile_used,
|
|
207
213
|
trace=trace,
|
|
208
|
-
summary=
|
|
214
|
+
summary=(
|
|
215
|
+
f"surrogate {s_meta.get('surrogate')} succeeded"
|
|
216
|
+
f" (provenance={s_meta.get('provenance')}"
|
|
217
|
+
+ (f" snapshot_ts={s_meta.get('snapshot_timestamp')})" if s_meta.get('snapshot_timestamp') else ")")
|
|
218
|
+
),
|
|
219
|
+
provenance=str(s_meta.get("provenance", "live")),
|
|
220
|
+
snapshot_timestamp=s_meta.get("snapshot_timestamp"),
|
|
221
|
+
trust=str(s_meta.get("trust", "origin")),
|
|
209
222
|
)
|
|
210
|
-
|
|
211
|
-
if
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
continue
|
|
224
|
+
if not enable_playwright:
|
|
225
|
+
continue
|
|
226
|
+
from .executor import run_playwright_fallback # lazy import
|
|
227
|
+
pw_attempt, pw_content = run_playwright_fallback(
|
|
228
|
+
url,
|
|
229
|
+
profile_id=profile_used or "unknown_challenge",
|
|
230
|
+
success_selectors=success_selectors,
|
|
231
|
+
device_class=device_class,
|
|
232
|
+
force_executor=fb_name,
|
|
233
|
+
)
|
|
234
|
+
trace.append(pw_attempt)
|
|
235
|
+
if pw_attempt.verdict in (Verdict.STRONG_OK.value, Verdict.WEAK_OK.value):
|
|
236
|
+
return FetchResult(
|
|
237
|
+
ok=True,
|
|
238
|
+
content=pw_content,
|
|
239
|
+
final_url=pw_attempt.url,
|
|
240
|
+
verdict=pw_attempt.verdict,
|
|
241
|
+
profile_used=profile_used,
|
|
242
|
+
trace=trace,
|
|
243
|
+
summary=f"Playwright fallback succeeded via {fb_name}",
|
|
221
244
|
)
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
245
|
+
# Synthesize a placeholder only when the profile genuinely offers no
|
|
246
|
+
# fallback route. Entries skipped because the caller disabled the
|
|
247
|
+
# browser are a caller choice, not a profile defect — no trace noise.
|
|
248
|
+
actionable = [n for n in fb_order if n != "curl_grid_exhaust"]
|
|
249
|
+
if pw_attempt is None and not actionable:
|
|
250
|
+
pw_attempt = Attempt(
|
|
225
251
|
phase="fallback",
|
|
226
|
-
executor="
|
|
252
|
+
executor="none",
|
|
227
253
|
url=url,
|
|
228
254
|
url_transform="original",
|
|
229
255
|
impersonate=None,
|
|
230
256
|
referer="",
|
|
231
257
|
verdict=Verdict.UNKNOWN.value,
|
|
232
|
-
error="
|
|
233
|
-
)
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
258
|
+
error="profile has empty fallback_when_challenge",
|
|
259
|
+
)
|
|
260
|
+
trace.append(pw_attempt)
|
|
261
|
+
except ImportError:
|
|
262
|
+
trace.append(Attempt(
|
|
263
|
+
phase="fallback",
|
|
264
|
+
executor="playwright",
|
|
265
|
+
url=url,
|
|
266
|
+
url_transform="original",
|
|
267
|
+
impersonate=None,
|
|
268
|
+
referer="",
|
|
269
|
+
verdict=Verdict.UNKNOWN.value,
|
|
270
|
+
error="executor module not available",
|
|
271
|
+
))
|
|
272
|
+
except (RuntimeError, OSError) as e:
|
|
273
|
+
trace.append(Attempt(
|
|
274
|
+
phase="fallback",
|
|
275
|
+
executor="playwright",
|
|
276
|
+
url=url,
|
|
277
|
+
url_transform="original",
|
|
278
|
+
impersonate=None,
|
|
279
|
+
referer="",
|
|
280
|
+
verdict=Verdict.UNKNOWN.value,
|
|
281
|
+
error=f"{type(e).__name__}:{str(e)[:200]}",
|
|
282
|
+
))
|
|
245
283
|
|
|
246
284
|
# -------- Give up, return best we have ----------------------------------
|
|
247
285
|
summary = format_summary(trace, profile_used)
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import asdict, dataclass, field
|
|
4
|
-
from typing import Optional
|
|
4
|
+
from typing import Literal, Optional
|
|
5
|
+
|
|
6
|
+
Provenance = Literal["live", "snapshot", "proxy"]
|
|
7
|
+
Trust = Literal["origin", "archive", "untrusted"]
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
@dataclass
|
|
@@ -32,6 +35,9 @@ class FetchResult:
|
|
|
32
35
|
profile_used: Optional[str] = None
|
|
33
36
|
trace: list[Attempt] = field(default_factory=list)
|
|
34
37
|
summary: str = ""
|
|
38
|
+
provenance: str = "live" # live | snapshot | proxy
|
|
39
|
+
snapshot_timestamp: Optional[str] = None # archive's own timestamp, when snapshot
|
|
40
|
+
trust: str = "origin" # origin | archive | untrusted
|
|
35
41
|
|
|
36
42
|
def to_dict(self) -> dict:
|
|
37
43
|
return {
|
|
@@ -41,5 +47,8 @@ class FetchResult:
|
|
|
41
47
|
"profile_used": self.profile_used,
|
|
42
48
|
"trace": [a.to_dict() for a in self.trace],
|
|
43
49
|
"summary": self.summary,
|
|
50
|
+
"provenance": self.provenance,
|
|
51
|
+
"snapshot_timestamp": self.snapshot_timestamp,
|
|
52
|
+
"trust": self.trust,
|
|
44
53
|
"content_length": len(self.content),
|
|
45
54
|
}
|