KosmoKrator

automation

Airtop Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Airtop KosmoKrator integration.

8 functions 5 read 3 write API key auth

Lua Namespace

Agents call this integration through app.integrations.airtop.*. Use lua_read_doc("integrations.airtop") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Airtop — Lua API Reference

create_session

Create a new cloud browser session. A session is a container for browser windows.

Parameters

NameTypeRequiredDescription
profilestringnoBrowser profile name for persisting cookies and state
proxystringnoProxy configuration (e.g., "http://user:pass@host:port")

Example

local session = app.integrations.airtop.create_session({
  profile = "default"
})

print("Session ID: " .. session.id)

get_session

Get details of an existing browser session.

Parameters

NameTypeRequiredDescription
session_idstringyesThe session ID to retrieve

Example

local session = app.integrations.airtop.get_session({
  session_id = "sess_abc123"
})

print("Status: " .. session.status)

create_window

Open a new browser window within a session.

Parameters

NameTypeRequiredDescription
session_idstringyesThe session ID to create the window in
urlstringnoStarting URL to navigate to when the window opens
widthintegernoWindow width in pixels (default: 1280)
heightintegernoWindow height in pixels (default: 720)

Example

local window = app.integrations.airtop.create_window({
  session_id = "sess_abc123",
  url = "https://example.com",
  width = 1920,
  height = 1080
})

print("Window ID: " .. window.id)

get_window

Get details of a browser window.

Parameters

NameTypeRequiredDescription
session_idstringyesThe session ID
window_idstringyesThe window ID to retrieve

Example

local window = app.integrations.airtop.get_window({
  session_id = "sess_abc123",
  window_id = "win_xyz789"
})

print("Current URL: " .. window.url)

Navigate a browser window to a URL.

Parameters

NameTypeRequiredDescription
session_idstringyesThe session ID
window_idstringyesThe window ID to navigate
urlstringyesThe URL to navigate to
wait_untilstringnoWhen to consider navigation complete: "load", "domcontentloaded", or "networkidle"

Example

local result = app.integrations.airtop.navigate({
  session_id = "sess_abc123",
  window_id = "win_xyz789",
  url = "https://example.com",
  wait_until = "networkidle"
})

print("Navigated to: " .. result.url)

get_page_content

Extract the content of the currently loaded page.

Parameters

NameTypeRequiredDescription
session_idstringyesThe session ID
window_idstringyesThe window ID to get content from

Example

local content = app.integrations.airtop.get_page_content({
  session_id = "sess_abc123",
  window_id = "win_xyz789"
})

print(content)

list_sessions

List all active browser sessions.

Parameters

None.

Example

local sessions = app.integrations.airtop.list_sessions({})

for _, session in ipairs(sessions) do
  print("Session: " .. session.id .. " — " .. session.status)
end

get_current_user

Get the profile of the authenticated Airtop user.

Parameters

None.

Example

local user = app.integrations.airtop.get_current_user({})

print("Logged in as: " .. user.email)

Typical Workflow

-- 1. Create a browser session
local session = app.integrations.airtop.create_session({})

-- 2. Open a window
local window = app.integrations.airtop.create_window({
  session_id = session.id
})

-- 3. Navigate to a page
app.integrations.airtop.navigate({
  session_id = session.id,
  window_id = window.id,
  url = "https://example.com"
})

-- 4. Extract content
local content = app.integrations.airtop.get_page_content({
  session_id = session.id,
  window_id = window.id
})

print(content)

Multi-Account Usage

If you have multiple Airtop accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.airtop.function_name({...})

-- Explicit default (portable across setups)
app.integrations.airtop.default.function_name({...})

-- Named accounts
app.integrations.airtop.work.function_name({...})
app.integrations.airtop.client.function_name({...})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Airtop — Lua API Reference

## create_session

Create a new cloud browser session. A session is a container for browser windows.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `profile` | string | no | Browser profile name for persisting cookies and state |
| `proxy` | string | no | Proxy configuration (e.g., `"http://user:pass@host:port"`) |

### Example

```lua
local session = app.integrations.airtop.create_session({
  profile = "default"
})

print("Session ID: " .. session.id)
```

---

## get_session

Get details of an existing browser session.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `session_id` | string | yes | The session ID to retrieve |

### Example

```lua
local session = app.integrations.airtop.get_session({
  session_id = "sess_abc123"
})

print("Status: " .. session.status)
```

---

## create_window

Open a new browser window within a session.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `session_id` | string | yes | The session ID to create the window in |
| `url` | string | no | Starting URL to navigate to when the window opens |
| `width` | integer | no | Window width in pixels (default: 1280) |
| `height` | integer | no | Window height in pixels (default: 720) |

### Example

```lua
local window = app.integrations.airtop.create_window({
  session_id = "sess_abc123",
  url = "https://example.com",
  width = 1920,
  height = 1080
})

print("Window ID: " .. window.id)
```

---

## get_window

Get details of a browser window.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `session_id` | string | yes | The session ID |
| `window_id` | string | yes | The window ID to retrieve |

