summaryrefslogtreecommitdiffhomepage
path: root/packages/sdk/js
diff options
context:
space:
mode:
authoropencode <[email protected]>2025-10-20 22:21:03 +0000
committeropencode <[email protected]>2025-10-20 22:21:03 +0000
commit6995dab1dcef179d5b38cd114f148da9e8617ade (patch)
tree8bb5367b92c2ffb5aa8f5d787c65443033514fd3 /packages/sdk/js
parenta0a09f421c9fb3d16a365ffb68783b9bdea9d564 (diff)
downloadopencode-6995dab1dcef179d5b38cd114f148da9e8617ade.tar.gz
opencode-6995dab1dcef179d5b38cd114f148da9e8617ade.zip
release: v0.15.10
Diffstat (limited to 'packages/sdk/js')
-rw-r--r--packages/sdk/js/package.json2
-rw-r--r--packages/sdk/js/src/gen/sdk.gen.ts12
-rw-r--r--packages/sdk/js/src/gen/types.gen.ts33
3 files changed, 46 insertions, 1 deletions
diff --git a/packages/sdk/js/package.json b/packages/sdk/js/package.json
index f92901c6e..1e8a38115 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.15.9",
+ "version": "0.15.10",
"type": "module",
"scripts": {
"typecheck": "tsgo --noEmit",
diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts
index ecdcb52bf..4f224ea4c 100644
--- a/packages/sdk/js/src/gen/sdk.gen.ts
+++ b/packages/sdk/js/src/gen/sdk.gen.ts
@@ -53,6 +53,8 @@ import type {
SessionShareData,
SessionShareResponses,
SessionShareErrors,
+ SessionDiffData,
+ SessionDiffResponses,
SessionSummarizeData,
SessionSummarizeResponses,
SessionSummarizeErrors,
@@ -388,6 +390,16 @@ class Session extends _HeyApiClient {
}
/**
+ * Get the diff that resulted from this user message
+ */
+ public diff<ThrowOnError extends boolean = false>(options: Options<SessionDiffData, ThrowOnError>) {
+ return (options.client ?? this._client).get<SessionDiffResponses, unknown, ThrowOnError>({
+ url: "/session/{id}/diff",
+ ...options,
+ })
+ }
+
+ /**
* Summarize the session
*/
public summarize<ThrowOnError extends boolean = false>(options: Options<SessionSummarizeData, ThrowOnError>) {
diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts
index 53049eb13..afca94864 100644
--- a/packages/sdk/js/src/gen/types.gen.ts
+++ b/packages/sdk/js/src/gen/types.gen.ts
@@ -583,6 +583,12 @@ export type Todo = {
id: string
}
+export type FileDiff = {
+ file: string
+ left: string
+ right: string
+}
+
export type UserMessage = {
id: string
sessionID: string
@@ -798,6 +804,7 @@ export type StepStartPart = {
sessionID: string
messageID: string
type: "step-start"
+ snapshot?: string
}
export type StepFinishPart = {
@@ -805,6 +812,7 @@ export type StepFinishPart = {
sessionID: string
messageID: string
type: "step-finish"
+ snapshot?: string
cost: number
tokens: {
input: number
@@ -1737,6 +1745,27 @@ export type SessionShareResponses = {
export type SessionShareResponse = SessionShareResponses[keyof SessionShareResponses]
+export type SessionDiffData = {
+ body?: never
+ path: {
+ id: string
+ }
+ query?: {
+ directory?: string
+ messageID?: string
+ }
+ url: "/session/{id}/diff"
+}
+
+export type SessionDiffResponses = {
+ /**
+ * Successfully retrieved diff
+ */
+ 200: Array<FileDiff>
+}
+
+export type SessionDiffResponse = SessionDiffResponses[keyof SessionDiffResponses]
+
export type SessionSummarizeData = {
body?: {
providerID: string
@@ -1827,6 +1856,10 @@ export type SessionPromptData = {
tools?: {
[key: string]: boolean
}
+ acpConnection?: {
+ connection: unknown
+ sessionId: string
+ }
parts: Array<TextPartInput | FilePartInput | AgentPartInput>
}
path: {