Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions snippets/openapi/get-browsers-id-fs-download_dir_zip.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.browsers.fs.downloadDirZip('id', { path: '/J!' });

console.log(response);

const content = await response.blob();
console.log(content);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.browsers.fs.download_dir_zip(
id="id",
path="/J!",
)
print(response)
content = response.read()
print(content)
```
</CodeGroup>
27 changes: 27 additions & 0 deletions snippets/openapi/get-browsers-id-logs-stream.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const logEvent = await client.browsers.logs.stream('id', { source: 'path' });

console.log(logEvent.event);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
log_event = client.browsers.logs.stream(
id="id",
source="path",
)
print(log_event.event)
```
</CodeGroup>
27 changes: 27 additions & 0 deletions snippets/openapi/get-browsers-id-process-process_id-status.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.browsers.process.status('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { id: 'id' });

console.log(response.cpu_pct);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.browsers.process.status(
process_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="id",
)
print(response.cpu_pct)
```
</CodeGroup>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.browsers.process.stdoutStream('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
id: 'id',
});

console.log(response.data_b64);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.browsers.process.stdout_stream(
process_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="id",
)
print(response.data_b64)
```
</CodeGroup>
29 changes: 29 additions & 0 deletions snippets/openapi/post-browsers-id-fs-upload.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

await client.browsers.fs.upload('id', {
files: [{ dest_path: '/J!', file: fs.createReadStream('path/to/file') }],
});
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
client.browsers.fs.upload(
id="id",
files=[{
"dest_path": "/J!",
"file": b"raw file contents",
}],
)
```
</CodeGroup>
25 changes: 25 additions & 0 deletions snippets/openapi/post-browsers-id-fs-upload_zip.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

await client.browsers.fs.uploadZip('id', { dest_path: '/J!', zip_file: fs.createReadStream('path/to/file') });
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
client.browsers.fs.upload_zip(
id="id",
dest_path="/J!",
zip_file=b"raw file contents",
)
```
</CodeGroup>
27 changes: 27 additions & 0 deletions snippets/openapi/post-browsers-id-process-exec.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.browsers.process.exec('id', { command: 'command' });

console.log(response.duration_ms);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.browsers.process.exec(
id="id",
command="command",
)
print(response.duration_ms)
```
</CodeGroup>
31 changes: 31 additions & 0 deletions snippets/openapi/post-browsers-id-process-process_id-kill.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.browsers.process.kill('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
id: 'id',
signal: 'TERM',
});

console.log(response.ok);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.browsers.process.kill(
process_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="id",
signal="TERM",
)
print(response.ok)
```
</CodeGroup>
31 changes: 31 additions & 0 deletions snippets/openapi/post-browsers-id-process-process_id-stdin.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.browsers.process.stdin('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
id: 'id',
data_b64: 'data_b64',
});

console.log(response.written_bytes);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.browsers.process.stdin(
process_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="id",
data_b64="data_b64",
)
print(response.written_bytes)
```
</CodeGroup>
27 changes: 27 additions & 0 deletions snippets/openapi/post-browsers-id-process-spawn.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<CodeGroup>
```typescript Typescript/Javascript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
apiKey: 'My API Key',
});

const response = await client.browsers.process.spawn('id', { command: 'command' });

console.log(response.pid);
```


```python Python
from kernel import Kernel

client = Kernel(
api_key="My API Key",
)
response = client.browsers.process.spawn(
id="id",
command="command",
)
print(response.pid)
```
</CodeGroup>
5 changes: 5 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* style sidebar titles */
#navigation-items .sidebar-group-header #sidebar-title{
font-weight: bold;
font-size: larger;
}