@ohmygame/plugin-ui 2.37.0 → 2.39.0

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/index.d.ts CHANGED
@@ -23,10 +23,14 @@ export type PluginUiMethod =
23
23
  | "models.complete"
24
24
  | "models.cancel"
25
25
  | "panel.open"
26
+ | "assets.add"
26
27
  | "library.add"
27
28
  | "assistant.run"
28
29
  | "assistant.history"
29
- | "assistant.clear";
30
+ | "assistant.clear"
31
+ | "media.models"
32
+ | "media.generate"
33
+ | "media.cancel";
30
34
 
31
35
  /**
32
36
  * An HTTPS request made by the app, to a host the plugin's manifest lists in
@@ -216,7 +220,7 @@ export interface PluginModelRequest {
216
220
  messages: PluginModelMessage[];
217
221
  /** Asks for JSON and reads the answer as `json`; the request fails if it isn't JSON. */
218
222
  json?: boolean;
219
- /** 1 to 8,192; 2,048 when left out. */
223
+ /** 1 to 8,192; 2,048 when left out. A coding agent's model sets its own. */
220
224
  maxTokens?: number;
221
225
  /** One of `list()`; the default model when left out. */
222
226
  model?: { provider: string; id: string };
@@ -226,7 +230,7 @@ export interface PluginModelResult {
226
230
  text: string;
227
231
  json?: unknown;
228
232
  model: { provider: string; id: string };
229
- /** Tokens read and written, which count toward the person's usage. */
233
+ /** Tokens read and written, which count toward the person's usage; 0 when a coding agent doesn't say. */
230
234
  usage: { input: number; output: number };
231
235
  stopReason: "stop" | "length";
232
236
  }
