From 2a1942fc2a0b0110418477531416cfa2797d5379 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Wed, 7 Oct 2026 09:34:06 -0500 Subject: [PATCH] fixup! diigo-cache: invalidate the last N days of cached pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docs per the docs-files-api skill: a 1–2 line @file; what a declaration is or does in JSDoc on it, not in // comments or the file header. Generated-by: Claude Opus 5.5 --- diigo-cache/src/api.ts | 26 +++++++++++--------------- diigo-cache/src/cache-page.ts | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/diigo-cache/src/api.ts b/diigo-cache/src/api.ts index f200ec3..6d3db73 100644 --- a/diigo-cache/src/api.ts +++ b/diigo-cache/src/api.ts @@ -1,17 +1,4 @@ -/** - * @file the Cap'n Web API at /api: trade a cache's webkey for a capability. - * - * The browser holds the key in a URL fragment (`/cache/#`, see - * docs/webkeys.md), so it never reaches the server in a URL. The skeleton - * page passes it *in-band* — `api.cache(key)` — and gets back a stub for a - * {@link CacheCap}: a facet exposing only what the holder should do (fill, - * status, the public companion), never the DO's wiring methods. - * Authorization is in-band, so cross-origin calls are safe (capnweb's - * note on `newWorkersRpcResponse`); every argument is checked at runtime, - * since TypeScript types are erased on the wire. - * - * @see https://github.com/cloudflare/capnweb - */ +/** @file the Cap'n Web API at /api: trade a cache's webkey for a capability. */ import { RpcTarget } from "capnweb"; import type { DiigoCacheLogic, FillStatus, PublicCacheLogic } from "./cache.js"; @@ -97,7 +84,16 @@ export class CacheCap extends FillCap { } } -/** the main interface at /api */ +/** + * the main interface at /api. The browser holds a cache's key in a URL + * fragment (`/cache/#`, docs/webkeys.md), so it never reaches the + * server in a URL; the webkey page passes it *in-band* to {@link cache} + * and gets back a {@link CacheCap}. With authorization in-band, + * cross-origin calls are safe (capnweb's note on `newWorkersRpcResponse`); + * arguments are checked at runtime, since types are erased on the wire. + * + * @see https://github.com/cloudflare/capnweb + */ export class CacheApi extends RpcTarget { #env: ApiEnv; diff --git a/diigo-cache/src/cache-page.ts b/diigo-cache/src/cache-page.ts index b34d1ae..aef4aad 100644 --- a/diigo-cache/src/cache-page.ts +++ b/diigo-cache/src/cache-page.ts @@ -1,17 +1,17 @@ -/** - * @file the webkey page at /cache/ — a skeleton, identical for every key - * (docs/webkeys.md): the key rides the URL fragment, which browsers never - * send to the server or in a Referer. The inline module reads it, trades - * it for a capability (`api.cache(key)`, Cap'n Web over /api, in-band), - * and drives the fill job. Each round trip is its own HTTP batch session: - * calls made before an await travel together. - * - * Without a fragment, the page is a login form a password manager fills - * (petname as username, cache id as password). Its inputs have no - * `name`, so a native submit (script failed) sends nothing; the key - * stays in memory, out of the address bar and history. - */ +/** @file the webkey page at /cache/: a skeleton the key's holder drives over /api. */ +/** + * the webkey page, identical for every key (docs/webkeys.md): the key + * rides the URL fragment, which browsers never send to the server or in a + * Referer. Its script reads it, trades it for a capability + * (`api.cache(key)`, Cap'n Web over /api, in-band), and drives the fill + * job. Each round trip is its own HTTP batch session. + * + * Without a fragment it is a login form a password manager fills + * (petname as username, cache id as password). The inputs have no + * `name`, so a native submit (script failed) sends nothing; the key stays + * in memory, out of the address bar and history. + */ export const CACHE_PAGE_HTML = ` diigo cache