Commit graph

538 commits

Author SHA1 Message Date
Anish Sarkar
8e8cf96faa feat(error-handling): implement LLM error adaptation and classification for chat streaming
- Introduced LLMErrorCategory and adapt_llm_exception to normalize LLM exceptions.
- Updated llm_retryable_message and llm_permanent_message to utilize the new adaptation logic.
- Enhanced classify_stream_exception to classify provider errors and return user-friendly messages.
- Added tests for error classification and adaptation to ensure robustness.
- Updated frontend error handling to display appropriate messages based on new classifications.
2026-06-12 05:03:14 +05:30
Anish Sarkar
908790e40f Merge remote-tracking branch 'upstream/dev' into feat/unified-model-connections 2026-06-12 03:15:28 +05:30
CREDO23
41f4a58663 Merge remote-tracking branch 'upstream/dev' into improvement-podcast-graph
# Conflicts:
#	surfsense_backend/app/tasks/celery_tasks/podcast_tasks.py
2026-06-11 23:14:49 +02:00
Anish Sarkar
610ff063d6 refactor(model-connections): update frontend for provider-based models 2026-06-12 02:17:51 +05:30
Anish Sarkar
3089dd4cb6 refactor(model-connections): simplify connection settings UI 2026-06-11 18:22:57 +05:30
CREDO23
aa7f14d94f feat(podcasts): add revert-regeneration and surface cancel on the live card 2026-06-11 12:31:42 +02:00
CREDO23
eb56acc407 refactor(podcasts): regenerate via brief gate, render brief inline in chat 2026-06-11 11:45:17 +02:00
CREDO23
11a6b178a0 refactor(podcasts): drop transcript gate, add regenerate-from-ready and voice previews 2026-06-11 10:42:13 +02:00
CREDO23
ccd8209d12 refactor(podcasts): drop chat podcast polling state 2026-06-11 10:04:51 +02:00
CREDO23
64b36f2622 feat(podcasts): add frontend contracts and lifecycle api service 2026-06-11 10:04:51 +02:00
DESKTOP-RTLN3BA\$punk
a7407502d3 feat(refactor): refactor payment system to implement unified credit wallet.
- Updated environment variables and - configurations for credit purchases via Stripe, replacing legacy page pack system.
- Introduced auto-reload feature for credit top-ups and modified database models to track credit transactions.
- Updated notification system to handle insufficient credits and auto-reload failures.
- Adjusted API routes and schemas to reflect changes in credit management.
2026-06-10 16:49:03 -07:00
Anish Sarkar
780e242132 feat(model-connections): implement manual model addition and enhance model discovery 2026-06-11 00:11:53 +05:30
Anish Sarkar
39cca36c31 feat(onboarding): include model connections in setup flow 2026-06-10 21:49:55 +05:30
Anish Sarkar
0674accc23 feat(web): add model connection client data layer 2026-06-10 21:49:21 +05:30
Anish Sarkar
32ab2b8713 feat(web): expose model policies in automations 2026-06-10 21:49:07 +05:30
DESKTOP-RTLN3BA\$punk
ce952d2ad1 chore: linting 2026-06-09 00:42:26 -07:00
Anish Sarkar
901c72cdcc feat(onboarding): implement onboarding completion check utility
- Added a new utility function `isLlmOnboardingComplete` to determine if the onboarding process is complete based on the agent LLM ID and the presence of global configurations.
- Updated the onboarding logic in the `OnboardPage` and `DashboardClientLayout` components to utilize the new utility function for improved readability and maintainability.
2026-06-07 17:53:18 +05:30
Anish Sarkar
08801fe3e8 feat(chat): implement chat tab synchronization and enhance thread activation with new hooks for improved navigation and metadata management 2026-06-04 18:16:33 +05:30
Anish Sarkar
168c0d2f89 feat(chat): add cached thread prefetching for faster navigation 2026-06-04 16:46:45 +05:30
Anish Sarkar
8b704b2fef feat(chat): Introduce centralized thread metadata management and update chat visibility handling with new hooks for thread mutations 2026-06-04 14:15:48 +05:30
Anish Sarkar
2a13b3777a feat(download): Enhance download functionality by adding mobile OS detection and updating UI components accordingly 2026-06-04 11:48:44 +05:30
Anish Sarkar
e427501482 feat(web): Remove summary controls from the web app 2026-06-04 00:52:45 +05:30
Anish Sarkar
c75a080997 Merge remote-tracking branch 'upstream/dev' into feat/ui-fixes 2026-06-03 21:53:35 +05:30
Anish Sarkar
9daaf12658 fix(thread): adjust Composer component height for improved user experience 2026-06-02 23:44:36 +05:30
Anish Sarkar
5fce4e1621 feat(chat): enhance ChatViewport with conditional footer rendering and update ChatExamplePrompts for improved category selection 2026-06-02 22:52:48 +05:30
CREDO23
637affecb8 feat(web): add document files contract and api method 2026-06-02 16:10:50 +02:00
Anish Sarkar
e3de7c4667 Merge remote-tracking branch 'upstream/dev' into feat/whatsapp-gateway-integration 2026-06-02 00:29:32 +05:30
Anish Sarkar
ebddf4506a feat(messaging): introduce comprehensive setup docs for Telegram, WhatsApp, Slack, and Discord messaging channels 2026-06-02 00:25:49 +05:30
DESKTOP-RTLN3BA\$punk
2690fe1196 feat(pricing): update pricing page and add AI automations details
- Revised the pricing page title and description to reflect new features including AI workspace, automations, and agents.
- Enhanced the FAQ section with detailed information about AI automations and agents, including scheduling and event-triggered workflows.
- Updated demo plans to include features related to AI automations and agents, ensuring clarity on capabilities and costs.
- Added a new automation illustration to the homepage features grid, emphasizing the automation capabilities of SurfSense.
2026-05-31 19:22:50 -07:00
DESKTOP-RTLN3BA\$punk
ec0342faa2 feat(announcements): enhance AnnouncementCard and add spotlight feature
- Added image support to the AnnouncementCard component for improved visual presentation of announcements.
- Introduced a spotlight feature in the announcement types to allow critical announcements to be displayed in a blocking dialog until acknowledged.
- Updated AnnouncementToastProvider to skip spotlight announcements to prevent duplicate notifications.
- Included a new AI automation announcement with an image in the announcements data for demonstration purposes.
2026-05-31 18:51:49 -07:00
DESKTOP-RTLN3BA\$punk
92b1d7a9f7 feat(automations): enhance tracking for automation lifecycle events
- Added tracking for automation creation, updates, deletions, and trigger modifications, including success and failure events.
- Implemented event tracking in the automation creation process, including chat approval and rejection scenarios.
- Updated the instrumentation client to ensure correct typing for PostHog integration.
- Refactored existing mutation atoms to include tracking calls for automation-related actions, improving analytics capabilities.
2026-05-30 01:13:21 -07:00
DESKTOP-RTLN3BA\$punk
9d1a01eb0c refactor(automations): streamline model eligibility handling in automation creation
- Removed the eligibility gate for model selection in the automation creation process, allowing users to choose models directly in the builder.
- Updated the `AutomationBuilderForm` to incorporate model selection logic, ensuring that selected models are validated and preserved during automation creation and editing.
- Simplified the `AutomationsContent` and `AutomationNewContent` components by eliminating unnecessary eligibility checks and alerts.
- Enhanced the user experience by integrating model selection directly into the automation approval process, ensuring that only billable models are used.
- Refactored related tests to cover new model selection behavior and ensure proper validation of user-selected models.
2026-05-29 20:27:40 -07:00
DESKTOP-RTLN3BA\$punk
fade9d1b9d feat(run-details-panel): enhance run details display and error handling
- Improved the layout and readability of the run details panel by restructuring sections and adding collapsible error views.
- Introduced a new `RunErrorSection` component to present run-level errors more clearly, allowing users to toggle raw error details.
- Updated the handling of run outputs, step results, and artifacts for better user experience.
- Refactored duration calculation in `RunRow` to utilize a dedicated `formatDuration` function for consistency.
- Added a new `RunStepResult` interface to improve type safety and clarity in handling step results.
2026-05-29 13:43:58 -07:00
DESKTOP-RTLN3BA\$punk
409fec94c3 feat(automations): implement model eligibility checks for automation creation
- Added model eligibility checks to ensure automations can only use billable models (premium or BYOK).
- Introduced new API endpoint to report model eligibility status for search spaces.
- Updated frontend components to display eligibility alerts and disable creation options when models are not billable.
- Enhanced automation creation forms to reflect model eligibility, preventing users from submitting invalid configurations.
- Implemented server-side logic to capture and preserve model preferences across automation edits, ensuring consistent behavior during execution.
2026-05-29 03:13:46 -07:00
DESKTOP-RTLN3BA\$punk
40ca9e6ed2 refactor: remove search_surfsense_docs tool and related references
- Deleted the `search_surfsense_docs` tool and its associated files, streamlining the agent's toolset.
- Updated various components and prompts to remove references to the now-removed tool, ensuring consistency across the codebase.
- Adjusted documentation to direct users to the SurfSense documentation link for product-related queries instead.
2026-05-28 22:35:14 -07:00
DESKTOP-RTLN3BA\$punk
9b9e6828c7 refactor(automations): enhance mention handling in task parameters
- Updated the `mentionParams` function to separate document and connector mentions, improving clarity and organization of the output.
- Modified the `mentionsFromParams` function to correctly handle and categorize mentions from parameters, ensuring connectors are processed separately.
- Adjusted documentation comments for better understanding of the changes in mention handling.
2026-05-28 21:44:22 -07:00
DESKTOP-RTLN3BA\$punk
d013617bf6 feat(automations): added UI and improved mentions
- Added support for @-mentions in agent tasks, allowing users to reference documents, folders, and connectors directly in their queries.
- Updated `run_agent_task` to resolve mentions and include them in the context passed to the agent.
- Introduced new parameters in `AgentTaskActionParams` for handling mentioned document and connector IDs.
- Refactored the automation edit and new components to utilize the new `AutomationBuilderForm` for a more streamlined user experience.
- Removed deprecated JSON forms to simplify the automation creation process.
2026-05-28 21:26:32 -07:00
DESKTOP-RTLN3BA\$punk
94e834134f chore: linting 2026-05-28 19:21:29 -07:00
Rohan Verma
4dda02c06c
Merge pull request #1443 from CREDO23/feature-automations
[Feat] Automation V1 — Scheduled Agent Tasks, Created via Chat (HITL) or JSON
2026-05-28 12:41:41 -07:00
CREDO23
91962ba879 fix automation run inputs, hitl routing, and detail UI polish 2026-05-28 02:48:47 +02:00
CREDO23
ed8d56aa16 feat(web): create automation via raw JSON 2026-05-28 01:44:13 +02:00
CREDO23
2e572d7818 feat(web): create_automation HITL approval card in chat
Closes the create loop in chat: the agent describes user intent → the
drafter sub-LLM produces an AutomationCreate JSON → this card surfaces
a structured preview → approve persists; reject cancels. Edits flow
through chat refinement (re-call with a refined intent), not in-card,
so the card stays simple and the multi-turn checkpointer carries the
context.

