Commit graph

3037 commits

Author SHA1 Message Date
CREDO23
9738392161 refactor(agents): rename intelligence_agent subagent to scraping 2026-07-02 18:59:34 +02:00
CREDO23
790507d107 feat(capabilities): meter captcha, truncate scrape, bound discover 2026-07-02 18:32:42 +02:00
CREDO23
18e2ad13ca test(automations): cover checkpointer cross-loop durability 2026-07-02 17:54:31 +02:00
CREDO23
f0c8d9ba5c test(chat): cover watch tools 2026-07-02 17:54:31 +02:00
CREDO23
f1ea60365c test(automations): cover watch rest routes 2026-07-02 17:54:31 +02:00
CREDO23
555dc3fcad test(automations): cover chat watch service 2026-07-02 17:54:31 +02:00
CREDO23
61412163fd test(automations): cover chat_message action 2026-07-02 17:54:31 +02:00
CREDO23
fecb4fa05e test(automations): add integration harness 2026-07-02 17:54:31 +02:00
CREDO23
3278f46585 fix(tasks): dispose checkpointer pool per celery task 2026-07-02 17:54:31 +02:00
CREDO23
896f38fba1 feat(chat): wire watch tools into intelligence agent 2026-07-02 17:54:31 +02:00
CREDO23
32d542f7a3 feat(chat): add stop and refresh watch tools 2026-07-02 17:54:31 +02:00
CREDO23
cf546b6821 feat(chat): add start_watch tool 2026-07-02 17:54:31 +02:00
CREDO23
c0c0b13029 feat(automations): add watch rest routes 2026-07-02 17:54:31 +02:00
CREDO23
2c9862c315 feat(automations): add chat watch service 2026-07-02 17:54:31 +02:00
CREDO23
b993bf31d9 feat(automations): add chat_message action 2026-07-02 17:54:31 +02:00
CREDO23
7ad83760b5 feat(chat): add intelligence_agent subagent over capability verbs 2026-07-02 00:17:22 +02:00
CREDO23
110beb4dd1 feat(chat): add web_scrape/web_discover tool emission handlers 2026-07-02 00:17:10 +02:00
CREDO23
de4b8ab6b0 feat(capabilities): generate agent tool door from registry 2026-07-02 00:17:01 +02:00
CREDO23
23802a74bb feat(capabilities): document verbs with descriptions and field docs 2026-07-02 00:16:55 +02:00
CREDO23
b1bd35c082 test(capabilities): cover REST door, meter-gate, and batch bounds 2026-07-01 17:53:42 +02:00
CREDO23
b1e49f21f2 feat(capabilities): mount capability REST routes 2026-07-01 17:53:42 +02:00
CREDO23
9c9ad97f8e feat(capabilities): generate REST door with per-workspace rate limit 2026-07-01 17:53:42 +02:00
CREDO23
c696829568 feat(capabilities): bound web.scrape batch and expose worst-case units 2026-07-01 17:53:42 +02:00
CREDO23
8fbfa5a6e1 feat(capabilities): add pre-flight meter-gate for billed verbs 2026-07-01 17:53:42 +02:00
CREDO23
f257e385db feat(capabilities): register web.discover verb 2026-07-01 17:08:58 +02:00
CREDO23
329bc63b6c feat(capabilities): add env-keyed searxng/linkup/baidu discover providers 2026-07-01 17:08:58 +02:00
CREDO23
adc39d1062 feat(config): add env keys for discover search providers 2026-07-01 17:08:58 +02:00
CREDO23
fa1055dd4c feat(capabilities): add web.discover schemas and provider seam 2026-07-01 17:08:58 +02:00
CREDO23
a413539f6a feat(capabilities): allow free verbs with no billing unit 2026-07-01 17:08:58 +02:00
CREDO23
8d76afc9d6 test(capabilities): cover registry, executor, schemas, billing 2026-07-01 16:42:47 +02:00
CREDO23
6b91a7ed0c feat(capabilities): register web.scrape verb 2026-07-01 16:42:47 +02:00
CREDO23
6679fda662 feat(capabilities): wire web.scrape to proprietary crawler 2026-07-01 16:42:47 +02:00
CREDO23
bbd81bcc99 feat(capabilities): add web.scrape schemas 2026-07-01 16:42:47 +02:00
CREDO23
bfe3117302 feat(capabilities): bill workspace owner at executor 2026-07-01 16:42:47 +02:00
CREDO23
3e6007431d feat(capabilities): add in-process verb store 2026-07-01 16:42:47 +02:00
CREDO23
78f7a93a88 feat(capabilities): add registry contracts and package 2026-07-01 16:42:47 +02:00
DESKTOP-RTLN3BA\$punk
15fd0b08d6 feat: completed init mvp of phase 3 2026-06-30 03:02:40 -07:00
DESKTOP-RTLN3BA\$punk
bdacea8b6e feat(crawler): captcha solving + per-attempt billing (Phase 3d)
Wire captchatools as the StealthyFetcher-tier page_action to detect, harvest
(egressing from the crawl's own proxy IP), inject, and submit reCAPTCHA v2/v3
and hCaptcha tokens. Opt-in and off by default (zero attempts, zero cost).

Licensing split:
- Apache-2 app/utils/captcha/ holds the generic, vendor-agnostic config
  (CaptchaConfig + captcha_enabled() = flag AND key present).
- Proprietary app/proprietary/web_crawler/captcha.py holds the bypass logic
  (detect/harvest/inject) plus a process-wide solver latch that halts solving
  on unrecoverable errors (no balance / bad key).

Crawler: CrawlOutcome gains captcha_attempts/captcha_solved, surfaced via a
per-call captcha_state dict threaded crawl_url -> _crawl_with_stealthy(_sync)
and stamped onto every stealth terminal outcome. The stealth tier captures the
proxy once and reuses it for both the fetch and the solver (IP-coherence).

Billing: WebCrawlCreditService gains captcha_billing_enabled,
captcha_solves_to_micros, charge_captcha, and a generic check_balance, sharing
a single _apply_debit path. The indexer accumulates attempts (even on failed
crawls), runs a combined crawl+captcha pre-flight, and posts a per-attempt
owner charge as usage_type="web_crawl_captcha". The captcha worst-case is only
reserved when solving is actually enabled, so a solving-off deployment is never
blocked for captcha that can never run. Both chat scrape tools fold attempts
into the current turn before the success/fail branch.

Fully config-driven prices; no migration. New unit tests cover the config,
factory (detection/latch/timeout/cap), credit service, indexer wiring, and the
chat fold.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 22:58:21 -07:00
DESKTOP-RTLN3BA\$punk
17bdb06825 feat(03c): bill credits per successful web crawl
Add a config-driven crawl meter (1 USD / 1000 successes by default, retunable
via WEB_CRAWL_MICROS_PER_SUCCESS) mirroring EtlCreditService:

- WebCrawlCreditService (gate -> pre-check -> post-charge) on the unified wallet
- webcrawler indexer: pre-flight credit block + post-charge of the workspace
  owner per success, with a web_crawl TokenUsage audit row
- chat scrape_webpage (main + research): fold each successful scrape into the
  active turn's token accumulator so it settles with the chat turn
- WEB_CRAWL_CREDIT_BILLING_ENABLED / WEB_CRAWL_MICROS_PER_SUCCESS config + env
- unit tests (service) + integration tests (indexer wiring)
- scripts/e2e_phase3_crawl_billing.py: manual functional e2e (3a/3b/3c)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 21:40:53 -07:00
DESKTOP-RTLN3BA\$punk
62260125f7 feat(03b): add BYO custom proxy provider + bounded crawler rotation-retry
Add CustomProxyProvider (single endpoint or rotating pool via Scrapling ProxyRotator), registered as 'custom' alongside anonymous_proxies and selectable via PROXY_PROVIDER. Adds is_pool_backed to the ProxyProvider ABC + a zero-arg package helper. The web crawler does a bounded one-per-tier is_proxy_error rotation-retry gated on is_pool_backed() (single-endpoint providers no-op). Config/.env.example gain CUSTOM_PROXY_URL(S). Zero-arg getter contract unchanged for all consumers. Documents the proprietary boundary test (generic proxy infra stays Apache-2). Tests: provider, registry, crawler rotation (16).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 21:03:34 -07:00
DESKTOP-RTLN3BA\$punk
5c36cd3071 feat(03a): implement Scrapling-only web crawler and remove Firecrawl integration
- Standardized the web crawler to use Scrapling exclusively, removing Firecrawl entirely.
- Updated the crawler's location to `app/proprietary/web_crawler/connector.py` under a non-Apache-2 license boundary.
- Refactored the `WebCrawlerConnector` to eliminate the Firecrawl API key dependency, simplifying the interface for crawling URLs.
- Adjusted related components to accommodate the new structure and ensure successful crawl outcomes are properly handled.
- Updated documentation to reflect these changes and the new implementation status.
2026-06-29 20:37:56 -07:00
DESKTOP-RTLN3BA\$punk
2836654701 Merge commit '683a7d3bc2' into feat/rename-searchspace-to-workspace 2026-06-29 17:55:15 -07:00
Rohan Verma
32951ac141
Merge pull request #1543 from DhruvTilva/fix/codeblock-interior-line-indentation
fix: prevent spurious leading spaces in nested codeBlock interior lines
2026-06-29 17:45:21 -07:00
Rohan Verma
d22131185f
Merge pull request #1542 from DhruvTilva/fix/multilingual-embedding-truncation
fix: use token-safe truncation for document embeddings
2026-06-29 17:44:55 -07:00
DESKTOP-RTLN3BA\$punk
47e4dd9403 Merge commit '2148053569' into dev 2026-06-26 11:30:37 -07:00
DESKTOP-RTLN3BA\$punk
ab7d138b32 feat(hotpatch): fix migration 168 2026-06-26 11:30:06 -07:00
Rohan Verma
2148053569
Merge pull request #1544 from AnishSarkar22/fix/login-button
feat: update authentication defaults to LOCAL
2026-06-26 11:06:22 -07:00
CREDO23
902b3374ea docs(env): update spawn-paused runbook to workspace_id (Phase 2 carve-outs)
Align the .env.example operational runbook with the renamed Redis key
surfsense:spawn_paused:<workspace_id> (carve-out 3). All other carve-out
decisions are applied inline: KEEP enum values 'SEARCH_SPACE', Celery task names,
OTel/metric key "search_space.id", and historical alembic migrations; RENAME the
Redis/event/LangGraph keys and the default seed name "My Workspace".
2026-06-26 18:38:11 +02:00
CREDO23
ca9bd28934 test: rename SearchSpace -> Workspace across tests + fixtures (Phase 2 Wave F)
Apply the same rename to surfsense_backend/tests: workspace_id fields/vars,
Workspace* classes/schemas, table name searchspaces -> workspaces in raw SQL,
and the API URL spellings -> /workspaces. Preserves the carve-out wire literals
tests assert (Celery task names, OTel key "search_space.id").
2026-06-26 18:36:46 +02:00
CREDO23
56826a63bc refactor(routes): rename to workspace + consolidate URL spellings (Phase 2 Wave E)
Hard cutover of the HTTP surface: collapse the three legacy spellings
(/searchspaces, /search-spaces, /search-space/{id}) onto canonical
/workspaces/{workspace_id}/..., rename the gateway field-setter sub-actions to
singular /workspace, rename search_spaces_routes.py -> workspaces_routes.py and the
search_spaces_router -> workspaces_router include, and flip search_space_id ->
workspace_id in bodies/params. No alias routers: the old URLs now 404 by design.
Full app constructs with zero legacy path spellings.
2026-06-26 18:35:08 +02:00