Skip to content

Commit df7ea7d

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

File tree

10 files changed

+136
-96
lines changed

10 files changed

+136
-96
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-5748199af356c3243a46a466e73b5d0bab7eaa0c56895e1d0f903d637f61d0bb.yml
3-
openapi_spec_hash: c04f6b6be54b05d9b1283c24e870163b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-be4c3fb58765ee2b56c3b548182b9d0f1a9d5ebb7c340083bc578bcf3876b026.yml
3+
openapi_spec_hash: dd5d801d838fd6b522b1dd892a75fce1
44
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3

api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Methods:
4141

4242
Types:
4343

44-
- <code><a href="./src/resources/find.ts">Match</a></code>
4544
- <code><a href="./src/resources/find.ts">Symbol</a></code>
4645
- <code><a href="./src/resources/find.ts">FindFilesResponse</a></code>
4746
- <code><a href="./src/resources/find.ts">FindSymbolsResponse</a></code>

src/client.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import {
4646
FindSymbolsResponse,
4747
FindTextParams,
4848
FindTextResponse,
49-
Match,
5049
Symbol,
5150
} from './resources/find';
5251
import {
@@ -789,7 +788,6 @@ export declare namespace Opencode {
789788

790789
export {
791790
Find as Find,
792-
type Match as Match,
793791
type Symbol as Symbol,
794792
type FindFilesResponse as FindFilesResponse,
795793
type FindSymbolsResponse as FindSymbolsResponse,

src/resources/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export interface Mode {
7777
model?: Mode.Model;
7878

7979
prompt?: string;
80+
81+
temperature?: number;
8082
}
8183

8284
export namespace Mode {

src/resources/config.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export interface Config {
2020
*/
2121
$schema?: string;
2222

23+
/**
24+
* Modes configuration, see https://opencode.ai/docs/modes
25+
*/
26+
agent?: Config.Agent;
27+
2328
/**
2429
* @deprecated Use 'share' field instead. Share newly created sessions
2530
* automatically
@@ -97,6 +102,33 @@ export interface Config {
97102
}
98103

99104
export namespace Config {
105+
/**
106+
* Modes configuration, see https://opencode.ai/docs/modes
107+
*/
108+
export interface Agent {
109+
general?: Agent.General;
110+
111+
[k: string]: Agent.AgentConfig | undefined;
112+
}
113+
114+
export namespace Agent {
115+
export interface General extends ConfigAPI.ModeConfig {
116+
description: string;
117+
}
118+
119+
export interface AgentConfig extends ConfigAPI.ModeConfig {
120+
description: string;
121+
}
122+
}
123+
124+
export interface AgentConfig extends ConfigAPI.ModeConfig {
125+
description: string;
126+
}
127+
128+
export interface AgentConfig extends ConfigAPI.ModeConfig {
129+
description: string;
130+
}
131+
100132
export interface Experimental {
101133
hook?: Experimental.Hook;
102134
}
@@ -438,10 +470,14 @@ export interface McpRemoteConfig {
438470
}
439471

440472
export interface ModeConfig {
473+
disable?: boolean;
474+
441475
model?: string;
442476

443477
prompt?: string;
444478

479+
temperature?: number;
480+
445481
tools?: { [key: string]: boolean };
446482
}
447483

src/resources/event.ts

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ export class Event extends APIResource {
1717
}
1818

1919
export type EventListResponse =
20-
| EventListResponse.EventLspClientDiagnostics
21-
| EventListResponse.EventPermissionUpdated
22-
| EventListResponse.EventFileEdited
2320
| EventListResponse.EventInstallationUpdated
21+
| EventListResponse.EventLspClientDiagnostics
2422
| EventListResponse.EventMessageUpdated
2523
| EventListResponse.EventMessageRemoved
2624
| EventListResponse.EventMessagePartUpdated
2725
| EventListResponse.EventMessagePartRemoved
2826
| EventListResponse.EventStorageWrite
27+
| EventListResponse.EventPermissionUpdated
28+
| EventListResponse.EventFileEdited
2929
| EventListResponse.EventSessionUpdated
3030
| EventListResponse.EventSessionDeleted
3131
| EventListResponse.EventSessionIdle
@@ -34,67 +34,29 @@ export type EventListResponse =
3434
| EventListResponse.EventIdeInstalled;
3535

3636
export namespace EventListResponse {
37-
export interface EventLspClientDiagnostics {
38-
properties: EventLspClientDiagnostics.Properties;
39-
40-
type: 'lsp.client.diagnostics';
41-
}
42-
43-
export namespace EventLspClientDiagnostics {
44-
export interface Properties {
45-
path: string;
46-
47-
serverID: string;
48-
}
49-
}
50-
51-
export interface EventPermissionUpdated {
52-
properties: EventPermissionUpdated.Properties;
37+
export interface EventInstallationUpdated {
38+
properties: EventInstallationUpdated.Properties;
5339

54-
type: 'permission.updated';
40+
type: 'installation.updated';
5541
}
5642

57-
export namespace EventPermissionUpdated {
43+
export namespace EventInstallationUpdated {
5844
export interface Properties {
59-
id: string;
60-
61-
metadata: { [key: string]: unknown };
62-
63-
sessionID: string;
64-
65-
time: Properties.Time;
66-
67-
title: string;
68-
}
69-
70-
export namespace Properties {
71-
export interface Time {
72-
created: number;
73-
}
45+
version: string;
7446
}
7547
}
7648

77-
export interface EventFileEdited {
78-
properties: EventFileEdited.Properties;
49+
export interface EventLspClientDiagnostics {
50+
properties: EventLspClientDiagnostics.Properties;
7951

80-
type: 'file.edited';
52+
type: 'lsp.client.diagnostics';
8153
}
8254

83-
export namespace EventFileEdited {
55+
export namespace EventLspClientDiagnostics {
8456
export interface Properties {
85-
file: string;
86-
}
87-
}
88-
89-
export interface EventInstallationUpdated {
90-
properties: EventInstallationUpdated.Properties;
91-
92-
type: 'installation.updated';
93-
}
57+
path: string;
9458

95-
export namespace EventInstallationUpdated {
96-
export interface Properties {
97-
version: string;
59+
serverID: string;
9860
}
9961
}
10062

@@ -164,6 +126,44 @@ export namespace EventListResponse {
164126
}
165127
}
166128

129+
export interface EventPermissionUpdated {
130+
properties: EventPermissionUpdated.Properties;
131+
132+
type: 'permission.updated';
133+
}
134+
135+
export namespace EventPermissionUpdated {
136+
export interface Properties {
137+
id: string;
138+
139+
metadata: { [key: string]: unknown };
140+
141+
sessionID: string;
142+
143+
time: Properties.Time;
144+
145+
title: string;
146+
}
147+
148+
export namespace Properties {
149+
export interface Time {
150+
created: number;
151+
}
152+
}
153+
}
154+
155+
export interface EventFileEdited {
156+
properties: EventFileEdited.Properties;
157+
158+
type: 'file.edited';
159+
}
160+
161+
export namespace EventFileEdited {
162+
export interface Properties {
163+
file: string;
164+
}
165+
}
166+
167167
export interface EventSessionUpdated {
168168
properties: EventSessionUpdated.Properties;
169169

src/resources/find.ts

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,6 @@ export class Find extends APIResource {
2727
}
2828
}
2929

30-
export interface Match {
31-
absolute_offset: number;
32-
33-
line_number: number;
34-
35-
lines: Match.Lines;
36-
37-
path: Match.Path;
38-
39-
submatches: Array<Match.Submatch>;
40-
}
41-
42-
export namespace Match {
43-
export interface Lines {
44-
text: string;
45-
}
46-
47-
export interface Path {
48-
text: string;
49-
}
50-
51-
export interface Submatch {
52-
end: number;
53-
54-
match: Submatch.Match;
55-
56-
start: number;
57-
}
58-
59-
export namespace Submatch {
60-
export interface Match {
61-
text: string;
62-
}
63-
}
64-
}
65-
6630
export interface Symbol {
6731
kind: number;
6832

@@ -105,7 +69,45 @@ export type FindFilesResponse = Array<string>;
10569

10670
export type FindSymbolsResponse = Array<Symbol>;
10771

108-
export type FindTextResponse = Array<Match>;
72+
export type FindTextResponse = Array<FindTextResponse.FindTextResponseItem>;
73+
74+
export namespace FindTextResponse {
75+
export interface FindTextResponseItem {
76+
absolute_offset: number;
77+
78+
line_number: number;
79+
80+
lines: FindTextResponseItem.Lines;
81+
82+
path: FindTextResponseItem.Path;
83+
84+
submatches: Array<FindTextResponseItem.Submatch>;
85+
}
86+
87+
export namespace FindTextResponseItem {
88+
export interface Lines {
89+
text: string;
90+
}
91+
92+
export interface Path {
93+
text: string;
94+
}
95+
96+
export interface Submatch {
97+
end: number;
98+
99+
match: Submatch.Match;
100+
101+
start: number;
102+
}
103+
104+
export namespace Submatch {
105+
export interface Match {
106+
text: string;
107+
}
108+
}
109+
}
110+
}
109111

110112
export interface FindFilesParams {
111113
query: string;
@@ -121,7 +123,6 @@ export interface FindTextParams {
121123

122124
export declare namespace Find {
123125
export {
124-
type Match as Match,
125126
type Symbol as Symbol,
126127
type FindFilesResponse as FindFilesResponse,
127128
type FindSymbolsResponse as FindSymbolsResponse,

src/resources/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export {
3131
} from './file';
3232
export {
3333
Find,
34-
type Match,
3534
type Symbol,
3635
type FindFilesResponse,
3736
type FindSymbolsResponse,

src/resources/session.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ export namespace Session {
270270
export interface Revert {
271271
messageID: string;
272272

273+
diff?: string;
274+
273275
partID?: string;
274276

275277
snapshot?: string;
@@ -541,6 +543,8 @@ export interface SessionChatParams {
541543

542544
mode?: string;
543545

546+
system?: string;
547+
544548
tools?: { [key: string]: boolean };
545549
}
546550

tests/api-resources/session.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ describe('resource session', () => {
7777
providerID: 'providerID',
7878
messageID: 'msg',
7979
mode: 'mode',
80+
system: 'system',
8081
tools: { foo: true },
8182
});
8283
});

0 commit comments

Comments
 (0)