@seldonframe/mcp 1.28.2 → 1.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -1
  2. package/src/welcome.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@seldonframe/mcp",
3
- "version": "1.28.2",
3
+ "version": "1.28.4",
4
+ "description": "MCP server for SeldonFrame — AI-native Business OS platform. v1.28.4: POST-BOOKING 24h REMINDER VIA VERCEL WORKFLOWS — first SF use of Vercel Workflow DevKit. CRM-side change; MCP package version bumped for SemVer hygiene. PROBLEM: SF had no post-booking reminder mechanism. Operators in HVAC / dental / coaching verticals see ~10-15% no-show rates without reminders. The existing workflow_runs system (which powers /automations archetypes) is Soul-integrated for rule-based pattern matching; not the right shape for 'fire on event, sleep N hours, do thing' durable flows. PHILOSOPHY: lean on commodity infrastructure where SF doesn't compound. Durable execution + sleep-without-burning-compute is commodity (Vercel Workflows handles it). SF's compounding edge is Soul + Brain + Agent — not workflow plumbing. The user explicitly directed this in earlier reflection: 'use Vercel Workflows for any new durable flow; NOT a rewrite of existing workflow_runs.' WHAT SHIPS: (1) WORKFLOW PACKAGE INSTALLED. pnpm add workflow @workflow/next in packages/crm. next.config.ts wrapped with withWorkflow() from workflow/next so the build pipeline compiles 'use workflow' / 'use step' files into durable code. (2) NEW lib/workflows/booking-reminder.ts. Per Vercel WDK conventions: workflow function (sandboxed VM, no Node.js APIs, 'use workflow' directive) does ONLY orchestration. All real work (DB queries, SMS/email sends, activity inserts) lives in step functions ('use step' directive, full Node.js access). The workflow: (a) loads booking via loadBookingForReminder step, (b) early-returns if status != 'scheduled' OR if <24h to startsAt, (c) sleeps with workflow.sleep(new Date(startsAt - 24h)) — durable, no compute consumed during the sleep, (d) re-fetches the booking after sleep (it may have been cancelled or rescheduled in the meantime; if rescheduled to >25h out we skip and let a future scheduled run pick it up), (e) calls sendReminder step which checks workspace integrations: hasTwilio → sendSmsFromApi via lib/sms/api with the contact's phone; else hasResend → sendEmailFromApi via lib/emails/api; else returns 'no_channel_configured', (f) writes an activity row via logReminderActivity step (type='reminder_sent_sms' / 'reminder_sent_email' / 'reminder_skipped' with the reason). (3) WIRED INTO submitPublicBookingAction. Right after emitSeldonEvent('booking.created', ...), the action does: const { start } = await import('workflow/api'); await start(bookingReminderWorkflow, [bookingId]). Fire-and-forget — start() returns immediately. Errors caught + logged so workflow trigger failures don't fail the booking creation itself. (4) ALONGSIDE existing workflow_runs system. workflow_runs powers /automations archetype configurator (Soul-integrated rule-based patterns); booking-reminder is a generic durable flow that doesn't need Soul. Both coexist. NO migrations. NO new env vars on the SF side, BUT requires Vercel Workflow infrastructure on the deployment side — Vercel Workflows is included in Vercel platform; no marketplace install needed. Backend redeploy required (Vercel detects the new workflow on next build via withWorkflow + lib/workflows/ scan).",
5
+ "description": "MCP server for SeldonFrame — AI-native Business OS platform. v1.28.3: SKILL-PACK ARCHITECTURE (CRM-side; MCP package version bumped for SemVer hygiene). Refactor with NO behavior change — same composed system prompt, different code shape. PHILOSOPHY (Karpathy / antifragile / thin-harness-fat-skill): behavioral guidance for agents (the FAT SKILL layer) belongs in markdown-style skill FILES, not inline string concatenation in prompt.ts. To improve agent intelligence, edit a skill file. No code change to the composer or runtime. As Claude (and successor models) get better at multi-turn memory, temporal reasoning, and avoiding hallucinated actions, we EDIT prose; architecture stays stable. Smaller models lean on verbose skills; larger models need terse ones. Same architecture either way. WHAT SHIPS: (1) NEW lib/agents/skills/<archetype>/<skill-id>.ts files. Each is a default-export string of markdown-shaped content. v1.28.3 ships 3 skills for the website-chatbot archetype: temporal-reasoning.ts (templated; uses {{currentDate}}, {{currentTime}}, {{timezone}} placeholders), be-smart-by-default.ts (the 7 behavioral rules introduced in v1.27.7-v1.27.8), hard-rules.ts (the 8 non-negotiable safety invariants). (2) NEW lib/agents/skills/registry.ts. Ordered REGISTRY array of {id, content, archetypes[], renderVars[]} entries. Functions: getSkillsForArchetype(archetype) returns ordered skills applicable to that archetype; renderSkill(skill, vars) substitutes {{placeholder}} tokens with values from a vars dict (unknown placeholders left intact, visible as a debug hint). (3) REFACTORED prompt.ts. composeSystemPrompt now: imports getSkillsForArchetype + renderSkill from registry; computes skillVars (currentDate, currentTime, timezone from workspace tz); emits 'up-front' skills (temporal-reasoning, be-smart-by-default) before dynamic operator content; emits 'hard-rules' AFTER dynamic content (so safety invariants are the final word the LLM reads — anchoring effect). The previous ~50 lines of inline backtick-string-concatenated prose are gone, replaced by 6 lines of registry iteration. (4) BEHAVIORAL OUTPUT IS IDENTICAL to v1.28.2. The skill files contain the EXACT same prose that was inlined; the registry orders them the same way the inline code did. Verifiable via tsc + comparing System prompts byte-for-byte. EXTENSIBILITY: adding a new behavioral skill = create skills/<archetype>/<id>.ts + add a registry entry. Zero changes to composer or runtime. Renaming an existing skill = move file + update registry + update import; prompt output identical. Voice + SMS archetypes can introduce specialized skills (skills/voice-receptionist/no-emojis.ts, skills/sms-followup-bot/under-160-chars.ts) without composer code changes. NO MCP tool changes. NO migrations. NO new env vars. Backend redeploy required.",
4
6
  "description": "MCP server for SeldonFrame — AI-native Business OS platform. v1.28.2: EMBED WIDGET POLISH (CRM-side; MCP package version bumped for SemVer hygiene). The /api/v1/public/agent/<slug>/embed.js IIFE that renders on operators' websites — first impression for end customers — was functional but plain. v1.28.2 brings it to world-class without forking a hosted-app codebase like mckaywrigley/chatbot-ui (wrong shape — that's a full Next.js app, we need a single <script> tag with zero deps on the operator's site). Polish in 5 categories: (1) MARKDOWN RENDERING. Inline parser in the IIFE handles **bold** → <strong>, *italic* → <em>, `code` → <code>, [text](https://...) → <a target=_blank rel=noopener noreferrer>, '- bullet' lines → <ul><li>, and \\n → <br>. All output goes through escapeHtml() FIRST then sanctioned tags re-injected — no raw HTML survives. SSE-friendly: re-renders innerHTML on every delta so bold/links resolve as soon as the closing token arrives. Inline CSS for strong/em/a/code/ul/li within .sf-agent-msg.assistant. (2) MOBILE-FIRST. Below 640px breakpoint the panel becomes FULL-SCREEN (Intercom pattern) — no rounded corners, fills viewport. Bubble shifts to bottom-right corner with smaller margin. Bigger touch targets throughout. (3) BRAND INHERITANCE. Header now shows the operator's logo if workspace.theme.logoUrl is set (https://... only — schema-validated server-side); falls back to a colored circle with the first letter of the org name. Logo container has bg=rgba(255,255,255,.18) so it sits cleanly on top of the operator's primaryColor header. (4) A11Y. role=dialog + aria-label on panel; role=log + aria-live=polite + aria-relevant=additions on messages region (announces new agent messages without spamming during streaming); screen-reader-only label on the textarea; aria-expanded toggles on the bubble; ARIA-labels on every control. Esc key closes panel + returns focus to bubble (focus management). focus-visible outlines on all interactive elements with proper offset. prefers-reduced-motion media query disables all transitions and animations. (5) ANIMATIONS + UX. Bubble: spring scale (cubic-bezier(.34,1.56,.64,1)) on hover (1.08x) + active (.95x). Panel: spring slide-up reveal — opacity 0 + translateY(8px) + scale(.98) → opacity 1 + 0 + 1 in 280ms. Messages: per-message fade+slide-in (220ms). Typing indicator: 3 animated bouncing dots (was 'Typing...' text). Textarea (was input) auto-grows to 120px max-height; Enter sends, Shift+Enter newline. Send button has translateY hover + scale active feedback. NO MCP tool changes. NO migrations. NO new env vars. The embed.js endpoint is automatically picked up on the next page load — operators don't need to update their script tag (the URL is stable; the response body changes server-side). Backend redeploy required.",
