feat: openapi-to-ts namespace all ai method names

pull/701/head
Travis Fischer 2025-03-25 19:57:38 +08:00
rodzic 0ea3ee6d7d
commit 72c77fe155
8 zmienionych plików z 108 dodań i 3584 usunięć

Wyświetl plik

@ -524,7 +524,7 @@ export class FirecrawlClient extends AIFunctionsProvider {
* Scrape a single URL.
*/
@aiFunction({
name: 'scrape',
name: 'firecrawl_scrape',
description: `Scrape a single URL.`,
inputSchema: firecrawl.ScrapeParamsSchema
})
@ -552,7 +552,7 @@ export class FirecrawlClient extends AIFunctionsProvider {
* Crawl multiple URLs based on options.
*/
@aiFunction({
name: 'crawl_urls',
name: 'firecrawl_crawl_urls',
description: `Crawl multiple URLs based on options.`,
inputSchema: firecrawl.CrawlUrlsParamsSchema
})
@ -570,7 +570,7 @@ export class FirecrawlClient extends AIFunctionsProvider {
* Search for a keyword in Google, returns top page results with markdown content for each page.
*/
@aiFunction({
name: 'search_google',
name: 'firecrawl_search_google',
description: `Search for a keyword in Google, returns top page results with markdown content for each page.`,
inputSchema: firecrawl.SearchGoogleParamsSchema
})
@ -588,7 +588,7 @@ export class FirecrawlClient extends AIFunctionsProvider {
* Get the status of a crawl job.
*/
@aiFunction({
name: 'get_crawl_status',
name: 'firecrawl_get_crawl_status',
description: `Get the status of a crawl job.`,
inputSchema: firecrawl.GetCrawlStatusParamsSchema
})
@ -604,7 +604,7 @@ export class FirecrawlClient extends AIFunctionsProvider {
* Cancel a crawl job.
*/
@aiFunction({
name: 'cancel_crawl_job',
name: 'firecrawl_cancel_crawl_job',
description: `Cancel a crawl job.`,
inputSchema: firecrawl.CancelCrawlJobParamsSchema
})

Wyświetl plik

@ -1505,7 +1505,7 @@ export class NotionClient extends AIFunctionsProvider {
* Get current user.
*/
@aiFunction({
name: 'get_self',
name: 'notion_get_self',
description: `Get current user.`,
inputSchema: notion.GetSelfParamsSchema
})
@ -1519,7 +1519,7 @@ export class NotionClient extends AIFunctionsProvider {
* Get user.
*/
@aiFunction({
name: 'get_user',
name: 'notion_get_user',
description: `Get user.`,
inputSchema: notion.GetUserParamsSchema
})
@ -1533,7 +1533,7 @@ export class NotionClient extends AIFunctionsProvider {
* List users.
*/
@aiFunction({
name: 'list_users',
name: 'notion_list_users',
description: `List users.`,
inputSchema: notion.ListUsersParamsSchema
})
@ -1553,7 +1553,7 @@ export class NotionClient extends AIFunctionsProvider {
* Create page.
*/
@aiFunction({
name: 'create_page',
name: 'notion_create_page',
description: `Create page.`,
inputSchema: notion.CreatePageParamsSchema
})
@ -1571,7 +1571,7 @@ export class NotionClient extends AIFunctionsProvider {
* Get page.
*/
@aiFunction({
name: 'get_page',
name: 'notion_get_page',
description: `Get page.`,
inputSchema: notion.GetPageParamsSchema
})
@ -1587,7 +1587,7 @@ export class NotionClient extends AIFunctionsProvider {
* Update page.
*/
@aiFunction({
name: 'update_page',
name: 'notion_update_page',
description: `Update page.`,
inputSchema: notion.UpdatePageParamsSchema
})
@ -1605,7 +1605,7 @@ export class NotionClient extends AIFunctionsProvider {
* Get page property.
*/
@aiFunction({
name: 'get_page_property',
name: 'notion_get_page_property',
description: `Get page property.`,
inputSchema: notion.GetPagePropertyParamsSchema
})
@ -1625,7 +1625,7 @@ export class NotionClient extends AIFunctionsProvider {
* Get block.
*/
@aiFunction({
name: 'get_block',
name: 'notion_get_block',
description: `Get block.`,
inputSchema: notion.GetBlockParamsSchema
})
@ -1641,7 +1641,7 @@ export class NotionClient extends AIFunctionsProvider {
* Delete block.
*/
@aiFunction({
name: 'delete_block',
name: 'notion_delete_block',
description: `Delete block.`,
inputSchema: notion.DeleteBlockParamsSchema
})
@ -1657,7 +1657,7 @@ export class NotionClient extends AIFunctionsProvider {
* Update block.
*/
@aiFunction({
name: 'update_block',
name: 'notion_update_block',
description: `Update block.`,
inputSchema: notion.UpdateBlockParamsSchema
})
@ -1702,7 +1702,7 @@ export class NotionClient extends AIFunctionsProvider {
* List block children.
*/
@aiFunction({
name: 'list_block_children',
name: 'notion_list_block_children',
description: `List block children.`,
inputSchema: notion.ListBlockChildrenParamsSchema
})
@ -1722,7 +1722,7 @@ export class NotionClient extends AIFunctionsProvider {
* Append block children.
*/
@aiFunction({
name: 'append_block_children',
name: 'notion_append_block_children',
description: `Append block children.`,
inputSchema: notion.AppendBlockChildrenParamsSchema
})
@ -1740,7 +1740,7 @@ export class NotionClient extends AIFunctionsProvider {
* Get database.
*/
@aiFunction({
name: 'get_database',
name: 'notion_get_database',
description: `Get database.`,
inputSchema: notion.GetDatabaseParamsSchema
})
@ -1756,7 +1756,7 @@ export class NotionClient extends AIFunctionsProvider {
* Update database.
*/
@aiFunction({
name: 'update_database',
name: 'notion_update_database',
description: `Update database.`,
inputSchema: notion.UpdateDatabaseParamsSchema
})
@ -1783,7 +1783,7 @@ export class NotionClient extends AIFunctionsProvider {
* Query database.
*/
@aiFunction({
name: 'query_database',
name: 'notion_query_database',
description: `Query database.`,
inputSchema: notion.QueryDatabaseParamsSchema
})
@ -1809,7 +1809,7 @@ export class NotionClient extends AIFunctionsProvider {
* List databases.
*/
@aiFunction({
name: 'list_databases',
name: 'notion_list_databases',
description: `List databases.`,
inputSchema: notion.ListDatabasesParamsSchema
})
@ -1829,7 +1829,7 @@ export class NotionClient extends AIFunctionsProvider {
* Create database.
*/
@aiFunction({
name: 'create_database',
name: 'notion_create_database',
description: `Create database.`,
inputSchema: notion.CreateDatabaseParamsSchema
})
@ -1856,7 +1856,7 @@ export class NotionClient extends AIFunctionsProvider {
* Search.
*/
@aiFunction({
name: 'search',
name: 'notion_search',
description: `Search.`,
inputSchema: notion.SearchParamsSchema
})
@ -1879,7 +1879,7 @@ export class NotionClient extends AIFunctionsProvider {
* List comments.
*/
@aiFunction({
name: 'list_comments',
name: 'notion_list_comments',
description: `List comments.`,
inputSchema: notion.ListCommentsParamsSchema
})
@ -1899,7 +1899,7 @@ export class NotionClient extends AIFunctionsProvider {
* Create comment.
*/
@aiFunction({
name: 'create_comment',
name: 'notion_create_comment',
description: `Create comment.`,
// TODO: Improve handling of union params
inputSchema: notion.CreateCommentParamsSchema as any
@ -1918,7 +1918,7 @@ export class NotionClient extends AIFunctionsProvider {
* OAuth token.
*/
@aiFunction({
name: 'oauth_token',
name: 'notion_oauth_token',
description: `OAuth token.`,
inputSchema: notion.OauthTokenParamsSchema
})

Wyświetl plik

@ -93,7 +93,7 @@ export class PetStoreClient extends AIFunctionsProvider {
* List all pets.
*/
@aiFunction({
name: 'list_pets',
name: 'pet_store_list_pets',
description: `List all pets.`,
inputSchema: petstore.ListPetsParamsSchema
})
@ -111,7 +111,7 @@ export class PetStoreClient extends AIFunctionsProvider {
* Create a pet.
*/
@aiFunction({
name: 'create_pets',
name: 'pet_store_create_pets',
description: `Create a pet.`,
inputSchema: petstore.CreatePetsParamsSchema
})
@ -129,7 +129,7 @@ export class PetStoreClient extends AIFunctionsProvider {
* Info for a specific pet.
*/
@aiFunction({
name: 'show_pet_by_id',
name: 'pet_store_show_pet_by_id',
description: `Info for a specific pet.`,
inputSchema: petstore.ShowPetByIdParamsSchema
})

Wyświetl plik

@ -110,7 +110,7 @@ Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagitt
Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
*/
@aiFunction({
name: 'find_pets',
name: 'petstore_expanded_find_pets',
description: `Returns all pets from the system that the user has access to
Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.
@ -131,7 +131,7 @@ Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condime
* Creates a new pet in the store. Duplicates are allowed.
*/
@aiFunction({
name: 'add_pet',
name: 'petstore_expanded_add_pet',
description: `Creates a new pet in the store. Duplicates are allowed.`,
inputSchema: petstoreexpanded.AddPetParamsSchema
})
@ -149,7 +149,7 @@ Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condime
* Returns a user based on a single ID, if the user does not have access to the pet.
*/
@aiFunction({
name: 'find_pet_by_id',
name: 'petstore_expanded_find_pet_by_id',
description: `Returns a user based on a single ID, if the user does not have access to the pet.`,
inputSchema: petstoreexpanded.FindPetByIdParamsSchema
})
@ -165,7 +165,7 @@ Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condime
* deletes a single pet based on the ID supplied.
*/
@aiFunction({
name: 'delete_pet',
name: 'petstore_expanded_delete_pet',
description: `deletes a single pet based on the ID supplied.`,
inputSchema: petstoreexpanded.DeletePetParamsSchema
})

Wyświetl plik

@ -151,7 +151,7 @@ export class SecurityClient extends AIFunctionsProvider {
* `apiKey` auth will be supplied within an `apiKey` query parameter.
*/
@aiFunction({
name: 'get_anything_api_key',
name: 'security_get_anything_api_key',
description: `\`apiKey\` auth will be supplied within an \`apiKey\` query parameter.`,
inputSchema: security.GetAnythingApiKeyParamsSchema
})
@ -167,7 +167,7 @@ export class SecurityClient extends AIFunctionsProvider {
* `apiKey` auth will be supplied within an `api_key` cookie.
*/
@aiFunction({
name: 'post_anything_api_key',
name: 'security_post_anything_api_key',
description: `\`apiKey\` auth will be supplied within an \`api_key\` cookie.`,
inputSchema: security.PostAnythingApiKeyParamsSchema
})
@ -183,7 +183,7 @@ export class SecurityClient extends AIFunctionsProvider {
* `apiKey` auth will be supplied within an `X-API-KEY` header.
*/
@aiFunction({
name: 'put_anything_api_key',
name: 'security_put_anything_api_key',
description: `\`apiKey\` auth will be supplied within an \`X-API-KEY\` header.`,
inputSchema: security.PutAnythingApiKeyParamsSchema
})
@ -201,7 +201,7 @@ export class SecurityClient extends AIFunctionsProvider {
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample.
*/
@aiFunction({
name: 'post_anything_basic',
name: 'security_post_anything_basic',
description: `Authentication credentials will be supplied within a \`Basic\` \`Authorization\` header.
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample.`,
@ -221,7 +221,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-a
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample.
*/
@aiFunction({
name: 'post_anything_bearer',
name: 'security_post_anything_bearer',
description: `Authentication credentials will be supplied within a \`Bearer\` \`Authorization\` header.
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample.`,
@ -244,7 +244,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-a
> We currently do not support any special handling for this so they're handled as a standard `Bearer` authentication token.
*/
@aiFunction({
name: 'put_anything_bearer',
name: 'security_put_anything_bearer',
description: `Authentication credentials will be supplied within a \`Bearer\` \`Authorization\` header, but its data should be controlled as a JWT.
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample
@ -268,7 +268,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-a
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23.
*/
@aiFunction({
name: 'get_anything_oauth2',
name: 'security_get_anything_oauth2',
description: `>
> We currently do not handle OAuth 2 authentication flows so if an operation has an \`oauth2\` requirement we assume that the user, or the projects JWT, has a qualified \`bearer\` token and will use that.
@ -290,7 +290,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-f
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23.
*/
@aiFunction({
name: 'post_anything_oauth2',
name: 'security_post_anything_oauth2',
description: `>
> We currently do not handle OAuth 2 authentication flows so if an operation has an \`oauth2\` requirement we assume that the user, or the projects JWT, has a qualified \`bearer\` token and will use that.
@ -312,7 +312,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-f
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23.
*/
@aiFunction({
name: 'put_anything_oauth2',
name: 'security_put_anything_oauth2',
description: `>
> We currently do not handle OAuth 2 authentication flows so if an operation has an \`oauth2\` requirement we assume that the user, or the projects JWT, has a qualified \`bearer\` token and will use that.
@ -334,7 +334,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-f
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23.
*/
@aiFunction({
name: 'delete_anything_oauth2',
name: 'security_delete_anything_oauth2',
description: `>
> We currently do not handle OAuth 2 authentication flows so if an operation has an \`oauth2\` requirement we assume that the user, or the projects JWT, has a qualified \`bearer\` token and will use that.
@ -356,7 +356,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-f
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23.
*/
@aiFunction({
name: 'patch_anything_oauth2',
name: 'security_patch_anything_oauth2',
description: `>
> We currently do not handle OAuth 2 authentication flows so if an operation has an \`oauth2\` requirement we assume that the user, or the projects JWT, has a qualified \`bearer\` token and will use that.
@ -375,7 +375,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-f
* 🚧 This is not supported.
*/
@aiFunction({
name: 'post_anything_open_id_connect',
name: 'security_post_anything_open_id_connect',
description: `🚧 This is not supported.`,
inputSchema: security.PostAnythingOpenIdConnectParamsSchema
})
@ -391,7 +391,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-f
* This operation does not have any authentication requirements.
*/
@aiFunction({
name: 'post_anything_no_auth',
name: 'security_post_anything_no_auth',
description: `This operation does not have any authentication requirements.`,
inputSchema: security.PostAnythingNoAuthParamsSchema
})
@ -409,7 +409,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-f
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object.
*/
@aiFunction({
name: 'get_anything_optional_auth',
name: 'security_get_anything_optional_auth',
description: `The \`apiKey\` query parameter auth on this operation is optional.
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object.`,
@ -427,7 +427,7 @@ https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#securit
* This endpoint requires an authentication header but making any request to it will forcefully return a 401 status code for invalid auth.
*/
@aiFunction({
name: 'post_status401',
name: 'security_post_status401',
description: `This endpoint requires an authentication header but making any request to it will forcefully return a 401 status code for invalid auth.`,
inputSchema: security.PostStatus401ParamsSchema
})

Wyświetl plik

@ -94,7 +94,7 @@ export class TicTacToeClient extends AIFunctionsProvider {
* Retrieves the current state of the board and the winner.
*/
@aiFunction({
name: 'get_board',
name: 'tic_tac_toe_get_board',
description: `Retrieves the current state of the board and the winner.`,
inputSchema: tictactoe.GetBoardParamsSchema
})
@ -108,7 +108,7 @@ export class TicTacToeClient extends AIFunctionsProvider {
* Retrieves the requested square.
*/
@aiFunction({
name: 'get_square',
name: 'tic_tac_toe_get_square',
description: `Retrieves the requested square.`,
inputSchema: tictactoe.GetSquareParamsSchema
})
@ -124,7 +124,7 @@ export class TicTacToeClient extends AIFunctionsProvider {
* Places a mark on the board and retrieves the whole board and the winner (if any).
*/
@aiFunction({
name: 'put_square',
name: 'tic_tac_toe_put_square',
description: `Places a mark on the board and retrieves the whole board and the winner (if any).`,
inputSchema: tictactoe.PutSquareParamsSchema
})

Wyświetl plik

@ -179,7 +179,12 @@ export async function generateTSFromOpenAPI({
`Duplicate operation name "${operationName}"`
)
operationNames.add(operationName)
const operationNameSnakeCase = decamelize(operationName)
const operationNameSnakeCaseTemp = decamelize(operationName)
const operationNameSnakeCase = operationNameSnakeCaseTemp.startsWith(
`${nameSnakeCase}_`
)
? operationNameSnakeCaseTemp
: `${nameSnakeCase}_${operationNameSnakeCaseTemp}`
// if (path !== '/comments' || method !== 'post') continue
// if (path !== '/crawl/status/{jobId}') continue