Skip to content

Commit f9b52a1

Browse files
feat(api): api update
1 parent 8d150d2 commit f9b52a1

File tree

6 files changed

+30
-17
lines changed

6 files changed

+30
-17
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-fb4caa8d0381531c44dd2d3c8c0b930b8c15a7bdde474d15bf7aeeb3b27aef56.yml
3-
openapi_spec_hash: 3a263e46f2369eeb2410430001c60d15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-5748199af356c3243a46a466e73b5d0bab7eaa0c56895e1d0f903d637f61d0bb.yml
3+
openapi_spec_hash: c04f6b6be54b05d9b1283c24e870163b
44
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3

api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Methods:
2121
Types:
2222

2323
- <code><a href="./src/resources/app.ts">App</a></code>
24-
- <code><a href="./src/resources/app.ts">LogLevel</a></code>
2524
- <code><a href="./src/resources/app.ts">Mode</a></code>
2625
- <code><a href="./src/resources/app.ts">Model</a></code>
2726
- <code><a href="./src/resources/app.ts">Provider</a></code>

src/client.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
AppModesResponse,
2525
AppProvidersResponse,
2626
AppResource,
27-
LogLevel,
2827
Mode,
2928
Model,
3029
Provider,
@@ -90,7 +89,7 @@ import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
9089
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
9190
import { readEnv } from './internal/utils/env';
9291
import {
93-
type LogLevel as ClientLogLevel,
92+
type LogLevel,
9493
type Logger,
9594
formatRequestDetails,
9695
loggerFor,
@@ -158,7 +157,7 @@ export interface ClientOptions {
158157
*
159158
* Defaults to process.env['OPENCODE_LOG'] or 'warn' if it isn't set.
160159
*/
161-
logLevel?: ClientLogLevel | undefined;
160+
logLevel?: LogLevel | undefined;
162161

163162
/**
164163
* Set the logger.
@@ -176,7 +175,7 @@ export class Opencode {
176175
maxRetries: number;
177176
timeout: number;
178177
logger: Logger | undefined;
179-
logLevel: ClientLogLevel | undefined;
178+
logLevel: LogLevel | undefined;
180179
fetchOptions: MergedRequestInit | undefined;
181180

182181
private fetch: Fetch;
@@ -778,7 +777,6 @@ export declare namespace Opencode {
778777
export {
779778
AppResource as AppResource,
780779
type App as App,
781-
type LogLevel as LogLevel,
782780
type Mode as Mode,
783781
type Model as Model,
784782
type Provider as Provider,

src/resources/app.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ export namespace App {
6969
}
7070
}
7171

72-
/**
73-
* Log level
74-
*/
75-
export type LogLevel = 'debug' | 'info' | 'error' | 'warn';
76-
7772
export interface Mode {
7873
name: string;
7974

@@ -162,7 +157,7 @@ export interface AppLogParams {
162157
/**
163158
* Log level
164159
*/
165-
level: LogLevel;
160+
level: 'debug' | 'info' | 'error' | 'warn';
166161

167162
/**
168163
* Log message
@@ -183,7 +178,6 @@ export interface AppLogParams {
183178
export declare namespace AppResource {
184179
export {
185180
type App as App,
186-
type LogLevel as LogLevel,
187181
type Mode as Mode,
188182
type Model as Model,
189183
type Provider as Provider,

src/resources/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export * from './shared';
44
export {
55
AppResource,
66
type App,
7-
type LogLevel,
87
type Mode,
98
type Model,
109
type Provider,

src/resources/session.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,30 @@ export interface FileSource {
219219

220220
export type Message = UserMessage | AssistantMessage;
221221

222-
export type Part = TextPart | FilePart | ToolPart | StepStartPart | StepFinishPart | SnapshotPart;
222+
export type Part =
223+
| TextPart
224+
| FilePart
225+
| ToolPart
226+
| StepStartPart
227+
| StepFinishPart
228+
| SnapshotPart
229+
| Part.PatchPart;
230+
231+
export namespace Part {
232+
export interface PatchPart {
233+
id: string;
234+
235+
files: Array<string>;
236+
237+
hash: string;
238+
239+
messageID: string;
240+
241+
sessionID: string;
242+
243+
type: 'patch';
244+
}
245+
}
223246

224247
export interface Session {
225248
id: string;

0 commit comments

Comments
 (0)