5
7
  "description": "MCP server for SeldonFrame — AI-native Business OS platform. v1.28.1: 90%-FEWER-TOOL-CALLS + /AGENTS DASHBOARD REDESIGN. PROBLEM: real-world dogfood showed Claude Code spending 3m 35s + ~17 actions to update an existing chatbot — only 2 of which (the actual update_agent_blueprint call + final response) were necessary work. The waste broke down as: progressive tool-schema loading (5+ separate 'Called seldonframe' round-trips as Claude Code lazy-discovered the 138-tool catalog), local-FS exploration (ls + node --version + read .env — all irrelevant on a hosted SF platform), an unnecessary question to the user about Anthropic key configuration (the workspace already had one), and stale references to the v1.27.9-removed token-budget concept leaking from MCP tool responses. Plus the /agents dashboard exposed only 2 CTAs (Open sandbox / View conversations) and zero inline health stats — operators had to drill into /agents/[id] just to see eval status / validator pass rate / 24h conversations. WHAT SHIPS: (1) NEW GET /api/v1/workspace-state ENDPOINT. Workspace-bearer auth. Returns in ONE round-trip: workspace identity (id, name, slug, industry, timezone, dashboard_url, public_site_url); integrations status (anthropic / openai / twilio / resend / kit / mailchimp configured? — booleans only, no keys leaked); agents WITH inline health stats (status, version, eval pass rate, validator pass rate 24h, conversations 24h, eval_meets_publish_gate boolean, last_eval_run_at); high-level counts (contacts, bookings, deals, agents); and a tailored next_steps[] array (e.g. 'Configure Anthropic LLM key' / 'No agents yet, call build_website_chatbot' / 'Run evals before promoting to live'). (2) NEW get_workspace_state MCP TOOL wrapping that endpoint. Description tells Claude Code to call it FIRST for any workspace task — replaces 4-6 progressive discovery calls. (3) NEW update_website_chatbot SKILL BUNDLE. Peer to v1.28.0's build_website_chatbot, for the 'agent already exists' case. Auto-resolves the workspace's website-chatbot agent_id if not passed (uses get_workspace_state internally), merges patch into blueprint via update_agent_blueprint, returns dashboard URL + version + next_steps with re-run-evals reminder. Refuses ambiguously (multi-agent workspaces) — returns the agent list instead. (4) STRIPPED DEPRECATED FIELDS. tokensUsedToday + dailyTokenBudget removed from list_agents and get_agent_metrics MCP tool response shapes (token-budget concept was retired in v1.27.9; stale data was still leaking through and causing Claude Code to suggest 'bump the token budget' as a follow-up). (5) WELCOME.JS REWRITTEN. New 'Step zero — call get_workspace_state' section + new ANTI-PATTERNS table explicitly enumerating what NOT to do (don't ls/cat/read .env; don't check node/npm versions; don't ask 'is Anthropic key configured?'; don't create duplicate agent). FIRST_CALL_BANNER similarly anchored on step-zero discovery + anti-patterns. (6) /AGENTS PAGE REDESIGN. Each agent row now shows inline: status pill + 3-stat grid (conversations 24h, validator pass rate 24h with 'X turns' hint, eval pass rate X/Y with last-run timestamp + meets-gate tone) + a contextual PromoteHint banner ('Evals haven't run' / 'Below 87.5% gate, fix in Settings' / 'Eval gate met, ready to promote') + 5 quick-link CTAs (Overview / Sandbox / Conversations / Evals / Settings — was 2). The agent list is now a roster + health dashboard, not a list-of-links. EXPECTED IMPACT: 'build a chatbot for [biz]' / 'update the chatbot's FAQ' / 'how is my chatbot doing' prompts resolve in 1-2 tool calls + ~5-10s, instead of 12+ tool calls + ~3.5min. Operators see at a glance whether each agent is healthy + what's blocking promotion, without drilling into per-agent pages. NO migrations, NO new env vars. Backend redeploy required.",
