@rizom/brain 0.2.0-alpha.354 → 0.2.0-alpha.355
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/dist/brain.js +37 -37
- package/dist/chunks/{app-m9hjd2pg.js → app-c5pdekt0.js} +2 -2
- package/dist/chunks/{blog-post-adapter-bqm9vrja.js → blog-post-adapter-njnq5kyv.js} +2 -2
- package/dist/chunks/{index-dqe1320c.js → index-6ckkrggy.js} +3 -3
- package/dist/chunks/{index-dqe1320c.js.map → index-6ckkrggy.js.map} +1 -1
- package/dist/chunks/{index-4x71s1h0.js → index-bjmmrp5q.js} +3 -3
- package/dist/chunks/{index-4x71s1h0.js.map → index-bjmmrp5q.js.map} +3 -3
- package/dist/chunks/{index-qpztpfw8.js → index-e2scq3d5.js} +2 -2
- package/dist/chunks/{index-d6q3sk2w.js → index-p49nmsdm.js} +2 -2
- package/dist/chunks/{index-d6q3sk2w.js.map → index-p49nmsdm.js.map} +2 -2
- package/dist/chunks/{index-6m5e8k9d.js → index-v3xvnwsn.js} +2 -2
- package/dist/chunks/{index-4mr9k51y.js → index-w5e9n75h.js} +3 -3
- package/dist/chunks/{index-4mr9k51y.js.map → index-w5e9n75h.js.map} +3 -3
- package/dist/chunks/{linkedin-template-d4av3dpq.js → linkedin-template-2yn0zvz4.js} +2 -2
- package/dist/chunks/{rss-datasource-5vhyhygh.js → rss-datasource-6drt6y87.js} +2 -2
- package/dist/entities.js +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces.js +1 -1
- package/dist/model.js +38 -38
- package/dist/model.js.map +13 -13
- package/dist/plugins.js +1 -1
- package/dist/services.js +1 -1
- package/dist/ui/studio-app.js +3 -3
- package/dist/ui/studio-app.js.map +3 -3
- package/dist/ui/studio-asset-manifest.json +4 -4
- package/dist/ui/studio-chunks/{main-x38k1kej.js → main-8g7rwpye.js} +5 -9
- package/dist/ui/studio-chunks/{main-x38k1kej.js.map → main-8g7rwpye.js.map} +3 -3
- package/dist/ui/studio-chunks/{studio-chat-workspace-a7km8rss.js → studio-chat-workspace-z9973dz1.js} +1 -1
- package/package.json +1 -1
- package/templates/deploy/scripts/create-predeploy-backup.ts +11 -1
- /package/dist/chunks/{app-m9hjd2pg.js.map → app-c5pdekt0.js.map} +0 -0
- /package/dist/chunks/{blog-post-adapter-bqm9vrja.js.map → blog-post-adapter-njnq5kyv.js.map} +0 -0
- /package/dist/chunks/{index-qpztpfw8.js.map → index-e2scq3d5.js.map} +0 -0
- /package/dist/chunks/{index-6m5e8k9d.js.map → index-v3xvnwsn.js.map} +0 -0
- /package/dist/chunks/{linkedin-template-d4av3dpq.js.map → linkedin-template-2yn0zvz4.js.map} +0 -0
- /package/dist/chunks/{rss-datasource-5vhyhygh.js.map → rss-datasource-6drt6y87.js.map} +0 -0
- /package/dist/ui/studio-chunks/{studio-chat-workspace-a7km8rss.js.map → studio-chat-workspace-z9973dz1.js.map} +0 -0
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"studio-chunks/account-view-9nxfz348.js.map": "studio-chunks/account-view-9nxfz348.js.map",
|
|
9
9
|
"studio-chunks/highlighted-body-OFNGDK62-agftc3h0.js": "studio-chunks/highlighted-body-OFNGDK62-agftc3h0.js",
|
|
10
10
|
"studio-chunks/highlighted-body-OFNGDK62-agftc3h0.js.map": "studio-chunks/highlighted-body-OFNGDK62-agftc3h0.js.map",
|
|
11
|
+
"studio-chunks/main-8g7rwpye.js": "studio-chunks/main-8g7rwpye.js",
|
|
12
|
+
"studio-chunks/main-8g7rwpye.js.map": "studio-chunks/main-8g7rwpye.js.map",
|
|
11
13
|
"studio-chunks/main-cv5ngmvq.js": "studio-chunks/main-cv5ngmvq.js",
|
|
12
14
|
"studio-chunks/main-cv5ngmvq.js.map": "studio-chunks/main-cv5ngmvq.js.map",
|
|
13
15
|
"studio-chunks/main-mv52cpdf.js": "studio-chunks/main-mv52cpdf.js",
|
|
@@ -16,11 +18,9 @@
|
|
|
16
18
|
"studio-chunks/main-rjtgxw09.js.map": "studio-chunks/main-rjtgxw09.js.map",
|
|
17
19
|
"studio-chunks/main-vrdekcfb.js": "studio-chunks/main-vrdekcfb.js",
|
|
18
20
|
"studio-chunks/main-vrdekcfb.js.map": "studio-chunks/main-vrdekcfb.js.map",
|
|
19
|
-
"studio-chunks/main-x38k1kej.js": "studio-chunks/main-x38k1kej.js",
|
|
20
|
-
"studio-chunks/main-x38k1kej.js.map": "studio-chunks/main-x38k1kej.js.map",
|
|
21
21
|
"studio-chunks/mermaid-GHXKKRXX-htpm26t0.js": "studio-chunks/mermaid-GHXKKRXX-htpm26t0.js",
|
|
22
22
|
"studio-chunks/mermaid-GHXKKRXX-htpm26t0.js.map": "studio-chunks/mermaid-GHXKKRXX-htpm26t0.js.map",
|
|
23
|
-
"studio-chunks/studio-chat-workspace-
|
|
24
|
-
"studio-chunks/studio-chat-workspace-
|
|
23
|
+
"studio-chunks/studio-chat-workspace-z9973dz1.js": "studio-chunks/studio-chat-workspace-z9973dz1.js",
|
|
24
|
+
"studio-chunks/studio-chat-workspace-z9973dz1.js.map": "studio-chunks/studio-chat-workspace-z9973dz1.js.map"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -833,7 +833,7 @@ import{Aa as Li,Ba as Gr,Ca as wi,Fa as _i,Ga as Si,ia as ee,ja as Mo,la as tt,m
|
|
|
833
833
|
background: transparent;
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
`;function yt(e){let t=e.startsWith("/")?e:`/${e}`;return t==="/"?"":t.replace(/\/+$/,"")}function gi(e,t){return`${yt(e)}/entities/${encodeURIComponent(t)}`}function Tv(e,t,o){return`${gi(e,t)}/${encodeURIComponent(o)}`}function Iv(e,t){let o=new URL(gi(e,t),"https://brains.invalid");return o.searchParams.set("mode","create"),`${o.pathname}${o.search}`}function vt(e,t){return`${yt(e)}/workspaces/${encodeURIComponent(t)}`}function Mv(e,t){let o=yt(t);if(e===(o||"/"))return{kind:"home"};let n=o===""?"":o;if(n!==""&&!e.startsWith(`${n}/`))return{kind:"not-found",pathname:e};let s=e.slice(n.length);try{let i=/^\/entities\/([^/]+)$/.exec(s);if(i?.[1])return{kind:"collection",entityType:decodeURIComponent(i[1])};let a=/^\/entities\/([^/]+)\/(.+)$/.exec(s);if(a?.[1]&&a[2]&&!s.endsWith("/"))return{kind:"entity",entityType:decodeURIComponent(a[1]),id:decodeURIComponent(a[2])};let c=/^\/workspaces\/([^/]+)$/.exec(s);if(c?.[1])return{kind:"workspace",workspaceId:decodeURIComponent(c[1])}}catch{}return{kind:"not-found",pathname:e}}var To="studio:account",Dv="StudioAccountWorkspace";var yi="studio:overview";var Io="/studio";function vi(){return Io}function Qv(e,t,o,r){for(let n of r){let s=n.aliases?.find((p)=>p.id===t);if(!s)continue;let i=new URLSearchParams(o);for(let[p,l]of Object.entries(s.query))i.set(p,l);i.sort();let a=i.toString(),c=vt(e,n.id);return a?`${c}?${a}`:c}return}function Wv(e,t,o){let r=yt(e)||"/",n=o.find((i)=>i.id===yi);if(n)return vt(r,n.id);let s=o.find((i)=>i.id===To);if(t.length===0&&s)return vt(r,s.id);return r}function Kv(e,t,o){Io=yt(e)||"/";let r=Wr({...t?{component:t,notFoundComponent:t}:{}}),n=pe({getParentRoute:()=>r,path:mi.slice(1)}),s=Io==="/"?(()=>{let i=pe({getParentRoute:()=>r,path:"/"}),a=pe({getParentRoute:()=>r,path:"entities/$entityType"}),c=pe({getParentRoute:()=>r,path:"entities/$entityType/$"}),p=pe({getParentRoute:()=>r,path:"workspaces/$workspaceId"});return r.addChildren([i,a,c,p,n])})():(()=>{let i=pe({getParentRoute:()=>r,path:Io.slice(1)}),a=pe({getParentRoute:()=>i,path:"/"}),c=pe({getParentRoute:()=>i,path:"entities/$entityType"}),p=pe({getParentRoute:()=>i,path:"entities/$entityType/$"}),l=pe({getParentRoute:()=>i,path:"workspaces/$workspaceId"});return r.addChildren([i.addChildren([a,c,p,l]),n])})();return Kr({routeTree:s,...o?{history:o}:{}})}var Ei=E(L(),1);function Hv(e,t){return e.runWorkspaceAction(t.workspaceId,{actionId:t.action.actionId,input:t.action.input,...t.action.invocation?.mode==="prepare"?{mode:"prepare"}:t.action.invocation?.mode==="execute"?{mode:"execute",confirmationToken:t.action.invocation.token}:{}})}function bi(e,t){return e.uploadFile(t)}function Vv(e,t){return e.deleteEntity(t.entityType,t.id)}function qv(e,t){let o=t.body===void 0?{}:{body:t.body};if(t.kind==="create")return e.createEntity({entityType:t.entityType,frontmatter:t.frontmatter,...o});return e.updateEntity({entityType:t.entityType,id:t.id,frontmatter:t.frontmatter,baseContentHash:t.baseContentHash,...o})}var fe={all:()=>["studio"],navigation:()=>["studio","navigation"],workspaceScope:(e)=>["studio","workspace",e],workspace:(e,t={})=>["studio","workspace",e,t],agentTargets:(e,t)=>["studio","agent-targets",e,t],syncStatus:()=>["studio","sync-status"],schema:(e)=>["studio","schema",e],entities:(e)=>["studio","entities",e],entity:(e,t)=>["studio","entity",e,t]};function Jv(e){return{queryKey:fe.navigation(),queryFn:()=>e.fetchNavigation()}}function Xv(e,t,o={}){return{queryKey:fe.workspace(t,o),queryFn:()=>e.fetchWorkspace(t,o),placeholderData:Wo,staleTime:15000}}async function Zv(e,t){await Promise.all([e.invalidateQueries({queryKey:fe.workspaceScope(t)}),e.invalidateQueries({queryKey:fe.navigation()})])}async function xi(e){await Promise.all([e.invalidateQueries({queryKey:fe.entities("image")}),e.invalidateQueries({queryKey:fe.navigation()}),e.invalidateQueries({queryKey:fe.syncStatus()})])}function eb(e,t,o){return{queryKey:fe.agentTargets(t,o),queryFn:()=>e.fetchAgentTargets(t,o)}}function tb(e){return{queryKey:fe.syncStatus(),queryFn:()=>e.fetchSyncStatus()}}function ob(e,t){return{queryKey:fe.schema(t),queryFn:()=>e.fetchSchema(t),staleTime:Number.POSITIVE_INFINITY}}function rb(e,t){return{queryKey:fe.entities(t),queryFn:()=>e.fetchEntities(t)}}function nb(e,t,o){return{queryKey:fe.entity(t,o),queryFn:()=>e.fetchEntity(t,o),staleTime:Number.POSITIVE_INFINITY}}var jr=E(L(),1);function cb(e){let t=e.frontmatter.title;return typeof t==="string"&&t.length>0?t:e.id}function lb(e){let t={};for(let o of e)if(o.default!==void 0)t[o.name]=o.default;return t}function Ri(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e.slice(0,16);return new Date(t.getTime()-t.getTimezoneOffset()*60000).toISOString().slice(0,16)}function ub(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return"";let o=Date.now()-t.getTime(),r=Math.max(0,Math.floor(o/60000));if(r<60)return`${Math.max(1,r)} minutes ago`;let n=Math.floor(r/60);if(n<24)return`${n} ${n===1?"hour":"hours"} ago`;let s=Math.floor(n/24);if(s===1)return"yesterday";if(s<14)return`${s} days ago`;return t.toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function db(e){if(e.frontmatter.status==="published")return"published";return e.frontmatter.published===!0?"published":"draft"}function pb(e){return e.endsWith("s")?e.slice(0,-1):e}function Pi(e){if(e instanceof wi&&e.issues.length>0)return e.issues.map((t)=>`${t.path.join(".")}: ${t.message}`).join("; ");return Si(e)}var w=E(Mo(),1),Za=new Set(["project","projects","series","topic","topics"]),ec=new Set(["profile","settings","site-info","siteInfo"]),tc=new Set(["agent","agents","anchor-profile","brain-character","playbook","playbooks","prompt","prompts","skill","skills","swot","swots"]);function oc(e){if(ec.has(e))return"Site";if(tc.has(e))return"System";if(Za.has(e))return"Collections";return"Content"}function wb(e){return e.some((t)=>t.name==="status"||t.name==="published")}function rc(e,t){if(!e.condition)return!0;let o=e.condition.value,r=t[e.condition.field];return Array.isArray(o)?o.some((n)=>n===r):o===r}function Sb(e,t){let o=new Set(e.filter((r)=>!rc(r,t)).map((r)=>r.name));return Object.fromEntries(Object.entries(t).filter(([r])=>!o.has(r)))}var Bt="type:",Ut="workspace:";function nc(e){if(e.startsWith(Bt)){let t=e.slice(Bt.length);return t.length>0?{kind:"type",id:t}:null}if(e.startsWith(Ut)){let t=e.slice(Ut.length);return t.length>0?{kind:"workspace",id:t}:null}return null}function Oi(e){let t=e.workspaces?.find((u)=>u.id==="studio:overview"),o=e.workspaces?.filter((u)=>u.id!=="studio:overview")??[],r=["Content","Collections","Site","System"].map((u)=>({label:u,types:e.types.filter((h)=>oc(h.entityType)===u)})).filter((u)=>u.types.length>0),n=r.filter((u)=>u.label==="Content"||u.label==="Collections"),s=r.filter((u)=>u.label==="Site"||u.label==="System"),i=(u)=>u.isSingleton?u.label:`${u.label} · ${u.count}`,a=(u)=>{let h=e.workspaceBadges?.[u.id]??0;return h>0?`${u.label} · ${h}`:u.label},c=[...t?[{label:"Home",options:[{value:`${Ut}${t.id}`,label:a(t)}]}]:[],...n.map((u)=>({label:u.label,options:u.types.map((h)=>({value:`${Bt}${h.entityType}`,label:i(h)}))})),...o.length>0?[{label:"Operations",options:o.map((u)=>({value:`${Ut}${u.id}`,label:a(u)}))}]:[],...s.map((u)=>({label:u.label,options:u.types.map((h)=>({value:`${Bt}${h.entityType}`,label:i(h)}))}))],p=e.active?`${Bt}${e.active}`:e.activeWorkspace?`${Ut}${e.activeWorkspace}`:"",l=c.flatMap((u)=>u.options).find((u)=>u.value===p)?.label,d=(u)=>{let h=nc(u);if(h?.kind==="type"){e.onSelect(h.id);return}if(h?.kind==="workspace")e.onSelectWorkspace?.(h.id)},f=(u)=>w.jsxDEV("section",{className:"rail-group",children:[w.jsxDEV("div",{className:"rail-title",children:u.label},void 0,!1,void 0,this),w.jsxDEV("ul",{children:u.types.map((h)=>w.jsxDEV("li",{children:w.jsxDEV("button",{type:"button",className:h.entityType===e.active?"type active":"type",onClick:()=>e.onSelect(h.entityType),children:[h.label,h.isSingleton?w.jsxDEV("span",{className:"singleton-mark",children:"solo"},void 0,!1,void 0,this):w.jsxDEV("span",{className:"count",children:h.count},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},h.entityType,!1,void 0,this))},void 0,!1,void 0,this)]},u.label,!0,void 0,this);return w.jsxDEV(w.Fragment,{children:[e.renderMode!=="desktop"?w.jsxDEV(ee.Root,{value:p,onValueChange:d,children:[w.jsxDEV(ee.Trigger,{className:"studio-mobile-switcher","aria-label":"Studio view",children:[w.jsxDEV("span",{className:"studio-mobile-switcher-label",children:"Browse"},void 0,!1,void 0,this),w.jsxDEV(ee.Value,{placeholder:"Choose a Studio view",children:w.jsxDEV("span",{className:"studio-mobile-switcher-value",children:l},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.jsxDEV(ee.Icon,{className:"studio-mobile-switcher-chevron","aria-hidden":"true",children:"↓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV(ee.Portal,{children:w.jsxDEV(ee.Content,{className:"studio-mobile-switcher-content",position:"popper",sideOffset:6,align:"start",children:[w.jsxDEV(ee.ScrollUpButton,{className:"studio-mobile-switcher-scroll",children:"↑"},void 0,!1,void 0,this),w.jsxDEV(ee.Viewport,{className:"studio-mobile-switcher-viewport",children:c.map((u)=>w.jsxDEV(ee.Group,{className:"studio-mobile-switcher-group",children:[w.jsxDEV(ee.Label,{className:"studio-mobile-switcher-group-label",children:u.label},void 0,!1,void 0,this),u.options.map((h)=>w.jsxDEV(ee.Item,{className:"studio-mobile-switcher-item",value:h.value,children:[w.jsxDEV(ee.ItemText,{children:h.label},void 0,!1,void 0,this),w.jsxDEV(ee.ItemIndicator,{className:"studio-mobile-switcher-indicator",children:"✓"},void 0,!1,void 0,this)]},h.value,!0,void 0,this))]},`mobile:${u.label}`,!0,void 0,this))},void 0,!1,void 0,this),w.jsxDEV(ee.ScrollDownButton,{className:"studio-mobile-switcher-scroll",children:"↓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,e.renderMode!=="mobile"?w.jsxDEV("nav",{className:"types",children:[t&&w.jsxDEV("section",{className:"rail-group rail-group--overview",children:w.jsxDEV("ul",{children:w.jsxDEV("li",{children:w.jsxDEV("button",{type:"button",className:t.id===e.activeWorkspace?"type workspace-type active":"type workspace-type",onClick:()=>e.onSelectWorkspace?.(t.id),children:[t.label,(e.workspaceBadges?.[t.id]??0)>0&&w.jsxDEV("span",{className:"count count--attention",children:e.workspaceBadges?.[t.id]},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),n.map(f),o.length>0&&w.jsxDEV("section",{className:"rail-group rail-group--operations",children:[w.jsxDEV("div",{className:"rail-title",children:"Operations"},void 0,!1,void 0,this),w.jsxDEV("ul",{children:o.map((u)=>w.jsxDEV("li",{children:w.jsxDEV("button",{type:"button",className:u.id===e.activeWorkspace?"type workspace-type active":"type workspace-type",onClick:()=>e.onSelectWorkspace?.(u.id),children:[u.label,(e.workspaceBadges?.[u.id]??0)>0&&w.jsxDEV("span",{className:"count count--attention",children:e.workspaceBadges?.[u.id]},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},u.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.map(f)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function sc(e){let{descriptor:t,value:o,onChange:r}=e,n=je(),s=_i(),i=Xo({mutationFn:(c)=>bi(s,c)}),a=typeof o==="string"&&o.length>0?o:null;return w.jsxDEV("div",{className:"field field-image",children:[w.jsxDEV("span",{className:"field-label",children:[t.label,w.jsxDEV("em",{className:"kind",children:"image entity"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a&&w.jsxDEV("p",{className:"image-ref",children:[w.jsxDEV("code",{children:a},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",variant:"link",size:"xs",onClick:()=>r(""),children:"Clear"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("label",{className:"upload-zone",children:[w.jsxDEV("span",{className:"upload-glyph","aria-hidden":"true",children:"↑"},void 0,!1,void 0,this),w.jsxDEV("strong",{children:"Choose an image"},void 0,!1,void 0,this),w.jsxDEV("small",{children:"PNG, JPEG, GIF, WebP, AVIF, or SVG"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"file",accept:"image/*",onChange:(c)=>{let p=c.currentTarget.files?.[0];if(!p)return;i.mutate(p,{onSuccess:(l)=>{r(l.entityId),xi(n)}})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i.isPending&&w.jsxDEV("p",{className:"status",children:"Uploading…"},void 0,!1,void 0,this),i.error&&w.jsxDEV("p",{className:"status status-error",children:Pi(i.error)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ic(e){let[t,o]=Ei.useState(""),r=Array.isArray(e.value)?e.value.filter((s)=>typeof s==="string"):[],n=()=>{let s=t.trim();if(s&&!r.includes(s))e.onChange([...r,s]);o("")};return w.jsxDEV("div",{className:"field field-tags",children:[w.jsxDEV("span",{className:"field-label",children:[e.descriptor.label,w.jsxDEV("em",{className:"kind",children:"tags"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"tags",children:[r.map((s)=>w.jsxDEV("span",{className:"tag",children:[s,w.jsxDEV(tt,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove ${s}`,onClick:()=>e.onChange(r.filter((i)=>i!==s)),children:"×"},void 0,!1,void 0,this)]},s,!0,void 0,this)),w.jsxDEV("span",{className:"tag tag-add",children:[w.jsxDEV(Vr,{type:"text",value:t,"aria-label":`Add ${e.descriptor.label.toLowerCase()} tag`,placeholder:"Add tag",onChange:(s)=>o(s.currentTarget.value),onKeyDown:(s)=>{if(s.key==="Enter"||s.key===",")s.preventDefault(),n()}},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",variant:"ghost",size:"icon-xs","aria-label":"Add tag",onClick:n,children:"+"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function ac(e){if(e.widget==="text")return"summarise";if(e.widget==="list"&&e.field?.widget==="string")return"tag-suggest";return null}function Rb(e){let{descriptor:t,state:o,onRun:r,onApply:n,onDiscard:s}=e,i=ac(t);if(!i)return null;let a="field"in o&&o.field===t.name;if(a&&o.kind==="suggested")return w.jsxDEV("div",{className:"field-assist-suggestion",children:[Array.isArray(o.suggestion)?w.jsxDEV("span",{className:"field-assist-tags",children:o.suggestion.map((c)=>w.jsxDEV("code",{children:c},c,!1,void 0,this))},void 0,!1,void 0,this):w.jsxDEV("span",{className:"field-assist-copy",children:o.suggestion},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",size:"xs",onClick:()=>n(o.field,o.suggestion),children:"Apply"},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",variant:"ghost",size:"xs",onClick:s,children:"Discard"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return w.jsxDEV("div",{className:"field-assist-controls",children:[w.jsxDEV(tt,{type:"button",variant:"outline",size:"xs",disabled:a&&o.kind==="loading",onClick:()=>r(i,t.name),children:a&&o.kind==="loading"?"Thinking…":i==="summarise"?"Summarise body":`Suggest ${t.label.toLowerCase()}`},void 0,!1,void 0,this),a&&o.kind==="error"&&w.jsxDEV("span",{className:"status status-error",children:o.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Pb(e){let{descriptor:t,value:o,onChange:r}=e,n=t.required!==!1,s=typeof o==="string"||typeof o==="number"?String(o):"",i=w.jsxDEV("span",{className:"field-label",children:[t.label,n?w.jsxDEV("em",{className:"req",children:"required"},void 0,!1,void 0,this):w.jsxDEV("em",{className:"kind",children:t.widget},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="image")return w.jsxDEV(sc,{descriptor:t,value:o,onChange:r},void 0,!1,void 0,this);if(t.widget==="boolean")return w.jsxDEV("label",{className:"field field-inline",children:[w.jsxDEV("span",{className:"field-label",children:t.label},void 0,!1,void 0,this),w.jsxDEV(Ci,{checked:o===!0,onCheckedChange:(a)=>r(a)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="select")return w.jsxDEV("label",{className:"field",children:[i,w.jsxDEV(ki,{value:s,required:n,onChange:(a)=>r(a.currentTarget.value),children:[w.jsxDEV("option",{value:"",children:"—"},void 0,!1,void 0,this),(t.options??[]).map((a)=>w.jsxDEV("option",{value:a,children:a},a,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="text")return w.jsxDEV("label",{className:"field",children:[i,w.jsxDEV(Hr,{value:s,required:n,rows:4,onChange:(a)=>r(a.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="list"&&t.field?.widget==="string")return w.jsxDEV(ic,{descriptor:t,value:o,onChange:r},void 0,!1,void 0,this);if(t.widget==="list"||t.widget==="object")return w.jsxDEV("label",{className:"field",children:[w.jsxDEV("span",{className:"field-label",children:[t.label,w.jsxDEV("em",{className:"kind",children:"read-only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV(Hr,{value:JSON.stringify(o??null,null,2),disabled:!0,rows:4},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return w.jsxDEV("label",{className:"field",children:[i,w.jsxDEV(Vr,{type:t.widget==="number"?"number":t.widget==="datetime"?"datetime-local":"text",value:t.widget==="datetime"?Ri(s):s,required:n,onChange:(a)=>r(t.widget==="datetime"&&a.currentTarget.value?new Date(a.currentTarget.value).toISOString():a.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var M=E(Mo(),1);function $t(e,t){if(typeof document>"u")return t;return document.querySelector("[data-studio-root]")?.getAttribute(e)??t}function cc(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function qr(e){window.location.assign(e)}function Ib(e){let t=vi(),o=$t("data-studio-brand-name","Brain"),r=$t("data-studio-principal-name","Your account"),n=$t("data-studio-principal-role","trusted"),s=$t("data-studio-session-href",`/logout?return_to=${encodeURIComponent(t)}`),i=$t("data-studio-dashboard-href","/dashboard"),a=vt(t,To);return M.jsxDEV("header",{className:"studio-chrome","aria-label":"Studio",children:[M.jsxDEV("a",{className:"studio-chrome-brand",href:t,children:[M.jsxDEV("span",{className:"studio-chrome-mark","aria-hidden":"true",children:o.slice(0,1).toUpperCase()},void 0,!1,void 0,this),M.jsxDEV("span",{className:"studio-chrome-brain",children:o},void 0,!1,void 0,this),M.jsxDEV("span",{className:"studio-chrome-slash","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),M.jsxDEV("strong",{children:"Studio"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.navigation?M.jsxDEV("div",{className:"studio-chrome-mobile-navigation",children:M.jsxDEV(Oi,{renderMode:"mobile",types:e.navigation.types,active:e.navigation.activeEntityType,onSelect:e.navigation.selectEntityType,workspaces:e.navigation.workspaces,activeWorkspace:e.navigation.activeWorkspaceId,workspaceBadges:e.navigation.workspaceBadges,onSelectWorkspace:e.navigation.selectWorkspace},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,M.jsxDEV("div",{className:"studio-chrome-location",children:[M.jsxDEV("span",{children:"Workspace"},void 0,!1,void 0,this),e.onContextClick?M.jsxDEV("button",{type:"button",onClick:e.onContextClick,children:["← ",e.contextLabel]},void 0,!0,void 0,this):M.jsxDEV("strong",{children:e.contextLabel},void 0,!1,void 0,this),e.contextBadge!==void 0&&e.contextBadge>0?M.jsxDEV("b",{children:e.contextBadge},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"studio-chrome-tools",children:[M.jsxDEV("button",{className:"command-chip studio-chrome-command",type:"button","aria-label":"Search or run a command",children:[M.jsxDEV("span",{className:"command-chip-hint",children:"Search or run a command…"},void 0,!1,void 0,this),M.jsxDEV("kbd",{children:"⌘K"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"command-chip-icon","aria-hidden":"true",children:"⌕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("button",{id:"climateToggle",className:"climate-chip studio-chrome-climate",type:"button","aria-label":"Toggle climate",children:"◐"},void 0,!1,void 0,this),M.jsxDEV(Ti,{children:[M.jsxDEV(Ii,{asChild:!0,children:M.jsxDEV("button",{className:"studio-chrome-identity",type:"button","aria-label":`${r} account menu`,children:cc(r)},void 0,!1,void 0,this)},void 0,!1,void 0,this),M.jsxDEV(Mi,{className:"studio-chrome-identity-menu",align:"end",sideOffset:8,children:[M.jsxDEV(Li,{className:"studio-chrome-identity-label",children:[M.jsxDEV("strong",{children:r},void 0,!1,void 0,this),M.jsxDEV("span",{children:n},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV(Gr,{},void 0,!1,void 0,this),M.jsxDEV(Lo,{onSelect:()=>qr(a),children:["Account",M.jsxDEV("span",{"aria-hidden":"true",children:"→"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV(Lo,{onSelect:()=>qr(i),children:["View public dashboard",M.jsxDEV("span",{"aria-hidden":"true",children:"↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV(Gr,{},void 0,!1,void 0,this),M.jsxDEV(Lo,{variant:"destructive",onSelect:()=>qr(s),children:["Sign out",M.jsxDEV("span",{"aria-hidden":"true",children:"⇥"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Db=`.studio-chrome {
|
|
836
|
+
`;function yt(e){let t=e.startsWith("/")?e:`/${e}`;return t==="/"?"":t.replace(/\/+$/,"")}function gi(e,t){return`${yt(e)}/entities/${encodeURIComponent(t)}`}function Tv(e,t,o){return`${gi(e,t)}/${encodeURIComponent(o)}`}function Iv(e,t){let o=new URL(gi(e,t),"https://brains.invalid");return o.searchParams.set("mode","create"),`${o.pathname}${o.search}`}function vt(e,t){return`${yt(e)}/workspaces/${encodeURIComponent(t)}`}function Mv(e,t){let o=yt(t);if(e===(o||"/"))return{kind:"home"};let n=o===""?"":o;if(n!==""&&!e.startsWith(`${n}/`))return{kind:"not-found",pathname:e};let s=e.slice(n.length);try{let i=/^\/entities\/([^/]+)$/.exec(s);if(i?.[1])return{kind:"collection",entityType:decodeURIComponent(i[1])};let a=/^\/entities\/([^/]+)\/(.+)$/.exec(s);if(a?.[1]&&a[2]&&!s.endsWith("/"))return{kind:"entity",entityType:decodeURIComponent(a[1]),id:decodeURIComponent(a[2])};let c=/^\/workspaces\/([^/]+)$/.exec(s);if(c?.[1])return{kind:"workspace",workspaceId:decodeURIComponent(c[1])}}catch{}return{kind:"not-found",pathname:e}}var To="studio:account",Dv="StudioAccountWorkspace";var yi="studio:overview";var Io="/studio";function vi(){return Io}function Qv(e,t,o,r){for(let n of r){let s=n.aliases?.find((p)=>p.id===t);if(!s)continue;let i=new URLSearchParams(o);for(let[p,l]of Object.entries(s.query))i.set(p,l);i.sort();let a=i.toString(),c=vt(e,n.id);return a?`${c}?${a}`:c}return}function Wv(e,t,o){let r=yt(e)||"/",n=o.find((i)=>i.id===yi);if(n)return vt(r,n.id);let s=o.find((i)=>i.id===To);if(t.length===0&&s)return vt(r,s.id);return r}function Kv(e,t,o){Io=yt(e)||"/";let r=Wr({...t?{component:t,notFoundComponent:t}:{}}),n=pe({getParentRoute:()=>r,path:mi.slice(1)}),s=Io==="/"?(()=>{let i=pe({getParentRoute:()=>r,path:"/"}),a=pe({getParentRoute:()=>r,path:"entities/$entityType"}),c=pe({getParentRoute:()=>r,path:"entities/$entityType/$"}),p=pe({getParentRoute:()=>r,path:"workspaces/$workspaceId"});return r.addChildren([i,a,c,p,n])})():(()=>{let i=pe({getParentRoute:()=>r,path:Io.slice(1)}),a=pe({getParentRoute:()=>i,path:"/"}),c=pe({getParentRoute:()=>i,path:"entities/$entityType"}),p=pe({getParentRoute:()=>i,path:"entities/$entityType/$"}),l=pe({getParentRoute:()=>i,path:"workspaces/$workspaceId"});return r.addChildren([i.addChildren([a,c,p,l]),n])})();return Kr({routeTree:s,...o?{history:o}:{}})}var Ei=E(L(),1);function Hv(e,t){return e.runWorkspaceAction(t.workspaceId,{actionId:t.action.actionId,input:t.action.input,...t.action.invocation?.mode==="prepare"?{mode:"prepare"}:t.action.invocation?.mode==="execute"?{mode:"execute",confirmationToken:t.action.invocation.token}:{}})}function bi(e,t){return e.uploadFile(t)}function Vv(e,t){return e.deleteEntity(t.entityType,t.id)}function qv(e,t){let o=t.body===void 0?{}:{body:t.body};if(t.kind==="create")return e.createEntity({entityType:t.entityType,frontmatter:t.frontmatter,...o});return e.updateEntity({entityType:t.entityType,id:t.id,frontmatter:t.frontmatter,baseContentHash:t.baseContentHash,...o})}var fe={all:()=>["studio"],navigation:()=>["studio","navigation"],workspaceScope:(e)=>["studio","workspace",e],workspace:(e,t={})=>["studio","workspace",e,t],agentTargets:(e,t)=>["studio","agent-targets",e,t],syncStatus:()=>["studio","sync-status"],schema:(e)=>["studio","schema",e],entities:(e)=>["studio","entities",e],entity:(e,t)=>["studio","entity",e,t]};function Jv(e){return{queryKey:fe.navigation(),queryFn:()=>e.fetchNavigation()}}function Xv(e,t,o={}){return{queryKey:fe.workspace(t,o),queryFn:()=>e.fetchWorkspace(t,o),placeholderData:Wo,staleTime:15000}}async function Zv(e,t){await Promise.all([e.invalidateQueries({queryKey:fe.workspaceScope(t)}),e.invalidateQueries({queryKey:fe.navigation()})])}async function xi(e){await Promise.all([e.invalidateQueries({queryKey:fe.entities("image")}),e.invalidateQueries({queryKey:fe.navigation()}),e.invalidateQueries({queryKey:fe.syncStatus()})])}function eb(e,t,o){return{queryKey:fe.agentTargets(t,o),queryFn:()=>e.fetchAgentTargets(t,o)}}function tb(e){return{queryKey:fe.syncStatus(),queryFn:()=>e.fetchSyncStatus()}}function ob(e,t){return{queryKey:fe.schema(t),queryFn:()=>e.fetchSchema(t),staleTime:Number.POSITIVE_INFINITY}}function rb(e,t){return{queryKey:fe.entities(t),queryFn:()=>e.fetchEntities(t)}}function nb(e,t,o){return{queryKey:fe.entity(t,o),queryFn:()=>e.fetchEntity(t,o),staleTime:Number.POSITIVE_INFINITY}}var jr=E(L(),1);function cb(e){let t=e.frontmatter.title;return typeof t==="string"&&t.length>0?t:e.id}function lb(e){let t={};for(let o of e)if(o.default!==void 0)t[o.name]=o.default;return t}function Ri(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e.slice(0,16);return new Date(t.getTime()-t.getTimezoneOffset()*60000).toISOString().slice(0,16)}function ub(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return"";let o=Date.now()-t.getTime(),r=Math.max(0,Math.floor(o/60000));if(r<60)return`${Math.max(1,r)} minutes ago`;let n=Math.floor(r/60);if(n<24)return`${n} ${n===1?"hour":"hours"} ago`;let s=Math.floor(n/24);if(s===1)return"yesterday";if(s<14)return`${s} days ago`;return t.toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function db(e){if(e.frontmatter.status==="published")return"published";return e.frontmatter.published===!0?"published":"draft"}function pb(e){return e.endsWith("s")?e.slice(0,-1):e}function Pi(e){if(e instanceof wi&&e.issues.length>0)return e.issues.map((t)=>`${t.path.join(".")}: ${t.message}`).join("; ");return Si(e)}var w=E(Mo(),1),Za=new Set(["project","projects","series","topic","topics"]),ec=new Set(["profile","settings","site-info","siteInfo"]),tc=new Set(["agent","agents","anchor-profile","brain-character","playbook","playbooks","prompt","prompts","skill","skills","style-guide","swot","swots"]);function oc(e){if(ec.has(e))return"Site";if(tc.has(e))return"System";if(Za.has(e))return"Collections";return"Content"}function wb(e){return e.some((t)=>t.name==="status"||t.name==="published")}function rc(e,t){if(!e.condition)return!0;let o=e.condition.value,r=t[e.condition.field];return Array.isArray(o)?o.some((n)=>n===r):o===r}function Sb(e,t){let o=new Set(e.filter((r)=>!rc(r,t)).map((r)=>r.name));return Object.fromEntries(Object.entries(t).filter(([r])=>!o.has(r)))}var Bt="type:",Ut="workspace:";function nc(e){if(e.startsWith(Bt)){let t=e.slice(Bt.length);return t.length>0?{kind:"type",id:t}:null}if(e.startsWith(Ut)){let t=e.slice(Ut.length);return t.length>0?{kind:"workspace",id:t}:null}return null}function Oi(e){let t=e.workspaces?.find((u)=>u.id==="studio:overview"),o=e.workspaces?.filter((u)=>u.id!=="studio:overview")??[],r=["Content","Collections","Site","System"].map((u)=>({label:u,types:e.types.filter((h)=>oc(h.entityType)===u)})).filter((u)=>u.types.length>0),n=r.filter((u)=>u.label==="Content"||u.label==="Collections"),s=r.filter((u)=>u.label==="Site"||u.label==="System"),i=(u)=>u.isSingleton?u.label:`${u.label} · ${u.count}`,a=(u)=>{let h=e.workspaceBadges?.[u.id]??0;return h>0?`${u.label} · ${h}`:u.label},c=[...t?[{label:"Home",options:[{value:`${Ut}${t.id}`,label:a(t)}]}]:[],...n.map((u)=>({label:u.label,options:u.types.map((h)=>({value:`${Bt}${h.entityType}`,label:i(h)}))})),...o.length>0?[{label:"Operations",options:o.map((u)=>({value:`${Ut}${u.id}`,label:a(u)}))}]:[],...s.map((u)=>({label:u.label,options:u.types.map((h)=>({value:`${Bt}${h.entityType}`,label:i(h)}))}))],p=e.active?`${Bt}${e.active}`:e.activeWorkspace?`${Ut}${e.activeWorkspace}`:"",l=c.flatMap((u)=>u.options).find((u)=>u.value===p)?.label,d=(u)=>{let h=nc(u);if(h?.kind==="type"){e.onSelect(h.id);return}if(h?.kind==="workspace")e.onSelectWorkspace?.(h.id)},f=(u)=>w.jsxDEV("section",{className:"rail-group",children:[w.jsxDEV("div",{className:"rail-title",children:u.label},void 0,!1,void 0,this),w.jsxDEV("ul",{children:u.types.map((h)=>w.jsxDEV("li",{children:w.jsxDEV("button",{type:"button",className:h.entityType===e.active?"type active":"type",onClick:()=>e.onSelect(h.entityType),children:[h.label,h.isSingleton?w.jsxDEV("span",{className:"singleton-mark",children:"solo"},void 0,!1,void 0,this):w.jsxDEV("span",{className:"count",children:h.count},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},h.entityType,!1,void 0,this))},void 0,!1,void 0,this)]},u.label,!0,void 0,this);return w.jsxDEV(w.Fragment,{children:[e.renderMode!=="desktop"?w.jsxDEV(ee.Root,{value:p,onValueChange:d,children:[w.jsxDEV(ee.Trigger,{className:"studio-mobile-switcher","aria-label":"Studio view",children:[w.jsxDEV("span",{className:"studio-mobile-switcher-label",children:"Browse"},void 0,!1,void 0,this),w.jsxDEV(ee.Value,{placeholder:"Choose a Studio view",children:w.jsxDEV("span",{className:"studio-mobile-switcher-value",children:l},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.jsxDEV(ee.Icon,{className:"studio-mobile-switcher-chevron","aria-hidden":"true",children:"↓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV(ee.Portal,{children:w.jsxDEV(ee.Content,{className:"studio-mobile-switcher-content",position:"popper",sideOffset:6,align:"start",children:[w.jsxDEV(ee.ScrollUpButton,{className:"studio-mobile-switcher-scroll",children:"↑"},void 0,!1,void 0,this),w.jsxDEV(ee.Viewport,{className:"studio-mobile-switcher-viewport",children:c.map((u)=>w.jsxDEV(ee.Group,{className:"studio-mobile-switcher-group",children:[w.jsxDEV(ee.Label,{className:"studio-mobile-switcher-group-label",children:u.label},void 0,!1,void 0,this),u.options.map((h)=>w.jsxDEV(ee.Item,{className:"studio-mobile-switcher-item",value:h.value,children:[w.jsxDEV(ee.ItemText,{children:h.label},void 0,!1,void 0,this),w.jsxDEV(ee.ItemIndicator,{className:"studio-mobile-switcher-indicator",children:"✓"},void 0,!1,void 0,this)]},h.value,!0,void 0,this))]},`mobile:${u.label}`,!0,void 0,this))},void 0,!1,void 0,this),w.jsxDEV(ee.ScrollDownButton,{className:"studio-mobile-switcher-scroll",children:"↓"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,e.renderMode!=="mobile"?w.jsxDEV("nav",{className:"types",children:[t&&w.jsxDEV("section",{className:"rail-group rail-group--overview",children:w.jsxDEV("ul",{children:w.jsxDEV("li",{children:w.jsxDEV("button",{type:"button",className:t.id===e.activeWorkspace?"type workspace-type active":"type workspace-type",onClick:()=>e.onSelectWorkspace?.(t.id),children:[t.label,(e.workspaceBadges?.[t.id]??0)>0&&w.jsxDEV("span",{className:"count count--attention",children:e.workspaceBadges?.[t.id]},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),n.map(f),o.length>0&&w.jsxDEV("section",{className:"rail-group rail-group--operations",children:[w.jsxDEV("div",{className:"rail-title",children:"Operations"},void 0,!1,void 0,this),w.jsxDEV("ul",{children:o.map((u)=>w.jsxDEV("li",{children:w.jsxDEV("button",{type:"button",className:u.id===e.activeWorkspace?"type workspace-type active":"type workspace-type",onClick:()=>e.onSelectWorkspace?.(u.id),children:[u.label,(e.workspaceBadges?.[u.id]??0)>0&&w.jsxDEV("span",{className:"count count--attention",children:e.workspaceBadges?.[u.id]},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},u.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.map(f)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function sc(e){let{descriptor:t,value:o,onChange:r}=e,n=je(),s=_i(),i=Xo({mutationFn:(c)=>bi(s,c)}),a=typeof o==="string"&&o.length>0?o:null;return w.jsxDEV("div",{className:"field field-image",children:[w.jsxDEV("span",{className:"field-label",children:[t.label,w.jsxDEV("em",{className:"kind",children:"image entity"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a&&w.jsxDEV("p",{className:"image-ref",children:[w.jsxDEV("code",{children:a},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",variant:"link",size:"xs",onClick:()=>r(""),children:"Clear"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("label",{className:"upload-zone",children:[w.jsxDEV("span",{className:"upload-glyph","aria-hidden":"true",children:"↑"},void 0,!1,void 0,this),w.jsxDEV("strong",{children:"Choose an image"},void 0,!1,void 0,this),w.jsxDEV("small",{children:"PNG, JPEG, GIF, WebP, AVIF, or SVG"},void 0,!1,void 0,this),w.jsxDEV("input",{type:"file",accept:"image/*",onChange:(c)=>{let p=c.currentTarget.files?.[0];if(!p)return;i.mutate(p,{onSuccess:(l)=>{r(l.entityId),xi(n)}})}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i.isPending&&w.jsxDEV("p",{className:"status",children:"Uploading…"},void 0,!1,void 0,this),i.error&&w.jsxDEV("p",{className:"status status-error",children:Pi(i.error)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ic(e){let[t,o]=Ei.useState(""),r=Array.isArray(e.value)?e.value.filter((s)=>typeof s==="string"):[],n=()=>{let s=t.trim();if(s&&!r.includes(s))e.onChange([...r,s]);o("")};return w.jsxDEV("div",{className:"field field-tags",children:[w.jsxDEV("span",{className:"field-label",children:[e.descriptor.label,w.jsxDEV("em",{className:"kind",children:"tags"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV("div",{className:"tags",children:[r.map((s)=>w.jsxDEV("span",{className:"tag",children:[s,w.jsxDEV(tt,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove ${s}`,onClick:()=>e.onChange(r.filter((i)=>i!==s)),children:"×"},void 0,!1,void 0,this)]},s,!0,void 0,this)),w.jsxDEV("span",{className:"tag tag-add",children:[w.jsxDEV(Vr,{type:"text",value:t,"aria-label":`Add ${e.descriptor.label.toLowerCase()} tag`,placeholder:"Add tag",onChange:(s)=>o(s.currentTarget.value),onKeyDown:(s)=>{if(s.key==="Enter"||s.key===",")s.preventDefault(),n()}},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",variant:"ghost",size:"icon-xs","aria-label":"Add tag",onClick:n,children:"+"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function ac(e){if(e.widget==="text")return"summarise";if(e.widget==="list"&&e.field?.widget==="string")return"tag-suggest";return null}function Rb(e){let{descriptor:t,state:o,onRun:r,onApply:n,onDiscard:s}=e,i=ac(t);if(!i)return null;let a="field"in o&&o.field===t.name;if(a&&o.kind==="suggested")return w.jsxDEV("div",{className:"field-assist-suggestion",children:[Array.isArray(o.suggestion)?w.jsxDEV("span",{className:"field-assist-tags",children:o.suggestion.map((c)=>w.jsxDEV("code",{children:c},c,!1,void 0,this))},void 0,!1,void 0,this):w.jsxDEV("span",{className:"field-assist-copy",children:o.suggestion},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",size:"xs",onClick:()=>n(o.field,o.suggestion),children:"Apply"},void 0,!1,void 0,this),w.jsxDEV(tt,{type:"button",variant:"ghost",size:"xs",onClick:s,children:"Discard"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return w.jsxDEV("div",{className:"field-assist-controls",children:[w.jsxDEV(tt,{type:"button",variant:"outline",size:"xs",disabled:a&&o.kind==="loading",onClick:()=>r(i,t.name),children:a&&o.kind==="loading"?"Thinking…":i==="summarise"?"Summarise body":`Suggest ${t.label.toLowerCase()}`},void 0,!1,void 0,this),a&&o.kind==="error"&&w.jsxDEV("span",{className:"status status-error",children:o.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Pb(e){let{descriptor:t,value:o,onChange:r}=e,n=t.required!==!1,s=typeof o==="string"||typeof o==="number"?String(o):"",i=w.jsxDEV("span",{className:"field-label",children:[t.label,n?w.jsxDEV("em",{className:"req",children:"required"},void 0,!1,void 0,this):w.jsxDEV("em",{className:"kind",children:t.widget},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="image")return w.jsxDEV(sc,{descriptor:t,value:o,onChange:r},void 0,!1,void 0,this);if(t.widget==="boolean")return w.jsxDEV("label",{className:"field field-inline",children:[w.jsxDEV("span",{className:"field-label",children:t.label},void 0,!1,void 0,this),w.jsxDEV(Ci,{checked:o===!0,onCheckedChange:(a)=>r(a)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="select")return w.jsxDEV("label",{className:"field",children:[i,w.jsxDEV(ki,{value:s,required:n,onChange:(a)=>r(a.currentTarget.value),children:[w.jsxDEV("option",{value:"",children:"—"},void 0,!1,void 0,this),(t.options??[]).map((a)=>w.jsxDEV("option",{value:a,children:a},a,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="text")return w.jsxDEV("label",{className:"field",children:[i,w.jsxDEV(Hr,{value:s,required:n,rows:4,onChange:(a)=>r(a.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="list"&&t.field?.widget==="string")return w.jsxDEV(ic,{descriptor:t,value:o,onChange:r},void 0,!1,void 0,this);if(t.widget==="list"||t.widget==="object")return w.jsxDEV("label",{className:"field",children:[w.jsxDEV("span",{className:"field-label",children:[t.label,w.jsxDEV("em",{className:"kind",children:"read-only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.jsxDEV(Hr,{value:JSON.stringify(o??null,null,2),disabled:!0,rows:4},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return w.jsxDEV("label",{className:"field",children:[i,w.jsxDEV(Vr,{type:t.widget==="number"?"number":t.widget==="datetime"?"datetime-local":"text",value:t.widget==="datetime"?Ri(s):s,required:n,onChange:(a)=>r(t.widget==="datetime"&&a.currentTarget.value?new Date(a.currentTarget.value).toISOString():a.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var M=E(Mo(),1);function $t(e,t){if(typeof document>"u")return t;return document.querySelector("[data-studio-root]")?.getAttribute(e)??t}function cc(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map((t)=>t.slice(0,1).toUpperCase()).join("")}function qr(e){window.location.assign(e)}function Ib(e){let t=vi(),o=$t("data-studio-brand-name","Brain"),r=$t("data-studio-principal-name","Your account"),n=$t("data-studio-principal-role","trusted"),s=$t("data-studio-session-href",`/logout?return_to=${encodeURIComponent(t)}`),i=$t("data-studio-dashboard-href","/dashboard"),a=vt(t,To);return M.jsxDEV("header",{className:"studio-chrome","aria-label":"Studio",children:[M.jsxDEV("a",{className:"studio-chrome-brand",href:t,children:[M.jsxDEV("span",{className:"studio-chrome-mark","aria-hidden":"true",children:o.slice(0,1).toUpperCase()},void 0,!1,void 0,this),M.jsxDEV("span",{className:"studio-chrome-brain",children:o},void 0,!1,void 0,this),M.jsxDEV("span",{className:"studio-chrome-slash","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),M.jsxDEV("strong",{children:"Studio"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.navigation?M.jsxDEV("div",{className:"studio-chrome-mobile-navigation",children:M.jsxDEV(Oi,{renderMode:"mobile",types:e.navigation.types,active:e.navigation.activeEntityType,onSelect:e.navigation.selectEntityType,workspaces:e.navigation.workspaces,activeWorkspace:e.navigation.activeWorkspaceId,workspaceBadges:e.navigation.workspaceBadges,onSelectWorkspace:e.navigation.selectWorkspace},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,M.jsxDEV("div",{className:"studio-chrome-location",children:[M.jsxDEV("span",{children:"Workspace"},void 0,!1,void 0,this),e.onContextClick?M.jsxDEV("button",{type:"button",onClick:e.onContextClick,children:["← ",e.contextLabel]},void 0,!0,void 0,this):M.jsxDEV("strong",{children:e.contextLabel},void 0,!1,void 0,this),e.contextBadge!==void 0&&e.contextBadge>0?M.jsxDEV("b",{children:e.contextBadge},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),M.jsxDEV("div",{className:"studio-chrome-tools",children:[M.jsxDEV("button",{className:"command-chip studio-chrome-command",type:"button","aria-label":"Search or run a command",children:[M.jsxDEV("span",{className:"command-chip-hint",children:"Search or run a command…"},void 0,!1,void 0,this),M.jsxDEV("kbd",{children:"⌘K"},void 0,!1,void 0,this),M.jsxDEV("span",{className:"command-chip-icon","aria-hidden":"true",children:"⌕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV("button",{id:"climateToggle",className:"climate-chip studio-chrome-climate",type:"button","aria-label":"Toggle climate",children:"◐"},void 0,!1,void 0,this),M.jsxDEV(Ti,{children:[M.jsxDEV(Ii,{asChild:!0,children:M.jsxDEV("button",{className:"studio-chrome-identity",type:"button","aria-label":`${r} account menu`,children:cc(r)},void 0,!1,void 0,this)},void 0,!1,void 0,this),M.jsxDEV(Mi,{className:"studio-chrome-identity-menu",align:"end",sideOffset:8,children:[M.jsxDEV(Li,{className:"studio-chrome-identity-label",children:[M.jsxDEV("strong",{children:r},void 0,!1,void 0,this),M.jsxDEV("span",{children:n},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV(Gr,{},void 0,!1,void 0,this),M.jsxDEV(Lo,{onSelect:()=>qr(a),children:["Account",M.jsxDEV("span",{"aria-hidden":"true",children:"→"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV(Lo,{onSelect:()=>qr(i),children:["View public dashboard",M.jsxDEV("span",{"aria-hidden":"true",children:"↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M.jsxDEV(Gr,{},void 0,!1,void 0,this),M.jsxDEV(Lo,{variant:"destructive",onSelect:()=>qr(s),children:["Sign out",M.jsxDEV("span",{"aria-hidden":"true",children:"⇥"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Db=`.studio-chrome {
|
|
837
837
|
position: relative;
|
|
838
838
|
z-index: 40;
|
|
839
839
|
display: grid;
|
|
@@ -1607,14 +1607,10 @@ import{Aa as Li,Ba as Gr,Ca as wi,Fa as _i,Ga as Si,ia as ee,ja as Mo,la as tt,m
|
|
|
1607
1607
|
color: var(--console-on-accent);
|
|
1608
1608
|
}
|
|
1609
1609
|
|
|
1610
|
-
/* Desktop
|
|
1610
|
+
/* Desktop keeps the Studio rail visible while the manuscript takes the
|
|
1611
|
+
remaining workspace. System singletons open directly in this editor, so
|
|
1612
|
+
dropping the rail here would also drop their only persistent navigation. */
|
|
1611
1613
|
@media (min-width: 901px) {
|
|
1612
|
-
.studio[data-view="editor"] .studio-body {
|
|
1613
|
-
grid-template-columns: 1fr;
|
|
1614
|
-
}
|
|
1615
|
-
.studio[data-view="editor"] .rail {
|
|
1616
|
-
display: none;
|
|
1617
|
-
}
|
|
1618
1614
|
.editor {
|
|
1619
1615
|
grid-template-columns: 330px minmax(0, 1fr);
|
|
1620
1616
|
grid-template-rows: minmax(0, 1fr) auto;
|
|
@@ -1731,4 +1727,4 @@ import{Aa as Li,Ba as Gr,Ca as wi,Fa as _i,Ga as Si,ia as ee,ja as Mo,la as tt,m
|
|
|
1731
1727
|
`;
|
|
1732
1728
|
export{qi as d,je as e,Fi as f,Xi as g,Xo as h,F as i,Qa as j,Ya as k,Ja as l,gi as m,Tv as n,Iv as o,vt as p,Mv as q,To as r,Dv as s,mi as t,qy as u,Gy as v,Yy as w,Xy as x,cb as y,lb as z,ub as A,db as B,pb as C,Pi as D,Hv as E,Vv as F,qv as G,fe as H,Jv as I,Xv as J,Zv as K,eb as L,tb as M,ob as N,rb as O,nb as P,wb as Q,rc as R,Sb as S,Oi as T,Rb as U,Pb as V,Ov as W,vi as X,Qv as Y,Wv as Z,Kv as _,Ib as $,Db as aa,Nb as ba};
|
|
1733
1729
|
|
|
1734
|
-
//# debugId=
|
|
1730
|
+
//# debugId=8D65A1E1889C2D0564756E2164756E21
|