@narumitw/pi-firecrawl 0.50.5 → 0.51.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,57 @@
1
+ # @narumitw/pi-firecrawl
2
+
3
+ ## 0.51.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 956f531: Restore the Chrome DevTools and Firecrawl extensions as maintained packages, update runtime compatibility, and include package changelogs in published files.
8
+
9
+ ## 0.51.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ea9cf7b: Default to five codemode-exposed Firecrawl capabilities without `firecrawl_load`. Existing settings without `toolMode` also adopt this default while preserving the saved tool selection. Enable Pi's codemode, or choose `lazy` in `/firecrawl settings` and `/reload` to restore the previous model-dependent lazy/eager behavior; `direct` declares the five tools without a loader.
14
+
15
+ Add a SettingsList screen for mode and capability availability. Mode edits save immediately and apply at the next session start; availability edits apply immediately without overwriting a pending mode. Disabled capabilities are unreachable in every mode. Status distinguishes running and saved mode, effective exposure, and callable versus declared tools. Preserve existing commands, legacy settings precedence, and native-deferred fallback behavior.
16
+
17
+ ## 0.50.5
18
+
19
+ ### Patch Changes
20
+
21
+ - 8abd5b7: Keep generated extension runtime graphs inside Pi's Jiti-loaded TypeScript path to avoid duplicate peer-runtime evaluation during startup. Add measured generated runtimes for Context Management, Herdr, and TypeSafe Search.
22
+
23
+ ## 0.50.4
24
+
25
+ ### Patch Changes
26
+
27
+ - 67a3049: Adapt provider, transcript, usage, deferred-tool, and telemetry behavior to Pi's current runtime contracts, including accurate cache-warming accounting and exclusion from ordinary generation traces.
28
+
29
+ ## 0.50.3
30
+
31
+ ### Patch Changes
32
+
33
+ - bd00d53: Render standard horizontal frames around the remaining extension menus.
34
+
35
+ ## 0.50.2
36
+
37
+ ### Patch Changes
38
+
39
+ - 3effdd1: Use native deferred tool loading only on supported models and eagerly expose configured tools otherwise.
40
+
41
+ ## 0.50.1
42
+
43
+ ### Patch Changes
44
+
45
+ - 30bc076: Load each extension from a generated TypeScript runtime to reduce Jiti package startup work while preserving existing first-use boundaries.
46
+
47
+ ## 0.50.0
48
+
49
+ ### Minor Changes
50
+
51
+ - f4eb46a: Load Firecrawl API capability tools on demand through a persistent `firecrawl_load` tool.
52
+
53
+ Treat the saved tool selection as the allowed lazy-load catalog and preserve stable prompt metadata while capabilities are deferred.
54
+
55
+ Preserve unsaved catalogs across runtime reloads and restore allowed loaded capabilities from the active branch.
56
+
57
+ Harden query ranking, settings validation and notices, and Unicode-safe display truncation.
package/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@narumitw/pi-firecrawl)](https://www.npmjs.com/package/@narumitw/pi-firecrawl) [![Pi extension](https://img.shields.io/badge/Pi-extension-blue)](https://pi.dev) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
4
4
 
5
- Add on-demand [Firecrawl](https://www.firecrawl.dev/) tools to Pi for web search, scraping, crawling, URL discovery, and content extraction.
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
- - Loads only the Firecrawl capabilities needed for the task and manages availability through `/firecrawl`.
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.
@@ -25,14 +25,14 @@ pi install npm:@narumitw/pi-firecrawl
25
25
  Run once from npm:
26
26
 
27
27
  ```bash
28
- FIRECRAWL_API_KEY=fc-... pi -e npm:@narumitw/pi-firecrawl
28
+ pi -e npm:@narumitw/pi-firecrawl
29
29
  ```
30
30
 
31
31
  Build and run a local checkout from the repository root:
32
32
 
33
33
  ```bash
34
34
  npm --workspace @narumitw/pi-firecrawl run build
35
- FIRECRAWL_API_KEY=fc-... pi -e ./packages/pi-firecrawl
35
+ pi -e ./packages/pi-firecrawl
36
36
  ```
37
37
 
38
38
  The package declares `dist/index.ts`, so build a local checkout before loading its package directory.
@@ -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`, start Pi with the extension, and ask the agent to load the Firecrawl capability needed for the task.
46
- Run `/firecrawl` to review configuration and choose which capabilities the loader may expose.
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
- Available capability names are saved to:
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
- A missing or invalid file leaves the current Firecrawl availability policy unchanged.
72
- An unsaved catalog remains stable across runtime reloads.
73
- A valid catalog is restored on startup and `/reload`, with native deferred or eager exposure chosen from model and provider support.
74
- The first successful availability change creates a missing file.
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
- The file stores only tool names and a timestamp, never `FIRECRAWL_API_KEY`, request headers, or other secrets.
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 Firecrawl capabilities relevant to a web research task.
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,27 +113,46 @@ The legacy filename is deprecated and will be removed in a future major release.
94
113
 
95
114
  ### Tool exposure
96
115
 
97
- The extension registers six tools: one loader and five API capabilities.
98
- With native deferred-tool support, only `firecrawl_load` starts active.
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.
102
137
  Loaded capability tools remain active for the current session until you make them unavailable through `/firecrawl`.
103
138
  On reload, resume, or fork, capabilities recorded by `firecrawl_load` on the active branch are restored when the current catalog still allows them.
104
139
 
105
- Pi uses native deferred tool references on compatible Anthropic models, native additional-tools or tool-search loading on compatible OpenAI and Codex Responses models, and native Kimi loading on compatible OpenAI Chat Completions models.
106
- Kimi-compatible models declare `compat.deferredToolsMode: "kimi"` in Pi's model metadata.
107
- `azure-openai-responses` remains eager because Pi's Azure adapter does not implement native deferred tool-search serialization.
108
- 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.
140
+ Native lazy loading requires `compat.supportsMidConvoSystemMessages: true` in Pi's registered model metadata.
141
+ Anthropic Messages also requires `supportsMidConvoToolChanges`; OpenAI Chat Completions requires `supportsMidConvoToolAdditions`.
142
+ OpenAI Responses, Codex Responses, and Azure Responses require `supportsAdditionalTools` or `supportsToolSearch`.
143
+ The extension uses these explicit capabilities, not provider names or model-ID guesses.
144
+
109
145
  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.
146
+ After a Lazy loading session enters eager exposure, it stays eager across later model switches to avoid removing tool definitions within that session.
147
+ Model switches do not change Codemode or Direct tools mode.
111
148
  The capability tools omit active-only prompt metadata so native deferred loading does not rebuild the system-prompt prefix.
112
149
 
113
150
  The saved `tools` array controls which capabilities the extension may expose.
114
- An empty array leaves the loader active but makes every Firecrawl API capability unavailable.
151
+ An empty array makes every Firecrawl API capability unavailable; only Lazy loading mode retains an active loader.
115
152
 
116
153
  `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, and the always-active loader guidance tells the agent not to retry repeatedly.
154
+ Every API capability fails with a clear configuration error when `FIRECRAWL_API_KEY` is missing; configure the key instead of retrying repeatedly.
155
+ 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
156
 
119
157
  Tool output is limited to 50 KB or 2,000 lines, whichever is reached first.
120
158
  When a response is truncated, the result reports the original and displayed sizes and the path to a complete temporary JSON file.
@@ -128,14 +166,15 @@ Oversized Firecrawl error bodies are bounded in the same way.
128
166
  | `/firecrawl` | Manage available Firecrawl tools and inspect configuration. |
129
167
  | `/firecrawl help` | Show command usage. |
130
168
  | `/firecrawl config` (alias: `quickstart`) | Show API-key presence and API URL without revealing the key. |
131
- | `/firecrawl status` | Show available and loaded tools, loader state, saved catalog, and configuration status. |
169
+ | `/firecrawl status` | Show running/saved mode, effective exposure, callable and declared counts, loader state, saved catalog, and configuration status. |
170
+ | `/firecrawl settings` | Edit tool mode and capability availability in TUI, or show manual-edit instructions in RPC. |
132
171
  | `/firecrawl tools` (aliases: `toggle`, `select`) | Choose available capabilities; each toggle saves immediately. |
133
172
  | `/firecrawl enable` (alias: `on`) | Make all five API capabilities available and save the selection. |
134
173
  | `/firecrawl disable` (alias: `off`) | Make all API capabilities unavailable and save the empty selection. |
135
174
 
136
175
  All routes support TUI and RPC and reject unknown or trailing arguments.
137
176
  Only `enable` and `disable` also support print and JSON modes.
138
- Disabling capabilities leaves the slash command and `firecrawl_load` available; see [Tool exposure](#tool-exposure) for native-deferred and eager behavior.
177
+ Disabling capabilities leaves the slash command available and retains `firecrawl_load` only in Lazy loading mode; see [Tool exposure](#tool-exposure).
139
178
  Done, Escape, or cancellation closes the tool selector **without undoing saved changes**.
140
179
 
141
180
  ## 🔒 Security and privacy