Matthew Meszaros
053ca6a71d
feat: usage-based AI credit system — every AI call reserves its flat minimum then settles the real token cost per model (light 1500/standard 400 tokens per credit, drain-to-zero overage settle wired into writing assistant, reply drafts, dashboard agent, inbox agent, research, automation nodes, and campaign switches), org spend controls in a new org_ai_settings table (day/week/month hard limits enforced in Consume, low-balance alert threshold, auto top-up config), a credit-watch monitor hook that fires BILLING_CREDITS_LOW realtime alerts once per day and buys the configured pack off-session via a new Stripe AutoTopUpCredits (idempotent on the PaymentIntent, bounded per month, Redis-locked), GET /subscription/credits/usage + GET/PATCH settings endpoints, and an AI usage & spend controls billing card (spend vs limits, 30-day chart, per-feature and per-model breakdowns, limits/reminder/auto-top-up form) with a realtime low-credit toast
2026-07-18 08:39:41 +02:00
Matthew Meszaros
684152d699
feat: add the agent transcript client and hydrated turn and block types used to rehydrate a reopened assistant conversation
2026-07-15 17:54:16 +02:00
Matthew Meszaros
56de65380b
feat: inbox agent that drafts a suggested unibox reply on inbound human replies for human approve/edit/discard - paid + per-org opt-in (organizations.inbox_agent_enabled) feature where the consumer's reply hook, on a non-automated reply, detaches a goroutine (panic-contained, never blocks ingest) that checks entitlement, dedupes via ai_thread_drafts partial unique indexes (one pending per thread, unique source_message_id), pre-checks balance, grounds a reply in the thread history + org voice + skills via generation.Provider.Complete, reserves a draft row then charges 5 credits (idempotency inbox_agent:<draft.ID>, row unwound on a fresh context if the charge fails so no unpaid draft lingers), and emits an org-scoped AI_DRAFT_READY event gated on access_unibox; the agent never sends - only a human POST to /unibox/agent-drafts/:id/approve sends through the normal reply path, claiming pending->approved before send with an approved->pending revert on send failure, alongside list + discard endpoints; plus the unibox awaiting_agent_draft badge + agent_drafts search scope, an AgentDraftCard in the thread view with inline-editable approve-and-send/discard, the workspace settings opt-in toggle, CanUseInboxAgent paid gate, migration 000065, and docs (inbox-agent guide, endpoints, realtime)
2026-07-14 06:13:27 +02:00
Matthew Meszaros
2aec6745fa
feat: connect external MCP servers whose tools the AI assistant can use - ai_mcp_servers table with bearer tokens sealed by the org DEK cipher (never returned) and SSRF-validated https urls, a dependency-free streamable-HTTP JSON-RPC client (initialize/tools/list/tools/call over safehttp dial-time IP blocking with SSE+JSON handling and body caps), an mcp service that discovers tools on connect and contributes only enabled servers' tools to the dashboard agent as namespaced mcp_<server>_<tool> defs that are always write-class and never auto-allowed, a registry DynamicToolSource hook so per-org tools join the agent's tool set and resume executes them through ToolDefs, /ai/connections CRUD gated on manage_settings with an mcp_server audit entity and spine, a Connections settings page to add servers and review/enable discovered tools, and docs
2026-07-13 20:05:24 +02:00
Matthew Meszaros
a2f50b6572
feat: org AI skills (playbooks) that every AI feature loads and follows - ai_skills table (org-scoped, unique name per org, 32KB content cap) with a skills service exposing CRUD plus an enabled-skills preamble injected into the dashboard agent, contact research, and reply-draft prompts and a load_skill read-tool that returns a playbook's full content by name, /ai/skills CRUD gated on manage_settings (JWT) or the AI_AGENT scope (API) with an ai_skill audit entity and spine entry, an AI skills settings page (list rows opening a right-side drawer with name, one-line description, enable toggle, and a markdown body), and docs with two example playbooks
2026-07-13 19:46:25 +02:00
Matthew Meszaros
f48d51bf16
feat: AI contact research agent that gathers cited web findings per contact with sync and background-batch runs - contact_research_runs table plus a strict save_research schema (every signal and public_artifact must carry a url, confidence high/medium/low, signals<=5 hooks<=3, reject-and-reprompt once then fail), a text/template runtime prompt injecting org voice, contact record, objective, and 5-search/6-fetch budgets, a research service that drives search_web/fetch_url through the provider loop and charges 2 credits on save (billable even for nothing_found, refund-free since charged only on save, balance and abuse-cap pre-checked so a capped org never does free work), POST/GET /contacts/:id/research plus a 500-cap /contacts/research/batch draining through a bounded pool of 4 workers over FOR-UPDATE-SKIP-LOCKED claims (no new Kafka), an org-scoped AI_RESEARCH_PROGRESS realtime event gated to view_contacts, APIPermAIResearch bit 23, a ContactEdit Research tab and a ContactsTable bulk Research action, and docs; also org-scopes every credit and research idempotency key so a client-supplied Idempotency-Key can never replay across tenants
2026-07-13 19:34:11 +02:00
Matthew Meszaros
8d208d8c41
feat: org voice profile grounding every AI writing surface plus context-grounded unibox reply drafts - organizations gains product_description/icp_notes/voice_profile (000059) with a manage_settings workspace settings section, generation.BuildVoiceRules and BuildReplyRules fold the humanizer rules and org grounding into every prompt, WritingGenerator.GenerateWriting now takes a VoiceContext and a provider.Complete primitive powers single completions, POST /unibox/reply/draft assembles thread history plus the counterpart contact (custom fields and campaigns) plus the voice profile into a reply-tuned prompt that charges 2 credits with refund-on-failure and a client idempotency key and never sends, a Draft reply button fills the composer, and docs cover the voice profile and AI reply drafts
2026-07-13 19:04:57 +02:00
Matthew Meszaros
7f425c1624
feat: dashboard-wide AI assistant with streamed tool-use runs, per-action approvals, and per-iteration credits - agent_sessions/agent_messages/ai_tool_policies migration, aiagent service runs the M2 registry through the provider loop over a resumable jsonb transcript, streams text/tool-step/approval/done events over SSE, gates write tools behind approve/deny/always-allow (send always per-action) and charges 1 credit per iteration (budget 20, refund on provider failure, out-of-credits 402 insufficient_credits, cap 429 usage_cap_exceeded) with a resume-safe idempotency namespace, provider PreIteration budget hook, /ai/sessions endpoints (cursor list + two SSE runs) gated by membership with tools bound to the member's org-permission bits, APIPermAIAgent bit 22, ai_session audit entity + spine, and a right-side resizable panel (Cmd+I / sparkle button) with streamed text, collapsible tool steps, inline approval and draft-artifact deep-link cards, stop, new chat, and a credits/budget meter; tenancy enforced at the SQL layer and docs for the assistant, endpoints, permissions, and error codes
2026-07-13 18:46:43 +02:00
Matthew Meszaros
5d6ed2a068
feat: AI credit economy with monthly plan grants, non-expiring purchased top-ups, and Stripe billing - two-pool credit_ledger (monthly allowance reset each cycle on invoice.paid, purchased pool via checkout mode=payment fulfilled webhook-only), consume drains monthly-then-purchased, 3 fixed top-up packs, /subscription/credits balance+checkout+paginated transactions gated on manage_billing, one-time trial grant, billing credits card with balance ring and pack buttons, credit_purchase/credit_grant audit entities and spine, wired plan.monthly_credits through pg_plan reads/writes, retry-safe webhook idempotency, and an AI credits guide
2026-07-13 17:40:20 +02:00
Matthew Meszaros
06c7a3502b
feat: wire live cursors, live step drag, and persisted step positions seeded from x/y into the campaign sequence builder canvas
2026-06-30 10:06:49 +02:00
Matthew Meszaros
03453cc069
feat: wire live cursors, live card drag, and debounced drag-to-stick layout persistence into the automation builder canvas
2026-06-30 10:06:49 +02:00
Matthew Meszaros
faad54b6a3
feat: add a redeemed promo codes table to the web billing settings page with its client, hook, and model
2026-06-28 05:10:04 +00:00
Matthew Meszaros
ae09a1646c
feat: build the dashboard referral settings page with its API clients, hooks, models, and route registration in web
2026-06-28 05:10:04 +00:00
Matthew Meszaros
38e9ca980f
fix: correct the dashboard /auth/me avatar and password endpoints, guard self-row actions on the members page, align the steps-page permission gate with the server, harden realtime event handling, and remove the dead admin roles client
2026-06-15 08:12:35 +02:00
Matthew Meszaros
a72addabeb
feat: add OAuth app webhook configuration with an event picker, signing-secret reveal and rotate, per-org installs, and a cross-org delivery log
2026-06-15 08:11:35 +02:00
Matthew Meszaros
d655ff4f59
feat: add the webhooks settings page with delivery observability, an onboarding setup step, and the webhook API client, hooks, and models
2026-06-15 08:11:35 +02:00
Matthew Meszaros
ab24d8bbc8
feat: add a 'Fire event' action and campaign step that publish custom events to the realtime gateway (no public URL), an HTTP-request campaign step, a configurable automation dry-run test with per-step toggles, and fix the false 'updated by a teammate' toast on your own save
2026-06-14 09:52:49 +02:00
Matthew Meszaros
e3c49fe571
feat: move the OAuth apps developer portal into Settings with a multi-step registration onboarding wizard (stepper, animated modal, logo upload) and an animated apps/authorized tab switch
2026-06-14 09:52:49 +02:00
Matthew Meszaros
b06a11315f
feat: add the OAuth 2.1 dashboard UI: an OAuth apps page (register apps with a scope picker, one-time client secret, rotate, delete, authorized-apps tab with revoke) and a standalone consent screen at /oauth/authorize, plus the API client, hooks, and sidebar entry
2026-06-13 14:07:21 +02:00
Matthew Meszaros
aed4a06190
feat: unify pagination by making the offset-based CRM deals/tasks search and meetings endpoints expose the same opaque next_cursor and {total, next_cursor, has_more} envelope as every keyset list (offset hidden inside the token), updating web clients, the OpenAPI spec, and the reference docs
2026-06-13 10:47:17 +02:00
Matthew Meszaros
587eae774e
feat: serve the entire customer API (auth + resources) only under /v1 with no unversioned alias, and repoint the web and admin clients to the versioned base accordingly
2026-06-13 07:18:23 +02:00
Matthew Meszaros
71abb12a38
feat: stop campaigns silently stalling on a transient scheduler error by retrying instead of completing the task, end past-end-date campaigns cleanly, record scheduler failures to the campaign log, add a campaign-chain reconciler, and surface failures live in the dashboard activity panel
2026-06-13 06:27:01 +02:00
Matthew Meszaros
a7a43e0c4c
feat: rename the campaign sequences resource to steps across the API and URL (/campaigns/:id/steps), the JSON fields (target_step_id, step_id/step_name/step_index, analytics steps[], create body steps), the web client/models/route segment/labels, the audit step entity type, and the wire-contract docs; internal Go type names and the Kafka avro schema stay
2026-06-12 09:38:11 +02:00
Matthew Meszaros
a0221dd312
feat: show one clear, app-wide 'you don't have permission' popup whenever a write action (edit/save/delete) is denied with 403, naming the missing permission or plan, instead of silent failures and generic error toasts across the dashboard
2026-06-11 18:30:53 +02:00
Matthew Meszaros
5bcc2baaa8
feat: implement the coming-soon security features — logged-in change-password (verify current, policy-checked, POST /me/password) with a real dialog, and new-device sign-in alerts (security notification category fired from the token service on an unrecognized OS+browser, delivered in-app and by email), removing the comingSoon stub helper and updating docs
2026-06-11 12:30:44 +02:00
Matthew Meszaros
39a9752d63
feat: real tokenized invite-accept link — public /invite landing page with safe preview (org, inviter, roles), accept-by-token plus the previously-broken accept-by-invitation-id, public preview + admin copy-link endpoints, login next-param redirect, and a Copy button that yields a working /invite?token link
2026-06-11 11:57:45 +02:00
Matthew Meszaros
8540f7db15
feat: members can hold multiple roles — join tables for member/invitation role sets (migration 000044) with effective permissions as the bitwise OR recomputed on every assignment and role edit/delete, role_ids in invite/update APIs, multi-select checkbox role picker with colored chips in roster and invite flow, freely deletable roles
2026-06-11 11:24:19 +02:00
Matthew Meszaros
091b39f34e
feat: roles become workspace data — seed editable Admin/Manager/Viewer rows per org (migration 000043 with member backfill), require role_id for invites and role changes, add role colors with a shared colored RoleSelect dropdown in the roster and invite flow, and rebuild Roles & access around real roles with an Owner reference column
2026-06-11 10:18:45 +02:00
Matthew Meszaros
0b253337fc
feat: integrate custom roles across Roles & access settings (manager replaces the coming-soon placeholder, custom roles join the permission matrix and summary cards, permission-aware canManage gating via the org context bitmask)
2026-06-11 10:08:46 +02:00
Matthew Meszaros
63b2b046f9
feat: custom roles dashboard UI (roles manager with built-in reference rows, permission-checkbox editor with start-from presets, custom roles in member role picker and invite flow, realtime spine refresh)
2026-06-11 09:45:23 +02:00
Matthew Meszaros
9d41619ba9
feat: add template preview client
...
Adds typed frontend API access for rendering campaign templates through the server preview endpoint.
2026-06-08 15:05:34 +02:00
Matthew Meszaros
ffc7940d37
feat: add two factor client APIs
...
Adds typed frontend API helpers for 2FA status, enrollment, disable, login verification, and the login-confirm challenge response.
2026-06-08 15:05:21 +02:00
Matthew Meszaros
55a02b6441
feat: add notification client APIs
...
Adds typed frontend client calls, hooks, and models for notification preferences, feed reads, and read-state mutations.
2026-06-08 15:05:09 +02:00
Matthew Meszaros
ce406079bc
feat: add deliverability dashboard
2026-06-08 12:04:08 +02:00
Matthew Meszaros
3bc8193139
feat: show campaign ab winners
2026-06-08 12:04:03 +02:00
Matthew Meszaros
d5032383cd
feat: add automation graph client models
2026-06-08 12:03:41 +02:00
Matthew Meszaros
f08464ce10
feat: add automation api bindings
2026-06-08 06:55:24 +02:00
Matthew Meszaros
82e753735c
feat: add integration and meetings dashboard
2026-06-08 06:25:44 +02:00
Matthew Meszaros
8773b7f7f3
feat: push contacts to integrations
2026-06-07 20:30:52 +02:00
Matthew Meszaros
e87cd7e8e9
feat: fix unibox seen updates
2026-06-07 19:35:12 +02:00
Matthew Meszaros
4e015e7efd
feat: add CRM task search clients
2026-06-07 07:04:21 +02:00
Matthew Meszaros
c10c4000e7
feat: add teams API hooks
2026-06-07 07:03:56 +02:00
Matthew Meszaros
49ac868956
feat: add CRM task type API hooks
2026-06-07 06:18:06 +02:00
Matthew Meszaros
64bf23500d
feat: add contact email lookup client
2026-06-07 06:17:28 +02:00
Matthew Meszaros
0ac0ba80ca
Merge remote-tracking branch 'origin/main' into feature/crm-system
2026-06-06 19:42:26 +02:00
Matthew Meszaros
050d09c961
feat: add cross-pipeline deals search surface
...
Replace the client-side, 100-row-capped deals board as the default view
with a server-driven cross-pipeline table so totals stop lying at scale.
- POST /crm/deals/search: faceted filter body (query, status, pipeline,
stage, owner, campaign, value range, close-date range), whitelisted
sort, offset pagination, and Contact/Stage/campaign hydrated via JOIN.
- POST /crm/deals/summary: COUNT + SUM(value) per status and per stage
over the same filter, with a mixed-currency guard, so header and board
column totals are true server aggregates.
- DealsTable: cross-pipeline default view (infinite scroll, server
filters/sort, honest summary stats) with a Table|Board toggle; the
kanban stays as the single-pipeline working view.
- Deal attribution: campaign_id + source_mailbox_id columns + indexes
(migration 000022) as groundwork for revenue lineage.
2026-06-06 19:42:20 +02:00
Matthew Meszaros
815665d6e2
feat: add unibox label client hooks
...
Add frontend request helpers and query hooks for thread labels, plus typed search and overview support for category-scoped Unibox data.
2026-06-06 19:37:19 +02:00
Matthew Meszaros
aa4f43b284
feat: wire settings profile updates
...
Persist profile and workspace setting edits, show live billing usage, and remove the unused bulk email API helper.
2026-06-06 07:50:26 +02:00
Matthew Meszaros
161d668a8f
feat: add campaign sequence api clients
...
Add frontend models, clients, and React Query hooks for step A/B variants, attachments, branching conditions, and AI writing generation.
2026-06-05 06:04:00 +02:00
Matthew Meszaros
7fe63a98eb
feat: add lead sync frontend clients
2026-06-04 11:50:09 +02:00