@rizom/ops 0.2.0-alpha.840 → 0.2.0-alpha.841

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
@@ -277,7 +277,7 @@ for (const spec of specs) {
277
277
  }
278
278
  `;var kD=b(()=>{Mn()});function Ju(e){if(e===null||typeof e!=="object"||Array.isArray(e))return!1;let t=BQ(e);return t===Object.prototype||t===null}function UQ(e){return e instanceof Error&&"code"in e&&typeof e.code==="string"}function bh(e){return UQ(e)&&e.code==="ENOENT"}var BQ;var Vu=b(()=>{BQ=Object.getPrototypeOf});import{lstat as mA,mkdir as RD,readFile as TD,unlink as qQ,writeFile as OD}from"fs/promises";import{join as pn}from"path";import{isDeepStrictEqual as MQ}from"util";function zD(e){return pn("deploy","runtime",FQ.parse(e.tag))}function ND(e){let t={"@rizom/brain":Ot.parse(e.brainVersion)};for(let r of[...e.sitePackages].sort()){let o=r.lastIndexOf("@"),n=CD.parse(r.slice(0,o)),i=Ot.parse(r.slice(o+1));if(t[n]!==void 0&&t[n]!==i)throw Error(`Conflicting runtime dependency pin: ${r}`);t[n]=i}return PD.parse({name:"rover-pilot-runtime",private:!0,packageManager:"bun@1.4.0",dependencies:t,overrides:{"postcss-selector-parser":"7.1.6"}})}async function hA(e){try{return await mA(e),!0}catch(t){if(bh(t))return!1;throw t}}async function $D(e){if(!(await mA(e)).isFile())throw Error(`Runtime lock input must be a regular file: ${e}`)}async function DD(e){if(!(await mA(e)).isDirectory())throw Error(`Runtime lock input must be a directory: ${e}`)}async function LD(e){for(let t of["deploy",pn("deploy","runtime")]){let r=pn(e,t);if(await hA(r))await DD(r)}}async function fA(e,t){let r=pn(e,"package.json"),o=pn(e,"bun.lock");await $D(r),await $D(o);let n=PD.parse(JSON.parse(await TD(r,"utf8")));if(!MQ(n,ND(t)))throw Error(`Runtime dependency manifest does not match ${t.tag}`);if(!(await TD(o,"utf8")).trim())throw Error(`Empty runtime dependency lock: ${o}`)}async function gA(e,t){await LD(e);let r=pn(e,zD(t));if(await DD(r),await hA(pn(r,".incomplete")))throw Error(`Incomplete runtime dependency lock: ${r}`);await fA(r,t)}async function ZD(e,t,r=jt){if(Bun.version!=="1.4.0")throw Error("Runtime dependency locks must be generated with Bun 1.4.0");let o=ND(t);await LD(e);let n=pn(e,zD(t));if(await hA(n))return await gA(e,t),"existing";await RD(pn(e,"deploy","runtime"),{recursive:!0}),await RD(n);let i=pn(n,".incomplete");return await OD(i,`Runtime dependency resolution has not completed.
279
279
  `,{flag:"wx"}),await OD(pn(n,"package.json"),`${JSON.stringify(o,null,2)}
