Commit graph

3151 commits

Author SHA1 Message Date
Anish Sarkar
be26f00d20 refactor(instagram): enhance fetch logic for login wall detection
Updated the fetch_json function to raise InstagramAccessBlockedError immediately upon detecting a login redirect (302 -> /accounts/login/). This change prevents unnecessary IP rotations when encountering endpoint-level access blocks, improving the efficiency of the scraper's handling of Instagram's login wall.
2026-07-09 19:56:29 +05:30
Anish Sarkar
4af0b9dbbd test(instagram): add regression test for InstagramAccessBlockedError handling
Introduced a new test to ensure that InstagramAccessBlockedError is properly propagated without causing deadlocks in the scraper's fan_out function. This regression test verifies that the error surfaces correctly when a blocked job is encountered, enhancing the resilience of the fetch process.
2026-07-09 19:09:06 +05:30
Anish Sarkar
e8f8eeab27 fix(instagram): improve error handling for Instagram access blocks in scraper
Updated the fan_out function to handle InstagramAccessBlockedError more gracefully. Instead of raising the error directly, it now puts the error into the results queue to prevent deadlocks. This change ensures that the consumer can handle access block scenarios without interrupting the processing of other jobs.
2026-07-09 19:08:18 +05:30
Anish Sarkar
6384409b1d test(instagram): enhance fetch resilience tests for login redirects
Added tests to handle scenarios where a 200 status response is redirected to a login page, ensuring proper rotation of IPs and raising errors when persistent login redirects occur. Updated the _FakeSession class to support login wall detection.
2026-07-09 18:29:29 +05:30
Anish Sarkar
d800ca33a5 feat(instagram): handle soft login wall in fetch logic
Added detection for Instagram's soft login wall, which returns a 200 status with login HTML. Implemented a new function to identify login redirects and adjusted the fetch logic to treat these cases similarly to 401/403 responses.
2026-07-09 18:29:17 +05:30
Anish Sarkar
7309ca5ca0 test(instagram): add manual e2e scraper script 2026-07-09 16:03:29 +05:30
Anish Sarkar
e151346fbe test(chat): include Instagram in subagent composition test 2026-07-09 16:03:23 +05:30
Anish Sarkar
458d223ef8 test(billing): cover Instagram item and comment billing 2026-07-09 16:02:54 +05:30
Anish Sarkar
2e66e714e2 test(instagram): add capability unit tests 2026-07-09 16:02:48 +05:30
Anish Sarkar
9da136070d test(instagram): add platform-layer unit tests 2026-07-09 16:02:41 +05:30
Anish Sarkar
98eab8c4b5 feat(chat): add Instagram builtin subagent 2026-07-09 16:02:05 +05:30
Anish Sarkar
929efe8152 feat(instagram): register instagram.* capability namespace 2026-07-09 16:01:49 +05:30
Anish Sarkar
7ea474be93 feat(instagram): add details capability verb 2026-07-09 16:01:38 +05:30
Anish Sarkar
38a26b1ccf feat(instagram): add comments capability verb 2026-07-09 14:58:58 +05:30
Anish Sarkar
ff55537bce feat(instagram): add scrape capability verb 2026-07-09 14:58:54 +05:30
Anish Sarkar
eccc142974 docs(instagram): add platform scraper README 2026-07-09 14:58:47 +05:30
Anish Sarkar
6270250f74 feat(instagram): add fan-out orchestrator with deterministic early-stop cleanup 2026-07-09 14:58:38 +05:30
Anish Sarkar
b1eff478fd feat(instagram): add proxy-aware fetch with warm-up and rotate-on-block 2026-07-09 14:58:32 +05:30
Anish Sarkar
2d29001004 feat(instagram): add web-JSON parsers 2026-07-09 14:58:27 +05:30
Anish Sarkar
8dc8ad6a36 feat(instagram): add URL classifier and normalizer 2026-07-09 14:58:15 +05:30
Anish Sarkar
842a0e666d feat(instagram): add platform input/output schemas 2026-07-09 14:58:11 +05:30
Anish Sarkar
51c2dfdfe6 feat(config): add Instagram per-item and per-comment scrape rates 2026-07-09 14:57:59 +05:30
Anish Sarkar
43660ee51b feat(billing): map Instagram units to rate keys and display nouns 2026-07-09 14:57:53 +05:30
Anish Sarkar
f204db7bce feat(billing): add INSTAGRAM_ITEM and INSTAGRAM_COMMENT units 2026-07-09 14:57:44 +05:30
Anish Sarkar
8486a4f914 feat(constants): add Instagram to SUBAGENT_TO_REQUIRED_CONNECTOR_MAP for enhanced multi-agent chat capabilities 2026-07-09 14:08:23 +05:30
Anish Sarkar
3bd864ed95 feat(env): add Instagram scraping configuration parameters to .env.example 2026-07-09 14:08:10 +05:30
Rohan Verma
3eb485ff31
Merge pull request #1575 from SyntaxSawdust/feature/1354-embedding-base-url
Support separate embedding base URL configuration
2026-07-08 17:11:42 -07:00
Rohan Verma
d2ed0bb382
Merge pull request #1570 from pelazas/fix/scheduler-task-map-bookstack
fix: dispatch periodic BookStack indexing from the scheduler task_map
2026-07-08 15:07:38 -07:00
DESKTOP-RTLN3BA\$punk
b8155c6c0e Merge commit '1ae927a7db' into dev 2026-07-08 15:05:11 -07:00
Anish Sarkar
7ba77c6b86 feat(capabilities): add documentation URLs to Google Maps, YouTube, and web crawl capabilities
- Introduced a `docs_url` field to the Google Maps reviews, scrape, YouTube comments, YouTube scrape, and web crawl capabilities for improved documentation access.
- Simplified descriptions for each capability to enhance clarity and user understanding.
2026-07-08 03:38:08 +05:30
Anish Sarkar
3b9c806c90 feat(capabilities): add documentation URL to capabilities and enhance Reddit scrape capability
- Introduced a `docs_url` field to the `Capability` and `CapabilitySummary` classes for better documentation access.
- Updated the `REDDIT_SCRAPE` capability to include a specific documentation link.
- Enhanced the PlaygroundRunner component to display the documentation link when available, improving user guidance.
2026-07-08 03:35:32 +05:30
Dustin Persek
41edac7641 Merge remote-tracking branch 'upstream/dev' into feature/1354-embedding-base-url
# Conflicts:
#	surfsense_web/content/docs/docker-installation/docker-compose.mdx
#	surfsense_web/content/docs/manual-installation.mdx
2026-07-07 14:19:40 -04:00
DESKTOP-RTLN3BA\$punk
b477d33cba Merge commit 'fa7075fde6' into dev 2026-07-07 00:39:58 -07:00
DESKTOP-RTLN3BA\$punk
9a9a78e7ef refactor: improve session management and concurrency in Google Search fetcher
- Introduced a semaphore to limit concurrent page renders, enhancing resource management.
- Updated session handling to defer browser closure until all in-flight renders are complete.
- Improved comments for clarity on the behavior of concurrent fetches and session lifecycle.
- Cleaned up imports in alembic environment and migration flow scripts for consistency.
2026-07-06 22:33:40 -07:00
DESKTOP-RTLN3BA\$punk
1c9ab207ef chore: bumped version to 0.0.31 2026-07-06 21:43:15 -07:00
DESKTOP-RTLN3BA\$punk
1fd58752a3 feat: update environment variables and enhance scraping capabilities
- Adjusted Google Maps and YouTube micro pricing in the .env.example file for better cost management.
- Introduced new environment variables for captcha solving and stealth browser hardening to improve scraping resilience.
- Removed outdated smoke test for scraper API endpoints to streamline testing.
- Enhanced anonymous chat agent's system prompt to clarify capabilities and suggest account creation for advanced features.
- Updated Reddit fetch logic to prioritize new session handling and improve resilience against IP-related issues.
- Added compacting functionality for scraper results to optimize data handling and presentation.
- Improved workspace and document management tools with clearer descriptions and enhanced functionality.
- Introduced new UI components for agent setup guidance in the web application.
2026-07-06 20:27:36 -07:00
DESKTOP-RTLN3BA\$punk
271a21aee6 feat: docs and ui tweaks 2026-07-06 19:26:35 -07:00
DESKTOP-RTLN3BA\$punk
50f2d095aa feat: api playground, other tweaks 2026-07-06 16:45:04 -07:00
Anish Sarkar
a8c1fb660d feat(rename): complete searchSpace to workspace transition across frontend and backend
- Introduced a comprehensive specification for renaming `searchSpace` to `workspace` in `surfsense_web` and `surfsense_desktop`, ensuring all TypeScript identifiers, React props, and local data structures are updated.
- Implemented migration shims for persisted local state to prevent data loss during the transition.
- Updated observability metrics and IPC channels to reflect the new naming convention.
- Removed legacy `active-search-space` module and replaced it with `active-workspace` to maintain consistency.
- Ensured no behavioral changes or data loss for users during the renaming process.
2026-07-06 15:12:40 +05:30
Anish Sarkar
fd8d1273cd Merge remote-tracking branch 'upstream/ci_mvp' into feat/ci-ui-changes 2026-07-06 13:25:51 +05:30
DESKTOP-RTLN3BA\$punk
035e777287 chore: remove proprietary README file
- Deleted the `README.md` from the `app/proprietary` directory, which outlined licensing and usage rules for proprietary components. This removal reflects a shift in project documentation strategy and simplifies the codebase.
2026-07-05 23:44:31 -07:00
DESKTOP-RTLN3BA\$punk
a64c8205fe feat: implement ensure_publication for zero_publication management
- Added the ensure_publication function to create and verify the zero_publication if it is missing, ensuring idempotency during database initialization.
- Integrated ensure_publication into the create_db_and_tables function to prevent zero-cache crash loops on startup.
- Introduced a self-check script to validate the ensure_publication functionality on a create_all-bootstrapped database.
- Updated various components to reflect the transition from search space to workspace, including adjustments in imports and routing paths.
2026-07-05 23:17:13 -07:00
Anish Sarkar
cda232101f feat(workspace): remove AI file sorting feature and related components 2026-07-06 10:50:20 +05:30
Rohan Verma
dec4cd9a0d
Merge pull request #1574 from CREDO23/feature-mcp-server
[Feat] MCP: Add SurfSense MCP server for scrapers, KB, and workspaces
2026-07-05 20:48:15 -07:00
Dustin Persek
6fafedca6a Support separate embedding base URL 2026-07-05 22:33:09 -04:00
CREDO23
cb22cc4bfc fix(backend): read page_content on extension document ingestion 2026-07-06 03:17:25 +02:00
CREDO23
800c0e55fd feat(backend): expose semantic document search endpoint 2026-07-06 02:29:19 +02:00
DESKTOP-RTLN3BA\$punk
80927a2872 feat(billing): meter platform scrapers per item; consolidate web scraping onto web.crawl
Add per-item, per-platform billing for the platform-native connectors (Reddit, Google Search, Google Maps places/reviews, YouTube videos/comments) through the capability gate/charge seam. Rates are config-driven with a shared wallet-credit module (wallet_credit) and a dedicated PlatformScrapeCreditService; agent and REST capability runs now record cost_micros. Google Maps scrape dual-meters places and attached reviews.

Remove the main-agent scrape_webpage tool now that the web.crawl capability covers single-page (maxCrawlDepth=0) and site crawling. The main agent now reaches crawling via task(web_crawler, ...). Update prompts, tool catalog, receipts, skills, proprietary docs, and tests; drop the obsolete chat-turn crawl fold path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 17:08:01 -07:00
DESKTOP-RTLN3BA\$punk
fd45e76f70 feat(agents): sharpen lead-list quality and Maps/Search routing boundary
Learned from lead-generation e2e runs (medical EMR, AI study app):

- routing.md: requested-N lists must be distinct entities that fit the
  asked segment - branches/locations of one parent count once, parent
  website domain is an ownership signal, fill shortfalls by widening
  discovery instead of padding; place-shaped discovery routes to the
  Maps specialist, open-web/enrichment to Search.
- google_maps prompt: exclusion criteria are strict (a satellite of an
  excluded chain is still that chain); shared parent domains mean one
  organization judged against the parent.
- google_search prompt: pure place-discovery tasks return blocked with
  a next_step pointing to the Maps specialist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 04:37:24 -07:00
DESKTOP-RTLN3BA\$punk
c600a2920b feat(crawler): harden web crawler and agent tooling for real-world research tasks
Crawler engine: escalate thin JS-shell pages past static fetch, repair
currency-lossy extractions, emit categorized link records with anchor
provenance, and decode percent-encoded mailto:/tel: contacts; site crawls
reuse the connector ladder via Scrapling's spider engine with URL pattern
filters. Agent layer: read_run gains char_offset paging, search_run gains
match excerpts, new export_run turns stored runs into CSV workspace docs;
reddit search fair-shares the item budget across queries and dedupes
cross-query hits. Subagent prompts and routing teach crawl-after-search,
full-run coverage before summarizing, and executing own-tool next steps
instead of returning partial.
2026-07-05 03:51:16 -07:00