summaryrefslogtreecommitdiffhomepage
path: root/packages/sdk/js
diff options
context:
space:
mode:
authoropencode <[email protected]>2025-10-07 03:32:10 +0000
committeropencode <[email protected]>2025-10-07 03:32:10 +0000
commite3f9e7785eb8ee94c52a2c5c05532b022b6bee83 (patch)
tree632ad603c800447c99f409288e2ce35b6da96d05 /packages/sdk/js
parenta20fc2dfdf0b54fddc6cc839be2db99045a52cbd (diff)
downloadopencode-e3f9e7785eb8ee94c52a2c5c05532b022b6bee83.tar.gz
opencode-e3f9e7785eb8ee94c52a2c5c05532b022b6bee83.zip
release: v0.14.4
Diffstat (limited to 'packages/sdk/js')
-rw-r--r--packages/sdk/js/package.json2
-rw-r--r--packages/sdk/js/src/gen/sdk.gen.ts28
-rw-r--r--packages/sdk/js/src/gen/types.gen.ts77
3 files changed, 104 insertions, 3 deletions
diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json
index 2e13ace51..67007bcf6 100644
--- a/packages/sdk/js/package.json
+++ b/packages/sdk/js/package.json
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/sdk",
- "version": "0.14.3",
+ "version": "0.14.4",
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit",
diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts
index ab49e18d2..aea90daec 100644
--- a/packages/sdk/js/src/gen/sdk.gen.ts
+++ b/packages/sdk/js/src/gen/sdk.gen.ts
@@ -32,8 +32,12 @@ import type {
SessionUpdateResponses,
SessionChildrenData,
SessionChildrenResponses,
+ SessionTodoData,
+ SessionTodoResponses,
SessionInitData,
SessionInitResponses,
+ SessionForkData,
+ SessionForkResponses,
SessionAbortData,
SessionAbortResponses,
SessionUnshareData,
@@ -293,6 +297,16 @@ class Session extends _HeyApiClient {
}
/**
+ * Get the todo list for a session
+ */
+ public todo<ThrowOnError extends boolean = false>(options: Options<SessionTodoData, ThrowOnError>) {
+ return (options.client ?? this._client).get<SessionTodoResponses, unknown, ThrowOnError>({
+ url: "/session/{id}/todo",
+ ...options,
+ })
+ }
+
+ /**
* Analyze the app and create an AGENTS.md file
*/
public init<ThrowOnError extends boolean = false>(options: Options<SessionInitData, ThrowOnError>) {
@@ -307,6 +321,20 @@ class Session extends _HeyApiClient {
}
/**
+ * Fork an existing session at a specific message
+ */
+ public fork<ThrowOnError extends boolean = false>(options: Options<SessionForkData, ThrowOnError>) {
+ return (options.client ?? this._client).post<SessionForkResponses, unknown, ThrowOnError>({
+ url: "/session/{id}/fork",
+ ...options,
+ headers: {
+ "Content-Type": "application/json",
+ ...options.headers,
+ },
+ })
+ }
+
+ /**
* Abort a session
*/
public abort<ThrowOnError extends boolean = false>(options: Options<SessionAbortData, ThrowOnError>) {
diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts
index b62bc096f..c255cc69c 100644
--- a/packages/sdk/js/src/gen/types.gen.ts
+++ b/packages/sdk/js/src/gen/types.gen.ts
@@ -550,6 +550,25 @@ export type Session = {
}
}
+export type Todo = {
+ /**
+ * Brief description of the task
+ */
+ content: string
+ /**
+ * Current status of the task: pending, in_progress, completed, cancelled
+ */
+ status: string
+ /**
+ * Priority level of the task: high, medium, low
+ */
+ priority: string
+ /**
+ * Unique identifier for the todo item
+ */
+ id: string
+}
+
export type UserMessage = {
id: string
sessionID: string
@@ -1093,6 +1112,14 @@ export type EventFileWatcherUpdated = {
}
}
+export type EventTodoUpdated = {
+ type: "todo.updated"
+ properties: {
+ sessionID: string
+ todos: Array<Todo>
+ }
+}
+
export type EventSessionIdle = {
type: "session.idle"
properties: {
@@ -1148,6 +1175,7 @@ export type Event =
| EventPermissionReplied
| EventFileEdited
| EventFileWatcherUpdated
+ | EventTodoUpdated
| EventSessionIdle
| EventSessionUpdated
| EventSessionDeleted
@@ -1440,11 +1468,34 @@ export type SessionChildrenResponses = {
export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses]
+export type SessionTodoData = {
+ body?: never
+ path: {
+ /**
+ * Session ID
+ */
+ id: string
+ }
+ query?: {
+ directory?: string
+ }
+ url: "/session/{id}/todo"
+}
+
+export type SessionTodoResponses = {
+ /**
+ * Todo list
+ */
+ 200: Array<Todo>
+}
+
+export type SessionTodoResponse = SessionTodoResponses[keyof SessionTodoResponses]
+
export type SessionInitData = {
body?: {
- messageID: string
- providerID: string
modelID: string
+ providerID: string
+ messageID: string
}
path: {
/**
@@ -1467,6 +1518,28 @@ export type SessionInitResponses = {
export type SessionInitResponse = SessionInitResponses[keyof SessionInitResponses]
+export type SessionForkData = {
+ body?: {
+ messageID?: string
+ }
+ path: {
+ id: string
+ }
+ query?: {
+ directory?: string
+ }
+ url: "/session/{id}/fork"
+}
+
+export type SessionForkResponses = {
+ /**
+ * 200
+ */
+ 200: Session
+}
+
+export type SessionForkResponse = SessionForkResponses[keyof SessionForkResponses]
+
export type SessionAbortData = {
body?: never
path: {