diff --git a/biome.json b/biome.json index d8f06e7..c898f32 100644 --- a/biome.json +++ b/biome.json @@ -28,7 +28,8 @@ "!**/tsconfig.tsbuildinfo", "!**/.cf-pages-bundle", "!**/packages", - "!**/*.html" + "!**/*.html", + "!src/agent-surfaces" ] }, "formatter": { diff --git a/knip.jsonc b/knip.jsonc index c3d6d90..ce0b956 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -1,5 +1,9 @@ { "$schema": "https://unpkg.com/knip@6/schema.json", + "ignoreIssues": { + "src/agent-surfaces/http.mjs": ["exports"], + "src/agent-surfaces/adapters/static-assets.mjs": ["files", "exports"] + }, "workspaces": { ".": { "entry": [ diff --git a/landing-astro/src/components/Head.astro b/landing-astro/src/components/Head.astro index 4adccbe..47a8941 100644 --- a/landing-astro/src/components/Head.astro +++ b/landing-astro/src/components/Head.astro @@ -1,4 +1,5 @@ --- +import { publicIdentityGraph } from '../../../src/public-site.mjs'; interface Props { title: string; description: string; @@ -30,43 +31,14 @@ const SITE_URL = 'https://read.significanthobbies.com'; } + diff --git a/landing-astro/src/pages/changelog/index.astro b/landing-astro/src/pages/changelog/index.astro index 5a3852d..9f95bf7 100644 --- a/landing-astro/src/pages/changelog/index.astro +++ b/landing-astro/src/pages/changelog/index.astro @@ -1,11 +1,11 @@ --- +import copy from '../../../../src/public-copy.json'; import PlainLayout from '@/layouts/PlainLayout.astro'; --- - +
-

Product direction

A smaller Reader.

-

The active product is a saved-link inbox, a one-click capture extension, and MCP tools for ChatGPT to retrieve links and update read state.

-

Existing saved data remains intact. Deployment and an authenticated ChatGPT connection are verified separately from source changes.

+

Product direction

{copy.changelog.heading}

+ {copy.changelog.paragraphs.map((paragraph) =>

{paragraph}

)} Source history ↗
diff --git a/landing-astro/src/pages/faq.astro b/landing-astro/src/pages/faq.astro index 7e44e3a..30d724c 100644 --- a/landing-astro/src/pages/faq.astro +++ b/landing-astro/src/pages/faq.astro @@ -1,12 +1,10 @@ --- +import copy from '../../../src/public-copy.json'; import PlainLayout from '@/layouts/PlainLayout.astro'; --- - +
-

Questions

Just your saved links.

-

How do I add one?

Paste a URL in the inbox or click Save link in the Chrome extension.

-

How does ChatGPT use it?

Connect Reader through MCP with OAuth. ChatGPT can search links, retrieve available text, and mark links read when you ask. The connection requires a deployed endpoint and OAuth setup.

-

Where are the other features?

RSS, the reader view, annotations, boards, memories, PDFs, and built-in AI are outside the active product. Existing saved data is retained.

-

Where is the extension?

It is built from this repository and loaded unpacked in Chrome. Public distribution is deferred.

+

Questions

{copy.faq.heading}

+ {copy.faq.questions.map((item) => <>

{item.question}

{item.answer}

)}
diff --git a/package.json b/package.json index eccf653..38760cf 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "dev": "concurrently -k -n worker,spa -c blue,green \"pnpm dev:worker\" \"pnpm dev:spa\"", "dev:spa": "vite", "dev:worker": "wrangler dev --config wrangler.local.toml", - "build": "node scripts/validate-env.mjs build && vite build", - "cf:build": "pnpm build && pnpm --filter ./landing-astro build && node scripts/overlay-astro-landing.mjs", + "build": "node scripts/generate-public-markdown.mjs && node scripts/validate-env.mjs build && vite build", + "cf:build": "pnpm build && pnpm --filter ./landing-astro build && node scripts/overlay-astro-landing.mjs && node scripts/check-public-markdown.mjs", "preview": "vite preview", "deploy": "pnpm validate:env:deploy && pnpm cf:build && pnpm exec wrangler deploy --tag \"$(git rev-parse HEAD)\"", "lint": "node scripts/check-code-health.mjs lint", @@ -82,7 +82,7 @@ "@vitest/coverage-v8": "4.1.10", "concurrently": "9.2.1", "drizzle-kit": "0.31.10", - "happy-dom": "20.11.1", + "happy-dom": "21.0.4", "husky": "9.1.7", "jscpd": "5.0.14", "knip": "^6.29.0", @@ -113,12 +113,14 @@ "brace-expansion@>=1.0.0 <1.1.21": "1.1.21", "brace-expansion@>=2.0.0 <2.1.7": "2.1.7", "brace-expansion@>=5.0.0 <5.0.12": "5.0.12", - "undici@>=7.0.0 <7.29.1": "7.29.1", "devalue@<=5.9.2": "5.9.3", "http-cache-semantics": "4.3.0", "sharp@<0.35.5": "0.35.5", "source-map-js@<1.2.2": "1.2.2", - "dompurify@<3.4.17": "3.4.17" + "dompurify@<3.4.17": "3.4.17", + "undici@>=7.0.0 <7.30.1": "7.30.1", + "undici@>=8.0.0 <8.12.2": "8.12.2", + "zod@>=4.0.0 <4.6.6": "4.6.6" }, "patchedDependencies": { "http-cache-semantics@4.3.0": "patches/http-cache-semantics@4.3.0.patch", diff --git a/packages/chrome-extension/package.json b/packages/chrome-extension/package.json index 3742bc4..a6ddbd7 100644 --- a/packages/chrome-extension/package.json +++ b/packages/chrome-extension/package.json @@ -22,7 +22,7 @@ "@types/react-dom": "19", "@vitejs/plugin-react": "6.0.5", "autoprefixer": "10.5.0", - "happy-dom": "20.11.2", + "happy-dom": "21.0.4", "postcss": "8.5.23", "tailwindcss": "4", "typescript": "6.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b4539b2..9043b20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,12 +22,14 @@ overrides: brace-expansion@>=1.0.0 <1.1.21: 1.1.21 brace-expansion@>=2.0.0 <2.1.7: 2.1.7 brace-expansion@>=5.0.0 <5.0.12: 5.0.12 - undici@>=7.0.0 <7.29.1: 7.29.1 devalue@<=5.9.2: 5.9.3 http-cache-semantics: 4.3.0 sharp@<0.35.5: 0.35.5 source-map-js@<1.2.2: 1.2.2 dompurify@<3.4.17: 3.4.17 + undici@>=7.0.0 <7.30.1: 7.30.1 + undici@>=8.0.0 <8.12.2: 8.12.2 + zod@>=4.0.0 <4.6.6: 4.6.6 patchedDependencies: '@saas-maker/templates@0.1.20': @@ -130,8 +132,8 @@ importers: specifier: 0.31.10 version: 0.31.10 happy-dom: - specifier: 20.11.1 - version: 20.11.1 + specifier: 21.0.4 + version: 21.0.4 husky: specifier: 9.1.7 version: 9.1.7 @@ -158,7 +160,7 @@ importers: version: 8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0) vitest: specifier: 4.1.10 - version: 4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@20.11.1)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) + version: 4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@21.0.4)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) wrangler: specifier: 4.114.0 version: 4.114.0(@cloudflare/workers-types@4.20260424.1)(@types/node@25.6.0) @@ -240,8 +242,8 @@ importers: specifier: 10.5.0 version: 10.5.0(postcss@8.5.23) happy-dom: - specifier: 20.11.2 - version: 20.11.2 + specifier: 21.0.4 + version: 21.0.4 postcss: specifier: 8.5.23 version: 8.5.23 @@ -256,7 +258,7 @@ importers: version: 8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0) vitest: specifier: 4.1.5 - version: 4.1.5(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10(vitest@4.1.10))(happy-dom@20.11.2)(vite@8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) + version: 4.1.5(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10(vitest@4.1.10))(happy-dom@21.0.4)(vite@8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) packages: @@ -3291,7 +3293,7 @@ packages: better-call@1.4.0: resolution: {integrity: sha512-bBKOT4vv1kZLDgxVePdilk/Jwkn+dtRRsmi3DzHcDP+WnswyVl6dR59l2HEeP/0cB+bDoopASAesWDPIdd/zZA==} peerDependencies: - zod: ^4.0.0 + zod: 4.6.6 peerDependenciesMeta: zod: optional: true @@ -3839,12 +3841,8 @@ packages: h3@1.15.11: resolution: {integrity: sha512-L3THSe2MPeBwgIZVSH5zLdBBU90TOxarvhK9d04IDY2AmVS8j2Jz2LIWtwsGOU3lu2I5jCN7FNvVfY2+XyF+mg==} - happy-dom@20.11.1: - resolution: {integrity: sha512-XSt8tMzbW9ymE7687xztkO1ckR7qJNQ3LywY9vlYGhGi3zXrGBHuUo2Cl1ztZaICW+1eAGdkLbj6iwVqDT33kg==} - engines: {node: '>=20.0.0'} - - happy-dom@20.11.2: - resolution: {integrity: sha512-7MB+bJLkxu3SowAfBJbjW+c55kNz5tkR45gu2qzrxznezhLeN5YIlJbwUgSzlGc+qWoZ8Ykg71H5ezz69xixrw==} + happy-dom@21.0.4: + resolution: {integrity: sha512-tFm+GaLBgo6o0awHnvHaNoraVo27qJ+2tZEtZ+cIa08hXbeitrxAJajLI05hsUy/2/YTKcUjQYzHe5mCcraLBw==} engines: {node: '>=20.0.0'} has-flag@4.0.0: @@ -4886,12 +4884,12 @@ packages: undici-types@7.19.2: resolution: {integrity: sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==} - undici@7.29.1: - resolution: {integrity: sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==} + undici@7.30.1: + resolution: {integrity: sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==} engines: {node: '>=20.18.1'} - undici@8.11.2: - resolution: {integrity: sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==} + undici@8.12.2: + resolution: {integrity: sha512-XtuDWVdqTLr3NAxm2ly9/hU6kUsJOgGh1RASzMBbsw6aWCOaQzHdW+QQDfdERjfJ2V5vL5pRPa4RetO9UfivDg==} engines: {node: '>=22.19.0'} unenv@2.0.0-rc.24: @@ -5343,11 +5341,8 @@ packages: youch@4.1.0-beta.10: resolution: {integrity: sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==} - zod@4.3.6: - resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==} - - zod@4.4.3: - resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zod@4.6.6: + resolution: {integrity: sha512-4UmzQUF5fxvfcYHlbjBmejU+w+hbDnWFx4aS8kBx7nPBHcO2SqPbpAG8snbdg+Xse4pRefR98hgjFgIMCI/UhA==} zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -5480,7 +5475,7 @@ snapshots: dependencies: sitemap: 9.0.1 stream-replace-string: 2.0.0 - zod: 4.3.6 + zod: 4.6.6 '@astrojs/telemetry@3.3.3': dependencies: @@ -5513,53 +5508,53 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1)': + '@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1)': dependencies: '@better-auth/utils': 0.4.2 '@better-fetch/fetch': 1.3.1 '@opentelemetry/semantic-conventions': 1.43.0 '@standard-schema/spec': 1.1.0 - better-call: 1.4.0(zod@4.4.3) + better-call: 1.4.0(zod@4.6.6) jose: 6.2.4 kysely: 0.28.17 nanostores: 1.4.1 - zod: 4.4.3 + zod: 4.6.6 optionalDependencies: '@cloudflare/workers-types': 4.20260424.1 '@opentelemetry/api': 1.9.1 - '@better-auth/drizzle-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(drizzle-orm@0.45.2(@cloudflare/workers-types@4.20260424.1)(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1)(kysely@0.28.17))': + '@better-auth/drizzle-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(drizzle-orm@0.45.2(@cloudflare/workers-types@4.20260424.1)(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1)(kysely@0.28.17))': dependencies: - '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) + '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) '@better-auth/utils': 0.4.2 optionalDependencies: drizzle-orm: 0.45.2(@cloudflare/workers-types@4.20260424.1)(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1)(kysely@0.28.17) - '@better-auth/kysely-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(kysely@0.28.17)': + '@better-auth/kysely-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(kysely@0.28.17)': dependencies: - '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) + '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) '@better-auth/utils': 0.4.2 optionalDependencies: kysely: 0.28.17 - '@better-auth/memory-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)': + '@better-auth/memory-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)': dependencies: - '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) + '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) '@better-auth/utils': 0.4.2 - '@better-auth/mongo-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)': + '@better-auth/mongo-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)': dependencies: - '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) + '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) '@better-auth/utils': 0.4.2 - '@better-auth/prisma-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)': + '@better-auth/prisma-adapter@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)': dependencies: - '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) + '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) '@better-auth/utils': 0.4.2 - '@better-auth/telemetry@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)': + '@better-auth/telemetry@1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)': dependencies: - '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) + '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) '@better-auth/utils': 0.4.2 '@better-fetch/fetch': 1.3.1 @@ -7685,7 +7680,7 @@ snapshots: obug: 2.1.4 std-env: 4.2.0 tinyrainbow: 3.1.0 - vitest: 4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@20.11.1)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) + vitest: 4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@21.0.4)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) '@vitest/expect@4.1.10': dependencies: @@ -7867,7 +7862,7 @@ snapshots: vitefu: 1.1.3(vite@8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) xxhash-wasm: 1.1.0 yargs-parser: 22.0.0 - zod: 4.4.3 + zod: 4.6.6 optionalDependencies: sharp: 0.35.5(@types/node@25.6.0) transitivePeerDependencies: @@ -7923,41 +7918,41 @@ snapshots: better-auth@1.6.27(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(drizzle-kit@0.31.10)(drizzle-orm@0.45.2(@cloudflare/workers-types@4.20260424.1)(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1)(kysely@0.28.17))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(vitest@4.1.10): dependencies: - '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) - '@better-auth/drizzle-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(drizzle-orm@0.45.2(@cloudflare/workers-types@4.20260424.1)(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1)(kysely@0.28.17)) - '@better-auth/kysely-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(kysely@0.28.17) - '@better-auth/memory-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2) - '@better-auth/mongo-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2) - '@better-auth/prisma-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2) - '@better-auth/telemetry': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.4.3))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1) + '@better-auth/core': 1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1) + '@better-auth/drizzle-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(drizzle-orm@0.45.2(@cloudflare/workers-types@4.20260424.1)(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1)(kysely@0.28.17)) + '@better-auth/kysely-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(kysely@0.28.17) + '@better-auth/memory-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2) + '@better-auth/mongo-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2) + '@better-auth/prisma-adapter': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2) + '@better-auth/telemetry': 1.6.27(@better-auth/core@1.6.27(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@cloudflare/workers-types@4.20260424.1)(@opentelemetry/api@1.9.1)(better-call@1.4.0(zod@4.6.6))(jose@6.2.4)(kysely@0.28.17)(nanostores@1.4.1))(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1) '@better-auth/utils': 0.4.2 '@better-fetch/fetch': 1.3.1 '@noble/ciphers': 2.2.0 '@noble/hashes': 2.2.0 - better-call: 1.4.0(zod@4.4.3) + better-call: 1.4.0(zod@4.6.6) defu: 6.1.7 jose: 6.2.4 kysely: 0.28.17 nanostores: 1.4.1 - zod: 4.4.3 + zod: 4.6.6 optionalDependencies: drizzle-kit: 0.31.10 drizzle-orm: 0.45.2(@cloudflare/workers-types@4.20260424.1)(@libsql/client@0.17.4)(@opentelemetry/api@1.9.1)(kysely@0.28.17) react: 19.2.8 react-dom: 19.2.8(react@19.2.8) - vitest: 4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@20.11.1)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) + vitest: 4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@21.0.4)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) transitivePeerDependencies: - '@cloudflare/workers-types' - '@opentelemetry/api' - better-call@1.4.0(zod@4.4.3): + better-call@1.4.0(zod@4.6.6): dependencies: '@better-auth/utils': 0.5.0 '@better-fetch/fetch': 1.3.1 rou3: 0.9.2 set-cookie-parser: 3.1.2 optionalDependencies: - zod: 4.4.3 + zod: 4.6.6 blake3-wasm@2.1.5: {} @@ -8442,20 +8437,7 @@ snapshots: ufo: 1.6.4 uncrypto: 0.1.3 - happy-dom@20.11.1: - dependencies: - '@types/node': 25.6.0 - '@types/whatwg-mimetype': 3.0.2 - '@types/ws': 8.18.1 - buffer-image-size: 0.6.4 - entities: 7.0.1 - whatwg-mimetype: 3.0.0 - ws: 8.21.1 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - happy-dom@20.11.2: + happy-dom@21.0.4: dependencies: '@types/node': 25.6.0 '@types/whatwg-mimetype': 3.0.2 @@ -8605,7 +8587,7 @@ snapshots: tinyglobby: 0.2.17 unbash: 4.0.3 yaml: 2.9.0 - zod: 4.4.3 + zod: 4.6.6 kysely@0.28.17: {} @@ -8834,7 +8816,7 @@ snapshots: dependencies: '@cspotcode/source-map-support': 0.8.1 sharp: 0.35.5(@types/node@25.6.0) - undici: 7.29.1 + undici: 7.30.1 workerd: 1.20260722.1 ws: 8.21.0 youch: 4.1.0-beta.10 @@ -9540,7 +9522,7 @@ snapshots: jsonc-parser: 3.3.1 nypm: 0.6.9 yaml: 2.9.0 - zod: 4.4.3 + zod: 4.6.6 ultrahtml@1.6.0: {} @@ -9554,9 +9536,9 @@ snapshots: undici-types@7.19.2: {} - undici@7.29.1: {} + undici@7.30.1: {} - undici@8.11.2: {} + undici@8.12.2: {} unenv@2.0.0-rc.24: dependencies: @@ -9576,7 +9558,7 @@ snapshots: dependencies: css-tree: 3.2.1 ohash: 2.0.11 - undici: 8.11.2 + undici: 8.12.2 unist-util-is@6.0.1: dependencies: @@ -9699,7 +9681,7 @@ snapshots: optionalDependencies: vite: 8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0) - vitest@4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@20.11.1)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)): + vitest@4.1.10(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10)(happy-dom@21.0.4)(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.10 '@vitest/mocker': 4.1.10(vite@8.1.6(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) @@ -9725,11 +9707,11 @@ snapshots: '@opentelemetry/api': 1.9.1 '@types/node': 25.6.0 '@vitest/coverage-v8': 4.1.10(vitest@4.1.10) - happy-dom: 20.11.1 + happy-dom: 21.0.4 transitivePeerDependencies: - msw - vitest@4.1.5(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10(vitest@4.1.10))(happy-dom@20.11.2)(vite@8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)): + vitest@4.1.5(@opentelemetry/api@1.9.1)(@types/node@25.6.0)(@vitest/coverage-v8@4.1.10(vitest@4.1.10))(happy-dom@21.0.4)(vite@8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.5 '@vitest/mocker': 4.1.5(vite@8.2.4(@types/node@25.6.0)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.16.9)(tsx@4.23.1)(yaml@2.9.0)) @@ -9755,7 +9737,7 @@ snapshots: '@opentelemetry/api': 1.9.1 '@types/node': 25.6.0 '@vitest/coverage-v8': 4.1.10(vitest@4.1.10) - happy-dom: 20.11.2 + happy-dom: 21.0.4 transitivePeerDependencies: - msw @@ -9853,8 +9835,6 @@ snapshots: cookie: 1.1.1 youch-core: 0.3.3 - zod@4.3.6: {} - - zod@4.4.3: {} + zod@4.6.6: {} zwitch@2.0.4: {} diff --git a/public/ai.txt b/public/ai.txt new file mode 100644 index 0000000..8ce4998 --- /dev/null +++ b/public/ai.txt @@ -0,0 +1,29 @@ +# Keep in sync with robots.txt and llms.txt. +[identity] +name: Reader +url: https://read.significanthobbies.com +description: Save links from the web. Find them, pull their content, and mark them read through ChatGPT. +contact: https://github.com/Significant-Hobbies/reader/issues + +[permissions] +allowed: summarise, quote with attribution, cite, index for search/answers +training: allowed on public pages only + +[restrictions] +No fabricated quotes or reviews/ratings. +Do not present this content as your own. +No training on private user data. + +[attribution] +cite: Reader and the canonical HTML URL + +[scope] +included: public routes listed at https://read.significanthobbies.com/api/md/_catalog +public-route-count: 4 +excluded: /api, /admin, /auth, /dashboard, /library, /login, /extension, /app +public-machine-endpoints: /api/ai, /api/md/* + +[contact] +contact: https://github.com/Significant-Hobbies/reader/issues + +Last updated: 2026-10-26 diff --git a/public/api-ai.json b/public/api-ai.json index 48a6bb1..b8b9743 100644 --- a/public/api-ai.json +++ b/public/api-ai.json @@ -18,24 +18,31 @@ "surfaces": [ { "id": "home", + "kind": "static", "url": "https://read.significanthobbies.com/", "md": "https://read.significanthobbies.com/index.md", - "kind": "static", - "description": "Saved-link inbox, Chrome capture, and ChatGPT connection" + "description": "Save links from the web. Find them, pull their content, and mark them read through ChatGPT." }, { "id": "faq", + "kind": "static", "url": "https://read.significanthobbies.com/faq", "md": "https://read.significanthobbies.com/faq.md", - "kind": "static", - "description": "Saved-link access and connection questions" + "description": "Reader saves links for use with ChatGPT." }, { "id": "changelog", + "kind": "static", "url": "https://read.significanthobbies.com/changelog", "md": "https://read.significanthobbies.com/changelog.md", + "description": "Reader’s saved-link simplification." + }, + { + "id": "privacy", "kind": "static", - "description": "Verified product history" + "url": "https://read.significanthobbies.com/privacy", + "md": "https://read.significanthobbies.com/privacy.md", + "description": "How Reader handles sign-in, saved links, extension keys, ChatGPT access, and analytics." } ], "auth": { diff --git a/public/changelog.md b/public/changelog.md index 2b4210a..8504980 100644 --- a/public/changelog.md +++ b/public/changelog.md @@ -1,7 +1,19 @@ -# Reader changes +# Reader — changes -Reader’s active scope is a saved-link inbox, a Chrome capture extension, and ChatGPT MCP retrieval and read-state updates. The broader research-library workflow is retired from active source. +> Reader’s saved-link simplification. -Existing saved data is preserved. Source implementation, production deployment, and authenticated ChatGPT acceptance are separate verification states. +Canonical: https://read.significanthobbies.com/changelog + +Product direction + +## A smaller Reader. + +The active product is a saved-link inbox, a one-click capture extension, and MCP tools for ChatGPT to retrieve links and update read state. + +Existing saved data remains intact. Deployment and an authenticated ChatGPT connection are verified separately from source changes. [Source history](https://github.com/Significant-Hobbies/reader/commits/main) + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) diff --git a/public/faq.md b/public/faq.md index 809e788..893e418 100644 --- a/public/faq.md +++ b/public/faq.md @@ -1,19 +1,28 @@ -# Reader FAQ +# Reader — questions -## What does Reader do? +> Reader saves links for use with ChatGPT. -It stores links you save and tracks read/unread state. Add a URL in the app or save a tab with the Chrome extension. +Canonical: https://read.significanthobbies.com/faq -## How does ChatGPT use it? +## Just your saved links. -Through an authenticated MCP connection with three tools: search, fetch, and set_read. ChatGPT can pull available text and mark links read when asked. Connecting requires OAuth setup and a deployed endpoint. +### How do I add one? -## What happened to the research-library features? +Paste a URL in the inbox or click Save link in the Chrome extension. -RSS, the built-in reader, PDFs, annotations, boards, memories, and AI chat are outside the active product. Existing saved data is retained. +### How does ChatGPT use it? -## Is the extension in the Chrome store? +Connect Reader through MCP with OAuth. ChatGPT can search links, retrieve available text, and mark links read when you ask. The connection requires a deployed endpoint and OAuth setup. -It is source-built for unpacked use; public distribution is deferred. +### Where are the other features? -[Reader](https://read.significanthobbies.com/) · [Connections](https://read.significanthobbies.com/extension) +RSS, the reader view, annotations, boards, memories, PDFs, and built-in AI are outside the active product. Existing saved data is retained. + +### Where is the extension? + +It is built from this repository and loaded unpacked in Chrome. Public distribution is deferred. + + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) diff --git a/public/index.md b/public/index.md index 7492dab..0c19c2c 100644 --- a/public/index.md +++ b/public/index.md @@ -1,11 +1,116 @@ -# Reader +# Reader — your saved-link inbox -Reader is a saved-link inbox. Paste a URL or save the current tab with the Chrome extension. Connect ChatGPT through MCP to find links, retrieve available source text, and mark them read or unread when you ask. +> Save links from the web. Find them, pull their content, and mark them read through ChatGPT. -The web app has a link list, an add-link action, and Connections. There is no RSS, built-in AI, article reader, annotation, board, memory, or PDF-capture workflow. +Canonical: https://read.significanthobbies.com/ -Google sign-in identifies the account. Links and MCP tool results are private. Fetching a source does not mark it read. A site may block extraction; its original URL remains available. +Your saved-link inbox -The Chrome extension is source-built for unpacked use; public distribution is deferred. There is no public plan or checkout. +## Save a link. *Pick it up in ChatGPT.* -[Open Reader](https://read.significanthobbies.com/library) · [Connections](https://read.significanthobbies.com/extension) · [Privacy](https://read.significanthobbies.com/privacy) +Keep the pages you want to come back to in one place. Add a URL, or save the current tab with the Chrome extension. ChatGPT can find your links, pull their content, and mark them read when you ask. + +[Sign in to your inbox](https://read.significanthobbies.com/login) + +[Connections](https://read.significanthobbies.com/extension) + +Google sign-in · no checkout + +![Reader's inbox with six saved links, read-state controls and an add-link button](https://read.significanthobbies.com/images/inbox.png) + +Illustrative interface · example links, not a customer's inbox + +## A saved tab is *only an intention.* + +How it works + +Reader keeps the list small: what you saved, whether you have read it, and a way back to it. + +### Save it + +Paste a URL in the inbox, or click Save link in the Chrome extension. Reader stores the title, the address and the date. + +### Find it + +Switch between unread, read and all. Search matches titles and addresses. + +### Mark it + +Links stay unread until you say otherwise. Opening or fetching a link never marks it read on its own. + +## Ask about what you saved, *in the conversation you are already in.* + +With ChatGPT + +Reader connects to ChatGPT through MCP with OAuth. Reading and discussion happen there; Reader holds the list. + +### Search + +“What have I saved about databases?” finds matching links in your inbox. + +### Fetch + +Pulls the available text of a link. If a site blocks extraction, the original address is still there. + +### Mark read + +Marks a link read, or unread again, only when you ask. Read and write are separate permissions. + +## Small on purpose, *and private to your account.* + +Boundaries + +Reader is a maintained personal tool. It does one job and does not grow past it. + +### Google sign-in + +Your inbox belongs to your account and is isolated from every other. + +### Chrome extension + +Saves the active tab's address and title. Built from source for a local unpacked install. + +### Not in Reader + +No RSS, annotations, boards, PDF capture or built-in AI. Earlier saves are kept and appear as links. + +### No checkout + +There is no public plan or payment. + +## Before you *save a link.* + + + + + +### How do I add a link? + +Paste a URL in the inbox, or click Save link in the Chrome extension. + +### What does ChatGPT see? + +Only what its tools ask for: a search over your saved titles and addresses, the text of a link you point it at, and the read state of a link you ask it to change. + +### Where did the other features go? + +RSS, the reader view, annotations, boards, memories, PDFs and built-in AI are outside the active product. Existing saved data is retained. + +### Can I install the Chrome extension? + +It is built from the repository and loaded unpacked in Chrome. Public store distribution is deferred. + +## Bring one link you mean *to come back to.* + + + +Sign in with Google, paste the address, and it is waiting in your inbox. + +[Sign in to your inbox](https://read.significanthobbies.com/login) + +[How it connects](https://read.significanthobbies.com/faq) + + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) diff --git a/public/llms-full.txt b/public/llms-full.txt index c7e0832..306d3f7 100644 --- a/public/llms-full.txt +++ b/public/llms-full.txt @@ -1,15 +1,208 @@ -# Reader +# Reader - full content -> A saved-link inbox for use with ChatGPT. +> Save links from the web. Find them, pull their content, and mark them read through ChatGPT. -Save URLs in the web app or Chrome extension. Authenticated MCP tools search links, retrieve available text, and set read/unread state. Private links are never exposed through the public catalog. +Source updated: 2026-10-26 -- [Product](https://read.significanthobbies.com/index.md) -- [FAQ](https://read.significanthobbies.com/faq.md) -- [Agent guidance](https://read.significanthobbies.com/agents.md) -- [Access](https://read.significanthobbies.com/pricing.md) -- [Full brief](https://read.significanthobbies.com/llms-full.txt) -- [Catalog](https://read.significanthobbies.com/api/ai) -- [Sitemap](https://read.significanthobbies.com/sitemap.xml) +--- + +# Reader — your saved-link inbox -The product is maintained for personal saved-link use. No RSS, article reader, boards, annotations, PDFs, memories, or built-in AI. MCP setup and live acceptance are separate from source readiness. +> Save links from the web. Find them, pull their content, and mark them read through ChatGPT. + +Canonical: https://read.significanthobbies.com/ + +Your saved-link inbox + +## Save a link. *Pick it up in ChatGPT.* + +Keep the pages you want to come back to in one place. Add a URL, or save the current tab with the Chrome extension. ChatGPT can find your links, pull their content, and mark them read when you ask. + +[Sign in to your inbox](https://read.significanthobbies.com/login) + +[Connections](https://read.significanthobbies.com/extension) + +Google sign-in · no checkout + +![Reader's inbox with six saved links, read-state controls and an add-link button](https://read.significanthobbies.com/images/inbox.png) + +Illustrative interface · example links, not a customer's inbox + +## A saved tab is *only an intention.* + +How it works + +Reader keeps the list small: what you saved, whether you have read it, and a way back to it. + +### Save it + +Paste a URL in the inbox, or click Save link in the Chrome extension. Reader stores the title, the address and the date. + +### Find it + +Switch between unread, read and all. Search matches titles and addresses. + +### Mark it + +Links stay unread until you say otherwise. Opening or fetching a link never marks it read on its own. + +## Ask about what you saved, *in the conversation you are already in.* + +With ChatGPT + +Reader connects to ChatGPT through MCP with OAuth. Reading and discussion happen there; Reader holds the list. + +### Search + +“What have I saved about databases?” finds matching links in your inbox. + +### Fetch + +Pulls the available text of a link. If a site blocks extraction, the original address is still there. + +### Mark read + +Marks a link read, or unread again, only when you ask. Read and write are separate permissions. + +## Small on purpose, *and private to your account.* + +Boundaries + +Reader is a maintained personal tool. It does one job and does not grow past it. + +### Google sign-in + +Your inbox belongs to your account and is isolated from every other. + +### Chrome extension + +Saves the active tab's address and title. Built from source for a local unpacked install. + +### Not in Reader + +No RSS, annotations, boards, PDF capture or built-in AI. Earlier saves are kept and appear as links. + +### No checkout + +There is no public plan or payment. + +## Before you *save a link.* + + + + + +### How do I add a link? + +Paste a URL in the inbox, or click Save link in the Chrome extension. + +### What does ChatGPT see? + +Only what its tools ask for: a search over your saved titles and addresses, the text of a link you point it at, and the read state of a link you ask it to change. + +### Where did the other features go? + +RSS, the reader view, annotations, boards, memories, PDFs and built-in AI are outside the active product. Existing saved data is retained. + +### Can I install the Chrome extension? + +It is built from the repository and loaded unpacked in Chrome. Public store distribution is deferred. + +## Bring one link you mean *to come back to.* + + + +Sign in with Google, paste the address, and it is waiting in your inbox. + +[Sign in to your inbox](https://read.significanthobbies.com/login) + +[How it connects](https://read.significanthobbies.com/faq) + + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) + + +--- + +# Reader — questions + +> Reader saves links for use with ChatGPT. + +Canonical: https://read.significanthobbies.com/faq + +## Just your saved links. + +### How do I add one? + +Paste a URL in the inbox or click Save link in the Chrome extension. + +### How does ChatGPT use it? + +Connect Reader through MCP with OAuth. ChatGPT can search links, retrieve available text, and mark links read when you ask. The connection requires a deployed endpoint and OAuth setup. + +### Where are the other features? + +RSS, the reader view, annotations, boards, memories, PDFs, and built-in AI are outside the active product. Existing saved data is retained. + +### Where is the extension? + +It is built from this repository and loaded unpacked in Chrome. Public distribution is deferred. + + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) + + +--- + +# Reader — changes + +> Reader’s saved-link simplification. + +Canonical: https://read.significanthobbies.com/changelog + +Product direction + +## A smaller Reader. + +The active product is a saved-link inbox, a one-click capture extension, and MCP tools for ChatGPT to retrieve links and update read state. + +Existing saved data remains intact. Deployment and an authenticated ChatGPT connection are verified separately from source changes. + +[Source history](https://github.com/Significant-Hobbies/reader/commits/main) + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) + + +--- + +# Privacy + +> How Reader handles sign-in, saved links, extension keys, ChatGPT access, and analytics. + +Canonical: https://read.significanthobbies.com/privacy + +Reader stores your Google sign-in identity and the links you save, including their titles and read states. Older saved material remains stored in your account. + +The extension sends the current page’s URL and title only when you click Save link. Its connection key stays in Chrome’s local extension storage. Reader stores a hash of that key. + +When you connect ChatGPT through MCP, it can retrieve your links and available source text, and update read states when you ask. Reader may fetch a saved URL to extract text. OpenAI’s privacy terms apply to information shared with ChatGPT. + +Reader uses analytics and error monitoring to understand usage and failures. We do not sell your saved links. + +Contact the maintainer to request removal of your account data. + + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) + + +Included 4 of 4 registered public pages (limit 50 pages / 500000 characters). + +Full catalog: https://read.significanthobbies.com/api/md/_catalog diff --git a/public/llms.txt b/public/llms.txt index 9944bb5..273878f 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -1,13 +1,24 @@ # Reader -> A saved-link inbox for use with ChatGPT. +> Save links from the web. Find them, pull their content, and mark them read through ChatGPT. -Save URLs in the web app or Chrome extension. Authenticated MCP tools search links, retrieve available text, and set read/unread state. Private links are never exposed through the public catalog. +Personal libraries, account records, API keys, and MCP responses are private. +Existing public guides: [Agent instructions](https://read.significanthobbies.com/agents.md) and [Access and pricing](https://read.significanthobbies.com/pricing.md). -- [Product](https://read.significanthobbies.com/index.md) -- [FAQ](https://read.significanthobbies.com/faq.md) -- [Agent guidance](https://read.significanthobbies.com/agents.md) -- [Access](https://read.significanthobbies.com/pricing.md) -- [Full brief](https://read.significanthobbies.com/llms-full.txt) -- [Catalog](https://read.significanthobbies.com/api/ai) -- [Sitemap](https://read.significanthobbies.com/sitemap.xml) + + +## Public pages + +- [Reader — your saved-link inbox](https://read.significanthobbies.com/index.md): Save links from the web. Find them, pull their content, and mark them read through ChatGPT. +- [Reader — questions](https://read.significanthobbies.com/faq.md): Reader saves links for use with ChatGPT. +- [Reader — changes](https://read.significanthobbies.com/changelog.md): Reader’s saved-link simplification. +- [Privacy](https://read.significanthobbies.com/privacy.md): How Reader handles sign-in, saved links, extension keys, ChatGPT access, and analytics. + +## Machine-readable + +- [Full content](https://read.significanthobbies.com/llms-full.txt): Bounded public page content +- [Markdown catalog](https://read.significanthobbies.com/api/md/_catalog): All registered public routes +- [Agent catalog](https://read.significanthobbies.com/api/ai): Existing discovery contract +- [AI usage policy](https://read.significanthobbies.com/ai.txt): Permissions and attribution +- [Sitemap](https://read.significanthobbies.com/sitemap.xml): Canonical HTML pages +- [OpenAPI](https://read.significanthobbies.com/openapi.json): Public API contract diff --git a/public/login.md b/public/login.md deleted file mode 100644 index edecaa8..0000000 --- a/public/login.md +++ /dev/null @@ -1,5 +0,0 @@ -# Sign in to Reader - -Sign in with Google to save links in your account inbox. The Chrome extension uses a revocable Reader key; ChatGPT uses a separate OAuth connection tied to the same Google identity. - -[Sign in](https://read.significanthobbies.com/login) · [Connections](https://read.significanthobbies.com/extension) diff --git a/public/privacy.md b/public/privacy.md new file mode 100644 index 0000000..b7c1a02 --- /dev/null +++ b/public/privacy.md @@ -0,0 +1,20 @@ +# Privacy + +> How Reader handles sign-in, saved links, extension keys, ChatGPT access, and analytics. + +Canonical: https://read.significanthobbies.com/privacy + +Reader stores your Google sign-in identity and the links you save, including their titles and read states. Older saved material remains stored in your account. + +The extension sends the current page’s URL and title only when you click Save link. Its connection key stays in Chrome’s local extension storage. Reader stores a hash of that key. + +When you connect ChatGPT through MCP, it can retrieve your links and available source text, and update read states when you ask. Reader may fetch a saved URL to extract text. OpenAI’s privacy terms apply to information shared with ChatGPT. + +Reader uses analytics and error monitoring to understand usage and failures. We do not sell your saved links. + +Contact the maintainer to request removal of your account data. + + +## Related + +[Reader](https://read.significanthobbies.com/) · [Questions](https://read.significanthobbies.com/faq) · [Changes](https://read.significanthobbies.com/changelog) · [Privacy](https://read.significanthobbies.com/privacy) diff --git a/public/robots.txt b/public/robots.txt index 2723219..3389509 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,23 +1,419 @@ +# Keep in sync with /llms.txt and /ai.txt. + User-agent: * Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md -Sitemap: https://read.significanthobbies.com/sitemap.xml -# Agent indexing +User-agent: OAI-SearchBot +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ Allow: /llms.txt +Allow: /llms-full.txt Allow: /index.md -Allow: /api/ai + +User-agent: ChatGPT-User +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt Allow: /llms-full.txt -Allow: /agents.md -Allow: /pricing.md -Allow: /skill.md -Allow: /.well-known/ai-catalog.json -Allow: /.well-known/agent-skills/ +Allow: /index.md + +User-agent: Claude-SearchBot +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md + +User-agent: Claude-User +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md + +User-agent: PerplexityBot +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md + +User-agent: Perplexity-User +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md User-agent: GPTBot Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md User-agent: ClaudeBot Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md User-agent: Google-Extended Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md + +User-agent: Applebot-Extended +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md + +User-agent: CCBot +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md + +User-agent: Bytespider +Allow: / +Disallow: /api$ +Disallow: /api/ +Disallow: /api? +Disallow: /admin$ +Disallow: /admin/ +Disallow: /admin? +Disallow: /auth$ +Disallow: /auth/ +Disallow: /auth? +Disallow: /dashboard$ +Disallow: /dashboard/ +Disallow: /dashboard? +Disallow: /library$ +Disallow: /library/ +Disallow: /library? +Disallow: /login$ +Disallow: /login/ +Disallow: /login? +Disallow: /extension$ +Disallow: /extension/ +Disallow: /extension? +Disallow: /app$ +Disallow: /app/ +Disallow: /app? +Allow: /api/ai$ +Allow: /api/md/ +Allow: /llms.txt +Allow: /llms-full.txt +Allow: /index.md + +Sitemap: https://read.significanthobbies.com/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml index d40ae2d..dc2c701 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -1,6 +1,2 @@ - - https://read.significanthobbies.com/2026-08-28 - https://read.significanthobbies.com/faq2026-08-28 - https://read.significanthobbies.com/changelog2026-08-28 - +https://read.significanthobbies.com/https://read.significanthobbies.com/faqhttps://read.significanthobbies.com/changeloghttps://read.significanthobbies.com/privacy diff --git a/scripts/check-code-health.mjs b/scripts/check-code-health.mjs index 16d300c..e24f153 100644 --- a/scripts/check-code-health.mjs +++ b/scripts/check-code-health.mjs @@ -137,6 +137,9 @@ function checkComplexity() { 'scripts/check-code-health.mjs', '-x', '**/*.d.ts', + // Shared vendored helpers are independently qualified upstream. + '-x', + 'src/agent-surfaces/**', '--csv', ]); const rows = result.stdout @@ -174,7 +177,7 @@ function checkDuplication() { '--mode', 'strict', '--ignore', - '**/*.test.*,**/__tests__/**,**/*.d.ts,**/node_modules/**,**/dist/**,**/coverage/**,src/agent-edge.mjs,scripts/check-code-health.mjs', + '**/*.test.*,**/__tests__/**,**/*.d.ts,**/node_modules/**,**/dist/**,**/coverage/**,src/agent-edge.mjs,src/agent-surfaces/**,scripts/check-code-health.mjs', '--reporters', 'json', '--output', diff --git a/scripts/check-public-markdown.mjs b/scripts/check-public-markdown.mjs new file mode 100644 index 0000000..f8df3e8 --- /dev/null +++ b/scripts/check-public-markdown.mjs @@ -0,0 +1,55 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readdir, readFile } from 'node:fs/promises'; +import { resolve } from 'node:path'; +import { publicRoutes, publicPages } from '../src/public-site.mjs'; + +test('public Reader build covers the source registry', async () => { + const root = resolve(import.meta.dirname, '..'); + const registered = new Set(publicRoutes.map((route) => route.path)); + const emitted = new Set(); + for (const entry of await readdir(resolve(root, 'landing-astro/dist'), { recursive: true })) { + if (!entry.endsWith('.html')) continue; + const html = await readFile(resolve(root, 'landing-astro/dist', entry), 'utf8'); + const path = + `/${entry.replace(/(?:^|\/)index\.html$/, '').replace(/\.html$/, '')}`.replace(/\/$/, '') || + '/'; + if (/name="robots"[^>]*content="[^"]*noindex/.test(html)) { + assert.ok(!registered.has(path), `Noindex page registered: ${path}`); + continue; + } + assert.ok(registered.has(path), `Public HTML missing Markdown renderer: ${path}`); + assert.ok(html.includes('name="ai-summary"'), `Missing AI summary: ${path}`); + assert.ok(html.includes('type="text/markdown"'), `Missing Markdown alternate: ${path}`); + emitted.add(path); + } + // /privacy is the existing public React view. Its server head is supplied by the + // Worker, and its copy is shared with the renderer; account SPA views are excluded. + assert.ok( + (await readFile(resolve(root, 'src/pages/PrivacyPage.tsx'), 'utf8')).includes( + 'copy.privacy.paragraphs' + ) + ); + emitted.add('/privacy'); + assert.deepEqual( + [...emitted].sort((a, b) => a.localeCompare(b)), + [...registered].sort((a, b) => a.localeCompare(b)) + ); + for (const route of publicRoutes) { + const markdown = await readFile( + resolve(root, 'dist', new URL(route.md).pathname.slice(1)), + 'utf8' + ); + assert.equal(markdown, publicPages[route.path]); + assert.ok(markdown.includes(`Canonical: ${route.url}`)); + } + const sitemap = await readFile(resolve(root, 'dist/sitemap.xml'), 'utf8'); + assert.deepEqual( + [...sitemap.matchAll(/([^<]+)<\/loc>/g)] + .map((item) => item[1]) + .sort((a, b) => a.localeCompare(b)), + publicRoutes.map((route) => route.url).sort((a, b) => a.localeCompare(b)) + ); + assert.ok((await readFile(resolve(root, 'dist/llms-full.txt'), 'utf8')).length < 500000); + console.log(`Verified ${registered.size} public Reader pages; account SPA views excluded.`); +}); diff --git a/scripts/generate-public-markdown.mjs b/scripts/generate-public-markdown.mjs new file mode 100644 index 0000000..2c099ff --- /dev/null +++ b/scripts/generate-public-markdown.mjs @@ -0,0 +1,43 @@ +import { readFile, writeFile } from 'node:fs/promises'; +import { resolve } from 'node:path'; +import { + publicRoutes, + publicPages, + publicManifest, + publicRobots, + publicSitemap, +} from '../src/public-site.mjs'; +import { + buildAiTxt, + buildFullMarkdown, + buildMarkdownIndex, +} from '../src/agent-surfaces/documents.mjs'; + +const output = resolve(import.meta.dirname, '../public'); +for (const route of publicRoutes) { + await writeFile(resolve(output, new URL(route.md).pathname.slice(1)), publicPages[route.path]); +} +await writeFile(resolve(output, 'llms.txt'), buildMarkdownIndex(publicManifest, publicRoutes)); +await writeFile( + resolve(output, 'llms-full.txt'), + (await buildFullMarkdown(publicManifest, publicRoutes, (path) => publicPages[path])).replace( + /^Generated: \d{4}-\d{2}-\d{2}$/m, + `Source updated: ${publicManifest.updatedAt}` + ) +); +await writeFile(resolve(output, 'ai.txt'), buildAiTxt(publicManifest, publicRoutes)); +await writeFile(resolve(output, 'robots.txt'), publicRobots); +await writeFile(resolve(output, 'sitemap.xml'), publicSitemap); +const catalogPath = resolve(output, 'api-ai.json'); +const catalog = JSON.parse(await readFile(catalogPath, 'utf8')); +catalog.surfaces = publicRoutes.map((route) => ({ + id: route.path === '/' ? 'home' : route.path.slice(1), + kind: 'static', + url: route.url, + md: route.md, + description: route.description, +})); +await writeFile(catalogPath, `${JSON.stringify(catalog, null, 2)}\n`); +console.log( + `Generated ${publicRoutes.length} public Reader Markdown pages and discovery documents.` +); diff --git a/src/agent-edge.mjs b/src/agent-edge.mjs index 9e5e68f..ed5d3df 100644 --- a/src/agent-edge.mjs +++ b/src/agent-edge.mjs @@ -1,3 +1,4 @@ +import { handlePublicDocument } from './public-site.mjs'; import staticCatalog from '../public/api-ai.json' with { type: 'json' }; const PRODUCT_ORIGIN = 'https://read.significanthobbies.com'; @@ -8,13 +9,6 @@ export const AGENT_SURFACE = { catalog: staticCatalog, }; -const ROUTE_MARKDOWN = new Map([ - ['/', '/index.md'], - ['/faq', '/faq.md'], - ['/changelog', '/changelog.md'], - ['/login', '/login.md'], -]); - const OPENAPI_SPEC = { openapi: '3.1.0', info: { @@ -126,6 +120,10 @@ function discoveryOperation(operationId, summary, contentType) { * @returns {Promise} */ export async function handleAgentEdge(request, env) { + if (new URL(request.url).pathname !== '/api/ai') { + const document = await handlePublicDocument(request); + if (document) return document; + } if (request.method !== 'GET' && request.method !== 'HEAD') return null; const url = new URL(request.url); @@ -157,19 +155,6 @@ export async function handleAgentEdge(request, env) { return jsonError(path, request.method); } - const markdownPath = ROUTE_MARKDOWN.get(path); - if (markdownPath && (wantsMarkdown(request) || url.searchParams.get('mode') === 'agent')) { - return serveAsset(env, request, markdownPath, { - 'Content-Type': 'text/markdown; charset=utf-8', - Link: `<${markdownPath}>; rel="alternate"; type="text/markdown"`, - Vary: 'Accept', - }); - } - - if (wantsMarkdown(request) && !path.includes('.') && !path.startsWith('/api/')) { - return markdown404(path, request.method, origin); - } - return null; } @@ -207,27 +192,6 @@ function isTrustedPreviewHost(hostWithPort) { ); } -function wantsMarkdown(request) { - const accept = (request.headers.get('accept') || '').toLowerCase(); - if (!accept.includes('text/markdown')) return isAgentUserAgent(request); - if (!accept.includes('text/html')) return true; - return accept.indexOf('text/markdown') < accept.indexOf('text/html'); -} - -function isAgentUserAgent(request) { - const userAgent = (request.headers.get('user-agent') || '').toLowerCase(); - return [ - 'gptbot', - 'chatgpt-user', - 'claudebot', - 'perplexitybot', - 'google-extended', - 'applebot-extended', - 'ora-agent', - 'deepseekbot', - ].some((agent) => userAgent.includes(agent)); -} - async function serveAsset(env, request, pathname, extraHeaders = {}) { const target = new URL(pathname, request.url); const asset = await env.ASSETS.fetch( @@ -289,31 +253,6 @@ function rebindUrls(value, origin) { return value; } -function markdown404(path, method, origin) { - const body = `# 404 — Not Found - -\`${path}\` is not a public Reader route. - -## Where to look next - -- [Reader product truth](${origin}/index.md) -- [Agent index](${origin}/llms.txt) -- [Agent catalog](${origin}/api/ai) -- [Sitemap](${origin}/sitemap.xml) -- [OpenAPI](${origin}/openapi.json) -`; - - return new Response(method === 'HEAD' ? null : body, { - status: 404, - headers: { - 'Content-Type': 'text/markdown; charset=utf-8', - 'Cache-Control': 'no-store', - 'X-Content-Type-Options': 'nosniff', - Vary: 'Accept', - }, - }); -} - function jsonError(path, method) { return new Response(method === 'HEAD' ? null : JSON.stringify({ error: 'not_found', path }), { status: 404, diff --git a/src/agent-surfaces.test.ts b/src/agent-surfaces.test.ts index 3e6c37a..f0be0f1 100644 --- a/src/agent-surfaces.test.ts +++ b/src/agent-surfaces.test.ts @@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs'; import { resolve } from 'node:path'; import { describe, expect, it } from 'vitest'; import { AGENT_SURFACE, handleAgentEdge } from './agent-edge.mjs'; +import { privacyHtmlDocument } from './public-site.mjs'; const readPublic = (path: string) => readFileSync(resolve(process.cwd(), 'public', path), 'utf8'); const readRepo = (path: string) => readFileSync(resolve(process.cwd(), path), 'utf8'); @@ -39,7 +40,7 @@ describe('public agent surface parity', () => { const urls = sitemapUrls(); expect(urls).toEqual(catalogUrls); - expect(urls).toHaveLength(3); + expect(urls).toHaveLength(4); expect(urls).not.toContain('https://read.significanthobbies.com/login'); for (const url of urls) { const path = new URL(url).pathname; @@ -108,7 +109,7 @@ describe('public agent surface parity', () => { expect(document).toContain('distribution is deferred'); } expect(home).toContain('saved-link'); - expect(home).toContain('no public plan or checkout'); + expect(home).toContain('no public plan or payment'); expect(pricing).toContain('no public plan, checkout, paid tier, or purchase flow'); }); @@ -145,7 +146,7 @@ describe('public agent surface parity', () => { ); expect(markdown?.status).toBe(200); expect(markdown?.headers.get('vary')).toBe('Accept'); - expect(await markdown?.text()).toContain('# Reader FAQ'); + expect(await markdown?.text()).toContain('# Reader — questions'); const botMarkdown = await handleAgentEdge( new Request('https://reader-preview.example/', { @@ -153,9 +154,7 @@ describe('public agent surface parity', () => { }), env ); - expect(botMarkdown?.status).toBe(200); - expect(botMarkdown?.headers.get('content-type')).toContain('text/markdown'); - expect(await botMarkdown?.text()).toContain('# Reader'); + expect(botMarkdown).toBeNull(); const catalog = await handleAgentEdge( new Request('https://reader-preview.example/api/ai'), @@ -195,6 +194,11 @@ describe('public agent surface parity', () => { for (const url of urls) { const pathname = new URL(url).pathname; + if (pathname === '/privacy') { + const html = privacyHtmlDocument(''); + expect(html).toContain(``); + continue; + } const sourcePath = landingSourceForPath(pathname); const source = readRepo(sourcePath); diff --git a/src/agent-surfaces/adapters/static-assets.mjs b/src/agent-surfaces/adapters/static-assets.mjs new file mode 100644 index 0000000..b3b730b --- /dev/null +++ b/src/agent-surfaces/adapters/static-assets.mjs @@ -0,0 +1,96 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +import { createAgentSurfaceManifest } from '../manifest.mjs'; +import { createAgentSurfaceHandler, discoveryLinkHeader } from '../handler.mjs'; +import { wantsMarkdown } from '../http.mjs'; + +// Workers Assets can omit MIME for extensionless JSON. Parsing and the +// manifest/registry shape checks remain mandatory; HTML never qualifies. +function metadataType(response) { + const type = response.headers.get('content-type'); + return !type || /^(?:application\/(?:json|octet-stream)|text\/plain)(?:;|$)/i.test(type); +} + +/** + * Serve only build-registered public Markdown assets, never the HTML fallback. + * @param {{ origin?: string, catalogPath?: string, identity?: object, preserveMarkdownPaths?: string[], publicReservedPaths?: string[], loadMarkdown?: (path: string, request: Request, route: any) => Promise | string | null | undefined }} options + */ +export function createStaticAssetHandler({ origin, catalogPath = '/api/md/_catalog', identity, preserveMarkdownPaths = [], publicReservedPaths = [], loadMarkdown }) { + const handlers = new WeakMap(); + return async function handle(request, assets) { + if (!assets?.fetch) return null; + const pathname = new URL(request.url).pathname; + if (!['GET', 'HEAD', 'OPTIONS'].includes(request.method)) return null; + const direct = pathname === '/api/md' || pathname.startsWith('/api/md/'); + const discovery = ['/llms.txt', '/llms-full.txt', '/ai.txt'].includes(pathname); + if (!direct && !discovery) { + if (preserveMarkdownPaths.includes(pathname) || ['/auth.md', '/skill.md', '/SKILL.md', '/agents.md', '/AGENTS.md'].includes(pathname)) return null; + if (/^\/(?:api|admin|auth|dashboard|_next|_astro|\.well-known)(?:\/|$)/.test(pathname) && !publicReservedPaths.includes(pathname)) return null; + // Public entity slugs can contain dots (for example /launchdesk/example.io). + if (/\.(?:css|m?js|map|json|xml|txt|png|jpe?g|gif|svg|webp|avif|ico|woff2?|ttf|otf|mp[34]|webm|pdf|zip|wasm)$/i.test(pathname)) return null; + } + if (!pathname.endsWith('.md') && !pathname.startsWith('/api/md') && !['/llms.txt', '/llms-full.txt', '/ai.txt'].includes(pathname) && !wantsMarkdown(request)) return null; + let handler = handlers.get(assets); + if (!handler) { + handler = (async () => { + const assetOrigin = origin || new URL(request.url).origin; + let config = identity; + if (!config) { + const response = await assets.fetch(new Request(new URL('/api/md/_identity', assetOrigin))); + if (!response.ok || !metadataType(response)) throw new Error('Public identity unavailable'); + config = await response.json(); + } + const canonicalOrigin = config.url || origin; + return createAgentSurfaceHandler({ + preserveMarkdownPaths, + publicReservedPaths, + manifest: createAgentSurfaceManifest({ ...config, url: canonicalOrigin, pages: {} }), + async listMarkdownRoutes() { + const response = await assets.fetch(new Request(new URL(catalogPath, assetOrigin))); + if (!response.ok || !metadataType(response)) throw new Error('Public Markdown catalog unavailable'); + const catalog = await response.json(); + if (!Array.isArray(catalog)) throw new TypeError('Invalid public Markdown catalog'); + return catalog; + }, + async loadMarkdown(path, publicRequest, route) { + const rendered = await loadMarkdown?.(path, publicRequest, route); + if (rendered !== undefined) { + if (rendered !== null && typeof rendered !== 'string') throw new TypeError('Public renderer must return Markdown text or null'); + return rendered; + } + const md = route?.assetPath || (path === '/' ? '/index.md' : `${path.replace(/\/$/, '')}.md`); + if (!md.startsWith('/') || md.startsWith('//') || new URL(md, assetOrigin).origin !== new URL(assetOrigin).origin) throw new Error('Invalid public asset path'); + const response = await assets.fetch(new Request(new URL(md, assetOrigin))); + if (response.status === 404) return null; + if (!response.ok || !response.headers.get('content-type')?.includes('text/markdown')) throw new Error('Public Markdown asset unavailable'); + const body = await response.text(); + if (/^\s*<(?:!doctype|html)/i.test(body)) throw new Error('HTML fallback is not Markdown'); + return body; + }, + }); + })().catch((error) => { handlers.delete(assets); throw error; }); + handlers.set(assets, handler); + } + try { + return await (await handler)(request); + } catch { + return new Response(request.method === 'HEAD' ? null : '# Markdown temporarily unavailable\n', { + status: 503, headers: { + 'Content-Type': 'text/markdown; charset=utf-8', 'Cache-Control': 'no-store', + 'CDN-Cache-Control': 'no-store', 'Cloudflare-CDN-Cache-Control': 'no-store', + 'Vary': 'Accept', 'X-Robots-Tag': 'noindex, follow', + 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', + }, + }); + } + }; +} + +export function advertiseMarkdown(response, origin, mdPath) { + const headers = new Headers(response.headers); + headers.append('Link', discoveryLinkHeader(origin)); + if (mdPath) headers.append('Link', `<${new URL(mdPath, origin).href}>; rel="alternate"; type="text/markdown"`); + const vary = new Set((headers.get('Vary') || '').split(',').map((value) => value.trim()).filter(Boolean)); + vary.add('Accept'); + headers.set('Vary', [...vary].join(', ')); + return new Response(response.body, { status: response.status, statusText: response.statusText, headers }); +} diff --git a/src/agent-surfaces/catalog.mjs b/src/agent-surfaces/catalog.mjs new file mode 100644 index 0000000..6692adc --- /dev/null +++ b/src/agent-surfaces/catalog.mjs @@ -0,0 +1,97 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +/** + * @typedef {{ + * id: string, + * url: string, + * md?: string | null, + * kind: 'static' | 'collection' | 'dynamic' | 'api' | 'feed' | 'spa', + * description?: string, + * }} AgentSurface + * + * @typedef {{ + * name: string, + * version?: string, + * url: string, + * llms?: string, + * llmsFull?: string | null, + * sitemap?: string | null, + * markdown?: { suffix?: string, negotiation?: boolean }, + * surfaces: AgentSurface[], + * auth?: { public?: boolean, notes?: string }, + * }} ApiAiCatalog + */ + +function mapSurface(origin, s) { + return { + id: s.id, + url: absolutize(origin, s.url), + md: s.md == null ? null : absolutize(origin, s.md), + kind: s.kind, + ...(s.description ? { description: s.description } : {}), + }; +} + +/** + * @param {ApiAiCatalog} input + * @returns {ApiAiCatalog} + */ +export function buildApiAiCatalog(input) { + if (!input?.name) throw new TypeError('buildApiAiCatalog: name required'); + if (!input?.url) throw new TypeError('buildApiAiCatalog: url required'); + if (!Array.isArray(input.surfaces)) { + throw new TypeError('buildApiAiCatalog: surfaces[] required'); + } + + const origin = input.url.replace(/\/$/, ''); + const catalog = { + name: input.name, + version: input.version || '1', + url: origin, + llms: input.llms || `${origin}/llms.txt`, + llmsFull: input.llmsFull === undefined ? null : input.llmsFull, + sitemap: input.sitemap === undefined ? `${origin}/sitemap.xml` : input.sitemap, + markdown: { + suffix: input.markdown?.suffix ?? '.md', + negotiation: input.markdown?.negotiation ?? true, + }, + surfaces: input.surfaces.map((s) => mapSurface(origin, s)), + auth: { + public: input.auth?.public ?? true, + notes: input.auth?.notes ?? '', + }, + }; + + assertApiAiCatalog(catalog); + return catalog; +} + +/** + * Lightweight runtime validation for audits and tests. + * @param {unknown} catalog + */ +function assertApiAiCatalog(catalog) { + if (!catalog || typeof catalog !== 'object') { + throw new TypeError('catalog must be an object'); + } + const c = /** @type {Record} */ (catalog); + for (const key of ['name', 'version', 'url', 'llms', 'markdown', 'surfaces']) { + if (c[key] == null) throw new TypeError(`catalog missing ${key}`); + } + if (!Array.isArray(c.surfaces)) throw new TypeError('surfaces must be an array'); + const md = /** @type {Record} */ (c.markdown); + if (typeof md.suffix !== 'string' || typeof md.negotiation !== 'boolean') { + throw new TypeError('markdown.suffix and markdown.negotiation required'); + } + return true; +} + +/** + * @param {string} origin + * @param {string} pathOrUrl + */ +function absolutize(origin, pathOrUrl) { + if (!pathOrUrl) return pathOrUrl; + if (pathOrUrl.startsWith('http://') || pathOrUrl.startsWith('https://')) return pathOrUrl; + const path = pathOrUrl.startsWith('/') ? pathOrUrl : `/${pathOrUrl}`; + return `${origin}${path}`; +} diff --git a/src/agent-surfaces/documents.mjs b/src/agent-surfaces/documents.mjs new file mode 100644 index 0000000..fb78b89 --- /dev/null +++ b/src/agent-surfaces/documents.mjs @@ -0,0 +1,83 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +import { htmlPathFromMarkdown, markdownPathFor } from './http.mjs'; + +/** Registry entries are explicitly public. Never populate them from user state. */ +export function listMarkdownRoutes(manifest) { + const paths = new Map(); + for (const [key, body] of Object.entries(manifest.pages)) { + const path = key.endsWith('.md') ? htmlPathFromMarkdown(key) : key; + if (paths.has(path)) continue; + const surface = manifest.catalog.surfaces.find((item) => new URL(item.url).pathname === path); + paths.set(path, { + path, + url: new URL(path, manifest.origin).href, + md: new URL(markdownPathFor(path), manifest.origin).href, + title: body.match(/^#\s+(.+)$/m)?.[1] || surface?.id || path, + description: surface?.description || body.match(/^>\s+(.+)$/m)?.[1] || '', + }); + } + return [...paths.values()]; +} + +export function buildMarkdownIndex(manifest, routes) { + const lines = [`# ${manifest.name}`, '', `> ${manifest.summary}`, '', + ...(manifest.notes || []), '', + '', '', '## Public pages', '']; + for (const route of routes.slice(0, 50)) { + lines.push(`- [${escapeLabel(route.title)}](${route.md}): ${route.description || route.title}`); + } + if (routes.length > 50) lines.push('', `Showing 50 of ${routes.length} pages; the catalog lists all public routes.`); + lines.push('', '## Machine-readable', '', + `- [Full content](${manifest.origin}/llms-full.txt): Bounded public page content`, + `- [Markdown catalog](${manifest.origin}/api/md/_catalog): All registered public routes`, + `- [Agent catalog](${manifest.origin}/api/ai): Existing discovery contract`, + `- [AI usage policy](${manifest.origin}/ai.txt): Permissions and attribution`); + if (manifest.catalog.sitemap) lines.push(`- [Sitemap](${manifest.catalog.sitemap}): Canonical HTML pages`); + if (manifest.openapi) lines.push(`- [OpenAPI](${manifest.openapi}): Public API contract`); + return `${lines.join('\n')}\n`; +} + +export function buildAiTxt(manifest, routes) { + const contact = manifest.contact; + return [ + '# Keep in sync with robots.txt and llms.txt.', + '[identity]', `name: ${manifest.name}`, `url: ${manifest.origin}`, `description: ${manifest.summary}`, + ...(contact ? [`contact: ${contact}`] : []), '', + '[permissions]', 'allowed: summarise, quote with attribution, cite, index for search/answers', + ...(manifest.trainingAllowed ? ['training: allowed on public pages only'] : []), '', + '[restrictions]', 'No fabricated quotes or reviews/ratings.', + 'Do not present this content as your own.', 'No training on private user data.', '', + '[attribution]', `cite: ${manifest.name} and the canonical HTML URL`, '', + '[scope]', `included: public routes listed at ${manifest.origin}/api/md/_catalog`, + `public-route-count: ${routes.length}`, + `excluded: ${(manifest.excludedPaths || ['/admin', '/api', '/dashboard', '/auth']).join(', ')}`, + 'public-machine-endpoints: /api/ai, /api/md/*', '', + ...(contact ? ['[contact]', `contact: ${contact}`, ''] : []), + ...(manifest.updatedAt ? [`Last updated: ${manifest.updatedAt}`, ''] : []), + ].join('\n'); +} + +export async function buildFullMarkdown(manifest, routes, render, { maxChars = 500000, maxPages = 50 } = {}) { + const header = `# ${manifest.name} - full content\n\n> ${manifest.summary}\n\nGenerated: ${new Date().toISOString().slice(0, 10)}\n\n`; + const footer = `\nFull catalog: ${manifest.origin}/api/md/_catalog\n`; + let body = header; + let included = 0; + for (const route of routes) { + if (route.full === false) continue; + if (included >= maxPages) break; + const markdown = await render(route.path); + if (markdown == null) continue; + const section = `---\n\n${markdown}\n\n`; + if (body.length + section.length + footer.length + 150 > maxChars) { + console.warn(`Full Markdown export reached its ${maxChars}-character limit after ${included} pages.`); + break; + } + body += section; + included++; + } + return `${body}Included ${included} of ${routes.length} registered public pages (limit ${maxPages} pages / ${maxChars} characters).\n${footer}`; +} + +function escapeLabel(value) { + return value.replace(/[\\[\]]/g, '\\$&').replace(/[\r\n]/g, ' '); +} diff --git a/src/agent-surfaces/format.mjs b/src/agent-surfaces/format.mjs new file mode 100644 index 0000000..69ba7cf --- /dev/null +++ b/src/agent-surfaces/format.mjs @@ -0,0 +1,34 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +/** + * Absolutize authored links without changing code examples or real .md routes. + * @param {string} markdown + * @param {string} canonical + * @param {{htmlPathsByMarkdown?: Record, resolveLink?: (href: string) => string | undefined}} options + */ +export function absoluteMarkdownLinks(markdown, canonical, { htmlPathsByMarkdown = {}, resolveLink } = {}) { + const code = []; + const protect = (text) => { + const token = `\u0000markdown-code-${code.length}\u0000`; + const newline = text.endsWith('\n') ? '\n' : ''; + code.push(newline ? text.slice(0, -1) : text); + return token + newline; + }; + const source = markdown + .replace(/^( {0,3})(`{3,}|~{3,})[^\n]*\n[\s\S]*?^\1\2[^\n]*(?:\n|$)/gm, protect) + .replace(/(`+)([^`]|(?!\1)`)*?\1/g, protect); + function destination(raw) { + const angle = raw.startsWith('<') && raw.endsWith('>'); + const href = angle ? raw.slice(1, -1) : raw; + const resolved = resolveLink?.(href); + if (resolved !== undefined) return angle ? `<${resolved}>` : resolved; + const url = new URL(href, canonical); + if (url.origin === new URL(canonical).origin && Object.hasOwn(htmlPathsByMarkdown, url.pathname)) { + url.pathname = htmlPathsByMarkdown[url.pathname]; + } else if (/^[a-z][a-z0-9+.-]*:/i.test(href)) return raw; + return angle ? `<${url.href}>` : url.href; + } + return source + .replace(/(!?\[[^\]\n]*\]\()(\s*)(<[^>\n]+>|[^\s)]+)(?=[\s)])/g, (_match, lead, space, href) => `${lead}${space}${destination(href)}`) + .replace(/^( {0,3}\[[^\]\n]+\]:\s*)(<[^>\n]+>|\S+)/gm, (_match, lead, href) => `${lead}${destination(href)}`) + .replace(/\u0000markdown-code-(\d+)\u0000/g, (_match, index) => code[Number(index)]); +} diff --git a/src/agent-surfaces/handler.mjs b/src/agent-surfaces/handler.mjs new file mode 100644 index 0000000..d30a389 --- /dev/null +++ b/src/agent-surfaces/handler.mjs @@ -0,0 +1,110 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +import { wantsMarkdown, markdownPathFor, htmlPathFromMarkdown, markdownResponse } from './http.mjs'; +import { listMarkdownRoutes, buildMarkdownIndex, buildAiTxt, buildFullMarkdown } from './documents.mjs'; + +const reserved = /^\/(?:api|admin|auth|dashboard|_next|_astro|\.well-known)(?:\/|$)/; +const nativeMarkdown = new Set(['/auth.md', '/skill.md', '/SKILL.md', '/agents.md', '/AGENTS.md']); +const documents = new Set(['/llms.txt', '/llms-full.txt', '/ai.txt', '/api/ai', '/api/md/_catalog']); + +/** A loader is reachable only through the explicitly enumerated public registry. */ +export function createAgentSurfaceHandler(options) { + const { manifest, loadMarkdown } = options; + if (!manifest) throw new TypeError('createAgentSurfaceHandler: manifest required'); + // Some public documentation sites use names such as /dashboard. Exceptions + // are exact, source-reviewed HTML routes, never API or infrastructure paths. + const publicReservedPaths = new Set(options.publicReservedPaths || []); + for (const path of publicReservedPaths) { + if (!/^\/(?:admin|auth|dashboard)(?:\/[^*?#\\]*)?$/.test(path)) throw new TypeError(`Invalid public route exception: ${path}`); + } + let snapshot; + let expires = 0; + let full; + + async function registry() { + if (!snapshot || Date.now() >= expires) { + full = undefined; + expires = Date.now() + 86400000; + snapshot = Promise.resolve(options.listMarkdownRoutes?.() ?? listMarkdownRoutes(manifest)).then((routes) => { + const seen = new Set(); + return routes.map((route) => { + const path = route.path; + if (!path?.startsWith('/') || path.startsWith('//') || (reserved.test(path) && !publicReservedPaths.has(path)) || /[?#\\]/.test(path) || new URL(path, manifest.origin).pathname !== path) { + throw new TypeError(`Invalid public Markdown route: ${path}`); + } + if (seen.has(path)) throw new TypeError(`Duplicate Markdown route: ${path}`); + seen.add(path); + return { ...route, url: new URL(path, manifest.origin).href, md: new URL(markdownPathFor(path), manifest.origin).href }; + }); + }).catch((error) => { snapshot = undefined; throw error; }); + } + return snapshot; + } + + async function render(path) { + const pages = manifest.pages; + if (Object.hasOwn(pages, path)) return pages[path]; + const mdPath = markdownPathFor(path); + if (Object.hasOwn(pages, mdPath)) return pages[mdPath]; + // Public, cacheable renderers never inherit cookies, authorization or query state. + return loadMarkdown ? loadMarkdown(path, new Request(new URL(path, manifest.origin)), (await registry()).find((route) => route.path === path)) : null; + } + + return async function handleAgentSurface(request) { + const path = new URL(request.url).pathname; + if (!['GET', 'HEAD', 'OPTIONS'].includes(request.method)) return null; + if (nativeMarkdown.has(path) || options.preserveMarkdownPaths?.includes(path)) return null; + const direct = path === '/api/md' || path.startsWith('/api/md/'); + const suffix = path.endsWith('.md') && !reserved.test(path); + if (!direct && !suffix && !documents.has(path) && (!manifest.negotiation || !wantsMarkdown(request))) return null; + const routes = await registry(); + const htmlPath = direct ? '/' + path.replace(/^\/api\/md\/?/, '') : suffix ? htmlPathFromMarkdown(path) : path; + const route = routes.find((entry) => entry.path.replace(/\/$/, '') === htmlPath.replace(/\/$/, '') || entry.aliases?.includes(path)); + if (!documents.has(path) && !direct && !suffix && !route) return null; + if (request.method === 'OPTIONS') { + return new Response(null, { status: 204, headers: { + 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', + 'Access-Control-Allow-Headers': 'Accept', 'Access-Control-Max-Age': '86400', + } }); + } + let response; + if (path === '/llms.txt') response = text(buildMarkdownIndex(manifest, routes)); + else if (path === '/ai.txt') response = text(buildAiTxt(manifest, routes)); + else if (path === '/api/ai') response = text(JSON.stringify(manifest.catalog), 'application/json; charset=utf-8'); + else if (path === '/api/md/_catalog') response = text(JSON.stringify(routes), 'application/json; charset=utf-8'); + else if (path === '/llms-full.txt') { + full ??= buildFullMarkdown(manifest, routes, render, options.fullLimits).catch((error) => { full = undefined; throw error; }); + response = text(await full); + } else { + const body = route ? await render(route.path) : null; + const fallback = new URL(manifest.origin); + fallback.pathname = htmlPath; + const canonical = route?.url || fallback.href; + response = markdownResponse(body ?? '# Not found\n\nNo public Markdown page exists at this path.\n', request, { + 'Content-Location': canonical, + Link: `<${canonical}>; rel="canonical"`, + ...(body == null ? { 'Cache-Control': 'no-store' } : {}), + ...(route?.lastModified ? { 'Last-Modified': new Date(route.lastModified).toUTCString() } : {}), + }); + if (body == null) response = new Response(response.body, { status: 404, headers: response.headers }); + } + response.headers.append('Link', discoveryLinkHeader(manifest.origin)); + if (!suffix && !direct && !documents.has(path)) { + // Cloudflare's URL cache does not partition on Vary: Accept. + response.headers.set('CDN-Cache-Control', 'no-store'); + response.headers.set('Cloudflare-CDN-Cache-Control', 'no-store'); + } + return request.method === 'HEAD' ? new Response(null, { status: response.status, headers: response.headers }) : response; + }; +} + +export function discoveryLinkHeader(origin) { + return ['/llms.txt', '/llms-full.txt', '/ai.txt'].map((path) => `<${new URL(path, origin).href}>; rel="describedby"`).join(', '); +} + +function text(body, type = 'text/plain; charset=utf-8') { + return new Response(body, { headers: { + 'Content-Type': type, 'Cache-Control': 'public, s-maxage=86400, stale-while-revalidate=604800', + 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', + 'X-Content-Type-Options': 'nosniff', + } }); +} diff --git a/src/agent-surfaces/http.mjs b/src/agent-surfaces/http.mjs new file mode 100644 index 0000000..df21779 --- /dev/null +++ b/src/agent-surfaces/http.mjs @@ -0,0 +1,187 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +/** Paths that must never fall through to an SPA HTML shell. */ +const AGENT_PATHS = new Set([ + '/llms.txt', + '/llms-full.txt', + '/ai.txt', + '/api/ai', + '/skill.md', + '/agents.md', + '/humans.txt', + '/.well-known/skills/index.json', + '/.well-known/agent.json', + '/.well-known/mcp.json', +]); + +/** + * @param {string} pathname + * @returns {boolean} + */ +export function isAgentPath(pathname) { + if (!pathname) return false; + const path = normalizePath(pathname); + if (AGENT_PATHS.has(path)) return true; + if (path.endsWith('.md')) return true; + if (path.startsWith('/.well-known/skills/')) return true; + return false; +} + +/** + * @param {string} htmlPath e.g. "/" or "/pricing" + * @returns {string} e.g. "/index.md" or "/pricing.md" + */ +export function markdownPathFor(htmlPath) { + const path = normalizePath(htmlPath); + if (path === '/') return '/index.md'; + if (path.endsWith('.md')) return path; + return `${path.replace(/\/$/, '')}.md`; +} + +/** + * @param {string} mdPath e.g. "/index.md" or "/pricing.md" + * @returns {string} + */ +export function htmlPathFromMarkdown(mdPath) { + const path = normalizePath(mdPath); + if (path === '/index.md') return '/'; + if (path.endsWith('.md')) return path.slice(0, -3); + return path; +} + +/** + * Prefer markdown when Accept ranks text/markdown over text/html + * (or when only markdown/plain is offered). + * + * @param {Request | { headers?: Headers | Record }} request + * @returns {boolean} + */ +export function wantsMarkdown(request) { + const headers = request?.headers; + const accept = + typeof headers?.get === 'function' + ? headers.get('accept') || '' + : headers?.accept || headers?.Accept || ''; + if (!accept) return false; + const ranges = accept.toLowerCase().split(',').map((part) => { + const [type, ...parameters] = part.trim().split(';'); + const weights = parameters.map((value) => value.trim()).filter((value) => /^q\s*=/.test(value)); + const raw = weights[0]?.split('=')[1]?.trim(); + const q = weights.length > 1 || (raw !== undefined && !/^(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?)$/.test(raw)) + ? 0 : raw === undefined ? 1 : Number(raw); + return { type: type.trim(), q }; + }); + // Wildcards never opt into Markdown. Specific media ranges override them. + const markdown = ranges.filter(({ type }) => type === 'text/markdown'); + if (!markdown.length) return false; + const quality = (types) => { + for (const type of types) { + const matches = ranges.filter((range) => range.type === type); + if (matches.length) return Math.min(...matches.map((range) => range.q)); + } + return 0; + }; + return quality(['text/markdown']) > quality(['text/html', 'text/*', '*/*']); +} + +/** + * Detect SPA / HTML shell responses that fake agent endpoints. + * @param {string | ArrayBuffer | Uint8Array} body + * @param {string} [contentType] + */ +export function isHtmlShell(body, contentType = '') { + const ct = (contentType || '').toLowerCase(); + if (ct.includes('text/html') || ct.includes('application/xhtml')) return true; + const text = bodyToPreview(body); + if (!text) return false; + const head = text.slice(0, 200).toLowerCase(); + return ( + head.includes('} [extraHeaders] + */ +export function textResponse(body, contentType = 'text/plain; charset=utf-8', extraHeaders = {}) { + return new Response(body, { + status: 200, + headers: { + 'Content-Type': contentType, + 'Cache-Control': 'public, max-age=300', + ...extraHeaders, + }, + }); +} + +/** + * @param {unknown} data + * @param {Record} [extraHeaders] + */ +export function jsonResponse(data, extraHeaders = {}) { + return new Response(JSON.stringify(data, null, 2) + '\n', { + status: 200, + headers: { + 'Content-Type': 'application/json; charset=utf-8', + 'Cache-Control': 'public, max-age=300', + ...extraHeaders, + }, + }); +} + +/** + * @param {string} body + * @param {Request | { headers?: Headers }} [request] for Accept negotiation + * @param {Record} [extraHeaders] + */ +export function markdownResponse(body, request, extraHeaders = {}) { + return new Response(request?.method === 'HEAD' ? null : body, { + headers: { + 'Content-Type': 'text/markdown; charset=utf-8', + 'X-Markdown-Tokens': String(Math.ceil(body.length / 4)), + 'X-Robots-Tag': 'noindex, follow', + 'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate=86400', + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS', + 'X-Content-Type-Options': 'nosniff', + Vary: 'Accept', + ...extraHeaders, + }, + }); +} + +/** + * @param {string} mdPath absolute path starting with / + */ +export function alternateLinkHeader(mdPath) { + const path = normalizePath(mdPath); + return `<${path}>; rel="alternate"; type="text/markdown"`; +} + +function normalizePath(pathname) { + if (!pathname) return '/'; + try { + if (pathname.startsWith('http://') || pathname.startsWith('https://')) { + pathname = new URL(pathname).pathname; + } + } catch { + /* keep raw */ + } + let path = pathname.split('?')[0].split('#')[0]; + if (!path.startsWith('/')) path = `/${path}`; + if (path.length > 1 && path.endsWith('/')) path = path.slice(0, -1); + return path || '/'; +} + +function bodyToPreview(body) { + if (body == null) return ''; + if (typeof body === 'string') return body; + if (body instanceof Uint8Array) { + return new TextDecoder().decode(body.slice(0, 256)); + } + return ''; +} diff --git a/src/agent-surfaces/llms.mjs b/src/agent-surfaces/llms.mjs new file mode 100644 index 0000000..ec53774 --- /dev/null +++ b/src/agent-surfaces/llms.mjs @@ -0,0 +1,64 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +/** + * Build llmstxt.org-style index documents. + * + * @typedef {{ title: string, url: string, description?: string }} LlmsLink + * @typedef {{ + * name: string, + * summary: string, + * url?: string, + * product?: LlmsLink[], + * docs?: LlmsLink[], + * feeds?: LlmsLink[], + * optional?: LlmsLink[], + * notes?: string[], + * }} LlmsMeta + */ + +/** + * @param {LlmsMeta} meta + * @returns {string} + */ +export function buildLlmsTxt(meta) { + if (!meta?.name) throw new TypeError('buildLlmsTxt: meta.name required'); + if (!meta?.summary) throw new TypeError('buildLlmsTxt: meta.summary required'); + + const lines = [`# ${meta.name}`, '', `> ${meta.summary.trim()}`, '']; + + if (meta.notes?.length) { + for (const note of meta.notes) lines.push(note); + lines.push(''); + } + + appendSection(lines, 'Product', meta.product); + appendSection(lines, 'Docs', meta.docs); + appendSection(lines, 'Feeds', meta.feeds); + appendSection(lines, 'Optional', meta.optional); + + // Always point agents at the machine catalog when present. + if (meta.url) { + const origin = meta.url.replace(/\/$/, ''); + lines.push('## Machine surfaces'); + lines.push(''); + lines.push(`- [Agent catalog](${origin}/api/ai): JSON inventory of public surfaces`); + lines.push(`- [This index](${origin}/llms.txt)`); + lines.push(''); + } + + return lines.join('\n').replace(/\n{3,}/g, '\n\n'); +} + +/** + * @param {string[]} lines + * @param {string} heading + * @param {LlmsLink[] | undefined} links + */ +function appendSection(lines, heading, links) { + if (!links?.length) return; + lines.push(`## ${heading}`, ''); + for (const link of links) { + const desc = link.description ? `: ${link.description}` : ''; + lines.push(`- [${link.title}](${link.url})${desc}`); + } + lines.push(''); +} diff --git a/src/agent-surfaces/manifest.mjs b/src/agent-surfaces/manifest.mjs new file mode 100644 index 0000000..4d8e412 --- /dev/null +++ b/src/agent-surfaces/manifest.mjs @@ -0,0 +1,134 @@ +// Generated from sass-maker/saas-maker tooling/lib/agent-surfaces; use sync-agent-readability.mjs. +import { buildLlmsTxt } from './llms.mjs'; +import { listMarkdownRoutes, buildMarkdownIndex } from './documents.mjs'; +import { buildApiAiCatalog } from './catalog.mjs'; +import { markdownPathFor } from './http.mjs'; + +/** + * Single source of truth for a product's agent surfaces. + * + * @typedef {import('./llms.mjs').LlmsMeta} LlmsMeta + * @typedef {import('./catalog.mjs').ApiAiCatalog} ApiAiCatalog + * @typedef {import('./catalog.mjs').AgentSurface} AgentSurface + * + * @typedef {{ + * name: string, + * url: string, + * summary: string, + * contact?: string, + * openapi?: string, + * updatedAt?: string, + * trainingAllowed?: boolean, + * excludedPaths?: string[], + * mode?: 'static' | 'collection' | 'dynamic' | 'spa', + * product?: import('./llms.mjs').LlmsLink[], + * docs?: import('./llms.mjs').LlmsLink[], + * feeds?: import('./llms.mjs').LlmsLink[], + * optional?: import('./llms.mjs').LlmsLink[], + * notes?: string[], + * surfaces?: AgentSurface[], + * pages?: Record, + * llmsFull?: string | null, + * sitemap?: string | null, + * auth?: { public?: boolean, notes?: string }, + * negotiation?: boolean, + * }} AgentSurfaceConfig + * + * pages: map of pathname → markdown body (for static/runtime serve) + */ + +/** + * @param {AgentSurfaceConfig} config + */ +export function createAgentSurfaceManifest(config) { + if (!config?.name || !config?.url || !config?.summary) { + throw new TypeError('createAgentSurfaceManifest requires name, url, summary'); + } + + const origin = config.url.replace(/\/$/, ''); + const pages = { ...(config.pages || {}) }; + + // Ensure homepage has an index.md key if pages has "/" content. + if (pages['/'] && !pages['/index.md']) { + pages['/index.md'] = pages['/']; + } + + const surfaces = + config.surfaces || + deriveSurfacesFromPages(pages, config.mode || 'static'); + + const catalog = buildApiAiCatalog({ + name: config.name, + url: origin, + llmsFull: `${origin}/llms-full.txt`, + sitemap: config.sitemap, + markdown: { suffix: '.md', negotiation: config.negotiation ?? true }, + surfaces, + auth: config.auth, + }); + + const llmsTxt = buildLlmsTxt({ + name: config.name, + summary: config.summary, + url: origin, + product: config.product, + docs: config.docs, + feeds: config.feeds, + optional: config.optional, + notes: config.notes, + }); + + const manifest = { + origin, + name: config.name, + summary: config.summary, + contact: config.contact, + openapi: config.openapi, + notes: config.notes, + updatedAt: config.updatedAt, + trainingAllowed: config.trainingAllowed ?? false, + excludedPaths: config.excludedPaths, + mode: config.mode || 'static', + llmsTxt, + llmsFull: config.llmsFull ?? null, + catalog, + pages, + negotiation: config.negotiation ?? true, + }; + if (Object.keys(pages).length) manifest.llmsTxt = buildMarkdownIndex(manifest, listMarkdownRoutes(manifest)); + return manifest; +} + +/** + * @param {Record} pages + * @param {string} kind + * @returns {import('./catalog.mjs').AgentSurface[]} + */ +function deriveSurfacesFromPages(pages, kind) { + const surfaces = []; + const seen = new Set(); + + for (const key of Object.keys(pages)) { + let htmlPath = key; + if (key.endsWith('.md')) { + htmlPath = key === '/index.md' ? '/' : key.slice(0, -3); + } + if (seen.has(htmlPath)) continue; + seen.add(htmlPath); + const id = + htmlPath === '/' + ? 'home' + : htmlPath.replace(/^\//, '').replace(/\//g, '-') || 'page'; + surfaces.push({ + id, + url: htmlPath, + md: markdownPathFor(htmlPath), + kind: /** @type {any} */ (kind === 'spa' ? 'spa' : kind === 'collection' ? 'collection' : kind === 'dynamic' ? 'dynamic' : 'static'), + }); + } + + if (surfaces.length === 0) { + surfaces.push({ id: 'home', url: '/', md: '/index.md', kind: 'static' }); + } + return surfaces; +} diff --git a/src/pages/PrivacyPage.test.tsx b/src/pages/PrivacyPage.test.tsx new file mode 100644 index 0000000..fcb7a45 --- /dev/null +++ b/src/pages/PrivacyPage.test.tsx @@ -0,0 +1,27 @@ +import { act } from 'react'; +import { createRoot } from 'react-dom/client'; +import { MemoryRouter } from 'react-router-dom'; +import { expect, it } from 'vitest'; +import PrivacyPage from './PrivacyPage'; +import copy from '../public-copy.json'; + +it('restores the app title when leaving a server-titled privacy page', async () => { + const previous = document.title; + document.title = copy.privacy.title; + const element = document.createElement('div'); + const root = createRoot(element); + try { + await act(async () => + root.render( + + + + ) + ); + expect(document.title).toBe(copy.privacy.title); + await act(async () => root.unmount()); + expect(document.title).toBe('Reader — your saved-link inbox'); + } finally { + document.title = previous; + } +}); diff --git a/src/pages/PrivacyPage.tsx b/src/pages/PrivacyPage.tsx index f1cd900..c858b0d 100644 --- a/src/pages/PrivacyPage.tsx +++ b/src/pages/PrivacyPage.tsx @@ -1,29 +1,26 @@ +import { useEffect } from 'react'; +import copy from '../public-copy.json'; import { Link } from 'react-router-dom'; export default function PrivacyPage() { + useEffect(() => { + const previous = document.title; + document.title = copy.privacy.title; + return () => { + document.title = + previous === copy.privacy.title ? 'Reader — your saved-link inbox' : previous; + }; + }, []); return (
← Reader

Privacy

-

- Reader stores your Google sign-in identity and the links you save, including their titles - and read states. Older saved material remains stored in your account. -

-

- The extension sends the current page’s URL and title only when you click Save link. Its - connection key stays in Chrome’s local extension storage. Reader stores a hash of that key. -

-

- When you connect ChatGPT through MCP, it can retrieve your links and available source text, - and update read states when you ask. Reader may fetch a saved URL to extract text. OpenAI’s - privacy terms apply to information shared with ChatGPT. -

-

- Reader uses analytics and error monitoring to understand usage and failures. We do not sell - your saved links. -

-

Contact the maintainer to request removal of your account data.

+ {copy.privacy.paragraphs.map((paragraph) => ( +

+ {paragraph} +

+ ))}
); } diff --git a/src/public-copy.json b/src/public-copy.json new file mode 100644 index 0000000..e950af9 --- /dev/null +++ b/src/public-copy.json @@ -0,0 +1,45 @@ +{ + "privacy": { + "title": "Privacy", + "description": "How Reader handles sign-in, saved links, extension keys, ChatGPT access, and analytics.", + "paragraphs": [ + "Reader stores your Google sign-in identity and the links you save, including their titles and read states. Older saved material remains stored in your account.", + "The extension sends the current page’s URL and title only when you click Save link. Its connection key stays in Chrome’s local extension storage. Reader stores a hash of that key.", + "When you connect ChatGPT through MCP, it can retrieve your links and available source text, and update read states when you ask. Reader may fetch a saved URL to extract text. OpenAI’s privacy terms apply to information shared with ChatGPT.", + "Reader uses analytics and error monitoring to understand usage and failures. We do not sell your saved links.", + "Contact the maintainer to request removal of your account data." + ] + }, + "faq": { + "title": "Reader — questions", + "description": "Reader saves links for use with ChatGPT.", + "heading": "Just your saved links.", + "questions": [ + { + "question": "How do I add one?", + "answer": "Paste a URL in the inbox or click Save link in the Chrome extension." + }, + { + "question": "How does ChatGPT use it?", + "answer": "Connect Reader through MCP with OAuth. ChatGPT can search links, retrieve available text, and mark links read when you ask. The connection requires a deployed endpoint and OAuth setup." + }, + { + "question": "Where are the other features?", + "answer": "RSS, the reader view, annotations, boards, memories, PDFs, and built-in AI are outside the active product. Existing saved data is retained." + }, + { + "question": "Where is the extension?", + "answer": "It is built from this repository and loaded unpacked in Chrome. Public distribution is deferred." + } + ] + }, + "changelog": { + "title": "Reader — changes", + "description": "Reader’s saved-link simplification.", + "heading": "A smaller Reader.", + "paragraphs": [ + "The active product is a saved-link inbox, a one-click capture extension, and MCP tools for ChatGPT to retrieve links and update read state.", + "Existing saved data remains intact. Deployment and an authenticated ChatGPT connection are verified separately from source changes." + ] + } +} diff --git a/src/public-site.mjs b/src/public-site.mjs new file mode 100644 index 0000000..632764b --- /dev/null +++ b/src/public-site.mjs @@ -0,0 +1,201 @@ +import content from '../landing-astro/src/content/reader.json' with { type: 'json' }; +import copy from './public-copy.json' with { type: 'json' }; +import { createAgentSurfaceManifest } from './agent-surfaces/manifest.mjs'; +import { createAgentSurfaceHandler } from './agent-surfaces/handler.mjs'; +import { listMarkdownRoutes } from './agent-surfaces/documents.mjs'; +import { absoluteMarkdownLinks } from './agent-surfaces/format.mjs'; + +export const SITE_ORIGIN = content.url; +export const publicIdentityGraph = { + '@context': 'https://schema.org', + '@graph': [ + { + '@type': 'Organization', + '@id': `${SITE_ORIGIN}/#publisher`, + name: 'Significant Hobbies', + url: 'https://significanthobbies.com/', + description: + 'A family of maintained personal applications built around focused, private workflows.', + logo: `${SITE_ORIGIN}/icon.svg`, + founder: { + '@type': 'Person', + name: 'Sarthak Agrawal', + url: 'https://sarthakagrawal.dev/', + }, + sameAs: [ + 'https://github.com/Significant-Hobbies', + 'https://github.com/Significant-Hobbies/reader', + ], + }, + { + '@type': 'WebSite', + '@id': `${SITE_ORIGIN}/#website`, + name: 'Reader', + url: SITE_ORIGIN, + description: content.page.description, + inLanguage: 'en', + publisher: { '@id': `${SITE_ORIGIN}/#publisher` }, + }, + ], +}; + +const excludedPaths = [ + '/api', + '/admin', + '/auth', + '/dashboard', + '/library', + '/login', + '/extension', + '/app', +]; +const absolute = (path) => new URL(path, SITE_ORIGIN).href; +const action = (link) => `[${link.label}](${absolute(link.href)})`; +function page(path, title, description, lines) { + return absoluteMarkdownLinks( + [ + `# ${title}`, + '', + `> ${description}`, + '', + `Canonical: ${absolute(path)}`, + '', + ...lines, + '', + '## Related', + '', + '[Reader](/) · [Questions](/faq) · [Changes](/changelog) · [Privacy](/privacy)', + '', + ].join('\n'), + absolute(path) + ); +} + +// Explicitly map the authored Workbench content; never read an account or scrape HTML. +const hero = content.hero; +const home = [ + hero.eyebrow, + '', + `## ${hero.title}`, + '', + hero.lede, + '', + action(hero.primary), + '', + action(hero.secondary), + '', + hero.note, + '', + `![${hero.window.alt}](${absolute(hero.window.src)})`, + '', + hero.caption, + '', +]; +for (const section of content.sections) { + for (const block of section.blocks) { + home.push(`## ${block.title}`, '', block.eyebrow ?? '', '', block.lede ?? '', ''); + if (block.type === 'statement') { + for (const point of block.points) home.push(`### ${point.title}`, '', point.body, ''); + } else if (block.type === 'faq') { + for (const item of block.items) home.push(`### ${item.q}`, '', item.a, ''); + } else if (block.type === 'cta') { + if (block.primary) home.push(action(block.primary), ''); + if (block.secondary) home.push(action(block.secondary), ''); + } else throw new Error(`Unmapped Reader public block: ${block.type}`); + } +} +export const publicPages = { + '/': page('/', content.page.title, content.page.description, home), + '/faq': page('/faq', copy.faq.title, copy.faq.description, [ + `## ${copy.faq.heading}`, + '', + ...copy.faq.questions.flatMap((item) => [`### ${item.question}`, '', item.answer, '']), + ]), + '/changelog': page('/changelog', copy.changelog.title, copy.changelog.description, [ + 'Product direction', + '', + `## ${copy.changelog.heading}`, + '', + ...copy.changelog.paragraphs.flatMap((paragraph) => [paragraph, '']), + '[Source history](https://github.com/Significant-Hobbies/reader/commits/main)', + ]), + '/privacy': page( + '/privacy', + copy.privacy.title, + copy.privacy.description, + copy.privacy.paragraphs.flatMap((paragraph) => [paragraph, '']) + ), +}; +export const publicManifest = createAgentSurfaceManifest({ + name: content.product, + url: SITE_ORIGIN, + summary: content.page.description, + contact: 'https://github.com/Significant-Hobbies/reader/issues', + updatedAt: '2026-10-26', + trainingAllowed: true, + excludedPaths, + sitemap: absolute('/sitemap.xml'), + openapi: absolute('/openapi.json'), + notes: [ + 'Personal libraries, account records, API keys, and MCP responses are private.', + `Existing public guides: [Agent instructions](${absolute('/agents.md')}) and [Access and pricing](${absolute('/pricing.md')}).`, + ], + pages: publicPages, +}); +export const publicRoutes = listMarkdownRoutes(publicManifest); +export const handlePublicDocument = createAgentSurfaceHandler({ + manifest: publicManifest, + preserveMarkdownPaths: ['/pricing.md'], +}); +export const publicRobots = [ + '# Keep in sync with /llms.txt and /ai.txt.', + '', + ...[ + '*', + 'OAI-SearchBot', + 'ChatGPT-User', + 'Claude-SearchBot', + 'Claude-User', + 'PerplexityBot', + 'Perplexity-User', + 'GPTBot', + 'ClaudeBot', + 'Google-Extended', + 'Applebot-Extended', + 'CCBot', + 'Bytespider', + ].flatMap((bot) => [ + `User-agent: ${bot}`, + 'Allow: /', + ...excludedPaths.flatMap((path) => [ + `Disallow: ${path}$`, + `Disallow: ${path}/`, + `Disallow: ${path}?`, + ]), + 'Allow: /api/ai$', + 'Allow: /api/md/', + 'Allow: /llms.txt', + 'Allow: /llms-full.txt', + 'Allow: /index.md', + '', + ]), + `Sitemap: ${absolute('/sitemap.xml')}`, + '', +].join('\n'); +export const publicSitemap = `\n${publicRoutes.map((route) => `${route.url}`).join('')}\n`; + +export function privacyHtmlDocument(html) { + const route = publicRoutes.find((item) => item.path === '/privacy'); + const escapeAttribute = (value) => + value.replaceAll('&', '&').replaceAll('"', '"').replaceAll('<', '<'); + return html + .replace(/[^<]*<\/title>/, `<title>${escapeAttribute(route.title)}`) + .replace( + //, + `` + ) + .replace( + '', + `` + ); +} diff --git a/src/public-site.test.ts b/src/public-site.test.ts new file mode 100644 index 0000000..bf1bc1e --- /dev/null +++ b/src/public-site.test.ts @@ -0,0 +1,127 @@ +import { describe, expect, it } from 'vitest'; +import { handleAgentEdge } from './agent-edge.mjs'; +import { publicPages, publicRoutes, publicRobots } from './public-site.mjs'; +import copy from './public-copy.json'; +import worker from './worker'; +import type { WorkerEnv } from './lib/worker-env'; + +const origin = 'https://read.significanthobbies.com'; +const env = { + ASSETS: { + fetch: async () => { + throw new Error('Public source renderer must not fetch user or asset data'); + }, + }, +}; +describe('public Reader representations', () => { + it('dispatches discovery through the actual Worker before private API routes', async () => { + const response = await worker.fetch( + new Request(`${origin}/api/md/_catalog`), + env as unknown as WorkerEnv, + { waitUntil() {}, passThroughOnException() {} } as ExecutionContext + ); + expect(response.status).toBe(200); + expect((await response.json()).map((route: { path: string }) => route.path)).toEqual([ + '/', + '/faq', + '/changelog', + '/privacy', + ]); + }); + it('serves source-identical pages in all forms without account inputs', async () => { + for (const route of publicRoutes) { + for (const [path, accept] of [ + [new URL(route.md).pathname, '*/*'], + [`/api/md${route.path}`, '*/*'], + [route.path, 'text/markdown'], + ]) { + const response = await handleAgentEdge( + new Request(`${origin}${path}?private=do-not-export`, { + headers: { + accept, + cookie: 'session_token=do-not-export', + authorization: 'Bearer do-not-export', + }, + }), + env + ); + expect(response?.status).toBe(200); + expect(await response?.text()).toBe(publicPages[route.path]); + expect(response?.headers.get('Content-Location')).toBe(route.url); + expect(response?.headers.get('X-Markdown-Tokens')).toBe( + String(Math.ceil(publicPages[route.path].length / 4)) + ); + expect(response?.headers.get('X-Robots-Tag')).toBe('noindex, follow'); + } + } + for (const paragraph of copy.privacy.paragraphs) + expect(publicPages['/privacy']).toContain(paragraph); + }); + it('preserves HTML preferences and excludes private and unknown paths', async () => { + for (const accept of [ + '*/*', + 'text/markdown;q=0', + 'text/markdown,text/html', + 'text/markdown;q=0.1,text/html;q=1', + ]) { + expect(await handleAgentEdge(new Request(origin, { headers: { accept } }), env)).toBeNull(); + } + for (const path of [ + '/library.md', + '/login.md', + '/api/md/library', + '/api/md/login', + '/api/md/api/links', + '/missing.md', + ]) { + expect((await handleAgentEdge(new Request(origin + path), env))?.status).toBe(404); + } + }); + it('returns bodyless HEAD and CORS preflight', async () => { + for (const route of publicRoutes) { + const get = await handleAgentEdge(new Request(route.md), env); + const head = await handleAgentEdge(new Request(route.md, { method: 'HEAD' }), env); + expect(await head?.text()).toBe(''); + expect(head?.headers.get('X-Markdown-Tokens')).toBe(get?.headers.get('X-Markdown-Tokens')); + const options = await handleAgentEdge(new Request(route.md, { method: 'OPTIONS' }), env); + expect(options?.status).toBe(204); + expect(options?.headers.get('Access-Control-Allow-Origin')).toBe('*'); + } + }); +}); + +it('keeps unknown canonical origins local and declares public machine endpoint exceptions', async () => { + for (const path of ['/api/md//evil.example/x', '//evil.example/x.md']) { + const response = await handleAgentEdge(new Request(origin + path)); + expect(response?.status).toBe(404); + expect(new URL(response!.headers.get('Content-Location')!).origin).toBe(origin); + expect(response?.headers.get('Link')).toContain(`<${origin}/`); + } + const response = await handleAgentEdge(new Request(`${origin}/ai.txt`)); + expect(await response?.text()).toContain('public-machine-endpoints: /api/ai, /api/md/*'); +}); + +it('keeps private robots exclusions segment-bounded and privacy aliases canonical', async () => { + expect(publicRobots).toContain('Disallow: /app$'); + expect(publicRobots).toContain('Disallow: /app/'); + expect(publicRobots).toContain('Disallow: /library?'); + expect(publicRobots).not.toMatch(/^Disallow: \/(?:app|api)$/m); + const shell = + 'ReaderPrivacy'; + const assets = { + ASSETS: { + fetch: async () => new Response(shell, { headers: { 'Content-Type': 'text/html' } }), + }, + }; + for (const path of ['/privacy', '/privacy/']) { + const response = await worker.fetch( + new Request(origin + path), + assets as unknown as WorkerEnv, + { waitUntil() {}, passThroughOnException() {} } as ExecutionContext + ); + const body = await response.text(); + expect(response.headers.get('Link')).toContain('/privacy.md'); + expect(body).toContain(`name="description" content="${copy.privacy.description}"`); + expect(body).toContain(`rel="canonical" href="${origin}/privacy"`); + } +}); diff --git a/src/worker.ts b/src/worker.ts index 213a6b7..6e6b152 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -1,3 +1,5 @@ +import { privacyHtmlDocument, publicRoutes, SITE_ORIGIN } from './public-site.mjs'; +import { discoveryLinkHeader } from './agent-surfaces/handler.mjs'; import { Hono } from 'hono'; import { handleAgentEdge } from './agent-edge.mjs'; @@ -24,12 +26,9 @@ const SECURITY_HEADERS: Record = { }; const AUTH_COOKIE_FRAGMENTS = ['session_token', 'session-token']; -const MARKDOWN_ALTERNATES: Record = { - '/': '/index.md', - '/faq': '/faq.md', - '/changelog': '/changelog.md', - '/login': '/login.md', -}; +const MARKDOWN_ALTERNATES: Record = Object.fromEntries( + publicRoutes.map((route: { path: string; md: string }) => [route.path, route.md]) +); const api = new Hono<{ Bindings: WorkerEnv }>(); @@ -95,7 +94,8 @@ function hasAuthCookie(request: Request): boolean { return AUTH_COOKIE_FRAGMENTS.some((fragment) => cookie.includes(fragment)); } -function withSecurityHeaders(response: Response, pathname: string): Response { +async function withSecurityHeaders(response: Response, requestedPath: string): Promise { + const pathname = requestedPath.replace(/\/$/, '') || '/'; const headers = new Headers(response.headers); for (const [key, value] of Object.entries(SECURITY_HEADERS)) { headers.set(key, value); @@ -108,13 +108,27 @@ function withSecurityHeaders(response: Response, pathname: string): Response { if (pathname === '/login') headers.set('X-Robots-Tag', 'noindex, follow'); const markdownAlternate = MARKDOWN_ALTERNATES[pathname]; if (markdownAlternate) { - headers.set('Link', `<${markdownAlternate}>; rel="alternate"; type="text/markdown"`); + headers.set( + 'Link', + `<${markdownAlternate}>; rel="alternate"; type="text/markdown", ${discoveryLinkHeader(SITE_ORIGIN)}` + ); } // Add Vary: Accept for pages that have markdown alternates. - const existingVary = headers.get('Vary'); - headers.set('Vary', existingVary ? `${existingVary}, Accept` : 'Accept, Accept-Encoding'); + const vary = new Set( + (headers.get('Vary') || 'Accept-Encoding').split(',').map((value) => value.trim()) + ); + if (!vary.has('*') && ![...vary].some((value) => value.toLowerCase() === 'accept')) + vary.add('Accept'); + headers.set('Vary', [...vary].join(', ')); + } + let body: BodyInit | ReadableStream | null = response.body; + // Privacy is a public React route; supply its discovery metadata in the HTML + // response without exposing or rendering any account state. + if (pathname === '/privacy' && contentType.includes('text/html') && response.body) { + body = privacyHtmlDocument(await response.text()); + headers.delete('Content-Length'); } - return new Response(response.body, { + return new Response(body, { status: response.status, statusText: response.statusText, headers, @@ -132,7 +146,7 @@ export default { return protectedResourceMetadata(request, env); } - if (!url.pathname.startsWith('/api/')) { + if (!url.pathname.startsWith('/api/') || url.pathname.startsWith('/api/md/')) { const agent = await handleAgentEdge(request, env); if (agent) return agent; }