Compare commits
176 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49be50aa99 | |||
| 0b8a3a505e | |||
|
|
af570c164a | ||
|
|
98ea0c986b | ||
|
|
68b633db3c | ||
|
|
a54e4152c3 | ||
|
|
5aeb75118a | ||
|
|
744dbcb6b7 | ||
|
|
b8869dd649 | ||
|
|
e2d070f968 | ||
|
|
783edc2197 | ||
|
|
075732f237 | ||
|
|
6a45d560d1 | ||
|
|
0491460e1a | ||
|
|
1ac2f5cc9a | ||
|
|
f3d3a08cc2 | ||
|
|
f29396e13a | ||
|
|
0cd29c91b8 | ||
|
|
efbc257512 | ||
|
|
78b0580c85 | ||
|
|
8107138490 | ||
|
|
d68a336199 | ||
|
|
7b3e1fc5e1 | ||
|
|
b01a79a9e1 | ||
|
|
a567775be1 | ||
|
|
53aa33ead9 | ||
|
|
c897d7b4d0 | ||
|
|
41ea0e26ab | ||
|
|
893eab6d02 | ||
|
|
66bed78f88 | ||
|
|
db9a6f668f | ||
|
|
5433beaebb | ||
|
|
250c4cc96f | ||
|
|
5681fd9bff | ||
|
|
9d8327b48d | ||
|
|
bbb2fad77a | ||
|
|
9b3983d32a | ||
|
|
6c6349a38f | ||
|
|
d3d2a0b468 | ||
|
|
3bf9f55067 | ||
|
|
c530e9ca09 | ||
|
|
56a8f09e53 | ||
|
|
748f31ac45 | ||
|
|
c413432d75 | ||
|
|
8d657e578e | ||
|
|
2609b28820 | ||
|
|
090669c999 | ||
|
|
9ccaac43ce | ||
|
|
e53775d581 | ||
|
|
82ebd30df7 | ||
|
|
b8f06155ed | ||
|
|
96d7242faa | ||
|
|
c95e6afc1d | ||
|
|
d8ca02ae02 | ||
|
|
ec84c73d62 | ||
|
|
9617d8adec | ||
|
|
c21f56a705 | ||
|
|
2a54059ea8 | ||
|
|
f964e5c798 | ||
|
|
29f214bc39 | ||
|
|
bb4ac3bdd8 | ||
|
|
17e09d1cc4 | ||
|
|
5d93ffee9c | ||
|
|
b9dcc6193e | ||
|
|
db5a4e90ad | ||
|
|
a3cd943478 | ||
|
|
5ac1c05eca | ||
|
|
7760cb569d | ||
|
|
fb8a924a7a | ||
|
|
e5a4024bdc | ||
|
|
ccf990a25b | ||
|
|
be7c406fb3 | ||
|
|
83e734a590 | ||
|
|
a5717bfb66 | ||
|
|
78fe83fbf8 | ||
|
|
bd11bc6b05 | ||
|
|
852b3d5138 | ||
|
|
47d38fb602 | ||
|
|
9a42b13865 | ||
|
|
58af16065d | ||
|
|
fb50341b0f | ||
|
|
c6a5c721e4 | ||
|
|
9bc577c771 | ||
|
|
450495c44b | ||
|
|
90ba4d0a2d | ||
|
|
8a1313b777 | ||
|
|
eeb0238603 | ||
|
|
d3260cb452 | ||
|
|
ed4a04fb44 | ||
|
|
d6c76e690d | ||
|
|
7a2eee7fe0 | ||
|
|
747a719148 | ||
|
|
daeb15f948 | ||
|
|
fc13c899f9 | ||
|
|
1fc4d16bf8 | ||
|
|
d5190170d6 | ||
|
|
e13b7f9edc | ||
|
|
2c736e5f4a | ||
|
|
bd3a67db17 | ||
|
|
3970904400 | ||
|
|
1e11b17ae7 | ||
|
|
b1aa6618b6 | ||
|
|
0e57cd2edc | ||
|
|
dd49464d56 | ||
|
|
5552978747 | ||
|
|
eaacc15fc8 | ||
|
|
3dbdb22953 | ||
|
|
83df6a2a4b | ||
|
|
21cb4d0e17 | ||
|
|
4e64fd8229 | ||
|
|
9f09a76ded | ||
|
|
09f227f49e | ||
|
|
5b7846382f | ||
|
|
81ab54fed1 | ||
|
|
d14c0f3c59 | ||
|
|
bdbe912409 | ||
|
|
acb7092faa | ||
|
|
83c38cc53a | ||
|
|
e836ffce14 | ||
|
|
38ecaef5c3 | ||
|
|
32ab74e482 | ||
|
|
3e376ca95f | ||
|
|
42ede69691 | ||
|
|
e6573a717d | ||
|
|
35f4cf6c26 | ||
|
|
55e1f1189f | ||
|
|
6e25123941 | ||
|
|
116eae23b8 | ||
|
|
e8c1bde745 | ||
|
|
4e232a3c5d | ||
|
|
9d09dbf0ca | ||
|
|
fe3f1d68e7 | ||
|
|
f10a6917f9 | ||
|
|
1f0476833b | ||
|
|
5c685e15b0 | ||
|
|
6ce93217bb | ||
|
|
e18ab84562 | ||
|
|
21589f4843 | ||
|
|
6a0ef3c188 | ||
|
|
d2e56157a4 | ||
|
|
73e578f47c | ||
|
|
8d9dfb690c | ||
|
|
62c1f1533d | ||
|
|
68b3095405 | ||
|
|
2c536d913d | ||
|
|
105f81de89 | ||
|
|
e5efb565c5 | ||
|
|
932c92d5f6 | ||
|
|
ecf97f8cc1 | ||
|
|
f4e7e7f54f | ||
|
|
75f0bfc8fc | ||
|
|
14feb5d4f7 | ||
|
|
56fb94104b | ||
|
|
8d3965fa9c | ||
|
|
e5b8971aac | ||
|
|
8616127c50 | ||
|
|
e3af57b136 | ||
|
|
9bde5fe6ef | ||
|
|
b83d6e4b80 | ||
|
|
6f14ce551a | ||
|
|
e4c4cdad4b | ||
|
|
d29d18b33c | ||
|
|
42753381ff | ||
|
|
77eee77313 | ||
|
|
8ff93b159b | ||
|
|
631d457373 | ||
|
|
1a8968a396 | ||
|
|
fefcde9df7 | ||
|
|
c99d8c2d3a | ||
|
|
c4fbd51f1d | ||
|
|
371841b253 | ||
|
|
f2d6f553b3 | ||
|
|
b59fdff188 | ||
|
|
ef3a20d4ba | ||
|
|
f1f6d87862 | ||
|
|
3a979f1660 |
72
.github/workflows/bump-winget.yml
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
name: Bump winget package
|
||||
|
||||
# Opens a pull request on microsoft/winget-pkgs for each published release,
|
||||
# the Windows counterpart of bump-cask.yml. Komac reads the manifest of the
|
||||
# version already in winget-pkgs, swaps in the new installer URL and its
|
||||
# checksum, and submits from the token owner's fork of winget-pkgs. The
|
||||
# package's first version is submitted by hand; this only updates it.
|
||||
#
|
||||
# Needs the WINGET_TOKEN secret: a classic personal access token with the
|
||||
# `public_repo` scope (Komac cannot open the pull request with a
|
||||
# fine-grained one), whose account has a fork of microsoft/winget-pkgs.
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Release tag to submit (vX.Y.Z). Empty means the latest release.
|
||||
required: false
|
||||
|
||||
env:
|
||||
PACKAGE_ID: DiffusionStudio.DiffusionStudio
|
||||
KOMAC_VERSION: 2.16.0
|
||||
KOMAC_SHA256: 7d2707fa6210f2789a3702de49fbd150b736dbf426ee0b9bc8e098736f9fd82d
|
||||
|
||||
jobs:
|
||||
bump-winget:
|
||||
if: ${{ !github.event.release.prerelease }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Resolve release
|
||||
id: info
|
||||
env:
|
||||
TAG: ${{ github.event.release.tag_name || inputs.tag }}
|
||||
run: |
|
||||
if [ -z "$TAG" ]; then
|
||||
TAG=$(curl -sf https://api.github.com/repos/diffusionstudio/editor/releases/latest | jq -r .tag_name)
|
||||
fi
|
||||
# Draft releases carry a placeholder tag (untagged-<hash>); never submit that.
|
||||
if ! echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||
echo "Refusing to bump winget: '$TAG' is not a vX.Y.Z tag" >&2
|
||||
exit 1
|
||||
fi
|
||||
URL="https://github.com/diffusionstudio/editor/releases/download/${TAG}/Diffusion-Studio-x64-Setup.exe"
|
||||
# Komac downloads the installer to hash it; make sure it is there first (retrying like bump-cask.yml).
|
||||
curl -sfIL --retry 10 --retry-delay 30 --retry-all-errors -o /dev/null "$URL"
|
||||
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
||||
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
|
||||
echo "url=$URL" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install Komac
|
||||
run: |
|
||||
curl -sfL -o komac.tar.gz "https://github.com/russellbanks/Komac/releases/download/v${KOMAC_VERSION}/komac-${KOMAC_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
|
||||
echo "${KOMAC_SHA256} komac.tar.gz" | sha256sum -c -
|
||||
tar -xzf komac.tar.gz komac
|
||||
./komac --version
|
||||
|
||||
- name: Submit to winget-pkgs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
||||
VERSION: ${{ steps.info.outputs.version }}
|
||||
URL: ${{ steps.info.outputs.url }}
|
||||
TAG: ${{ steps.info.outputs.tag }}
|
||||
# On a rerun Komac finds the pull request it opened before and, in CI,
|
||||
# exits without opening another.
|
||||
run: |
|
||||
./komac update "$PACKAGE_ID" \
|
||||
--version "$VERSION" \
|
||||
--urls "$URL" \
|
||||
--release-notes-url "https://github.com/diffusionstudio/editor/releases/tag/${TAG}" \
|
||||
--submit
|
||||
3
.gitignore
vendored
@ -39,4 +39,5 @@ out/
|
||||
# AI
|
||||
skills-lock.json
|
||||
.agents
|
||||
.claude
|
||||
.claude
|
||||
.gstack/
|
||||
|
||||
33
README.md
@ -49,7 +49,6 @@ The agent handles everything from there:
|
||||
Beyond finishing a cut, it covers:
|
||||
|
||||
- **Motion graphics**: explainers, promos, and title sequences
|
||||
- **Generative assets**: images, video, and voiceover, declared in code and composited into the timeline
|
||||
- **Clipping**: highlights from a long video, reformatted for social
|
||||
- **Video understanding**: summaries, scene search, quotes with timestamps
|
||||
|
||||
@ -141,10 +140,6 @@ The root is a `<stage>` holding one `<scene>` per frame you cut in:
|
||||
|
||||
```tsx
|
||||
import { For } from "solid-js";
|
||||
import { generate } from "@diffusionstudio/jsx";
|
||||
|
||||
const hero = generate.image({ prompt: "A neon city at night, cinematic", aspectRatio: "16:9" });
|
||||
const motion = generate.video({ prompt: "slow camera push-in", startFrame: hero, duration: 5 });
|
||||
|
||||
const TITLES = [
|
||||
{ text: "The Grid", start: 0, end: 2.5 },
|
||||
@ -155,7 +150,7 @@ export default function Project() {
|
||||
return (
|
||||
<stage camera={[0.3, 0, 0, 0.3, 85, 150]}>
|
||||
<scene name="Intro" width={1920} height={1080} fill="black" active>
|
||||
<video src={motion} start={0} end={5} width={1920} height={1080} />
|
||||
<video src="footage/city.mp4" start={0} end={5} width={1920} height={1080} />
|
||||
<For each={TITLES}>
|
||||
{(t) => (
|
||||
<text
|
||||
@ -185,16 +180,16 @@ Everything a mount produces stays a first-class editor node, so a person can pic
|
||||
Cutting footage requires understanding it. The app exposes the inspection tools an agent needs to work with media it cannot watch — as MCP tools, and as the same commands in a shell:
|
||||
|
||||
```sh
|
||||
diffusion media probe clip.mp4 # container + codec metadata, like ffprobe
|
||||
diffusion media grab clip.mp4 -t 0 12 45 # decode frames to PNGs
|
||||
diffusion media filmstrip clip.mp4 # grid of video frames
|
||||
diffusion media waveform track.mp3 # audio waveform, silence flagged
|
||||
diffusion media transcribe interview.wav # timed, word-level transcript
|
||||
diffusion media listen interview.mp4 -p "what is said in the intro?" # ask a multimodal model
|
||||
diffusion capture intro -t 0 2 4 # the frames a render would produce, by scene id
|
||||
diffusion probe clip.mp4 # container + codec metadata, like ffprobe
|
||||
diffusion grab clip.mp4 -t 0 12 45 # decode frames to PNGs
|
||||
diffusion filmstrip clip.mp4 # grid of video frames
|
||||
diffusion waveform track.mp3 # audio waveform, silence flagged
|
||||
diffusion transcribe interview.wav # timed, word-level transcript
|
||||
diffusion listen interview.mp4 -p "what is said in the intro?" # ask a multimodal model
|
||||
diffusion capture intro -t 0 2 4 # the frames a render would produce, by scene id
|
||||
```
|
||||
|
||||
Each command is the MCP tool of the same name: `diffusion media grab` is `media_grab`, `--per-sheet` is `perSheet`.
|
||||
Each command is the MCP tool of the same name: `diffusion grab` is `grab`, `--per-sheet` is `perSheet`.
|
||||
|
||||
| Command | Purpose |
|
||||
| --- | --- |
|
||||
@ -202,8 +197,8 @@ Each command is the MCP tool of the same name: `diffusion media grab` is `media_
|
||||
| `diffusion context` | Summary of app state |
|
||||
| `diffusion capture` | Render frames of a scene, as an export would, to a labelled contact sheet or one PNG per position |
|
||||
| `diffusion check` | Check a node's subtree for structural mistakes (black-frame gaps, never-visible nodes, failed sources) and report subtree stats |
|
||||
| `diffusion media …` | Inspect a file by id or path: `probe`, `grab`, `filmstrip`, `waveform`, `transcribe`, `listen` |
|
||||
| `diffusion models` / `diffusion voices` / `diffusion fonts` | Discover generation models, speech voices, local fonts |
|
||||
| `diffusion probe` / `grab` / `filmstrip` / `waveform` / `transcribe` / `listen` | Inspect a file by id or path |
|
||||
| `diffusion fonts` | Discover Google Fonts and local font families |
|
||||
| `diffusion screenshot` / `diffusion logs` | The app itself: capture the window, read recent console output |
|
||||
| `diffusion report` | Report a bug in the tools or the app: diagnostics bundled, filed as a GitHub issue via `gh` |
|
||||
|
||||
@ -212,8 +207,8 @@ Conventions throughout: every result is one JSON object, the same structured con
|
||||
## Documentation
|
||||
|
||||
- [Tool reference](docs/reference/tools/README.md): every tool and CLI command, its options, and its output
|
||||
- [JSX reference](docs/reference/jsx/README.md): the composition markup with elements, timing, paints, generative assets, and captions
|
||||
- [Examples](docs/examples/README.md): runnable compositions, from basic scenes and generative assets to three.js and raw WebGPU
|
||||
- [JSX reference](docs/reference/jsx/README.md): the composition markup with elements, timing, paints, and captions
|
||||
- [Examples](docs/examples/README.md): runnable compositions, from basic scenes to three.js and raw WebGPU
|
||||
|
||||
## Repository layout
|
||||
|
||||
@ -224,7 +219,7 @@ Conventions throughout: every result is one JSON object, the same structured con
|
||||
| `apps/cli` | `@diffusionstudio/cli` | The `diffusion` CLI (`dapi` alias): a client of the app's MCP server |
|
||||
| `packages/runtime` | `@diffusionstudio/runtime` | Headless editor runtime: the koota world, traits, actions, systems, media decoding, capture. No DOM, no Solid |
|
||||
| `packages/reconciler` | `@diffusionstudio/reconciler` | Evaluates a compiled project bundle and reconciles its element tree onto runtime entities, via Solid's universal renderer |
|
||||
| `packages/jsx` | `@diffusionstudio/jsx` | The authoring API: element vocabulary, types, and generated assets (`generate.*`) |
|
||||
| `packages/jsx` | `@diffusionstudio/jsx` | The authoring API: element vocabulary and types |
|
||||
| `packages/assets` | `@diffusionstudio/assets` | A project's asset library: the `assets.yml` manifest, content hashing, probing, resolution |
|
||||
| `packages/encoder` | `@diffusionstudio/encoder` | Offline video/audio/image encoding over runtime worlds (mediabunny) |
|
||||
| `packages/koota-solid` | `@diffusionstudio/koota-solid` | Solid bindings for koota, ported from `@koota/react` |
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@diffusionstudio/cli",
|
||||
"private": true,
|
||||
"version": "0.209.0",
|
||||
"version": "0.216.0",
|
||||
"license": "MPL-2.0",
|
||||
"bin": {
|
||||
"diffusion": "./dist/index.js",
|
||||
|
||||
@ -12,13 +12,14 @@ import type { ToolInput, ToolName, ToolOutput } from "@diffusionstudio/dapi";
|
||||
|
||||
export const APP_NAME = "Diffusion Studio";
|
||||
|
||||
// Renders and AI generation outlive the 60s default.
|
||||
// Renders, media analysis and file transfers outlive the 60s default.
|
||||
const TIMEOUTS: Record<string, number> = {
|
||||
export: 3_600_000,
|
||||
capture: 600_000,
|
||||
media_transcribe: 600_000,
|
||||
media_listen: 600_000,
|
||||
media_segment: 3_600_000,
|
||||
transcribe: 600_000,
|
||||
listen: 600_000,
|
||||
generate: 600_000,
|
||||
job: 600_000,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
import { existsSync } from "node:fs";
|
||||
import { isAbsolute, resolve } from "node:path";
|
||||
import { Command } from "commander";
|
||||
import { Argument, Command } from "commander";
|
||||
import { z } from "zod";
|
||||
import { version } from "../../../package.json";
|
||||
import { MCP_URL, toolByName } from "@diffusionstudio/dapi";
|
||||
@ -66,24 +66,31 @@ function assetPath(ref: string): string {
|
||||
return ref;
|
||||
}
|
||||
|
||||
/** `x,y` as a point, added to the ones given before; a malformed one becomes NaN for the schema to reject. */
|
||||
const point = (value: string, previous: Array<{ x: number; y: number }> = []): Array<{ x: number; y: number }> => {
|
||||
const [x = NaN, y = NaN, ...rest] = value.split(",").map(numeric);
|
||||
return [...previous, rest.length > 0 ? { x: NaN, y: NaN } : { x, y }];
|
||||
};
|
||||
/** Parsed JSON, or a failure naming what was being read. */
|
||||
function json(value: string, what: string): unknown {
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch (e) {
|
||||
fail(`${what} is not valid JSON: ${(e as Error).message}`);
|
||||
}
|
||||
}
|
||||
|
||||
/** `x0,y0,x1,y1` as a box; the wrong count of numbers becomes NaN for the schema to reject. */
|
||||
const box = (value: string): [number, number, number, number] => {
|
||||
const bounds = value.split(",").map(numeric);
|
||||
return bounds.length === 4 ? (bounds as [number, number, number, number]) : [NaN, NaN, NaN, NaN];
|
||||
};
|
||||
/** Every `{ "path": … }` file reference in a request, resolved as `assetPath` does; the rest untouched. */
|
||||
function resolveFileRefs(value: unknown): unknown {
|
||||
if (Array.isArray(value)) return value.map(resolveFileRefs);
|
||||
if (typeof value !== "object" || value === null) return value;
|
||||
const entries = Object.entries(value);
|
||||
if (entries.length === 1 && entries[0]![0] === "path" && typeof entries[0]![1] === "string") return { path: assetPath(entries[0]![1]) };
|
||||
return Object.fromEntries(entries.map(([key, item]) => [key, resolveFileRefs(item)]));
|
||||
}
|
||||
|
||||
/**
|
||||
* A mask's destination: a path spelled as one on disk (absolute, or starting
|
||||
* with `.`) resolves against the working directory; anything else is a
|
||||
* library path, passed through for the app to resolve in the open project.
|
||||
* Where generated files go: a path spelled as one on disk
|
||||
* (absolute, or starting with `.`) resolves against the working directory;
|
||||
* anything else is a library path, passed through for the app to resolve in
|
||||
* the open project.
|
||||
*/
|
||||
function maskOutput(ref: string): string {
|
||||
function libraryOrDiskPath(ref: string): string {
|
||||
return isAbsolute(ref) || ref.startsWith(".") ? resolve(ref) : ref;
|
||||
}
|
||||
|
||||
@ -92,15 +99,15 @@ const program = new Command();
|
||||
program
|
||||
.name("diffusion")
|
||||
.description(
|
||||
`The Diffusion Studio CLI: understand, generate, and edit footage.
|
||||
Analyze video/audio/images, generate them with AI, and compose assets.
|
||||
Use for any media analysis, media generation, or video editing task. No ffmpeg needed.`)
|
||||
`The Diffusion Studio CLI: understand and edit footage.
|
||||
Analyze video/audio/images and compose assets.
|
||||
Use for any media analysis or video editing task. No ffmpeg needed.`)
|
||||
.version(version);
|
||||
|
||||
program
|
||||
.command("open")
|
||||
.description(
|
||||
`Launch ${APP_NAME} (or surface the running instance) and, given a path, open that folder as a project, creating the project files if the folder is not one yet. Prints the project's id, display name, and folder. Run this once before commands that need an open project (capture, check, export, context, and library paths in media commands).`,
|
||||
`Launch ${APP_NAME} (or surface the running instance) and, given a path, open that folder as a project, creating the project files if the folder is not one yet. Prints the project's id, display name, and folder. Run this once before commands that need an open project.`,
|
||||
)
|
||||
.argument("[path]", `${field("open", "dir")} (default: none — just launch the app)`)
|
||||
.option("-b, --background", "launch or keep the app in the background, without raising a window")
|
||||
@ -154,114 +161,115 @@ program
|
||||
if (output.issues.some((issue) => issue.severity === "error")) process.exitCode = 1;
|
||||
});
|
||||
|
||||
const media = program
|
||||
.command("media")
|
||||
.alias("m")
|
||||
.description(
|
||||
"Inspect a media file by path, without adding it to the project: probe metadata, transcribe speech, grab frames, render visual previews, and analyze with multimodal models. Local files work with or without an open project; library paths need one.",
|
||||
);
|
||||
|
||||
media
|
||||
program
|
||||
.command("probe")
|
||||
.description(describe("media_probe"))
|
||||
.argument("<path>", field("media_probe", "path"))
|
||||
.action((ref: string) => run("media_probe", { path: assetPath(ref) }));
|
||||
.description(describe("probe"))
|
||||
.argument("<path>", field("probe", "path"))
|
||||
.action((ref: string) => run("probe", { path: assetPath(ref) }));
|
||||
|
||||
media
|
||||
program
|
||||
.command("transcribe")
|
||||
.description(describe("media_transcribe"))
|
||||
.argument("<path>", field("media_transcribe", "path"))
|
||||
.option("-o, --output <path>", field("media_transcribe", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"media_transcribe">, "path">) =>
|
||||
run("media_transcribe", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
.description(describe("transcribe"))
|
||||
.argument("<path>", field("transcribe", "path"))
|
||||
.option("-o, --output <path>", field("transcribe", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"transcribe">, "path">) =>
|
||||
run("transcribe", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
);
|
||||
|
||||
media
|
||||
program
|
||||
.command("grab")
|
||||
.alias("sample")
|
||||
.description(describe("media_grab"))
|
||||
.argument("<path>", field("media_grab", "path"))
|
||||
.option("-t, --times <time...>", field("media_grab", "times"))
|
||||
.option("-c, --count <n>", field("media_grab", "count"), numeric)
|
||||
.option("-a, --auto", field("media_grab", "auto"))
|
||||
.option("-s, --start <time>", field("media_grab", "start"))
|
||||
.option("-e, --end <time>", field("media_grab", "end"))
|
||||
.option("-q, --quality <preset>", field("media_grab", "quality"))
|
||||
.option("-S, --separate", field("media_grab", "separate"))
|
||||
.option("--per-sheet <n>", field("media_grab", "perSheet"), numeric)
|
||||
.option("--uncapped", field("media_grab", "uncapped"))
|
||||
.option("-o, --output <dir>", field("media_grab", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"media_grab">, "path">) =>
|
||||
run("media_grab", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
.description(describe("grab"))
|
||||
.argument("<path>", field("grab", "path"))
|
||||
.option("-t, --times <time...>", field("grab", "times"))
|
||||
.option("-c, --count <n>", field("grab", "count"), numeric)
|
||||
.option("-a, --auto", field("grab", "auto"))
|
||||
.option("-s, --start <time>", field("grab", "start"))
|
||||
.option("-e, --end <time>", field("grab", "end"))
|
||||
.option("-q, --quality <preset>", field("grab", "quality"))
|
||||
.option("-S, --separate", field("grab", "separate"))
|
||||
.option("--per-sheet <n>", field("grab", "perSheet"), numeric)
|
||||
.option("--uncapped", field("grab", "uncapped"))
|
||||
.option("-o, --output <dir>", field("grab", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"grab">, "path">) =>
|
||||
run("grab", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
);
|
||||
|
||||
media
|
||||
program
|
||||
.command("filmstrip")
|
||||
.alias("film")
|
||||
.description(describe("media_filmstrip"))
|
||||
.argument("<path>", field("media_filmstrip", "path"))
|
||||
.option("-s, --start <time>", field("media_filmstrip", "start"))
|
||||
.option("-e, --end <time>", field("media_filmstrip", "end"))
|
||||
.option("-x, --scale <factor>", field("media_filmstrip", "scale"), numeric)
|
||||
.option("-o, --output <path>", field("media_filmstrip", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"media_filmstrip">, "path">) =>
|
||||
run("media_filmstrip", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
.description(describe("filmstrip"))
|
||||
.argument("<path>", field("filmstrip", "path"))
|
||||
.option("-s, --start <time>", field("filmstrip", "start"))
|
||||
.option("-e, --end <time>", field("filmstrip", "end"))
|
||||
.option("-x, --scale <factor>", field("filmstrip", "scale"), numeric)
|
||||
.option("-o, --output <path>", field("filmstrip", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"filmstrip">, "path">) =>
|
||||
run("filmstrip", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
);
|
||||
|
||||
media
|
||||
program
|
||||
.command("waveform")
|
||||
.alias("wave")
|
||||
.description(describe("media_waveform"))
|
||||
.argument("<path>", field("media_waveform", "path"))
|
||||
.option("-s, --start <time>", field("media_waveform", "start"))
|
||||
.option("-e, --end <time>", field("media_waveform", "end"))
|
||||
.option("-x, --scale <factor>", field("media_waveform", "scale"), numeric)
|
||||
.option("-o, --output <path>", field("media_waveform", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"media_waveform">, "path">) =>
|
||||
run("media_waveform", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
.description(describe("waveform"))
|
||||
.argument("<path>", field("waveform", "path"))
|
||||
.option("-s, --start <time>", field("waveform", "start"))
|
||||
.option("-e, --end <time>", field("waveform", "end"))
|
||||
.option("-x, --scale <factor>", field("waveform", "scale"), numeric)
|
||||
.option("-o, --output <path>", field("waveform", "output"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"waveform">, "path">) =>
|
||||
run("waveform", { path: assetPath(ref), ...opts, output: opts.output && resolve(opts.output) }),
|
||||
);
|
||||
|
||||
media
|
||||
program
|
||||
.command("listen")
|
||||
.description(describe("media_listen"))
|
||||
.argument("<path>", field("media_listen", "path"))
|
||||
.option("-p, --prompt <str>", field("media_listen", "prompt"))
|
||||
.option("-s, --start <time>", field("media_listen", "start"))
|
||||
.option("-e, --end <time>", field("media_listen", "end"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"media_listen">, "path">) => run("media_listen", { path: assetPath(ref), ...opts }));
|
||||
.description(describe("listen"))
|
||||
.argument("<path>", field("listen", "path"))
|
||||
.option("-p, --prompt <str>", field("listen", "prompt"))
|
||||
.option("-s, --start <time>", field("listen", "start"))
|
||||
.option("-e, --end <time>", field("listen", "end"))
|
||||
.action((ref: string, opts: Omit<ToolInput<"listen">, "path">) => run("listen", { path: assetPath(ref), ...opts }));
|
||||
|
||||
media
|
||||
.command("segment")
|
||||
.alias("mask")
|
||||
.description(describe("media_segment"))
|
||||
.argument("<path>", field("media_segment", "path"))
|
||||
.requiredOption("-t, --time <time>", field("media_segment", "time"))
|
||||
.option("-p, --point <x,y>", `${field("media_segment", "points")}; repeat for more`, point)
|
||||
.option("-x, --exclude <x,y>", `${field("media_segment", "exclude")}; repeat for more`, point)
|
||||
.option("-b, --box <x0,y0,x1,y1>", field("media_segment", "box"), box)
|
||||
.option("--preview", field("media_segment", "preview"))
|
||||
.option("-s, --start <time>", field("media_segment", "start"))
|
||||
.option("-e, --end <time>", field("media_segment", "end"))
|
||||
.option("-m, --model <size>", field("media_segment", "model"))
|
||||
program
|
||||
.command("generate")
|
||||
.alias("gen")
|
||||
.description(describe("generate"))
|
||||
.addArgument(new Argument("<model>", field("generate", "model")).choices(toolByName("generate").input.shape.model.options))
|
||||
.argument(
|
||||
"[fields]",
|
||||
`the model's other fields as one JSON object, e.g. '{"aspectRatio":"16:9","images":[{"path":"./ref.png"}]}'; a { "path" } that exists relative to the working directory is sent as its absolute path; an "audio" field also takes { "scene": "<id>" }, the scene's mix`,
|
||||
)
|
||||
.option("-p, --prompt <text>", "the request's `prompt`, without JSON quoting; wins over one in the fields")
|
||||
.option(
|
||||
"-o, --output <path>",
|
||||
`${field("media_segment", "output")}; a path starting with . resolves against the working directory`,
|
||||
`${field("generate", "output")}; a path starting with . resolves against the working directory`,
|
||||
)
|
||||
.action((ref: string, opts: Omit<ToolInput<"media_segment">, "path"> & { point?: ToolInput<"media_segment">["points"] }) => {
|
||||
const { point: points, ...rest } = opts;
|
||||
return run("media_segment", { path: assetPath(ref), ...rest, points, output: opts.output && maskOutput(opts.output) });
|
||||
.option("--max-credits <n>", field("generate", "maxCredits"), numeric)
|
||||
.option("--estimate", field("generate", "estimate"))
|
||||
.action((model: ToolInput<"generate">["model"], fields: string | undefined, opts: { prompt?: string; output?: string; maxCredits?: number; estimate?: boolean }) => {
|
||||
const parsed = fields === undefined ? {} : json(fields, "fields");
|
||||
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) fail("fields must be a JSON object.");
|
||||
const request = resolveFileRefs(parsed) as Record<string, unknown>;
|
||||
return run("generate", {
|
||||
...request,
|
||||
model,
|
||||
...(opts.prompt === undefined ? {} : { prompt: opts.prompt }),
|
||||
output: opts.output && libraryOrDiskPath(opts.output),
|
||||
maxCredits: opts.maxCredits,
|
||||
estimate: opts.estimate,
|
||||
});
|
||||
});
|
||||
|
||||
program
|
||||
.command("models")
|
||||
.description(describe("models"))
|
||||
.argument("[type]", field("models", "type"))
|
||||
.action((type: ToolInput<"models">["type"]) => run("models", { type }));
|
||||
|
||||
program
|
||||
.command("voices")
|
||||
.description(describe("voices"))
|
||||
.action(() => run("voices", {}));
|
||||
.command("job")
|
||||
.description(`${describe("job")} Exits 1 when the job failed or was canceled.`)
|
||||
.argument("<id>", field("job", "id"))
|
||||
.option("--cancel", field("job", "cancel"))
|
||||
.action(async (id: string, opts: { cancel?: boolean }) => {
|
||||
const output = await call("job", { id, cancel: opts.cancel }).catch(appError);
|
||||
console.log(JSON.stringify(output));
|
||||
if (output.status === "failed" || output.status === "canceled") process.exitCode = 1;
|
||||
});
|
||||
|
||||
program
|
||||
.command("logs")
|
||||
@ -311,4 +319,8 @@ program
|
||||
// Explicit argv convention: the packaged wrapper runs this bundle on
|
||||
// Electron in ELECTRON_RUN_AS_NODE mode, where commander would otherwise
|
||||
// detect Electron and drop the script path from argv.
|
||||
program.parse(process.argv, { from: "node" });
|
||||
// The media commands used to sit under a `media` (`m`) group; drop that word so
|
||||
// scripts written against it (older projects' npm scripts) keep working.
|
||||
const argv = ["media", "m"].includes(process.argv[2] ?? "") ? process.argv.toSpliced(2, 1) : process.argv;
|
||||
|
||||
program.parse(argv, { from: "node" });
|
||||
|
||||
@ -93,6 +93,13 @@ const config: ForgeConfig = {
|
||||
}),
|
||||
],
|
||||
hooks: {
|
||||
prePackage: async () => {
|
||||
if (process.platform === 'win32' && !process.env.SKIP_SIGN && !sign) {
|
||||
throw new Error(
|
||||
'Windows signing needs WINDOWS_SIGNTOOL_PATH, WINDOWS_SIGN_DLIB and WINDOWS_SIGN_METADATA; set SKIP_SIGN=1 for an unsigned build.',
|
||||
);
|
||||
}
|
||||
},
|
||||
preMake: async () => ensure7zip(),
|
||||
},
|
||||
};
|
||||
@ -111,9 +118,7 @@ function windowsSign() {
|
||||
} = process.env;
|
||||
|
||||
if (!signToolPath || !dlib || !metadata) {
|
||||
throw new Error(
|
||||
'Windows signing needs WINDOWS_SIGNTOOL_PATH, WINDOWS_SIGN_DLIB and WINDOWS_SIGN_METADATA; set SKIP_SIGN=1 for an unsigned build.',
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@diffusionstudio/desktop",
|
||||
"private": true,
|
||||
"version": "0.209.0",
|
||||
"version": "0.216.0",
|
||||
"license": "MPL-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@ -3,84 +3,107 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import { app } from "electron";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { join } from "node:path";
|
||||
import { access, writeFile } from "node:fs/promises";
|
||||
import { stat, writeFile } from "node:fs/promises";
|
||||
|
||||
import type { ClientEventName, TrackedEvent, TrackProps } from "@diffusionstudio/api-contract";
|
||||
import type { WindowHost } from "./window-host";
|
||||
|
||||
const enabled = app.isPackaged || process.env.DIFFUSION_ANALYTICS === "1";
|
||||
|
||||
const FLUSH_INTERVAL_MS = 30_000;
|
||||
const BATCH_MAX = 100;
|
||||
const QUEUE_MAX = 2_000;
|
||||
|
||||
const queue: TrackedEvent[] = [];
|
||||
|
||||
let apiUrl: string | null = null;
|
||||
let token: string | null | undefined;
|
||||
|
||||
/** Canvas edits by kind, and source files changed from outside the app, since the last flush. */
|
||||
let canvasEdits: Record<string, number> = {};
|
||||
let changedFiles = new Set<string>();
|
||||
|
||||
export function configureAnalytics(config: { apiUrl: string; token: string | null }): void {
|
||||
apiUrl = config.apiUrl;
|
||||
token = config.token;
|
||||
}
|
||||
|
||||
export function track(name: ClientEventName, props: TrackProps = {}): void {
|
||||
if (!enabled) return;
|
||||
// Undefined values would fail validation; JSON leaves them out.
|
||||
queue.push({
|
||||
id: randomUUID(),
|
||||
at: new Date().toISOString(),
|
||||
name,
|
||||
props: JSON.parse(JSON.stringify(props)),
|
||||
});
|
||||
|
||||
if (queue.length > QUEUE_MAX) {
|
||||
queue.splice(0, queue.length - QUEUE_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
/** Edits the canvas wrote back to the source (move, insert, remove, …). */
|
||||
export function countCanvasEdits(kinds: string[]): void {
|
||||
for (const kind of kinds) {
|
||||
canvasEdits[kind] = (canvasEdits[kind] ?? 0) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/** A source file changed from outside the app: an agent or an editor writing code. */
|
||||
export function countCodeChange(path: string): void {
|
||||
changedFiles.add(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Desktop analytics. The renderer's Umami script never fires inside Electron
|
||||
* (its `data-domains` gate does not match the `file://` origin), so main
|
||||
* posts events directly to Umami's send API: the renderer's product events
|
||||
* arrive over `ANALYTICS_TRACK`, and the install event is sent from here.
|
||||
*
|
||||
* Install tracking is proxied by the first launch of a packaged build: one
|
||||
* event, then a marker file in `userData` to never send it again. Offline
|
||||
* first launches retry on the next launch.
|
||||
* Starts the flush and usage timers and records the launch. The first launch of an
|
||||
* install is recorded once, guarded by a marker file in `userData`; its age
|
||||
* goes on every `app_opened`, so install-to-sign-up time needs no device id.
|
||||
*/
|
||||
export async function startAnalytics(windows: WindowHost): Promise<void> {
|
||||
if (!enabled) return;
|
||||
|
||||
const UMAMI_ENDPOINT = "https://cloud.umami.is/api/send";
|
||||
const UMAMI_WEBSITE_ID = "e898e381-6ce3-4f5f-a485-8327ec9aa88b";
|
||||
const HOSTNAME = "desktop.diffusion.studio";
|
||||
const MARKER_FILE = "install-tracked";
|
||||
setInterval(flush, FLUSH_INTERVAL_MS);
|
||||
setInterval(() => (windows.current() && track("app_used")), 60_000);
|
||||
|
||||
// Umami discards events whose User-Agent trips its bot filter, which both
|
||||
// Node's fetch default and Electron's own UA do — send a plain browser UA
|
||||
// that still attributes the right OS.
|
||||
function userAgent(): string {
|
||||
const platform =
|
||||
process.platform === "darwin"
|
||||
? "Macintosh; Intel Mac OS X 10_15_7"
|
||||
: process.platform === "win32"
|
||||
? "Windows NT 10.0; Win64; x64"
|
||||
: "X11; Linux x86_64";
|
||||
return `Mozilla/5.0 (${platform}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36`;
|
||||
const marker = join(app.getPath("userData"), "install-tracked");
|
||||
const installedAt = await stat(marker).then((info) => info.birthtimeMs, () => null);
|
||||
|
||||
if (installedAt === null) {
|
||||
track("app_installed", { arch: process.arch });
|
||||
await writeFile(marker, new Date().toISOString()).catch(() => { });
|
||||
}
|
||||
|
||||
track("app_opened", { install_age_s: Math.round((Date.now() - (installedAt ?? Date.now())) / 1000) });
|
||||
}
|
||||
|
||||
export type AnalyticsEventData = Record<string, string | number | boolean>;
|
||||
async function flush(): Promise<void> {
|
||||
const edits = Object.values(canvasEdits).reduce((sum, n) => sum + n, 0);
|
||||
if (edits) {
|
||||
track("canvas_edited", { edits, ...canvasEdits });
|
||||
}
|
||||
if (changedFiles.size) {
|
||||
track("code_changed", { files: changedFiles.size });
|
||||
}
|
||||
canvasEdits = {};
|
||||
changedFiles = new Set();
|
||||
|
||||
/** Post one event to Umami. Resolves to whether Umami accepted it; never throws. */
|
||||
async function sendEvent(name: string, url: string, data: AnalyticsEventData): Promise<boolean> {
|
||||
if (!queue.length || !apiUrl || token === undefined) return;
|
||||
const batch = queue.splice(0, BATCH_MAX);
|
||||
try {
|
||||
const response = await fetch(UMAMI_ENDPOINT, {
|
||||
const response = await fetch(`${apiUrl}/api/v2/trpc/events.track`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", "User-Agent": userAgent() },
|
||||
body: JSON.stringify({
|
||||
type: "event",
|
||||
payload: { website: UMAMI_WEBSITE_ID, hostname: HOSTNAME, url, name, data },
|
||||
}),
|
||||
headers: { "Content-Type": "application/json", ...(token ? { Authorization: `Bearer ${token}` } : {}) },
|
||||
body: JSON.stringify({ source: "desktop", appVersion: app.getVersion(), platform: process.platform, events: batch }),
|
||||
signal: AbortSignal.timeout(10_000),
|
||||
});
|
||||
return response.ok;
|
||||
// Sent, or a batch the API will never take (400): either way it is done.
|
||||
if (response.ok || response.status === 400) return;
|
||||
} catch {
|
||||
// Offline or Umami unreachable.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** A product event from the renderer. Dev builds stay out of the numbers. */
|
||||
export async function trackEvent(name: string, data: AnalyticsEventData = {}): Promise<void> {
|
||||
if (!app.isPackaged) return;
|
||||
await sendEvent(name, "/desktop", {
|
||||
...data,
|
||||
platform: process.platform,
|
||||
version: app.getVersion(),
|
||||
});
|
||||
}
|
||||
|
||||
export async function trackInstall(): Promise<void> {
|
||||
if (!app.isPackaged) return;
|
||||
|
||||
const marker = join(app.getPath("userData"), MARKER_FILE);
|
||||
try {
|
||||
await access(marker);
|
||||
return;
|
||||
} catch {
|
||||
// No marker yet — this is the first (tracked) launch.
|
||||
// Offline or the API unreachable.
|
||||
}
|
||||
|
||||
const sent = await sendEvent("desktop_install", "/desktop/install", {
|
||||
platform: process.platform,
|
||||
arch: process.arch,
|
||||
version: app.getVersion(),
|
||||
});
|
||||
// Not sent — retried on the next launch.
|
||||
if (sent) await writeFile(marker, new Date().toISOString()).catch(() => {});
|
||||
queue.unshift(...batch);
|
||||
}
|
||||
|
||||
47
apps/desktop/src/clipboard.ts
Normal file
@ -0,0 +1,47 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// The files on the system clipboard: what a copy in Finder or Explorer (or
|
||||
// of a recording in a screenshot app) leaves there. The renderer reads
|
||||
// pictures itself, but the web clipboard API knows nothing of files, and
|
||||
// outside a paste event this is the only way to them.
|
||||
|
||||
import { clipboard } from "electron";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
/** The files on the clipboard, by path, in the order they were copied. */
|
||||
export function clipboardPaths(): string[] {
|
||||
switch (process.platform) {
|
||||
case "darwin": {
|
||||
// Every file of a copy is in the filenames list, a plist of paths; the
|
||||
// file URL type only holds the first.
|
||||
const plist = clipboard.read("NSFilenamesPboardType");
|
||||
const paths = [...plist.matchAll(/<string>([^<]*)<\/string>/g)].map((match) => unescapeXml(match[1]!));
|
||||
if (paths.length) return paths;
|
||||
const url = clipboard.read("public.file-url");
|
||||
return url.startsWith("file:") ? [fileURLToPath(url)] : [];
|
||||
}
|
||||
case "win32": {
|
||||
// Only the first file of a copy: the full list is in CF_HDROP, which
|
||||
// Electron cannot read.
|
||||
const path = clipboard.readBuffer("FileNameW").toString("utf16le").split("\0")[0];
|
||||
return path ? [path] : [];
|
||||
}
|
||||
default:
|
||||
return clipboard
|
||||
.read("text/uri-list")
|
||||
.split(/\r?\n/)
|
||||
.filter((line) => line.startsWith("file:"))
|
||||
.map((url) => fileURLToPath(url));
|
||||
}
|
||||
}
|
||||
|
||||
function unescapeXml(text: string): string {
|
||||
return text
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/&/g, "&");
|
||||
}
|
||||
@ -2,10 +2,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import { mkdirSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
|
||||
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { basename, dirname, join } from "node:path";
|
||||
import { afterAll, describe, expect, it } from "vitest";
|
||||
import { afterAll, describe, expect, it, vi } from "vitest";
|
||||
import { present, toCallToolResult } from "./present";
|
||||
|
||||
const dir = mkdtempSync(join(tmpdir(), "dapi-present-"));
|
||||
@ -25,7 +25,7 @@ describe("present", () => {
|
||||
});
|
||||
|
||||
it("picks a fresh temp directory when none is given", async () => {
|
||||
const presented = await present("media_grab", { path: "/c.mp4" }, [{ timecode: "0f", png: png(3) }]);
|
||||
const presented = await present("grab", { path: "/c.mp4" }, [{ timecode: "0f", png: png(3) }]);
|
||||
const { path } = (presented.output as { images: Array<{ path: string }> }).images[0]!;
|
||||
expect(path).toMatch(/dapi-grab-.*[\\/]0f\.png$/);
|
||||
rmSync(join(path, ".."), { recursive: true, force: true });
|
||||
@ -33,20 +33,20 @@ describe("present", () => {
|
||||
|
||||
it("keeps a preview's other fields next to the path", async () => {
|
||||
const file = join(dir, "wave.png");
|
||||
const presented = await present("media_waveform", { path: "/c.mp4", output: file }, { png: png(4), silences: [{ start: 0, end: 1 }] });
|
||||
const presented = await present("waveform", { path: "/c.mp4", output: file }, { png: png(4), silences: [{ start: 0, end: 1 }] });
|
||||
expect(presented.output).toEqual({ path: file, silences: [{ start: 0, end: 1 }] });
|
||||
});
|
||||
|
||||
it("writes a preview or transcript into an output that names an existing directory", async () => {
|
||||
const out = join(dir, "into");
|
||||
mkdirSync(out, { recursive: true });
|
||||
const preview = await present("media_waveform", { path: "/c.mp4", output: out }, { png: png(7), silences: [] });
|
||||
const preview = await present("waveform", { path: "/c.mp4", output: out }, { png: png(7), silences: [] });
|
||||
const previewPath = (preview.output as { path: string }).path;
|
||||
expect(dirname(previewPath)).toBe(out);
|
||||
expect(basename(previewPath)).toMatch(/^dapi-waveform-.*\.png$/);
|
||||
expect(readFileSync(previewPath)).toEqual(Buffer.from(png(7)));
|
||||
|
||||
const transcript = await present("media_transcribe", { path: "/c.mp4", output: out }, { segments: [] });
|
||||
const transcript = await present("transcribe", { path: "/c.mp4", output: out }, { segments: [] });
|
||||
const transcriptPath = (transcript.output as { path: string }).path;
|
||||
expect(transcriptPath).toMatch(/dapi-transcript-.*\.json$/);
|
||||
expect(JSON.parse(readFileSync(transcriptPath, "utf8"))).toEqual({ segments: [] });
|
||||
@ -64,56 +64,11 @@ describe("present", () => {
|
||||
it("writes a transcript to a file, unchanged, and returns its path and size", async () => {
|
||||
const file = join(dir, "talk.json");
|
||||
const segments = [{ text: "Hi there", words: [{ text: "Hi", start: 0, end: 0.2 }, { text: "there", start: 0.3, end: 0.6 }] }];
|
||||
const presented = await present("media_transcribe", { path: "/c.mp4", output: file }, { segments });
|
||||
const presented = await present("transcribe", { path: "/c.mp4", output: file }, { segments });
|
||||
expect(presented).toEqual({ output: { path: file, segments: 1, words: 2 }, images: [] });
|
||||
expect(JSON.parse(readFileSync(file, "utf8"))).toEqual({ segments });
|
||||
});
|
||||
|
||||
it("writes a segment's mask where output says and its picture to the temp dir", async () => {
|
||||
const found = {
|
||||
model: "tiny" as const, frameRate: 30, start: 0, end: 1, frames: 30, bbox: null, area: 0, score: 1, iou: 0.9, lost: [], weak: [],
|
||||
};
|
||||
const file = join(dir, "masks", "skater.mask");
|
||||
const presented = await present("media_segment", { path: "/c.mp4", time: 0, output: file }, { png: png(8), mask: png(9, 4), ...found });
|
||||
const output = presented.output as { image: string; path: string };
|
||||
expect(output).toEqual({ image: output.image, path: file, ...found });
|
||||
expect(output.image).toMatch(/dapi-segment-.*\.png$/);
|
||||
expect(readFileSync(file)).toEqual(Buffer.from(png(9, 4)));
|
||||
expect(presented.images).toEqual([{ path: output.image, png: png(8) }]);
|
||||
});
|
||||
|
||||
it("keeps the path of a mask the app put into the library, and writes none for a preview", async () => {
|
||||
const found = {
|
||||
model: "tiny" as const, frameRate: 30, start: 1, end: 1.033, frames: 1, bbox: null, area: 0, score: 1, iou: 0.9, lost: [], weak: [],
|
||||
};
|
||||
const stored = await present("media_segment", { path: "/c.mp4", time: 1 }, { png: png(8), path: "/p/assets/masks/a.mask", src: "masks/a.mask", ...found });
|
||||
expect(stored.output).toMatchObject({ path: "/p/assets/masks/a.mask", src: "masks/a.mask" });
|
||||
const preview = await present("media_segment", { path: "/c.mp4", time: 1, preview: true }, { png: png(8), ...found });
|
||||
expect(preview.output).not.toHaveProperty("path");
|
||||
});
|
||||
|
||||
it("has no picture for a track still running in the background", async () => {
|
||||
const span = { model: "tiny" as const, frameRate: 30, start: 0, end: 2, frames: 60 };
|
||||
const running = await present("media_segment", { path: "/c.mp4", time: 1 }, { path: "/p/assets/masks/a.mask", src: "masks/a.mask", state: "tracking" as const, ...span });
|
||||
expect(running).toEqual({ output: { path: "/p/assets/masks/a.mask", src: "masks/a.mask", state: "tracking", ...span }, images: [] });
|
||||
});
|
||||
|
||||
it("writes a done track's contact sheet once, inline only the first time context reports it", async () => {
|
||||
const row = {
|
||||
id: "track-1", src: "masks/a.mask", video: "a.mp4", state: "done" as const, progress: 1,
|
||||
model: "tiny" as const, frameRate: 30, start: 0, end: 2, frames: 60, bbox: null, area: 0, score: 1, iou: 0.9, lost: [], weak: [],
|
||||
};
|
||||
const base = { rootDir: "/p", projectDir: "/p/a", currentTime: null, fontFamilies: [], generations: [] };
|
||||
const first = await present("context", {}, { ...base, masks: [{ ...row, png: png(8) }] });
|
||||
const image = (first.output as { masks: { image: string }[] }).masks[0]!.image;
|
||||
expect(image).toMatch(/dapi-segment-.*\.png$/);
|
||||
expect(first.images).toEqual([{ path: image, png: png(8) }]);
|
||||
expect(first.output).toEqual({ ...base, masks: [{ ...row, image }] });
|
||||
|
||||
const again = await present("context", {}, { ...base, masks: [{ ...row, png: png(8) }] });
|
||||
expect(again).toEqual({ output: { ...base, masks: [{ ...row, image }] }, images: [] });
|
||||
});
|
||||
|
||||
it("passes other results through untouched", async () => {
|
||||
expect(await present("check", { id: "x" }, { stats: {}, issues: [] })).toEqual({ output: { stats: {}, issues: [] }, images: [] });
|
||||
});
|
||||
@ -134,3 +89,92 @@ describe("toCallToolResult", () => {
|
||||
expect(toCallToolResult({ output: {}, images: large }).content).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("present a generation job", () => {
|
||||
const job = (id: string, status: string, assets: Array<Record<string, unknown>>) => ({
|
||||
job: { id, status, credits: 4, etaSeconds: 10, etaRemainingSeconds: null, error: null, assets },
|
||||
saveTo: null as string | null,
|
||||
});
|
||||
const file = (filename: string) => ({ url: `https://files.test/${filename}`, filename, mimeType: "image/png", size: 8 });
|
||||
|
||||
it("passes a job still running through as the API has it", async () => {
|
||||
const running = job("j-running", "running", []);
|
||||
expect((await present("job", { id: "j-running" }, running)).output).toEqual(running.job);
|
||||
});
|
||||
|
||||
it("downloads a succeeded job's files once, to the output numbered and with the made extension", async () => {
|
||||
const fetch = vi.fn(async (url: string) => new Response(new Uint8Array([url.length])));
|
||||
vi.stubGlobal("fetch", fetch);
|
||||
try {
|
||||
const out = join(dir, "generated", "fox.jpg");
|
||||
const done = { ...job("j-done", "succeeded", [file("red-fox.png"), file("red-fox-2.png")]), saveTo: out };
|
||||
const first = await present("job", { id: "j-done" }, done);
|
||||
const again = await present("job", { id: "j-done" }, done);
|
||||
const assets = (first.output as { assets: Array<Record<string, unknown>> }).assets;
|
||||
expect(assets.map((asset) => asset.path)).toEqual([join(dir, "generated", "fox-1.png"), join(dir, "generated", "fox-2.png")]);
|
||||
expect(assets[0]).not.toHaveProperty("url");
|
||||
expect(assets[0]).toMatchObject({ filename: "red-fox.png", mimeType: "image/png" });
|
||||
expect(again.output).toEqual(first.output);
|
||||
expect(fetch).toHaveBeenCalledTimes(2);
|
||||
} finally {
|
||||
vi.unstubAllGlobals();
|
||||
}
|
||||
});
|
||||
|
||||
it("writes a single file at the output, over a file already there", async () => {
|
||||
vi.stubGlobal("fetch", async () => new Response("new"));
|
||||
try {
|
||||
const out = join(dir, "single.png");
|
||||
writeFileSync(out, "old");
|
||||
const presented = await present("job", { id: "j-one" }, { ...job("j-one", "succeeded", [file("x.png")]), saveTo: out });
|
||||
expect((presented.output as { assets: Array<{ path: string }> }).assets[0]!.path).toBe(out);
|
||||
expect(readFileSync(out, "utf8")).toBe("new");
|
||||
} finally {
|
||||
vi.unstubAllGlobals();
|
||||
}
|
||||
});
|
||||
|
||||
it("saves into a directory of the job's own under the temp dir when no directory is given", async () => {
|
||||
vi.stubGlobal("fetch", async () => new Response(new Uint8Array([1])));
|
||||
try {
|
||||
const presented = await present("generate", { model: "flux-2-klein" }, job("j-temp", "succeeded", [file("a.png")]));
|
||||
const path = (presented.output as { assets: Array<{ path: string }> }).assets[0]!.path;
|
||||
expect(path).toMatch(/dapi-generate-j-temp[\\/]a\.png$/);
|
||||
rmSync(dirname(path), { recursive: true, force: true });
|
||||
} finally {
|
||||
vi.unstubAllGlobals();
|
||||
}
|
||||
});
|
||||
|
||||
it("leaves files the renderer saved into the library as they are", async () => {
|
||||
const saved = job("j-lib", "succeeded", [{ filename: "a.png", path: "/p/assets/a.png", src: "a.png" }]);
|
||||
expect((await present("job", { id: "j-lib" }, saved)).output).toEqual(saved.job);
|
||||
});
|
||||
it("writes a local job's files from their bytes, to the output, once", async () => {
|
||||
const out = join(dir, "masks", "skater.mask");
|
||||
const done = { ...job("local-mask", "succeeded", [{ filename: "Tracking 1.mask", mimeType: "", size: 4, bytes: png(9, 4) }]), saveTo: out };
|
||||
const first = await present("job", { id: "local-mask" }, done);
|
||||
writeFileSync(out, "edited since");
|
||||
const again = await present("job", { id: "local-mask" }, done);
|
||||
const assets = (first.output as { assets: Array<Record<string, unknown>> }).assets;
|
||||
expect(assets).toEqual([{ filename: "Tracking 1.mask", mimeType: "", size: 4, path: out }]);
|
||||
expect(again.output).toEqual(first.output);
|
||||
expect(readFileSync(out, "utf8")).toBe("edited since");
|
||||
});
|
||||
|
||||
it("writes a local job's picture to the temp dir, inline only the first time, and names it in its details", async () => {
|
||||
const details = { frameRate: 30, start: 1, end: 1.033, frames: 1, bbox: null, lost: [] };
|
||||
const preview = { ...job("local-preview", "succeeded", []), image: png(8) };
|
||||
preview.job = { ...preview.job, details } as typeof preview.job;
|
||||
const first = await present("generate", { model: "sam-2.1" }, preview);
|
||||
const image = (first.output as { details: { image: string } }).details.image;
|
||||
expect(image).toMatch(/dapi-local-preview\.png$/);
|
||||
expect(first.output).toEqual({ ...preview.job, details: { ...details, image } });
|
||||
expect(first.images).toEqual([{ path: image, png: png(8) }]);
|
||||
expect(readFileSync(image)).toEqual(Buffer.from(png(8)));
|
||||
|
||||
const again = await present("job", { id: "local-preview" }, preview);
|
||||
expect(again).toEqual({ output: first.output, images: [] });
|
||||
rmSync(image, { force: true });
|
||||
});
|
||||
});
|
||||
|
||||
@ -5,11 +5,13 @@
|
||||
import { existsSync, realpathSync } from "node:fs";
|
||||
import { mkdir, mkdtemp, stat, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { dirname, join } from "node:path";
|
||||
import { basename, dirname, join } from "node:path";
|
||||
import { randomUUID } from "node:crypto";
|
||||
|
||||
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
||||
import type { TimecodedImage, ToolArgs, ToolName, ToolOutput, ToolResult } from "@diffusionstudio/dapi";
|
||||
import { generatedPath } from "@diffusionstudio/dapi";
|
||||
|
||||
import type { GenerationResult, TimecodedImage, ToolArgs, ToolName, ToolOutput, ToolResult } from "@diffusionstudio/dapi";
|
||||
|
||||
/** A file the tool wrote, kept in memory only long enough to decide whether to inline it. */
|
||||
export type WrittenImage = { path: string; png: Uint8Array };
|
||||
@ -38,20 +40,21 @@ export async function present(name: ToolName, args: unknown, result: unknown): P
|
||||
switch (name) {
|
||||
case "capture":
|
||||
return presentImages(result as ToolResult<"capture">, (args as ToolArgs<"capture">).output, "capture");
|
||||
case "media_grab":
|
||||
return presentImages(result as ToolResult<"media_grab">, (args as ToolArgs<"media_grab">).output, "grab");
|
||||
case "media_filmstrip":
|
||||
return presentPreview(result as ToolResult<"media_filmstrip">, (args as ToolArgs<"media_filmstrip">).output, "filmstrip");
|
||||
case "media_waveform":
|
||||
return presentPreview(result as ToolResult<"media_waveform">, (args as ToolArgs<"media_waveform">).output, "waveform");
|
||||
case "grab":
|
||||
return presentImages(result as ToolResult<"grab">, (args as ToolArgs<"grab">).output, "grab");
|
||||
case "filmstrip":
|
||||
return presentPreview(result as ToolResult<"filmstrip">, (args as ToolArgs<"filmstrip">).output, "filmstrip");
|
||||
case "waveform":
|
||||
return presentPreview(result as ToolResult<"waveform">, (args as ToolArgs<"waveform">).output, "waveform");
|
||||
case "screenshot":
|
||||
return presentScreenshot(result as ToolResult<"screenshot">, (args as ToolArgs<"screenshot">).output);
|
||||
case "media_transcribe":
|
||||
return presentTranscript(result as ToolResult<"media_transcribe">, (args as ToolArgs<"media_transcribe">).output);
|
||||
case "media_segment":
|
||||
return presentSegment(result as ToolResult<"media_segment">, (args as ToolArgs<"media_segment">).output);
|
||||
case "context":
|
||||
return presentContext(result as ToolResult<"context">);
|
||||
case "transcribe":
|
||||
return presentTranscript(result as ToolResult<"transcribe">, (args as ToolArgs<"transcribe">).output);
|
||||
case "generate":
|
||||
if ((args as ToolArgs<"generate">).estimate) return { output: result, images: [] };
|
||||
return presentJob(result as GenerationResult);
|
||||
case "job":
|
||||
return presentJob(result as GenerationResult);
|
||||
default:
|
||||
return { output: result, images: [] };
|
||||
}
|
||||
@ -110,56 +113,73 @@ async function presentScreenshot(result: ToolResult<"screenshot">, output: strin
|
||||
return { output: presented, images: [{ path, png: result.png }] };
|
||||
}
|
||||
|
||||
async function presentTranscript(transcript: ToolResult<"media_transcribe">, output: string | undefined): Promise<Presented> {
|
||||
async function presentTranscript(transcript: ToolResult<"transcribe">, output: string | undefined): Promise<Presented> {
|
||||
const path = await singleFilePath(output, `dapi-transcript-${randomUUID()}.json`);
|
||||
await writeFile(path, JSON.stringify(transcript, null, 2));
|
||||
const words = transcript.segments.reduce((sum, segment) => sum + segment.words.length, 0);
|
||||
const presented: ToolOutput<"media_transcribe"> = { path, segments: transcript.segments.length, words };
|
||||
const presented: ToolOutput<"transcribe"> = { path, segments: transcript.segments.length, words };
|
||||
return { output: presented, images: [] };
|
||||
}
|
||||
|
||||
/** Files of succeeded jobs saved to disk, by job id: the first poll that sees a job succeed saves them, the rest reuse the paths. */
|
||||
const jobFiles = new Map<string, Promise<string[]>>();
|
||||
|
||||
/** Pictures of local jobs, by job id: each is written to the temp dir, and shown inline, the first poll it comes with. */
|
||||
const jobImages = new Map<string, string>();
|
||||
|
||||
/**
|
||||
* The picture always goes to the temp dir; `output` is where the mask goes.
|
||||
* A mask the renderer put into the project's library comes with its path; one
|
||||
* that comes as bytes is written here, to `output` or the temp dir. A track
|
||||
* still running in the background has no picture yet (see `presentContext`).
|
||||
* A job's files bound for disk are saved once it has succeeded — downloaded
|
||||
* from their `url`, or written from the `bytes` a local model made — to
|
||||
* `saveTo` (see `generatedPath`; a file already there is written over, as the
|
||||
* other tools' outputs are) or under their own names into a directory of the
|
||||
* job's own under the temp dir, and their `url` or `bytes` is swapped for the
|
||||
* `path`. Files the renderer saved into the library arrive with their paths.
|
||||
* A local job's picture goes to the temp dir, named in `details.image`.
|
||||
*/
|
||||
async function presentSegment(result: ToolResult<"media_segment">, output: string | undefined): Promise<Presented> {
|
||||
const { png, mask, ...found } = result;
|
||||
let path = found.path;
|
||||
if (mask) {
|
||||
path = await singleFilePath(output, `dapi-mask-${randomUUID()}.mask`);
|
||||
await writeFile(path, mask);
|
||||
}
|
||||
async function presentJob({ job, saveTo, image }: GenerationResult): Promise<Presented> {
|
||||
const images: WrittenImage[] = [];
|
||||
let image: string | undefined;
|
||||
if (png) {
|
||||
image = join(tempDir(), `dapi-segment-${randomUUID()}.png`);
|
||||
await writeFile(image, png);
|
||||
images.push({ path: image, png });
|
||||
let shown = job;
|
||||
if (image) {
|
||||
let path = jobImages.get(job.id);
|
||||
if (path === undefined) {
|
||||
path = join(tempDir(), `dapi-${job.id}.png`);
|
||||
await writeFile(path, image);
|
||||
jobImages.set(job.id, path);
|
||||
images.push({ path, png: image });
|
||||
}
|
||||
shown = { ...job, details: { ...job.details, image: path } };
|
||||
}
|
||||
const presented: ToolOutput<"media_segment"> = { ...found, ...(image === undefined ? {} : { image }), ...(path === undefined ? {} : { path }) };
|
||||
return { output: presented, images };
|
||||
|
||||
const pending = job.assets.filter((file) => file.url !== undefined || file.bytes !== undefined);
|
||||
if (job.status !== "succeeded" || pending.length === 0) return { output: shown, images };
|
||||
|
||||
let paths = jobFiles.get(job.id);
|
||||
if (!paths) {
|
||||
const temp = join(tempDir(), `dapi-generate-${job.id}`);
|
||||
const targets = job.assets.map((file, i) =>
|
||||
saveTo === null ? join(temp, basename(file.filename)) : generatedPath(saveTo, file.filename, i, job.assets.length),
|
||||
);
|
||||
paths = saveAll(job.assets, targets);
|
||||
paths.catch(() => jobFiles.delete(job.id));
|
||||
jobFiles.set(job.id, paths);
|
||||
}
|
||||
const written = await paths;
|
||||
const assets = job.assets.map(({ url: _url, bytes: _bytes, ...file }, i) => ({ ...file, path: written[i] }));
|
||||
return { output: { ...shown, assets }, images };
|
||||
}
|
||||
|
||||
/** Contact sheets of background tracks already written, by track id: each is written, and shown inline, once. */
|
||||
const trackSheets = new Map<string, string>();
|
||||
|
||||
/** A done track's contact sheet goes to the temp dir the first poll it shows up in, and arrives inline with that poll. */
|
||||
async function presentContext(result: ToolResult<"context">): Promise<Presented> {
|
||||
const images: WrittenImage[] = [];
|
||||
const masks: ToolOutput<"context">["masks"] = [];
|
||||
for (const { png, ...row } of result.masks) {
|
||||
let image = trackSheets.get(row.id);
|
||||
if (png && image === undefined) {
|
||||
image = join(tempDir(), `dapi-segment-${randomUUID()}.png`);
|
||||
await writeFile(image, png);
|
||||
trackSheets.set(row.id, image);
|
||||
images.push({ path: image, png });
|
||||
}
|
||||
masks.push(image === undefined ? row : { ...row, image });
|
||||
async function saveAll(files: GenerationResult["job"]["assets"], targets: string[]): Promise<string[]> {
|
||||
for (const [i, file] of files.entries()) {
|
||||
await mkdir(dirname(targets[i]!), { recursive: true });
|
||||
await writeFile(targets[i]!, file.bytes ?? (await download(file.url!, file.filename)));
|
||||
}
|
||||
return { output: { ...result, masks }, images };
|
||||
return targets;
|
||||
}
|
||||
|
||||
async function download(url: string, filename: string): Promise<Uint8Array> {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) throw new Error(`Could not download ${filename} (${response.status})`);
|
||||
return new Uint8Array(await response.arrayBuffer());
|
||||
}
|
||||
|
||||
function screenshotFilename(taken: Date, attempt: number): string {
|
||||
|
||||
@ -3,13 +3,14 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { MCP_HOST, MCP_PATH, MCP_PORT, tools } from "@diffusionstudio/dapi";
|
||||
import { MCP_HOST, MCP_PATH, MCP_PORT, isDapiError, tools } from "@diffusionstudio/dapi";
|
||||
import { mainHandlers } from "./handlers";
|
||||
import { DapiHttpServer } from "./http";
|
||||
import { instructions } from "./docs";
|
||||
import { RendererCalls } from "./renderer-calls";
|
||||
import { serveCatalog } from "./tools-session";
|
||||
|
||||
import type { TrackProps } from "@diffusionstudio/api-contract";
|
||||
import type { LogEntry } from "@diffusionstudio/dapi";
|
||||
import type { AppWindow, MainContext, MainToolName } from "./handler";
|
||||
import type { RendererHost } from "./renderer-calls";
|
||||
@ -33,6 +34,8 @@ export type DapiServerDeps = {
|
||||
};
|
||||
/** The staged docs: INSTRUCTIONS.md, their path, and the skill headers, all for every session. Null when not staged. */
|
||||
docsDir: string | null;
|
||||
/** Told about every finished call, as `tool_called` analytics props. */
|
||||
onToolCall?(props: TrackProps): void;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -100,12 +103,27 @@ export class DapiServer {
|
||||
const session = new McpServer({ name: SERVER_NAME, title: "Diffusion Studio", version: this.deps.version }, { instructions: this.instructionsText });
|
||||
serveCatalog(session, async (tool, args, signal) => {
|
||||
const release = this.deps.window.hold();
|
||||
const startedAt = performance.now();
|
||||
// The failure's code (`not-found`, `busy`, …), never its message: messages name the user's files.
|
||||
let error: string | undefined;
|
||||
try {
|
||||
return await (tool.environment === "main" ?
|
||||
this.runInMain(tool.name as MainToolName, args, signal)
|
||||
: this.renderer.call(tool.name, args, signal));
|
||||
} catch (thrown) {
|
||||
error = isDapiError(thrown) ? thrown.code : "error";
|
||||
throw thrown;
|
||||
} finally {
|
||||
release();
|
||||
const client = session.server.getClientVersion();
|
||||
this.deps.onToolCall?.({
|
||||
tool: tool.name,
|
||||
client: client?.name,
|
||||
client_version: client?.version,
|
||||
ok: !error,
|
||||
error,
|
||||
duration_ms: Math.round(performance.now() - startedAt),
|
||||
});
|
||||
}
|
||||
});
|
||||
return session;
|
||||
|
||||
@ -9,6 +9,8 @@ import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
||||
import { JSON_SCHEMA_DIALECT, tools } from "@diffusionstudio/dapi";
|
||||
import { serveCatalog } from "./tools-session";
|
||||
|
||||
const CONTEXT = { rootDir: null, projectDir: null, currentTime: null, fontFamilies: [] };
|
||||
|
||||
let client: Client;
|
||||
const calls: Array<{ name: string; args: unknown }> = [];
|
||||
|
||||
@ -17,8 +19,8 @@ beforeAll(async () => {
|
||||
serveCatalog(session, async (tool, args) => {
|
||||
calls.push({ name: tool.name, args });
|
||||
switch (tool.name) {
|
||||
case "voices":
|
||||
return { voices: [] };
|
||||
case "context":
|
||||
return CONTEXT;
|
||||
case "check":
|
||||
throw new Error("No project open — run open first");
|
||||
default:
|
||||
@ -54,9 +56,9 @@ describe("serveCatalog", () => {
|
||||
expect(JSON.stringify(bad.content)).toContain("limit");
|
||||
expect(calls.length).toBe(before);
|
||||
|
||||
const result = await client.callTool({ name: "voices", arguments: {} });
|
||||
expect(result.structuredContent).toEqual({ voices: [] });
|
||||
expect(calls.at(-1)).toEqual({ name: "voices", args: {} });
|
||||
const result = await client.callTool({ name: "context", arguments: {} });
|
||||
expect(result.structuredContent).toEqual(CONTEXT);
|
||||
expect(calls.at(-1)).toEqual({ name: "context", args: {} });
|
||||
});
|
||||
|
||||
it("returns a handler's failure as a readable error result, not a protocol error", async () => {
|
||||
|
||||
@ -6,16 +6,9 @@
|
||||
// canvas (renderer) and the edit writer (main). Types only, with no Node
|
||||
// imports, so the renderer's program can include it without Node's types.
|
||||
|
||||
import type { InspectValue, PropValue, SerializedAssetRef } from "@diffusionstudio/jsx";
|
||||
import type { InspectValue, PropValue } from "@diffusionstudio/jsx";
|
||||
|
||||
export type { PropValue, SerializedAssetRef };
|
||||
|
||||
/**
|
||||
* A value an edit can carry: what a source spells as a literal, or a
|
||||
* `generate.*` declaration in its wire form, spelled as the call that
|
||||
* reproduces it (see `setProp`).
|
||||
*/
|
||||
export type EditValue = PropValue | SerializedAssetRef;
|
||||
export type { PropValue };
|
||||
|
||||
export interface SourceContext {
|
||||
/** Absolute path of the project folder. */
|
||||
@ -37,7 +30,7 @@ export interface SourceContext {
|
||||
export interface SourceSet {
|
||||
kind: "set";
|
||||
source: string;
|
||||
props: Record<string, EditValue>;
|
||||
props: Record<string, PropValue>;
|
||||
text?: string;
|
||||
}
|
||||
|
||||
@ -54,7 +47,7 @@ export interface SourceInsert {
|
||||
source: string;
|
||||
parent: string;
|
||||
tag: string;
|
||||
props: Record<string, EditValue>;
|
||||
props: Record<string, PropValue>;
|
||||
before?: string;
|
||||
text?: string;
|
||||
}
|
||||
@ -94,7 +87,7 @@ export interface SourceRemove {
|
||||
* one in `ids`. The first iteration keeps the body's own names, so it carries
|
||||
* none.
|
||||
*/
|
||||
export type SourceIteration = Record<string, { props: Record<string, EditValue>; text?: string; pending?: string }>;
|
||||
export type SourceIteration = Record<string, { props: Record<string, PropValue>; text?: string; pending?: string }>;
|
||||
|
||||
/**
|
||||
* Replaces the `<For>`/`<Index>` around the element named by `source` with
|
||||
|
||||
@ -9,11 +9,11 @@ import { join } from "node:path";
|
||||
|
||||
import { IndentationText, Project, SyntaxKind } from "ts-morph";
|
||||
|
||||
import { ID_ATTR, INSPECT_TAG, formatSource, isCompositionTag, isLoopTag, isSerializedAssetRef, isTransformType, parseSource } from "@diffusionstudio/jsx";
|
||||
import { ID_ATTR, INSPECT_TAG, formatSource, isCompositionTag, isLoopTag, parseSource } from "@diffusionstudio/jsx";
|
||||
|
||||
import { writeFileAtomic } from "./atomic";
|
||||
|
||||
import type { PropValue, SerializedAssetRef } from "@diffusionstudio/jsx";
|
||||
import type { PropValue } from "@diffusionstudio/jsx";
|
||||
import type {
|
||||
ArrowFunction,
|
||||
FunctionExpression,
|
||||
@ -28,7 +28,6 @@ import type {
|
||||
|
||||
export type * from "./edit-types";
|
||||
import type {
|
||||
EditValue,
|
||||
SourceContext,
|
||||
SourceEdit,
|
||||
SourceInsert,
|
||||
@ -121,8 +120,7 @@ const round = (value: number): number => Math.round(value * 100) / 100;
|
||||
const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
||||
|
||||
/** A prop value as the JavaScript that would have produced it. */
|
||||
function literalText(value: PropValue | SerializedAssetRef): string {
|
||||
if (isSerializedAssetRef(value)) return declarationText(value);
|
||||
function literalText(value: PropValue): string {
|
||||
if (typeof value === "string") return JSON.stringify(value);
|
||||
if (typeof value === "number") return String(round(value));
|
||||
if (typeof value === "boolean" || value === null) return String(value);
|
||||
@ -152,46 +150,14 @@ const initializerText = (value: PropValue): string =>
|
||||
? `"${value}"`
|
||||
: `{${literalText(value)}}`;
|
||||
|
||||
/**
|
||||
* A declaration's wire form as the call that reproduces it: `generate.<type>`
|
||||
* over its options, or `transform.<type>` over its input, with declared
|
||||
* inputs spelled as the nested calls they are.
|
||||
*/
|
||||
function declarationText(ref: SerializedAssetRef): string {
|
||||
const { type, ...options } = ref.$asset;
|
||||
if (isTransformType(type)) return `transform.${type}(${literalText((options as { input: EditValue }).input)})`;
|
||||
return `generate.${type}(${literalText(options as Record<string, PropValue>)})`;
|
||||
}
|
||||
|
||||
/** The namespaces a declaration is spelled with: what its file has to import. */
|
||||
function declarationImports(ref: SerializedAssetRef, names = new Set<string>()): Set<string> {
|
||||
const { type, ...options } = ref.$asset;
|
||||
names.add(isTransformType(type) ? "transform" : "generate");
|
||||
for (const value of Object.values(options)) {
|
||||
for (const input of Array.isArray(value) ? value : [value]) {
|
||||
if (isSerializedAssetRef(input)) declarationImports(input, names);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a prop onto a tag as one would write it: `muted`, not `muted={true}`,
|
||||
* and no attribute at all rather than `muted={false}`, since absence is what a
|
||||
* boolean prop's false reads as. A declaration is spelled as the call that
|
||||
* reproduces it — the caller makes sure its namespaces are imported (see
|
||||
* `ensureDeclarationImports`).
|
||||
* boolean prop's false reads as.
|
||||
*/
|
||||
function setProp(tag: JsxTag, name: string, value: EditValue): void {
|
||||
function setProp(tag: JsxTag, name: string, value: PropValue): void {
|
||||
const attribute = attributeOf(tag, name);
|
||||
|
||||
if (isSerializedAssetRef(value)) {
|
||||
const initializer = `{${declarationText(value)}}`;
|
||||
if (attribute) attribute.setInitializer(initializer);
|
||||
else tag.addAttribute({ name, initializer });
|
||||
return;
|
||||
}
|
||||
|
||||
if (value === true) {
|
||||
if (attribute) attribute.removeInitializer();
|
||||
else tag.addAttribute({ name });
|
||||
@ -207,45 +173,6 @@ function setProp(tag: JsxTag, name: string, value: EditValue): void {
|
||||
else tag.addAttribute({ name, initializer: initializerText(value) });
|
||||
}
|
||||
|
||||
/** Where `generate` and `transform` come from — the module every project authors against. */
|
||||
const DECLARATION_MODULE = "@diffusionstudio/jsx";
|
||||
|
||||
/**
|
||||
* Makes sure the namespaces a declaration is spelled with are in scope once
|
||||
* it has been written into the file: added to the module's existing import,
|
||||
* or as an import of their own after the last one — or above the first
|
||||
* statement, past the file's header comments, when there are no imports at
|
||||
* all. Idempotent.
|
||||
*/
|
||||
function ensureDeclarationImports(sourceFile: SourceFile, ref: SerializedAssetRef): void {
|
||||
for (const name of declarationImports(ref)) ensureNamedImport(sourceFile, name);
|
||||
}
|
||||
|
||||
function ensureNamedImport(sourceFile: SourceFile, name: string): void {
|
||||
const declarations = sourceFile.getImportDeclarations();
|
||||
const importable = declarations.find(
|
||||
(declaration) =>
|
||||
declaration.getModuleSpecifierValue() === DECLARATION_MODULE &&
|
||||
!declaration.isTypeOnly() &&
|
||||
!declaration.getNamespaceImport(),
|
||||
);
|
||||
|
||||
if (importable) {
|
||||
const named = importable.getNamedImports();
|
||||
if (named.some((specifier) => specifier.getName() === name && !specifier.getAliasNode())) return;
|
||||
importable.addNamedImport(name);
|
||||
return;
|
||||
}
|
||||
|
||||
const statement = `import { ${name} } from "${DECLARATION_MODULE}";`;
|
||||
const last = declarations.at(-1);
|
||||
if (last) sourceFile.insertText(last.getEnd(), `\n${statement}`);
|
||||
else {
|
||||
const first = sourceFile.getStatements()[0];
|
||||
sourceFile.insertText(first ? first.getStart() : 0, `${statement}\n\n`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Text content as JSX spells it: bare when JSX would read it back verbatim,
|
||||
* otherwise as a string expression (JSX collapses whitespace around line
|
||||
@ -487,14 +414,8 @@ function reindent(text: string, from: string, to: string): string {
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether an expression is a value rather than a way of computing one. A
|
||||
* declaration call over values is one too: it is what the writer spells a
|
||||
* declaration as, so it is an initializer the writer may also overwrite.
|
||||
*/
|
||||
/** Whether an expression is a value rather than a way of computing one. */
|
||||
function isLiteral(node: Node): boolean {
|
||||
if (isDeclarationCall(node)) return true;
|
||||
|
||||
if (
|
||||
node.isKind(SyntaxKind.StringLiteral) ||
|
||||
node.isKind(SyntaxKind.NumericLiteral) ||
|
||||
@ -528,29 +449,11 @@ function isLiteral(node: Node): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** The namespaces a declaration call is made through. */
|
||||
const DECLARATION_NAMESPACES = new Set(["generate", "transform"]);
|
||||
|
||||
/**
|
||||
* A `generate.*` or `transform.*` call over literals — a nested declaration
|
||||
* among them. One whose argument computes anything is authored reactivity,
|
||||
* like any expression.
|
||||
*/
|
||||
function isDeclarationCall(node: Node): boolean {
|
||||
const call = node.asKind(SyntaxKind.CallExpression);
|
||||
const callee = call?.getExpression().asKind(SyntaxKind.PropertyAccessExpression);
|
||||
if (!call || !callee || !callee.getExpression().isKind(SyntaxKind.Identifier)) return false;
|
||||
if (!DECLARATION_NAMESPACES.has(callee.getExpression().getText())) return false;
|
||||
|
||||
const args = call.getArguments();
|
||||
return args.length === 1 && isLiteral(args[0]!);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Files
|
||||
|
||||
/** Every project source file, project-relative and `/`-separated. */
|
||||
async function sourceFiles(dir: string, prefix = ""): Promise<string[]> {
|
||||
export async function sourceFiles(dir: string, prefix = ""): Promise<string[]> {
|
||||
let entries;
|
||||
try {
|
||||
entries = await readdir(prefix ? join(dir, ...prefix.split("/")) : dir, { withFileTypes: true });
|
||||
@ -858,7 +761,6 @@ class SourceWriter {
|
||||
// the canvas already shows the edit, and an export and the next open
|
||||
// render the file, so a prop left as it was would move back.
|
||||
setProp(tag, name, value);
|
||||
if (isSerializedAssetRef(value)) ensureDeclarationImports(sourceFile, value);
|
||||
wrote = true;
|
||||
}
|
||||
|
||||
@ -955,7 +857,6 @@ class SourceWriter {
|
||||
insertChild(sourceFile, parent, child, before);
|
||||
for (const [name, value] of Object.entries(edit.props)) {
|
||||
setProp(findTag(sourceFile, id)!, name, value);
|
||||
if (isSerializedAssetRef(value)) ensureDeclarationImports(sourceFile, value);
|
||||
}
|
||||
ids[edit.source] = formatSource(file, id);
|
||||
return true;
|
||||
@ -1195,7 +1096,6 @@ class SourceWriter {
|
||||
}
|
||||
for (const [name, value] of Object.entries(record.props)) {
|
||||
setProp(found(), name, value);
|
||||
if (isSerializedAssetRef(value)) ensureDeclarationImports(sourceFile, value);
|
||||
}
|
||||
|
||||
const element = elementOf(found());
|
||||
|
||||
64
apps/desktop/src/editors.ts
Normal file
@ -0,0 +1,64 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Code editors a project folder can be opened in. A project is a folder of
|
||||
// JSX, so editing it by hand is a real way of working on it, and the app's
|
||||
// watcher puts whatever the editor saves on the canvas.
|
||||
|
||||
import { app } from "electron";
|
||||
import { execFile, spawn } from "node:child_process";
|
||||
import { isAbsolute } from "node:path";
|
||||
|
||||
export type EditorId = "vscode" | "cursor" | "zed";
|
||||
|
||||
export type EditorInfo = { id: EditorId; label: string };
|
||||
|
||||
/**
|
||||
* The editors offered, in menu order. Each is found by the URL scheme it
|
||||
* registers with the OS when installed: asking who handles it answers both
|
||||
* whether the editor is there and where, on macOS and Windows alike, without
|
||||
* knowing where anyone keeps their applications.
|
||||
*/
|
||||
const EDITORS: Array<EditorInfo & { protocol: string }> = [
|
||||
{ id: "vscode", label: "VS Code", protocol: "vscode://" },
|
||||
{ id: "cursor", label: "Cursor", protocol: "cursor://" },
|
||||
{ id: "zed", label: "Zed", protocol: "zed://" },
|
||||
];
|
||||
|
||||
/** Where the app handling `protocol` lives (the .app on macOS, the .exe on Windows), or null when none does. */
|
||||
async function handlerPath(protocol: string): Promise<string | null> {
|
||||
try {
|
||||
return (await app.getApplicationInfoForProtocol(protocol)).path || null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** The editors installed here, in menu order. */
|
||||
export async function installedEditors(): Promise<EditorInfo[]> {
|
||||
const found = await Promise.all(EDITORS.map(async (editor) => ((await handlerPath(editor.protocol)) ? editor : null)));
|
||||
return found.filter((editor) => editor !== null).map(({ id, label }) => ({ id, label }));
|
||||
}
|
||||
|
||||
/** Opens the folder `dir` in the editor `id`. */
|
||||
export async function openInEditor(id: EditorId, dir: string): Promise<void> {
|
||||
const editor = EDITORS.find((candidate) => candidate.id === id);
|
||||
if (!editor) throw new Error(`Unknown editor "${id}".`);
|
||||
if (!isAbsolute(dir)) throw new Error(`The folder must be an absolute path (got "${dir}").`);
|
||||
|
||||
const path = await handlerPath(editor.protocol);
|
||||
if (!path) throw new Error(`${editor.label} is not installed.`);
|
||||
|
||||
if (process.platform === "darwin") {
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
execFile("/usr/bin/open", ["-a", path, dir], (error) => (error ? reject(error) : resolve()));
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Windows: the editor's own executable takes a folder to open, and outlives the app.
|
||||
const child = spawn(path, [dir], { detached: true, stdio: "ignore" });
|
||||
child.on("error", (error) => console.error(`[editors] could not start ${editor.label}:`, error));
|
||||
child.unref();
|
||||
}
|
||||
136
apps/desktop/src/legacy-generations.test.ts
Normal file
@ -0,0 +1,136 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Projects from before generation was removed are pointed at what their
|
||||
// declarations produced. The keys below are in the shape the generation code
|
||||
// wrote them: the request, defaults applied, inputs by asset id.
|
||||
|
||||
import { tmpdir } from "node:os";
|
||||
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { migrateGenerations } from "./legacy-generations";
|
||||
|
||||
const FILE = "index.tsx";
|
||||
|
||||
const asset = (id: string, path: string, key?: string) => ({
|
||||
id,
|
||||
path,
|
||||
source: `assets/${path}`,
|
||||
type: "IMAGE",
|
||||
mimeType: "image/png",
|
||||
createdAt: "2026-01-01T00:00:00.000Z",
|
||||
...(key ? { generation: { key, id: "run" } } : {}),
|
||||
});
|
||||
|
||||
const HERO_KEY = JSON.stringify({ type: "image", model: "flux", prompt: "A neon city", aspectRatio: "16:9", seed: 7, refIds: [] });
|
||||
const MOTION_KEY = JSON.stringify({ type: "video", model: "kling", prompt: "push in", aspectRatio: "16:9", duration: 5, audio: false, seed: 3, startFrameId: "hero01" });
|
||||
const UPSCALE_KEY = JSON.stringify({ type: "upscale", inputId: "photo1" });
|
||||
|
||||
const MANIFEST = {
|
||||
version: 1,
|
||||
folders: [],
|
||||
assets: [
|
||||
asset("hero01", "generated/A neon city.png", HERO_KEY),
|
||||
asset("motion", "generated/push in.mp4", MOTION_KEY),
|
||||
asset("photo1", "photos/me.png"),
|
||||
asset("upsc01", "generated/me (Upscaled).png", UPSCALE_KEY),
|
||||
asset("capt01", "generated/Captions 1.json", "transcript:v1:intro:123"),
|
||||
asset("capt02", "generated/Captions 2.json", "transcript:v1:outro:0"),
|
||||
// A failed generation's record: no bytes, so no answer.
|
||||
{ id: "fail01", path: "generated/a fox", type: "IMAGE", createdAt: "2026-01-01", generation: { key: "x" }, state: "error" },
|
||||
],
|
||||
};
|
||||
|
||||
let dir: string;
|
||||
const written: string[] = [];
|
||||
|
||||
beforeEach(async () => {
|
||||
dir = await mkdtemp(join(tmpdir(), "legacy-generations-test-"));
|
||||
written.length = 0;
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await rm(dir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
async function migrate(source: string, manifest: unknown = MANIFEST): Promise<string> {
|
||||
await writeFile(join(dir, FILE), source);
|
||||
await migrateGenerations({ dir, onWrite: (file) => written.push(file) }, manifest);
|
||||
return readFile(join(dir, FILE), "utf8");
|
||||
}
|
||||
|
||||
describe("migrateGenerations", () => {
|
||||
it("points declarations at the assets they made, chains and consts included, and drops the import", async () => {
|
||||
const text = await migrate(`import { For } from "solid-js";
|
||||
import { generate, transform } from "@diffusionstudio/jsx";
|
||||
|
||||
const hero = generate.image({ prompt: "A neon city", aspectRatio: "16:9", seed: 7 });
|
||||
const motion = generate.video({ prompt: "push in", startFrame: hero, seed: 3 });
|
||||
|
||||
export default () => (
|
||||
<scene id="intro">
|
||||
<video id="a" src={motion} />
|
||||
<image id="b" src={transform.upscale("photos/me.png")} />
|
||||
</scene>
|
||||
);
|
||||
`);
|
||||
|
||||
expect(text).toContain(`const hero = "generated/A neon city.png";`);
|
||||
expect(text).toContain(`const motion = "generated/push in.mp4";`);
|
||||
expect(text).toContain(`<image id="b" src="generated/me (Upscaled).png" />`);
|
||||
expect(text).not.toContain("@diffusionstudio/jsx");
|
||||
expect(text).toContain(`import { For } from "solid-js";`);
|
||||
expect(written).toEqual([FILE]);
|
||||
});
|
||||
|
||||
it("keeps a declaration nothing matches beside an empty source, so the project still loads", async () => {
|
||||
const text = await migrate(`import { generate } from "@diffusionstudio/jsx";
|
||||
export default () => <image id="c" src={generate.image({ prompt: "never made", seed: 1 })} />;
|
||||
`);
|
||||
|
||||
expect(text).toContain(`src={"" /* no generated asset matched; generation was removed: generate.image({ prompt: "never made", seed: 1 }) */}`);
|
||||
expect(text).not.toContain("import { generate }");
|
||||
});
|
||||
|
||||
it("does not take a key whose recorded fields differ from what the call spells", async () => {
|
||||
const text = await migrate(`import { generate } from "@diffusionstudio/jsx";
|
||||
export default () => <image id="c" src={generate.image({ prompt: "A neon city", seed: 8 })} />;
|
||||
`);
|
||||
|
||||
expect(text).not.toContain("A neon city.png");
|
||||
});
|
||||
|
||||
it("gives a src-less caption the transcript of its scene and seed", async () => {
|
||||
const text = await migrate(`export default () => (
|
||||
<stage>
|
||||
<scene id="intro"><captions id="c1" preset="classic" seed={123} /></scene>
|
||||
<scene id="outro"><Captions id="c2" /></scene>
|
||||
<scene id="other"><captions id="c3" /></scene>
|
||||
</stage>
|
||||
);
|
||||
`);
|
||||
|
||||
expect(text).toContain(`<captions id="c1" preset="classic" src="generated/Captions 1.json" />`);
|
||||
expect(text).toContain(`<Captions src="generated/Captions 2.json" id="c2" />`);
|
||||
// No transcript was ever made for this scene: left as it was.
|
||||
expect(text).toContain(`<captions id="c3" />`);
|
||||
});
|
||||
|
||||
it("writes nothing to a migrated project, or without a readable library", async () => {
|
||||
const source = `import { generate } from "@diffusionstudio/jsx";
|
||||
export default () => <image id="c" src={generate.image({ prompt: "A neon city", seed: 7 })} />;
|
||||
`;
|
||||
expect(await migrate(source, null)).toBe(source);
|
||||
expect(written).toEqual([]);
|
||||
|
||||
const migrated = await migrate(source);
|
||||
expect(migrated).toContain(`src="generated/A neon city.png"`);
|
||||
written.length = 0;
|
||||
|
||||
await migrateGenerations({ dir, onWrite: (file) => written.push(file) }, MANIFEST);
|
||||
expect(written).toEqual([]);
|
||||
});
|
||||
});
|
||||
509
apps/desktop/src/legacy-generations.ts
Normal file
@ -0,0 +1,509 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* A one-time rewrite of projects written before generation was removed from
|
||||
* the JSX. Those projects declare assets with `generate.*` / `transform.*`
|
||||
* calls and caption scenes with a `<captions>` that has no `src`; neither
|
||||
* loads any more. What they produced is still in the library: every asset a
|
||||
* generation landed as carries its `generation.key` in `assets.yml`, the
|
||||
* request as it was sent. So each declaration is matched against those keys
|
||||
* and replaced by the library path of the asset it made, and each `src`-less
|
||||
* `<captions>` gets the transcript its scene was given.
|
||||
*
|
||||
* Runs before every compile and writes nothing to a project with nothing left
|
||||
* to migrate. A declaration that matches no asset is replaced by an empty
|
||||
* source with the call kept beside it in a comment, so the project loads and
|
||||
* nothing the user wrote is lost. Delete this file once projects from before
|
||||
* the removal no longer need opening.
|
||||
*/
|
||||
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { Project, SyntaxKind } from "ts-morph";
|
||||
|
||||
import { ID_ATTR } from "@diffusionstudio/jsx";
|
||||
|
||||
import { writeFileAtomic } from "./atomic";
|
||||
import { sourceFiles } from "./edit";
|
||||
|
||||
import type { CallExpression, JsxOpeningElement, JsxSelfClosingElement, Node, SourceFile } from "ts-morph";
|
||||
import type { SourceContext } from "./edit-types";
|
||||
|
||||
/** The module the declarations were imported from. */
|
||||
const JSX_MODULE = "@diffusionstudio/jsx";
|
||||
|
||||
/** Defaults the generation applied, and so baked into its key, when the call left them out. */
|
||||
const DEFAULTS: Record<string, Record<string, unknown>> = {
|
||||
image: { aspectRatio: "16:9" },
|
||||
video: { aspectRatio: "16:9", duration: 5, audio: false },
|
||||
};
|
||||
|
||||
/**
|
||||
* Fields whose defaults lived in the app's model lists rather than here: when
|
||||
* the call leaves one out, any value in the key is taken to be the default.
|
||||
*/
|
||||
const FREE_WHEN_OMITTED = new Set(["model", "voice"]);
|
||||
|
||||
type Namespace = "generate" | "transform";
|
||||
|
||||
/** A `generate.*` / `transform.*` call, with its argument read as a value. */
|
||||
interface Declaration {
|
||||
namespace: Namespace;
|
||||
type: string;
|
||||
node: CallExpression;
|
||||
argument: unknown;
|
||||
}
|
||||
|
||||
/** A value the source computes rather than spells; a declaration over one cannot be matched. */
|
||||
const UNKNOWN = Symbol("unknown");
|
||||
|
||||
interface ManifestEntry {
|
||||
id: string;
|
||||
path: string;
|
||||
key?: string;
|
||||
}
|
||||
|
||||
/** What the library knows: entries newest first, as the manifest lists them. */
|
||||
class Library {
|
||||
private readonly entries: ManifestEntry[];
|
||||
|
||||
public constructor(entries: ManifestEntry[]) {
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
/** The id of the asset an input named: an id, or a library path. */
|
||||
public idOf(input: string): string | undefined {
|
||||
const path = normalizePath(input);
|
||||
return this.entries.find((entry) => entry.id === input || entry.path === path)?.id;
|
||||
}
|
||||
|
||||
/** The newest asset whose generation key, parsed, satisfies `matches`. */
|
||||
public generated(matches: (key: Record<string, unknown>) => boolean): ManifestEntry | undefined {
|
||||
for (const entry of this.entries) {
|
||||
if (!entry.key?.startsWith("{")) continue;
|
||||
try {
|
||||
const key = JSON.parse(entry.key) as unknown;
|
||||
if (key && typeof key === "object" && matches(key as Record<string, unknown>)) return entry;
|
||||
} catch {
|
||||
// Not a key this migration knows how to read.
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/** The transcript a scene was given under `key`. */
|
||||
public byKey(key: string): ManifestEntry | undefined {
|
||||
return this.entries.find((entry) => entry.key === key);
|
||||
}
|
||||
}
|
||||
|
||||
/** Library entries that have bytes and a generation key; anything else is no answer. */
|
||||
function readEntries(manifest: unknown): ManifestEntry[] {
|
||||
const assets = (manifest as { assets?: unknown } | null)?.assets;
|
||||
if (!Array.isArray(assets)) return [];
|
||||
|
||||
return assets.flatMap((record): ManifestEntry[] => {
|
||||
if (!record || typeof record !== "object") return [];
|
||||
const r = record as Record<string, unknown>;
|
||||
if (typeof r.id !== "string" || typeof r.path !== "string" || typeof r.source !== "string") return [];
|
||||
const generation = r.generation as { key?: unknown } | undefined;
|
||||
const key = typeof generation?.key === "string" ? generation.key : undefined;
|
||||
return [{ id: r.id, path: normalizePath(r.path), key }];
|
||||
});
|
||||
}
|
||||
|
||||
const normalizePath = (path: string): string =>
|
||||
path.replace(/\\/g, "/").split("/").filter((part) => part && part !== ".").join("/");
|
||||
|
||||
/** Whether the project might hold anything to migrate; saves parsing the rest. */
|
||||
const mayNeedMigration = (text: string): boolean => text.includes(JSX_MODULE) || /<captions\b/i.test(text);
|
||||
|
||||
/**
|
||||
* Rewrites every source file of the project that still declares generations
|
||||
* or `src`-less captions. Returns the project-relative files it wrote.
|
||||
*/
|
||||
export async function migrateGenerations(context: SourceContext, manifest: unknown): Promise<string[]> {
|
||||
// Without a readable library every declaration would look unmatched.
|
||||
if (!Array.isArray((manifest as { assets?: unknown } | null)?.assets)) return [];
|
||||
|
||||
const library = new Library(readEntries(manifest));
|
||||
const project = new Project({ useInMemoryFileSystem: true, skipLoadingLibFiles: true });
|
||||
const written: string[] = [];
|
||||
|
||||
for (const path of await sourceFiles(context.dir)) {
|
||||
const absolute = join(context.dir, ...path.split("/"));
|
||||
let text: string;
|
||||
try {
|
||||
text = await readFile(absolute, "utf8");
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
if (!mayNeedMigration(text)) continue;
|
||||
|
||||
const next = migrateText(project, path, text, library);
|
||||
if (next === text) continue;
|
||||
|
||||
context.onWrite?.(path, next);
|
||||
await writeFileAtomic(absolute, next);
|
||||
written.push(path);
|
||||
}
|
||||
|
||||
if (written.length) console.log(`[projects] migrated generated assets in ${written.join(", ")}`);
|
||||
return written;
|
||||
}
|
||||
|
||||
/** The file's text with its declarations and captions migrated; the same text when there is nothing to do. */
|
||||
function migrateText(project: Project, path: string, text: string, library: Library): string {
|
||||
const sourceFile = project.createSourceFile(`/${path}`, text, { overwrite: true });
|
||||
try {
|
||||
// A file mid-edit is not one to rewrite.
|
||||
if (project.getProgram().getSyntacticDiagnostics(sourceFile).length) return text;
|
||||
|
||||
const edits = [...declarationEdits(sourceFile, library), ...captionEdits(sourceFile, library)];
|
||||
if (!edits.length) return text;
|
||||
|
||||
let next = text;
|
||||
for (const edit of outermost(edits).sort((a, b) => b.start - a.start)) {
|
||||
next = next.slice(0, edit.start) + edit.text + next.slice(edit.end);
|
||||
}
|
||||
return dropUnusedImports(project, path, next);
|
||||
} finally {
|
||||
project.removeSourceFile(sourceFile);
|
||||
}
|
||||
}
|
||||
|
||||
interface TextEdit {
|
||||
start: number;
|
||||
end: number;
|
||||
text: string;
|
||||
}
|
||||
|
||||
/** Edits not inside another: replacing an outer call takes the calls inside it along. */
|
||||
function outermost(edits: TextEdit[]): TextEdit[] {
|
||||
return edits.filter((edit) => !edits.some((other) => other !== edit
|
||||
&& other.start <= edit.start && edit.end <= other.end
|
||||
&& (other.start !== edit.start || other.end !== edit.end)));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Declarations
|
||||
|
||||
/** The local names `generate` and `transform` were imported under. */
|
||||
function namespaces(sourceFile: SourceFile): Map<string, Namespace> {
|
||||
const names = new Map<string, Namespace>();
|
||||
for (const declaration of sourceFile.getImportDeclarations()) {
|
||||
if (declaration.getModuleSpecifierValue() !== JSX_MODULE) continue;
|
||||
for (const specifier of declaration.getNamedImports()) {
|
||||
const imported = specifier.getName();
|
||||
if (imported !== "generate" && imported !== "transform") continue;
|
||||
names.set(specifier.getAliasNode()?.getText() ?? imported, imported);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
function declarationEdits(sourceFile: SourceFile, library: Library): TextEdit[] {
|
||||
const names = namespaces(sourceFile);
|
||||
if (!names.size) return [];
|
||||
|
||||
const declarations = new Map<CallExpression, Declaration>();
|
||||
const read = (node: Node, seen: Set<Node>): unknown => readValue(node, names, declarations, seen);
|
||||
|
||||
for (const call of sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression)) {
|
||||
read(call, new Set());
|
||||
}
|
||||
|
||||
const paths = new Map<Declaration, string | undefined>();
|
||||
const resolve = (declaration: Declaration): string | undefined => {
|
||||
if (!paths.has(declaration)) paths.set(declaration, match(declaration, library, resolve));
|
||||
return paths.get(declaration);
|
||||
};
|
||||
|
||||
return [...declarations.values()].map((declaration) => {
|
||||
const path = resolve(declaration);
|
||||
return replacement(declaration.node, path, path === undefined ? declaration.node.getText() : undefined);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A node read as the value it spells: literals, arrays, object literals, a
|
||||
* const it names (followed in this file), or a declaration. `UNKNOWN` for
|
||||
* anything the source computes.
|
||||
*/
|
||||
function readValue(
|
||||
node: Node,
|
||||
names: Map<string, Namespace>,
|
||||
declarations: Map<CallExpression, Declaration>,
|
||||
seen: Set<Node>,
|
||||
): unknown {
|
||||
const read = (child: Node): unknown => readValue(child, names, declarations, seen);
|
||||
|
||||
if (node.isKind(SyntaxKind.ParenthesizedExpression)) return read(node.getExpression());
|
||||
if (node.isKind(SyntaxKind.AsExpression) || node.isKind(SyntaxKind.SatisfiesExpression)) return read(node.getExpression());
|
||||
if (node.isKind(SyntaxKind.StringLiteral) || node.isKind(SyntaxKind.NoSubstitutionTemplateLiteral)) return node.getLiteralValue();
|
||||
if (node.isKind(SyntaxKind.NumericLiteral)) return node.getLiteralValue();
|
||||
if (node.isKind(SyntaxKind.TrueKeyword)) return true;
|
||||
if (node.isKind(SyntaxKind.FalseKeyword)) return false;
|
||||
if (node.isKind(SyntaxKind.NullKeyword)) return null;
|
||||
if (node.isKind(SyntaxKind.Identifier) && node.getText() === "undefined") return undefined;
|
||||
|
||||
if (node.isKind(SyntaxKind.PrefixUnaryExpression) && node.getOperatorToken() === SyntaxKind.MinusToken) {
|
||||
const operand = read(node.getOperand());
|
||||
return typeof operand === "number" ? -operand : UNKNOWN;
|
||||
}
|
||||
|
||||
if (node.isKind(SyntaxKind.ArrayLiteralExpression)) {
|
||||
const items = node.getElements().map(read);
|
||||
return items.includes(UNKNOWN) ? UNKNOWN : items;
|
||||
}
|
||||
|
||||
if (node.isKind(SyntaxKind.ObjectLiteralExpression)) {
|
||||
const object: Record<string, unknown> = {};
|
||||
for (const property of node.getProperties()) {
|
||||
if (property.isKind(SyntaxKind.PropertyAssignment)) {
|
||||
const name = property.getNameNode();
|
||||
if (name.isKind(SyntaxKind.ComputedPropertyName)) return UNKNOWN;
|
||||
const key = name.isKind(SyntaxKind.StringLiteral) ? name.getLiteralValue() : name.getText();
|
||||
object[key] = read(property.getInitializerOrThrow());
|
||||
} else if (property.isKind(SyntaxKind.ShorthandPropertyAssignment)) {
|
||||
object[property.getName()] = read(property.getNameNode());
|
||||
} else {
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
return Object.values(object).includes(UNKNOWN) ? UNKNOWN : object;
|
||||
}
|
||||
|
||||
// A const, followed to its initializer once: a cycle reads as unknown.
|
||||
if (node.isKind(SyntaxKind.Identifier)) {
|
||||
const initializer = constInitializer(node);
|
||||
if (!initializer || seen.has(initializer)) return UNKNOWN;
|
||||
seen.add(initializer);
|
||||
return read(initializer);
|
||||
}
|
||||
|
||||
if (node.isKind(SyntaxKind.CallExpression)) {
|
||||
const known = declarations.get(node);
|
||||
if (known) return known;
|
||||
|
||||
const callee = node.getExpression().asKind(SyntaxKind.PropertyAccessExpression);
|
||||
const namespace = callee && names.get(callee.getExpression().getText());
|
||||
if (!callee || !namespace || !callee.getExpression().isKind(SyntaxKind.Identifier)) return UNKNOWN;
|
||||
|
||||
const [argument] = node.getArguments();
|
||||
const declaration: Declaration = {
|
||||
namespace,
|
||||
type: callee.getName(),
|
||||
node,
|
||||
argument: argument ? read(argument) : UNKNOWN,
|
||||
};
|
||||
declarations.set(node, declaration);
|
||||
return declaration;
|
||||
}
|
||||
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
/** The initializer of the top-level or block-scoped `const` an identifier names, in its own file. */
|
||||
function constInitializer(identifier: Node): Node | undefined {
|
||||
const symbol = identifier.getSymbol();
|
||||
const declaration = symbol?.getDeclarations()[0]?.asKind(SyntaxKind.VariableDeclaration);
|
||||
if (!declaration || declaration.getVariableStatement()?.getDeclarationKind() !== "const") return undefined;
|
||||
if (!declaration.getNameNode().isKind(SyntaxKind.Identifier)) return undefined;
|
||||
return declaration.getInitializer();
|
||||
}
|
||||
|
||||
const isDeclaration = (value: unknown): value is Declaration =>
|
||||
typeof value === "object" && value !== null && "namespace" in value && "node" in value;
|
||||
|
||||
/**
|
||||
* The library path of the asset a declaration made, or undefined when no
|
||||
* generation key matches it. Inputs are matched first, by id, which is how
|
||||
* the key recorded them.
|
||||
*/
|
||||
function match(
|
||||
declaration: Declaration,
|
||||
library: Library,
|
||||
resolve: (declaration: Declaration) => string | undefined,
|
||||
): string | undefined {
|
||||
const idOf = (input: unknown): string | undefined => {
|
||||
if (typeof input === "string") return library.idOf(input);
|
||||
if (isDeclaration(input)) {
|
||||
const path = resolve(input);
|
||||
return path === undefined ? undefined : library.idOf(path);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const { type, argument } = declaration;
|
||||
|
||||
if (declaration.namespace === "transform") {
|
||||
const inputId = idOf(argument);
|
||||
if (inputId === undefined) return undefined;
|
||||
return library.generated((key) => key.type === type && key.inputId === inputId && Object.keys(key).length === 2)?.path;
|
||||
}
|
||||
|
||||
if (!argument || typeof argument !== "object" || isDeclaration(argument) || Array.isArray(argument)) return undefined;
|
||||
const options = argument as Record<string, unknown>;
|
||||
if (typeof options.prompt !== "string") return undefined;
|
||||
|
||||
// What the key must hold, field by field; `undefined` means it must not hold the field.
|
||||
const expected: Record<string, unknown> = { type, ...DEFAULTS[type] };
|
||||
for (const [name, value] of Object.entries(options)) {
|
||||
if (name === "refs" || name === "startFrame" || name === "endFrame") continue;
|
||||
expected[name] = value;
|
||||
}
|
||||
expected.seed = options.seed;
|
||||
|
||||
switch (type) {
|
||||
case "image": {
|
||||
const refs = Array.isArray(options.refs) ? options.refs : [];
|
||||
const refIds = refs.map(idOf);
|
||||
if (refIds.includes(undefined)) return undefined;
|
||||
expected.refIds = refIds;
|
||||
break;
|
||||
}
|
||||
case "video": {
|
||||
for (const [option, field] of [["startFrame", "startFrameId"], ["endFrame", "endFrameId"]] as const) {
|
||||
if (options[option] === undefined) {
|
||||
expected[field] = undefined;
|
||||
continue;
|
||||
}
|
||||
const id = idOf(options[option]);
|
||||
if (id === undefined) return undefined;
|
||||
expected[field] = id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "audio":
|
||||
expected.duration = options.duration;
|
||||
break;
|
||||
case "voice":
|
||||
break;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return library.generated((key) => Object.entries(expected).every(([name, value]) => {
|
||||
if (value === undefined) return FREE_WHEN_OMITTED.has(name) || !(name in key);
|
||||
return JSON.stringify(key[name]) === JSON.stringify(value);
|
||||
}))?.path;
|
||||
}
|
||||
|
||||
/**
|
||||
* The edit putting `path` where the call was: an attribute's `{call}` becomes
|
||||
* `"path"`, anything else the string literal. With no path, an empty source
|
||||
* stands in and the call is kept beside it in a comment.
|
||||
*/
|
||||
function replacement(call: CallExpression, path: string | undefined, unmatched?: string): TextEdit {
|
||||
const comment = unmatched === undefined
|
||||
? ""
|
||||
: ` /* no generated asset matched; generation was removed: ${unmatched.replace(/\*\//g, "* /")} */`;
|
||||
const literal = JSON.stringify(path ?? "");
|
||||
|
||||
const expression = call.getParent()?.asKind(SyntaxKind.JsxExpression);
|
||||
if (expression?.getParent()?.isKind(SyntaxKind.JsxAttribute)) {
|
||||
if (!comment && path !== undefined && !/["&\p{Cc}\u2028\u2029]/u.test(path)) {
|
||||
return { start: expression.getStart(), end: expression.getEnd(), text: literal };
|
||||
}
|
||||
return { start: call.getStart(), end: call.getEnd(), text: literal + comment };
|
||||
}
|
||||
|
||||
return { start: call.getStart(), end: call.getEnd(), text: literal + comment };
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Captions
|
||||
|
||||
type JsxTag = JsxOpeningElement | JsxSelfClosingElement;
|
||||
|
||||
const lower = (tag: JsxTag): string => tag.getTagNameNode().getText().toLowerCase();
|
||||
|
||||
const idOf = (tag: JsxTag): string | undefined =>
|
||||
tag.getAttribute(ID_ATTR)?.asKind(SyntaxKind.JsxAttribute)?.getInitializer()?.asKind(SyntaxKind.StringLiteral)?.getLiteralValue();
|
||||
|
||||
/**
|
||||
* A `<captions>` without a `src` used to transcribe its scene, keyed by the
|
||||
* scene's id and the caption's `seed`. The transcript is in the library under
|
||||
* that key; the caption is pointed at it and loses the `seed`.
|
||||
*/
|
||||
function captionEdits(sourceFile: SourceFile, library: Library): TextEdit[] {
|
||||
const edits: TextEdit[] = [];
|
||||
const tags: JsxTag[] = [
|
||||
...sourceFile.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),
|
||||
...sourceFile.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),
|
||||
];
|
||||
|
||||
for (const tag of tags) {
|
||||
if (lower(tag) !== "captions") continue;
|
||||
const attributes = tag.getAttributes();
|
||||
if (tag.getAttribute("src") || attributes.some((attribute) => attribute.isKind(SyntaxKind.JsxSpreadAttribute))) continue;
|
||||
|
||||
const sceneId = enclosingSceneId(tag);
|
||||
if (sceneId === undefined) continue;
|
||||
|
||||
const seedAttribute = tag.getAttribute("seed")?.asKind(SyntaxKind.JsxAttribute);
|
||||
let seed = 0;
|
||||
if (seedAttribute) {
|
||||
const value = seedAttribute.getInitializer()?.asKind(SyntaxKind.JsxExpression)?.getExpression();
|
||||
const literal = value?.asKind(SyntaxKind.NumericLiteral)?.getLiteralValue();
|
||||
if (literal === undefined) continue;
|
||||
seed = literal;
|
||||
}
|
||||
|
||||
const transcript = library.byKey(`transcript:v1:${sceneId}:${seed}`);
|
||||
if (!transcript) continue;
|
||||
|
||||
const src = `src=${JSON.stringify(transcript.path)}`;
|
||||
if (seedAttribute) {
|
||||
edits.push({ start: seedAttribute.getStart(), end: seedAttribute.getEnd(), text: src });
|
||||
} else {
|
||||
const at = tag.getTagNameNode().getEnd();
|
||||
edits.push({ start: at, end: at, text: ` ${src}` });
|
||||
}
|
||||
}
|
||||
|
||||
return edits;
|
||||
}
|
||||
|
||||
/** The id of the `<scene>` element a tag sits inside, in the same JSX tree. */
|
||||
function enclosingSceneId(tag: JsxTag): string | undefined {
|
||||
for (const ancestor of tag.getAncestors()) {
|
||||
const opening = ancestor.asKind(SyntaxKind.JsxElement)?.getOpeningElement();
|
||||
if (opening && lower(opening) === "scene") return idOf(opening);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Imports
|
||||
|
||||
/** Takes `generate` / `transform` out of the imports once nothing uses them. */
|
||||
function dropUnusedImports(project: Project, path: string, text: string): string {
|
||||
const sourceFile = project.createSourceFile(`/${path}`, text, { overwrite: true });
|
||||
try {
|
||||
for (const declaration of sourceFile.getImportDeclarations()) {
|
||||
if (declaration.getModuleSpecifierValue() !== JSX_MODULE) continue;
|
||||
let removed = false;
|
||||
for (const specifier of declaration.getNamedImports()) {
|
||||
const name = specifier.getName();
|
||||
if (name !== "generate" && name !== "transform") continue;
|
||||
const local = specifier.getAliasNode()?.getText() ?? name;
|
||||
const used = sourceFile.getDescendantsOfKind(SyntaxKind.Identifier)
|
||||
.some((identifier) => identifier.getText() === local && !identifier.getFirstAncestorByKind(SyntaxKind.ImportDeclaration));
|
||||
if (used) continue;
|
||||
specifier.remove();
|
||||
removed = true;
|
||||
}
|
||||
// Only an import this emptied goes; one that imported nothing by name was never ours.
|
||||
if (removed && !declaration.getNamedImports().length && !declaration.getDefaultImport() && !declaration.getNamespaceImport()) {
|
||||
declaration.remove();
|
||||
}
|
||||
}
|
||||
return sourceFile.getFullText();
|
||||
} finally {
|
||||
project.removeSourceFile(sourceFile);
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,8 @@
|
||||
import type { LogEntry, ScreenshotResult } from "@diffusionstudio/dapi";
|
||||
import type { SourceEdit, WriteResult } from "./edit-types";
|
||||
import type { AgentId } from "./mcp-config";
|
||||
import type { EditorId, EditorInfo } from "./editors";
|
||||
import type { MissingProjectChoice, SaveAction } from "./projects";
|
||||
|
||||
export const MAIN_WIRE = {
|
||||
REQUEST: "main:request",
|
||||
@ -30,27 +32,33 @@ export const MAIN_CHANNELS = {
|
||||
// Renderer→Main requests
|
||||
APP_OPEN_EXTERNAL: "app:open-external",
|
||||
APP_SHOW_IN_FOLDER: "app:show-in-folder",
|
||||
ANALYTICS_TRACK: "analytics:track",
|
||||
APP_EDITORS_LIST: "app:editors-list",
|
||||
APP_OPEN_IN_EDITOR: "app:open-in-editor",
|
||||
ANALYTICS_CONFIGURE: "analytics:configure",
|
||||
AUTH_GET_PENDING_CALLBACK: "auth:get-pending-callback",
|
||||
CHECKOUT_GET_PENDING_CALLBACK: "checkout:get-pending-callback",
|
||||
WINDOW_IS_FULLSCREEN: "window:is-fullscreen",
|
||||
WINDOW_SET_COLOR_MODE: "window:set-color-mode",
|
||||
WINDOW_CAPTURE: "window:capture",
|
||||
WINDOW_SET_BUSY: "window:set-busy",
|
||||
WINDOW_SHOW: "window:show",
|
||||
CLIPBOARD_PATHS: "clipboard:paths",
|
||||
FILE_TRANSFER: "file:transfer",
|
||||
FILE_WRITE_OPEN: "file:write-open",
|
||||
FILE_WRITE_CHUNK: "file:write-chunk",
|
||||
FILE_WRITE_CLOSE: "file:write-close",
|
||||
FILE_WRITE_ABORT: "file:write-abort",
|
||||
LOGS_GET: "logs:get",
|
||||
PROJECTS_PICK_ROOT: "projects:pick-root",
|
||||
PROJECTS_PICK_FOLDER: "projects:pick-folder",
|
||||
PROJECTS_DEFAULT_ROOT: "projects:default-root",
|
||||
PROJECTS_SCAN: "projects:scan",
|
||||
PROJECTS_GET: "projects:get",
|
||||
PROJECTS_INIT: "projects:init",
|
||||
PROJECTS_RESOLVE: "projects:resolve",
|
||||
PROJECTS_FIND_MOVED: "projects:find-moved",
|
||||
PROJECTS_ASK_MISSING: "projects:ask-missing",
|
||||
PROJECTS_CREATE: "projects:create",
|
||||
PROJECTS_PICK_SAVE: "projects:pick-save",
|
||||
PROJECTS_SAVE: "projects:save",
|
||||
PROJECTS_MOVE: "projects:move",
|
||||
PROJECTS_RENAME: "projects:rename",
|
||||
PROJECTS_DUPLICATE: "projects:duplicate",
|
||||
PROJECTS_DELETE: "projects:delete",
|
||||
@ -92,7 +100,7 @@ export type ProjectInfo = {
|
||||
* since — `PROJECTS_RESOLVE` is what gives one out.
|
||||
*/
|
||||
id: string;
|
||||
/** Folder name. Renaming the project moves it, so it is not the identity. */
|
||||
/** Folder name. The user can move or rename it, so it is not the identity. */
|
||||
name: string;
|
||||
/** Human name from package.json `displayName` (falls back to the folder name). */
|
||||
displayName: string;
|
||||
@ -104,6 +112,11 @@ export type ProjectInfo = {
|
||||
modifiedAt: string;
|
||||
/** birthtime of the folder, ISO string. */
|
||||
createdAt: string;
|
||||
/**
|
||||
* Whether the folder is a draft's: in the app's drafts folder, named after
|
||||
* the id, until the user saves it somewhere of their choosing.
|
||||
*/
|
||||
draft: boolean;
|
||||
};
|
||||
|
||||
export type CompileResult =
|
||||
@ -111,6 +124,8 @@ export type CompileResult =
|
||||
|
||||
export type { SourceEdit, WriteResult };
|
||||
export type { AgentId };
|
||||
export type { EditorId, EditorInfo };
|
||||
export type { MissingProjectChoice };
|
||||
|
||||
// One agent the settings page lists: whether it is set up on this machine,
|
||||
// whether its config already carries the app's MCP entry, and — for the
|
||||
@ -176,10 +191,9 @@ export type MainRequestMap = {
|
||||
request: { url: string };
|
||||
response: void;
|
||||
};
|
||||
// A product event, posted to Umami by main (the renderer's script is inert
|
||||
// in Electron).
|
||||
[MAIN_CHANNELS.ANALYTICS_TRACK]: {
|
||||
request: { event: string; data?: Record<string, string | number | boolean> };
|
||||
// Where main sends events and as whom: on launch and every auth change.
|
||||
[MAIN_CHANNELS.ANALYTICS_CONFIGURE]: {
|
||||
request: { apiUrl: string; token: string | null };
|
||||
response: void;
|
||||
};
|
||||
[MAIN_CHANNELS.AUTH_GET_PENDING_CALLBACK]: {
|
||||
@ -194,6 +208,8 @@ export type MainRequestMap = {
|
||||
[MAIN_CHANNELS.WINDOW_SET_COLOR_MODE]: { request: { mode: "light" | "dark" }; response: void };
|
||||
[MAIN_CHANNELS.WINDOW_CAPTURE]: { request: void; response: ScreenshotResult };
|
||||
[MAIN_CHANNELS.WINDOW_SET_BUSY]: { request: { busy: boolean }; response: void };
|
||||
[MAIN_CHANNELS.WINDOW_SHOW]: { request: void; response: void };
|
||||
[MAIN_CHANNELS.CLIPBOARD_PATHS]: { request: void; response: string[] };
|
||||
[MAIN_CHANNELS.FILE_TRANSFER]: {
|
||||
request: { selector: string; absolutePath: string };
|
||||
response: void;
|
||||
@ -219,25 +235,20 @@ export type MainRequestMap = {
|
||||
request: { path: string };
|
||||
response: void;
|
||||
};
|
||||
[MAIN_CHANNELS.LOGS_GET]: { request: void; response: LogEntry[] };
|
||||
[MAIN_CHANNELS.PROJECTS_PICK_ROOT]: {
|
||||
// The code editors installed here that a folder can be opened in.
|
||||
[MAIN_CHANNELS.APP_EDITORS_LIST]: {
|
||||
request: void;
|
||||
response: string | null;
|
||||
response: EditorInfo[];
|
||||
};
|
||||
[MAIN_CHANNELS.APP_OPEN_IN_EDITOR]: {
|
||||
request: { id: EditorId; dir: string };
|
||||
response: void;
|
||||
};
|
||||
[MAIN_CHANNELS.LOGS_GET]: { request: void; response: LogEntry[] };
|
||||
[MAIN_CHANNELS.PROJECTS_PICK_FOLDER]: {
|
||||
request: void;
|
||||
response: string | null;
|
||||
};
|
||||
[MAIN_CHANNELS.PROJECTS_DEFAULT_ROOT]: {
|
||||
request: void;
|
||||
response: string | null;
|
||||
};
|
||||
// Every project folder directly under `root`: what the app puts on its
|
||||
// list when `root` is chosen as the projects root.
|
||||
[MAIN_CHANNELS.PROJECTS_SCAN]: {
|
||||
request: { root: string };
|
||||
response: ProjectInfo[];
|
||||
};
|
||||
[MAIN_CHANNELS.PROJECTS_GET]: {
|
||||
request: { dir: string };
|
||||
response: ProjectInfo | null;
|
||||
@ -250,11 +261,35 @@ export type MainRequestMap = {
|
||||
request: { dir: string };
|
||||
response: ProjectInfo | null;
|
||||
};
|
||||
// The project `id` in a folder beside `dir`, which no longer holds it (a
|
||||
// folder renamed or moved in Finder); null when none does.
|
||||
[MAIN_CHANNELS.PROJECTS_FIND_MOVED]: {
|
||||
request: { dir: string; id: string };
|
||||
response: ProjectInfo | null;
|
||||
};
|
||||
// Asks what to do about a project whose folder can't be found.
|
||||
[MAIN_CHANNELS.PROJECTS_ASK_MISSING]: {
|
||||
request: { displayName: string; dir: string };
|
||||
response: MissingProjectChoice;
|
||||
};
|
||||
// A new project, as a draft called "Untitled" until it is saved.
|
||||
[MAIN_CHANNELS.PROJECTS_CREATE]: {
|
||||
request: { root: string; displayName: string };
|
||||
request: void;
|
||||
response: ProjectInfo;
|
||||
};
|
||||
// Where to save a draft, or move a saved project; `name` fills the picker.
|
||||
[MAIN_CHANNELS.PROJECTS_PICK_SAVE]: {
|
||||
request: { dir: string; name: string; startIn: string | null; action: SaveAction };
|
||||
response: string | null;
|
||||
};
|
||||
[MAIN_CHANNELS.PROJECTS_SAVE]: {
|
||||
request: { dir: string; target: string };
|
||||
response: ProjectInfo;
|
||||
};
|
||||
[MAIN_CHANNELS.PROJECTS_MOVE]: {
|
||||
request: { dir: string; target: string };
|
||||
response: ProjectInfo;
|
||||
};
|
||||
// Renames the project: `displayName` in the record, and the folder with it.
|
||||
[MAIN_CHANNELS.PROJECTS_RENAME]: {
|
||||
request: { dir: string; displayName: string };
|
||||
response: ProjectInfo;
|
||||
|
||||
@ -8,14 +8,17 @@ import { existsSync } from "node:fs";
|
||||
import { mkdir, open, rename, unlink } from "node:fs/promises";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { FileHandle } from "node:fs/promises";
|
||||
import type { IUpdateInfo } from "update-electron-app";
|
||||
import { makeUserNotifier, updateElectronApp } from "update-electron-app";
|
||||
import { tempPathFor } from "./atomic";
|
||||
import { DapiServer } from "./dapi/server";
|
||||
import { agentChatEndpoint, configureAgentChat, deleteProjectChats, stopAgentChat } from "./agent-chat";
|
||||
import { cliStatus, installCli, refreshCliShim, uninstallCli } from "./cli-install";
|
||||
import { applyMcp, healMcpRegistrations, mcpStatus } from "./mcp-install";
|
||||
import { trackEvent, trackInstall } from "./analytics";
|
||||
import { configureAnalytics, countCanvasEdits, startAnalytics, track } from "./analytics";
|
||||
import { setupAppMenu } from "./menu";
|
||||
import { clipboardPaths } from "./clipboard";
|
||||
import { installedEditors, openInEditor } from "./editors";
|
||||
import { AppTray } from "./tray";
|
||||
import { WindowHost } from "./window-host";
|
||||
import { handleSquirrelEvent } from "./squirrel";
|
||||
@ -24,16 +27,18 @@ import { MAIN_CHANNELS } from "./main-channels";
|
||||
import {
|
||||
compileProject,
|
||||
createProject,
|
||||
defaultRoot,
|
||||
deleteProject,
|
||||
duplicateProject,
|
||||
getProject,
|
||||
askAboutMissingProject,
|
||||
findMovedProject,
|
||||
initProject,
|
||||
pickFolder,
|
||||
pickRoot,
|
||||
pickSaveLocation,
|
||||
renameProject,
|
||||
resolveProject,
|
||||
scanProjects,
|
||||
saveProject,
|
||||
moveProject,
|
||||
unwatchAll,
|
||||
listEntries,
|
||||
realPathEntry,
|
||||
@ -107,14 +112,25 @@ function setColorMode(mode: "dark" | "light") {
|
||||
mainWindow.setTitleBarOverlay({ ...WINDOWS_OVERLAY_COLORS[mode], height: WINDOWS_OVERLAY_HEIGHT });
|
||||
}
|
||||
|
||||
// A downloaded update is offered while the user has the window out; one that
|
||||
// lands while the app runs in the background waits for the next show, since
|
||||
// the app rarely quits on its own to apply it.
|
||||
const notifyUser = makeUserNotifier();
|
||||
let pendingUpdate: IUpdateInfo | null = null;
|
||||
|
||||
function offerUpdate() {
|
||||
if (!pendingUpdate || !windows.visible()) return;
|
||||
const info = pendingUpdate;
|
||||
pendingUpdate = null;
|
||||
notifyUser(info);
|
||||
}
|
||||
|
||||
if (app.isPackaged && !squirrelLaunch) {
|
||||
const notifyUser = makeUserNotifier();
|
||||
updateElectronApp({
|
||||
repo: "diffusionstudio/editor",
|
||||
onNotifyUser: function (info) {
|
||||
if (windows.visible()) {
|
||||
notifyUser(info);
|
||||
}
|
||||
pendingUpdate = info;
|
||||
offerUpdate();
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -127,7 +143,10 @@ let lastProject: string | null = null;
|
||||
const windows = new WindowHost({
|
||||
create: createWindow,
|
||||
idleMs: WINDOW_IDLE_MS,
|
||||
onChange: () => tray.refresh(),
|
||||
onChange: () => {
|
||||
tray.refresh();
|
||||
offerUpdate();
|
||||
},
|
||||
});
|
||||
|
||||
const tray = new AppTray({
|
||||
@ -171,6 +190,7 @@ const dapi = new DapiServer({
|
||||
hold: () => windows.hold(),
|
||||
lastProject: () => lastProject,
|
||||
},
|
||||
onToolCall: (props) => track("tool_called", props),
|
||||
});
|
||||
|
||||
function pushLog(level: LogEntry["level"], message: string, source: string) {
|
||||
@ -355,7 +375,9 @@ if (squirrelLaunch) {
|
||||
|
||||
mainBridge.handle(MAIN_CHANNELS.APP_OPEN_EXTERNAL, ({ url }) => shell.openExternal(url));
|
||||
mainBridge.handle(MAIN_CHANNELS.APP_SHOW_IN_FOLDER, ({ path }) => shell.showItemInFolder(path));
|
||||
mainBridge.handle(MAIN_CHANNELS.ANALYTICS_TRACK, ({ event, data }) => trackEvent(event, data));
|
||||
mainBridge.handle(MAIN_CHANNELS.APP_EDITORS_LIST, () => installedEditors());
|
||||
mainBridge.handle(MAIN_CHANNELS.APP_OPEN_IN_EDITOR, ({ id, dir }) => openInEditor(id, dir));
|
||||
mainBridge.handle(MAIN_CHANNELS.ANALYTICS_CONFIGURE, (config) => configureAnalytics(config));
|
||||
mainBridge.handle(MAIN_CHANNELS.AUTH_GET_PENDING_CALLBACK, () =>
|
||||
takePendingDeepLink(MAIN_CHANNELS.AUTH_CALLBACK),
|
||||
);
|
||||
@ -365,6 +387,7 @@ if (squirrelLaunch) {
|
||||
mainBridge.handle(MAIN_CHANNELS.WINDOW_IS_FULLSCREEN, () => mainWindow?.isFullScreen() ?? false);
|
||||
mainBridge.handle(MAIN_CHANNELS.WINDOW_SET_COLOR_MODE, ({ mode }) => setColorMode(mode));
|
||||
mainBridge.handle(MAIN_CHANNELS.WINDOW_SET_BUSY, ({ busy }) => windows.setBusy(busy));
|
||||
mainBridge.handle(MAIN_CHANNELS.WINDOW_SHOW, () => windows.show());
|
||||
mainBridge.handle(MAIN_CHANNELS.WINDOW_CAPTURE, async () => {
|
||||
if (!mainWindow || mainWindow.isDestroyed()) throw new Error("No main window");
|
||||
const image = await mainWindow.webContents.capturePage(undefined, { stayHidden: true });
|
||||
@ -373,6 +396,7 @@ if (squirrelLaunch) {
|
||||
// A plain Uint8Array over the PNG, so the renderer sees bytes and not a Buffer.
|
||||
return { png: new Uint8Array(png.buffer, png.byteOffset, png.byteLength), width, height };
|
||||
});
|
||||
mainBridge.handle(MAIN_CHANNELS.CLIPBOARD_PATHS, () => clipboardPaths());
|
||||
mainBridge.handle(MAIN_CHANNELS.LOGS_GET, () => logBuffer);
|
||||
mainBridge.handle(MAIN_CHANNELS.AGENT_CHAT_ENDPOINT, () => agentChatEndpoint());
|
||||
mainBridge.handle(MAIN_CHANNELS.MCP_STATUS, () => mcpStatus());
|
||||
@ -380,21 +404,28 @@ if (squirrelLaunch) {
|
||||
mainBridge.handle(MAIN_CHANNELS.CLI_STATUS, () => cliStatus());
|
||||
mainBridge.handle(MAIN_CHANNELS.CLI_INSTALL, () => installCli());
|
||||
mainBridge.handle(MAIN_CHANNELS.CLI_UNINSTALL, () => uninstallCli());
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_PICK_ROOT, () => pickRoot(mainWindow));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_PICK_FOLDER, () => pickFolder(mainWindow));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_DEFAULT_ROOT, () => defaultRoot(mainWindow));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_SCAN, ({ root }) => scanProjects(root));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_GET, ({ dir }) => getProject(dir));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_INIT, ({ dir }) => initProject(mainWindow, dir));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_RESOLVE, ({ dir }) => resolveProject(dir));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_CREATE, ({ root, displayName }) =>
|
||||
createProject(root, displayName),
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_FIND_MOVED, ({ dir, id }) => findMovedProject(dir, id));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_ASK_MISSING, ({ displayName, dir }) =>
|
||||
askAboutMissingProject(mainWindow, displayName, dir),
|
||||
);
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_CREATE, () => createProject());
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_PICK_SAVE, ({ dir, name, startIn, action }) =>
|
||||
pickSaveLocation(mainWindow, dir, name, startIn, action),
|
||||
);
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_SAVE, ({ dir, target }) => saveProject(dir, target));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_MOVE, ({ dir, target }) => moveProject(dir, target));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_RENAME, ({ dir, displayName }) => renameProject(dir, displayName));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_DUPLICATE, ({ dir }) => duplicateProject(dir));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_DELETE, ({ dir }) => deleteProject(dir).then(deleteProjectChats));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_COMPILE, ({ dir }) => compileProject(dir));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_WRITE, ({ dir, edits }) => writeProject(dir, edits));
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_WRITE, ({ dir, edits }) => {
|
||||
countCanvasEdits(edits.map((edit) => edit.kind));
|
||||
return writeProject(dir, edits);
|
||||
});
|
||||
mainBridge.handle(MAIN_CHANNELS.PROJECTS_WATCH, ({ dir }, event) => {
|
||||
lastProject = dir;
|
||||
tray.refresh();
|
||||
@ -506,7 +537,7 @@ if (squirrelLaunch) {
|
||||
);
|
||||
refreshCliShim();
|
||||
healMcpRegistrations();
|
||||
trackInstall();
|
||||
startAnalytics(windows);
|
||||
tray.start();
|
||||
|
||||
// Opened by a person (Finder, Dock, Start menu): show the editor
|
||||
|
||||
98
apps/desktop/src/projects.drafts.test.ts
Normal file
@ -0,0 +1,98 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// A new project is a draft: made without asking, in the app's own folder,
|
||||
// named after its id — until it is saved, which moves it where the user said
|
||||
// and names it after the folder they chose.
|
||||
|
||||
import { tmpdir } from "node:os";
|
||||
import { mkdir, mkdtemp, readdir, readFile, rm } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
let userData = "";
|
||||
|
||||
vi.mock("electron", () => ({
|
||||
app: { isPackaged: false, getPath: (name: string) => (name === "userData" ? userData : tmpdir()) },
|
||||
dialog: {},
|
||||
shell: {},
|
||||
ipcMain: { on: () => { } },
|
||||
}));
|
||||
|
||||
const { createProject, draftsRoot, duplicateProject, moveProject, readManifest, saveProject, writeManifest } =
|
||||
await import("./projects");
|
||||
|
||||
let root: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
root = await mkdtemp(join(tmpdir(), "drafts-test-"));
|
||||
userData = join(root, "userData");
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await rm(root, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
describe("drafts", () => {
|
||||
it("creates a draft in the drafts folder, named after its id", async () => {
|
||||
const project = await createProject();
|
||||
expect(project.draft).toBe(true);
|
||||
expect(project.dir).toBe(join(draftsRoot(), project.id));
|
||||
expect(project.name).toBe(project.id);
|
||||
expect(project.displayName).toBe("Untitled");
|
||||
expect(project.entry).toBe("index.tsx");
|
||||
});
|
||||
|
||||
it("duplicates a draft as a draft with an id of its own", async () => {
|
||||
const source = await createProject();
|
||||
const copy = await duplicateProject(source.dir);
|
||||
expect(copy.draft).toBe(true);
|
||||
expect(copy.id).not.toBe(source.id);
|
||||
expect(copy.dir).toBe(join(draftsRoot(), copy.id));
|
||||
});
|
||||
|
||||
it("saves a draft by moving it and naming it after the folder", async () => {
|
||||
const draft = await createProject();
|
||||
const target = join(root, "Saved", "My Ad");
|
||||
|
||||
const saved = await saveProject(draft.dir, target);
|
||||
expect(saved).toMatchObject({ id: draft.id, dir: target, name: "My Ad", displayName: "My Ad", draft: false });
|
||||
expect(await readdir(draftsRoot())).toEqual([]);
|
||||
const pkg = JSON.parse(await readFile(join(target, "package.json"), "utf8"));
|
||||
expect(pkg.projectId).toBe(draft.id);
|
||||
});
|
||||
|
||||
it("lands a write asked for before the save in the saved folder", async () => {
|
||||
const draft = await createProject();
|
||||
const target = join(root, "My Ad");
|
||||
|
||||
const manifest = { version: 1, folders: [], assets: [{ id: "a" }] };
|
||||
const writing = writeManifest(draft.dir, manifest);
|
||||
await saveProject(draft.dir, target);
|
||||
await writing;
|
||||
expect(await readManifest(target)).toEqual(manifest);
|
||||
expect(await readdir(draftsRoot())).toEqual([]);
|
||||
});
|
||||
|
||||
it("refuses a folder that exists, and a project that is not a draft", async () => {
|
||||
const draft = await createProject();
|
||||
const taken = join(root, "taken");
|
||||
await mkdir(taken);
|
||||
await expect(saveProject(draft.dir, taken)).rejects.toThrow(/already exists/);
|
||||
|
||||
const saved = await saveProject(draft.dir, join(root, "saved"));
|
||||
await expect(saveProject(saved.dir, join(root, "again"))).rejects.toThrow(/saved already/);
|
||||
});
|
||||
|
||||
it("moves a saved project, keeping its name, and refuses to move a draft", async () => {
|
||||
const draft = await createProject();
|
||||
await expect(moveProject(draft.dir, join(root, "elsewhere"))).rejects.toThrow(/Save the draft/);
|
||||
|
||||
const saved = await saveProject(draft.dir, join(root, "My Ad"));
|
||||
const target = join(root, "Archive", "Ad Folder");
|
||||
const moved = await moveProject(saved.dir, target);
|
||||
expect(moved).toMatchObject({ id: draft.id, dir: target, name: "Ad Folder", displayName: "My Ad", draft: false });
|
||||
expect(await readdir(root)).not.toContain("My Ad");
|
||||
});
|
||||
});
|
||||
51
apps/desktop/src/projects.locate.test.ts
Normal file
@ -0,0 +1,51 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// A project folder renamed or moved in Finder is found again next to where it
|
||||
// was, by the id in its record.
|
||||
|
||||
import { tmpdir } from "node:os";
|
||||
import { mkdir, mkdtemp, rename, rm } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("electron", () => ({
|
||||
app: { isPackaged: false, getPath: () => tmpdir() },
|
||||
dialog: {},
|
||||
shell: {},
|
||||
ipcMain: { on: () => { } },
|
||||
}));
|
||||
|
||||
const { findMovedProject, initProject } = await import("./projects");
|
||||
|
||||
let root: string;
|
||||
|
||||
beforeEach(async () => {
|
||||
root = await mkdtemp(join(tmpdir(), "locate-test-"));
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await rm(root, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
describe("findMovedProject", () => {
|
||||
it("finds a project renamed in place by its id", async () => {
|
||||
const project = await initProject(null, join(root, "golden-river"));
|
||||
await initProject(null, join(root, "another"));
|
||||
await rename(project.dir, join(root, "My Ad"));
|
||||
|
||||
const found = await findMovedProject(project.dir, project.id);
|
||||
expect(found).toMatchObject({ id: project.id, dir: join(root, "My Ad") });
|
||||
});
|
||||
|
||||
it("finds nothing when the folder left its parent, or the parent is gone", async () => {
|
||||
const project = await initProject(null, join(root, "golden-river"));
|
||||
await mkdir(join(root, "elsewhere", "deeper"), { recursive: true });
|
||||
await rename(project.dir, join(root, "elsewhere", "deeper", "My Ad"));
|
||||
|
||||
expect(await findMovedProject(project.dir, project.id)).toBeNull();
|
||||
expect(await findMovedProject(join(root, "gone", "golden-river"), project.id)).toBeNull();
|
||||
expect(await findMovedProject(project.dir, "")).toBeNull();
|
||||
});
|
||||
});
|
||||
@ -16,11 +16,13 @@ import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
||||
import type { PluginItem, TransformOptions } from "@babel/core";
|
||||
import type { BuildOptions, Plugin } from "esbuild";
|
||||
|
||||
import { countCodeChange } from "./analytics";
|
||||
import { isTempPath, TEMP_PREFIX, writeFileAtomic } from "./atomic";
|
||||
import { windowsCloudSyncKind } from "./cloud-sync-windows";
|
||||
import { mainBridge } from "./main-manager";
|
||||
import { MAIN_CHANNELS } from "./main-channels";
|
||||
import { applyEdits, editLabel, stampProject } from "./edit";
|
||||
import { migrateGenerations } from "./legacy-generations";
|
||||
import { canonicalizeTagsPlugin, inspectPlugin, sourcePlugin } from "./source";
|
||||
import type { CompileResult, FsEntry, FsStat, ProjectInfo, SourceEdit, WriteResult } from "./main-channels";
|
||||
import type { SourceContext } from "./edit";
|
||||
@ -96,7 +98,8 @@ async function writePackage(dir: string, pkg: PackageJson): Promise<void> {
|
||||
// Identity
|
||||
|
||||
// A project is named twice: `displayName` is what the user calls it and the
|
||||
// folder is what the disk calls it, and renaming moves both. Neither can be
|
||||
// folder is what the disk calls it, and either can change apart from the
|
||||
// other (the app renames the one, the user moves the other). Neither can be
|
||||
// the project's identity, so the record carries an id that nothing renames —
|
||||
// it is what the app's URLs point at, and what the editor keys the open world
|
||||
// by. Top level rather than inside `diffusion`, which `writeConfig` replaces
|
||||
@ -151,54 +154,121 @@ async function describe(dir: string): Promise<ProjectInfo | null> {
|
||||
entry,
|
||||
modifiedAt: file.mtime.toISOString(),
|
||||
createdAt: folder.birthtime.toISOString(),
|
||||
draft: isDraft(dir),
|
||||
};
|
||||
}
|
||||
|
||||
export const getProject = (dir: string): Promise<ProjectInfo | null> => describe(dir);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Drafts
|
||||
|
||||
// A new project starts as a draft: a folder the app makes without asking,
|
||||
// in a place of its own, named after the id. Saving it (⌘S) is when the user
|
||||
// says where it goes and what the folder is called — the folder moves there,
|
||||
// and from then on it is an ordinary project.
|
||||
|
||||
/**
|
||||
* The folder projects go in when the user has not picked one. `~/Movies` on
|
||||
* macOS, `Videos` elsewhere — chosen because it is the one media folder the
|
||||
* sync services leave alone: iCloud's "Desktop & Documents Folders" covers
|
||||
* only those two, and OneDrive's Known Folder Move only Desktop, Documents,
|
||||
* and Pictures. It also needs no macOS permission prompt, which Documents and
|
||||
* Desktop do. Created on demand, so a user who never makes a project never
|
||||
* gets the folder.
|
||||
*
|
||||
* Null when it turns out to be synced after all and the user would rather
|
||||
* pick somewhere else — the caller falls back to `pickRoot`.
|
||||
* The folder drafts live in. Inside the app's own data, which nothing syncs —
|
||||
* neither iCloud nor OneDrive reaches `Application Support` or `AppData` —
|
||||
* and which needs no permission prompt. On Windows the Local AppData rather
|
||||
* than the Roaming one, which a roaming profile would carry, media and all,
|
||||
* from machine to machine.
|
||||
*/
|
||||
export async function defaultRoot(window: BrowserWindow | null): Promise<string | null> {
|
||||
export function draftsRoot(): string {
|
||||
const local = process.platform === "win32" ? process.env.LOCALAPPDATA : undefined;
|
||||
const base = local ? join(local, basename(app.getPath("userData"))) : app.getPath("userData");
|
||||
return join(base, "Drafts");
|
||||
}
|
||||
|
||||
/** Whether `dir` is a draft's folder: directly inside `draftsRoot`. */
|
||||
function isDraft(dir: string): boolean {
|
||||
const parent = dirname(resolve(dir));
|
||||
const root = draftsRoot();
|
||||
return process.platform === "win32" ? parent.toLowerCase() === root.toLowerCase() : parent === root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Where the save picker starts when no project has been saved yet: a folder
|
||||
* under `~/Movies` on macOS, `Videos` elsewhere — the one media folder the
|
||||
* sync services leave alone (iCloud's "Desktop & Documents Folders" covers
|
||||
* only those two, OneDrive's Known Folder Move only Desktop, Documents, and
|
||||
* Pictures), and one that needs no macOS permission prompt. Created on
|
||||
* demand, so a user who never saves a project never gets the folder.
|
||||
*/
|
||||
async function defaultSaveFolder(): Promise<string> {
|
||||
const dir = join(app.getPath("videos"), "Diffusion Studio");
|
||||
if (!(await confirmCloudLocation(window, dir, "Choose another folder"))) return null;
|
||||
await mkdir(dir, { recursive: true });
|
||||
return dir;
|
||||
}
|
||||
|
||||
export async function pickRoot(window: BrowserWindow | null): Promise<string | null> {
|
||||
const options: Electron.OpenDialogOptions = {
|
||||
title: "Choose projects folder",
|
||||
defaultPath: app.getPath("videos"),
|
||||
properties: ["openDirectory", "createDirectory"],
|
||||
/** Characters no folder name can hold on one platform or another. */
|
||||
const UNSAFE_NAME = /[\\/:*?"<>|]+/g;
|
||||
|
||||
/** Why the project in `dir` cannot be saved or moved as `target`, or null when it can. */
|
||||
async function saveProblem(dir: string, target: string): Promise<string | null> {
|
||||
if (await exists(target)) {
|
||||
return `"${basename(target)}" already exists in ${basename(dirname(target))}. Choose another name.`;
|
||||
}
|
||||
const inside = relative(resolve(dir), resolve(target));
|
||||
if (!inside.startsWith("..") && !isAbsolute(inside)) return "A project can't be saved inside itself.";
|
||||
if (isDraft(target)) return "Choose a folder outside the drafts folder.";
|
||||
return null;
|
||||
}
|
||||
|
||||
/** What the save picker is asked for: saving a draft, or moving a saved project. */
|
||||
export type SaveAction = "save" | "move";
|
||||
|
||||
/**
|
||||
* Asks where to save the draft in `dir`, or where to move the project there:
|
||||
* the folder it will become, or null when the user cancels. Starts in
|
||||
* `startIn` — the parent of the last project saved — with `name` filled in.
|
||||
* A name that is taken is refused rather than replaced, and a synced folder
|
||||
* is warned about; either way the picker comes back, since the user came here
|
||||
* to save.
|
||||
*/
|
||||
export async function pickSaveLocation(
|
||||
window: BrowserWindow | null,
|
||||
dir: string,
|
||||
name: string,
|
||||
startIn: string | null,
|
||||
action: SaveAction = "save",
|
||||
): Promise<string | null> {
|
||||
const start = startIn && (await stat(startIn).catch(() => null))?.isDirectory() ? startIn : await defaultSaveFolder();
|
||||
const folder = name.replace(UNSAFE_NAME, "-").trim() || basename(dir);
|
||||
const options: Electron.SaveDialogOptions = {
|
||||
title: action === "move" ? "Move project" : "Save project",
|
||||
buttonLabel: action === "move" ? "Move" : "Save",
|
||||
defaultPath: join(start, folder),
|
||||
properties: ["createDirectory", "showOverwriteConfirmation"],
|
||||
};
|
||||
|
||||
// Declining a synced folder reopens the picker rather than dropping the
|
||||
// user back to the dashboard: they came here to choose one.
|
||||
while (true) {
|
||||
const { canceled, filePaths } = window
|
||||
? await dialog.showOpenDialog(window, options)
|
||||
: await dialog.showOpenDialog(options);
|
||||
if (canceled || !filePaths[0]) return null;
|
||||
if (await confirmCloudLocation(window, filePaths[0], "Choose another folder")) {
|
||||
return filePaths[0];
|
||||
const { canceled, filePath } = window
|
||||
? await dialog.showSaveDialog(window, options)
|
||||
: await dialog.showSaveDialog(options);
|
||||
if (canceled || !filePath) return null;
|
||||
options.defaultPath = filePath;
|
||||
|
||||
const problem = await saveProblem(dir, filePath);
|
||||
if (problem) {
|
||||
const message: Electron.MessageBoxOptions = {
|
||||
type: "warning",
|
||||
message: action === "move" ? "Can't move here" : "Can't save here",
|
||||
detail: problem,
|
||||
};
|
||||
if (window) await dialog.showMessageBox(window, message);
|
||||
else await dialog.showMessageBox(message);
|
||||
continue;
|
||||
}
|
||||
if (await confirmCloudLocation(window, filePath, "Choose another folder")) return filePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A folder to open as a single project, wherever it lives. Unlike `pickRoot`
|
||||
* this leaves the projects root alone, and it does not vet the location: the
|
||||
* folder goes through `initProject`, which asks about a synced one there.
|
||||
* A folder to open as a single project, wherever it lives. It does not vet
|
||||
* the location: the folder goes through `initProject`, which asks about a
|
||||
* synced one there.
|
||||
*/
|
||||
export async function pickFolder(window: BrowserWindow | null): Promise<string | null> {
|
||||
const options: Electron.OpenDialogOptions = {
|
||||
@ -379,24 +449,52 @@ async function confirmCloudLocation(
|
||||
return response === 1;
|
||||
}
|
||||
|
||||
/** Direct child folders of `root` that could hold a project, in a stable order. */
|
||||
async function childDirs(root: string): Promise<string[]> {
|
||||
const entries = await readdir(root, { withFileTypes: true });
|
||||
return entries
|
||||
.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".") && entry.name !== "node_modules")
|
||||
.map((entry) => entry.name)
|
||||
.sort()
|
||||
.map((name) => join(root, name));
|
||||
/**
|
||||
* The project `id` in a folder beside `dir`, which no longer holds it: one
|
||||
* renamed in Finder, or moved to another folder next to it. Found by the id in
|
||||
* its record, which goes wherever the folder goes. Null when no sibling holds
|
||||
* it, or `dir`'s parent is gone too. Reads only.
|
||||
*/
|
||||
export async function findMovedProject(dir: string, id: string): Promise<ProjectInfo | null> {
|
||||
if (!id) return null;
|
||||
const parent = dirname(dir);
|
||||
let entries;
|
||||
try {
|
||||
entries = await readdir(parent, { withFileTypes: true });
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
for (const entry of entries) {
|
||||
if (!entry.isDirectory() || entry.name.startsWith(".")) continue;
|
||||
const candidate = join(parent, entry.name);
|
||||
if (recordedId(await readPackage(candidate)) === id) return describe(candidate);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Every direct child folder of `root` that holds an entry file. The one
|
||||
* search of the disk for projects there is: the app runs it when a projects
|
||||
* root is chosen, to put the projects already in it on its list. Reads only.
|
||||
*/
|
||||
export async function scanProjects(root: string): Promise<ProjectInfo[]> {
|
||||
const projects = await Promise.all((await childDirs(root)).map(describe));
|
||||
return projects.filter((project): project is ProjectInfo => project !== null);
|
||||
/** What the user wants done about a project whose folder can't be found. */
|
||||
export type MissingProjectChoice = "locate" | "remove" | "cancel";
|
||||
|
||||
/** Tells the user the project's folder is gone, and asks what to do about it. */
|
||||
export async function askAboutMissingProject(
|
||||
window: BrowserWindow | null,
|
||||
displayName: string,
|
||||
dir: string,
|
||||
): Promise<MissingProjectChoice> {
|
||||
const options: Electron.MessageBoxOptions = {
|
||||
type: "warning",
|
||||
message: `Can't find "${displayName}"`,
|
||||
detail: `It was in ${dir}. It may have been moved, renamed or deleted, or be on a disk that isn't connected.`,
|
||||
buttons: ["Locate...", "Remove from List", "Cancel"],
|
||||
defaultId: 0,
|
||||
cancelId: 2,
|
||||
};
|
||||
const { response } = window
|
||||
? await dialog.showMessageBox(window, options)
|
||||
: await dialog.showMessageBox(options);
|
||||
if (response === 0) return "locate";
|
||||
if (response === 1) return "remove";
|
||||
return "cancel";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -415,17 +513,6 @@ export async function resolveProject(dir: string): Promise<ProjectInfo | null> {
|
||||
// ---------------------------------------------------------------------------
|
||||
// Scaffold
|
||||
|
||||
/** Folder-safe project name: "Golden River 15 Aug" -> "golden-river-15-aug". */
|
||||
function folderName(name: string): string {
|
||||
return (
|
||||
name
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9._-]+/g, "-")
|
||||
.replace(/^[-.]+|[-.]+$/g, "")
|
||||
.slice(0, 64) || "project"
|
||||
);
|
||||
}
|
||||
|
||||
/** `base`, or `base-2`, `base-3`... when the folder is taken. */
|
||||
async function freeFolder(root: string, base: string): Promise<string> {
|
||||
let name = base;
|
||||
@ -450,22 +537,19 @@ const SOLID_VERSION = "^1.9.10";
|
||||
/**
|
||||
* The diffusion surface as npm scripts: the CLI is how a project is inspected and
|
||||
* cut, so its commands belong in the record of the project they act on —
|
||||
* `npm run` prints the menu, `npm run <name> -- <args>` runs one. Named after
|
||||
* the command rather than its path (`grab`, not `media:grab`): the `media`
|
||||
* subcommands have no top-level namesakes to collide with.
|
||||
* `npm run` prints the menu, `npm run <name> -- <args>` runs one, named after
|
||||
* the command.
|
||||
*/
|
||||
const SCRIPTS: Record<string, string> = {
|
||||
open: "diffusion open .",
|
||||
context: "diffusion context",
|
||||
capture: "diffusion capture",
|
||||
probe: "diffusion media probe",
|
||||
transcribe: "diffusion media transcribe",
|
||||
grab: "diffusion media grab",
|
||||
filmstrip: "diffusion media filmstrip",
|
||||
waveform: "diffusion media waveform",
|
||||
listen: "diffusion media listen",
|
||||
models: "diffusion models",
|
||||
voices: "diffusion voices",
|
||||
probe: "diffusion probe",
|
||||
transcribe: "diffusion transcribe",
|
||||
grab: "diffusion grab",
|
||||
filmstrip: "diffusion filmstrip",
|
||||
waveform: "diffusion waveform",
|
||||
listen: "diffusion listen",
|
||||
fonts: "diffusion fonts",
|
||||
logs: "diffusion logs",
|
||||
screenshot: "diffusion screenshot",
|
||||
@ -550,10 +634,10 @@ a new session.
|
||||
| Path | What it is |
|
||||
| ---- | ---------- |
|
||||
| \`index.tsx\` | The entry. Its default export renders the composition. |
|
||||
| \`package.json\` | The project record: \`projectId\` (its identity, kept across renames), \`displayName\` (the name shown in the app), \`main\` (the entry), \`diffusion\` (how each scene is exported), and the diffusion commands as scripts. |
|
||||
| \`package.json\` | The project record: \`projectId\` (its identity, kept across renames), \`displayName\` (the name shown in the app), \`main\` (the entry), \`diffusion\` (how each scene is exported, and whether the stage has ever had anything on it), and the diffusion commands as scripts. |
|
||||
| \`tsconfig.json\` | Types for the composition tags, through \`jsxImportSource\`. |
|
||||
| \`assets.yml\` | The asset library: for every asset its library path, where its bytes are, and what it was found to be; for a generation without bytes, where it stands. Written by the app; hand edits are read on the next load. |
|
||||
| \`assets/\` | The library's files: put one here and it is taken in while the app watches, and the app writes its own here too — generations under \`assets/generated/\`. Media imported through the app is linked where it lies instead, never copied. |
|
||||
| \`assets.yml\` | The asset library: for every asset its library path, where its bytes are, and what it was found to be. Written by the app; hand edits are read on the next load. |
|
||||
| \`assets/\` | The library's files: put one here and it is taken in while the app watches, and the app writes its own here too. Media imported through the app is linked where it lies instead, never copied. |
|
||||
| \`cache/\` | Derived data (thumbnails, waveforms). Disposable, and not checked in. |
|
||||
|
||||
## Authoring
|
||||
@ -599,10 +683,6 @@ export default function Project() {
|
||||
and the gradient paints, \`<stroke>\`, \`<shadow>\`, \`<effect>\`.
|
||||
- \`src\` takes a library path (\`"b-roll/drone.mp4"\` — the portable form, it
|
||||
survives the file being relinked), an asset id, a URL, or an absolute path.
|
||||
- Generated assets are declared rather than fetched: \`src={generate.image({ prompt })}\`,
|
||||
and \`generate.video\`, \`generate.voice\`, \`generate.audio\`. They are produced on
|
||||
mount, in dependency order. \`diffusion context\` reports where each stands:
|
||||
generating, failed with the reason, or done with the asset path it landed as.
|
||||
- Solid is fully available while mounting: \`<For>\`, \`<Show>\`, \`createMemo\`, and
|
||||
\`useTicker()\` for values that follow the playhead.
|
||||
- npm packages work as they normally do. The folder is a real npm package, so
|
||||
@ -622,16 +702,14 @@ All of them talk to the running app, except \`fonts\`.
|
||||
| Script | Command | What it does |
|
||||
| ------ | ------- | ------------ |
|
||||
| \`open\` | \`diffusion open .\` | Launch the app with this project open. |
|
||||
| \`context\` | \`diffusion context\` | Which project the app has open, where its playhead sits, its fonts, where its generations stand. |
|
||||
| \`context\` | \`diffusion context\` | Which project the app has open, where its playhead sits, its fonts, its background mask tracks. |
|
||||
| \`capture\` | \`diffusion capture <id>\` | Render frames of a scene, as an export would, to labelled PNG contact sheets. |
|
||||
| \`probe\` | \`diffusion media probe <id\\|path>\` | Container and per-track metadata, without decoding. |
|
||||
| \`transcribe\` | \`diffusion media transcribe <id\\|path>\` | Timed speech transcript, word by word. |
|
||||
| \`grab\` | \`diffusion media grab <id\\|path>\` | Decode frames of a video to labelled PNG contact sheets. |
|
||||
| \`filmstrip\` | \`diffusion media filmstrip <id\\|path>\` | Thumbnail grid across a window of a video. |
|
||||
| \`waveform\` | \`diffusion media waveform <id\\|path>\` | Loudness over time, with the silences marked. |
|
||||
| \`listen\` | \`diffusion media listen <id\\|path>\` | Ask a multimodal model what is in an audio track. |
|
||||
| \`models\` | \`diffusion models [type]\` | Generation models and their per-model constraints. |
|
||||
| \`voices\` | \`diffusion voices\` | Speech voices for \`generate.voice\`. |
|
||||
| \`probe\` | \`diffusion probe <id\\|path>\` | Container and per-track metadata, without decoding. |
|
||||
| \`transcribe\` | \`diffusion transcribe <id\\|path>\` | Timed speech transcript, word by word. |
|
||||
| \`grab\` | \`diffusion grab <id\\|path>\` | Decode frames of a video to labelled PNG contact sheets. |
|
||||
| \`filmstrip\` | \`diffusion filmstrip <id\\|path>\` | Thumbnail grid across a window of a video. |
|
||||
| \`waveform\` | \`diffusion waveform <id\\|path>\` | Loudness over time, with the silences marked. |
|
||||
| \`listen\` | \`diffusion listen <id\\|path>\` | Ask a multimodal model what is in an audio track. |
|
||||
| \`fonts\` | \`diffusion fonts\` | Google Fonts and local font families, valid as \`fontFamily\`. |
|
||||
| \`logs\` | \`diffusion logs\` | Recent console output from the app. |
|
||||
| \`screenshot\` | \`diffusion screenshot\` | The whole app window as a PNG. |
|
||||
@ -639,7 +717,7 @@ All of them talk to the running app, except \`fonts\`.
|
||||
|
||||
## Reference
|
||||
|
||||
- [JSX reference](https://github.com/diffusionstudio/editor/blob/main/docs/reference/jsx/README.md): elements, timing, paints, generation, captions
|
||||
- [JSX reference](https://github.com/diffusionstudio/editor/blob/main/docs/reference/jsx/README.md): elements, timing, paints, captions
|
||||
- [Tool reference](https://github.com/diffusionstudio/editor/blob/main/docs/reference/tools/README.md): every tool and command, its options and its output
|
||||
- [Examples](https://github.com/diffusionstudio/editor/tree/main/docs/examples): runnable compositions to read
|
||||
`;
|
||||
@ -749,82 +827,59 @@ export async function initProject(window: BrowserWindow | null, dir: string): Pr
|
||||
return project;
|
||||
}
|
||||
|
||||
/** What a new project is called until it is saved under a name of the user's. */
|
||||
const DRAFT_NAME = "Untitled";
|
||||
|
||||
/**
|
||||
* Creates a fresh project folder under `root`, named after `displayName`. A
|
||||
* taken name is numbered rather than refused: the folder is a label, the id
|
||||
* inside it is the project.
|
||||
* Creates a fresh project as a draft: a folder in `draftsRoot` named after
|
||||
* the id it is given here, so creating one asks nothing. `saveProject` is
|
||||
* what gives it a place and a name of the user's choosing.
|
||||
*/
|
||||
export async function createProject(root: string, displayName: string): Promise<ProjectInfo> {
|
||||
const dir = join(root, await freeFolder(root, folderName(displayName)));
|
||||
export async function createProject(): Promise<ProjectInfo> {
|
||||
const id = nanoid();
|
||||
const dir = join(draftsRoot(), id);
|
||||
await mkdir(dir, { recursive: true });
|
||||
await scaffold(dir, displayName);
|
||||
// The record first, so the scaffold keeps the id the folder is named after.
|
||||
await writePackage(dir, { ...packageJson(DRAFT_NAME, DRAFT_NAME), projectId: id });
|
||||
await scaffold(dir, DRAFT_NAME);
|
||||
const project = await describe(dir);
|
||||
if (!project) throw new Error("Failed to scaffold the project.");
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renames the project: the human name in the record, and the folder with it,
|
||||
* so what the user sees in Finder keeps matching what they see in the app.
|
||||
* This is the only thing here that moves a folder — nothing syncs the two
|
||||
* behind the user's back — and it costs the project neither its identity nor
|
||||
* its links, both of which are the id.
|
||||
* Renames the project: the human name in the record, and nothing else. The
|
||||
* folder keeps its name — moving it is the user's to do, by hand — and the id
|
||||
* the project goes by is untouched either way.
|
||||
*/
|
||||
export async function renameProject(dir: string, displayName: string): Promise<ProjectInfo> {
|
||||
const pkg = (await readPackage(dir)) ?? packageJson(basename(dir), displayName);
|
||||
const name = displayName.trim() || basename(dir);
|
||||
await writePackage(dir, { ...pkg, displayName: name });
|
||||
await writePackage(dir, { ...pkg, displayName: displayName.trim() || basename(dir) });
|
||||
|
||||
const project = await describe(await renameFolder(dir, name));
|
||||
const project = await describe(dir);
|
||||
if (!project) throw new Error("Not a project folder.");
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the project folder to match `displayName`; answers where it ended up.
|
||||
* Best effort by design: the folder can be locked, open elsewhere, or on a
|
||||
* volume that will not have it, and none of that should cost the user the
|
||||
* name they just typed.
|
||||
* Copies the folder next to itself as `<name>-copy` (numbered when taken); a
|
||||
* draft's copy is a draft too, named after its own id.
|
||||
*/
|
||||
async function renameFolder(dir: string, displayName: string): Promise<string> {
|
||||
const root = dirname(dir);
|
||||
const base = folderName(displayName);
|
||||
const current = basename(dir);
|
||||
// Already named after it, numbered suffix and all: moving `my-clip-2` to
|
||||
// `my-clip` (or to `my-clip-3`) shuffles folders that are equally right.
|
||||
if (current === base || (current.startsWith(`${base}-`) && /^\d+$/.test(current.slice(base.length + 1)))) {
|
||||
return dir;
|
||||
}
|
||||
|
||||
try {
|
||||
const target = join(root, await freeFolder(root, base));
|
||||
// The watcher holds the old path, and the renderer re-watches the new one
|
||||
// as soon as it hears where the project went.
|
||||
unwatchProject(dir);
|
||||
await rename(dir, target);
|
||||
return target;
|
||||
} catch {
|
||||
return dir;
|
||||
}
|
||||
}
|
||||
|
||||
/** Copies the folder next to itself as `<name>-copy` (numbered when taken). */
|
||||
export async function duplicateProject(dir: string): Promise<ProjectInfo> {
|
||||
const source = await describe(dir);
|
||||
if (!source) throw new Error("Not a project folder.");
|
||||
|
||||
const id = nanoid();
|
||||
const root = dirname(dir);
|
||||
const target = join(root, await freeFolder(root, `${source.name}-copy`));
|
||||
const target = source.draft ? join(root, id) : join(root, await freeFolder(root, `${source.name}-copy`));
|
||||
|
||||
await cp(dir, target, { recursive: true, errorOnExist: true, force: false });
|
||||
// The record came along with everything else, id included, and two folders
|
||||
// answering to one id is the thing the id exists to prevent. The folder is
|
||||
// already named for the copy, so the record is written here rather than
|
||||
// through `renameProject` (which would move it again).
|
||||
// answering to one id is the thing the id exists to prevent.
|
||||
const pkg = await readPackage(target);
|
||||
await writePackage(target, {
|
||||
...(pkg ?? packageJson(basename(target), source.displayName)),
|
||||
projectId: nanoid(),
|
||||
projectId: id,
|
||||
displayName: `${source.displayName} (Copy)`,
|
||||
});
|
||||
const project = await describe(target);
|
||||
@ -832,11 +887,61 @@ export async function duplicateProject(dir: string): Promise<ProjectInfo> {
|
||||
return project;
|
||||
}
|
||||
|
||||
/** Moves the folder to the trash; resolves with the id it had ("" for none), for what is kept outside it. */
|
||||
/**
|
||||
* Saves the draft in `dir` as `target`: moves its folder there and names the
|
||||
* project after it — the name the user typed in the save picker, which is
|
||||
* the draft's own unless they changed it. Writes still on their way into the
|
||||
* draft land first; whoever has it open lets go of the folder before asking
|
||||
* (see `ProjectProvider` in the web app), and opens it again where it went.
|
||||
*/
|
||||
export async function saveProject(dir: string, target: string): Promise<ProjectInfo> {
|
||||
if (!isDraft(dir)) throw new Error("This project is saved already.");
|
||||
await moveFolder(dir, target);
|
||||
return renameProject(target, basename(target));
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the saved project in `dir` to `target`, as saving moves a draft —
|
||||
* but it keeps its name, which is the user's already. A draft is saved
|
||||
* rather than moved.
|
||||
*/
|
||||
export async function moveProject(dir: string, target: string): Promise<ProjectInfo> {
|
||||
if (isDraft(dir)) throw new Error("Save the draft instead of moving it.");
|
||||
await moveFolder(dir, target);
|
||||
const project = await describe(target);
|
||||
if (!project) throw new Error("Failed to move the project.");
|
||||
return project;
|
||||
}
|
||||
|
||||
/** Moves the project folder `dir` to `target`, once whatever is on its way into it has landed. */
|
||||
async function moveFolder(dir: string, target: string): Promise<void> {
|
||||
if (!isAbsolute(target)) throw new Error(`The project folder must be an absolute path (got "${target}").`);
|
||||
const problem = await saveProblem(dir, target);
|
||||
if (problem) throw new Error(problem);
|
||||
|
||||
await settleWrites(dir);
|
||||
unwatchProject(dir);
|
||||
await mkdir(dirname(target), { recursive: true });
|
||||
try {
|
||||
await rename(dir, target);
|
||||
} catch (error) {
|
||||
// Another volume: there is no moving a folder there, only copying it.
|
||||
if ((error as NodeJS.ErrnoException).code !== "EXDEV") throw error;
|
||||
await cp(dir, target, { recursive: true, errorOnExist: true, force: false });
|
||||
await rm(dir, { recursive: true, force: true });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the folder to the trash; resolves with the id it had ("" for none), for what is kept outside it.
|
||||
* A folder that is already gone counts as deleted, so the project can still come off the list.
|
||||
*/
|
||||
export async function deleteProject(dir: string): Promise<string> {
|
||||
const id = recordedId(await readPackage(dir));
|
||||
unwatchProject(dir);
|
||||
await shell.trashItem(dir);
|
||||
if (await exists(dir)) {
|
||||
await shell.trashItem(dir);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
@ -911,6 +1016,11 @@ export async function compileProject(dir: string): Promise<CompileResult> {
|
||||
// of the scaffold is the dashboard's (see `initProject`).
|
||||
await ensureRecord(dir);
|
||||
|
||||
// Projects from before generation was removed declare assets the JSX can
|
||||
// no longer load; they are pointed at what those declarations produced.
|
||||
// Writes nothing to a project with nothing left to migrate.
|
||||
await migrateGenerations(sourceContext(dir), await readManifest(dir).catch(() => null));
|
||||
|
||||
// Names every element before it is numbered, so the ids this compile hands
|
||||
// the canvas are durable ones. A fully keyed project is not written to.
|
||||
await stampProject(sourceContext(dir));
|
||||
@ -952,13 +1062,47 @@ export async function compileProject(dir: string): Promise<CompileResult> {
|
||||
* (see `noteContent`).
|
||||
*/
|
||||
export async function writeProject(dir: string, edits: SourceEdit[]): Promise<WriteResult> {
|
||||
const finish = startWrite(dir);
|
||||
try {
|
||||
return await applyEdits(sourceContext(dir), edits);
|
||||
} catch (error) {
|
||||
return { skipped: edits.map(editLabel), error: error instanceof Error ? error.message : String(error) };
|
||||
} finally {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes into a project that have not finished yet, by folder. Saving a draft
|
||||
* moves its folder, and waits these out first (see `settleWrites`): one that
|
||||
* lost the race would fail, or put a file back in the folder that just left.
|
||||
* A write starts before its first await, so one asked for before the save is
|
||||
* always among them.
|
||||
*/
|
||||
const writes = new Map<string, Set<Promise<void>>>();
|
||||
|
||||
/** Marks a write into `dir` as running; call what it returns when the write is done. */
|
||||
function startWrite(dir: string): () => void {
|
||||
let release!: () => void;
|
||||
const done = new Promise<void>((resolve) => (release = resolve));
|
||||
const running = writes.get(dir) ?? new Set<Promise<void>>();
|
||||
writes.set(dir, running);
|
||||
running.add(done);
|
||||
|
||||
return () => {
|
||||
release();
|
||||
running.delete(done);
|
||||
if (!running.size && writes.get(dir) === running) {
|
||||
writes.delete(dir);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** Settles once every write into `dir` asked for so far has, however it went. */
|
||||
async function settleWrites(dir: string): Promise<void> {
|
||||
await Promise.allSettled([...(writes.get(dir) ?? []), configWrites.get(dir)]);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Assets
|
||||
|
||||
@ -994,11 +1138,16 @@ export async function readManifest(dir: string): Promise<unknown> {
|
||||
* claimed first so the watcher does not hand it back as a change.
|
||||
*/
|
||||
export async function writeManifest(dir: string, manifest: unknown): Promise<void> {
|
||||
const path = join(dir, MANIFEST_FILE);
|
||||
const text = `# Diffusion Studio asset library. Edited by the app; hand edits are read on the next load.
|
||||
const finish = startWrite(dir);
|
||||
try {
|
||||
const path = join(dir, MANIFEST_FILE);
|
||||
const text = `# Diffusion Studio asset library. Edited by the app; hand edits are read on the next load.
|
||||
${stringifyYaml(manifest, { lineWidth: 0 })}`;
|
||||
noteContent(path, text);
|
||||
await writeFileAtomic(path, text);
|
||||
noteContent(path, text);
|
||||
await writeFileAtomic(path, text);
|
||||
} finally {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@ -1013,17 +1162,37 @@ export async function readConfig(dir: string): Promise<unknown> {
|
||||
return pkg?.[CONFIG_FIELD] ?? null;
|
||||
}
|
||||
|
||||
/** Settles when the config write last asked for is done, by project. */
|
||||
const configWrites = new Map<string, Promise<void>>();
|
||||
|
||||
/**
|
||||
* Replaces the project's config in its package.json (removes the field for
|
||||
* null), leaving the rest of the record alone. The watcher is told to keep
|
||||
* quiet about it, like the manifest: the app already shows these values.
|
||||
*
|
||||
* One at a time, in the order asked: each reads the record the last one left,
|
||||
* and the file ends up holding the config the app was given last rather than
|
||||
* whichever write happened to finish last.
|
||||
*/
|
||||
export async function writeConfig(dir: string, config: unknown): Promise<void> {
|
||||
const pkg = (await readPackage(dir)) ?? packageJson(basename(dir), basename(dir));
|
||||
const next: PackageJson = { ...pkg };
|
||||
if (config === null || config === undefined) delete next[CONFIG_FIELD];
|
||||
else next[CONFIG_FIELD] = config;
|
||||
await writePackage(dir, next);
|
||||
const previous = configWrites.get(dir);
|
||||
let release!: () => void;
|
||||
const done = new Promise<void>((resolve) => (release = resolve));
|
||||
configWrites.set(dir, done);
|
||||
|
||||
try {
|
||||
await previous;
|
||||
const pkg = (await readPackage(dir)) ?? packageJson(basename(dir), basename(dir));
|
||||
const next: PackageJson = { ...pkg };
|
||||
if (config === null || config === undefined) delete next[CONFIG_FIELD];
|
||||
else next[CONFIG_FIELD] = config;
|
||||
await writePackage(dir, next);
|
||||
} finally {
|
||||
release();
|
||||
if (configWrites.get(dir) === done) {
|
||||
configWrites.delete(dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Entries of a directory; [] when it is missing or not a directory. */
|
||||
@ -1121,8 +1290,8 @@ const watchers = new Map<string, FSWatcher>();
|
||||
|
||||
/**
|
||||
* What the app believes is on disk, by absolute path: a digest of the content
|
||||
* of every file it has written, and of every change it has already been told
|
||||
* about. The watcher stays on — anything else may be editing these files, and
|
||||
* of every file whose write has been answered for (see `claimed`), and of
|
||||
* every change it has already been told about. The watcher stays on — anything else may be editing these files, and
|
||||
* should still reach the canvas — but the app's own writes must not come back
|
||||
* as a change, or every key stamp and every dragged rect would cost a
|
||||
* recompile and a remount of the scene the user is looking at.
|
||||
@ -1136,6 +1305,36 @@ const watchers = new Map<string, FSWatcher>();
|
||||
*/
|
||||
const known = new Map<string, string>();
|
||||
|
||||
/**
|
||||
* Writes claimed that no event has answered for yet, oldest first, by absolute
|
||||
* path. More than one at a time: a slider writes the config on every move, so
|
||||
* the next write is claimed before the event for the last one is answered,
|
||||
* and that event must still be recognized as ours. One that matches settles
|
||||
* every claim made before it, which can no longer land after it.
|
||||
*/
|
||||
const claimed = new Map<string, string[]>();
|
||||
|
||||
/** Claims kept per path; past this the oldest is taken to have been answered. */
|
||||
const CLAIMS_MAX = 32;
|
||||
|
||||
function claim(path: string, digest: string): void {
|
||||
const claims = claimed.get(path) ?? [];
|
||||
claims.push(digest);
|
||||
if (claims.length > CLAIMS_MAX) claims.shift();
|
||||
claimed.set(path, claims);
|
||||
}
|
||||
|
||||
/** Whether `current` is what a claimed write put at `path`; settles it if so. */
|
||||
function settleClaim(path: string, current: string): boolean {
|
||||
const claims = claimed.get(path);
|
||||
const index = claims?.indexOf(current) ?? -1;
|
||||
if (index < 0) return false;
|
||||
claims!.splice(0, index + 1);
|
||||
if (!claims!.length) claimed.delete(path);
|
||||
known.set(path, current);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Digests for what has no content: a file that is not there, and a folder. */
|
||||
const ABSENT = "";
|
||||
const FOLDER = "folder";
|
||||
@ -1172,9 +1371,9 @@ async function digestOf(path: string): Promise<string> {
|
||||
* round, and self-correcting either way.
|
||||
*/
|
||||
export function noteContent(path: string, text: string | null): void {
|
||||
if (text === null) known.set(path, ABSENT);
|
||||
if (text === null) claim(path, ABSENT);
|
||||
else if (Buffer.byteLength(text) > DIGEST_MAX) known.delete(path);
|
||||
else known.set(path, digest(text));
|
||||
else claim(path, digest(text));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1188,9 +1387,12 @@ export function noteContent(path: string, text: string | null): void {
|
||||
* exactly what an event will find at `as`.
|
||||
*/
|
||||
export async function noteRenamed(temp: string, as: string): Promise<void> {
|
||||
known.set(as, await digestOf(temp));
|
||||
claim(as, await digestOf(temp));
|
||||
}
|
||||
|
||||
/** The files a change to which counts as code being written, for analytics. */
|
||||
const SOURCE_FILE = /\.[cm]?[jt]sx?$/;
|
||||
|
||||
export function watchProject(window: BrowserWindow | null, dir: string): void {
|
||||
if (watchers.has(dir)) return;
|
||||
|
||||
@ -1202,6 +1404,11 @@ export function watchProject(window: BrowserWindow | null, dir: string): void {
|
||||
|
||||
const watcher = watch(dir, { recursive: true }, (_event, filename) => {
|
||||
if (!filename) return;
|
||||
// macOS's recursive FSEvents watch fires an extra notification for the
|
||||
// watched folder itself alongside the real one for whatever changed
|
||||
// inside it — and again once more, asynchronously, after the folder is
|
||||
// removed and the watcher closed. Neither names an actual project file.
|
||||
if (filename === basename(dir)) return;
|
||||
// Project-relative and `/`-separated; installs churn node_modules constantly.
|
||||
const path = filename.split(sep).join("/");
|
||||
if (path.startsWith("node_modules/") || path === "node_modules") return;
|
||||
@ -1214,8 +1421,10 @@ export function watchProject(window: BrowserWindow | null, dir: string): void {
|
||||
queue = queue
|
||||
.then(async () => {
|
||||
const current = await digestOf(file);
|
||||
if (known.get(file) === current) return;
|
||||
if (settleClaim(file, current) || known.get(file) === current) return;
|
||||
known.set(file, current);
|
||||
if (SOURCE_FILE.test(path) && current !== ABSENT) countCodeChange(path);
|
||||
|
||||
mainBridge.emit(window, MAIN_CHANNELS.PROJECTS_CHANGED, { dir, path });
|
||||
})
|
||||
.catch(() => { });
|
||||
@ -1231,6 +1440,7 @@ export function unwatchProject(dir: string): void {
|
||||
// remember: the next watch starts from a fresh load of the project anyway.
|
||||
const prefix = dir.endsWith(sep) ? dir : dir + sep;
|
||||
for (const path of known.keys()) if (path.startsWith(prefix)) known.delete(path);
|
||||
for (const path of claimed.keys()) if (path.startsWith(prefix)) claimed.delete(path);
|
||||
}
|
||||
|
||||
export function unwatchAll(): void {
|
||||
|
||||
@ -21,7 +21,7 @@ vi.mock("electron", () => ({
|
||||
ipcMain: { on: () => { } },
|
||||
}));
|
||||
|
||||
const { noteContent, noteRenamed, unwatchProject, watchProject, writeManifest } = await import("./projects");
|
||||
const { noteContent, noteRenamed, readConfig, unwatchProject, watchProject, writeConfig, writeManifest } = await import("./projects");
|
||||
|
||||
let dir: string;
|
||||
let changed: string[] = [];
|
||||
@ -181,4 +181,37 @@ describe("watchProject", () => {
|
||||
await settle();
|
||||
expect(changed).toEqual([]);
|
||||
});
|
||||
|
||||
// A slider in the export settings writes the config on every move, so the
|
||||
// next write is claimed before the event for the last one is answered.
|
||||
it("says nothing about config writes that overlap, and keeps the last", async () => {
|
||||
await writeFile(join(dir, "package.json"), `${JSON.stringify({ name: "p" }, null, 2)}\n`, "utf8");
|
||||
await waitFor("package.json");
|
||||
|
||||
changed = [];
|
||||
const writes: Promise<void>[] = [];
|
||||
for (let bitrate = 1; bitrate <= 40; bitrate++) {
|
||||
writes.push(writeConfig(dir, { export: { intro: { video: { bitrate } } } }));
|
||||
await settle(8);
|
||||
}
|
||||
await Promise.all(writes);
|
||||
|
||||
await settle();
|
||||
expect(changed).toEqual([]);
|
||||
expect(await readConfig(dir)).toEqual({ export: { intro: { video: { bitrate: 40 } } } });
|
||||
});
|
||||
|
||||
it("reports an outside edit that lands between two of the app's own", async () => {
|
||||
const file = join(dir, "index.tsx");
|
||||
noteContent(file, "ours\n");
|
||||
noteContent(file, "ours again\n");
|
||||
await writeFileAtomic(file, "ours\n");
|
||||
await writeFile(file, "theirs\n", "utf8");
|
||||
await waitFor("index.tsx");
|
||||
|
||||
changed = [];
|
||||
await writeFileAtomic(file, "ours again\n");
|
||||
await settle();
|
||||
expect(changed).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
@ -28,10 +28,12 @@ const COMPOSITION_COMPONENTS = new Map<string, string>(
|
||||
|
||||
// These composition names also exist in SVG. An SVG fragment is DOM content
|
||||
// only while it has an SVG container in the same JSX tree; elsewhere the tag
|
||||
// keeps its composition meaning.
|
||||
const AMBIGUOUS_SVG_TAGS: ReadonlySet<string> = new Set(["rect", "text", "image"]);
|
||||
// keeps its composition meaning. `<mask>` and `<clipPath>` are SVG containers
|
||||
// too, but as such they only ever sit in an `<svg>`, so they are not counted
|
||||
// as one: a composition `<mask>` keeps the shapes under it composition ones.
|
||||
const AMBIGUOUS_SVG_TAGS: ReadonlySet<string> = new Set(["rect", "ellipse", "polygon", "path", "text", "image", "mask", "clipPath"]);
|
||||
const SVG_CONTAINERS: ReadonlySet<string> = new Set([
|
||||
"svg", "g", "defs", "symbol", "marker", "mask", "clipPath", "pattern",
|
||||
"svg", "g", "defs", "symbol", "marker", "pattern",
|
||||
"filter", "linearGradient", "radialGradient", "textPath", "tspan", "switch",
|
||||
]);
|
||||
|
||||
|
||||
@ -6,10 +6,12 @@ import { EventEmitter } from "node:events";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const appEvents = new EventEmitter();
|
||||
const updaterEvents = new EventEmitter();
|
||||
const dock = { show: vi.fn(async () => { }), hide: vi.fn() };
|
||||
|
||||
vi.mock("electron", () => ({
|
||||
app: { on: (event: string, listener: () => void) => appEvents.on(event, listener), dock, focus: () => { } },
|
||||
autoUpdater: { on: (event: string, listener: () => void) => updaterEvents.on(event, listener) },
|
||||
}));
|
||||
|
||||
const { WindowHost } = await import("./window-host");
|
||||
@ -45,6 +47,7 @@ let host: InstanceType<typeof WindowHost>;
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers();
|
||||
appEvents.removeAllListeners();
|
||||
updaterEvents.removeAllListeners();
|
||||
created = [];
|
||||
host = new WindowHost({
|
||||
create: () => {
|
||||
@ -132,4 +135,11 @@ describe("WindowHost", () => {
|
||||
expect(created[0]!.isDestroyed()).toBe(true);
|
||||
expect(host.current()).toBeNull();
|
||||
});
|
||||
|
||||
it("lets the window close when an update quits the app to install", async () => {
|
||||
await host.show();
|
||||
updaterEvents.emit("before-quit-for-update");
|
||||
created[0]!.close();
|
||||
expect(created[0]!.isDestroyed()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
// the Dock icon (macOS) follows whether the window is showing, and closing
|
||||
// the window hides it rather than ending what the renderer is doing.
|
||||
|
||||
import { app } from "electron";
|
||||
import { app, autoUpdater } from "electron";
|
||||
|
||||
import type { BrowserWindow } from "electron";
|
||||
|
||||
@ -47,6 +47,11 @@ export class WindowHost {
|
||||
app.on("before-quit", () => {
|
||||
this.quitting = true;
|
||||
});
|
||||
// quitAndInstall closes the windows before `before-quit`; a close turned
|
||||
// into a hide there would leave the app running and the update unapplied.
|
||||
autoUpdater.on("before-quit-for-update", () => {
|
||||
this.quitting = true;
|
||||
});
|
||||
}
|
||||
|
||||
/** The window, if there is one. */
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
VITE_SUPABASE_URL=https://mpvhvyxuqfcemfnwiaiq.supabase.co
|
||||
VITE_SUPABASE_ANON_KEY=sb_publishable_V-K9coUWXVy8dsZPGKDw-g_d1JzJf8u
|
||||
|
||||
VITE_UMAMI_WEBSITE_ID=e898e381-6ce3-4f5f-a485-8327ec9aa88b
|
||||
VITE_UMAMI_SCRIPT_URL=https://cloud.umami.is/script.js
|
||||
VITE_UMAMI_DOMAINS=diffusion.studio,app.diffusion.studio
|
||||
|
||||
VITE_API_URL=https://api.diffusion.studio
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@diffusionstudio/web",
|
||||
"private": true,
|
||||
"version": "0.209.0",
|
||||
"version": "0.216.0",
|
||||
"license": "MPL-2.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@ -14,7 +14,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@diffusionstudio/agent-chat": "*",
|
||||
"@diffusionstudio/api-contract": "^0.1.0",
|
||||
"@diffusionstudio/api-contract": "^0.5.0",
|
||||
"@diffusionstudio/assets": "*",
|
||||
"@diffusionstudio/dapi": "*",
|
||||
"@diffusionstudio/encoder": "*",
|
||||
@ -30,8 +30,8 @@
|
||||
"@solid-primitives/resize-observer": "^2.1.3",
|
||||
"@solidjs/router": "^0.15.4",
|
||||
"@supabase/supabase-js": "^2.99.2",
|
||||
"@trpc/client": "^11.10.0",
|
||||
"@trpc/server": "^11.10.0",
|
||||
"@trpc/client": "^11.19.0",
|
||||
"@trpc/server": "^11.19.0",
|
||||
"animejs": "^4.4.1",
|
||||
"cmdk-solid": "^1.1.2",
|
||||
"colord": "^2.9.3",
|
||||
|
||||
@ -2,28 +2,31 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Dropping files and folders onto a composer. Nothing is read, copied or
|
||||
// uploaded: an attachment is a path the agent reads where it is, so drops
|
||||
// only work where the shell can say where a file lives (the desktop app).
|
||||
// Shared by the home view and the chat composer.
|
||||
|
||||
import { Show, createSignal } from "solid-js";
|
||||
import { toast } from "somoto";
|
||||
|
||||
import { pickFiles } from "@diffusionstudio/assets";
|
||||
|
||||
import { Icon } from "@/components/ui/icon";
|
||||
import { RemoveButton } from "@/components/ui/remove-button";
|
||||
import { cx } from "@/lib/cva";
|
||||
|
||||
import { client, hasHost } from "./connection";
|
||||
|
||||
/**
|
||||
* A file or folder dropped onto a composer. Only what the tile and the
|
||||
* handoff need: the name to label it, the kind and extension to draw it, and
|
||||
* the path to send — null off the desktop, where the browser will not say
|
||||
* where a dropped file lives.
|
||||
* where a dropped file lives. An image picked, dropped or pasted also carries
|
||||
* an object URL for its thumbnail; one rebuilt from a path does not.
|
||||
*/
|
||||
export type Attachment = {
|
||||
key: string;
|
||||
name: string;
|
||||
kind: "file" | "folder";
|
||||
path: string | null;
|
||||
preview?: string;
|
||||
};
|
||||
|
||||
/** The paths worth sending: attachments the shell could locate. */
|
||||
@ -52,19 +55,81 @@ export function droppedAttachments(event: DragEvent): Attachment[] {
|
||||
const file = item.getAsFile();
|
||||
if (!file) continue;
|
||||
|
||||
const path = window.desktop?.getPathForFile(file) || null;
|
||||
const name = entry?.name || file.name;
|
||||
result.push({
|
||||
key: path ?? `${name}:${file.size}:${file.lastModified}`,
|
||||
name,
|
||||
kind: entry?.isDirectory ? "folder" : "file",
|
||||
path,
|
||||
});
|
||||
result.push(fileAttachment(file, entry?.isDirectory ? "folder" : "file", entry?.name || file.name));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/** A file picked or dropped without the entry API, which only a drop has. */
|
||||
function fileAttachment(file: File, kind: Attachment["kind"] = "file", name = file.name, path = window.desktop?.getPathForFile(file) || null): Attachment {
|
||||
const preview = kind === "file" && file.type.startsWith("image/") ? URL.createObjectURL(file) : undefined;
|
||||
return { key: path ?? `${name}:${file.size}:${file.lastModified}`, name, kind, path, ...(preview ? { preview } : {}) };
|
||||
}
|
||||
|
||||
/**
|
||||
* The files on the clipboard. None when the paste is text: rich text from a
|
||||
* document app carries a picture of itself alongside, and that is not what
|
||||
* the user meant to paste.
|
||||
*/
|
||||
function pastedFiles(event: ClipboardEvent): File[] {
|
||||
const data = event.clipboardData;
|
||||
if (!data || data.types.includes("text/rtf")) return [];
|
||||
return Array.from(data.files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pasted files as attachments. A file copied in the Finder has a path and is
|
||||
* sent as it is; a screenshot or an image copied from a page is only bytes,
|
||||
* so it is uploaded to the agent host, which may not share this disk, and
|
||||
* the path it was written to is what gets sent.
|
||||
*/
|
||||
async function pastedAttachments(files: File[]): Promise<Attachment[]> {
|
||||
return Promise.all(
|
||||
files.map(async (file) => {
|
||||
const path = window.desktop?.getPathForFile(file) || null;
|
||||
if (path) return file.type.startsWith("image/") ? fileAttachment(file, "file", file.name, path) : attachmentFromPath(path);
|
||||
if (!hasHost()) return fileAttachment(file);
|
||||
const saved = await client.request("attachments.upload", { name: file.name, data: await base64(file) });
|
||||
return fileAttachment(file, "file", file.name, saved.path);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
/** A file's bytes as base64, without the data URL's prefix. */
|
||||
function base64(file: File): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
const url = reader.result as string;
|
||||
resolve(url.slice(url.indexOf(",") + 1));
|
||||
};
|
||||
reader.onerror = () => reject(reader.error);
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A paste handler for a composer: files go to `onPaste`, text is left to the
|
||||
* textarea. A paste that fails to save is a toast, not a lost image.
|
||||
*/
|
||||
export function createPasteHandler(onPaste: (pasted: Attachment[]) => void) {
|
||||
return (event: ClipboardEvent) => {
|
||||
const files = pastedFiles(event);
|
||||
if (files.length === 0) return;
|
||||
event.preventDefault();
|
||||
pastedAttachments(files).then(onPaste, (error: Error) =>
|
||||
toast.error("Could not paste the file", { description: error.message }),
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
/** Files chosen from the system picker, as attachments; folders can only be dropped. */
|
||||
export async function pickAttachments(): Promise<Attachment[]> {
|
||||
const files = await pickFiles({ accept: "" });
|
||||
return files.map((file) => fileAttachment(file));
|
||||
}
|
||||
|
||||
/** The same file dropped twice is one attachment, not two tiles. */
|
||||
export function mergeAttachments(current: Attachment[], dropped: Attachment[]): Attachment[] {
|
||||
const known = new Set(current.map((entry) => entry.key));
|
||||
@ -134,7 +199,7 @@ export function DropOverlay(props: { radius?: string }) {
|
||||
shape-rendering="crispEdges"
|
||||
/>
|
||||
</svg>
|
||||
<Icon name="attachment" class="size-6 text-muted-foreground" />
|
||||
<Icon name="attachment" class="text-muted-foreground" />
|
||||
<span class="text-xs font-450 text-muted-foreground">Drop files or folders here</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -148,9 +213,9 @@ type AttachmentTileProps = {
|
||||
};
|
||||
|
||||
/**
|
||||
* One dropped file or folder: a grey square with a folder mark, or the file's
|
||||
* type in the middle. There is no thumbnail to show — nothing is loaded — so
|
||||
* the name is in the tooltip and the remove button appears on hover, as it
|
||||
* One attached file or folder: the image itself when there is one to show,
|
||||
* else a grey square with a folder mark, or the file's type in the middle.
|
||||
* The name is in the tooltip and the remove button appears on hover, as it
|
||||
* does on the generation composer's reference images.
|
||||
*/
|
||||
export function AttachmentTile(props: AttachmentTileProps) {
|
||||
@ -161,14 +226,21 @@ export function AttachmentTile(props: AttachmentTileProps) {
|
||||
>
|
||||
<div class="grid size-full place-items-center overflow-hidden rounded-lg bg-input text-muted-foreground">
|
||||
<Show
|
||||
when={props.attachment.kind === "folder"}
|
||||
when={props.attachment.preview}
|
||||
fallback={
|
||||
<span class="max-w-9 truncate px-0.5 text-[9px] font-450 uppercase tracking-wide">
|
||||
{fileType(props.attachment.name)}
|
||||
</span>
|
||||
<Show
|
||||
when={props.attachment.kind === "folder"}
|
||||
fallback={
|
||||
<span class="max-w-9 truncate px-0.5 text-[9px] font-450 uppercase tracking-wide">
|
||||
{fileType(props.attachment.name)}
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<Icon name="navigation.folder" />
|
||||
</Show>
|
||||
}
|
||||
>
|
||||
<Icon name="navigation.folder" class="size-6" />
|
||||
{(src) => <img src={src()} alt="" draggable={false} class="size-full object-cover" />}
|
||||
</Show>
|
||||
</div>
|
||||
<RemoveButton
|
||||
|
||||
@ -8,11 +8,12 @@
|
||||
|
||||
import { For, Show, createEffect } from "solid-js";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Icon } from "@/components/ui/icon";
|
||||
|
||||
import type { ModelRef } from "@diffusionstudio/agent-chat";
|
||||
|
||||
import { AttachmentTile, DropOverlay, createDropZone, mergeAttachments, type Attachment } from "./attachments";
|
||||
import { AttachmentTile, DropOverlay, createDropZone, createPasteHandler, mergeAttachments, pickAttachments, type Attachment } from "./attachments";
|
||||
import { ModelPicker } from "./model-picker";
|
||||
|
||||
const MAX_HEIGHT_PX = 160;
|
||||
@ -37,7 +38,9 @@ type ComposerProps = {
|
||||
export function Composer(props: ComposerProps) {
|
||||
let textarea: HTMLTextAreaElement | undefined;
|
||||
|
||||
const drop = createDropZone((dropped) => props.onAttachments(mergeAttachments(props.attachments, dropped)));
|
||||
const attach = (added: Attachment[]) => props.onAttachments(mergeAttachments(props.attachments, added));
|
||||
const drop = createDropZone(attach);
|
||||
const paste = createPasteHandler(attach);
|
||||
|
||||
const canSend = () => !props.running && !props.blocked && props.model !== null && (props.text.trim().length > 0 || props.attachments.length > 0);
|
||||
|
||||
@ -52,6 +55,16 @@ export function Composer(props: ComposerProps) {
|
||||
resize();
|
||||
});
|
||||
|
||||
// The panel mounts whenever the Chat tab comes up: land in the box, ready
|
||||
// to type. It may still be disabled while the host connects, and a disabled
|
||||
// box can't take focus — so focus it the first time it is enabled.
|
||||
let focused = false;
|
||||
createEffect(() => {
|
||||
if (focused || props.blocked !== null) return;
|
||||
focused = true;
|
||||
textarea?.focus();
|
||||
});
|
||||
|
||||
// Enter sends, shift+enter breaks the line — and the editor's shortcuts
|
||||
// have no business reading what is typed here. While a turn runs Enter
|
||||
// does nothing: there is no queue.
|
||||
@ -71,6 +84,7 @@ export function Composer(props: ComposerProps) {
|
||||
onDragEnter={drop.onDragEnter}
|
||||
onDragLeave={drop.onDragLeave}
|
||||
onDrop={drop.onDrop}
|
||||
onPaste={paste}
|
||||
>
|
||||
<Show when={props.attachments.length > 0}>
|
||||
{/* The remove buttons overhang the tiles' corners, and a scrolling
|
||||
@ -91,6 +105,7 @@ export function Composer(props: ComposerProps) {
|
||||
|
||||
<textarea
|
||||
ref={textarea}
|
||||
data-chat-composer
|
||||
value={props.text}
|
||||
onInput={(event) => props.onText(event.currentTarget.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
@ -99,36 +114,48 @@ export function Composer(props: ComposerProps) {
|
||||
placeholder={props.blocked ?? "Do anything"}
|
||||
disabled={props.blocked !== null}
|
||||
rows={1}
|
||||
class="max-h-40 min-h-7 w-full resize-none overflow-auto bg-transparent p-1 text-[12px] leading-5 text-foreground outline-none placeholder:text-muted-foreground selection:bg-selection selection:text-selection-foreground disabled:cursor-default"
|
||||
class="max-h-40 min-h-7 w-full resize-none overflow-auto bg-transparent p-1 text-xs leading-5 text-foreground outline-none placeholder:text-muted-foreground selection:bg-selection selection:text-selection-foreground disabled:cursor-default"
|
||||
/>
|
||||
|
||||
<div class="flex min-h-4 items-center justify-between gap-1">
|
||||
<ModelPicker value={props.model} onSelect={props.onModel} class="min-w-0" />
|
||||
<Show
|
||||
when={props.running}
|
||||
fallback={
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-square"
|
||||
onClick={async () => attach(await pickAttachments())}
|
||||
aria-label="Add files"
|
||||
title="Add files"
|
||||
class="text-muted-foreground hover:bg-muted"
|
||||
>
|
||||
<Icon name="plus-add" />
|
||||
</Button>
|
||||
<div class="flex min-w-0 items-center gap-1.5">
|
||||
<ModelPicker value={props.model} onSelect={props.onModel} class="min-w-0" />
|
||||
<Show
|
||||
when={props.running}
|
||||
fallback={
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => canSend() && props.onSend()}
|
||||
disabled={!canSend()}
|
||||
aria-label="Send"
|
||||
title={sendTitle()}
|
||||
class="grid size-7 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground transition-opacity hover:bg-primary-hover disabled:pointer-events-none disabled:opacity-40 focus-ring"
|
||||
>
|
||||
<Icon name="arrow-top" />
|
||||
</button>
|
||||
}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => canSend() && props.onSend()}
|
||||
disabled={!canSend()}
|
||||
aria-label="Send"
|
||||
title={sendTitle()}
|
||||
class="grid size-7 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground transition-opacity hover:bg-primary-hover disabled:pointer-events-none disabled:opacity-40 focus-ring"
|
||||
onClick={props.onStop}
|
||||
aria-label="Stop"
|
||||
title="Stop"
|
||||
class="grid size-7 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground hover:bg-primary-hover focus-ring"
|
||||
>
|
||||
<Icon name="arrow-top" />
|
||||
<Icon name="stop" />
|
||||
</button>
|
||||
}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={props.onStop}
|
||||
aria-label="Stop"
|
||||
title="Stop"
|
||||
class="grid size-7 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground hover:bg-primary-hover focus-ring"
|
||||
>
|
||||
<Icon name="stop" />
|
||||
</button>
|
||||
</Show>
|
||||
</Show>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Show when={drop.dragging()}>
|
||||
|
||||
@ -33,7 +33,7 @@ export function HeaderActions(props: HeaderActionsProps) {
|
||||
>
|
||||
<Icon name="plus-add" />
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>New chat</TooltipContent>
|
||||
<TooltipContent shortcut="⇧⌘L">New chat</TooltipContent>
|
||||
</Tooltip>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -76,10 +76,10 @@ export function HistoryMenu(props: HistoryMenuProps) {
|
||||
{(chat) => (
|
||||
<DropdownMenuItem tone="neutral" class="group/row" onSelect={() => props.onOpen(chat.id)}>
|
||||
<Show when={chat.status === "running"}>
|
||||
<Icon name="spinner-loader" class="animate-spin size-6 -mr-1 shrink-0" />
|
||||
<Icon name="spinner-loader" class="animate-spin -mr-1 shrink-0" />
|
||||
</Show>
|
||||
<Show when={chat.status === "waiting"}>
|
||||
<Icon name="dot" class="size-6 -mr-1 shrink-0 text-primary" />
|
||||
<Icon name="dot" class="-mr-1 shrink-0 text-primary" />
|
||||
</Show>
|
||||
<span class="min-w-0 flex-1 truncate" title={chat.title}>
|
||||
{chat.title}
|
||||
@ -90,7 +90,7 @@ export function HistoryMenu(props: HistoryMenuProps) {
|
||||
</span>
|
||||
</Show>
|
||||
<Show when={chat.id === props.chatId}>
|
||||
<Icon name="confirm-check" class="size-6 -mr-1 shrink-0 group-hover/row:hidden" />
|
||||
<Icon name="confirm-check" class="-mr-1 shrink-0 group-hover/row:hidden" />
|
||||
</Show>
|
||||
<button
|
||||
type="button"
|
||||
@ -102,7 +102,7 @@ export function HistoryMenu(props: HistoryMenuProps) {
|
||||
>
|
||||
<Icon
|
||||
name="close-remove-small"
|
||||
class="absolute left-1/2 top-1/2 size-6 -translate-x-1/2 -translate-y-1/2 text-inherit!"
|
||||
class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-inherit!"
|
||||
/>
|
||||
</button>
|
||||
</DropdownMenuItem>
|
||||
|
||||
@ -26,7 +26,9 @@ export {
|
||||
DropOverlay,
|
||||
attachmentPaths,
|
||||
createDropZone,
|
||||
createPasteHandler,
|
||||
droppedAttachments,
|
||||
mergeAttachments,
|
||||
pickAttachments,
|
||||
type Attachment,
|
||||
} from "./attachments";
|
||||
|
||||
@ -55,7 +55,7 @@ export function ReasoningItem(props: { item: Of<"reasoning"> }) {
|
||||
aria-expanded={open()}
|
||||
onClick={() => expandable() && setOpen(!open())}
|
||||
>
|
||||
<Icon name={open() ? "chevron-down" : "chevron-right"} class="size-6" />
|
||||
<Icon name={open() ? "chevron-down" : "chevron-right"} />
|
||||
<span>Thinking</span>
|
||||
</button>
|
||||
<Show when={open()}>
|
||||
@ -80,13 +80,13 @@ export function ToolItem(props: { item: Of<"tool"> }) {
|
||||
onClick={() => expandable() && setOpen(!open())}
|
||||
>
|
||||
<Show when={props.item.status === "running"}>
|
||||
<Icon name="spinner-loader" class="size-6 shrink-0 animate-spin" />
|
||||
<Icon name="spinner-loader" class="shrink-0 animate-spin" />
|
||||
</Show>
|
||||
<Show when={props.item.status === "done"}>
|
||||
<Icon name="confirm-check" class="size-6 shrink-0" />
|
||||
<Icon name="confirm-check" class="shrink-0" />
|
||||
</Show>
|
||||
<Show when={props.item.status === "failed"}>
|
||||
<Icon name="close-remove-small" class="size-6 shrink-0 text-destructive" />
|
||||
<Icon name="close-remove-small" class="shrink-0 text-destructive" />
|
||||
</Show>
|
||||
<span class="shrink-0 font-450" classList={{ "agent-shimmer": props.item.status === "running" }}>
|
||||
{props.item.title}
|
||||
|
||||
@ -2,9 +2,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// One dropdown for harness and model: Claude Code's models, then Codex's,
|
||||
// fed by the host's probes. A harness that is not ready is one disabled row
|
||||
// that says why, never hidden, so the picker also says what this works with.
|
||||
// One dropdown for harness and model, two levels deep: Claude Code and
|
||||
// Codex first, each opening onto its models, fed by the host's probes. A
|
||||
// harness that is not ready is one disabled row that says why, never hidden,
|
||||
// so the picker also says what this works with.
|
||||
|
||||
import { For, Show } from "solid-js";
|
||||
|
||||
@ -12,13 +13,17 @@ import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuGroupLabel,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuItemDetail,
|
||||
DropdownMenuPortal,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuSub,
|
||||
DropdownMenuSubContent,
|
||||
DropdownMenuSubTrigger,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Icon } from "@/components/ui/icon";
|
||||
import { cx } from "@/lib/cva";
|
||||
|
||||
import type { HarnessId, HarnessInfo, ModelRef } from "@diffusionstudio/agent-chat";
|
||||
|
||||
@ -52,66 +57,69 @@ export function ModelPicker(props: ModelPickerProps) {
|
||||
const harnesses = () => chatState.harnesses;
|
||||
|
||||
return (
|
||||
<DropdownMenu placement="bottom-start" onOpenChange={(open) => open && refreshHarnesses()}>
|
||||
<DropdownMenu placement="bottom-end" onOpenChange={(open) => open && refreshHarnesses()}>
|
||||
<DropdownMenuTrigger
|
||||
as="button"
|
||||
type="button"
|
||||
as={Button}
|
||||
variant="ghost"
|
||||
aria-label="Choose the agent and model"
|
||||
class={`flex h-7 shrink-0 items-center rounded-md pl-0.5 pr-2 text-xs font-450 text-muted-foreground hover:bg-muted focus-ring ${props.class ?? ""}`}
|
||||
class={cx("text-muted-foreground hover:bg-muted data-[expanded]:bg-muted", props.class)}
|
||||
>
|
||||
<span class="grid size-6 shrink-0 place-items-center overflow-clip">
|
||||
<Icon name={harnessIcon(props.value?.harness)} />
|
||||
</span>
|
||||
<span class="max-w-40 truncate">{modelLabel(props.value)}</span>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuPortal>
|
||||
<DropdownMenuContent class="w-56">
|
||||
<Show when={harnesses().length === 0}>
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuContent class="w-48">
|
||||
<DropdownMenuGroup>
|
||||
<Show when={harnesses().length === 0}>
|
||||
<DropdownMenuItem disabled>
|
||||
<span class="min-w-0 flex-1 truncate text-muted-foreground">
|
||||
{chatState.connection === "unavailable" ? "Chat runs in the desktop app" : "Connecting…"}
|
||||
</span>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
</Show>
|
||||
<For each={harnesses()}>
|
||||
{(harness, index) => (
|
||||
<>
|
||||
<Show when={index() > 0}>
|
||||
<DropdownMenuSeparator />
|
||||
</Show>
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuGroupLabel>{harness.label}</DropdownMenuGroupLabel>
|
||||
<Show when={harness.status === "ready" && harness.detail}>
|
||||
{/* "Update Claude Code": the harness works, but is older than we test against. */}
|
||||
<p class="px-2 pb-1 text-[10px] leading-3.5 text-muted-foreground">{harness.detail}</p>
|
||||
</Show>
|
||||
<Show
|
||||
when={harness.status === "ready"}
|
||||
fallback={
|
||||
<DropdownMenuItem disabled>
|
||||
</Show>
|
||||
<For each={harnesses()}>
|
||||
{(harness) => (
|
||||
<Show
|
||||
when={harness.status === "ready"}
|
||||
fallback={
|
||||
<DropdownMenuItem disabled>
|
||||
<Icon name={harnessIcon(harness.id)} />
|
||||
<span class="min-w-0 flex-1 truncate">{harness.label}</span>
|
||||
<DropdownMenuItemDetail class="truncate">{unavailableLabel(harness)}</DropdownMenuItemDetail>
|
||||
</DropdownMenuItem>
|
||||
}
|
||||
>
|
||||
<DropdownMenuSub>
|
||||
<DropdownMenuSubTrigger>
|
||||
<span class="flex items-center gap-1">
|
||||
<Icon name={harnessIcon(harness.id)} />
|
||||
<span class="min-w-0 flex-1 truncate text-muted-foreground">{unavailableLabel(harness)}</span>
|
||||
</DropdownMenuItem>
|
||||
}
|
||||
>
|
||||
<For each={harness.models}>
|
||||
{(model) => (
|
||||
<DropdownMenuItem onSelect={() => props.onSelect({ harness: harness.id, model: model.id })}>
|
||||
<Icon name={harnessIcon(harness.id)} />
|
||||
<span class="min-w-0 flex-1 truncate">{model.label}</span>
|
||||
<Show when={props.value?.harness === harness.id && props.value?.model === model.id}>
|
||||
<Icon name="confirm-check" class="size-6" />
|
||||
</Show>
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
</For>
|
||||
</Show>
|
||||
</DropdownMenuGroup>
|
||||
</>
|
||||
)}
|
||||
</For>
|
||||
<span class="min-w-0 truncate">{harness.label}</span>
|
||||
</span>
|
||||
</DropdownMenuSubTrigger>
|
||||
<DropdownMenuPortal>
|
||||
<DropdownMenuSubContent class="w-48">
|
||||
<Show when={harness.detail}>
|
||||
{/* "Update Claude Code": the harness works, but is older than we test against. */}
|
||||
<p class="px-2 text-[10px] leading-3.5 text-muted-foreground">{harness.detail}</p>
|
||||
</Show>
|
||||
<DropdownMenuGroup>
|
||||
<For each={harness.models}>
|
||||
{(model) => (
|
||||
<DropdownMenuItem onSelect={() => props.onSelect({ harness: harness.id, model: model.id })}>
|
||||
<span class="min-w-0 flex-1 truncate">{model.label}</span>
|
||||
<Show when={props.value?.harness === harness.id && props.value?.model === model.id}>
|
||||
<Icon name="confirm-check" />
|
||||
</Show>
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
</For>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuSubContent>
|
||||
</DropdownMenuPortal>
|
||||
</DropdownMenuSub>
|
||||
</Show>
|
||||
)}
|
||||
</For>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenuPortal>
|
||||
</DropdownMenu>
|
||||
|
||||
@ -16,7 +16,7 @@ export function runningLabel(last: Item | undefined): string {
|
||||
export function RunningIndicator(props: { last: Item | undefined }) {
|
||||
return (
|
||||
<div class="flex h-6 items-center text-[11px] text-muted-foreground" role="status" aria-live="polite">
|
||||
<Icon name="spinner-loader" class="size-6 shrink-0 animate-spin" />
|
||||
<Icon name="spinner-loader" class="shrink-0 animate-spin" />
|
||||
<span class="agent-ellipsis">{runningLabel(props.last)}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -28,6 +28,7 @@ import {
|
||||
import type { Transcript } from "@diffusionstudio/agent-chat";
|
||||
|
||||
import { store as settings } from "@/init";
|
||||
import { track } from "@/lib/analytics";
|
||||
import { createStoredSignal } from "@/lib/store";
|
||||
import { projectRoute } from "@/hooks/use-project-route";
|
||||
import type { ProjectInfo } from "@/projects";
|
||||
@ -301,6 +302,13 @@ export type SendOptions = {
|
||||
/** Sends a turn; resolves with the chat id as soon as the host accepted it. */
|
||||
export async function send(options: SendOptions): Promise<string> {
|
||||
const key = draftKey(options.projectId, options.chatId);
|
||||
track("prompt_sent", {
|
||||
new_chat: !options.chatId,
|
||||
harness: options.model.harness,
|
||||
model: options.model.model,
|
||||
length: options.text.length,
|
||||
attachments: options.attachments.length,
|
||||
});
|
||||
const optimistic: Item = {
|
||||
id: `optimistic-${Date.now()}`,
|
||||
kind: "user",
|
||||
@ -383,7 +391,14 @@ export async function startChat(options: StartChatOptions): Promise<void> {
|
||||
// is written directly: the editor reads it when it mounts.
|
||||
settings.define<boolean>("layout.uiVisible", true).value = true;
|
||||
try {
|
||||
await send({ projectId, cwd: options.project.dir, chatId: null, text: options.text, attachments: options.attachments, model: options.model });
|
||||
await send({
|
||||
projectId,
|
||||
cwd: options.project.dir,
|
||||
chatId: null,
|
||||
text: options.text,
|
||||
attachments: options.attachments,
|
||||
model: options.model,
|
||||
});
|
||||
} catch (error) {
|
||||
setActiveChat(projectId, null);
|
||||
setState("drafts", draftKey(projectId, null), {
|
||||
|
||||
@ -6,9 +6,10 @@ import { Router, HashRouter, Route, useLocation } from '@solidjs/router';
|
||||
import { ColorModeProvider } from '@kobalte/core';
|
||||
import { Show, createEffect, createMemo, type JSX } from 'solid-js';
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
import { AppContextMenu } from "@/components/app-context-menu";
|
||||
|
||||
import { AuthProvider, useAuth } from '@/context/auth';
|
||||
import { CommandsProvider } from '@/context/commands';
|
||||
import { CommandPalette, ReloadWindowCommand } from '@/components/commands';
|
||||
import { PersistRoute } from '@/lib/persist-route';
|
||||
import { useColorMode } from "@kobalte/core";
|
||||
import { mainBridge } from "@/lib/ipc";
|
||||
@ -95,15 +96,17 @@ function App() {
|
||||
<RouterComponent
|
||||
root={(props) => (
|
||||
<ColorModeProvider initialColorMode="dark">
|
||||
<AppContextMenu>
|
||||
<AuthProvider>
|
||||
<AuthProvider>
|
||||
<CommandsProvider>
|
||||
{props.children}
|
||||
<CommandPalette />
|
||||
<ReloadWindowCommand />
|
||||
<BootSplash />
|
||||
<UpgradeDialog />
|
||||
<PurchaseSuccess />
|
||||
<EditorApi />
|
||||
</AuthProvider>
|
||||
</AppContextMenu>
|
||||
</CommandsProvider>
|
||||
</AuthProvider>
|
||||
<Toaster />
|
||||
<EnvironmentOverlays />
|
||||
<PersistRoute />
|
||||
|
||||
109
apps/web/src/assets/icons/README.md
Normal file
@ -0,0 +1,109 @@
|
||||
# Icons
|
||||
|
||||
Every `*.svg` in this folder is an icon. `<Icon name="trash" />` ([icon.tsx](../../components/ui/icon.tsx)) renders `trash.svg` at **25×25 px**. The file name is the icon name.
|
||||
|
||||
The icons are drawn on a **25×25 pixel grid** so they render sharp on 1x screens. The icons in the
|
||||
[Figma UI library](https://www.figma.com/design/aLnWQdH3C7hqlQVYnsac9s/Diffusion-Studio---UI-Library?node-id=2270-51319&m=dev)
|
||||
are 24×24 components (`icon.24.<name>`), so an icon has to be redrawn when it comes over, not just exported.
|
||||
|
||||
## Why 25 and not 24
|
||||
|
||||
The icons are mostly 1px lines. A 1px line is only sharp when it fills one pixel column exactly, i.e. when its
|
||||
centerline sits on a half pixel (`x = 12.5` covers pixels 12–13). In a 24 frame the center is 12, so a centered
|
||||
line covers half of pixel 11 and half of pixel 12 and renders as a 2px grey smear. In a 25 frame the center is
|
||||
12.5, so centered 1px lines are sharp.
|
||||
|
||||
The Figma exports have two more problems:
|
||||
|
||||
- **Lines are outlined.** Each 1px stroke comes out as a filled shape with two parallel edges.
|
||||
- **Odd scales.** Many icons were scaled, so their strokes are 0.8, 0.93 or 1.1 px instead of 1 px.
|
||||
|
||||
Neither can be fixed by just shifting the icon. Redraw it as clean 1px strokes instead.
|
||||
|
||||
## Converting a Figma icon
|
||||
|
||||
### 1. Export it
|
||||
|
||||
In Figma, select the icon component (e.g. `icon.24.trash`). Then either right-click → **Copy/Paste as → Copy as SVG**, or use **Export → SVG** in Dev Mode. You get something like:
|
||||
|
||||
```svg
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1331 5.93335C9.87541 5.93335 9.66647 6.14229 9.66647 6.40002C9.66647 6.65775 9.87541 6.86668 10.1331 6.86668H13.8665C14.1242 6.86668 14.3331 6.65775 14.3331 6.40002C14.3331 6.14229 14.1242 5.93335 13.8665 5.93335H10.1331ZM7.7998 8.26668C7.7998 8.00895 8.00874 7.80002 8.26647 7.80002H9.66647H14.3331H15.7331C15.9908 7.80002 16.1998 8.00895 16.1998 8.26668C16.1998 8.52441 15.9908 8.73335 15.7331 8.73335H15.2665V16.2C15.2665 16.7155 14.8486 17.1333 14.3331 17.1333H9.66647C9.15101 17.1333 8.73314 16.7155 8.73314 16.2V8.73335H8.26647C8.00874 8.73335 7.7998 8.52441 7.7998 8.26668ZM9.66647 8.73335H14.3331V16.2H9.66647V8.73335Z" fill="currentColor"/>
|
||||
</svg>
|
||||
```
|
||||
|
||||
### 2. Read the geometry
|
||||
|
||||
Work out what the outline is made of: the **centerline** of each stroke and the stroke width. Each pair of
|
||||
parallel edges is one stroke, and its centerline is halfway between them. For the trash icon:
|
||||
|
||||
| Part | Edges in the 24 frame | Centerline | Width |
|
||||
| --- | --- | --- | --- |
|
||||
| Handle | y 5.93–6.87, x 9.67–14.33, round ends | y 6.4, x 10.13–13.87 | 0.93 |
|
||||
| Lid | y 7.8–8.73, x 7.8–16.2, round ends | y 8.27, x 8.27–15.73 | 0.93 |
|
||||
| Can sides | x 8.73–9.67 and 14.33–15.27 | x 9.2 and 14.8 | 0.93 |
|
||||
| Can bottom | y 16.2–17.13, rounded outer corners | y 16.67 | 0.93 |
|
||||
|
||||
The 0.93 width means this icon was scaled; it becomes 1.
|
||||
|
||||
### 3. Redraw it in the 25 frame
|
||||
|
||||
Add 0.5 to every coordinate (12 → 12.5), then snap following these rules:
|
||||
|
||||
- **1px strokes on half pixels.** Every stroke is `stroke="currentColor"` with the default width of 1, and horizontal and vertical centerlines on `.5`. A stroked rect therefore has `.5` x/y and whole-number width/height: `<rect x="6.5" y="6.5" width="12" height="12"/>`.
|
||||
- **Solid shapes on whole pixels.** Genuinely filled shapes (a solid triangle, a lock body) keep `fill="currentColor"`, with their straight edges on whole numbers.
|
||||
- **Symmetric stays symmetric.** Mirror about `x = 12.5` / `y = 12.5`. A centered line goes on 12.5; a centered box has an odd outer size (e.g. 7…18 = 11, or 6…19 = 13).
|
||||
- **Even stays even.** Repeated bars, dots or holes stay the same size with equal gaps. If the original spacing can't be both even and sharp (e.g. 2.5 px), use the nearest whole spacing that is.
|
||||
- **Uniform weight.** Strokes of about 0.75–1.25 px all become 1 px, diagonals and curves included. Don't mix weights unless the design clearly does.
|
||||
- **Stay close.** Move each part by at most ~0.5 px (1 px if the rules above need it). Keep corner radii, round vs square caps and joins (`stroke-linecap="round"`, `stroke-linejoin="round"`), opacity layers and arrowhead angles.
|
||||
- **Diagonals and curves.** These can't be fully sharp. Run 45° lines through pixel centers (`.5, .5` points). Give circles centered on 12.5 a whole-number radius so their top, bottom, left and right edges are sharp.
|
||||
|
||||
For the trash icon:
|
||||
|
||||
| Part | Centerline + 0.5 | Snapped |
|
||||
| --- | --- | --- |
|
||||
| Handle | y 6.9, x 10.63–14.37 | `M10.5 6.5H14.5` (4 long, centered) |
|
||||
| Lid | y 8.77, x 8.77–16.23 | `M8.5 8.5H16.5` (8 long, centered) |
|
||||
| Sides | x 9.7 and 15.3 | x 9.5 and 15.5 (symmetric about 12.5) |
|
||||
| Bottom | y 17.17 | y 17.5, corner radius 0.5 |
|
||||
|
||||
```svg
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.5 6.5H14.5M8.5 8.5H16.5M9.5 8.5V17C9.5 17.2761 9.7239 17.5 10 17.5H15C15.2761 17.5 15.5 17.2761 15.5 17V8.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
</svg>
|
||||
```
|
||||
|
||||
### 4. Clean up
|
||||
|
||||
The root element is always `<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">`, with no
|
||||
`width`/`height`. Beyond that:
|
||||
|
||||
- **Colors.** Use `currentColor` instead of Figma's hard-coded colors, so the icon follows the text color. Keep a fixed color only when the design really needs one.
|
||||
- **No wrappers.** Remove `transform`s, `clipPath`s that don't clip anything, masks, `<g>` wrappers and Figma ids.
|
||||
- **Short coordinates.** Use absolute path commands and at most 4 decimals.
|
||||
|
||||
### 5. Check it at 1x
|
||||
|
||||
Render the icon at 25 px with a device pixel ratio of 1 and zoom in with nearest-neighbour scaling:
|
||||
|
||||
```bash
|
||||
rsvg-convert -w 25 -h 25 -b white trash.svg | magick - -filter point -resize 1600% /tmp/trash-1x.png
|
||||
```
|
||||
|
||||
Straight lines should be solid single-pixel rows and columns, with no grey row next to them. Only diagonals and curves
|
||||
may show grey pixels. Compare the result with the Figma original next to it at the same zoom; apart from the sharpness,
|
||||
they should look the same.
|
||||
|
||||
### 6. Add it
|
||||
|
||||
Save the file as `<name>.svg`, using the Figma name without `icon.24.` (`icon.24.trash` → `trash.svg`). Then use it as
|
||||
`<Icon name="trash" />`. Remove icons from this folder once nothing references them.
|
||||
|
||||
## Exceptions
|
||||
|
||||
A few icons stay on their own grid on purpose:
|
||||
|
||||
- **Brand logos** (`agent.*`, `editor.*`, `claude`, `codex`, `social.*`, `diffusion-logo*`) are moved to the 25 frame without reshaping.
|
||||
- **The `large-*` provider logos** are left as exported.
|
||||
- **`frame`** (20×20, shown at 20 px), **`folder-thumbnail`** (32×24) and **`vertical-knob-line`** are drawn for their own sizes.
|
||||
- **`line-join-*`** use a 15×15 grid because they are shown at 14 px.
|
||||
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.59091 5.75C7.02192 5.75 5.75 7.02192 5.75 8.59091C5.75 10.1599 7.02192 11.4318 8.59091 11.4318C10.1599 11.4318 11.4318 10.1599 11.4318 8.59091C11.4318 7.02192 10.1599 5.75 8.59091 5.75ZM6.88636 8.59091C6.88636 7.64951 7.64951 6.88636 8.59091 6.88636C9.53231 6.88636 10.2955 7.64951 10.2955 8.59091C10.2955 9.53231 9.53231 10.2955 8.59091 10.2955C7.64951 10.2955 6.88636 9.53231 6.88636 8.59091ZM15.4091 5.75C13.8401 5.75 12.5682 7.02192 12.5682 8.59091C12.5682 10.1599 13.8401 11.4318 15.4091 11.4318C16.9781 11.4318 18.25 10.1599 18.25 8.59091C18.25 7.02192 16.9781 5.75 15.4091 5.75ZM13.7045 8.59091C13.7045 7.64951 14.4677 6.88636 15.4091 6.88636C16.3505 6.88636 17.1136 7.64951 17.1136 8.59091C17.1136 9.53231 16.3505 10.2955 15.4091 10.2955C14.4677 10.2955 13.7045 9.53231 13.7045 8.59091ZM5.75 15.4091C5.75 13.8401 7.02192 12.5682 8.59091 12.5682C10.1599 12.5682 11.4318 13.8401 11.4318 15.4091C11.4318 16.9781 10.1599 18.25 8.59091 18.25C7.02192 18.25 5.75 16.9781 5.75 15.4091ZM8.59091 13.7045C7.64951 13.7045 6.88636 14.4677 6.88636 15.4091C6.88636 16.3505 7.64951 17.1136 8.59091 17.1136C9.53231 17.1136 10.2955 16.3505 10.2955 15.4091C10.2955 14.4677 9.53231 13.7045 8.59091 13.7045ZM15.4091 12.5682C13.8401 12.5682 12.5682 13.8401 12.5682 15.4091C12.5682 16.9781 13.8401 18.25 15.4091 18.25C16.9781 18.25 18.25 16.9781 18.25 15.4091C18.25 13.8401 16.9781 12.5682 15.4091 12.5682ZM13.7045 15.4091C13.7045 14.4677 14.4677 13.7045 15.4091 13.7045C16.3505 13.7045 17.1136 14.4677 17.1136 15.4091C17.1136 16.3505 16.3505 17.1136 15.4091 17.1136C14.4677 17.1136 13.7045 16.3505 13.7045 15.4091Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.3069 5.57328C17.3069 5.3671 17.1397 5.19995 16.9335 5.19995C16.7274 5.19995 16.5602 5.3671 16.5602 5.57328V6.13329H16.0002C15.794 6.13329 15.6269 6.30043 15.6269 6.50662C15.6269 6.7128 15.794 6.87996 16.0002 6.87996H16.5602V7.43996C16.5602 7.64614 16.7274 7.81329 16.9335 7.81329C17.1397 7.81329 17.3069 7.64614 17.3069 7.43996V6.87996H17.8669C18.073 6.87996 18.2402 6.7128 18.2402 6.50662C18.2402 6.30043 18.073 6.13329 17.8669 6.13329H17.3069V5.57328ZM15.3969 8.0433C15.5791 8.22554 15.5791 8.52102 15.3969 8.70327L14.4636 9.6366C14.2813 9.81884 13.9858 9.81884 13.8036 9.6366C13.6213 9.45436 13.6213 9.15888 13.8036 8.97663L14.7368 8.04331C14.9191 7.86106 15.2146 7.86106 15.3969 8.0433ZM13.5302 9.90997C13.7124 10.0922 13.7124 10.3877 13.5302 10.5699L6.99684 17.1032C6.8146 17.2855 6.51913 17.2855 6.33688 17.1032C6.15463 16.9211 6.15463 16.6256 6.33688 16.4433L12.8702 9.90997C13.0525 9.72772 13.348 9.72772 13.5302 9.90997ZM16.9335 9.86662C17.1397 9.86662 17.3069 10.0338 17.3069 10.24V10.8H17.8669C18.073 10.8 18.2402 10.9671 18.2402 11.1733C18.2402 11.3795 18.073 11.5466 17.8669 11.5466H17.3069V12.1066C17.3069 12.3128 17.1397 12.48 16.9335 12.48C16.7274 12.48 16.5602 12.3128 16.5602 12.1066V11.5466H16.0002C15.794 11.5466 15.6269 11.3795 15.6269 11.1733C15.6269 10.9671 15.794 10.8 16.0002 10.8H16.5602V10.24C16.5602 10.0338 16.7274 9.86662 16.9335 9.86662ZM12.6402 5.57328C12.6402 5.3671 12.4731 5.19995 12.2669 5.19995C12.0607 5.19995 11.8935 5.3671 11.8935 5.57328V6.13329H11.3335C11.1274 6.13329 10.9602 6.30043 10.9602 6.50662C10.9602 6.7128 11.1274 6.87996 11.3335 6.87996H11.8935V7.43996C11.8935 7.64614 12.0607 7.81329 12.2669 7.81329C12.4731 7.81329 12.6402 7.64614 12.6402 7.43996V6.87996H13.2002C13.4064 6.87996 13.5735 6.7128 13.5735 6.50662C13.5735 6.30043 13.4064 6.13329 13.2002 6.13329H12.6402V5.57328Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.0444 11.6108V8.70752C16.0444 8.21512 15.6452 7.81592 15.1528 7.81592H8.84521C8.35284 7.81598 7.95368 8.21515 7.95361 8.70752V11.6167C7.95361 11.8254 8.02666 12.0281 8.15967 12.188L11.314 15.978C11.6709 16.4068 12.3289 16.4066 12.6851 15.978L15.8384 12.1812C15.9715 12.0209 16.0444 11.8187 16.0444 11.6108ZM16.9653 11.6108C16.9653 12.0339 16.8165 12.4439 16.5464 12.769L13.3921 16.5659C12.6677 17.4376 11.3304 17.4367 10.606 16.5659L7.45264 12.7759C7.18173 12.4502 7.03369 12.0396 7.03369 11.6167V8.70752C7.03375 7.70705 7.84474 6.89606 8.84521 6.896H15.1528C16.1533 6.896 16.9653 7.707 16.9653 8.70752V11.6108Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 727 B |
@ -1,18 +1,18 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<mask id="mask0_6512_20130" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="7" y="7" width="10" height="10">
|
||||
<rect x="7" y="7" width="10" height="10" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<mask id="mask0_6512_20130" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="7.5" y="7.5" width="10" height="10">
|
||||
<rect x="7.5" y="7.5" width="10" height="10" fill="currentColor"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_6512_20130)">
|
||||
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M18.3021 7.51951C13.3663 8.86561 8.86513 13.3668 7.51902 18.3026L6.89307 18.1318C8.29963 12.9745 12.974 8.30012 18.1313 6.89355L18.3021 7.51951Z" fill="currentColor"/>
|
||||
<path opacity="0.25" fill-rule="evenodd" clip-rule="evenodd" d="M17.9373 6.96847C12.9463 8.36776 8.36727 12.9468 6.96799 17.9378L6.34326 17.7627C7.80369 12.5536 12.5531 7.80418 17.7623 6.34375L17.9373 6.96847Z" fill="currentColor"/>
|
||||
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M17.4694 6.44718C12.5006 7.92183 7.92892 12.4911 6.44997 17.4593L5.82812 17.2743C7.3696 12.0959 12.1057 7.36226 17.2847 5.8252L17.4694 6.44718Z" fill="currentColor"/>
|
||||
<path opacity="0.35" fill-rule="evenodd" clip-rule="evenodd" d="M16.8548 5.97539C12.0074 7.55193 7.55399 12.0044 5.97583 16.8516L5.35889 16.6508C7.00128 11.6063 11.6094 6.99912 16.6541 5.3584L16.8548 5.97539Z" fill="currentColor"/>
|
||||
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M16.1712 5.53649C11.5009 7.21148 7.22263 11.4862 5.54162 16.1557L4.93115 15.936C6.67772 11.0844 11.0994 6.66618 15.9522 4.92578L16.1712 5.53649Z" fill="currentColor"/>
|
||||
<path opacity="0.45" fill-rule="evenodd" clip-rule="evenodd" d="M15.3697 5.15694C10.9549 6.92615 6.93187 10.9475 5.15972 15.3618L4.55762 15.1201C6.39573 10.5415 10.5491 6.38982 15.1283 4.55469L15.3697 5.15694Z" fill="currentColor"/>
|
||||
<path opacity="0.5" fill-rule="evenodd" clip-rule="evenodd" d="M14.4678 4.8427C10.3857 6.67852 6.68702 10.3748 4.84737 14.4563L4.25586 14.1897C6.16062 9.96381 9.97495 6.15183 14.2017 4.25098L14.4678 4.8427Z" fill="currentColor"/>
|
||||
<path opacity="0.6" fill-rule="evenodd" clip-rule="evenodd" d="M13.4295 4.62427C9.77812 6.48028 6.48829 9.76834 4.62945 13.419L4.05127 13.1246C5.97238 9.35165 9.3617 5.96413 13.1355 4.0459L13.4295 4.62427Z" fill="currentColor"/>
|
||||
<path opacity="0.7" fill-rule="evenodd" clip-rule="evenodd" d="M12.2033 4.55519C9.12119 6.34523 6.35302 9.11197 4.56084 12.1934L4 11.8672C5.84878 8.68844 8.69792 5.84075 11.8774 3.99414L12.2033 4.55519Z" fill="currentColor"/>
|
||||
<path opacity="0.8" fill-rule="evenodd" clip-rule="evenodd" d="M10.7007 4.73387C8.3852 6.29848 6.29628 8.38762 4.73196 10.7032L4.19434 10.3401C5.80509 7.95567 7.95321 5.80735 10.3374 4.19629L10.7007 4.73387Z" fill="currentColor"/>
|
||||
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M18.8021 8.0195C13.8663 9.3656 9.3651 13.8668 8.019 18.8026L7.3931 18.6318C8.7996 13.4745 13.474 8.8001 18.6313 7.3936L18.8021 8.0195Z" fill="currentColor"/>
|
||||
<path opacity="0.25" fill-rule="evenodd" clip-rule="evenodd" d="M18.4373 7.4685C13.4463 8.8678 8.8673 13.4468 7.468 18.4378L6.8433 18.2627C8.3037 13.0536 13.0531 8.3042 18.2623 6.8438L18.4373 7.4685Z" fill="currentColor"/>
|
||||
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M17.9694 6.9472C13.0006 8.4218 8.4289 12.9911 6.95 17.9593L6.3281 17.7743C7.8696 12.5959 12.6057 7.8623 17.7847 6.3252L17.9694 6.9472Z" fill="currentColor"/>
|
||||
<path opacity="0.35" fill-rule="evenodd" clip-rule="evenodd" d="M17.3548 6.4754C12.5074 8.0519 8.054 12.5044 6.4758 17.3516L5.8589 17.1508C7.5013 12.1063 12.1094 7.4991 17.1541 5.8584L17.3548 6.4754Z" fill="currentColor"/>
|
||||
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M16.6712 6.0365C12.0009 7.7115 7.7226 11.9862 6.0416 16.6557L5.4311 16.436C7.1777 11.5844 11.5994 7.1662 16.4522 5.4258L16.6712 6.0365Z" fill="currentColor"/>
|
||||
<path opacity="0.45" fill-rule="evenodd" clip-rule="evenodd" d="M15.8697 5.6569C11.4549 7.4261 7.4319 11.4475 5.6597 15.8618L5.0576 15.6201C6.8957 11.0415 11.0491 6.8898 15.6283 5.0547L15.8697 5.6569Z" fill="currentColor"/>
|
||||
<path opacity="0.5" fill-rule="evenodd" clip-rule="evenodd" d="M14.9678 5.3427C10.8857 7.1785 7.187 10.8748 5.3474 14.9563L4.7559 14.6897C6.6606 10.4638 10.4749 6.6518 14.7017 4.751L14.9678 5.3427Z" fill="currentColor"/>
|
||||
<path opacity="0.6" fill-rule="evenodd" clip-rule="evenodd" d="M13.9295 5.1243C10.2781 6.9803 6.9883 10.2683 5.1295 13.919L4.5513 13.6246C6.4724 9.8516 9.8617 6.4641 13.6355 4.5459L13.9295 5.1243Z" fill="currentColor"/>
|
||||
<path opacity="0.7" fill-rule="evenodd" clip-rule="evenodd" d="M12.7033 5.0552C9.6212 6.8452 6.853 9.612 5.0608 12.6934L4.5 12.3672C6.3488 9.1884 9.1979 6.3407 12.3774 4.4941L12.7033 5.0552Z" fill="currentColor"/>
|
||||
<path opacity="0.8" fill-rule="evenodd" clip-rule="evenodd" d="M11.2007 5.2339C8.8852 6.7985 6.7963 8.8876 5.232 11.2032L4.6943 10.8401C6.3051 8.4557 8.4532 6.3073 10.8374 4.6963L11.2007 5.2339Z" fill="currentColor"/>
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 6.50049C17.0523 6.50049 17.5 6.9482 17.5 7.50049V16.5005C17.4997 17.0525 17.0521 17.5005 16.5 17.5005H7.5C6.94788 17.5005 6.50026 17.0525 6.5 16.5005L6.5 7.50049C6.5 6.9482 6.94772 6.50049 7.5 6.50049L16.5 6.50049ZM7.5 16.5005H16.5V7.50049L7.5 7.50049L7.5 16.5005Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17 7.0005C17.5523 7.0005 18 7.4482 18 8.0005V17.0005C17.9997 17.5525 17.5521 18.0005 17 18.0005H8C7.4479 18.0005 7.0003 17.5525 7 17.0005L7 8.0005C7 7.4482 7.4477 7.0005 8 7.0005L17 7.0005ZM8 17.0005H17V8.0005L8 8.0005L8 17.0005Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.8 KiB |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.4363 11.1433H19.25V12.8567H17.4375V14.5294H16.5391V16.1429H15.625V14.5294H14.7266V16.1429H13.8125V14.5294H10.1875V16.1429H9.274V14.5294H8.375V16.1429H7.4609V14.5294H6.5625V12.8562H4.75V11.1438H6.5625V7.85714H17.4363V11.1433ZM8.375 11.1433H9.274V9.57063H8.375V11.1433ZM14.7248 11.1433H15.625V9.57063H14.7248V11.1433Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 8H18V12H20V14H18V15H17V17H16V15H15V17H14V15H11V17H10V15H9V17H8V15H7V14H5V12H7V8ZM9 10V12H10V10H9ZM15 10V12H16V10H15Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 292 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.79816 5.50775C10.34 5.28508 10.9298 5.20472 11.5115 5.27433C12.2613 5.36038 12.9296 5.6793 13.5162 6.23052C13.5241 6.23801 13.5338 6.24341 13.5443 6.24626C13.5548 6.24911 13.5658 6.2493 13.5764 6.24683C14.3684 6.05222 15.13 6.12084 15.8607 6.4527L15.8962 6.46957L15.9828 6.51232C16.7461 6.90773 17.2934 7.50789 17.6241 8.31109C17.7805 8.69301 17.8593 9.0918 17.8609 9.5069C17.872 9.81599 17.8379 10.125 17.7597 10.4243C17.7558 10.4395 17.7559 10.4555 17.7598 10.4707C17.7638 10.486 17.7714 10.5 17.7822 10.5115C18.2244 10.9598 18.5319 11.5232 18.6698 12.1376C18.8864 13.2068 18.6642 14.1709 18.0044 15.0287L17.902 15.1524C17.465 15.6528 16.8914 16.0146 16.2517 16.1935C16.2377 16.1975 16.2249 16.2049 16.2143 16.2148C16.2037 16.2248 16.1957 16.2372 16.1909 16.2509C16.0475 16.6649 15.9035 17.0181 15.6357 17.3713C14.9613 18.2612 13.9696 18.7561 12.8525 18.7499C11.9621 18.7454 11.1729 18.4198 10.4844 17.7735C10.474 17.7639 10.4612 17.7572 10.4474 17.7541C10.4336 17.7509 10.4192 17.7514 10.4057 17.7555C10.1143 17.8494 9.82066 17.8629 9.50342 17.8596C8.99658 17.8555 8.49736 17.7358 8.04375 17.5097C7.56894 17.2742 7.15562 16.9312 6.83663 16.5079C6.72245 16.3566 6.60939 16.2143 6.5267 16.0462C6.41266 15.8143 6.31948 15.5728 6.24827 15.3245C6.09874 14.7602 6.09545 14.1671 6.2387 13.6011C6.24333 13.5878 6.24487 13.5735 6.2432 13.5595C6.24042 13.5455 6.2331 13.5329 6.22239 13.5235C5.87566 13.1728 5.61061 12.7499 5.44615 12.2849C5.33727 11.9987 5.27406 11.6971 5.25884 11.3912C5.23164 10.9884 5.26731 10.5838 5.36459 10.192C5.61771 9.35728 6.10089 8.70257 6.81413 8.22729C6.97276 8.12154 7.12351 8.03942 7.26525 7.98092C7.42613 7.91343 7.58756 7.85718 7.74956 7.80993C7.76115 7.8065 7.77169 7.80022 7.78024 7.79168C7.78879 7.78313 7.79506 7.77259 7.7985 7.761C7.92134 7.31945 8.13261 6.90745 8.41949 6.55C8.80199 6.07416 9.26154 5.72655 9.79816 5.50775ZM9.34592 9.92313C9.28311 9.81326 9.17923 9.73284 9.05713 9.69956C8.93503 9.66628 8.8047 9.68287 8.69483 9.74567C8.58496 9.80847 8.50454 9.91235 8.47125 10.0344C8.43797 10.1565 8.45456 10.2869 8.51736 10.3967L9.47023 12.0644L8.52074 13.6664C8.46253 13.7749 8.44851 13.9017 8.48161 14.0204C8.51471 14.139 8.59238 14.2403 8.69838 14.303C8.80439 14.3657 8.93053 14.3851 9.05047 14.357C9.1704 14.3289 9.27484 14.2556 9.34198 14.1523L10.4332 12.3119C10.4763 12.2394 10.4993 12.1567 10.5 12.0723C10.5007 11.9879 10.479 11.9049 10.4372 11.8316L9.34592 9.92313ZM12.4093 13.4329C12.2877 13.4402 12.1736 13.4935 12.0901 13.5821C12.0066 13.6707 11.9601 13.7879 11.9601 13.9096C11.9601 14.0314 12.0066 14.1485 12.0901 14.2371C12.1736 14.3257 12.2877 14.3791 12.4093 14.3863H15.1362C15.2587 14.3804 15.3742 14.3275 15.4588 14.2387C15.5434 14.1499 15.5906 14.032 15.5906 13.9093C15.5906 13.7867 15.5434 13.6688 15.4588 13.58C15.3742 13.4912 15.2587 13.4383 15.1362 13.4324H12.4093V13.4329Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.2982 6.0077C10.84 5.7851 11.4298 5.7047 12.0115 5.7743C12.7613 5.8604 13.4296 6.1793 14.0162 6.7305C14.0241 6.738 14.0338 6.7434 14.0443 6.7463C14.0548 6.7491 14.0658 6.7493 14.0764 6.7468C14.8684 6.5522 15.63 6.6208 16.3607 6.9527L16.3962 6.9696L16.4828 7.0123C17.2461 7.4077 17.7934 8.0079 18.1241 8.8111C18.2805 9.193 18.3593 9.5918 18.3609 10.0069C18.372 10.316 18.3379 10.625 18.2597 10.9243C18.2558 10.9395 18.2559 10.9555 18.2598 10.9707C18.2638 10.986 18.2714 11 18.2822 11.0115C18.7244 11.4598 19.0319 12.0232 19.1698 12.6376C19.3864 13.7068 19.1642 14.6709 18.5044 15.5287L18.402 15.6524C17.965 16.1528 17.3914 16.5146 16.7517 16.6935C16.7377 16.6975 16.7249 16.7049 16.7143 16.7148C16.7037 16.7248 16.6957 16.7372 16.6909 16.7509C16.5475 17.1649 16.4035 17.5181 16.1357 17.8713C15.4613 18.7612 14.4696 19.2561 13.3525 19.2499C12.4621 19.2454 11.6729 18.9198 10.9844 18.2735C10.974 18.2639 10.9612 18.2572 10.9474 18.2541C10.9336 18.2509 10.9192 18.2514 10.9057 18.2555C10.6143 18.3494 10.3207 18.3629 10.0034 18.3596C9.4966 18.3555 8.9974 18.2358 8.5437 18.0097C8.0689 17.7742 7.6556 17.4312 7.3366 17.0079C7.2225 16.8566 7.1094 16.7143 7.0267 16.5462C6.9127 16.3143 6.8195 16.0728 6.7483 15.8245C6.5987 15.2602 6.5954 14.6671 6.7387 14.1011C6.7433 14.0878 6.7449 14.0735 6.7432 14.0595C6.7404 14.0455 6.7331 14.0329 6.7224 14.0235C6.3757 13.6728 6.1106 13.2499 5.9462 12.7849C5.8373 12.4987 5.7741 12.1971 5.7588 11.8912C5.7316 11.4884 5.7673 11.0838 5.8646 10.692C6.1177 9.8573 6.6009 9.2026 7.3141 8.7273C7.4728 8.6215 7.6235 8.5394 7.7652 8.4809C7.9261 8.4134 8.0876 8.3572 8.2496 8.3099C8.2612 8.3065 8.2717 8.3002 8.2802 8.2917C8.2888 8.2831 8.2951 8.2726 8.2985 8.261C8.4213 7.8194 8.6326 7.4074 8.9195 7.05C9.302 6.5742 9.7615 6.2265 10.2982 6.0077ZM9.8459 10.4231C9.7831 10.3133 9.6792 10.2328 9.5571 10.1996C9.435 10.1663 9.3047 10.1829 9.1948 10.2457C9.085 10.3085 9.0045 10.4123 8.9712 10.5344C8.938 10.6565 8.9546 10.7869 9.0174 10.8967L9.9702 12.5644L9.0207 14.1664C8.9625 14.2749 8.9485 14.4017 8.9816 14.5204C9.0147 14.639 9.0924 14.7403 9.1984 14.803C9.3044 14.8657 9.4305 14.8851 9.5505 14.857C9.6704 14.8289 9.7748 14.7556 9.842 14.6523L10.9332 12.8119C10.9763 12.7394 10.9993 12.6567 11 12.5723C11.0007 12.4879 10.979 12.4049 10.9372 12.3316L9.8459 10.4231ZM12.9093 13.9329C12.7877 13.9402 12.6736 13.9935 12.5901 14.0821C12.5066 14.1707 12.4601 14.2879 12.4601 14.4096C12.4601 14.5314 12.5066 14.6485 12.5901 14.7371C12.6736 14.8257 12.7877 14.8791 12.9093 14.8863H15.6362C15.7587 14.8804 15.8742 14.8275 15.9588 14.7387C16.0434 14.6499 16.0906 14.532 16.0906 14.4093C16.0906 14.2867 16.0434 14.1688 15.9588 14.08C15.8742 13.9912 15.7587 13.9383 15.6362 13.9324H12.9093V13.9329Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.8 KiB |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18.2943 8.19548L12.4894 4.84384C12.3978 4.791 12.2938 4.76318 12.188 4.76318C12.0822 4.76318 11.9783 4.791 11.8866 4.84384L6.08244 8.19548C6.00538 8.23997 5.94136 8.30395 5.89683 8.38098C5.85229 8.45802 5.82879 8.54542 5.82869 8.63441V15.3919C5.82879 15.4808 5.85229 15.5682 5.89683 15.6453C5.94136 15.7223 6.00538 15.7863 6.08244 15.8308L11.8873 19.1824C11.9789 19.2353 12.0829 19.2632 12.1887 19.2632C12.2945 19.2632 12.3985 19.2353 12.4901 19.1824L18.295 15.8315C18.372 15.787 18.436 15.723 18.4806 15.646C18.5251 15.5689 18.5486 15.4815 18.5487 15.3925V8.63372C18.5486 8.54473 18.5251 8.45734 18.4806 8.3803C18.436 8.30326 18.372 8.23929 18.295 8.19479L18.2943 8.19548ZM17.9301 8.90531L12.3262 18.6111C12.2885 18.6763 12.1884 18.6495 12.1884 18.5734V12.2185C12.1883 12.156 12.1718 12.0945 12.1405 12.0404C12.1092 11.9862 12.0642 11.9412 12.01 11.9099L6.50697 8.73385C6.44113 8.69544 6.46788 8.59531 6.544 8.59531H17.7504C17.9102 8.59531 18.0097 8.76746 17.9301 8.90531Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18.7943 8.6955L12.9894 5.3438C12.8978 5.291 12.7938 5.2632 12.688 5.2632C12.5822 5.2632 12.4783 5.291 12.3866 5.3438L6.5824 8.6955C6.5054 8.74 6.4414 8.804 6.3968 8.881C6.3523 8.958 6.3288 9.0454 6.3287 9.1344V15.8919C6.3288 15.9808 6.3523 16.0682 6.3968 16.1453C6.4414 16.2223 6.5054 16.2863 6.5824 16.3308L12.3873 19.6824C12.4789 19.7353 12.5829 19.7632 12.6887 19.7632C12.7945 19.7632 12.8985 19.7353 12.9901 19.6824L18.795 16.3315C18.872 16.287 18.936 16.223 18.9806 16.146C19.0251 16.0689 19.0486 15.9815 19.0487 15.8925V9.1337C19.0486 9.0447 19.0251 8.9573 18.9806 8.8803C18.936 8.8033 18.872 8.7393 18.795 8.6948L18.7943 8.6955ZM18.4301 9.4053L12.8262 19.1111C12.7885 19.1763 12.6884 19.1495 12.6884 19.0734V12.7185C12.6883 12.656 12.6718 12.5945 12.6405 12.5404C12.6092 12.4862 12.5642 12.4412 12.51 12.4099L7.007 9.2339C6.9411 9.1954 6.9679 9.0953 7.044 9.0953H18.2504C18.4102 9.0953 18.5097 9.2675 18.4301 9.4053Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.1 KiB |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.4849 17.9678C18.2386 18.5331 19.3693 18.1562 18.3331 17.1195C15.2231 14.1051 15.8834 5.81376 12.0207 5.81376C8.15802 5.81376 8.81727 14.1051 5.70832 17.1201C4.57769 18.2501 5.80226 18.5325 6.55601 17.9672C9.47653 15.9889 9.28809 12.503 12.0207 12.503C14.7528 12.503 14.5644 15.9889 17.4849 17.9678Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.9849 18.4678C18.7386 19.0331 19.8693 18.6562 18.8331 17.6195C15.7231 14.6051 16.3834 6.3138 12.5207 6.3138C8.658 6.3138 9.3173 14.6051 6.2083 17.6201C5.0777 18.7501 6.3023 19.0325 7.056 18.4672C9.9765 16.4889 9.7881 13.003 12.5207 13.003C15.2528 13.003 15.0644 16.4889 17.9849 18.4678Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 462 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.2793 5.25C16.9345 5.25 17.5631 5.51032 18.0264 5.97363C18.4897 6.43694 18.75 7.06549 18.75 7.7207V16.2793C18.75 16.9345 18.4897 17.5631 18.0264 18.0264C17.5631 18.4897 16.9345 18.75 16.2793 18.75H7.7207C7.06549 18.75 6.43694 18.4897 5.97363 18.0264C5.51032 17.5631 5.25 16.9345 5.25 16.2793V7.7207C5.25 7.06549 5.51032 6.43694 5.97363 5.97363C6.43694 5.51032 7.06549 5.25 7.7207 5.25H16.2793ZM7.64648 6.0625C7.22638 6.0625 6.82342 6.22931 6.52637 6.52637C6.22931 6.82342 6.0625 7.22638 6.0625 7.64648V16.3535C6.0625 16.7736 6.22931 17.1766 6.52637 17.4736C6.82342 17.7707 7.22638 17.9375 7.64648 17.9375H16.3535C16.7736 17.9375 17.1766 17.7707 17.4736 17.4736C17.7707 17.1766 17.9375 16.7736 17.9375 16.3535V7.64648C17.9375 7.22638 17.7707 6.82342 17.4736 6.52637C17.1766 6.22931 16.7736 6.0625 16.3535 6.0625H7.64648ZM14.6963 11.0762V13.251L9.32031 15.8359V14.2607L13.6807 12.1641L9.32129 10.0674V8.49121L14.6963 11.0762Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.7793 5.75C17.4345 5.75 18.0631 6.0103 18.5264 6.4736C18.9897 6.9369 19.25 7.5655 19.25 8.2207V16.7793C19.25 17.4345 18.9897 18.0631 18.5264 18.5264C18.0631 18.9897 17.4345 19.25 16.7793 19.25H8.2207C7.5655 19.25 6.9369 18.9897 6.4736 18.5264C6.0103 18.0631 5.75 17.4345 5.75 16.7793V8.2207C5.75 7.5655 6.0103 6.9369 6.4736 6.4736C6.9369 6.0103 7.5655 5.75 8.2207 5.75H16.7793ZM8.1465 6.5625C7.7264 6.5625 7.3234 6.7293 7.0264 7.0264C6.7293 7.3234 6.5625 7.7264 6.5625 8.1465V16.8535C6.5625 17.2736 6.7293 17.6766 7.0264 17.9736C7.3234 18.2707 7.7264 18.4375 8.1465 18.4375H16.8535C17.2736 18.4375 17.6766 18.2707 17.9736 17.9736C18.2707 17.6766 18.4375 17.2736 18.4375 16.8535V8.1465C18.4375 7.7264 18.2707 7.3234 17.9736 7.0264C17.6766 6.7293 17.2736 6.5625 16.8535 6.5625H8.1465ZM15.1963 11.5762V13.751L9.8203 16.3359V14.7607L14.1807 12.6641L9.8213 10.5674V8.9912L15.1963 11.5762Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1019 B |
@ -1,5 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(4 4)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.666 3.9987H5.33268V11.9987H10.666V3.9987ZM13.3327 14.6654H2.66602V1.33203H13.3327V14.6654Z" fill="currentColor"/>
|
||||
</g>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 9H10V16H15V9ZM18 19H7V6H18V19Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 187 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.126 6.37019C12.744 5.70777 13.7011 5.55541 14.7939 5.67683C15.9085 5.80098 16.738 6.15524 17.2627 6.81941C17.7756 7.46738 17.8906 8.28293 17.8906 9.07136C17.8906 9.58953 17.8422 10.1112 17.6602 10.5714C17.7199 10.7779 17.749 10.9603 17.7744 11.1261C17.7853 11.1949 17.7968 11.2609 17.8086 11.3243C18.6457 11.6734 19.1875 12.6574 19.25 13.2227V14.919C19.2497 15.6134 16.2128 18.3585 11.998 18.3585C7.86451 18.3584 4.86425 15.7182 4.75 14.961V13.1954C4.82703 12.6263 5.36386 11.6678 6.18945 11.3243C6.20123 11.2609 6.2108 11.194 6.22168 11.1261C6.24795 10.9603 6.27615 10.7779 6.33594 10.5714C6.15392 10.1112 6.1055 9.58949 6.10547 9.07136C6.10547 8.28293 6.22137 7.46738 6.7334 6.81941C7.25808 6.1552 8.0876 5.80101 9.20215 5.67683C10.295 5.55541 11.252 5.70788 11.8701 6.37019C11.9154 6.41814 11.9572 6.46804 11.9961 6.51961C12.036 6.46795 12.0816 6.41822 12.126 6.37019ZM12 10.4444C11.8686 10.6912 11.7024 10.9184 11.5068 11.1182C10.9178 11.7199 10.0902 12.0167 9.05078 12.0167C8.46008 12.0167 7.9312 11.9423 7.48633 11.752L7.46484 11.8575V15.7139C7.84455 16.0067 9.93184 17.0127 11.998 17.0128C14.0641 17.0128 16.1521 16.0068 16.5312 15.7139V11.8575L16.5107 11.752C16.0667 11.9423 15.5362 12.0167 14.9453 12.0167C13.9068 12.0167 13.0792 11.72 12.4893 11.1182C12.2948 10.9183 12.1301 10.6911 12 10.4444ZM10.3594 12.9542C10.5458 12.9542 10.7246 13.0284 10.8564 13.1602C10.9883 13.292 11.0624 13.4709 11.0625 13.6573V15.0645C11.0625 15.251 10.9882 15.4297 10.8564 15.5616C10.7246 15.6935 10.5459 15.7677 10.3594 15.7677C10.1729 15.7677 9.99417 15.6935 9.8623 15.5616C9.73051 15.4297 9.65625 15.251 9.65625 15.0645V13.6573C9.65631 13.4709 9.7305 13.292 9.8623 13.1602C9.99415 13.0284 10.173 12.9542 10.3594 12.9542ZM13.6406 12.9542C13.827 12.9542 14.0058 13.0284 14.1377 13.1602C14.2695 13.292 14.3437 13.4709 14.3438 13.6573V15.0645C14.3438 15.251 14.2695 15.4297 14.1377 15.5616C14.0058 15.6935 13.8271 15.7677 13.6406 15.7677C13.4541 15.7677 13.2754 15.6935 13.1436 15.5616C13.0118 15.4297 12.9375 15.251 12.9375 15.0645V13.6573C12.9376 13.4709 13.0117 13.292 13.1436 13.1602C13.2754 13.0284 13.4542 12.9542 13.6406 12.9542ZM10.8779 7.29695C10.7029 7.11036 10.3001 6.92332 9.35352 7.0284C8.43074 7.13076 8.01391 7.39411 7.80176 7.66218C7.57791 7.94493 7.4668 8.37808 7.4668 9.07136C7.46685 9.7897 7.58391 10.1323 7.74609 10.3136C7.89295 10.4775 8.21657 10.6573 9.05273 10.6573C9.82577 10.6573 10.2661 10.4435 10.5371 10.1671C10.8225 9.87525 11.0151 9.4177 11.0967 8.75984C11.2027 7.91266 11.0628 7.4954 10.8779 7.29695ZM14.6436 7.0284C13.6978 6.92331 13.2951 7.11033 13.1201 7.29695C12.9353 7.4954 12.7944 7.91267 12.9004 8.75984C12.9828 9.41765 13.1756 9.87525 13.4609 10.1671C13.7319 10.4435 14.1714 10.6573 14.9453 10.6573C15.7806 10.6573 16.1051 10.4775 16.252 10.3136C16.4141 10.1323 16.5312 9.7897 16.5312 9.07136C16.5312 8.37808 16.4201 7.94493 16.1963 7.66218C15.9851 7.39397 15.5678 7.1308 14.6436 7.0284Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.626 6.8702C13.244 6.2078 14.2011 6.0554 15.2939 6.1768C16.4085 6.301 17.238 6.6552 17.7627 7.3194C18.2756 7.9674 18.3906 8.7829 18.3906 9.5714C18.3906 10.0895 18.3422 10.6112 18.1602 11.0714C18.2199 11.2779 18.249 11.4603 18.2744 11.6261C18.2853 11.6949 18.2968 11.7609 18.3086 11.8243C19.1457 12.1734 19.6875 13.1574 19.75 13.7227V15.419C19.7497 16.1134 16.7128 18.8585 12.498 18.8585C8.3645 18.8584 5.3643 16.2182 5.25 15.461V13.6954C5.327 13.1263 5.8639 12.1678 6.6894 11.8243C6.7012 11.7609 6.7108 11.694 6.7217 11.6261C6.748 11.4603 6.7762 11.2779 6.8359 11.0714C6.6539 10.6112 6.6055 10.0895 6.6055 9.5714C6.6055 8.7829 6.7214 7.9674 7.2334 7.3194C7.7581 6.6552 8.5876 6.301 9.7021 6.1768C10.795 6.0554 11.752 6.2079 12.3701 6.8702C12.4154 6.9181 12.4572 6.968 12.4961 7.0196C12.536 6.968 12.5816 6.9182 12.626 6.8702ZM12.5 10.9444C12.3686 11.1912 12.2024 11.4184 12.0068 11.6182C11.4178 12.2199 10.5902 12.5167 9.5508 12.5167C8.9601 12.5167 8.4312 12.4423 7.9863 12.252L7.9648 12.3575V16.2139C8.3445 16.5067 10.4318 17.5127 12.498 17.5128C14.5641 17.5128 16.6521 16.5068 17.0312 16.2139V12.3575L17.0107 12.252C16.5667 12.4423 16.0362 12.5167 15.4453 12.5167C14.4068 12.5167 13.5792 12.22 12.9893 11.6182C12.7948 11.4183 12.6301 11.1911 12.5 10.9444ZM10.8594 13.4542C11.0458 13.4542 11.2246 13.5284 11.3564 13.6602C11.4883 13.792 11.5624 13.9709 11.5625 14.1573V15.5645C11.5625 15.751 11.4882 15.9297 11.3564 16.0616C11.2246 16.1935 11.0459 16.2677 10.8594 16.2677C10.6729 16.2677 10.4942 16.1935 10.3623 16.0616C10.2305 15.9297 10.1562 15.751 10.1562 15.5645V14.1573C10.1563 13.9709 10.2305 13.792 10.3623 13.6602C10.4941 13.5284 10.673 13.4542 10.8594 13.4542ZM14.1406 13.4542C14.327 13.4542 14.5058 13.5284 14.6377 13.6602C14.7695 13.792 14.8437 13.9709 14.8438 14.1573V15.5645C14.8438 15.751 14.7695 15.9297 14.6377 16.0616C14.5058 16.1935 14.3271 16.2677 14.1406 16.2677C13.9541 16.2677 13.7754 16.1935 13.6436 16.0616C13.5118 15.9297 13.4375 15.751 13.4375 15.5645V14.1573C13.4376 13.9709 13.5117 13.792 13.6436 13.6602C13.7754 13.5284 13.9542 13.4542 14.1406 13.4542ZM11.3779 7.7969C11.2029 7.6104 10.8001 7.4233 9.8535 7.5284C8.9307 7.6308 8.5139 7.8941 8.3018 8.1622C8.0779 8.4449 7.9668 8.8781 7.9668 9.5714C7.9668 10.2897 8.0839 10.6323 8.2461 10.8136C8.3929 10.9775 8.7166 11.1573 9.5527 11.1573C10.3258 11.1573 10.7661 10.9435 11.0371 10.6671C11.3225 10.3752 11.5151 9.9177 11.5967 9.2598C11.7027 8.4127 11.5628 7.9954 11.3779 7.7969ZM15.1436 7.5284C14.1978 7.4233 13.7951 7.6103 13.6201 7.7969C13.4353 7.9954 13.2944 8.4127 13.4004 9.2598C13.4828 9.9177 13.6756 10.3752 13.9609 10.6671C14.2319 10.9435 14.6714 11.1573 15.4453 11.1573C16.2806 11.1573 16.6051 10.9775 16.752 10.8136C16.9141 10.6323 17.0312 10.2897 17.0312 9.5714C17.0312 8.8781 16.9201 8.4449 16.6963 8.1622C16.4851 7.894 16.0678 7.6308 15.1436 7.5284Z" fill="currentColor" fill-opacity="0.64"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.9 KiB |
3
apps/web/src/assets/icons/ai-credits-small.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5005 7C15.5379 7.0002 18.0005 9.4625 18.0005 12.5C18.0005 15.5375 15.5379 17.9998 12.5005 18C9.4629 18 7.0005 15.5376 7.0005 12.5C7.0005 9.4624 9.4629 7 12.5005 7ZM12.5005 8C10.0152 8 8.0005 10.0147 8.0005 12.5C8.0005 14.9853 10.0152 17 12.5005 17C14.9856 16.9998 17.0005 14.9852 17.0005 12.5C17.0005 10.0148 14.9856 8.0002 12.5005 8ZM12.1118 10.0518C12.2131 9.6483 12.7869 9.6483 12.8882 10.0518L13.0093 10.5361C13.1885 11.2525 13.7479 11.8121 14.4644 11.9912L14.9478 12.1123C15.3516 12.2133 15.3516 12.7867 14.9478 12.8877L14.4644 13.0088C13.7479 13.1879 13.1885 13.7475 13.0093 14.4639L12.8882 14.9482C12.7869 15.3517 12.2131 15.3517 12.1118 14.9482L11.9907 14.4639C11.8115 13.7475 11.2521 13.1879 10.5356 13.0088L10.0523 12.8877C9.6484 12.7867 9.6484 12.2133 10.0523 12.1123L10.5356 11.9912C11.2521 11.8121 11.8115 11.2525 11.9907 10.5361L12.1118 10.0518Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 976 B |
4
apps/web/src/assets/icons/ai-credits.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12.5" cy="12.5" r="6" stroke="currentColor"/>
|
||||
<path d="M12.5 9Q13.7 11.3 16 12.5Q13.7 13.7 12.5 16Q11.3 13.7 9 12.5Q11.3 11.3 12.5 9Z" stroke="currentColor" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 275 B |
@ -1,3 +1,5 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.2998 15.1279C8.1673 15.1279 8.87081 15.8318 8.87109 16.6992C8.87109 17.5669 8.16747 18.2705 7.2998 18.2705C6.43219 18.2704 5.72852 17.5668 5.72852 16.6992C5.7288 15.8318 6.43237 15.128 7.2998 15.1279ZM12 6.02832C12.2383 6.02832 12.469 6.11239 12.6523 6.26465C12.8353 6.41668 12.96 6.62752 13.0039 6.86133L13.5811 9.91797H13.582C13.6055 10.042 13.6656 10.1559 13.7549 10.2451C13.8441 10.3344 13.958 10.3945 14.082 10.418V10.4189L17.1387 10.9961H17.1377C17.3719 11.0398 17.5831 11.1644 17.7354 11.3477C17.8876 11.531 17.9717 11.7617 17.9717 12C17.9717 12.2383 17.8876 12.469 17.7354 12.6523C17.5832 12.8355 17.3718 12.9591 17.1377 13.0029L14.082 13.5811V13.582C13.958 13.6055 13.8441 13.6656 13.7549 13.7549C13.6656 13.8441 13.6055 13.958 13.582 14.082H13.5811L13.0039 17.1387C12.96 17.3725 12.8353 17.5833 12.6523 17.7354C12.469 17.8876 12.2383 17.9717 12 17.9717C11.7617 17.9717 11.531 17.8876 11.3477 17.7354C11.1647 17.5833 11.04 17.3725 10.9961 17.1387L10.4189 14.082H10.418C10.3945 13.958 10.3344 13.8441 10.2451 13.7549C10.1559 13.6656 10.042 13.6055 9.91797 13.582V13.5811L6.86133 13.0039V13.0029C6.62759 12.959 6.41664 12.8353 6.26465 12.6523C6.11239 12.469 6.02832 12.2383 6.02832 12C6.02832 11.7617 6.11239 11.531 6.26465 11.3477C6.41668 11.1647 6.62752 11.04 6.86133 10.9961L9.91797 10.4189V10.418C10.042 10.3945 10.1559 10.3344 10.2451 10.2451C10.3344 10.1559 10.3945 10.042 10.418 9.91797H10.4189L10.9961 6.86133C11.04 6.62752 11.1647 6.41668 11.3477 6.26465C11.531 6.11239 11.7617 6.02832 12 6.02832ZM7.2998 16.0713C6.95297 16.0714 6.67215 16.3524 6.67188 16.6992C6.67188 17.0462 6.9528 17.3281 7.2998 17.3281C7.64687 17.3281 7.92871 17.0463 7.92871 16.6992C7.92843 16.3524 7.6467 16.0713 7.2998 16.0713ZM12 6.97168C11.9818 6.97168 11.9642 6.97771 11.9502 6.98926C11.9362 7.00091 11.9263 7.01725 11.9229 7.03516V7.03613L11.3447 10.0928C11.2861 10.4031 11.1354 10.6888 10.9121 10.9121C10.6888 11.1354 10.4031 11.2861 10.0928 11.3447L7.03613 11.9229H7.03516C7.01725 11.9263 7.00091 11.9362 6.98926 11.9502C6.97771 11.9642 6.97168 11.9818 6.97168 12C6.97168 12.0182 6.97771 12.0358 6.98926 12.0498C7.00091 12.0638 7.01725 12.0737 7.03516 12.0771H7.03613L10.0928 12.6553C10.4031 12.7139 10.6888 12.8646 10.9121 13.0879C11.1354 13.3112 11.2861 13.5969 11.3447 13.9072L11.9229 16.9639V16.9648C11.9263 16.9827 11.9362 16.9991 11.9502 17.0107C11.9642 17.0223 11.9818 17.0283 12 17.0283C12.0182 17.0283 12.0358 17.0223 12.0498 17.0107C12.0638 16.9991 12.0737 16.9827 12.0771 16.9648V16.9639L12.6553 13.9072C12.7139 13.5969 12.8646 13.3112 13.0879 13.0879C13.3112 12.8646 13.5969 12.7139 13.9072 12.6553L16.9639 12.0771H16.9648C16.9827 12.0737 16.9991 12.0638 17.0107 12.0498C17.0223 12.0358 17.0283 12.0182 17.0283 12C17.0283 11.9818 17.0223 11.9642 17.0107 11.9502C16.9991 11.9362 16.9827 11.9263 16.9648 11.9229H16.9639L13.9072 11.3447C13.5969 11.2861 13.3112 11.1354 13.0879 10.9121C12.8646 10.6888 12.7139 10.4031 12.6553 10.0928L12.0771 7.03613V7.03516C12.0737 7.01725 12.0638 7.00091 12.0498 6.98926C12.0358 6.97771 12.0182 6.97168 12 6.97168ZM16.8496 5.73047C17.1099 5.73047 17.3213 5.94282 17.3213 6.20312V6.97852H18.1025C18.3625 6.97878 18.5741 7.19019 18.5742 7.4502C18.574 7.71012 18.3625 7.92161 18.1025 7.92188H17.3213V8.70312C17.3208 8.96299 17.1096 9.1748 16.8496 9.1748C16.5898 9.17459 16.3784 8.96286 16.3779 8.70312V7.92188H15.6025C15.3424 7.92188 15.1301 7.71028 15.1299 7.4502C15.13 7.19003 15.3423 6.97852 15.6025 6.97852H16.3779V6.20312C16.3779 5.94295 16.5895 5.73068 16.8496 5.73047Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 7L13.55 10.58Q13.75 11.25 14.42 11.45L18 12.5L14.42 13.55Q13.75 13.75 13.55 14.42L12.5 18L11.45 14.42Q11.25 13.75 10.58 13.55L7 12.5L10.58 11.45Q11.25 11.25 11.45 10.58Z" stroke="currentColor" stroke-linejoin="round"/>
|
||||
<circle cx="7.5" cy="17.5" r="1" stroke="currentColor"/>
|
||||
<path d="M17.5 6.5V8.5M16.5 7.5H18.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 456 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.7459 8.9822C17.7929 10.0294 17.7928 11.7273 16.7459 12.7746L12.5032 17.0173C12.2726 17.2479 12.2727 17.622 12.5032 17.8528L13.2753 18.6248C13.4702 18.82 13.4701 19.1367 13.2753 19.3319C13.0801 19.5271 12.7634 19.527 12.5681 19.3319L11.7961 18.5599C11.1751 17.9386 11.1749 16.9314 11.7961 16.3101L16.0388 12.0675C16.6952 11.4108 16.6952 10.346 16.0388 9.68931C15.3821 9.03268 14.3174 9.03283 13.6606 9.68931L10.1893 13.1606C10.0673 13.2826 9.89726 13.3285 9.73972 13.298C9.67674 13.2858 9.61559 13.2614 9.56018 13.2248C9.53235 13.2065 9.50595 13.1844 9.48146 13.1599C9.37064 13.0488 9.32521 12.8988 9.34059 12.7539C9.34548 12.7081 9.35415 12.6625 9.37166 12.6192C9.38393 12.5889 9.39944 12.5595 9.41793 12.5315C9.43618 12.504 9.45715 12.4771 9.48146 12.4528L12.9528 8.98151C13.6093 8.3247 13.6095 7.26001 12.9528 6.60331C12.296 5.94704 11.2312 5.94696 10.5746 6.60331L5.56061 11.6173C5.36534 11.8125 5.04876 11.8125 4.8535 11.6173C4.65853 11.422 4.65834 11.1053 4.8535 10.9102L9.86747 5.89621C10.9147 4.84933 12.6126 4.84941 13.6599 5.89621C14.2967 6.53303 14.5433 7.41035 14.4057 8.23574C15.2312 8.09786 16.1089 8.34526 16.7459 8.9822ZM15.2032 10.5249C15.3984 10.7201 15.3984 11.0367 15.2032 11.232L11.7319 14.7033C10.6846 15.7505 8.98679 15.7506 7.93949 14.7033C6.89243 13.656 6.89232 11.9581 7.93949 10.9109L11.4108 7.43955C11.606 7.24445 11.9227 7.24443 12.1179 7.43955C12.3131 7.63477 12.313 7.95138 12.1179 8.14666L8.6466 11.618C7.98995 12.2747 7.99006 13.3394 8.6466 13.9962C9.30337 14.6529 10.368 14.6529 11.0248 13.9962L14.4961 10.5249C14.6913 10.3298 15.008 10.33 15.2032 10.5249Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.2459 9.4822C18.2929 10.5294 18.2928 12.2273 17.2459 13.2746L13.0032 17.5173C12.7726 17.7479 12.7727 18.122 13.0032 18.3528L13.7753 19.1248C13.9702 19.32 13.9701 19.6367 13.7753 19.8319C13.5801 20.0271 13.2634 20.027 13.0681 19.8319L12.2961 19.0599C11.6751 18.4386 11.6749 17.4314 12.2961 16.8101L16.5388 12.5675C17.1952 11.9108 17.1952 10.846 16.5388 10.1893C15.8821 9.5327 14.8174 9.5328 14.1606 10.1893L10.6893 13.6606C10.5673 13.7826 10.3973 13.8285 10.2397 13.798C10.1767 13.7858 10.1156 13.7614 10.0602 13.7248C10.0323 13.7065 10.006 13.6844 9.9815 13.6599C9.8706 13.5488 9.8252 13.3988 9.8406 13.2539C9.8455 13.2081 9.8542 13.1625 9.8717 13.1192C9.8839 13.0889 9.8994 13.0595 9.9179 13.0315C9.9362 13.004 9.9572 12.9771 9.9815 12.9528L13.4528 9.4815C14.1093 8.8247 14.1095 7.76 13.4528 7.1033C12.796 6.447 11.7312 6.447 11.0746 7.1033L6.0606 12.1173C5.8653 12.3125 5.5488 12.3125 5.3535 12.1173C5.1585 11.922 5.1583 11.6053 5.3535 11.4102L10.3675 6.3962C11.4147 5.3493 13.1126 5.3494 14.1599 6.3962C14.7967 7.033 15.0433 7.9104 14.9057 8.7357C15.7312 8.5979 16.6089 8.8453 17.2459 9.4822ZM15.7032 11.0249C15.8984 11.2201 15.8984 11.5367 15.7032 11.732L12.2319 15.2033C11.1846 16.2505 9.4868 16.2506 8.4395 15.2033C7.3924 14.156 7.3923 12.4581 8.4395 11.4109L11.9108 7.9395C12.106 7.7444 12.4227 7.7444 12.6179 7.9395C12.8131 8.1348 12.813 8.4514 12.6179 8.6467L9.1466 12.118C8.49 12.7747 8.4901 13.8394 9.1466 14.4962C9.8034 15.1529 10.868 15.1529 11.5248 14.4962L14.9961 11.0249C15.1913 10.8298 15.508 10.83 15.7032 11.0249Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.6 KiB |
4
apps/web/src/assets/icons/ai.edit-with-prompt.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.5 7.5L7.5 15.5V17.5H9.5L17.5 9.5A1.4142 1.4142 0 0 0 15.5 7.5ZM14.5 8.5L16.5 10.5M13.5 17.5H18.5M15.5 14.5H18.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M8.01 5.44C8.14 4.94 8.86 4.94 8.99 5.44L9.3 6.7L10.56 7.01C11.06 7.14 11.06 7.86 10.56 7.99L9.3 8.3L8.99 9.56C8.86 10.06 8.14 10.06 8.01 9.56L7.7 8.3L6.44 7.99C5.94 7.86 5.94 7.14 6.44 7.01L7.7 6.7Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 509 B |
5
apps/web/src/assets/icons/ai.remove-background.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.5 9.5V8.5A1 1 0 0 1 8.5 7.5H9.5M11.5 7.5H13.5M17.5 11.5V12.5M7.5 16V16.5A1 1 0 0 0 8.5 17.5H9.5M11.5 17.5H13.5M7.5 11.5V14.5L9.5 12.5L13 16M12.5 15.5L15.5 12.5L17.5 14.5V16.5A1 1 0 0 1 16.5 17.5H15.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<circle cx="12.5" cy="10.5" r="1" stroke="currentColor"/>
|
||||
<path d="M17.01 5.44C17.14 4.94 17.86 4.94 17.99 5.44L18.3 6.7L19.56 7.01C20.06 7.14 20.06 7.86 19.56 7.99L18.3 8.3L17.99 9.56C17.86 10.06 17.14 10.06 17.01 9.56L16.7 8.3L15.44 7.99C14.94 7.86 14.94 7.14 15.44 7.01L16.7 6.7Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 670 B |
4
apps/web/src/assets/icons/ai.remove-silences.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 6.5V18.5M10.5 7.5H9A1.5 1.5 0 0 0 7.5 9V16A1.5 1.5 0 0 0 9 17.5H10.5M17.5 10.5V16A1.5 1.5 0 0 1 16 17.5H14.5M9.5 11.5V13.5M15.5 11.5V13.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M16.01 4.44C16.14 3.94 16.86 3.94 16.99 4.44L17.3 5.7L18.56 6.01C19.06 6.14 19.06 6.86 18.56 6.99L17.3 7.3L16.99 8.56C16.86 9.06 16.14 9.06 16.01 8.56L15.7 7.3L14.44 6.99C13.94 6.86 13.94 6.14 14.44 6.01L15.7 5.7Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 551 B |
@ -1,3 +1,5 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.0007 17.9998C8.68737 17.9998 6.00098 15.3134 6.00098 11.9995C6.00098 8.68615 8.68738 5.99976 12.0007 5.99976C15.3146 5.99976 18.001 8.68615 18.001 11.9995C18.001 15.3134 15.3146 17.9998 12.0007 17.9998ZM12.0007 17.0999C12.6751 17.1072 13.3443 16.9807 13.9695 16.7277C14.5946 16.4746 15.1634 16.1001 15.6429 15.6258C16.1224 15.1515 16.5031 14.5868 16.7629 13.9644C17.0227 13.342 17.1564 12.6742 17.1564 11.9998C17.1564 11.3253 17.0227 10.6575 16.7629 10.0351C16.5031 9.41272 16.1224 8.84802 15.6429 8.3737C15.1634 7.89938 14.5946 7.52487 13.9695 7.27185C13.3443 7.01882 12.6751 6.89231 12.0007 6.89962C10.6576 6.91419 9.37451 7.45793 8.42994 8.41281C7.48536 9.36769 6.95556 10.6566 6.95556 11.9998C6.95556 13.3429 7.48536 14.6318 8.42994 15.5867C9.37451 16.5416 10.6576 17.0853 12.0007 17.0999ZM12.0019 12.8999C11.8825 12.8999 11.7681 12.8525 11.6837 12.7681C11.5993 12.6838 11.5519 12.5693 11.5519 12.45L11.5519 9.45044C11.5519 9.33111 11.5993 9.21667 11.6837 9.13229C11.7681 9.04791 11.8825 9.0005 12.0019 9.0005C12.1212 9.0005 12.2356 9.04791 12.32 9.13229C12.4044 9.21667 12.4518 9.33111 12.4518 9.45044L12.4518 12.45C12.4518 12.5693 12.4044 12.6838 12.32 12.7681C12.2356 12.8525 12.1212 12.8999 12.0019 12.8999ZM12.0019 13.7998C11.8428 13.7998 11.6902 13.863 11.5777 13.9755C11.4652 14.088 11.402 14.2406 11.402 14.3997C11.402 14.5588 11.4652 14.7114 11.5777 14.8239C11.6902 14.9364 11.8428 14.9996 12.0019 14.9996C12.161 14.9996 12.3136 14.9364 12.4261 14.8239C12.5386 14.7114 12.6018 14.5588 12.6018 14.3997C12.6018 14.2406 12.5386 14.088 12.4261 13.9755C12.3136 13.863 12.161 13.7998 12.0019 13.7998Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12.5" cy="12.5" r="6" stroke="currentColor"/>
|
||||
<path d="M12.5 9.5V12.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<circle cx="12.5" cy="14.5" r="0.6" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 268 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.333 6.83468C12.333 6.75441 12.3136 6.67532 12.2766 6.60411C12.2395 6.5329 12.1859 6.47166 12.1201 6.42556C12.0544 6.37946 11.9786 6.34986 11.899 6.33927C11.8194 6.32867 11.7385 6.33738 11.663 6.36468L7.10301 8.01468C6.87753 8.0962 6.68264 8.24521 6.54486 8.44144C6.40708 8.63767 6.33311 8.87158 6.33301 9.11134V13.166C6.33304 13.2463 6.3524 13.3254 6.38945 13.3966C6.4265 13.4678 6.48015 13.529 6.54587 13.5751C6.61158 13.6212 6.68743 13.6508 6.767 13.6614C6.84657 13.672 6.92752 13.6633 7.00301 13.636L7.33301 13.5167V14.58C7.10683 14.66 6.86477 14.6845 6.62715 14.6516C6.38952 14.6187 6.16326 14.5292 5.96734 14.3908C5.77143 14.2523 5.61157 14.0689 5.5012 13.8559C5.39083 13.6429 5.33315 13.4066 5.33301 13.1667V9.11068C5.33301 8.66536 5.47023 8.23087 5.72598 7.86632C5.98174 7.50177 6.34361 7.22489 6.76234 7.07334L11.3223 5.42334C11.549 5.34129 11.792 5.31506 12.0309 5.34685C12.2698 5.37865 12.4975 5.46754 12.6948 5.606C12.892 5.74447 13.053 5.92842 13.1641 6.1423C13.2752 6.35617 13.3332 6.59367 13.333 6.83468V6.95268L12.333 7.31468V6.83468ZM14.9997 8.83468C14.9996 8.75441 14.9803 8.67532 14.9432 8.60411C14.9062 8.5329 14.8525 8.47166 14.7868 8.42556C14.7211 8.37946 14.6453 8.34986 14.5657 8.33927C14.4861 8.32867 14.4052 8.33738 14.3297 8.36468L9.54967 10.0933C9.38851 10.1516 9.24923 10.2582 9.15081 10.3984C9.05238 10.5387 8.99961 10.706 8.99967 10.8773V15.1653C8.99971 15.2456 9.01907 15.3247 9.05612 15.3959C9.09317 15.4671 9.14682 15.5284 9.21253 15.5745C9.27825 15.6206 9.3541 15.6502 9.43367 15.6608C9.51323 15.6714 9.59419 15.6626 9.66967 15.6353L9.99967 15.5167V16.5807C9.77339 16.6607 9.53122 16.6852 9.29348 16.6522C9.05575 16.6192 8.82941 16.5297 8.63346 16.3911C8.43752 16.2525 8.27769 16.0689 8.16741 15.8557C8.05712 15.6425 7.9996 15.406 7.99967 15.166V10.878C7.99951 10.5011 8.11553 10.1333 8.33193 9.82466C8.54833 9.51605 8.85459 9.28163 9.20901 9.15334L13.989 7.42334C14.2156 7.34129 14.4587 7.31506 14.6976 7.34685C14.9365 7.37865 15.1642 7.46754 15.3615 7.606C15.5587 7.74447 15.7197 7.92842 15.8308 8.1423C15.9419 8.35617 15.9998 8.59367 15.9997 8.83468V8.95268L14.9997 9.31468V8.83468ZM16.9963 10.3647C17.0718 10.3374 17.1528 10.3287 17.2324 10.3393C17.3119 10.3499 17.3878 10.3795 17.4535 10.4256C17.5192 10.4717 17.5728 10.5329 17.6099 10.6041C17.6469 10.6753 17.6663 10.7544 17.6663 10.8347V15.3567C17.6663 15.4594 17.6346 15.5597 17.5755 15.6438C17.5165 15.7279 17.433 15.7917 17.3363 15.8267L12.3363 17.636C12.2609 17.6633 12.1799 17.672 12.1003 17.6614C12.0208 17.6508 11.9449 17.6212 11.8792 17.5751C11.8135 17.529 11.7598 17.4678 11.7228 17.3966C11.6857 17.3254 11.6664 17.2463 11.6663 17.166V12.644C11.6664 12.5413 11.6981 12.441 11.7571 12.3569C11.8162 12.2728 11.8997 12.2089 11.9963 12.174L16.9963 10.3647ZM18.6663 10.8347C18.6664 10.5937 18.6084 10.3563 18.4972 10.1425C18.3861 9.92873 18.2251 9.74487 18.0278 9.60648C17.8306 9.46809 17.6029 9.37926 17.3641 9.3475C17.1252 9.31573 16.8822 9.34198 16.6557 9.42401L11.6557 11.2333C11.3658 11.3383 11.1153 11.53 10.9383 11.7825C10.7612 12.0349 10.6663 12.3357 10.6663 12.644V17.166C10.6663 17.407 10.7243 17.6444 10.8354 17.8582C10.9466 18.072 11.1076 18.2558 11.3048 18.3942C11.5021 18.5326 11.7298 18.6214 11.9686 18.6532C12.2075 18.685 12.4504 18.6587 12.677 18.5767L17.677 16.7673C17.9669 16.6624 18.2174 16.4706 18.3944 16.2182C18.5715 15.9658 18.6664 15.665 18.6663 15.3567V10.8347Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.4 14.3214L6.2063 14.7477Q5.5 15 5.5 14.25V9.25Q5.5 8.5 6.2063 8.2477L11.7937 6.2523Q12.5 6 12.5 6.75V7.9405M10.4 16.3214L9.2063 16.7477Q8.5 17 8.5 16.25V11.25Q8.5 10.5 9.2063 10.2477L14.7937 8.2523Q15.5 8 15.5 8.75V9.9405M11.5 13.25Q11.5 12.5 12.2063 12.2477L17.7937 10.2523Q18.5 10 18.5 10.75V15.75Q18.5 16.5 17.7937 16.7523L12.2063 18.7477Q11.5 19 11.5 18.25Z" stroke="currentColor" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 503 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.83 7.88C14.476 7.88015 14.9999 8.40392 14.9999 9.05V11.1199L18.6249 11.1199C19.108 11.1199 19.4996 11.5119 19.4999 11.9949C19.4997 12.478 19.108 12.8699 18.6249 12.8699L14.9999 12.8699V14.95C14.9999 15.5961 14.476 16.1199 13.83 16.12H10.1708C9.52461 16.12 8.99989 15.5962 8.99988 14.95V12.8699H5.37488C4.89187 12.8698 4.50007 12.4779 4.49988 11.9949C4.50014 11.512 4.89191 11.1201 5.37488 11.1199H8.99988V9.05C8.99988 8.40383 9.5246 7.88 10.1708 7.88H13.83Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5.5 12.5H19.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="10" y="8" width="5" height="9" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 221 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 3.125C12.4832 3.125 12.875 3.51675 12.875 4V8.49023H14.3398C14.986 8.49023 15.5098 9.01398 15.5098 9.66016V11.125H20C20.4832 11.125 20.875 11.5168 20.875 12C20.875 12.4832 20.4832 12.875 20 12.875H15.5098V14.3398C15.5098 14.986 14.986 15.5098 14.3398 15.5098H9.66016C9.01398 15.5098 8.49023 14.986 8.49023 14.3398V9.66016C8.49023 9.01398 9.01398 8.49023 9.66016 8.49023H11.125V4C11.125 3.51675 11.5168 3.125 12 3.125Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 9V4.5M16 12.5H20.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="9" y="9" width="7" height="7" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 230 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 3.125C11.5168 3.125 11.125 3.51675 11.125 4V8.49023H9.66016C9.01398 8.49023 8.49023 9.01398 8.49023 9.66016V11.125H4C3.51675 11.125 3.125 11.5168 3.125 12C3.125 12.4832 3.51675 12.875 4 12.875H8.49023V14.3398C8.49023 14.986 9.01398 15.5098 9.66016 15.5098H14.3398C14.986 15.5098 15.5098 14.986 15.5098 14.3398V9.66016C15.5098 9.01398 14.986 8.49023 14.3398 8.49023H12.875V4C12.875 3.51675 12.4832 3.125 12 3.125Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 9V4.5M9 12.5H4.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="9" y="9" width="7" height="7" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 228 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 4.5C12.4832 4.5 12.875 4.89175 12.875 5.375V8.22559C14.3122 8.55743 15.4426 9.68776 15.7744 11.125H18.625C19.1082 11.125 19.5 11.5168 19.5 12C19.5 12.4832 19.1082 12.875 18.625 12.875H15.7744C15.4426 14.3122 14.3122 15.4426 12.875 15.7744V18.625C12.875 19.1082 12.4832 19.5 12 19.5C11.5168 19.5 11.125 19.1082 11.125 18.625V15.7744C9.68776 15.4426 8.55743 14.3122 8.22559 12.875H5.375C4.89175 12.875 4.5 12.4832 4.5 12C4.5 11.5168 4.89175 11.125 5.375 11.125H8.22559C8.55743 9.68776 9.68776 8.55743 11.125 8.22559V5.375C11.125 4.89175 11.5168 4.5 12 4.5ZM12 9.875C10.8264 9.875 9.875 10.8264 9.875 12C9.875 13.1736 10.8264 14.125 12 14.125C13.1736 14.125 14.125 13.1736 14.125 12C14.125 10.8264 13.1736 9.875 12 9.875Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 5.5V9.5M12.5 15.5V19.5M5.5 12.5H9.5M15.5 12.5H19.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<circle cx="12.5" cy="12.5" r="3" stroke="currentColor" stroke-width="2"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 835 B After Width: | Height: | Size: 269 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 4.5C12.4832 4.5 12.875 4.89175 12.875 5.375V9H14.9499C15.5958 9.00015 16.1197 9.52402 16.1199 10.1699V13.8301C16.1197 14.476 15.5958 14.9999 14.9499 15H12.875V18.625C12.875 19.1082 12.4832 19.5 12 19.5C11.5167 19.5 11.125 19.1082 11.125 18.625V15H9.05C8.40408 14.9999 7.8901 14.476 7.88989 13.8301V10.1699C7.8901 9.52402 8.40408 9.00015 9.05 9H11.125V5.375C11.125 4.89175 11.5167 4.5 12 4.5Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 5.5V19.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="8" y="10" width="9" height="5" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 221 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 4.5C12.4832 4.5 12.875 4.89175 12.875 5.375V9H14.9499C15.5958 9.00015 16.1197 9.52402 16.1199 10.1699V13.8301C16.1197 14.476 15.5958 14.9999 14.9499 15H12.875V18.625C12.875 19.1082 12.4832 19.5 12 19.5C11.5167 19.5 11.125 19.1082 11.125 18.625V15H9.04989C8.40398 14.9999 7.8901 14.476 7.88989 13.8301V10.1699C7.8901 9.52402 8.40398 9.00015 9.04989 9H11.125V5.375C11.125 4.89175 11.5167 4.5 12 4.5Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 5.5V19.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="8" y="10" width="9" height="5" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 221 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.83 7.88C14.476 7.88015 14.9999 8.40392 14.9999 9.05V11.1199L18.6249 11.1199C19.108 11.1199 19.4996 11.5119 19.4999 11.9949C19.4997 12.478 19.108 12.8699 18.6249 12.8699H14.9999V14.95C14.9999 15.5961 14.476 16.1199 13.83 16.12H10.1708C9.52461 16.12 8.99989 15.5962 8.99988 14.95V12.8699H5.37488C4.89187 12.8698 4.50007 12.4779 4.49988 11.9949C4.50014 11.512 4.89191 11.1201 5.37488 11.1199H8.99988V9.05C8.99988 8.40383 9.5246 7.88 10.1708 7.88H13.83Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5.5 12.5H19.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="10" y="8" width="5" height="9" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 566 B After Width: | Height: | Size: 221 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 20.875C12.4832 20.875 12.875 20.4832 12.875 20V15.5098H14.3398C14.986 15.5098 15.5098 14.986 15.5098 14.3398V12.875H20C20.4832 12.875 20.875 12.4832 20.875 12C20.875 11.5168 20.4832 11.125 20 11.125H15.5098V9.66016C15.5098 9.01398 14.986 8.49023 14.3398 8.49023H9.66016C9.01398 8.49023 8.49023 9.01398 8.49023 9.66016V14.3398C8.49023 14.986 9.01398 15.5098 9.66016 15.5098H11.125V20C11.125 20.4832 11.5168 20.875 12 20.875Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 16V20.5M16 12.5H20.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="9" y="9" width="7" height="7" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 232 B |
@ -1,3 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 20.875C11.5168 20.875 11.125 20.4832 11.125 20V15.5098H9.66016C9.01398 15.5098 8.49023 14.986 8.49023 14.3398V12.875H4C3.51675 12.875 3.125 12.4832 3.125 12C3.125 11.5168 3.51675 11.125 4 11.125H8.49023V9.66016C8.49023 9.01398 9.01398 8.49023 9.66016 8.49023H14.3398C14.986 8.49023 15.5098 9.01398 15.5098 9.66016V14.3398C15.5098 14.986 14.986 15.5098 14.3398 15.5098H12.875V20C12.875 20.4832 12.4832 20.875 12 20.875Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 16V20.5M9 12.5H4.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
<rect x="9" y="9" width="7" height="7" rx="1" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 230 B |
@ -1,3 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 842.32007 1000.0001">
|
||||
<path fill="currentColor" d="M824.66636 779.30363c-15.12299 34.93724-33.02368 67.09674-53.7638 96.66374-28.27076 40.3074-51.4182 68.2078-69.25717 83.7012-27.65347 25.4313-57.2822 38.4556-89.00964 39.1963-22.77708 0-50.24539-6.4813-82.21973-19.629-32.07926-13.0861-61.55985-19.5673-88.51583-19.5673-28.27075 0-58.59083 6.4812-91.02193 19.5673-32.48053 13.1477-58.64639 19.9994-78.65196 20.6784-30.42501 1.29623-60.75123-12.0985-91.02193-40.2457-19.32039-16.8514-43.48632-45.7394-72.43607-86.6641-31.060778-43.7024-56.597041-94.37983-76.602609-152.15586C10.740416 658.44309 0 598.01283 0 539.50845c0-67.01648 14.481044-124.8172 43.486336-173.25401C66.28194 327.34823 96.60818 296.6578 134.5638 274.1276c37.95566-22.53016 78.96676-34.01129 123.1321-34.74585 24.16591 0 55.85633 7.47508 95.23784 22.166 39.27042 14.74029 64.48571 22.21538 75.54091 22.21538 8.26518 0 36.27668-8.7405 83.7629-26.16587 44.90607-16.16001 82.80614-22.85118 113.85458-20.21546 84.13326 6.78992 147.34122 39.95559 189.37699 99.70686-75.24463 45.59122-112.46573 109.4473-111.72502 191.36456.67899 63.8067 23.82643 116.90384 69.31888 159.06309 20.61664 19.56727 43.64066 34.69027 69.2571 45.4307-5.55531 16.11062-11.41933 31.54225-17.65372 46.35662zM631.70926 20.0057c0 50.01141-18.27108 96.70693-54.6897 139.92782-43.94932 51.38118-97.10817 81.07162-154.75459 76.38659-.73454-5.99983-1.16045-12.31444-1.16045-18.95003 0-48.01091 20.9006-99.39207 58.01678-141.40314 18.53027-21.27094 42.09746-38.95744 70.67685-53.0663C578.3158 9.00229 605.2903 1.31621 630.65988 0c.74076 6.68575 1.04938 13.37191 1.04938 20.00505z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
3
apps/web/src/assets/icons/arrow-bottom.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.1464 13.1464C7.9512 13.3417 7.9512 13.6583 8.1464 13.8535L12.1465 17.8536C12.3417 18.0488 12.6583 18.0488 12.8536 17.8536L16.8536 13.8535C17.0488 13.6583 17.0488 13.3417 16.8536 13.1464C16.6583 12.9512 16.3417 12.9512 16.1464 13.1464L13 16.2929L13 7.5C13 7.2239 12.7761 7 12.5 7C12.2239 7 12 7.2239 12 7.5L12 16.2929L8.8536 13.1464C8.6583 12.9512 8.3417 12.9512 8.1464 13.1464Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 533 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.3535 7.64645C11.1583 7.45118 10.8417 7.45118 10.6464 7.64645L6.6464 11.6465C6.4512 11.8417 6.4512 12.1583 6.6464 12.3536L10.6464 16.3536C10.8417 16.5488 11.1583 16.5488 11.3535 16.3536C11.5488 16.1583 11.5488 15.8417 11.3535 15.6464L8.2071 12.5H17C17.2761 12.5 17.5 12.2761 17.5 12C17.5 11.7239 17.2761 11.5 17 11.5H8.2071L11.3535 8.35355C11.5488 8.15829 11.5488 7.84171 11.3535 7.64645Z" fill="currentColor" />
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.8535 8.1464C11.6583 7.9512 11.3417 7.9512 11.1464 8.1464L7.1464 12.1465C6.9512 12.3417 6.9512 12.6583 7.1464 12.8536L11.1464 16.8536C11.3417 17.0488 11.6583 17.0488 11.8535 16.8536C12.0488 16.6583 12.0488 16.3417 11.8535 16.1464L8.7071 13H17.5C17.7761 13 18 12.7761 18 12.5C18 12.2239 17.7761 12 17.5 12H8.7071L11.8535 8.8536C12.0488 8.6583 12.0488 8.3417 11.8535 8.1464Z" fill="currentColor" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 529 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5173 8.51706C12.6735 8.36085 12.9267 8.36085 13.0829 8.51706L16.283 11.7171C16.4391 11.8733 16.4391 12.1265 16.283 12.2827L13.0829 15.4828C12.9267 15.6389 12.6735 15.6389 12.5173 15.4828C12.361 15.3265 12.361 15.0733 12.5173 14.917L15.0344 12.3999H8.0001C7.77919 12.3999 7.6001 12.2208 7.6001 11.9999C7.6001 11.779 7.77919 11.5999 8.0001 11.5999H15.0344L12.5173 9.08274C12.361 8.92654 12.361 8.67327 12.5173 8.51706Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 573 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6465 7.64645C12.8417 7.45118 13.1583 7.45118 13.3535 7.64645L17.3536 11.6465C17.5488 11.8417 17.5488 12.1583 17.3536 12.3536L13.3535 16.3536C13.1583 16.5488 12.8417 16.5488 12.6465 16.3536C12.4512 16.1583 12.4512 15.8417 12.6465 15.6464L15.7929 12.5H7C6.72386 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.72386 11.5 7 11.5H15.7929L12.6465 8.35355C12.4512 8.15829 12.4512 7.84171 12.6465 7.64645Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.1465 8.1464C13.3417 7.9512 13.6583 7.9512 13.8535 8.1464L17.8536 12.1465C18.0488 12.3417 18.0488 12.6583 17.8536 12.8536L13.8535 16.8536C13.6583 17.0488 13.3417 17.0488 13.1465 16.8536C12.9512 16.6583 12.9512 16.3417 13.1465 16.1464L16.2929 13H7.5C7.2239 13 7 12.7761 7 12.5C7 12.2239 7.2239 12 7.5 12H16.2929L13.1465 8.8536C12.9512 8.6583 12.9512 8.3417 13.1465 8.1464Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 527 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.1266 12.2014C17.3474 12.2016 17.5264 12.3804 17.5264 12.6012L17.5264 17.127C17.5262 17.3476 17.3472 17.5266 17.1266 17.5268L12.6008 17.5268C12.3801 17.5268 12.2013 17.3477 12.201 17.127C12.201 16.9061 12.3799 16.7272 12.6008 16.7272L16.1605 16.7265L12.884 13.4499C12.7278 13.2937 12.7278 13.0399 12.884 12.8837C13.0402 12.7277 13.2934 12.7282 13.4495 12.8844L16.7261 16.1609L16.7268 12.6012C16.7268 12.3803 16.9057 12.2014 17.1266 12.2014ZM11.3986 6.47343C11.6195 6.47347 11.7984 6.65238 11.7984 6.87325C11.7984 7.09418 11.6195 7.27306 11.3986 7.27307H7.83961L11.1162 10.5497C11.2724 10.7058 11.2724 10.9597 11.1162 11.1159C10.96 11.2721 10.7062 11.2721 10.55 11.1159L7.27337 7.83931L7.27337 11.3983C7.27338 11.6192 7.09378 11.7988 6.87286 11.7988C6.65221 11.7985 6.47373 11.619 6.47373 11.3983L6.47304 6.87325C6.47308 6.65238 6.65268 6.47278 6.87355 6.47274L11.3986 6.47343Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 7.5H7.5V12M7.5 7.5L11.5 11.5M13 17.5H17.5V13M17.5 17.5L13.5 13.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 230 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.64645 11.3536C7.45118 11.1583 7.45118 10.8417 7.64645 10.6465L11.6465 6.6464C11.8417 6.4512 12.1583 6.4512 12.3536 6.6464L16.3536 10.6465C16.5488 10.8417 16.5488 11.1583 16.3536 11.3536C16.1583 11.5488 15.8417 11.5488 15.6464 11.3536L12.5 8.2071L12.5 17C12.5 17.2761 12.2761 17.5 12 17.5C11.7239 17.5 11.5 17.2761 11.5 17L11.5 8.2071L8.35355 11.3536C8.15829 11.5488 7.84171 11.5488 7.64645 11.3536Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.1464 11.8536C7.9512 11.6583 7.9512 11.3417 8.1464 11.1465L12.1465 7.1464C12.3417 6.9512 12.6583 6.9512 12.8536 7.1464L16.8536 11.1465C17.0488 11.3417 17.0488 11.6583 16.8536 11.8536C16.6583 12.0488 16.3417 12.0488 16.1464 11.8536L13 8.7071L13 17.5C13 17.7761 12.7761 18 12.5 18C12.2239 18 12 17.7761 12 17.5L12 8.7071L8.8536 11.8536C8.6583 12.0488 8.3417 12.0488 8.1464 11.8536Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 554 B After Width: | Height: | Size: 534 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5498 7.31994L7.7498 7.31996C7.02079 7.31996 6.4298 7.91095 6.4298 8.63996V13.04C6.4298 13.769 7.02079 14.3599 7.7498 14.3599H12.1498C12.2665 14.3599 12.3784 14.4063 12.461 14.4889L14.3498 16.3777V14.7999C14.3498 14.557 14.5468 14.3599 14.7898 14.3599H16.5498C17.2788 14.3599 17.8698 13.769 17.8698 13.04V8.63994C17.8698 7.91092 17.2788 7.31994 16.5498 7.31994ZM7.7498 6.43996L16.5498 6.43994C17.7648 6.43994 18.7498 7.42492 18.7498 8.63994V13.04C18.7498 14.255 17.7648 15.2399 16.5498 15.2399H15.2298V17.4399C15.2298 17.6179 15.1226 17.7783 14.9581 17.8464C14.7938 17.9145 14.6045 17.8769 14.4786 17.7511L11.9676 15.2399H7.7498C6.53478 15.2399 5.5498 14.255 5.5498 13.04V8.63996C5.5498 7.42493 6.53477 6.43997 7.7498 6.43996Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.5 15.5H8A1.5 1.5 0 0 1 6.5 14V9A1.5 1.5 0 0 1 8 7.5H17A1.5 1.5 0 0 1 18.5 9V14A1.5 1.5 0 0 1 17 15.5H15.5V18.5L12.5 15.5Z" stroke="currentColor" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 264 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="7.15625" y="7.15625" width="9.6875" height="9.6875" rx="0.40625" stroke="#9A9CA3" stroke-width="0.8125"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="7.5" y="7.5" width="10" height="10" rx="0.5" stroke="#9A9CA3"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 153 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="5.96429" y="8.00457" width="12.0714" height="7.98571" rx="0.464286" stroke="#9A9CA3" stroke-width="0.928572"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="6.5" y="8.5" width="12" height="7" rx="0.5" stroke="#9A9CA3"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 152 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15.7986 6.56348H16.6111V17.4385H15.7986V6.56348ZM8.20117 6.56348V17.4385H16.6111C16.6111 17.8872 16.2473 18.251 15.7986 18.251H8.20117C7.75244 18.251 7.38867 17.8872 7.38867 17.4385V6.56348C7.38867 6.11475 7.75244 5.75098 8.20117 5.75098H15.7986C16.2473 5.75098 16.6111 6.11475 16.6111 6.56348H8.20117Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="7.5" y="6.5" width="9" height="12" rx="0.5" stroke="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 416 B After Width: | Height: | Size: 157 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.4375 15.8V16.6125H6.5625V15.8H17.4375ZM17.4375 8.20264H6.5625V16.6125C6.11377 16.6125 5.75 16.2488 5.75 15.8L5.75 8.20264C5.75 7.75391 6.11377 7.39014 6.5625 7.39014H17.4375C17.8862 7.39014 18.25 7.75391 18.25 8.20264V15.8C18.25 16.2488 17.8862 16.6125 17.4375 16.6125V8.20264Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="6.5" y="7.5" width="12" height="9" rx="0.5" stroke="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 157 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="8.00725" y="18.0328" width="12.0714" height="7.98571" rx="0.464286" transform="rotate(-90 8.00725 18.0328)" stroke="#9A9CA3" stroke-width="0.928572"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="8.5" y="6.5" width="7" height="12" rx="0.5" stroke="#9A9CA3"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 152 B |
@ -1,10 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_2362_268752)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.08819 5.93335C7.73467 5.93335 7.41149 6.13308 7.25339 6.44929L5.98238 8.99131C5.94997 9.05611 5.93311 9.12757 5.93311 9.20002V17.1333C5.93311 17.6488 6.35098 18.0667 6.86644 18.0667H17.1331C17.6486 18.0667 18.0664 17.6488 18.0664 17.1333V9.20002C18.0664 9.12757 18.0495 9.05611 18.0172 8.99131L16.7461 6.44931C16.588 6.13311 16.2649 5.93338 15.9114 5.93338L11.9998 5.93336L8.08819 5.93335ZM8.08819 6.86668L11.5331 6.86669V8.73335H7.15486L8.08819 6.86668ZM12.4664 8.73335V6.8667L15.9114 6.86671L16.8447 8.73335H12.4664ZM11.9998 9.66668H17.1331V17.1333H6.86644V9.66668H11.9998ZM10.1331 11.5333C9.87537 11.5333 9.66644 11.7423 9.66644 12C9.66644 12.2577 9.87537 12.4667 10.1331 12.4667H13.8664C14.1242 12.4667 14.3331 12.2577 14.3331 12C14.3331 11.7423 14.1242 11.5333 13.8664 11.5333H10.1331Z" fill="currentColor"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_2362_268752">
|
||||
<rect width="14" height="14" fill="white" transform="translate(5 5)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.5 9.5L8 6.5H17L18.5 9.5M6.5 9.5H18.5M6.5 9.5V18C6.5 18.2761 6.7239 18.5 7 18.5H18C18.2761 18.5 18.5 18.2761 18.5 18V9.5M12.5 6.5V9.5" stroke="currentColor" stroke-linejoin="round"/>
|
||||
<path d="M10.5 12.5H14.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 347 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.9287 5.5C12.6248 5.50015 13.9999 6.87514 14 8.57129V14.3574C13.9998 15.4618 13.1043 16.3573 12 16.3574C10.8957 16.3573 10.0002 15.4618 10 14.3574V9.11719C10 8.84114 10.224 8.61734 10.5 8.61719C10.776 8.61734 11 8.84114 11 9.11719V14.3574C11.0002 14.9095 11.4479 15.3573 12 15.3574C12.5521 15.3573 12.9998 14.9095 13 14.3574V8.57129C12.9999 7.42743 12.0726 6.50015 10.9287 6.5C9.7848 6.50008 8.8575 7.42738 8.85742 8.57129V14.3574C8.85757 16.093 10.2645 17.4998 12 17.5C13.7355 17.4998 15.1434 16.093 15.1436 14.3574V12C15.1436 11.7239 15.3674 11.5 15.6436 11.5C15.9194 11.5004 16.1436 11.7241 16.1436 12V14.3574C16.1434 16.6452 14.2878 18.4998 12 18.5C9.71218 18.4998 7.85757 16.6452 7.85742 14.3574V8.57129C7.8575 6.8751 9.23252 5.50008 10.9287 5.5Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M16.5 12.5V14.5A4 4 0 0 1 8.5 14.5V9.5A3 3 0 0 1 14.5 9.5V14.5A2 2 0 0 1 10.5 14.5V9.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 867 B After Width: | Height: | Size: 224 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.1863 6.62918C12.3274 6.69975 12.4166 6.84398 12.4166 7.00174V16.9987C12.4166 17.1565 12.3274 17.3007 12.1863 17.3712C12.0452 17.4418 11.8763 17.4266 11.7501 17.3319L8.52888 14.916H7.00157C6.31143 14.916 5.75195 14.3565 5.75195 13.6664V10.3341C5.75195 9.64392 6.31143 9.08444 7.00157 9.08444H8.52888L11.7501 6.66851C11.8763 6.57385 12.0452 6.55862 12.1863 6.62918ZM11.5835 7.83482L8.91765 9.83421C8.84555 9.88829 8.75786 9.91752 8.66773 9.91752H7.00157C6.77152 9.91752 6.58503 10.104 6.58503 10.3341V13.6664C6.58503 13.8964 6.77152 14.0829 7.00157 14.0829H8.66773C8.75786 14.0829 8.84555 14.1122 8.91765 14.1662L11.5835 16.1656V7.83482ZM18.1262 10.0395C18.2888 10.2022 18.2888 10.4659 18.1262 10.6286L16.7545 12.0002L18.1262 13.3718C18.2888 13.5345 18.2888 13.7982 18.1262 13.9609C17.9635 14.1236 17.6997 14.1236 17.537 13.9609L16.1654 12.5893L14.7939 13.9609C14.6312 14.1236 14.3674 14.1236 14.2047 13.9609C14.0421 13.7982 14.0421 13.5345 14.2047 13.3718L15.5764 12.0002L14.2047 10.6286C14.0421 10.4659 14.0421 10.2022 14.2047 10.0395C14.3674 9.87685 14.6312 9.87685 14.7939 10.0395L16.1654 11.4111L17.537 10.0395C17.6997 9.87685 17.9635 9.87685 18.1262 10.0395Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.9694 6.62757C12.1123 6.69746 12.2029 6.84266 12.2029 7.00174V16.9987C12.2029 17.1578 12.1123 17.303 11.9694 17.3729C11.8265 17.4428 11.6562 17.4251 11.5307 17.3275L8.43018 14.916H6.9962C6.30605 14.916 5.74658 14.3565 5.74658 13.6664V10.3341C5.74658 9.64392 6.30605 9.08444 6.9962 9.08444H8.43018L11.5307 6.67295C11.6562 6.57528 11.8265 6.55767 11.9694 6.62757ZM11.3699 7.85342L8.82883 9.82978C8.75571 9.88664 8.66573 9.91752 8.5731 9.91752H6.9962C6.76615 9.91752 6.57966 10.104 6.57966 10.3341V13.6664C6.57966 13.8964 6.76615 14.0829 6.9962 14.0829H8.5731C8.66573 14.0829 8.75571 14.1138 8.82883 14.1706L11.3699 16.147V7.85342ZM14.3093 8.95784C14.4625 8.8559 14.6694 8.89747 14.7713 9.05069C15.9566 10.8322 15.9566 13.1682 14.7713 14.9497C14.6694 15.1029 14.4625 15.1445 14.3093 15.0425C14.156 14.9406 14.1144 14.7338 14.2164 14.5805C15.2529 13.0226 15.2529 10.9778 14.2164 9.41987C14.1144 9.26664 14.156 9.05979 14.3093 8.95784ZM16.3088 6.94379C16.1897 6.80339 15.9795 6.78601 15.8391 6.90499C15.6987 7.02396 15.6813 7.23424 15.8003 7.37465C18.0572 10.0382 18.0572 13.9622 15.8003 16.6258C15.6813 16.7662 15.6987 16.9764 15.8391 17.0954C15.9795 17.2145 16.1897 17.197 16.3088 17.0567C18.7764 14.1445 18.7764 9.85597 16.3088 6.94379Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.5 7.5C14.7761 7.5 15 7.72386 15 8L15 16C15 16.2761 14.7761 16.5 14.5 16.5C14.2239 16.5 14 16.2761 14 16L14 8C14 7.72386 14.2239 7.5 14.5 7.5ZM9.5 8.5C9.77614 8.5 10 8.72386 10 9L10 15C10 15.2761 9.77614 15.5 9.5 15.5C9.22386 15.5 9 15.2761 9 15L9 9C9 8.72386 9.22386 8.5 9.5 8.5ZM12 9.5C12.2761 9.5 12.5 9.72386 12.5 10V14C12.5 14.2761 12.2761 14.5 12 14.5C11.7239 14.5 11.5 14.2761 11.5 14V10C11.5 9.72386 11.7239 9.5 12 9.5ZM17 10C17.2761 10 17.5 10.2239 17.5 10.5V13.5C17.5 13.7761 17.2761 14 17 14C16.7239 14 16.5 13.7761 16.5 13.5V10.5C16.5 10.2239 16.7239 10 17 10ZM7 10.5C7.27614 10.5 7.5 10.7239 7.5 11V13C7.5 13.2761 7.27614 13.5 7 13.5C6.72386 13.5 6.5 13.2761 6.5 13V11C6.5 10.7239 6.72386 10.5 7 10.5Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.5 11.5V13.5M10.5 9.5V15.5M12.5 10.5V14.5M14.5 8.5V16.5M16.5 10.5V14.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 830 B After Width: | Height: | Size: 210 B |
@ -1,8 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.5 6.125C10.7071 6.125 10.875 6.29289 10.875 6.5V17.5C10.875 17.7071 10.7071 17.875 10.5 17.875C10.2929 17.875 10.125 17.7071 10.125 17.5V6.5C10.125 6.29289 10.2929 6.125 10.5 6.125Z" fill="currentColor"/>
|
||||
<path d="M16.5 7.625C16.7071 7.625 16.875 7.79289 16.875 8V16C16.875 16.2071 16.7071 16.375 16.5 16.375C16.2929 16.375 16.125 16.2071 16.125 16V8C16.125 7.79289 16.2929 7.625 16.5 7.625Z" fill="currentColor"/>
|
||||
<path d="M7.5 9.125C7.70711 9.125 7.875 9.29289 7.875 9.5V14.5C7.875 14.7071 7.70711 14.875 7.5 14.875C7.29289 14.875 7.125 14.7071 7.125 14.5V9.5C7.125 9.29289 7.29289 9.125 7.5 9.125Z" fill="currentColor"/>
|
||||
<path d="M13.5 9.125C13.7071 9.125 13.875 9.29289 13.875 9.5V14.5C13.875 14.7071 13.7071 14.875 13.5 14.875C13.2929 14.875 13.125 14.7071 13.125 14.5V9.5C13.125 9.29289 13.2929 9.125 13.5 9.125Z" fill="currentColor"/>
|
||||
<path d="M4.5 10.375C4.70711 10.375 4.875 10.5429 4.875 10.75V13.25C4.875 13.4571 4.70711 13.625 4.5 13.625C4.29289 13.625 4.125 13.4571 4.125 13.25V10.75C4.125 10.5429 4.29289 10.375 4.5 10.375Z" fill="currentColor"/>
|
||||
<path d="M19.5 10.375C19.7071 10.375 19.875 10.5429 19.875 10.75V13.25C19.875 13.4571 19.7071 13.625 19.5 13.625C19.2929 13.625 19.125 13.4571 19.125 13.25V10.75C19.125 10.5429 19.2929 10.375 19.5 10.375Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.5 11.5V13.5M7.5 10.5V14.5M10.5 7.5V17.5M13.5 10.5V14.5M16.5 8.5V16.5M19.5 11.5V13.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 224 B |
@ -1,4 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.0567 12.0003C17.0567 9.20776 14.7929 6.94395 12.0003 6.94395C9.20776 6.94395 6.94395 9.20776 6.94395 12.0003C6.94395 14.7929 9.20776 17.0567 12.0003 17.0567C14.7929 17.0567 17.0567 14.7929 17.0567 12.0003ZM18.1803 12.0003C18.1803 15.4134 15.4134 18.1803 12.0003 18.1803C8.58719 18.1803 5.82031 15.4134 5.82031 12.0003C5.82031 8.58719 8.58719 5.82031 12.0003 5.82031C15.4134 5.82031 18.1803 8.58719 18.1803 12.0003Z" fill="currentColor"/>
|
||||
<path d="M7.63322 7.63321C7.85253 7.41393 8.20802 7.41393 8.42732 7.63321L16.3683 15.5741C16.5876 15.7934 16.5876 16.1494 16.3683 16.3687C16.1489 16.5877 15.7934 16.5873 15.5742 16.3681L7.63322 8.42724C7.41393 8.20795 7.41392 7.85249 7.63322 7.63321Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.5567 12.5003C17.5567 9.7078 15.2929 7.444 12.5003 7.444C9.7078 7.444 7.444 9.7078 7.444 12.5003C7.444 15.2929 9.7078 17.5567 12.5003 17.5567C15.2929 17.5567 17.5567 15.2929 17.5567 12.5003ZM18.6803 12.5003C18.6803 15.9134 15.9134 18.6803 12.5003 18.6803C9.0872 18.6803 6.3203 15.9134 6.3203 12.5003C6.3203 9.0872 9.0872 6.3203 12.5003 6.3203C15.9134 6.3203 18.6803 9.0872 18.6803 12.5003Z" fill="currentColor"/>
|
||||
<path d="M8.1332 8.1332C8.3525 7.9139 8.708 7.9139 8.9273 8.1332L16.8683 16.0741C17.0876 16.2934 17.0876 16.6494 16.8683 16.8687C16.6489 17.0877 16.2934 17.0873 16.0742 16.8681L8.1332 8.9272C7.9139 8.708 7.9139 8.3525 8.1332 8.1332Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 805 B After Width: | Height: | Size: 761 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.2041 2.01074C12.2128 2.113 13 2.96435 13 4V11L12.9893 11.2041C12.8938 12.1457 12.1457 12.8938 11.2041 12.9893L11 13H4C2.96435 13 2.113 12.2128 2.01074 11.2041L2 11V4C2 2.89543 2.89543 2 4 2H11L11.2041 2.01074ZM3 10V11C3 11.5523 3.44772 12 4 12H11C11.5523 12 12 11.5523 12 11V10H3ZM4 3C3.44772 3 3 3.44772 3 4V9H12V4C12 3.44772 11.5523 3 11 3H4Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 461 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.2041 2.01074C12.2128 2.113 13 2.96435 13 4V11L12.9893 11.2041C12.8938 12.1457 12.1457 12.8938 11.2041 12.9893L11 13H4C2.96435 13 2.113 12.2128 2.01074 11.2041L2 11V4C2 2.89543 2.89543 2 4 2H11L11.2041 2.01074ZM4 3C3.44772 3 3 3.44772 3 4V9H12V4C12 3.44772 11.5523 3 11 3H4Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 390 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.2041 2.01074C12.2128 2.113 13 2.96435 13 4V11L12.9893 11.2041C12.8938 12.1457 12.1457 12.8938 11.2041 12.9893L11 13H4C2.96435 13 2.113 12.2128 2.01074 11.2041L2 11V4C2 2.89543 2.89543 2 4 2H11L11.2041 2.01074ZM4 3C3.44772 3 3 3.44772 3 4V11C3 11.5523 3.44772 12 4 12H5V3H4ZM11 12C11.5523 12 12 11.5523 12 11V4C12 3.44772 11.5523 3 11 3H6V12H11Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 461 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.2041 2.01074C12.2128 2.113 13 2.96435 13 4V11L12.9893 11.2041C12.8938 12.1457 12.1457 12.8938 11.2041 12.9893L11 13H4C2.96435 13 2.113 12.2128 2.01074 11.2041L2 11V4C2 2.89543 2.89543 2 4 2H11L11.2041 2.01074ZM6 12H11C11.5523 12 12 11.5523 12 11V4C12 3.44772 11.5523 3 11 3H6V12Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 396 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.2041 2.01074C12.2128 2.113 13 2.96435 13 4V11L12.9893 11.2041C12.8938 12.1457 12.1457 12.8938 11.2041 12.9893L11 13H4C2.96435 13 2.113 12.2128 2.01074 11.2041L2 11V4C2 2.89543 2.89543 2 4 2H11L11.2041 2.01074ZM4 3C3.44772 3 3 3.44772 3 4V11C3 11.5523 3.44772 12 4 12H9V3H4ZM11 12C11.5523 12 12 11.5523 12 11V4C12 3.44772 11.5523 3 11 3H10V12H11Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 462 B |
@ -1,3 +0,0 @@
|
||||
<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11.2041 2.01074C12.2128 2.113 13 2.96435 13 4V11L12.9893 11.2041C12.8938 12.1457 12.1457 12.8938 11.2041 12.9893L11 13H4C2.96435 13 2.113 12.2128 2.01074 11.2041L2 11V4C2 2.89543 2.89543 2 4 2H11L11.2041 2.01074ZM4 3C3.44772 3 3 3.44772 3 4V11C3 11.5523 3.44772 12 4 12H9V3H4Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 390 B |
@ -1,3 +1,5 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.2467 5.57737C12.3274 5.47648 12.4272 5.39258 12.5405 5.33053C12.6537 5.26849 12.7782 5.22952 12.9066 5.2159C13.0351 5.20227 13.1649 5.21426 13.2887 5.25116C13.4125 5.28806 13.5277 5.34915 13.6277 5.43088L16.8135 8.03266C16.9887 8.17571 17.1088 8.37514 17.1534 8.59689C17.1979 8.81865 17.1641 9.04899 17.0577 9.24858C16.7791 9.16346 16.4895 9.12034 16.1982 9.12064H15.9052L16.1963 8.78858L14.5184 7.41835L13.1345 9.12162H11.8756L13.7615 6.80111L13.0095 6.1868L10.6675 9.12064H9.41738L12.2467 5.57737ZM14.7333 14.0039C14.6037 14.0039 14.4795 14.0553 14.388 14.1469C14.2964 14.2385 14.2449 14.3627 14.2449 14.4922C14.2449 14.6217 14.2964 14.7459 14.388 14.8375C14.4795 14.9291 14.6037 14.9805 14.7333 14.9805H15.7099C15.8394 14.9805 15.9636 14.9291 16.0552 14.8375C16.1468 14.7459 16.1982 14.6217 16.1982 14.4922C16.1982 14.3627 16.1468 14.2385 16.0552 14.1469C15.9636 14.0553 15.8394 14.0039 15.7099 14.0039H14.7333ZM6.82654 9.60896C6.82654 9.47945 6.87798 9.35525 6.96956 9.26367C7.06114 9.17209 7.18535 9.12064 7.31486 9.12064H8.44171L9.21814 8.144H7.31486C6.92632 8.144 6.5537 8.29834 6.27897 8.57308C6.00424 8.84781 5.84989 9.22043 5.84989 9.60896V15.4688C5.84989 16.1164 6.10713 16.7374 6.56502 17.1953C7.02291 17.6532 7.64395 17.9104 8.2915 17.9104H16.1982C16.7163 17.9104 17.2131 17.7047 17.5794 17.3383C17.9457 16.972 18.1515 16.4752 18.1515 15.9572V12.0506C18.1515 11.5325 17.9457 11.0357 17.5794 10.6694C17.2131 10.3031 16.7163 10.0973 16.1982 10.0973H7.31486C7.18535 10.0973 7.06114 10.0458 6.96956 9.95426C6.87798 9.86268 6.82654 9.73848 6.82654 9.60896ZM6.82654 15.4688V10.9909C6.98019 11.0456 7.14297 11.0733 7.31486 11.0739H16.1982C16.4572 11.0739 16.7057 11.1768 16.8888 11.36C17.072 11.5431 17.1749 11.7916 17.1749 12.0506V15.9572C17.1749 16.2162 17.072 16.4646 16.8888 16.6478C16.7057 16.8309 16.4572 16.9338 16.1982 16.9338H8.2915C7.90297 16.9338 7.53035 16.7795 7.25562 16.5047C6.98088 16.23 6.82654 15.8574 6.82654 15.4688Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="5.5" y="7.5" width="14" height="10" rx="0.5" stroke="currentColor"/>
|
||||
<path d="M5.5 10.5H19.5" stroke="currentColor"/>
|
||||
<path d="M8.5 13.5H11.5" stroke="currentColor" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 279 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 6C9 8.75 7.5 11 7.5 13.5C7.5 15.9853 9.51472 18 12 18C14.4853 18 16.5 15.9853 16.5 13.5C16.5 11 15 8.75 12 6ZM15.5 13.5C15.5 11.612 14.4732 9.77195 12 7.37357C9.52686 9.77195 8.5 11.612 8.5 13.5C8.5 15.433 10.067 17 12 17C13.933 17 15.5 15.433 15.5 13.5Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5 6.5C9.5 9.25 8 11.5 8 14C8 16.4853 10.0147 18.5 12.5 18.5C14.9853 18.5 17 16.4853 17 14C17 11.5 15.5 9.25 12.5 6.5ZM16 14C16 12.112 14.9732 10.272 12.5 7.8736C10.0269 10.272 9 12.112 9 14C9 15.933 10.567 17.5 12.5 17.5C14.433 17.5 16 15.933 16 14Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 406 B |
@ -1,3 +1,3 @@
|
||||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 13.5C7.5 11 9 8.75 12 6C15 8.75 16.5 11 16.5 13.5C16.5 15.9853 14.4853 18 12 18C9.51472 18 7.5 15.9853 7.5 13.5ZM15.4524 12.8031C14.1735 12.3212 12.7879 12.9621 11.4896 13.5626C10.4327 14.0514 9.43365 14.5135 8.59695 14.3215C8.53357 14.058 8.5 13.7829 8.5 13.5C8.5 11.612 9.52686 9.77195 12 7.37357C14.1684 9.47639 15.225 11.15 15.4524 12.8031Z" fill="currentColor"/>
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 14C8 11.5 9.5 9.25 12.5 6.5C15.5 9.25 17 11.5 17 14C17 16.4853 14.9853 18.5 12.5 18.5C10.0147 18.5 8 16.4853 8 14ZM15.9524 13.3031C14.6735 12.8212 13.2879 13.4621 11.9896 14.0626C10.9327 14.5514 9.9337 15.0135 9.0969 14.8215C9.0336 14.558 9 14.2829 9 14C9 12.112 10.0269 10.272 12.5 7.8736C14.6684 9.9764 15.725 11.65 15.9524 13.3031Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 490 B |