@rizom/brain 0.2.0-alpha.95 → 0.2.0-alpha.96

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
- function t(i){return i}var e={name:"@rizom/brain",version:"0.2.0-alpha.95",description:"Brain runtime + CLI \u2014 scaffold, run, and manage AI brain instances",type:"module",bin:{brain:"./dist/brain.js"},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"],scripts:{build:"bun scripts/build.ts",prepublishOnly:"bun scripts/build.ts","dev:start":"bun dist/brain.js start",typecheck:"tsc --noEmit",test:"bun test",lint:"eslint . --ext .ts"},dependencies:{"@clack/prompts":"^0.11.0","@modelcontextprotocol/sdk":"^1.24.0","@tailwindcss/postcss":"^4.1.13","@tailwindcss/typography":"^0.5.19",postcss:"^8.5.6",preact:"^10.27.2","preact-render-to-string":"^6.3.1",tailwindcss:"^4.1.11"},optionalDependencies:{"@bitwarden/sdk-napi":"^1.0.0","@libsql/client":"^0.15.7","@tailwindcss/oxide":"^4.1.4","better-sqlite3":"^11.8.1",lightningcss:"^1.29.2","playwright-core":"^1.56.0","react-devtools-core":"^6.1.1",sharp:"^0.34.5"},devDependencies:{"@brains/app":"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-default":"workspace:*","@brains/theme-rizom":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@types/bun":"latest",rollup:"^4.60.2","rollup-plugin-dts":"^6.4.1",typescript:"^5.3.3"},publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brain-cli"},license:"Apache-2.0",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brain-cli#readme",bugs:"https://github.com/rizom-ai/brains/issues",engines:{bun:">=1.3.3"},keywords:["brain","ai","cli","mcp","agent","personal-ai","knowledge-management"]};var n=e.version;export{t as defineBrain,n as PLUGIN_API_VERSION};
2
+ function t(i){return i}var e={name:"@rizom/brain",version:"0.2.0-alpha.96",description:"Brain runtime + CLI \u2014 scaffold, run, and manage AI brain instances",type:"module",bin:{brain:"./dist/brain.js"},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"],scripts:{build:"bun scripts/build.ts",prepublishOnly:"bun scripts/build.ts","dev:start":"bun dist/brain.js start",typecheck:"tsc --noEmit",test:"bun test",lint:"eslint . --ext .ts"},dependencies:{"@clack/prompts":"^0.11.0","@modelcontextprotocol/sdk":"^1.24.0","@tailwindcss/postcss":"^4.1.13","@tailwindcss/typography":"^0.5.19",postcss:"^8.5.6",preact:"^10.27.2","preact-render-to-string":"^6.3.1",tailwindcss:"^4.1.11"},optionalDependencies:{"@bitwarden/sdk-napi":"^1.0.0","@libsql/client":"^0.15.7","@tailwindcss/oxide":"^4.1.4","better-sqlite3":"^11.8.1",lightningcss:"^1.29.2","playwright-core":"^1.56.0","react-devtools-core":"^6.1.1",sharp:"^0.34.5"},devDependencies:{"@brains/app":"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-default":"workspace:*","@brains/theme-rizom":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@types/bun":"latest",rollup:"^4.60.2","rollup-plugin-dts":"^6.4.1",typescript:"^5.3.3"},publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brain-cli"},license:"Apache-2.0",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brain-cli#readme",bugs:"https://github.com/rizom-ai/brains/issues",engines:{bun:">=1.3.3"},keywords:["brain","ai","cli","mcp","agent","personal-ai","knowledge-management"]};var n=e.version;export{t as defineBrain,n as PLUGIN_API_VERSION};
3
3
 
4
- //# debugId=C6FBE7D0B5DD577364756E2164756E21
4
+ //# debugId=25B6FA5B09F3C70764756E2164756E21
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 = packageJson.version;\n"
7
7
  ],
8
8
  "mappings": ";AAkEO,SAAS,CAAW,CAAC,EAA8C,CACxE,OAAO,wsFC1DF,IAAM,EAAqB,EAAY",
9
- "debugId": "C6FBE7D0B5DD577364756E2164756E21",
9
+ "debugId": "25B6FA5B09F3C70764756E2164756E21",
10
10
  "names": []
11
11
  }
package/dist/site.js CHANGED
@@ -978,7 +978,7 @@ The excerpt should be clear, concise, and compelling.`});H0();_5();M3();import{j
978
978
  Note: This is part of a series called "${X.seriesName}".`:""}`;return w.ai.generate({prompt:W,templateName:"blog:generation"})}),w.eval.registerHandler("generateExcerpt",async($)=>{let X=w70.parse($);return w.ai.generate({prompt:`Title: ${X.title}
979
979
 
980
980
  Content:
