dsh-tinyfish 0.2.0 → 0.3.0

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # dsh-tinyfish
2
2
 
3
+ <img src="assets/tinyfish.svg" alt="TinyFish logo" width="96" />
4
+
3
5
  [![npm](https://img.shields.io/npm/v/dsh-tinyfish.svg)](https://www.npmjs.com/package/dsh-tinyfish) [![downloads](https://img.shields.io/npm/dm/dsh-tinyfish.svg)](https://www.npmjs.com/package/dsh-tinyfish) [![ci](https://github.com/viztor/dsh-tinyfish/actions/workflows/ci.yml/badge.svg)](https://github.com/viztor/dsh-tinyfish/actions/workflows/ci.yml) [![license](https://img.shields.io/npm/l/dsh-tinyfish.svg)](https://github.com/viztor/dsh-tinyfish/blob/main/LICENSE) [![node](https://img.shields.io/badge/node-%3E%3D22.14-5FA04E.svg)](https://nodejs.org)
4
6
 
5
7
  **Search and fetch for the DeepSeek Harness, at $0.**
@@ -18,8 +20,12 @@ A DSH bundle that makes [TinyFish](https://tinyfish.ai) the implementation of th
18
20
  ```sh
19
21
  cd ~/.dsh/profiles/web
20
22
  npm install dsh-tinyfish
23
+ # or, identically:
24
+ npm install @viztor/dsh-tinyfish
21
25
  ```
22
26
 
27
+ Both names ship the same content from the same release; `dsh-tinyfish` is the name DSH resolves and the docs use.
28
+
23
29
  Add the bundle to that profile's `package.json`, then restart DSH:
24
30
 
25
31
  ```jsonc
@@ -0,0 +1,18 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="TinyFish logo">
2
+ <title>TinyFish</title>
3
+ <defs>
4
+ <linearGradient id="tf-fish" x1="12" y1="20" x2="52" y2="44" gradientUnits="userSpaceOnUse">
5
+ <stop offset="0" stop-color="#4D6BFE"/>
6
+ <stop offset="1" stop-color="#14B8A6"/>
7
+ </linearGradient>
8
+ </defs>
9
+ <!--
10
+ The DeepSeek Harness icon family: a softly tinted rounded square carrying
11
+ one vibrant glyph. Pale blue container, DeepSeek-blue-to-teal fish, white
12
+ knockout eye. Fill only, so it stays crisp at any size.
13
+ -->
14
+ <rect x="2" y="2" width="60" height="60" rx="15" fill="#E8F1FE"/>
15
+ <ellipse cx="27" cy="33" rx="15" ry="11" fill="url(#tf-fish)"/>
16
+ <polygon points="39,33 53,23 53,43" fill="url(#tf-fish)"/>
17
+ <circle cx="21" cy="30.5" r="2.4" fill="#ffffff"/>
18
+ </svg>
package/lib/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
2
2
  import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
3
3
  import z from "@deepseek-ai/schemastery";
4
+ import { createHash } from "node:crypto";
4
5
  import { readFileSync } from "node:fs";
5
6
  import { homedir } from "node:os";
6
7
  import { join } from "node:path";
@@ -235,7 +236,10 @@ async function call(url, options) {
235
236
  if (isAbortError(error)) throw aborted(signal, error);
236
237
  throw new WebError(`TinyFish request to ${url} failed: ${String(error)}`, WEB_PROVIDER_ERROR, { cause: error });
237
238
  }
238
- if (response.status === 401 || response.status === 403) throw new WebError(`TinyFish rejected the ${channel} API key (HTTP ${response.status}). Refresh it, or switch the provider's channel.`, WEB_PROVIDER_ERROR);
239
+ if (response.status === 401 || response.status === 403) {
240
+ const fingerprint = createHash("sha256").update(key, "utf8").digest("hex").slice(0, 12);
241
+ throw new WebError(`TinyFish rejected the ${channel} API key (HTTP ${response.status}, key sha256:${fingerprint}). Refresh it, or switch the provider's channel.`, WEB_PROVIDER_ERROR);
242
+ }
239
243
  if (response.status === 429) throw new TransientWebError("TinyFish rate limit reached (HTTP 429).", WEB_PROVIDER_ERROR);
240
244
  if (!response.ok) throw new WebError(`TinyFish returned HTTP ${response.status} for ${url}`, WEB_PROVIDER_ERROR);
241
245
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tinyfish",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "TinyFish-backed search and fetch providers for the DeepSeek Harness web capability seam (ctx.web) — $0 SERP and page extraction, direct or via Monid.",
5
5
  "keywords": [
6
6
  "cordis",
@@ -26,7 +26,8 @@
26
26
  "lib/client.js",
27
27
  "cordis.patch.yml",
28
28
  "README.md",
29
- "LICENSE"
29
+ "LICENSE",
30
+ "assets/tinyfish.svg"
30
31
  ],
31
32
  "type": "module",
32
33
  "main": "lib/index.mjs",
@@ -44,9 +45,9 @@
44
45
  }
45
46
  },
46
47
  "scripts": {
47
- "build": "vp pack && node scripts/name-client-bundle.mjs",
48
+ "build": "vp pack && node scripts/name-client-bundle.ts",
48
49
  "check": "vp check",
49
- "ci": "vp check && vp test && node scripts/check.mjs",
50
+ "ci": "vp check && vp test && node scripts/check.ts",
50
51
  "clean": "rm -rf lib",
51
52
  "format": "vp fmt --check",
52
53
  "format:fix": "vp fmt --write",
@@ -74,7 +75,8 @@
74
75
  "react": "^18.3.1",
75
76
  "typescript": "^7.0.2",
76
77
  "ultracite": "^7.12.1",
77
- "vite-plus": "catalog:"
78
+ "vite-plus": "catalog:",
79
+ "vitest": "5.0.1"
78
80
  },
79
81
  "peerDependencies": {
80
82
  "@deepseek-ai/cordis": "~4.0.4",