Tool UI (components/tool-ui/automation/):
- create-automation.tsx — entry dispatcher + ApprovalCard chrome
  (pending/processing/complete/rejected via useHitlPhase) + SavedCard
  (links to the detail page) + InvalidCard (lists drafter validation
  issues) + ErrorCard (verbatim message). Rejection result is hidden
  because the approval card itself shows the rejected phase inline.
- automation-draft-preview.tsx — structured preview body: name +
  description + goal, triggers (humanised cron + tz + static-input
  keys), plan steps (step_id → action), and a collapsible raw JSON
  for power users.

Wiring:
- components/tool-ui/index.ts — re-export.
- features/chat-messages/timeline/tool-registry/registry.ts —
  register create_automation → CreateAutomationToolUI (dynamic import,
  same pattern as other connector tools).
- contracts/enums/toolIcons.tsx — Workflow icon + "Create automation"
  display name so fallback chrome (and timeline headers) are honest.

Shared util:
- lib/automations/describe-cron.ts — lifted from the route slice's
  lib/ folder since both the dashboard slice and the new approval card
  now render schedule descriptions. Slice imports updated; the now-
  empty slice lib/ folder is gone.

Backend prompt fragments:
- main_agent/system_prompt/.../create_automation/description.md and
  the tool's docstring no longer promise in-card edits. They make the
  refinement path explicit: if the user wants changes after seeing the
  draft, they reply in chat and the agent calls the tool again with a
  refined intent.

