@eternify-labs/seo-audit 0.4.0 → 0.4.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/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import{a as Le,c as Te}from"./chunk-KQB6L3WV.js";import{d as De,e as Me,f as _e,
|
|
|
5
5
|
Claude CLI output:
|
|
6
6
|
${t}`:e}}}var re=class{constructor(e){this.config=e}config;id="claude";label="Claude";env(){let e={...process.env};return this.config.anthropicApiKey&&(e.ANTHROPIC_API_KEY=this.config.anthropicApiKey),e}authStatus(){if(this.config.anthropicApiKey||process.env.ANTHROPIC_API_KEY)return{method:"api-key",detail:"Using Anthropic API key"};let e=Be.join(Ke.homedir(),".claude",".credentials.json");return Ue.existsSync(e)||Ue.existsSync(Be.join(Ke.homedir(),".claude.json"))?{method:"subscription",detail:"Reusing your Claude Code login"}:{method:"unknown",detail:"No Claude credentials detected yet"}}async verify(){let e=ne();try{for await(let t of te({prompt:"Reply with exactly the single word: ok",options:{model:this.config.model,tools:[],maxTurns:1,persistSession:!1,permissionMode:"dontAsk",env:this.env(),stderr:e.stderr}}))if(t.type==="result")return t.subtype==="success"?{ok:!0,detail:`Connected (model responded in ${t.duration_ms}ms)`}:{ok:!1,detail:e.describe(`Claude returned ${t.subtype}`)};return{ok:!1,detail:"No result from Claude"}}catch(t){return{ok:!1,detail:e.describe(t instanceof Error?t.message:String(t))}}}async analyzeJson(e){let t=ne();try{for await(let r of te({prompt:`${e.system}
|
|
7
7
|
|
|
8
|
-
${e.prompt}`,options:{model:K("claude",this.config,e.tier),tools:e.webSearch?["WebSearch","WebFetch"]:[],allowedTools:e.webSearch?["WebSearch","WebFetch"]:void 0,
|
|
8
|
+
${e.prompt}`,options:{model:K("claude",this.config,e.tier),tools:e.webSearch?["WebSearch","WebFetch"]:[],allowedTools:e.webSearch?["WebSearch","WebFetch"]:void 0,persistSession:!1,permissionMode:"dontAsk",env:this.env(),outputFormat:{type:"json_schema",schema:e.jsonSchema},stderr:t.stderr}}))if(r.type==="result"){if(r.subtype==="success"&&r.structured_output!==void 0)return r.structured_output;throw new Error(`Claude analysis failed: ${r.subtype}`)}throw new Error("Claude analysis produced no result")}catch(r){throw new Error(t.describe(r instanceof Error?r.message:String(r)))}}async exploreJson(e){let t=ne();try{for await(let r of te({prompt:`${e.system}
|
|
9
9
|
|
|
10
10
|
${e.prompt}`,options:{model:this.config.model,cwd:e.cwd,tools:["Read","Glob","Grep"],allowedTools:["Read","Glob","Grep"],permissionMode:"dontAsk",persistSession:!1,env:this.env(),outputFormat:{type:"json_schema",schema:e.jsonSchema},stderr:t.stderr}}))if(r.type==="assistant"){for(let o of r.message.content)if(o.type==="tool_use"){let i=o.input,s=typeof i?.file_path=="string"?` ${i.file_path}`:typeof i?.pattern=="string"?` ${i.pattern}`:"";e.onEvent?.({kind:"tool",message:`${o.name}${s}`})}}else if(r.type==="result"){if(r.subtype==="success"&&r.structured_output!==void 0)return r.structured_output;throw new Error(`Claude exploration failed: ${r.subtype}`)}throw new Error("Claude exploration produced no result")}catch(r){throw new Error(t.describe(r instanceof Error?r.message:String(r)))}}async runAgent(e){let t=i=>e.onEvent?.(i),r=ne(),o="";try{for await(let i of te({prompt:e.prompt,options:{model:this.config.model,cwd:e.cwd,tools:["Read","Edit","Write","Glob","Grep"],allowedTools:["Read","Edit","Write","Glob","Grep"],permissionMode:"dontAsk",persistSession:!1,env:this.env(),stderr:r.stderr}}))if(i.type==="assistant"){for(let s of i.message.content)if(s.type==="text"&&s.text.trim())t({kind:"text",message:s.text.trim()});else if(s.type==="tool_use"){let a=s.input,d=typeof a?.file_path=="string"?` ${a.file_path}`:"";t({kind:"tool",message:`${s.name}${d}`})}}else if(i.type==="result")if(i.subtype==="success")o=i.result;else throw new Error(`Claude agent failed: ${i.subtype}`);return o}catch(i){throw new Error(r.describe(i instanceof Error?i.message:String(i)))}}};import ze from"fs";import he from"path";import me from"os";import{createRequire as Ct}from"module";import{Codex as It}from"@openai/codex-sdk";var jt=Ct(import.meta.url);function fe(){let e={"darwin-arm64":"aarch64-apple-darwin","darwin-x64":"x86_64-apple-darwin","linux-arm64":"aarch64-unknown-linux-musl","linux-x64":"x86_64-unknown-linux-musl","win32-arm64":"aarch64-pc-windows-msvc","win32-x64":"x86_64-pc-windows-msvc"}[`${process.platform}-${process.arch}`];if(!e)return null;try{let t=he.dirname(jt.resolve("@openai/codex-sdk/package.json")),r=he.join(t,"vendor",e,"codex",process.platform==="win32"?"codex.exe":"codex");return ze.existsSync(r)?r:null}catch{return null}}var oe=class{constructor(e){this.config=e}config;id="openai";label="OpenAI";client(){let e=this.config.openaiApiKey??process.env.OPENAI_API_KEY;return new It(e?{apiKey:e}:{})}authStatus(){return this.config.openaiApiKey||process.env.OPENAI_API_KEY?{method:"api-key",detail:"Using OpenAI API key"}:ze.existsSync(he.join(me.homedir(),".codex","auth.json"))?{method:"subscription",detail:"Reusing your Codex / ChatGPT login"}:{method:"unknown",detail:"No OpenAI credentials detected yet"}}threadDefaults(){return{model:this.config.model,skipGitRepoCheck:!0}}async verify(){try{let e=this.client().startThread({...this.threadDefaults(),sandboxMode:"read-only",workingDirectory:me.tmpdir()}),t=Date.now();return(await e.run("Reply with exactly the single word: ok")).finalResponse?{ok:!0,detail:`Connected (model responded in ${Date.now()-t}ms)`}:{ok:!1,detail:"Empty response from OpenAI"}}catch(e){return{ok:!1,detail:e instanceof Error?e.message:String(e)}}}async analyzeJson(e){let o=(await this.client().startThread({...this.threadDefaults(),model:K("openai",this.config,e.tier),sandboxMode:"read-only",workingDirectory:me.tmpdir()}).run(`${e.system}
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eternify-labs/seo-audit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "SEO & AEO auditor: score any domain or codebase, get an actionable report, and let an AI agent fix your code.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|