### Example

```lua
local window = app.integrations.airtop.get_window({
  session_id = "sess_abc123",
  window_id = "win_xyz789"
})

print("Current URL: " .. window.url)
```

---

## navigate

Navigate a browser window to a URL.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `session_id` | string | yes | The session ID |
| `window_id` | string | yes | The window ID to navigate |
| `url` | string | yes | The URL to navigate to |
| `wait_until` | string | no | When to consider navigation complete: `"load"`, `"domcontentloaded"`, or `"networkidle"` |

### Example

```lua
local result = app.integrations.airtop.navigate({
  session_id = "sess_abc123",
  window_id = "win_xyz789",
  url = "https://example.com",
  wait_until = "networkidle"
})

print("Navigated to: " .. result.url)
```

---

## get_page_content

Extract the content of the currently loaded page.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `session_id` | string | yes | The session ID |
| `window_id` | string | yes | The window ID to get content from |

### Example

```lua
local content = app.integrations.airtop.get_page_content({
  session_id = "sess_abc123",
  window_id = "win_xyz789"
})

print(content)
```

---

## list_sessions

List all active browser sessions.

### Parameters

None.

### Example

```lua
local sessions = app.integrations.airtop.list_sessions({})

for _, session in ipairs(sessions) do
  print("Session: " .. session.id .. " — " .. session.status)
end
```

---

## get_current_user

Get the profile of the authenticated Airtop user.

### Parameters

None.

### Example

```lua
local user = app.integrations.airtop.get_current_user({})

print("Logged in as: " .. user.email)
```

---

## Typical Workflow

```lua
-- 1. Create a browser session
local session = app.integrations.airtop.create_session({})

-- 2. Open a window
local window = app.integrations.airtop.create_window({
  session_id = session.id
})

-- 3. Navigate to a page
app.integrations.airtop.navigate({
  session_id = session.id,
  window_id = window.id,
  url = "https://example.com"
})

-- 4. Extract content
local content = app.integrations.airtop.get_page_content({
  session_id = session.id,
  window_id = window.id
})

print(content)
```

---

## Multi-Account Usage

If you have multiple Airtop accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.airtop.function_name({...})

-- Explicit default (portable across setups)
app.integrations.airtop.default.function_name({...})

-- Named accounts
app.integrations.airtop.work.function_name({...})
app.integrations.airtop.client.function_name({...})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.airtop.airtop_create_session({
  profile = "example_profile",
  proxy = "example_proxy"
})
print(result)

Functions

airtop_create_session

Create a new cloud browser session in Airtop. A session is a container for one or more browser windows. Returns the session ID needed to create windows and interact with pages.

Operation
Write write
Full name
airtop.airtop_create_session
ParameterTypeRequiredDescription
profile string no Optional browser profile name to use for the session. Profiles can persist cookies and state across sessions.
proxy string no Optional proxy configuration for the session (e.g., "http://user:pass@host:port").

airtop_get_session

Get details of an existing Airtop browser session, including its status and associated windows.

Operation
Read read
Full name
airtop.airtop_get_session
ParameterTypeRequiredDescription
session_id string yes The ID of the session to retrieve.

airtop_create_window

Open a new browser window within an existing Airtop session. Optionally specify a starting URL to navigate to immediately.

Operation
Write write
Full name
airtop.airtop_create_window
ParameterTypeRequiredDescription
session_id string yes The session ID to create the window in.
url string no Optional starting URL to navigate to when the window opens.
width integer no Window width in pixels (default: 1280).
height integer no Window height in pixels (default: 720).

airtop_get_window

Get details of a browser window in an Airtop session, including its current URL and status.

Operation
Read read
Full name
airtop.airtop_get_window
ParameterTypeRequiredDescription
session_id string yes The session ID.
window_id string yes The window ID to retrieve.

airtop_navigate

Navigate a browser window to a specified URL in an Airtop session. Waits for the page to load before returning.

Operation
Write write
Full name
airtop.airtop_navigate
ParameterTypeRequiredDescription
session_id string yes The session ID.
window_id string yes The window ID to navigate.
url string yes The URL to navigate to (e.g., "https://example.com").
wait_until string no When to consider navigation complete: "load", "domcontentloaded", or "networkidle". Default is "load".

airtop_get_page_content

Extract the content of the currently loaded page in an Airtop browser window. Returns the page text content, which can be used for analysis, summarization, or data extraction.

Operation
Read read
Full name
airtop.airtop_get_page_content
ParameterTypeRequiredDescription
session_id string yes The session ID.
window_id string yes The window ID to get content from.

airtop_list_sessions

List all active browser sessions in Airtop. Returns session IDs and their current status.

Operation
Read read
Full name
airtop.airtop_list_sessions
ParameterTypeRequiredDescription
No parameters.

airtop_get_current_user

Get the profile of the currently authenticated Airtop user. Useful for verifying API credentials and checking account details.

Operation
Read read
Full name
airtop.airtop_get_current_user
ParameterTypeRequiredDescription
No parameters.