@ownweb-me/dsh-web-fetch-tinyfish
v0.1.7
Published
pnpm: `@ownweb-me/dsh-web-fetch-tinyfish`
Downloads
1,306
Readme
dsh-web-fetch-tinyfish
pnpm: @ownweb-me/dsh-web-fetch-tinyfish
Registers the tinyfish fetch provider on the shared web capability seam
(ctx.web), backed by the TinyFish Fetch API (markdown extraction, per-URL
timeout, body cap). It declares no tools — the model-facing web_fetch
tool is owned by @deepseek-ai/dsh-tool-web and routes to whichever
provider the seam selects. The search and fetch registries are separate, so
it can be active alongside dsh-web-search-tinyfish.
Selection
dsh-base pins the built-in fetch backend (fetchProvider: http), and a
web row in a patch replaces the whole row config. Route web_fetch to
TinyFish with:
- id: web
config:
fetchProvider: tinyfishor
export DSH_WEB_FETCH_PROVIDER=tinyfishWithout a pin, exactly one usable provider must be registered for fetch
(auto-select); several usable providers without a pin fail with
WEB_PROVIDER_AMBIGUOUS. If you've disabled the built-in provider rows in
your profile layer (web-fetch-http), any fetch provider without a
registered/selected provider fails with WEB_PROVIDER_UNAVAILABLE.
Credentials
Resolved per call — the first source with a value wins:
| Priority | Source |
|---|---|
| 1 | tinyfishApiKey literal config field (this plugin) |
| 2 | TINYFISH_API_KEY in the launching environment |
| 3 | refs.TINYFISH_API_KEY in the dsh credential store (~/.dsh/.credentials.yaml) |
| 4 | TINYFISH_API_KEY in the project .env / ~/.dsh/.env |
The env-var name is renamable via tinyfishApiKeyEnv. The store file holds
refs under refs: keyed by environment-variable name:
# ~/.dsh/.credentials.yaml (must be owner-readable only: chmod 600)
version: 1
refs:
TINYFISH_API_KEY: sk-tinyfish-...The store watches the file, so edits (including rotations and removals)
take effect on the very next request — no restart, no config edit. A
provider with no resolvable key is unavailable, and a pinned selection then
fails with WEB_PROVIDER_CREDENTIAL_MISSING. Restate the entire config when
overriding (patches replace, they do not merge):
- id: dsh-web-fetch-tinyfish
config:
tinyfishApiKey: '...' # optional literal key; wins over the store
tinyfishApiKeyEnv: TINYFISH_API_KEY
fetchMaxChars: 100000 # default 100000
fetchTimeoutMs: 60000 # default 60000, clamped to 1..110000Run from source
The plugin resolves its @deepseek-ai/* imports from its own
node_modules, so install first:
pnpm install
pnpm dsh web --patch ./cordis.yml(The overlay uses an absolute path into this checkout; adjust if you move it. Note: the loader transpiles TS in strip-only mode — erasable syntax only, no parameter properties or enums.)
Install from npm
The package is published to the public npm registry, so no local registry
or .npmrc is needed — the default registry is npmjs:
dsh plugin --profile demo add @ownweb-me/[email protected]
dsh --profile demo --dump-config # shows the "# == dsh-web-*" layersName the version explicitly: pnpm ≥ 12 applies a 24-hour
minimumReleaseAge supply-chain policy that filters freshly published
versions out of bare-spec resolutions, so a bare add right after a
release silently installs the previous version.
Unlike add ., a registry install also installs the package's own
dependencies, and the tarball ships prebuilt JS (the prepare script runs
at publish time; main points at the emitted .js), so no build step
runs in the profile.
Install as a bundle
(Or install this local checkout as a bundle instead of the registry package:)
dsh plugin --profile demo add .
pnpm install # add . doesn't install the package's dependencies
dsh --profile demo --dump-config # shows the "# == dsh-web-*" layersFor git/path installs of this TypeScript package, pnpm runs the prepare
script (esbuild) on install; if pnpm blocks the build, allowlist it in the
profile's pnpm-workspace.yaml allowBuilds.
Either way, add the web row override to the profile's cordis.patch.yml
(see "Selection").
Errors
All failures are WebErrors with machine-routable codes:
WEB_PROVIDER_CREDENTIAL_MISSING (no key), WEB_PROVIDER_ERROR (provider
HTTP/transport failure; TinyFish per-URL errors include the error code and,
when present, the upstream HTTP status), WEB_ABORTED (cancellation).
Verification
TINYFISH_API_KEY=tf-fake pnpm dsh web --patch ./cordis.ymlExpect the [dsh-web-fetch-tinyfish] registration line; a real web_fetch
then reaches TinyFish (an invalid fake key → WEB_PROVIDER_ERROR wrapping
the upstream HTTP error).
