diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 76d5538..b28fea9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.0" + ".": "0.9.1" } diff --git a/.stats.yml b/.stats.yml index 062204b..f6de080 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 31 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e907afeabfeea49dedd783112ac3fd29267bc86f3d594f89ba9a2abf2bcbc9d8.yml -openapi_spec_hash: 060ca6288c1a09b6d1bdf207a0011165 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b55c3e0424fa7733487139488b9fff00ad8949ff02ee3160ee36b9334e84b134.yml +openapi_spec_hash: 17f36677e3dc0a3aeb419654c8d5cae3 config_hash: f67e4b33b2fb30c1405ee2fff8096320 diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a1d4e..0f38f36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.9.1 (2025-08-15) + +Full Changelog: [v0.9.0...v0.9.1](https://github.com/onkernel/kernel-node-sdk/compare/v0.9.0...v0.9.1) + +### Features + +* **api:** add browser timeouts ([a7cf6cd](https://github.com/onkernel/kernel-node-sdk/commit/a7cf6cdc4b35728bbdf85469d4212e90e5241b78)) + +### Chores + +* **internal:** codegen related update ([0665717](https://github.com/onkernel/kernel-node-sdk/commit/0665717e9f8831133ccec9cb24e29a0db800c86f)) +* **internal:** update comment in script ([c435fb5](https://github.com/onkernel/kernel-node-sdk/commit/c435fb5125da065d4a5d36777506a8924c7fb02e)) +* update @stainless-api/prism-cli to v5.15.0 ([391384a](https://github.com/onkernel/kernel-node-sdk/commit/391384a0c5cc64b4bc4f4e8f717e11ae4cf7bce5)) + ## 0.9.0 (2025-08-08) Full Changelog: [v0.8.3...v0.9.0](https://github.com/onkernel/kernel-node-sdk/compare/v0.8.3...v0.9.0) diff --git a/package.json b/package.json index e01977a..e3715cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onkernel/sdk", - "version": "0.9.0", + "version": "0.9.1", "description": "The official TypeScript library for the Kernel API", "author": "Kernel <>", "types": "dist/index.d.ts", diff --git a/scripts/mock b/scripts/mock index d2814ae..0b28f6e 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi diff --git a/scripts/test b/scripts/test index 2049e31..7bce051 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 diff --git a/src/resources/browsers/browsers.ts b/src/resources/browsers/browsers.ts index 438a892..3e37d79 100644 --- a/src/resources/browsers/browsers.ts +++ b/src/resources/browsers/browsers.ts @@ -129,11 +129,31 @@ export interface BrowserCreateResponse { */ cdp_ws_url: string; + /** + * When the browser session was created. + */ + created_at: string; + + /** + * Whether the browser session is running in headless mode. + */ + headless: boolean; + /** * Unique identifier for the browser session */ session_id: string; + /** + * Whether the browser session is running in stealth mode. + */ + stealth: boolean; + + /** + * The number of seconds of inactivity before the browser session is terminated. + */ + timeout_seconds: number; + /** * Remote URL for live viewing the browser session. Only available for non-headless * browsers. @@ -152,11 +172,31 @@ export interface BrowserRetrieveResponse { */ cdp_ws_url: string; + /** + * When the browser session was created. + */ + created_at: string; + + /** + * Whether the browser session is running in headless mode. + */ + headless: boolean; + /** * Unique identifier for the browser session */ session_id: string; + /** + * Whether the browser session is running in stealth mode. + */ + stealth: boolean; + + /** + * The number of seconds of inactivity before the browser session is terminated. + */ + timeout_seconds: number; + /** * Remote URL for live viewing the browser session. Only available for non-headless * browsers. @@ -178,11 +218,31 @@ export namespace BrowserListResponse { */ cdp_ws_url: string; + /** + * When the browser session was created. + */ + created_at: string; + + /** + * Whether the browser session is running in headless mode. + */ + headless: boolean; + /** * Unique identifier for the browser session */ session_id: string; + /** + * Whether the browser session is running in stealth mode. + */ + stealth: boolean; + + /** + * The number of seconds of inactivity before the browser session is terminated. + */ + timeout_seconds: number; + /** * Remote URL for live viewing the browser session. Only available for non-headless * browsers. @@ -218,6 +278,13 @@ export interface BrowserCreateParams { * mechanisms. */ stealth?: boolean; + + /** + * The number of seconds of inactivity before the browser session is terminated. + * Only applicable to non-persistent browsers. Activity includes CDP connections + * and live view connections. Defaults to 60 seconds. + */ + timeout_seconds?: number; } export interface BrowserDeleteParams { diff --git a/src/version.ts b/src/version.ts index 5c16194..72f481f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.9.0'; // x-release-please-version +export const VERSION = '0.9.1'; // x-release-please-version diff --git a/tests/api-resources/apps.test.ts b/tests/api-resources/apps.test.ts index 6bb4e0d..36a0654 100644 --- a/tests/api-resources/apps.test.ts +++ b/tests/api-resources/apps.test.ts @@ -8,7 +8,7 @@ const client = new Kernel({ }); describe('resource apps', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.apps.list(); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource apps', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( diff --git a/tests/api-resources/browsers/browsers.test.ts b/tests/api-resources/browsers/browsers.test.ts index d28bd02..7685e68 100644 --- a/tests/api-resources/browsers/browsers.test.ts +++ b/tests/api-resources/browsers/browsers.test.ts @@ -8,7 +8,7 @@ const client = new Kernel({ }); describe('resource browsers', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create', async () => { const responsePromise = client.browsers.create(); const rawResponse = await responsePromise.asResponse(); @@ -20,7 +20,7 @@ describe('resource browsers', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( @@ -30,13 +30,14 @@ describe('resource browsers', () => { invocation_id: 'rr33xuugxj9h0bkf1rdt2bet', persistence: { id: 'my-awesome-browser-for-user-1234' }, stealth: true, + timeout_seconds: 0, }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Kernel.NotFoundError); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.browsers.retrieve('htzv5orfit78e1m2biiifpbv'); const rawResponse = await responsePromise.asResponse(); @@ -48,7 +49,7 @@ describe('resource browsers', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.browsers.list(); const rawResponse = await responsePromise.asResponse(); @@ -60,7 +61,7 @@ describe('resource browsers', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: only required params', async () => { const responsePromise = client.browsers.delete({ persistent_id: 'persistent_id' }); const rawResponse = await responsePromise.asResponse(); @@ -72,12 +73,12 @@ describe('resource browsers', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('delete: required and optional params', async () => { const response = await client.browsers.delete({ persistent_id: 'persistent_id' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('deleteByID', async () => { const responsePromise = client.browsers.deleteByID('htzv5orfit78e1m2biiifpbv'); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/browsers/fs/fs.test.ts b/tests/api-resources/browsers/fs/fs.test.ts index 44a5ad8..87fbb3d 100644 --- a/tests/api-resources/browsers/fs/fs.test.ts +++ b/tests/api-resources/browsers/fs/fs.test.ts @@ -8,7 +8,7 @@ const client = new Kernel({ }); describe('resource fs', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createDirectory: only required params', async () => { const responsePromise = client.browsers.fs.createDirectory('id', { path: '/J!' }); const rawResponse = await responsePromise.asResponse(); @@ -20,12 +20,12 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('createDirectory: required and optional params', async () => { const response = await client.browsers.fs.createDirectory('id', { path: '/J!', mode: '0611' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('deleteDirectory: only required params', async () => { const responsePromise = client.browsers.fs.deleteDirectory('id', { path: '/J!' }); const rawResponse = await responsePromise.asResponse(); @@ -37,12 +37,12 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('deleteDirectory: required and optional params', async () => { const response = await client.browsers.fs.deleteDirectory('id', { path: '/J!' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('deleteFile: only required params', async () => { const responsePromise = client.browsers.fs.deleteFile('id', { path: '/J!' }); const rawResponse = await responsePromise.asResponse(); @@ -54,12 +54,12 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('deleteFile: required and optional params', async () => { const response = await client.browsers.fs.deleteFile('id', { path: '/J!' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('fileInfo: only required params', async () => { const responsePromise = client.browsers.fs.fileInfo('id', { path: '/J!' }); const rawResponse = await responsePromise.asResponse(); @@ -71,12 +71,12 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('fileInfo: required and optional params', async () => { const response = await client.browsers.fs.fileInfo('id', { path: '/J!' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('listFiles: only required params', async () => { const responsePromise = client.browsers.fs.listFiles('id', { path: '/J!' }); const rawResponse = await responsePromise.asResponse(); @@ -88,12 +88,12 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('listFiles: required and optional params', async () => { const response = await client.browsers.fs.listFiles('id', { path: '/J!' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('move: only required params', async () => { const responsePromise = client.browsers.fs.move('id', { dest_path: '/J!', src_path: '/J!' }); const rawResponse = await responsePromise.asResponse(); @@ -105,17 +105,16 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('move: required and optional params', async () => { const response = await client.browsers.fs.move('id', { dest_path: '/J!', src_path: '/J!' }); }); - // skipped: tests are disabled for the time being - test.skip('readFile: required and optional params', async () => { + test('readFile: required and optional params', async () => { const response = await client.browsers.fs.readFile('id', { path: '/J!' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('setFilePermissions: only required params', async () => { const responsePromise = client.browsers.fs.setFilePermissions('id', { mode: '0611', path: '/J!' }); const rawResponse = await responsePromise.asResponse(); @@ -127,7 +126,7 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('setFilePermissions: required and optional params', async () => { const response = await client.browsers.fs.setFilePermissions('id', { mode: '0611', @@ -137,7 +136,7 @@ describe('resource fs', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('writeFile: only required params', async () => { const responsePromise = client.browsers.fs.writeFile( 'id', @@ -153,7 +152,7 @@ describe('resource fs', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('writeFile: required and optional params', async () => { const response = await client.browsers.fs.writeFile( 'id', diff --git a/tests/api-resources/browsers/fs/watch.test.ts b/tests/api-resources/browsers/fs/watch.test.ts index c85702d..47ddfb8 100644 --- a/tests/api-resources/browsers/fs/watch.test.ts +++ b/tests/api-resources/browsers/fs/watch.test.ts @@ -8,7 +8,7 @@ const client = new Kernel({ }); describe('resource watch', () => { - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail + // Prism doesn't support text/event-stream responses test.skip('events: only required params', async () => { const responsePromise = client.browsers.fs.watch.events('watch_id', { id: 'id' }); const rawResponse = await responsePromise.asResponse(); @@ -20,12 +20,12 @@ describe('resource watch', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail + // Prism doesn't support text/event-stream responses test.skip('events: required and optional params', async () => { const response = await client.browsers.fs.watch.events('watch_id', { id: 'id' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('start: only required params', async () => { const responsePromise = client.browsers.fs.watch.start('id', { path: 'path' }); const rawResponse = await responsePromise.asResponse(); @@ -37,12 +37,12 @@ describe('resource watch', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('start: required and optional params', async () => { const response = await client.browsers.fs.watch.start('id', { path: 'path', recursive: true }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('stop: only required params', async () => { const responsePromise = client.browsers.fs.watch.stop('watch_id', { id: 'id' }); const rawResponse = await responsePromise.asResponse(); @@ -54,7 +54,7 @@ describe('resource watch', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('stop: required and optional params', async () => { const response = await client.browsers.fs.watch.stop('watch_id', { id: 'id' }); }); diff --git a/tests/api-resources/browsers/replays.test.ts b/tests/api-resources/browsers/replays.test.ts index 23a4cd9..d0ee498 100644 --- a/tests/api-resources/browsers/replays.test.ts +++ b/tests/api-resources/browsers/replays.test.ts @@ -8,7 +8,7 @@ const client = new Kernel({ }); describe('resource replays', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.browsers.replays.list('id'); const rawResponse = await responsePromise.asResponse(); @@ -20,12 +20,11 @@ describe('resource replays', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being - test.skip('download: required and optional params', async () => { + test('download: required and optional params', async () => { const response = await client.browsers.replays.download('replay_id', { id: 'id' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('start', async () => { const responsePromise = client.browsers.replays.start('id'); const rawResponse = await responsePromise.asResponse(); @@ -37,7 +36,7 @@ describe('resource replays', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('start: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( @@ -49,7 +48,7 @@ describe('resource replays', () => { ).rejects.toThrow(Kernel.NotFoundError); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('stop: only required params', async () => { const responsePromise = client.browsers.replays.stop('replay_id', { id: 'id' }); const rawResponse = await responsePromise.asResponse(); @@ -61,7 +60,7 @@ describe('resource replays', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('stop: required and optional params', async () => { const response = await client.browsers.replays.stop('replay_id', { id: 'id' }); }); diff --git a/tests/api-resources/deployments.test.ts b/tests/api-resources/deployments.test.ts index 83eb8d7..289fe0c 100644 --- a/tests/api-resources/deployments.test.ts +++ b/tests/api-resources/deployments.test.ts @@ -8,7 +8,7 @@ const client = new Kernel({ }); describe('resource deployments', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.deployments.create({ entrypoint_rel_path: 'src/app.py', @@ -23,7 +23,7 @@ describe('resource deployments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: required and optional params', async () => { const response = await client.deployments.create({ entrypoint_rel_path: 'src/app.py', @@ -35,7 +35,7 @@ describe('resource deployments', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.deployments.retrieve('id'); const rawResponse = await responsePromise.asResponse(); @@ -47,7 +47,7 @@ describe('resource deployments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list', async () => { const responsePromise = client.deployments.list(); const rawResponse = await responsePromise.asResponse(); @@ -59,7 +59,7 @@ describe('resource deployments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('list: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( @@ -67,7 +67,7 @@ describe('resource deployments', () => { ).rejects.toThrow(Kernel.NotFoundError); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail + // Prism doesn't support text/event-stream responses test.skip('follow', async () => { const responsePromise = client.deployments.follow('id'); const rawResponse = await responsePromise.asResponse(); @@ -79,7 +79,7 @@ describe('resource deployments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail + // Prism doesn't support text/event-stream responses test.skip('follow: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( diff --git a/tests/api-resources/invocations.test.ts b/tests/api-resources/invocations.test.ts index e481c15..baa3790 100644 --- a/tests/api-resources/invocations.test.ts +++ b/tests/api-resources/invocations.test.ts @@ -8,7 +8,7 @@ const client = new Kernel({ }); describe('resource invocations', () => { - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: only required params', async () => { const responsePromise = client.invocations.create({ action_name: 'analyze', @@ -24,7 +24,7 @@ describe('resource invocations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('create: required and optional params', async () => { const response = await client.invocations.create({ action_name: 'analyze', @@ -35,7 +35,7 @@ describe('resource invocations', () => { }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('retrieve', async () => { const responsePromise = client.invocations.retrieve('rr33xuugxj9h0bkf1rdt2bet'); const rawResponse = await responsePromise.asResponse(); @@ -47,7 +47,7 @@ describe('resource invocations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: only required params', async () => { const responsePromise = client.invocations.update('id', { status: 'succeeded' }); const rawResponse = await responsePromise.asResponse(); @@ -59,12 +59,12 @@ describe('resource invocations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('update: required and optional params', async () => { const response = await client.invocations.update('id', { status: 'succeeded', output: 'output' }); }); - // skipped: tests are disabled for the time being + // Prism tests are disabled test.skip('deleteBrowsers', async () => { const responsePromise = client.invocations.deleteBrowsers('id'); const rawResponse = await responsePromise.asResponse(); @@ -76,7 +76,7 @@ describe('resource invocations', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail + // Prism doesn't support text/event-stream responses test.skip('follow', async () => { const responsePromise = client.invocations.follow('id'); const rawResponse = await responsePromise.asResponse();