Lines 1-56javascript
2import{Command as Uf}from"commander";import{dirname as jo,relative as Ht}from"path";import{intro as xc,outro as _c,text as To,select as Tn,spinner as Cc,isCancel as Fe,cancel as Ue,confirm as Ec}from"@clack/prompts";var Pe=[".env.local",".env.production",".env"],Rr=["NEXT_PUBLIC_SITE_URL","SITE_URL","NEXT_PUBLIC_URL","NEXTAUTH_URL","VITE_SITE_URL"];var oe="@seoagent-official/seoagent",Ct=`${oe}@latest`;import{homedir as Bs}from"os";import{join as Ie}from"path";var k=".seoagent",Ar=["audit","strategy/clusters","briefs","content","content/images","performance"],ye={AGENTS:".agents/skills/seoagen ...
5!content/images/.gitkeep
9`,Gs=process.env.XDG_CONFIG_HOME&&process.env.XDG_CONFIG_HOME.trim().length>0?process.env.XDG_CONFIG_HOME:Ie(Bs(),".config"),G=Ie(Gs,"seoagent"),ce=Ie(G,"auth.json"),mn=Ie(G,"state"),At=Ie(G,"update-check.json"),Pt=Ie(G,"projects.json");var Ve="https://seoagent.com",Te=process.env.SEOAGENT_API_BASE&&process.env.SEOAGENT_API_BASE.trim().length>0?process.env.SEOAGENT_API_BASE.replace(/\/$/,""):Ve,P={BASE:Te,PRICING:`${Te}/pricing`,LEAD_API:`${Te}/api/cli/lead`,CLI_AUTH_PAGE:`${Te}/cli/auth`,CLI_AUTH_POLL:`${Te}/api/cli/auth/poll`,CLI_SYNC:`${Te}/api/cli/sync`};function X(e,t){let n=t&&t!=="unkno ...
10`),i=Xs(r),s=i.length>0?i[0].indent:0,[a]=Lr(i,0,s);return{data:a,body:o}}function Tt(e){if(!Vs(e))return null;try{return le(Js(e,"utf-8"))}catch{return null}}function Zs(e){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number")return String(e);let t=String(e);return t===""||/[:#\[\]{}&*!|>'"%@`,]/.test(t)||/^\s|\s$/.test(t)?`"${t.replace(/"/g,'\\"')}"`:t}function jr(e,t,n){let r=" ".repeat(t);for(let[o,i]of Object.entries(e))i!==void 0&&(i!==null&&typeof i=="object"?(n.push(`${r}${o}:`),jr(i,t+1,n)):n.push(`${r}${o}: ${Zs(i)}`))}function hn(e,t=""){let ...
15`)}var na=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function wn(){return ea()}var ra=new Set(["strapi","wordpress","sanity","contentful","ghost","webflow","shopify","payload","directus","mdx-local","none"]),oa="project.md";function Je(e){return yn(e,k)}function Ot(e){return yn(Je(e),oa)}function Ur(e){return Nr(Ot(e))}function C(e){let t=Tt(Ot(e));if(!t)return null;let n=t.data;if(typeof n.domain!="string"||!n.domain)return null;let r=typeof n.image_provider=="string"?n.image_provider:void 0,o=typeof n.cms=="string"?n.cms:void 0,i=o&&ra.has(o)?o:void 0,s=typeof n.instal ...
16`)}function sa(e){let t={domain:e.domain,site_type:e.site_type,language:e.language,initialized_at:e.initialized_at,seoagent_version:e.seoagent_version};return e.skill_version&&(t.skill_version=e.skill_version),e.install_id&&(t.install_id=e.install_id),e.image_provider&&(t.image_provider=e.image_provider),e.cms&&(t.cms=e.cms),e.blog_path&&(t.blog_path=e.blog_path),t}function Mr(e,t){let n=Je(e);Dr(n,{recursive:!0});let r=hn(sa(t),ia(t));Fr(Ot(e),r,"utf-8")}function V(e,t){let n=Ot(e);if(!Nr(n))return!1;let r=le(ta(n,"utf-8")),o={...r.data,...t};return Fr(n,hn(o,r.body),"utf-8"),!0}function Br(e ...
17`,"utf-8"),{file:t,added:o||s}}function Zr(e){let t=Le(e,Et);if(!Ft(t))return!1;let n=vn(t).hooks;return n?Xr.some(r=>{let o=n[r];return Array.isArray(o)&&o.some(i=>i.hooks?.some(xn))}):!1}function eo(e){let t=Le(e,Et);if(!Ft(t))return{file:t,removed:!1};let n=vn(t),r=n.hooks;if(!r)return{file:t,removed:!1};let o=!1;for(let i of Xr){let s=r[i];if(!Array.isArray(s))continue;for(let c of s){let u=c.hooks.length;c.hooks=c.hooks.filter(d=>!xn(d)),c.hooks.length!==u&&(o=!0)}let a=s.filter(c=>c.hooks.length>0);a.length===0?delete r[i]:r[i]=a}return o?(Object.keys(r).length===0&&delete n.hooks,Dt(t,J ...
18`,"utf-8"),{file:t,removed:!0}):{file:t,removed:!1}}import{existsSync as to,mkdirSync as _a,readFileSync as Ca,writeFileSync as Ea}from"fs";import{join as Ra}from"path";function no(e){return to(Ra(e,k,"project.md"))}function ro(){try{if(!to(Pt))return[];let e=JSON.parse(Ca(Pt,"utf-8"));return Array.isArray(e.projects)?e.projects.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function oo(e){try{_a(G,{recursive:!0}),Ea(Pt,JSON.stringify({projects:e},null,2)+`
19`,"utf-8")}catch{}}function ke(e){try{if(!no(e))return;let t=ro();if(t.includes(e))return;t.push(e),oo(t)}catch{}}function io(){let e=ro(),t=e.filter(no);return t.length!==e.length&&oo(t),t}import{readFileSync as Ta,writeFileSync as Oa,existsSync as La}from"fs";import{join as lo}from"path";function ao(e){let t={business:{},writingInstructions:[],referenceUrls:[],topicsToAvoid:[],contentTone:null,additionalNotes:null},n=Aa(e);for(let[r,o]of n){let i=r.toLowerCase().trim();i==="business context"?t.business=Pa(o):i==="writing instructions"?t.writingInstructions=so(o):i==="reference urls"?t.refere ...
20`)}function Aa(e){let t=e.split(`
21`),n=[],r="",o=[];for(let i of t){let s=i.match(/^#\s+(.+)$/);s?(r&&n.push([r,o.join(`
22`)]),r=s[1],o=[]):o.push(i)}return r&&n.push([r,o.join(`
23`)]),n}function Pa(e){let t={},n=e.split(`
24`);for(let r of n){let o=r.match(/^[-*]\s+\*\*(.+?):\*\*\s*(.*)$/);if(o){let i=o[1].toLowerCase().trim(),s=o[2].trim();s&&(t[i]=s)}}return t}function so(e){let t=[],n=e.split(`
25`);for(let r of n){let o=r.match(/^[-*]\s+(.+)$/);if(o){let i=o[1].trim();(!i.startsWith("(")||!i.endsWith(")"))&&t.push(i)}}return t}function Ia(e){let t=[],n=e.split(`
26`);for(let r of n){let o=r.match(/^[-*]\s+(https?:\/\/\S+)(?:\s+[—–-]\s+(.+))?$/);o&&t.push({url:o[1].trim(),description:o[2]?.trim()||""})}return t}var uo="context.md";function Ut(e){let t=lo(e,".seoagent",uo);if(!La(t))return null;let n=Ta(t,"utf-8");return ao(n)}function ja(e,t){let n=lo(e,".seoagent",uo),r=co(t);Oa(n,r,"utf-8")}function po(e,t){ja(e,{business:{type:t||""},writingInstructions:[],referenceUrls:[],topicsToAvoid:[],contentTone:null,additionalNotes:null})}import{existsSync as Xe,readFileSync as fo,readdirSync as Na,statSync as mo}from"fs";import{join as be}from"path";var Da=[{c ...
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
index.jsView on unpkg · L8 27`),n=["# Pages","","Inventory of pages discovered in your codebase. Re-running `seoagent init`","or `seoagent refresh` re-scans and merges in newly-added pages without","touching rows you or the audit have edited. `In sitemap` is refreshed from","the live sitemap; `Status` / `Rendered` / `Word count` are filled by","`seoagent refresh --crawl` (a live fetch of each page). This file syncs to","the cloud on login."].join(`
28`),r="| URL | In sitemap | In nav | Status | Rendered | Word count | Notes |",o="|---|---|---|---|---|---|---|",i=e.map(s=>`| ${s.url} | ${s.in_sitemap} | ${s.in_nav} | ${s.status} | ${s.rendered} | ${s.word_count} | ${s.notes} |`);return[t,"",n,"",r,o,...i,""].join(`
29`)}function Sc(e){let t=new Map,n;try{n=kc(e,"utf-8")}catch{return t}let r=n.split(/\r?\n/);for(let o=0;o<r.length-1;o++){if(
30`))}import{existsSync as Fo}from"fs";import{intro as Ic,outro as Tc,confirm as Oc,isCancel as Lc,cancel as jc}from"@clack/prompts";import{existsSync as Kt,rmSync as Pc}from"fs";import{join as qt}from"path";function No(e,t={}){let n=[],r=qt(e,k);Kt(r)&&n.push({label:".seoagent/ \u2014 project state + all generated work",path:r,kind:"dir"});let o=qt(e,ye.CLAUDE);Kt(o)&&n.push({label:".claude/skills/seoagent/ \u2014 installed skill bundle",path:o,kind:"dir"});let i=qt(e,ye.AGENTS);return Kt(i)&&n.push({label:".agents/skills/seoagent/ \u2014 installed skill bundle",path:i,kind:"dir"}),Zr(e)&&n.pus ...
31`);if(!r){Ic("SEOAgent \u2014 uninstall"),l.message(`This will remove:
32${o}`);let s=await Oc({message:"Remove these and start fresh?"});if(Lc(s)||!s){jc("Cancelled \u2014 nothing was removed.");return}}Do(t,n);let i=n.map(s=>` \u2713 ${s.label}`).join(`
33`);r?l.success(`Removed:
35${i}`),!e.global&&Fo(G)&&l.info("Your seoagent.com login (~/.config/seoagent/) was kept \u2014 it is shared across projects. Run `uninstall --global` to wipe it too."),l.info(`Re-install any time with \`${f("init")}\`.`)}import x from"picocolors";import{existsSync as Mo,mkdirSync as Uo,readFileSync as Nc,writeFileSync as
36`,"utf-8");try{Fc(ce,384)}catch{}}function Go(){if(!Mo(ce))return!1;try{return Uc(ce),!0}catch{return!1}}import{existsSync as rt,readdirSync as Ln,statSync as Bc,readFileSync as Wo}from"fs";import{join as Me}from"path";function Gc(e){let t=(e.match(/^\s*-\s+\[\s\]/gm)??[]).length,n=(e.match(/^\s*-\s+\[x\]/gim)??[]).length;return{open:t,done:n}}function Wc(e){let t=Me(e,"audit","latest.md");if(!rt(t))return null;let n=Tt(t);if(!n)return null;let r=Wo(t,"utf-8"),o=Gc(r);return{exists:!0,date:typeof n.data.audited_at=="string"?n.data.audited_at:void 0,issueCount:o.open}}function Hc(e){try{let n=W ...
37`)}function Jc(e,t){if(!t)return de.dim(`\u250C${"\u2500".repeat(e-2)}\u2510`);let n=Ko(t),r=e-5-n;return r<1?de.dim
38
CriticalSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution with blocking evidence.
index.jsView on unpkg · L25 CriticalTrigger Reachable Dangerous Capability
A package entrypoint or install-time lifecycle script reaches a source file with blocking dangerous behavior.
index.jsView on unpkg · L25 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
index.jsView on unpkg · L25 39Live: ${e.canonical}`:"",o=[`# ${e.title}`,"",`Tracked record \u2014 this article is **${e.status}** and ${n}.`,"This is a pointer so the cloud dashboard can track it without duplicating","the body. Edit the source file to change the article."+r,""].join(`
44`}function Xo(e,t){let n=Ge(e,k,"content"),r=Dn(n),o=new Set;for(let c of r)c.source==="repo"&&c.repo_path&&o.add(El(c.repo_path));if(o.size===0)return{tracked:[]};let i=[...o].flatMap(c=>Nn(e,c)),s=Fn(i,r,Un(e));if(s.toTrack.length===0)return{tracked:[]};_l(n,{recursive:!0});let a=[];for(let c of s.toTrack){let u=dt({slug:c.slug,title:c.title,canonical:ut(c.slug,{domain:t.domain,blogPath:t.blog_path}),status:"published",page_type:c.page_type,source:"repo",repo_path:c.path,tracked_at:new Date().toISOString()});Cl(Ge(n,`${c.slug}.md`),u,"utf-8"),a.push(c.slug)}return{tracked:a}}import{existsSyn ...
46action_type: ${e.action_type}
50created_at: ${e.created_at}
53# Prune action \u2014 ${o??`article ${n}`}
55SEOAgent's auto-prune determined that this article should be removed from
56your repo. The cloud has already marked it pruned in your dashboard and
Long lines were clipped for display.