@narumitw/pi-firecrawl 0.50.5 → 0.51.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 +56 -18
- package/dist/chunks/chunk-WIQUHR2L.ts +1232 -0
- package/dist/chunks/chunk-WIQUHR2L.ts.map +7 -0
- package/dist/chunks/settings-ui-UUHNBNUE.ts +260 -0
- package/dist/chunks/settings-ui-UUHNBNUE.ts.map +7 -0
- package/dist/index.ts +69 -1017
- package/dist/index.ts.map +4 -4
- package/package.json +3 -2
- package/src/firecrawl.ts +41 -22
- package/src/lazy-tools.ts +148 -19
- package/src/settings-key-hints.ts +100 -0
- package/src/settings-ui.ts +186 -0
- package/src/settings.ts +50 -10
- package/src/tool-selector.ts +200 -41
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@narumitw/pi-firecrawl) [](https://pi.dev) [](./LICENSE)
|
|
4
4
|
|
|
5
|
-
Add
|
|
5
|
+
Add [Firecrawl](https://www.firecrawl.dev/) tools to Pi for web search, scraping, crawling, URL discovery, and content extraction.
|
|
6
6
|
|
|
7
7
|
## ✨ Features
|
|
8
8
|
|
|
9
9
|
- Scrapes a URL into markdown, HTML, links, screenshots, or structured JSON.
|
|
10
10
|
- Starts crawl jobs, checks their status, and retrieves completed crawl data.
|
|
11
11
|
- Discovers site URLs and searches the web with optional result-page scraping.
|
|
12
|
-
-
|
|
12
|
+
- Offers Codemode, Lazy loading, and Direct tools modes with availability controls through `/firecrawl`.
|
|
13
13
|
- Supports custom Firecrawl endpoints and shows status only while a tool is running.
|
|
14
14
|
- Bounds model-visible output while preserving oversized responses in private temporary files.
|
|
15
15
|
- Reads the API key from the environment and never logs, displays, or stores it.
|
|
@@ -42,8 +42,9 @@ Review third-party extension source before installing it.
|
|
|
42
42
|
|
|
43
43
|
## 🚀 Quick start
|
|
44
44
|
|
|
45
|
-
Set `FIRECRAWL_API_KEY`,
|
|
46
|
-
|
|
45
|
+
Set `FIRECRAWL_API_KEY`, enable Pi's codemode with `"defaultTools": ["+codemode"]` in Pi's `settings.json`, and start Pi with the extension.
|
|
46
|
+
Ask the agent to search or scrape a page through Firecrawl using codemode.
|
|
47
|
+
Run `/firecrawl settings` to choose another tool mode or change capability availability.
|
|
47
48
|
|
|
48
49
|
## ⚙️ Settings
|
|
49
50
|
|
|
@@ -62,20 +63,38 @@ export FIRECRAWL_API_URL=https://api.firecrawl.dev/v1
|
|
|
62
63
|
`FIRECRAWL_BASE_URL` is also accepted for compatibility.
|
|
63
64
|
The API key remains in the environment and is sent only as a bearer credential to the configured Firecrawl endpoint.
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
Open `/firecrawl settings` in TUI mode to edit Tool mode and the five capability switches.
|
|
67
|
+
Mode changes save immediately and apply at the next session start, including `/reload`; capability switches apply immediately using the running mode.
|
|
68
|
+
Closing the screen does not undo saved changes.
|
|
69
|
+
In RPC mode, the settings route shows the path and manual-edit instructions; print and JSON modes reject this route.
|
|
70
|
+
|
|
71
|
+
User settings are saved to:
|
|
66
72
|
|
|
67
73
|
```text
|
|
68
74
|
${PI_CODING_AGENT_DIR:-~/.pi/agent}/pi-firecrawl.json
|
|
69
75
|
```
|
|
70
76
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"toolMode": "codemode",
|
|
80
|
+
"tools": ["firecrawl_scrape", "firecrawl_crawl", "firecrawl_crawl_status", "firecrawl_map", "firecrawl_search"],
|
|
81
|
+
"updatedAt": 1
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`toolMode` accepts `codemode` (default), `lazy`, or `direct`; see [Tool exposure](#tool-exposure).
|
|
86
|
+
Existing valid files without `toolMode` also use the new codemode default, preserving their tool selection.
|
|
87
|
+
To restore the previous behavior, choose `lazy` and run `/reload`.
|
|
88
|
+
A fresh runtime allows all five capabilities; a missing or invalid file preserves any existing unsaved availability policy across reloads.
|
|
89
|
+
Invalid settings produce a warning and block saves until repaired.
|
|
90
|
+
Loading a missing file creates nothing; the first explicit settings change creates it.
|
|
91
|
+
Manual file edits apply at the next session start, including `/reload`.
|
|
92
|
+
There are no project overrides; `tools` controls availability independently from `toolMode`.
|
|
75
93
|
Within one Pi process, saves run in invocation order, reread the latest valid document, and preserve unknown fields.
|
|
76
94
|
Malformed JSON or invalid recognized fields block saves without replacing the file.
|
|
77
95
|
A failed save restores the previous availability and loaded capabilities while preserving other extensions' active tools.
|
|
78
|
-
|
|
96
|
+
Mode and availability saves change only their owned fields, so an availability edit does not overwrite a pending saved mode.
|
|
97
|
+
The file stores mode, tool names, and a timestamp, never `FIRECRAWL_API_KEY`, request headers, or other secrets.
|
|
79
98
|
|
|
80
99
|
Older versions used `pi-firecrawl-settings.json`.
|
|
81
100
|
A legacy-only file remains readable with a warning and is never modified automatically; rename it to `pi-firecrawl.json`.
|
|
@@ -85,7 +104,7 @@ The legacy filename is deprecated and will be removed in a future major release.
|
|
|
85
104
|
|
|
86
105
|
## 🛠️ Tools
|
|
87
106
|
|
|
88
|
-
- `firecrawl_load` — find and load
|
|
107
|
+
- `firecrawl_load` — find and load capabilities; available only in Lazy loading mode.
|
|
89
108
|
- `firecrawl_scrape` — scrape a single URL and return requested formats such as markdown, HTML, links, screenshots, or JSON.
|
|
90
109
|
- `firecrawl_crawl` — start a site crawl job and return the Firecrawl job id.
|
|
91
110
|
- `firecrawl_crawl_status` — check a crawl job status and retrieve completed crawl data.
|
|
@@ -94,8 +113,24 @@ The legacy filename is deprecated and will be removed in a future major release.
|
|
|
94
113
|
|
|
95
114
|
### Tool exposure
|
|
96
115
|
|
|
97
|
-
|
|
98
|
-
|
|
116
|
+
| Mode | Tool exposure | Loader |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| `codemode` (default) | Five allowed tools are callable through codemode and discoverable with `searchTools()` / `describeTool()`, without direct declarations. | None. |
|
|
119
|
+
| `lazy` | Only the loader starts active on native-deferred-compatible models; it appends capabilities as needed. | `firecrawl_load` stays active; loading all five yields six active Firecrawl tools. |
|
|
120
|
+
| `direct` | All five allowed tools are declared immediately. | None. |
|
|
121
|
+
|
|
122
|
+
Counts assume all capabilities are enabled.
|
|
123
|
+
Disabled capabilities are hidden and cannot be called or activated in any mode; `/firecrawl disable` makes all five unavailable.
|
|
124
|
+
Codemode mode does not explicitly activate capability tools; Pi's general tool controls can explicitly declare allowed codemode tools.
|
|
125
|
+
|
|
126
|
+
These modes require a Pi release with tool exposure support.
|
|
127
|
+
Codemode must be active in Pi for the default workflow.
|
|
128
|
+
Add `"defaultTools": ["+codemode"]` to Pi's `settings.json` and `/reload`.
|
|
129
|
+
Pi's `--tools` flag is an allowlist for extension tools too; a list that omits the Firecrawl capabilities prevents codemode from discovering or calling them.
|
|
130
|
+
The extension warns when codemode is inactive and does not silently switch modes.
|
|
131
|
+
Choose `lazy` or `direct` if you do not want to enable codemode.
|
|
132
|
+
|
|
133
|
+
In Lazy loading mode, with native deferred-tool support, only `firecrawl_load` starts active.
|
|
99
134
|
The loader accepts a task-oriented `query`, filters to capabilities allowed by settings, and adds up to three matching tools by default without removing any active Pi tool.
|
|
100
135
|
Set `limit` from 1 to 5 to change the maximum number loaded by one call.
|
|
101
136
|
A general website-crawl query can load both `firecrawl_crawl` and `firecrawl_crawl_status`, while a status-specific query loads the status capability.
|
|
@@ -107,14 +142,16 @@ Kimi-compatible models declare `compat.deferredToolsMode: "kimi"` in Pi's model
|
|
|
107
142
|
`azure-openai-responses` remains eager because Pi's Azure adapter does not implement native deferred tool-search serialization.
|
|
108
143
|
Fireworks Messages models also remain eager because their native protocol requires the canonical `ToolSearch` or `tool_search` loader name, while this independently installable package keeps the collision-safe `firecrawl_load` name.
|
|
109
144
|
When the selected model/provider lacks native deferred support, the extension activates every capability allowed by settings before the next model request instead of using Pi's cache-invalidating lazy-loading fallback.
|
|
110
|
-
After a session enters eager exposure, it stays eager across later model switches to avoid removing tool definitions within that session.
|
|
145
|
+
After a Lazy loading session enters eager exposure, it stays eager across later model switches to avoid removing tool definitions within that session.
|
|
146
|
+
Model switches do not change Codemode or Direct tools mode.
|
|
111
147
|
The capability tools omit active-only prompt metadata so native deferred loading does not rebuild the system-prompt prefix.
|
|
112
148
|
|
|
113
149
|
The saved `tools` array controls which capabilities the extension may expose.
|
|
114
|
-
An empty array
|
|
150
|
+
An empty array makes every Firecrawl API capability unavailable; only Lazy loading mode retains an active loader.
|
|
115
151
|
|
|
116
152
|
`firecrawl_load` performs no network request and does not create response artifacts.
|
|
117
|
-
Every API capability fails with a clear configuration error when `FIRECRAWL_API_KEY` is missing
|
|
153
|
+
Every API capability fails with a clear configuration error when `FIRECRAWL_API_KEY` is missing; configure the key instead of retrying repeatedly.
|
|
154
|
+
Settings changes, reloads, and a Lazy loading fallback to eager exposure are intentional model-visible tool transitions; ordinary turns do not reconfigure the tools or rewrite conversation history.
|
|
118
155
|
|
|
119
156
|
Tool output is limited to 50 KB or 2,000 lines, whichever is reached first.
|
|
120
157
|
When a response is truncated, the result reports the original and displayed sizes and the path to a complete temporary JSON file.
|
|
@@ -128,14 +165,15 @@ Oversized Firecrawl error bodies are bounded in the same way.
|
|
|
128
165
|
| `/firecrawl` | Manage available Firecrawl tools and inspect configuration. |
|
|
129
166
|
| `/firecrawl help` | Show command usage. |
|
|
130
167
|
| `/firecrawl config` (alias: `quickstart`) | Show API-key presence and API URL without revealing the key. |
|
|
131
|
-
| `/firecrawl status` | Show
|
|
168
|
+
| `/firecrawl status` | Show running/saved mode, effective exposure, callable and declared counts, loader state, saved catalog, and configuration status. |
|
|
169
|
+
| `/firecrawl settings` | Edit tool mode and capability availability in TUI, or show manual-edit instructions in RPC. |
|
|
132
170
|
| `/firecrawl tools` (aliases: `toggle`, `select`) | Choose available capabilities; each toggle saves immediately. |
|
|
133
171
|
| `/firecrawl enable` (alias: `on`) | Make all five API capabilities available and save the selection. |
|
|
134
172
|
| `/firecrawl disable` (alias: `off`) | Make all API capabilities unavailable and save the empty selection. |
|
|
135
173
|
|
|
136
174
|
All routes support TUI and RPC and reject unknown or trailing arguments.
|
|
137
175
|
Only `enable` and `disable` also support print and JSON modes.
|
|
138
|
-
Disabling capabilities leaves the slash command and `firecrawl_load`
|
|
176
|
+
Disabling capabilities leaves the slash command available and retains `firecrawl_load` only in Lazy loading mode; see [Tool exposure](#tool-exposure).
|
|
139
177
|
Done, Escape, or cancellation closes the tool selector **without undoing saved changes**.
|
|
140
178
|
|
|
141
179
|
## 🔒 Security and privacy
|