KosmoKrator

productivity

BrowserStack Lua API for KosmoKrator Agents

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

Lua Namespace

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

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic BrowserStack workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.browserstack.get_plan({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("browserstack"))' --json
kosmo integrations:lua --eval 'print(docs.read("browserstack.get_plan"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local browserstack = app.integrations.browserstack
local result = browserstack.get_plan({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.browserstack, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.browserstack.default.* or app.integrations.browserstack.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need BrowserStack, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

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

BrowserStack

Namespace: browserstack

Use the BrowserStack integration to inspect and manage BrowserStack Automate and App Automate resources. Authentication uses BrowserStack HTTP Basic credentials: username and access_key.

Common Workflows

  • Use browserstack_get_plan to inspect allowed, running, and queued parallel sessions before scheduling test runs.
  • Use browserstack_list_browsers to discover supported OS, browser, and real-device combinations.
  • Use browserstack_list_projects, browserstack_get_project, browserstack_update_project, and browserstack_delete_project for Automate projects.
  • Use browserstack_list_builds, browserstack_update_build, browserstack_delete_build, and browserstack_delete_builds for Automate builds.
  • Use browserstack_list_build_sessions, browserstack_get_session, browserstack_update_session, browserstack_delete_session, browserstack_get_session_logs, and browserstack_get_session_network_logs for session results and debugging assets.
  • Use browserstack_upload_app, browserstack_list_recent_apps, and browserstack_delete_app for App Automate app management.
  • Use browserstack_api_get, browserstack_api_post, browserstack_api_put, and browserstack_api_delete for safe relative BrowserStack API paths not covered by first-class tools. Full URLs are rejected.

Argument Notes

Automate tools use project_id, build_id, or session_id depending on the resource. App Automate app deletion uses app_id. browserstack_list_recent_apps accepts optional custom_id.

Write tools accept request bodies through payload. Read tools accept optional filters through query.

For browserstack_upload_app, pass a public app URL in payload.url; optional fields include custom_id and ios_keychain_support.

Examples

local plan = tools.browserstack_get_plan({})

local builds = tools.browserstack_list_builds({
  query = { limit = 20, status = "running" }
})

local session_logs = tools.browserstack_get_session_logs({
  session_id = "session-id"
})

local uploaded = tools.browserstack_upload_app({
  payload = {
    url = "https://example.test/app-debug.apk",
    custom_id = "SampleApp"
  }
})

Return Shapes

The integration returns decoded BrowserStack JSON responses directly. Empty successful responses are normalized to:

{"success": true}

Plain text responses such as session logs are normalized to:

{"value": "raw response text"}

BrowserStack product APIs use different base hosts. Automate calls use https://api.browserstack.com; App Automate upload and recent-app calls use https://api-cloud.browserstack.com.

Raw agent markdown
# BrowserStack

Namespace: `browserstack`

Use the BrowserStack integration to inspect and manage BrowserStack Automate and App Automate resources. Authentication uses BrowserStack HTTP Basic credentials: `username` and `access_key`.

## Common Workflows

- Use `browserstack_get_plan` to inspect allowed, running, and queued parallel sessions before scheduling test runs.
- Use `browserstack_list_browsers` to discover supported OS, browser, and real-device combinations.
- Use `browserstack_list_projects`, `browserstack_get_project`, `browserstack_update_project`, and `browserstack_delete_project` for Automate projects.
- Use `browserstack_list_builds`, `browserstack_update_build`, `browserstack_delete_build`, and `browserstack_delete_builds` for Automate builds.
- Use `browserstack_list_build_sessions`, `browserstack_get_session`, `browserstack_update_session`, `browserstack_delete_session`, `browserstack_get_session_logs`, and `browserstack_get_session_network_logs` for session results and debugging assets.
- Use `browserstack_upload_app`, `browserstack_list_recent_apps`, and `browserstack_delete_app` for App Automate app management.
- Use `browserstack_api_get`, `browserstack_api_post`, `browserstack_api_put`, and `browserstack_api_delete` for safe relative BrowserStack API paths not covered by first-class tools. Full URLs are rejected.

## Argument Notes

Automate tools use `project_id`, `build_id`, or `session_id` depending on the resource. App Automate app deletion uses `app_id`. `browserstack_list_recent_apps` accepts optional `custom_id`.

Write tools accept request bodies through `payload`. Read tools accept optional filters through `query`.

For `browserstack_upload_app`, pass a public app URL in `payload.url`; optional fields include `custom_id` and `ios_keychain_support`.

## Examples

```lua
local plan = tools.browserstack_get_plan({})

local builds = tools.browserstack_list_builds({
  query = { limit = 20, status = "running" }
})

local session_logs = tools.browserstack_get_session_logs({
  session_id = "session-id"
})

local uploaded = tools.browserstack_upload_app({
  payload = {
    url = "https://example.test/app-debug.apk",
    custom_id = "SampleApp"
  }
})
```

## Return Shapes

The integration returns decoded BrowserStack JSON responses directly. Empty successful responses are normalized to:

```json
{"success": true}
```

Plain text responses such as session logs are normalized to:

```json
{"value": "raw response text"}
```

BrowserStack product APIs use different base hosts. Automate calls use `https://api.browserstack.com`; App Automate upload and recent-app calls use `https://api-cloud.browserstack.com`.
Metadata-derived Lua example
local result = app.integrations.browserstack.get_plan({})
print(result)

Functions

get_plan Read

Get Automate plan and parallel session details.

Lua path
app.integrations.browserstack.get_plan
Full name
browserstack.browserstack_get_plan
ParameterTypeRequiredDescription
No parameters.
list Read

List Automate browsers and devices.

Lua path
app.integrations.browserstack.list
Full name
browserstack.browserstack_list_browsers
ParameterTypeRequiredDescription
No parameters.
list_projects Read

List Automate projects.

Lua path
app.integrations.browserstack.list_projects
Full name
browserstack.browserstack_list_projects
ParameterTypeRequiredDescription
No parameters.
get_project Read

Get one Automate project.

Lua path
app.integrations.browserstack.get_project
Full name
browserstack.browserstack_get_project
ParameterTypeRequiredDescription
No parameters.
update_project Write

Update Automate project details.

Lua path
app.integrations.browserstack.update_project
Full name
browserstack.browserstack_update_project
ParameterTypeRequiredDescription
No parameters.
delete_project Write

Delete one Automate project.

Lua path
app.integrations.browserstack.delete_project
Full name
browserstack.browserstack_delete_project
ParameterTypeRequiredDescription
No parameters.
list_builds Read

List Automate builds.

Lua path
app.integrations.browserstack.list_builds
Full name
browserstack.browserstack_list_builds
ParameterTypeRequiredDescription
No parameters.
update_build Write

Update Automate build name or tag.

Lua path
app.integrations.browserstack.update_build
Full name
browserstack.browserstack_update_build
ParameterTypeRequiredDescription
No parameters.
delete_build Write

Delete one Automate build.

Lua path
app.integrations.browserstack.delete_build
Full name
browserstack.browserstack_delete_build
ParameterTypeRequiredDescription
No parameters.
delete_builds Write

Delete multiple Automate builds.

Lua path
app.integrations.browserstack.delete_builds
Full name
browserstack.browserstack_delete_builds
ParameterTypeRequiredDescription
No parameters.
list_build_sessions Read

List sessions in an Automate build.

Lua path
app.integrations.browserstack.list_build_sessions
Full name
browserstack.browserstack_list_build_sessions
ParameterTypeRequiredDescription
No parameters.
get_session Read

Get one Automate session.

Lua path
app.integrations.browserstack.get_session
Full name
browserstack.browserstack_get_session
ParameterTypeRequiredDescription
No parameters.
update_session Write

Update one Automate session.

Lua path
app.integrations.browserstack.update_session
Full name
browserstack.browserstack_update_session
ParameterTypeRequiredDescription
No parameters.
delete_session Write

Delete one Automate session.

Lua path
app.integrations.browserstack.delete_session
Full name
browserstack.browserstack_delete_session
ParameterTypeRequiredDescription
No parameters.
get_session_logs Read

Get text logs for one session.

Lua path
app.integrations.browserstack.get_session_logs
Full name
browserstack.browserstack_get_session_logs
ParameterTypeRequiredDescription
No parameters.
get_session_network_logs Read

Get HAR network logs for one session.

Lua path
app.integrations.browserstack.get_session_network_logs
Full name
browserstack.browserstack_get_session_network_logs
ParameterTypeRequiredDescription
No parameters.
upload_app Write

Upload an App Automate app by public URL.

Lua path
app.integrations.browserstack.upload_app
Full name
browserstack.browserstack_upload_app
ParameterTypeRequiredDescription
No parameters.
list_recent_apps Read

List recently uploaded App Automate apps.

Lua path
app.integrations.browserstack.list_recent_apps
Full name
browserstack.browserstack_list_recent_apps
ParameterTypeRequiredDescription
No parameters.
delete_app Write

Delete an uploaded App Automate app.

Lua path
app.integrations.browserstack.delete_app
Full name
browserstack.browserstack_delete_app
ParameterTypeRequiredDescription
No parameters.
api_get Read

Call a safe relative BrowserStack GET path.

Lua path
app.integrations.browserstack.api_get
Full name
browserstack.browserstack_api_get
ParameterTypeRequiredDescription
No parameters.
api_post Write

Call a safe relative BrowserStack POST path.

Lua path
app.integrations.browserstack.api_post
Full name
browserstack.browserstack_api_post
ParameterTypeRequiredDescription
No parameters.
api_put Write

Call a safe relative BrowserStack PUT path.

Lua path
app.integrations.browserstack.api_put
Full name
browserstack.browserstack_api_put
ParameterTypeRequiredDescription
No parameters.
api_delete Write

Call a safe relative BrowserStack DELETE path.

Lua path
app.integrations.browserstack.api_delete
Full name
browserstack.browserstack_api_delete
ParameterTypeRequiredDescription
No parameters.