From 870e534210b2ccdebdbeee4f1346d32bb321c756 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 18:45:05 +0000 Subject: [PATCH 01/16] chore(internal): version bump --- bin/publish-npm | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/bin/publish-npm b/bin/publish-npm index 2505dec..4c21181 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -4,35 +4,19 @@ set -eux npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +# Build the project yarn build -cd dist -# Get latest version from npm -# -# If the package doesn't exist, yarn will return -# {"type":"error","data":"Received invalid response from npm."} -# where .data.version doesn't exist so LAST_VERSION will be an empty string. -LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')" +# Navigate to the dist directory +cd dist -# Get current version from package.json +# Get the version from package.json VERSION="$(node -p "require('./package.json').version")" -# Check if current version is pre-release (e.g. alpha / beta / rc) -CURRENT_IS_PRERELEASE=false +# Extract the pre-release tag if it exists if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then - CURRENT_IS_PRERELEASE=true - CURRENT_TAG="${BASH_REMATCH[1]}" -fi - -# Check if last version is a stable release -LAST_IS_STABLE_RELEASE=true -if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then - LAST_IS_STABLE_RELEASE=false -fi - -# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. -if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then - TAG="$CURRENT_TAG" + # Extract the part before any dot in the pre-release identifier + TAG="${BASH_REMATCH[1]}" else TAG="latest" fi From 1d16505b24c6ee4236cf982ac710bb351006b955 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 02:11:48 +0000 Subject: [PATCH 02/16] chore(internal): codegen related update --- bin/publish-npm | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/bin/publish-npm b/bin/publish-npm index 4c21181..2505dec 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -4,19 +4,35 @@ set -eux npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" -# Build the project yarn build - -# Navigate to the dist directory cd dist -# Get the version from package.json +# Get latest version from npm +# +# If the package doesn't exist, yarn will return +# {"type":"error","data":"Received invalid response from npm."} +# where .data.version doesn't exist so LAST_VERSION will be an empty string. +LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')" + +# Get current version from package.json VERSION="$(node -p "require('./package.json').version")" -# Extract the pre-release tag if it exists +# Check if current version is pre-release (e.g. alpha / beta / rc) +CURRENT_IS_PRERELEASE=false if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then - # Extract the part before any dot in the pre-release identifier - TAG="${BASH_REMATCH[1]}" + CURRENT_IS_PRERELEASE=true + CURRENT_TAG="${BASH_REMATCH[1]}" +fi + +# Check if last version is a stable release +LAST_IS_STABLE_RELEASE=true +if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then + LAST_IS_STABLE_RELEASE=false +fi + +# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. +if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then + TAG="$CURRENT_TAG" else TAG="latest" fi From 98626394921ac1b3ec0b91d4800d0070e90373aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 02:59:32 +0000 Subject: [PATCH 03/16] fix: compat with more runtimes --- src/internal/detect-platform.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/internal/detect-platform.ts b/src/internal/detect-platform.ts index c5e273b..e82d95c 100644 --- a/src/internal/detect-platform.ts +++ b/src/internal/detect-platform.ts @@ -85,10 +85,10 @@ const getPlatformProperties = (): PlatformProperties => { return { 'X-Stainless-Lang': 'js', 'X-Stainless-Package-Version': VERSION, - 'X-Stainless-OS': normalizePlatform((globalThis as any).process.platform), - 'X-Stainless-Arch': normalizeArch((globalThis as any).process.arch), + 'X-Stainless-OS': normalizePlatform((globalThis as any).process.platform ?? 'unknown'), + 'X-Stainless-Arch': normalizeArch((globalThis as any).process.arch ?? 'unknown'), 'X-Stainless-Runtime': 'node', - 'X-Stainless-Runtime-Version': (globalThis as any).process.version, + 'X-Stainless-Runtime-Version': (globalThis as any).process.version ?? 'unknown', }; } From cf5274425c39098da877195686c5a16f61590642 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 12:30:14 +0000 Subject: [PATCH 04/16] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index be606c6..449c1d2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-64ccdff4ca5d73d79d89e817fe83ccfd3d529696df3e6818c3c75e586ae00801.yml openapi_spec_hash: 21c7b8757fc0cc9415cda1bc06251de6 -config_hash: b3fcacd707da56b21d31ce0baf4fb87d +config_hash: f03f4ba5576f016fbd430540e2e78804 From fee86015bde7b67ed72c4119b169add2d65b74a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 13:52:00 +0000 Subject: [PATCH 05/16] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 449c1d2..928da34 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-64ccdff4ca5d73d79d89e817fe83ccfd3d529696df3e6818c3c75e586ae00801.yml openapi_spec_hash: 21c7b8757fc0cc9415cda1bc06251de6 -config_hash: f03f4ba5576f016fbd430540e2e78804 +config_hash: 4bc202cdd2df5cd211fa97e999498052 From d8618fb15a40c20f114fa841ba77d16c9cc1e727 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 13:52:30 +0000 Subject: [PATCH 06/16] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 928da34..cd34424 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-64ccdff4ca5d73d79d89e817fe83ccfd3d529696df3e6818c3c75e586ae00801.yml openapi_spec_hash: 21c7b8757fc0cc9415cda1bc06251de6 -config_hash: 4bc202cdd2df5cd211fa97e999498052 +config_hash: c6bab7ac8da570a5abbcfb19db119b6b From 285e2b18ef1458eee08daa75e26ac65884cbac92 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 14:39:05 +0000 Subject: [PATCH 07/16] feat(api): update via SDK Studio --- .stats.yml | 4 ++-- src/resources/apps/apps.ts | 3 +-- src/resources/apps/deployments.ts | 2 +- src/resources/apps/invocations.ts | 6 +++--- src/resources/browsers.ts | 10 +++++----- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index cd34424..dbb369a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-64ccdff4ca5d73d79d89e817fe83ccfd3d529696df3e6818c3c75e586ae00801.yml -openapi_spec_hash: 21c7b8757fc0cc9415cda1bc06251de6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-1f7397b87108a992979b665f45bf0aee5b10387e8124f4768c4c7852ba0b23d7.yml +openapi_spec_hash: e5460337788e7eab0d8f05ef2f55086e config_hash: c6bab7ac8da570a5abbcfb19db119b6b diff --git a/src/resources/apps/apps.ts b/src/resources/apps/apps.ts index dbccad8..2b982f6 100644 --- a/src/resources/apps/apps.ts +++ b/src/resources/apps/apps.ts @@ -25,8 +25,7 @@ export class Apps extends APIResource { invocations: InvocationsAPI.Invocations = new InvocationsAPI.Invocations(this._client); /** - * List application versions for the authenticated user. Optionally filter by app - * name and/or version label. + * List applications. Optionally filter by app name and/or version label. * * @example * ```ts diff --git a/src/resources/apps/deployments.ts b/src/resources/apps/deployments.ts index 30fa7ca..a5cf463 100644 --- a/src/resources/apps/deployments.ts +++ b/src/resources/apps/deployments.ts @@ -11,7 +11,7 @@ import { path } from '../../internal/utils/path'; export class Deployments extends APIResource { /** - * Deploy a new application + * Deploy a new application and associated actions to Kernel. * * @example * ```ts diff --git a/src/resources/apps/invocations.ts b/src/resources/apps/invocations.ts index dabbdb6..7479550 100644 --- a/src/resources/apps/invocations.ts +++ b/src/resources/apps/invocations.ts @@ -7,7 +7,7 @@ import { path } from '../../internal/utils/path'; export class Invocations extends APIResource { /** - * Invoke an application + * Invoke an action. * * @example * ```ts @@ -23,7 +23,7 @@ export class Invocations extends APIResource { } /** - * Get an app invocation by id + * Get details about an invocation's status and output. * * @example * ```ts @@ -37,7 +37,7 @@ export class Invocations extends APIResource { } /** - * Update invocation status or output + * Update an invocation's status or output. * * @example * ```ts diff --git a/src/resources/browsers.ts b/src/resources/browsers.ts index b66c68f..8d043c8 100644 --- a/src/resources/browsers.ts +++ b/src/resources/browsers.ts @@ -9,7 +9,7 @@ import { path } from '../internal/utils/path'; export class Browsers extends APIResource { /** - * Create Browser Session + * Create a new browser session from within an action. * * @example * ```ts @@ -23,7 +23,7 @@ export class Browsers extends APIResource { } /** - * Get Browser Session by ID + * Get information about a browser session. * * @example * ```ts @@ -37,7 +37,7 @@ export class Browsers extends APIResource { } /** - * List active browser sessions for the authenticated user + * List active browser sessions * * @example * ```ts @@ -49,7 +49,7 @@ export class Browsers extends APIResource { } /** - * Delete a persistent browser session by persistent_id query parameter. + * Delete a persistent browser session by its persistent_id. * * @example * ```ts @@ -68,7 +68,7 @@ export class Browsers extends APIResource { } /** - * Delete Browser Session by ID + * Delete a browser session by ID * * @example * ```ts From 76f5cd585cd38ec7755ae821670011f358057b64 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 14:43:37 +0000 Subject: [PATCH 08/16] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbb369a..03ed944 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-1f7397b87108a992979b665f45bf0aee5b10387e8124f4768c4c7852ba0b23d7.yml -openapi_spec_hash: e5460337788e7eab0d8f05ef2f55086e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-7af0ef1d19efb9231c098855b72668646401afd5e00400953aca0728f7ceadb7.yml +openapi_spec_hash: fb160fe8ee0cda0a1ce9766c8195ee68 config_hash: c6bab7ac8da570a5abbcfb19db119b6b From 36826dcdb6fe50107c300fe82bad75749c2e7ce8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 17:24:19 +0000 Subject: [PATCH 09/16] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 03ed944..a9ddb6d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-7af0ef1d19efb9231c098855b72668646401afd5e00400953aca0728f7ceadb7.yml -openapi_spec_hash: fb160fe8ee0cda0a1ce9766c8195ee68 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b91d95f8e40f28d0e455d749b86c4d864ac15a264dcc2c5b317f626ff605ce2c.yml +openapi_spec_hash: befc3a683593ad7d832cfa9f0db941aa config_hash: c6bab7ac8da570a5abbcfb19db119b6b From d3c4417538150b91be13854d837938113ce6a09f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 31 May 2025 03:10:23 +0000 Subject: [PATCH 10/16] chore(deps): bump eslint-plugin-prettier --- package.json | 5 +---- yarn.lock | 34 ++++++++++++++-------------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index a5f5e93..b927242 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@typescript-eslint/eslint-plugin": "8.31.1", "@typescript-eslint/parser": "8.31.1", "eslint": "^9.20.1", - "eslint-plugin-prettier": "^5.2.3", + "eslint-plugin-prettier": "^5.4.1", "eslint-plugin-unused-imports": "^4.1.4", "iconv-lite": "^0.6.3", "jest": "^29.4.0", @@ -46,9 +46,6 @@ "tsconfig-paths": "^4.0.0", "typescript": "5.8.3" }, - "resolutions": { - "synckit": "0.8.8" - }, "imports": { "@onkernel/sdk": ".", "@onkernel/sdk/*": "./src/*" diff --git a/yarn.lock b/yarn.lock index 43da555..49d3eb8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -714,10 +714,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@pkgr/core@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31" - integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== +"@pkgr/core@^0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.4.tgz#d897170a2b0ba51f78a099edccd968f7b103387c" + integrity sha512-ROFF39F6ZrnzSUEmQQZUar0Jt4xVoP9WnDRdWwF4NNcXs3xBTLgBUDoOwW141y1jP+S8nahIbdxbFC7IShw9Iw== "@sinclair/typebox@^0.27.8": version "0.27.8" @@ -1547,13 +1547,13 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-prettier@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz#c4af01691a6fa9905207f0fbba0d7bea0902cce5" - integrity sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw== +eslint-plugin-prettier@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz#99b55d7dd70047886b2222fdd853665f180b36af" + integrity sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg== dependencies: prettier-linter-helpers "^1.0.0" - synckit "^0.9.1" + synckit "^0.11.7" eslint-plugin-unused-imports@^4.1.4: version "4.1.4" @@ -3198,13 +3198,12 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -synckit@0.8.8, synckit@^0.9.1: - version "0.8.8" - resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.8.tgz#fe7fe446518e3d3d49f5e429f443cf08b6edfcd7" - integrity sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ== +synckit@^0.11.7: + version "0.11.8" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.11.8.tgz#b2aaae998a4ef47ded60773ad06e7cb821f55457" + integrity sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A== dependencies: - "@pkgr/core" "^0.1.0" - tslib "^2.6.2" + "@pkgr/core" "^0.2.4" test-exclude@^6.0.0: version "6.0.0" @@ -3308,11 +3307,6 @@ tsconfig-paths@^4.0.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - tslib@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" From 3248860f264c1a24c3721eeb5a79c59f6f53dd7f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 31 May 2025 03:22:57 +0000 Subject: [PATCH 11/16] chore(internal): update jest config --- jest.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jest.config.ts b/jest.config.ts index a3ef35c..f21115c 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -15,6 +15,7 @@ const config: JestConfigWithTsJest = { '/dist/', '/deno/', '/deno_tests/', + '/packages/', ], testPathIgnorePatterns: ['scripts'], }; From 8e7e28aac90753040d3eb24320c6a758266d4391 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 04:43:52 +0000 Subject: [PATCH 12/16] chore: adjust eslint.config.mjs ignore pattern --- eslint.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 4d61d87..341aac5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,7 +10,7 @@ export default tseslint.config( parserOptions: { sourceType: 'module' }, }, files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.js', '**/*.mjs', '**/*.cjs'], - ignores: ['dist/**'], + ignores: ['dist/'], plugins: { '@typescript-eslint': tseslint.plugin, 'unused-imports': unusedImports, From 8622a147a7919f2edd3aa41dfa3ab0a89a7146c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 19:42:54 +0000 Subject: [PATCH 13/16] feat(api): update via SDK Studio --- .stats.yml | 4 ++-- src/resources/browsers.ts | 6 ++++++ tests/api-resources/browsers.test.ts | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a9ddb6d..d654666 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b91d95f8e40f28d0e455d749b86c4d864ac15a264dcc2c5b317f626ff605ce2c.yml -openapi_spec_hash: befc3a683593ad7d832cfa9f0db941aa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-4502c65bef0843a6ae96d23bba075433af6bab49b55b544b1522f63e7881c00c.yml +openapi_spec_hash: 3e67b77bbc8cd6155b8f66f3271f2643 config_hash: c6bab7ac8da570a5abbcfb19db119b6b diff --git a/src/resources/browsers.ts b/src/resources/browsers.ts index 8d043c8..adc075f 100644 --- a/src/resources/browsers.ts +++ b/src/resources/browsers.ts @@ -175,6 +175,12 @@ export interface BrowserCreateParams { * Optional persistence configuration for the browser session. */ persistence?: BrowserPersistence; + + /** + * If true, launches the browser in stealth mode to reduce detection by anti-bot + * mechanisms. + */ + stealth?: boolean; } export interface BrowserDeleteParams { diff --git a/tests/api-resources/browsers.test.ts b/tests/api-resources/browsers.test.ts index 8bb89aa..c6f0967 100644 --- a/tests/api-resources/browsers.test.ts +++ b/tests/api-resources/browsers.test.ts @@ -25,6 +25,7 @@ describe('resource browsers', () => { const response = await client.browsers.create({ invocation_id: 'rr33xuugxj9h0bkf1rdt2bet', persistence: { id: 'my-awesome-browser-for-user-1234' }, + stealth: true, }); }); From ac334e0fb49f98a15e1318c6754838ae17b036d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 03:55:50 +0000 Subject: [PATCH 14/16] chore(docs): use top-level-await in example snippets --- README.md | 58 ++++++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 8db99d1..22327b8 100644 --- a/README.md +++ b/README.md @@ -27,18 +27,14 @@ const client = new Kernel({ environment: 'development', // defaults to 'production' }); -async function main() { - const deployment = await client.apps.deployments.create({ - entrypoint_rel_path: 'main.ts', - file: fs.createReadStream('path/to/file'), - env_vars: { OPENAI_API_KEY: 'x' }, - version: '1.0.0', - }); - - console.log(deployment.apps); -} +const deployment = await client.apps.deployments.create({ + entrypoint_rel_path: 'main.ts', + file: fs.createReadStream('path/to/file'), + env_vars: { OPENAI_API_KEY: 'x' }, + version: '1.0.0', +}); -main(); +console.log(deployment.apps); ``` ### Request & Response types @@ -54,15 +50,11 @@ const client = new Kernel({ environment: 'development', // defaults to 'production' }); -async function main() { - const params: Kernel.BrowserCreateParams = { - invocation_id: 'REPLACE_ME', - persistence: { id: 'browser-for-user-1234' }, - }; - const browser: Kernel.BrowserCreateResponse = await client.browsers.create(params); -} - -main(); +const params: Kernel.BrowserCreateParams = { + invocation_id: 'REPLACE_ME', + persistence: { id: 'browser-for-user-1234' }, +}; +const browser: Kernel.BrowserCreateResponse = await client.browsers.create(params); ``` Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. @@ -119,21 +111,17 @@ a subclass of `APIError` will be thrown: ```ts -async function main() { - const browser = await client.browsers - .create({ invocation_id: 'REPLACE_ME', persistence: { id: 'browser-for-user-1234' } }) - .catch(async (err) => { - if (err instanceof Kernel.APIError) { - console.log(err.status); // 400 - console.log(err.name); // BadRequestError - console.log(err.headers); // {server: 'nginx', ...} - } else { - throw err; - } - }); -} - -main(); +const browser = await client.browsers + .create({ invocation_id: 'REPLACE_ME', persistence: { id: 'browser-for-user-1234' } }) + .catch(async (err) => { + if (err instanceof Kernel.APIError) { + console.log(err.status); // 400 + console.log(err.name); // BadRequestError + console.log(err.headers); // {server: 'nginx', ...} + } else { + throw err; + } + }); ``` Error codes are as follows: From 77cdbc227d624567aa460e3659bdb30678548a26 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 04:25:56 +0000 Subject: [PATCH 15/16] chore(internal): fix readablestream types in node 20 --- scripts/build | 2 -- src/internal/shim-types.d.ts | 28 ---------------------------- src/internal/shim-types.ts | 26 ++++++++++++++++++++++++++ src/internal/shims.ts | 4 ++-- 4 files changed, 28 insertions(+), 32 deletions(-) delete mode 100644 src/internal/shim-types.d.ts create mode 100644 src/internal/shim-types.ts diff --git a/scripts/build b/scripts/build index 6a52f04..b2ad914 100755 --- a/scripts/build +++ b/scripts/build @@ -37,8 +37,6 @@ npm exec tsc-multi # when building .mjs node scripts/utils/fix-index-exports.cjs cp tsconfig.dist-src.json dist/src/tsconfig.json -cp src/internal/shim-types.d.ts dist/internal/shim-types.d.ts -cp src/internal/shim-types.d.ts dist/internal/shim-types.d.mts node scripts/utils/postprocess-files.cjs diff --git a/src/internal/shim-types.d.ts b/src/internal/shim-types.d.ts deleted file mode 100644 index fe48144..0000000 --- a/src/internal/shim-types.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -/** - * Shims for types that we can't always rely on being available globally. - * - * Note: these only exist at the type-level, there is no corresponding runtime - * version for any of these symbols. - */ - -/** - * In order to properly access the global `NodeJS` type, if it's available, we - * need to make use of declaration shadowing. Without this, any checks for the - * presence of `NodeJS.ReadableStream` will fail. - */ -declare namespace NodeJS { - interface ReadableStream {} -} - -type HasProperties = keyof T extends never ? false : true; - -// @ts-ignore -type _ReadableStream = - // @ts-ignore - HasProperties extends true ? NodeJS.ReadableStream : ReadableStream; - -// @ts-ignore -declare const _ReadableStream: unknown extends typeof ReadableStream ? never : typeof ReadableStream; -export { _ReadableStream as ReadableStream }; diff --git a/src/internal/shim-types.ts b/src/internal/shim-types.ts new file mode 100644 index 0000000..8ddf7b0 --- /dev/null +++ b/src/internal/shim-types.ts @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +/** + * Shims for types that we can't always rely on being available globally. + * + * Note: these only exist at the type-level, there is no corresponding runtime + * version for any of these symbols. + */ + +type NeverToAny = T extends never ? any : T; + +/** @ts-ignore */ +type _DOMReadableStream = globalThis.ReadableStream; + +/** @ts-ignore */ +type _NodeReadableStream = import('stream/web').ReadableStream; + +type _ConditionalNodeReadableStream = + typeof globalThis extends { ReadableStream: any } ? never : _NodeReadableStream; + +type _ReadableStream = NeverToAny< + | ([0] extends [1 & _DOMReadableStream] ? never : _DOMReadableStream) + | ([0] extends [1 & _ConditionalNodeReadableStream] ? never : _ConditionalNodeReadableStream) +>; + +export type { _ReadableStream as ReadableStream }; diff --git a/src/internal/shims.ts b/src/internal/shims.ts index 9b04cd9..006524f 100644 --- a/src/internal/shims.ts +++ b/src/internal/shims.ts @@ -7,8 +7,8 @@ * messages in cases where an environment isn't fully supported. */ -import { type Fetch } from './builtin-types'; -import { type ReadableStream } from './shim-types'; +import type { Fetch } from './builtin-types'; +import type { ReadableStream } from './shim-types'; export function getDefaultFetch(): Fetch { if (typeof fetch !== 'undefined') { From 457ed8cf318154e16461e31f6d497326765c9347 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 04:26:53 +0000 Subject: [PATCH 16/16] release: 0.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 25 +++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2537c1f..f1c1e58 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.5.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 49f18f7..60707d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## 0.5.0 (2025-06-04) + +Full Changelog: [v0.4.0...v0.5.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.4.0...v0.5.0) + +### Features + +* **api:** update via SDK Studio ([8622a14](https://github.com/onkernel/kernel-node-sdk/commit/8622a147a7919f2edd3aa41dfa3ab0a89a7146c8)) +* **api:** update via SDK Studio ([285e2b1](https://github.com/onkernel/kernel-node-sdk/commit/285e2b18ef1458eee08daa75e26ac65884cbac92)) + + +### Bug Fixes + +* compat with more runtimes ([9862639](https://github.com/onkernel/kernel-node-sdk/commit/98626394921ac1b3ec0b91d4800d0070e90373aa)) + + +### Chores + +* adjust eslint.config.mjs ignore pattern ([8e7e28a](https://github.com/onkernel/kernel-node-sdk/commit/8e7e28aac90753040d3eb24320c6a758266d4391)) +* **deps:** bump eslint-plugin-prettier ([d3c4417](https://github.com/onkernel/kernel-node-sdk/commit/d3c4417538150b91be13854d837938113ce6a09f)) +* **docs:** use top-level-await in example snippets ([ac334e0](https://github.com/onkernel/kernel-node-sdk/commit/ac334e0fb49f98a15e1318c6754838ae17b036d9)) +* **internal:** codegen related update ([1d16505](https://github.com/onkernel/kernel-node-sdk/commit/1d16505b24c6ee4236cf982ac710bb351006b955)) +* **internal:** fix readablestream types in node 20 ([77cdbc2](https://github.com/onkernel/kernel-node-sdk/commit/77cdbc227d624567aa460e3659bdb30678548a26)) +* **internal:** update jest config ([3248860](https://github.com/onkernel/kernel-node-sdk/commit/3248860f264c1a24c3721eeb5a79c59f6f53dd7f)) +* **internal:** version bump ([870e534](https://github.com/onkernel/kernel-node-sdk/commit/870e534210b2ccdebdbeee4f1346d32bb321c756)) + ## 0.4.0 (2025-05-28) Full Changelog: [v0.3.0...v0.4.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.3.0...v0.4.0) diff --git a/package.json b/package.json index b927242..6b06ec5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onkernel/sdk", - "version": "0.4.0", + "version": "0.5.0", "description": "The official TypeScript library for the Kernel API", "author": "Kernel <>", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 4e7f788..1f5d158 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.4.0'; // x-release-please-version +export const VERSION = '0.5.0'; // x-release-please-version