diff options
| author | Adam <[email protected]> | 2026-01-15 13:33:21 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-19 07:35:52 -0600 |
| commit | 093a3e7876bfec4bdfc57f580e37875d6fe9e4cb (patch) | |
| tree | 1eaa32bdc0aa2a71296c2ac68f07d4fc67cd02b7 /packages/sdk/js/src | |
| parent | f26de6c52f7442762973155c26743d3494fb5887 (diff) | |
| download | opencode-093a3e7876bfec4bdfc57f580e37875d6fe9e4cb.tar.gz opencode-093a3e7876bfec4bdfc57f580e37875d6fe9e4cb.zip | |
feat(app): reset worktree
Diffstat (limited to 'packages/sdk/js/src')
| -rw-r--r-- | packages/sdk/js/src/v2/gen/sdk.gen.ts | 38 | ||||
| -rw-r--r-- | packages/sdk/js/src/v2/gen/types.gen.ts | 31 |
2 files changed, 69 insertions, 0 deletions
diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index ba299f81f..59b7f0696 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -165,6 +165,9 @@ import type { WorktreeRemoveErrors, WorktreeRemoveInput, WorktreeRemoveResponses, + WorktreeResetErrors, + WorktreeResetInput, + WorktreeResetResponses, } from "./types.gen.js" export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2< @@ -745,6 +748,41 @@ export class Worktree extends HeyApiClient { }, }) } + + /** + * Reset worktree + * + * Reset a worktree branch to the primary default branch. + */ + public reset<ThrowOnError extends boolean = false>( + parameters?: { + directory?: string + worktreeResetInput?: WorktreeResetInput + }, + options?: Options<never, ThrowOnError>, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "query", key: "directory" }, + { key: "worktreeResetInput", map: "body" }, + ], + }, + ], + ) + return (options?.client ?? this.client).post<WorktreeResetResponses, WorktreeResetErrors, ThrowOnError>({ + url: "/experimental/worktree/reset", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } } export class Resource extends HeyApiClient { diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index 58d3c3ae2..75540f907 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -1912,6 +1912,10 @@ export type WorktreeRemoveInput = { directory: string } +export type WorktreeResetInput = { + directory: string +} + export type McpResource = { name: string uri: string @@ -2630,6 +2634,33 @@ export type WorktreeCreateResponses = { export type WorktreeCreateResponse = WorktreeCreateResponses[keyof WorktreeCreateResponses] +export type WorktreeResetData = { + body?: WorktreeResetInput + path?: never + query?: { + directory?: string + } + url: "/experimental/worktree/reset" +} + +export type WorktreeResetErrors = { + /** + * Bad request + */ + 400: BadRequestError +} + +export type WorktreeResetError = WorktreeResetErrors[keyof WorktreeResetErrors] + +export type WorktreeResetResponses = { + /** + * Worktree reset + */ + 200: boolean +} + +export type WorktreeResetResponse = WorktreeResetResponses[keyof WorktreeResetResponses] + export type ExperimentalResourceListData = { body?: never path?: never |
