



















Brings safari-mcp (https://github.com/achiya-automation/safari-mcp) to CLI-Anything as a schema-driven harness. Every one of the 84 MCP tools is auto-generated as a Click command from the bundled tool schema (resources/tools.json) — guaranteed 1:1 parity with the upstream server. Architecture highlights: - Schema-driven CLI generation via scripts/extract_tools.py (offline parser of safari-mcp's Zod schemas with depth-aware modifier detection for nested z.array(z.object(...)).describe() patterns) - Dynamic Click command registration at import time from tools.json - TestCLISubprocess with _resolve_cli() per HARNESS.md Phase 5 - URL validation with scheme blocking and optional private-network lockdown (utils/security.py) - 95 tests: 16 unit + 36 security + 24 parity + 19 E2E (all pass against real Safari; SAFARI_E2E=1 to enable live tests) Honest positioning: The harness is STRICTLY slower than using safari-mcp directly for MCP-compatible agents (Claude Code, Cursor, Cline). Per-call latency: 119ms (persistent MCP session) vs 3,023ms (CLI subprocess spawn). See HARNESS.md "Performance Tradeoffs" for the full benchmark — MCP wins by ~25× on latency. The CLI is optimized for a different audience: - Agents that do not speak MCP (Codex CLI, GitHub Copilot CLI) - Bash scripting and jq pipelines - CI/CD and cron jobs - Long-running Opus sessions where tool-definition token overhead (~8K tokens per API call with MCP vs ~100 with CLI) dominates cost Both paths return byte-identical output (verified live with Unicode titles via list_tabs). Files: - safari/agent-harness/HARNESS.md architecture deep-dive - safari/agent-harness/SAFARI.md software-specific SOP - safari/agent-harness/setup.py PyPI package metadata - safari/agent-harness/scripts/ extract_tools.py offline Zod parser → tools.json - safari/agent-harness/cli_anything/safari/ safari_cli.py Click CLI with dynamic tool group core/session.py in-memory REPL state utils/safari_backend.py sync MCP stdio client wrapper utils/security.py URL validation + DOM sanitization utils/tool_registry.py loads tools.json, kebab↔camel utils/repl_skin.py copied verbatim from plugin resources/tools.json 84-tool schema bundle (safari-mcp 2.7.8) skills/SKILL.md agent discovery manifest README.md user-facing docs tests/ 11/36/24/19 test files + TEST.md
…anguage - Remove unused `sanitize_dom_text` and `_PROMPT_INJECTION_PATTERNS` from security.py (and 11 corresponding tests). The function was never called in the CLI pipeline. - Add explicit `return` after `_handle_error` in `_validate_url_or_exit` so control flow is unambiguous if `sys.exit` is mocked. - Replace manual `__name__`/`__doc__` copy with `functools.wraps` in `handle_error` decorator. - Document `asyncio.run()` limitation in `call()` docstring. - Add `safari` entry to `_ACCENT_COLORS` in repl_skin.py (was falling back to default). - Add conflict-of-interest disclosure to HARNESS.md and SAFARI.md. - Strip promotional language, cost comparisons, and benchmark tables from HARNESS.md, SAFARI.md, SKILL.md, and README.md. Keep factual per-call overhead note; remove dollar-amount positioning. - Remove DOMShell comparison table from HARNESS.md. All 49 non-E2E tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。