feat(cli): adopt Alexandria SDK 4.40.0 in beta - #225
Conversation
There was a problem hiding this comment.
2 issues found across 5 files
Confidence score: 4/5
src/__tests__/alexandria-beta.test.tscould pass even if the CLI submits only one provider call, leaving a regression in request construction undetected — assert that the body contains bothprovider/lookupandother/lookup.package.jsonrequires Node 22 while@types/noderemains on Node 20 typings, which can hide incompatibilities for Node 22 code — bump the devDependency to^22.0.0.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="package.json">
<violation number="1" location="package.json:70">
P3: The engines floor is now Node 22 but @types/node stays at ^20.0.0, so TypeScript type-checks against Node 20 typings even though the package requires Node 22. Bump the devDependency to ^22.0.0 so new code targeting Node 22+ APIs type-checks (e.g. fetch/undici, crypto.hash) instead of failing under @types/node 20 and forcing an unplanned bump later.</violation>
</file>
<file name="src/__tests__/alexandria-beta.test.ts">
<violation number="1" location="src/__tests__/alexandria-beta.test.ts:215">
P3: This test does not verify that both provider calls were sent. Assert the request body contains `provider/lookup` and `other/lookup`; otherwise it can pass when the CLI submits only one call and the mock still returns the preloaded partial response.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
| "homepage": "https://docs.firecrawl.dev/cli", | ||
| "engines": { | ||
| "node": ">=18.0.0" | ||
| "node": ">=22.0.0" |
There was a problem hiding this comment.
P3: The engines floor is now Node 22 but @types/node stays at ^20.0.0, so TypeScript type-checks against Node 20 typings even though the package requires Node 22. Bump the devDependency to ^22.0.0 so new code targeting Node 22+ APIs type-checks (e.g. fetch/undici, crypto.hash) instead of failing under @types/node 20 and forcing an unplanned bump later.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 70:
<comment>The engines floor is now Node 22 but @types/node stays at ^20.0.0, so TypeScript type-checks against Node 20 typings even though the package requires Node 22. Bump the devDependency to ^22.0.0 so new code targeting Node 22+ APIs type-checks (e.g. fetch/undici, crypto.hash) instead of failing under @types/node 20 and forcing an unplanned bump later.</comment>
<file context>
@@ -67,7 +67,7 @@
"homepage": "https://docs.firecrawl.dev/cli",
"engines": {
- "node": ">=18.0.0"
+ "node": ">=22.0.0"
},
"files": [
</file context>
| const result = await cli(['scrape', '--alexandria', 'provider/lookup']); | ||
| expect(result.code).toBe(1); | ||
| expect(JSON.parse(result.stdout)).toMatchObject(response); | ||
| expect(requests).toHaveLength(1); |
There was a problem hiding this comment.
P3: This test does not verify that both provider calls were sent. Assert the request body contains provider/lookup and other/lookup; otherwise it can pass when the CLI submits only one call and the mock still returns the preloaded partial response.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/__tests__/alexandria-beta.test.ts, line 215:
<comment>This test does not verify that both provider calls were sent. Assert the request body contains `provider/lookup` and `other/lookup`; otherwise it can pass when the CLI submits only one call and the mock still returns the preloaded partial response.</comment>
<file context>
@@ -196,6 +201,37 @@ it('executes Find Tools through the same API and refuses keyless access', async
+ const result = await cli(['scrape', '--alexandria', 'provider/lookup']);
+ expect(result.code).toBe(1);
+ expect(JSON.parse(result.stdout)).toMatchObject(response);
+ expect(requests).toHaveLength(1);
+});
+
</file context>
| expect(requests).toHaveLength(1); | |
| expect(requests).toHaveLength(1); | |
| expect(requests[0].body.alexandria).toEqual([ | |
| expect.objectContaining({ provider: 'provider', capability: 'lookup' }), | |
| expect.objectContaining({ provider: 'other', capability: 'lookup' }), | |
| ]); |
The Alexandria CLI beta still used SDK 4.24.0 and sent provider execution through its private HTTP client. Upgrade to the published
firecrawl@4.40.0and usescrape({ alexandria })for provider calls and the CLI's Find Tools flow.Preserve the existing CLI JSON receipt, retry IDs, billing information, terms actions, and nonzero exit status for partial failures. Search retains its HTTP transport because the high-level SDK helper drops the search ID and credit metadata used by CLI consumers.
Prepare
1.23.4-alexandria-beta.2under the existingalexandrianpm tag. Align the CLI engine and CI test runtime with the SDK's Node 22 minimum. Merging triggers the existing beta publication workflow; this does not promote the CLI tolatest.Validation: formatting, typecheck, build, and all 442 tests passed. The 8 beta command tests exercise the installed SDK against a local mock API, including terms refusals, charged failures, partial results, keyless rejection, and tool contracts on URL scrapes. No paid provider executions were run.
Summary by cubic
Updates the Alexandria CLI beta from
firecrawl4.24.0 to 4.40.0 and routes provider and Find Tools calls through the published SDK’sscrape({ alexandria })API instead of the private HTTP client. The CLI preserves its JSON receipts, request IDs, billing metadata, terms actions, and nonzero exit status for partial failures; search remains on HTTP because the SDK helper omits search metadata.Behavior
Migration
1.23.4-alexandria-beta.2under thealexandriatag without promoting it tolatest.Written for commit 2fd1738. Summary will update on new commits.