mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
sync
This commit is contained in:
parent
3e31ee0973
commit
292026258f
3 changed files with 162 additions and 4 deletions
1
bun.lock
1
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:",
|
||||
|
|
|
|||
|
|
@ -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<ThrowOnError extends boolean = false>(options?: Options<TuiPublishData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<TuiPublishResponses, TuiPublishErrors, ThrowOnError>({
|
||||
url: "/tui/publish",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Auth extends _HeyApiClient {
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue