Skip to content
Open
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
28 changes: 28 additions & 0 deletions flexus_client_kit/ckit_integrations_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class IntegrationRecord:
integr_need_mongo: bool = False


@dataclass
class _MongoStoreState:
collection: Any = None


def static_integrations_load(bot_dir: Path, allowlist: list[str], builtin_skills: list[str]) -> list[IntegrationRecord]:
# static means designed to save into constant on top level of a bot file
# logger is not yet initilized here, no logs possible
Expand Down Expand Up @@ -246,6 +251,29 @@ def _setup_crm(obj, rcx, _tam=tools_and_methods):
integr_prompt=fi_crm.LOG_CRM_ACTIVITIES_PROMPT if "log_activity" in subset else "",
))

elif name == "mongo_store":
from flexus_client_kit.integrations import fi_mongo_store
from flexus_client_kit import ckit_mongo
state = _MongoStoreState()
async def _init_mongo_store(rcx, setup, _state=state):
from pymongo import AsyncMongoClient
mongo_conn_str = await ckit_mongo.mongo_fetch_creds(rcx.fclient, rcx.persona.persona_id)
mongo = AsyncMongoClient(mongo_conn_str)
dbname = rcx.persona.persona_id + "_db"
_state.collection = mongo[dbname]["personal_mongo"]
return _state
result.append(IntegrationRecord(
integr_name=name,
integr_tools=[fi_mongo_store.MONGO_STORE_TOOL],
integr_init=_init_mongo_store,
integr_setup_handlers=lambda obj, rcx, _s=state: [
rcx.on_tool_call("mongo_store")(
lambda tc, args: fi_mongo_store.handle_mongo_store(rcx.workdir, _s.collection, tc, args)
)
],
integr_prompt="",
))

else:
raise ValueError(f"Unknown integration {name!r}")
return result
Expand Down
2 changes: 1 addition & 1 deletion flexus_client_kit/manifest_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"type": "array",
"title": "Tools and Integrations",
"items": { "type": "string" },
"description": "List of tools and integrations the bot uses. Accepts built-in integrations (flexus_policy_document, print_widget, gmail, google_calendar, jira, skills) and cloud tool names. Each provides tools and optionally OAuth. Example: ['flexus_policy_document', 'gmail', 'google_calendar']."
"description": "List of tools and integrations the bot uses. Accepts built-in integrations (flexus_policy_document, print_widget, gmail, google_calendar, jira, skills, mongo_store) and cloud tool names. Each provides tools and optionally OAuth. Example: ['flexus_policy_document', 'gmail', 'google_calendar']."
},
"shared_skills_allowlist": {
"type": "string",
Expand Down
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions flexus_simple_bots/browser_hand/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"bot_name": "browser_hand",
"accent_color": "#34495E",
"title1": "Browser",
"title2": "Web automation agent for navigation, forms, and multi-step workflows.",
"author": "Flexus",
"occupation": "Web Automation Specialist",
"typical_group": "Productivity / Automation",
"github_repo": "https://github.com/smallcloudai/flexus-client-kit.git",
"integrations": [
"skills",
"mongo_store"
],
"shared_skills_allowlist": "*",
"featured_actions": [
{
"feat_question": "Navigate to example.com and fill out the contact form",
"feat_expert": "default"
},
{
"feat_question": "Compare prices for a product across 3 websites",
"feat_expert": "default"
},
{
"feat_question": "Take a screenshot of our landing page on mobile and desktop",
"feat_expert": "default"
}
],
"intro_message": "Hi! I'm Browser. I can navigate websites, take screenshots, extract content, and help with web-based workflows. Tell me what you need done on the web.",
"preferred_model_default": "grok-4-1-fast-reasoning",
"daily_budget_default": 10000000,
"default_inbox_default": 10000,
"tags": [
"Automation",
"Browser",
"Web",
"Productivity"
]
}
79 changes: 79 additions & 0 deletions flexus_simple_bots/browser_hand/prompts/expert_default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
expert_description: Web automation agent for navigation, form filling, screenshots, and multi-step workflows
---

## Web Automation Agent

You are Browser — a web automation agent that navigates sites, extracts content, takes screenshots, and helps with multi-step web workflows.

## Available Tools

- **web** — Navigate to URLs, extract page content, and take browser screenshots.
- `web(open=[{url: "...", content_selectors: ["main", ".product"]}])` — Extract specific content
- `web(screenshot=[{url: "...", w: 1280, h: 720, full_page: true}])` — Take screenshots
- `web(search=[{q: "query"}])` — Search the web
- **mongo_store** — Persist session state, extracted data, and task history.
- **flexus_fetch_skill** — Load web automation reference guides.

## Automation Pipeline

### Phase 1 — Understand Task
Parse the user's request to identify:
- Target URL(s) to visit
- Actions to perform (read, extract, screenshot, compare)
- Data to collect
- Success criteria

### Phase 2 — Navigate and Extract
For each target URL:
1. Fetch the page with `web(open=[{url: "..."}])`
2. Analyze the content structure
3. Use CSS selectors to target specific elements if needed
4. Take screenshots at key points if auto_screenshot is enabled

### Phase 3 — Multi-Step Workflows
For complex tasks:
1. Break into sequential steps
2. Execute each step, verifying success before proceeding
3. Handle common obstacles:
- Cookie consent banners
- Login requirements (inform user)
- Dynamic content loading
- Pagination

### Phase 4 — Purchase Approval Gate
**MANDATORY**: Before ANY action involving money or payments:
1. STOP immediately
2. Present the full details to the user:
- What is being purchased
- Total cost
- Payment method
- Seller/merchant
3. Wait for explicit user confirmation
4. Do NOT proceed without explicit approval

This gate applies to:
- Clicking "Buy", "Purchase", "Pay", "Subscribe", "Add to Cart + Checkout"
- Submitting payment forms
- Confirming orders
- Starting free trials that auto-convert to paid

### Phase 5 — Report
Provide a summary of:
- Pages visited and actions taken
- Data extracted
- Screenshots captured
- Any issues encountered
- Results vs. success criteria

Save session data to mongo_store.

## Rules
- ALWAYS require purchase approval for ANY financial transaction
- Never store or transmit passwords
- Verify HTTPS before entering sensitive information
- Report suspicious or phishing-like pages immediately
- Respect robots.txt and rate limits
- Do not attempt to bypass CAPTCHAs
- Limit pages visited to the configured maximum
- Take screenshots as evidence of key actions
17 changes: 17 additions & 0 deletions flexus_simple_bots/browser_hand/prompts/personality.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
You are Browser, a precise and cautious web automation agent. You navigate websites
methodically, extract information accurately, and never take financial actions without
explicit human approval. Safety and accuracy are your top priorities.

Your style:
- Describe what you see on each page before taking action
- Take screenshots as evidence at key decision points
- Be explicit about what data you're extracting and from where
- Ask for clarification rather than guessing at ambiguous instructions
- Report security concerns immediately

What you never do:
- Complete purchases or payments without explicit user approval
- Store or transmit passwords
- Attempt to bypass CAPTCHAs or security measures
- Visit suspicious or phishing-like URLs without warning the user
- Exceed the configured page visit limit
29 changes: 29 additions & 0 deletions flexus_simple_bots/browser_hand/setup_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"bs_name": "purchase_approval",
"bs_type": "bool",
"bs_default": true,
"bs_group": "Safety",
"bs_order": 1,
"bs_importance": 1,
"bs_description": "Require explicit approval before any purchase or payment action (strongly recommended)"
},
{
"bs_name": "max_pages_per_task",
"bs_type": "string_short",
"bs_default": "25",
"bs_group": "Limits",
"bs_order": 2,
"bs_importance": 0,
"bs_description": "Maximum pages to visit per task: 10, 25, 50"
},
{
"bs_name": "auto_screenshot",
"bs_type": "bool",
"bs_default": true,
"bs_group": "Behavior",
"bs_order": 3,
"bs_importance": 0,
"bs_description": "Automatically take screenshots at key steps"
}
]
83 changes: 83 additions & 0 deletions flexus_simple_bots/browser_hand/skills/web-automation/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: web-automation
description: Web automation reference for CSS selectors, common workflows, and error recovery
---

## CSS Selector Reference

### Basic Selectors
- `#id` — Element by ID
- `.class` — Elements by class
- `tag` — Elements by tag name
- `tag.class` — Tag with specific class

### Form Selectors
- `input[type="text"]` — Text inputs
- `input[type="email"]` — Email inputs
- `select` — Dropdown menus
- `textarea` — Text areas
- `button[type="submit"]` — Submit buttons
- `input[name="fieldname"]` — Input by name attribute

### Navigation Selectors
- `nav a` — Navigation links
- `a[href*="login"]` — Login links
- `.breadcrumb` — Breadcrumb navigation
- `.pagination` — Pagination controls

### Content Selectors
- `main` — Main content area
- `article` — Article content
- `.product-card` — Product listings
- `.price, [data-price]` — Price elements
- `table` — Data tables
- `h1, h2, h3` — Headings

## Common Workflow Templates

### Price Comparison
1. Search for product on each site
2. Extract price, availability, shipping cost
3. Normalize currency and format
4. Generate comparison table

### Content Extraction
1. Navigate to target page
2. Identify content structure (selectors)
3. Extract text, images, links
4. Format as structured data

### Form Submission Guide
1. Navigate to form page
2. Identify all required fields
3. Present field list to user for values
4. Describe how to fill each field

## Error Recovery

### Element Not Found
- Try alternative selectors
- Check if content is dynamically loaded
- Try full-page screenshot to see current state

### Timeout
- Retry with longer timeout
- Check if site is accessible
- Try alternative URL or cached version

### CAPTCHA Detected
- Do NOT attempt to solve
- Inform user that manual intervention is needed
- Suggest alternative approaches

### Pop-ups/Modals
- Look for close buttons: `.close`, `[aria-label="Close"]`, `.dismiss`
- Try pressing Escape key
- Check if content is accessible behind modal

## Security Checklist
- Verify domain matches expected (no typosquatting)
- Check for HTTPS (padlock icon)
- Never enter credentials unless user explicitly provides them
- Watch for phishing indicators (misspelled domains, suspicious redirects)
- Report any security concerns immediately
Empty file.
Binary file added flexus_simple_bots/clip/clip-1024x1536.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added flexus_simple_bots/clip/clip-256x256.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions flexus_simple_bots/clip/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"bot_name": "clip",
"accent_color": "#E74C3C",
"title1": "Clip",
"title2": "Turns long-form video into viral short clips with captions.",
"author": "Flexus",
"occupation": "Video Editor",
"typical_group": "Content / Marketing",
"github_repo": "https://github.com/smallcloudai/flexus-client-kit.git",
"integrations": [
"skills",
"mongo_store"
],
"shared_skills_allowlist": "*",
"featured_actions": [
{
"feat_question": "Turn this YouTube video into 3 short clips: https://...",
"feat_expert": "default"
},
{
"feat_question": "Create vertical shorts with captions from a podcast episode",
"feat_expert": "default"
},
{
"feat_question": "Extract the best 60-second highlights from this video",
"feat_expert": "default"
}
],
"intro_message": "Hi! I'm Clip. Send me a video URL or file and I'll turn it into viral short clips with captions, thumbnails, and optional voice-over.",
"preferred_model_default": "grok-4-1-fast-reasoning",
"daily_budget_default": 10000000,
"default_inbox_default": 10000,
"tags": [
"Video",
"Content",
"Clips",
"Social Media"
]
}
Loading