From 23ea8ba1ceb35358c62ba1051ba402223d0fb5b3 Mon Sep 17 00:00:00 2001 From: Dax Date: Fri, 21 Nov 2025 00:21:06 -0500 Subject: Tui onboarding (#4569) Co-authored-by: GitHub Action --- packages/sdk/js/src/gen/sdk.gen.ts | 87 ++++++++++++++++++++ packages/sdk/js/src/gen/types.gen.ts | 151 +++++++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+) (limited to 'packages/sdk/js/src') diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts index 04dc29ccd..dc2247990 100644 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ b/packages/sdk/js/src/gen/sdk.gen.ts @@ -19,6 +19,8 @@ import type { ToolListData, ToolListResponses, ToolListErrors, + InstanceDisposeData, + InstanceDisposeResponses, PathGetData, PathGetResponses, SessionListData, @@ -92,6 +94,16 @@ import type { CommandListResponses, ConfigProvidersData, ConfigProvidersResponses, + ProviderListData, + ProviderListResponses, + ProviderAuthData, + ProviderAuthResponses, + ProviderOauthAuthorizeData, + ProviderOauthAuthorizeResponses, + ProviderOauthAuthorizeErrors, + ProviderOauthCallbackData, + ProviderOauthCallbackResponses, + ProviderOauthCallbackErrors, FindTextData, FindTextResponses, FindFilesData, @@ -272,6 +284,18 @@ class Tool extends _HeyApiClient { } } +class Instance extends _HeyApiClient { + /** + * Dispose the current instance + */ + public dispose(options?: Options) { + return (options?.client ?? this._client).post({ + url: "/instance/dispose", + ...options, + }) + } +} + class Path extends _HeyApiClient { /** * Get the current path @@ -554,6 +578,67 @@ class Command extends _HeyApiClient { } } +class Oauth extends _HeyApiClient { + /** + * Authorize a provider using OAuth + */ + public authorize(options: Options) { + return (options.client ?? this._client).post< + ProviderOauthAuthorizeResponses, + ProviderOauthAuthorizeErrors, + ThrowOnError + >({ + url: "/provider/{id}/oauth/authorize", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }) + } + + /** + * Handle OAuth callback for a provider + */ + public callback(options: Options) { + return (options.client ?? this._client).post< + ProviderOauthCallbackResponses, + ProviderOauthCallbackErrors, + ThrowOnError + >({ + url: "/provider/{id}/oauth/callback", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }) + } +} + +class Provider extends _HeyApiClient { + /** + * List all providers + */ + public list(options?: Options) { + return (options?.client ?? this._client).get({ + url: "/provider", + ...options, + }) + } + + /** + * Get provider authentication methods + */ + public auth(options?: Options) { + return (options?.client ?? this._client).get({ + url: "/provider/auth", + ...options, + }) + } + oauth = new Oauth({ client: this._client }) +} + class Find extends _HeyApiClient { /** * Find text in files @@ -891,9 +976,11 @@ export class OpencodeClient extends _HeyApiClient { project = new Project({ client: this._client }) config = new Config({ client: this._client }) tool = new Tool({ client: this._client }) + instance = new Instance({ client: this._client }) path = new Path({ client: this._client }) session = new Session({ client: this._client }) command = new Command({ client: this._client }) + provider = new Provider({ client: this._client }) find = new Find({ client: this._client }) file = new File({ client: this._client }) app = new App({ client: this._client }) diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index c776c8dc9..ebd1140f1 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -1333,6 +1333,17 @@ export type Provider = { } } +export type ProviderAuthMethod = { + type: "oauth" | "api" + label: string +} + +export type ProviderAuthAuthorization = { + url: string + method: "auto" | "code" + instructions: string +} + export type Symbol = { name: string kind: number @@ -1611,6 +1622,24 @@ export type ToolListResponses = { export type ToolListResponse = ToolListResponses[keyof ToolListResponses] +export type InstanceDisposeData = { + body?: never + path?: never + query?: { + directory?: string + } + url: "/instance/dispose" +} + +export type InstanceDisposeResponses = { + /** + * Instance disposed + */ + 200: boolean +} + +export type InstanceDisposeResponse = InstanceDisposeResponses[keyof InstanceDisposeResponses] + export type PathGetData = { body?: never path?: never @@ -2484,6 +2513,128 @@ export type ConfigProvidersResponses = { export type ConfigProvidersResponse = ConfigProvidersResponses[keyof ConfigProvidersResponses] +export type ProviderListData = { + body?: never + path?: never + query?: { + directory?: string + } + url: "/provider" +} + +export type ProviderListResponses = { + /** + * List of providers + */ + 200: { + all: Array + default: { + [key: string]: string + } + connected: Array + } +} + +export type ProviderListResponse = ProviderListResponses[keyof ProviderListResponses] + +export type ProviderAuthData = { + body?: never + path?: never + query?: { + directory?: string + } + url: "/provider/auth" +} + +export type ProviderAuthResponses = { + /** + * Provider auth methods + */ + 200: { + [key: string]: Array + } +} + +export type ProviderAuthResponse = ProviderAuthResponses[keyof ProviderAuthResponses] + +export type ProviderOauthAuthorizeData = { + body?: { + /** + * Auth method index + */ + method: number + } + path: { + /** + * Provider ID + */ + id: string + } + query?: { + directory?: string + } + url: "/provider/{id}/oauth/authorize" +} + +export type ProviderOauthAuthorizeErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type ProviderOauthAuthorizeError = ProviderOauthAuthorizeErrors[keyof ProviderOauthAuthorizeErrors] + +export type ProviderOauthAuthorizeResponses = { + /** + * Authorization URL and method + */ + 200: ProviderAuthAuthorization +} + +export type ProviderOauthAuthorizeResponse = ProviderOauthAuthorizeResponses[keyof ProviderOauthAuthorizeResponses] + +export type ProviderOauthCallbackData = { + body?: { + /** + * Auth method index + */ + method: number + /** + * OAuth authorization code + */ + code?: string + } + path: { + /** + * Provider ID + */ + id: string + } + query?: { + directory?: string + } + url: "/provider/{id}/oauth/callback" +} + +export type ProviderOauthCallbackErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type ProviderOauthCallbackError = ProviderOauthCallbackErrors[keyof ProviderOauthCallbackErrors] + +export type ProviderOauthCallbackResponses = { + /** + * OAuth callback processed successfully + */ + 200: boolean +} + +export type ProviderOauthCallbackResponse = ProviderOauthCallbackResponses[keyof ProviderOauthCallbackResponses] + export type FindTextData = { body?: never path?: never -- cgit v1.2.3