@slowcook-ai/review-overlay 0.8.1 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,6 +53,37 @@ export default function RootLayout({ children }: { children: ReactNode }) {
53
53
 
54
54
  The `enabled` gate keeps the overlay out of production-style builds. Slowcook's preview-deploy workflow (0.16-α.5) sets `NEXT_PUBLIC_SLOWCOOK_REVIEW=1` plus the owner/repo/PR env vars when it builds the mock for a `slowcook-mockup` PR.
55
55
 
56
+ ## Hosting the built mock — cache headers (required)
57
+
58
+ When you serve a **statically built** mock (Vite/Next export rsynced to a box, an
59
+ S3 bucket, etc.), the HTML shell **must not be hard-cached**, or reviewers keep
60
+ seeing a stale mock after every redeploy and your overlay fixes never reach them.
61
+
62
+ Rule of thumb:
63
+
64
+ - **`index.html` (and any app shell / chooser) → `Cache-Control: no-cache`** so the
65
+ browser revalidates each load and picks up the newest build immediately.
66
+ - **Content-hashed assets (`/assets/*.js`, `*.css`) → long, immutable cache** —
67
+ their filename changes every build, so caching them is safe.
68
+
69
+ nginx example (mirrors the delgoosh mock at `mock.delgoosh.com`):
70
+
71
+ ```nginx
72
+ # hashed build assets are immutable — a new build emits new filenames
73
+ location ~* /assets/ {
74
+ expires 30d;
75
+ add_header Cache-Control "public, max-age=2592000, immutable";
76
+ }
77
+ # app shell — always revalidate so a redeploy is seen on the next load
78
+ location = /index.html { add_header Cache-Control "no-cache"; }
79
+ location / { try_files $uri $uri/ /index.html; } # SPA fallback
80
+ ```
81
+
82
+ > If a CDN (Cloudflare, etc.) fronts the host, it may apply its own Browser-Cache-TTL
83
+ > to cacheable responses — harmless for hashed assets, but make sure the shell stays
84
+ > `no-cache` (don't let the CDN cache `index.html`). `slowcook run-mock` already serves
85
+ > with no-store dev headers; this note is for **self-hosted static deploys**.
86
+
56
87
  ## How a comment lands in the PR
57
88
 
58
89
  1. PM clicks the floating toggle → **💬 Comment**.
@@ -22,6 +22,7 @@
22
22
  * Tailwind in the host app
23
23
  */
24
24
  import { type JSX } from "react";
25
+ import { type RepoCoord } from "../github.js";
25
26
  export interface SlowcookReviewOverlayProps {
26
27
  /**
27
28
  * GitHub owner. Optional — falls back to
@@ -83,6 +84,15 @@ export interface SlowcookReviewOverlayProps {
83
84
  * to `NEXT_PUBLIC_SLOWCOOK_SURFACES` (JSON). Empty hides the switcher.
84
85
  */
85
86
  surfaces?: ReviewSurface[];
87
+ /**
88
+ * 0.9.0 — URL of a `testing-surfaces.json` manifest (epic ▸ context ▸ scenario
89
+ * ▸ state). When set, the pill grows an EPSS router IN review mode (a 2×2
90
+ * dropdown) and shows a tiny PSS breadcrumb in nav mode. Picking a state writes
91
+ * the resolved selection to localStorage (`slowcook_test_surface`) for the
92
+ * mock's data-adaptor + navigates. Falls back to `NEXT_PUBLIC_SLOWCOOK_SURFACES_URL`.
93
+ * Empty disables the router.
94
+ */
95
+ testingSurfacesUrl?: string;
86
96
  }
87
97
  export interface ReviewSurface {
88
98
  label: string;
@@ -91,4 +101,12 @@ export interface ReviewSurface {
91
101
  blurb?: string;
92
102
  }
93
103
  export declare function SlowcookReviewOverlay(props: SlowcookReviewOverlayProps): JSX.Element | null;
104
+ /**
105
+ * 0.8.1 — deterministic, in-code explanation of a write/auth failure. No LLM,
106
+ * no agent: the overlay itself tells the reviewer exactly why GitHub rejected
107
+ * the post and what to do (use a classic PAT with the `repo` scope), keyed off
108
+ * the HTTP status + GitHub's own message. Surfaced on every repo the overlay is
109
+ * mounted on.
110
+ */
111
+ export declare function describeAuthError(status: number | undefined, message: string | undefined, repo: RepoCoord): string;
94
112
  //# sourceMappingURL=overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/react/overlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EAA4C,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AA4C3E,MAAM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