v1 deliberately excludes:
- In-card edit form / right-side edit panel — defer until we see real
  demand. The chat refinement loop covers the common case.
- approve_always / persistent allow rules — automations are a single
  artifact, not a repeated mutation, so the "trust this kind of call"
  affordance doesn't apply.
2026-05-28 01:32:04 +02:00
CREDO23
b18a5fdca9 feat(web): automations contracts, API client, atoms and hooks
Foundation for the v1 automations UI. Mirrors backend Pydantic schemas
into Zod and wires the data layer end-to-end so feature surfaces can
be built on top.

contracts/types/automation.types.ts:
- AutomationStatus, TriggerType, RunStatus enums.
- AutomationDefinition envelope (PlanStep, TriggerSpec, Execution,
  Metadata, Inputs).
- AutomationCreate/Update/Detail/Summary/List + listParams.
- TriggerCreate/Update/Detail.
- RunSummary/Detail/List + runListParams.

lib/apis/automations-api.service.ts:
- list/get/create/update/delete automations.
- add/update/remove triggers (sub-resource).
- list/get runs (read-only sub-resource).
- safeParse on every write, 204-safe deletes.

atoms/automations/:
- automationsListAtom (active search space, first page).
- 6 mutation atoms with toast + cache invalidation.

hooks/:
- use-automations.ts wraps the list atom.
- use-automation.ts: parameterized detail by id.
- use-automation-runs.ts: useAutomationRuns + useAutomationRun.

