From 292026258f5a168aec13e97d56b6d5100a37a57c Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 16 Oct 2025 15:32:51 -0400 Subject: [PATCH] sync --- bun.lock | 1 + packages/sdk/js/src/gen/sdk.gen.ts | 17 +++ packages/sdk/js/src/gen/types.gen.ts | 148 ++++++++++++++++++++++++++- 3 files changed, 162 insertions(+), 4 deletions(-) diff --git a/bun.lock b/bun.lock index c6535eaee..8da8c5ce3 100644 --- a/bun.lock +++ b/bun.lock @@ -190,6 +190,7 @@ "@opentui/core": "0.0.0-20251010-2eed09fd", "@opentui/solid": "0.0.0-20251010-2eed09fd", "@parcel/watcher": "2.5.1", + "@solid-primitives/event-bus": "1.1.2", "@standard-schema/spec": "1.0.0", "@zip.js/zip.js": "2.7.62", "ai": "catalog:", diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts index 686a8d9c8..9fd73d38d 100644 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ b/packages/sdk/js/src/gen/sdk.gen.ts @@ -125,6 +125,9 @@ import type { TuiExecuteCommandErrors, TuiShowToastData, TuiShowToastResponses, + TuiPublishData, + TuiPublishResponses, + TuiPublishErrors, AuthSetData, AuthSetResponses, AuthSetErrors, @@ -718,6 +721,20 @@ class Tui extends _HeyApiClient { }, }) } + + /** + * Publish a TUI event + */ + public publish(options?: Options) { + return (options?.client ?? this._client).post({ + url: "/tui/publish", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }) + } } class Auth extends _HeyApiClient { diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index c01a5ef4d..481761b25 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -1055,6 +1055,69 @@ export type LspStatus = { status: "connected" | "error" } +export type EventTuiPromptAppend = { + type: "tui.prompt.append" + properties: { + text: string + } +} + +export type EventTuiPromptSubmit = { + type: "tui.prompt.submit" + properties: { + [key: string]: unknown + } +} + +export type EventTuiPromptClear = { + type: "tui.prompt.clear" + properties: { + [key: string]: unknown + } +} + +export type EventTuiCommandExecute = { + type: "tui.command.execute" + properties: { + command: "session.list" + [key: string]: + | { + command: string + } + | "session.list" + } +} + +export type EventTuiSessionList = { + type: "tui.session.list" + properties: { + [key: string]: unknown + } +} + +export type EventTuiThemeList = { + type: "tui.theme.list" + properties: { + [key: string]: unknown + } +} + +export type EventTuiModelList = { + type: "tui.model.list" + properties: { + [key: string]: unknown + } +} + +export type EventTuiToastShow = { + type: "tui.toast.show" + properties: { + title?: string + message: string + variant: "info" | "success" | "warning" | "error" + } +} + export type OAuth = { type: "oauth" refresh: string @@ -1242,6 +1305,14 @@ export type Event = | EventSessionUpdated | EventSessionDeleted | EventSessionError + | EventTuiPromptAppend + | EventTuiPromptSubmit + | EventTuiPromptClear + | EventTuiCommandExecute + | EventTuiSessionList + | EventTuiThemeList + | EventTuiModelList + | EventTuiToastShow | EventServerConnected export type ProjectListData = { @@ -1514,9 +1585,38 @@ export type SessionGetResponses = { export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses] export type SessionUpdateData = { - body?: { - title?: string - } + body?: + | { + text: string + } + | { + [key: string]: unknown + } + | { + [key: string]: unknown + } + | { + [key: string]: unknown + } + | { + [key: string]: unknown + } + | { + [key: string]: unknown + } + | { + command: "session.list" + [key: string]: + | { + command: string + } + | "session.list" + } + | { + title?: string + message: string + variant: "info" | "success" | "warning" | "error" + } path: { id: string } @@ -2552,7 +2652,12 @@ export type TuiClearPromptResponse = TuiClearPromptResponses[keyof TuiClearPromp export type TuiExecuteCommandData = { body?: { - command: string + command: "session.list" + [key: string]: + | { + command: string + } + | "session.list" } path?: never query?: { @@ -2601,6 +2706,41 @@ export type TuiShowToastResponses = { export type TuiShowToastResponse = TuiShowToastResponses[keyof TuiShowToastResponses] +export type TuiPublishData = { + body?: + | EventTuiPromptAppend + | EventTuiPromptSubmit + | EventTuiPromptClear + | EventTuiCommandExecute + | EventTuiSessionList + | EventTuiThemeList + | EventTuiModelList + | EventTuiToastShow + path?: never + query?: { + directory?: string + } + url: "/tui/publish" +} + +export type TuiPublishErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type TuiPublishError = TuiPublishErrors[keyof TuiPublishErrors] + +export type TuiPublishResponses = { + /** + * Event published successfully + */ + 200: boolean +} + +export type TuiPublishResponse = TuiPublishResponses[keyof TuiPublishResponses] + export type AuthSetData = { body?: Auth path: {