File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- configured_endpoints : 22
1+ configured_endpoints : 23
22openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-69b99aaffe10dd5247638b6a34d6c0b3c1cf5300853d12c947151fd946e7fcdb.yml
33openapi_spec_hash : e2c746cf689d71f04c6e9b1bd92e6356
4- config_hash : e64b350ea4abbb4d56d49b0adebacb02
4+ config_hash : d779331eb3dabf2d99f2a20be154d1c9
Original file line number Diff line number Diff line change @@ -126,3 +126,11 @@ Methods:
126126- <code title =" delete /session/{id}/share " >client.session.<a href =" ./src/resources/session.ts " >unshare</a >(id) -> Session</code >
127127
128128# Tui
129+
130+ Types:
131+
132+ - <code ><a href =" ./src/resources/tui.ts " >TuiPromptResponse</a ></code >
133+
134+ Methods:
135+
136+ - <code title =" post /tui/prompt " >client.tui.<a href =" ./src/resources/tui.ts " >prompt</a >() -> TuiPromptResponse</code >
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ import {
8282 ToolStateRunning ,
8383 UserMessage ,
8484} from './resources/session' ;
85- import { Tui } from './resources/tui' ;
85+ import { Tui , TuiPromptResponse } from './resources/tui' ;
8686import { type Fetch } from './internal/builtin-types' ;
8787import { HeadersLike , NullableHeaders , buildHeaders } from './internal/headers' ;
8888import { FinalRequestOptions , RequestOptions } from './internal/request-options' ;
@@ -849,7 +849,7 @@ export declare namespace Opencode {
849849 type SessionSummarizeParams as SessionSummarizeParams ,
850850 } ;
851851
852- export { Tui as Tui } ;
852+ export { Tui as Tui , type TuiPromptResponse as TuiPromptResponse } ;
853853
854854 export type MessageAbortedError = API . MessageAbortedError ;
855855 export type ProviderAuthError = API . ProviderAuthError ;
Original file line number Diff line number Diff line change @@ -73,4 +73,4 @@ export {
7373 type SessionInitParams ,
7474 type SessionSummarizeParams ,
7575} from './session' ;
76- export { Tui } from './tui' ;
76+ export { Tui , type TuiPromptResponse } from './tui' ;
Original file line number Diff line number Diff line change 11// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
33import { APIResource } from '../core/resource' ;
4+ import { APIPromise } from '../core/api-promise' ;
5+ import { RequestOptions } from '../internal/request-options' ;
46
5- export class Tui extends APIResource { }
7+ export class Tui extends APIResource {
8+ /**
9+ * Send a prompt to the TUI
10+ */
11+ prompt ( options ?: RequestOptions ) : APIPromise < TuiPromptResponse > {
12+ return this . _client . post ( '/tui/prompt' , options ) ;
13+ }
14+ }
15+
16+ export type TuiPromptResponse = boolean ;
17+
18+ export declare namespace Tui {
19+ export { type TuiPromptResponse as TuiPromptResponse } ;
20+ }
Original file line number Diff line number Diff line change 1+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+ import Opencode from '@opencode-ai/sdk' ;
4+
5+ const client = new Opencode ( { baseURL : process . env [ 'TEST_API_BASE_URL' ] ?? 'http://127.0.0.1:4010' } ) ;
6+
7+ describe ( 'resource tui' , ( ) => {
8+ // skipped: tests are disabled for the time being
9+ test . skip ( 'prompt' , async ( ) => {
10+ const responsePromise = client . tui . prompt ( ) ;
11+ const rawResponse = await responsePromise . asResponse ( ) ;
12+ expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
13+ const response = await responsePromise ;
14+ expect ( response ) . not . toBeInstanceOf ( Response ) ;
15+ const dataAndResponse = await responsePromise . withResponse ( ) ;
16+ expect ( dataAndResponse . data ) . toBe ( response ) ;
17+ expect ( dataAndResponse . response ) . toBe ( rawResponse ) ;
18+ } ) ;
19+ } ) ;
You can’t perform that action at this time.
0 commit comments