lib/query-client/cache-keys.ts: automations namespace (list, detail,
runs, run) keyed by (id, limit, offset) where relevant.

Smoke: zod round-trip OK on backend-shape payloads (Automation,
AutomationCreate, Trigger, Run); typecheck clean for new files;
biome clean.
2026-05-28 00:55:57 +02:00
CREDO23
d48bb2033b fix(web): handle 204 No Content responses in base API service
DELETE endpoints in the automations API return 204; calling .json() on
an empty body throws SyntaxError. Treat 204 as data=null and skip
schema validation so callers can opt out of response bodies without
errors or spurious schema-mismatch warnings.

Also drops a pre-existing 'unknown → BodyInit' type error on the
non-JSON body branch via a narrow cast (caller is responsible for
passing a real BodyInit when Content-Type isn't application/json).
2026-05-28 00:55:46 +02:00
Anish Sarkar
2d134439ec feat(web): enhance mention handling to support connectors and improve document key management 2026-05-26 21:52:04 +05:30
Anish Sarkar
a41b16b73e feat(web): enhance chat context and mention handling with connector support 2026-05-26 21:11:53 +05:30
suryo12
d571cb23fa refactor(web): use last-seen-tick comparison for slideout listener
Replace the boolean "skip first render" ref with a ref that stores the
previously-seen tick value. The effect now compares against the stored
value and only fires when it differs, which makes the dependency
naturally used (removes the `void slideoutOpenedTick;` acknowledgement)
and self-documents the intent of the guard.

Behavior is unchanged — both forms preserve the one-shot-per-event
semantics of the prior window-event implementation. The JSDoc on
`slideoutOpenedTickAtom` is updated to describe the new pattern.
2026-05-24 18:13:36 +07:00
suryo12
ddae506631 refactor(web): replace slideout panel window event with jotai atom (fixes #1358)
Replace the `SLIDEOUT_PANEL_OPENED_EVENT` window event with a
`slideoutOpenedTickAtom` jotai atom. The dispatcher in
`SidebarSlideOutPanel` now bumps the tick via `useSetAtom`, and the
listener in `Thread` reads it via `useAtomValue` and reacts on change
behind a ref guard that skips the initial render — preserving the
one-shot-per-open semantics of the previous event.

This removes the implicit cross-module string contract, makes the
signal traceable through React DevTools / jotai inspector, and lets
TypeScript catch typos that the string-based event API silently
swallowed.
2026-05-24 16:41:47 +07:00
Rohan Verma
06bcc85287
Merge pull request #1426 from guangyang1206/fix/1375-move-getConnectorTelemetryMeta-to-lib
fix: move getConnectorTelemetryMeta from components/ to lib
2026-05-23 15:50:59 -07:00
Anish Sarkar
6302939a72 feat(docs): add observability documentation 2026-05-23 03:18:25 +05:30