geo-ai-search-optimization 2.8.0 → 2.8.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.
package/README.md CHANGED
@@ -192,7 +192,9 @@ publish-pack <input> --out-dir <dir> # Full deliverable package
192
192
  api-server [--port 3456] [--host 127.0.0.1]
193
193
  ```
194
194
 
195
- All API responses are cached for 10 minutes by default. Add `?no-cache=1` to bypass. Use `/api/cache-stats` and `POST /api/cache-clear` to manage.
195
+ **CLI caching:** URL-based analysis results are cached for 5 minutes. Use `--no-cache` to bypass.
196
+
197
+ **API caching:** All API responses are cached for 10 minutes by default. Add `?no-cache=1` to bypass. Use `/api/cache-stats` and `POST /api/cache-clear` to manage.
196
198
 
197
199
  Exposes all analysis functions as HTTP endpoints:
198
200
 
@@ -298,7 +300,7 @@ Full TypeScript declarations included (`index.d.ts`) — 300+ exports with IDE a
298
300
  ## GitHub Action
299
301
 
300
302
  ```yaml
301
- - uses: redredchen01/geo-ai-search-optimization@v2.8.0
303
+ - uses: redredchen01/geo-ai-search-optimization@v2.8.2
302
304
  with:
303
305
  project-path: ./your-project
304
306
  min-score: 60
package/action.yml CHANGED
@@ -51,7 +51,7 @@ runs:
51
51
 
52
52
  - name: Install geo-ai-search-optimization
53
53
  shell: bash
54
- run: npm install -g geo-ai-search-optimization@2.8.0
54
+ run: npm install -g geo-ai-search-optimization@2.8.2
55
55
 
56
56
  - name: Run GEO Audit
57
57
  id: audit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geo-ai-search-optimization",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "description": "Install and run a Generative Engine Optimization (GEO)-first, SEO-supported Codex skill for website optimization.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -106,7 +106,10 @@ export function renderBatchFullPageAuditMarkdown(report) {
106
106
  readability: "Readability", headingStructure: "Heading Structure",
107
107
  internalLinks: "Internal Links", socialMeta: "Social Meta",
108
108
  platformReady: "Platform Readiness", schema: "Schema",
109
- freshness: "Freshness", security: "Security", topics: "Topics"
109
+ freshness: "Freshness", contentFreshness: "Content Freshness",
110
+ security: "Security", topics: "Topics",
111
+ accessibility: "Accessibility", performance: "Performance",
112
+ imageAudit: "Image Audit", linkQuality: "Link Quality"
110
113
  };
111
114
 