280
- `,{flag:"wx"}),await r(process.execPath,["install","--lockfile-only","--ignore-scripts"],{cwd:n}),await fA(n,t),await r(process.execPath,["install","--frozen-lockfile","--ignore-scripts","--dry-run"],{cwd:n}),await fA(n,t),await qQ(i),"created"}var FQ,CD,PD;var yA=b(()=>{Vu();ue();Un();Mn();FQ=c.string().regex(/^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$/),CD=c.string().regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/),PD=c.strictObject({name:c.literal("rover-pilot-runtime"),private:c.literal(!0),packageManager:c.literal("bun@1.4.0"),dependencies:c.record(CD,Ot),overrides:c.strictObject({"postcss-selector-parser":c.literal("7.1.6")})})});function Wu(e,t=[]){let r=`brain-${e}`,o=[...new Set(t)].sort();if(o.length===0)return r;let n=`${r}--${o.map((a)=>a.replace(/^@/,"").replace("/","-").replace(/@(?=[^@]*$)/,"-")).join("--")}`,s=`--s${oh(JSON.stringify([e,...o])).slice(0,12)}`;return`${n.length+s.length<=HQ?n:r}${s}`}function Sh(e){if(!e)return[];return[jD(e.package,e.version),jD(e.theme,e.themeVersion)].filter((t)=>t!==void 0)}function jD(e,t){if(!e?.startsWith("@rizom/"))return;if(t===void 0)throw Error(`Package ${e} has no explicit version pin`);return`${e}@${t}`}function BD(e){let t=new Map;for(let r of e){let o=[...new Set(Sh(r.siteOverride))].sort(),n=Wu(r.brainVersion,o),i=t.get(n);if(i&&(i.brainVersion!==r.brainVersion||!Bun.deepEquals(i.sitePackages,o)))throw Error(`Image tag collision for distinct runtime requirements: ${n}`);t.set(n,{tag:n,brainVersion:r.brainVersion,sitePackages:o})}return[...t.values()].sort((r,o)=>r.tag.localeCompare(o.tag))}function KQ(e,t){let r=new Map;for(let o of[...e,...t]){let n=o.lastIndexOf("@"),i=n>0?o.slice(0,n):o,s=r.get(i);if(s&&s!==o)throw Error(`Fleet shared images have conflicting pins for ${i}: ${s} and ${o}`);r.set(i,o)}return[...r.values()].sort()}async function vh(e){let t=e.brainVersionInput?.trim()??"";if(t){let o=KQ([],(e.sitePackagesInput??"").split(/\s+/).filter(Boolean)),n=Wu(t,o);if(!e.allowTagOverwrite&&await e.imageExists(n))throw Error(`Image tag ${n} already exists; published tags are immutable. Pick a new version, or pass overwrite=true only when replacing a tag whose containers were never deployed.`);return[{tag:n,brainVersion:t,sitePackages:o}]}let r=[];for(let o of BD(e.users))if(!await e.imageExists(o.tag))r.push(o);else await e.verifyImage(o);return r}async function JQ(e,t,r){try{return await e("docker",["manifest","inspect",`${t}:${r}`]),!0}catch(o){if(o instanceof Error&&/exited with code/.test(o.message))return!1;throw o}}async function VQ(e){let t=e.env??process.env,r=e.runCommand??jt,o=e.log??console.log,n=t.BRAIN_VERSION_INPUT?.trim()??"",i=t.SITE_PACKAGES_INPUT?.trim()??"",s=t.ALLOW_TAG_OVERWRITE?.trim()==="true",{users:a}=await ut(e.rootDir),l=await vh({users:a,brainVersionInput:n,sitePackagesInput:i,allowTagOverwrite:s,imageExists:(u)=>JQ(r,e.imageRepository,u),verifyImage:(u)=>ID(e.imageRepository,u,r)});for(let u of l){try{await gA(e.rootDir,u)}catch(d){throw Error(`Missing or invalid runtime lock for ${u.tag}; run brains-ops images:lock and commit its reviewed package.json and bun.lock before building.`,{cause:d})}o(`build needed: ${u.tag} (brain ${u.brainVersion}${u.sitePackages.length>0?`, sites ${u.sitePackages.join(" ")}`:""})`)}if(l.length===0)o("All declared images already exist; nothing to build.");return e.writeOutput("images_json",JSON.stringify(l.map((u)=>({tag:u.tag,brain_version:u.brainVersion,site_packages:u.sitePackages.join(" ")})))),l}var HQ=128;var wh=b(()=>{kD();yA();Jr();Mn();ih()});var qD,WQ,GQ,QQ,Fn,Gu,YQ,bA,XQ,eY,UD,tY,rY,MD,Kke,FD;var xh=b(()=>{jE();qD=["primary","secondary"],WQ=c.custom((e)=>typeof e==="function","Expected a React component"),GQ=c.strictObject({show:c.boolean().optional(),label:c.string().min(1).optional(),slot:c.enum(qD).optional(),priority:c.number().optional()}),QQ=c.strictObject({id:c.string().min(1),template:c.string().min(1),content:c.unknown().optional(),dataQuery:c.looseObject({entityType:c.string().optional(),template:c.string().optional(),query:c.record(c.string(),c.unknown()).optional()}).optional(),order:c.number().optional()}),Fn=c.string().regex(/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/,{message:"must be a language tag such as en or zh-TW"}),Gu=c.strictObject({title:c.string().optional(),description:c.string().optional(),navigationLabel:c.string().optional()}),YQ=c.strictObject({id:c.string().min(1),path:c.string().startsWith("/"),title:c.string().optional(),pageLabel:c.string().optional(),description:c.string().optional(),sections:c.array(QQ).optional(),layout:c.string().min(1).optional(),fullscreen:c.boolean().optional(),pluginId:c.string().optional(),sourceEntityType:c.string().optional(),external:c.boolean().optional(),navigation:GQ.optional(),translations:c.record(Fn,Gu).optional()}),bA=c.strictObject({label:c.string().min(1),pluralName:c.string().min(1).optional(),layout:c.string().min(1).optional(),detailTemplate:c.string().min(1).optional(),paginate:c.boolean().optional(),pageSize:c.number().int().positive().optional(),citable:c.boolean().optional(),navigation:c.strictObject({show:c.boolean().optional(),slot:c.enum(qD).optional(),priority:c.number().optional()}).optional()}),XQ=c.strictObject({schema:c.custom((e)=>e instanceof c.ZodType,"Expected a Zod schema"),component:c.custom((e)=>typeof e==="function","Expected a React component"),title:c.string().min(1),description:c.string(),requiredPermission:c.enum(["admin","trusted","public"]).optional(),fullscreen:c.boolean().optional(),dataSource:c.string().min(1).optional(),components:c.record(Fn,c.custom((e)=>typeof e==="function","Expected a React component")).optional()}),eY=c.custom((e)=>typeof e==="object"&&e!==null&&Reflect.get(e,"kind")==="rizom-data-source"&&typeof Reflect.get(e,"id")==="string"&&typeof Reflect.get(e,"fetch")==="function","Expected a fetching data source declared with defineDataSource"),UD=c.strictObject({namespace:c.string().min(1),sections:c.record(c.string(),XQ)}),tY=c.record(c.string(),c.json()),rY=c.record(c.string(),c.record(c.string(),tY)),MD={layouts:c.record(c.string(),WQ).refine((e)=>typeof e.default==="function",{message:'Site layouts must include a "default" component'}),routes:c.array(YQ),content:rY.optional(),sections:c.union([UD,c.array(UD)]).optional(),themeOverride:c.string().optional(),headScripts:c.array(c.string()).optional(),entityDisplay:c.record(c.string(),bA),staticAssets:c.record(c.string(),c.string()).optional(),languages:c.array(Fn).min(1).optional(),dataSources:c.array(eY).readonly().optional()},Kke=c.strictObject(MD).partial(),FD=c.strictObject(MD).superRefine((e,t)=>{let r=e.languages??[],o=new Set;for(let[u,d]of r.entries()){let p=d.toLowerCase();if(o.has(p))t.addIssue({code:"custom",path:["languages",u],message:`Language "${d}" is declared twice`});o.add(p)}let n=r.slice(1).map((u)=>`/${u.toLowerCase()}`),i=new Set;for(let[u,d]of e.routes.entries()){if(i.has(d.id))t.addIssue({code:"custom",path:["routes",u,"id"],message:`Duplicate route id "${d.id}"`});i.add(d.id);let p=d.path.toLowerCase(),m=n.find((S)=>p===S||p.startsWith(`${S}/`));if(m)t.addIssue({code:"custom",path:["routes",u,"path"],message:`Route path "${d.path}" is under ${m}, where another language's pages are built`});let h=d.layout??"default";if(!e.layouts[h])t.addIssue({code:"custom",path:["routes",u,"layout"],message:`Unknown layout "${h}"`});for(let[S,y]of(d.sections??[]).entries()){let v=/^([^:.\s]+)\.([^:.\s]+)$/.exec(y.template);if(v)t.addIssue({code:"custom",path:["routes",u,"sections",S,"template"],message:`Section template "${y.template}" is written "${v[1]}:${v[2]}"`})}}let s=Array.isArray(e.sections)?e.sections:e.sections?[e.sections]:[],a=new Map(s.map((u)=>[u.namespace,u]));if(a.size!==s.length)t.addIssue({code:"custom",path:["sections"],message:"Section group namespaces must be unique"});let l=new Set;for(let[u,d]of(e.dataSources??[]).entries()){if(l.has(d.id))t.addIssue({code:"custom",path:["dataSources",u],message:`Data source "${d.id}" is declared twice`});l.add(d.id)}for(let u of s)for(let[d,p]of Object.entries(u.sections))if(p.dataSource&&!l.has(p.dataSource))t.addIssue({code:"custom",path:["sections",u.namespace,d,"dataSource"],message:`Section "${u.namespace}:${d}" reads data source "${p.dataSource}", which the site does not declare`});for(let[u,d]of Object.entries(e.content??{})){let p=a.get(u);if(!p){t.addIssue({code:"custom",path:["content",u],message:`Content namespace "${u}" has no section group`});continue}for(let[m,h]of Object.entries(d)){let S=p.sections[m];if(!S){t.addIssue({code:"custom",path:["content",u,m],message:`Content section "${u}:${m}" is not defined`});continue}let y=S.schema.safeParse(h);if(!y.success)t.addIssue({code:"custom",path:["content",u,m],message:`Content does not satisfy the "${u}:${m}" schema: ${c.prettifyError(y.error)}`})}}})});var HD,KD,JD,_h,VD,oY,WD,GD,iY,QD,YD,sY,Eh;var SA=b(()=>{vt();ue();xh();xh();HD=c.object({id:c.string(),template:c.string(),content:c.unknown().optional(),dataQuery:c.looseObject({entityType:c.string().optional(),template:c.string().optional(),query:c.looseObject({id:c.string().optional(),limit:c.number().optional(),offset:c.number().optional()}).optional()}).optional(),order:c.number().optional()}),KD=["primary","secondary"],JD=c.object({show:c.boolean().default(!1),label:c.string().optional(),slot:c.enum(KD).default("primary"),priority:c.number().min(0).max(100).default(50)}).optional(),_h=c.object({id:c.string(),path:c.string(),title:c.string().default(""),pageLabel:c.string().optional(),description:c.string().default(""),sections:c.array(HD).default([]),layout:c.string().default("default"),fullscreen:c.boolean().optional(),pluginId:c.string().optional(),sourceEntityType:c.string().optional(),external:c.boolean().optional(),navigation:JD,translations:c.record(Fn,Gu).optional(),languages:c.array(Fn).optional()}),VD=c.object({routes:c.array(_h),pluginId:c.string()}),oY=he({channel:"plugin:site-builder:route:register",request:VD,response:c.void(),delivery:"command"}),WD=c.strictObject({}),GD=c.array(_h),iY=he({channel:"site-builder:routes:list",request:WD,response:GD,delivery:"request"}),QD=c.strictObject({}),YD=c.array(_h),sY=he({channel:"plugin:site-builder:pages",request:QD,response:YD,delivery:"collect"}),Eh=c.object({label:c.string(),href:c.string(),priority:c.number()})});var XD,eL,tL,aY;var rL=b(()=>{vt();ue();XD=c.object({pluginId:c.string(),slotName:c.string(),render:c.custom((e)=>typeof e==="function"),priority:c.number().optional()}),eL=c.strictObject({}),tL=c.array(XD),aY=he({channel:"plugin:site-builder:slots",request:eL,response:tL,delivery:"collect"})});var nL="site:metadata:updated",Ah,oL,iL,bc,sL,cY,lY,uY;var vA=b(()=>{vt();ue();SA();Ah=c.object({heading:c.string().describe("Main CTA heading text"),subtitle:c.string().optional().describe("A line under the CTA heading"),buttonText:c.string().describe("Call-to-action button text"),buttonLink:c.string().describe("URL or anchor for the CTA button")}),oL=c.object({title:c.string().optional(),description:c.string().optional(),copyright:c.string().optional(),cta:Ah.optional()}),iL=c.object({blurb:c.string().optional().describe("Short italic subtitle under the section title")}),bc=c.object({represents:c.enum(["brain","anchor"]).default("anchor").describe("Identity represented by the site"),title:c.string().describe("The site's title"),description:c.string().describe("The site's description"),url:c.string().optional().describe("Canonical site URL"),copyright:c.string().optional().describe("Copyright notice text"),logo:c.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:c.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:c.string().optional().describe("Analytics script HTML"),cta:Ah.optional().describe("Call-to-action configuration"),sections:c.record(c.string(),iL).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers."),translations:c.record(Fn,oL).optional().describe("The site's title, description, copyright and call to action in its other languages, keyed by language tag. A site is built in a language only once it has one.")}),sL=c.strictObject({}),cY=he({channel:"site:metadata:get",request:sL,response:bc,delivery:"request"}),lY=Bn(nL,bc),uY=bc.extend({copyright:c.string(),navigation:c.object({primary:c.array(Eh),secondary:c.array(Eh)}),socialLinks:c.array(oA).optional().describe("Social media links from profile metadata"),photo:c.string().optional().describe("The anchor's photo, as ![alt](entity://image/<id>)")})});var aRe;var wA=b(()=>{ue();aRe=c.record(c.string(),c.unknown())});var Qu=b(()=>{wA()});var aL=b(()=>{vt();Qu()});var cL=b(()=>{Qu();vt()});var lL=b(()=>{Qu();vt()});var _Re,ERe;var xA=b(()=>{ue();_Re=c.record(c.string(),c.unknown()),ERe=c.object({label:c.string().optional(),line:c.boolean().optional(),itemTitle:c.string().optional(),itemLabel:c.string().optional()}).loose()});var kRe;var uL=b(()=>{ue();$a();kRe=c.record(c.string(),c.unknown())});var dL=b(()=>{$a()});var fL=b(()=>{ue();xA()});var mL;var hL=b(()=>{vt();ue();mL=c.object({id:c.string().min(1),title:c.string().min(1),url:c.url().optional(),brain:uc.optional()})});var Rh=b(()=>{Qu();aL();cL();lL();xA();uL();dL();fL();hL();wA()});var EY;var gL=b(()=>{ue();EY=c.object({slug:c.string(),title:c.string(),type:c.string(),entityId:c.string(),contentHash:c.string()})});var _A=b(()=>{Rh();gL();Rh();Rh()});var yL=b(()=>{_A();ue()});var EA=()=>{};var AY,IY,kY;var Th=b(()=>{ue();vt();AY={url:c.string(),typeLabel:c.string(),listUrl:c.string(),listLabel:c.string()},IY={url:c.string().nullable().default(null),typeLabel:c.string().nullable().default(null),listUrl:c.string().nullable().default(null),listLabel:c.string().nullable().default(null)},kY=c.object({name:c.string(),description:c.string(),schema:c.unknown(),basePrompt:c.string().optional(),useKnowledgeContext:c.boolean().optional(),requiredPermission:c.enum(["admin","trusted","public"]),formatter:c.unknown().optional(),overlayFormatter:c.unknown().optional(),layout:c.object({component:c.unknown().optional(),fullscreen:c.boolean().optional(),formats:c.unknown().optional()}).optional(),dataSourceId:c.string().optional()})});var Oh=b(()=>{Th()});var vL=b(()=>{Oh()});var AA=()=>{};var TY,OY,Sc,wL,$Y;var xL=b(()=>{vt();ue();AA();TY=c.enum(["admin","trusted","public"]),OY=c.enum(["create","update","delete","extract","publish"]),Sc=c.enum(["never","admin","trusted","public"]),wL=c.strictObject({create:Sc.optional(),update:Sc.optional(),delete:Sc.optional(),extract:Sc.optional(),publish:Sc.optional()}),$Y=c.record(c.string(),wL)});var _L=b(()=>{Oh();Th()});var CY,PY,$h,zY,NY,DY;var EL=b(()=>{ue();CY=c.enum(["site-content-preview","site-content-production"]),PY=c.enum(["web","image","pdf","epub"]),$h=c.custom((e)=>typeof e==="function"),zY=c.object({name:c.string(),schema:c.unknown(),description:c.string().optional(),pluginId:c.string(),renderers:c.object({web:c.union([$h,c.string()]).optional(),image:c.union([$h,c.string()]).optional(),pdf:c.union([$h,c.string()]).optional(),epub:c.union([$h,c.string()]).optional()})}),NY=c.object({enableContentGeneration:c.boolean().default(!1),outputDir:c.string(),workingDir:c.string().optional(),environment:c.enum(["preview","production"]).default("preview"),siteConfig:c.object({title:c.string(),description:c.string(),url:c.string().optional()}).optional()}),DY=c.object({success:c.boolean(),routesBuilt:c.number(),errors:c.array(c.string()).optional(),warnings:c.array(c.string()).optional()})});var AL=b(()=>{Th();vL();Oh();xL();AA();_L();EL()});var IA=ye(function(ZY,Ch){(function(){function e(g,E){Object.defineProperty(o.prototype,g,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",E[0],E[1])}})}function t(g){if(g===null||typeof g!=="object")return null;return g=De&&g[De]||g["@@iterator"],typeof g==="function"?g:null}function r(g,E){g=(g=g.constructor)&&(g.displayName||g.name)||"ReactClass";var D=g+"."+E;Qe[D]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",E,g),Qe[D]=!0)}function o(g,E,D){this.props=g,this.context=E,this.refs=Dt,this.updater=D||St}function n(){}function i(g,E,D){this.props=g,this.context=E,this.refs=Dt,this.updater=D||St}function s(){}function a(g){return""+g}function l(g){try{a(g);var E=!1}catch(q){E=!0}if(E){E=console;var D=E.error,H=typeof Symbol==="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return D.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),a(g)}}function u(g){if(g==null)return null;if(typeof g==="function")return g.$$typeof===On?null:g.displayName||g.name||null;if(typeof g==="string")return g;switch(g){case J:return"Fragment";case re:return"Profiler";case G:return"StrictMode";case xe:return"Suspense";case ke:return"SuspenseList";case Ue:return"Activity"}if(typeof g==="object")switch(typeof g.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case N:return"Portal";case me:return g.displayName||"Context";case ae:return(g._context.displayName||"Context")+".Consumer";case Se:var E=g.render;return g=g.displayName,g||(g=E.displayName||E.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case Ie:return E=g.displayName||null,E!==null?E:u(g.type)||"Memo";case _e:E=g._payload,g=g._init;try{return u(g(E))}catch(D){}}return null}function d(g){if(g===J)return"<>";if(typeof g==="object"&&g!==null&&g.$$typeof===_e)return"<...>";try{var E=u(g);return E?"<"+E+">":"<...>"}catch(D){return"<...>"}}function p(){var g=Le.A;return g===null?null:g.getOwner()}function m(){return Error("react-stack-top-frame")}function h(g){if(po.call(g,"key")){var E=Object.getOwnPropertyDescriptor(g,"key").get;if(E&&E.isReactWarning)return!1}return g.key!==void 0}function S(g,E){function D(){ds||(ds=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",E))}D.isReactWarning=!0,Object.defineProperty(g,"key",{get:D,configurable:!0})}function y(){var g=u(this.type);return ps[g]||(ps[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function v(g,E,D,H,q,te){var se=D.ref;return g={$$typeof:M,type:g,key:E,props:D,_owner:H},(se!==void 0?se:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:y}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function x(g,E){return E=v(g.type,E,g.props,g._owner,g._debugStack,g._debugTask),g._store&&(E._store.validated=g._store.validated),E}function _(g){k(g)?g._store&&(g._store.validated=1):typeof g==="object"&&g!==null&&g.$$typeof===_e&&(g._payload.status==="fulfilled"?k(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function k(g){return typeof g==="object"&&g!==null&&g.$$typeof===M}function O(g){var E={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(D){return E[D]})}function L(g,E){return typeof g==="object"&&g!==null&&g.key!=null?(l(g.key),O(""+g.key)):E.toString(36)}function z(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status==="string"?g.then(s,s):(g.status="pending",g.then(function(E){g.status==="pending"&&(g.status="fulfilled",g.value=E)},function(E){g.status==="pending"&&(g.status="rejected",g.reason=E)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function K(g,E,D,H,q){var te=typeof g;if(te==="undefined"||te==="boolean")g=null;var se=!1;if(g===null)se=!0;else switch(te){case"bigint":case"string":case"number":se=!0;break;case"object":switch(g.$$typeof){case M:case N:se=!0;break;case _e:return se=g._init,K(se(g._payload),E,D,H,q)}}if(se){se=g,q=q(se);var be=H===""?"."+L(se,0):H;return $r(q)?(D="",be!=null&&(D=be.replace(Aa,"$&/")+"/"),K(q,E,D,"",function(Te){return Te})):q!=null&&(k(q)&&(q.key!=null&&(se&&se.key===q.key||l(q.key)),D=x(q,D+(q.key==null||se&&se.key===q.key?"":(""+q.key).replace(Aa,"$&/")+"/")+be),H!==""&&se!=null&&k(se)&&se.key==null&&se._store&&!se._store.validated&&(D._store.validated=2),q=D),E.push(q)),1}if(se=0,be=H===""?".":H+":",$r(g))for(var fe=0;fe<g.length;fe++)H=g[fe],te=be+L(H,fe),se+=K(H,E,D,te,q);else if(fe=t(g),typeof fe==="function")for(fe===g.entries&&(Yo||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Yo=!0),g=fe.call(g),fe=0;!(H=g.next()).done;)H=H.value,te=be+L(H,fe++),se+=K(H,E,D,te,q);else if(te==="object"){if(typeof g.then==="function")return K(z(g),E,D,H,q);throw E=String(g),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return se}function P(g,E,D){if(g==null)return g;var H=[],q=0;return K(g,H,"","",function(te){return E.call(D,te,q++)}),H}function W(g){if(g._status===-1){var E=g._ioInfo;E!=null&&(E.start=E.end=performance.now()),E=g._result;var D=E();if(D.then(function(q){if(g._status===0||g._status===-1){g._status=1,g._result=q;var te=g._ioInfo;te!=null&&(te.end=performance.now()),D.status===void 0&&(D.status="fulfilled",D.value=q)}},function(q){if(g._status===0||g._status===-1){g._status=2,g._result=q;var te=g._ioInfo;te!=null&&(te.end=performance.now()),D.status===void 0&&(D.status="rejected",D.reason=q)}}),E=g._ioInfo,E!=null){E.value=D;var H=D.displayName;typeof H==="string"&&(E.name=H)}g._status===-1&&(g._status=0,g._result=D)}if(g._status===1)return E=g._result,E===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
280
+ `,{flag:"wx"}),await r(process.execPath,["install","--lockfile-only","--ignore-scripts"],{cwd:n}),await fA(n,t),await r(process.execPath,["install","--frozen-lockfile","--ignore-scripts","--dry-run"],{cwd:n}),await fA(n,t),await qQ(i),"created"}var FQ,CD,PD;var yA=b(()=>{Vu();ue();Un();Mn();FQ=c.string().regex(/^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$/),CD=c.string().regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/),PD=c.strictObject({name:c.literal("rover-pilot-runtime"),private:c.literal(!0),packageManager:c.literal("bun@1.4.0"),dependencies:c.record(CD,Ot),overrides:c.strictObject({"postcss-selector-parser":c.literal("7.1.6")})})});function Wu(e,t=[]){let r=`brain-${e}`,o=[...new Set(t)].sort();if(o.length===0)return r;let n=`${r}--${o.map((a)=>a.replace(/^@/,"").replace("/","-").replace(/@(?=[^@]*$)/,"-")).join("--")}`,s=`--s${oh(JSON.stringify([e,...o])).slice(0,12)}`;return`${n.length+s.length<=HQ?n:r}${s}`}function Sh(e){if(!e)return[];return[jD(e.package,e.version),jD(e.theme,e.themeVersion)].filter((t)=>t!==void 0)}function jD(e,t){if(!e?.startsWith("@rizom/"))return;if(t===void 0)throw Error(`Package ${e} has no explicit version pin`);return`${e}@${t}`}function BD(e){let t=new Map;for(let r of e){let o=[...new Set(Sh(r.siteOverride))].sort(),n=Wu(r.brainVersion,o),i=t.get(n);if(i&&(i.brainVersion!==r.brainVersion||!Bun.deepEquals(i.sitePackages,o)))throw Error(`Image tag collision for distinct runtime requirements: ${n}`);t.set(n,{tag:n,brainVersion:r.brainVersion,sitePackages:o})}return[...t.values()].sort((r,o)=>r.tag.localeCompare(o.tag))}function KQ(e,t){let r=new Map;for(let o of[...e,...t]){let n=o.lastIndexOf("@"),i=n>0?o.slice(0,n):o,s=r.get(i);if(s&&s!==o)throw Error(`Fleet shared images have conflicting pins for ${i}: ${s} and ${o}`);r.set(i,o)}return[...r.values()].sort()}async function vh(e){let t=e.brainVersionInput?.trim()??"";if(t){let o=KQ([],(e.sitePackagesInput??"").split(/\s+/).filter(Boolean)),n=Wu(t,o);if(!e.allowTagOverwrite&&await e.imageExists(n))throw Error(`Image tag ${n} already exists; published tags are immutable. Pick a new version, or pass overwrite=true only when replacing a tag whose containers were never deployed.`);return[{tag:n,brainVersion:t,sitePackages:o}]}let r=[];for(let o of BD(e.users))if(!await e.imageExists(o.tag))r.push(o);else await e.verifyImage(o);return r}async function JQ(e,t,r){try{return await e("docker",["manifest","inspect",`${t}:${r}`]),!0}catch(o){if(o instanceof Error&&/exited with code/.test(o.message))return!1;throw o}}async function VQ(e){let t=e.env??process.env,r=e.runCommand??jt,o=e.log??console.log,n=t.BRAIN_VERSION_INPUT?.trim()??"",i=t.SITE_PACKAGES_INPUT?.trim()??"",s=t.ALLOW_TAG_OVERWRITE?.trim()==="true",{users:a}=await ut(e.rootDir),l=await vh({users:a,brainVersionInput:n,sitePackagesInput:i,allowTagOverwrite:s,imageExists:(u)=>JQ(r,e.imageRepository,u),verifyImage:(u)=>ID(e.imageRepository,u,r)});for(let u of l){try{await gA(e.rootDir,u)}catch(d){throw Error(`Missing or invalid runtime lock for ${u.tag}; run brains-ops images:lock and commit its reviewed package.json and bun.lock before building.`,{cause:d})}o(`build needed: ${u.tag} (brain ${u.brainVersion}${u.sitePackages.length>0?`, sites ${u.sitePackages.join(" ")}`:""})`)}if(l.length===0)o("All declared images already exist; nothing to build.");return e.writeOutput("images_json",JSON.stringify(l.map((u)=>({tag:u.tag,brain_version:u.brainVersion,site_packages:u.sitePackages.join(" ")})))),l}var HQ=128;var wh=b(()=>{kD();yA();Jr();Mn();ih()});var qD,WQ,GQ,QQ,Fn,Gu,YQ,bA,XQ,eY,UD,tY,rY,MD,Kke,FD;var xh=b(()=>{jE();qD=["primary","secondary"],WQ=c.custom((e)=>typeof e==="function","Expected a React component"),GQ=c.strictObject({show:c.boolean().optional(),label:c.string().min(1).optional(),slot:c.enum(qD).optional(),priority:c.number().optional()}),QQ=c.strictObject({id:c.string().min(1),template:c.string().min(1),content:c.unknown().optional(),dataQuery:c.looseObject({entityType:c.string().optional(),template:c.string().optional(),query:c.record(c.string(),c.unknown()).optional()}).optional(),order:c.number().optional()}),Fn=c.string().regex(/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/,{message:"must be a language tag such as en or zh-TW"}),Gu=c.strictObject({title:c.string().optional(),description:c.string().optional(),navigationLabel:c.string().optional()}),YQ=c.strictObject({id:c.string().min(1),path:c.string().startsWith("/"),title:c.string().optional(),pageLabel:c.string().optional(),description:c.string().optional(),sections:c.array(QQ).optional(),layout:c.string().min(1).optional(),fullscreen:c.boolean().optional(),pluginId:c.string().optional(),sourceEntityType:c.string().optional(),sourceEntityId:c.string().optional(),external:c.boolean().optional(),navigation:GQ.optional(),translations:c.record(Fn,Gu).optional()}),bA=c.strictObject({label:c.string().min(1),pluralName:c.string().min(1).optional(),layout:c.string().min(1).optional(),detailTemplate:c.string().min(1).optional(),paginate:c.boolean().optional(),pageSize:c.number().int().positive().optional(),citable:c.boolean().optional(),navigation:c.strictObject({show:c.boolean().optional(),slot:c.enum(qD).optional(),priority:c.number().optional()}).optional()}),XQ=c.strictObject({schema:c.custom((e)=>e instanceof c.ZodType,"Expected a Zod schema"),component:c.custom((e)=>typeof e==="function","Expected a React component"),title:c.string().min(1),description:c.string(),requiredPermission:c.enum(["admin","trusted","public"]).optional(),fullscreen:c.boolean().optional(),dataSource:c.string().min(1).optional(),components:c.record(Fn,c.custom((e)=>typeof e==="function","Expected a React component")).optional()}),eY=c.custom((e)=>typeof e==="object"&&e!==null&&Reflect.get(e,"kind")==="rizom-data-source"&&typeof Reflect.get(e,"id")==="string"&&typeof Reflect.get(e,"fetch")==="function","Expected a fetching data source declared with defineDataSource"),UD=c.strictObject({namespace:c.string().min(1),sections:c.record(c.string(),XQ)}),tY=c.record(c.string(),c.json()),rY=c.record(c.string(),c.record(c.string(),tY)),MD={layouts:c.record(c.string(),WQ).refine((e)=>typeof e.default==="function",{message:'Site layouts must include a "default" component'}),routes:c.array(YQ),content:rY.optional(),sections:c.union([UD,c.array(UD)]).optional(),themeOverride:c.string().optional(),headScripts:c.array(c.string()).optional(),entityDisplay:c.record(c.string(),bA),staticAssets:c.record(c.string(),c.string()).optional(),languages:c.array(Fn).min(1).optional(),dataSources:c.array(eY).readonly().optional()},Kke=c.strictObject(MD).partial(),FD=c.strictObject(MD).superRefine((e,t)=>{let r=e.languages??[],o=new Set;for(let[u,d]of r.entries()){let p=d.toLowerCase();if(o.has(p))t.addIssue({code:"custom",path:["languages",u],message:`Language "${d}" is declared twice`});o.add(p)}let n=r.slice(1).map((u)=>`/${u.toLowerCase()}`),i=new Set;for(let[u,d]of e.routes.entries()){if(i.has(d.id))t.addIssue({code:"custom",path:["routes",u,"id"],message:`Duplicate route id "${d.id}"`});i.add(d.id);let p=d.path.toLowerCase(),m=n.find((S)=>p===S||p.startsWith(`${S}/`));if(m)t.addIssue({code:"custom",path:["routes",u,"path"],message:`Route path "${d.path}" is under ${m}, where another language's pages are built`});let h=d.layout??"default";if(!e.layouts[h])t.addIssue({code:"custom",path:["routes",u,"layout"],message:`Unknown layout "${h}"`});for(let[S,y]of(d.sections??[]).entries()){let v=/^([^:.\s]+)\.([^:.\s]+)$/.exec(y.template);if(v)t.addIssue({code:"custom",path:["routes",u,"sections",S,"template"],message:`Section template "${y.template}" is written "${v[1]}:${v[2]}"`})}}let s=Array.isArray(e.sections)?e.sections:e.sections?[e.sections]:[],a=new Map(s.map((u)=>[u.namespace,u]));if(a.size!==s.length)t.addIssue({code:"custom",path:["sections"],message:"Section group namespaces must be unique"});let l=new Set;for(let[u,d]of(e.dataSources??[]).entries()){if(l.has(d.id))t.addIssue({code:"custom",path:["dataSources",u],message:`Data source "${d.id}" is declared twice`});l.add(d.id)}for(let u of s)for(let[d,p]of Object.entries(u.sections))if(p.dataSource&&!l.has(p.dataSource))t.addIssue({code:"custom",path:["sections",u.namespace,d,"dataSource"],message:`Section "${u.namespace}:${d}" reads data source "${p.dataSource}", which the site does not declare`});for(let[u,d]of Object.entries(e.content??{})){let p=a.get(u);if(!p){t.addIssue({code:"custom",path:["content",u],message:`Content namespace "${u}" has no section group`});continue}for(let[m,h]of Object.entries(d)){let S=p.sections[m];if(!S){t.addIssue({code:"custom",path:["content",u,m],message:`Content section "${u}:${m}" is not defined`});continue}let y=S.schema.safeParse(h);if(!y.success)t.addIssue({code:"custom",path:["content",u,m],message:`Content does not satisfy the "${u}:${m}" schema: ${c.prettifyError(y.error)}`})}}})});var HD,KD,JD,_h,VD,oY,WD,GD,iY,QD,YD,sY,Eh;var SA=b(()=>{vt();ue();xh();xh();HD=c.object({id:c.string(),template:c.string(),content:c.unknown().optional(),dataQuery:c.looseObject({entityType:c.string().optional(),template:c.string().optional(),query:c.looseObject({id:c.string().optional(),limit:c.number().optional(),offset:c.number().optional()}).optional()}).optional(),order:c.number().optional()}),KD=["primary","secondary"],JD=c.object({show:c.boolean().default(!1),label:c.string().optional(),slot:c.enum(KD).default("primary"),priority:c.number().min(0).max(100).default(50)}).optional(),_h=c.object({id:c.string(),path:c.string(),title:c.string().default(""),pageLabel:c.string().optional(),description:c.string().default(""),sections:c.array(HD).default([]),layout:c.string().default("default"),fullscreen:c.boolean().optional(),pluginId:c.string().optional(),sourceEntityType:c.string().optional(),sourceEntityId:c.string().optional(),external:c.boolean().optional(),navigation:JD,translations:c.record(Fn,Gu).optional(),languages:c.array(Fn).optional()}),VD=c.object({routes:c.array(_h),pluginId:c.string()}),oY=he({channel:"plugin:site-builder:route:register",request:VD,response:c.void(),delivery:"command"}),WD=c.strictObject({}),GD=c.array(_h),iY=he({channel:"site-builder:routes:list",request:WD,response:GD,delivery:"request"}),QD=c.strictObject({}),YD=c.array(_h),sY=he({channel:"plugin:site-builder:pages",request:QD,response:YD,delivery:"collect"}),Eh=c.object({label:c.string(),href:c.string(),priority:c.number()})});var XD,eL,tL,aY;var rL=b(()=>{vt();ue();XD=c.object({pluginId:c.string(),slotName:c.string(),render:c.custom((e)=>typeof e==="function"),priority:c.number().optional()}),eL=c.strictObject({}),tL=c.array(XD),aY=he({channel:"plugin:site-builder:slots",request:eL,response:tL,delivery:"collect"})});var nL="site:metadata:updated",Ah,oL,iL,bc,sL,cY,lY,uY;var vA=b(()=>{vt();ue();SA();Ah=c.object({heading:c.string().describe("Main CTA heading text"),subtitle:c.string().optional().describe("A line under the CTA heading"),buttonText:c.string().describe("Call-to-action button text"),buttonLink:c.string().describe("URL or anchor for the CTA button")}),oL=c.object({title:c.string().optional(),description:c.string().optional(),copyright:c.string().optional(),cta:Ah.optional()}),iL=c.object({blurb:c.string().optional().describe("Short italic subtitle under the section title")}),bc=c.object({represents:c.enum(["brain","anchor"]).default("anchor").describe("Identity represented by the site"),title:c.string().describe("The site's title"),description:c.string().describe("The site's description"),url:c.string().optional().describe("Canonical site URL"),copyright:c.string().optional().describe("Copyright notice text"),logo:c.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:c.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:c.string().optional().describe("Analytics script HTML"),cta:Ah.optional().describe("Call-to-action configuration"),sections:c.record(c.string(),iL).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers."),translations:c.record(Fn,oL).optional().describe("The site's title, description, copyright and call to action in its other languages, keyed by language tag. A site is built in a language only once it has one.")}),sL=c.strictObject({}),cY=he({channel:"site:metadata:get",request:sL,response:bc,delivery:"request"}),lY=Bn(nL,bc),uY=bc.extend({copyright:c.string(),navigation:c.object({primary:c.array(Eh),secondary:c.array(Eh)}),socialLinks:c.array(oA).optional().describe("Social media links from profile metadata"),photo:c.string().optional().describe("The anchor's photo, as ![alt](entity://image/<id>)")})});var aRe;var wA=b(()=>{ue();aRe=c.record(c.string(),c.unknown())});var Qu=b(()=>{wA()});var aL=b(()=>{vt();Qu()});var cL=b(()=>{Qu();vt()});var lL=b(()=>{Qu();vt()});var _Re,ERe;var xA=b(()=>{ue();_Re=c.record(c.string(),c.unknown()),ERe=c.object({label:c.string().optional(),line:c.boolean().optional(),itemTitle:c.string().optional(),itemLabel:c.string().optional()}).loose()});var kRe;var uL=b(()=>{ue();$a();kRe=c.record(c.string(),c.unknown())});var dL=b(()=>{$a()});var fL=b(()=>{ue();xA()});var mL;var hL=b(()=>{vt();ue();mL=c.object({id:c.string().min(1),title:c.string().min(1),url:c.url().optional(),brain:uc.optional()})});var Rh=b(()=>{Qu();aL();cL();lL();xA();uL();dL();fL();hL();wA()});var EY;var gL=b(()=>{ue();EY=c.object({slug:c.string(),title:c.string(),type:c.string(),entityId:c.string(),contentHash:c.string()})});var _A=b(()=>{Rh();gL();Rh();Rh()});var yL=b(()=>{_A();ue()});var EA=()=>{};var AY,IY,kY;var Th=b(()=>{ue();vt();AY={url:c.string(),typeLabel:c.string(),listUrl:c.string(),listLabel:c.string()},IY={url:c.string().nullable().default(null),typeLabel:c.string().nullable().default(null),listUrl:c.string().nullable().default(null),listLabel:c.string().nullable().default(null)},kY=c.object({name:c.string(),description:c.string(),schema:c.unknown(),basePrompt:c.string().optional(),useKnowledgeContext:c.boolean().optional(),requiredPermission:c.enum(["admin","trusted","public"]),formatter:c.unknown().optional(),overlayFormatter:c.unknown().optional(),layout:c.object({component:c.unknown().optional(),fullscreen:c.boolean().optional(),formats:c.unknown().optional()}).optional(),dataSourceId:c.string().optional()})});var Oh=b(()=>{Th()});var vL=b(()=>{Oh()});var AA=()=>{};var TY,OY,Sc,wL,$Y;var xL=b(()=>{vt();ue();AA();TY=c.enum(["admin","trusted","public"]),OY=c.enum(["create","update","delete","extract","publish"]),Sc=c.enum(["never","admin","trusted","public"]),wL=c.strictObject({create:Sc.optional(),update:Sc.optional(),delete:Sc.optional(),extract:Sc.optional(),publish:Sc.optional()}),$Y=c.record(c.string(),wL)});var _L=b(()=>{Oh();Th()});var CY,PY,$h,zY,NY,DY;var EL=b(()=>{ue();CY=c.enum(["site-content-preview","site-content-production"]),PY=c.enum(["web","image","pdf","epub"]),$h=c.custom((e)=>typeof e==="function"),zY=c.object({name:c.string(),schema:c.unknown(),description:c.string().optional(),pluginId:c.string(),renderers:c.object({web:c.union([$h,c.string()]).optional(),image:c.union([$h,c.string()]).optional(),pdf:c.union([$h,c.string()]).optional(),epub:c.union([$h,c.string()]).optional()})}),NY=c.object({enableContentGeneration:c.boolean().default(!1),outputDir:c.string(),workingDir:c.string().optional(),environment:c.enum(["preview","production"]).default("preview"),siteConfig:c.object({title:c.string(),description:c.string(),url:c.string().optional()}).optional()}),DY=c.object({success:c.boolean(),routesBuilt:c.number(),errors:c.array(c.string()).optional(),warnings:c.array(c.string()).optional()})});var AL=b(()=>{Th();vL();Oh();xL();AA();_L();EL()});var IA=ye(function(ZY,Ch){(function(){function e(g,E){Object.defineProperty(o.prototype,g,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",E[0],E[1])}})}function t(g){if(g===null||typeof g!=="object")return null;return g=De&&g[De]||g["@@iterator"],typeof g==="function"?g:null}function r(g,E){g=(g=g.constructor)&&(g.displayName||g.name)||"ReactClass";var D=g+"."+E;Qe[D]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",E,g),Qe[D]=!0)}function o(g,E,D){this.props=g,this.context=E,this.refs=Dt,this.updater=D||St}function n(){}function i(g,E,D){this.props=g,this.context=E,this.refs=Dt,this.updater=D||St}function s(){}function a(g){return""+g}function l(g){try{a(g);var E=!1}catch(q){E=!0}if(E){E=console;var D=E.error,H=typeof Symbol==="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return D.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),a(g)}}function u(g){if(g==null)return null;if(typeof g==="function")return g.$$typeof===On?null:g.displayName||g.name||null;if(typeof g==="string")return g;switch(g){case J:return"Fragment";case re:return"Profiler";case G:return"StrictMode";case xe:return"Suspense";case ke:return"SuspenseList";case Ue:return"Activity"}if(typeof g==="object")switch(typeof g.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case N:return"Portal";case me:return g.displayName||"Context";case ae:return(g._context.displayName||"Context")+".Consumer";case Se:var E=g.render;return g=g.displayName,g||(g=E.displayName||E.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case Ie:return E=g.displayName||null,E!==null?E:u(g.type)||"Memo";case _e:E=g._payload,g=g._init;try{return u(g(E))}catch(D){}}return null}function d(g){if(g===J)return"<>";if(typeof g==="object"&&g!==null&&g.$$typeof===_e)return"<...>";try{var E=u(g);return E?"<"+E+">":"<...>"}catch(D){return"<...>"}}function p(){var g=Le.A;return g===null?null:g.getOwner()}function m(){return Error("react-stack-top-frame")}function h(g){if(po.call(g,"key")){var E=Object.getOwnPropertyDescriptor(g,"key").get;if(E&&E.isReactWarning)return!1}return g.key!==void 0}function S(g,E){function D(){ds||(ds=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",E))}D.isReactWarning=!0,Object.defineProperty(g,"key",{get:D,configurable:!0})}function y(){var g=u(this.type);return ps[g]||(ps[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function v(g,E,D,H,q,te){var se=D.ref;return g={$$typeof:M,type:g,key:E,props:D,_owner:H},(se!==void 0?se:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:y}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function x(g,E){return E=v(g.type,E,g.props,g._owner,g._debugStack,g._debugTask),g._store&&(E._store.validated=g._store.validated),E}function _(g){k(g)?g._store&&(g._store.validated=1):typeof g==="object"&&g!==null&&g.$$typeof===_e&&(g._payload.status==="fulfilled"?k(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function k(g){return typeof g==="object"&&g!==null&&g.$$typeof===M}function O(g){var E={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(D){return E[D]})}function L(g,E){return typeof g==="object"&&g!==null&&g.key!=null?(l(g.key),O(""+g.key)):E.toString(36)}function z(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status==="string"?g.then(s,s):(g.status="pending",g.then(function(E){g.status==="pending"&&(g.status="fulfilled",g.value=E)},function(E){g.status==="pending"&&(g.status="rejected",g.reason=E)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function K(g,E,D,H,q){var te=typeof g;if(te==="undefined"||te==="boolean")g=null;var se=!1;if(g===null)se=!0;else switch(te){case"bigint":case"string":case"number":se=!0;break;case"object":switch(g.$$typeof){case M:case N:se=!0;break;case _e:return se=g._init,K(se(g._payload),E,D,H,q)}}if(se){se=g,q=q(se);var be=H===""?"."+L(se,0):H;return $r(q)?(D="",be!=null&&(D=be.replace(Aa,"$&/")+"/"),K(q,E,D,"",function(Te){return Te})):q!=null&&(k(q)&&(q.key!=null&&(se&&se.key===q.key||l(q.key)),D=x(q,D+(q.key==null||se&&se.key===q.key?"":(""+q.key).replace(Aa,"$&/")+"/")+be),H!==""&&se!=null&&k(se)&&se.key==null&&se._store&&!se._store.validated&&(D._store.validated=2),q=D),E.push(q)),1}if(se=0,be=H===""?".":H+":",$r(g))for(var fe=0;fe<g.length;fe++)H=g[fe],te=be+L(H,fe),se+=K(H,E,D,te,q);else if(fe=t(g),typeof fe==="function")for(fe===g.entries&&(Yo||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Yo=!0),g=fe.call(g),fe=0;!(H=g.next()).done;)H=H.value,te=be+L(H,fe++),se+=K(H,E,D,te,q);else if(te==="object"){if(typeof g.then==="function")return K(z(g),E,D,H,q);throw E=String(g),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return se}function P(g,E,D){if(g==null)return g;var H=[],q=0;return K(g,H,"","",function(te){return E.call(D,te,q++)}),H}function W(g){if(g._status===-1){var E=g._ioInfo;E!=null&&(E.start=E.end=performance.now()),E=g._result;var D=E();if(D.then(function(q){if(g._status===0||g._status===-1){g._status=1,g._result=q;var te=g._ioInfo;te!=null&&(te.end=performance.now()),D.status===void 0&&(D.status="fulfilled",D.value=q)}},function(q){if(g._status===0||g._status===-1){g._status=2,g._result=q;var te=g._ioInfo;te!=null&&(te.end=performance.now()),D.status===void 0&&(D.status="rejected",D.reason=q)}}),E=g._ioInfo,E!=null){E.value=D;var H=D.displayName;typeof H==="string"&&(E.name=H)}g._status===-1&&(g._status=0,g._result=D)}if(g._status===1)return E=g._result,E===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
281
281
 
