Skip to content

Commit 063d67a

Browse files
author
opencode
committed
release: v0.4.1
1 parent 4f164c5 commit 063d67a

8 files changed

Lines changed: 98 additions & 55 deletions

File tree

packages/function/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode/function",
3-
"version": "0.3.133",
3+
"version": "0.4.1",
44
"$schema": "https://json.schemastore.org/package.json",
55
"private": true,
66
"type": "module",

packages/opencode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
3-
"version": "0.3.133",
3+
"version": "0.4.1",
44
"name": "opencode",
55
"type": "module",
66
"private": true,

packages/plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@opencode-ai/plugin",
4-
"version": "0.3.133",
4+
"version": "0.4.1",
55
"type": "module",
66
"scripts": {
77
"typecheck": "tsc --noEmit"

packages/sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@opencode-ai/sdk",
4-
"version": "0.3.133",
4+
"version": "0.4.1",
55
"type": "module",
66
"scripts": {
77
"typecheck": "tsc --noEmit"

packages/sdk/js/src/gen/sdk.gen.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import type {
1515
SessionCreateData,
1616
SessionCreateResponses,
1717
SessionCreateErrors,
18-
SessionGetData,
19-
SessionGetResponses,
2018
SessionDeleteData,
2119
SessionDeleteResponses,
20+
SessionGetData,
21+
SessionGetResponses,
2222
SessionInitData,
2323
SessionInitResponses,
2424
SessionAbortData,
@@ -55,8 +55,8 @@ import type {
5555
FileStatusResponses,
5656
AppLogData,
5757
AppLogResponses,
58-
AppModesData,
59-
AppModesResponses,
58+
AppAgentsData,
59+
AppAgentsResponses,
6060
TuiAppendPromptData,
6161
TuiAppendPromptResponses,
6262
TuiOpenHelpData,
@@ -151,11 +151,11 @@ class App extends _HeyApiClient {
151151
}
152152

153153
/**
154-
* List all modes
154+
* List all agents
155155
*/
156-
public modes<ThrowOnError extends boolean = false>(options?: Options<AppModesData, ThrowOnError>) {
157-
return (options?.client ?? this._client).get<AppModesResponses, unknown, ThrowOnError>({
158-
url: "/mode",
156+
public agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>) {
157+
return (options?.client ?? this._client).get<AppAgentsResponses, unknown, ThrowOnError>({
158+
url: "/agent",
159159
...options,
160160
})
161161
}
@@ -205,20 +205,20 @@ class Session extends _HeyApiClient {
205205
}
206206

207207
/**
208-
* Get session
208+
* Delete a session and all its data
209209
*/
210-
public get<ThrowOnError extends boolean = false>(options: Options<SessionGetData, ThrowOnError>) {
211-
return (options.client ?? this._client).get<SessionGetResponses, unknown, ThrowOnError>({
212-
url: "/session/{sessionID}",
210+
public delete<ThrowOnError extends boolean = false>(options: Options<SessionDeleteData, ThrowOnError>) {
211+
return (options.client ?? this._client).delete<SessionDeleteResponses, unknown, ThrowOnError>({
212+
url: "/session/{id}",
213213
...options,
214214
})
215215
}
216216

217217
/**
218-
* Delete a session and all its data
218+
* Get session
219219
*/
220-
public delete<ThrowOnError extends boolean = false>(options: Options<SessionDeleteData, ThrowOnError>) {
221-
return (options.client ?? this._client).delete<SessionDeleteResponses, unknown, ThrowOnError>({
220+
public get<ThrowOnError extends boolean = false>(options: Options<SessionGetData, ThrowOnError>) {
221+
return (options.client ?? this._client).get<SessionGetResponses, unknown, ThrowOnError>({
222222
url: "/session/{id}",
223223
...options,
224224
})
@@ -471,7 +471,7 @@ class Tui extends _HeyApiClient {
471471
}
472472

473473
/**
474-
* Execute a TUI command (e.g. switch_mode)
474+
* Execute a TUI command (e.g. switch_agent)
475475
*/
476476
public executeCommand<ThrowOnError extends boolean = false>(options?: Options<TuiExecuteCommandData, ThrowOnError>) {
477477
return (options?.client ?? this._client).post<TuiExecuteCommandResponses, unknown, ThrowOnError>({

packages/sdk/js/src/gen/types.gen.ts

Lines changed: 76 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ export type Part =
200200
| ({
201201
type: "patch"
202202
} & PatchPart)
203+
| ({
204+
type: "agent"
205+
} & AgentPart)
203206

204207
export type TextPart = {
205208
id: string
@@ -374,6 +377,19 @@ export type PatchPart = {
374377
files: Array<string>
375378
}
376379

380+
export type AgentPart = {
381+
id: string
382+
sessionID: string
383+
messageID: string
384+
type: string
385+
name: string
386+
source?: {
387+
value: string
388+
start: number
389+
end: number
390+
}
391+
}
392+
377393
export type EventMessagePartRemoved = {
378394
type: string
379395
properties: {
@@ -567,17 +583,19 @@ export type Config = {
567583
*/
568584
username?: string
569585
/**
570-
* Modes configuration, see https://opencode.ai/docs/modes
586+
* @deprecated Use `agent` field instead.
571587
*/
572588
mode?: {
573-
build?: ModeConfig
574-
plan?: ModeConfig
575-
[key: string]: ModeConfig | undefined
589+
build?: AgentConfig
590+
plan?: AgentConfig
591+
[key: string]: AgentConfig | undefined
576592
}
577593
/**
578-
* Modes configuration, see https://opencode.ai/docs/modes
594+
* Agent configuration, see https://opencode.ai/docs/agent
579595
*/
580596
agent?: {
597+
plan?: AgentConfig
598+
build?: AgentConfig
581599
general?: AgentConfig
582600
[key: string]: AgentConfig | undefined
583601
}
@@ -704,13 +722,21 @@ export type KeybindsConfig = {
704722
*/
705723
app_help: string
706724
/**
707-
* Next mode
725+
* @deprecated use switch_agent. Next mode
708726
*/
709727
switch_mode: string
710728
/**
711-
* Previous Mode
729+
* @deprecated use switch_agent_reverse. Previous mode
712730
*/
713731
switch_mode_reverse: string
732+
/**
733+
* Next agent
734+
*/
735+
switch_agent: string
736+
/**
737+
* Previous agent
738+
*/
739+
switch_agent_reverse: string
714740
/**
715741
* Open external editor
716742
*/
@@ -849,7 +875,7 @@ export type KeybindsConfig = {
849875
app_exit: string
850876
}
851877

852-
export type ModeConfig = {
878+
export type AgentConfig = {
853879
model?: string
854880
temperature?: number
855881
top_p?: number
@@ -858,10 +884,11 @@ export type ModeConfig = {
858884
[key: string]: boolean
859885
}
860886
disable?: boolean
861-
}
862-
863-
export type AgentConfig = ModeConfig & {
864-
description: string
887+
/**
888+
* Description of when to use the agent
889+
*/
890+
description?: string
891+
mode?: string
865892
}
866893

867894
export type Provider = {
@@ -968,6 +995,17 @@ export type FilePartInput = {
968995
source?: FilePartSource
969996
}
970997

998+
export type AgentPartInput = {
999+
id?: string
1000+
type: string
1001+
name: string
1002+
source?: {
1003+
value: string
1004+
start: number
1005+
end: number
1006+
}
1007+
}
1008+
9711009
export type Symbol = {
9721010
name: string
9731011
kind: number
@@ -984,10 +1022,12 @@ export type File = {
9841022
status: "added" | "deleted" | "modified"
9851023
}
9861024

987-
export type Mode = {
1025+
export type Agent = {
9881026
name: string
989-
temperature?: number
1027+
description?: string
1028+
mode: string
9901029
topP?: number
1030+
temperature?: number
9911031
model?: {
9921032
modelID: string
9931033
providerID: string
@@ -1103,25 +1143,25 @@ export type SessionCreateResponses = {
11031143

11041144
export type SessionCreateResponse = SessionCreateResponses[keyof SessionCreateResponses]
11051145

1106-
export type SessionGetData = {
1146+
export type SessionDeleteData = {
11071147
body?: never
11081148
path: {
1109-
sessionID: string
1149+
id: string
11101150
}
11111151
query?: never
1112-
url: "/session/{sessionID}"
1152+
url: "/session/{id}"
11131153
}
11141154

1115-
export type SessionGetResponses = {
1155+
export type SessionDeleteResponses = {
11161156
/**
1117-
* Get session
1157+
* Successfully deleted session
11181158
*/
1119-
200: Session
1159+
200: boolean
11201160
}
11211161

1122-
export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses]
1162+
export type SessionDeleteResponse = SessionDeleteResponses[keyof SessionDeleteResponses]
11231163

1124-
export type SessionDeleteData = {
1164+
export type SessionGetData = {
11251165
body?: never
11261166
path: {
11271167
id: string
@@ -1130,14 +1170,14 @@ export type SessionDeleteData = {
11301170
url: "/session/{id}"
11311171
}
11321172

1133-
export type SessionDeleteResponses = {
1173+
export type SessionGetResponses = {
11341174
/**
1135-
* Successfully deleted session
1175+
* Get session
11361176
*/
1137-
200: boolean
1177+
200: Session
11381178
}
11391179

1140-
export type SessionDeleteResponse = SessionDeleteResponses[keyof SessionDeleteResponses]
1180+
export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses]
11411181

11421182
export type SessionInitData = {
11431183
body?: {
@@ -1271,7 +1311,7 @@ export type SessionChatData = {
12711311
messageID?: string
12721312
providerID: string
12731313
modelID: string
1274-
mode?: string
1314+
agent?: string
12751315
system?: string
12761316
tools?: {
12771317
[key: string]: boolean
@@ -1283,6 +1323,9 @@ export type SessionChatData = {
12831323
| ({
12841324
type: "file"
12851325
} & FilePartInput)
1326+
| ({
1327+
type: "agent"
1328+
} & AgentPartInput)
12861329
>
12871330
}
12881331
path: {
@@ -1556,21 +1599,21 @@ export type AppLogResponses = {
15561599

15571600
export type AppLogResponse = AppLogResponses[keyof AppLogResponses]
15581601

1559-
export type AppModesData = {
1602+
export type AppAgentsData = {
15601603
body?: never
15611604
path?: never
15621605
query?: never
1563-
url: "/mode"
1606+
url: "/agent"
15641607
}
15651608

1566-
export type AppModesResponses = {
1609+
export type AppAgentsResponses = {
15671610
/**
1568-
* List of modes
1611+
* List of agents
15691612
*/
1570-
200: Array<Mode>
1613+
200: Array<Agent>
15711614
}
15721615

1573-
export type AppModesResponse = AppModesResponses[keyof AppModesResponses]
1616+
export type AppAgentsResponse = AppAgentsResponses[keyof AppAgentsResponses]
15741617

15751618
export type TuiAppendPromptData = {
15761619
body?: {

packages/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@opencode/web",
33
"type": "module",
4-
"version": "0.3.133",
4+
"version": "0.4.1",
55
"scripts": {
66
"dev": "astro dev",
77
"dev:remote": "sst shell --stage=dev --target=Web astro dev",

sdks/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "opencode",
33
"displayName": "opencode",
44
"description": "opencode for VS Code",
5-
"version": "0.3.133",
5+
"version": "0.4.1",
66
"publisher": "sst-dev",
77
"repository": {
88
"type": "git",

0 commit comments

Comments
 (0)