981
- ${X.content}`,templateName:"blog:excerpt"})})}var Tj={name:"@brains/blog",private:!0,version:"0.2.0-alpha.95",description:"AI-powered blog post generation from existing brain content",type:"module",exports:{".":"./src/index.ts"},scripts:{typecheck:"tsc --noEmit",test:"bun test",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix",eval:"cd evals && bun run brain-eval"},dependencies:{"@brains/contracts":"workspace:*","@brains/plugins":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};class Sj extends g6{entityType=t4.entityType;schema=y8;adapter=t4;constructor(w={}){super("blog",Tj,w,rf)}getEntityTypeConfig(){return{weight:2,publish:{publishStatuses:["queued","published"]}}}createGenerationHandler(w){return new cf(this.logger.child("BlogGenerationJobHandler"),w)}getTemplates(){return Dj()}getDataSources(){return[new nf(this.logger.child("BlogDataSource"))]}async onRegister(w){let{RSSDataSource:$}=await Promise.resolve().then(() => (Ij(),jj));w.entities.registerDataSource(new $(this.logger.child("RSSDataSource"))),await vj(w,this.logger),Lj(w,this.logger),Pj(w,this.logger),kj(w),this.logger.info("Blog plugin registered (routes auto-generated at /posts/)")}}M3();kw();Q1();i4();H0();Q1();i4();var Cj=Z.object({}),QJ=y2.extend({id:Z.literal("site-info"),entityType:Z.literal("site-info"),metadata:Cj}),M$=SW,H7=bW.omit({url:!0,analyticsScript:!0});Q1();class $6 extends t2{constructor(){super({entityType:"site-info",schema:QJ,frontmatterSchema:H7,isSingleton:!0,hasBody:!1})}createSiteInfoContent(w){let $=H7.parse(w);return this.buildMarkdown("",$)}parseSiteInfoBody(w){return this.parseFrontmatter(w)}fromMarkdown(w){return{content:w,entityType:"site-info"}}extractMetadata(w){return{}}generateFrontMatter(w){let $=this.parseFrontmatter(w.content);return this.buildMarkdown("",$)}}var Sr0=new $6;var dr0=new $6;var J70=new $6;async function Q9(w){let X=(await w.listEntities({entityType:"site-info",options:{limit:1}}))[0];if(!X)throw Error("Site info not found \u2014 create a site-info entity");return J70.parseSiteInfoBody(X.content)}H0();var G70=H7.extend({navigation:Z.object({primary:Z.array(Z.object({label:Z.string(),href:Z.string(),priority:Z.number()})),secondary:Z.array(Z.object({label:Z.string(),href:Z.string(),priority:Z.number()}))}),copyright:Z.string(),socialLinks:Z.array(Z.object({platform:Z.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:Z.string().describe("Profile or contact URL"),label:Z.string().optional().describe("Optional display label")})).optional().describe("Social media links from profile entity")});Q1();var AJ=b8,t6=B3.extend(AJ.shape);Q1();s4();H0();var K70=new T5;class FJ{postsListUrl;id="personal:homepage";name="Personal Homepage DataSource";description="Fetches profile and blog posts for a personal homepage";constructor(w){this.postsListUrl=w}async fetch(w,$,X){let W=X.entityService,[Y,J,G]=await Promise.all([V3(W),W.listEntities({entityType:"post",options:{limit:20}}),Q9(W)]),K=K70.parseProfileBody(Y,t6),H=J.sort(f8).slice(0,6).map(e4);if(!G.cta)throw Error("CTA not configured in site-info");let f={profile:K,posts:H,postsListUrl:this.postsListUrl,cta:G.cta};return $.parse(f)}}Q1();s4();var H70=new T5;class OJ{id="personal:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(w,$,X){let W=await V3(X.entityService),J={profile:H70.parseProfileBody(W,t6)};return $.parse(J)}}import{jsxDEV as Y1,Fragment as bj}from"preact/jsx-dev-runtime";function U70(w){return new Date(w).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function f70(w){return w.split(/(\*[^*]+\*)/).map(($,X)=>{if($.startsWith("*")&&$.endsWith("*")&&$.length>2)return Y1("em",{className:"font-sans italic font-medium text-theme-inverse tracking-[-0.015em] [font-variation-settings:'opsz'_72]",children:$.slice(1,-1)},X,!1,void 0,this);return $})}var sA=({profile:w,posts:$,postsListUrl:X,cta:W})=>{let Y=w.tagline??w.description,J=w.name.split(" ")[0];return Y1(bj,{children:[Y1(V2,{title:w.name,description:w.description??Y??"Personal site",ogType:"website"},void 0,!1,void 0,this),Y1("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:Y1("div",{className:"w-full max-w-[1100px] mx-auto text-center flex flex-col items-center gap-7",children:[Y&&Y1("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:f70(Y)},void 0,!1,void 0,this),w.description&&Y1("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:w.description},void 0,!1,void 0,this),Y1("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[Y1("a",{href:X,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 ",Y1("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y1("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 ",J]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.length>0&&Y1("section",{className:"flex flex-col py-24 px-6 md:px-12 gap-11 bg-theme-subtle",children:[Y1("div",{className:"flex justify-between items-end max-w-layout mx-auto w-full gap-6 flex-wrap",children:[Y1("div",{children:[Y1("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),Y1("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"," ",Y1("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),Y1("a",{href:X,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 ",Y1("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y1("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,320px),1fr))] gap-8 max-w-layout mx-auto w-full",children:$.map((G)=>Y1("a",{href:G.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:[G.coverImageUrl?Y1("img",{src:G.coverImageUrl,alt:G.metadata.title,className:"w-full aspect-[16/10] object-cover bg-theme-muted"},void 0,!1,void 0,this):Y1("div",{className:"w-full aspect-[16/10] bg-gradient-to-br from-brand to-accent","aria-hidden":"true"},void 0,!1,void 0,this),Y1("div",{className:"flex flex-col gap-4 p-7 flex-1",children:[Y1("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:[G.frontmatter.seriesName&&Y1(bj,{children:[Y1("span",{className:"text-brand",children:G.frontmatter.seriesName},void 0,!1,void 0,this),Y1("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),Y1("time",{children:U70(G.metadata.publishedAt??G.created)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y1("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:G.metadata.title},void 0,!1,void 0,this),G.frontmatter.excerpt&&Y1("p",{className:"text-base leading-[1.55] text-theme-muted m-0 flex-1",children:G.frontmatter.excerpt},void 0,!1,void 0,this),Y1("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"," ",Y1("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)]},G.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y1("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:[Y1("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),Y1("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:W.heading},void 0,!1,void 0,this),W.subtitle&&Y1("p",{className:"text-center text-base leading-[1.55] text-theme-on-dark opacity-80 max-w-[480px] m-0",children:W.subtitle},void 0,!1,void 0,this),Y1("a",{href:W.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:[W.buttonText," ",Y1("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 v2,Fragment as Q70}from"preact/jsx-dev-runtime";var tA=({profile:w})=>{let $=`About ${w.name}`,X=w.description??w.intro??"About page",W=Boolean(w.email??w.website);return v2(Q70,{children:[v2(V2,{title:$,description:X,ogType:"profile"},void 0,!1,void 0,this),v2("section",{className:"hero-decor bg-brand text-theme-inverse relative flex flex-col px-6 md:px-12 pt-32 pb-24",children:v2("div",{className:"w-full max-w-3xl mx-auto flex flex-col gap-6",children:[v2("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:w.name},void 0,!1,void 0,this),w.description&&v2("p",{className:"text-[clamp(1.0625rem,1.4vw,1.25rem)] leading-[1.55] text-theme-inverse opacity-95 max-w-2xl m-0",children:w.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),w.story&&v2("section",{className:`py-24 px-6 md:px-12 bg-theme-subtle${W?"":" flex-grow"}`,children:v2("div",{className:"max-w-3xl mx-auto",children:v2(f9,{markdown:w.story},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),W&&v2("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:[v2("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),v2("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"," ",v2("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),v2("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[w.email&&v2("a",{href:`mailto:${w.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 ",v2("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.website&&v2("a",{href:w.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 xj={name:"@brains/site-personal",private:!0,version:"0.2.0-alpha.95",description:"Personal site composition package",type:"module",exports:{".":"./src/index.ts"},files:["src"],scripts:{typecheck:"tsc --noEmit",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix"},dependencies:{"@brains/blog":"workspace:*","@brains/identity-service":"workspace:*","@brains/plugins":"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":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};var F70=Z.object({entityDisplay:Z.object({post:Z.object({label:Z.string().default("Post"),pluralName:Z.string().optional()}).default({})}).default({})});class eA extends I8{dependencies=["blog"];constructor(w={}){super("personal-site",xj,w,F70)}async onRegister(w){w.entities.extendFrontmatterSchema("anchor-profile",AJ);let $=this.config.entityDisplay.post,X=`/${$.pluralName??$.label.toLowerCase()+"s"}`,W=new FJ(X);w.entities.registerDataSource(W);let Y=new OJ;w.entities.registerDataSource(Y);let J=Z.object({profile:t6,posts:Z.array(r5),postsListUrl:Z.string(),cta:M$}),G=Z.object({profile:t6});w.templates.register({homepage:T1({name:"homepage",description:"Personal homepage with recent blog posts",schema:J,dataSourceId:"personal:homepage",requiredPermission:"public",layout:{component:sA}}),about:T1({name:"about",description:"About page with profile",schema:G,dataSourceId:"personal:about",requiredPermission:"public",layout:{component:tA}})}),this.logger.info("Personal site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function wF(w){return new eA(w??{})}var $F=[{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 h5}from"preact/jsx-dev-runtime";function XF({sections:w,siteInfo:$}){let X=[...$.navigation.primary,...$.navigation.secondary].filter((W)=>W.label!=="Home");return h5("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[h5(A$,{title:$.title,titleClassName:"font-heading font-bold text-2xl",navigation:$.navigation.primary,showThemeToggle:!0,themeToggleClassName:"bg-theme-toggle text-theme-toggle-icon hover:bg-theme-toggle-hover rounded-[10px]",...$.logo!==void 0?{logo:$.logo}:{}},void 0,!1,void 0,this),h5("main",{className:"flex-grow flex flex-col",children:w},void 0,!1,void 0,this),h5("footer",{className:"bg-footer text-footer border-t border-theme",children:h5("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:[h5("div",{className:"flex flex-col gap-1 mb-4 md:mb-0",children:[h5("span",{className:"text-brand font-heading font-bold text-lg",children:$.title},void 0,!1,void 0,this),$.description&&h5("span",{className:"text-theme-muted text-xs",children:$.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h5("nav",{className:"flex flex-wrap justify-center gap-x-6 gap-y-2 mb-4 md:mb-0",children:X.map((W)=>h5("a",{href:W.href,className:"text-theme-muted text-[13px] hover:text-brand transition-colors",children:W.label},W.href,!1,void 0,this))},void 0,!1,void 0,this),h5("div",{className:"flex items-center gap-4",children:[$.copyright&&h5("span",{className:"text-theme-light text-[11px]",children:$.copyright},void 0,!1,void 0,this),h5(c6,{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)}Q1();H0();_5();Q1();H0();Q1();H0();H0();Q1();var O70=Z.enum(["generating","draft","queued","published","failed"]),yj="publishedAt is required when deck status is published",uj=(w)=>w.status==="published"&&!w.publishedAt,WF=(w)=>{if(uj(w))throw Error(yj)},e6=Z.object({title:Z.string(),slug:Z.string().optional(),description:Z.string().optional(),author:Z.string().optional(),status:O70,publishedAt:Z.string().datetime().optional(),event:Z.string().optional(),coverImageId:Z.string().optional()}),Z70=e6.pick({title:!0,description:!0,status:!0,publishedAt:!0,coverImageId:!0}).extend({slug:Z.string(),error:Z.string().optional()}).superRefine((w,$)=>{if(!uj(w))return;$.addIssue({code:Z.ZodIssueCode.custom,path:["publishedAt"],message:yj})}),ZJ=y2.extend({entityType:Z.literal("deck"),metadata:Z70}),zJ=ZJ.extend({frontmatter:e6,body:Z.string()}),N$=zJ.extend({url:Z.string().optional(),typeLabel:Z.string().optional(),listUrl:Z.string().optional(),listLabel:Z.string().optional(),coverImageUrl:Z.string().optional(),coverImageWidth:Z.number().optional(),coverImageHeight:Z.number().optional()});class YF extends t2{constructor(){super({entityType:"deck",schema:ZJ,frontmatterSchema:e6,supportsCoverImage:!0})}validateSlideStructure(w){if(!/^---$/gm.test(w))throw Error("Invalid deck: markdown must contain slide separators (---) to be a valid presentation")}toMarkdown(w){let $=this.extractBody(w.content);this.validateSlideStructure($);let X=this.parseFrontMatter(w.content,e6);WF(X);let W={...X,slug:X.slug??w.metadata.slug};return this.buildMarkdown($,W)}fromMarkdown(w){let $=this.parseFrontmatter(w),X=this.extractBody(w);WF($),this.validateSlideStructure(X);let W=$.slug??G5($.title),Y=$.status;return{entityType:"deck",content:w,metadata:{slug:W,title:$.title,description:$.description,status:Y,publishedAt:$.publishedAt,coverImageId:$.coverImageId}}}generateTitle(w){return w.metadata.title}generateSummary(w){if(w.metadata.description)return w.metadata.description;return`Presentation: ${w.metadata.title}`}generateFrontMatter(w){return this.toMarkdown(w)}buildStub(w){let $={title:w.title,slug:w.id,status:"generating"};return{content:this.buildMarkdown(`---
981
+ ${X.content}`,templateName:"blog:excerpt"})})}var Tj={name:"@brains/blog",private:!0,version:"0.2.0-alpha.96",description:"AI-powered blog post generation from existing brain content",type:"module",exports:{".":"./src/index.ts"},scripts:{typecheck:"tsc --noEmit",test:"bun test",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix",eval:"cd evals && bun run brain-eval"},dependencies:{"@brains/contracts":"workspace:*","@brains/plugins":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};class Sj extends g6{entityType=t4.entityType;schema=y8;adapter=t4;constructor(w={}){super("blog",Tj,w,rf)}getEntityTypeConfig(){return{weight:2,publish:{publishStatuses:["queued","published"]}}}createGenerationHandler(w){return new cf(this.logger.child("BlogGenerationJobHandler"),w)}getTemplates(){return Dj()}getDataSources(){return[new nf(this.logger.child("BlogDataSource"))]}async onRegister(w){let{RSSDataSource:$}=await Promise.resolve().then(() => (Ij(),jj));w.entities.registerDataSource(new $(this.logger.child("RSSDataSource"))),await vj(w,this.logger),Lj(w,this.logger),Pj(w,this.logger),kj(w),this.logger.info("Blog plugin registered (routes auto-generated at /posts/)")}}M3();kw();Q1();i4();H0();Q1();i4();var Cj=Z.object({}),QJ=y2.extend({id:Z.literal("site-info"),entityType:Z.literal("site-info"),metadata:Cj}),M$=SW,H7=bW.omit({url:!0,analyticsScript:!0});Q1();class $6 extends t2{constructor(){super({entityType:"site-info",schema:QJ,frontmatterSchema:H7,isSingleton:!0,hasBody:!1})}createSiteInfoContent(w){let $=H7.parse(w);return this.buildMarkdown("",$)}parseSiteInfoBody(w){return this.parseFrontmatter(w)}fromMarkdown(w){return{content:w,entityType:"site-info"}}extractMetadata(w){return{}}generateFrontMatter(w){let $=this.parseFrontmatter(w.content);return this.buildMarkdown("",$)}}var Sr0=new $6;var dr0=new $6;var J70=new $6;async function Q9(w){let X=(await w.listEntities({entityType:"site-info",options:{limit:1}}))[0];if(!X)throw Error("Site info not found \u2014 create a site-info entity");return J70.parseSiteInfoBody(X.content)}H0();var G70=H7.extend({navigation:Z.object({primary:Z.array(Z.object({label:Z.string(),href:Z.string(),priority:Z.number()})),secondary:Z.array(Z.object({label:Z.string(),href:Z.string(),priority:Z.number()}))}),copyright:Z.string(),socialLinks:Z.array(Z.object({platform:Z.enum(["github","instagram","linkedin","email","website"]).describe("Social media platform"),url:Z.string().describe("Profile or contact URL"),label:Z.string().optional().describe("Optional display label")})).optional().describe("Social media links from profile entity")});Q1();var AJ=b8,t6=B3.extend(AJ.shape);Q1();s4();H0();var K70=new T5;class FJ{postsListUrl;id="personal:homepage";name="Personal Homepage DataSource";description="Fetches profile and blog posts for a personal homepage";constructor(w){this.postsListUrl=w}async fetch(w,$,X){let W=X.entityService,[Y,J,G]=await Promise.all([V3(W),W.listEntities({entityType:"post",options:{limit:20}}),Q9(W)]),K=K70.parseProfileBody(Y,t6),H=J.sort(f8).slice(0,6).map(e4);if(!G.cta)throw Error("CTA not configured in site-info");let f={profile:K,posts:H,postsListUrl:this.postsListUrl,cta:G.cta};return $.parse(f)}}Q1();s4();var H70=new T5;class OJ{id="personal:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(w,$,X){let W=await V3(X.entityService),J={profile:H70.parseProfileBody(W,t6)};return $.parse(J)}}import{jsxDEV as Y1,Fragment as bj}from"preact/jsx-dev-runtime";function U70(w){return new Date(w).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function f70(w){return w.split(/(\*[^*]+\*)/).map(($,X)=>{if($.startsWith("*")&&$.endsWith("*")&&$.length>2)return Y1("em",{className:"font-sans italic font-medium text-theme-inverse tracking-[-0.015em] [font-variation-settings:'opsz'_72]",children:$.slice(1,-1)},X,!1,void 0,this);return $})}var sA=({profile:w,posts:$,postsListUrl:X,cta:W})=>{let Y=w.tagline??w.description,J=w.name.split(" ")[0];return Y1(bj,{children:[Y1(V2,{title:w.name,description:w.description??Y??"Personal site",ogType:"website"},void 0,!1,void 0,this),Y1("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:Y1("div",{className:"w-full max-w-[1100px] mx-auto text-center flex flex-col items-center gap-7",children:[Y&&Y1("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:f70(Y)},void 0,!1,void 0,this),w.description&&Y1("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:w.description},void 0,!1,void 0,this),Y1("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[Y1("a",{href:X,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 ",Y1("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y1("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 ",J]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.length>0&&Y1("section",{className:"flex flex-col py-24 px-6 md:px-12 gap-11 bg-theme-subtle",children:[Y1("div",{className:"flex justify-between items-end max-w-layout mx-auto w-full gap-6 flex-wrap",children:[Y1("div",{children:[Y1("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),Y1("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"," ",Y1("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),Y1("a",{href:X,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 ",Y1("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y1("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,320px),1fr))] gap-8 max-w-layout mx-auto w-full",children:$.map((G)=>Y1("a",{href:G.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:[G.coverImageUrl?Y1("img",{src:G.coverImageUrl,alt:G.metadata.title,className:"w-full aspect-[16/10] object-cover bg-theme-muted"},void 0,!1,void 0,this):Y1("div",{className:"w-full aspect-[16/10] bg-gradient-to-br from-brand to-accent","aria-hidden":"true"},void 0,!1,void 0,this),Y1("div",{className:"flex flex-col gap-4 p-7 flex-1",children:[Y1("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:[G.frontmatter.seriesName&&Y1(bj,{children:[Y1("span",{className:"text-brand",children:G.frontmatter.seriesName},void 0,!1,void 0,this),Y1("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),Y1("time",{children:U70(G.metadata.publishedAt??G.created)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y1("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:G.metadata.title},void 0,!1,void 0,this),G.frontmatter.excerpt&&Y1("p",{className:"text-base leading-[1.55] text-theme-muted m-0 flex-1",children:G.frontmatter.excerpt},void 0,!1,void 0,this),Y1("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"," ",Y1("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)]},G.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y1("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:[Y1("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),Y1("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:W.heading},void 0,!1,void 0,this),W.subtitle&&Y1("p",{className:"text-center text-base leading-[1.55] text-theme-on-dark opacity-80 max-w-[480px] m-0",children:W.subtitle},void 0,!1,void 0,this),Y1("a",{href:W.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:[W.buttonText," ",Y1("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 v2,Fragment as Q70}from"preact/jsx-dev-runtime";var tA=({profile:w})=>{let $=`About ${w.name}`,X=w.description??w.intro??"About page",W=Boolean(w.email??w.website);return v2(Q70,{children:[v2(V2,{title:$,description:X,ogType:"profile"},void 0,!1,void 0,this),v2("section",{className:"hero-decor bg-brand text-theme-inverse relative flex flex-col px-6 md:px-12 pt-32 pb-24",children:v2("div",{className:"w-full max-w-3xl mx-auto flex flex-col gap-6",children:[v2("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:w.name},void 0,!1,void 0,this),w.description&&v2("p",{className:"text-[clamp(1.0625rem,1.4vw,1.25rem)] leading-[1.55] text-theme-inverse opacity-95 max-w-2xl m-0",children:w.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),w.story&&v2("section",{className:`py-24 px-6 md:px-12 bg-theme-subtle${W?"":" flex-grow"}`,children:v2("div",{className:"max-w-3xl mx-auto",children:v2(f9,{markdown:w.story},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),W&&v2("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:[v2("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),v2("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"," ",v2("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),v2("div",{className:"flex flex-wrap justify-center gap-3.5 mt-2",children:[w.email&&v2("a",{href:`mailto:${w.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 ",v2("span",{"aria-hidden":"true",children:"\u2192"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.website&&v2("a",{href:w.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 xj={name:"@brains/site-personal",private:!0,version:"0.2.0-alpha.96",description:"Personal site composition package",type:"module",exports:{".":"./src/index.ts"},files:["src"],scripts:{typecheck:"tsc --noEmit",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix"},dependencies:{"@brains/blog":"workspace:*","@brains/identity-service":"workspace:*","@brains/plugins":"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":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};var F70=Z.object({entityDisplay:Z.object({post:Z.object({label:Z.string().default("Post"),pluralName:Z.string().optional()}).default({})}).default({})});class eA extends I8{dependencies=["blog"];constructor(w={}){super("personal-site",xj,w,F70)}async onRegister(w){w.entities.extendFrontmatterSchema("anchor-profile",AJ);let $=this.config.entityDisplay.post,X=`/${$.pluralName??$.label.toLowerCase()+"s"}`,W=new FJ(X);w.entities.registerDataSource(W);let Y=new OJ;w.entities.registerDataSource(Y);let J=Z.object({profile:t6,posts:Z.array(r5),postsListUrl:Z.string(),cta:M$}),G=Z.object({profile:t6});w.templates.register({homepage:T1({name:"homepage",description:"Personal homepage with recent blog posts",schema:J,dataSourceId:"personal:homepage",requiredPermission:"public",layout:{component:sA}}),about:T1({name:"about",description:"About page with profile",schema:G,dataSourceId:"personal:about",requiredPermission:"public",layout:{component:tA}})}),this.logger.info("Personal site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function wF(w){return new eA(w??{})}var $F=[{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 h5}from"preact/jsx-dev-runtime";function XF({sections:w,siteInfo:$}){let X=[...$.navigation.primary,...$.navigation.secondary].filter((W)=>W.label!=="Home");return h5("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[h5(A$,{title:$.title,titleClassName:"font-heading font-bold text-2xl",navigation:$.navigation.primary,showThemeToggle:!0,themeToggleClassName:"bg-theme-toggle text-theme-toggle-icon hover:bg-theme-toggle-hover rounded-[10px]",...$.logo!==void 0?{logo:$.logo}:{}},void 0,!1,void 0,this),h5("main",{className:"flex-grow flex flex-col",children:w},void 0,!1,void 0,this),h5("footer",{className:"bg-footer text-footer border-t border-theme",children:h5("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:[h5("div",{className:"flex flex-col gap-1 mb-4 md:mb-0",children:[h5("span",{className:"text-brand font-heading font-bold text-lg",children:$.title},void 0,!1,void 0,this),$.description&&h5("span",{className:"text-theme-muted text-xs",children:$.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),h5("nav",{className:"flex flex-wrap justify-center gap-x-6 gap-y-2 mb-4 md:mb-0",children:X.map((W)=>h5("a",{href:W.href,className:"text-theme-muted text-[13px] hover:text-brand transition-colors",children:W.label},W.href,!1,void 0,this))},void 0,!1,void 0,this),h5("div",{className:"flex items-center gap-4",children:[$.copyright&&h5("span",{className:"text-theme-light text-[11px]",children:$.copyright},void 0,!1,void 0,this),h5(c6,{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)}Q1();H0();_5();Q1();H0();Q1();H0();H0();Q1();var O70=Z.enum(["generating","draft","queued","published","failed"]),yj="publishedAt is required when deck status is published",uj=(w)=>w.status==="published"&&!w.publishedAt,WF=(w)=>{if(uj(w))throw Error(yj)},e6=Z.object({title:Z.string(),slug:Z.string().optional(),description:Z.string().optional(),author:Z.string().optional(),status:O70,publishedAt:Z.string().datetime().optional(),event:Z.string().optional(),coverImageId:Z.string().optional()}),Z70=e6.pick({title:!0,description:!0,status:!0,publishedAt:!0,coverImageId:!0}).extend({slug:Z.string(),error:Z.string().optional()}).superRefine((w,$)=>{if(!uj(w))return;$.addIssue({code:Z.ZodIssueCode.custom,path:["publishedAt"],message:yj})}),ZJ=y2.extend({entityType:Z.literal("deck"),metadata:Z70}),zJ=ZJ.extend({frontmatter:e6,body:Z.string()}),N$=zJ.extend({url:Z.string().optional(),typeLabel:Z.string().optional(),listUrl:Z.string().optional(),listLabel:Z.string().optional(),coverImageUrl:Z.string().optional(),coverImageWidth:Z.number().optional(),coverImageHeight:Z.number().optional()});class YF extends t2{constructor(){super({entityType:"deck",schema:ZJ,frontmatterSchema:e6,supportsCoverImage:!0})}validateSlideStructure(w){if(!/^---$/gm.test(w))throw Error("Invalid deck: markdown must contain slide separators (---) to be a valid presentation")}toMarkdown(w){let $=this.extractBody(w.content);this.validateSlideStructure($);let X=this.parseFrontMatter(w.content,e6);WF(X);let W={...X,slug:X.slug??w.metadata.slug};return this.buildMarkdown($,W)}fromMarkdown(w){let $=this.parseFrontmatter(w),X=this.extractBody(w);WF($),this.validateSlideStructure(X);let W=$.slug??G5($.title),Y=$.status;return{entityType:"deck",content:w,metadata:{slug:W,title:$.title,description:$.description,status:Y,publishedAt:$.publishedAt,coverImageId:$.coverImageId}}}generateTitle(w){return w.metadata.title}generateSummary(w){if(w.metadata.description)return w.metadata.description;return`Presentation: ${w.metadata.title}`}generateFrontMatter(w){return this.toMarkdown(w)}buildStub(w){let $={title:w.title,slug:w.id,status:"generating"};return{content:this.buildMarkdown(`---
982
982
  `,$),metadata:{title:w.title,slug:w.id,status:"generating"}}}}var R$=new YF;H0();_5();var z70=Z.object({markdown:Z.string().describe("Markdown content with slide separators (---)")}),JF=T1({name:"deck-detail",description:"Render a presentation deck as Reveal.js slides",schema:z70,dataSourceId:"decks:entities",requiredPermission:"public",layout:{component:EA,fullscreen:!0}});_5();H0();var GF=Z.object({decks:Z.array(zJ)}),KF=Z.object({decks:Z.array(N$),pageTitle:Z.string().optional(),pageLabel:Z.string().optional()});import{jsxDEV as HF}from"preact/jsx-dev-runtime";var V70="Presentations",UF=({decks:w,pageLabel:$})=>{let X=w.map((Y)=>({id:Y.id,url:Y.url,title:Y.frontmatter.title,date:Y.frontmatter.publishedAt??Y.created,description:Y.frontmatter.description}));return HF("div",{className:"deck-list bg-theme",children:HF("div",{className:"container mx-auto max-w-[1100px] px-6 py-16 md:px-12 md:py-24",children:HF(F$,{label:$&&$!=="Decks"?$:V70,items:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)};x2();var vd0=Z.object({message:Z.string()});g3();g3();x2();QW();class VJ{schema;config;processor=W8();constructor(w,$){this.schema=w;this.config=$}getLabels(){let w={};for(let $ of this.config.mappings)w[$.key]=$.label;return w}generateBodyTemplate(){if(this.config.mappings.length===0)return"";let w=[];for(let $ of this.config.mappings)w.push(`## ${$.label}`,"",`<!-- Write your ${$.label.toLowerCase()} here -->`,"");return w.join(`
983
983
  `).trimEnd()+`
984
984
  `}format(w){try{let $=[`# ${this.config.title}`,""];for(let X of this.config.mappings)this.formatField(w,X,$,2);return $.join(`
@@ -1485,12 +1485,12 @@ ${$.join(`
1485
1485
  </div>
1486
1486
  </body>
1487
1487
  </html>`}H0();H0();i4();H0();H0();function tO(w){let $=rU0(w.template,w.format),X=Z.record(Z.unknown()).parse(w.content),W=Z.record(Z.unknown()).parse(w.template.schema.parse(X)),Y=new IG(w.siteConfig.title),J=cU0(w.imageBuildService),G=sO(iA,{headCollector:Y,children:sO(kA,{imageRenderer:J,children:sO($,W)})}),K=pU0(G);if(!Y.getHeadProps())Y.setHeadProps({title:w.siteConfig.title});let H=dU0(Y.generateHeadHTML(),w.noindex??!0);return aO(K,H,w.siteConfig.title,w.siteConfig.themeMode)}function rU0(w,$){let X=w.renderers[$];if(!X||typeof X!=="function")throw Error(`No ${$} renderer for template: ${w.name}`);return X}function cU0(w){return w?.createImageRenderer()??null}function dU0(w,$){if(!$)return w;return`${w}
1488
- <meta name="robots" content="noindex,nofollow">`}import{createServer as iU0}from"http";import{lstat as cu,mkdir as iu,readFile as nU0,writeFile as nu}from"fs/promises";import{dirname as oU0,extname as aU0,join as eO,posix as sU0,resolve as SG,sep as du}from"path";async function $Z(w){let $=eU0(w.mediaPath),X=wf0(w.outputDir,$),W=tO({template:w.template,format:w.format,content:w.content,siteConfig:w.siteConfig,imageBuildService:w.imageBuildService});return await iu(oU0(X),{recursive:!0}),await nu(X,W,"utf-8"),await tU0(w.outputDir,w.themeCSS),{urlPath:$,filePath:X}}async function tU0(w,$){let X=eO(w,"styles");await iu(X,{recursive:!0}),await nu(eO(X,"main.css"),$,"utf-8")}async function XZ(w){let $=SG(w.rootDir),X=w.host??"127.0.0.1",W=iU0(async(G,K)=>{try{let H=new URL(G.url??"/",`http://${X}`),f=decodeURIComponent(H.pathname);if($f0(f)){K.writeHead(403),K.end("Forbidden");return}let Q=f.startsWith("/")?f.slice(1):f,A=SG($,Q);if(!wZ($,A)){K.writeHead(403),K.end("Forbidden");return}let F=await Xf0(A);if(!F||!wZ($,F)){K.writeHead(404),K.end("Not found");return}let z=await nU0(F);K.writeHead(200,{"content-type":Wf0(F)}),K.end(z)}catch{K.writeHead(404),K.end("Not found")}});await Yf0(W,X);let Y=Jf0(W),J=`http://${X}:${Y}`;return{baseUrl:J,urlFor:(G)=>`${J}${G.startsWith("/")?G:`/${G}`}`,close:()=>Gf0(W)}}function eU0(w){if(!w.startsWith("/_media/"))throw Error("Media render paths must start with /_media/");if(w.split("/").filter(Boolean).some((W)=>W===".."))throw Error("Media render path cannot contain traversal");let X=sU0.normalize(w);if(!X.startsWith("/_media/"))throw Error("Media render path cannot contain traversal");return X.endsWith("/")?X:`${X}/`}function wf0(w,$){let X=SG(w),W=$.slice(1),Y=SG(X,W,"index.html");if(!wZ(X,Y))throw Error("Media render path cannot contain traversal");return Y}function $f0(w){return w.split("/").some(($)=>$==="..")}function wZ(w,$){let X=w.endsWith(du)?w:`${w}${du}`;return $===w||$.startsWith(X)}async function Xf0(w){try{let $=await cu(w);if($.isSymbolicLink())return null;if($.isDirectory()){let X=eO(w,"index.html"),W=await cu(X).catch(()=>null);if(!W||W.isSymbolicLink())return null;return W.isFile()?X:null}if($.isFile())return w;return null}catch{return null}}function Wf0(w){switch(aU0(w).toLowerCase()){case".css":return"text/css; charset=utf-8";case".html":return"text/html; charset=utf-8";case".js":return"application/javascript; charset=utf-8";case".json":return"application/json";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".svg":return"image/svg+xml";case".webp":return"image/webp";default:return"application/octet-stream"}}async function Yf0(w,$){await new Promise((X,W)=>{let Y=(G)=>{w.off("listening",J),W(G)},J=()=>{w.off("error",Y),X()};w.once("error",Y),w.once("listening",J),w.listen(0,$)})}function Jf0(w){let $=w.address();if(typeof $!=="object"||$===null)throw Error("Static render server did not bind to a TCP port");return $.port}async function Gf0(w){await new Promise(($,X)=>{w.close((W)=>{if(W){X(W);return}$()})})}H0();var Qf0=26214400,Af0=60000,ou=20;class WZ{context;renderPdf;getThemeMode;constructor(w,$={}){this.context=w;this.renderPdf=$.renderPdf??BF,this.getThemeMode=$.getThemeMode??(async()=>"dark")}async resolve(w){if(w.sourceEntityType!=="deck")return;let $=await this.context.entityService.getEntity({entityType:"deck",id:w.sourceEntityId});if(!$)return;let X=Ff0($,{brandLabel:this.resolveBrandLabel()});if(X.slides.length>ou)throw Error(`Refusing to render carousel with ${X.slides.length} slides; maxSlides=${ou}`);let W=await this.getThemeMode(),Y=await Kf0(ff0(Uf0(),"brain-deck-carousel-"));try{let J=await $Z({outputDir:Y,mediaPath:`/_media/carousel/${$.id}`,template:nj,format:"pdf",content:X,siteConfig:{title:X.title,themeMode:W},themeCSS:this.context.themeCSS}),G=await XZ({rootDir:Y});try{return{type:"document",data:await this.renderPdf(G.urlFor(J.urlPath),{maxBytes:Qf0,timeoutMs:Af0,printBackground:!0,preferCSSPageSize:!0}),mimeType:"application/pdf",filename:`${Of0($)}-carousel.pdf`}}finally{await G.close()}}finally{await Hf0(Y,{recursive:!0,force:!0})}}resolveBrandLabel(){let w=this.context.domain?.trim();if(w&&w.length>0)return w;let $=this.context.identity.getProfile().name;return $.length>0?$:void 0}}function Ff0(w,$={}){let{frontmatter:X,content:W}=y4(w.content),Y=typeof X.title==="string"?X.title:w.metadata.title,J=typeof X.event==="string"&&X.event.length>0?X.event:void 0,G=W.split(/^---$/gm).map((K)=>K.trim()).filter((K)=>K.length>0).map((K)=>({markdown:K}));return{title:Y,slides:G,...$.brandLabel?{brandLabel:$.brandLabel}:{},...J?{eyebrow:J}:{}}}function Of0(w){let $=w.metadata.slug;return $.length>0?$:G5(w.metadata.title)}var au={name:"@brains/decks",private:!0,version:"0.2.0-alpha.95",description:"Presentation decks plugin for creating and viewing slide presentations",type:"module",exports:{".":"./src/index.ts"},scripts:{typecheck:"tsc --noEmit",test:"bun test",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix",eval:"cd evals && bun run brain-eval"},dependencies:{"@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/ui-library":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};class su extends g6{deps;entityType=R$.entityType;schema=R$.schema;adapter=R$;unregisterCarouselAttachmentProvider;constructor(w={}){super("decks",au);this.deps=w}createGenerationHandler(w){return new VF(this.logger.child("DeckGenerationJobHandler"),w)}getTemplates(){return{"deck-detail":JF,"deck-list":QF,generation:gj,description:mj}}getDataSources(){return[new zF(this.logger)]}getEntityTypeConfig(){return{weight:1.5}}async onRegister(w){await this.registerWithPublishPipeline(w),this.subscribeToPublishExecute(w),this.registerCarouselAttachmentProvider(w),this.registerEvalHandlers(w),this.logger.info("Decks plugin registered")}async onShutdown(){this.unregisterCarouselAttachmentProvider?.(),this.unregisterCarouselAttachmentProvider=void 0}async registerWithPublishPipeline(w){await w.messaging.send({type:"publish:register",payload:{entityType:"deck",provider:{name:"internal",publish:async()=>({id:"internal"})}}})}subscribeToPublishExecute(w){w.messaging.subscribe("publish:execute",async($)=>{let{entityType:X,entityId:W}=$.payload;if(X!=="deck")return{success:!0};try{let Y=await w.entityService.getEntity({entityType:"deck",id:W});if(!Y)return await w.messaging.send({type:"publish:report:failure",payload:{entityType:X,entityId:W,error:`Deck not found: ${W}`}}),{success:!0};if(Y.metadata.status==="published")return{success:!0};let J=new Date().toISOString(),G={...Y,metadata:{...Y.metadata,status:"published",publishedAt:J}};await w.entityService.updateEntity({entity:{...G,content:this.adapter.toMarkdown(G)}}),await w.messaging.send({type:"publish:report:success",payload:{entityType:X,entityId:W,result:{id:W}}})}catch(Y){await w.messaging.send({type:"publish:report:failure",payload:{entityType:X,entityId:W,error:a1(Y)}})}return{success:!0}})}registerCarouselAttachmentProvider(w){let $={...this.deps,getThemeMode:this.deps.getThemeMode??(async()=>{try{return(await Q9(w.entityService)).themeMode??"dark"}catch{return"dark"}})};this.unregisterCarouselAttachmentProvider=w.attachments.register("deck",dj,new WZ(w,$))}registerEvalHandlers(w){w.eval.registerHandler("generateDeck",async($)=>{let X=Z.object({prompt:Z.string(),event:Z.string().optional()}).parse($);return w.ai.generate({prompt:`${X.prompt}${X.event?`
1488
+ <meta name="robots" content="noindex,nofollow">`}import{createServer as iU0}from"http";import{lstat as cu,mkdir as iu,readFile as nU0,writeFile as nu}from"fs/promises";import{dirname as oU0,extname as aU0,join as eO,posix as sU0,resolve as SG,sep as du}from"path";async function $Z(w){let $=eU0(w.mediaPath),X=wf0(w.outputDir,$),W=tO({template:w.template,format:w.format,content:w.content,siteConfig:w.siteConfig,imageBuildService:w.imageBuildService});return await iu(oU0(X),{recursive:!0}),await nu(X,W,"utf-8"),await tU0(w.outputDir,w.themeCSS),{urlPath:$,filePath:X}}async function tU0(w,$){let X=eO(w,"styles");await iu(X,{recursive:!0}),await nu(eO(X,"main.css"),$,"utf-8")}async function XZ(w){let $=SG(w.rootDir),X=w.host??"127.0.0.1",W=iU0(async(G,K)=>{try{let H=new URL(G.url??"/",`http://${X}`),f=decodeURIComponent(H.pathname);if($f0(f)){K.writeHead(403),K.end("Forbidden");return}let Q=f.startsWith("/")?f.slice(1):f,A=SG($,Q);if(!wZ($,A)){K.writeHead(403),K.end("Forbidden");return}let F=await Xf0(A);if(!F||!wZ($,F)){K.writeHead(404),K.end("Not found");return}let z=await nU0(F);K.writeHead(200,{"content-type":Wf0(F)}),K.end(z)}catch{K.writeHead(404),K.end("Not found")}});await Yf0(W,X);let Y=Jf0(W),J=`http://${X}:${Y}`;return{baseUrl:J,urlFor:(G)=>`${J}${G.startsWith("/")?G:`/${G}`}`,close:()=>Gf0(W)}}function eU0(w){if(!w.startsWith("/_media/"))throw Error("Media render paths must start with /_media/");if(w.split("/").filter(Boolean).some((W)=>W===".."))throw Error("Media render path cannot contain traversal");let X=sU0.normalize(w);if(!X.startsWith("/_media/"))throw Error("Media render path cannot contain traversal");return X.endsWith("/")?X:`${X}/`}function wf0(w,$){let X=SG(w),W=$.slice(1),Y=SG(X,W,"index.html");if(!wZ(X,Y))throw Error("Media render path cannot contain traversal");return Y}function $f0(w){return w.split("/").some(($)=>$==="..")}function wZ(w,$){let X=w.endsWith(du)?w:`${w}${du}`;return $===w||$.startsWith(X)}async function Xf0(w){try{let $=await cu(w);if($.isSymbolicLink())return null;if($.isDirectory()){let X=eO(w,"index.html"),W=await cu(X).catch(()=>null);if(!W||W.isSymbolicLink())return null;return W.isFile()?X:null}if($.isFile())return w;return null}catch{return null}}function Wf0(w){switch(aU0(w).toLowerCase()){case".css":return"text/css; charset=utf-8";case".html":return"text/html; charset=utf-8";case".js":return"application/javascript; charset=utf-8";case".json":return"application/json";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".svg":return"image/svg+xml";case".webp":return"image/webp";default:return"application/octet-stream"}}async function Yf0(w,$){await new Promise((X,W)=>{let Y=(G)=>{w.off("listening",J),W(G)},J=()=>{w.off("error",Y),X()};w.once("error",Y),w.once("listening",J),w.listen(0,$)})}function Jf0(w){let $=w.address();if(typeof $!=="object"||$===null)throw Error("Static render server did not bind to a TCP port");return $.port}async function Gf0(w){await new Promise(($,X)=>{w.close((W)=>{if(W){X(W);return}$()})})}H0();var Qf0=26214400,Af0=60000,ou=20;class WZ{context;renderPdf;getThemeMode;constructor(w,$={}){this.context=w;this.renderPdf=$.renderPdf??BF,this.getThemeMode=$.getThemeMode??(async()=>"dark")}async resolve(w){if(w.sourceEntityType!=="deck")return;let $=await this.context.entityService.getEntity({entityType:"deck",id:w.sourceEntityId});if(!$)return;let X=Ff0($,{brandLabel:this.resolveBrandLabel()});if(X.slides.length>ou)throw Error(`Refusing to render carousel with ${X.slides.length} slides; maxSlides=${ou}`);let W=await this.getThemeMode(),Y=await Kf0(ff0(Uf0(),"brain-deck-carousel-"));try{let J=await $Z({outputDir:Y,mediaPath:`/_media/carousel/${$.id}`,template:nj,format:"pdf",content:X,siteConfig:{title:X.title,themeMode:W},themeCSS:this.context.themeCSS}),G=await XZ({rootDir:Y});try{return{type:"document",data:await this.renderPdf(G.urlFor(J.urlPath),{maxBytes:Qf0,timeoutMs:Af0,printBackground:!0,preferCSSPageSize:!0}),mimeType:"application/pdf",filename:`${Of0($)}-carousel.pdf`}}finally{await G.close()}}finally{await Hf0(Y,{recursive:!0,force:!0})}}resolveBrandLabel(){let w=this.context.domain?.trim();if(w&&w.length>0)return w;let $=this.context.identity.getProfile().name;return $.length>0?$:void 0}}function Ff0(w,$={}){let{frontmatter:X,content:W}=y4(w.content),Y=typeof X.title==="string"?X.title:w.metadata.title,J=typeof X.event==="string"&&X.event.length>0?X.event:void 0,G=W.split(/^---$/gm).map((K)=>K.trim()).filter((K)=>K.length>0).map((K)=>({markdown:K}));return{title:Y,slides:G,...$.brandLabel?{brandLabel:$.brandLabel}:{},...J?{eyebrow:J}:{}}}function Of0(w){let $=w.metadata.slug;return $.length>0?$:G5(w.metadata.title)}var au={name:"@brains/decks",private:!0,version:"0.2.0-alpha.96",description:"Presentation decks plugin for creating and viewing slide presentations",type:"module",exports:{".":"./src/index.ts"},scripts:{typecheck:"tsc --noEmit",test:"bun test",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix",eval:"cd evals && bun run brain-eval"},dependencies:{"@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/ui-library":"workspace:*","@brains/utils":"workspace:*"},devDependencies:{"@brains/app":"workspace:*","@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@types/bun":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};class su extends g6{deps;entityType=R$.entityType;schema=R$.schema;adapter=R$;unregisterCarouselAttachmentProvider;constructor(w={}){super("decks",au);this.deps=w}createGenerationHandler(w){return new VF(this.logger.child("DeckGenerationJobHandler"),w)}getTemplates(){return{"deck-detail":JF,"deck-list":QF,generation:gj,description:mj}}getDataSources(){return[new zF(this.logger)]}getEntityTypeConfig(){return{weight:1.5}}async onRegister(w){await this.registerWithPublishPipeline(w),this.subscribeToPublishExecute(w),this.registerCarouselAttachmentProvider(w),this.registerEvalHandlers(w),this.logger.info("Decks plugin registered")}async onShutdown(){this.unregisterCarouselAttachmentProvider?.(),this.unregisterCarouselAttachmentProvider=void 0}async registerWithPublishPipeline(w){await w.messaging.send({type:"publish:register",payload:{entityType:"deck",provider:{name:"internal",publish:async()=>({id:"internal"})}}})}subscribeToPublishExecute(w){w.messaging.subscribe("publish:execute",async($)=>{let{entityType:X,entityId:W}=$.payload;if(X!=="deck")return{success:!0};try{let Y=await w.entityService.getEntity({entityType:"deck",id:W});if(!Y)return await w.messaging.send({type:"publish:report:failure",payload:{entityType:X,entityId:W,error:`Deck not found: ${W}`}}),{success:!0};if(Y.metadata.status==="published")return{success:!0};let J=new Date().toISOString(),G={...Y,metadata:{...Y.metadata,status:"published",publishedAt:J}};await w.entityService.updateEntity({entity:{...G,content:this.adapter.toMarkdown(G)}}),await w.messaging.send({type:"publish:report:success",payload:{entityType:X,entityId:W,result:{id:W}}})}catch(Y){await w.messaging.send({type:"publish:report:failure",payload:{entityType:X,entityId:W,error:a1(Y)}})}return{success:!0}})}registerCarouselAttachmentProvider(w){let $={...this.deps,getThemeMode:this.deps.getThemeMode??(async()=>{try{return(await Q9(w.entityService)).themeMode??"dark"}catch{return"dark"}})};this.unregisterCarouselAttachmentProvider=w.attachments.register("deck",dj,new WZ(w,$))}registerEvalHandlers(w){w.eval.registerHandler("generateDeck",async($)=>{let X=Z.object({prompt:Z.string(),event:Z.string().optional()}).parse($);return w.ai.generate({prompt:`${X.prompt}${X.event?`
1489
1489
 
1490
1490
  Note: This presentation is for "${X.event}".`:""}`,templateName:"decks:generation"})}),w.eval.registerHandler("generateDescription",async($)=>{let X=Z.object({title:Z.string(),content:Z.string()}).parse($);return w.ai.generate({prompt:`Title: ${X.title}
1491
1491
 
1492
1492
  Content:
1493
- ${X.content}`,templateName:"decks:description"})})}}i4();H0();Q1();var CG=b8.extend({expertise:Z.array(Z.string()).optional().describe("Skills, domains, areas of focus"),currentFocus:Z.string().optional().describe("What you're currently working on"),availability:Z.string().optional().describe("What you're open to (consulting, speaking, etc.)")}),F4=B3.extend(CG.shape);Q1();s4();H0();var zf0=new T5;class bG{postsListUrl;decksListUrl;id="professional:homepage-list";name="Homepage List DataSource";description="Fetches profile, blog posts, and presentation decks for homepage";constructor(w,$){this.postsListUrl=w;this.decksListUrl=$}async fetch(w,$,X){let W=X.entityService,[Y,J,G,K]=await Promise.all([V3(W),W.listEntities({entityType:"post",options:{limit:20}}),W.listEntities({entityType:"deck",options:{limit:20}}),Q9(W)]),H=zf0.parseProfileBody(Y,F4),f=J.sort(f8).slice(0,3).map(e4),Q=G.sort(f8).slice(0,3).map(h$);if(!K.cta)throw Error("CTA not configured in site-info");let A={profile:H,posts:f,decks:Q,postsListUrl:this.postsListUrl,decksListUrl:this.decksListUrl,cta:K.cta,sections:K.sections??{}};return $.parse(A)}}Q1();s4();var Vf0=new T5;class xG{id="professional:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(w,$,X){let W=await V3(X.entityService),J={profile:Vf0.parseProfileBody(W,F4)};return $.parse(J)}}import{jsxDEV as E1,Fragment as Nf0}from"preact/jsx-dev-runtime";var Bf0="grid md:grid-cols-[14rem_1px_1fr] gap-y-2 gap-x-0 md:gap-16 items-start",Mf0="border-t md:border-t-0 md:border-l border-rule-strong md:self-stretch",YZ=({number:w,title:$,blurb:X,children:W})=>E1("section",{className:"py-20 border-b border-rule px-6 md:px-12",children:E1("div",{className:"max-w-6xl mx-auto",children:E1("div",{className:Bf0,children:[E1(pA,{title:$,number:w,blurb:X},void 0,!1,void 0,this),E1("div",{className:Mf0,"aria-hidden":"true"},void 0,!1,void 0,this),E1("div",{className:"mt-6 md:mt-0",children:W},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),JZ=({profile:w,posts:$,decks:X,postsListUrl:W,decksListUrl:Y,cta:J,sections:G})=>{let K=w.tagline||w.description,H=$.map((z)=>({id:z.id,url:z.url,title:z.metadata.title,date:z.metadata.publishedAt||z.created,description:z.frontmatter.excerpt,series:z.frontmatter.seriesName&&z.frontmatter.seriesIndex?{name:z.frontmatter.seriesName,index:z.frontmatter.seriesIndex}:void 0})),f=X.map((z)=>({id:z.id,url:z.url,title:z.frontmatter.title||z.id,date:z.frontmatter.publishedAt??z.created,description:z.frontmatter.description})),Q=w.name||"Home",A=w.intro||w.description||K||"Professional site",F=Boolean(w.description)||w.expertise!==void 0&&w.expertise.length>0;return E1(Nf0,{children:[E1(V2,{title:Q,description:A,ogType:"website"},void 0,!1,void 0,this),E1("div",{className:"homepage-list bg-theme",children:[E1("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:E1("div",{className:"relative z-10 max-w-6xl mx-auto w-full",children:[w.name&&E1("div",{className:"flex items-center gap-[0.6rem] mb-6 font-mono text-[0.7rem] font-medium uppercase tracking-[0.22em] text-accent",children:[E1("span",{className:"w-[18px] h-px bg-accent","aria-hidden":"true"},void 0,!1,void 0,this),E1("span",{children:w.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&E1("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:UJ(K,"italic font-normal text-accent [font-variation-settings:'opsz'_144,'SOFT'_80]")},void 0,!1,void 0,this),w.intro&&E1("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:UJ(w.intro,"italic text-accent")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),E1(YZ,{number:"01",title:"Essays",blurb:G.essays?.blurb,children:E1(HJ,{items:H,viewAllUrl:W,viewAllLabel:"View all essays"},void 0,!1,void 0,this)},void 0,!1,void 0,this),f.length>0&&E1(YZ,{number:"02",title:"Presentations",blurb:G.presentations?.blurb,children:E1(HJ,{items:f,viewAllUrl:Y,viewAllLabel:"View all presentations"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F&&E1(YZ,{number:"03",title:"About",blurb:G.about?.blurb,children:E1("div",{className:"flex flex-col gap-8",children:[w.description&&E1("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:w.description},void 0,!1,void 0,this),w.expertise&&w.expertise.length>0&&E1(rA,{subjects:w.expertise},void 0,!1,void 0,this),E1("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",E1("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),E1(IA,{cta:J,variant:"editorial",socialLinks:w.socialLinks},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};import{jsxDEV as R1,Fragment as Rf0}from"preact/jsx-dev-runtime";var GZ=({profile:w})=>{let $=`About ${w.name||"Me"}`,X=w.description||w.intro||"About page",W=w.expertise&&w.expertise.length>0||w.currentFocus||w.availability||w.email||w.website||w.socialLinks&&w.socialLinks.length>0;return R1(Rf0,{children:[R1(V2,{title:$,description:X,ogType:"profile"},void 0,!1,void 0,this),R1("div",{className:"about-page bg-theme",children:[R1("header",{className:"hero-bg-pattern relative w-full py-16 md:py-24 px-6 md:px-12 bg-theme overflow-hidden",children:R1("div",{className:"relative z-10 max-w-4xl mx-auto",children:[R1("h1",{className:"text-5xl md:text-6xl font-semibold mb-6 text-heading",children:["About ",w.name||"Me"]},void 0,!0,void 0,this),w.description&&R1("p",{className:"text-xl md:text-2xl text-theme-muted leading-relaxed",children:w.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),R1("div",{className:"container mx-auto px-6 md:px-12 max-w-4xl py-12 md:py-16",children:[w.story&&R1("section",{className:"content-section-reveal mb-20 md:mb-28",children:R1(f9,{markdown:w.story},void 0,!1,void 0,this)},void 0,!1,void 0,this),W&&R1("div",{className:"content-section-reveal grid md:grid-cols-2 gap-x-16 gap-y-12",children:[w.expertise&&w.expertise.length>0&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Expertise"},void 0,!1,void 0,this),R1("ul",{className:"flex flex-wrap gap-3",children:w.expertise.map((Y,J)=>R1("li",{className:uA({variant:"accent",size:"lg"}),children:Y},J,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.currentFocus&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Current Focus"},void 0,!1,void 0,this),R1("p",{className:"text-lg text-theme leading-relaxed",children:w.currentFocus},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.availability&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Availability"},void 0,!1,void 0,this),R1("p",{className:"text-lg text-theme leading-relaxed",children:w.availability},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(w.email||w.website||w.socialLinks&&w.socialLinks.length>0)&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Contact"},void 0,!1,void 0,this),R1("div",{className:"space-y-4",children:[w.email&&R1("p",{className:"text-lg",children:R1("a",{href:`mailto:${w.email}`,className:"text-brand hover:text-brand-dark transition-colors",children:w.email},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.website&&R1("p",{className:"text-lg",children:R1("a",{href:w.website,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:text-brand-dark transition-colors",children:w.website},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.socialLinks&&w.socialLinks.length>0&&R1("div",{className:"flex flex-wrap gap-4 mt-4",children:w.socialLinks.map((Y,J)=>R1(c5,{href:Y.url,external:!0,variant:"secondary",size:"md",children:Y.label||Y.platform},J,!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 r2,Fragment as tu}from"preact/jsx-dev-runtime";var KZ=()=>{return r2(tu,{children:[r2(V2,{title:"Thanks for subscribing!",description:"You've successfully subscribed to the newsletter."},void 0,!1,void 0,this),r2("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:r2("div",{className:"text-center max-w-md",children:[r2("div",{className:"text-6xl mb-6",children:"\uD83C\uDF89"},void 0,!1,void 0,this),r2("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Thanks for subscribing!"},void 0,!1,void 0,this),r2("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),r2(c5,{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)},HZ=()=>{return r2(tu,{children:[r2(V2,{title:"Subscription failed",description:"There was a problem with your subscription."},void 0,!1,void 0,this),r2("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:r2("div",{className:"text-center max-w-md",children:[r2("div",{className:"text-6xl mb-6",children:"\uD83D\uDE22"},void 0,!1,void 0,this),r2("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Something went wrong"},void 0,!1,void 0,this),r2("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),r2(c5,{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)};H0();var eu=Z.object({label:Z.string().describe("Display label for entity type (e.g., 'Essay')"),pluralName:Z.string().optional().describe("URL path segment (defaults to label.toLowerCase() + 's')")}),wg=Z.object({entityDisplay:Z.object({post:eu,deck:eu}).describe("Display metadata for post and deck entity types (required for homepage)")});var $g={name:"@brains/site-professional",private:!0,version:"0.2.0-alpha.95",description:"Professional site composition package",type:"module",exports:{".":"./src/index.ts"},files:["src"],scripts:{typecheck:"tsc --noEmit",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix"},dependencies:{"@brains/blog":"workspace:*","@brains/decks":"workspace:*","@brains/identity-service":"workspace:*","@brains/plugins":"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":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};class UZ extends I8{dependencies=["blog","decks"];constructor(w){super("professional-site",$g,w,wg)}async onRegister(w){w.entities.extendFrontmatterSchema("anchor-profile",CG);let $=this.config.entityDisplay.post,X=this.config.entityDisplay.deck,W=`/${$.pluralName??$.label.toLowerCase()+"s"}`,Y=`/${X.pluralName??X.label.toLowerCase()+"s"}`,J=new bG(W,Y);w.entities.registerDataSource(J);let G=new xG;w.entities.registerDataSource(G);let K=Z.object({profile:F4,posts:Z.array(r5),decks:Z.array(N$),postsListUrl:Z.string(),decksListUrl:Z.string(),cta:M$,sections:Z.record(Z.string(),CW)}),H=Z.object({profile:F4}),f=Z.object({});w.templates.register({"homepage-list":T1({name:"homepage-list",description:"Professional homepage with essays and presentations",schema:K,dataSourceId:"professional:homepage-list",requiredPermission:"public",layout:{component:JZ}}),about:T1({name:"about",description:"About page with full profile information",schema:H,dataSourceId:"professional:about",requiredPermission:"public",layout:{component:GZ}}),"subscribe-thanks":T1({name:"subscribe-thanks",description:"Newsletter subscription success page",schema:f,requiredPermission:"public",layout:{component:KZ}}),"subscribe-error":T1({name:"subscribe-error",description:"Newsletter subscription error page",schema:f,requiredPermission:"public",layout:{component:HZ}})}),this.logger.info("Professional site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function fZ(w){return new UZ(w??{})}var QZ=[{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 yG}from"preact/jsx-dev-runtime";function AZ({sections:w,siteInfo:$,slots:X,wordmark:W}){return yG("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[yG(A$,{title:$.title,navigation:$.navigation.primary,showThemeToggle:!0,...$.logo!==void 0?{logo:$.logo}:{},...W!==void 0?{wordmark:W}:{}},void 0,!1,void 0,this),yG("main",{className:"flex-grow flex flex-col bg-theme",children:w},void 0,!1,void 0,this),yG(CA,{primaryNavigation:$.navigation.primary,secondaryNavigation:$.navigation.secondary,copyright:$.copyright,socialLinks:$.socialLinks,title:$.title,tagline:$.description,children:X?.getSlot("footer-top").map((Y)=>Y.render())},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Xg(w){return{id:w.id,version:w.version,type:w.type,packageName:w.packageName}}var s01=XF;function t01(w){return Xg(wF(w))}var qf0=$F,e01=qf0,w11=AZ;function $11(w){return Xg(fZ(w))}var X11=QZ;export{qf0 as routes,$11 as professionalSitePlugin,X11 as professionalRoutes,t01 as personalSitePlugin,e01 as personalRoutes,w11 as ProfessionalLayout,s01 as PersonalLayout};
1493
+ ${X.content}`,templateName:"decks:description"})})}}i4();H0();Q1();var CG=b8.extend({expertise:Z.array(Z.string()).optional().describe("Skills, domains, areas of focus"),currentFocus:Z.string().optional().describe("What you're currently working on"),availability:Z.string().optional().describe("What you're open to (consulting, speaking, etc.)")}),F4=B3.extend(CG.shape);Q1();s4();H0();var zf0=new T5;class bG{postsListUrl;decksListUrl;id="professional:homepage-list";name="Homepage List DataSource";description="Fetches profile, blog posts, and presentation decks for homepage";constructor(w,$){this.postsListUrl=w;this.decksListUrl=$}async fetch(w,$,X){let W=X.entityService,[Y,J,G,K]=await Promise.all([V3(W),W.listEntities({entityType:"post",options:{limit:20}}),W.listEntities({entityType:"deck",options:{limit:20}}),Q9(W)]),H=zf0.parseProfileBody(Y,F4),f=J.sort(f8).slice(0,3).map(e4),Q=G.sort(f8).slice(0,3).map(h$);if(!K.cta)throw Error("CTA not configured in site-info");let A={profile:H,posts:f,decks:Q,postsListUrl:this.postsListUrl,decksListUrl:this.decksListUrl,cta:K.cta,sections:K.sections??{}};return $.parse(A)}}Q1();s4();var Vf0=new T5;class xG{id="professional:about";name="About Page DataSource";description="Fetches full profile data for the about page";async fetch(w,$,X){let W=await V3(X.entityService),J={profile:Vf0.parseProfileBody(W,F4)};return $.parse(J)}}import{jsxDEV as E1,Fragment as Nf0}from"preact/jsx-dev-runtime";var Bf0="grid md:grid-cols-[14rem_1px_1fr] gap-y-2 gap-x-0 md:gap-16 items-start",Mf0="border-t md:border-t-0 md:border-l border-rule-strong md:self-stretch",YZ=({number:w,title:$,blurb:X,children:W})=>E1("section",{className:"py-20 border-b border-rule px-6 md:px-12",children:E1("div",{className:"max-w-6xl mx-auto",children:E1("div",{className:Bf0,children:[E1(pA,{title:$,number:w,blurb:X},void 0,!1,void 0,this),E1("div",{className:Mf0,"aria-hidden":"true"},void 0,!1,void 0,this),E1("div",{className:"mt-6 md:mt-0",children:W},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),JZ=({profile:w,posts:$,decks:X,postsListUrl:W,decksListUrl:Y,cta:J,sections:G})=>{let K=w.tagline||w.description,H=$.map((z)=>({id:z.id,url:z.url,title:z.metadata.title,date:z.metadata.publishedAt||z.created,description:z.frontmatter.excerpt,series:z.frontmatter.seriesName&&z.frontmatter.seriesIndex?{name:z.frontmatter.seriesName,index:z.frontmatter.seriesIndex}:void 0})),f=X.map((z)=>({id:z.id,url:z.url,title:z.frontmatter.title||z.id,date:z.frontmatter.publishedAt??z.created,description:z.frontmatter.description})),Q=w.name||"Home",A=w.intro||w.description||K||"Professional site",F=Boolean(w.description)||w.expertise!==void 0&&w.expertise.length>0;return E1(Nf0,{children:[E1(V2,{title:Q,description:A,ogType:"website"},void 0,!1,void 0,this),E1("div",{className:"homepage-list bg-theme",children:[E1("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:E1("div",{className:"relative z-10 max-w-6xl mx-auto w-full",children:[w.name&&E1("div",{className:"flex items-center gap-[0.6rem] mb-6 font-mono text-[0.7rem] font-medium uppercase tracking-[0.22em] text-accent",children:[E1("span",{className:"w-[18px] h-px bg-accent","aria-hidden":"true"},void 0,!1,void 0,this),E1("span",{children:w.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&E1("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:UJ(K,"italic font-normal text-accent [font-variation-settings:'opsz'_144,'SOFT'_80]")},void 0,!1,void 0,this),w.intro&&E1("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:UJ(w.intro,"italic text-accent")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),E1(YZ,{number:"01",title:"Essays",blurb:G.essays?.blurb,children:E1(HJ,{items:H,viewAllUrl:W,viewAllLabel:"View all essays"},void 0,!1,void 0,this)},void 0,!1,void 0,this),f.length>0&&E1(YZ,{number:"02",title:"Presentations",blurb:G.presentations?.blurb,children:E1(HJ,{items:f,viewAllUrl:Y,viewAllLabel:"View all presentations"},void 0,!1,void 0,this)},void 0,!1,void 0,this),F&&E1(YZ,{number:"03",title:"About",blurb:G.about?.blurb,children:E1("div",{className:"flex flex-col gap-8",children:[w.description&&E1("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:w.description},void 0,!1,void 0,this),w.expertise&&w.expertise.length>0&&E1(rA,{subjects:w.expertise},void 0,!1,void 0,this),E1("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",E1("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),E1(IA,{cta:J,variant:"editorial",socialLinks:w.socialLinks},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};import{jsxDEV as R1,Fragment as Rf0}from"preact/jsx-dev-runtime";var GZ=({profile:w})=>{let $=`About ${w.name||"Me"}`,X=w.description||w.intro||"About page",W=w.expertise&&w.expertise.length>0||w.currentFocus||w.availability||w.email||w.website||w.socialLinks&&w.socialLinks.length>0;return R1(Rf0,{children:[R1(V2,{title:$,description:X,ogType:"profile"},void 0,!1,void 0,this),R1("div",{className:"about-page bg-theme",children:[R1("header",{className:"hero-bg-pattern relative w-full py-16 md:py-24 px-6 md:px-12 bg-theme overflow-hidden",children:R1("div",{className:"relative z-10 max-w-4xl mx-auto",children:[R1("h1",{className:"text-5xl md:text-6xl font-semibold mb-6 text-heading",children:["About ",w.name||"Me"]},void 0,!0,void 0,this),w.description&&R1("p",{className:"text-xl md:text-2xl text-theme-muted leading-relaxed",children:w.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),R1("div",{className:"container mx-auto px-6 md:px-12 max-w-4xl py-12 md:py-16",children:[w.story&&R1("section",{className:"content-section-reveal mb-20 md:mb-28",children:R1(f9,{markdown:w.story},void 0,!1,void 0,this)},void 0,!1,void 0,this),W&&R1("div",{className:"content-section-reveal grid md:grid-cols-2 gap-x-16 gap-y-12",children:[w.expertise&&w.expertise.length>0&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Expertise"},void 0,!1,void 0,this),R1("ul",{className:"flex flex-wrap gap-3",children:w.expertise.map((Y,J)=>R1("li",{className:uA({variant:"accent",size:"lg"}),children:Y},J,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.currentFocus&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Current Focus"},void 0,!1,void 0,this),R1("p",{className:"text-lg text-theme leading-relaxed",children:w.currentFocus},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w.availability&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Availability"},void 0,!1,void 0,this),R1("p",{className:"text-lg text-theme leading-relaxed",children:w.availability},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(w.email||w.website||w.socialLinks&&w.socialLinks.length>0)&&R1("section",{children:[R1("h2",{className:"text-sm tracking-widest uppercase text-theme-muted mb-6",children:"Contact"},void 0,!1,void 0,this),R1("div",{className:"space-y-4",children:[w.email&&R1("p",{className:"text-lg",children:R1("a",{href:`mailto:${w.email}`,className:"text-brand hover:text-brand-dark transition-colors",children:w.email},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.website&&R1("p",{className:"text-lg",children:R1("a",{href:w.website,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:text-brand-dark transition-colors",children:w.website},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.socialLinks&&w.socialLinks.length>0&&R1("div",{className:"flex flex-wrap gap-4 mt-4",children:w.socialLinks.map((Y,J)=>R1(c5,{href:Y.url,external:!0,variant:"secondary",size:"md",children:Y.label||Y.platform},J,!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 r2,Fragment as tu}from"preact/jsx-dev-runtime";var KZ=()=>{return r2(tu,{children:[r2(V2,{title:"Thanks for subscribing!",description:"You've successfully subscribed to the newsletter."},void 0,!1,void 0,this),r2("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:r2("div",{className:"text-center max-w-md",children:[r2("div",{className:"text-6xl mb-6",children:"\uD83C\uDF89"},void 0,!1,void 0,this),r2("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Thanks for subscribing!"},void 0,!1,void 0,this),r2("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),r2(c5,{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)},HZ=()=>{return r2(tu,{children:[r2(V2,{title:"Subscription failed",description:"There was a problem with your subscription."},void 0,!1,void 0,this),r2("div",{className:"min-h-[60vh] flex items-center justify-center px-6",children:r2("div",{className:"text-center max-w-md",children:[r2("div",{className:"text-6xl mb-6",children:"\uD83D\uDE22"},void 0,!1,void 0,this),r2("h1",{className:"text-3xl font-semibold mb-4 text-heading",children:"Something went wrong"},void 0,!1,void 0,this),r2("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),r2(c5,{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)};H0();var eu=Z.object({label:Z.string().describe("Display label for entity type (e.g., 'Essay')"),pluralName:Z.string().optional().describe("URL path segment (defaults to label.toLowerCase() + 's')")}),wg=Z.object({entityDisplay:Z.object({post:eu,deck:eu}).describe("Display metadata for post and deck entity types (required for homepage)")});var $g={name:"@brains/site-professional",private:!0,version:"0.2.0-alpha.96",description:"Professional site composition package",type:"module",exports:{".":"./src/index.ts"},files:["src"],scripts:{typecheck:"tsc --noEmit",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix"},dependencies:{"@brains/blog":"workspace:*","@brains/decks":"workspace:*","@brains/identity-service":"workspace:*","@brains/plugins":"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":"latest","bun-types":"latest",eslint:"^8.56.0",typescript:"^5.3.3"}};class UZ extends I8{dependencies=["blog","decks"];constructor(w){super("professional-site",$g,w,wg)}async onRegister(w){w.entities.extendFrontmatterSchema("anchor-profile",CG);let $=this.config.entityDisplay.post,X=this.config.entityDisplay.deck,W=`/${$.pluralName??$.label.toLowerCase()+"s"}`,Y=`/${X.pluralName??X.label.toLowerCase()+"s"}`,J=new bG(W,Y);w.entities.registerDataSource(J);let G=new xG;w.entities.registerDataSource(G);let K=Z.object({profile:F4,posts:Z.array(r5),decks:Z.array(N$),postsListUrl:Z.string(),decksListUrl:Z.string(),cta:M$,sections:Z.record(Z.string(),CW)}),H=Z.object({profile:F4}),f=Z.object({});w.templates.register({"homepage-list":T1({name:"homepage-list",description:"Professional homepage with essays and presentations",schema:K,dataSourceId:"professional:homepage-list",requiredPermission:"public",layout:{component:JZ}}),about:T1({name:"about",description:"About page with full profile information",schema:H,dataSourceId:"professional:about",requiredPermission:"public",layout:{component:GZ}}),"subscribe-thanks":T1({name:"subscribe-thanks",description:"Newsletter subscription success page",schema:f,requiredPermission:"public",layout:{component:KZ}}),"subscribe-error":T1({name:"subscribe-error",description:"Newsletter subscription error page",schema:f,requiredPermission:"public",layout:{component:HZ}})}),this.logger.info("Professional site plugin registered successfully")}async getTools(){return[]}async getResources(){return[]}}function fZ(w){return new UZ(w??{})}var QZ=[{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 yG}from"preact/jsx-dev-runtime";function AZ({sections:w,siteInfo:$,slots:X,wordmark:W}){return yG("div",{className:"flex flex-col min-h-screen bg-theme overflow-x-clip",children:[yG(A$,{title:$.title,navigation:$.navigation.primary,showThemeToggle:!0,...$.logo!==void 0?{logo:$.logo}:{},...W!==void 0?{wordmark:W}:{}},void 0,!1,void 0,this),yG("main",{className:"flex-grow flex flex-col bg-theme",children:w},void 0,!1,void 0,this),yG(CA,{primaryNavigation:$.navigation.primary,secondaryNavigation:$.navigation.secondary,copyright:$.copyright,socialLinks:$.socialLinks,title:$.title,tagline:$.description,children:X?.getSlot("footer-top").map((Y)=>Y.render())},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Xg(w){return{id:w.id,version:w.version,type:w.type,packageName:w.packageName}}var s01=XF;function t01(w){return Xg(wF(w))}var qf0=$F,e01=qf0,w11=AZ;function $11(w){return Xg(fZ(w))}var X11=QZ;export{qf0 as routes,$11 as professionalSitePlugin,X11 as professionalRoutes,t01 as personalSitePlugin,e01 as personalRoutes,w11 as ProfessionalLayout,s01 as PersonalLayout};
1494
1494
 
1495
- //# debugId=F1C14D9202B2879264756E2164756E21
1495
+ //# debugId=BC257267C197D0EF64756E2164756E21
1496
1496
  //# sourceMappingURL=site.js.map