pi-tinyfish-tools0.2.4
TinyFish Web Agent tools for pi — search, fetch, and goal-driven browser automation
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-tinyfish
English · 简体中文
TinyFish Web Agent tools for pi — search, fetch, and goal-driven browser automation.
Developed and verified against Pi 1.8.0; the host Pi range is declared in peerDependencies.
Tools
| Tool | API | Description |
|---|---|---|
tinyfish_search |
Search API | Web search with ranked results, snippets, and URLs |
tinyfish_fetch |
Fetch API | Render URLs and extract clean content (markdown/html/json) |
tinyfish_agent_run |
Agent API (SSE) | Goal-driven browser automation with real-time progress |
tinyfish_run_get |
Runs API | Query a specific automation run's status and result |
tinyfish_run_list |
Runs API | List/search historical automation runs |
tinyfish_run_cancel |
Runs API | Cancel an in-progress run |
Setup
- Install:
pi install npm:pi-tinyfish-tools
# or local:
pi install ./pi-tinyfish
- Configure your TinyFish API key (get one from agent.tinyfish.ai/api-keys):
/tinyfish-login
- Check status:
/tinyfish-status
Configuration
API key and defaults are stored in ~/.pi/agent/pi-tinyfish.json (permissions 0600). No global environment variable required.
{
"apiKey": "tf_xxx",
"defaultLocation": "US",
"defaultLanguage": "en",
"defaultFetchFormat": "markdown",
"defaultBrowserProfile": "lite"
}
Fallback: TINYFISH_API_KEY env var for CI / debugging.
Commands
| Command | Description |
|---|---|
/tinyfish-login |
Enter your TinyFish API key interactively |
/tinyfish-status |
Show configuration status (key never exposed) |
/tinyfish-logout |
Remove stored API key |
Development, tests, and public contracts
The contributor rules, documentation index, and tests below are available in a source checkout.
npm install # peer deps
npm test # vitest
pi -e . # load extension for testing
- Development and contribution rules:
AGENTS.mdanddoc/README.md. - Tests:
tests/README.md— configuration, TinyFish API client, output formatting, and tool-result projection; runnpm test. - Public tool contract: the field-level three-layer result contract and per-tool summary strings are in
src/tools/README.md; registered tool implementations live insrc/tools/and the extension entry inindex.ts.
Tool Result UI
Tool results follow a three-layer information model so the LLM gets the full picture while the user only sees what they need on screen:
content— full output, enters the next conversation turn, never silently truncated.details— compact structured summary (status, count, urls), used byrenderResultand persisted in session state.renderResult— visual view for humans: one-line summary by default, pressCtrl+O(app.tools.expand) to expand the full markdown.
This applies to all six tools. The field-level contract and per-tool summary strings live in src/tools/README.md.
Directory layout
index.ts # Standard package entry — re-exports src/index.ts
src/ # Extension implementation
index.ts # registers tools and /commands
api.ts # TinyFish REST/SSE client
config.ts # ~/.pi/agent/pi-tinyfish.json read/write
format.ts # Output text formatters
render.ts # Shared renderResult helpers
tools/ # One file per registered tool
skills/
tinyfish/
SKILL.md # Agent-facing usage guide
Per-file roles and implementation conventions are documented in src/README.md.
Documentation
doc/README.md is the navigation entry for the repository's documents — current mechanism, ADRs (doc/决策档案/), and evidence/history (doc/references/).
Design notes
- All six tools are synchronous —
execute()awaits the full response. No background runs, nopi.sendMessageinjection. The LLM sees results in the natural tool-call return. detailsis the source of truth for collapsible summaries;contentis the source of truth for LLM context. They are intentionally not derived from each other.truncateOutput(format.ts) only trimscontentwhen the caller passesmaxBytes; it never silently strips data the LLM needs.