-
Notifications
You must be signed in to change notification settings - Fork 108
feat(cli): adopt Alexandria SDK 4.40.0 in beta #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -162,7 +162,12 @@ it('relays terms refusals and keeps the request ID on failure', async () => { | |||||||||||||
| success: false, | ||||||||||||||
| error: 'Accept provider terms', | ||||||||||||||
| code: 'THIRD_PARTY_DATA_TERMS_REQUIRED', | ||||||||||||||
| requiresAction: { url: 'https://firecrawl.dev/terms/provider' }, | ||||||||||||||
| requiresAction: { | ||||||||||||||
| type: 'accept_terms', | ||||||||||||||
| terms: 'provider', | ||||||||||||||
| version: '1.0', | ||||||||||||||
| url: 'https://firecrawl.dev/terms/provider', | ||||||||||||||
| }, | ||||||||||||||
| }; | ||||||||||||||
| const result = await cli([ | ||||||||||||||
| 'scrape', | ||||||||||||||
|
|
@@ -196,6 +201,37 @@ it('executes Find Tools through the same API and refuses keyless access', async | |||||||||||||
| }); | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| it('preserves charged SDK failures', async () => { | ||||||||||||||
| status = 402; | ||||||||||||||
| response = { | ||||||||||||||
| success: false, | ||||||||||||||
| error: 'Provider call failed after billing', | ||||||||||||||
| code: 'PROVIDER_ERROR', | ||||||||||||||
| chargeId: 'charge-1', | ||||||||||||||
| }; | ||||||||||||||
| const result = await cli(['scrape', '--alexandria', 'provider/lookup']); | ||||||||||||||
| expect(result.code).toBe(1); | ||||||||||||||
| expect(JSON.parse(result.stdout)).toMatchObject(response); | ||||||||||||||
| expect(requests).toHaveLength(1); | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Prompt for AI agents
Suggested change
|
||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| it('retains successful results and billing when one provider fails', async () => { | ||||||||||||||
| response.data.alexandria.push({ | ||||||||||||||
| provider: 'other', | ||||||||||||||
| capability: 'lookup', | ||||||||||||||
| error: { code: 'PROVIDER_ERROR', message: 'Unavailable', status: 503 }, | ||||||||||||||
| }); | ||||||||||||||
| const result = await cli([ | ||||||||||||||
| 'scrape', | ||||||||||||||
| '--alexandria', | ||||||||||||||
| 'provider/lookup', | ||||||||||||||
| 'other/lookup', | ||||||||||||||
| ]); | ||||||||||||||
| expect(result.code).toBe(1); | ||||||||||||||
| expect(JSON.parse(result.stdout)).toMatchObject(response); | ||||||||||||||
| expect(requests).toHaveLength(1); | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| it('keeps URL scrape tool contracts in the output', async () => { | ||||||||||||||
| response = { | ||||||||||||||
| success: true, | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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