UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

2 lines (1 loc) • 5.5 kB
import{c as u,a as x,dZ as A,a6 as _,i as P,ao as $,K as g,an as S,q as y,e as p}from"./index-ztdGKvBm.js";import{D as I,o as N,a as w}from"./schema-Bb-DbvPZ.js";import{r as M}from"./task-board-i6qU2BVR.js";const C={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},G={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function R(t,e){return{queryKey:g.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...C,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(7),{org:n}=_();let s;e[0]!==n.id||e[1]!==n.slug?(s=R(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],P(i)}function E(){const t=u.c(9),{org:e}=_(),n=S(),s=y();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(g.organizationSettings(e.id),r=>({...r??C,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],p(i)}function z(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:G}function K(){const{data:t}=d(D);return t??G}function D(t){return z(t.simple_mode)}function V(){const t=u.c(7),e=E();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function Y(){return m("reports_only")}function m(t){const e=u.c(5);let n;e[0]!==t?(n=a=>N(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??I.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function J(t){const e=u.c(6);let n;e[0]!==t?(n=i=>N(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=d(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?I.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function W(){const t=m("chat_harness_sandbox_only");return A().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=_(),n=S(),s=y();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(g.organizationSettings(e.id),c=>c&&{...c,flags:{...c.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],p(i)}function X(){const{data:t}=d(L);return t??null}function L(t){return t.plan_objective??null}function tt(){const t=u.c(8),{org:e}=_(),n=S(),s=y();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_PLAN_OBJECTIVE_SET",l),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{plan_objective:r}=l;s.setQueryData(g.organizationSettings(e.id),c=>c&&{...c,plan_objective:r})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],p(i)}function et(){const t=u.c(2),e=S();let n;return t[0]!==e?(n={mutationFn:()=>e.call("ORGANIZATION_PLAN_OBJECTIVE_FIND",{})},t[0]=e,t[1]=n):n=t[1],p(n)}function j(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function nt(){const t=u.c(8),{data:e}=x.useSession(),n=A();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||j(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=m("hosting_enabled"),r=m("e2e_enabled"),c=m("monitor_enabled"),F=m("experiments_enabled"),O=o||a||l,b=o||a||r,T=o||i||c,h=o||a||F;let f;return t[3]!==O||t[4]!==b||t[5]!==T||t[6]!==h?(f={hosting:O,e2e:b,monitor:T,experiments:h},t[3]=O,t[4]=b,t[5]=T,t[6]=h,t[7]=f):f=t[7],f}function st(){const{data:t}=d(q);return t??!1}function q(t){return w(t.flags)}function ot(){const{data:t}=d(v);return t??!0}function v(t){return M(t.flags)}function at(){const t=u.c(7),e=E();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function it(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.coding_agent_mcp_excluded}function lt(){const t=u.c(5),e=E();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function ut(){const t=u.c(2),{data:e}=d(k);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function k(t){return t.submodule_credentials}function rt(){const t=u.c(5),e=E();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{Y as a,W as b,J as c,K as d,nt as e,ot as f,X as g,tt as h,et as i,H as j,st as k,at as l,it as m,lt as n,V as o,ut as p,rt as q,m as u};