From 09bc8d9ca496bc338396b5c3cb90bbb1d8b79f8a Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Tue, 25 Nov 2025 19:39:20 -0800 Subject: show current git branch in tui (#4765) Co-authored-by: GitHub Action --- packages/sdk/js/src/gen/sdk.gen.ts | 15 +++++++++++++++ packages/sdk/js/src/gen/types.gen.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) (limited to 'packages/sdk') diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts index afc9696f1..0dc470566 100644 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ b/packages/sdk/js/src/gen/sdk.gen.ts @@ -23,6 +23,8 @@ import type { InstanceDisposeResponses, PathGetData, PathGetResponses, + VcsGetData, + VcsGetResponses, SessionListData, SessionListResponses, SessionCreateData, @@ -311,6 +313,18 @@ class Path extends _HeyApiClient { } } +class Vcs extends _HeyApiClient { + /** + * Get VCS info for the current instance + */ + public get(options?: Options) { + return (options?.client ?? this._client).get({ + url: "/vcs", + ...options, + }) + } +} + class Session extends _HeyApiClient { /** * List all sessions @@ -995,6 +1009,7 @@ export class OpencodeClient extends _HeyApiClient { tool = new Tool({ client: this._client }) instance = new Instance({ client: this._client }) path = new Path({ client: this._client }) + vcs = new Vcs({ client: this._client }) session = new Session({ client: this._client }) command = new Command({ client: this._client }) provider = new Provider({ client: this._client }) diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index 6e3b8c071..7e211148f 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -589,6 +589,13 @@ export type EventSessionError = { } } +export type EventVcsChanged = { + type: "vcs.changed" + properties: { + branch?: string + } +} + export type EventTuiPromptAppend = { type: "tui.prompt.append" properties: { @@ -670,6 +677,7 @@ export type Event = | EventSessionDeleted | EventSessionDiff | EventSessionError + | EventVcsChanged | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow @@ -1251,6 +1259,15 @@ export type Path = { directory: string } +export type VcsInfo = { + worktree: string + directory: string + projectID: string + vcs?: { + branch: string + } +} + export type NotFoundError = { name: "NotFoundError" data: { @@ -1687,6 +1704,24 @@ export type PathGetResponses = { export type PathGetResponse = PathGetResponses[keyof PathGetResponses] +export type VcsGetData = { + body?: never + path?: never + query?: { + directory?: string + } + url: "/vcs" +} + +export type VcsGetResponses = { + /** + * VCS info + */ + 200: VcsInfo +} + +export type VcsGetResponse = VcsGetResponses[keyof VcsGetResponses] + export type SessionListData = { body?: never path?: never -- cgit v1.2.3