hermes-plugin-tinyfish 0.2.1__tar.gz → 0.3.0__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.
Files changed (59) hide show
  1. hermes_plugin_tinyfish-0.3.0/CHANGELOG.md +173 -0
  2. hermes_plugin_tinyfish-0.3.0/PKG-INFO +372 -0
  3. hermes_plugin_tinyfish-0.3.0/README.md +340 -0
  4. hermes_plugin_tinyfish-0.3.0/hermes_plugin_tinyfish/__init__.py +100 -0
  5. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/hermes_plugin_tinyfish/browser_provider.py +3 -3
  6. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/hermes_plugin_tinyfish/config.py +30 -18
  7. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/hermes_plugin_tinyfish/credit_policy.py +0 -13
  8. hermes_plugin_tinyfish-0.3.0/hermes_plugin_tinyfish/health.py +271 -0
  9. hermes_plugin_tinyfish-0.3.0/hermes_plugin_tinyfish/provider.py +414 -0
  10. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/hermes_plugin_tinyfish/rest_client.py +11 -132
  11. hermes_plugin_tinyfish-0.3.0/hermes_plugin_tinyfish/routing_context.py +75 -0
  12. hermes_plugin_tinyfish-0.3.0/hermes_plugin_tinyfish/setup_cli.py +725 -0
  13. hermes_plugin_tinyfish-0.3.0/hermes_plugin_tinyfish/update_check.py +290 -0
  14. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/plugin.yaml +2 -2
  15. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/pyproject.toml +10 -9
  16. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/tests/test_browser_provider.py +19 -0
  17. hermes_plugin_tinyfish-0.3.0/tests/test_credit_policy.py +154 -0
  18. hermes_plugin_tinyfish-0.3.0/tests/test_health.py +84 -0
  19. hermes_plugin_tinyfish-0.3.0/tests/test_provider.py +421 -0
  20. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/tests/test_register.py +28 -7
  21. hermes_plugin_tinyfish-0.3.0/tests/test_rest_client.py +316 -0
  22. hermes_plugin_tinyfish-0.3.0/tests/test_routing_context.py +136 -0
  23. hermes_plugin_tinyfish-0.3.0/tests/test_setup_cli.py +779 -0
  24. hermes_plugin_tinyfish-0.3.0/tests/test_update_check.py +336 -0
  25. hermes_plugin_tinyfish-0.3.0/tests/test_version.py +46 -0
  26. hermes_plugin_tinyfish-0.2.1/CHANGELOG.md +0 -89
  27. hermes_plugin_tinyfish-0.2.1/PKG-INFO +0 -263
  28. hermes_plugin_tinyfish-0.2.1/README.md +0 -232
  29. hermes_plugin_tinyfish-0.2.1/hermes_plugin_tinyfish/__init__.py +0 -57
  30. hermes_plugin_tinyfish-0.2.1/hermes_plugin_tinyfish/provider.py +0 -277
  31. hermes_plugin_tinyfish-0.2.1/hermes_plugin_tinyfish/setup_cli.py +0 -561
  32. hermes_plugin_tinyfish-0.2.1/hermes_plugin_tinyfish/tools.py +0 -158
  33. hermes_plugin_tinyfish-0.2.1/tests/test_credit_policy.py +0 -46
  34. hermes_plugin_tinyfish-0.2.1/tests/test_provider.py +0 -174
  35. hermes_plugin_tinyfish-0.2.1/tests/test_setup_cli.py +0 -50
  36. hermes_plugin_tinyfish-0.2.1/tests/test_tools.py +0 -14
  37. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/__init__.py +0 -0
  38. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -0
  39. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/generate_report.py +0 -0
  40. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/improve_description.py +0 -0
  41. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/package_skill.py +0 -0
  42. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/quick_validate.py +0 -0
  43. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/run_eval.py +0 -0
  44. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/run_loop.py +0 -0
  45. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.agents/skills/skill-creator/scripts/utils.py +0 -0
  46. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/.gitignore +0 -0
  47. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/CODE_OF_CONDUCT.md +0 -0
  48. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/CONTRIBUTING.md +0 -0
  49. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/LICENSE +0 -0
  50. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/SECURITY.md +0 -0
  51. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/__init__.py +0 -0
  52. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/hermes_plugin_tinyfish/normalize.py +0 -0
  53. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/scripts/prepare_release.py +0 -0
  54. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/scripts/validate_release.py +0 -0
  55. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/tests/conftest.py +0 -0
  56. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/tests/test_live.py +0 -0
  57. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/tests/test_normalize.py +0 -0
  58. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/tests/test_prepare_release.py +0 -0
  59. {hermes_plugin_tinyfish-0.2.1 → hermes_plugin_tinyfish-0.3.0}/tests/test_validate_release.py +0 -0
