A local-first multi-agent app development platform, built on PenguinHarness
feat(ui,gallery): 组件库多了一族 GPU 背景,显卡不行就画同色的静态替身
lmliheng7de152a15266
diff --git a/packages/ui-gallery/src/library/boards.tsx b/packages/ui-gallery/src/library/boards.tsxindex b12603ae..e0ca8b4f 100644--- a/packages/ui-gallery/src/library/boards.tsx+++ b/packages/ui-gallery/src/library/boards.tsx@@ -26,6 +26,7 @@ import { LayoutBoard } from "./boards/layout";import { LoadingBoard } from "./boards/loading";import { NoticesBoard } from "./boards/notices";import { PickersBoard } from "./boards/pickers";+import { ShadersBoard } from "./boards/shaders";import { StreamingBoard } from "./boards/streaming";import { TabsBoard } from "./boards/tabs";import { ToastsBoard } from "./boards/toasts";@@ -51,6 +52,7 @@ export const BOARDS: Readonly<Record<TopicId, ComponentType>> = {content: ContentBoard,layout: LayoutBoard,data: DataBoard,+ shaders: ShadersBoard,colour: ColourBoard,type: TypeBoard,shape: ShapeBoard,diff --git a/packages/ui-gallery/src/library/boards/shaders.tsx b/packages/ui-gallery/src/library/boards/shaders.tsxnew file mode 100644index 00000000..3502ac00--- /dev/null+++ b/packages/ui-gallery/src/library/boards/shaders.tsx@@ -0,0 +1,120 @@+/**+ * Shaders: the WebGPU backdrops, on the two things that decide them — the device and the reader's+ * motion preference. The board shows what a caller passes in (the active theme's own colours, read+ * from this frame's root), the two backdrops side by side, and what the box is drawing right now:+ * a canvas, or the stand-in that costs nothing on a machine that cannot draw one.+ */+import { useEffect, useState } from "react";+import { AuroraBackdrop, DotGridBackdrop } from "@adelie/ui";+import { BoardGroup } from "../../foundations/shared";+import { useGallery } from "../../state";+import { readShaderColors } from "../shader-colors";+import type { ShaderColors } from "../shader-colors";++function read(): ShaderColors {+ const computed = getComputedStyle(document.documentElement);+ return readShaderColors((name) => computed.getPropertyValue(name));+}++/** The theme's colours, read from this frame's root and re-read when its theme attributes change. */+function useShaderColors(): ShaderColors | null {+ const [colors, setColors] = useState<ShaderColors | null>(null);+ useEffect(() => {+ const update = () => setColors(read());+ update();+ const observer = new MutationObserver(update);+ observer.observe(document.documentElement, {+ attributes: true,+ attributeFilter: ["class", "data-theme", "data-accent", "style"],+ });+ return () => observer.disconnect();+ }, []);+ return colors;+}++/**+ * Which of the two the box is drawing, read off the box itself: the GPU's canvas is in it, or its+ * absence is the stand-in. Observed rather than predicted — the support probe and the device are+ * both async, and a device can refuse the composition after the canvas already mounted.+ *+ * The box comes in as state, not as a ref: the board waits for the theme's colours before it+ * renders it, so a ref would still be empty at mount and the effect would never run again.+ *+ * The first two seconds belong to the device: an empty box there means "not asked yet", not "no+ * canvas", because the probe has not answered. A canvas that goes away again is the device's own+ * answer (`onUnavailable`, device lost), so it is read at once — in a browser with a software+ * WebGPU adapter the canvas appears and is refused a beat later, which is what showed both halves:+ * the line has to follow it down as well, or it keeps saying "a GPU canvas" over a stand-in.+ */+function useDrawnBy(element: HTMLDivElement | null): "gpu" | "static" | null {+ const [drawn, setDrawn] = useState<"gpu" | "static" | null>(null);+ useEffect(() => {+ if (!element) return;+ let settled = false;+ let hadCanvas = false;+ const read = (): "gpu" | "static" => (element.querySelector("canvas") ? "gpu" : "static");+ const check = () => {+ if (read() === "gpu") {+ hadCanvas = true;+ setDrawn("gpu");+ } else if (hadCanvas || settled) {+ setDrawn("static");+ }+ };+ check();+ const observer = new MutationObserver(check);+ observer.observe(element, { childList: true, subtree: true });+ const settle = window.setTimeout(() => {+ settled = true;+ check();+ }, 2000);+ return () => {+ observer.disconnect();+ window.clearTimeout(settle);+ };+ }, [element]);+ return drawn;+}++export function ShadersBoard() {+ const { S } = useGallery();+ const t = S.library.shaders;+ const colors = useShaderColors();+ const [box, setBox] = useState<HTMLDivElement | null>(null);+ const drawn = useDrawnBy(box);++ if (!colors) return <p className="gf-muted">{S.intro.resolving}</p>;++ return (+ <div className="gf-board">+ <BoardGroup title={t.aurora} aside={t.auroraHint}>+ <div ref={setBox} className="lib-box h-40 w-full max-w-xl">+ <AuroraBackdrop+ className="h-full w-full"+ colorA={colors.ground}+ colorB={colors.accent}+ cursor+ />+ </div>+ </BoardGroup>+ <BoardGroup title={t.grid} aside={t.gridHint}>+ <div className="lib-row">+ {[0, 0.6].map((twinkle) => (+ <span key={twinkle} className="lib-cell w-64">+ <span className="lib-box block h-32 w-64">+ <DotGridBackdrop className="h-full w-full" color={colors.line} twinkle={twinkle} />+ </span>+ <span className="lib-caption">{twinkle === 0 ? t.gridStill : t.gridTwinkle}</span>+ </span>+ ))}+ </div>+ </BoardGroup>+ <BoardGroup title={t.drawing} aside={drawn === null ? t.drawingPending : undefined}>+ <p className="lib-caption">+ {drawn === "gpu" ? t.drawingGpu : drawn === "static" ? t.drawingStatic : ""}+ </p>+ <p className="lib-caption">{t.standInHint}</p>+ </BoardGroup>+ </div>+ );+}diff --git a/packages/ui-gallery/src/library/shader-colors.ts b/packages/ui-gallery/src/library/shader-colors.tsnew file mode 100644index 00000000..2ac8f349--- /dev/null+++ b/packages/ui-gallery/src/library/shader-colors.ts@@ -0,0 +1,34 @@+/**+ * The active theme's colours, for the shader backdrops.+ *+ * A GPU canvas cannot read a CSS custom property, so a shader colour is always a string the caller+ * passes in. The gallery reads those strings from the frame root's own computed style — the theme+ * under test, since the frame carries the page's theme attributes — and the backdrops take them as+ * props, which is also how an app that wants its theme's colours does it.+ *+ * Pure over a getter, so a test can drive it with a stub, exactly like the chart tokens' reader.+ */++export interface ShaderColors {+ /** The page's own ground (`--ui-canvas`): the aurora's first colour, the surface it drifts on. */+ ground: string;+ /** The theme's accent (`--ui-accent`): the aurora's second colour. */+ accent: string;+ /** The separator ink (`--ui-line`): the dot grid's colour, faint by nature in every theme. */+ line: string;+}++export const SHADER_COLOR_TOKENS: Readonly<Record<keyof ShaderColors, string>> = {+ ground: "--ui-canvas",+ accent: "--ui-accent",+ line: "--ui-line",+};++export function readShaderColors(getValue: (name: string) => string): ShaderColors {+ const value = (name: string) => getValue(name).trim();+ return {+ ground: value(SHADER_COLOR_TOKENS.ground),+ accent: value(SHADER_COLOR_TOKENS.accent),+ line: value(SHADER_COLOR_TOKENS.line),+ };+}diff --git a/packages/ui-gallery/src/library/topics.ts b/packages/ui-gallery/src/library/topics.tsindex 54d71713..4a66bc3d 100644--- a/packages/ui-gallery/src/library/topics.ts+++ b/packages/ui-gallery/src/library/topics.ts@@ -30,6 +30,7 @@ export const TOPIC_IDS = ["content","layout","data",+ "shaders","colour","type","shape",@@ -68,6 +69,7 @@ export const TOPICS: readonly Topic[] = [component("content"),component("layout"),component("data"),+ component("shaders"),foundation("colour"),foundation("type"),foundation("shape"),diff --git a/packages/ui-gallery/src/strings-en.ts b/packages/ui-gallery/src/strings-en.tsindex 5f88dd22..58695076 100644--- a/packages/ui-gallery/src/strings-en.ts+++ b/packages/ui-gallery/src/strings-en.ts@@ -478,6 +478,11 @@ export const en: GalleryStrings = {title: "Data",description: "Tables, list rows, label/value pairs and the log view.",},+ shaders: {+ title: "Shaders",+ description:+ "GPU-drawn backdrops: the caller hands in the colours, and a device without WebGPU — or a reader who asked for less motion — draws the same colours as a static stand-in.",+ },colour: {title: "Colour",description: "Surfaces, inks, lines, the accent, the tones, chart series and code colours.",@@ -792,6 +797,23 @@ export const en: GalleryStrings = {progressOver: "Over the limit",progressIndeterminate: "Indeterminate",},+ shaders: {+ aurora: "Colour field",+ auroraHint:+ "Two colours drifting through oklab under a whisper of noise, so the wide grades do not band. The colours are props — the theme's own ground and accent are handed in here.",+ grid: "Dot grid",+ gridHint:+ "One colour, one pitch: the page's engineering paper. That colour is handed in too — the theme's separator ink here.",+ gridStill: "Still",+ gridTwinkle: "Twinkling",+ drawing: "What this box draws",+ drawingPending: "Asking the device…",+ drawingGpu: "A GPU canvas: this device's WebGPU works and the motion is running.",+ drawingStatic:+ "The stand-in: this device cannot draw it, or the system asked for less motion.",+ standInHint:+ "The stand-in is the caller's (here a flat gradient and a pattern of CSS dots), so a machine without a working GPU never shows a hole in the page.",+ },streaming: {reply: "Assistant reply",receiving: "Receiving…",diff --git a/packages/ui-gallery/src/strings.ts b/packages/ui-gallery/src/strings.tsindex 197653b3..9c342075 100644--- a/packages/ui-gallery/src/strings.ts+++ b/packages/ui-gallery/src/strings.ts@@ -461,6 +461,11 @@ export const zh = {description: "页面框架与页头、卡片与卡片头、分节、可折叠分节、实体头部,以及导航列表。",},data: { title: "数据", description: "表格、列表行、键值对与日志。" },+ shaders: {+ title: "着色器",+ description:+ "GPU 画的背景:颜色由调用方传进去,没有 WebGPU 或系统要求减少动效时,画的是同色的静态替身。",+ },colour: {title: "颜色",description: "表面、文字、线条、强调色、语义色调、图表序列与代码色。",@@ -754,6 +759,22 @@ export const zh = {progressOver: "超出上限",progressIndeterminate: "不定进度",},+ shaders: {+ aurora: "色彩场",+ auroraHint:+ "两色在 oklab 里流动,压一层很轻的噪点,免得大片渐变出现色带。颜色是 props —— 这里传的是当前主题的底色与强调色。",+ grid: "点阵",+ gridHint:+ "一个颜色、一个间距,页面的「工程纸」;颜色同样由调用方给,这里传当前主题的分隔线色。",+ gridStill: "静止",+ gridTwinkle: "微闪",+ drawing: "这一块现在画的是",+ drawingPending: "正在问设备…",+ drawingGpu: "GPU 画布:这台设备的 WebGPU 可用,动画在跑。",+ drawingStatic: "静态替身:这台设备画不了,或系统要求减少动效。",+ standInHint:+ "替身由调用方给(这里是同色的一个渐变与一排 CSS 点),所以显卡不行的时候页面也不会空一块。",+ },streaming: {reply: "助手回答",receiving: "正在接收…",diff --git a/packages/ui-gallery/test/library.test.ts b/packages/ui-gallery/test/library.test.tsindex 6d623bc7..581f5f40 100644--- a/packages/ui-gallery/test/library.test.ts+++ b/packages/ui-gallery/test/library.test.ts@@ -14,6 +14,7 @@ import {CHART_PALETTE_TOKENS,readChartTokens,} from "../src/library/chart-tokens";+import { SHADER_COLOR_TOKENS, readShaderColors } from "../src/library/shader-colors";import { DEMO_TREE, flattenTree } from "../src/library/demo-tree";import { LIBRARY_FRAME_PATH, libraryFrameSrc, parseLibraryParams } from "../src/library/frame";import {@@ -67,6 +68,7 @@ describe("the library's topics", () => {"content","layout","data",+ "shaders",]);const foundations = TOPIC_GROUPS.find((group) => group.id === "foundations")!.topics;expect(foundations.map((topic) => topic.id)).toEqual([@@ -363,6 +365,59 @@ describe("the layout and data boards", () => {});});+describe("the shaders board", () => {+ it("shows both backdrops from the package, with the theme's colours handed in as props", () => {+ const board = read("../src/library/boards/shaders.tsx");+ expect(board).toMatch(/from "@adelie\/ui";/);+ expect(board).not.toMatch(/web\/src/);+ // The gallery never reaches the shader library itself: it takes the package's backdrops.+ expect(board).not.toMatch(/node_modules|shaders\/react/);+ expect(board).toMatch(/<AuroraBackdrop/);+ expect(board).toMatch(/<DotGridBackdrop/);+ expect(board).toMatch(/colorA=\{colors\.ground\}/);+ expect(board).toMatch(/colorB=\{colors\.accent\}/);+ expect(board).toMatch(/color=\{colors\.line\}/);+ // Which of the two a box draws is observed off the box (the canvas is there or it is not),+ // never predicted: the support probe and the device are both async.+ expect(board).toMatch(/querySelector\("canvas"\)/);+ // And the box is handed over as state, not as a ref: the board renders it only after the+ // theme's colours arrive, so an effect keyed on a ref would still find it empty and settle+ // nothing (the line stayed blank until this was a state setter).+ expect(board).toMatch(/const \[box, setBox\] = useState<HTMLDivElement \| null>\(null\);/);+ expect(board).toMatch(/ref=\{setBox\}/);+ expect(board).not.toMatch(/box\.current/);+ });++ it("reads the theme's own colours, one token per backdrop colour", () => {+ const colors = readShaderColors((name) =>+ name === SHADER_COLOR_TOKENS.accent ? " #006838 " : "",+ );+ expect(colors.accent).toBe("#006838");+ expect(colors.ground).toBe("");+ expect(Object.values(SHADER_COLOR_TOKENS)).toEqual(["--ui-canvas", "--ui-accent", "--ui-line"]);+ });++ it("names every part in both dictionaries", () => {+ for (const S of [zh, en]) {+ const t = S.library.shaders;+ for (const text of [+ t.aurora,+ t.auroraHint,+ t.grid,+ t.gridHint,+ t.gridStill,+ t.gridTwinkle,+ t.drawing,+ t.drawingPending,+ t.drawingGpu,+ t.drawingStatic,+ t.standInHint,+ ])+ expect(text.trim()).not.toBe("");+ }+ });+});+describe("the library frame's sizing", () => {it("measures what is painted, overlays included, and swallows the resizes it asks for", () => {const page = read("../src/library/page.tsx");diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex 48ec64bc..1cbf4e32 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -47,6 +47,7 @@"remark-gfm": "^4.0.0","remark-math": "^6.0.0","remark-parse": "^11.0.0",+ "shaders": "^4.0.5","shiki": "^4.3.1","unified": "^11.0.5","zustand": "^5.0.15"diff --git a/packages/ui/src/components/shaders/aurora-backdrop/aurora-backdrop.tsx b/packages/ui/src/components/shaders/aurora-backdrop/aurora-backdrop.tsxnew file mode 100644index 00000000..63288ac3--- /dev/null+++ b/packages/ui/src/components/shaders/aurora-backdrop/aurora-backdrop.tsx@@ -0,0 +1,67 @@+/**+ * A soft colour field that drifts on its own — the backdrop for a surface with nothing on it yet+ * (the new-chat page, a sign-in page, an empty Project): mesh-gradient swaths under a whisper of+ * noise, so the flat areas are not flat.+ *+ * **The colours are required props.** A GPU canvas cannot read a CSS custom property, so nothing+ * here can be a token, and a colour of this component's own would be a colour outside the theme:+ * the caller hands over the two it wants (the gallery reads the active theme's own ground and+ * accent off the frame root), which is how an app that wants its theme's colours does it too.+ *+ * `cursor` adds the library's trail behind the pointer. It is off by default: a page-wide backdrop+ * that answers the pointer is a personality, not a default, and it should only be switched on where+ * the pointer really is on the backdrop rather than on top of a dense UI.+ *+ * `speed` is the library's own 0–5 scale (0.6 is a slow drift); `grain` keeps the noise layer that+ * hides banding in the large, evenly-graded areas.+ */+import { CursorTrail, MeshGradient, SimplexNoise } from "shaders/react";+import { ShaderSurface } from "../shader-surface/shader-surface";++export interface AuroraBackdropProps {+ /** Sizing and placement; `absolute inset-0` is the usual one for a backdrop. */+ className?: string;+ /** The first colour, usually the theme's ground (`--ui-canvas`). Required: see the note above. */+ colorA: string;+ /** The second colour, usually the theme's accent (`--ui-accent`). Returns in the cursor trail. */+ colorB: string;+ /** Drift speed on the library's 0–5 scale. */+ speed?: number;+ /** The noise layer that hides banding in the graded areas. */+ grain?: boolean;+ /** A trail behind the pointer, for a backdrop that genuinely holds the pointer. */+ cursor?: boolean;+}++/** The library reads `oklab` here, so a two-stop gradient keeps its contrast through the middle+ * instead of greying out. */+const COLOR_SPACE = "oklab";++export function AuroraBackdrop({+ className,+ colorA,+ colorB,+ speed = 0.6,+ grain = true,+ cursor = false,+}: AuroraBackdropProps) {+ return (+ <ShaderSurface+ className={className}+ standIn={+ // The same two colours at a single angle: the resting frame of the field above, so a device+ // without a GPU shows the backdrop rather than a hole.+ <div+ className="h-full w-full"+ style={{ backgroundImage: `linear-gradient(135deg, ${colorA}, ${colorB})` }}+ />+ }+ >+ <MeshGradient colorA={colorA} colorB={colorB} colorSpace={COLOR_SPACE} speed={speed} />+ {grain && <SimplexNoise scale={3} speed={0.5} opacity={0.12} blendMode="softLight" />}+ {cursor && (+ <CursorTrail colorA={colorA} colorB={colorB} radius={0.3} length={0.4} opacity={0.5} />+ )}+ </ShaderSurface>+ );+}diff --git a/packages/ui/src/components/shaders/dot-grid-backdrop/dot-grid-backdrop.tsx b/packages/ui/src/components/shaders/dot-grid-backdrop/dot-grid-backdrop.tsxnew file mode 100644index 00000000..404fabed--- /dev/null+++ b/packages/ui/src/components/shaders/dot-grid-backdrop/dot-grid-backdrop.tsx@@ -0,0 +1,65 @@+/**+ * A faint dot grid — engineering paper under a surface that should not read as empty, without+ * decorating it. Where `AuroraBackdrop` is about colour, this one is about structure: one colour,+ * one pitch, and nothing moving unless the caller asks for `twinkle`.+ *+ * `color` is a required prop, for the same reason as everywhere in this family — a GPU canvas+ * cannot read a CSS custom property, so nothing here can be a token and nothing here can carry a+ * colour of its own. The caller hands one in: the theme's own line or muted-ink colour at a low+ * `opacity` is what keeps the grid faint in both modes.+ *+ * `density` counts dots down the canvas (the width fits as many as the aspect ratio allows), so the+ * pitch follows the box; `dotSize` is the library's 0–1 share of a cell.+ */+import { DotGrid } from "shaders/react";+import { ShaderSurface } from "../shader-surface/shader-surface";++export interface DotGridBackdropProps {+ /** Sizing and placement; `absolute inset-0` is the usual one for a backdrop. */+ className?: string;+ /** The dot colour, required: the theme's line or muted ink reads right in either mode. */+ color: string;+ /** Dots down the canvas height (1–200). */+ density?: number;+ /** Each dot's share of its cell, 0–1. */+ dotSize?: number;+ /** Dot opacity, 0–1: the grid's faintness, independent of its colour. */+ opacity?: number;+ /** Per-dot twinkle intensity, 0–1; 0 is a still grid. */+ twinkle?: number;+}++export function DotGridBackdrop({+ className,+ color,+ density = 30,+ dotSize = 0.22,+ opacity = 0.5,+ twinkle = 0,+}: DotGridBackdropProps) {+ return (+ <ShaderSurface+ className={className}+ standIn={+ // The still grid, drawn with CSS: the same colour, dots at their library default of 30 down+ // the box, on a square pitch.+ <div+ className="h-full w-full"+ style={{+ backgroundImage: `radial-gradient(circle, ${color} 1px, transparent 1.5px)`,+ backgroundSize: "calc(100% / 30) calc(100% / 30)",+ opacity,+ }}+ />+ }+ >+ <DotGrid+ color={color}+ density={density}+ dotSize={dotSize}+ opacity={opacity}+ twinkle={twinkle}+ />+ </ShaderSurface>+ );+}diff --git a/packages/ui/src/components/shaders/shader-support.ts b/packages/ui/src/components/shaders/shader-support.tsnew file mode 100644index 00000000..9d86da96--- /dev/null+++ b/packages/ui/src/components/shaders/shader-support.ts@@ -0,0 +1,84 @@+/**+ * Which of the two things a shader visual draws: the WebGPU canvas, or the static stand-in the+ * caller handed it.+ *+ * Shaders is WebGPU-only, and its canvas has nothing to announce when it cannot start, so the+ * decision is made here rather than left to the library: a decorative background must never be+ * the reason a page looks broken.+ *+ * - **The probe.** `getWebGPUSupport()` asks the browser for an adapter — cheap, side-effect-free+ * and cached for the page by the library — and that answer, not the bare presence of+ * `navigator.gpu`, is what matters: a blocklisted driver, a headless browser or a machine whose+ * device request fails all leave a canvas that stays transparent for good. A probe that throws+ * is read as "not supported": the stand-in is the safe side of that call.+ * - **Reduce motion.** The library renders every frame and no prop stops it, so a reader who asked+ * their system for less motion gets the stand-in — the resting frame — rather than motion that+ * has to be endured.+ * - **The first paint is always the stand-in.** The probe is async, and guessing it would flip the+ * markup after hydration; the stand-in costs one paint and is usually what a caller wanted on+ * screen first anyway.+ *+ * `reportUnavailable` is the canvas's own word: the library calls `onUnavailable` when this device+ * cannot run the composition after all (device lost, out of memory, a limit exceeded), and the+ * surface then falls back to the stand-in for good.+ */+import { useCallback, useEffect, useState } from "react";+import { getWebGPUSupport } from "shaders/react";+import { usePrefersReducedMotion } from "../../motion/use-reduced-motion";++/** What a shader visual draws right now. */+export type ShaderRenderMode = "static" | "gpu";++/** The page's WebGPU verdict, before it is known. */+export type ShaderProbe = "unknown" | "supported" | "unsupported";++export interface ShaderRenderInput {+ probe: ShaderProbe;+ reducedMotion: boolean;+ /** The canvas reported that this device cannot run it (`Shader`'s `onUnavailable`). */+ unavailable: boolean;+}++/** The decision table, as a pure function: only a live, permitted, still-running device draws. */+export function shaderRenderMode({+ probe,+ reducedMotion,+ unavailable,+}: ShaderRenderInput): ShaderRenderMode {+ return probe === "supported" && !reducedMotion && !unavailable ? "gpu" : "static";+}++export interface ShaderSurfaceMode {+ mode: ShaderRenderMode;+ /** The canvas could not run: stay on the stand-in. */+ reportUnavailable: () => void;+}++/**+ * The live form of the table: probes once after mount (never during a render, so the stand-in is+ * what the server and the first paint produce), and remembers a refusal from the canvas.+ */+export function useShaderSurfaceMode(): ShaderSurfaceMode {+ const reducedMotion = usePrefersReducedMotion();+ const [probe, setProbe] = useState<ShaderProbe>("unknown");+ const [unavailable, setUnavailable] = useState(false);++ useEffect(() => {+ // Asking for an adapter under reduce-motion would be work for an answer nothing uses.+ if (reducedMotion) return;+ let alive = true;+ getWebGPUSupport()+ .then((info) => {+ if (alive) setProbe(info.supported ? "supported" : "unsupported");+ })+ .catch(() => {+ if (alive) setProbe("unsupported");+ });+ return () => {+ alive = false;+ };+ }, [reducedMotion]);++ const reportUnavailable = useCallback(() => setUnavailable(true), []);+ return { mode: shaderRenderMode({ probe, reducedMotion, unavailable }), reportUnavailable };+}diff --git a/packages/ui/src/components/shaders/shader-surface/shader-surface.tsx b/packages/ui/src/components/shaders/shader-surface/shader-surface.tsxnew file mode 100644index 00000000..225478ef--- /dev/null+++ b/packages/ui/src/components/shaders/shader-surface/shader-surface.tsx@@ -0,0 +1,43 @@+/**+ * The base every shader visual in this package is built on: the WebGPU canvas from the `shaders`+ * package, or the stand-in its caller handed it when this device cannot draw one (`shader-support.ts`+ * decides which, and why).+ *+ * Two rules come with the box, both from the library's own contract:+ *+ * - **`className` sizes the box, never the canvas.** A shader canvas has no size of its own — it+ * fills its container and follows it on resize — so the placement is a class on this element and+ * the canvas is stretched inside it.+ * - **The box is `aria-hidden`.** An effect is decoration: it carries no text and nothing about it+ * is worth announcing, in either mode.+ *+ * The stand-in is the caller's, because only the caller knows what its effect was for: this+ * component draws whatever it was handed, in the same box, with the same class.+ */+import type { ReactNode } from "react";+import { Shader } from "shaders/react";+import { useShaderSurfaceMode } from "../shader-support";++export interface ShaderSurfaceProps {+ /** Sizing and placement for the box the canvas fills — the canvas has no size of its own. */+ className?: string;+ /** The layers, bottom to top: the `shaders` package's own components, composed as siblings. */+ children?: ReactNode;+ /** What stands on the box without a working GPU, and under reduce-motion. */+ standIn?: ReactNode;+}++export function ShaderSurface({ className, children, standIn }: ShaderSurfaceProps) {+ const { mode, reportUnavailable } = useShaderSurfaceMode();+ return (+ <div className={className} aria-hidden="true">+ {mode === "gpu" ? (+ <Shader className="h-full w-full" onUnavailable={reportUnavailable}>+ {children}+ </Shader>+ ) : (+ standIn+ )}+ </div>+ );+}diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.tsindex 4664b19e..8b103819 100644--- a/packages/ui/src/index.ts+++ b/packages/ui/src/index.ts@@ -225,3 +225,11 @@ export * from "./components/shell/rail/rail";export * from "./components/shell/mobile-top-bar/mobile-top-bar";export * from "./components/shell/sidebar-frame/sidebar-frame";export * from "./components/shell/session-row/session-row";++// Shaders (new here, not a migration wave) — the WebGPU backdrop family built on the `shaders`+// package: the box a canvas fills and the decision of whether this device draws one at all, then+// the two backdrops composed from it.+export * from "./components/shaders/shader-support";+export * from "./components/shaders/shader-surface/shader-surface";+export * from "./components/shaders/aurora-backdrop/aurora-backdrop";+export * from "./components/shaders/dot-grid-backdrop/dot-grid-backdrop";diff --git a/packages/ui/test/shaders.test.ts b/packages/ui/test/shaders.test.tsnew file mode 100644index 00000000..96e1789d--- /dev/null+++ b/packages/ui/test/shaders.test.ts@@ -0,0 +1,123 @@+/**+ * The shader family: the table that decides between the GPU canvas and the stand-in, the box the+ * canvas fills (with the stand-in inside it), and the two backdrops.+ *+ * A canvas cannot be drawn in this suite's Node environment, so what is asserted here is what can+ * be: the decision itself as a pure function, the markup of the stand-in path, and the composition+ * of each backdrop read at the source — the layers, their props and where they are imported from.+ */+import { readFileSync } from "node:fs";+import { fileURLToPath } from "node:url";+import { createElement } from "react";+import { describe, expect, it } from "vitest";+import { AuroraBackdrop } from "../src/components/shaders/aurora-backdrop/aurora-backdrop";+import { DotGridBackdrop } from "../src/components/shaders/dot-grid-backdrop/dot-grid-backdrop";+import { shaderRenderMode } from "../src/components/shaders/shader-support";+import type { ShaderRenderInput } from "../src/components/shaders/shader-support";+import { ShaderSurface } from "../src/components/shaders/shader-surface/shader-surface";+import { renderStatic } from "../src/testing";++const read = (rel: string) => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), "utf8");++const FAMILY = [+ "../src/components/shaders/shader-surface/shader-surface.tsx",+ "../src/components/shaders/aurora-backdrop/aurora-backdrop.tsx",+ "../src/components/shaders/dot-grid-backdrop/dot-grid-backdrop.tsx",+] as const;++describe("shaderRenderMode", () => {+ it("draws on the GPU for exactly one combination: supported, still running, motion allowed", () => {+ const rows: [ShaderRenderInput, string][] = [];+ for (const probe of ["unknown", "supported", "unsupported"] as const) {+ for (const reducedMotion of [false, true]) {+ for (const unavailable of [false, true]) {+ const input = { probe, reducedMotion, unavailable };+ rows.push([input, shaderRenderMode(input)]);+ }+ }+ }+ expect(rows.filter(([, mode]) => mode === "gpu")).toEqual([+ [{ probe: "supported", reducedMotion: false, unavailable: false }, "gpu"],+ ]);+ });+});++describe("ShaderSurface", () => {+ it("draws the caller's stand-in inside the box it was given, before any device is known", () => {+ const html = renderStatic(+ createElement(ShaderSurface, {+ className: "absolute inset-0",+ standIn: createElement("div", { className: "stand-in" }),+ }),+ );+ expect(html).toContain('class="absolute inset-0"');+ expect(html).toContain('class="stand-in"');+ });++ it("hides the box from assistive technology in both modes, and mounts no canvas here", () => {+ const html = renderStatic(createElement(ShaderSurface, {}));+ expect(html).toContain('aria-hidden="true"');+ // The suite has no DOM and no WebGPU: the canvas must not appear at all.+ expect(html).not.toContain("<canvas");+ expect(html).not.toContain("data-renderer");+ });++ it("mounts the library's canvas only on the GPU branch, stretched to the box", () => {+ const src = read("../src/components/shaders/shader-surface/shader-surface.tsx");+ expect(src).toMatch(/import \{ Shader \} from "shaders\/react";/);+ expect(src).toMatch(/mode === "gpu" \? \(/);+ expect(src).toMatch(/<Shader className="h-full w-full" onUnavailable=\{reportUnavailable\}>/);+ });+});++describe("the backdrops", () => {+ it("AuroraBackdrop stands in with the two colours it was handed, as one gradient", () => {+ const html = renderStatic(+ createElement(AuroraBackdrop, {+ className: "h-40 w-full",+ colorA: "#111827",+ colorB: "#3b82f6",+ }),+ );+ expect(html).toContain("linear-gradient(135deg, #111827, #3b82f6)");+ expect(html).toContain('class="h-40 w-full"');+ const src = read("../src/components/shaders/aurora-backdrop/aurora-backdrop.tsx");+ for (const layer of ["<MeshGradient", "<SimplexNoise", "<CursorTrail"])+ expect(src).toContain(layer);+ // The grain is on by default and the cursor trail is not: a page-wide trail is a personality.+ expect(src).toMatch(/grain = true/);+ expect(src).toMatch(/cursor = false/);+ });++ it("DotGridBackdrop stands in with the same dots drawn in CSS", () => {+ const html = renderStatic(+ createElement(DotGridBackdrop, { className: "h-40 w-full", color: "#94a3b8" }),+ );+ expect(html).toContain("radial-gradient(circle, #94a3b8 1px, transparent 1.5px)");+ expect(html).toContain('class="h-40 w-full"');+ const src = read("../src/components/shaders/dot-grid-backdrop/dot-grid-backdrop.tsx");+ expect(src).toMatch(/<DotGrid\s+color=\{color\}\s+density=\{density\}/);+ // A still grid is the default; the twinkle is the caller's choice.+ expect(src).toMatch(/twinkle = 0/);+ });++ it("hold no colour of their own: every colour is a required prop", () => {+ // A canvas cannot read a CSS custom property and no colour may leave the theme (deslop rule+ // 20), so a colour default here would be a colour outside every theme. Required, not optional.+ const aurora = read("../src/components/shaders/aurora-backdrop/aurora-backdrop.tsx");+ expect(aurora).toMatch(/colorA: string;/);+ expect(aurora).toMatch(/colorB: string;/);+ expect(aurora).not.toMatch(/colorA = "|colorB = "/);+ const grid = read("../src/components/shaders/dot-grid-backdrop/dot-grid-backdrop.tsx");+ expect(grid).toMatch(/\n {2}color: string;/);+ expect(grid).not.toMatch(/color = "/);+ });++ it("import their layers from the package, never from its dist or node_modules", () => {+ for (const file of FAMILY) {+ const src = read(file);+ expect(src, file).not.toMatch(/node_modules|shaders\/dist|\.\.\/\.\.\/\.\.\/\.\.\/\.\./);+ }+ for (const file of FAMILY.slice(1)) expect(read(file)).toContain('from "shaders/react"');+ });+});diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex ff508ba9..14352f73 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -75,6 +75,9 @@ importers:'@adelie/continual-learning':specifier: workspace:*version: link:../../plugins/continual-learning+ '@adelie/core':+ specifier: workspace:*+ version: link:../core'@adelie/csu-mail':specifier: workspace:*version: link:../../plugins/csu-mail@@ -93,15 +96,12 @@ importers:'@adelie/model-development':specifier: workspace:*version: link:../../plugins/model-development- '@adelie/core':+ '@adelie/requirements-box':specifier: workspace:*- version: link:../core+ version: link:../../plugins/requirements-box'@adelie/server':specifier: workspace:*version: file:packages/server([email protected])([email protected])- '@adelie/requirements-box':- specifier: workspace:*- version: link:../../plugins/requirements-box'@adelie/skill-porting':specifier: workspace:*version: link:../../plugins/skill-porting@@ -422,18 +422,18 @@ importers:packages/server:dependencies:- '@hono/node-server':- specifier: '>=2.0.5'- version: 2.0.12([email protected])- '@larksuiteoapi/node-sdk':- specifier: ^1.73.0'@adelie/amsp':specifier: workspace:*version: link:../amsp'@adelie/core':specifier: workspace:*version: file:packages/core([email protected])([email protected])+ '@hono/node-server':+ specifier: '>=2.0.5'+ version: 2.0.12([email protected])+ '@larksuiteoapi/node-sdk':+ specifier: ^1.73.0'@xterm/headless':specifier: ^5.5.0version: 5.5.0@@ -543,6 +543,9 @@ importers:remark-parse:specifier: ^11.0.0version: 11.0.0([email protected])+ shaders:+ specifier: ^4.0.5shiki:specifier: ^4.3.1version: 4.3.1@@ -582,7 +585,7 @@ importers:dependencies:'@adelie/ui':specifier: workspace:*- version: link:../ui+ version: file:packages/ui(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])react:specifier: ^19.1.0version: 19.2.7@@ -637,7 +640,7 @@ importers:version: file:packages/core([email protected])([email protected])'@adelie/ui':specifier: workspace:*- version: link:../ui+ version: file:packages/ui(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])'@xterm/addon-clipboard':specifier: ^0.1.0version: 0.1.0(@xterm/[email protected])@@ -760,12 +763,12 @@ importers:specifier: ^3.1.0version: 3.1.6devDependencies:- '@deepseek-ai/dsh-sandbox':- specifier: 0.1.0-rc.7- version: 0.1.0-rc.7(@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected]))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])))(@deepseek-ai/[email protected](@deepseek-ai/[email protected]))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected]))))(@deepseek-ai/[email protected](fbdb1d988541b64ff002d18c4ded7293))'@adelie/core':specifier: workspace:*version: file:packages/core([email protected])([email protected])+ '@deepseek-ai/dsh-sandbox':+ specifier: 0.1.0-rc.7+ version: 0.1.0-rc.7(@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected]))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected])))(@deepseek-ai/[email protected](@deepseek-ai/[email protected]))(@deepseek-ai/[email protected](@deepseek-ai/[email protected])(@deepseek-ai/[email protected](@deepseek-ai/[email protected]))))(@deepseek-ai/[email protected](fbdb1d988541b64ff002d18c4ded7293))tsup:specifier: ^8.3.0version: 8.5.1([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])@@ -815,6 +818,92 @@ importers:packages:+ '@adelie/agent-company@file:plugins/agent-company':+ resolution: {directory: plugins/agent-company, type: directory}++ '@adelie/agent-development@file:plugins/agent-development':+ resolution: {directory: plugins/agent-development, type: directory}++ '@adelie/agent-tuning@file:plugins/agent-tuning':+ resolution: {directory: plugins/agent-tuning, type: directory}++ '@adelie/amsp@file:packages/amsp':+ resolution: {directory: packages/amsp, type: directory}+ engines: {node: '>=24'}++ '@adelie/browser-automation@file:plugins/browser-automation':+ resolution: {directory: plugins/browser-automation, type: directory}++ '@adelie/cli@file:packages/cli':+ resolution: {directory: packages/cli, type: directory}+ engines: {node: '>=24'}+ hasBin: true++ '@adelie/continual-learning@file:plugins/continual-learning':+ resolution: {directory: plugins/continual-learning, type: directory}++ '@adelie/core@file:packages/core':+ resolution: {directory: packages/core, type: directory}+ engines: {node: '>=24'}++ '@adelie/csu-mail@file:plugins/csu-mail':+ resolution: {directory: plugins/csu-mail, type: directory}++ '@adelie/data-analysis@file:plugins/data-analysis':+ resolution: {directory: plugins/data-analysis, type: directory}++ '@adelie/goal@file:plugins/goal':+ resolution: {directory: plugins/goal, type: directory}++ '@adelie/hmr@file:packages/hmr':+ resolution: {directory: packages/hmr, type: directory}++ '@adelie/humanizer@file:plugins/humanizer':+ resolution: {directory: plugins/humanizer, type: directory}++ '@adelie/lesson-video@file:plugins/lesson-video':+ resolution: {directory: plugins/lesson-video, type: directory}++ '@adelie/model-development@file:plugins/model-development':+ resolution: {directory: plugins/model-development, type: directory}++ '@adelie/requirements-box@file:plugins/requirements-box':+ resolution: {directory: plugins/requirements-box, type: directory}++ '@adelie/server@file:packages/server':+ resolution: {directory: packages/server, type: directory}+ engines: {node: '>=24'}++ '@adelie/skill-porting@file:plugins/skill-porting':+ resolution: {directory: plugins/skill-porting, type: directory}++ '@adelie/software-development@file:plugins/software-development':+ resolution: {directory: plugins/software-development, type: directory}++ '@adelie/ui@file:packages/ui':+ resolution: {directory: packages/ui, type: directory}+ peerDependencies:+ react: ^19.1.0+ react-dom: ^19.1.0++ '@adelie/use-bento-slides@file:plugins/use-bento-slides':+ resolution: {directory: plugins/use-bento-slides, type: directory}++ '@adelie/use-claude-code@file:plugins/use-claude-code':+ resolution: {directory: plugins/use-claude-code, type: directory}++ '@adelie/use-firecrawl@file:plugins/use-firecrawl':+ resolution: {directory: plugins/use-firecrawl, type: directory}++ '@adelie/use-offerdao@file:plugins/use-offerdao':+ resolution: {directory: plugins/use-offerdao, type: directory}++ '@adelie/use-wps-office@file:plugins/use-wps-office':+ resolution: {directory: plugins/use-wps-office, type: directory}++ '@adelie/wechat-miniprogram@file:plugins/wechat-miniprogram':+ resolution: {directory: plugins/wechat-miniprogram, type: directory}+'@ampproject/[email protected]':resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}engines: {node: '>=6.0.0'}@@ -1504,86 +1593,6 @@ packages:'@larksuiteoapi/[email protected]':resolution: {integrity: sha512-gs4EiupJ6RdYAEJGtuYrCVsB7wSMBwtUDK+ilpmOHD6RTvbtciW6AWciQO9coOQVuBZfh7hvAi25dPfCsny/nA==}- '@adelie/agent-company@file:plugins/agent-company':- resolution: {directory: plugins/agent-company, type: directory}-- '@adelie/agent-development@file:plugins/agent-development':- resolution: {directory: plugins/agent-development, type: directory}-- '@adelie/agent-tuning@file:plugins/agent-tuning':- resolution: {directory: plugins/agent-tuning, type: directory}-- '@adelie/amsp@file:packages/amsp':- resolution: {directory: packages/amsp, type: directory}- engines: {node: '>=24'}-- '@adelie/browser-automation@file:plugins/browser-automation':- resolution: {directory: plugins/browser-automation, type: directory}-- '@adelie/continual-learning@file:plugins/continual-learning':- resolution: {directory: plugins/continual-learning, type: directory}-- '@adelie/csu-mail@file:plugins/csu-mail':- resolution: {directory: plugins/csu-mail, type: directory}-- '@adelie/data-analysis@file:plugins/data-analysis':- resolution: {directory: plugins/data-analysis, type: directory}-- '@adelie/goal@file:plugins/goal':- resolution: {directory: plugins/goal, type: directory}-- '@adelie/humanizer@file:plugins/humanizer':- resolution: {directory: plugins/humanizer, type: directory}-- '@adelie/lesson-video@file:plugins/lesson-video':- resolution: {directory: plugins/lesson-video, type: directory}-- '@adelie/model-development@file:plugins/model-development':- resolution: {directory: plugins/model-development, type: directory}-- '@adelie/cli@file:packages/cli':- resolution: {directory: packages/cli, type: directory}- engines: {node: '>=24'}- hasBin: true-- '@adelie/core@file:packages/core':- resolution: {directory: packages/core, type: directory}- engines: {node: '>=24'}-- '@adelie/hmr@file:packages/hmr':- resolution: {directory: packages/hmr, type: directory}-- '@adelie/server@file:packages/server':- resolution: {directory: packages/server, type: directory}- engines: {node: '>=24'}-- '@adelie/requirements-box@file:plugins/requirements-box':- resolution: {directory: plugins/requirements-box, type: directory}-- '@adelie/skill-porting@file:plugins/skill-porting':- resolution: {directory: plugins/skill-porting, type: directory}-- '@adelie/software-development@file:plugins/software-development':- resolution: {directory: plugins/software-development, type: directory}-- '@adelie/use-bento-slides@file:plugins/use-bento-slides':- resolution: {directory: plugins/use-bento-slides, type: directory}-- '@adelie/use-claude-code@file:plugins/use-claude-code':- resolution: {directory: plugins/use-claude-code, type: directory}-- '@adelie/use-firecrawl@file:plugins/use-firecrawl':- resolution: {directory: plugins/use-firecrawl, type: directory}-- '@adelie/use-offerdao@file:plugins/use-offerdao':- resolution: {directory: plugins/use-offerdao, type: directory}-- '@adelie/use-wps-office@file:plugins/use-wps-office':- resolution: {directory: plugins/use-wps-office, type: directory}-- '@adelie/wechat-miniprogram@file:plugins/wechat-miniprogram':- resolution: {directory: plugins/wechat-miniprogram, type: directory}-'@malept/[email protected]':resolution: {integrity: sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==}engines: {node: '>= 12.13.0'}@@ -4220,6 +4229,48 @@ packages:resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}+ resolution: {integrity: sha512-NB+/RiK0oydteeeKdPqsLpR3iSoDTvt8bsdgw2wPb697QVCY/yadZV8gitCyCQx5t/kb4nJicIR+cbG9Q6JFfQ==}+ hasBin: true+ peerDependencies:+ react: ^18.0.0 || ^19.0.0+ react-dom: ^18.0.0 || ^19.0.0+ solid-js: ^1.8.0+ svelte: ^5+ vue: ^3.5.0+ peerDependenciesMeta:+ react:+ optional: true+ react-dom:+ optional: true+ solid-js:+ optional: true+ svelte:+ optional: true+ vue:+ optional: true++ resolution: {integrity: sha512-1muVyMI5NGkv/+/QpHD9wY2HfmxeWq3MBDT3ERFBTStCSzikSBravuTaGv3B1nz0rXccvv3C0xp3lmvfptu3Zg==}+ hasBin: true+ peerDependencies:+ react: ^18.0.0 || ^19.0.0+ react-dom: ^18.0.0 || ^19.0.0+ solid-js: ^1.8.0+ svelte: ^5+ vue: ^3.5.0+ peerDependenciesMeta:+ react:+ optional: true+ react-dom:+ optional: true+ solid-js:+ optional: true+ svelte:+ optional: true+ vue:+ optional: true+resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}engines: {node: '>=8'}@@ -4398,6 +4449,10 @@ packages:resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}+ resolution: {integrity: sha512-81EcMHTCQ2IPweOGk9SpMgjbenR9ZJRsAE84btEv0DhvVKwhe7qBy28hWgatoXa9ppWzmtpHiJ+e86SiaAtY6w==}+ engines: {node: '>=12.20.0'}+resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}@@ -4453,6 +4508,9 @@ packages:resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}+ resolution: {integrity: sha512-FHHwMJzZbnP23+fU1PxXljy7j0RRRosL2r1/CRUNTqfW+l7m35JsUkM615x/cAzw4GqRdXPIl3axKMj9qzpZtQ==}+resolution: {integrity: sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==}engines: {node: '>=18'}@@ -4485,6 +4543,14 @@ packages:resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}engines: {node: '>= 0.6'}+ resolution: {integrity: sha512-ivy9nisfsBhugH6OrygtdYI28c28mo7AFeB85COUzGG6MmuViFQPz4ylmDHNjAI3P12EAxWhqtjLsdYWfCj6xQ==}++ resolution: {integrity: sha512-zYwQEhnPPwhq5vQKmollXRK1LCVjStOnL+2B0PiebqvAzYPr25rPNR4r3olLoow5sKKjyj3kzHKEcpD5SyDzGQ==}+ engines: {node: '>=12.20.0'}+ hasBin: true+resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}engines: {node: '>=14.17'}@@ -4778,43 +4844,291 @@ packages:snapshots:- '@ampproject/[email protected]':- dependencies:- '@jridgewell/gen-mapping': 0.3.13- '@jridgewell/trace-mapping': 0.3.31+ '@adelie/agent-company@file:plugins/agent-company': {}- '@anthropic-ai/[email protected]([email protected])':- dependencies:- '@anthropic-ai/sdk': 0.91.1([email protected])- '@aws-crypto/sha256-js': 4.0.0- '@aws-sdk/client-bedrock-runtime': 3.1068.0- '@aws-sdk/credential-providers': 3.1068.0- '@smithy/eventstream-serde-node': 2.2.0- '@smithy/fetch-http-handler': 5.4.7- '@smithy/protocol-http': 3.3.0- '@smithy/signature-v4': 3.1.2- '@smithy/smithy-client': 2.5.1- '@smithy/types': 2.12.0- '@smithy/util-base64': 2.3.0- transitivePeerDependencies:- - zod+ '@adelie/agent-development@file:plugins/agent-development': {}- '@anthropic-ai/[email protected]([email protected])':- dependencies:- json-schema-to-ts: 3.1.1- optionalDependencies:- zod: 4.4.3+ '@adelie/agent-tuning@file:plugins/agent-tuning': {}- '@ark/[email protected]':- dependencies:- '@ark/util': 0.56.2+ '@adelie/amsp@file:packages/amsp': {}- '@ark/[email protected]': {}+ '@adelie/browser-automation@file:plugins/browser-automation': {}- '@aws-crypto/[email protected]':+ '@adelie/cli@file:packages/cli([email protected])':dependencies:- '@aws-crypto/util': 3.0.0- '@aws-sdk/types': 3.973.12+ '@adelie/agent-company': file:plugins/agent-company+ '@adelie/agent-development': file:plugins/agent-development+ '@adelie/agent-tuning': file:plugins/agent-tuning+ '@adelie/browser-automation': file:plugins/browser-automation+ '@adelie/continual-learning': file:plugins/continual-learning+ '@adelie/core': file:packages/core([email protected])([email protected])+ '@adelie/csu-mail': file:plugins/csu-mail+ '@adelie/data-analysis': file:plugins/data-analysis+ '@adelie/goal': file:plugins/goal+ '@adelie/humanizer': file:plugins/humanizer+ '@adelie/lesson-video': file:plugins/lesson-video+ '@adelie/model-development': file:plugins/model-development+ '@adelie/requirements-box': file:plugins/requirements-box+ '@adelie/server': file:packages/server([email protected])+ '@adelie/skill-porting': file:plugins/skill-porting+ '@adelie/software-development': file:plugins/software-development+ '@adelie/use-bento-slides': file:plugins/use-bento-slides+ '@adelie/use-claude-code': file:plugins/use-claude-code+ '@adelie/use-firecrawl': file:plugins/use-firecrawl+ '@adelie/use-offerdao': file:plugins/use-offerdao+ '@adelie/use-wps-office': file:plugins/use-wps-office+ '@adelie/wechat-miniprogram': file:plugins/wechat-miniprogram+ '@modelcontextprotocol/client': 2.0.0+ '@prismshadow/agenthub': 0.4.15([email protected])([email protected])+ commander: 13.1.0+ dotenv: 17.4.2+ smol-toml: 1.6.1+ yaml: 2.9.0+ transitivePeerDependencies:+ - '@modelcontextprotocol/sdk'+ - bufferutil+ - debug+ - supports-color+ - utf-8-validate+ - ws+ - zod++ '@adelie/continual-learning@file:plugins/continual-learning': {}++ '@adelie/core@file:packages/core([email protected])([email protected])':+ dependencies:+ '@adelie/agent-company': file:plugins/agent-company+ '@adelie/agent-development': file:plugins/agent-development+ '@adelie/agent-tuning': file:plugins/agent-tuning+ '@adelie/browser-automation': file:plugins/browser-automation+ '@adelie/continual-learning': file:plugins/continual-learning+ '@adelie/csu-mail': file:plugins/csu-mail+ '@adelie/data-analysis': file:plugins/data-analysis+ '@adelie/goal': file:plugins/goal+ '@adelie/humanizer': file:plugins/humanizer+ '@adelie/lesson-video': file:plugins/lesson-video+ '@adelie/model-development': file:plugins/model-development+ '@adelie/requirements-box': file:plugins/requirements-box+ '@adelie/skill-porting': file:plugins/skill-porting+ '@adelie/software-development': file:plugins/software-development+ '@adelie/use-bento-slides': file:plugins/use-bento-slides+ '@adelie/use-claude-code': file:plugins/use-claude-code+ '@adelie/use-firecrawl': file:plugins/use-firecrawl+ '@adelie/use-offerdao': file:plugins/use-offerdao+ '@adelie/use-wps-office': file:plugins/use-wps-office+ '@adelie/wechat-miniprogram': file:plugins/wechat-miniprogram+ '@modelcontextprotocol/client': 2.0.0+ '@prismshadow/agenthub': 0.4.15([email protected])([email protected])+ arktype: 2.2.3+ smol-toml: 1.6.1+ yaml: 2.9.0+ transitivePeerDependencies:+ - '@modelcontextprotocol/sdk'+ - bufferutil+ - supports-color+ - utf-8-validate+ - ws+ - zod++ dependencies:+ '@adelie/agent-company': file:plugins/agent-company+ '@adelie/agent-development': file:plugins/agent-development+ '@adelie/agent-tuning': file:plugins/agent-tuning+ '@adelie/browser-automation': file:plugins/browser-automation+ '@adelie/continual-learning': file:plugins/continual-learning+ '@adelie/csu-mail': file:plugins/csu-mail+ '@adelie/data-analysis': file:plugins/data-analysis+ '@adelie/goal': file:plugins/goal+ '@adelie/humanizer': file:plugins/humanizer+ '@adelie/lesson-video': file:plugins/lesson-video+ '@adelie/model-development': file:plugins/model-development+ '@adelie/requirements-box': file:plugins/requirements-box+ '@adelie/skill-porting': file:plugins/skill-porting+ '@adelie/software-development': file:plugins/software-development+ '@adelie/use-bento-slides': file:plugins/use-bento-slides+ '@adelie/use-claude-code': file:plugins/use-claude-code+ '@adelie/use-firecrawl': file:plugins/use-firecrawl+ '@adelie/use-offerdao': file:plugins/use-offerdao+ '@adelie/use-wps-office': file:plugins/use-wps-office+ '@adelie/wechat-miniprogram': file:plugins/wechat-miniprogram+ '@modelcontextprotocol/client': 2.0.0+ arktype: 2.2.3+ smol-toml: 1.6.1+ yaml: 2.9.0+ transitivePeerDependencies:+ - '@modelcontextprotocol/sdk'+ - bufferutil+ - supports-color+ - utf-8-validate+ - ws+ - zod++ '@adelie/csu-mail@file:plugins/csu-mail': {}++ '@adelie/data-analysis@file:plugins/data-analysis': {}++ '@adelie/goal@file:plugins/goal': {}++ '@adelie/hmr@file:packages/hmr([email protected])([email protected])':+ dependencies:+ '@adelie/core': file:packages/core([email protected])([email protected])+ transitivePeerDependencies:+ - '@modelcontextprotocol/sdk'+ - bufferutil+ - supports-color+ - utf-8-validate+ - ws+ - zod++ '@adelie/humanizer@file:plugins/humanizer': {}++ '@adelie/lesson-video@file:plugins/lesson-video': {}++ '@adelie/model-development@file:plugins/model-development': {}++ '@adelie/requirements-box@file:plugins/requirements-box': {}++ '@adelie/server@file:packages/server([email protected])':+ dependencies:+ '@adelie/amsp': file:packages/amsp+ '@adelie/core': file:packages/core([email protected])([email protected])+ '@hono/node-server': 2.0.12([email protected])+ '@xterm/headless': 5.5.0+ dotenv: 17.4.2+ fflate: 0.8.3+ hono: 4.12.34+ node-pty: 1.1.0+ remark-gfm: 4.0.1([email protected])+ remark-parse: 11.0.0([email protected])+ smol-toml: 1.6.1+ tar: 7.5.22+ typescript: 5.9.3+ undici: 7.29.0+ unified: 11.0.5+ ws: 8.21.0+ yaml: 2.9.0+ transitivePeerDependencies:+ - '@modelcontextprotocol/sdk'+ - bufferutil+ - debug+ - supports-color+ - utf-8-validate+ - zod++ '@adelie/server@file:packages/server([email protected])([email protected])':+ dependencies:+ '@adelie/amsp': file:packages/amsp+ '@hono/node-server': 2.0.12([email protected])+ '@xterm/headless': 5.5.0+ dotenv: 17.4.2+ fflate: 0.8.3+ hono: 4.12.34+ node-pty: 1.1.0+ remark-gfm: 4.0.1([email protected])+ remark-parse: 11.0.0([email protected])+ smol-toml: 1.6.1+ tar: 7.5.22+ typescript: 5.9.3+ undici: 7.29.0+ unified: 11.0.5+ ws: 8.21.0+ yaml: 2.9.0+ transitivePeerDependencies:+ - '@modelcontextprotocol/sdk'+ - bufferutil+ - debug+ - supports-color+ - utf-8-validate+ - zod++ '@adelie/skill-porting@file:plugins/skill-porting': {}++ '@adelie/software-development@file:plugins/software-development': {}++ '@adelie/ui@file:packages/ui(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])':+ dependencies:+ '@fontsource-variable/ibm-plex-sans': 5.3.0+ '@fontsource-variable/jetbrains-mono': 5.3.0+ '@fontsource-variable/mona-sans': 5.3.0+ '@fontsource-variable/noto-sans-sc': 5.3.0+ '@fontsource/ibm-plex-sans-condensed': 5.3.0+ '@shikijs/langs': 4.3.1+ '@shikijs/themes': 4.3.1+ katex: 0.16.47+ react: 19.2.7+ react-dom: 19.2.7([email protected])+ rehype-katex: 7.0.1+ remark-gfm: 4.0.1([email protected])+ remark-math: 6.0.0([email protected])+ remark-parse: 11.0.0([email protected])+ shiki: 4.3.1+ unified: 11.0.5+ zustand: 5.0.15(@types/[email protected])([email protected])+ transitivePeerDependencies:+ - '@types/react'+ - immer+ - solid-js+ - supports-color+ - svelte+ - use-sync-external-store+ - vue++ '@adelie/use-bento-slides@file:plugins/use-bento-slides': {}++ '@adelie/use-claude-code@file:plugins/use-claude-code': {}++ '@adelie/use-firecrawl@file:plugins/use-firecrawl': {}++ '@adelie/use-offerdao@file:plugins/use-offerdao': {}++ '@adelie/use-wps-office@file:plugins/use-wps-office': {}++ '@adelie/wechat-miniprogram@file:plugins/wechat-miniprogram': {}++ '@ampproject/[email protected]':+ dependencies:+ '@jridgewell/gen-mapping': 0.3.13+ '@jridgewell/trace-mapping': 0.3.31++ '@anthropic-ai/[email protected]([email protected])':+ dependencies:+ '@anthropic-ai/sdk': 0.91.1([email protected])+ '@aws-crypto/sha256-js': 4.0.0+ '@aws-sdk/client-bedrock-runtime': 3.1068.0+ '@aws-sdk/credential-providers': 3.1068.0+ '@smithy/eventstream-serde-node': 2.2.0+ '@smithy/fetch-http-handler': 5.4.7+ '@smithy/protocol-http': 3.3.0+ '@smithy/signature-v4': 3.1.2+ '@smithy/smithy-client': 2.5.1+ '@smithy/types': 2.12.0+ '@smithy/util-base64': 2.3.0+ transitivePeerDependencies:+ - zod++ '@anthropic-ai/[email protected]([email protected])':+ dependencies:+ json-schema-to-ts: 3.1.1+ optionalDependencies:+ zod: 4.4.3++ '@ark/[email protected]':+ dependencies:+ '@ark/util': 0.56.2++ '@ark/[email protected]': {}++ '@aws-crypto/[email protected]':+ dependencies:+ '@aws-crypto/util': 3.0.0+ '@aws-sdk/types': 3.973.12tslib: 1.14.1'@aws-crypto/[email protected]':@@ -5606,224 +5920,6 @@ snapshots:- supports-color- utf-8-validate- '@adelie/agent-company@file:plugins/agent-company': {}-- '@adelie/agent-development@file:plugins/agent-development': {}-- '@adelie/agent-tuning@file:plugins/agent-tuning': {}-- '@adelie/amsp@file:packages/amsp': {}-- '@adelie/browser-automation@file:plugins/browser-automation': {}-- '@adelie/continual-learning@file:plugins/continual-learning': {}-- '@adelie/csu-mail@file:plugins/csu-mail': {}-- '@adelie/data-analysis@file:plugins/data-analysis': {}-- '@adelie/goal@file:plugins/goal': {}-- '@adelie/humanizer@file:plugins/humanizer': {}-- '@adelie/lesson-video@file:plugins/lesson-video': {}-- '@adelie/model-development@file:plugins/model-development': {}-- '@adelie/cli@file:packages/cli([email protected])':- dependencies:- '@adelie/agent-company': file:plugins/agent-company- '@adelie/agent-development': file:plugins/agent-development- '@adelie/agent-tuning': file:plugins/agent-tuning- '@adelie/browser-automation': file:plugins/browser-automation- '@adelie/continual-learning': file:plugins/continual-learning- '@adelie/csu-mail': file:plugins/csu-mail- '@adelie/data-analysis': file:plugins/data-analysis- '@adelie/goal': file:plugins/goal- '@adelie/humanizer': file:plugins/humanizer- '@adelie/lesson-video': file:plugins/lesson-video- '@adelie/model-development': file:plugins/model-development- '@adelie/core': file:packages/core([email protected])([email protected])- '@adelie/server': file:packages/server([email protected])- '@adelie/requirements-box': file:plugins/requirements-box- '@adelie/skill-porting': file:plugins/skill-porting- '@adelie/software-development': file:plugins/software-development- '@adelie/use-bento-slides': file:plugins/use-bento-slides- '@adelie/use-claude-code': file:plugins/use-claude-code- '@adelie/use-firecrawl': file:plugins/use-firecrawl- '@adelie/use-offerdao': file:plugins/use-offerdao- '@adelie/use-wps-office': file:plugins/use-wps-office- '@adelie/wechat-miniprogram': file:plugins/wechat-miniprogram- '@modelcontextprotocol/client': 2.0.0- '@prismshadow/agenthub': 0.4.15([email protected])([email protected])- commander: 13.1.0- dotenv: 17.4.2- smol-toml: 1.6.1- yaml: 2.9.0- transitivePeerDependencies:- - '@modelcontextprotocol/sdk'- - bufferutil- - debug- - supports-color- - utf-8-validate- - ws- - zod-- '@adelie/core@file:packages/core([email protected])([email protected])':- dependencies:- '@adelie/agent-company': file:plugins/agent-company- '@adelie/agent-development': file:plugins/agent-development- '@adelie/agent-tuning': file:plugins/agent-tuning- '@adelie/browser-automation': file:plugins/browser-automation- '@adelie/continual-learning': file:plugins/continual-learning- '@adelie/csu-mail': file:plugins/csu-mail- '@adelie/data-analysis': file:plugins/data-analysis- '@adelie/goal': file:plugins/goal- '@adelie/humanizer': file:plugins/humanizer- '@adelie/lesson-video': file:plugins/lesson-video- '@adelie/model-development': file:plugins/model-development- '@adelie/requirements-box': file:plugins/requirements-box- '@adelie/skill-porting': file:plugins/skill-porting- '@adelie/software-development': file:plugins/software-development- '@adelie/use-bento-slides': file:plugins/use-bento-slides- '@adelie/use-claude-code': file:plugins/use-claude-code- '@adelie/use-firecrawl': file:plugins/use-firecrawl- '@adelie/use-offerdao': file:plugins/use-offerdao- '@adelie/use-wps-office': file:plugins/use-wps-office- '@adelie/wechat-miniprogram': file:plugins/wechat-miniprogram- '@modelcontextprotocol/client': 2.0.0- '@prismshadow/agenthub': 0.4.15([email protected])([email protected])- arktype: 2.2.3- smol-toml: 1.6.1- yaml: 2.9.0- transitivePeerDependencies:- - '@modelcontextprotocol/sdk'- - bufferutil- - supports-color- - utf-8-validate- - ws- - zod-- dependencies:- '@adelie/agent-company': file:plugins/agent-company- '@adelie/agent-development': file:plugins/agent-development- '@adelie/agent-tuning': file:plugins/agent-tuning- '@adelie/browser-automation': file:plugins/browser-automation- '@adelie/continual-learning': file:plugins/continual-learning- '@adelie/csu-mail': file:plugins/csu-mail- '@adelie/data-analysis': file:plugins/data-analysis- '@adelie/goal': file:plugins/goal- '@adelie/humanizer': file:plugins/humanizer- '@adelie/lesson-video': file:plugins/lesson-video- '@adelie/model-development': file:plugins/model-development- '@adelie/requirements-box': file:plugins/requirements-box- '@adelie/skill-porting': file:plugins/skill-porting- '@adelie/software-development': file:plugins/software-development- '@adelie/use-bento-slides': file:plugins/use-bento-slides- '@adelie/use-claude-code': file:plugins/use-claude-code- '@adelie/use-firecrawl': file:plugins/use-firecrawl- '@adelie/use-offerdao': file:plugins/use-offerdao- '@adelie/use-wps-office': file:plugins/use-wps-office- '@adelie/wechat-miniprogram': file:plugins/wechat-miniprogram- '@modelcontextprotocol/client': 2.0.0- arktype: 2.2.3- smol-toml: 1.6.1- yaml: 2.9.0- transitivePeerDependencies:- - '@modelcontextprotocol/sdk'- - bufferutil- - supports-color- - utf-8-validate- - ws- - zod-- '@adelie/hmr@file:packages/hmr([email protected])([email protected])':- dependencies:- '@adelie/core': file:packages/core([email protected])([email protected])- transitivePeerDependencies:- - '@modelcontextprotocol/sdk'- - bufferutil- - supports-color- - utf-8-validate- - ws- - zod-- '@adelie/server@file:packages/server([email protected])':- dependencies:- '@hono/node-server': 2.0.12([email protected])- '@adelie/amsp': file:packages/amsp- '@adelie/core': file:packages/core([email protected])([email protected])- '@xterm/headless': 5.5.0- dotenv: 17.4.2- fflate: 0.8.3- hono: 4.12.34- node-pty: 1.1.0- remark-gfm: 4.0.1([email protected])- remark-parse: 11.0.0([email protected])- smol-toml: 1.6.1- tar: 7.5.22- typescript: 5.9.3- undici: 7.29.0- unified: 11.0.5- ws: 8.21.0- yaml: 2.9.0- transitivePeerDependencies:- - '@modelcontextprotocol/sdk'- - bufferutil- - debug- - supports-color- - utf-8-validate- - zod-- '@adelie/server@file:packages/server([email protected])([email protected])':- dependencies:- '@hono/node-server': 2.0.12([email protected])- '@adelie/amsp': file:packages/amsp- '@xterm/headless': 5.5.0- dotenv: 17.4.2- fflate: 0.8.3- hono: 4.12.34- node-pty: 1.1.0- remark-gfm: 4.0.1([email protected])- remark-parse: 11.0.0([email protected])- smol-toml: 1.6.1- tar: 7.5.22- typescript: 5.9.3- undici: 7.29.0- unified: 11.0.5- ws: 8.21.0- yaml: 2.9.0- transitivePeerDependencies:- - '@modelcontextprotocol/sdk'- - bufferutil- - debug- - supports-color- - utf-8-validate- - zod-- '@adelie/requirements-box@file:plugins/requirements-box': {}-- '@adelie/skill-porting@file:plugins/skill-porting': {}-- '@adelie/software-development@file:plugins/software-development': {}-- '@adelie/use-bento-slides@file:plugins/use-bento-slides': {}-- '@adelie/use-claude-code@file:plugins/use-claude-code': {}-- '@adelie/use-firecrawl@file:plugins/use-firecrawl': {}-- '@adelie/use-offerdao@file:plugins/use-offerdao': {}-- '@adelie/use-wps-office@file:plugins/use-wps-office': {}-- '@adelie/wechat-miniprogram@file:plugins/wechat-miniprogram': {}-'@malept/[email protected]':dependencies:cross-spawn: 7.0.6@@ -8916,6 +9012,20 @@ snapshots:+ dependencies:+ typegpu: 0.12.3+ optionalDependencies:+ react: 19.2.7+ react-dom: 19.2.7([email protected])++ dependencies:+ typegpu: 0.12.3+ optionalDependencies:+ react: 19.2.7+ react-dom: 19.2.7([email protected])+dependencies:shebang-regex: 3.0.0@@ -9116,6 +9226,8 @@ snapshots:+ [email protected]: {}+@@ -9155,6 +9267,8 @@ snapshots:+ [email protected]: {}+[email protected]([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:bundle-require: 5.1.0([email protected])@@ -9197,6 +9311,14 @@ snapshots:media-typer: 0.3.0mime-types: 2.1.35+ [email protected]: {}++ dependencies:+ tinyest: 0.3.4+ tsover-runtime: 0.0.7+ typed-binary: 4.3.4+diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 53404e36..e9d1f672 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -58,3 +58,4 @@ minimumReleaseAgeExclude:- "@deepseek-ai/[email protected]"- "@deepseek-ai/[email protected]"- "@prismshadow/[email protected]"