@capybara-hq/plugin-sdk 0.1.0-rc.8 → 0.1.0-rc.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/agent-docs/agent-templates.md +14 -2
- package/agent-docs/concepts.md +14 -5
- package/agent-docs/connector-templates.md +11 -3
- package/agent-docs/extension-points/channel.md +1 -1
- package/agent-docs/extension-points/context.md +15 -0
- package/agent-docs/extension-points/device-provider.md +15 -0
- package/agent-docs/extension-points/file-preview.md +3 -1
- package/agent-docs/extension-points/identity-source.md +2 -0
- package/agent-docs/extension-points/model-provider.md +3 -1
- package/agent-docs/extension-points/object-store.md +2 -0
- package/agent-docs/extension-points/push-provider.md +17 -0
- package/agent-docs/extensions.md +77 -4
- package/agent-docs/plugin-format.md +45 -10
- package/agent-docs/setup.md +54 -0
- package/dist/agent-template.d.ts +15 -6
- package/dist/agent-template.js +32 -13
- package/dist/avatar-presets.d.ts +8 -0
- package/dist/avatar-presets.js +17 -0
- package/dist/bootstrap.d.ts +109 -1
- package/dist/bootstrap.js +185 -2
- package/dist/cards.d.ts +97 -13
- package/dist/cards.js +121 -19
- package/dist/channel.d.ts +133 -47
- package/dist/channel.js +10 -5
- package/dist/client-css.d.ts +36 -0
- package/dist/client-css.js +326 -0
- package/dist/client-section.d.ts +35 -0
- package/dist/client-section.js +133 -0
- package/dist/config-ui.d.ts +28 -6
- package/dist/config-ui.js +88 -25
- package/dist/config-url-fetch.d.ts +19 -0
- package/dist/config-url-fetch.js +43 -0
- package/dist/connector-auth.d.ts +13 -2
- package/dist/connector-auth.js +82 -8
- package/dist/connector.d.ts +74 -32
- package/dist/context.d.ts +40 -0
- package/dist/context.js +2 -0
- package/dist/ctx.d.ts +224 -30
- package/dist/ctx.js +9 -1
- package/dist/define-extension.d.ts +23 -13
- package/dist/define-extension.js +19 -5
- package/dist/device-denied-paths.d.ts +20 -0
- package/dist/device-denied-paths.js +118 -0
- package/dist/device-operation.d.ts +339 -0
- package/dist/device-operation.js +312 -0
- package/dist/device-protocol.d.ts +285 -50
- package/dist/device-protocol.js +755 -90
- package/dist/device-provider.d.ts +780 -0
- package/dist/device-provider.js +409 -0
- package/dist/device-service.d.ts +126 -0
- package/dist/device-service.js +211 -0
- package/dist/dial-in.d.ts +286 -0
- package/dist/dial-in.js +213 -0
- package/dist/directory.d.ts +15 -12
- package/dist/extension-point.d.ts +2 -0
- package/dist/extension-point.js +7 -3
- package/dist/field-meta.d.ts +19 -0
- package/dist/field-meta.js +54 -0
- package/dist/file-preview.d.ts +43 -10
- package/dist/git-hosts.d.ts +53 -0
- package/dist/git-hosts.js +98 -0
- package/dist/hooks.d.ts +125 -20
- package/dist/hooks.js +5 -0
- package/dist/http-access.d.ts +71 -0
- package/dist/http-access.js +12 -0
- package/dist/identity.d.ts +70 -9
- package/dist/identity.js +46 -1
- package/dist/index.d.ts +28 -4
- package/dist/index.js +28 -4
- package/dist/model-params.d.ts +41 -22
- package/dist/model-params.js +28 -15
- package/dist/model.d.ts +227 -75
- package/dist/model.js +152 -19
- package/dist/native-failure.d.ts +13 -0
- package/dist/native-failure.js +31 -0
- package/dist/net.d.ts +52 -0
- package/dist/net.js +34 -0
- package/dist/network-classes.d.ts +98 -0
- package/dist/network-classes.js +291 -0
- package/dist/permissions.d.ts +65 -22
- package/dist/permissions.js +139 -43
- package/dist/platform-only.d.ts +27 -0
- package/dist/platform-only.js +35 -0
- package/dist/plugin-manifest.d.ts +30 -6
- package/dist/plugin-manifest.js +147 -55
- package/dist/plugin-package.d.ts +82 -39
- package/dist/plugin-package.js +68 -41
- package/dist/push.d.ts +75 -0
- package/dist/push.js +87 -0
- package/dist/sandbox-linux-runtime-source.d.ts +1 -0
- package/dist/sandbox-linux-runtime-source.js +2343 -0
- package/dist/sandbox-native-runtime-source.d.ts +10 -0
- package/dist/sandbox-native-runtime-source.js +480 -0
- package/dist/sandbox-runtime-source.d.ts +47 -0
- package/dist/sandbox-runtime-source.js +73 -0
- package/dist/sandbox-write-denies.d.ts +139 -0
- package/dist/sandbox-write-denies.js +869 -0
- package/dist/secret.d.ts +8 -2
- package/dist/secret.js +11 -4
- package/dist/setup-check.d.ts +128 -0
- package/dist/setup-check.js +142 -0
- package/dist/setup-guide-parse.d.ts +121 -0
- package/dist/setup-guide-parse.js +356 -0
- package/dist/setup-guide-render.d.ts +45 -0
- package/dist/setup-guide-render.js +351 -0
- package/dist/setup-guide.d.ts +86 -72
- package/dist/setup-guide.js +340 -108
- package/dist/shell-capabilities.d.ts +211 -0
- package/dist/shell-capabilities.js +44 -0
- package/dist/shell-environment.d.ts +57 -0
- package/dist/shell-environment.js +21 -0
- package/dist/skill-invocation.d.ts +5 -0
- package/dist/skill-invocation.js +4 -3
- package/dist/skill.d.ts +27 -17
- package/dist/skill.js +40 -26
- package/dist/storage.d.ts +52 -25
- package/dist/svg-viewbox.d.ts +10 -0
- package/dist/svg-viewbox.js +24 -0
- package/dist/theme-assets.d.ts +25 -9
- package/dist/theme-assets.js +87 -47
- package/dist/theme-tokens.generated.d.ts +26 -2
- package/dist/theme-tokens.generated.js +17 -0
- package/dist/theme.d.ts +48 -10
- package/dist/theme.js +100 -21
- package/dist/tool.d.ts +196 -31
- package/dist/tool.js +133 -13
- package/dist/ui-parts.d.ts +23 -0
- package/dist/ui-parts.js +385 -0
- package/dist/ui-resolve.d.ts +35 -0
- package/dist/ui-resolve.js +42 -0
- package/dist/ui-slots.d.ts +65 -0
- package/dist/ui-slots.js +261 -0
- package/dist/ui.d.ts +245 -77
- package/dist/ui.js +104 -27
- package/dist/url.d.ts +4 -1
- package/dist/url.js +4 -1
- package/dist/web.d.ts +26 -20
- package/package.json +12 -1
- package/schemas/bootstrap-extra.v1.schema.json +186 -0
- package/schemas/bootstrap.v1.schema.json +20 -0
- package/schemas/connector-template.v1.schema.json +62 -4
- package/schemas/plugin.v1.schema.json +74 -143
- package/schemas/theme.v1.schema.json +77 -0
- package/agent-docs/extension-points/sandbox.md +0 -15
- package/dist/org-access.d.ts +0 -27
- package/dist/org-access.js +0 -35
- package/dist/sandbox.d.ts +0 -254
- package/dist/sandbox.js +0 -153
package/dist/storage.d.ts
CHANGED
|
@@ -7,27 +7,34 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/** Object storage extension point ref. */
|
|
9
9
|
export declare const OBJECT_STORE_EXTENSION_POINT = "object-store@1";
|
|
10
|
-
/**
|
|
10
|
+
/** Metadata of an object. */
|
|
11
11
|
export interface ObjectHead {
|
|
12
12
|
key: string;
|
|
13
|
-
/**
|
|
13
|
+
/** Size in bytes. */
|
|
14
14
|
size: number;
|
|
15
15
|
contentType: string;
|
|
16
16
|
etag?: string;
|
|
17
|
-
/** ISO 8601
|
|
17
|
+
/** ISO 8601 time. */
|
|
18
18
|
lastModified?: string;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* The `object-store@1` implementation (provided by an object-store plugin, e.g. S3-compatible
|
|
22
|
+
* storage).
|
|
23
|
+
*/
|
|
21
24
|
export interface ObjectStore {
|
|
22
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Writes (overwriting a key of the same name); give `size` when `body` is a stream if possible.
|
|
27
|
+
*/
|
|
23
28
|
put(key: string, body: Uint8Array | ReadableStream<Uint8Array>, opts: {
|
|
24
29
|
contentType: string;
|
|
25
30
|
size?: number;
|
|
26
31
|
signal?: AbortSignal;
|
|
27
32
|
}): Promise<ObjectHead>;
|
|
28
33
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
34
|
+
* Reads; returns null when missing. `range` is a closed byte range; an omitted `end` means read
|
|
35
|
+
* to the end.
|
|
36
|
+
* With `range`, `head.size` is still the size of the whole object; when the store ignores Range,
|
|
37
|
+
* body may be the whole object.
|
|
31
38
|
*/
|
|
32
39
|
get(key: string, opts?: {
|
|
33
40
|
signal?: AbortSignal;
|
|
@@ -39,15 +46,18 @@ export interface ObjectStore {
|
|
|
39
46
|
head: ObjectHead;
|
|
40
47
|
body: ReadableStream<Uint8Array>;
|
|
41
48
|
} | null>;
|
|
42
|
-
/**
|
|
49
|
+
/** Returns null when missing. */
|
|
43
50
|
head(key: string): Promise<ObjectHead | null>;
|
|
44
|
-
/**
|
|
51
|
+
/** Deletes; a missing key also counts as success. */
|
|
45
52
|
delete(key: string): Promise<void>;
|
|
46
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Deletes all objects under a prefix and returns the number deleted (used for org data deletion).
|
|
55
|
+
*/
|
|
47
56
|
deletePrefix(prefix: string): Promise<number>;
|
|
48
57
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
58
|
+
* Lists objects under a prefix with pagination; an omitted `cursor` in the result means there is
|
|
59
|
+
* no next page. When the listing carries no type, `contentType` is an empty string
|
|
60
|
+
* (use `head` to get it when needed).
|
|
51
61
|
*/
|
|
52
62
|
list(prefix: string, opts?: {
|
|
53
63
|
cursor?: string;
|
|
@@ -56,41 +66,58 @@ export interface ObjectStore {
|
|
|
56
66
|
items: ObjectHead[];
|
|
57
67
|
cursor?: string;
|
|
58
68
|
}>;
|
|
59
|
-
/**
|
|
69
|
+
/** Presigned download URL (options in {@link PresignGetOptions}). */
|
|
60
70
|
presignGet(key: string, opts: PresignGetOptions): Promise<string>;
|
|
61
71
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
72
|
+
* Presigned upload: the browser uploads straight to storage following the returned {@link
|
|
73
|
+
* PresignedUpload}. An upload over `maxSize` must be rejected by the **store side**
|
|
74
|
+
* (a presigned PUT cannot limit the size, so S3-compatible implementations use a POST policy with
|
|
75
|
+
* a `content-length-range` condition).
|
|
64
76
|
*/
|
|
65
77
|
presignPut(key: string, opts: {
|
|
66
78
|
contentType: string;
|
|
67
79
|
maxSize: number;
|
|
68
80
|
ttlSeconds: number;
|
|
69
81
|
}): Promise<PresignedUpload>;
|
|
82
|
+
/**
|
|
83
|
+
* The canonical URI of a key in this store: unsigned, stable, no credentials
|
|
84
|
+
* (`s3://bucket/key`). This is an identifier, never a presigned URL: it may be recorded in an
|
|
85
|
+
* event log and shown to a model, so it must stay valid and carry no secret. Optional: a store
|
|
86
|
+
* with no notion of URIs leaves it out and the kernel falls back to its own reference.
|
|
87
|
+
*/
|
|
88
|
+
uri?(key: string): string;
|
|
70
89
|
}
|
|
71
|
-
/**
|
|
90
|
+
/** Options of a presigned download. */
|
|
72
91
|
export interface PresignGetOptions {
|
|
73
92
|
ttlSeconds: number;
|
|
74
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Download file name, goes into `Content-Disposition` (RFC 6266; non-ASCII uses
|
|
95
|
+
* `filename*=UTF-8''…`).
|
|
96
|
+
*/
|
|
75
97
|
downloadName?: string;
|
|
76
98
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
99
|
+
* How the browser opens it: `attachment` (default, download) or `inline` (display in the page).
|
|
100
|
+
* User-uploaded content should use `inline` only for types
|
|
101
|
+
* that do not execute scripts (images, PDF).
|
|
79
102
|
*/
|
|
80
103
|
disposition?: "attachment" | "inline";
|
|
81
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Overrides the response `Content-Type` (e.g. return the verified type rather than the type
|
|
106
|
+
* recorded in storage).
|
|
107
|
+
*/
|
|
82
108
|
responseContentType?: string;
|
|
83
109
|
}
|
|
84
110
|
/**
|
|
85
|
-
*
|
|
86
|
-
* - `PUT
|
|
87
|
-
* - `POST
|
|
88
|
-
*
|
|
111
|
+
* The request method of a presigned upload:
|
|
112
|
+
* - `PUT`: the request body is the file bytes, and the request carries `headers`;
|
|
113
|
+
* - `POST`: a `multipart/form-data` form; first put every item of `fields` in as is, and put the
|
|
114
|
+
* file field `file` **last**;
|
|
115
|
+
* the request carries `headers` (usually empty).
|
|
89
116
|
*/
|
|
90
117
|
export interface PresignedUpload {
|
|
91
118
|
method: "PUT" | "POST";
|
|
92
119
|
url: string;
|
|
93
120
|
headers: Record<string, string>;
|
|
94
|
-
/** `POST
|
|
121
|
+
/** Always present for `POST`: the form fields (including policy and signature). */
|
|
95
122
|
fields?: Record<string, string>;
|
|
96
123
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Characters of a viewBox value; longer values are refused before any regex sees them. */
|
|
2
|
+
export declare const VIEWBOX_MAX_CHARS = 128;
|
|
3
|
+
/**
|
|
4
|
+
* The only regexes the viewBox parser runs. Each is one character class under one quantifier,
|
|
5
|
+
* so matching is linear in the (already capped) input: there is nothing to backtrack into.
|
|
6
|
+
*/
|
|
7
|
+
export declare const VIEWBOX_SEPARATOR_RE: RegExp;
|
|
8
|
+
export declare const VIEWBOX_NUMBER_RE: RegExp;
|
|
9
|
+
/** `min-x min-y width height`, width and height > 0; undefined when malformed. */
|
|
10
|
+
export declare function parseViewBox(v: string): [number, number, number, number] | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Internal to the SDK: not re-exported from index.ts, so not part of the public API.
|
|
2
|
+
/** Characters of a viewBox value; longer values are refused before any regex sees them. */
|
|
3
|
+
export const VIEWBOX_MAX_CHARS = 128;
|
|
4
|
+
/**
|
|
5
|
+
* The only regexes the viewBox parser runs. Each is one character class under one quantifier,
|
|
6
|
+
* so matching is linear in the (already capped) input: there is nothing to backtrack into.
|
|
7
|
+
*/
|
|
8
|
+
export const VIEWBOX_SEPARATOR_RE = /[\s,]+/;
|
|
9
|
+
export const VIEWBOX_NUMBER_RE = /^[-+.0-9eE]+$/;
|
|
10
|
+
/** `min-x min-y width height`, width and height > 0; undefined when malformed. */
|
|
11
|
+
export function parseViewBox(v) {
|
|
12
|
+
if (v.length > VIEWBOX_MAX_CHARS)
|
|
13
|
+
return undefined;
|
|
14
|
+
const parts = v
|
|
15
|
+
.trim()
|
|
16
|
+
.split(VIEWBOX_SEPARATOR_RE)
|
|
17
|
+
.filter((p) => p !== "");
|
|
18
|
+
if (parts.length !== 4 || !parts.every((p) => VIEWBOX_NUMBER_RE.test(p)))
|
|
19
|
+
return undefined;
|
|
20
|
+
const n = parts.map(Number);
|
|
21
|
+
if (!n.every(Number.isFinite) || n[2] <= 0 || n[3] <= 0)
|
|
22
|
+
return undefined;
|
|
23
|
+
return n;
|
|
24
|
+
}
|
package/dist/theme-assets.d.ts
CHANGED
|
@@ -21,17 +21,33 @@ export declare function sanitizeThemeSvg(bytes: Uint8Array): {
|
|
|
21
21
|
export declare function checkWoff2(bytes: Uint8Array): string | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* A PNG logo: the PNG signature, an `IHDR` first chunk with a height of at least
|
|
24
|
-
* {@link THEME_LIMITS}`.pngMinHeight` pixels, and at most
|
|
24
|
+
* {@link THEME_LIMITS}`.pngMinHeight` pixels, and at most `maxBytes` (default
|
|
25
|
+
* {@link THEME_LIMITS}`.pngBytes`; an app icon allows {@link THEME_LIMITS}`.appIconBytes`).
|
|
25
26
|
*/
|
|
26
|
-
export declare function checkPng(bytes: Uint8Array): string | undefined;
|
|
27
|
+
export declare function checkPng(bytes: Uint8Array, maxBytes?: number): string | undefined;
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
* Every asset a parsed theme names, in order: `fonts.<i>.file`, `logo.mark`, `logo.favicon`,
|
|
30
|
+
* `logo.illustration`, `logo.appIcon`, `logo.appIconMaskable`, `avatars.<i>.file`. `ref` is the
|
|
31
|
+
* path as written (an optional leading `./`). The one list every reader of theme assets uses (the
|
|
32
|
+
* checks, packing, the catalog and delivery), so a file the theme does not name is never read or
|
|
33
|
+
* served.
|
|
34
|
+
*/
|
|
35
|
+
export declare function themeAssetRefs(theme: ParsedTheme): {
|
|
36
|
+
field: string;
|
|
37
|
+
ref: string;
|
|
38
|
+
}[];
|
|
39
|
+
/**
|
|
40
|
+
* Resolves and checks the asset files of a parsed theme ({@link themeAssetRefs}), each by its
|
|
41
|
+
* kind: `fonts[].file` ({@link checkWoff2}); `logo.mark` and `logo.illustration` (`.svg` through
|
|
42
|
+
* {@link sanitizeThemeSvg}, `.png` through {@link checkPng}); `logo.favicon` and `avatars[].file`
|
|
43
|
+
* likewise and square (SVG viewBox or PNG width = height); `logo.appIcon` and
|
|
44
|
+
* `logo.appIconMaskable` PNG only, square, at least {@link THEME_LIMITS}`.appIconMinSize` px and at
|
|
45
|
+
* most {@link THEME_LIMITS}`.appIconBytes`. `files` holds the plugin's files keyed by their path
|
|
46
|
+
* without a leading `./`; the returned `assets` (the sanitized SVG bytes, the other files
|
|
47
|
+
* unchanged) use the same keys. Errors are `<field>: <reason>`, English; the total input size of
|
|
48
|
+
* the theme's distinct assets must stay within {@link THEME_LIMITS}`.assetsBytes`. That limit is
|
|
49
|
+
* per plugin, so a caller reading several themes also checks the sum over all of them (distinct
|
|
50
|
+
* paths).
|
|
35
51
|
*/
|
|
36
52
|
export declare function validateThemeAssets(theme: ParsedTheme, files: Map<string, Uint8Array>): {
|
|
37
53
|
assets: Map<string, Uint8Array>;
|
package/dist/theme-assets.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { SaxesParser } from "saxes";
|
|
2
2
|
import { isSafePackagePath } from "./plugin-package.js";
|
|
3
|
+
import { parseViewBox } from "./svg-viewbox.js";
|
|
3
4
|
import { THEME_LIMITS } from "./theme.js";
|
|
4
5
|
/**
|
|
5
|
-
* Checks of a theme's asset files (themes spec §4.2-§4.4
|
|
6
|
-
*
|
|
7
|
-
* boundary: the output is re-serialized from
|
|
8
|
-
* allowlisted, every attribute value and text
|
|
6
|
+
* Checks of a theme's asset files (themes spec §4.2-§4.4, theme brand coverage spec §1): woff2
|
|
7
|
+
* fonts, PNG logos, app icons and avatars, and the SVG sanitizer. The sanitized SVG is served to
|
|
8
|
+
* every browser, so {@link sanitizeThemeSvg} is a trust boundary: the output is re-serialized from
|
|
9
|
+
* the parsed tree (never the input bytes), elements are allowlisted, every attribute value and text
|
|
10
|
+
* node is escaped on output.
|
|
9
11
|
*/
|
|
10
12
|
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
11
13
|
const XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
@@ -79,10 +81,6 @@ const SVG_ELEMENTS = new Set([
|
|
|
79
81
|
const XML_ATTRS = new Set(["space", "lang"]);
|
|
80
82
|
/** Root attributes dropped: the design system sizes the logo to its slot. */
|
|
81
83
|
const ROOT_DROPPED = new Set(["width", "height", "class"]);
|
|
82
|
-
/** Characters of a viewBox value; longer values are refused before they are split. */
|
|
83
|
-
const VIEWBOX_MAX_CHARS = 128;
|
|
84
|
-
/** Characters a viewBox number may use (checked per character class, no backtracking). */
|
|
85
|
-
const VIEWBOX_NUMBER_RE = /^[-+.0-9eE]+$/;
|
|
86
84
|
/**
|
|
87
85
|
* The only functions an attribute value may call: colors and transforms. `url` is allowed only as
|
|
88
86
|
* `url(#id)` (checked separately); everything else (`image-set`, `cross-fade`, `element`,
|
|
@@ -150,21 +148,6 @@ function checkValue(el, attr, value) {
|
|
|
150
148
|
}
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
|
-
/** `min-x min-y width height`, width and height > 0; undefined when malformed. */
|
|
154
|
-
function parseViewBox(v) {
|
|
155
|
-
if (v.length > VIEWBOX_MAX_CHARS)
|
|
156
|
-
return undefined;
|
|
157
|
-
const parts = v
|
|
158
|
-
.trim()
|
|
159
|
-
.split(/[\s,]+/)
|
|
160
|
-
.filter((p) => p !== "");
|
|
161
|
-
if (parts.length !== 4 || !parts.every((p) => VIEWBOX_NUMBER_RE.test(p)))
|
|
162
|
-
return undefined;
|
|
163
|
-
const n = parts.map(Number);
|
|
164
|
-
if (!n.every(Number.isFinite) || n[2] <= 0 || n[3] <= 0)
|
|
165
|
-
return undefined;
|
|
166
|
-
return n;
|
|
167
|
-
}
|
|
168
151
|
/** The serialized attributes of an allowed SVG element; rejects the forbidden ones. */
|
|
169
152
|
function attributesOf(tag, isRoot, usesXlink) {
|
|
170
153
|
const el = tag.local;
|
|
@@ -356,16 +339,17 @@ export function checkWoff2(bytes) {
|
|
|
356
339
|
}
|
|
357
340
|
/**
|
|
358
341
|
* A PNG logo: the PNG signature, an `IHDR` first chunk with a height of at least
|
|
359
|
-
* {@link THEME_LIMITS}`.pngMinHeight` pixels, and at most
|
|
342
|
+
* {@link THEME_LIMITS}`.pngMinHeight` pixels, and at most `maxBytes` (default
|
|
343
|
+
* {@link THEME_LIMITS}`.pngBytes`; an app icon allows {@link THEME_LIMITS}`.appIconBytes`).
|
|
360
344
|
*/
|
|
361
|
-
export function checkPng(bytes) {
|
|
362
|
-
const r = readPng(bytes);
|
|
345
|
+
export function checkPng(bytes, maxBytes = THEME_LIMITS.pngBytes) {
|
|
346
|
+
const r = readPng(bytes, maxBytes);
|
|
363
347
|
return typeof r === "string" ? r : undefined;
|
|
364
348
|
}
|
|
365
349
|
/** {@link checkPng}, returning the IHDR size when the PNG passes. */
|
|
366
|
-
function readPng(bytes) {
|
|
367
|
-
if (bytes.length >
|
|
368
|
-
return `PNG is larger than ${
|
|
350
|
+
function readPng(bytes, maxBytes) {
|
|
351
|
+
if (bytes.length > maxBytes) {
|
|
352
|
+
return `PNG is larger than ${maxBytes} bytes`;
|
|
369
353
|
}
|
|
370
354
|
if (!startsWith(bytes, PNG_SIG))
|
|
371
355
|
return "image is not a PNG file (no PNG signature)";
|
|
@@ -383,13 +367,51 @@ function readPng(bytes) {
|
|
|
383
367
|
return { width, height };
|
|
384
368
|
}
|
|
385
369
|
/**
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
|
|
392
|
-
|
|
370
|
+
* Every asset a parsed theme names, in order: `fonts.<i>.file`, `logo.mark`, `logo.favicon`,
|
|
371
|
+
* `logo.illustration`, `logo.appIcon`, `logo.appIconMaskable`, `avatars.<i>.file`. `ref` is the
|
|
372
|
+
* path as written (an optional leading `./`). The one list every reader of theme assets uses (the
|
|
373
|
+
* checks, packing, the catalog and delivery), so a file the theme does not name is never read or
|
|
374
|
+
* served.
|
|
375
|
+
*/
|
|
376
|
+
export function themeAssetRefs(theme) {
|
|
377
|
+
return refsWithKind(theme).map(({ field, ref }) => ({ field, ref }));
|
|
378
|
+
}
|
|
379
|
+
/** The kind each logo field is checked as, in {@link themeAssetRefs} order. */
|
|
380
|
+
const LOGO_ASSETS = [
|
|
381
|
+
["mark", "image"],
|
|
382
|
+
["favicon", "favicon"],
|
|
383
|
+
["illustration", "image"],
|
|
384
|
+
["appIcon", "appIcon"],
|
|
385
|
+
["appIconMaskable", "appIcon"],
|
|
386
|
+
];
|
|
387
|
+
/** {@link themeAssetRefs} with the kind each file is checked as. */
|
|
388
|
+
function refsWithKind(theme) {
|
|
389
|
+
const refs = [];
|
|
390
|
+
theme.fonts?.forEach((f, i) => {
|
|
391
|
+
refs.push({ field: `fonts.${i}.file`, ref: f.file, kind: "font" });
|
|
392
|
+
});
|
|
393
|
+
for (const [key, kind] of LOGO_ASSETS) {
|
|
394
|
+
const ref = theme.logo?.[key];
|
|
395
|
+
if (ref !== undefined)
|
|
396
|
+
refs.push({ field: `logo.${key}`, ref, kind });
|
|
397
|
+
}
|
|
398
|
+
theme.avatars?.forEach((a, i) => {
|
|
399
|
+
refs.push({ field: `avatars.${i}.file`, ref: a.file, kind: "avatar" });
|
|
400
|
+
});
|
|
401
|
+
return refs;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Resolves and checks the asset files of a parsed theme ({@link themeAssetRefs}), each by its
|
|
405
|
+
* kind: `fonts[].file` ({@link checkWoff2}); `logo.mark` and `logo.illustration` (`.svg` through
|
|
406
|
+
* {@link sanitizeThemeSvg}, `.png` through {@link checkPng}); `logo.favicon` and `avatars[].file`
|
|
407
|
+
* likewise and square (SVG viewBox or PNG width = height); `logo.appIcon` and
|
|
408
|
+
* `logo.appIconMaskable` PNG only, square, at least {@link THEME_LIMITS}`.appIconMinSize` px and at
|
|
409
|
+
* most {@link THEME_LIMITS}`.appIconBytes`. `files` holds the plugin's files keyed by their path
|
|
410
|
+
* without a leading `./`; the returned `assets` (the sanitized SVG bytes, the other files
|
|
411
|
+
* unchanged) use the same keys. Errors are `<field>: <reason>`, English; the total input size of
|
|
412
|
+
* the theme's distinct assets must stay within {@link THEME_LIMITS}`.assetsBytes`. That limit is
|
|
413
|
+
* per plugin, so a caller reading several themes also checks the sum over all of them (distinct
|
|
414
|
+
* paths).
|
|
393
415
|
*/
|
|
394
416
|
export function validateThemeAssets(theme, files) {
|
|
395
417
|
const assets = new Map();
|
|
@@ -415,13 +437,16 @@ export function validateThemeAssets(theme, files) {
|
|
|
415
437
|
assets.set(path, r);
|
|
416
438
|
};
|
|
417
439
|
const font = (b) => checkWoff2(b) ?? b;
|
|
440
|
+
const notSquare = (what, w, h) => `${what} must be square, not ${w} x ${h}`;
|
|
441
|
+
/** A logo image (`mark` rules); `square` names what must be square, or is undefined. */
|
|
418
442
|
const image = (ref, square) => (b) => {
|
|
419
|
-
const notSquare = (w, h) => `favicon must be square, not ${w} x ${h}`;
|
|
420
443
|
if (/\.png$/i.test(ref)) {
|
|
421
|
-
const r = readPng(b);
|
|
444
|
+
const r = readPng(b, THEME_LIMITS.pngBytes);
|
|
422
445
|
if (typeof r === "string")
|
|
423
446
|
return r;
|
|
424
|
-
return square && r.width !== r.height
|
|
447
|
+
return square !== undefined && r.width !== r.height
|
|
448
|
+
? notSquare(square, r.width, r.height)
|
|
449
|
+
: b;
|
|
425
450
|
}
|
|
426
451
|
if (!/\.svg$/i.test(ref))
|
|
427
452
|
return "must be a .svg or .png file";
|
|
@@ -429,15 +454,30 @@ export function validateThemeAssets(theme, files) {
|
|
|
429
454
|
if ("error" in r)
|
|
430
455
|
return r.error;
|
|
431
456
|
const [, , w, h] = r.viewBox;
|
|
432
|
-
return square && w !== h
|
|
457
|
+
return square !== undefined && w !== h
|
|
458
|
+
? notSquare(square, w, h)
|
|
459
|
+
: new TextEncoder().encode(r.svg);
|
|
433
460
|
};
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
461
|
+
const appIcon = (ref) => (b) => {
|
|
462
|
+
if (!/\.png$/i.test(ref))
|
|
463
|
+
return "must be a .png file";
|
|
464
|
+
const r = readPng(b, THEME_LIMITS.appIconBytes);
|
|
465
|
+
if (typeof r === "string")
|
|
466
|
+
return r;
|
|
467
|
+
if (r.width !== r.height)
|
|
468
|
+
return notSquare("app icon", r.width, r.height);
|
|
469
|
+
if (r.width < THEME_LIMITS.appIconMinSize) {
|
|
470
|
+
return `app icon must be at least ${THEME_LIMITS.appIconMinSize} px, not ${r.width}`;
|
|
471
|
+
}
|
|
472
|
+
return b;
|
|
473
|
+
};
|
|
474
|
+
for (const { field, ref, kind } of refsWithKind(theme)) {
|
|
475
|
+
const check = kind === "font"
|
|
476
|
+
? font
|
|
477
|
+
: kind === "appIcon"
|
|
478
|
+
? appIcon(ref)
|
|
479
|
+
: image(ref, kind === "favicon" ? "favicon" : kind === "avatar" ? "avatar" : undefined);
|
|
480
|
+
resolve(field, ref, check);
|
|
441
481
|
}
|
|
442
482
|
let total = 0;
|
|
443
483
|
for (const n of sizes.values())
|
|
@@ -109,6 +109,26 @@ export declare const THEME_TOKENS: {
|
|
|
109
109
|
readonly dark: "rgba(0,0,0,.60)";
|
|
110
110
|
readonly light: "rgba(10,10,10,.25)";
|
|
111
111
|
};
|
|
112
|
+
readonly "preview-light": {
|
|
113
|
+
readonly dark: "#FAF9F6";
|
|
114
|
+
readonly light: "#FAF9F6";
|
|
115
|
+
};
|
|
116
|
+
readonly "preview-dark": {
|
|
117
|
+
readonly dark: "#0A0A0A";
|
|
118
|
+
readonly light: "#0A0A0A";
|
|
119
|
+
};
|
|
120
|
+
readonly lightbox: {
|
|
121
|
+
readonly dark: "rgba(0,0,0,.88)";
|
|
122
|
+
readonly light: "rgba(10,10,10,.80)";
|
|
123
|
+
};
|
|
124
|
+
readonly "float-ground": {
|
|
125
|
+
readonly dark: "rgba(28,28,26,0.85)";
|
|
126
|
+
readonly light: "rgba(255,255,255,0.85)";
|
|
127
|
+
};
|
|
128
|
+
readonly "float-line": {
|
|
129
|
+
readonly dark: "rgba(255,255,255,0.08)";
|
|
130
|
+
readonly light: "rgba(26,26,24,0.08)";
|
|
131
|
+
};
|
|
112
132
|
readonly "diff-add": {
|
|
113
133
|
readonly dark: "rgba(63,212,131,.08)";
|
|
114
134
|
readonly light: "rgba(22,128,63,.10)";
|
|
@@ -251,6 +271,10 @@ export declare const THEME_TOKENS: {
|
|
|
251
271
|
readonly dark: "0 8px 24px rgba(0,0,0,.45)";
|
|
252
272
|
readonly light: "0 8px 24px rgba(26,26,24,.08)";
|
|
253
273
|
};
|
|
274
|
+
readonly "shadow-float-touch": {
|
|
275
|
+
readonly dark: "0 6px 20px rgba(0,0,0,.35)";
|
|
276
|
+
readonly light: "0 6px 20px rgba(26,26,24,.10)";
|
|
277
|
+
};
|
|
254
278
|
};
|
|
255
279
|
readonly radius: {
|
|
256
280
|
readonly sm: 4;
|
|
@@ -265,8 +289,8 @@ export declare const THEME_FONTS: {
|
|
|
265
289
|
};
|
|
266
290
|
/** The tokens a theme may override: no avatar colors, no color-mix values (they derive). */
|
|
267
291
|
export declare const THEME_OVERRIDABLE: {
|
|
268
|
-
readonly color: readonly ["bg", "panel", "panel-2", "sidebar", "sidebar-active", "raised", "selected", "hover", "line-soft", "line", "line-strong", "line-card", "scroll-thumb", "ink", "muted", "faint", "disabled", "accent", "accent-hover", "accent-press", "on-accent", "focus-ring", "ok", "fail", "warn", "scrim", "diff-add", "diff-del"];
|
|
269
|
-
readonly shadow: readonly ["shadow-1", "shadow-2", "shadow-sheet", "shadow-float"];
|
|
292
|
+
readonly color: readonly ["bg", "panel", "panel-2", "sidebar", "sidebar-active", "raised", "selected", "hover", "line-soft", "line", "line-strong", "line-card", "scroll-thumb", "ink", "muted", "faint", "disabled", "accent", "accent-hover", "accent-press", "on-accent", "focus-ring", "ok", "fail", "warn", "scrim", "lightbox", "float-ground", "float-line", "diff-add", "diff-del"];
|
|
293
|
+
readonly shadow: readonly ["shadow-1", "shadow-2", "shadow-sheet", "shadow-float", "shadow-float-touch"];
|
|
270
294
|
readonly radius: readonly ["sm", "md", "bubble"];
|
|
271
295
|
};
|
|
272
296
|
/** [foreground, background, floor] or, with a fourth element, the surface it sits on. */
|
|
@@ -30,6 +30,11 @@ export const THEME_TOKENS = {
|
|
|
30
30
|
"fail": { dark: "#FF5C52", light: "#C8302A" },
|
|
31
31
|
"warn": { dark: "#F2C14B", light: "#8F6500" },
|
|
32
32
|
"scrim": { dark: "rgba(0,0,0,.60)", light: "rgba(10,10,10,.25)" },
|
|
33
|
+
"preview-light": { dark: "#FAF9F6", light: "#FAF9F6" },
|
|
34
|
+
"preview-dark": { dark: "#0A0A0A", light: "#0A0A0A" },
|
|
35
|
+
"lightbox": { dark: "rgba(0,0,0,.88)", light: "rgba(10,10,10,.80)" },
|
|
36
|
+
"float-ground": { dark: "rgba(28,28,26,0.85)", light: "rgba(255,255,255,0.85)" },
|
|
37
|
+
"float-line": { dark: "rgba(255,255,255,0.08)", light: "rgba(26,26,24,0.08)" },
|
|
33
38
|
"diff-add": { dark: "rgba(63,212,131,.08)", light: "rgba(22,128,63,.10)" },
|
|
34
39
|
"diff-del": { dark: "rgba(255,92,82,.08)", light: "rgba(207,34,46,.08)" },
|
|
35
40
|
"avatar-black": { dark: "#1C1C1A", light: "#1C1C1A" },
|
|
@@ -67,6 +72,7 @@ export const THEME_TOKENS = {
|
|
|
67
72
|
"shadow-2": { dark: "0 16px 48px rgba(0,0,0,.50)", light: "0 8px 24px rgba(10,10,10,.12)" },
|
|
68
73
|
"shadow-sheet": { dark: "-16px 0 40px rgba(0,0,0,.40)", light: "-4px 0 16px rgba(10,10,10,.08)" },
|
|
69
74
|
"shadow-float": { dark: "0 8px 24px rgba(0,0,0,.45)", light: "0 8px 24px rgba(26,26,24,.08)" },
|
|
75
|
+
"shadow-float-touch": { dark: "0 6px 20px rgba(0,0,0,.35)", light: "0 6px 20px rgba(26,26,24,.10)" },
|
|
70
76
|
},
|
|
71
77
|
radius: { sm: 4, md: 8, bubble: 10 },
|
|
72
78
|
};
|
|
@@ -104,6 +110,9 @@ export const THEME_OVERRIDABLE = {
|
|
|
104
110
|
"fail",
|
|
105
111
|
"warn",
|
|
106
112
|
"scrim",
|
|
113
|
+
"lightbox",
|
|
114
|
+
"float-ground",
|
|
115
|
+
"float-line",
|
|
107
116
|
"diff-add",
|
|
108
117
|
"diff-del",
|
|
109
118
|
],
|
|
@@ -112,6 +121,7 @@ export const THEME_OVERRIDABLE = {
|
|
|
112
121
|
"shadow-2",
|
|
113
122
|
"shadow-sheet",
|
|
114
123
|
"shadow-float",
|
|
124
|
+
"shadow-float-touch",
|
|
115
125
|
],
|
|
116
126
|
radius: ["sm", "md", "bubble"],
|
|
117
127
|
};
|
|
@@ -123,8 +133,15 @@ export const THEME_CONTRAST = [
|
|
|
123
133
|
["muted", "sidebar", 4.5],
|
|
124
134
|
["muted", "panel-2", 4.5],
|
|
125
135
|
["muted", "raised", 4.5],
|
|
136
|
+
["ink", "float-ground", 4.5, "bg"],
|
|
137
|
+
["muted", "float-ground", 4.5, "bg"],
|
|
126
138
|
["muted", "selected", 4.5],
|
|
127
139
|
["muted", "hover", 4.5],
|
|
140
|
+
["ink", "hover", 4.5, "panel"],
|
|
141
|
+
["ink", "selected", 4.5, "panel"],
|
|
142
|
+
["muted", "hover", 4.5, "panel"],
|
|
143
|
+
["fail", "selected", 4.5, "panel"],
|
|
144
|
+
["accent", "selected", 3, "panel"],
|
|
128
145
|
["disabled", "bg", 3],
|
|
129
146
|
["disabled", "panel", 3],
|
|
130
147
|
["disabled", "hover", 3],
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type BuiltinAvatarPresetId } from "./avatar-presets.js";
|
|
2
3
|
import { type LocalizedName } from "./plugin-package.js";
|
|
3
4
|
import { type MergedScheme, type ThemeScheme } from "./theme-readability.js";
|
|
4
5
|
/**
|
|
5
6
|
* A theme file `themes/<id>.json` (themes spec §4): a partial override of the design tokens per
|
|
6
|
-
* scheme, optional fonts
|
|
7
|
+
* scheme, optional fonts, an optional logo and the brand fields (theme brand coverage spec §1:
|
|
8
|
+
* illustration, app icons, decoration, avatar presets). The id is the file's base name
|
|
7
9
|
* ({@link themeIdOf}, `CATALOG_ITEM_NAME_RE`).
|
|
8
10
|
*
|
|
9
11
|
* {@link parseThemeFile} is the CSS-injection boundary: every token value is parsed against the
|
|
10
12
|
* grammar `tokens.json` uses (`#RRGGBB`, `rgba(r,g,b,a)`, shadows `<x> <y> <blur> [<spread>]
|
|
11
13
|
* <color>`) and re-rendered from its parts in canonical form. Asset paths (`fonts[].file`,
|
|
12
|
-
* `logo
|
|
13
|
-
* to `[A-Za-z0-9._-]`, so they need no escaping inside `url(...)`. Font
|
|
14
|
-
* letters, digits, spaces and `-`. Free text (`name`, `description`,
|
|
15
|
-
* control, format, line / paragraph separator or
|
|
16
|
-
* never CSS. Whether the files exist and their
|
|
17
|
-
* the reader of the package, with {@link THEME_LIMITS}.
|
|
14
|
+
* `logo.*`, `avatars[].file`) are relative to the plugin root (an optional leading `./`) and every
|
|
15
|
+
* segment is limited to `[A-Za-z0-9._-]`, so they need no escaping inside `url(...)`. Font
|
|
16
|
+
* families are limited to letters, digits, spaces and `-`. Free text (`name`, `description`,
|
|
17
|
+
* `logo.wordmark`, `avatars[].name`) carries no control, format, line / paragraph separator or
|
|
18
|
+
* lone surrogate characters; it is text for the UI, never CSS. Whether the files exist and their
|
|
19
|
+
* size / signature / SVG rules are checked by the reader of the package, with {@link THEME_LIMITS}.
|
|
18
20
|
*
|
|
19
21
|
* The committed JSON Schema (`schemas/theme.v1.schema.json`) is generated from
|
|
20
22
|
* {@link ThemeFileSchema} (the shape only) by `pnpm gen:package-schemas`; token names, value
|
|
@@ -26,7 +28,7 @@ export declare const THEME_LIMITS: {
|
|
|
26
28
|
readonly fileBytes: number;
|
|
27
29
|
/** Themes per plugin. */
|
|
28
30
|
readonly perPlugin: 10;
|
|
29
|
-
/** Total bytes of a plugin's theme assets (fonts and
|
|
31
|
+
/** Total bytes of a plugin's theme assets (fonts, logos, app icons and avatars). */
|
|
30
32
|
readonly assetsBytes: number;
|
|
31
33
|
/** Fonts per theme. */
|
|
32
34
|
readonly fonts: 8;
|
|
@@ -38,9 +40,21 @@ export declare const THEME_LIMITS: {
|
|
|
38
40
|
readonly pngBytes: number;
|
|
39
41
|
/** Minimum pixel height of a logo PNG. */
|
|
40
42
|
readonly pngMinHeight: 64;
|
|
41
|
-
/** Characters of the wordmark. */
|
|
43
|
+
/** Characters of the wordmark (and of each avatar preset name). */
|
|
42
44
|
readonly wordmark: 24;
|
|
45
|
+
/** Avatar presets per theme. */
|
|
46
|
+
readonly avatars: 12;
|
|
47
|
+
/** Bytes of an app icon PNG. */
|
|
48
|
+
readonly appIconBytes: 1048576;
|
|
49
|
+
/** Minimum pixel size of an app icon PNG (square). */
|
|
50
|
+
readonly appIconMinSize: 512;
|
|
43
51
|
};
|
|
52
|
+
/** The id of a theme's avatar preset (`avatars[].id`); never a built-in preset id. */
|
|
53
|
+
export declare const THEME_AVATAR_ID_RE: RegExp;
|
|
54
|
+
/** The sign-in page background decoration (the dither columns) a theme asks for; omitted means
|
|
55
|
+
* `dither`. */
|
|
56
|
+
export declare const THEME_DECORATIONS: readonly ["dither", "none"];
|
|
57
|
+
export type ThemeDecoration = (typeof THEME_DECORATIONS)[number];
|
|
44
58
|
/** A theme of the plugin: a `./…/<id>.json` file ({@link ThemeFile}). */
|
|
45
59
|
export interface PluginThemeRef {
|
|
46
60
|
path: string;
|
|
@@ -74,6 +88,24 @@ export interface ThemeLogo {
|
|
|
74
88
|
wordmark?: string;
|
|
75
89
|
/** `.svg` or `.png` path inside the plugin. */
|
|
76
90
|
favicon?: string;
|
|
91
|
+
/** The empty-state art: `.svg` or `.png` path inside the plugin, the `mark` rules. */
|
|
92
|
+
illustration?: string;
|
|
93
|
+
/** Apple touch and manifest `any` icon: a square `.png` path, ≥ 512 px, ≤ 1 MiB. */
|
|
94
|
+
appIcon?: string;
|
|
95
|
+
/** Manifest `maskable` icon: a square `.png` path, ≥ 512 px, ≤ 1 MiB; requires `appIcon`. */
|
|
96
|
+
appIconMaskable?: string;
|
|
97
|
+
}
|
|
98
|
+
/** An agent avatar preset the theme adds to the picker. */
|
|
99
|
+
export interface ThemeAvatarPreset {
|
|
100
|
+
/** {@link THEME_AVATAR_ID_RE}, unique in the theme, not a built-in preset id. */
|
|
101
|
+
id: string;
|
|
102
|
+
/** Each ≤ 24 characters, the wordmark's character rules. */
|
|
103
|
+
name: {
|
|
104
|
+
en: string;
|
|
105
|
+
zh?: string;
|
|
106
|
+
};
|
|
107
|
+
/** A square `.svg` or `.png` path inside the plugin (PNG ≥ 64 px, the `mark` size limits). */
|
|
108
|
+
file: string;
|
|
77
109
|
}
|
|
78
110
|
/** `themes/<id>.json`. */
|
|
79
111
|
export interface ThemeFile {
|
|
@@ -86,6 +118,12 @@ export interface ThemeFile {
|
|
|
86
118
|
schemes: Partial<Record<ThemeScheme, ThemeSchemeOverride>>;
|
|
87
119
|
fonts?: ThemeFont[];
|
|
88
120
|
logo?: ThemeLogo;
|
|
121
|
+
/** Omitted means `dither`; readers apply the default. */
|
|
122
|
+
decoration?: ThemeDecoration;
|
|
123
|
+
/** At most {@link THEME_LIMITS}`.avatars`. */
|
|
124
|
+
avatars?: ThemeAvatarPreset[];
|
|
125
|
+
/** Built-in presets not offered; hiding all of them requires at least one `avatars` entry. */
|
|
126
|
+
hideAvatarPresets?: BuiltinAvatarPresetId[];
|
|
89
127
|
}
|
|
90
128
|
/**
|
|
91
129
|
* A theme file after {@link parseThemeFile}: values canonical. It holds only the file's own
|
|
@@ -108,7 +146,7 @@ export interface ParseThemeOptions {
|
|
|
108
146
|
*/
|
|
109
147
|
readability?: boolean;
|
|
110
148
|
}
|
|
111
|
-
/** `themes/
|
|
149
|
+
/** `themes/neon-grid.json` → `neon-grid`. */
|
|
112
150
|
export declare function themeIdOf(path: string): string;
|
|
113
151
|
/**
|
|
114
152
|
* The zod schema of a theme file's shape (strict objects). Token names and values are only
|