6
8
  "description": "MCP server for SeldonFrame — AI-native Business OS platform. v1.28.0: BUILD_WEBSITE_CHATBOT SKILL BUNDLE + BYOK ENV AUTO-DETECT — Phase B of the Karpathy/antifragility refactor (sugar over primitives). PROBLEM: even after v1.27.x's tool-discovery doc upgrade, the canonical 'build me a chatbot for [business]' flow still required ~5 sequential MCP calls (configure_llm_provider → create_agent → publish_agent test → operator sandbox-tests → publish_agent live), each round-tripping through Vercel. ~30s wall time. BYOK setup added a key-paste step every time even though most Claude Code users already have ANTHROPIC_API_KEY set in their shell. WHAT SHIPS: (1) BYOK ENV AUTO-DETECT. configure_llm_provider gains a 'pass nothing / pass api_key=\"env\"' mode. The MCP server reads process.env.ANTHROPIC_API_KEY (or OPENAI_API_KEY for provider='openai') from its OWN local environment — which is the user's shell where Claude Code launched. Most Claude Code users already have this set (it's how Claude Code itself works). Returns { ok: false, error: 'no_env_key' } with a clear hint if the env var isn't set. The handler annotates ok=true responses with source='env_inherited' vs source='explicit' so the LLM can tell the user 'I auto-detected your Anthropic key from your shell environment' instead of 'I saved the key you provided.' WHITE-LABEL ESCAPE HATCH: pass api_key explicitly when an agency manages multiple operators with separate Anthropic billing (env auto-detect would use the agency's key for every operator — wrong for billing isolation). (2) NEW SKILL-BUNDLE TOOL build_website_chatbot. ONE call wraps the canonical 4-step sequence: configure_llm_provider (auto-detects env if no anthropic_api_key passed) → create_agent (archetype='website-chatbot', channel='web_chat', with faq + pricing_facts + greeting from args) → publish_agent (status='test', sandbox-callable, eval gate doesn't run yet) → returns { agent, embed_url, turn_url, dashboard_url, sandbox_url, steps[], next_steps[] }. Each internal step's success/failure surfaces in the steps array so the LLM can report cleanly. Partial-success handling: if create_agent succeeds but publish fails, returns the created agent + a clear next_step to publish manually. Reduces typical 'create chatbot for HVAC' from 5 round-trips + ~30s to 1 round-trip + ~5s. (3) WELCOME.JS CAPABILITY MAP UPDATED. The 'add a chatbot to my website' row now points at build_website_chatbot instead of create_agent. Canonical short flow walkthrough rewritten to show the 1-call version. FIRST_CALL_BANNER similarly updated. Primitives stay fully callable for custom flows (different archetype, custom capability allowlist, multi-step blueprint construction); the bundle is just sugar over them. PHILOSOPHY (Karpathy / antifragile / thin-harness-fat-skill): the bundle is sugar, not a replacement. Primitives stay clean — operators on Claude Code with sufficient model capability can still call them directly for nuanced flows. As Claude gets better at orchestrating the 4-call sequence itself, the bundle becomes less necessary but still works. Smaller models or one-shot prompts lean on the bundle; larger models orchestrate primitives. Same architecture serves both. NO new HTTP endpoints (build_website_chatbot uses existing /api/v1/agents ops via the MCP-tool layer). NO migrations, NO new env vars on the server side. ENCRYPTION_KEY still required (already shipped). DEFERRED to v1.28.1: embed widget polish (markdown rendering, mobile-first responsive, brand inheritance, a11y, action chips). DEFERRED to v1.28.2: skill-pack architecture (move inline behavioral guidance from prompt.ts to agents/<archetype>/skills/*.md files the composer reads on demand). DEFERRED to v1.28.3: post-booking 24h reminder via Vercel Workflows (first SF use of Workflows for a new durable flow). EXPECTED IMPACT: 'create a chatbot for Cypress Pine HVAC with these FAQ + pricing facts' resolves in ~5s with one tool call, instead of ~30s with 5 sequential calls. Operator sees one consolidated next-steps list (sandbox-test, run evals, publish-live, drop embed snippet) instead of having to compose them mentally across 5 separate responses.",
