@rizom/brain 0.2.0-alpha.236 → 0.2.0-alpha.237

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Za as r,_a as o}from"./chunks/index-q5r12b3s.js";import"./chunks/index-fxc39qy2.js";function t(i){return i}var e={name:"@rizom/brain",version:"0.2.0-alpha.236",description:"Brain runtime + CLI \u2014 scaffold, run, and manage AI brain instances",keywords:["brain","ai","cli","mcp","agent","personal-ai","knowledge-management"],license:"Apache-2.0",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{brain:"./dist/brain.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@clack/prompts":"^1.5.1","@modelcontextprotocol/sdk":"^1.29.0","@tailwindcss/postcss":"^4.3.1","@tailwindcss/typography":"^0.5.20",postcss:"^8.5.15",preact:"^10.27.2","preact-render-to-string":"^6.7.0",tailwindcss:"^4.3.1",zod:"^4.1.8"},devDependencies:{"@brains/app":"workspace:*","@brains/auth-service":"workspace:*","@brains/build-tools":"workspace:*","@brains/content-formatters":"workspace:*","@brains/deploy-support":"workspace:*","@brains/eslint-config":"workspace:*","@brains/mcp-service":"workspace:*","@brains/plugins":"workspace:*","@brains/ranger":"workspace:*","@brains/relay":"workspace:*","@brains/rover":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-default":"workspace:*","@brains/site-personal":"workspace:*","@brains/site-professional":"workspace:*","@brains/theme-rizom":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@rizom/theme-default":"workspace:*","@types/bun":"^1.3.14",rolldown:"^1.0.0","rolldown-plugin-dts":"^0.27.4",typescript:"^7.0.2"},engines:{bun:">=1.3.3"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./cli":"./dist/brain.js","./plugins":{types:"./dist/plugins.d.ts",import:"./dist/plugins.js"},"./entities":{types:"./dist/entities.d.ts",import:"./dist/entities.js"},"./services":{types:"./dist/services.d.ts",import:"./dist/services.js"},"./interfaces":{types:"./dist/interfaces.d.ts",import:"./dist/interfaces.js"},"./templates":{types:"./dist/templates.d.ts",import:"./dist/templates.js"},"./site":{types:"./dist/site.d.ts",import:"./dist/site.js"},"./themes":{types:"./dist/themes.d.ts",import:"./dist/themes.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js"},"./tsconfig.instance.json":"./tsconfig.instance.json"},files:["dist","templates","tsconfig.instance.json"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brain-cli#readme",optionalDependencies:{"@bitwarden/sdk-napi":"^1.0.0","@libsql/client":"^0.17.4","@tailwindcss/oxide":"^4.1.4",lightningcss:"^1.29.2","playwright-core":"^1.61.0","react-devtools-core":"^7.0.1",sharp:"^0.35.1"},publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brain-cli"},scripts:{build:"bun scripts/build.ts","dev:start":"bun scripts/build.ts && bun dist/brain.js start",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};var n=e.version;export{o as z,t as defineBrain,r as ZodError,n as PLUGIN_API_VERSION};
2
+ import{Za as r,_a as o}from"./chunks/index-q5r12b3s.js";import"./chunks/index-fxc39qy2.js";function t(i){return i}var e={name:"@rizom/brain",version:"0.2.0-alpha.237",description:"Brain runtime + CLI \u2014 scaffold, run, and manage AI brain instances",keywords:["brain","ai","cli","mcp","agent","personal-ai","knowledge-management"],license:"Apache-2.0",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{brain:"./dist/brain.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@clack/prompts":"^1.5.1","@modelcontextprotocol/sdk":"^1.29.0","@tailwindcss/postcss":"^4.3.1","@tailwindcss/typography":"^0.5.20",postcss:"^8.5.15",preact:"^10.27.2","preact-render-to-string":"^6.7.0",tailwindcss:"^4.3.1",zod:"^4.1.8"},devDependencies:{"@brains/app":"workspace:*","@brains/auth-service":"workspace:*","@brains/build-tools":"workspace:*","@brains/content-formatters":"workspace:*","@brains/deploy-support":"workspace:*","@brains/eslint-config":"workspace:*","@brains/mcp-service":"workspace:*","@brains/plugins":"workspace:*","@brains/ranger":"workspace:*","@brains/relay":"workspace:*","@brains/rover":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-default":"workspace:*","@brains/site-personal":"workspace:*","@brains/site-professional":"workspace:*","@brains/theme-rizom":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@rizom/theme-default":"workspace:*","@types/bun":"^1.3.14",rolldown:"^1.0.0","rolldown-plugin-dts":"^0.27.4",typescript:"^7.0.2"},engines:{bun:">=1.3.3"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./cli":"./dist/brain.js","./plugins":{types:"./dist/plugins.d.ts",import:"./dist/plugins.js"},"./entities":{types:"./dist/entities.d.ts",import:"./dist/entities.js"},"./services":{types:"./dist/services.d.ts",import:"./dist/services.js"},"./interfaces":{types:"./dist/interfaces.d.ts",import:"./dist/interfaces.js"},"./templates":{types:"./dist/templates.d.ts",import:"./dist/templates.js"},"./site":{types:"./dist/site.d.ts",import:"./dist/site.js"},"./themes":{types:"./dist/themes.d.ts",import:"./dist/themes.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js"},"./tsconfig.instance.json":"./tsconfig.instance.json"},files:["dist","templates","tsconfig.instance.json"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brain-cli#readme",optionalDependencies:{"@bitwarden/sdk-napi":"^1.0.0","@libsql/client":"^0.17.4","@tailwindcss/oxide":"^4.1.4",lightningcss:"^1.29.2","playwright-core":"^1.61.0","react-devtools-core":"^7.0.1",sharp:"^0.35.1"},publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brain-cli"},scripts:{build:"bun scripts/build.ts","dev:start":"bun scripts/build.ts && bun dist/brain.js start",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};var n=e.version;export{o as z,t as defineBrain,r as ZodError,n as PLUGIN_API_VERSION};
3
3
 
4
- //# debugId=00BEEA9C3E9100A164756E2164756E21
4
+ //# debugId=D768130C80BF3DD764756E2164756E21
5
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -6,6 +6,6 @@
6
6
  "import packageJson from \"../package.json\" with { type: \"json\" };\n\n/**\n * Pre-v1 external plugin API marker.\n *\n * During alpha, the external plugin API compatibility marker tracks the\n * published @rizom/brain package version. Once the plugin API is declared\n * stable, this can move to an independent semver contract such as 1.0.0.\n */\nexport const PLUGIN_API_VERSION: string = packageJson.version;\n"
7
7
  ],
8
8
  "mappings": ";0FA0EO,UAAS,CAAW,CAAC,EAA8C,CACxE,OAAO,k1FClEF,IAAM,EAA6B,EAAY",
9
- "debugId": "00BEEA9C3E9100A164756E2164756E21",
9
+ "debugId": "D768130C80BF3DD764756E2164756E21",
10
10
  "names": []
11
11
  }
package/dist/site.js CHANGED
@@ -1371,7 +1371,7 @@ ${r.join(`
1371
1371
  letter-spacing: 0.02em;
1372
1372
  }
1373
1373
  .printable-footer a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
1374
- `}},void 0,!1,void 0,this),ur("header",{className:"printable-hero",children:[ur("div",{className:"printable-masthead",children:r.brandLabel&&ur("p",{className:"printable-kicker",children:r.brandLabel},void 0,!1,void 0,this)},void 0,!1,void 0,this),ur("div",{children:[ur("h1",{className:"printable-title",children:r.title},void 0,!1,void 0,this),r.excerpt&&ur("p",{className:"printable-excerpt",children:r.excerpt},void 0,!1,void 0,this),ur("div",{className:"printable-meta",children:[r.author&&ur("span",{children:["By ",r.author]},void 0,!0,void 0,this),f&&ur("span",{children:f},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.coverImageUrl&&ur("figure",{className:"printable-cover-wrap",children:ur("img",{className:"printable-cover",src:r.coverImageUrl,alt:""},void 0,!1,void 0,this)},void 0,!1,void 0,this),ur(q1,{markdown:r.body,className:"printable-body"},void 0,!1,void 0,this),(Boolean(r.canonicalUrl)||Boolean(r.brandLabel))&&ur("footer",{className:"printable-footer",children:[ur("span",{children:r.brandLabel??"Printable PDF"},void 0,!1,void 0,this),r.canonicalUrl&&ur("a",{href:r.canonicalUrl,children:r.canonicalUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Cq=26214400,eq=60000;class v4{metadata={outputEntityType:"document"};context;renderPdf;constructor(l,r={}){this.context=l,this.renderPdf=r.renderPdf??zu}async resolve(l){if(l.sourceEntityType!=="post"||l.attachmentType!==y5)return;let r=await this.context.entityService.getEntity({entityType:"post",id:l.sourceEntityId});if(!r)return;let f=l_(r,{brandLabel:this.resolveBrandLabel(),coverImageUrl:await this.resolveCoverImageUrl(r)}),i=await xq(sq(Eq(),"brain-blog-printable-"));try{let n=await e1({outputDir:i,mediaPath:`/_media/printable/post/${r.id}`,template:kW,format:"pdf",content:f,siteConfig:{title:f.title,themeMode:"light"},themeCSS:this.context.themeCSS}),u=await lf({rootDir:i});try{return{type:"document",data:await this.renderPdf(u.urlFor(n.urlPath),{maxBytes:Cq,timeoutMs:eq,printBackground:!0,preferCSSPageSize:!0}),mimeType:"application/pdf",filename:`${r_(r)}-printable.pdf`}}finally{await u.close()}}finally{await jq(i,{recursive:!0,force:!0})}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name.trim();return r.length>0?r:void 0}async resolveCoverImageUrl(l){let{frontmatter:r}=X1(l.content),f=el.parse(r);if(!f.coverImageId)return;let i=await this.context.entityService.getEntity({entityType:"image",id:f.coverImageId});return i?.content.startsWith("data:image/")?i.content:void 0}}function l_(l,r={}){let{frontmatter:f,content:i}=X1(l.content),n=el.parse(f);return{title:n.title,body:i,...n.excerpt?{excerpt:n.excerpt}:{},...n.author?{author:n.author}:{},...n.publishedAt?{publishedAt:n.publishedAt}:{},...n.canonicalUrl?{canonicalUrl:n.canonicalUrl}:{},...r.coverImageUrl?{coverImageUrl:r.coverImageUrl}:{},...r.brandLabel?{brandLabel:r.brandLabel}:{}}}function r_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}import{mkdtemp as t_,rm as h_}from"fs/promises";import{tmpdir as o_}from"os";import{join as w_}from"path";import{jsxDEV as u_}from"preact/jsx-dev-runtime";var kt="og-image",f_="blog:og-image",$W=c.object({title:c.string().min(1),excerpt:c.string().optional(),author:c.string().optional(),publishedAt:c.string().optional(),brandLabel:c.string().optional(),coverImageUrl:c.string().optional()}),bW={name:f_,pluginId:"blog",schema:$W,renderers:{image:n_}};function i_(l){if(!l)return;let r=new Date(l);if(Number.isNaN(r.getTime()))return;return r.toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"2-digit"})}function n_(l){let r=$W.parse(l);return u_(Au,{brandLabel:r.brandLabel??r.title,eyebrow:"Journal",title:r.title,subtitle:r.excerpt,meta:[r.author],tag:i_(r.publishedAt)},void 0,!1,void 0,this)}var v_={width:1200,height:630},m_=60000;class m4{metadata={outputEntityType:"image",targetField:"ogImageId"};context;screenshotPng;constructor(l,r={}){this.context=l,this.screenshotPng=r.screenshotPng??Ju}async resolve(l){if(l.sourceEntityType!=="post"||l.attachmentType!==kt)return;let r=await this.context.entityService.getEntity({entityType:"post",id:l.sourceEntityId});if(!r)return;let f=k_(r,{brandLabel:this.resolveBrandLabel(),coverImageUrl:await this.resolveCoverImageUrl(r)}),i=await t_(w_(o_(),"brain-blog-og-image-"));try{let n=await e1({outputDir:i,mediaPath:`/_media/og/post/${r.id}`,template:bW,format:"image",content:f,siteConfig:{title:f.title,themeMode:"light"},themeCSS:this.context.themeCSS}),u=await lf({rootDir:i});try{return{type:"image",data:await this.screenshotPng(u.urlFor(n.urlPath),v_,{timeoutMs:m_,fullPage:!1,omitBackground:!1}),mimeType:"image/png",filename:`${$_(r)}-og.png`}}finally{await u.close()}}finally{await h_(i,{recursive:!0,force:!0})}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name.trim();return r.length>0?r:void 0}async resolveCoverImageUrl(l){let{frontmatter:r}=X1(l.content),f=el.parse(r);if(!f.coverImageId)return;let i=await this.context.entityService.getEntity({entityType:"image",id:f.coverImageId});return i?.content.startsWith("data:image/")?i.content:void 0}}function k_(l,r={}){let{frontmatter:f}=X1(l.content),i=el.parse(f);return{title:i.title,...i.excerpt?{excerpt:i.excerpt}:{},...i.author?{author:i.author}:{},...i.publishedAt?{publishedAt:i.publishedAt}:{},...r.coverImageUrl?{coverImageUrl:r.coverImageUrl}:{},...r.brandLabel?{brandLabel:r.brandLabel}:{}}}function $_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}var yW={name:"@brains/blog",version:"0.2.0-alpha.236",description:"AI-powered blog post generation from existing brain content",dependencies:{"@brains/atproto-contracts":"workspace:*","@brains/contracts":"workspace:*","@brains/media-page-composer":"workspace:*","@brains/media-renderer":"workspace:*","@brains/plugins":"workspace:*","@brains/style-guide":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},private:!0,scripts:{eval:"cd evals && bun run brain-eval",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};class gW extends Ni{entityType=Wf.entityType;schema=k4;adapter=Wf;unregisterAtprotoProjection;unregisterPrintableAttachmentProvider;unregisterOgImageAttachmentProvider;constructor(l={}){super("blog",yW,l,C5)}getEntityTypeConfig(){return{weight:2,projectionSourceRole:"primary",publish:{publishStatuses:["queued","published"]}}}createGenerationHandler(l){return new lo(this.logger.child("BlogGenerationJobHandler"),l)}getTemplates(){return U$()}getDataSources(){return[new io(this.logger.child("BlogDataSource"))]}async onRegister(l){let{RSSDataSource:r}=await import("./chunks/rss-datasource-9j87n822.js");l.entities.registerDataSource(new r(this.logger.child("RSSDataSource"))),a$(l,this.logger),F$(l,this.logger),T$(l,this.logger),L$(l),this.unregisterPrintableAttachmentProvider=l.attachments.register("post",y5,new v4(l)),this.unregisterOgImageAttachmentProvider=l.attachments.register("post",kt,new m4(l)),this.deferPublishAssetRegistration(l),this.unregisterAtprotoProjection=of.getInstance().register($3()),this.logger.info("Blog plugin registered (routes auto-generated at /posts/)")}deferPublishAssetRegistration(l){l.messaging.subscribe(qf.pluginsRegistered,async()=>{return await l.messaging.send({type:dW.register,payload:{entityType:"post",attachmentType:kt,mediaEntityType:"image",targetEntityField:{location:"frontmatter",field:"ogImageId"},requiredWhen:{status:"published"},autoGenerate:!0,jobType:"image:image-render-source"}}),{success:!0}})}async onShutdown(){this.unregisterPrintableAttachmentProvider?.(),this.unregisterPrintableAttachmentProvider=void 0,this.unregisterOgImageAttachmentProvider?.(),this.unregisterOgImageAttachmentProvider=void 0,this.unregisterAtprotoProjection?.(),this.unregisterAtprotoProjection=void 0}}class d5{postsListUrl;id="personal:homepage";name="Personal Homepage DataSource";description="Fetches profile and blog posts for a personal homepage";constructor(l){this.postsListUrl=l}async fetch(l,r,f){let i=f.entityService,[n,u,t]=await Promise.all([H1(i,Mn),Ri(i,{entityType:"post",count:6,parse:Sf}),_f(i)]),o={profile:n,posts:u,postsListUrl:this.postsListUrl,cta:pn(t.cta)};return r.parse(o)}}class g5{id="personal:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(l,r,f){let n={profile:await H1(f.entityService,Mn)};return r.parse(n)}}import{jsxDEV as _0,Fragment as cW}from"preact/jsx-dev-runtime";function y_(l){return new Date(l).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function d_(l){return l.split(/(\*[^*]+\*)/).map((r,f)=>{if(r.startsWith("*")&&r.endsWith("*")&&r.length>2)return _0("em",{className:"font-sans italic font-medium text-theme-inverse tracking-[-0.015em] [font-variation-settings:'opsz'_72]",children:r.slice(1,-1)},f,!1,void 0,this);return r})}var $4=({profile:l,posts:r,postsListUrl:f,cta:i})=>{let n=l.tagline??l.description,u=l.name.split(" ")[0];return _0(cW,{children:[_0(Pl,{title:l.name,description:l.description??n??"Personal site",ogType:"website"},void 0,!1,void 0,this),_0("header",{className:"hero-decor bg-brand text-theme-inverse relative flex flex-col items-center justify-center px-6 md:px-12 pt-32 pb-24 gap-7",children:_0("div",{className:"w-full max-w-[1100px] mx-auto text-center flex flex-col items-center gap-7",children:[n&&_0("h1",{className:"font-heading font-bold text-[clamp(2.5rem,6vw,5rem)] leading-[1.05] tracking-[-0.035em] text-theme-inverse text-balance m-0 [font-variation-settings:'wdth'_90,'opsz'_96]",children:d_(n)},void 0,!1,void 0,this),l.description&&_0("p",{className:"text-[clamp(1.0625rem,1.4vw,1.3125rem)] leading-[1.5] text-theme-inverse opacity-95 max-w-[600px] mx-auto m-0",children:l.description},void 0,!1,void 0,this),_0("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[_0("a",{href:f,className:"inline-flex items-center gap-2 rounded-full py-3.5 px-7 bg-theme text-brand border-2 border-theme font-heading font-semibold text-[15px] hover:bg-theme-subtle hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:["Read the Blog ",_0("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("a",{href:"/about",className:"rounded-full py-3.5 px-7 border-2 border-theme-light text-theme-inverse font-heading font-semibold text-[15px] hover:bg-brand-dark hover:border-theme hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:["About ",u]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),r.length>0&&_0("section",{className:"flex flex-col py-24 px-6 md:px-12 gap-11 bg-theme-subtle",children:[_0("div",{className:"flex justify-between items-end max-w-layout mx-auto w-full gap-6 flex-wrap",children:[_0("div",{children:[_0("span",{className:"block font-heading font-semibold text-[13px] uppercase tracking-[0.22em] text-brand mb-3 [font-variation-settings:'wdth'_85,'opsz'_12]",children:"The Archive"},void 0,!1,void 0,this),_0("h2",{className:"font-heading font-bold text-[clamp(2.25rem,5vw,3.75rem)] leading-none tracking-[-0.03em] text-heading m-0 [font-variation-settings:'wdth'_92,'opsz'_64]",children:["Recent"," ",_0("em",{className:"font-sans italic font-medium text-brand [font-variation-settings:'opsz'_60]",children:"posts"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_0("a",{href:f,className:"font-heading font-semibold text-[15px] text-brand inline-flex items-center gap-1.5 pb-1.5 border-b-2 border-current hover:text-brand-dark transition-colors [font-variation-settings:'wdth'_88,'opsz'_16]",children:["View the whole archive ",_0("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_0("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,320px),1fr))] gap-8 max-w-layout mx-auto w-full",children:r.map((t)=>_0("a",{href:t.url,className:"group flex flex-col bg-theme border border-theme rounded-md overflow-hidden hover:-translate-y-1 hover:border-brand/50 transition-all no-underline shadow-sm hover:shadow-lg",children:[t.coverImageUrl?_0("img",{src:t.coverImageUrl,alt:t.metadata.title,className:"w-full aspect-[16/10] object-cover bg-theme-muted"},void 0,!1,void 0,this):_0("div",{className:"w-full aspect-[16/10] bg-gradient-to-br from-brand to-accent","aria-hidden":"true"},void 0,!1,void 0,this),_0("div",{className:"flex flex-col gap-4 p-7 flex-1",children:[_0("div",{className:"flex flex-wrap items-center gap-3.5 font-heading text-[11px] font-semibold uppercase tracking-[0.18em] text-theme-muted [font-variation-settings:'wdth'_85,'opsz'_11]",children:[t.frontmatter.seriesName&&_0(cW,{children:[_0("span",{className:"text-brand",children:t.frontmatter.seriesName},void 0,!1,void 0,this),_0("span",{className:"w-[3px] h-[3px] rounded-full bg-current opacity-50","aria-hidden":"true"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("time",{children:y_(t.metadata.publishedAt??t.created)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("h3",{className:"font-sans font-semibold text-[clamp(1.375rem,1.8vw,1.625rem)] leading-[1.18] tracking-[-0.012em] text-heading m-0 text-balance",children:t.metadata.title},void 0,!1,void 0,this),t.frontmatter.excerpt&&_0("p",{className:"text-base leading-[1.55] text-theme-muted m-0 flex-1",children:t.frontmatter.excerpt},void 0,!1,void 0,this),_0("span",{className:"inline-flex items-center gap-1.5 font-heading font-semibold text-[13px] uppercase tracking-[0.14em] text-brand mt-1 [font-variation-settings:'wdth'_88,'opsz'_14]",children:["Read the post"," ",_0("span",{"aria-hidden":"true",className:"transition-transform group-hover:translate-x-1",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},t.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("section",{className:"cta-decor bg-theme-dark text-theme-on-dark flex-grow flex flex-col items-center justify-center py-24 px-6 md:px-12 gap-5",children:[_0("span",{className:"font-heading font-medium text-xs uppercase tracking-[0.24em] text-accent [font-variation-settings:'wdth'_85,'opsz'_12]",children:"Get in touch"},void 0,!1,void 0,this),_0("h2",{className:"text-center font-heading font-bold text-[clamp(2rem,4vw,3rem)] leading-none tracking-[-0.03em] text-theme-on-dark m-0 [font-variation-settings:'wdth'_90,'opsz'_64]",children:i.heading},void 0,!1,void 0,this),i.subtitle&&_0("p",{className:"text-center text-base leading-[1.55] text-theme-on-dark opacity-80 max-w-[480px] m-0",children:i.subtitle},void 0,!1,void 0,this),_0("a",{href:i.buttonLink,className:"inline-flex items-center gap-2 rounded-full py-3.5 px-7 bg-brand text-theme-inverse border-2 border-brand font-heading font-semibold text-[15px] hover:bg-brand-dark hover:-translate-y-0.5 transition-all mt-2 [font-variation-settings:'wdth'_92,'opsz'_18]",children:[i.buttonText," ",_0("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};import{jsxDEV as tr,Fragment as g_}from"preact/jsx-dev-runtime";var b4=({profile:l})=>{let r=`About ${l.name}`,f=l.description??l.intro??"About page",i=Boolean(l.email??l.website);return tr(g_,{children:[tr(Pl,{title:r,description:f,ogType:"profile"},void 0,!1,void 0,this),tr("section",{className:"hero-decor bg-brand text-theme-inverse relative flex flex-col px-6 md:px-12 pt-32 pb-24",children:tr("div",{className:"w-full max-w-3xl mx-auto flex flex-col gap-6",children:[tr("h1",{className:"font-heading font-bold text-[clamp(2.5rem,6vw,4.5rem)] leading-[1.05] tracking-[-0.035em] text-theme-inverse text-balance m-0 [font-variation-settings:'wdth'_90,'opsz'_96]",children:l.name},void 0,!1,void 0,this),l.description&&tr("p",{className:"text-[clamp(1.0625rem,1.4vw,1.25rem)] leading-[1.55] text-theme-inverse opacity-95 max-w-2xl m-0",children:l.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.story&&tr("section",{className:`py-24 px-6 md:px-12 bg-theme-subtle${i?"":" flex-grow"}`,children:tr("div",{className:"max-w-3xl mx-auto",children:tr(q1,{markdown:l.story},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),i&&tr("section",{className:"cta-decor bg-theme-dark text-theme-on-dark flex-grow flex flex-col items-center justify-center py-24 px-6 md:px-12 gap-5",children:[tr("span",{className:"font-heading font-medium text-xs uppercase tracking-[0.24em] text-accent [font-variation-settings:'wdth'_85,'opsz'_12]",children:"Get in touch"},void 0,!1,void 0,this),tr("h2",{className:"text-center font-heading font-bold text-[clamp(2rem,4vw,3rem)] leading-none tracking-[-0.03em] text-theme-on-dark m-0 [font-variation-settings:'wdth'_90,'opsz'_64]",children:["Say"," ",tr("em",{className:"font-sans italic font-medium text-accent [font-variation-settings:'opsz'_72]",children:"hi."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),tr("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[l.email&&tr("a",{href:`mailto:${l.email}`,className:"inline-flex items-center gap-2 rounded-full py-3.5 px-7 bg-brand text-theme-inverse border-2 border-brand font-heading font-semibold text-[15px] hover:bg-brand-dark hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:["Get in Touch ",tr("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.website&&tr("a",{href:l.website,className:"rounded-full py-3.5 px-7 border-2 border-theme-light text-theme-on-dark font-heading font-semibold text-[15px] hover:bg-brand-dark hover:border-theme hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:"Website"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var AW={name:"@brains/site-personal",version:"0.2.0-alpha.236",description:"Personal site composition package",dependencies:{"@brains/blog":"workspace:*","@brains/plugins":"workspace:*","@brains/profile":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-engine":"workspace:*","@brains/site-info":"workspace:*","@brains/templates":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*",preact:"^10.27.2"},devDependencies:{"@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},files:["src"],private:!0,scripts:{lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",typecheck:"tsc --noEmit"},type:"module"};var A_=c.object({entityDisplay:c.object({post:c.object({label:c.string().default("Post"),pluralName:c.string().optional()}).default({label:"Post"})}).default({post:{label:"Post"}})}),K_=c.object({heading:c.string(),buttonText:c.string(),buttonLink:c.string(),subtitle:c.string().optional()}),W_=c.looseObject({id:c.string(),entityType:c.literal("post"),content:c.string(),created:c.string(),updated:c.string(),contentHash:c.string(),metadata:c.looseObject({title:c.string(),publishedAt:c.string().optional()}),frontmatter:c.looseObject({excerpt:c.string(),seriesName:c.string().optional(),seriesIndex:c.number().optional()}),body:c.string(),url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),seriesUrl:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional(),coverImageSrcset:c.string().optional(),coverImageSizes:c.string().optional()});class y4 extends Pn{dependencies=["blog"];constructor(l={}){super("personal-site",AW,l,A_)}async onRegister(l){let r=this.config.entityDisplay.post,f=`/${r.pluralName??r.label.toLowerCase()+"s"}`,i=new d5(f);l.entities.registerDataSource(i);let n=new g5;l.entities.registerDataSource(n);let u=c.object({profile:If,posts:c.array(W_),postsListUrl:c.string(),cta:K_}),t=c.object({profile:If});l.templates.register({homepage:Jl({name:"homepage",description:"Personal homepage with recent blog posts",schema:u,dataSourceId:"personal:homepage",requiredPermission:"public",layout:{component:$4}}),about:Jl({name:"about",description:"About page with profile",schema:t,dataSourceId:"personal:about",requiredPermission:"public",layout:{component:b4}})}),this.logger.info("Personal site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function d4(l){return new y4(l??{})}var g4=[{id:"home",path:"/",title:"Home",description:"Personal site homepage",layout:"default",navigation:{show:!0,label:"Home",slot:"secondary",priority:10},sections:[{id:"homepage",template:"personal-site:homepage",dataQuery:{}}]},{id:"about",path:"/about",title:"About",description:"About page",layout:"default",navigation:{show:!0,label:"About",slot:"primary",priority:90},sections:[{id:"about",template:"personal-site:about",dataQuery:{}}]}];import{jsxDEV as Rr}from"preact/jsx-dev-runtime";function c4({sections:l,siteInfo:r}){let f=[...r.navigation.primary,...r.navigation.secondary].filter((i)=>i.label!=="Home");return Rr("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[Rr(cu,{title:r.title,titleClassName:"font-heading font-bold text-2xl",navigation:r.navigation.primary,showThemeToggle:!0,themeToggleClassName:"bg-theme-toggle text-theme-toggle-icon hover:bg-theme-toggle-hover rounded-[10px]",...r.logo!==void 0?{logo:r.logo}:{}},void 0,!1,void 0,this),Rr("main",{className:"flex-grow flex flex-col",children:l},void 0,!1,void 0,this),Rr("footer",{className:"bg-footer text-footer border-t border-theme",children:Rr("div",{className:"max-w-layout mx-auto flex flex-col md:flex-row justify-between items-center py-8 px-6 md:px-8",children:[Rr("div",{className:"flex flex-col gap-1 mb-4 md:mb-0",children:[Rr("span",{className:"text-brand font-heading font-bold text-lg",children:r.title},void 0,!1,void 0,this),r.description&&Rr("span",{className:"text-theme-muted text-xs",children:r.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Rr("nav",{className:"flex flex-wrap justify-center gap-x-6 gap-y-2 mb-4 md:mb-0",children:f.map((i)=>Rr("a",{href:i.href,className:"text-theme-muted text-[13px] hover:text-brand transition-colors",children:i.label},i.href,!1,void 0,this))},void 0,!1,void 0,this),Rr("div",{className:"flex items-center gap-4",children:[r.copyright&&Rr("span",{className:"text-theme-light text-[11px]",children:r.copyright},void 0,!1,void 0,this),Rr(kf,{variant:"footer",size:"sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var $t=D5;var KW=c.enum(["generating","draft","queued","published","failed"]),WW=c.enum(["generating","draft","queued","published","failed"]),A4="publishedAt is required when deck status is published",K4=(l)=>l.status==="published"&&!l.publishedAt,W4=(l)=>{if(K4(l))throw Error(A4)},Y1=c.object({title:c.string(),slug:c.string().optional(),description:c.string().optional(),author:c.string().optional(),status:KW,publishedAt:c.string().datetime().optional(),event:c.string().optional(),coverImageId:c.string().optional(),ogImageId:c.string().optional()}),g50=c.object({title:c.string(),description:c.string().optional(),status:KW,publishedAt:c.string().datetime().optional(),coverImageId:c.string().optional(),slug:c.string(),error:c.string().optional()}).superRefine((l,r)=>{if(!K4(l))return;r.addIssue({code:c.ZodIssueCode.custom,path:["publishedAt"],message:A4})}),Z_=c.object({title:c.string(),description:c.string().optional(),status:WW,publishedAt:c.string().datetime().optional(),coverImageId:c.string().optional(),slug:c.string(),error:c.string().optional()}).superRefine((l,r)=>{if(!K4(l))return;r.addIssue({code:"custom",path:["publishedAt"],message:A4})}),O_=c.object({title:c.string(),slug:c.string().optional(),description:c.string().optional(),author:c.string().optional(),status:WW,publishedAt:c.string().datetime().optional(),event:c.string().optional(),coverImageId:c.string().optional(),ogImageId:c.string().optional()}),zn=hf.extend({entityType:c.literal("deck"),metadata:Z_}),c5=zn.extend({frontmatter:O_,body:c.string(),ogImageUrl:c.string().optional()}),bt=c5.extend({url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional()});class Z4 extends Fi{constructor(){super({entityType:"deck",purpose:"A slide-deck presentation.",schema:zn,frontmatterSchema:Y1,supportsCoverImage:!0})}validateSlideStructure(l){if(!/^---$/gm.test(l))throw Error("Invalid deck: markdown must contain slide separators (---) to be a valid presentation")}toMarkdown(l){let r=this.extractBody(l.content);this.validateSlideStructure(r);let f=this.parseFrontMatter(l.content,Y1);W4(f);let i={...f,slug:f.slug??l.metadata.slug};return this.buildMarkdown(r,i)}fromMarkdown(l){let r=this.parseFrontmatter(l),f=this.extractBody(l);W4(r),this.validateSlideStructure(f);let i=r.slug??Cl(r.title),n=r.status;return{entityType:"deck",content:l,metadata:{slug:i,title:r.title,description:r.description,status:n,publishedAt:r.publishedAt,coverImageId:r.coverImageId}}}generateTitle(l){return l.metadata.title}generateSummary(l){if(l.metadata.description)return l.metadata.description;return`Presentation: ${l.metadata.title}`}generateFrontMatter(l){return this.toMarkdown(l)}buildStub(l){let r={title:l.title,slug:l.id,status:"generating"};return{content:this.buildMarkdown(`---
1374
+ `}},void 0,!1,void 0,this),ur("header",{className:"printable-hero",children:[ur("div",{className:"printable-masthead",children:r.brandLabel&&ur("p",{className:"printable-kicker",children:r.brandLabel},void 0,!1,void 0,this)},void 0,!1,void 0,this),ur("div",{children:[ur("h1",{className:"printable-title",children:r.title},void 0,!1,void 0,this),r.excerpt&&ur("p",{className:"printable-excerpt",children:r.excerpt},void 0,!1,void 0,this),ur("div",{className:"printable-meta",children:[r.author&&ur("span",{children:["By ",r.author]},void 0,!0,void 0,this),f&&ur("span",{children:f},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r.coverImageUrl&&ur("figure",{className:"printable-cover-wrap",children:ur("img",{className:"printable-cover",src:r.coverImageUrl,alt:""},void 0,!1,void 0,this)},void 0,!1,void 0,this),ur(q1,{markdown:r.body,className:"printable-body"},void 0,!1,void 0,this),(Boolean(r.canonicalUrl)||Boolean(r.brandLabel))&&ur("footer",{className:"printable-footer",children:[ur("span",{children:r.brandLabel??"Printable PDF"},void 0,!1,void 0,this),r.canonicalUrl&&ur("a",{href:r.canonicalUrl,children:r.canonicalUrl},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Cq=26214400,eq=60000;class v4{metadata={outputEntityType:"document"};context;renderPdf;constructor(l,r={}){this.context=l,this.renderPdf=r.renderPdf??zu}async resolve(l){if(l.sourceEntityType!=="post"||l.attachmentType!==y5)return;let r=await this.context.entityService.getEntity({entityType:"post",id:l.sourceEntityId});if(!r)return;let f=l_(r,{brandLabel:this.resolveBrandLabel(),coverImageUrl:await this.resolveCoverImageUrl(r)}),i=await xq(sq(Eq(),"brain-blog-printable-"));try{let n=await e1({outputDir:i,mediaPath:`/_media/printable/post/${r.id}`,template:kW,format:"pdf",content:f,siteConfig:{title:f.title,themeMode:"light"},themeCSS:this.context.themeCSS}),u=await lf({rootDir:i});try{return{type:"document",data:await this.renderPdf(u.urlFor(n.urlPath),{maxBytes:Cq,timeoutMs:eq,printBackground:!0,preferCSSPageSize:!0}),mimeType:"application/pdf",filename:`${r_(r)}-printable.pdf`}}finally{await u.close()}}finally{await jq(i,{recursive:!0,force:!0})}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name.trim();return r.length>0?r:void 0}async resolveCoverImageUrl(l){let{frontmatter:r}=X1(l.content),f=el.parse(r);if(!f.coverImageId)return;let i=await this.context.entityService.getEntity({entityType:"image",id:f.coverImageId});return i?.content.startsWith("data:image/")?i.content:void 0}}function l_(l,r={}){let{frontmatter:f,content:i}=X1(l.content),n=el.parse(f);return{title:n.title,body:i,...n.excerpt?{excerpt:n.excerpt}:{},...n.author?{author:n.author}:{},...n.publishedAt?{publishedAt:n.publishedAt}:{},...n.canonicalUrl?{canonicalUrl:n.canonicalUrl}:{},...r.coverImageUrl?{coverImageUrl:r.coverImageUrl}:{},...r.brandLabel?{brandLabel:r.brandLabel}:{}}}function r_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}import{mkdtemp as t_,rm as h_}from"fs/promises";import{tmpdir as o_}from"os";import{join as w_}from"path";import{jsxDEV as u_}from"preact/jsx-dev-runtime";var kt="og-image",f_="blog:og-image",$W=c.object({title:c.string().min(1),excerpt:c.string().optional(),author:c.string().optional(),publishedAt:c.string().optional(),brandLabel:c.string().optional(),coverImageUrl:c.string().optional()}),bW={name:f_,pluginId:"blog",schema:$W,renderers:{image:n_}};function i_(l){if(!l)return;let r=new Date(l);if(Number.isNaN(r.getTime()))return;return r.toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"2-digit"})}function n_(l){let r=$W.parse(l);return u_(Au,{brandLabel:r.brandLabel??r.title,eyebrow:"Journal",title:r.title,subtitle:r.excerpt,meta:[r.author],tag:i_(r.publishedAt)},void 0,!1,void 0,this)}var v_={width:1200,height:630},m_=60000;class m4{metadata={outputEntityType:"image",targetField:"ogImageId"};context;screenshotPng;constructor(l,r={}){this.context=l,this.screenshotPng=r.screenshotPng??Ju}async resolve(l){if(l.sourceEntityType!=="post"||l.attachmentType!==kt)return;let r=await this.context.entityService.getEntity({entityType:"post",id:l.sourceEntityId});if(!r)return;let f=k_(r,{brandLabel:this.resolveBrandLabel(),coverImageUrl:await this.resolveCoverImageUrl(r)}),i=await t_(w_(o_(),"brain-blog-og-image-"));try{let n=await e1({outputDir:i,mediaPath:`/_media/og/post/${r.id}`,template:bW,format:"image",content:f,siteConfig:{title:f.title,themeMode:"light"},themeCSS:this.context.themeCSS}),u=await lf({rootDir:i});try{return{type:"image",data:await this.screenshotPng(u.urlFor(n.urlPath),v_,{timeoutMs:m_,fullPage:!1,omitBackground:!1}),mimeType:"image/png",filename:`${$_(r)}-og.png`}}finally{await u.close()}}finally{await h_(i,{recursive:!0,force:!0})}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name.trim();return r.length>0?r:void 0}async resolveCoverImageUrl(l){let{frontmatter:r}=X1(l.content),f=el.parse(r);if(!f.coverImageId)return;let i=await this.context.entityService.getEntity({entityType:"image",id:f.coverImageId});return i?.content.startsWith("data:image/")?i.content:void 0}}function k_(l,r={}){let{frontmatter:f}=X1(l.content),i=el.parse(f);return{title:i.title,...i.excerpt?{excerpt:i.excerpt}:{},...i.author?{author:i.author}:{},...i.publishedAt?{publishedAt:i.publishedAt}:{},...r.coverImageUrl?{coverImageUrl:r.coverImageUrl}:{},...r.brandLabel?{brandLabel:r.brandLabel}:{}}}function $_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}var yW={name:"@brains/blog",version:"0.2.0-alpha.237",description:"AI-powered blog post generation from existing brain content",dependencies:{"@brains/atproto-contracts":"workspace:*","@brains/contracts":"workspace:*","@brains/media-page-composer":"workspace:*","@brains/media-renderer":"workspace:*","@brains/plugins":"workspace:*","@brains/style-guide":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},private:!0,scripts:{eval:"cd evals && bun run brain-eval",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};class gW extends Ni{entityType=Wf.entityType;schema=k4;adapter=Wf;unregisterAtprotoProjection;unregisterPrintableAttachmentProvider;unregisterOgImageAttachmentProvider;constructor(l={}){super("blog",yW,l,C5)}getEntityTypeConfig(){return{weight:2,projectionSourceRole:"primary",publish:{publishStatuses:["queued","published"]}}}createGenerationHandler(l){return new lo(this.logger.child("BlogGenerationJobHandler"),l)}getTemplates(){return U$()}getDataSources(){return[new io(this.logger.child("BlogDataSource"))]}async onRegister(l){let{RSSDataSource:r}=await import("./chunks/rss-datasource-9j87n822.js");l.entities.registerDataSource(new r(this.logger.child("RSSDataSource"))),a$(l,this.logger),F$(l,this.logger),T$(l,this.logger),L$(l),this.unregisterPrintableAttachmentProvider=l.attachments.register("post",y5,new v4(l)),this.unregisterOgImageAttachmentProvider=l.attachments.register("post",kt,new m4(l)),this.deferPublishAssetRegistration(l),this.unregisterAtprotoProjection=of.getInstance().register($3()),this.logger.info("Blog plugin registered (routes auto-generated at /posts/)")}deferPublishAssetRegistration(l){l.messaging.subscribe(qf.pluginsRegistered,async()=>{return await l.messaging.send({type:dW.register,payload:{entityType:"post",attachmentType:kt,mediaEntityType:"image",targetEntityField:{location:"frontmatter",field:"ogImageId"},requiredWhen:{status:"published"},autoGenerate:!0,jobType:"image:image-render-source"}}),{success:!0}})}async onShutdown(){this.unregisterPrintableAttachmentProvider?.(),this.unregisterPrintableAttachmentProvider=void 0,this.unregisterOgImageAttachmentProvider?.(),this.unregisterOgImageAttachmentProvider=void 0,this.unregisterAtprotoProjection?.(),this.unregisterAtprotoProjection=void 0}}class d5{postsListUrl;id="personal:homepage";name="Personal Homepage DataSource";description="Fetches profile and blog posts for a personal homepage";constructor(l){this.postsListUrl=l}async fetch(l,r,f){let i=f.entityService,[n,u,t]=await Promise.all([H1(i,Mn),Ri(i,{entityType:"post",count:6,parse:Sf}),_f(i)]),o={profile:n,posts:u,postsListUrl:this.postsListUrl,cta:pn(t.cta)};return r.parse(o)}}class g5{id="personal:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(l,r,f){let n={profile:await H1(f.entityService,Mn)};return r.parse(n)}}import{jsxDEV as _0,Fragment as cW}from"preact/jsx-dev-runtime";function y_(l){return new Date(l).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function d_(l){return l.split(/(\*[^*]+\*)/).map((r,f)=>{if(r.startsWith("*")&&r.endsWith("*")&&r.length>2)return _0("em",{className:"font-sans italic font-medium text-theme-inverse tracking-[-0.015em] [font-variation-settings:'opsz'_72]",children:r.slice(1,-1)},f,!1,void 0,this);return r})}var $4=({profile:l,posts:r,postsListUrl:f,cta:i})=>{let n=l.tagline??l.description,u=l.name.split(" ")[0];return _0(cW,{children:[_0(Pl,{title:l.name,description:l.description??n??"Personal site",ogType:"website"},void 0,!1,void 0,this),_0("header",{className:"hero-decor bg-brand text-theme-inverse relative flex flex-col items-center justify-center px-6 md:px-12 pt-32 pb-24 gap-7",children:_0("div",{className:"w-full max-w-[1100px] mx-auto text-center flex flex-col items-center gap-7",children:[n&&_0("h1",{className:"font-heading font-bold text-[clamp(2.5rem,6vw,5rem)] leading-[1.05] tracking-[-0.035em] text-theme-inverse text-balance m-0 [font-variation-settings:'wdth'_90,'opsz'_96]",children:d_(n)},void 0,!1,void 0,this),l.description&&_0("p",{className:"text-[clamp(1.0625rem,1.4vw,1.3125rem)] leading-[1.5] text-theme-inverse opacity-95 max-w-[600px] mx-auto m-0",children:l.description},void 0,!1,void 0,this),_0("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[_0("a",{href:f,className:"inline-flex items-center gap-2 rounded-full py-3.5 px-7 bg-theme text-brand border-2 border-theme font-heading font-semibold text-[15px] hover:bg-theme-subtle hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:["Read the Blog ",_0("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("a",{href:"/about",className:"rounded-full py-3.5 px-7 border-2 border-theme-light text-theme-inverse font-heading font-semibold text-[15px] hover:bg-brand-dark hover:border-theme hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:["About ",u]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),r.length>0&&_0("section",{className:"flex flex-col py-24 px-6 md:px-12 gap-11 bg-theme-subtle",children:[_0("div",{className:"flex justify-between items-end max-w-layout mx-auto w-full gap-6 flex-wrap",children:[_0("div",{children:[_0("span",{className:"block font-heading font-semibold text-[13px] uppercase tracking-[0.22em] text-brand mb-3 [font-variation-settings:'wdth'_85,'opsz'_12]",children:"The Archive"},void 0,!1,void 0,this),_0("h2",{className:"font-heading font-bold text-[clamp(2.25rem,5vw,3.75rem)] leading-none tracking-[-0.03em] text-heading m-0 [font-variation-settings:'wdth'_92,'opsz'_64]",children:["Recent"," ",_0("em",{className:"font-sans italic font-medium text-brand [font-variation-settings:'opsz'_60]",children:"posts"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_0("a",{href:f,className:"font-heading font-semibold text-[15px] text-brand inline-flex items-center gap-1.5 pb-1.5 border-b-2 border-current hover:text-brand-dark transition-colors [font-variation-settings:'wdth'_88,'opsz'_16]",children:["View the whole archive ",_0("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_0("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,320px),1fr))] gap-8 max-w-layout mx-auto w-full",children:r.map((t)=>_0("a",{href:t.url,className:"group flex flex-col bg-theme border border-theme rounded-md overflow-hidden hover:-translate-y-1 hover:border-brand/50 transition-all no-underline shadow-sm hover:shadow-lg",children:[t.coverImageUrl?_0("img",{src:t.coverImageUrl,alt:t.metadata.title,className:"w-full aspect-[16/10] object-cover bg-theme-muted"},void 0,!1,void 0,this):_0("div",{className:"w-full aspect-[16/10] bg-gradient-to-br from-brand to-accent","aria-hidden":"true"},void 0,!1,void 0,this),_0("div",{className:"flex flex-col gap-4 p-7 flex-1",children:[_0("div",{className:"flex flex-wrap items-center gap-3.5 font-heading text-[11px] font-semibold uppercase tracking-[0.18em] text-theme-muted [font-variation-settings:'wdth'_85,'opsz'_11]",children:[t.frontmatter.seriesName&&_0(cW,{children:[_0("span",{className:"text-brand",children:t.frontmatter.seriesName},void 0,!1,void 0,this),_0("span",{className:"w-[3px] h-[3px] rounded-full bg-current opacity-50","aria-hidden":"true"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("time",{children:y_(t.metadata.publishedAt??t.created)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("h3",{className:"font-sans font-semibold text-[clamp(1.375rem,1.8vw,1.625rem)] leading-[1.18] tracking-[-0.012em] text-heading m-0 text-balance",children:t.metadata.title},void 0,!1,void 0,this),t.frontmatter.excerpt&&_0("p",{className:"text-base leading-[1.55] text-theme-muted m-0 flex-1",children:t.frontmatter.excerpt},void 0,!1,void 0,this),_0("span",{className:"inline-flex items-center gap-1.5 font-heading font-semibold text-[13px] uppercase tracking-[0.14em] text-brand mt-1 [font-variation-settings:'wdth'_88,'opsz'_14]",children:["Read the post"," ",_0("span",{"aria-hidden":"true",className:"transition-transform group-hover:translate-x-1",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},t.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_0("section",{className:"cta-decor bg-theme-dark text-theme-on-dark flex-grow flex flex-col items-center justify-center py-24 px-6 md:px-12 gap-5",children:[_0("span",{className:"font-heading font-medium text-xs uppercase tracking-[0.24em] text-accent [font-variation-settings:'wdth'_85,'opsz'_12]",children:"Get in touch"},void 0,!1,void 0,this),_0("h2",{className:"text-center font-heading font-bold text-[clamp(2rem,4vw,3rem)] leading-none tracking-[-0.03em] text-theme-on-dark m-0 [font-variation-settings:'wdth'_90,'opsz'_64]",children:i.heading},void 0,!1,void 0,this),i.subtitle&&_0("p",{className:"text-center text-base leading-[1.55] text-theme-on-dark opacity-80 max-w-[480px] m-0",children:i.subtitle},void 0,!1,void 0,this),_0("a",{href:i.buttonLink,className:"inline-flex items-center gap-2 rounded-full py-3.5 px-7 bg-brand text-theme-inverse border-2 border-brand font-heading font-semibold text-[15px] hover:bg-brand-dark hover:-translate-y-0.5 transition-all mt-2 [font-variation-settings:'wdth'_92,'opsz'_18]",children:[i.buttonText," ",_0("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};import{jsxDEV as tr,Fragment as g_}from"preact/jsx-dev-runtime";var b4=({profile:l})=>{let r=`About ${l.name}`,f=l.description??l.intro??"About page",i=Boolean(l.email??l.website);return tr(g_,{children:[tr(Pl,{title:r,description:f,ogType:"profile"},void 0,!1,void 0,this),tr("section",{className:"hero-decor bg-brand text-theme-inverse relative flex flex-col px-6 md:px-12 pt-32 pb-24",children:tr("div",{className:"w-full max-w-3xl mx-auto flex flex-col gap-6",children:[tr("h1",{className:"font-heading font-bold text-[clamp(2.5rem,6vw,4.5rem)] leading-[1.05] tracking-[-0.035em] text-theme-inverse text-balance m-0 [font-variation-settings:'wdth'_90,'opsz'_96]",children:l.name},void 0,!1,void 0,this),l.description&&tr("p",{className:"text-[clamp(1.0625rem,1.4vw,1.25rem)] leading-[1.55] text-theme-inverse opacity-95 max-w-2xl m-0",children:l.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),l.story&&tr("section",{className:`py-24 px-6 md:px-12 bg-theme-subtle${i?"":" flex-grow"}`,children:tr("div",{className:"max-w-3xl mx-auto",children:tr(q1,{markdown:l.story},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),i&&tr("section",{className:"cta-decor bg-theme-dark text-theme-on-dark flex-grow flex flex-col items-center justify-center py-24 px-6 md:px-12 gap-5",children:[tr("span",{className:"font-heading font-medium text-xs uppercase tracking-[0.24em] text-accent [font-variation-settings:'wdth'_85,'opsz'_12]",children:"Get in touch"},void 0,!1,void 0,this),tr("h2",{className:"text-center font-heading font-bold text-[clamp(2rem,4vw,3rem)] leading-none tracking-[-0.03em] text-theme-on-dark m-0 [font-variation-settings:'wdth'_90,'opsz'_64]",children:["Say"," ",tr("em",{className:"font-sans italic font-medium text-accent [font-variation-settings:'opsz'_72]",children:"hi."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),tr("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[l.email&&tr("a",{href:`mailto:${l.email}`,className:"inline-flex items-center gap-2 rounded-full py-3.5 px-7 bg-brand text-theme-inverse border-2 border-brand font-heading font-semibold text-[15px] hover:bg-brand-dark hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:["Get in Touch ",tr("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.website&&tr("a",{href:l.website,className:"rounded-full py-3.5 px-7 border-2 border-theme-light text-theme-on-dark font-heading font-semibold text-[15px] hover:bg-brand-dark hover:border-theme hover:-translate-y-0.5 transition-all [font-variation-settings:'wdth'_92,'opsz'_18]",children:"Website"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var AW={name:"@brains/site-personal",version:"0.2.0-alpha.237",description:"Personal site composition package",dependencies:{"@brains/blog":"workspace:*","@brains/plugins":"workspace:*","@brains/profile":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-engine":"workspace:*","@brains/site-info":"workspace:*","@brains/templates":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*",preact:"^10.27.2"},devDependencies:{"@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},files:["src"],private:!0,scripts:{lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",typecheck:"tsc --noEmit"},type:"module"};var A_=c.object({entityDisplay:c.object({post:c.object({label:c.string().default("Post"),pluralName:c.string().optional()}).default({label:"Post"})}).default({post:{label:"Post"}})}),K_=c.object({heading:c.string(),buttonText:c.string(),buttonLink:c.string(),subtitle:c.string().optional()}),W_=c.looseObject({id:c.string(),entityType:c.literal("post"),content:c.string(),created:c.string(),updated:c.string(),contentHash:c.string(),metadata:c.looseObject({title:c.string(),publishedAt:c.string().optional()}),frontmatter:c.looseObject({excerpt:c.string(),seriesName:c.string().optional(),seriesIndex:c.number().optional()}),body:c.string(),url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),seriesUrl:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional(),coverImageSrcset:c.string().optional(),coverImageSizes:c.string().optional()});class y4 extends Pn{dependencies=["blog"];constructor(l={}){super("personal-site",AW,l,A_)}async onRegister(l){let r=this.config.entityDisplay.post,f=`/${r.pluralName??r.label.toLowerCase()+"s"}`,i=new d5(f);l.entities.registerDataSource(i);let n=new g5;l.entities.registerDataSource(n);let u=c.object({profile:If,posts:c.array(W_),postsListUrl:c.string(),cta:K_}),t=c.object({profile:If});l.templates.register({homepage:Jl({name:"homepage",description:"Personal homepage with recent blog posts",schema:u,dataSourceId:"personal:homepage",requiredPermission:"public",layout:{component:$4}}),about:Jl({name:"about",description:"About page with profile",schema:t,dataSourceId:"personal:about",requiredPermission:"public",layout:{component:b4}})}),this.logger.info("Personal site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function d4(l){return new y4(l??{})}var g4=[{id:"home",path:"/",title:"Home",description:"Personal site homepage",layout:"default",navigation:{show:!0,label:"Home",slot:"secondary",priority:10},sections:[{id:"homepage",template:"personal-site:homepage",dataQuery:{}}]},{id:"about",path:"/about",title:"About",description:"About page",layout:"default",navigation:{show:!0,label:"About",slot:"primary",priority:90},sections:[{id:"about",template:"personal-site:about",dataQuery:{}}]}];import{jsxDEV as Rr}from"preact/jsx-dev-runtime";function c4({sections:l,siteInfo:r}){let f=[...r.navigation.primary,...r.navigation.secondary].filter((i)=>i.label!=="Home");return Rr("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[Rr(cu,{title:r.title,titleClassName:"font-heading font-bold text-2xl",navigation:r.navigation.primary,showThemeToggle:!0,themeToggleClassName:"bg-theme-toggle text-theme-toggle-icon hover:bg-theme-toggle-hover rounded-[10px]",...r.logo!==void 0?{logo:r.logo}:{}},void 0,!1,void 0,this),Rr("main",{className:"flex-grow flex flex-col",children:l},void 0,!1,void 0,this),Rr("footer",{className:"bg-footer text-footer border-t border-theme",children:Rr("div",{className:"max-w-layout mx-auto flex flex-col md:flex-row justify-between items-center py-8 px-6 md:px-8",children:[Rr("div",{className:"flex flex-col gap-1 mb-4 md:mb-0",children:[Rr("span",{className:"text-brand font-heading font-bold text-lg",children:r.title},void 0,!1,void 0,this),r.description&&Rr("span",{className:"text-theme-muted text-xs",children:r.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Rr("nav",{className:"flex flex-wrap justify-center gap-x-6 gap-y-2 mb-4 md:mb-0",children:f.map((i)=>Rr("a",{href:i.href,className:"text-theme-muted text-[13px] hover:text-brand transition-colors",children:i.label},i.href,!1,void 0,this))},void 0,!1,void 0,this),Rr("div",{className:"flex items-center gap-4",children:[r.copyright&&Rr("span",{className:"text-theme-light text-[11px]",children:r.copyright},void 0,!1,void 0,this),Rr(kf,{variant:"footer",size:"sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var $t=D5;var KW=c.enum(["generating","draft","queued","published","failed"]),WW=c.enum(["generating","draft","queued","published","failed"]),A4="publishedAt is required when deck status is published",K4=(l)=>l.status==="published"&&!l.publishedAt,W4=(l)=>{if(K4(l))throw Error(A4)},Y1=c.object({title:c.string(),slug:c.string().optional(),description:c.string().optional(),author:c.string().optional(),status:KW,publishedAt:c.string().datetime().optional(),event:c.string().optional(),coverImageId:c.string().optional(),ogImageId:c.string().optional()}),g50=c.object({title:c.string(),description:c.string().optional(),status:KW,publishedAt:c.string().datetime().optional(),coverImageId:c.string().optional(),slug:c.string(),error:c.string().optional()}).superRefine((l,r)=>{if(!K4(l))return;r.addIssue({code:c.ZodIssueCode.custom,path:["publishedAt"],message:A4})}),Z_=c.object({title:c.string(),description:c.string().optional(),status:WW,publishedAt:c.string().datetime().optional(),coverImageId:c.string().optional(),slug:c.string(),error:c.string().optional()}).superRefine((l,r)=>{if(!K4(l))return;r.addIssue({code:"custom",path:["publishedAt"],message:A4})}),O_=c.object({title:c.string(),slug:c.string().optional(),description:c.string().optional(),author:c.string().optional(),status:WW,publishedAt:c.string().datetime().optional(),event:c.string().optional(),coverImageId:c.string().optional(),ogImageId:c.string().optional()}),zn=hf.extend({entityType:c.literal("deck"),metadata:Z_}),c5=zn.extend({frontmatter:O_,body:c.string(),ogImageUrl:c.string().optional()}),bt=c5.extend({url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional()});class Z4 extends Fi{constructor(){super({entityType:"deck",purpose:"A slide-deck presentation.",schema:zn,frontmatterSchema:Y1,supportsCoverImage:!0})}validateSlideStructure(l){if(!/^---$/gm.test(l))throw Error("Invalid deck: markdown must contain slide separators (---) to be a valid presentation")}toMarkdown(l){let r=this.extractBody(l.content);this.validateSlideStructure(r);let f=this.parseFrontMatter(l.content,Y1);W4(f);let i={...f,slug:f.slug??l.metadata.slug};return this.buildMarkdown(r,i)}fromMarkdown(l){let r=this.parseFrontmatter(l),f=this.extractBody(l);W4(r),this.validateSlideStructure(f);let i=r.slug??Cl(r.title),n=r.status;return{entityType:"deck",content:l,metadata:{slug:i,title:r.title,description:r.description,status:n,publishedAt:r.publishedAt,coverImageId:r.coverImageId}}}generateTitle(l){return l.metadata.title}generateSummary(l){if(l.metadata.description)return l.metadata.description;return`Presentation: ${l.metadata.title}`}generateFrontMatter(l){return this.toMarkdown(l)}buildStub(l){let r={title:l.title,slug:l.id,status:"generating"};return{content:this.buildMarkdown(`---
1375
1375
  `,r),metadata:{title:l.title,slug:l.id,status:"generating"}}}}var yt=new Z4;var X_=c.object({markdown:c.string().describe("Markdown content with slide separators (---)"),deck:bt.optional()}),O4=Jl({name:"deck-detail",description:"Render a presentation deck as Reveal.js slides",schema:X_,dataSourceId:"decks:entities",requiredPermission:"public",layout:{component:jw,fullscreen:!0}});var X4=c.object({decks:c.array(c5)}),Y4=c.object({decks:c.array(bt),pageTitle:c.string().optional(),pageLabel:c.string().optional()});import{jsxDEV as J4}from"preact/jsx-dev-runtime";var Y_="Presentations",z4=({decks:l,pageLabel:r})=>{let f=l.map((n)=>({id:n.id,url:n.url,title:n.frontmatter.title,date:n.frontmatter.publishedAt??n.created,description:n.frontmatter.description}));return J4("div",{className:"deck-list bg-theme",children:J4("div",{className:"container mx-auto max-w-[1100px] px-6 py-16 md:px-12 md:py-24",children:J4(Ku,{label:r&&r!=="Decks"?r:Y_,items:f},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)};class A5 extends ZW{constructor(){super(X4,{title:"Deck List",mappings:[{key:"decks",label:"Decks",type:"array",itemType:"object"}]})}}var Q4=Jl({name:"deck-list",description:"List view of all presentation decks",schema:Y4,dataSourceId:"decks:entities",requiredPermission:"public",formatter:new A5,layout:{component:z4}});var J_=c.object({title:c.string().max(80).describe("A short, punchy title (2-5 words) that's memorable and evocative"),content:c.string().describe("Full slide deck content in markdown format with slide separators (---). Each slide should have a header and focused content."),description:c.string().describe("A concise 1-2 sentence summary that captures the essence of the talk")}),OW=Jl({name:"decks:generation",description:"Template for AI to generate complete slide decks from prompts",schema:J_,dataSourceId:"shell:ai-content",requiredPermission:"public",useKnowledgeContext:!0,basePrompt:`Generate a complete slide deck based on the user's prompt.
1376
1376
 
1377
1377
  Content requirements:
@@ -1675,12 +1675,12 @@ ${o}`,templateName:"decks:description",representedIdentity:"none"})).description
1675
1675
  color: var(--carousel-accent);
1676
1676
  font-weight: 600;
1677
1677
  }
1678
- `}},void 0,!1,void 0,this),n.map((v,k)=>kr("section",{className:`deck-carousel-slide${k===0?" is-cover":""}`,children:[kr("header",{className:"deck-carousel-header",children:kr("span",{className:"deck-carousel-wordmark","aria-label":f??r,children:[kr("span",{className:"wm-primary",children:u.primary},void 0,!1,void 0,this),u.secondary!==void 0&&kr(P_,{children:[kr("span",{className:"wm-dot",children:"."},void 0,!1,void 0,this),kr("span",{className:"wm-secondary",children:u.secondary},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),kr("div",{className:"deck-carousel-body",children:kr("div",{className:"deck-carousel-content",dangerouslySetInnerHTML:{__html:w(v.markdown)}},void 0,!1,void 0,this)},void 0,!1,void 0,this),kr("footer",{className:"deck-carousel-footer",children:[kr("span",{className:"deck-carousel-footer-meta",children:i??r},void 0,!1,void 0,this),kr("span",{className:"deck-carousel-counter","aria-label":`Slide ${k+1} of ${t}`,children:[kr("span",{className:"deck-carousel-counter-current",children:String(k+1).padStart(2,"0")},void 0,!1,void 0,this)," / ",kr("span",{children:o},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},k,!0,void 0,this))]},void 0,!0,void 0,this)}import{mkdtemp as p_,rm as M_}from"fs/promises";import{tmpdir as V_}from"os";import{join as I_}from"path";var q_=26214400,__=60000,RW=20;class N4{metadata={outputEntityType:"document"};context;renderPdf;getThemeMode;constructor(l,r={}){this.context=l,this.renderPdf=r.renderPdf??zu,this.getThemeMode=r.getThemeMode??(async()=>"dark")}async resolve(l){if(l.sourceEntityType!=="deck")return;let r=await this.context.entityService.getEntity({entityType:"deck",id:l.sourceEntityId});if(!r)return;let f=S_(r,{brandLabel:this.resolveBrandLabel()});if(f.slides.length>RW)throw Error(`Refusing to render carousel with ${f.slides.length} slides; maxSlides=${RW}`);let i=await this.getThemeMode(),n=await p_(I_(V_(),"brain-deck-carousel-"));try{let u=await e1({outputDir:n,mediaPath:`/_media/carousel/${r.id}`,template:NW,format:"pdf",content:f,siteConfig:{title:f.title,themeMode:i},themeCSS:this.context.themeCSS}),t=await lf({rootDir:n});try{return{type:"document",data:await this.renderPdf(t.urlFor(u.urlPath),{maxBytes:q_,timeoutMs:__,printBackground:!0,preferCSSPageSize:!0}),mimeType:"application/pdf",filename:`${D_(r)}-carousel.pdf`}}finally{await t.close()}}finally{await M_(n,{recursive:!0,force:!0})}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name;return r.length>0?r:void 0}}function S_(l,r={}){let{frontmatter:f,content:i}=X1(l.content),n=typeof f.title==="string"?f.title:l.metadata.title,u=typeof f.event==="string"&&f.event.length>0?f.event:void 0,t=i.split(/^---$/gm).map((o)=>o.trim()).filter((o)=>o.length>0).map((o)=>({markdown:o}));return{title:n,slides:t,...r.brandLabel?{brandLabel:r.brandLabel}:{},...u?{eyebrow:u}:{}}}function D_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}import{jsxDEV as E_}from"preact/jsx-dev-runtime";var Z5="og-image",x_="decks:og-image",TW=c.object({title:c.string().min(1),description:c.string().optional(),event:c.string().optional(),brandLabel:c.string().optional(),slideCount:c.number().int().positive().optional(),coverImageUrl:c.string().optional()}),LW={name:x_,pluginId:"decks",schema:TW,renderers:{image:j_}};function j_(l){let r=TW.parse(l),f=r.slideCount?`${r.slideCount} slide${r.slideCount===1?"":"s"}`:void 0;return E_(Au,{brandLabel:r.brandLabel??r.title,eyebrow:"Deck",title:r.title,subtitle:r.description,meta:[r.event],tag:f},void 0,!1,void 0,this)}class R4{metadata={outputEntityType:"image",targetField:"ogImageId"};context;deps;constructor(l,r={}){this.context=l,this.deps=r}async resolve(l){if(l.sourceEntityType!=="deck"||l.attachmentType!==Z5)return;let r=await this.context.entityService.getEntity({entityType:"deck",id:l.sourceEntityId});if(!r)return;let{frontmatter:f,content:i}=X1(r.content),n=Y1.parse(f),u=s_(i),t=this.resolveBrandLabel(),o=await this.resolveCoverImageUrl(n.coverImageId),w={title:n.title,...n.description?{description:n.description}:{},...n.event?{event:n.event}:{},...u?{slideCount:u}:{},...o?{coverImageUrl:o}:{},...t?{brandLabel:t}:{}};return{type:"image",data:await w4({mediaPath:`/_media/og/deck/${r.id}`,template:LW,content:w,title:w.title,themeMode:"dark",themeCSS:this.context.themeCSS,tmpPrefix:"brain-deck-og-image-",...this.deps.screenshotPng&&{screenshotPng:this.deps.screenshotPng}}),mimeType:"image/png",filename:`${C_(r)}-og.png`}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name.trim();return r.length>0?r:void 0}async resolveCoverImageUrl(l){if(!l)return;let r=await this.context.entityService.getEntity({entityType:"image",id:l});return r?.content.startsWith("data:image/")?r.content:void 0}}function s_(l){return l.split(/^---$/gm).map((r)=>r.trim()).filter((r)=>r.length>0).length}function C_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}async function PW({entity:l,config:r}){let f=zn.parse(l),i=Rl(f.content,Y1),n=i.metadata;return{$type:"ai.rizom.brain.deck",title:n.title,...n.slug&&{slug:n.slug},...n.description&&{description:n.description},body:i.content,format:"text/markdown",...n.author&&{author:n.author},...n.event&&{event:n.event},...n.publishedAt&&{publishedAt:n.publishedAt},...r.brainDid&&{brainDid:r.brainDid},...r.anchorDid&&{anchorDid:r.anchorDid},sourceEntityType:"deck",sourceEntityId:f.id,createdAt:f.created,...f.updated&&{updatedAt:f.updated}}}function T4(){return{entityType:"deck",collection:"ai.rizom.brain.deck",lexicon:gr["ai.rizom.brain.deck"],validate:!1,buildRecord:PW}}var pW={name:"@brains/decks",version:"0.2.0-alpha.236",description:"Presentation decks plugin for creating and viewing slide presentations",dependencies:{"@brains/atproto-contracts":"workspace:*","@brains/content-formatters":"workspace:*","@brains/contracts":"workspace:*","@brains/image":"workspace:*","@brains/media-page-composer":"workspace:*","@brains/media-renderer":"workspace:*","@brains/plugins":"workspace:*","@brains/site-info":"workspace:*","@brains/style-guide":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},private:!0,scripts:{eval:"cd evals && bun run brain-eval",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};var lS=c.object({prompt:c.string(),event:c.string().optional()}),rS=c.object({title:c.string(),content:c.string()});class MW extends Ni{deps;entityType=yt.entityType;schema=yt.schema;adapter=yt;unregisterCarouselAttachmentProvider;unregisterOgImageAttachmentProvider;unregisterAtprotoProjection;constructor(l={}){super("decks",pW,{},_t);this.deps=l}createGenerationHandler(l){return new F4(this.logger.child("DeckGenerationJobHandler"),l)}getTemplates(){return{"deck-detail":O4,"deck-list":Q4,generation:OW,description:XW}}getDataSources(){return[new a4(this.logger)]}getEntityTypeConfig(){return{weight:1.5,projectionSourceRole:"primary"}}async onRegister(l){this.deferPublishRegistration(l),this.subscribeToPublishExecute(l),this.registerCarouselAttachmentProvider(l),this.registerOgImageAttachmentProvider(l),this.registerEvalHandlers(l),this.unregisterAtprotoProjection=of.getInstance().register(T4()),this.logger.info("Decks plugin registered")}async onShutdown(){this.unregisterCarouselAttachmentProvider?.(),this.unregisterCarouselAttachmentProvider=void 0,this.unregisterOgImageAttachmentProvider?.(),this.unregisterOgImageAttachmentProvider=void 0,this.unregisterAtprotoProjection?.(),this.unregisterAtprotoProjection=void 0}deferPublishRegistration(l){l.messaging.subscribe(qf.pluginsRegistered,async()=>{return await l.messaging.send({type:pr.register,payload:{entityType:"deck",provider:{name:"internal",publish:async()=>({id:"internal"})},config:{executionMode:"provider"}}}),{success:!0}})}subscribeToPublishExecute(l){l.messaging.subscribe(pr.execute,async(r)=>{let{entityType:f,entityId:i}=r.payload;if(f!=="deck")return{success:!0};try{let n=await l.entityService.getEntity({entityType:"deck",id:i});if(!n)return await l.messaging.send({type:pr.reportFailure,payload:{entityType:f,entityId:i,error:`Deck not found: ${i}`}}),{success:!0};if(n.metadata.status==="published")return{success:!0};let u=new Date().toISOString(),t={...n,metadata:{...n.metadata,status:"published",publishedAt:u}};await l.entityService.updateEntity({entity:{...t,content:this.adapter.toMarkdown(t)}}),await l.messaging.send({type:pr.reportSuccess,payload:{entityType:f,entityId:i,result:{id:i}}})}catch(n){await l.messaging.send({type:pr.reportFailure,payload:{entityType:f,entityId:i,error:wn(n)}})}return{success:!0}})}registerCarouselAttachmentProvider(l){let r={...this.deps,getThemeMode:this.deps.getThemeMode??(async()=>{try{return(await _f(l.entityService)).themeMode??"dark"}catch{return"dark"}})};this.unregisterCarouselAttachmentProvider=l.attachments.register("deck",aW,new N4(l,r))}registerOgImageAttachmentProvider(l){this.unregisterOgImageAttachmentProvider=l.attachments.register("deck",Z5,new R4(l))}registerEvalHandlers(l){l.eval.registerHandler("generateDeck",async(r)=>{let f=lS.parse(r),i=F1(await a1(l.entityService));return l.ai.generate({prompt:`${f.prompt}${f.event?`
1678
+ `}},void 0,!1,void 0,this),n.map((v,k)=>kr("section",{className:`deck-carousel-slide${k===0?" is-cover":""}`,children:[kr("header",{className:"deck-carousel-header",children:kr("span",{className:"deck-carousel-wordmark","aria-label":f??r,children:[kr("span",{className:"wm-primary",children:u.primary},void 0,!1,void 0,this),u.secondary!==void 0&&kr(P_,{children:[kr("span",{className:"wm-dot",children:"."},void 0,!1,void 0,this),kr("span",{className:"wm-secondary",children:u.secondary},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),kr("div",{className:"deck-carousel-body",children:kr("div",{className:"deck-carousel-content",dangerouslySetInnerHTML:{__html:w(v.markdown)}},void 0,!1,void 0,this)},void 0,!1,void 0,this),kr("footer",{className:"deck-carousel-footer",children:[kr("span",{className:"deck-carousel-footer-meta",children:i??r},void 0,!1,void 0,this),kr("span",{className:"deck-carousel-counter","aria-label":`Slide ${k+1} of ${t}`,children:[kr("span",{className:"deck-carousel-counter-current",children:String(k+1).padStart(2,"0")},void 0,!1,void 0,this)," / ",kr("span",{children:o},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},k,!0,void 0,this))]},void 0,!0,void 0,this)}import{mkdtemp as p_,rm as M_}from"fs/promises";import{tmpdir as V_}from"os";import{join as I_}from"path";var q_=26214400,__=60000,RW=20;class N4{metadata={outputEntityType:"document"};context;renderPdf;getThemeMode;constructor(l,r={}){this.context=l,this.renderPdf=r.renderPdf??zu,this.getThemeMode=r.getThemeMode??(async()=>"dark")}async resolve(l){if(l.sourceEntityType!=="deck")return;let r=await this.context.entityService.getEntity({entityType:"deck",id:l.sourceEntityId});if(!r)return;let f=S_(r,{brandLabel:this.resolveBrandLabel()});if(f.slides.length>RW)throw Error(`Refusing to render carousel with ${f.slides.length} slides; maxSlides=${RW}`);let i=await this.getThemeMode(),n=await p_(I_(V_(),"brain-deck-carousel-"));try{let u=await e1({outputDir:n,mediaPath:`/_media/carousel/${r.id}`,template:NW,format:"pdf",content:f,siteConfig:{title:f.title,themeMode:i},themeCSS:this.context.themeCSS}),t=await lf({rootDir:n});try{return{type:"document",data:await this.renderPdf(t.urlFor(u.urlPath),{maxBytes:q_,timeoutMs:__,printBackground:!0,preferCSSPageSize:!0}),mimeType:"application/pdf",filename:`${D_(r)}-carousel.pdf`}}finally{await t.close()}}finally{await M_(n,{recursive:!0,force:!0})}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name;return r.length>0?r:void 0}}function S_(l,r={}){let{frontmatter:f,content:i}=X1(l.content),n=typeof f.title==="string"?f.title:l.metadata.title,u=typeof f.event==="string"&&f.event.length>0?f.event:void 0,t=i.split(/^---$/gm).map((o)=>o.trim()).filter((o)=>o.length>0).map((o)=>({markdown:o}));return{title:n,slides:t,...r.brandLabel?{brandLabel:r.brandLabel}:{},...u?{eyebrow:u}:{}}}function D_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}import{jsxDEV as E_}from"preact/jsx-dev-runtime";var Z5="og-image",x_="decks:og-image",TW=c.object({title:c.string().min(1),description:c.string().optional(),event:c.string().optional(),brandLabel:c.string().optional(),slideCount:c.number().int().positive().optional(),coverImageUrl:c.string().optional()}),LW={name:x_,pluginId:"decks",schema:TW,renderers:{image:j_}};function j_(l){let r=TW.parse(l),f=r.slideCount?`${r.slideCount} slide${r.slideCount===1?"":"s"}`:void 0;return E_(Au,{brandLabel:r.brandLabel??r.title,eyebrow:"Deck",title:r.title,subtitle:r.description,meta:[r.event],tag:f},void 0,!1,void 0,this)}class R4{metadata={outputEntityType:"image",targetField:"ogImageId"};context;deps;constructor(l,r={}){this.context=l,this.deps=r}async resolve(l){if(l.sourceEntityType!=="deck"||l.attachmentType!==Z5)return;let r=await this.context.entityService.getEntity({entityType:"deck",id:l.sourceEntityId});if(!r)return;let{frontmatter:f,content:i}=X1(r.content),n=Y1.parse(f),u=s_(i),t=this.resolveBrandLabel(),o=await this.resolveCoverImageUrl(n.coverImageId),w={title:n.title,...n.description?{description:n.description}:{},...n.event?{event:n.event}:{},...u?{slideCount:u}:{},...o?{coverImageUrl:o}:{},...t?{brandLabel:t}:{}};return{type:"image",data:await w4({mediaPath:`/_media/og/deck/${r.id}`,template:LW,content:w,title:w.title,themeMode:"dark",themeCSS:this.context.themeCSS,tmpPrefix:"brain-deck-og-image-",...this.deps.screenshotPng&&{screenshotPng:this.deps.screenshotPng}}),mimeType:"image/png",filename:`${C_(r)}-og.png`}}resolveBrandLabel(){let l=this.context.domain?.trim();if(l&&l.length>0)return l;let r=this.context.identity.getProfile().name.trim();return r.length>0?r:void 0}async resolveCoverImageUrl(l){if(!l)return;let r=await this.context.entityService.getEntity({entityType:"image",id:l});return r?.content.startsWith("data:image/")?r.content:void 0}}function s_(l){return l.split(/^---$/gm).map((r)=>r.trim()).filter((r)=>r.length>0).length}function C_(l){let r=l.metadata.slug;return r.length>0?r:Cl(l.metadata.title)}async function PW({entity:l,config:r}){let f=zn.parse(l),i=Rl(f.content,Y1),n=i.metadata;return{$type:"ai.rizom.brain.deck",title:n.title,...n.slug&&{slug:n.slug},...n.description&&{description:n.description},body:i.content,format:"text/markdown",...n.author&&{author:n.author},...n.event&&{event:n.event},...n.publishedAt&&{publishedAt:n.publishedAt},...r.brainDid&&{brainDid:r.brainDid},...r.anchorDid&&{anchorDid:r.anchorDid},sourceEntityType:"deck",sourceEntityId:f.id,createdAt:f.created,...f.updated&&{updatedAt:f.updated}}}function T4(){return{entityType:"deck",collection:"ai.rizom.brain.deck",lexicon:gr["ai.rizom.brain.deck"],validate:!1,buildRecord:PW}}var pW={name:"@brains/decks",version:"0.2.0-alpha.237",description:"Presentation decks plugin for creating and viewing slide presentations",dependencies:{"@brains/atproto-contracts":"workspace:*","@brains/content-formatters":"workspace:*","@brains/contracts":"workspace:*","@brains/image":"workspace:*","@brains/media-page-composer":"workspace:*","@brains/media-renderer":"workspace:*","@brains/plugins":"workspace:*","@brains/site-info":"workspace:*","@brains/style-guide":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},private:!0,scripts:{eval:"cd evals && bun run brain-eval",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",test:"bun test",typecheck:"tsc --noEmit"},type:"module"};var lS=c.object({prompt:c.string(),event:c.string().optional()}),rS=c.object({title:c.string(),content:c.string()});class MW extends Ni{deps;entityType=yt.entityType;schema=yt.schema;adapter=yt;unregisterCarouselAttachmentProvider;unregisterOgImageAttachmentProvider;unregisterAtprotoProjection;constructor(l={}){super("decks",pW,{},_t);this.deps=l}createGenerationHandler(l){return new F4(this.logger.child("DeckGenerationJobHandler"),l)}getTemplates(){return{"deck-detail":O4,"deck-list":Q4,generation:OW,description:XW}}getDataSources(){return[new a4(this.logger)]}getEntityTypeConfig(){return{weight:1.5,projectionSourceRole:"primary"}}async onRegister(l){this.deferPublishRegistration(l),this.subscribeToPublishExecute(l),this.registerCarouselAttachmentProvider(l),this.registerOgImageAttachmentProvider(l),this.registerEvalHandlers(l),this.unregisterAtprotoProjection=of.getInstance().register(T4()),this.logger.info("Decks plugin registered")}async onShutdown(){this.unregisterCarouselAttachmentProvider?.(),this.unregisterCarouselAttachmentProvider=void 0,this.unregisterOgImageAttachmentProvider?.(),this.unregisterOgImageAttachmentProvider=void 0,this.unregisterAtprotoProjection?.(),this.unregisterAtprotoProjection=void 0}deferPublishRegistration(l){l.messaging.subscribe(qf.pluginsRegistered,async()=>{return await l.messaging.send({type:pr.register,payload:{entityType:"deck",provider:{name:"internal",publish:async()=>({id:"internal"})},config:{executionMode:"provider"}}}),{success:!0}})}subscribeToPublishExecute(l){l.messaging.subscribe(pr.execute,async(r)=>{let{entityType:f,entityId:i}=r.payload;if(f!=="deck")return{success:!0};try{let n=await l.entityService.getEntity({entityType:"deck",id:i});if(!n)return await l.messaging.send({type:pr.reportFailure,payload:{entityType:f,entityId:i,error:`Deck not found: ${i}`}}),{success:!0};if(n.metadata.status==="published")return{success:!0};let u=new Date().toISOString(),t={...n,metadata:{...n.metadata,status:"published",publishedAt:u}};await l.entityService.updateEntity({entity:{...t,content:this.adapter.toMarkdown(t)}}),await l.messaging.send({type:pr.reportSuccess,payload:{entityType:f,entityId:i,result:{id:i}}})}catch(n){await l.messaging.send({type:pr.reportFailure,payload:{entityType:f,entityId:i,error:wn(n)}})}return{success:!0}})}registerCarouselAttachmentProvider(l){let r={...this.deps,getThemeMode:this.deps.getThemeMode??(async()=>{try{return(await _f(l.entityService)).themeMode??"dark"}catch{return"dark"}})};this.unregisterCarouselAttachmentProvider=l.attachments.register("deck",aW,new N4(l,r))}registerOgImageAttachmentProvider(l){this.unregisterOgImageAttachmentProvider=l.attachments.register("deck",Z5,new R4(l))}registerEvalHandlers(l){l.eval.registerHandler("generateDeck",async(r)=>{let f=lS.parse(r),i=F1(await a1(l.entityService));return l.ai.generate({prompt:`${f.prompt}${f.event?`
1679
1679
 
1680
1680
  Note: This presentation is for "${f.event}".`:""}`,templateName:"decks:generation",representedIdentity:"anchor",...i&&{styleGuide:{voice:i}}})}),l.eval.registerHandler("generateDescription",async(r)=>{let f=rS.parse(r);return l.ai.generate({prompt:`Title: ${f.title}
1681
1681
 
1682
1682
  Content:
1683
- ${f.content}`,templateName:"decks:description",representedIdentity:"none"})})}}class O5{postsListUrl;decksListUrl;id="professional:homepage-list";name="Homepage List DataSource";description="Fetches profile, blog posts, and presentation decks for homepage";constructor(l,r){this.postsListUrl=l,this.decksListUrl=r}async fetch(l,r,f){let i=f.entityService,[n,u,t,o]=await Promise.all([H1(i,$t),Ri(i,{entityType:"post",count:3,parse:Sf}),Ri(i,{entityType:"deck",count:3,parse:dt}),_f(i)]),w={profile:n,posts:u,decks:t,postsListUrl:this.postsListUrl,decksListUrl:this.decksListUrl,cta:pn(o.cta),sections:o.sections??{}};return r.parse(w)}}class X5{id="professional:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(l,r,f){let n={profile:await H1(f.entityService,$t)};return r.parse(n)}}import{jsxDEV as Kl,Fragment as nS}from"preact/jsx-dev-runtime";var fS="grid md:grid-cols-[14rem_1px_1fr] gap-y-2 gap-x-0 md:gap-16 items-start",iS="border-t md:border-t-0 md:border-l border-rule-strong md:self-stretch",L4=({number:l,title:r,blurb:f,children:i})=>Kl("section",{className:"py-20 border-b border-rule px-6 md:px-12",children:Kl("div",{className:"max-w-6xl mx-auto",children:Kl("div",{className:fS,children:[Kl(h3,{title:r,number:l,blurb:f},void 0,!1,void 0,this),Kl("div",{className:iS,"aria-hidden":"true"},void 0,!1,void 0,this),Kl("div",{className:"mt-6 md:mt-0",children:i},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),P4=({profile:l,posts:r,decks:f,postsListUrl:i,decksListUrl:n,cta:u,sections:t})=>{let o=l.tagline?.length?l.tagline:l.description,w=r.map((d)=>({id:d.id,url:d.url,title:d.metadata.title,date:d.metadata.publishedAt??d.created,description:d.frontmatter.excerpt,series:d.frontmatter.seriesName&&d.frontmatter.seriesIndex?{name:d.frontmatter.seriesName,index:d.frontmatter.seriesIndex}:void 0})),v=f.map((d)=>({id:d.id,url:d.url,title:d.frontmatter.title||d.id,date:d.frontmatter.publishedAt??d.created,description:d.frontmatter.description})),k=l.name||"Home",$=[l.intro,l.description,o].find((d)=>d)??"Professional site",b=Boolean(l.description)||l.expertise!==void 0&&l.expertise.length>0;return Kl(nS,{children:[Kl(Pl,{title:k,description:$,ogType:"website"},void 0,!1,void 0,this),Kl("div",{className:"homepage-list bg-theme",children:[Kl("header",{className:"hero-bg-pattern relative w-full px-6 md:px-12 pt-28 pb-24 md:pt-28 md:pb-24 overflow-hidden border-b border-rule",children:Kl("div",{className:"relative z-10 max-w-6xl mx-auto w-full",children:[l.name&&Kl("div",{className:"flex items-center gap-[0.6rem] mb-6 font-mono text-[0.7rem] font-medium uppercase tracking-[0.22em] text-accent",children:[Kl("span",{className:"w-[18px] h-px bg-accent","aria-hidden":"true"},void 0,!1,void 0,this),Kl("span",{children:l.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o&&Kl("h1",{className:"font-heading text-[clamp(2.75rem,6.5vw,5.5rem)] font-normal text-heading leading-[1.02] tracking-[-0.025em] max-w-[18ch] [font-variation-settings:'opsz'_144,'SOFT'_30]",children:nh(o,"italic font-normal text-accent [font-variation-settings:'opsz'_144,'SOFT'_80]")},void 0,!1,void 0,this),l.intro&&Kl("p",{className:"font-heading font-light text-[clamp(1.1rem,1.8vw,1.4rem)] leading-[1.5] text-theme-muted max-w-[42ch] mt-8 [font-variation-settings:'opsz'_24]",children:nh(l.intro,"italic text-accent")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Kl(L4,{number:"01",title:"Essays",blurb:t.essays?.blurb,children:Kl(ih,{items:w,viewAllUrl:i,viewAllLabel:"View all essays"},void 0,!1,void 0,this)},void 0,!1,void 0,this),v.length>0&&Kl(L4,{number:"02",title:"Presentations",blurb:t.presentations?.blurb,children:Kl(ih,{items:v,viewAllUrl:n,viewAllLabel:"View all presentations"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b&&Kl(L4,{number:"03",title:"About",blurb:t.about?.blurb,children:Kl("div",{className:"flex flex-col gap-8",children:[l.description&&Kl("p",{className:"font-heading font-light text-[1.25rem] leading-[1.55] text-theme max-w-[55ch] [font-variation-settings:'opsz'_24,'SOFT'_50]",children:l.description},void 0,!1,void 0,this),l.expertise&&l.expertise.length>0&&Kl(o3,{subjects:l.expertise},void 0,!1,void 0,this),Kl("a",{href:"/about",className:"mt-6 inline-flex items-center gap-2 font-mono text-[0.7rem] font-medium uppercase tracking-[0.18em] text-accent pb-1 relative before:content-[''] before:absolute before:left-0 before:right-full before:bottom-0 before:h-px before:bg-accent before:transition-[right] before:duration-300 hover:before:right-0",children:["Learn more",Kl("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Kl(sw,{cta:u,variant:"editorial",socialLinks:l.socialLinks},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};import{jsxDEV as kl,Fragment as uS}from"preact/jsx-dev-runtime";var p4=({profile:l})=>{let r=`About ${l.name||"Me"}`,f=[l.description,l.intro].find((n)=>n)??"About page",i=l.expertise!==void 0&&l.expertise.length>0||Boolean(l.currentFocus)||Boolean(l.availability)||Boolean(l.email)||Boolean(l.website)||l.socialLinks!==void 0&&l.socialLinks.length>0;return kl(uS,{children:[kl(Pl,{title:r,description:f,ogType:"profile"},void 0,!1,void 0,this),kl("div",{className:"about-page bg-theme",children:[kl("header",{className:"hero-bg-pattern relative w-full py-16 md:py-24 px-6 md:px-12 bg-theme overflow-hidden",children:kl("div",{className:"relative z-10 max-w-4xl mx-auto",children:[kl("h1",{className:"text-5xl md:text-6xl font-semibold mb-6 text-heading",children:["About ",l.name||"Me"]},void 0,!0,void 0,this),l.description&&kl("p",{className:"text-xl md:text-2xl text-theme-muted leading-relaxed",children:l.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),kl("div",{className:"container mx-auto px-6 md:px-12 max-w-4xl py-12 md:py-16",children:[l.story&&kl("section",{className:"content-section-reveal mb-20 md:mb-28",children:kl(q1,{markdown:l.story},void 0,!1,void 0,this)},void 0,!1,void 0,this),i&&kl("div",{className:"content-section-reveal grid md:grid-cols-2 gap-x-16 gap-y-12",children:[l.expertise&&l.expertise.length>0&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Expertise"},void 0,!1,void 0,this),kl("ul",{className:"flex flex-wrap gap-3",children:l.expertise.map((n,u)=>kl("li",{className:i3({variant:"accent",size:"lg"}),children:n},u,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.currentFocus&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Current Focus"},void 0,!1,void 0,this),kl("p",{className:"text-lg text-theme leading-relaxed",children:l.currentFocus},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.availability&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Availability"},void 0,!1,void 0,this),kl("p",{className:"text-lg text-theme leading-relaxed",children:l.availability},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(Boolean(l.email)||Boolean(l.website)||l.socialLinks!==void 0&&l.socialLinks.length>0)&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Contact"},void 0,!1,void 0,this),kl("div",{className:"space-y-4",children:[l.email&&kl("p",{className:"text-lg",children:kl("a",{href:`mailto:${l.email}`,className:"text-brand hover:text-brand-dark transition-colors",children:l.email},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.website&&kl("p",{className:"text-lg",children:kl("a",{href:l.website,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:text-brand-dark transition-colors",children:l.website},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.socialLinks&&l.socialLinks.length>0&&kl("div",{className:"flex flex-wrap gap-4 mt-4",children:l.socialLinks.map((n,u)=>kl(Vr,{href:n.url,external:!0,variant:"secondary",size:"md",children:n.label?.length?n.label:n.platform},u,!1,void 0,this))},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)]},void 0,!0,void 0,this)};import{jsxDEV as $r,Fragment as VW}from"preact/jsx-dev-runtime";var M4=()=>{return $r(VW,{children:[$r(Pl,{title:"Thanks for subscribing!",description:"You've successfully subscribed to the newsletter."},void 0,!1,void 0,this),$r("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:$r("div",{className:"text-center max-w-md",children:[$r("div",{className:"text-6xl mb-6",children:"\uD83C\uDF89"},void 0,!1,void 0,this),$r("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Thanks for subscribing!"},void 0,!1,void 0,this),$r("p",{className:"text-lg text-theme-muted mb-8",children:"You'll receive a confirmation email shortly. Check your inbox to confirm your subscription."},void 0,!1,void 0,this),$r(Vr,{href:"/",variant:"primary",children:"Back to Home"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},V4=()=>{return $r(VW,{children:[$r(Pl,{title:"Subscription failed",description:"There was a problem with your subscription."},void 0,!1,void 0,this),$r("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:$r("div",{className:"text-center max-w-md",children:[$r("div",{className:"text-6xl mb-6",children:"\uD83D\uDE22"},void 0,!1,void 0,this),$r("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Something went wrong"},void 0,!1,void 0,this),$r("p",{className:"text-lg text-theme-muted mb-8",children:"We couldn't process your subscription. Please try again or contact us if the problem persists."},void 0,!1,void 0,this),$r(Vr,{href:"/",variant:"primary",children:"Back to Home"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var IW=c.object({label:c.string().describe("Display label for entity type (e.g., 'Essay')"),pluralName:c.string().optional().describe("URL path segment (defaults to label.toLowerCase() + 's')")}),tS={post:{label:"Post"},deck:{label:"Deck"}},qW=c.object({entityDisplay:c.object({post:IW,deck:IW}).default(tS).describe("Display metadata for post and deck entity types used by the homepage")});var _W={name:"@brains/site-professional",version:"0.2.0-alpha.236",description:"Professional site composition package",dependencies:{"@brains/blog":"workspace:*","@brains/decks":"workspace:*","@brains/plugins":"workspace:*","@brains/profile":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-engine":"workspace:*","@brains/site-info":"workspace:*","@brains/templates":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*",preact:"^10.27.2"},devDependencies:{"@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},files:["src"],private:!0,scripts:{lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",typecheck:"tsc --noEmit"},type:"module"};var oS=c.object({blurb:c.string().optional().describe("Short italic subtitle under the section title")}),wS=c.object({heading:c.string(),buttonText:c.string(),buttonLink:c.string()}),vS=c.looseObject({id:c.string(),entityType:c.literal("post"),content:c.string(),created:c.string(),updated:c.string(),contentHash:c.string(),metadata:c.looseObject({title:c.string(),publishedAt:c.string().optional()}),frontmatter:c.looseObject({excerpt:c.string(),seriesName:c.string().optional(),seriesIndex:c.number().optional()}),body:c.string(),url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),seriesUrl:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional(),coverImageSrcset:c.string().optional(),coverImageSizes:c.string().optional()}),mS=c.looseObject({id:c.string(),entityType:c.literal("deck"),content:c.string(),created:c.string(),updated:c.string(),contentHash:c.string(),metadata:c.looseObject({title:c.string(),publishedAt:c.string().optional()}),frontmatter:c.looseObject({title:c.string(),description:c.string().optional(),publishedAt:c.string().optional()}),body:c.string(),url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional()});class I4 extends Pn{dependencies=["blog","decks"];constructor(l){super("professional-site",_W,l,qW)}async onRegister(l){let r=this.config.entityDisplay.post,f=this.config.entityDisplay.deck,i=`/${r.pluralName??r.label.toLowerCase()+"s"}`,n=`/${f.pluralName??f.label.toLowerCase()+"s"}`,u=new O5(i,n);l.entities.registerDataSource(u);let t=new X5;l.entities.registerDataSource(t);let o=c.object({profile:If,posts:c.array(vS),decks:c.array(mS),postsListUrl:c.string(),decksListUrl:c.string(),cta:wS,sections:c.record(c.string(),oS)}),w=c.object({profile:If}),v=c.object({});l.templates.register({"homepage-list":Jl({name:"homepage-list",description:"Professional homepage with essays and presentations",schema:o,dataSourceId:"professional:homepage-list",requiredPermission:"public",layout:{component:P4}}),about:Jl({name:"about",description:"About page with full profile information",schema:w,dataSourceId:"professional:about",requiredPermission:"public",layout:{component:p4}}),"subscribe-thanks":Jl({name:"subscribe-thanks",description:"Newsletter subscription success page",schema:v,requiredPermission:"public",layout:{component:M4}}),"subscribe-error":Jl({name:"subscribe-error",description:"Newsletter subscription error page",schema:v,requiredPermission:"public",layout:{component:V4}})}),this.logger.info("Professional site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function q4(l){return new I4(l??{})}var _4=[{id:"home",path:"/",title:"Home",description:"Professional site homepage",layout:"default",navigation:{show:!0,label:"Home",slot:"secondary",priority:10},sections:[{id:"homepage",template:"professional-site:homepage-list",dataQuery:{}}]},{id:"about",path:"/about",title:"About",description:"About page",layout:"default",navigation:{show:!0,label:"About",slot:"primary",priority:90},sections:[{id:"about",template:"professional-site:about",dataQuery:{}}]},{id:"subscribe-thanks",path:"/subscribe/thanks",title:"Thanks for subscribing",description:"Newsletter subscription confirmation",layout:"default",navigation:{show:!1},sections:[{id:"subscribe-thanks",template:"professional-site:subscribe-thanks",dataQuery:{},content:{}}]},{id:"subscribe-error",path:"/subscribe/error",title:"Subscription failed",description:"Newsletter subscription error",layout:"default",navigation:{show:!1},sections:[{id:"subscribe-error",template:"professional-site:subscribe-error",dataQuery:{},content:{}}]}];import{jsxDEV as Y5}from"preact/jsx-dev-runtime";function S4({sections:l,siteInfo:r,slots:f,wordmark:i}){return Y5("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[Y5(cu,{title:r.title,navigation:r.navigation.primary,showThemeToggle:!0,...r.logo!==void 0?{logo:r.logo}:{},...i!==void 0?{wordmark:i}:{}},void 0,!1,void 0,this),Y5("main",{className:"flex-grow flex flex-col bg-theme",children:l},void 0,!1,void 0,this),Y5(l3,{primaryNavigation:r.navigation.primary,secondaryNavigation:r.navigation.secondary,copyright:r.copyright,socialLinks:r.socialLinks,title:r.title,tagline:r.description,children:f?.getSlot("footer-top").map((n)=>n.render())},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function SW(l){return l}var I30=c4;function q30(l){return SW(d4(l))}var kS=g4,_30=kS,S30=S4;function D30(l){return SW(q4(l))}var x30=_4;export{kS as routes,D30 as professionalSitePlugin,x30 as professionalRoutes,q30 as personalSitePlugin,_30 as personalRoutes,S30 as ProfessionalLayout,I30 as PersonalLayout};
1683
+ ${f.content}`,templateName:"decks:description",representedIdentity:"none"})})}}class O5{postsListUrl;decksListUrl;id="professional:homepage-list";name="Homepage List DataSource";description="Fetches profile, blog posts, and presentation decks for homepage";constructor(l,r){this.postsListUrl=l,this.decksListUrl=r}async fetch(l,r,f){let i=f.entityService,[n,u,t,o]=await Promise.all([H1(i,$t),Ri(i,{entityType:"post",count:3,parse:Sf}),Ri(i,{entityType:"deck",count:3,parse:dt}),_f(i)]),w={profile:n,posts:u,decks:t,postsListUrl:this.postsListUrl,decksListUrl:this.decksListUrl,cta:pn(o.cta),sections:o.sections??{}};return r.parse(w)}}class X5{id="professional:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(l,r,f){let n={profile:await H1(f.entityService,$t)};return r.parse(n)}}import{jsxDEV as Kl,Fragment as nS}from"preact/jsx-dev-runtime";var fS="grid md:grid-cols-[14rem_1px_1fr] gap-y-2 gap-x-0 md:gap-16 items-start",iS="border-t md:border-t-0 md:border-l border-rule-strong md:self-stretch",L4=({number:l,title:r,blurb:f,children:i})=>Kl("section",{className:"py-20 border-b border-rule px-6 md:px-12",children:Kl("div",{className:"max-w-6xl mx-auto",children:Kl("div",{className:fS,children:[Kl(h3,{title:r,number:l,blurb:f},void 0,!1,void 0,this),Kl("div",{className:iS,"aria-hidden":"true"},void 0,!1,void 0,this),Kl("div",{className:"mt-6 md:mt-0",children:i},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),P4=({profile:l,posts:r,decks:f,postsListUrl:i,decksListUrl:n,cta:u,sections:t})=>{let o=l.tagline?.length?l.tagline:l.description,w=r.map((d)=>({id:d.id,url:d.url,title:d.metadata.title,date:d.metadata.publishedAt??d.created,description:d.frontmatter.excerpt,series:d.frontmatter.seriesName&&d.frontmatter.seriesIndex?{name:d.frontmatter.seriesName,index:d.frontmatter.seriesIndex}:void 0})),v=f.map((d)=>({id:d.id,url:d.url,title:d.frontmatter.title||d.id,date:d.frontmatter.publishedAt??d.created,description:d.frontmatter.description})),k=l.name||"Home",$=[l.intro,l.description,o].find((d)=>d)??"Professional site",b=Boolean(l.description)||l.expertise!==void 0&&l.expertise.length>0;return Kl(nS,{children:[Kl(Pl,{title:k,description:$,ogType:"website"},void 0,!1,void 0,this),Kl("div",{className:"homepage-list bg-theme",children:[Kl("header",{className:"hero-bg-pattern relative w-full px-6 md:px-12 pt-28 pb-24 md:pt-28 md:pb-24 overflow-hidden border-b border-rule",children:Kl("div",{className:"relative z-10 max-w-6xl mx-auto w-full",children:[l.name&&Kl("div",{className:"flex items-center gap-[0.6rem] mb-6 font-mono text-[0.7rem] font-medium uppercase tracking-[0.22em] text-accent",children:[Kl("span",{className:"w-[18px] h-px bg-accent","aria-hidden":"true"},void 0,!1,void 0,this),Kl("span",{children:l.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o&&Kl("h1",{className:"font-heading text-[clamp(2.75rem,6.5vw,5.5rem)] font-normal text-heading leading-[1.02] tracking-[-0.025em] max-w-[18ch] [font-variation-settings:'opsz'_144,'SOFT'_30]",children:nh(o,"italic font-normal text-accent [font-variation-settings:'opsz'_144,'SOFT'_80]")},void 0,!1,void 0,this),l.intro&&Kl("p",{className:"font-heading font-light text-[clamp(1.1rem,1.8vw,1.4rem)] leading-[1.5] text-theme-muted max-w-[42ch] mt-8 [font-variation-settings:'opsz'_24]",children:nh(l.intro,"italic text-accent")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Kl(L4,{number:"01",title:"Essays",blurb:t.essays?.blurb,children:Kl(ih,{items:w,viewAllUrl:i,viewAllLabel:"View all essays"},void 0,!1,void 0,this)},void 0,!1,void 0,this),v.length>0&&Kl(L4,{number:"02",title:"Presentations",blurb:t.presentations?.blurb,children:Kl(ih,{items:v,viewAllUrl:n,viewAllLabel:"View all presentations"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b&&Kl(L4,{number:"03",title:"About",blurb:t.about?.blurb,children:Kl("div",{className:"flex flex-col gap-8",children:[l.description&&Kl("p",{className:"font-heading font-light text-[1.25rem] leading-[1.55] text-theme max-w-[55ch] [font-variation-settings:'opsz'_24,'SOFT'_50]",children:l.description},void 0,!1,void 0,this),l.expertise&&l.expertise.length>0&&Kl(o3,{subjects:l.expertise},void 0,!1,void 0,this),Kl("a",{href:"/about",className:"mt-6 inline-flex items-center gap-2 font-mono text-[0.7rem] font-medium uppercase tracking-[0.18em] text-accent pb-1 relative before:content-[''] before:absolute before:left-0 before:right-full before:bottom-0 before:h-px before:bg-accent before:transition-[right] before:duration-300 hover:before:right-0",children:["Learn more",Kl("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Kl(sw,{cta:u,variant:"editorial",socialLinks:l.socialLinks},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};import{jsxDEV as kl,Fragment as uS}from"preact/jsx-dev-runtime";var p4=({profile:l})=>{let r=`About ${l.name||"Me"}`,f=[l.description,l.intro].find((n)=>n)??"About page",i=l.expertise!==void 0&&l.expertise.length>0||Boolean(l.currentFocus)||Boolean(l.availability)||Boolean(l.email)||Boolean(l.website)||l.socialLinks!==void 0&&l.socialLinks.length>0;return kl(uS,{children:[kl(Pl,{title:r,description:f,ogType:"profile"},void 0,!1,void 0,this),kl("div",{className:"about-page bg-theme",children:[kl("header",{className:"hero-bg-pattern relative w-full py-16 md:py-24 px-6 md:px-12 bg-theme overflow-hidden",children:kl("div",{className:"relative z-10 max-w-4xl mx-auto",children:[kl("h1",{className:"text-5xl md:text-6xl font-semibold mb-6 text-heading",children:["About ",l.name||"Me"]},void 0,!0,void 0,this),l.description&&kl("p",{className:"text-xl md:text-2xl text-theme-muted leading-relaxed",children:l.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),kl("div",{className:"container mx-auto px-6 md:px-12 max-w-4xl py-12 md:py-16",children:[l.story&&kl("section",{className:"content-section-reveal mb-20 md:mb-28",children:kl(q1,{markdown:l.story},void 0,!1,void 0,this)},void 0,!1,void 0,this),i&&kl("div",{className:"content-section-reveal grid md:grid-cols-2 gap-x-16 gap-y-12",children:[l.expertise&&l.expertise.length>0&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Expertise"},void 0,!1,void 0,this),kl("ul",{className:"flex flex-wrap gap-3",children:l.expertise.map((n,u)=>kl("li",{className:i3({variant:"accent",size:"lg"}),children:n},u,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.currentFocus&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Current Focus"},void 0,!1,void 0,this),kl("p",{className:"text-lg text-theme leading-relaxed",children:l.currentFocus},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.availability&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Availability"},void 0,!1,void 0,this),kl("p",{className:"text-lg text-theme leading-relaxed",children:l.availability},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(Boolean(l.email)||Boolean(l.website)||l.socialLinks!==void 0&&l.socialLinks.length>0)&&kl("section",{children:[kl("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Contact"},void 0,!1,void 0,this),kl("div",{className:"space-y-4",children:[l.email&&kl("p",{className:"text-lg",children:kl("a",{href:`mailto:${l.email}`,className:"text-brand hover:text-brand-dark transition-colors",children:l.email},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.website&&kl("p",{className:"text-lg",children:kl("a",{href:l.website,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:text-brand-dark transition-colors",children:l.website},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.socialLinks&&l.socialLinks.length>0&&kl("div",{className:"flex flex-wrap gap-4 mt-4",children:l.socialLinks.map((n,u)=>kl(Vr,{href:n.url,external:!0,variant:"secondary",size:"md",children:n.label?.length?n.label:n.platform},u,!1,void 0,this))},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)]},void 0,!0,void 0,this)};import{jsxDEV as $r,Fragment as VW}from"preact/jsx-dev-runtime";var M4=()=>{return $r(VW,{children:[$r(Pl,{title:"Thanks for subscribing!",description:"You've successfully subscribed to the newsletter."},void 0,!1,void 0,this),$r("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:$r("div",{className:"text-center max-w-md",children:[$r("div",{className:"text-6xl mb-6",children:"\uD83C\uDF89"},void 0,!1,void 0,this),$r("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Thanks for subscribing!"},void 0,!1,void 0,this),$r("p",{className:"text-lg text-theme-muted mb-8",children:"You'll receive a confirmation email shortly. Check your inbox to confirm your subscription."},void 0,!1,void 0,this),$r(Vr,{href:"/",variant:"primary",children:"Back to Home"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},V4=()=>{return $r(VW,{children:[$r(Pl,{title:"Subscription failed",description:"There was a problem with your subscription."},void 0,!1,void 0,this),$r("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:$r("div",{className:"text-center max-w-md",children:[$r("div",{className:"text-6xl mb-6",children:"\uD83D\uDE22"},void 0,!1,void 0,this),$r("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Something went wrong"},void 0,!1,void 0,this),$r("p",{className:"text-lg text-theme-muted mb-8",children:"We couldn't process your subscription. Please try again or contact us if the problem persists."},void 0,!1,void 0,this),$r(Vr,{href:"/",variant:"primary",children:"Back to Home"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var IW=c.object({label:c.string().describe("Display label for entity type (e.g., 'Essay')"),pluralName:c.string().optional().describe("URL path segment (defaults to label.toLowerCase() + 's')")}),tS={post:{label:"Post"},deck:{label:"Deck"}},qW=c.object({entityDisplay:c.object({post:IW,deck:IW}).default(tS).describe("Display metadata for post and deck entity types used by the homepage")});var _W={name:"@brains/site-professional",version:"0.2.0-alpha.237",description:"Professional site composition package",dependencies:{"@brains/blog":"workspace:*","@brains/decks":"workspace:*","@brains/plugins":"workspace:*","@brains/profile":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-engine":"workspace:*","@brains/site-info":"workspace:*","@brains/templates":"workspace:*","@brains/ui-library":"workspace:*","@brains/utils":"workspace:*",preact:"^10.27.2"},devDependencies:{"@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"^1.3.14","bun-types":"^1.3.14",eslint:"^10.5.0",typescript:"^7.0.2"},exports:{".":"./src/index.ts"},files:["src"],private:!0,scripts:{lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",typecheck:"tsc --noEmit"},type:"module"};var oS=c.object({blurb:c.string().optional().describe("Short italic subtitle under the section title")}),wS=c.object({heading:c.string(),buttonText:c.string(),buttonLink:c.string()}),vS=c.looseObject({id:c.string(),entityType:c.literal("post"),content:c.string(),created:c.string(),updated:c.string(),contentHash:c.string(),metadata:c.looseObject({title:c.string(),publishedAt:c.string().optional()}),frontmatter:c.looseObject({excerpt:c.string(),seriesName:c.string().optional(),seriesIndex:c.number().optional()}),body:c.string(),url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),seriesUrl:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional(),coverImageSrcset:c.string().optional(),coverImageSizes:c.string().optional()}),mS=c.looseObject({id:c.string(),entityType:c.literal("deck"),content:c.string(),created:c.string(),updated:c.string(),contentHash:c.string(),metadata:c.looseObject({title:c.string(),publishedAt:c.string().optional()}),frontmatter:c.looseObject({title:c.string(),description:c.string().optional(),publishedAt:c.string().optional()}),body:c.string(),url:c.string().optional(),typeLabel:c.string().optional(),listUrl:c.string().optional(),listLabel:c.string().optional(),coverImageUrl:c.string().optional(),ogImageUrl:c.string().optional(),coverImageWidth:c.number().optional(),coverImageHeight:c.number().optional()});class I4 extends Pn{dependencies=["blog","decks"];constructor(l){super("professional-site",_W,l,qW)}async onRegister(l){let r=this.config.entityDisplay.post,f=this.config.entityDisplay.deck,i=`/${r.pluralName??r.label.toLowerCase()+"s"}`,n=`/${f.pluralName??f.label.toLowerCase()+"s"}`,u=new O5(i,n);l.entities.registerDataSource(u);let t=new X5;l.entities.registerDataSource(t);let o=c.object({profile:If,posts:c.array(vS),decks:c.array(mS),postsListUrl:c.string(),decksListUrl:c.string(),cta:wS,sections:c.record(c.string(),oS)}),w=c.object({profile:If}),v=c.object({});l.templates.register({"homepage-list":Jl({name:"homepage-list",description:"Professional homepage with essays and presentations",schema:o,dataSourceId:"professional:homepage-list",requiredPermission:"public",layout:{component:P4}}),about:Jl({name:"about",description:"About page with full profile information",schema:w,dataSourceId:"professional:about",requiredPermission:"public",layout:{component:p4}}),"subscribe-thanks":Jl({name:"subscribe-thanks",description:"Newsletter subscription success page",schema:v,requiredPermission:"public",layout:{component:M4}}),"subscribe-error":Jl({name:"subscribe-error",description:"Newsletter subscription error page",schema:v,requiredPermission:"public",layout:{component:V4}})}),this.logger.info("Professional site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function q4(l){return new I4(l??{})}var _4=[{id:"home",path:"/",title:"Home",description:"Professional site homepage",layout:"default",navigation:{show:!0,label:"Home",slot:"secondary",priority:10},sections:[{id:"homepage",template:"professional-site:homepage-list",dataQuery:{}}]},{id:"about",path:"/about",title:"About",description:"About page",layout:"default",navigation:{show:!0,label:"About",slot:"primary",priority:90},sections:[{id:"about",template:"professional-site:about",dataQuery:{}}]},{id:"subscribe-thanks",path:"/subscribe/thanks",title:"Thanks for subscribing",description:"Newsletter subscription confirmation",layout:"default",navigation:{show:!1},sections:[{id:"subscribe-thanks",template:"professional-site:subscribe-thanks",dataQuery:{},content:{}}]},{id:"subscribe-error",path:"/subscribe/error",title:"Subscription failed",description:"Newsletter subscription error",layout:"default",navigation:{show:!1},sections:[{id:"subscribe-error",template:"professional-site:subscribe-error",dataQuery:{},content:{}}]}];import{jsxDEV as Y5}from"preact/jsx-dev-runtime";function S4({sections:l,siteInfo:r,slots:f,wordmark:i}){return Y5("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[Y5(cu,{title:r.title,navigation:r.navigation.primary,showThemeToggle:!0,...r.logo!==void 0?{logo:r.logo}:{},...i!==void 0?{wordmark:i}:{}},void 0,!1,void 0,this),Y5("main",{className:"flex-grow flex flex-col bg-theme",children:l},void 0,!1,void 0,this),Y5(l3,{primaryNavigation:r.navigation.primary,secondaryNavigation:r.navigation.secondary,copyright:r.copyright,socialLinks:r.socialLinks,title:r.title,tagline:r.description,children:f?.getSlot("footer-top").map((n)=>n.render())},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function SW(l){return l}var I30=c4;function q30(l){return SW(d4(l))}var kS=g4,_30=kS,S30=S4;function D30(l){return SW(q4(l))}var x30=_4;export{kS as routes,D30 as professionalSitePlugin,x30 as professionalRoutes,q30 as personalSitePlugin,_30 as personalRoutes,S30 as ProfessionalLayout,I30 as PersonalLayout};
1684
1684
 
1685
- //# debugId=0D95113E5F5F2AC464756E2164756E21
1685
+ //# debugId=05AAB2685035D1AF64756E2164756E21
1686
1686
  //# sourceMappingURL=site.js.map