From 7a7060ef156451c90137cfccd74a59e3f3e40f68 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 4 Nov 2025 13:32:56 -0500 Subject: fix session performance issue from large diffs --- packages/sdk/js/src/gen/sdk.gen.ts | 9 +++++++-- packages/sdk/js/src/gen/types.gen.ts | 22 ++++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) (limited to 'packages/sdk/js/src/gen') diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts index b76b6996f..1a54da8fa 100644 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ b/packages/sdk/js/src/gen/sdk.gen.ts @@ -55,6 +55,7 @@ import type { SessionShareErrors, SessionDiffData, SessionDiffResponses, + SessionDiffErrors, SessionSummarizeData, SessionSummarizeResponses, SessionSummarizeErrors, @@ -475,12 +476,16 @@ class Session extends _HeyApiClient { } /** - * Get the diff that resulted from this user message + * Get the diff for this session */ public diff( options: Options, ) { - return (options.client ?? this._client).get({ + return (options.client ?? this._client).get< + SessionDiffResponses, + SessionDiffErrors, + ThrowOnError + >({ url: "/session/{id}/diff", ...options, }) diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index 7293f13cd..d4b763324 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -527,7 +527,9 @@ export type Session = { directory: string parentID?: string summary?: { - diffs: Array + additions: number + deletions: number + diffs?: Array } share?: { url: string @@ -1882,6 +1884,9 @@ export type SessionShareResponse = SessionShareResponses[keyof SessionShareRespo export type SessionDiffData = { body?: never path: { + /** + * Session ID + */ id: string } query?: { @@ -1891,9 +1896,22 @@ export type SessionDiffData = { url: "/session/{id}/diff" } +export type SessionDiffErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * Not found + */ + 404: NotFoundError +} + +export type SessionDiffError = SessionDiffErrors[keyof SessionDiffErrors] + export type SessionDiffResponses = { /** - * Successfully retrieved diff + * List of diffs */ 200: Array } -- cgit v1.2.3