fimo 2.10.3-staging.2 → 2.10.4-staging.1
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/assets/skills/fimo-studio/references/ai-chat/agents.md +1 -1
- package/assets/skills/fimo-studio/references/ai-chat/default-agents.md +5 -5
- package/dist/cli/bundle.json +2 -2
- package/dist/cli/index.js +8 -8
- package/package.json +8 -8
- package/templates/astro/package.json +3 -3
- package/templates/nextjs/package.json +4 -4
- package/templates/react-router/package.json +5 -5
- package/templates/sveltekit/package.json +3 -3
- package/templates/vite/package.json +5 -5
|
@@ -43,4 +43,4 @@ The **+** menu lists them under **Agents**: **SEO**, **GEO**, **Content**, **Qua
|
|
|
43
43
|
|
|
44
44
|
A change on main wakes the routines it can matter to, before a publish: CMS edits, code changes, images, languages and forms; the first publish and a new domain also wake Technical SEO and Cookie consent. A small model reads each change first, so a change that matters to no routine starts nothing; schedules run anyway. A run that a change started checks only the pages it touches.
|
|
45
45
|
|
|
46
|
-
**Alone:** a fix with one right answer from the page's own words, without a message. **Asked as a decision:** a
|
|
46
|
+
**Alone:** a fix with one right answer from the page's own words, without a message, including shorter text from the same words and a rewrite that only applies the team's own rules. **Asked as a decision:** new words or a new meaning in what visitors read, which page wins a search, whether a page exists, a redirect with more than one possible target, a price or a legal page. They never remove a page or change the robots policy alone. A change a person asks for in chat is made. To stop a kind of question, tell the agent in its chat ("do this on your own from now on", "don't ask me this again"): it saves the rule in its memory and no routine of that agent asks it again. A rule never covers the robots policy, a price, a legal page or removing a page. A check that could not finish (a timeout, a 5xx, a page past the crawl limit) is retried once, then reported as incomplete, never acted on.
|
|
@@ -10,12 +10,12 @@ Plans, setup and the rules every default agent follows are in `ai-chat/agents`.
|
|
|
10
10
|
- **Image SEO:** alt text, file names, and images over 200 KB. An image in the media library is rendered through Fimo's resizing; a file of the site is uploaded first. An image on another host gets a proposal for a smaller export.
|
|
11
11
|
- **Hreflang:** on a site in more than one language, each version lists the others.
|
|
12
12
|
- **Internal linking:** orphan pages, pages more than three clicks deep, and articles with no link to a hub or product page or more than eight links. Runs on changes and every Monday.
|
|
13
|
-
- **Keyword optimization** (every Tuesday, needs Search Console): for pages ranking 8th to 20th it
|
|
13
|
+
- **Keyword optimization** (every Tuesday, needs Search Console): for pages ranking 8th to 20th it writes a title and headings from the searches that bring visitors, keeps the old words, and checks 8 weeks later whether they helped; on a clear loss it puts the old words back.
|
|
14
14
|
- **Keyword research** (2nd of each month): writes at most five briefs to the site knowledge and asks which to write; the Content agent's Writing routine writes the approved ones.
|
|
15
15
|
|
|
16
16
|
The Monday runs of Technical SEO, Meta tags and Internal linking read every page of main's hosted preview, for what no single change shows (pages out of the sitemap, shared titles, title shape, orphan and deep pages). A run that a change started checks only the pages it touches, its first run too.
|
|
17
17
|
|
|
18
|
-
Alone, it
|
|
18
|
+
Alone, it points a link at a new address only after it checked that the address shows the same content in the same language, and otherwise removes a dead link and keeps its words; it adds a link on words the text already uses to name another page, keeps the 8 most useful links on a page with too many, shortens a title or description Google cuts from the same words (in a field only search reads, added to the type when needed, when the title is also the page's heading), sets the public address when the canonicals and sitemap agree on it, and adds a 301 from a page's old address once the same page is live at the new one. A title, description, heading or link it changed is not changed again for 8 weeks (Google needs 8 to 12 weeks to show the effect), unless the change broke something, and words a person rewrote after an agent changed them stay. Keyword research never changes the site alone.
|
|
19
19
|
|
|
20
20
|
## GEO (4 routines)
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@ Alone, it fixes a link only after it checked that the new address shows the same
|
|
|
24
24
|
- **AI citation optimization:** a direct answer under each content page's H1, and question headings on long pages.
|
|
25
25
|
- **AI visibility** (once a week): how often ChatGPT, Gemini, Perplexity and Google AI Mode name and cite the site for about 20 customer questions. It changes nothing.
|
|
26
26
|
|
|
27
|
-
Alone, it writes a missing llms.txt and keeps its
|
|
27
|
+
Alone, it writes a missing llms.txt and keeps its lines in step with the pages and their titles and descriptions, adds Organization, WebSite, Article and BreadcrumbList from facts the site already shows (never an invented logo, address, author or rating), and fixes landmarks and heading levels without changing a word. It asks before an opening answer, new headings, FAQ or Product data, or a change to how pages are rendered (unless one setting serves the same pages as HTML and nothing else changes). It never changes who robots.txt lets crawl, AI crawlers included, and never invents a claim; asked, it names the crawlers robots.txt keeps out.
|
|
28
28
|
|
|
29
29
|
## Content (6 routines)
|
|
30
30
|
|
|
@@ -44,7 +44,7 @@ It also measures accessibility in each page, and opens one or two pages of each
|
|
|
44
44
|
- **Mobile optimization:** a missing viewport or one that blocks zoom, sideways scrolling, images, tables and forms wider than the screen, tap targets under 24 × 24 px, text mostly under 12 px.
|
|
45
45
|
- **Page speed** (3rd of each month): Lighthouse on a phone for the home page and one page of each template.
|
|
46
46
|
|
|
47
|
-
Alone, it names a control or labels a field from words the page shows, fixes heading levels, tabindex and a removed focus outline, lets visitors zoom again,
|
|
47
|
+
Alone, it names a control or labels a field from words the page shows, fixes heading levels, tabindex and a removed focus outline, lets visitors zoom again, keeps media inside the screen by its own width, gives small tap targets 24 × 24 px, and moves a failing colour to a passing shade the site's palette already has. Any other colour, size or layout change is asked as a decision. Image alt text stays with SEO.
|
|
48
48
|
|
|
49
49
|
## Compliance (3 routines)
|
|
50
50
|
|
|
@@ -54,4 +54,4 @@ It can open a sample of pages with no consent given and record the cookies, thir
|
|
|
54
54
|
- **Cookie consent:** trackers and third-party cookies before a choice, a missing banner, a banner with no way to refuse.
|
|
55
55
|
- **Privacy and legal pages:** a privacy page exists, names the services loaded and the kinds of field the forms collect, and was updated in the last two years.
|
|
56
56
|
|
|
57
|
-
Alone, it
|
|
57
|
+
Alone, it applies the brand rules where the meaning stays: a term they replace, a claim they ban that the sentence does not need, their voice for a sentence that keeps every name and number, and spelling. It proposes a sentence whose meaning would change, the consent setup and every legal page, with placeholders for legal details, and never states that a site is compliant. It does not ask the team to source its own people's quotes or its own figures.
|
package/dist/cli/bundle.json
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -1624,7 +1624,7 @@ function findings(site) {
|
|
|
1624
1624
|
if (site.sitemapState === 'missing') add('sitemap-missing', T, 'auto', '/sitemap.xml', 'no sitemap URLs');
|
|
1625
1625
|
if (!site.pub) add('site-url-missing', T, 'suggest', '/', 'no seo.url in .fimo/config.json');
|
|
1626
1626
|
// The site is served on another host than seo.url names: one finding, not one per canonical and sitemap entry.
|
|
1627
|
-
else if (site.served) add('site-url-mismatch', T, '
|
|
1627
|
+
else if (site.served) add('site-url-mismatch', T, 'auto', '/', 'seo.url is ' + site.pub + ', the canonicals and the sitemap use ' + site.served);
|
|
1628
1628
|
const publicHosts = [site.pub && new URL(site.pub).host, site.served].filter(Boolean);
|
|
1629
1629
|
for (const [path, p] of pages) {
|
|
1630
1630
|
if (p.inSitemap && p.state === 'broken') add('sitemap-non-200', T, 'auto', path, 'in the sitemap, ' + say(p));
|
|
@@ -1678,7 +1678,7 @@ function findings(site) {
|
|
|
1678
1678
|
const chars = !WIDE_SCRIPT.test(p.lang || '');
|
|
1679
1679
|
if (!v) add(k + '-missing', 'meta-tags', 'auto', path, 'no ' + k);
|
|
1680
1680
|
else if (counts[key(p, k)] > 1) add(k + '-duplicate', 'meta-tags', priced ? 'suggest' : 'auto', path, '"' + v + '" on ' + counts[key(p, k)] + ' pages' + (priced ? '; it carries a price' : ''));
|
|
1681
|
-
else if ((chars && v.length > max) || wide > px) add(k + '-too-long', 'meta-tags', '
|
|
1681
|
+
else if ((chars && v.length > max) || wide > px) add(k + '-too-long', 'meta-tags', 'auto', path, v.length + ' chars' + (wide ? ', ' + wide + ' px' : '') + ', Google shows about ' + (chars ? max + ' chars or ' : '') + px + ' px: "' + v + '"');
|
|
1682
1682
|
else if (chars && v.length < min) add(k + '-length', 'meta-tags', 'note', path, v.length + ' chars: "' + v + '"');
|
|
1683
1683
|
}
|
|
1684
1684
|
const og = ['title', 'description', 'image'].filter((k) => !p.og[k]);
|
|
@@ -1728,11 +1728,11 @@ function findings(site) {
|
|
|
1728
1728
|
const loc = localeOf(to);
|
|
1729
1729
|
const slug = to.split('?')[0].split('/').pop();
|
|
1730
1730
|
const near = targets.filter(([c]) => c !== to && localeOf(c) === loc).map(([c, p]) => [(slug && c.split('/').pop() === slug ? 0 : distance(c, to)), c, p]).filter(([d]) => d <= 3).sort((a, b) => a[0] - b[0])[0];
|
|
1731
|
-
add('broken-internal-link', 'broken-links', '
|
|
1731
|
+
add('broken-internal-link', 'broken-links', 'auto', to, (t.why || 'answers ' + t.status) + where + (near ? '; candidate ' + near[1] + ' (title "' + near[2].title + '", H1 "' + near[2].h1s[0] + '")' : '; no candidate'));
|
|
1732
1732
|
} else if (t.to && permanent(t)) add('link-to-redirect', 'broken-links', 'auto', to, 'redirects for good to ' + t.to + where);
|
|
1733
|
-
else if (t.ids) for (const [frag, src] of Object.entries(f.frags)) if (!t.ids.includes(frag)) add('broken-fragment', 'broken-links', '
|
|
1733
|
+
else if (t.ids) for (const [frag, src] of Object.entries(f.frags)) if (!t.ids.includes(frag)) add('broken-fragment', 'broken-links', 'auto', to + '#' + frag, 'no element with this id; linked from ' + [...src].slice(0, 3).join(', '));
|
|
1734
1734
|
}
|
|
1735
|
-
for (const [url, e] of Object.entries(site.external)) if (e.state === 'broken') add('broken-external-link', 'broken-links', '
|
|
1735
|
+
for (const [url, e] of Object.entries(site.external)) if (e.state === 'broken') add('broken-external-link', 'broken-links', 'auto', url, 'answers ' + e.status + '; linked from ' + e.from.slice(0, 3).join(', ') + (e.text ? ' as "' + e.text + '"' : ''));
|
|
1736
1736
|
|
|
1737
1737
|
for (const [path, p] of live) {
|
|
1738
1738
|
const none = p.images.filter((i) => i.alt === null);
|
|
@@ -1774,7 +1774,7 @@ function findings(site) {
|
|
|
1774
1774
|
const article = (path) => ARTICLE_PATH.test(path) && !listing(path, site.pages[path]);
|
|
1775
1775
|
for (const [path, p] of indexable) {
|
|
1776
1776
|
if (!article(path) || !p.textLinks) continue;
|
|
1777
|
-
if (p.textLinks.length > MAX_TEXT_LINKS) add('links-too-many', 'internal-linking', '
|
|
1777
|
+
if (p.textLinks.length > MAX_TEXT_LINKS) add('links-too-many', 'internal-linking', 'auto', path, p.textLinks.length + ' internal links in its text; keep at most ' + MAX_TEXT_LINKS);
|
|
1778
1778
|
const up = p.textLinks.filter((to) => !home(to) && !article(to) && st(to).state === 'ok' && !st(to).to);
|
|
1779
1779
|
if (!up.length) add('content-no-hub-link', 'internal-linking', 'suggest', path, 'its text links to no live hub or product page' + (p.textLinks.length ? ', only to ' + p.textLinks.slice(0, 3).join(', ') : ''));
|
|
1780
1780
|
}
|
|
@@ -2077,7 +2077,7 @@ function qualityFindings(site, { add, unsure, live }) {
|
|
|
2077
2077
|
for (const w of media) note('media-too-wide', M, 'auto', w.el, path, w.el + ' is ' + w.w + ' px wide on a ' + f.vw + ' px screen');
|
|
2078
2078
|
const others = f.wide.filter((w) => !media.includes(w));
|
|
2079
2079
|
if (f.scroll > f.vw + 1 && (others.length || !media.length)) note('page-overflow', M, 'suggest', others.map((w) => w.el).join(' ') || path, path, 'scrolls sideways (' + f.scroll + ' px on a ' + f.vw + ' px screen)' + (others.length ? '; past the edge: ' + others.slice(0, 3).map((w) => w.el + ' ' + w.w + ' px').join(', ') : ''));
|
|
2080
|
-
for (const t of f.targets) note('tap-target-small', M, '
|
|
2080
|
+
for (const t of f.targets) note('tap-target-small', M, 'auto', t.el + '|' + t.text, path, t.el + (t.text ? ' "' + t.text + '"' : '') + ' is ' + t.w + ' x ' + t.h + ' px beside another target; a finger needs ' + TAP_PX + ' x ' + TAP_PX);
|
|
2081
2081
|
if (f.text.total && f.text.small / f.text.total > SMALL_TEXT.share) note('text-too-small', M, 'suggest', path, path, Math.round((100 * f.text.small) / f.text.total) + '% of the text is under ' + SMALL_TEXT.px + ' px: ' + f.text.samples.map((x) => x.el + ' ' + x.px + ' px "' + x.text + '"').join(', '));
|
|
2082
2082
|
}
|
|
2083
2083
|
}
|
|
@@ -2910,7 +2910,7 @@ Output
|
|
|
2910
2910
|
${run.output}`:fields},"render")})}__name(renderRunDetail,"renderRunDetail");function renderFields(fields){let width=Math.max(...Object.keys(fields).map(key=>key.length));return Object.entries(fields).map(([key,value])=>`${key.padEnd(width)} ${String(value)}`).join(`
|
|
2911
2911
|
`)}__name(renderFields,"renderFields");function renderTable(headers,rows){if(rows.length===0)return"No results.";let widths=headers.map((header,index)=>Math.max(header.length,...rows.map(row2=>String(row2[index]??"").length)));return[headers,...rows].map(row2=>row2.map((value,index)=>String(value).padEnd(widths[index])).join(" ").trimEnd()).join(`
|
|
2912
2912
|
`)}__name(renderTable,"renderTable");function readActiveRunId(body){if(!body||typeof body!="object")return;let value=body.activeRunId;return typeof value=="string"?value:void 0}__name(readActiveRunId,"readActiveRunId");init_esm();init_dist();import fs44 from"node:fs";import path46 from"node:path";import{isDeepStrictEqual}from"node:util";init_sdk_transport();init_project_context();init_project2();var SYSTEM_SCHEMA_FIELDS=new Set(RESERVED_CONTENT_FIELD_NAMES),SchemaCommandError=class extends Error{static{__name(this,"SchemaCommandError")}code;constructor(code2,message,options){super(message,options),this.name="SchemaCommandError",this.code=code2}};function isRecord3(value){return!!(value&&typeof value=="object"&&!Array.isArray(value))}__name(isRecord3,"isRecord");function schemaMatches(actual,expected){if(!isRecord3(actual)||!isRecord3(actual.fields))return!1;let userFields=Object.fromEntries(Object.entries(actual.fields).filter(([fieldName])=>!SYSTEM_SCHEMA_FIELDS.has(fieldName)));return actual.name===expected.name&&actual.label===expected.label&&actual.isSingleton===expected.isSingleton&&isDeepStrictEqual(actual.i18n,expected.i18n)&&isDeepStrictEqual(actual.groups??[],expected.groups)&&isDeepStrictEqual(userFields,expected.fields)}__name(schemaMatches,"schemaMatches");async function readBackSchemaBatch(fimo,projectId2,branch,schemas3){let checks=await Promise.all(schemas3.map(async schema=>{try{let actual=await fimo.execute("schemas.get",{projectId:projectId2,branch,typeName:schema.name});return{name:schema.name,actual,state:schemaMatches(actual,schema)?"matched":"mismatched"}}catch(error){if(error instanceof ApiRequestError&&error.status===404)return{name:schema.name,state:"absent"};throw error}})),matched=checks.filter(check=>check.state==="matched"),absent=checks.filter(check=>check.state==="absent"),mismatched=checks.filter(check=>check.state==="mismatched");return matched.length===schemas3.length?{state:"committed",results:matched.map(check=>check.actual)}:absent.length===schemas3.length?{state:"absent"}:{state:"ambiguous",details:[matched.length>0?`matched: ${matched.map(check=>check.name).join(", ")}`:null,absent.length>0?`absent: ${absent.map(check=>check.name).join(", ")}`:null,mismatched.length>0?`mismatched: ${mismatched.map(check=>check.name).join(", ")}`:null].filter(Boolean).join("; ")}}__name(readBackSchemaBatch,"readBackSchemaBatch");async function upsertSchemasWithReconciliation(fimo,projectId2,branch,schemas3,operations){let timeout;try{return await fimo.execute("schemas.upsertBatch",{projectId:projectId2,branch,contentTypes:schemas3,operations:[...operations]})}catch(error){if(!(error instanceof ApiRequestError)||error.status!==504)throw error;timeout=error}let firstReadBack=await readBackAfterTimeout(fimo,projectId2,branch,schemas3,timeout);if(firstReadBack.state==="committed")return firstReadBack.results;if(firstReadBack.state==="ambiguous")throw ambiguousSchemaPushError(firstReadBack.details,timeout);try{return await fimo.execute("schemas.upsertBatch",{projectId:projectId2,branch,contentTypes:schemas3,operations:[...operations]})}catch(error){if(!(error instanceof ApiRequestError)||error.status!==504)throw error;timeout=error}let secondReadBack=await readBackAfterTimeout(fimo,projectId2,branch,schemas3,timeout);if(secondReadBack.state==="committed")return secondReadBack.results;let detail=secondReadBack.state==="absent"?"all requested schemas remain absent after one retry":secondReadBack.details;throw ambiguousSchemaPushError(detail,timeout)}__name(upsertSchemasWithReconciliation,"upsertSchemasWithReconciliation");function ambiguousSchemaPushError(detail,cause){return new SchemaCommandError("SCHEMA_PUSH_AMBIGUOUS",`Schema push returned an ambiguous 504 (${detail}). No further write was attempted; read the schemas back before rerunning.`,{cause})}__name(ambiguousSchemaPushError,"ambiguousSchemaPushError");async function readBackAfterTimeout(fimo,projectId2,branch,schemas3,timeout){try{return await readBackSchemaBatch(fimo,projectId2,branch,schemas3)}catch(error){let detail=error instanceof Error?error.message:String(error);throw new SchemaCommandError("SCHEMA_PUSH_AMBIGUOUS",`Schema push returned an ambiguous 504 and read-back failed (${detail}). No retry was attempted.`,{cause:timeout})}}__name(readBackAfterTimeout,"readBackAfterTimeout");function renameOperation(contentType,value){let separator=value.indexOf("="),from=value.slice(0,separator).trim(),to=value.slice(separator+1).trim();if(separator<=0||!from||!to||to.includes("="))throw new SchemaCommandError("SCHEMA_RENAME_INVALID",`Invalid --rename "${value}". Use --rename old.path=new.path.`);return{type:"renameField",contentType,from,to}}__name(renameOperation,"renameOperation");function toApiShape(schema){return{name:schema.uid,label:schema.name,isSingleton:schema.isSingleton??!1,i18n:schema.i18n??{enabled:!0},groups:schema.groups??[],fields:schema.fields}}__name(toApiShape,"toApiShape");function renderPrettyJson8(data){return JSON.stringify(data,null,2)}__name(renderPrettyJson8,"renderPrettyJson");function isUniqueConflictIssue(issue2){if(!issue2||typeof issue2!="object"||Array.isArray(issue2))return!1;let candidate=issue2;return candidate.kind==="unique_conflict"&&typeof candidate.contentType=="string"&&typeof candidate.field=="string"&&typeof candidate.value=="string"&&typeof candidate.documentCount=="number"&&Array.isArray(candidate.documentIds)&&candidate.documentIds.every(id=>typeof id=="string")&&(candidate.documentIdsTruncated===void 0||typeof candidate.documentIdsTruncated=="boolean")}__name(isUniqueConflictIssue,"isUniqueConflictIssue");function getUniqueConflictIssues(body){if(!body||typeof body!="object"||Array.isArray(body))return null;let issues=body.issues;return Array.isArray(issues)?issues.filter(isUniqueConflictIssue):null}__name(getUniqueConflictIssues,"getUniqueConflictIssues");function renderSchemaTransitionRejected(body,issues){currentMode().format==="json"?ui.result({command:"schemas push",data:body,render:__name(()=>"","render")}):ui.table({command:"schemas push",headline:"Schema push rejected. Nothing was written.",columns:[{key:"content_type",label:"CONTENT TYPE"},{key:"field",label:"FIELD"},{key:"value",label:"VALUE"},{key:"documents",label:"DOCUMENTS"},{key:"document_ids",label:"DOCUMENT IDS"}],rows:issues.map(issue2=>{let remaining=Math.max(issue2.documentCount-issue2.documentIds.length,0),truncationNote=remaining>0?`... and ${remaining} more`:"... and more";return{content_type:issue2.contentType,field:issue2.field,value:issue2.value,documents:issue2.documentCount,document_ids:issue2.documentIdsTruncated?[...issue2.documentIds,truncationNote].join(", "):issue2.documentIds.join(", ")}})}),process.exitCode=1}__name(renderSchemaTransitionRejected,"renderSchemaTransitionRejected");async function schemaListCommand(options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd);await requireOperation("cms.schema.list",{projectId:ctx.projectId,branch:ctx.branch});let result=await fimo.execute("schemas.list",{projectId:ctx.projectId,branch:ctx.branch});ui.result({command:"schemas list",data:result,render:__name(()=>renderPrettyJson8(result),"render")})}__name(schemaListCommand,"schemaListCommand");async function schemaGetCommand(typeName,options,cmd){let{ctx,fimo}=await bootstrapProjectCommand(options,cmd);await requireOperation("cms.schema.get",{projectId:ctx.projectId,branch:ctx.branch});let result=await fimo.execute("schemas.get",{projectId:ctx.projectId,branch:ctx.branch,typeName});ui.result({command:"schemas get",data:result,render:__name(()=>renderPrettyJson8(result),"render")})}__name(schemaGetCommand,"schemaGetCommand");async function schemaPushCommand(typeName,options,cmd){if((options.rename?.length??0)>0&&!typeName)throw new SchemaCommandError("SCHEMA_RENAME_REQUIRES_TYPE","--rename requires one schema name: fimo schemas push <typeName> --rename old.path=new.path.");let{ctx,fimo}=await bootstrapProjectCommand(options,cmd,{refuseReadOnly:!0});await requireOperation("cms.schema.push",{projectId:ctx.projectId,branch:ctx.branch});let cwd=resolveProjectCwd(options.cwd),schemasDir=path46.join(cwd,"src/schemas"),allSchemaFiles=fs44.readdirSync(schemasDir).filter(file=>file.endsWith(".json")),files2=typeName?[`${typeName}.json`]:allSchemaFiles,schemaUids=new Set(allSchemaFiles.flatMap(file=>{try{let schema=JSON.parse(fs44.readFileSync(path46.join(schemasDir,file),"utf-8"));return typeof schema.uid=="string"?[schema.uid]:[]}catch{return[]}})),schemas3=files2.map(file=>{let filePath=path46.join(schemasDir,file);if(!fs44.existsSync(filePath))throw new Error(`Schema file not found: ${filePath}`);let issues=validateSchemaFile(filePath,path46.join("src/schemas",file),schemaUids);if(issues.length>0)throw new Error(issues.map(issue2=>`${issue2.file}: ${issue2.message}`).join(`
|
|
2913
|
-
`));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 tmpdir4}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(a=>a.split(/\s+/)).filter(Boolean)){let p2;try{let u2=new URL(raw,"http://site.invalid");p2=u2.pathname+u2.search}catch{throw new SiteCommandError(`'${raw}' is not a page path.`,"Name pages by path, for example `/pricing` or `/blog/my-post`.")}out.includes(p2)||out.push(p2)}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 the live site with --branch main (main's hosted preview), or the published 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"?"
|
|
2913
|
+
`));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 tmpdir4}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(a=>a.split(/\s+/)).filter(Boolean)){let p2;try{let u2=new URL(raw,"http://site.invalid");p2=u2.pathname+u2.search}catch{throw new SiteCommandError(`'${raw}' is not a page path.`,"Name pages by path, for example `/pricing` or `/blog/my-post`.")}out.includes(p2)||out.push(p2)}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 the live site with --branch main (main's hosted preview), or the published 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"]}),stdout="",stderr="";child.stdout.on("data",d3=>stdout+=d3.toString("utf8")),child.stderr.on("data",d3=>stderr+=d3.toString("utf8")),child.on("error",reject),child.on("close",code2=>resolve10({code:code2??1,stdout:stdout.trim(),stderr:stderr.trim()}))})}__name(runScript,"runScript");async function readPages(input){let dir=mkdtempSync2(path47.join(tmpdir4(),"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(`
|
|
2914
2914
|
`)+`
|
|
2915
2915
|
`);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(`
|
|
2916
2916
|
`).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}),text=[targetLine(target,ctx.branch),read,report2].filter(Boolean).join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fimo",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.4-staging.1",
|
|
4
4
|
"description": "Fimo CLI - create, deploy, and manage Fimo sites",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro-component"
|
|
@@ -194,13 +194,13 @@
|
|
|
194
194
|
"devDependencies": {
|
|
195
195
|
"@clack/core": "^1.2.0",
|
|
196
196
|
"@clack/prompts": "^1.2.0",
|
|
197
|
-
"@fimo/agents-bundle": "2.10.
|
|
198
|
-
"@fimo/api-contracts": "2.10.
|
|
199
|
-
"@fimo/cli-kit": "2.10.
|
|
200
|
-
"@fimo/framework-detect": "2.10.
|
|
201
|
-
"@fimo/routes": "2.10.
|
|
202
|
-
"@fimo/sdk": "2.10.
|
|
203
|
-
"@fimo/tsconfig": "2.10.
|
|
197
|
+
"@fimo/agents-bundle": "2.10.4-staging.1",
|
|
198
|
+
"@fimo/api-contracts": "2.10.4-staging.1",
|
|
199
|
+
"@fimo/cli-kit": "2.10.4-staging.1",
|
|
200
|
+
"@fimo/framework-detect": "2.10.4-staging.1",
|
|
201
|
+
"@fimo/routes": "2.10.4-staging.1",
|
|
202
|
+
"@fimo/sdk": "2.10.4-staging.1",
|
|
203
|
+
"@fimo/tsconfig": "2.10.4-staging.1",
|
|
204
204
|
"@types/node": "22.18.6",
|
|
205
205
|
"agent-install": "^0.0.5",
|
|
206
206
|
"astro": "^7.1.6",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"check": "astro sync && astro check"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"fimo": "2.10.
|
|
13
|
-
"fimo-analytics": "2.10.
|
|
14
|
-
"fimo-astro": "2.10.
|
|
12
|
+
"fimo": "2.10.4-staging.1",
|
|
13
|
+
"fimo-analytics": "2.10.4-staging.1",
|
|
14
|
+
"fimo-astro": "2.10.4-staging.1",
|
|
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.10.
|
|
16
|
-
"fimo-analytics": "2.10.
|
|
17
|
-
"fimo-next": "2.10.
|
|
18
|
-
"fimo-react": "2.10.
|
|
15
|
+
"fimo": "2.10.4-staging.1",
|
|
16
|
+
"fimo-analytics": "2.10.4-staging.1",
|
|
17
|
+
"fimo-next": "2.10.4-staging.1",
|
|
18
|
+
"fimo-react": "2.10.4-staging.1",
|
|
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.10.
|
|
25
|
-
"fimo-analytics": "2.10.
|
|
26
|
-
"fimo-react": "2.10.
|
|
27
|
-
"fimo-react-router": "2.10.
|
|
28
|
-
"fimo-vite": "2.10.
|
|
24
|
+
"fimo": "2.10.4-staging.1",
|
|
25
|
+
"fimo-analytics": "2.10.4-staging.1",
|
|
26
|
+
"fimo-react": "2.10.4-staging.1",
|
|
27
|
+
"fimo-react-router": "2.10.4-staging.1",
|
|
28
|
+
"fimo-vite": "2.10.4-staging.1",
|
|
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.10.
|
|
15
|
-
"fimo-analytics": "2.10.
|
|
16
|
-
"fimo-sveltekit": "2.10.
|
|
14
|
+
"fimo": "2.10.4-staging.1",
|
|
15
|
+
"fimo-analytics": "2.10.4-staging.1",
|
|
16
|
+
"fimo-sveltekit": "2.10.4-staging.1",
|
|
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.10.
|
|
15
|
-
"fimo-analytics": "2.10.
|
|
16
|
-
"fimo-react": "2.10.
|
|
17
|
-
"fimo-react-router": "2.10.
|
|
18
|
-
"fimo-vite": "2.10.
|
|
14
|
+
"fimo": "2.10.4-staging.1",
|
|
15
|
+
"fimo-analytics": "2.10.4-staging.1",
|
|
16
|
+
"fimo-react": "2.10.4-staging.1",
|
|
17
|
+
"fimo-react-router": "2.10.4-staging.1",
|
|
18
|
+
"fimo-vite": "2.10.4-staging.1",
|
|
19
19
|
"react": "^19.2.7",
|
|
20
20
|
"react-dom": "^19.2.7",
|
|
21
21
|
"react-router": "^8.3.0",
|