From f1241f2d66a097bfb11a2cbd9fda9495b54b0690 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 24 Sep 2025 20:29:34 +0000 Subject: [PATCH 1/2] feat: Per Invocation Logs --- .stats.yml | 4 ++-- api.md | 2 +- invocation.go | 20 ++++++++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 385372f..4039b10 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 50 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d3a597bbbb25c131e2c06eb9b47d70932d14a97a6f916677a195a128e196f4db.yml -openapi_spec_hash: c967b384624017eed0abff1b53a74530 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5ee2116982adf46664acf84b8ba4b56ba65780983506c63d9b005dab49def757.yml +openapi_spec_hash: 42a3a519301d0e2bb2b5a71018915b55 config_hash: 0d150b61cae2dc57d3648ceae7784966 diff --git a/api.md b/api.md index 45a6ef1..7ddd94f 100644 --- a/api.md +++ b/api.md @@ -50,7 +50,7 @@ Methods: - client.Invocations.Get(ctx context.Context, id string) (kernel.InvocationGetResponse, error) - client.Invocations.Update(ctx context.Context, id string, body kernel.InvocationUpdateParams) (kernel.InvocationUpdateResponse, error) - client.Invocations.DeleteBrowsers(ctx context.Context, id string) error -- client.Invocations.Follow(ctx context.Context, id string) (kernel.InvocationFollowResponseUnion, error) +- client.Invocations.Follow(ctx context.Context, id string, query kernel.InvocationFollowParams) (kernel.InvocationFollowResponseUnion, error) # Browsers diff --git a/invocation.go b/invocation.go index ce58efb..5abe4c4 100644 --- a/invocation.go +++ b/invocation.go @@ -8,10 +8,12 @@ import ( "errors" "fmt" "net/http" + "net/url" "slices" "time" "github.com/onkernel/kernel-go-sdk/internal/apijson" + "github.com/onkernel/kernel-go-sdk/internal/apiquery" "github.com/onkernel/kernel-go-sdk/internal/requestconfig" "github.com/onkernel/kernel-go-sdk/option" "github.com/onkernel/kernel-go-sdk/packages/param" @@ -89,7 +91,7 @@ func (r *InvocationService) DeleteBrowsers(ctx context.Context, id string, opts // Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and // status updates for an invocation. The stream terminates automatically once the // invocation reaches a terminal state. -func (r *InvocationService) FollowStreaming(ctx context.Context, id string, opts ...option.RequestOption) (stream *ssestream.Stream[InvocationFollowResponseUnion]) { +func (r *InvocationService) FollowStreaming(ctx context.Context, id string, query InvocationFollowParams, opts ...option.RequestOption) (stream *ssestream.Stream[InvocationFollowResponseUnion]) { var ( raw *http.Response err error @@ -101,7 +103,7 @@ func (r *InvocationService) FollowStreaming(ctx context.Context, id string, opts return } path := fmt.Sprintf("invocations/%s/events", id) - err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &raw, opts...) + err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &raw, opts...) return ssestream.NewStream[InvocationFollowResponseUnion](ssestream.NewDecoder(raw), err) } @@ -460,3 +462,17 @@ const ( InvocationUpdateParamsStatusSucceeded InvocationUpdateParamsStatus = "succeeded" InvocationUpdateParamsStatusFailed InvocationUpdateParamsStatus = "failed" ) + +type InvocationFollowParams struct { + // Show logs since the given time (RFC timestamps or durations like 5m). + Since param.Opt[string] `query:"since,omitzero" json:"-"` + paramObj +} + +// URLQuery serializes [InvocationFollowParams]'s query parameters as `url.Values`. +func (r InvocationFollowParams) URLQuery() (v url.Values, err error) { + return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{ + ArrayFormat: apiquery.ArrayQueryFormatComma, + NestedFormat: apiquery.NestedQueryFormatBrackets, + }) +} From 72ce9a50cd6d01a3c498eb7dec0157a28036314a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 24 Sep 2025 20:54:07 +0000 Subject: [PATCH 2/2] release: 0.11.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 95e4ab6..5332797 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.11.2" + ".": "0.11.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e4b8897..0a0cc83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.11.3 (2025-09-24) + +Full Changelog: [v0.11.2...v0.11.3](https://github.com/onkernel/kernel-go-sdk/compare/v0.11.2...v0.11.3) + +### Features + +* Per Invocation Logs ([f1241f2](https://github.com/onkernel/kernel-go-sdk/commit/f1241f2d66a097bfb11a2cbd9fda9495b54b0690)) + ## 0.11.2 (2025-09-24) Full Changelog: [v0.11.1...v0.11.2](https://github.com/onkernel/kernel-go-sdk/compare/v0.11.1...v0.11.2) diff --git a/README.md b/README.md index 6ccc286..3eb5c90 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/onkernel/kernel-go-sdk@v0.11.2' +go get -u 'github.com/onkernel/kernel-go-sdk@v0.11.3' ``` diff --git a/internal/version.go b/internal/version.go index b485679..1d190b8 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.11.2" // x-release-please-version +const PackageVersion = "0.11.3" // x-release-please-version