tomoshi 1.0.0 → 1.1.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,13 +1,57 @@
1
- # tomoshi (灯 — lamp light)
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/Michael-Obele/tomoshibi/main/banner.svg" alt="Tomoshibi — lamp light banner with paper lantern" width="100%" />
3
+ </p>
2
4
 
3
- Self-hosted web search & scraping MCP for AI agents. One binary, $5/mo.
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/tomoshi"><img src="https://img.shields.io/npm/v/tomoshi?label=tomoshi&color=cb0000" alt="npm version"/></a>
7
+ <a href="https://www.npmjs.com/package/tomoshi"><img src="https://img.shields.io/npm/dm/tomoshi" alt="npm downloads"/></a>
8
+ <a href="https://github.com/Michael-Obele/tomoshibi/actions/workflows/npm.yml"><img src="https://github.com/Michael-Obele/tomoshibi/actions/workflows/npm.yml/badge.svg" alt="npm provenance"/></a>
9
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT"/></a>
10
+ <a href="https://github.com/Michael-Obele/tomoshibi"><img src="https://img.shields.io/github/stars/Michael-Obele/tomoshibi?style=social" alt="GitHub stars"/></a>
11
+ </p>
4
12
 
5
- - **npm:** `tomoshi` (primary) + `tomoshibi` alias
6
- - **MCP:** 3 tools — `cinder_extract`, `cinder_discover`, `cinder_monitor`
13
+ <h1 align="center">tomoshi <span style="font-weight:400">灯</span></h1>
7
14
 
8
- ## Install
15
+ <p align="center"><em>lamp light — the MCP that turns any site into LLM-ready markdown</em><br/>Self-hosted Firecrawl alternative. <strong>3 tools, not 17.</strong> One binary, $5/mo. Sigstore provenance.</p>
9
16
 