112
115
  for (const [key, avg] of Object.entries(report.dimensionAverages)) {
package/src/cli-shared.js CHANGED
@@ -1,3 +1,20 @@
1
+ import { createCache } from "./cache-layer.js";
2
+
3
+ let _cliCache = null;
4
+
5
+ export function getCliCache() {
6
+ if (!_cliCache) {
7
+ _cliCache = createCache({ cacheDir: ".geo-cache/cli", ttl: 300000 }); // 5 min TTL
8
+ }
9
+ return _cliCache;
10
+ }
11
+
12
+ function buildCacheKey(commandLabel, args) {
13
+ const input = args.find((v) => !v.startsWith("-"));
14
+ if (!input || !/^https?:\/\//i.test(input)) return null; // Only cache URL inputs
15
+ return `cli:${commandLabel}:${input}`;
16
+ }
17
+
1
18
  export function getFlagValue(args, flagName) {
2
19
  const index = args.indexOf(flagName);
3
20
  if (index === -1) {
@@ -188,7 +205,37 @@ export function createStructuredOutputCommandHandler({
188
205
  getOutputJson
189
206
  }) {
190
207
  return async function structuredOutputCommandHandler(args) {
208
+ const noCache = hasFlag(args, "--no-cache");
209
+ const cacheKey = noCache ? null : buildCacheKey(commandLabel, args);
210
+ const cache = cacheKey ? getCliCache() : null;
211
+
212
+ // Check cache
213
+ if (cache && cacheKey) {
214
+ const cached = await cache.get(cacheKey);
215
+ if (cached.hit) {
216
+ const result = cached.data;
217
+ const outputJson = getOutputJson ? getOutputJson(args, result) : hasFlag(args, "--json");
218
+ const renderedOutput = outputJson ? `${JSON.stringify(result, null, 2)}\n` : renderMarkdown(result);
219
+ const outputPath = getFlagValue(args, "--out");
220
+ process.stderr.write(`(cached, age ${Math.round(cached.age / 1000)}s)\n`);
221
+
222
+ if (outputPath) {
223
+ const resolvedOutputPath = await writeOutput(outputPath, renderedOutput);
224
+ process.stdout.write(`已保存 ${commandLabel} 结果:${resolvedOutputPath}\n`);
225
+ return;
226
+ }
227
+ process.stdout.write(renderedOutput);
228
+ return;
229
+ }
230
+ }
231
+
191
232
  const result = await execute(args);
233
+
234
+ // Store in cache
235
+ if (cache && cacheKey) {
236
+ await cache.set(cacheKey, result);
237
+ }
238
+
192
239
  const outputJson = getOutputJson ? getOutputJson(args, result) : hasFlag(args, "--json");
193
240
  const renderedOutput = outputJson ? `${JSON.stringify(result, null, 2)}\n` : renderMarkdown(result);
194
241
  const outputPath = getFlagValue(args, "--out");
package/src/compare.js CHANGED
@@ -2,7 +2,7 @@ import { writeScanOutput } from "./scan.js";
2
2
  import { fullPageAudit } from "./full-page-audit.js";
3
3
 
4
4
  /**
5
- * Compare two pages across all 12 dimensions.
5
+ * Compare two pages across all 17 dimensions.
6
6
  * Produces a side-by-side analysis with delta scoring.
7
7
  */
8
8
 
@@ -117,7 +117,9 @@ export function renderCompareMarkdown(report) {
117
117
  base: "Base", citability: "Citability", eeat: "E-E-A-T", readability: "Readability",
118
118
  headingStructure: "Headings", internalLinks: "Links", socialMeta: "Social",
119
119
  platformReady: "Platforms", schema: "Schema", freshness: "Freshness",
120
- security: "Security", topics: "Topics"
120
+ contentFreshness: "Content Freshness", security: "Security", topics: "Topics",
121
+ accessibility: "Accessibility", performance: "Performance",
122
+ imageAudit: "Image Audit", linkQuality: "Link Quality"
121
123
  };
122
124
 
123
125
  lines.push(
package/src/csv-export.js CHANGED
@@ -22,9 +22,10 @@ export function fullPageAuditToCsv(report) {
22
22
  const rows = [toCsvRow(["Dimension", "Score", "Label", "Weight"])];
23
23
 
24
24
  const weights = {
25
- base: 15, citability: 12, eeat: 12, readability: 8, headingStructure: 6,
26
- internalLinks: 5, socialMeta: 5, platformReady: 8, schema: 7,
27
- freshness: 8, security: 7, topics: 7
25
+ base: 12, citability: 10, eeat: 10, readability: 6, headingStructure: 5,
26
+ socialMeta: 4, internalLinks: 4, platformReady: 6, schema: 5,
27
+ freshness: 3, contentFreshness: 3, security: 6, topics: 5,
28
+ accessibility: 5, performance: 5, imageAudit: 5, linkQuality: 6
28
29
  };
29
30
 
30
31
  for (const [dim, data] of Object.entries(report.dimensions || {})) {
@@ -232,7 +232,7 @@ function buildHtml(report, options = {}) {
232
232
  : ""
233
233
  }
234
234
 
235
- <footer>Generated by geo-ai-search-optimization v2.8.0 &mdash; ${escapeHtml(timestamp)}</footer>
235
+ <footer>Generated by geo-ai-search-optimization v2.8.2 &mdash; ${escapeHtml(timestamp)}</footer>
236
236
  </div>
237
237
  </body>
238
238
  </html>`;
@@ -2,7 +2,7 @@ import { writeScanOutput } from "./scan.js";
2
2
  import { fullPageAudit } from "./full-page-audit.js";
3
3
 
4
4
  /**
5
- * Deep benchmark: full 12-dimension comparison against N competitors.
5
+ * Deep benchmark: full 17-dimension comparison against N competitors.
6
6
  */
7
7
 
8
8
  async function auditSafe(url, options) {
@@ -155,7 +155,9 @@ const DIM_LABELS = {
155
155
  base: "Base", citability: "Citability", eeat: "E-E-A-T", readability: "Readability",
156
156
  headingStructure: "Headings", internalLinks: "Links", socialMeta: "Social",
157
157
  platformReady: "Platforms", schema: "Schema", freshness: "Freshness",
158
- security: "Security", topics: "Topics"
158
+ contentFreshness: "Content Freshness", security: "Security", topics: "Topics",
159
+ accessibility: "Accessibility", performance: "Performance",
160
+ imageAudit: "Image Audit", linkQuality: "Link Quality"
159
161
  };
160
162
 
161
163
  export function renderDeepBenchmarkMarkdown(report) {
@@ -5,7 +5,7 @@
5
5
  const DEFAULT_TIMEOUT = 10_000;
6
6
  const DEFAULT_RETRIES = 2;
7
7
  const DEFAULT_RETRY_DELAY = 1000;
8
- const USER_AGENT = "geo-ai-search-optimization/2.8.0";
8
+ const USER_AGENT = "geo-ai-search-optimization/2.8.2";
9
9
 
10
10
  export async function fetchWithRetry(url, options = {}) {
11
11
  const timeout = options.timeout || DEFAULT_TIMEOUT;
package/src/pdf-report.js CHANGED
@@ -184,7 +184,7 @@ export function generatePdfHtml(data, options = {}) {
184
184
  ${body}
185
185
 
186
186
  <div class="footer">
187
- Generated by geo-ai-search-optimization v2.8.0 — Open-source GEO toolkit for AI search optimization.
187
+ Generated by geo-ai-search-optimization v2.8.2 — Open-source GEO toolkit for AI search optimization.
188
188
  <br>Print this page to PDF for a polished report.
189
189
  </div>
190
190
  </body>