282
282
  Your code should look like:
283
283
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -779,7 +779,7 @@ printf 'REMOTE_ARTIFACT_DIR=%s\\n' "$remote_dir"
779
779
  `),i}async function FH(e,t){let r=await ut(e),o=r.users.find((n)=>n.handle===t);if(!o)throw Error(`Unknown pilot user: ${t}`);return{pilot:r.pilot,user:o}}async function HH(e){let t=await Pye(uo(zye(),"brains-ops-watchdog-smoke-")),r=uo(t,"id_ed25519"),o=uo(t,"known_hosts");try{let n=encodeURIComponent(`brain=${e.target.pilot.contentRepoPrefix}${e.target.user.handle}`),i=await e.fetchImpl(`https://api.hetzner.cloud/v1/servers?label_selector=${n}`,{headers:{Authorization:`Bearer ${e.environment.HCLOUD_TOKEN}`}});if(!i.ok)throw Error(`Hetzner server lookup failed with ${i.status}`);let s=Nye.parse(await i.json());if(s.servers.length!==1)throw Error(`Expected one smoke server, found ${s.servers.length}`);let a=s.servers[0];if(a?.status!=="running")throw Error("Smoke server is not running");await Jl(r,Lye(e.environment.KAMAL_SSH_PRIVATE_KEY),{mode:384}),await Cye(r,384);let l=await e.commandRunner("ssh-keyscan",["-T","10","-t","ed25519",a.public_net.ipv4.ip]);if(l.exitCode!==0||!l.stdout.trim())throw Error("Unable to resolve watchdog smoke SSH host key");return await Jl(o,l.stdout,{mode:384}),{temporaryRoot:t,sshKeyPath:r,knownHostsPath:o,serverIp:a.public_net.ipv4.ip,commandRunner:e.commandRunner}}catch(n){throw await E$(t,{recursive:!0,force:!0}),n}}async function _$(e,t,r){return e.commandRunner("ssh",[...KH(e),`root@${e.serverIp}`,"bash","-s","--",t,r],{stdin:A$()})}async function Dye(e,t,r){return e.commandRunner("scp",[...KH(e),"-r",`root@${e.serverIp}:${t}/.`,r])}function KH(e){return["-i",e.sshKeyPath,"-o","BatchMode=yes","-o","IdentitiesOnly=yes","-o","ConnectTimeout=10","-o","StrictHostKeyChecking=yes","-o",`UserKnownHostsFile=${e.knownHostsPath}`]}async function Jb(e,t,r){await Promise.all([Jl(uo(e,`${t}.stdout.log`),r.stdout),Jl(uo(e,`${t}.stderr.log`),r.stderr)])}function Lye(e){return`${e.replace(/\r\n/g,`
