Skip to content

Workspaces

A workspace is a folder that Guida opens to organize your automation project. Opening a workspace unlocks persistent storage (g.store), work queues (g.queue), full-text search (g.search), event triggers, and custom MCP tools.

Use File > Open Workspace or the toolbar button to select a folder. Guida will create the default structure if it doesn’t exist.

my-workspace/
├── scripts/ # Your automation scripts (*.js, *.lua, *.janet)
├── lib/ # Shared libraries for JS, Lua, and Janet
├── views/ # Queue view configurations
├── events.json # Event trigger config
├── tools.json # Custom MCP tool definitions
├── queues.json # Worker pool definitions
├── domains.json # Domain whitelist for MCP
├── workflows/ # Named automation pipelines (optional)
├── store.db # Persistent storage (auto-created)
├── queue.db # Work queue data (auto-created)
├── workflow-ledger.db # Workflow run/item history (auto-created)
└── search-index/ # Full-text search index (auto-created)

The Workspace pane in Guida automatically lists all .js, .lua, and .janet files found in the scripts/, lib/, and workflow folders. When creating a new file, use the extension for the engine you want.

These are created automatically when you first use the corresponding API:

  • store.db — LiteDB database for g.store.* operations. Documents organized in named collections.
  • queue.db — SQLite database for StratQueue-backed g.queue.* operations. Supports priority queues, custom dequeue strategies, checked-out work, and dead-letter queues.
  • workflow-ledger.db — SQLite database for workflow runs, items, events, artifacts, leases, retries, and recovery history.
  • search-index/ — Lucene.NET index directory for g.search.* operations.

All data is workspace-local and travels with the folder.

Use File > Backup Workspace… to create a timestamped archive of the whole workspace, or File > Backup Managed Workspace Files… to archive only Guida-managed state such as store.db, queue/ledger snapshots, and search-index/. See Workspace Backups.

Auto-run scripts when browser events occur:

{
"triggers": [
{
"event": "url-match",
"pattern": "https://example.com/products/*",
"script": "scripts/extract-product.js"
},
{
"event": "page-loaded",
"script": "scripts/inject-styles.js"
},
{
"event": "tab-created",
"script": "scripts/setup-tab.js"
}
]
}

Trigger types:

EventPatternFires when
url-matchGlob pattern (* = any chars)Navigation completes to a matching URL
page-loadedAny page finishes loading
tab-createdA new tab is created
tab-closedA tab is closed
tab-activatedA tab becomes active
dom-mutationCSS selector(s)A watched DOM element changes (text, attributes, or children)
external-queueA poll script returns data (configurable interval)

If the same script is already running, it won’t be triggered again.

dom-mutation — reactive DOM observation using MutationObserver. Ideal for live data like stock prices, betting odds, or dashboard metrics:

{
"event": "dom-mutation",
"selector": ".price-display",
"script": "scripts/on-price-change.js",
"debounce": 1000,
"strategy": "exhaust"
}
  • selector — CSS selector to observe (or selectors for an array of selectors)
  • attributes — optional list of specific attribute names to watch
  • debounce — milliseconds to debounce per element (default: 0)
  • strategy — backpressure strategy: "exhaust" (default — skip if script running), "buffer" (collect changes into an array), "sample" (keep only the latest change)

external-queue — poll an external data source at a configurable interval:

{
"event": "external-queue",
"source": "scripts/poll-api.js",
"script": "scripts/handle-item.js",
"interval": 30
}

The source script runs on each poll — return data if work is available, or null if empty. When data is returned, the script handler runs and can access it via g.trigger.getContext().

Trigger context — all trigger scripts can call g.trigger.getContext() to access event metadata (event type, tab ID, URL, timestamp, and trigger-specific fields like mutation details).

Define tools that external AI agents can invoke. See Custom Tools.

Define declarative worker pools for batch processing. See Queue Workers.

Control which domains the MCP server can navigate to. See MCP Integration.

{
"allowedDomains": [
"example.com",
"*.example.com",
"trusted-site.org"
]
}

These APIs require an open workspace and will return an error otherwise:

APIDescription
g.store.*Persistent document storage
g.queue.*Transactional work queues
g.search.*Full-text search index
g.workers.*Queue worker pools
g.workflows.*Workflow inspection and switching

Core APIs like g.dom.click, g.nav.navigateToUrl, and g.tabs.getTabs work without a workspace.