package/src/welcome.js CHANGED
@@ -8,7 +8,7 @@
8
8
  // stripped. `create_full_workspace` is the only workspace-creation
9
9
  // path mentioned anywhere in this briefing.
10
10
 
11
- export const VERSION = "1.28.2";
11
+ export const VERSION = "1.28.4";
12
12
 
13
13
  export const WELCOME_MARKDOWN = `# SeldonFrame — create a real Business OS in one conversation
14
14
 
@@ -433,4 +433,4 @@ admin dashboard. Pre-fills their email automatically.
433
433
  <https://seldonframe.com> · **Discord:** <https://discord.gg/sbVUu976NW>
434
434
  `;
435
435
 
436
- export const FIRST_CALL_BANNER = `🚀 SeldonFrame v1.28.2 is connected. STEP ZERO: for any workspace task call get_workspace_state({workspace_id}) FIRST — returns workspace identity + integrations status + agents with inline health stats + counts + tailored next_steps in ONE round-trip. Replaces 4-6 progressive discovery calls. ANTI-PATTERNS: don't ls/cat/read .env (SF is hosted, not local files); don't check node/npm versions (irrelevant); don't ask 'is Anthropic key configured?' (state response tells you); don't create a duplicate agent (state response shows existing ones — use update_website_chatbot instead of build_website_chatbot when one exists). Token-budget concept removed in v1.27.9 — ignore stale references. CAPABILITY MAP — pick the right primitive BEFORE exploring tools: (a) "build me a website" → WORKSPACE → create_workspace_v2 + block tools. (b) "add a chatbot to my website / landing page" → AGENT (web chat) → build_website_chatbot (v1.28+ skill bundle: configure_llm + create_agent + publish-test in 1 call; auto-detects ANTHROPIC_API_KEY from env). Drop to primitives (configure_llm_provider + create_agent + publish_agent) only for custom flows. CRITICAL ANTI-PATTERN: chat widgets are NOT blocks. Don't search list_blocks for chat — chat agents are a separate primitive (v1.26+). (c) "auto-reply to inbound SMS/email" → CONVERSATION → send_conversation_turn (one-shot Soul-aware reply, not a website widget). (d) "add hero/services/faq/cta section" → BLOCK → get_block_skill + persist_block. (e) "send campaign email/sms" → MESSAGING. (f) CRM ops → list_contacts/create_deal/etc. CHATBOT CANONICAL FLOW (v1.28+ — 1 call instead of 5): build_website_chatbot({workspace_id, name, faq, pricing_facts, greeting}) → wraps configure_llm + create_agent + publish-test in one call, auto-detects ANTHROPIC_API_KEY from env. Then: operator sandbox-tests at /agents/[id]/test → publish_agent({status:"live"}) auto-runs 8-scenario eval gate (≥87.5% pass required). Observability tools after publish: list_agents, tail_agent_conversations, get_agent_conversation, get_agent_metrics, run_agent_evals, replay_conversation. Dashboard surfaces /agents, /agents/[id]/test, /agents/[id]/settings, /agents/[id]/evals, /agents/[id]/conversations let operators iterate without leaving the browser. WORKSPACE FLOW (legacy reference): create_workspace_v2 → IN PARALLEL for all 7 recommended_blocks (hero, services, about, faq, cta, booking, intake): get_block_skill + persist_block → complete_workspace_v2 → finalize_workspace({workspace_id, email}). Run blocks in PARALLEL (Promise.all) — sequential takes 60+ seconds. v1.10+ CUSTOMIZE: regenerate_block, upload_workspace_image (image_url preferred over base64). v1.11+ STRUCTURAL: get_landing_structure, move_section, delete_section. v1.12+ COMPOSITES: add_composite_section / update_composite_section — manifest ANY block from 12 low-level primitives. Skipping finalize_workspace leaves the operator with no admin login. Every URL is real. NEVER create local files.`;
436
+ export const FIRST_CALL_BANNER = `🚀 SeldonFrame v1.28.4 is connected. STEP ZERO: for any workspace task call get_workspace_state({workspace_id}) FIRST — returns workspace identity + integrations status + agents with inline health stats + counts + tailored next_steps in ONE round-trip. Replaces 4-6 progressive discovery calls. ANTI-PATTERNS: don't ls/cat/read .env (SF is hosted, not local files); don't check node/npm versions (irrelevant); don't ask 'is Anthropic key configured?' (state response tells you); don't create a duplicate agent (state response shows existing ones — use update_website_chatbot instead of build_website_chatbot when one exists). Token-budget concept removed in v1.27.9 — ignore stale references. CAPABILITY MAP — pick the right primitive BEFORE exploring tools: (a) "build me a website" → WORKSPACE → create_workspace_v2 + block tools. (b) "add a chatbot to my website / landing page" → AGENT (web chat) → build_website_chatbot (v1.28+ skill bundle: configure_llm + create_agent + publish-test in 1 call; auto-detects ANTHROPIC_API_KEY from env). Drop to primitives (configure_llm_provider + create_agent + publish_agent) only for custom flows. CRITICAL ANTI-PATTERN: chat widgets are NOT blocks. Don't search list_blocks for chat — chat agents are a separate primitive (v1.26+). (c) "auto-reply to inbound SMS/email" → CONVERSATION → send_conversation_turn (one-shot Soul-aware reply, not a website widget). (d) "add hero/services/faq/cta section" → BLOCK → get_block_skill + persist_block. (e) "send campaign email/sms" → MESSAGING. (f) CRM ops → list_contacts/create_deal/etc. CHATBOT CANONICAL FLOW (v1.28+ — 1 call instead of 5): build_website_chatbot({workspace_id, name, faq, pricing_facts, greeting}) → wraps configure_llm + create_agent + publish-test in one call, auto-detects ANTHROPIC_API_KEY from env. Then: operator sandbox-tests at /agents/[id]/test → publish_agent({status:"live"}) auto-runs 8-scenario eval gate (≥87.5% pass required). Observability tools after publish: list_agents, tail_agent_conversations, get_agent_conversation, get_agent_metrics, run_agent_evals, replay_conversation. Dashboard surfaces /agents, /agents/[id]/test, /agents/[id]/settings, /agents/[id]/evals, /agents/[id]/conversations let operators iterate without leaving the browser. WORKSPACE FLOW (legacy reference): create_workspace_v2 → IN PARALLEL for all 7 recommended_blocks (hero, services, about, faq, cta, booking, intake): get_block_skill + persist_block → complete_workspace_v2 → finalize_workspace({workspace_id, email}). Run blocks in PARALLEL (Promise.all) — sequential takes 60+ seconds. v1.10+ CUSTOMIZE: regenerate_block, upload_workspace_image (image_url preferred over base64). v1.11+ STRUCTURAL: get_landing_structure, move_section, delete_section. v1.12+ COMPOSITES: add_composite_section / update_composite_section — manifest ANY block from 12 low-level primitives. Skipping finalize_workspace leaves the operator with no admin login. Every URL is real. NEVER create local files.`;