diff options
Diffstat (limited to 'packages/sdk')
| -rw-r--r-- | packages/sdk/js/src/gen/sdk.gen.ts | 15 | ||||
| -rw-r--r-- | packages/sdk/js/src/gen/types.gen.ts | 35 |
2 files changed, 50 insertions, 0 deletions
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<ThrowOnError extends boolean = false>(options?: Options<VcsGetData, ThrowOnError>) { + return (options?.client ?? this._client).get<VcsGetResponses, unknown, ThrowOnError>({ + 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 |
