Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firecrawl-cli",
"version": "1.23.4-alexandria-beta.20",
"version": "1.23.4-alexandria-beta.21",
"publishConfig": {
"tag": "alexandria"
},
Expand Down
47 changes: 47 additions & 0 deletions src/__tests__/alexandria-beta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,53 @@ it('expands only a selected tool without falling back to a group', async () => {
expect(requests).toHaveLength(4);
});

it('inspects a combined tool address in one request and preserves provider errors', async () => {
response = catalogue('tools', [
{
id: 'pizzahut-com/restaurants/store',
provider: 'pizzahut-com',
capability: 'restaurants/store',
options: { store_number: { type: 'string' } },
},
]);
const result = await cli([
'list',
'pizzahut-com/restaurants/store',
'--json',
]);
expect(result.code).toBe(0);
expect(requests).toHaveLength(1);
expect(requests[0].body.alexandria[0].options).toEqual({
providers: ['pizzahut-com'],
capabilities: ['restaurants/store'],
level: 'tools',
expand: ['options', 'response', 'examples'],
limit: 20,
});
expect(result.stdout).toContain('store_number');
response = {
success: true,
data: {
creditsCost: 0,
alexandria: [
{
provider: 'firecrawl',
capability: 'find-tools',
error: {
code: 'unknown_provider',
message: 'Unknown provider',
status: 404,
},
},
],
},
};
const missing = await cli(['list', 'missing/restaurants/store', '--json']);
expect(missing.code).not.toBe(0);
expect(requests).toHaveLength(2);
expect(missing.stdout).toContain('unknown_provider');
});

it('preserves scoped next requests, pagination and discovery receipts', async () => {
const next = {
provider: 'firecrawl',
Expand Down
19 changes: 19 additions & 0 deletions src/commands/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,25 @@ export async function handleList(
if (options.request)
return fetchPage(parseFindToolsRequest(options.request).options);
if (!path.length) return fetchPage({ level: 'providers', limit });
if (!options.category && path[0].includes('/')) {
const [provider, ...segments] = path[0].split('/');
if (
path.length !== 1 ||
!provider ||
segments.some((segment) => !segment)
)
throw new Error(
'Use list <provider>/<capability> without extra path arguments.'
);
return fetchPage({
providers: [provider],
capabilities: [segments.join('/')],
level: 'tools',
expand: ['options', 'response', 'examples'],
limit,
});
}

if (options.contracts && options.category && path.length === 1) {
return fetchPage({
categories: [categoryId(path[0])],
Expand Down
Loading