fimo 2.10.3-staging.1 → 2.10.3

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,8 +1,8 @@
1
1
  {
2
2
  "bundled": true,
3
3
  "bundler": "esbuild",
4
- "bundledAt": "2026-10-30T08:40:27.154Z",
5
- "cliVersion": "2.10.2",
4
+ "bundledAt": "2026-10-30T11:16:16.076Z",
5
+ "cliVersion": "2.10.3",
6
6
  "external": [
7
7
  "oxc-parser",
8
8
  "fsevents",
package/dist/cli/index.js CHANGED
@@ -352,6 +352,13 @@ const EVENT = /\b(ends?|ending|until|through|deadline|offer|sale|discount|promo(
352
352
  const DATE = /\b(?:(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\.?\s+(\d{1,2})(?:st|nd|rd|th)?,?\s+((?:19|20)\d{2})|(\d{1,2})(?:st|nd|rd|th)?\s+(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\.?,?\s+((?:19|20)\d{2})|((?:19|20)\d{2})-(\d{2})-(\d{2}))\b/gi;
353
353
  const SOON = /\b(coming soon|launching soon|available soon|stay tuned|under construction)\b|próximamente|bientôt disponible|demnächst verfügbar/i;
354
354
  const MONTHS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
355
+ // A year still to come is a plan only in a sentence about the future; "in 2027" with none of these is written as now.
356
+ const FUTURE = /\b(will|shall|going to|plans?|planned|expects?|expected|forecasts?|projected|predict\w*|by|until|through|before|coming|upcoming|next|roadmap|targets?|aims?|starting|from|due|scheduled|outlook|trends)\b/i;
357
+ // A date written with numbers (22/09/2026, 2026-09-22), its year five digits long when mistyped (22/09/20206).
358
+ const NUMERIC_DATE = /(?<![\d/.-])(?:(\d{1,2})([/.])(\d{1,2})\2((?:19|20)\d{2,3})|((?:19|20)\d{2,3})-(\d{1,2})-(\d{1,2}))(?![\d/-]|\.\d)/g;
359
+ const NO_DATE = /\bInvalid Date\b|\bNaN\s*[/.-]\s*NaN\b/;
360
+ // Content refresh's ledger (FIMO-3322): what each page said at the last full read, for the run to save to memory.
361
+ const PAGES_LEDGER = DIR + '/pages.tsv';
355
362
  // Quality: WCAG AA contrast, the width a phone shows (CSS px), the smallest target a finger can hit (WCAG 2.5.8), the
356
363
  // smallest legible text and the share of a page's text below it (Lighthouse), and the pages a phone pass opens.
357
364
  const CONTRAST = { text: 4.5, large: 3 };
@@ -1949,6 +1956,21 @@ function contentFindings(site, { add, live, indexable, home, article, listing, s
1949
1956
  const sentences = (text) => (text || '').split(/(?<=[.!?])\s+(?=\S)/).map((x) => x.trim()).filter(Boolean);
1950
1957
  const clip = (s, at) => (s.length <= 200 ? s : (at > 100 ? '…' : '') + s.slice(Math.max(0, at - 100), at + 100).trim() + '…');
1951
1958
  const retired = (opt('retired') || '').split(';').map((pair) => pair.split('=').map((x) => x.trim())).filter(([old, now]) => old && now);
1959
+ // A date no calendar has: a five-digit year, a month or day out of range (either order for 22/09/2026), a broken render.
1960
+ const real = (y, m, d) => String(y).length === 4 && m >= 1 && m <= 12 && d >= 1 && d <= new Date(Date.UTC(+y, m, 0)).getUTCDate();
1961
+ const noDate = (s) => {
1962
+ const broken = NO_DATE.exec(s || '');
1963
+ if (broken) return 'shows "' + broken[0] + '" where a date should be';
1964
+ for (const m of (s || '').matchAll(NUMERIC_DATE)) {
1965
+ const ok = m[4] ? real(m[4], +m[3], +m[1]) || real(m[4], +m[1], +m[3]) : real(m[5], +m[6], +m[7]);
1966
+ if (!ok) return '"' + m[0] + '" is not a date';
1967
+ }
1968
+ for (const m of (s || '').matchAll(DATE)) {
1969
+ const [y, mon, d] = m[7] ? [m[7], +m[8], +m[9]] : [m[3] || m[6], MONTHS.indexOf((m[1] || m[5]).slice(0, 3).toLowerCase()) + 1, +(m[2] || m[4])];
1970
+ if (!real(y, mon, d)) return '"' + m[0] + '" is not a date';
1971
+ }
1972
+ return null;
1973
+ };
1952
1974
  // One sentence in a shared header, footer or template is one finding, named on the first page that shows it. A
1953
1975
  // legal page's own words are only ever asked about; the header and footer it shares with every page are not its own.
1954
1976
  const found = new Map();
@@ -1958,12 +1980,19 @@ function contentFindings(site, { add, live, indexable, home, article, listing, s
1958
1980
  for (const [path, p] of read) {
1959
1981
  const heads = (p.heads || []).filter((h) => h.l <= 3).map((h) => h.t);
1960
1982
  for (const s of [p.title, p.description, ...heads]) {
1961
- const m = /\b((?:19|20)\d{2})\s*$/.exec(s || '');
1983
+ const m = /\b((?:19|20)\d{2})\s*\)?\s*$/.exec(s || '');
1962
1984
  if (m && Number(m[1]) < year) note('year-past-as-current', 'suggest', path, s, 'a heading or title that ends on ' + m[1]);
1985
+ if (m && Number(m[1]) > year && !FUTURE.test(s)) note('year-future', 'suggest', path, s, 'a heading or title that ends on ' + m[1] + ', a year still to come');
1963
1986
  }
1987
+ for (const t of p.times || []) { const bad = noDate(t); if (bad) note('date-invalid', 'suggest', path, t, bad); }
1964
1988
  for (const [s, edge] of [p.header, p.body, p.footer].flatMap((text, i) => sentences(text).map((x) => [x, i !== 1]))) {
1965
1989
  shared = edge;
1966
1990
  for (const m of s.matchAll(COPYRIGHT)) if (Number(m[1]) < year) note('copyright-year-stale', 'auto', path, clip(s, m.index), 'the copyright line ends on ' + m[1] + '; this year is ' + year);
1991
+ const bad = noDate(s);
1992
+ if (bad && !(p.times || []).some((t) => s.includes(t) && noDate(t))) note('date-invalid', 'suggest', path, clip(s, 0), bad);
1993
+ // Only "in 2027", "updated March 2027": a year before a noun ("2027 roadmap") names a plan.
1994
+ const ahead = once(COPYRIGHT).test(s) || FUTURE.test(s) ? null : [...s.matchAll(YEAR_AS_CURRENT)].filter((m) => m[1] && Number(m[1]) > year)[0];
1995
+ if (ahead) note('year-future', 'suggest', path, clip(s, ahead.index), ahead[1] + ', a year still to come, written as the present');
1967
1996
  if (!PAST.test(s) && !once(COPYRIGHT).test(s)) {
1968
1997
  const y = PAST_VERB.test(s) ? null : [...s.matchAll(YEAR_AS_CURRENT)].map((m) => [Number(m[1] || m[2]), m.index]).find(([y]) => y < year);
1969
1998
  if (y) note('year-past-as-current', 'suggest', path, clip(s, y[1]), y[0] + ' written as the present');
@@ -2067,14 +2096,81 @@ const load = () => {
2067
2096
  // check): title, description, headings and text of each path given, or of the pages closest to the home page.
2068
2097
  function pageText() {
2069
2098
  const site = load();
2099
+ // A long page prints 6,000 characters at a time, and says where the rest starts (FIMO-3322): a cut it does not
2100
+ // name reads as the whole page.
2101
+ const from = Math.max(0, Number(opt('from', 0)) || 0);
2070
2102
  const asked = rest.filter((a) => a.startsWith('/'));
2071
2103
  const paths = asked.length ? asked : Object.entries(site.pages).filter(([, p]) => p.state === 'ok' && !p.to && p.body !== undefined && !p.twin).map(([path]) => path).sort((a, b) => a.split('/').length - b.split('/').length).slice(0, Number(opt('max', 10)));
2072
2104
  for (const path of paths) {
2073
2105
  const p = site.pages[path];
2074
2106
  if (!p || p.body === undefined) { console.log('## ' + path + '\n(not in this crawl)\n'); continue; }
2075
2107
  const body = String(p.body || '');
2076
- console.log(['## ' + path, 'title: ' + (p.title || ''), 'description: ' + (p.description || ''), 'headings: ' + (p.heads || []).map((h) => 'H' + h.l + ' ' + h.t).join(' | '), body.length > 6000 ? body.slice(0, 6000) + ' …' : body, ''].join('\n'));
2108
+ const left = body.length - from - 6000;
2109
+ const text = body.slice(from, from + 6000) + (left > 0 ? ' … [' + left + ' more characters: text ' + path + ' --from ' + (from + 6000) + ']' : '');
2110
+ console.log(['## ' + path, 'title: ' + (p.title || ''), 'description: ' + (p.description || ''), 'headings: ' + (p.heads || []).map((h) => 'H' + h.l + ' ' + h.t).join(' | '), text, ''].join('\n'));
2111
+ }
2112
+ }
2113
+
2114
+ // Content refresh (FIMO-3322): what to read this run, from the ledger the last whole read left. A page whose text
2115
+ // changed, a page that states a known value of a fact (--values, old or current), and a dated sentence whose date
2116
+ // passed; the first run, with no ledger, reads every page. Writes today's ledger for the run to save: one line per
2117
+ // page with the hash of its text, the day it was last read, the values it states and its dated sentences.
2118
+ function pageLedger() {
2119
+ const site = load();
2120
+ if (site.named) { console.log('The ledger needs a read of the whole site: run fimo site check --all first.'); process.exit(2); }
2121
+ const today = String(opt('today') || new Date().toISOString()).slice(0, 10);
2122
+ const values = (opt('values') || '').split(';').map((v) => v.replace(/\s+/g, ' ').trim()).filter(Boolean);
2123
+ const flat = (s) => String(s || '').replace(/\s+/g, ' ');
2124
+ const hash = (s) => crypto.createHash('sha1').update(s).digest('hex').slice(0, 12);
2125
+ const pattern = (v) => new RegExp((/^\d/.test(v) ? '(?<![\\d.,])' : '') + v.replace(/[.*+?^$()|[\]{}\\]/g, '\\$&') + (/\d$/.test(v) ? '(?![\\d])' : ''), 'i');
2126
+ const file = rest[0] && !rest[0].startsWith('--') ? rest[0] : null;
2127
+ const lines = file && fs.existsSync(file) ? fs.readFileSync(file, 'utf8').split('\n') : [];
2128
+ const was = new Map(lines.filter((l) => l.startsWith('/') || l.startsWith('@')).map((l) => { const [path, h, day, said, dated] = l.split('\t'); return [path, { h, day, said: said || '', dated: dated || '' }]; }));
2129
+ const since = (/^fimo-content ledger (\S+)/.exec(lines[0] || '') || [])[1];
2130
+ const pages = Object.entries(site.pages).filter(([, p]) => p.state === 'ok' && !p.to && p.body !== undefined && !p.twin).sort(([a], [b]) => a.localeCompare(b));
2131
+ const now = new Map();
2132
+ const stated = new Map(values.map((v) => [v, []]));
2133
+ const dateOf = (m) => (m[7] ? Date.UTC(+m[7], +m[8] - 1, +m[9]) : Date.UTC(+(m[3] || m[6]), MONTHS.indexOf((m[1] || m[5]).slice(0, 3).toLowerCase()), +(m[2] || m[4])));
2134
+ for (const [path, p] of pages) {
2135
+ const text = flat([p.title, p.description, p.body].join('\n'));
2136
+ const said = values.filter((v) => pattern(v).test(text));
2137
+ for (const v of said) { const s = text.split(/(?<=[.!?])\s+/).find((x) => pattern(v).test(x)) || v; stated.get(v).push(path + ' "' + (s.length > 160 ? s.slice(0, 160) + '…' : s) + '"'); }
2138
+ // A sentence about an event or offer with a date still to come: the next run reads it once that day passed.
2139
+ const dated = flat(p.body).split(/(?<=[.!?])\s+/).filter((s) => EVENT.test(s)).flatMap((s) => [...s.matchAll(DATE)].map((m) => [dateOf(m), s])).filter(([d]) => d >= Date.parse(today)).map(([d, s]) => new Date(d).toISOString().slice(0, 10) + ' ' + s.slice(0, 80).replace(/\|/g, '/'));
2140
+ const h = hash(text);
2141
+ const before = was.get(path);
2142
+ now.set(path, { h, day: before && before.h === h ? before.day : today, said: said.join('|'), dated: dated.join('|') });
2143
+ }
2144
+ const edges = [...new Set(pages.flatMap(([, p]) => [flat(p.header), flat(p.footer)]))].sort().join('\n');
2145
+ const shared = { h: hash(edges), day: today, said: '', dated: '' };
2146
+ // A page this read could not reach keeps its line: unknown is not gone.
2147
+ const missing = [...was].filter(([path]) => path.startsWith('/') && !now.has(path));
2148
+ const kept = missing.filter(([path]) => !site.pages[path] || site.pages[path].state === 'unknown');
2149
+ for (const [path, row] of kept) now.set(path, row);
2150
+ const out = [];
2151
+ const list = (paths) => paths.slice(0, 60).join(', ') + (paths.length > 60 ? ' +' + (paths.length - 60) + ' more' : '');
2152
+ if (!was.size) out.push('No ledger yet: read every page (' + pages.length + '): ' + list(pages.map(([path]) => path)));
2153
+ else {
2154
+ const prior = was.get('@shared');
2155
+ shared.day = prior && prior.h === shared.h ? prior.day : today;
2156
+ const changed = pages.filter(([path]) => was.has(path) && was.get(path).h !== now.get(path).h).map(([path]) => path);
2157
+ const added = pages.filter(([path]) => !was.has(path)).map(([path]) => path);
2158
+ const gone = missing.filter(([path]) => site.pages[path] && site.pages[path].state !== 'unknown').map(([path]) => path);
2159
+ const passed = pages.filter(([path]) => was.has(path) && !changed.includes(path)).flatMap(([path]) => was.get(path).dated.split('|').filter((d) => d && d.slice(0, 10) < today).map((d) => path + ': ' + d));
2160
+ out.push('Ledger of ' + (since || 'an earlier run') + ': ' + [...was.keys()].filter((k) => k.startsWith('/')).length + ' pages; read today: ' + pages.length + '.');
2161
+ if (changed.length) out.push('Read, text changed since the ledger (' + changed.length + '): ' + list(changed));
2162
+ if (added.length) out.push('Read, new since the ledger (' + added.length + '): ' + list(added));
2163
+ if (prior && prior.h !== shared.h) out.push('Read, the header or footer changed: it is the same on every page, read it once (text /).');
2164
+ if (passed.length) out.push('Read, a dated sentence whose day passed:\n' + passed.slice(0, 20).map((d) => ' ' + d).join('\n'));
2165
+ if (gone.length) out.push('Gone since the ledger: ' + list(gone));
2166
+ if (kept.length) out.push('Not read today, kept as the ledger had them: ' + list(kept.map(([path]) => path)));
2167
+ const quiet = pages.length - changed.length - added.length;
2168
+ out.push(quiet + ' pages are unchanged since the ledger: read them again only where a value below is on them.');
2077
2169
  }
2170
+ for (const [v, where] of stated) out.push('"' + v + '" is on ' + (where.length ? where.length + (where.length === 1 ? ' page' : ' pages') + ':\n' + where.slice(0, 12).map((w) => ' ' + w).join('\n') + (where.length > 12 ? '\n +' + (where.length - 12) + ' more' : '') : 'no page'));
2171
+ const rows = [...now].sort(([a], [b]) => a.localeCompare(b)).map(([path, r]) => [path, r.h, r.day, r.said, r.dated].join('\t'));
2172
+ fs.writeFileSync(PAGES_LEDGER, ['fimo-content ledger ' + today, ['@shared', shared.h, shared.day, '', ''].join('\t'), ...rows].join('\n') + '\n');
2173
+ console.log(out.join('\n') + '\n\nToday\'s ledger (' + rows.length + ' pages) is in ' + PAGES_LEDGER + '.');
2078
2174
  }
2079
2175
 
2080
2176
  function complianceFindings(site, { add, unsure }) {
@@ -2275,7 +2371,8 @@ else if (cmd === 'check') check();
2275
2371
  else if (cmd === 'diff') diff();
2276
2372
  else if (cmd === 'text') pageText();
2277
2373
  else if (cmd === 'links') links();
2278
- else console.log('node site.mjs crawl [origin] [--max 300] [--max-links 300] [--deadline 900] [--parallel 1] [--seed previous.txt] [--preview-host host] [--hosted url] [--quality] [--phone-max 20] [--compliance] [--consent-max 6] [--fresh] [--pages file] [--http [--browser-max 100]] [--session name] | wait | check [--topic t1,t2] [--retired "Old=New;..."] [--today YYYY-MM-DD] | text [/path ...] | links (after crawl --pages) | diff previous.txt (writes snapshot.txt)');
2374
+ else if (cmd === 'ledger') pageLedger();
2375
+ else console.log('node site.mjs crawl [origin] [--max 300] [--max-links 300] [--deadline 900] [--parallel 1] [--seed previous.txt] [--preview-host host] [--hosted url] [--quality] [--phone-max 20] [--compliance] [--consent-max 6] [--fresh] [--pages file] [--http [--browser-max 100]] [--session name] | wait | check [--topic t1,t2] [--retired "Old=New;..."] [--today YYYY-MM-DD] | text [/path ...] | links (after crawl --pages) | diff previous.txt (writes snapshot.txt) | ledger [previous.tsv] [--values "v1;v2"] [--today YYYY-MM-DD] (writes pages.tsv)');
2279
2376
  `;import{z as z136}from"zod";function toSpec(def){return{token:def.token,riskTier:def.risk,description:def.description}}__name(toSpec,"toSpec");var VOCABULARY=Object.freeze(Object.fromEntries(CAPABILITY_VOCABULARY.filter(definition=>definition.declarable).map(definition=>[definition.token,toSpec(definition)]))),CapabilityToken=z136.enum(Object.keys(VOCABULARY)),CapabilitiesArraySchema=z136.array(CapabilityToken);var RUNTIME_BASELINE_OPERATION_CAPABILITIES=["files:read","files:write"];function isRuntimeBaselineOperationCapability(capability){return RUNTIME_BASELINE_OPERATION_CAPABILITIES.includes(capability)}__name(isRuntimeBaselineOperationCapability,"isRuntimeBaselineOperationCapability");var OPERATION_CAP={"agents.list":"agents:read","agents.routines":"agents:read","agents.routine_runs":"agents:read","knowledge.get":"knowledge:read","knowledge.update":"knowledge:write","cms.list":"cms:read","cms.get":"cms:read","cms.query":"cms:read","cms.create":"cms:write","cms.update":"cms:write","cms.delete":"cms:write","cms.bulk_create":"cms:write","cms.bulk_update":"cms:write","cms.bulk_delete":"cms:write","cms.schema.list":"cms:schema:read","cms.schema.get":"cms:schema:read","cms.schema.push":"cms:schema:write","cms.schema.delete":"cms:schema:write","assets.list":"assets:read","assets.get":"assets:read","assets.read":"assets:read","assets.upload":"assets:write","assets.generate":"assets:write","assets.create_folder":"assets:write","assets.move":"assets:write","assets.delete":"assets:write","i18n.list":"i18n:read","i18n.get":"i18n:read","i18n.create":"i18n:write","i18n.update":"i18n:write","i18n.delete":"i18n:write","i18n.locales.add":"i18n:locales:add","forms.list":"forms:read","forms.get":"forms:read","forms.push":"forms:write","forms.delete":"forms:write","webhooks.events":"webhooks:read","webhooks.list":"webhooks:read","webhooks.get":"webhooks:read","webhooks.deliveries.list":"webhooks:read","webhooks.deliveries.get":"webhooks:read","webhooks.create":"webhooks:write","webhooks.update":"webhooks:write","webhooks.delete":"webhooks:write","webhooks.test":"webhooks:write","webhooks.deliveries.retry":"webhooks:write","webhooks.rotate_secret":"webhooks:write","schedules.list":"schedules:read","schedules.get":"schedules:read","schedules.runs.list":"schedules:read","schedules.runs.get":"schedules:read","schedules.create":"schedules:write","schedules.update":"schedules:write","schedules.delete":"schedules:write","schedules.pause":"schedules:write","schedules.resume":"schedules:write","schedules.run":"schedules:write","files.read":"files:read","files.write":"files:write","fimo.deploy":"fimo:deploy","fimo.logs.read":"fimo:logs:read","fimo.analytics.read":"fimo:analytics:read","fimo.preview.url":"fimo:preview:read","fimo.site.check":"fimo:preview:read","fimo.history.list":"fimo:history:read","fimo.history.get":"fimo:history:read","agent.delegate":"agent:delegate","runtime.auto_merge":"runtime:auto_merge"};function capabilityFor(op){return OPERATION_CAP[op]}__name(capabilityFor,"capabilityFor");function hasOperation(op){return Object.prototype.hasOwnProperty.call(OPERATION_CAP,op)}__name(hasOperation,"hasOperation");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}__name(_define_property,"_define_property");var CapabilityDenied=class extends Error{static{__name(this,"CapabilityDenied")}constructor(detail){let def=getCapability(detail.cap),description=def?.description?` (${def.description})`:"";super(`capability denied: ${detail.cap}${description} \u2014 reason: ${detail.reason}`),_define_property(this,"cap",void 0),_define_property(this,"reason",void 0),_define_property(this,"granted",void 0),_define_property(this,"sessionId",void 0),_define_property(this,"fixHint",void 0),this.name="CapabilityDenied",this.cap=detail.cap,this.reason=detail.reason,this.granted=detail.granted??[],this.sessionId=detail.sessionId,this.fixHint=fixHintFor(detail)}};function fixHintFor(detail){switch(detail.reason){case"not-declared":return`Add '${detail.cap}' to the agent's capabilities.yaml and re-activate.`;case"session-not-found":return`Session '${detail.sessionId??"<unknown>"}' does not exist or has expired.`;case"snapshot-stale":return"Session capability snapshot is corrupted. Restart the agent session.";case"runtime-only":return`'${detail.cap}' is reserved for the platform \u2014 drop it from capabilities.yaml.`;case"auto-merge-blocked":return"runtime:auto_merge is declared but blocked by project policy (.fimo/config.json \u2192 agents.auto_merge)."}}__name(fixHintFor,"fixHintFor");var configured=null;async function auditCapabilityDecision(event){if(!configured)return;let row2={...event,ts:new Date().toISOString()};if(event.decision==="deny"){try{await configured.transport.write(row2)}catch(err){throw configured.breadcrumb?.({category:"audit",level:"error",message:"audit deny row write failed",data:{cap:event.cap,error:err.message}}),err}configured.breadcrumb?.({category:"audit",level:"warning",message:`capability denied: ${event.cap}`,data:{sessionId:event.sessionId,cap:event.cap,reason:event.reason}});return}configured.transport.write(row2).catch(err=>{configured?.breadcrumb?.({category:"audit",level:"warning",message:"audit allow row write failed (best-effort)",data:{cap:event.cap,error:err.message}})})}__name(auditCapabilityDecision,"auditCapabilityDecision");var ENV_SESSION="FIMO_AGENT_SESSION",ENV_CAPS_FALLBACK="FIMO_AGENT_CAPABILITIES";function currentAgentSession(){let id=process.env[ENV_SESSION];return id&&id.length>0?id:void 0}__name(currentAgentSession,"currentAgentSession");async function defaultFetchSessionCapabilities(_sessionId){let raw=process.env[ENV_CAPS_FALLBACK];return raw?raw.split(",").map(s=>s.trim()).filter(s=>s.length>0):[]}__name(defaultFetchSessionCapabilities,"defaultFetchSessionCapabilities");async function requireCapability(cap,ctx={}){let sessionId=currentAgentSession();if(!sessionId)return{ok:!0,bypassed:!0};let granted=await(ctx.fetchSessionCapabilities??defaultFetchSessionCapabilities)(sessionId);if(!granted.includes(cap)){try{await auditCapabilityDecision({sessionId,cap,decision:"deny",reason:granted.length===0?"session-not-found":"not-declared",projectId:ctx.projectId,env:ctx.branch})}catch{}throw new CapabilityDenied({cap,reason:granted.length===0?"session-not-found":"not-declared",granted,sessionId})}return auditCapabilityDecision({sessionId,cap,decision:"allow",projectId:ctx.projectId,env:ctx.branch}),{ok:!0,bypassed:!1}}__name(requireCapability,"requireCapability");async function requireOperation(op,ctx={}){if(!hasOperation(op))throw new Error(`requireOperation: unknown operation id '${op}' \u2014 register it in @fimo/agents capabilities/operation-map.ts`);let cap=capabilityFor(op);return isRuntimeBaselineOperationCapability(cap)?{ok:!0,bypassed:currentAgentSession()===void 0}:requireCapability(cap,ctx)}__name(requireOperation,"requireOperation");init_project_context();init_project2();function registerAgentsCommands(program2){let agents=program2.command("agents").description("Read project agents and their routines"),scoped=__name(command=>command.option("--project <id>","Site id (defaults to the linked site)").option("-C, --cwd <dir>","Site directory"),"scoped");scoped(agents).action((_options,command)=>agentsCommand(command.optsWithGlobals(),void 0,command)),scoped(agents.command("list").description("List agents and routine schedules")).action((_options,command)=>agentsCommand(command.optsWithGlobals(),void 0,command)),scoped(agents.command("show <name-or-id>").description("Read an agent and its routine instructions")).action((ref,_options,command)=>agentsCommand(command.optsWithGlobals(),ref,command)),scoped(agents.command("runs <agent> [routine]").description("List the newest runs of an agent's routines, or of one routine by name or ID").option("--limit <n>","Runs per routine, newest first (1-50)","10")).action((agent2,routine,_options,command)=>agentRunsCommand(command.optsWithGlobals(),agent2,routine,command))}__name(registerAgentsCommands,"registerAgentsCommands");async function projectScope(options,command,operation){let cwd=resolveProjectCwd(options.cwd),projectId2=options.project??resolveProjectSettings(cwd)?.projectId;if(!projectId2)throw new NotInProjectError;let branch=branchOverrideFromCommand(command)??(process.env.FIMO_ENV?.trim()||DEFAULT_BRANCH);await requireOperation(operation,{projectId:projectId2});let fimo=createCliFimoClient(loadConfig()),{chats:chats2}=await fimo.execute("agents.list",{projectId:projectId2,branch});return{projectId:projectId2,branch,fimo,agents:chats2.filter(chat=>chat.kind==="agent")}}__name(projectScope,"projectScope");function pick(items,ref,nameOf,kind){let byId=items.find(item=>item.id===ref),found=byId?[byId]:items.filter(item=>nameOf(item)===ref);if(!found.length)throw new Error(`${kind} not found: ${ref}`);if(found.length>1)throw new Error(`Multiple ${kind.toLowerCase()}s named "${ref}". Use an ID from fimo agents.`);return found[0]}__name(pick,"pick");async function agentsCommand(options,ref,command){let scope2=await projectScope(options,command,"agents.list"),{projectId:projectId2,branch,fimo}=scope2,agents=ref===void 0?scope2.agents:[pick(scope2.agents,ref,agent2=>agent2.title,"Agent")],result=await Promise.all(agents.map(async agent2=>{let{routines:routines2}=await fimo.execute("agents.routines",{projectId:projectId2,branch,threadId:agent2.id});return{id:agent2.id,name:agent2.title??"Agent",description:ref===void 0?(agent2.description??"").replace(/\s+/g," ").slice(0,60):agent2.description,routines:routines2.map(routine=>({id:routine.id,name:routine.name,schedule:routine.triggers.schedule,event:routine.triggers.event?.text??null,paused:routine.paused,nextRunAt:routine.nextRunAt,lastRunAt:routine.lastRunAt,lastOutcome:routine.lastOutcome,outOfAgentHoursUntil:routine.outOfAgentHoursUntil,...ref!==void 0?{instructions:routine.instructions}:{}}))}}));ui.result({command:ref===void 0?"agents list":"agents show",data:ref===void 0?{agents:result}:result[0],render:__name(()=>result.length?result.map(agent2=>[`${agent2.name} (${agent2.id})`,...agent2.description?[agent2.description]:[],...agent2.routines.map(routine=>{let when=[routine.schedule?`${routine.schedule.cron} (${routine.schedule.timezone})`:"manual",...routine.event?[routine.event]:[],...routine.nextRunAt?[`next ${routine.nextRunAt}`]:[],...routine.lastRunAt?[`last ${routine.lastRunAt}${routine.lastOutcome?` (${routine.lastOutcome})`:""}`]:[],...routine.outOfAgentHoursUntil?[`out of agent-hours until ${routine.outOfAgentHoursUntil}`]:[]].join("; ");return` - ${routine.name}: ${when}${routine.paused?" [paused]":""}${routine.instructions?`
2280
2377
  ${routine.instructions}`:""}`})].join(`
2281
2378
  `)).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fimo",
3
- "version": "2.10.3-staging.1",
3
+ "version": "2.10.3",
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.3-staging.1",
198
- "@fimo/api-contracts": "2.10.3-staging.1",
199
- "@fimo/cli-kit": "2.10.3-staging.1",
200
- "@fimo/framework-detect": "2.10.3-staging.1",
201
- "@fimo/routes": "2.10.3-staging.1",
202
- "@fimo/sdk": "2.10.3-staging.1",
203
- "@fimo/tsconfig": "2.10.3-staging.1",
197
+ "@fimo/agents-bundle": "2.10.3",
198
+ "@fimo/api-contracts": "2.10.3",
199
+ "@fimo/cli-kit": "2.10.3",
200
+ "@fimo/framework-detect": "2.10.3",
201
+ "@fimo/routes": "2.10.3",
202
+ "@fimo/sdk": "2.10.3",
203
+ "@fimo/tsconfig": "2.10.3",
204
204
  "@types/node": "22.18.6",
205
205
  "agent-install": "^0.0.5",
206
206
  "astro": "^7.1.6",
package/release.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "source": "npm",
3
- "apiUrl": "https://api.staging.fimo.team",
4
- "webUrl": "https://staging.fimo.team"
3
+ "apiUrl": "https://api.fimo.ai",
4
+ "webUrl": "https://fimo.ai"
5
5
  }
@@ -9,9 +9,9 @@
9
9
  "check": "astro sync && astro check"
10
10
  },
11
11
  "dependencies": {
12
- "fimo": "2.10.3-staging.1",
13
- "fimo-analytics": "2.10.3-staging.1",
14
- "fimo-astro": "2.10.3-staging.1",
12
+ "fimo": "2.10.3",
13
+ "fimo-analytics": "2.10.3",
14
+ "fimo-astro": "2.10.3",
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.3-staging.1",
16
- "fimo-analytics": "2.10.3-staging.1",
17
- "fimo-next": "2.10.3-staging.1",
18
- "fimo-react": "2.10.3-staging.1",
15
+ "fimo": "2.10.3",
16
+ "fimo-analytics": "2.10.3",
17
+ "fimo-next": "2.10.3",
18
+ "fimo-react": "2.10.3",
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.3-staging.1",
25
- "fimo-analytics": "2.10.3-staging.1",
26
- "fimo-react": "2.10.3-staging.1",
27
- "fimo-react-router": "2.10.3-staging.1",
28
- "fimo-vite": "2.10.3-staging.1",
24
+ "fimo": "2.10.3",
25
+ "fimo-analytics": "2.10.3",
26
+ "fimo-react": "2.10.3",
27
+ "fimo-react-router": "2.10.3",
28
+ "fimo-vite": "2.10.3",
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.3-staging.1",
15
- "fimo-analytics": "2.10.3-staging.1",
16
- "fimo-sveltekit": "2.10.3-staging.1",
14
+ "fimo": "2.10.3",
15
+ "fimo-analytics": "2.10.3",
16
+ "fimo-sveltekit": "2.10.3",
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.3-staging.1",
15
- "fimo-analytics": "2.10.3-staging.1",
16
- "fimo-react": "2.10.3-staging.1",
17
- "fimo-react-router": "2.10.3-staging.1",
18
- "fimo-vite": "2.10.3-staging.1",
14
+ "fimo": "2.10.3",
15
+ "fimo-analytics": "2.10.3",
16
+ "fimo-react": "2.10.3",
17
+ "fimo-react-router": "2.10.3",
18
+ "fimo-vite": "2.10.3",
19
19
  "react": "^19.2.7",
20
20
  "react-dom": "^19.2.7",
21
21
  "react-router": "^8.3.0",