Skip to content

feat(cli): adopt Alexandria SDK 4.40.0 in beta - #225

Merged
developersdigest merged 1 commit into
mainfrom
alexandria/cli-beta
Sep 14, 2026
Merged

developersdigest merged 1 commit into
mainfrom
alexandria/cli-beta

Conversation

@developersdigest

@developersdigest developersdigest commented Sep 14, 2026

Copy link
Copy Markdown
Member

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.0 and use scrape({ 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.2 under the existing alexandria npm 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 to latest.

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 firecrawl 4.24.0 to 4.40.0 and routes provider and Find Tools calls through the published SDK’s scrape({ 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

  • SDK errors now retain charge IDs, error codes, and required terms actions in CLI output.
  • Partial provider failures keep successful results and billing details.

Migration

  • The CLI and CI now require Node.js 22.
  • Merging publishes 1.23.4-alexandria-beta.2 under the alexandria tag without promoting it to latest.

Written for commit 2fd1738. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 5 files

Confidence score: 4/5

  • src/__tests__/alexandria-beta.test.ts could pass even if the CLI submits only one provider call, leaving a regression in request construction undetected — assert that the body contains both provider/lookup and other/lookup.
  • package.json requires Node 22 while @types/node remains 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

Comment thread package.json
"homepage": "https://docs.firecrawl.dev/cli",
"engines": {
"node": ">=18.0.0"
"node": ">=22.0.0"

@cubic-dev-ai cubic-dev-ai Bot Sep 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Fix with cubic

const result = await cli(['scrape', '--alexandria', 'provider/lookup']);
expect(result.code).toBe(1);
expect(JSON.parse(result.stdout)).toMatchObject(response);
expect(requests).toHaveLength(1);

@cubic-dev-ai cubic-dev-ai Bot Sep 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
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' }),
]);
Fix with cubic

@developersdigest
developersdigest merged commit 7fda708 into main Sep 14, 2026
8 checks passed
@developersdigest
developersdigest deleted the alexandria/cli-beta branch September 14, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant