From ef66c019f8674a8a997a6003bab6a3779b0849ea Mon Sep 17 00:00:00 2001 From: Ryuzo Yamamoto Date: Wed, 24 Jun 2026 18:21:05 +0900 Subject: [PATCH] feat: add tailor.aigateway.get types for AI Gateway URL resolution --- .changeset/tailor-aigateway-get.md | 5 +++++ packages/types/tailor.d.ts | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .changeset/tailor-aigateway-get.md diff --git a/.changeset/tailor-aigateway-get.md b/.changeset/tailor-aigateway-get.md new file mode 100644 index 0000000..909b28d --- /dev/null +++ b/.changeset/tailor-aigateway-get.md @@ -0,0 +1,5 @@ +--- +"@tailor-platform/function-types": minor +--- + +Add `tailor.aigateway.get(name)` types for resolving an AI Gateway URL in the caller's workspace. diff --git a/packages/types/tailor.d.ts b/packages/types/tailor.d.ts index 8f80d24..d22d162 100644 --- a/packages/types/tailor.d.ts +++ b/packages/types/tailor.d.ts @@ -61,6 +61,27 @@ declare namespace tailor.authconnection { function getConnectionToken(connectionName: string): Promise; } +declare namespace tailor.aigateway { + /** + * AIGateway describes a resolved AI Gateway in the caller's workspace. + */ + interface AIGateway { + /** + * Base URL of the AI Gateway, e.g. + * `https://my-aigateway-.ai.erp.dev`. Requests to this URL + * are automatically authenticated for the calling workspace. + */ + url: string; + } + + /** + * get resolves a named AI Gateway in the caller's own workspace and returns + * it. The gateway's existence is verified at call time, so resolving a name + * that does not exist rejects rather than failing later inside `fetch`. + */ + function get(name: string): Promise; +} + declare namespace tailor.iconv { /** * Convert string from one encoding to another