domma-cms 1.57.1 → 1.59.0
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.
- package/CHANGELOG.md +9 -0
- package/admin/js/app.js +2 -2
- package/admin/js/lib/admin-assistant.js +2 -2
- package/admin/js/lib/chat-toast.js +2 -0
- package/admin/js/lib/notifications-arrange.js +1 -1
- package/admin/js/templates/docs/usage-chat.html +11 -4
- package/admin/js/views/launchers.js +26 -25
- package/admin/js/views/notifications.js +10 -4
- package/docs/DommaFeatures.md +2 -1
- package/docs/admin-assistant.md +1 -1
- package/docs/plugin-development.md +1 -0
- package/package.json +1 -1
- package/server/routes/api/contacts.js +67 -12
- package/server/routes/api/launchers.js +3 -2
- package/server/services/adminAssistant.js +3 -1
- package/server/services/aiAssist.js +44 -0
- package/server/services/chat/ai.js +21 -9
- package/server/services/chat/conversation.js +40 -2
- package/server/services/permissionRegistry.js +11 -0
- package/server/services/plugins.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.59.0] - 2026-11-11
|
|
4
|
+
|
|
5
|
+
- **Contacts: own address book only.** A new permission, `contacts-restricted`, is for outside accounts such as a Job Board's candidates and companies. A role holding it uses Contacts for its own contacts and only the groups it made: it does not see anyone else's group names, cannot file a contact in someone else's group, and someone else's group is "not found" to it. Contacts Pro reads it too: no list of people, no sharing, no changes to the shared custom fields. It changes nothing for a person who also holds a role that gives Contacts without it, or for the top role.
|
|
6
|
+
- **Chat notifications.** Admins get a notification when a visitor starts a chat (with their first message and the page), and when the AI turns a visitor's question down: off-topic, or something the launcher's rules forbid. Each is its own source in Notifications settings (Visitor chat started, Chat question turned down), so either can be switched off or sent to other people. Turned-down questions need the Manager's launcher-chat update. While the admin is open these, and a visitor asking for a person or leaving a message, also pop up as messages with an **Open Chats** button (within 30 seconds; **Chat pop-ups** in the Notifications settings cog turns them off for a browser).
|
|
7
|
+
|
|
8
|
+
## [1.58.0] - 2026-11-11
|
|
9
|
+
|
|
10
|
+
- **AI Assist.** AI chat answers (chat launchers, admin launchers and the admin assistant) now come with the AI Assist Tool, in the Pro plan, instead of riding on the Site Builder. A Tool switches them on with `hooks.enableAiAssist()` (paid, closed-source plugins only). Without AI Assist, chats answer from the Knowledge alone and the launcher editor says so under **AI answers**.
|
|
11
|
+
|
|
3
12
|
## [1.57.1] - 2026-11-11
|
|
4
13
|
|
|
5
14
|
- An engine update no longer deletes a site's own files in `public/images` (such as `public/images/branding`). Since the engine started shipping `public/images/characters`, the update replaced the whole folder. Now only `public/css` and `public/js` are replaced whole; in any other folder the engine ships, only its own entries are replaced.
|
package/admin/js/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{wireNotificationMenu as tt}from"./lib/topbar-notifications.js";import{installSmoothCarets as et}from"./lib/smooth-caret.js";import{viewLoaders as at}from"./views/index.js";import{createLazyViews as it}from"./lib/lazy-views.js";import{withPluginChrome as K}from"./lib/plugin-chrome.js";import{api as r,getUser as O,isAuthenticated as p,logout as ot,sendToLogin as st}from"./api.js";import{claimDrafts as nt}from"./lib/draft-owner.js";import{isAuthScreen as y,loginHashFor as rt}from"./lib/login-arrange.js";import{installHttpInterceptor as lt}from"./http-interceptor.js";import{installResizableSlideovers as ct}from"./lib/slideover-resizable.js";import{installActivityThrobber as mt}from"./lib/activity-throbber.js";import{installUpdateNotice as pt,renderCmsVersion as dt}from"./lib/update-notice.js";import{renderFrameworkVersions as q,wireAccountMenu as ut}from"./lib/topbar-account.js";import{refreshTopbarProject as V}from"./lib/topbar-project.js";import{CONFINED_CLASS as ht,isConfined as wt,isPathAllowed as gt,redirectFor as ft}from"./lib/admin-scope.js";import{deliverDesktop as vt,desktopActive as bt,notificationSettings as St}from"./lib/desktop-notify.js";import{avatarUrl as Ct,installAccountAvatar as Mt}from"./lib/avatar.js";import{installCalculator as Dt}from"./lib/calculator.js";import{installAdminAssistant as yt}from"./lib/admin-assistant.js";import{installAdminLaunchers as Et}from"./lib/admin-launchers.js";import{takeOverviewPass as Nt,withDashboardStrip as z}from"./lib/dashboards-strip.js";import{installHotkeys as Pt}from"./lib/hotkeys-ui.js";import{applyAdminBrand as G}from"./lib/admin-brand.js";import{installRouterCatchUp as At}from"./lib/router-catch-up.js";import{installSidebarDrawer as jt}from"./lib/sidebar-drawer.js";$(()=>{et(document),lt(),Dt(),yt(),Et(),pt(),mt(),ct(),jt(),(async()=>{const{applyAdminTheme:t,refreshAdminTheme:i}=await import("./lib/admin-theme.js");p()?await i(r,{init:!0}):t({dommaTheme:"charcoal-dark"},{init:!0})})();let c=null,f=null,m="/",v=!1,w=null,d=null,u=!0;function N(t){if(j[t])return E.toast(`${j[t]} is switched off on this site.`,{type:"info"}),"/";const[i,e]=t.split("?"),a=new URLSearchParams(e||"").get("tab");if(i==="/settings"&&["favicon","pageNavigation","breadcrumbs","motion","search"].includes(a))return`/appearance?tab=${a}`;if(t.split("?")[0]==="/my-dashboard")return"/dashboards";const o=A[t]||ft(c,t);return o||(!u&&i==="/system/notifications"?c?.home||"/":(t.split("?")[0]||"/")==="/"&&m&&m!=="/"&&!Nt()?A[m]||m:null)}function P(){document.body.classList.toggle(ht,wt(c))}const A={},j={};R.use(async(t,i,e)=>{if(y(t.path))return e();if(!p()){st();return}const a=N(t.path);if(a){R.navigate(a);return}e()});async function b(){try{const t=await r.get("/auth/permissions");c=t.adminScope||null,P(),f=t.adminBrand||null,G(f),m=t.adminHome||"/",q(t.versions||{});const i=t.permissions||[];return v=gt(c,"/settings")&&i.some(e=>e==="settings"||e.startsWith("settings.")),w=i.some(e=>e==="notifications"||e.startsWith("notifications.")),d=t.adminPortal||null,u=t.notificationsScreen!==!1,i}catch{return c=null,P(),m="/",f||G(null),v=!1,w=null,d=null,u=!0,[]}}document.addEventListener("dm:admin-home-changed",()=>{b()});let k=null,I=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(V(r),k){I=!0;return}k=(async()=>{do{I=!1;try{await T(await b())}catch{}}while(I)})().finally(()=>{k=null})});async function T(t){const{applyAdminPortal:i}=await import("./lib/admin-portal.js");if(await i(d),d)return;const{renderAdminSidebar:e}=await import("./lib/sidebar-renderer.js");await e({mount:"#admin-sidebar",permissions:t,adminScope:c,brand:f,notificationsScreen:u})}M.subscribe("router:afterChange",({to:t})=>{y(t.path)&&(g&&(clearInterval(g),g=null),c=null,P(),m="/",v=!1,w=null,u=!0,d&&(d=null,import("./lib/admin-portal.js").then(i=>i.applyAdminPortal(null))))});const J=[{path:"/",view:"dashboard",title:"Dashboard - Domma CMS"},{path:"/dashboards",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/my-dashboard",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/pages",view:"pages",title:"Pages - Domma CMS"},{path:"/pages/new",view:"pageEditor",title:"New Page - Domma CMS"},{path:"/pages/edit/*",view:"pageEditor",title:"Edit Page - Domma CMS"},{path:"/media",view:"media",title:"Media - Domma CMS"},{path:"/menus",view:"menus",title:"Menus - Domma CMS"},{path:"/context-menus",view:"contextMenus",title:"Context Menus - Domma CMS"},{path:"/context-menus/new",view:"contextMenuEditor",title:"New Context Menu - Domma CMS"},{path:"/context-menus/edit/:slug",view:"contextMenuEditor",title:"Edit Context Menu - Domma CMS"},{path:"/launchers",view:"launchers",title:"Launchers - Domma CMS"},{path:"/menus/new",view:"menuEditor",title:"New Menu - Domma CMS"},{path:"/menus/edit/:slug",view:"menuEditor",title:"Edit Menu - Domma CMS"},{path:"/menu-locations",view:"menuLocations",title:"Menu Locations - Domma CMS"},{path:"/navigation",view:"menusRedirect",title:"Menus - Domma CMS"},{path:"/layouts",view:"layouts",title:"Layouts - Domma CMS"},{path:"/appearance",view:"appearance",title:"Appearance - Domma CMS"},{path:"/footer",view:"footer",title:"Footer - Domma CMS"},{path:"/settings",view:"settings",title:"Settings - Domma CMS"},{path:"/theme",view:"theme",title:"Theme - Domma CMS"},{path:"/users",view:"users",title:"Users - Domma CMS"},{path:"/users/new",view:"userEditor",title:"New User - Domma CMS"},{path:"/users/edit/:id",view:"userEditor",title:"Edit User - Domma CMS"},{path:"/plugins",view:"plugins",title:"Plugins - Domma CMS"},{path:"/plugins/code/:name",view:"pluginCode",title:"Plugin Code - Domma CMS"},{path:"/documentation",view:"documentation",title:"Usage - Domma CMS"},{path:"/tutorials",view:"tutorials",title:"Tutorials - Domma CMS"},{path:"/tutorials/crud",view:"tutorialCrud",title:"Building a CRUD App - Domma CMS"},{path:"/tutorials/editor",view:"tutorialEditor",title:"The Editor - Domma CMS"},{path:"/tutorials/plugin",view:"tutorialPlugin",title:"Writing a Tool - Domma CMS"},{path:"/tutorials/forms",view:"tutorialForms",title:"Form Follow-Up - Domma CMS"},{path:"/docs/components",view:"componentsReference",title:"Components Reference - Domma CMS"},{path:"/docs/components-howto",view:"componentsHowto",title:"Components How-To - Domma CMS"},{path:"/docs/components-walkthrough",view:"componentsWalkthrough",title:"Components Walkthrough - Domma CMS"},{path:"/docs/components-rules",view:"componentsRules",title:"Components Rules - Domma CMS"},{path:"/docs/usage/pages",view:"usagePages",title:"Pages - Usage - Domma CMS"},{path:"/docs/usage/media",view:"usageMedia",title:"Media - Usage - Domma CMS"},{path:"/docs/usage/navigation",view:"usageNavigation",title:"Navigation - Usage - Domma CMS"},{path:"/docs/usage/dconfig",view:"usageDconfig",title:"DConfig - Usage - Domma CMS"},{path:"/docs/usage/shortcodes",view:"usageShortcodes",title:"Shortcodes - Usage - Domma CMS"},{path:"/docs/usage/site-settings",view:"usageSiteSettings",title:"Site Settings - Usage - Domma CMS"},{path:"/docs/usage/plugins",view:"usagePlugins",title:"Plugins - Usage - Domma CMS"},{path:"/docs/usage/users-roles",view:"usageUsersRoles",title:"Users & Roles - Usage - Domma CMS"},{path:"/docs/usage/views",view:"usageViews",title:"Views - Usage - Domma CMS"},{path:"/docs/usage/actions",view:"usageActions",title:"Actions - Usage - Domma CMS"},{path:"/docs/usage/cta-shortcode",view:"usageCtaShortcode",title:"CTA Shortcode - Usage - Domma CMS"},{path:"/docs/usage/editions",view:"usageEditions",title:"Editions & Licences - Usage - Domma CMS"},{path:"/docs/usage/collections",view:"usageCollections",title:"Collections & Forms - Usage - Domma CMS"},{path:"/docs/usage/blocks",view:"usageBlocks",title:"Blocks - Usage - Domma CMS"},{path:"/docs/usage/tools",view:"usageTools",title:"Built-in Tools - Usage - Domma CMS"},{path:"/docs/usage/dashboard",view:"usageDashboard",title:"Dashboard - Usage - Domma CMS"},{path:"/docs/usage/search-engines",view:"usageSearchEngines",title:"Search Engines & AI - Usage - Domma CMS"},{path:"/docs/usage/launchers",view:"usageLaunchers",title:"Launchers - Usage - Domma CMS"},{path:"/docs/usage/chat",view:"usageChat",title:"Chat & Knowledge - Usage - Domma CMS"},{path:"/docs/plugins",view:"pluginGuides",title:"Plugin Guides - Domma CMS"},{path:"/docs/plugins/*",view:"pluginGuide",title:"Plugin Guide - Domma CMS"},{path:"/docs/api/authentication",view:"apiRefAuthentication",title:"Authentication - API - Domma CMS"},{path:"/docs/api/pages",view:"apiRefPages",title:"Pages - API - Domma CMS"},{path:"/docs/api/settings",view:"apiRefSettings",title:"Settings - API - Domma CMS"},{path:"/docs/api/layouts",view:"apiRefLayouts",title:"Layouts - API - Domma CMS"},{path:"/docs/api/navigation",view:"apiRefNavigation",title:"Navigation - API - Domma CMS"},{path:"/docs/api/media",view:"apiRefMedia",title:"Media - API - Domma CMS"},{path:"/docs/api/users",view:"apiRefUsers",title:"Users - API - Domma CMS"},{path:"/docs/api/plugins",view:"apiRefPlugins",title:"Plugins - API - Domma CMS"},{path:"/docs/api/collections",view:"apiRefCollections",title:"Collections - API - Domma CMS"},{path:"/docs/api/views",view:"apiRefViews",title:"Views API - Domma CMS"},{path:"/docs/api/actions",view:"apiRefActions",title:"Actions API - Domma CMS"},{path:"/docs/api/forms",view:"apiRefForms",title:"Forms API - Domma CMS"},{path:"/docs/api/scaffold",view:"apiRefScaffold",title:"Scaffold API - Domma CMS"},{path:"/docs/api/external",view:"apiRefExternal",title:"External API & Tokens - Domma CMS"},{path:"/docs/api/content",view:"apiRefContent",title:"Content API - Domma CMS"},{path:"/docs/api/builder",view:"apiRefBuilder",title:"API Builder - Domma CMS"},{path:"/api-reference",view:"apiReference",title:"API Reference - Domma CMS"},{path:"/collections",view:"collections",title:"Collections - Domma CMS"},{path:"/collections/new",view:"collectionEditor",title:"New Collection - Domma CMS"},{path:"/collections/edit/:slug",view:"collectionEditor",title:"Edit Collection - Domma CMS"},{path:"/collections/:slug/entries",view:"collectionEntries",title:"Entries - Domma CMS"},{path:"/forms",view:"forms",title:"Forms - Domma CMS"},{path:"/forms/new",view:"formEditor",title:"New Form - Domma CMS"},{path:"/forms/edit/:slug",view:"formEditor",title:"Edit Form - Domma CMS"},{path:"/forms/:slug/submissions",view:"formSubmissions",title:"Submissions - Domma CMS"},{path:"/views",view:"viewsList",title:"Views - Domma CMS"},{path:"/views/new",view:"viewEditor",title:"New View - Domma CMS"},{path:"/views/edit/:slug",view:"viewEditor",title:"Edit View - Domma CMS"},{path:"/views/:slug/preview",view:"viewPreview",title:"View Preview - Domma CMS"},{path:"/actions",view:"actionsList",title:"Actions - Domma CMS"},{path:"/actions/new",view:"actionEditor",title:"New Action - Domma CMS"},{path:"/actions/edit/:slug",view:"actionEditor",title:"Edit Action - Domma CMS"},{path:"/pro/docs",view:"proDocs",title:"Pro Documentation - Domma CMS"},{path:"/blocks",view:"blocks",title:"Blocks - Domma CMS"},{path:"/blocks/new",view:"pageEditor",title:"New Block - Domma CMS"},{path:"/blocks/edit/:name",view:"pageEditor",title:"Edit Block - Domma CMS"},{path:"/components",view:"components",title:"Components - Domma CMS"},{path:"/components/new",view:"pageEditor",title:"New Component - Domma CMS"},{path:"/components/edit/:name",view:"pageEditor",title:"Edit Component - Domma CMS"},{path:"/my-profile",view:"myProfile",title:"My Profile - Domma CMS"},{path:"/roles",view:"roles",title:"Roles & Permissions - Domma CMS"},{path:"/roles/edit/:id",view:"roleEditor",title:"Edit Role - Domma CMS"},{path:"/effects",view:"effects",title:"Effects - Domma CMS"},{path:"/search",view:"search",title:"Search - Domma CMS"},{path:"/content-api",view:"contentApi",title:"Content API - Domma CMS"},{path:"/launchers/chats",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/chats/:id",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/knowledge",view:"chatKnowledge",title:"Chat Knowledge - Domma CMS"},{path:"/notes",view:"notes",title:"Notes - Domma CMS"},{path:"/todo",view:"todo",title:"Todo - Domma CMS"},{path:"/calculator",view:"calculator",title:"Calculator - Domma CMS"},{path:"/analytics",view:"analytics",title:"Analytics - Domma CMS"},{path:"/seo",view:"seo",title:"SEO - Domma CMS"},{path:"/seo/:tab",view:"seo",title:"SEO - Domma CMS"},{path:"/wordpress-import",view:"wordpressImport",title:"Import a site - Domma CMS"},{path:"/contacts",view:"contacts",title:"Contacts - Domma CMS"},{path:"/calls/new",view:"callNew",title:"Call now - Domma CMS"},{path:"/system/notifications",view:"notifications",title:"Notifications - Domma CMS"},{path:"/api-tokens",view:"apiTokens",title:"API Tokens - Domma CMS"},{path:"/api-endpoints",view:"apiEndpoints",title:"API Builder - Domma CMS"},{path:"/api-endpoints/new",view:"apiEndpointEditor",title:"New API Endpoint - Domma CMS"},{path:"/api-endpoints/edit/:id",view:"apiEndpointEditor",title:"Edit API Endpoint - Domma CMS"},{path:"/projects",view:"projects",title:"Projects - Domma CMS"},{path:"/projects/new",view:"projects",title:"New Project - Domma CMS"},{path:"/projects/edit/:slug",view:"projects",title:"Edit Project - Domma CMS"},{path:"/projects/:slug/settings",view:"projectSettings",title:"Project settings - Domma CMS"},{path:"/projects/:slug/pages",view:"pages",title:"Project pages - Domma CMS"},{path:"/projects/:slug/collections",view:"collections",title:"Project collections - Domma CMS"},{path:"/projects/:slug/forms",view:"forms",title:"Project forms - Domma CMS"},{path:"/projects/:slug/actions",view:"actionsList",title:"Project actions - Domma CMS"},{path:"/projects/:slug/menus",view:"menus",title:"Project menus - Domma CMS"},{path:"/projects/:slug/blocks",view:"blocks",title:"Project blocks - Domma CMS"},{path:"/projects/:slug/components",view:"components",title:"Project components - Domma CMS"},{path:"/projects/:slug/views",view:"viewsList",title:"Project views - Domma CMS"},{path:"/projects/:slug/roles",view:"roles",title:"Project roles - Domma CMS"},{path:"/projects/:slug/users",view:"users",title:"Project users - Domma CMS"},{path:"/projects/:slug/apis",view:"apiEndpoints",title:"Project APIs - Domma CMS"},{path:"/projects/:slug",view:"projectDetail",title:"Project - Domma CMS"},{path:"/login",view:"login",title:"Sign in - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}},{path:"/reset-password",view:"login",title:"Reset Password - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}}];M.subscribe("router:afterChange",async({to:t,from:i})=>{if(!y(t.path)){if($("#admin-sidebar").show(),$("#admin-topbar").show(),y(i?.path)){$("#topbar-user-name").remove(),import("./lib/admin-theme.js").then(o=>o.refreshAdminTheme(r)),await x();const e=await b(),a=N(t.path);if(a&&R.navigate(a),T(e),St.read().signInToasts)try{const o=await r.system.notifications.list().catch(()=>[]),n=(Array.isArray(o)?o:[]).filter(s=>s.unread&&["warning","critical"].includes(s.data?.severity)).slice(0,3);for(const s of n){const l=h(s.data?.title||""),F=h((s.data?.body||"").slice(0,120));E.toast(`${l} - ${F}`,{type:s.data?.severity==="critical"?"error":"warning",duration:0})}}catch{}}H()}}),M.subscribe("router:afterChange",()=>{setTimeout(()=>{$(".btn-primary, .btn-danger").length&&Domma.effects.reveal(".btn-primary, .btn-danger",{animation:"fade",stagger:40,duration:300})},50)});const Y=["#field-project","#menu-project","#collection-project","#endpoint-project","#action-project","#view-project","#block-project","#component-project","#role-project",'[name="project"]','[name="ownedByProject"]'];function Q(t){return/^\/(pages|menus|context-menus|collections|forms|actions|views|blocks|components|users|roles|api-endpoints)\/(new|edit\/)/.test(t)}M.subscribe("router:afterChange",({to:t})=>{const i=t?String(t.path).split("?")[0]:"";if(!t||!Q(i))return;const a=new URLSearchParams(location.hash.split("?")[1]||"").get("project");if(!a||!/\/new$/.test(i))return;let o=0;const n=60,s=1500,l=()=>{o+=n;for(const F of Y){const D=document.querySelector(F);if(!D)continue;if(Array.from(D.options||[]).find(Z=>Z.value===a)){D.value=a,D.dispatchEvent(new Event("change",{bubbles:!0}));return}}o<s&&setTimeout(l,n)};setTimeout(l,n)});const _="cms_card_states",U=S.get(_)||{};M.subscribe("router:afterChange",()=>{setTimeout(()=>{$("#view-container .card-collapsible").each(function(){const t=$(this).find(".card-header h2, .card-header h3").first().text().trim();t&&U[t]==="collapsed"&&$(this).addClass("card-collapsed")})},200)}),$("#view-container").on("click",".card-collapsible .card-header",function(t){if($(t.target).closest("button, a").length)return;const i=$(this).closest(".card");i.toggleClass("card-collapsed");const e=$(this).find("h2, h3").first().text().trim();e&&(U[e]=i.hasClass("card-collapsed")?"collapsed":"open",S.set(_,U))}),Pt(),document.addEventListener("keydown",t=>{if(!(t.ctrlKey||t.metaKey)||t.key!=="s"||window.location.hash.startsWith("#/login")||window.location.hash.startsWith("#/reset-password"))return;const i=document.querySelector("#view-container .view-header button.btn-primary");i&&(t.preventDefault(),i.click())});const C=it(),W=C.views,X={notes:{displayName:"Notes",icon:"edit-3"},todo:{displayName:"Todo",icon:"check-square"},calculator:{displayName:"Calculator",icon:"calculator"},analytics:{displayName:"Analytics",icon:"chart-bar"},seo:{displayName:"SEO",icon:"search"},wordpressImport:{displayName:"Import a site",icon:"download"},contacts:{displayName:"Contacts",icon:"users"},projects:{displayName:"Projects",icon:"folder"},pages:{displayName:"Pages",icon:"file-text"},media:{displayName:"Media",icon:"image"},menus:{displayName:"Site menus",icon:"menu"},contextMenus:{displayName:"Context Menus",icon:"menu"},launchers:{displayName:"Launchers",icon:"rocket"},theme:{displayName:"Theme",icon:"droplet"},collections:{displayName:"Collections",icon:"database"},forms:{displayName:"Forms",icon:"layout"},viewsList:{displayName:"Views",icon:"eye"},actionsList:{displayName:"Actions",icon:"zap"},apiEndpoints:{displayName:"API Builder",icon:"code"},blocks:{displayName:"Blocks",icon:"box"},components:{displayName:"Components",icon:"component"},notifications:{displayName:"Notifications",icon:"bell"},roles:{displayName:"Roles",icon:"shield"},users:{displayName:"Users",icon:"users"},appearance:{displayName:"Appearance",icon:"layout"},footer:{displayName:"Footer",icon:"panel-bottom"},settings:{displayName:"Site Settings",icon:"settings"},effects:{displayName:"Effects",icon:"sparkles"},layouts:{displayName:"Layouts",icon:"layout"},plugins:{displayName:"Marketplace",icon:"store"},myProfile:{displayName:"My Profile",icon:"user"},apiTokens:{displayName:"API Tokens",icon:"key"},search:{displayName:"Search",icon:"search"},contentApi:{displayName:"Content API",icon:"file-text"},chats:{displayName:"Chats",icon:"message-circle"},dashboard:{displayName:"Dashboard",icon:"home"},dashboards:{displayName:"Dashboards",icon:"home"},pageEditor:{displayName:"Pages",section:"Edit",icon:"file-text"},menuEditor:{displayName:"Site menus",section:"Edit",icon:"menu"},menuLocations:{displayName:"Site menus",section:"Locations",icon:"map-pin"},contextMenuEditor:{displayName:"Context Menus",section:"Edit",icon:"menu"},collectionEditor:{displayName:"Collections",section:"Edit",icon:"database"},collectionEntries:{displayName:"Collections",section:"Entries",icon:"database"},formEditor:{displayName:"Forms",section:"Edit",icon:"layout"},formSubmissions:{displayName:"Forms",section:"Submissions",icon:"inbox"},viewEditor:{displayName:"Views",section:"Edit",icon:"eye"},viewPreview:{displayName:"Views",section:"Preview",icon:"eye"},actionEditor:{displayName:"Actions",section:"Edit",icon:"zap"},apiEndpointEditor:{displayName:"API Builder",section:"Edit",icon:"code"},roleEditor:{displayName:"Roles",section:"Edit",icon:"shield"},userEditor:{displayName:"Users",section:"Edit",icon:"users"},projectDetail:{displayName:"Projects",section:"Overview",icon:"folder"},projectSettings:{displayName:"Projects",section:"Settings",icon:"folder"},pluginCode:{displayName:"Marketplace",section:"Code",icon:"code"},chatKnowledge:{displayName:"Chats",section:"Knowledge",icon:"book-open"}};for(const[t,i]of Object.entries(at))C.register(t,async()=>{let e=await i();const a=X[t];return a&&(e=K(e,{plugin:t,licence:"Built in",...a})),t==="dashboard"?z(e):e});R.use(async(t,i,e)=>{try{await C.load(t.view)}catch(a){console.error("[admin] Screen failed to load",a),W[t.view]={template:'<p role="alert">This screen could not load. Reload the page to try again.</p>'}}e()});const L=[...J];async function x(){if(p())try{const t=await r.plugins.adminConfig(),i=new Set(L.map(e=>e.path));for(const e of t.routes||[])i.has(e.path)||L.push(e);for(const[e,a]of Object.entries(t.views||{})){const o=(t.meta||{})[e];C.register(e,async()=>{const s=(await import(`/plugins/${a.entry}`))[a.exportName];if(!s)throw new Error(`Missing plugin screen: ${e}`);const l=K(s,o);return e==="dashboard"?z(l):l},JSON.stringify([a,o]))}for(const[e,{route:a}]of Object.entries(t.takeovers||{}))a&&(A[`/${e}`]=a);t.mediaPicker&&(globalThis[Symbol.for("domma.media-picker")]=t.mediaPicker);for(const[e,{enabled:a,displayName:o}]of Object.entries(t.tools||{}))a===!1&&(j[`/${e}`]=o);for(const{id:e,href:a}of t.css||[])if(!document.getElementById(e)){const o=document.createElement("link");o.id=e,o.rel="stylesheet",o.href=a,document.head.appendChild(o)}}catch{}}function H(){const t=O();if(!t)return;if($("#topbar-user-name").length){V(r);return}const e={"super-admin":"Super Admin",admin:"Admin",user:"User"}[t.role]||t.role,a=Ct(t);$("#topbar-user").get(0).innerHTML=`
|
|
1
|
+
import{wireNotificationMenu as it}from"./lib/topbar-notifications.js";import{installSmoothCarets as ot}from"./lib/smooth-caret.js";import{viewLoaders as st}from"./views/index.js";import{createLazyViews as nt}from"./lib/lazy-views.js";import{withPluginChrome as q}from"./lib/plugin-chrome.js";import{api as r,getUser as V,isAuthenticated as p,logout as rt,sendToLogin as lt}from"./api.js";import{claimDrafts as ct}from"./lib/draft-owner.js";import{isAuthScreen as y,loginHashFor as mt}from"./lib/login-arrange.js";import{installHttpInterceptor as pt}from"./http-interceptor.js";import{installResizableSlideovers as dt}from"./lib/slideover-resizable.js";import{installActivityThrobber as ut}from"./lib/activity-throbber.js";import{installUpdateNotice as ht,renderCmsVersion as wt}from"./lib/update-notice.js";import{renderFrameworkVersions as z,wireAccountMenu as gt}from"./lib/topbar-account.js";import{refreshTopbarProject as _}from"./lib/topbar-project.js";import{CONFINED_CLASS as ft,isConfined as vt,isPathAllowed as bt,redirectFor as Ct}from"./lib/admin-scope.js";import{deliverDesktop as St,desktopActive as G,notificationSettings as J}from"./lib/desktop-notify.js";import{deliverChatToasts as Mt}from"./lib/chat-toast.js";import{avatarUrl as Dt,installAccountAvatar as yt}from"./lib/avatar.js";import{installCalculator as Et}from"./lib/calculator.js";import{installAdminAssistant as Nt}from"./lib/admin-assistant.js";import{installAdminLaunchers as Pt}from"./lib/admin-launchers.js";import{takeOverviewPass as At,withDashboardStrip as Y}from"./lib/dashboards-strip.js";import{installHotkeys as jt}from"./lib/hotkeys-ui.js";import{applyAdminBrand as Q}from"./lib/admin-brand.js";import{installRouterCatchUp as kt}from"./lib/router-catch-up.js";import{installSidebarDrawer as Rt}from"./lib/sidebar-drawer.js";$(()=>{ot(document),pt(),Et(),Nt(),Pt(),ht(),ut(),dt(),Rt(),(async()=>{const{applyAdminTheme:t,refreshAdminTheme:i}=await import("./lib/admin-theme.js");p()?await i(r,{init:!0}):t({dommaTheme:"charcoal-dark"},{init:!0})})();let c=null,f=null,m="/",v=!1,w=null,d=null,u=!0;function N(t){if(j[t])return E.toast(`${j[t]} is switched off on this site.`,{type:"info"}),"/";const[i,e]=t.split("?"),a=new URLSearchParams(e||"").get("tab");if(i==="/settings"&&["favicon","pageNavigation","breadcrumbs","motion","search"].includes(a))return`/appearance?tab=${a}`;if(t.split("?")[0]==="/my-dashboard")return"/dashboards";const o=A[t]||Ct(c,t);return o||(!u&&i==="/system/notifications"?c?.home||"/":(t.split("?")[0]||"/")==="/"&&m&&m!=="/"&&!At()?A[m]||m:null)}function P(){document.body.classList.toggle(ft,vt(c))}const A={},j={};R.use(async(t,i,e)=>{if(y(t.path))return e();if(!p()){lt();return}const a=N(t.path);if(a){R.navigate(a);return}e()});async function b(){try{const t=await r.get("/auth/permissions");c=t.adminScope||null,P(),f=t.adminBrand||null,Q(f),m=t.adminHome||"/",z(t.versions||{});const i=t.permissions||[];return v=bt(c,"/settings")&&i.some(e=>e==="settings"||e.startsWith("settings.")),w=i.some(e=>e==="notifications"||e.startsWith("notifications.")),d=t.adminPortal||null,u=t.notificationsScreen!==!1,i}catch{return c=null,P(),m="/",f||Q(null),v=!1,w=null,d=null,u=!0,[]}}document.addEventListener("dm:admin-home-changed",()=>{b()});let k=null,I=!1;document.addEventListener("dm:sidebar-rebuild",()=>{if(_(r),k){I=!0;return}k=(async()=>{do{I=!1;try{await T(await b())}catch{}}while(I)})().finally(()=>{k=null})});async function T(t){const{applyAdminPortal:i}=await import("./lib/admin-portal.js");if(await i(d),d)return;const{renderAdminSidebar:e}=await import("./lib/sidebar-renderer.js");await e({mount:"#admin-sidebar",permissions:t,adminScope:c,brand:f,notificationsScreen:u})}M.subscribe("router:afterChange",({to:t})=>{y(t.path)&&(g&&(clearInterval(g),g=null),c=null,P(),m="/",v=!1,w=null,u=!0,d&&(d=null,import("./lib/admin-portal.js").then(i=>i.applyAdminPortal(null))))});const X=[{path:"/",view:"dashboard",title:"Dashboard - Domma CMS"},{path:"/dashboards",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/my-dashboard",view:"dashboards",title:"Dashboards - Domma CMS"},{path:"/pages",view:"pages",title:"Pages - Domma CMS"},{path:"/pages/new",view:"pageEditor",title:"New Page - Domma CMS"},{path:"/pages/edit/*",view:"pageEditor",title:"Edit Page - Domma CMS"},{path:"/media",view:"media",title:"Media - Domma CMS"},{path:"/menus",view:"menus",title:"Menus - Domma CMS"},{path:"/context-menus",view:"contextMenus",title:"Context Menus - Domma CMS"},{path:"/context-menus/new",view:"contextMenuEditor",title:"New Context Menu - Domma CMS"},{path:"/context-menus/edit/:slug",view:"contextMenuEditor",title:"Edit Context Menu - Domma CMS"},{path:"/launchers",view:"launchers",title:"Launchers - Domma CMS"},{path:"/menus/new",view:"menuEditor",title:"New Menu - Domma CMS"},{path:"/menus/edit/:slug",view:"menuEditor",title:"Edit Menu - Domma CMS"},{path:"/menu-locations",view:"menuLocations",title:"Menu Locations - Domma CMS"},{path:"/navigation",view:"menusRedirect",title:"Menus - Domma CMS"},{path:"/layouts",view:"layouts",title:"Layouts - Domma CMS"},{path:"/appearance",view:"appearance",title:"Appearance - Domma CMS"},{path:"/footer",view:"footer",title:"Footer - Domma CMS"},{path:"/settings",view:"settings",title:"Settings - Domma CMS"},{path:"/theme",view:"theme",title:"Theme - Domma CMS"},{path:"/users",view:"users",title:"Users - Domma CMS"},{path:"/users/new",view:"userEditor",title:"New User - Domma CMS"},{path:"/users/edit/:id",view:"userEditor",title:"Edit User - Domma CMS"},{path:"/plugins",view:"plugins",title:"Plugins - Domma CMS"},{path:"/plugins/code/:name",view:"pluginCode",title:"Plugin Code - Domma CMS"},{path:"/documentation",view:"documentation",title:"Usage - Domma CMS"},{path:"/tutorials",view:"tutorials",title:"Tutorials - Domma CMS"},{path:"/tutorials/crud",view:"tutorialCrud",title:"Building a CRUD App - Domma CMS"},{path:"/tutorials/editor",view:"tutorialEditor",title:"The Editor - Domma CMS"},{path:"/tutorials/plugin",view:"tutorialPlugin",title:"Writing a Tool - Domma CMS"},{path:"/tutorials/forms",view:"tutorialForms",title:"Form Follow-Up - Domma CMS"},{path:"/docs/components",view:"componentsReference",title:"Components Reference - Domma CMS"},{path:"/docs/components-howto",view:"componentsHowto",title:"Components How-To - Domma CMS"},{path:"/docs/components-walkthrough",view:"componentsWalkthrough",title:"Components Walkthrough - Domma CMS"},{path:"/docs/components-rules",view:"componentsRules",title:"Components Rules - Domma CMS"},{path:"/docs/usage/pages",view:"usagePages",title:"Pages - Usage - Domma CMS"},{path:"/docs/usage/media",view:"usageMedia",title:"Media - Usage - Domma CMS"},{path:"/docs/usage/navigation",view:"usageNavigation",title:"Navigation - Usage - Domma CMS"},{path:"/docs/usage/dconfig",view:"usageDconfig",title:"DConfig - Usage - Domma CMS"},{path:"/docs/usage/shortcodes",view:"usageShortcodes",title:"Shortcodes - Usage - Domma CMS"},{path:"/docs/usage/site-settings",view:"usageSiteSettings",title:"Site Settings - Usage - Domma CMS"},{path:"/docs/usage/plugins",view:"usagePlugins",title:"Plugins - Usage - Domma CMS"},{path:"/docs/usage/users-roles",view:"usageUsersRoles",title:"Users & Roles - Usage - Domma CMS"},{path:"/docs/usage/views",view:"usageViews",title:"Views - Usage - Domma CMS"},{path:"/docs/usage/actions",view:"usageActions",title:"Actions - Usage - Domma CMS"},{path:"/docs/usage/cta-shortcode",view:"usageCtaShortcode",title:"CTA Shortcode - Usage - Domma CMS"},{path:"/docs/usage/editions",view:"usageEditions",title:"Editions & Licences - Usage - Domma CMS"},{path:"/docs/usage/collections",view:"usageCollections",title:"Collections & Forms - Usage - Domma CMS"},{path:"/docs/usage/blocks",view:"usageBlocks",title:"Blocks - Usage - Domma CMS"},{path:"/docs/usage/tools",view:"usageTools",title:"Built-in Tools - Usage - Domma CMS"},{path:"/docs/usage/dashboard",view:"usageDashboard",title:"Dashboard - Usage - Domma CMS"},{path:"/docs/usage/search-engines",view:"usageSearchEngines",title:"Search Engines & AI - Usage - Domma CMS"},{path:"/docs/usage/launchers",view:"usageLaunchers",title:"Launchers - Usage - Domma CMS"},{path:"/docs/usage/chat",view:"usageChat",title:"Chat & Knowledge - Usage - Domma CMS"},{path:"/docs/plugins",view:"pluginGuides",title:"Plugin Guides - Domma CMS"},{path:"/docs/plugins/*",view:"pluginGuide",title:"Plugin Guide - Domma CMS"},{path:"/docs/api/authentication",view:"apiRefAuthentication",title:"Authentication - API - Domma CMS"},{path:"/docs/api/pages",view:"apiRefPages",title:"Pages - API - Domma CMS"},{path:"/docs/api/settings",view:"apiRefSettings",title:"Settings - API - Domma CMS"},{path:"/docs/api/layouts",view:"apiRefLayouts",title:"Layouts - API - Domma CMS"},{path:"/docs/api/navigation",view:"apiRefNavigation",title:"Navigation - API - Domma CMS"},{path:"/docs/api/media",view:"apiRefMedia",title:"Media - API - Domma CMS"},{path:"/docs/api/users",view:"apiRefUsers",title:"Users - API - Domma CMS"},{path:"/docs/api/plugins",view:"apiRefPlugins",title:"Plugins - API - Domma CMS"},{path:"/docs/api/collections",view:"apiRefCollections",title:"Collections - API - Domma CMS"},{path:"/docs/api/views",view:"apiRefViews",title:"Views API - Domma CMS"},{path:"/docs/api/actions",view:"apiRefActions",title:"Actions API - Domma CMS"},{path:"/docs/api/forms",view:"apiRefForms",title:"Forms API - Domma CMS"},{path:"/docs/api/scaffold",view:"apiRefScaffold",title:"Scaffold API - Domma CMS"},{path:"/docs/api/external",view:"apiRefExternal",title:"External API & Tokens - Domma CMS"},{path:"/docs/api/content",view:"apiRefContent",title:"Content API - Domma CMS"},{path:"/docs/api/builder",view:"apiRefBuilder",title:"API Builder - Domma CMS"},{path:"/api-reference",view:"apiReference",title:"API Reference - Domma CMS"},{path:"/collections",view:"collections",title:"Collections - Domma CMS"},{path:"/collections/new",view:"collectionEditor",title:"New Collection - Domma CMS"},{path:"/collections/edit/:slug",view:"collectionEditor",title:"Edit Collection - Domma CMS"},{path:"/collections/:slug/entries",view:"collectionEntries",title:"Entries - Domma CMS"},{path:"/forms",view:"forms",title:"Forms - Domma CMS"},{path:"/forms/new",view:"formEditor",title:"New Form - Domma CMS"},{path:"/forms/edit/:slug",view:"formEditor",title:"Edit Form - Domma CMS"},{path:"/forms/:slug/submissions",view:"formSubmissions",title:"Submissions - Domma CMS"},{path:"/views",view:"viewsList",title:"Views - Domma CMS"},{path:"/views/new",view:"viewEditor",title:"New View - Domma CMS"},{path:"/views/edit/:slug",view:"viewEditor",title:"Edit View - Domma CMS"},{path:"/views/:slug/preview",view:"viewPreview",title:"View Preview - Domma CMS"},{path:"/actions",view:"actionsList",title:"Actions - Domma CMS"},{path:"/actions/new",view:"actionEditor",title:"New Action - Domma CMS"},{path:"/actions/edit/:slug",view:"actionEditor",title:"Edit Action - Domma CMS"},{path:"/pro/docs",view:"proDocs",title:"Pro Documentation - Domma CMS"},{path:"/blocks",view:"blocks",title:"Blocks - Domma CMS"},{path:"/blocks/new",view:"pageEditor",title:"New Block - Domma CMS"},{path:"/blocks/edit/:name",view:"pageEditor",title:"Edit Block - Domma CMS"},{path:"/components",view:"components",title:"Components - Domma CMS"},{path:"/components/new",view:"pageEditor",title:"New Component - Domma CMS"},{path:"/components/edit/:name",view:"pageEditor",title:"Edit Component - Domma CMS"},{path:"/my-profile",view:"myProfile",title:"My Profile - Domma CMS"},{path:"/roles",view:"roles",title:"Roles & Permissions - Domma CMS"},{path:"/roles/edit/:id",view:"roleEditor",title:"Edit Role - Domma CMS"},{path:"/effects",view:"effects",title:"Effects - Domma CMS"},{path:"/search",view:"search",title:"Search - Domma CMS"},{path:"/content-api",view:"contentApi",title:"Content API - Domma CMS"},{path:"/launchers/chats",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/chats/:id",view:"chats",title:"Chats - Domma CMS"},{path:"/launchers/knowledge",view:"chatKnowledge",title:"Chat Knowledge - Domma CMS"},{path:"/notes",view:"notes",title:"Notes - Domma CMS"},{path:"/todo",view:"todo",title:"Todo - Domma CMS"},{path:"/calculator",view:"calculator",title:"Calculator - Domma CMS"},{path:"/analytics",view:"analytics",title:"Analytics - Domma CMS"},{path:"/seo",view:"seo",title:"SEO - Domma CMS"},{path:"/seo/:tab",view:"seo",title:"SEO - Domma CMS"},{path:"/wordpress-import",view:"wordpressImport",title:"Import a site - Domma CMS"},{path:"/contacts",view:"contacts",title:"Contacts - Domma CMS"},{path:"/calls/new",view:"callNew",title:"Call now - Domma CMS"},{path:"/system/notifications",view:"notifications",title:"Notifications - Domma CMS"},{path:"/api-tokens",view:"apiTokens",title:"API Tokens - Domma CMS"},{path:"/api-endpoints",view:"apiEndpoints",title:"API Builder - Domma CMS"},{path:"/api-endpoints/new",view:"apiEndpointEditor",title:"New API Endpoint - Domma CMS"},{path:"/api-endpoints/edit/:id",view:"apiEndpointEditor",title:"Edit API Endpoint - Domma CMS"},{path:"/projects",view:"projects",title:"Projects - Domma CMS"},{path:"/projects/new",view:"projects",title:"New Project - Domma CMS"},{path:"/projects/edit/:slug",view:"projects",title:"Edit Project - Domma CMS"},{path:"/projects/:slug/settings",view:"projectSettings",title:"Project settings - Domma CMS"},{path:"/projects/:slug/pages",view:"pages",title:"Project pages - Domma CMS"},{path:"/projects/:slug/collections",view:"collections",title:"Project collections - Domma CMS"},{path:"/projects/:slug/forms",view:"forms",title:"Project forms - Domma CMS"},{path:"/projects/:slug/actions",view:"actionsList",title:"Project actions - Domma CMS"},{path:"/projects/:slug/menus",view:"menus",title:"Project menus - Domma CMS"},{path:"/projects/:slug/blocks",view:"blocks",title:"Project blocks - Domma CMS"},{path:"/projects/:slug/components",view:"components",title:"Project components - Domma CMS"},{path:"/projects/:slug/views",view:"viewsList",title:"Project views - Domma CMS"},{path:"/projects/:slug/roles",view:"roles",title:"Project roles - Domma CMS"},{path:"/projects/:slug/users",view:"users",title:"Project users - Domma CMS"},{path:"/projects/:slug/apis",view:"apiEndpoints",title:"Project APIs - Domma CMS"},{path:"/projects/:slug",view:"projectDetail",title:"Project - Domma CMS"},{path:"/login",view:"login",title:"Sign in - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}},{path:"/reset-password",view:"login",title:"Reset Password - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}}];M.subscribe("router:afterChange",async({to:t,from:i})=>{if(!y(t.path)){if($("#admin-sidebar").show(),$("#admin-topbar").show(),y(i?.path)){$("#topbar-user-name").remove(),import("./lib/admin-theme.js").then(o=>o.refreshAdminTheme(r)),await x();const e=await b(),a=N(t.path);if(a&&R.navigate(a),T(e),J.read().signInToasts)try{const o=await r.system.notifications.list().catch(()=>[]),n=(Array.isArray(o)?o:[]).filter(s=>s.unread&&["warning","critical"].includes(s.data?.severity)).slice(0,3);for(const s of n){const l=h(s.data?.title||""),O=h((s.data?.body||"").slice(0,120));E.toast(`${l} - ${O}`,{type:s.data?.severity==="critical"?"error":"warning",duration:0})}}catch{}}K()}}),M.subscribe("router:afterChange",()=>{setTimeout(()=>{$(".btn-primary, .btn-danger").length&&Domma.effects.reveal(".btn-primary, .btn-danger",{animation:"fade",stagger:40,duration:300})},50)});const Z=["#field-project","#menu-project","#collection-project","#endpoint-project","#action-project","#view-project","#block-project","#component-project","#role-project",'[name="project"]','[name="ownedByProject"]'];function tt(t){return/^\/(pages|menus|context-menus|collections|forms|actions|views|blocks|components|users|roles|api-endpoints)\/(new|edit\/)/.test(t)}M.subscribe("router:afterChange",({to:t})=>{const i=t?String(t.path).split("?")[0]:"";if(!t||!tt(i))return;const a=new URLSearchParams(location.hash.split("?")[1]||"").get("project");if(!a||!/\/new$/.test(i))return;let o=0;const n=60,s=1500,l=()=>{o+=n;for(const O of Z){const D=document.querySelector(O);if(!D)continue;if(Array.from(D.options||[]).find(at=>at.value===a)){D.value=a,D.dispatchEvent(new Event("change",{bubbles:!0}));return}}o<s&&setTimeout(l,n)};setTimeout(l,n)});const W="cms_card_states",U=S.get(W)||{};M.subscribe("router:afterChange",()=>{setTimeout(()=>{$("#view-container .card-collapsible").each(function(){const t=$(this).find(".card-header h2, .card-header h3").first().text().trim();t&&U[t]==="collapsed"&&$(this).addClass("card-collapsed")})},200)}),$("#view-container").on("click",".card-collapsible .card-header",function(t){if($(t.target).closest("button, a").length)return;const i=$(this).closest(".card");i.toggleClass("card-collapsed");const e=$(this).find("h2, h3").first().text().trim();e&&(U[e]=i.hasClass("card-collapsed")?"collapsed":"open",S.set(W,U))}),jt(),document.addEventListener("keydown",t=>{if(!(t.ctrlKey||t.metaKey)||t.key!=="s"||window.location.hash.startsWith("#/login")||window.location.hash.startsWith("#/reset-password"))return;const i=document.querySelector("#view-container .view-header button.btn-primary");i&&(t.preventDefault(),i.click())});const C=nt(),H=C.views,et={notes:{displayName:"Notes",icon:"edit-3"},todo:{displayName:"Todo",icon:"check-square"},calculator:{displayName:"Calculator",icon:"calculator"},analytics:{displayName:"Analytics",icon:"chart-bar"},seo:{displayName:"SEO",icon:"search"},wordpressImport:{displayName:"Import a site",icon:"download"},contacts:{displayName:"Contacts",icon:"users"},projects:{displayName:"Projects",icon:"folder"},pages:{displayName:"Pages",icon:"file-text"},media:{displayName:"Media",icon:"image"},menus:{displayName:"Site menus",icon:"menu"},contextMenus:{displayName:"Context Menus",icon:"menu"},launchers:{displayName:"Launchers",icon:"rocket"},theme:{displayName:"Theme",icon:"droplet"},collections:{displayName:"Collections",icon:"database"},forms:{displayName:"Forms",icon:"layout"},viewsList:{displayName:"Views",icon:"eye"},actionsList:{displayName:"Actions",icon:"zap"},apiEndpoints:{displayName:"API Builder",icon:"code"},blocks:{displayName:"Blocks",icon:"box"},components:{displayName:"Components",icon:"component"},notifications:{displayName:"Notifications",icon:"bell"},roles:{displayName:"Roles",icon:"shield"},users:{displayName:"Users",icon:"users"},appearance:{displayName:"Appearance",icon:"layout"},footer:{displayName:"Footer",icon:"panel-bottom"},settings:{displayName:"Site Settings",icon:"settings"},effects:{displayName:"Effects",icon:"sparkles"},layouts:{displayName:"Layouts",icon:"layout"},plugins:{displayName:"Marketplace",icon:"store"},myProfile:{displayName:"My Profile",icon:"user"},apiTokens:{displayName:"API Tokens",icon:"key"},search:{displayName:"Search",icon:"search"},contentApi:{displayName:"Content API",icon:"file-text"},chats:{displayName:"Chats",icon:"message-circle"},dashboard:{displayName:"Dashboard",icon:"home"},dashboards:{displayName:"Dashboards",icon:"home"},pageEditor:{displayName:"Pages",section:"Edit",icon:"file-text"},menuEditor:{displayName:"Site menus",section:"Edit",icon:"menu"},menuLocations:{displayName:"Site menus",section:"Locations",icon:"map-pin"},contextMenuEditor:{displayName:"Context Menus",section:"Edit",icon:"menu"},collectionEditor:{displayName:"Collections",section:"Edit",icon:"database"},collectionEntries:{displayName:"Collections",section:"Entries",icon:"database"},formEditor:{displayName:"Forms",section:"Edit",icon:"layout"},formSubmissions:{displayName:"Forms",section:"Submissions",icon:"inbox"},viewEditor:{displayName:"Views",section:"Edit",icon:"eye"},viewPreview:{displayName:"Views",section:"Preview",icon:"eye"},actionEditor:{displayName:"Actions",section:"Edit",icon:"zap"},apiEndpointEditor:{displayName:"API Builder",section:"Edit",icon:"code"},roleEditor:{displayName:"Roles",section:"Edit",icon:"shield"},userEditor:{displayName:"Users",section:"Edit",icon:"users"},projectDetail:{displayName:"Projects",section:"Overview",icon:"folder"},projectSettings:{displayName:"Projects",section:"Settings",icon:"folder"},pluginCode:{displayName:"Marketplace",section:"Code",icon:"code"},chatKnowledge:{displayName:"Chats",section:"Knowledge",icon:"book-open"}};for(const[t,i]of Object.entries(st))C.register(t,async()=>{let e=await i();const a=et[t];return a&&(e=q(e,{plugin:t,licence:"Built in",...a})),t==="dashboard"?Y(e):e});R.use(async(t,i,e)=>{try{await C.load(t.view)}catch(a){console.error("[admin] Screen failed to load",a),H[t.view]={template:'<p role="alert">This screen could not load. Reload the page to try again.</p>'}}e()});const L=[...X];async function x(){if(p())try{const t=await r.plugins.adminConfig(),i=new Set(L.map(e=>e.path));for(const e of t.routes||[])i.has(e.path)||L.push(e);for(const[e,a]of Object.entries(t.views||{})){const o=(t.meta||{})[e];C.register(e,async()=>{const s=(await import(`/plugins/${a.entry}`))[a.exportName];if(!s)throw new Error(`Missing plugin screen: ${e}`);const l=q(s,o);return e==="dashboard"?Y(l):l},JSON.stringify([a,o]))}for(const[e,{route:a}]of Object.entries(t.takeovers||{}))a&&(A[`/${e}`]=a);t.mediaPicker&&(globalThis[Symbol.for("domma.media-picker")]=t.mediaPicker);for(const[e,{enabled:a,displayName:o}]of Object.entries(t.tools||{}))a===!1&&(j[`/${e}`]=o);for(const{id:e,href:a}of t.css||[])if(!document.getElementById(e)){const o=document.createElement("link");o.id=e,o.rel="stylesheet",o.href=a,document.head.appendChild(o)}}catch{}}function K(){const t=V();if(!t)return;if($("#topbar-user-name").length){_(r);return}const e={"super-admin":"Super Admin",admin:"Admin",user:"User"}[t.role]||t.role,a=Dt(t);$("#topbar-user").get(0).innerHTML=`
|
|
2
2
|
<a id="topbar-project" class="topbar-action-link topbar-project" hidden>
|
|
3
3
|
<span data-icon="folder"></span>
|
|
4
4
|
<span id="topbar-project-name" class="topbar-project-name"></span>
|
|
@@ -51,4 +51,4 @@ import{wireNotificationMenu as tt}from"./lib/topbar-notifications.js";import{ins
|
|
|
51
51
|
</a>
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
|
-
`;const o=$("#topbar-settings").get(0);o&&(o.hidden=!v),$("#topbar-logout-btn").on("click",n=>{n.preventDefault(),
|
|
54
|
+
`;const o=$("#topbar-settings").get(0);o&&(o.hidden=!v),$("#topbar-logout-btn").on("click",n=>{n.preventDefault(),rt()}),Domma.icons.scan("#admin-topbar"),E.tooltip("#topbar-actions [data-tooltip]",{placement:"bottom"}),gt(t),it({refreshBadge:F,canRead:()=>w!==!1,own:()=>!u}),yt(t),z(),wt(),_(r),F(),g||(g=setInterval(F,3e4))}function h(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}let g=null,B=null;async function F(){if(!(!p()||w===!1))try{const{count:t}=await r.system.notifications.unreadCount(),i=$("#topbar-bell-badge");t>0?i.text(t>99?"99+":String(t)).removeAttr("hidden"):i.attr("hidden","").text("");const e=J.read().chatToasts&&t>0&&(B===null||t>B);if(B=t,t>0&&(G()||e)){const a=await r.system.notifications.list().catch(()=>[]);G()&&St(a),e&&Mt(a)}}catch{}}(async()=>{if(!p()&&!window.location.hash.startsWith("#/reset-password"))window.location.hash.startsWith("#/login")||(window.location.hash=mt(window.location.hash));else{ct(V()?.id);const a=V(),[o]=await Promise.all([a?b():Promise.resolve([]),x()]);if(a){const n=(window.location.hash||"#/").slice(1)||"/",s=N(n);s&&(window.location.hash=`#${s}`),T(o).catch(l=>console.error("[admin] Sidebar failed to load",l)),K()}}const t=R._extractParams.bind(R);R._extractParams=function(a,o){const n=o.indexOf("?");if(n!==-1&&(o=o.slice(0,n)),a.endsWith("/*")){const s=a.slice(0,-2);return o.startsWith(s+"/")?{}:null}return t(a,o)};const i=R._renderNotFound.bind(R);let e="";R._renderNotFound=async function(a){return p()&&e!==a&&(e=a,await x(),R._matchRoute(a).route)?(e="",R._handleRouteChange()):(e="",p()&&$("#admin-sidebar").get(0)?.style.display==="none"?(E.toast("That link goes nowhere - here is your home page.",{type:"warning"}),R.navigate("/")):i(a))},kt(R),R.init({container:"#view-container",routes:L,views:H,default:"/",transitions:{enter:"fadeIn",leave:"fadeOut",duration:150}})})()});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{api as
|
|
1
|
+
import{api as I,getUser as x,isAuthenticated as k}from"../api.js";import{onceClosed as T}from"./tool-kit.js";import{mountCharacter as H}from"/public/js/character-view.mjs?v=20261111-remy-character";export function installAdminAssistant(){let v=null,u=0,w=0,s=null,t=null,i=null,h=null;const l=M.observable([]),g=M.observable(""),m=M.observable(!1),d=M.observable(""),A=()=>location.hash.slice(1).split("?")[0]||"/",C=()=>/^#\/(login|reset-password)(\?|\/|$)/.test(location.hash);function p(){u++,i?.element?.querySelector(".admin-assistant-panel")?.replaceChildren(),i?.close(!0),i=null,h?.destroy(),h=null,t?.remove(),t=null,l.value=[],g.value="",m.value=!1,d.value=""}async function $(){const a=g.peek().trim();if(!a||a.length>1e3||m.peek())return;const n=v,e=u,o=l.peek().slice(-10).map(c=>({from:c.from,text:c.text.slice(0,1e3)}));g.value="",d.value="",m.value=!0,l.value=[...l.peek(),{from:"visitor",text:a}].slice(-30);try{const c=await I.post("/admin-assistant/ask",{question:a,history:o,route:A()});if(u!==e||x()?.id!==n||!k())return;l.value=[...l.peek(),{from:"bot",text:c.answer}].slice(-30)}catch(c){u===e&&x()?.id===n&&(d.value=c.message||"Could not get an answer.")}finally{u===e&&(m.value=!1)}}function N(){if(!s?.enabled||!t)return;if(i){i.open();return}const a=s.name.replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r]),n=E.slideover({title:`Ask ${a}`,size:"md",position:"right"}),e=document.createElement("div");e.className="admin-assistant-panel",e.innerHTML=`<p class="text-muted">Help and drafts for the current tool. You choose what to copy and save.</p>
|
|
2
2
|
<div class="admin-assistant-messages" role="log" aria-live="polite" aria-label="Assistant conversation"></div>
|
|
3
3
|
<p role="status" data-bind-hidden="!busy.value">Thinking...</p>
|
|
4
4
|
<p class="text-danger" role="alert" data-bind-text="error.value"></p>
|
|
@@ -6,4 +6,4 @@ import{api as $,getUser as x,isAuthenticated as k}from"../api.js";import{onceClo
|
|
|
6
6
|
<textarea id="admin-assistant-question" class="form-input" maxlength="1000" rows="3" data-model="question.value" placeholder="Ask for help or a draft..."></textarea>
|
|
7
7
|
<div class="admin-assistant-actions"><button type="submit" class="btn btn-primary" data-bind-disabled="busy.value">Ask</button>
|
|
8
8
|
<button type="button" class="btn btn-secondary" data-on-click="reset" data-bind-disabled="busy.value">Clear conversation</button></div></form>
|
|
9
|
-
<small class="text-muted">Questions are sent to the site's AI service. Current page records are not attached automatically.</small>`;const o=e.querySelector('[role="log"]'),c=M.effect(()=>{o.replaceChildren();for(const r of l.value){const y=document.createElement("article");y.className=`admin-assistant-message is-${r.from}`;const q=document.createElement("strong");q.textContent=r.from==="visitor"?"You":s.name;const L=document.createElement("p");if(L.textContent=r.text,y.append(q,L),r.from==="bot"){const b=document.createElement("button");b.type="button",b.className="btn btn-sm btn-secondary",b.textContent="Copy",b.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(r.text),E.toast("Copied.",{type:"success"})}catch{E.toast("Select the text to copy it.",{type:"info"})}}),y.append(b)}o.append(y)}o.scrollTop=o.scrollHeight});e.querySelector("form").addEventListener("submit",r=>{r.preventDefault()
|
|
9
|
+
<small class="text-muted">Questions are sent to the site's AI service. Current page records are not attached automatically.</small>`;const o=e.querySelector('[role="log"]'),c=M.effect(()=>{o.replaceChildren();for(const r of l.value){const y=document.createElement("article");y.className=`admin-assistant-message is-${r.from}`;const q=document.createElement("strong");q.textContent=r.from==="visitor"?"You":s.name;const L=document.createElement("p");if(L.textContent=r.text,y.append(q,L),r.from==="bot"){const b=document.createElement("button");b.type="button",b.className="btn btn-sm btn-secondary",b.textContent="Copy",b.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(r.text),E.toast("Copied.",{type:"success"})}catch{E.toast("Select the text to copy it.",{type:"info"})}}),y.append(b)}o.append(y)}o.scrollTop=o.scrollHeight});e.querySelector("form").addEventListener("submit",r=>{r.preventDefault(),$()});const S=M.applyBindings({question:g,busy:m,error:d},e,{methods:{reset:()=>{l.value=[],d.value=""}}});n.element.append(e),i=n,T(n,()=>{S.dispose(),c(),i===n&&(i=null)}),s.available||(d.value="AI answers need AI Assist (in the Pro plan) on this site."),n.open()}async function f(){const a=k()&&!C()?x()?.id:null;if(a!==v&&(p(),v=a),!a)return;const n=++w;try{const e=await I.get(`/admin-assistant/config?route=${encodeURIComponent(A())}`);if(n!==w||a!==x()?.id||!k()||C())return;if(!e.enabled){p(),s=null;return}s&&(s.name!==e.name||s.character!==e.character)&&p(),s=e,t||(t=document.createElement("button"),t.type="button",t.className="admin-assistant-trigger",t.addEventListener("click",async()=>{await f(),N()}),document.body.append(t)),t.replaceChildren(),h?.destroy(),e.character&&(h=H(t,{id:e.character,portrait:!0,animated:e.animated}));const o=document.createElement("span");o.textContent=`Ask ${e.name}`,t.append(o),t.setAttribute("aria-label",`Ask ${e.name}`)}catch{n===w&&(p(),s=null)}}M.subscribe("router:afterChange",f),window.addEventListener("admin-assistant:settings",f),window.addEventListener("storage",f),window.addEventListener("hashchange",()=>{C()&&(p(),v=null)}),f()}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{chatToastsDue as u,rememberSeen as h}from"./notifications-arrange.js";const c="notifications.chatToastSeen",d="#/launchers/chats";function f(){try{const t=S.get(c);return Array.isArray(t)?t:null}catch{return null}}function y(t){try{S.set(c,t)}catch{}}export function deliverChatToasts(t,{enabled:s=!0}={}){const r=f(),o=s?u(t,{seen:r}):[];for(const e of o){const n=e.data||{},a=n.source==="core:chat"&&n.severity==="warning",l=String(n.body||"").split(`
|
|
2
|
+
`).filter(Boolean)[0]||"";E.toast(l.slice(0,200),{title:String(n.title||"Visitor chat"),type:a?"warning":"info",duration:a?0:15e3,closable:!0,actions:[{label:"Open Chats",primary:!0,closeOnClick:!0,onClick:()=>{location.hash=d}}]})}const i=(t||[]).filter(e=>e?.unread&&String(e.data?.source||"").startsWith("core:chat")).map(e=>e.id);return y(h(r||[],i)),o.length}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fmtDate as s}from"./dates.js";export const SEVERITIES=["critical","warning","info","success"],FILTERS=["all","new",...SEVERITIES],SEVERITY_TONE={critical:"danger",warning:"warn",success:"ok",info:"info"};const
|
|
1
|
+
import{fmtDate as s}from"./dates.js";export const SEVERITIES=["critical","warning","info","success"],FILTERS=["all","new",...SEVERITIES],SEVERITY_TONE={critical:"danger",warning:"warn",success:"ok",info:"info"};const c=(t,e,n=`${e}s`)=>`${t} ${t===1?e:n}`;export function severityOf(t){const e=t?.data?.severity;return SEVERITIES.includes(e)?e:"info"}export function ago(t,e=Date.now()){const n=new Date(t).getTime();if(!Number.isFinite(n))return"";const r=Math.max(0,Math.round((e-n)/1e3));return r<60?"just now":r<3600?`${Math.round(r/60)} min ago`:r<86400?`${c(Math.round(r/3600),"hour")} ago`:r<86400*14?`${c(Math.round(r/86400),"day")} ago`:s(n)}export function arrangeNotifications(t,{filter:e="all",query:n=""}={}){const r=String(n).trim().toLowerCase();return[...t||[]].filter(i=>e==="all"?!0:e==="new"?i.isNew:severityOf(i)===e).filter(i=>!r||[i.data?.title,i.data?.body,i.data?.link].some(o=>String(o||"").toLowerCase().includes(r))).sort((i,o)=>String(o.data?.createdAt||"").localeCompare(String(i.data?.createdAt||"")))}export function filterCounts(t){const e={all:0,new:0,critical:0,warning:0,info:0,success:0};for(const n of t||[])e.all++,n.isNew&&e.new++,e[severityOf(n)]++;return e}export function safeLink(t){const e=String(t||"").trim();return/^https?:\/\/\S+$/i.test(e)||/^#\/\S*$/.test(e)?e:""}export function sourceLabel(t={}){return t.source==="manager"?"from the manager":t.source==="sample"?"sample":t.sourceLabel?String(t.sourceLabel):t.source?String(t.source).startsWith("core:")?"System":String(t.source).split(":")[0]:""}export function notificationRow(t,{now:e=Date.now(),expanded:n=""}={}){const r=t?.data||{},i=severityOf(t),o=String(r.body||""),a=o.replace(/\s+/g," ").trim();return{id:String(t.id),title:String(r.title||"(no title)"),severity:i,severityLabel:i[0].toUpperCase()+i.slice(1),tone:SEVERITY_TONE[i],meta:[r.createdAt?ago(r.createdAt,e):"",sourceLabel(r),/^https?:\/\//i.test(String(r.link||""))?"has a link":"",r.expiresAt&&Date.parse(r.expiresAt)>e?`until ${s(r.expiresAt)}`:""].filter(Boolean).join(" \xB7 "),preview:a.length>140?`${a.slice(0,139)}\u2026`:a,body:o,link:safeLink(r.link),linkTarget:/^#\//.test(safeLink(r.link))?"_self":"_blank",linkText:/^#\//.test(safeLink(r.link))?"Go there \u2192":"Open link \u2197",isNew:!!t.isNew,unread:!!t.unread,open:n===String(t.id),rowCls:[t.unread?"is-unread":"",n===String(t.id)?"is-open":"",`is-${i}`].filter(Boolean).join(" ")}}const l={boot:"at start-up","15m":"every 15 minutes",hourly:"hourly",daily:"daily at 08:00"};export function sourceRow(t,e=Date.now()){const n=t.every?`${l[t.every]||t.every}${t.atBoot&&t.every!=="boot"?" and at start-up":""}`:"as it happens";return{id:String(t.id),label:String(t.label||t.id),description:String(t.description||""),meta:[t.ownerLabel||t.owner,n,t.lastRun?`last run ${ago(t.lastRun,e)}`:""].filter(Boolean).join(" \xB7 "),enabled:!!t.enabled,audience:t.audience||"super-admin",every:t.every||"",lastError:t.lastError?`Last run failed: ${t.lastError}`:""}}export const DESKTOP_LEVELS=["all","warning","critical"],DEFAULT_SETTINGS=Object.freeze({desktop:!1,desktopLevel:"all",signInToasts:!0,chatToasts:!0});export function normaliseSettings(t){const e=t&&typeof t=="object"?t:{},n=DEFAULT_SETTINGS;return{desktop:typeof e.desktop=="boolean"?e.desktop:n.desktop,desktopLevel:DESKTOP_LEVELS.includes(e.desktopLevel)?e.desktopLevel:n.desktopLevel,signInToasts:typeof e.signInToasts=="boolean"?e.signInToasts:n.signInToasts,chatToasts:typeof e.chatToasts=="boolean"?e.chatToasts:n.chatToasts}}export function meetsLevel(t,e="all"){return e==="critical"?t==="critical":e==="warning"?t==="critical"||t==="warning":!0}export function desktopWorthy(t,{seen:e=[],level:n="all",max:r=3}={}){const i=new Set((e||[]).map(String));return[...t||[]].filter(o=>o&&o.unread&&!i.has(String(o.id))&&meetsLevel(severityOf(o),n)).sort((o,a)=>String(o.data?.createdAt||"").localeCompare(String(a.data?.createdAt||""))).slice(-r)}export const CHAT_SOURCES=Object.freeze(["core:chat","core:chat-started","core:chat-declined"]),CHAT_TOAST_RECENT_MS=10*6e4;export function chatToastsDue(t,{seen:e=null,now:n=Date.now(),max:r=3}={}){const i=new Set((e||[]).map(String));return[...t||[]].filter(o=>o&&o.unread&&CHAT_SOURCES.includes(o.data?.source)&&!i.has(String(o.id))).filter(o=>e||n-Date.parse(o.data?.createdAt||0)<CHAT_TOAST_RECENT_MS).sort((o,a)=>String(o.data?.createdAt||"").localeCompare(String(a.data?.createdAt||""))).slice(-r)}export function rememberSeen(t,e,n=200){const r=[...(t||[]).map(String)];for(const i of e||[])r.includes(String(i))||r.push(String(i));return r.slice(-n)}export function desktopPayload(t){const e=t?.data||{},n=severityOf(t),r=String(e.body||"").replace(/\s+/g," ").trim();return{title:String(e.title||"Notification").slice(0,120),options:{body:r.length>240?`${r.slice(0,239)}\u2026`:r,tag:`dcms-notification-${t?.id}`,requireInteraction:n==="critical"}}}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
A <strong>bot</strong> answers first, straight away, from what you have taught it in the <strong>Knowledge</strong>.
|
|
12
12
|
When it cannot help, or the visitor asks for a person, the chat comes to you in <strong>Content > Chats</strong>.
|
|
13
13
|
When nobody is available, the visitor leaves their name and email instead, so nobody is left waiting. The bot is
|
|
14
|
-
called <strong>Della</strong> to begin with (rename her per launcher). With the Pro plan on a hosted site, Della
|
|
14
|
+
called <strong>Della</strong> to begin with (rename her per launcher). With <strong>AI Assist</strong> (in the Pro plan) on a hosted site, Della
|
|
15
15
|
can also answer, with AI, the questions your Knowledge does not cover - see <a href="#della-ai">AI answers</a>.</p>
|
|
16
16
|
|
|
17
17
|
<h3>Setting it up</h3>
|
|
@@ -76,7 +76,11 @@
|
|
|
76
76
|
<ul>
|
|
77
77
|
<li><strong>Available for chats</strong> - on while this screen is open. That is what tells the bot someone can
|
|
78
78
|
take a chat. Leave the screen or switch it off and, when nobody else is available, visitors are asked for
|
|
79
|
-
their details instead.
|
|
79
|
+
their details instead. Admins get a notification when a visitor starts a chat, asks for a person or leaves a
|
|
80
|
+
message, and when the AI turns a question down. Each can be switched off, or sent to other people, in
|
|
81
|
+
<strong>Notifications</strong> settings (Visitor chat started, Visitor chat, Chat question turned down).
|
|
82
|
+
While the admin is open, each also pops up as a message with an <strong>Open Chats</strong> button, within
|
|
83
|
+
30 seconds; turn <strong>Chat pop-ups</strong> off in the Notifications settings cog for this browser.</li>
|
|
80
84
|
<li>Click a chat to read it; type a reply and press <kbd>Ctrl</kbd>+<kbd>Enter</kbd> (or Send). Once you reply,
|
|
81
85
|
the bot stays quiet in that chat. You can also reply to a chat the bot is handling.</li>
|
|
82
86
|
<li>Right-click a chat (or its ⋮) to <strong>email the visitor</strong>, copy their address, open the page they
|
|
@@ -87,7 +91,8 @@
|
|
|
87
91
|
how long ended chats are kept (90 days to begin with), and how many new chats the whole site takes in an hour
|
|
88
92
|
(300 to begin with; each visitor can start at most 6 an hour and send 120 messages).</p>
|
|
89
93
|
|
|
90
|
-
<h3 id="della-ai">AI answers (Pro plan, hosted sites)</h3>
|
|
94
|
+
<h3 id="della-ai">AI answers (AI Assist, in the Pro plan, hosted sites)</h3>
|
|
95
|
+
<p>AI answers come with the <strong>AI Assist</strong> Tool, part of the Pro plan. It also powers admin launchers and the admin assistant. Without it every chat answers from the Knowledge alone, and the launcher editor says so under <strong>AI answers</strong>.</p>
|
|
91
96
|
<p>When nothing in the Knowledge fits a question, Della asks Claude (Anthropic's AI). Claude answers only from what
|
|
92
97
|
you have given it and says it does not know rather than guess - then the chat goes on as before ("Sorry, I do not
|
|
93
98
|
know" and the offer of a person). What Claude is given with each question:</p>
|
|
@@ -106,7 +111,9 @@
|
|
|
106
111
|
</ul>
|
|
107
112
|
<p>Switch it off per launcher with <strong>AI answers what the Knowledge does not</strong>. Questions the AI answered
|
|
108
113
|
still go on the Unanswered list, so you can turn the common ones into Knowledge; in the inbox an AI answer is
|
|
109
|
-
marked "Answered by AI".
|
|
114
|
+
marked "Answered by AI". When the AI turns a question down (off-topic, or something your rules forbid, such as
|
|
115
|
+
medical advice), the visitor gets a polite reply and admins get a <strong>Chat question turned down</strong>
|
|
116
|
+
notification with the question. Visitors see a line under the chat saying Della is an AI assistant. What you write in the
|
|
110
117
|
context and rules is sent to Claude with each question, so leave out anything private. Each site has 2,000 AI
|
|
111
118
|
answers a month; past that the bot answers from the Knowledge alone until the next month.</p>
|
|
112
119
|
|