@@ -280,6 +284,146 @@ export interface PluginAssistant {
280
284
  history(): Promise<PluginAssistantEntry[]>;
281
285
  /** Forgets the conversation, to start over. */
282
286
  clear(): Promise<null>;
287
+ /**
288
+ * The conversation as a page draws it (API 2.38.0): call `load()`, then
289
+ * draw `state` on each change. `system` may be a function, called for
290
+ * each message, to tell the assistant what the panel shows then.
291
+ */
292
+ session(options?: { system?: string | (() => string); maxTokens?: number }): PluginAssistantSession;
293
+ }
294
+
295
+ /** A step of the assistant's turn: what it said, or a tool it used and, once `done`, its answer. */
296
+ export type PluginAssistantItem =
297
+ | { kind: "text"; text: string }
298
+ | {
299
+ kind: "tool";
300
+ id: string;
301
+ name: string;
302
+ input: unknown;
303
+ result?: string;
304
+ error?: true;
305
+ done: boolean;
306
+ /** The run stopped before the tool answered. */
307
+ stopped?: true;
308
+ };
309
+
310
+ /** One of the person's messages, or the assistant's steps after it. */
311
+ export type PluginAssistantTurn =
312
+ | { role: "user"; text: string; /** How many images came with it. */ images?: number }
313
+ | {
314
+ role: "assistant";
315
+ items: PluginAssistantItem[];
316
+ /** Why it ended early: the page stopped it, it took 8 steps, or the model hit its length. */
317
+ stopped?: "user" | "steps" | "length";
318
+ /** Why the run failed. */
319
+ error?: string;
320
+ };
321
+
322
+ export interface PluginAssistantSessionState {
323
+ /**
324
+ * `loading` reads the models and the conversation, or clears it;
325
+ * `ready` takes a message; `running` is answering one; `no-model` has no
326
+ * model set up, though the conversation still shows (`load()` looks
327
+ * again); `error` couldn't read them, says why in `error`, and `load()`
328
+ * tries again, or `clear()` when `canClear`.
329
+ */
330
+ status: "loading" | "ready" | "running" | "no-model" | "error";
331
+ /** The finished turns, oldest first. */
332
+ turns: PluginAssistantTurn[];
333
+ /** The assistant's turn while it runs. */
334
+ live?: Extract<PluginAssistantTurn, { role: "assistant" }>;
335
+ /** The models the person set up. */
336
+ models: PluginModel[];
337
+ /** The one the person chose, kept in the page's storage as `assistant.model`; the default when left out. */
338
+ model?: { provider: string; id: string };
339
+ /** The model a message goes to, named in each request: the one chosen, else the default as of the last `load()`. Images go only when its `images` is true. */
340
+ using?: PluginModel;
341
+ /** Why it can't go on, or why the last clear failed. */
342
+ error: string;
343
+ /** Whether `clear()` has something to forget: turns, or a conversation that couldn't be read. */
344
+ canClear: boolean;
345
+ }
346
+
347
+ export interface PluginAssistantSession {
348
+ readonly state: PluginAssistantSessionState;
349
+ /** Calls `listener` with the state on each change; returns a function that stops it. */
350
+ subscribe(listener: (state: PluginAssistantSessionState) => void): () => void;
351
+ /** Reads the models and the conversation; again later to see models set up since or try again. */
352
+ load(): Promise<void>;
353
+ /**
354
+ * Says `text` to the assistant when `status` is `ready`, with `images` if
355
+ * the model reads them; images alone make a message too. Resolves with the
356
+ * run's result, or undefined when it didn't run, was stopped or failed;
357
+ * the turn says which.
358
+ */
359
+ send(
360
+ text: string,
361
+ options?: { images?: Array<{ data: Blob | string; type?: string }> },
362
+ ): Promise<Awaited<ReturnType<PluginAssistant["run"]>> | undefined>;
363
+ /** Stops the run going on. */
364
+ stop(): void;
365
+ /** Forgets the conversation, and reads it again when it couldn't be read. */
366
+ clear(): Promise<void>;
367
+ /** Chooses one of `state.models` for the messages that follow, or the default with no model; the page's storage keeps it. */
368
+ setModel(model?: { provider: string; id: string }): Promise<void>;
369
+ }
370
+
371
+ /**
372
+ * An image or audio model the person set up, from `host.media.models()`,
373
+ * with what it takes: an image model's `aspectRatiosByResolution` (or
374
+ * `resolutions`, `aspectRatios`) and `supportsReferenceImage`; an audio
375
+ * model's `produces`, `readsText`, `maxDurationSeconds` and the like.
376
+ */
377
+ export interface PluginMediaModel {
378
+ provider: string;
379
+ id: string;
380
+ name: string;
381
+ [option: string]: unknown;
382
+ }
383
+
384
+ export type PluginMediaRequest =
385
+ | {
386
+ media: "image";
387
+ prompt: string;
388
+ /** One of `media.models("image")`; the default model when left out. */
389
+ model?: { provider: string; id: string };
390
+ /** Either alone is enough: the other is the model's nearest. */
391
+ resolution?: "512" | "1K" | "2K" | "4K";
392
+ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9";
393
+ /** How many images, 1 to 4; with `outputs` or `images`, give a resolution or an aspect ratio. */
394
+ outputs?: 1 | 2 | 3 | 4;
395
+ transparentBackground?: boolean;
396
+ /** Up to 16 PNG, JPEG or WebP images to work from, each a Blob of at most 5 MB, for a model that takes them. */
397
+ images?: Blob[];
398
+ /** Settings of the model's own, as its `params` in `media.models("image")` list them; left out, each takes its default. */
399
+ params?: Record<string, string | number | boolean>;
400
+ }
401
+ | {
402
+ media: "audio";
403
+ /** The words a speech model says, or a description of the sound or music. */
404
+ prompt: string;
405
+ /** One of `media.models("audio")`; when left out, the default for `kind`. */
406
+ model?: { provider: string; id: string };
407
+ kind?: "speech" | "sound-effect" | "music";
408
+ durationSeconds?: number;
409
+ loop?: boolean;
410
+ instrumental?: boolean;
411
+ voiceId?: string;
412
+ };
413
+
414
+ export interface PluginMedia {
415
+ /** The person's connected image or audio models, and the one a request without `model` uses. */
416
+ models(media: "image" | "audio", options?: { kind?: "speech" | "sound-effect" | "music" }): Promise<{ default?: { provider: string; id: string }; models: PluginMediaModel[] }>;
417
+ /**
418
+ * Makes images or audio, which may cost the person; the files aren't kept,
419
+ * so `assets.add` one to keep it. Only while the page shows,
420
+ * and not in a Plugin Builder preview; a plugin sends at most 2 requests at
421
+ * once and 10 a minute.
422
+ */
423
+ generate(request: PluginMediaRequest, options?: { signal?: AbortSignal }): Promise<{
424
+ model?: { provider: string; id: string };
425
+ files: Array<{ name: string; type: string; data: Blob }>;
426
+ }>;
283
427
  }
284
428
 
