diff --git a/.stats.yml b/.stats.yml index 2ff039c..56337c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-04eaffcca7fcec3eba3c34ba4e91ba830867173c552015a0abfd65e25084d9b5.yml -openapi_spec_hash: 4dfbcc2ce25451592f610e372ecad0cb +configured_endpoints: 24 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-d10809ab68e48a338167e5504d69db2a0a80739adf6ecd3f065644a4139bc374.yml +openapi_spec_hash: 4875565ef8df3446dbab11f450e04c51 config_hash: 0032a76356d31c6b4c218b39fff635bb diff --git a/api.md b/api.md index 69f9bd6..983e134 100644 --- a/api.md +++ b/api.md @@ -133,4 +133,5 @@ Methods: Methods: +- client.Tui.OpenHelp(ctx context.Context) (bool, error) - client.Tui.Prompt(ctx context.Context, body opencode.TuiPromptParams) (bool, error) diff --git a/tui.go b/tui.go index b94bb85..c1396d2 100644 --- a/tui.go +++ b/tui.go @@ -31,6 +31,14 @@ func NewTuiService(opts ...option.RequestOption) (r *TuiService) { return } +// Open the help dialog +func (r *TuiService) OpenHelp(ctx context.Context, opts ...option.RequestOption) (res *bool, err error) { + opts = append(r.Options[:], opts...) + path := "tui/open-help" + err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &res, opts...) + return +} + // Send a prompt to the TUI func (r *TuiService) Prompt(ctx context.Context, body TuiPromptParams, opts ...option.RequestOption) (res *bool, err error) { opts = append(r.Options[:], opts...) diff --git a/tui_test.go b/tui_test.go index 7c9bb59..620f212 100644 --- a/tui_test.go +++ b/tui_test.go @@ -13,6 +13,28 @@ import ( "github.com/sst/opencode-sdk-go/option" ) +func TestTuiOpenHelp(t *testing.T) { + t.Skip("skipped: tests are disabled for the time being") + baseURL := "http://localhost:4010" + if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok { + baseURL = envURL + } + if !testutil.CheckTestServer(t, baseURL) { + return + } + client := opencode.NewClient( + option.WithBaseURL(baseURL), + ) + _, err := client.Tui.OpenHelp(context.TODO()) + if err != nil { + var apierr *opencode.Error + if errors.As(err, &apierr) { + t.Log(string(apierr.DumpRequest(true))) + } + t.Fatalf("err should be nil: %s", err.Error()) + } +} + func TestTuiPrompt(t *testing.T) { t.Skip("skipped: tests are disabled for the time being") baseURL := "http://localhost:4010"