fimo 2.15.0-staging.1 → 2.15.0-staging.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bundled": true,
3
3
  "bundler": "esbuild",
4
- "bundledAt": "2026-11-16T13:42:45.896Z",
4
+ "bundledAt": "2026-11-16T14:39:15.250Z",
5
5
  "cliVersion": "2.14.0",
6
6
  "external": [
7
7
  "oxc-parser",
package/dist/cli/index.js CHANGED
@@ -2924,7 +2924,7 @@ ${run.output}`:fields},"render")})}__name(renderRunDetail,"renderRunDetail");fun
2924
2924
  `));return JSON.parse(fs44.readFileSync(filePath,"utf-8"))}),framework=await detectProjectFramework(cwd);syncSchemas({cwd,framework:framework?.slug??null,verbose:!1});let operations=schemas3.length===1?(options.rename??[]).map(value=>renameOperation(schemas3[0].uid,value)):[],results;try{results=await upsertSchemasWithReconciliation(fimo,ctx.projectId,ctx.branch,schemas3.map(schema=>toApiShape(schema)),operations)}catch(error){if(error instanceof ApiRequestError&&error.code==="schema_transition_rejected"){let issues=getUniqueConflictIssues(error.body);if(issues){renderSchemaTransitionRejected(error.body,issues);return}}throw error}let payload=results.length===1?results[0]:results;ui.result({command:"schemas push",data:payload,render:__name(()=>renderPrettyJson8(payload),"render")})}__name(schemaPushCommand,"schemaPushCommand");async function schemaDeleteCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.schema.delete",{projectId:ctx.projectId,branch:ctx.branch});let result=await fimo.execute("schemas.deleteFromBranch",{projectId:ctx.projectId,branch:ctx.branch,typeName});ui.result({command:"schemas delete",data:result,render:__name(()=>renderPrettyJson8(result),"render")})}__name(schemaDeleteCommand,"schemaDeleteCommand");init_dist();init_project_context();var SinglesInputError=class extends Error{static{__name(this,"SinglesInputError")}constructor(message){super(message),this.name="SinglesInputError"}};function renderPrettyJson9(data){return JSON.stringify(data,null,2)}__name(renderPrettyJson9,"renderPrettyJson");function parseJsonObject2(value){let parsed;try{parsed=JSON.parse(value)}catch(error){throw new SinglesInputError(error instanceof Error?`Invalid JSON: ${error.message}`:"Invalid JSON.")}if(!parsed||typeof parsed!="object"||Array.isArray(parsed))throw new SinglesInputError("Expected a JSON object.");return parsed}__name(parseJsonObject2,"parseJsonObject");async function singlesGetCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd);await requireOperation("cms.get",{projectId:ctx.projectId,branch:ctx.branch});let{data:result}=await fimo.execute("singles.get",{projectId:ctx.projectId,branch:ctx.branch,typeName,locale:options.locale,populate:options.populate?[options.populate]:void 0});ui.result({command:"singles get",data:result,render:__name(()=>renderPrettyJson9(result),"render")})}__name(singlesGetCommand,"singlesGetCommand");async function singlesUpdateCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.update",{projectId:ctx.projectId,branch:ctx.branch});let input=parseJsonObject2(await readContentInputSource(options,message=>new SinglesInputError(message))),{data:result}=await fimo.execute("singles.update",{projectId:ctx.projectId,branch:ctx.branch,typeName,locale:options.locale,data:input.data});ui.result({command:"singles update",data:result,render:__name(()=>renderPrettyJson9(result),"render")})}__name(singlesUpdateCommand,"singlesUpdateCommand");import{spawn as spawn3}from"node:child_process";import{mkdtempSync as mkdtempSync2,rmSync,writeFileSync as writeFileSync6}from"node:fs";import{tmpdir as tmpdir5}from"node:os";import path47 from"node:path";init_esm();init_dist();init_config();init_project_services();init_git();init_project_context();init_project2();var PREVIEW_WAIT_MS=9e4,DEV_SERVER_URL="http://localhost:5173",MAX_PAGES=50,DEADLINE_SECONDS=300,SiteCommandError=class extends Error{constructor(message,hint){super(message);this.hint=hint;this.name="SiteCommandError"}static{__name(this,"SiteCommandError")}};function normalizePagePaths(args,all=!1){if(all){if(args.length>0)throw new SiteCommandError("--all reads every page: name no page with it.","Run `fimo site check --all`.");return[]}let out=[];for(let raw of args.flatMap(a2=>a2.split(/\s+/)).filter(Boolean)){let p;try{let u4=new URL(raw,"http://site.invalid");p=u4.pathname+u4.search}catch{throw new SiteCommandError(`'${raw}' is not a page path.`,"Name pages by path, for example `/pricing` or `/blog/my-post`.")}out.includes(p)||out.push(p)}if(out.length===0)throw new SiteCommandError("Name at least one page, or pass --all.","For example `fimo site check / /pricing`, or `fimo site check --all` for the whole site.");if(out.length>MAX_PAGES)throw new SiteCommandError(`${out.length} pages named; this checks at most ${MAX_PAGES} at once.`,"Check the pages the change affects, in batches if needed.");return out}__name(normalizePagePaths,"normalizePagePaths");async function answers(origin){try{return await fetch(origin+"/",{redirect:"manual",signal:AbortSignal.timeout(1e4)}),!0}catch{return!1}}__name(answers,"answers");function previewProblem(wait,branch,waitMs){switch(wait.kind){case"none":return`Branch '${branch}' has no hosted preview`;case"failed":return`the hosted preview of '${branch}' failed to build`;case"pending":return`the hosted preview of '${branch}' is still ${wait.preview.status==="queued"?"waiting to build":"building"} after ${Math.round(waitMs/1e3)} s`;case"no-url":return`the hosted preview of '${branch}' is ready but has no URL`}}__name(previewProblem,"previewProblem");async function resolveSiteTarget(input){if(input.url)try{return{kind:"url",origin:new URL(input.url).origin}}catch{throw new SiteCommandError(`--url '${input.url}' is not a URL.`,"Pass an origin such as http://localhost:5173.")}if(isProductionBranch(input.branch))throw new SiteCommandError(`Branch '${input.branch}' is production and has no hosted preview.`,"Check main's preview with --branch main, or the published site at its address with --url <origin>.");let wait=await waitForHostedPreview(input.readPreview,input.waitMs??PREVIEW_WAIT_MS,input.sleep);if(wait.kind==="ready")return{kind:"hosted-preview",origin:new URL(wait.url).origin,generation:wait.preview.generation,revision:wait.preview.revision};let why=previewProblem(wait,input.branch,input.waitMs??PREVIEW_WAIT_MS),ownBranch=input.checkoutBranch===input.branch;if(ownBranch&&await(input.devServerAnswers??answers)(DEV_SERVER_URL))return{kind:"dev-server",origin:DEV_SERVER_URL,why};let retry=wait.kind==="pending"?"Run the command again in a minute.":wait.kind==="failed"?"The hosted preview is a production build that Fimo runs apart from your dev server, so `fimo logs` does not show its error. Run the site's production build locally (its `build` script, for example `npm run build`) to see the error, fix it, then deploy again.":"Deploy a change to ask for a hosted preview (`fimo deploy`).";throw new SiteCommandError(`Cannot check the site: ${why}${ownBranch?`, and no dev server answers at ${DEV_SERVER_URL}`:""}.`,`${retry} Or pass --url <origin> to check another address.`)}__name(resolveSiteTarget,"resolveSiteTarget");function runScript(file,args,cwd,siteDir){return new Promise((resolve10,reject)=>{let child=spawn3(process.execPath,[file,...args],{cwd,env:siteDir?{...process.env,FIMO_SITE_DIR:siteDir}:process.env,stdio:["ignore","pipe","pipe"]}),stdout2="",stderr="";child.stdout.on("data",d=>stdout2+=d.toString("utf8")),child.stderr.on("data",d=>stderr+=d.toString("utf8")),child.on("error",reject),child.on("close",code2=>resolve10({code:code2??1,stdout:stdout2.trim(),stderr:stderr.trim()}))})}__name(runScript,"runScript");async function readPages(input){let dir=mkdtempSync2(path47.join(tmpdir5(),"fimo-site-")),siteDir=input.all?void 0:dir;try{let script=path47.join(dir,"site.mjs"),pages2=path47.join(dir,"pages.txt");writeFileSync6(script,SITE_SCRIPT),writeFileSync6(pages2,input.paths.join(`
2925
2925
  `)+`
2926
2926
  `);let crawlArgs=input.all?["crawl",input.origin,"--fresh",...input.seed?["--seed",path47.resolve(input.seed)]:[]]:["crawl",input.origin,"--pages",pages2,"--deadline",String(DEADLINE_SECONDS),"--fresh"];input.browser?(crawlArgs.push("--parallel","2"),__name((...topics)=>input.topics.length===0||input.topics.some(t2=>topics.includes(t2)),"reads")("accessibility","mobile")&&crawlArgs.push("--quality"),input.topics.some(t2=>t2==="consent"||t2==="privacy")&&crawlArgs.push("--compliance")):crawlArgs.push("--http");let read=await runScript(script,crawlArgs,input.projectDir,siteDir);if(read.code!==0)throw new SiteCommandError(read.stdout.split(`
2927
- `).filter(Boolean).pop()||read.stderr||"The pages could not be read.",input.browser?"Check that agent-browser is installed (`agent-browser --version`).":`Check that ${input.origin} answers.`);let report2=await runScript(script,[...input.report],input.projectDir,siteDir);if(report2.code!==0)throw new SiteCommandError(report2.stdout||report2.stderr||"The check failed.","Run the command again.");return{read:read.stdout,report:report2.stdout}}finally{rmSync(dir,{recursive:!0,force:!0})}}__name(readPages,"readPages");async function checkoutBranchOf(projectDir){try{let branch=(await currentBranch2(projectDir)).trim();if(branch)return branch}catch{}return process.env.FIMO_ENV?.trim()||null}__name(checkoutBranchOf,"checkoutBranchOf");function targetLine(target,branch){switch(target.kind){case"hosted-preview":return`Hosted preview of '${branch}' (${target.origin}${target.revision?`, revision ${target.revision.slice(0,7)}`:""}).`;case"dev-server":return`Dev server ${target.origin}: ${target.why}.`;case"url":return`${target.origin} (--url).`}}__name(targetLine,"targetLine");async function runSiteCommand(command,pathArgs,options,cmd){try{let all=options.all===!0,paths=normalizePagePaths(pathArgs,all),{ctx}=await bootstrapProjectCommand(options,cmd);await requireOperation("fimo.site.check",{projectId:ctx.projectId,branch:ctx.branch});let sandbox=createSandboxService(loadConfig(),ctx.branch),projectDir=resolveProjectCwd(options.cwd),target=await resolveSiteTarget({url:options.url,branch:ctx.branch,checkoutBranch:await checkoutBranchOf(projectDir),readPreview:__name(()=>sandbox.getHostedPreview(ctx.projectId,ctx.branch),"readPreview")}),topics=(options.topic??"").split(",").map(t2=>t2.trim()).filter(Boolean),browser=command==="site check"&&options.browser===!0,{read,report:report2}=await readPages({origin:target.origin,paths,all,seed:options.seed,browser,topics,report:command==="site links"?["links"]:["check",...topics.length?["--topic",topics.join(",")]:[]],projectDir}),text2=[targetLine(target,ctx.branch),read,report2].filter(Boolean).join(`
2927
+ `).filter(Boolean).pop()||read.stderr||"The pages could not be read.",input.browser?"Check that agent-browser is installed (`agent-browser --version`).":`Check that ${input.origin} answers.`);let report2=await runScript(script,[...input.report],input.projectDir,siteDir);if(report2.code!==0)throw new SiteCommandError(report2.stdout||report2.stderr||"The check failed.","Run the command again.");return{read:read.stdout.replace(" pages (--max),"," pages,"),report:report2.stdout}}finally{rmSync(dir,{recursive:!0,force:!0})}}__name(readPages,"readPages");async function checkoutBranchOf(projectDir){try{let branch=(await currentBranch2(projectDir)).trim();if(branch)return branch}catch{}return process.env.FIMO_ENV?.trim()||null}__name(checkoutBranchOf,"checkoutBranchOf");function targetLine(target,branch){switch(target.kind){case"hosted-preview":return`Hosted preview of '${branch}' (${target.origin}${target.revision?`, revision ${target.revision.slice(0,7)}`:""}).`;case"dev-server":return`Dev server ${target.origin}: ${target.why}.`;case"url":return`${target.origin} (--url).`}}__name(targetLine,"targetLine");async function runSiteCommand(command,pathArgs,options,cmd){try{let all=options.all===!0,paths=normalizePagePaths(pathArgs,all),{ctx}=await bootstrapProjectCommand(options,cmd);await requireOperation("fimo.site.check",{projectId:ctx.projectId,branch:ctx.branch});let sandbox=createSandboxService(loadConfig(),ctx.branch),projectDir=resolveProjectCwd(options.cwd),target=await resolveSiteTarget({url:options.url,branch:ctx.branch,checkoutBranch:await checkoutBranchOf(projectDir),readPreview:__name(()=>sandbox.getHostedPreview(ctx.projectId,ctx.branch),"readPreview")}),topics=(options.topic??"").split(",").map(t2=>t2.trim()).filter(Boolean),browser=command==="site check"&&options.browser===!0,{read,report:report2}=await readPages({origin:target.origin,paths,all,seed:options.seed,browser,topics,report:command==="site links"?["links"]:["check",...topics.length?["--topic",topics.join(",")]:[]],projectDir}),text2=[targetLine(target,ctx.branch),read,report2].filter(Boolean).join(`
2928
2928
  `);ui.result({command,data:{project_id:ctx.projectId,branch:ctx.branch,target:target.origin,target_kind:target.kind,mode:browser?"browser":"http",...all?{all:!0}:{pages:paths},...topics.length?{topics}:{},output:text2},render:__name(()=>text2,"render")})}catch(error){ui.error({command,code:"SITE_CHECK_FAILED",message:error instanceof Error?error.message:String(error),hint:error instanceof SiteCommandError?error.hint:"Run the command again; if it keeps failing, pass --url <origin>."})}}__name(runSiteCommand,"runSiteCommand");function siteCheckCommand(paths,options,cmd){return runSiteCommand("site check",paths,options,cmd)}__name(siteCheckCommand,"siteCheckCommand");function siteLinksCommand(paths,options,cmd){return runSiteCommand("site links",paths,options,cmd)}__name(siteLinksCommand,"siteLinksCommand");function registerSiteCommands(program2){let site=program2.command("site").description("Check pages of the site for SEO, links, images, AI readiness and more: named pages, or every page");site.command("check [paths...]").description("Check named pages, or the whole site, of the Branch's hosted preview (SEO, links, images, ...): HTTP by default (a browser for pages JavaScript draws), every page in a real browser with --browser").option("--topic <topics>","Only these topics, comma-separated (meta-tags, image-seo, broken-links, ...)").option("--browser","Render every page in a real browser: accessibility, phone layout, consent (slower)").option("--all","Every page: the home page, the sitemap, llms.txt and every page they link to (at most 300)").option("--seed <file>","With --all: also read the pages a saved snapshot lists").option("--url <origin>","Check this address instead of the hosted preview (for example http://localhost:5173)").option("-C, --cwd <dir>","Run against this directory instead of cwd").action((paths=[],opts,cmd)=>siteCheckCommand(paths,opts,cmd)),site.command("links <paths...>").description("List the named pages' links with each target's status; every unique target is checked once").option("--url <origin>","Check this address instead of the hosted preview (for example http://localhost:5173)").option("-C, --cwd <dir>","Run against this directory instead of cwd").action((paths,opts,cmd)=>siteLinksCommand(paths,opts,cmd))}__name(registerSiteCommands,"registerSiteCommands");init_status();import{readFileSync as readFileSync12}from"node:fs";import path48 from"node:path";init_dist();init_config();init_sdk_transport();init_project_services();init_project_context();init_version();var MAX_SUPPORT_MESSAGE_LENGTH=2e4;function registerSupportCommands(program2){program2.command("support").description("Contact Fimo support").command("report").description("Report a Fimo problem or high-impact feature request with site and environment context").argument("[message...]","What happened or capability is missing; use --message-file for longer or agent-written reports").option("--message-file <path>","Read the report from a UTF-8 text file").option("-C, --cwd <dir>","Site directory").option("--preview","Print the exact support payload without sending it").option("-y, --yes","Send without prompting").addHelpText("after",`
2929
2929
  Examples:
2930
2930
  fimo support report "Preview deployment fails after validation"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fimo",
3
- "version": "2.15.0-staging.1",
3
+ "version": "2.15.0-staging.2",
4
4
  "description": "CLI for Fimo, the website platform for sites built with coding agents: CMS, previews, site agents, and hosting. Create, deploy, and manage Fimo sites.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -202,13 +202,13 @@
202
202
  "devDependencies": {
203
203
  "@clack/core": "^1.5.1",
204
204
  "@clack/prompts": "^1.8.1",
205
- "@fimo/agents-bundle": "2.15.0-staging.1",
206
- "@fimo/api-contracts": "2.15.0-staging.1",
207
- "@fimo/cli-kit": "2.15.0-staging.1",
208
- "@fimo/framework-detect": "2.15.0-staging.1",
209
- "@fimo/routes": "2.15.0-staging.1",
210
- "@fimo/sdk": "2.15.0-staging.1",
211
- "@fimo/tsconfig": "2.15.0-staging.1",
205
+ "@fimo/agents-bundle": "2.15.0-staging.2",
206
+ "@fimo/api-contracts": "2.15.0-staging.2",
207
+ "@fimo/cli-kit": "2.15.0-staging.2",
208
+ "@fimo/framework-detect": "2.15.0-staging.2",
209
+ "@fimo/routes": "2.15.0-staging.2",
210
+ "@fimo/sdk": "2.15.0-staging.2",
211
+ "@fimo/tsconfig": "2.15.0-staging.2",
212
212
  "@types/node": "22.18.6",
213
213
  "agent-install": "^0.0.5",
214
214
  "astro": "^7.4.5",
@@ -9,9 +9,9 @@
9
9
  "check": "astro sync && astro check"
10
10
  },
11
11
  "dependencies": {
12
- "fimo": "2.15.0-staging.1",
13
- "fimo-analytics": "2.15.0-staging.1",
14
- "fimo-astro": "2.15.0-staging.1",
12
+ "fimo": "2.15.0-staging.2",
13
+ "fimo-analytics": "2.15.0-staging.2",
14
+ "fimo-astro": "2.15.0-staging.2",
15
15
  "zod": "^4.4.3"
16
16
  },
17
17
  "devDependencies": {
@@ -12,10 +12,10 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@tanstack/react-query": "^5.80.6",
15
- "fimo": "2.15.0-staging.1",
16
- "fimo-analytics": "2.15.0-staging.1",
17
- "fimo-next": "2.15.0-staging.1",
18
- "fimo-react": "2.15.0-staging.1",
15
+ "fimo": "2.15.0-staging.2",
16
+ "fimo-analytics": "2.15.0-staging.2",
17
+ "fimo-next": "2.15.0-staging.2",
18
+ "fimo-react": "2.15.0-staging.2",
19
19
  "next": "16.4.2",
20
20
  "react": "^19.2.7",
21
21
  "react-dom": "^19.2.7",
@@ -21,11 +21,11 @@
21
21
  "cn": "0.2.4",
22
22
  "date-fns": "^4.1.0",
23
23
  "embla-carousel-react": "^8.6.0",
24
- "fimo": "2.15.0-staging.1",
25
- "fimo-analytics": "2.15.0-staging.1",
26
- "fimo-react": "2.15.0-staging.1",
27
- "fimo-react-router": "2.15.0-staging.1",
28
- "fimo-vite": "2.15.0-staging.1",
24
+ "fimo": "2.15.0-staging.2",
25
+ "fimo-analytics": "2.15.0-staging.2",
26
+ "fimo-react": "2.15.0-staging.2",
27
+ "fimo-react-router": "2.15.0-staging.2",
28
+ "fimo-vite": "2.15.0-staging.2",
29
29
  "input-otp": "^1.4.2",
30
30
  "isbot": "^5",
31
31
  "lucide-react": "^0.577.0",
@@ -11,9 +11,9 @@
11
11
  "prepare": "svelte-kit sync"
12
12
  },
13
13
  "dependencies": {
14
- "fimo": "2.15.0-staging.1",
15
- "fimo-analytics": "2.15.0-staging.1",
16
- "fimo-sveltekit": "2.15.0-staging.1",
14
+ "fimo": "2.15.0-staging.2",
15
+ "fimo-analytics": "2.15.0-staging.2",
16
+ "fimo-sveltekit": "2.15.0-staging.2",
17
17
  "zod": "^4.4.3"
18
18
  },
19
19
  "devDependencies": {
@@ -11,11 +11,11 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@tanstack/react-query": "^5.80.6",
14
- "fimo": "2.15.0-staging.1",
15
- "fimo-analytics": "2.15.0-staging.1",
16
- "fimo-react": "2.15.0-staging.1",
17
- "fimo-react-router": "2.15.0-staging.1",
18
- "fimo-vite": "2.15.0-staging.1",
14
+ "fimo": "2.15.0-staging.2",
15
+ "fimo-analytics": "2.15.0-staging.2",
16
+ "fimo-react": "2.15.0-staging.2",
17
+ "fimo-react-router": "2.15.0-staging.2",
18
+ "fimo-vite": "2.15.0-staging.2",
19
19
  "react": "^19.2.7",
20
20
  "react-dom": "^19.2.7",
21
21
  "react-router": "^8.3.0",