285
429
  export interface PluginUiHost {
@@ -297,6 +441,11 @@ export interface PluginUiHost {
297
441
  * plugin's model limits. Only an installed plugin's panel has one.
298
442
  */
299
443
  assistant: PluginAssistant;
444
+ /**
445
+ * The person's image and audio models, with `capabilities.media`
446
+ * (API 2.38.0), made the way the app's own generation makes them.
447
+ */
448
+ media: PluginMedia;
300
449
  /**
301
450
  * Imports a `.js` or `.mjs` module of the project, such as
302
451
  * `pixelfx/effects/ricochet.js`, from a folder the manifest's
@@ -321,17 +470,29 @@ export interface PluginUiHost {
321
470
  open(panel: string, options?: { state?: unknown }): Promise<null>;
322
471
  };
323
472
  /**
324
- * The person's Library, with `capabilities.library` (API 2.35.0), where a
325
- * page puts what it makes instead of a download. Each file is listed as
326
- * added by the plugin, and the person sees a toast as it comes.
473
+ * The project's assets, with `capabilities.library` (API 2.38.0), where a
474
+ * page puts what it makes instead of a download. Each file goes in the
475
+ * project's media as generated, and the person sees a toast as it comes.
327
476
  */
328
- library: {
477
+ assets: {
329
478
  /**
330
479
  * Adds a PNG, JPEG or WebP image, sound, video or 3D model of at most
331
480
  * 200 MB, named with its type, such as `ricochet.png`: a File keeps its
332
481
  * own name unless given one. `prompt`, at most 1,000 characters, says
333
482
  * what it was made from. Only while the page shows; a plugin adds at
334
- * most 2 at once and 20 a minute.
483
+ * most 2 at once and 20 a minute. Resolves with the file's path in the
484
+ * project.
485
+ */
486
+ add(file: Blob | File, options?: { name?: string; prompt?: string }): Promise<{ path: string; name: string; mediaType: "image" | "video" | "audio" | "model" }>;
487
+ };
488
+ /**
489
+ * @deprecated Since API 2.38.0, when the Library became the project's
490
+ * assets: use `assets`. Removed in API 3.0.0. `library.add` adds to the
491
+ * project's assets the same way and resolves with an `id`.
492
+ */
493
+ library: {
494
+ /**
495
+ * @deprecated Use `assets.add`.
335
496
  */
336
497
  add(file: Blob | File, options?: { name?: string; prompt?: string }): Promise<{ id: string; name: string; mediaType: "image" | "video" | "audio" | "model" }>;
337
498
  };
package/index.js CHANGED
@@ -148,9 +148,16 @@ function bridge(port, hello) {
148
148
  return api.request("panel.open", { panel, ...(options.state !== undefined ? { state: options.state } : {}) });
149
149
  },
150
150
  },
151
- /** The person's Library, with the `library` capability. */
152
- library: {
151
+ /** The project's assets, with the `library` capability. */
152
+ assets: {
153
153
  /** Adds a file the page made, named with its type (`ricochet.png`); a File keeps its own name unless given one. */
154
+ add(file, options = {}) {
155
+ const name = options.name ?? file?.name;
156
+ return api.request("assets.add", { data: file, name, ...(options.prompt ? { prompt: options.prompt } : {}) });
157
+ },
158
+ },
159
+ /** @deprecated Since API 2.38.0: use `assets`. Removed in API 3.0.0. */
160
+ library: {
154
161
  add(file, options = {}) {
155
162
  const name = options.name ?? file?.name;
156
163
  return api.request("library.add", { data: file, name, ...(options.prompt ? { prompt: options.prompt } : {}) });
@@ -259,6 +266,39 @@ function bridge(port, hello) {
259
266
  clear() {
260
267
  return api.request("assistant.clear");
261
268
  },
269
+ /**
270
+ * The conversation as a page draws it: its turns, the run going on,
271
+ * the models to choose from and the one chosen, kept in the page's
272
+ * storage as `assistant.model`. The page draws it on each change.
273
+ */
274
+ session(options) {
275
+ return assistantSession(api, options);
276
+ },
277
+ },
278
+ /**
279
+ * The image and audio models the person set up, for a plugin with the
280
+ * `media` capability. Each request may cost them, so make only what the
281
+ * person asked for, while the panel shows; `assets.add` keeps a file.
282
+ */
283
+ media: {
284
+ models(media, { kind } = {}) {
285
+ return api.request("media.models", { media, ...(kind ? { kind } : {}) });
286
+ },
287
+ async generate(request, { signal } = {}) {
288
+ signal?.throwIfAborted();
289
+ const call = `media-${next}-${Math.random().toString(36).slice(2, 10)}`;
290
+ const stop = () => void api.request("media.cancel", { call }).catch(() => {});
291
+ signal?.addEventListener("abort", stop, { once: true });
292
+ try {
293
+ return await api.request("media.generate", { ...request, call });
294
+ } catch (error) {
295
+ // Stopped by the page, it fails as an abort does, not with the app's message.
296
+ if (signal?.aborted) throw signal.reason;
297
+ throw error;
298
+ } finally {
299
+ signal?.removeEventListener("abort", stop);
300
+ }
301
+ },
262
302
  },
263
303
  /**
264
304
  * Imports a module of the project from a folder the manifest's
@@ -314,6 +354,195 @@ function bridge(port, hello) {
314
354
  return api;
315
355
  }
316
356
 
357
+ // ---------------------------------------------------------------------------
358
+ // The assistant's conversation, kept as turns for a page to draw.
359
+
360
+ const MODEL_KEY = "assistant.model";
361
+ const sameModel = (a, b) => !!a && !!b && a.provider === b.provider && a.id === b.id;
362
+ const reason = (error) => (error instanceof Error ? error.message : String(error));
363
+
364
+ /** The turns of `history()`: each of the person's messages, and the assistant's steps after it as one turn. */
365
+ function turnsOf(entries) {
366
+ const turns = [];
367
+ for (const entry of Array.isArray(entries) ? entries : []) {
368
+ if (entry?.role === "user") turns.push({ role: "user", text: String(entry.text ?? ""), ...(entry.images ? { images: entry.images } : {}) });
369
+ else if (entry?.role === "assistant") {
370
+ let turn = turns.at(-1);
371
+ if (turn?.role !== "assistant") turns.push((turn = { role: "assistant", items: [] }));
372
+ if (entry.text) turn.items.push({ kind: "text", text: String(entry.text) });
373
+ for (const tool of entry.tools ?? [])
374
+ turn.items.push({ kind: "tool", id: tool.id, name: tool.name, input: tool.input, result: tool.result, ...(tool.error ? { error: true } : {}), done: true });
375
+ }
376
+ }
377
+ return turns;
378
+ }
379
+
380
+ /** The assistant's turn after one event of a run. */
381
+ function withEvent(turn, event) {
382
+ const items = [...turn.items];
383
+ if (event?.type === "text" && event.text) items.push({ kind: "text", text: String(event.text) });
384
+ else if (event?.type === "tool") items.push({ kind: "tool", id: event.id, name: event.name, input: event.input, done: false });
385
+ else if (event?.type === "tool.result") {
386
+ const index = items.findIndex((item) => item.kind === "tool" && item.id === event.id);
387
+ const step = { kind: "tool", id: event.id, name: event.name, input: index >= 0 ? items[index].input : undefined, result: event.result, ...(event.error ? { error: true } : {}), done: true };
388
+ if (index >= 0) items[index] = step;
389
+ else items.push(step);
390
+ }
391
+ return { ...turn, items };
392
+ }
393
+
394
+ /** The turn once its run ends: its reply if no step said it, and tool steps left waiting marked stopped. */
395
+ function ended(turn, { text, stopped, error }) {
396
+ const items = turn.items.map((item) => (item.kind === "tool" && !item.done ? { ...item, done: true, error: true, stopped: true } : item));
397
+ if (text && !items.some((item) => item.kind === "text" && item.text === text)) items.push({ kind: "text", text });
398
+ return { ...turn, items, ...(stopped ? { stopped } : {}), ...(error ? { error } : {}) };
399
+ }
400
+
401
+ function assistantSession(api, { system, maxTokens } = {}) {
402
+ const listeners = new Set();
403
+ let controller;
404
+ // Each load or clear takes the next number; a load whose number is no longer the latest drops what it read.
405
+ let epoch = 0;
406
+ let loading;
407
+ // The model the person chose here, which wins over what storage said when a load started.
408
+ let picked;
409
+ // Whether what's kept can't be read, so clearing it is the way on.
410
+ let unreadable = false;
411
+ let state = { status: "loading", turns: [], live: undefined, models: [], model: undefined, using: undefined, error: "", canClear: false };
412
+ const update = (patch) => {
413
+ const next = { ...state, ...patch };
414
+ // The model a run uses: the one chosen while it's still set up, else the default.
415
+ const chosen = next.models.find((model) => sameModel(model, next.model));
416
+ next.using = chosen ?? next.models.find((model) => model.default) ?? next.models[0];
417
+ next.canClear = next.status !== "running" && next.status !== "loading" && (unreadable || next.turns.length > 0);
418
+ state = next;
419
+ // A page's listener that throws mustn't leave the session half changed; its error still reaches the plugin's log.
420
+ for (const listener of listeners)
421
+ try {
422
+ listener(state);
423
+ } catch (error) {
424
+ queueMicrotask(() => {
425
+ throw error;
426
+ });
427
+ }
428
+ };
429
+
430
+ function load() {
431
+ if (state.status === "running") return loading ?? Promise.resolve();
432
+ if (state.status === "loading" && loading) return loading;
433
+ const mine = ++epoch;
434
+ loading = (async () => {
435
+ update({ status: "loading", error: "" });
436
+ let models;
437
+ let saved;
438
+ try {
439
+ [models, saved] = await Promise.all([api.models.list(), api.request("storage.get", { key: MODEL_KEY }).catch(() => undefined)]);
440
+ } catch (error) {
441
+ if (mine === epoch) update({ status: "error", error: reason(error) });
442
+ return;
443
+ }
444
+ let turns;
445
+ let failure;
446
+ // The conversation is read even with no model, so it still shows and can be cleared.
447
+ try {
448
+ turns = turnsOf(await api.assistant.history());
449
+ } catch (error) {
450
+ failure = error;
451
+ }
452
+ if (mine !== epoch) return;
453
+ const wanted = picked !== undefined ? picked.model : saved;
454
+ const model = models.some((item) => sameModel(item, wanted)) ? { provider: wanted.provider, id: wanted.id } : undefined;
455
+ unreadable = !!failure;
456
+ if (failure) update({ status: "error", error: reason(failure), turns: [], models, model });
457
+ else update({ status: models.length ? "ready" : "no-model", turns, models, model });
458
+ })();
459
+ return loading;
460
+ }
461
+
462
+ async function send(text, { images } = {}) {
463
+ if (state.status !== "ready") return undefined;
464
+ const said = String(text ?? "").trim();
465
+ // The model this message goes to, named in the request, so the images checked against it are the ones it gets.
466
+ const model = state.using;
467
+ const sent = model?.images && images?.length ? images : undefined;
468
+ if (!said && !sent) return undefined;
469
+ const prompt = typeof system === "function" ? system() : system;
470
+ const run = (controller = new AbortController());
471
+ let live = { role: "assistant", items: [] };
472
+ update({ status: "running", error: "", turns: [...state.turns, { role: "user", text: said, ...(sent ? { images: sent.length } : {}) }], live });
473
+ try {
474
+ const result = await api.assistant.run(
475
+ {
476
+ text: said,
477
+ ...(sent ? { images: sent } : {}),
478
+ ...(prompt ? { system: String(prompt) } : {}),
479
+ ...(model ? { model: { provider: model.provider, id: model.id } } : {}),
480
+ ...(maxTokens ? { maxTokens } : {}),
481
+ },
482
+ {
483
+ signal: run.signal,
484
+ onEvent: (event) => {
485
+ live = withEvent(live, event);
486
+ update({ live });
487
+ },
488
+ },
489
+ );
490
+ live = ended(live, { text: result.text, stopped: result.stopped });
491
+ return result;
492
+ } catch (error) {
493
+ live = ended(live, run.signal.aborted ? { stopped: "user" } : { error: reason(error) });
494
+ return undefined;
495
+ } finally {
496
+ controller = undefined;
497
+ update({ status: "ready", live: undefined, turns: [...state.turns, live] });
498
+ }
499
+ }
500
+
501
+ return {
502
+ get state() {
503
+ return state;
504
+ },
505
+ /** Calls `listener(state)` on each change; returns a function that stops it. */
506
+ subscribe(listener) {
507
+ listeners.add(listener);
508
+ return () => listeners.delete(listener);
509
+ },
510
+ load,
511
+ send,
512
+ stop() {
513
+ controller?.abort();
514
+ },
515
+ async clear() {
516
+ if (state.status === "running" || state.status === "loading") return;
517
+ const before = state.status;
518
+ // Nothing is sent while it clears, and a load still reading drops what it read.
519
+ const mine = ++epoch;
520
+ update({ status: "loading" });
521
+ try {
522
+ await api.assistant.clear();
523
+ } catch (error) {
524
+ // The conversation is still there, so the page can go on or clear again.
525
+ if (mine === epoch) update({ status: before, error: reason(error) });
526
+ return;
527
+ }
528
+ if (mine !== epoch) return;
529
+ if (unreadable || before === "error") {
530
+ unreadable = false;
531
+ update({ status: before, turns: [] });
532
+ return load();
533
+ }
534
+ update({ status: before, turns: [], error: "" });
535
+ },
536
+ async setModel(model) {
537
+ const chosen = model ? state.models.find((item) => sameModel(item, model)) : undefined;
538
+ if (model && !chosen) throw new Error(`${model.provider}/${model.id} isn't one of the models set up`);
539
+ picked = { model: chosen ? { provider: chosen.provider, id: chosen.id } : undefined };
540
+ update({ model: picked.model });
541
+ await api.request("storage.set", { key: MODEL_KEY, value: chosen ? { provider: chosen.provider, id: chosen.id } : null });
542
+ },
543
+ };
544
+ }
545
+
317
546
  /** The app's colour tokens, so `plugin-ui.css` and the page match the app. */
318
547
  function applyTheme({ tokens, appearance }) {
319
548
  const root = document.documentElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohmygame/plugin-ui",
3
- "version": "2.37.0",
3
+ "version": "2.39.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
package/plugin-ui.css CHANGED
@@ -12,8 +12,8 @@
12
12
  --gray-4: #2a2a2a;
13
13
  --gray-5: #303030;
14
14
  --gray-6: #3b3b3b;
15
- --gray-8: #737373;
16
- --gray-9: #a3a3a3;
15
+ --gray-8: #808080;
16
+ --gray-9: #aeaeae;
17
17
  --gray-12: #ececec;
18
18
  --color-accent: #2563eb;
19
19
  --color-on-accent: #ffffff;
@@ -51,7 +51,7 @@
51
51
  --color-danger: var(--hue-danger);
52
52
  --color-warning: var(--hue-warning);
53
53
  --shadow-hairline: 0 0 0 1px var(--color-border);
54
- --shadow-float: 0 12px 32px rgb(0 0 0 / 40%), 0 0 0 1px rgb(255 255 255 / 6%);
54
+ --shadow-float: 0 -0.5px 0 rgb(255 255 255 / 6%), 0 0 0 0.5px rgb(255 255 255 / 12%), 0 2px 4px -2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
55
55
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
56
56
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
57
57
  --text-xs: 11px;
@@ -82,16 +82,16 @@
82
82
  background: transparent;
83
83
  }
84
84
  :root[data-appearance="light"] {
85
- --gray-0: #f3f3f3;
86
- --gray-1: #f8f8f8;
85
+ --gray-0: #f2f2f2;
86
+ --gray-1: #fafafa;
87
87
  --gray-2: #ffffff;
88
- --gray-3: #f6f6f6;
89
- --gray-4: #efefef;
88
+ --gray-3: #f2f2f2;
89
+ --gray-4: #ebebeb;
90
90
  --gray-5: #e5e5e5;
91
91
  --gray-6: #d4d4d4;
92
- --gray-8: #8c8c8c;
92
+ --gray-8: #808080;
93
93
  --gray-9: #5c5c5c;
94
- --gray-12: #1a1a1a;
94
+ --gray-12: #161616;
95
95
  --color-grid-dot: #dedede;
96
96
  --hue-audio: #3f8e68;
97
97
  --hue-code: #3f879f;
@@ -105,7 +105,11 @@
105
105
  --hue-warning: #a8771f;
106
106
  --color-focus: color-mix(in srgb, var(--gray-12) 70%, transparent);
107
107
  --color-control-thumb: #ffffff;
108
- --shadow-float: 0 8px 28px rgb(0 0 0 / 9%), 0 0 0 1px rgb(0 0 0 / 7%);
108
+ --shadow-float: 0 0 0 0.5px rgb(0 0 0 / 12%), 0 2px 4px -2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 6%);
109
+ --color-hover: rgb(0 0 0 / 4%);
110
+ --color-selected: rgb(0 0 0 / 6%);
111
+ --color-border: rgb(0 0 0 / 10%);
112
+ --color-border-strong: rgb(0 0 0 / 16%);
109
113
  color-scheme: light;
110
114
  }
111
115
  /* Keep page width stable when tabs or disclosures change its scroll height. */