780
780
  `).replace(/\\n/g,`
781
781
  `).trimEnd()}
782
- `}var UH,Nye;var Wb=b(async()=>{ue();LH();Jr();df();Ts();await DH();UH=c.object({HCLOUD_TOKEN:c.string().min(1),KAMAL_SSH_PRIVATE_KEY:c.string().min(1)}),Nye=c.object({servers:c.array(c.object({status:c.string(),public_net:c.object({ipv4:c.object({ip:c.string().min(1)})})}))})});import{chmod as lA,mkdir as yh,readFile as AD,writeFile as ED}from"fs/promises";import{dirname as yQ,join as yc}from"path";import{fileURLToPath as bQ}from"url";var gf={name:"@rizom/ops",version:"0.2.0-alpha.840",description:"Operator CLI for managing private brain fleet registry repos",keywords:["brains","ops","cli","deploy","fleet","operator"],license:"AGPL-3.0-only",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{"brains-ops":"./dist/brains-ops.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@libsql/client":"^0.17.4","age-encryption":"^0.3.0",yaml:"^2.9.0"},devDependencies:{"@brains/contracts":"workspace:*","@brains/deploy-support":"workspace:*","@brains/eslint-config":"workspace:*","@brains/job-queue":"workspace:*","@brains/profile":"workspace:*","@brains/site-composition":"workspace:*","@brains/test-utils":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@types/bun":"^1.4.0",typescript:"^7.0.2"},engines:{bun:">=1.3.3"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js",bun:"./dist/deploy.js"}},files:["dist","templates"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brains-ops#readme",main:"./dist/index.js",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brains-ops"},scripts:{build:"bun scripts/build.ts",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts",test:"bun test --timeout 20000","test:smoke":"bun run build && RUN_SMOKE_TESTS=1 bun test --timeout 60000",typecheck:"tsc --noEmit"},type:"module",types:"./dist/index.d.ts"};ei();gc();Ts();var SQ=["pilot.yaml","package.json",".env.schema",".gitignore","cohorts/cohort-1.yaml","users/alice.yaml",".github/actions/varlock-env/action.yml",".github/workflows/build.yml",".github/workflows/deploy.yml",".github/workflows/directory-sync-stress.yml",".github/workflows/health-watchdog-smoke.yml",".github/workflows/offboard.yml",".github/workflows/reconcile.yml",".github/workflows/upgrade.yml","deploy/Dockerfile","deploy/kamal/deploy.yml","deploy/scripts/helpers.ts","deploy/scripts/create-predeploy-backup.ts","deploy/scripts/install-health-watchdog.ts","deploy/scripts/provision-server.ts","deploy/scripts/pull-local-models.ts","deploy/scripts/reload-homeserver.ts","deploy/scripts/update-dns.ts","deploy/scripts/write-ssh-key.ts","deploy/scripts/decrypt-user-secrets.ts","deploy/scripts/validate-secrets.ts","deploy/scripts/write-kamal-secrets.ts","deploy/scripts/resolve-user-config.ts","deploy/scripts/resolve-missing-images.ts","deploy/scripts/verify-runtime-image.ts","deploy/scripts/resolve-deploy-handles.ts","deploy/scripts/sync-content-repo.ts",".kamal/hooks/pre-deploy","docs/onboarding-checklist.md","docs/canonical-crossover-record.md","docs/operator-playbook.md","docs/user-onboarding.md","README.md"],uA=new Set([".kamal/hooks/pre-deploy"]),vQ=new Set(["cohorts/cohort-1.yaml","users/alice.yaml","docs/canonical-crossover-record.md"]),wQ=bQ(new URL("../templates/rover-pilot/",import.meta.url));function qn(e){return(t)=>t.includes(e)}function xQ(e){return z$.find((t)=>e===`deploy/scripts/${t}`)}function dA(e){return e.replace(/\n {2}secret:\n(?: {4}- .*\n)+\nvolumes:\n/,`
782
+ `}var UH,Nye;var Wb=b(async()=>{ue();LH();Jr();df();Ts();await DH();UH=c.object({HCLOUD_TOKEN:c.string().min(1),KAMAL_SSH_PRIVATE_KEY:c.string().min(1)}),Nye=c.object({servers:c.array(c.object({status:c.string(),public_net:c.object({ipv4:c.object({ip:c.string().min(1)})})}))})});import{chmod as lA,mkdir as yh,readFile as AD,writeFile as ED}from"fs/promises";import{dirname as yQ,join as yc}from"path";import{fileURLToPath as bQ}from"url";var gf={name:"@rizom/ops",version:"0.2.0-alpha.841",description:"Operator CLI for managing private brain fleet registry repos",keywords:["brains","ops","cli","deploy","fleet","operator"],license:"AGPL-3.0-only",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{"brains-ops":"./dist/brains-ops.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@libsql/client":"^0.17.4","age-encryption":"^0.3.0",yaml:"^2.9.0"},devDependencies:{"@brains/contracts":"workspace:*","@brains/deploy-support":"workspace:*","@brains/eslint-config":"workspace:*","@brains/job-queue":"workspace:*","@brains/profile":"workspace:*","@brains/site-composition":"workspace:*","@brains/test-utils":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@types/bun":"^1.4.0",typescript:"^7.0.2"},engines:{bun:">=1.3.3"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js",bun:"./dist/deploy.js"}},files:["dist","templates"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brains-ops#readme",main:"./dist/index.js",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brains-ops"},scripts:{build:"bun scripts/build.ts",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts",test:"bun test --timeout 20000","test:smoke":"bun run build && RUN_SMOKE_TESTS=1 bun test --timeout 60000",typecheck:"tsc --noEmit"},type:"module",types:"./dist/index.d.ts"};ei();gc();Ts();var SQ=["pilot.yaml","package.json",".env.schema",".gitignore","cohorts/cohort-1.yaml","users/alice.yaml",".github/actions/varlock-env/action.yml",".github/workflows/build.yml",".github/workflows/deploy.yml",".github/workflows/directory-sync-stress.yml",".github/workflows/health-watchdog-smoke.yml",".github/workflows/offboard.yml",".github/workflows/reconcile.yml",".github/workflows/upgrade.yml","deploy/Dockerfile","deploy/kamal/deploy.yml","deploy/scripts/helpers.ts","deploy/scripts/create-predeploy-backup.ts","deploy/scripts/install-health-watchdog.ts","deploy/scripts/provision-server.ts","deploy/scripts/pull-local-models.ts","deploy/scripts/reload-homeserver.ts","deploy/scripts/update-dns.ts","deploy/scripts/write-ssh-key.ts","deploy/scripts/decrypt-user-secrets.ts","deploy/scripts/validate-secrets.ts","deploy/scripts/write-kamal-secrets.ts","deploy/scripts/resolve-user-config.ts","deploy/scripts/resolve-missing-images.ts","deploy/scripts/verify-runtime-image.ts","deploy/scripts/resolve-deploy-handles.ts","deploy/scripts/sync-content-repo.ts",".kamal/hooks/pre-deploy","docs/onboarding-checklist.md","docs/canonical-crossover-record.md","docs/operator-playbook.md","docs/user-onboarding.md","README.md"],uA=new Set([".kamal/hooks/pre-deploy"]),vQ=new Set(["cohorts/cohort-1.yaml","users/alice.yaml","docs/canonical-crossover-record.md"]),wQ=bQ(new URL("../templates/rover-pilot/",import.meta.url));function qn(e){return(t)=>t.includes(e)}function xQ(e){return z$.find((t)=>e===`deploy/scripts/${t}`)}function dA(e){return e.replace(/\n {2}secret:\n(?: {4}- .*\n)+\nvolumes:\n/,`
783
783
  secret:
784
784
  - __DYNAMIC_SECRETS__
785
785
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rizom/ops",
3
- "version": "0.2.0-alpha.840",
3
+ "version": "0.2.0-alpha.841",
4
4
  "description": "Operator CLI for managing private brain fleet registry repos",
5
5
  "keywords": [
6
6
  "brains",