summaryrefslogtreecommitdiffhomepage
path: root/packages/sdk
diff options
context:
space:
mode:
authorYuku Kotani <[email protected]>2025-11-02 00:14:39 +0900
committerGitHub <[email protected]>2025-11-01 11:14:39 -0400
commit2fe7d13e692bf9053466a3bd0a23ff3d6de0bc03 (patch)
tree2b2834e5536c33919f0353135a17eb304e1a7e44 /packages/sdk
parent1bc3c98ae70e1ce9b07572fa7766b5a4bea240e7 (diff)
downloadopencode-2fe7d13e692bf9053466a3bd0a23ff3d6de0bc03.tar.gz
opencode-2fe7d13e692bf9053466a3bd0a23ff3d6de0bc03.zip
Add formatter status display to TUI status dialog (#3701)
Diffstat (limited to 'packages/sdk')
-rw-r--r--packages/sdk/js/src/gen/sdk.gen.ts17
-rw-r--r--packages/sdk/js/src/gen/types.gen.ts35
2 files changed, 52 insertions, 0 deletions
diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts
index 1dcdd8067..b76b6996f 100644
--- a/packages/sdk/js/src/gen/sdk.gen.ts
+++ b/packages/sdk/js/src/gen/sdk.gen.ts
@@ -107,6 +107,8 @@ import type {
McpStatusResponses,
LspStatusData,
LspStatusResponses,
+ FormatterStatusData,
+ FormatterStatusResponses,
TuiAppendPromptData,
TuiAppendPromptResponses,
TuiAppendPromptErrors,
@@ -773,6 +775,20 @@ class Lsp extends _HeyApiClient {
}
}
+class Formatter extends _HeyApiClient {
+ /**
+ * Get formatter status
+ */
+ public status<ThrowOnError extends boolean = false>(
+ options?: Options<FormatterStatusData, ThrowOnError>,
+ ) {
+ return (options?.client ?? this._client).get<FormatterStatusResponses, unknown, ThrowOnError>({
+ url: "/formatter",
+ ...options,
+ })
+ }
+}
+
class Control extends _HeyApiClient {
/**
* Get the next TUI request from the queue
@@ -1023,6 +1039,7 @@ export class OpencodeClient extends _HeyApiClient {
app = new App({ client: this._client })
mcp = new Mcp({ client: this._client })
lsp = new Lsp({ client: this._client })
+ formatter = new Formatter({ client: this._client })
tui = new Tui({ client: this._client })
auth = new Auth({ client: this._client })
event = new Event({ client: this._client })
diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts
index 63673e762..fb0371cda 100644
--- a/packages/sdk/js/src/gen/types.gen.ts
+++ b/packages/sdk/js/src/gen/types.gen.ts
@@ -1070,6 +1070,12 @@ export type LspStatus = {
status: "connected" | "error"
}
+export type FormatterStatus = {
+ name: string
+ extensions: Array<string>
+ enabled: boolean
+}
+
export type EventTuiPromptAppend = {
type: "tui.prompt.append"
properties: {
@@ -1248,6 +1254,16 @@ export type EventTodoUpdated = {
}
}
+export type EventCommandExecuted = {
+ type: "command.executed"
+ properties: {
+ name: string
+ sessionID: string
+ arguments: string
+ messageID: string
+ }
+}
+
export type EventSessionIdle = {
type: "session.idle"
properties: {
@@ -1310,6 +1326,7 @@ export type Event =
| EventFileEdited
| EventFileWatcherUpdated
| EventTodoUpdated
+ | EventCommandExecuted
| EventSessionIdle
| EventSessionCreated
| EventSessionUpdated
@@ -2511,6 +2528,24 @@ export type LspStatusResponses = {
export type LspStatusResponse = LspStatusResponses[keyof LspStatusResponses]
+export type FormatterStatusData = {
+ body?: never
+ path?: never
+ query?: {
+ directory?: string
+ }
+ url: "/formatter"
+}
+
+export type FormatterStatusResponses = {
+ /**
+ * Formatter status
+ */
+ 200: Array<FormatterStatus>
+}
+
+export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses]
+
export type TuiAppendPromptData = {
body?: {
text: string