10
- ```json
17
+ <p align="center">
18
+ <a href="#install-30-seconds">Install</a> ·
19
+ <a href="#why-tomoshi">Why tomoshi</a> ·
20
+ <a href="#tools">Tools</a> ·
21
+ <a href="#hosting">Hosting</a>
22
+ </p>
23
+
24
+ ---
25
+
26
+ ## Why tomoshi?
27
+
28
+ If you're paying Firecrawl/Exa per token or spawning a browser per request, you're overpaying.
29
+
30
+ | What hurts with hosted APIs | What tomoshi gives you | Outcome |
31
+ |---|---|---|
32
+ | **$0.01–0.10 per scrape** + rate limits | **$0 self-hosted** — one binary, hobby-tier RAM | Ship RAG without a cloud bill |
33
+ | **500ms Chrome spawn per request** | **One shared allocator + recycled tabs** | ~200ms static, parallel pools |
34
+ | **JS SPAs return empty HTML** | **Smart mode** — static first, fallback to Chromedp | Works on React/Vue without guessing |
35
+ | **Noisy HTML (nav/ads/footer)** | **Readability main-content** + ad block | Clean markdown your LLM wants |
36
+
37
+ Part of [**Tomoshibi 灯火**](https://github.com/Michael-Obele/tomoshibi) — Go API + Svelte 5 playground + this MCP. Formerly Cinder.
38
+
39
+ ---
40
+
41
+ ## Install (30 seconds)
42
+
43
+ **Prerequisites:** A running Tomoshibi API. Host it in one command:
44
+
45
+ ```bash
46
+ git clone https://github.com/Michael-Obele/tomoshibi.git && cd tomoshibi
47
+ docker compose up -d # api 7431 + redis 7434 + searxng 7435
48
+ # or: fly deploy (see tomoshibi README)
49
+ ```
50
+
51
+ Then add the MCP:
52
+
53
+ ```jsonc
54
+ // .vscode/mcp.json or Claude config
11
55
  {
12
56
  "mcpServers": {
13
57
  "tomoshi": {
@@ -21,8 +65,54 @@ Self-hosted web search & scraping MCP for AI agents. One binary, $5/mo.
21
65
  }
22
66
  ```
23
67
 
24
- Legacy `CINDER_API_URL` still works.
68
+ Legacy `CINDER_API_URL` still works. Aliases: `tomoshibi`, `tomoshibi-mcp` (same package).
69
+
70
+ Restart your editor — `tomoshi` appears as 3 tools.
71
+
72
+ ---
73
+
74
+ ## Tools
75
+
76
+ 3 tools, not 8 — resource-oriented (`action` enum, ≤7 philosophy).
77
+
78
+ | Tool | `action` | What it does |
79
+ |---|---|---|
80
+ | `tomoshi_extract` | `scrape` · `scrape_multi` (≤10) · `links` · `batch` · `batch_status` | Single/multi-page → markdown, link extraction, async batch (Redis) |
81
+ | `tomoshi_discover` | `search` · `map` · `crawl` · `crawl_status` | SearXNG search (Brave fallback), sitemap, async BFS crawl |
82
+ | `tomoshi_monitor` | `create` · `status` · `delete` | Hash markdown, webhook on change |
83
+
84
+ Async actions (`batch`, `crawl`, `monitor`) are Redis-backed — poll `*_status` until done.
85
+
86
+ **Example — scrape + search in one turn:**
87
+
88
+ > `tomoshi_discover` `search` "svelte 5 runes" → `tomoshi_extract` `scrape_multi` on top 3 URLs → LLM-ready markdown
89
+
90
+ ---
91
+
92
+ ## Hosting
93
+
94
+ | Option | Command | Cost |
95
+ |---|---|---|
96
+ | **Docker Compose** | `docker compose up -d` | $0 (your machine) |
97
+ | **Fly.io** | `fly deploy` | ~$5/mo (512 MB) |
98
+ | **From source** | `go run ./packages/api/cmd/api` | $0 + Chromium |
99
+
100
+ API base: `http://localhost:7431` — all endpoints under `/v1` (`/scrape`, `/search`, `/crawl`, `/batch`, `/monitor`, `/map`).
101
+
102
+ ---
103
+
104
+ ## Links
105
+
106
+ - **GitHub:** https://github.com/Michael-Obele/tomoshibi
107
+ - **npm:** https://www.npmjs.com/package/tomoshi
108
+ - **API docs:** `https://your-api.fly.dev/docs` (Swagger, auto-generated)
109
+
110
+ ---
111
+
112
+ ## Name
113
+
114
+ **tomoshi** (灯 — ともし) — Japanese for *lamp, light*. Short form of **Tomoshibi** (灯火 — ともしび) *lamp light*, the glow of a paper lantern. Search as illumination: lighting up the web for AI agents.
25
115
 
26
- ## Provenance
116
+ ## License
27
117
 
28
- Published with npm Provenance (OIDC). Verify at https://www.npmjs.com/package/tomoshi
118
+ MIT see [LICENSE](https://github.com/Michael-Obele/tomoshibi/blob/main/LICENSE).
package/dist/server.js CHANGED
@@ -60,7 +60,7 @@ export function createServer() {
60
60
  // Resource: discovery — 1 tool per domain resource with `action` enum
61
61
  // Consolidates former cinder_search + cinder_map + cinder_crawl (3→1, crawl already merged start/status)
62
62
  server.tool({
63
- name: "cinder_discover",
63
+ name: "tomoshi_discover",
64
64
  description: "Discovery resource (4 actions): `search` (SearXNG/Brave, domain filters/pagination), `map` (sitemap/traversal), `crawl` (enqueue BFS async, Redis), `crawl_status` (poll crawl). Replaces cinder_search/cinder_map/cinder_crawl.",
65
65
  schema: DiscoverSchema,
66
66
  annotations: {
@@ -72,7 +72,7 @@ export function createServer() {
72
72
  }, createDiscoverHandler(client));
73
73
  // Resource: change-tracking — already action-multiplexed (create|status|delete)
74
74
  server.tool({
75
- name: "cinder_monitor",
75
+ name: "tomoshi_monitor",
76
76
  description: "Change-tracking resource (3 actions): `create` (hashes markdown, fires signed webhook on change), `status` (config/last hash/next check), `delete` (stop & remove). Requires Redis.",
77
77
  schema: MonitorSchema,
78
78
  annotations: {
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,mBAAoB,SAAQ,wBAAwB;IACxD,KAAK,CAAC,YAAY,CAAC,MAAW;QAC5B,MAAM,CAAC,GAAQ,MAAM,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;YAAE,CAAC,CAAC,IAAI,GAAG,QAAQ,CAAC;QACvD,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AACD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,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AiB;QACvB,WAAW,EACT,qLAAqL;QACvL,MAAM,EAAE,aAAa;QACrB,WAAW,EAAE;YACX,YAAY,EAAE,KAAK;YACnB,aAAa,EAAE,IAAI;YACnB,cAAc,EAAE,KAAK;YACrB,eAAe,EAAE,KAAK;SACvB;KACF,EACD,oBAAoB,CAAC,MAAM,CAAQ,CACpC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -2,7 +2,7 @@ import * as v from "valibot";
2
2
  /**
3
3
  * Resource-oriented multiplexed discovery tool.
4
4
  * Consolidates `cinder_search` + `cinder_map` + `cinder_crawl`
5
- * into a single `cinder_discover` resource (3→1).
5
+ * into a single `tomoshi_discover` resource (3→1).
6
6
  *
7
7
  * Principle: 1 tool per domain resource with `action` enum
8
8
  * (arch.md "Why 7 Tools Instead of 17" — FlarelyLegal 17→7).
@@ -2,7 +2,7 @@ import * as v from "valibot";
2
2
  /**
3
3
  * Resource-oriented multiplexed extraction tool.
4
4
  * Consolidates `cinder_scrape` + `cinder_links` + `cinder_batch_scrape`
5
- * into a single `cinder_extract` resource (5→1 with scrape_multi).
5
+ * into a single `tomoshi_extract` resource (5→1 with scrape_multi).
6
6
  *
7
7
  * Principle: 1 tool per domain resource with `action` enum
8
8
  * (arch.md "Why 7 Tools Instead of 17" — FlarelyLegal 17→7).
@@ -1,6 +1,6 @@
1
1
  import * as v from "valibot";
2
2
  /**
3
- * Schema for the cinder_monitor tool.
3
+ * Schema for the tomoshi_monitor tool.
4
4
  * A single tool that creates, checks, or deletes a change-tracking monitor,
5
5
  * selected by the `action` discriminator (mirrors handlers.MonitorRequest).
6
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tomoshi",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Tomoshibi (灯火 — lamp light) — self-hosted web search & scraping for AI agents. One binary, $5/mo.",
5
5
  "bin": {
6
6
  "tomoshi": "dist/stdio.js",
@@ -10,7 +10,11 @@
10
10
  "type": "module",
11
11
  "main": "dist/index.js",
12
12
  "types": "dist/index.d.ts",
13
- "files": ["dist", "README.md", "LICENSE"],
13
+ "files": [
14
+ "dist",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
14
18
  "publishConfig": {
15
19
  "access": "public",
16
20
  "provenance": true
@@ -25,6 +29,15 @@
25
29
  "patch:tmcp": "echo \"no patch needed\"",
26
30
  "postinstall": "echo \"no patch needed\""
27
31
  },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/Michael-Obele/tomoshibi.git",
35
+ "directory": "packages/mcp"
36
+ },
37
+ "homepage": "https://github.com/Michael-Obele/tomoshibi#readme",
38
+ "bugs": {
39
+ "url": "https://github.com/Michael-Obele/tomoshibi/issues"
40
+ },
28
41
  "keywords": [
29
42
  "tmcp",
30
43
  "mcp",