Scrape

codemode-gatewaysourcetypescript
Path: codemode-gateway/src/providers/scrape.tsRelative: src/providers/scrape.tsSubproject: codemode-gatewayCategory: codemode-gateway
Lines: 178Bytes: 5,517Imports: 1Exports: 3

Content Preview

  1. import type { Env } from "../types";
  2. /**
  3. * `scrape` namespace tools — convenience persistence over the bound D1
  4. * database `env.DB` (table `scrape_pages`), composed with the existing
  5. * `browser` and `ai` namespaces. One sandbox code block can render a page
  6. * (`browser.markdown`), organize it (`ai.generate`), and persist it here
  7. * (`scrape.save`) — see the `scrape-and-store` snippet.
  8. *
  9. * Schema (`migrations/0001_scrape_store.sql`):
  10. * scrape_pages(id TEXT PK, url, title, markdown, summa