@@ -0,0 +1,173 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project uses semantic versioning.
7
+
8
+ ## Unreleased
9
+
10
+ ## [0.3.0] - 2026-08-04
11
+
12
+ ### Added
13
+
14
+ - Added marked, once-per-active-context guidance so Hermes can infer when
15
+ ordinary web requests should use generic provider tools and when
16
+ TinyFish-specific controls require native MCP Search or Fetch without
17
+ accumulating one new copy on every turn.
18
+ - Added nonblocking, source-aware update checks with a 24-hour profile-local
19
+ cache, one-time conversational notices, install-appropriate update guidance,
20
+ opt-outs, and non-networked diagnostics.
21
+
22
+ ### Changed
23
+
24
+ - Expanded diagnostics to schema version 3 with routing state, installed and
25
+ cached-latest versions, release channel, and update availability.
26
+ - Clarified that persistent Search/Fetch settings are REST fallback defaults,
27
+ not required parity configuration for plain-language requests.
28
+
29
+ ## [0.2.4] - 2026-07-22
30
+
31
+ ### Fixed
32
+
33
+ - Made the merge-to-release path fully automatic by explicitly running checks
34
+ for bot-created release PRs, merging them after validation, and dispatching
35
+ the PyPI-trusted Release workflow for tagging, GitHub Release creation, and
36
+ package publication.
37
+
38
+ ## [0.2.3] - 2026-07-22
39
+
40
+ ### Added
41
+
42
+ - Added conservative MCP OAuth failure classification, explicit reauthorization
43
+ guidance, transport-specific live diagnostics, `/tinyfish-status`, and
44
+ `hermes tinyfish reauth`.
45
+
46
+ ### Changed
47
+
48
+ - Corrected the development build dependency floor to the latest available
49
+ non-yanked release so clean CI environments can install the `dev` extra.
50
+ - Made MCP-to-REST degradation observable without logging raw OAuth responses,
51
+ and clarified that a cached token file does not prove credential validity.
52
+ - Serialized plugin-triggered lazy MCP discovery within each process and
53
+ limited live diagnostics to one discovery opportunity, reducing duplicate
54
+ connection and OAuth refresh attempts without taking ownership of tokens.
55
+ - Stopped treating a zero exit status from Hermes's MCP login command as proof
56
+ that browser reauthorization completed; MCP-only live diagnostics remain the
57
+ authoritative verification step.
58
+ - Replaced nested Hermes subprocesses during interactive MCP login with a
59
+ direct process handoff, preventing the plugin's parent process from competing
60
+ for the OAuth callback port. Reauthorization now warns about shared Hermes
61
+ homes and external gateway supervisors without attempting to manage them.
62
+ - Classified explicit OAuth failures nested inside task-group errors while
63
+ preserving generic HTTP 400 as unknown, and added safe guidance for visually
64
+ wrapped authorization URLs, single-flow callbacks, and unreliable login exit
65
+ status.
66
+
67
+ ## [0.2.2] - 2026-07-13
68
+
69
+ ### Added
70
+
71
+ - Added migration diagnostics for ignored `0.2.x` Agent, Profile setup, and
72
+ model-tool credit-policy keys.
73
+ - Added authoritative Search/Fetch live diagnostics, a Browser-only paid live
74
+ check, expanded compatibility CI, and structured issue forms.
75
+
76
+ ### Changed
77
+
78
+ - Refocused the plugin on TinyFish Search and Fetch plus optional TinyFish
79
+ Browser infrastructure controlled by Hermes.
80
+ - Simplified credit policy to Browser only, corrected usage reporting to use
81
+ TinyFish Fetch operation history, and aligned runtime version reporting with
82
+ installed package metadata.
83
+ - Promoted the package development classifier from Alpha to Beta for the
84
+ feature-complete core-only scope.
85
+ - Extended supported and tested Python versions through Python 3.13.
86
+
87
+ ### Removed
88
+
89
+ - Removed TinyFish Agent CLI commands, model-callable Agent tools, Browser
90
+ Context Profile commands, and their Agent/Profile REST and policy surfaces.
91
+ Existing remote TinyFish runs, profiles, credentials, and saved state are not
92
+ modified.
93
+
94
+ ## [0.2.1] - 2026-07-08
95
+
96
+ ### Changed
97
+
98
+ - Made the tag-based release workflow idempotent for existing GitHub Releases
99
+ and prevented duplicate/fallback tag runs from proceeding into PyPI publish.
100
+ - Added a manual PyPI release recovery path for cases where GitHub Release
101
+ creation succeeds but the PyPI publish job is cancelled before upload.
102
+
103
+ ## [0.2.0] - 2026-07-08
104
+
105
+ ### Added
106
+
107
+ - Added default-deny TinyFish credit policies for Agent, Browser, Browser
108
+ Context Profile setup, and model-callable TinyFish Agent tools.
109
+ - Added optional TinyFish Browser provider registration for Hermes browser
110
+ automation.
111
+ - Added TinyFish Agent CLI commands, Browser Context Profile CLI commands,
112
+ usage diagnostics, and `doctor --live-paid`.
113
+ - Added optional model-callable TinyFish Agent tools gated by credit policy.
114
+ - Added REST fallback support for TinyFish Search and Fetch options from
115
+ `tinyfish.search` and `tinyfish.fetch` config.
116
+ - Added a manual Prepare Release workflow that computes the next version,
117
+ promotes `Unreleased` changelog notes into a dated release section, updates
118
+ package metadata, and opens a release PR.
119
+ - Added an Auto Release workflow so feature PR merges automatically create a
120
+ release-prep PR and release-prep PR merges automatically create the release
121
+ tag.
122
+ - Enabled auto-merge for generated release-prep PRs so the post-feature-merge
123
+ release path can run without additional maintainer steps when repository
124
+ auto-merge is enabled.
125
+ - Added shared release validation and release-note extraction used by both
126
+ manual tag releases and automated post-merge releases.
127
+ - Added Python 3.10 compatibility guidance for coding agents and a CI
128
+ `compileall` check across package code, scripts, and tests.
129
+
130
+ ### Changed
131
+
132
+ - Updated README, reference docs, and operations docs to present this as an
133
+ independent unaffiliated community plugin.
134
+ - Clarified that free Search/Fetch assumptions are based on current TinyFish
135
+ documentation and may change.
136
+ - Expanded plugin metadata to advertise optional browser-provider support.
137
+ - Tightened release automation so GitHub Releases use only the matching
138
+ changelog version section and PyPI publishing has one gated workflow path.
139
+
140
+ ## [0.1.4] - 2026-07-07
141
+
142
+ ### Changed
143
+
144
+ - Updated README badges and installation notes after PyPI publication.
145
+
146
+ ## [0.1.3] - 2026-07-07
147
+
148
+ ### Changed
149
+
150
+ - Enabled PyPI publication through Trusted Publishing.
151
+
152
+ ## [0.1.2] - 2026-07-06
153
+
154
+ ### Changed
155
+
156
+ - Corrected public package author metadata to use the repository owner handle.
157
+
158
+ ## [0.1.1] - 2026-07-06
159
+
160
+ ### Changed
161
+
162
+ - Clarified that Hermes Git plugin installs clone the repository default branch.
163
+ - Added gated PyPI publishing directly to the tag-based release workflow for future releases.
164
+
165
+ ## [0.1.0] - 2026-07-06
166
+
167
+ ### Added
168
+
169
+ - Initial TinyFish Hermes web provider.
170
+ - OAuth MCP-first routing for search and fetch.
171
+ - REST API-key fallback for `TINYFISH_API_KEY`.
172
+ - `hermes tinyfish setup`, `doctor`, and `status` CLI commands.
173
+ - CI, release, dependency review, and PyPI publishing workflows.
@@ -0,0 +1,372 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-plugin-tinyfish
3
+ Version: 0.3.0
4
+ Summary: TinyFish Search, Fetch, plain-language routing, update awareness, and optional Browser for Hermes Agent
5
+ Project-URL: Homepage, https://github.com/gabeosx/hermes-plugin-tinyfish
6
+ Project-URL: Documentation, https://github.com/gabeosx/hermes-plugin-tinyfish#readme
7
+ Project-URL: Issues, https://github.com/gabeosx/hermes-plugin-tinyfish/issues
8
+ Project-URL: Changelog, https://github.com/gabeosx/hermes-plugin-tinyfish/blob/main/CHANGELOG.md
9
+ Author: gabeosx
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: browser,hermes-agent,mcp,tinyfish,web-extraction,web-search
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
22
+ Requires-Python: >=3.10
23
+ Requires-Dist: httpx>=0.28.1
24
+ Provides-Extra: dev
25
+ Requires-Dist: build>=1.5.0; extra == 'dev'
26
+ Requires-Dist: mypy>=2.2.0; extra == 'dev'
27
+ Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
28
+ Requires-Dist: pytest>=9.1.1; extra == 'dev'
29
+ Requires-Dist: ruff>=0.6; extra == 'dev'
30
+ Requires-Dist: tomli>=2.0; (python_version < '3.11') and extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Hermes TinyFish Plugin
34
+
35
+ [![CI](https://github.com/gabeosx/hermes-plugin-tinyfish/actions/workflows/ci.yml/badge.svg)](https://github.com/gabeosx/hermes-plugin-tinyfish/actions/workflows/ci.yml)
36
+ [![PyPI](https://img.shields.io/pypi/v/hermes-plugin-tinyfish.svg)](https://pypi.org/project/hermes-plugin-tinyfish/)
37
+ [![Python](https://img.shields.io/pypi/pyversions/hermes-plugin-tinyfish.svg)](https://pypi.org/project/hermes-plugin-tinyfish/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
39
+ [![Security Policy](https://img.shields.io/badge/Security-policy-green.svg)](SECURITY.md)
40
+
41
+ TinyFish Search and Fetch providers with plain-language tool routing, update
42
+ awareness, and optional TinyFish Browser infrastructure for
43
+ [Hermes Agent](https://hermes-agent.nousresearch.com/docs/).
44
+
45
+ Hermes remains the agent: it plans, chooses tools, and controls browser
46
+ interaction. This plugin supplies web data and, when explicitly enabled, a
47
+ remote browser session underneath Hermes's own browser loop.
48
+
49
+ This is an independent community plugin. It is not affiliated with, endorsed
50
+ by, or maintained by TinyFish or Hermes / Nous Research.
51
+
52
+ TinyFish documentation currently describes Search and Fetch as free and
53
+ Browser as credit-consuming. This plugin treats Search and Fetch as the safe
54
+ default entry point. Pricing and free-use assumptions are based only on current
55
+ TinyFish documentation and may change; Browser defaults to `deny`.
56
+
57
+ ## Install
58
+
59
+ Hermes Git plugin install:
60
+
61
+ ```bash
62
+ hermes plugins install gabeosx/hermes-plugin-tinyfish --enable
63
+ hermes tinyfish setup
64
+ ```
65
+
66
+ Python package install:
67
+
68
+ ```bash
69
+ pip install hermes-plugin-tinyfish
70
+ hermes tinyfish setup
71
+ ```
72
+
73
+ ## Update
74
+
75
+ Update an existing Hermes Git plugin installation:
76
+
77
+ ```bash
78
+ hermes plugins update web-tinyfish
79
+ hermes tinyfish status
80
+ hermes tinyfish doctor
81
+ ```
82
+
83
+ If the plugin was installed as a Python package instead, update it with:
84
+
85
+ ```bash
86
+ python -m pip install --upgrade hermes-plugin-tinyfish
87
+ hermes tinyfish status
88
+ hermes tinyfish doctor
89
+ ```
90
+
91
+ The plugin also performs a nonblocking update check when it loads. Git installs
92
+ are compared with the latest stable GitHub Release; Python package installs are
93
+ compared with the latest stable PyPI version. Results are cached for 24 hours
94
+ at `$HERMES_HOME/cache/web-tinyfish-update.json` in the active profile. If an
95
+ update is available, Hermes mentions it once on the first conversational turn
96
+ where the cached or background result is available. The plugin never installs
97
+ the update itself.
98
+
99
+ The check sends only the installed plugin version in its HTTP User-Agent. It
100
+ does not send Hermes configuration, TinyFish credentials, searches, fetched
101
+ URLs, or conversation content. Network and cache failures are silent. Disable
102
+ the check with `tinyfish.update_check: false` or the conventional
103
+ `NO_UPDATE_NOTIFIER=1` environment variable.
104
+
105
+ ## Safe Default Setup
106
+
107
+ `hermes tinyfish setup` configures TinyFish for Hermes `web_search` and
108
+ `web_extract` only:
109
+
110
+ ```yaml
111
+ mcp_servers:
112
+ tinyfish:
113
+ url: https://agent.tinyfish.ai/mcp
114
+ auth: oauth
115
+ tools:
116
+ include: [search, fetch_content]
117
+ resources: false
118
+ prompts: false
119
+
120
+ web:
121
+ search_backend: tinyfish
122
+ extract_backend: tinyfish
123
+
124
+ tinyfish:
125
+ routing_context: true
126
+ update_check: true
127
+ credit_policy:
128
+ browser: deny
129
+ ```
130
+
131
+ The plugin prefers TinyFish's hosted OAuth MCP server and falls back to REST
132
+ with `TINYFISH_API_KEY` when MCP OAuth is unavailable. It may save
133
+ `TINYFISH_API_KEY` to `~/.hermes/.env` if you choose API-key fallback.
134
+
135
+ Verify Search and Fetch:
136
+
137
+ ```bash
138
+ hermes tinyfish doctor
139
+ hermes tinyfish doctor --live
140
+ hermes tinyfish doctor --live --transport mcp
141
+ hermes tinyfish doctor --live --transport rest
142
+ ```
143
+
144
+ `doctor --live` runs independent Search and Fetch checks and exits nonzero if
145
+ either fails. The default `auto` transport remains MCP-first and may use the
146
+ REST fallback. Use `--transport mcp` to test OAuth without allowing REST to
147
+ hide an MCP failure, or `--transport rest` to test only the API-key path.
148
+
149
+ If MCP reports that authorization must be renewed:
150
+
151
+ ```bash
152
+ hermes tinyfish reauth
153
+ ```
154
+
155
+ The command replaces the current plugin CLI process with Hermes's supported
156
+ `hermes mcp login tinyfish` command; it does not start a nested Hermes process.
157
+ If a gateway or another Hermes process shares the same Hermes home, pause that
158
+ process and any supervisor or watchdog for the maintenance window. The plugin
159
+ does not stop host services automatically.
160
+
161
+ Complete the browser flow, restore and reload or restart affected Hermes
162
+ processes, then verify the recovered OAuth path with
163
+ `hermes tinyfish doctor --live --transport mcp`. The plugin never deletes,
164
+ rewrites, or validates Hermes's OAuth token files itself.
165
+
166
+ For browser authorization from a headless or remote terminal:
167
+
168
+ - Complete one authorization flow at a time and never combine an authorization
169
+ URL with a callback URL from another attempt.
170
+ - Terminal wrapping is visual. Copy the entire URL and do not manually edit
171
+ OAuth characters such as `state` or the PKCE challenge.
172
+ - If copied terminal text contains line breaks, remove only whitespace. In a
173
+ local Blink shell on iOS/iPadOS, for example:
174
+
175
+ ```bash
176
+ pbpaste | tr -d '\r\n\t ' | pbcopy
177
+ ```
178
+
179
+ - If Hermes prints another authorization URL before reporting success, stop
180
+ that attempt rather than authorizing multiple URLs.
181
+ - Treat the MCP-only doctor as authoritative. Some Hermes versions can print
182
+ an authentication failure while still returning shell status 0.
183
+
184
+ ## Automatic Tool Routing
185
+
186
+ Talk to Hermes normally; you do not need to choose “the plugin” or “MCP.” When
187
+ an active context does not already contain the current routing version, the
188
+ plugin adds a short routing note that helps Hermes choose the narrowest tool
189
+ surface:
190
+
191
+ - “Find recent TinyFish documentation” uses Hermes `web_search`.
192
+ - “Read this page and summarize it” uses Hermes `web_extract`.
193
+ - “Search only these domains, in English, after this date, and return page 2”
194
+ uses TinyFish MCP's native `search` tool because the generic search schema
195
+ cannot express all of those controls.
196
+ - “Fetch these URLs using this selector, include image links, and use this
197
+ cache TTL” uses TinyFish MCP's native `fetch_content` tool.
198
+
199
+ Hermes keeps the visible stored user message clean but persists the exact
200
+ API-bound message in an `api_content` sidecar for prompt-cache replay. The note
201
+ contains a versioned marker, so the hook does not add another copy while that
202
+ version remains in the active context. If compression removes the marked
203
+ message, the hook adds one fresh copy. Multiple tool calls inside a turn do not
204
+ run the hook again. Hermes still sees the real tool schemas and makes the final
205
+ choice; the plugin does not keyword-match the prompt or force a tool.
206
+
207
+ Routing guidance defaults on only when the plugin-managed TinyFish MCP server
208
+ is configured. Set `tinyfish.routing_context: false` to disable the guidance
209
+ without disabling the provider. This prevents new injections; a copy already
210
+ present in the active API context may remain until that context is reset or
211
+ compressed.
212
+
213
+ ## Search and Fetch Options
214
+
215
+ Optional REST fallback defaults can be configured in `config.yaml`:
216
+
217
+ ```yaml
218
+ tinyfish:
219
+ search:
220
+ location: US
221
+ language: en
222
+ recency_minutes: 1440
223
+ domain_type: web
224
+ page: 0
225
+ fetch:
226
+ format: markdown
227
+ links: false
228
+ image_links: false
229
+ ttl: 3600
230
+ ```
231
+
232
+ MCP remains the preferred path when configured. These options apply only to
233
+ REST fallback calls. They are fixed fallback defaults, not required settings
234
+ for ordinary requests and not a substitute for plain-language, per-request MCP
235
+ controls. The plugin does not add persistent include-domain, exclude-selector,
236
+ or similar parity settings.
237
+
238
+ ## Optional Browser Provider
239
+
240
+ TinyFish Browser can supply remote browser infrastructure for Hermes after
241
+ explicit opt-in:
242
+
243
+ ```yaml
244
+ browser:
245
+ cloud_provider: tinyfish
246
+ tinyfish:
247
+ credit_policy:
248
+ browser: request
249
+ ```
250
+
251
+ Browser policy values are:
252
+
253
+ - `deny`: fail closed; this is the default.
254
+ - `request`: use Hermes's approval flow for each `browser_*` tool invocation.
255
+ - `allow`: run Browser tools without per-invocation approval.
256
+
257
+ Manage the policy with:
258
+
259
+ ```bash
260
+ hermes tinyfish credits status
261
+ hermes tinyfish credits set browser request
262
+ hermes tinyfish credits reset
263
+ ```
264
+
265
+ `credits reset` restores `browser: deny` and removes retired Agent/Profile
266
+ policy keys left by plugin `0.2.x`.
267
+
268
+ ## Why TinyFish Agent Is Not Included
269
+
270
+ TinyFish Agent performs delegated goal-based web automation. Hermes already
271
+ owns planning and browser interaction, so exposing a second agent loop through
272
+ this provider is duplicative and makes control, approval, and billing less
273
+ clear. The plugin therefore does not register TinyFish Agent tools or manage
274
+ Browser Context Profiles.
275
+
276
+ Users who specifically need TinyFish's delegated Agent, Profile, Vault, batch,
277
+ or streaming capabilities can configure TinyFish's full MCP service
278
+ independently in Hermes. Those tools are outside this plugin's setup, policy,
279
+ diagnostics, and compatibility guarantees. The plugin-managed `tinyfish` MCP
280
+ entry intentionally remains restricted to `search` and `fetch_content`.
281
+
282
+ ## Diagnostics and Migration
283
+
284
+ ```bash
285
+ hermes tinyfish status
286
+ hermes tinyfish usage
287
+ hermes tinyfish doctor --live
288
+ hermes tinyfish doctor --live --transport mcp
289
+ hermes tinyfish doctor --live-paid
290
+ ```
291
+
292
+ - `status` is non-secret and reports ignored `0.2.x` policy keys under
293
+ `retired_credit_policy_keys`.
294
+ - Status also reports whether routing and update checks are enabled, whether
295
+ routing is active, the installed version, the cached latest version, and
296
+ cached update availability. Reading status never performs an update request.
297
+ - `mcp_token_cached` reports only whether Hermes's expected cache file is
298
+ present. It does not mean the access or refresh token is valid.
299
+ - `/tinyfish-status` shows non-networked status inside CLI or gateway sessions;
300
+ `/tinyfish-status live` explicitly runs Search and Fetch checks.
301
+ - `usage` reads TinyFish Fetch operation history; it is not Agent or Browser
302
+ billing data.
303
+ - `doctor --live-paid` only creates and closes a TinyFish Browser session. It
304
+ refuses under `deny`, requests approval under `request`, and never prints
305
+ connection URLs or credentials.
306
+ - The former `agent` and `profiles` commands and model-callable Agent tools are
307
+ intentionally removed. Existing remote TinyFish runs, profiles, credentials,
308
+ and saved state are not changed.
309
+
310
+ ## Upgrade Safety
311
+
312
+ This plugin uses public Hermes extension points:
313
+
314
+ - `ctx.register_web_search_provider(...)`
315
+ - `ctx.register_browser_provider(...)`
316
+ - `ctx.register_hook("pre_tool_call", ...)` for Browser credit policy
317
+ - `ctx.register_hook("pre_llm_call", ...)` for context-aware tool routing and
318
+ update notices
319
+ - `ctx.register_cli_command(...)`
320
+ - `ctx.register_command(...)` for `/tinyfish-status`
321
+ - `ctx.dispatch_tool(...)` for registered TinyFish MCP calls
322
+ - Hermes MCP configuration under `mcp_servers`
323
+ - Hermes environment helpers for optional API-key fallback
324
+
325
+ It does not patch Hermes Agent, update scripts, Dockerfiles, or files inside a
326
+ Hermes installation or source checkout. A narrow legacy compatibility shim
327
+ still asks Hermes to discover configured MCP servers when TinyFish tools have
328
+ not been registered in the current process. It is retained because removing it
329
+ reintroduces a previously observed MCP-to-REST regression; it will be removed
330
+ only after every supported Hermes surface owns discovery through a public API.
331
+
332
+ ## Development
333
+
334
+ ```bash
335
+ python -m venv .venv
336
+ source .venv/bin/activate
337
+ python -m pip install -U pip
338
+ python -m pip install -e ".[dev]"
339
+ ruff format .
340
+ ruff check .
341
+ mypy hermes_plugin_tinyfish
342
+ pytest --cov=hermes_plugin_tinyfish --cov-fail-under=70
343
+ python -m build
344
+ ```
345
+
346
+ Live tests are opt-in:
347
+
348
+ ```bash
349
+ TINYFISH_LIVE_TESTS=1 TINYFISH_API_KEY=... pytest tests/test_live.py
350
+ ```
351
+
352
+ ## Maintainer Docs
353
+
354
+ - [Release operations](docs/operations/release.md)
355
+ - [Compatibility testing](docs/operations/compatibility-testing.md)
356
+ - [OAuth hardening compatibility report](docs/operations/oauth-hardening-compatibility-report.md)
357
+ - [User install smoke test](docs/operations/user-install-smoke-test.md)
358
+ - [Hermes extension points](docs/reference/hermes-extension-points.md)
359
+ - [TinyFish integration notes](docs/reference/tinyfish-integration.md)
360
+ - [Roadmap and non-goals](docs/roadmap.md)
361
+
362
+ ## References
363
+
364
+ - [TinyFish MCP Integration](https://docs.tinyfish.ai/mcp-integration)
365
+ - [TinyFish Authentication](https://docs.tinyfish.ai/authentication)
366
+ - [TinyFish Search API](https://docs.tinyfish.ai/search-api)
367
+ - [TinyFish Fetch API](https://docs.tinyfish.ai/fetch-api)
368
+ - [TinyFish Browser API](https://docs.tinyfish.ai/browser-api)
369
+ - [Hermes Web Search Provider Plugins](https://hermes-agent.nousresearch.com/docs/developer-guide/web-search-provider-plugin)
370
+ - [Hermes Browser Provider Plugins](https://hermes-agent.nousresearch.com/docs/developer-guide/browser-provider-plugin)
371
+ - [Hermes Plugins](https://hermes-agent.nousresearch.com/docs/user-guide/features/plugins)
372
+ - [Hermes MCP](https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp)