@capybara-hq/plugin-sdk 0.1.0-rc.3 → 0.1.0-rc.30
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/agent-docs/agent-templates.md +15 -3
- package/agent-docs/concepts.md +5 -0
- package/agent-docs/connector-templates.md +2 -1
- package/agent-docs/extension-points/channel.md +1 -1
- package/agent-docs/extension-points/config-source.md +1 -1
- package/agent-docs/extension-points/connector.md +1 -1
- package/agent-docs/extension-points/context.md +15 -0
- package/agent-docs/extension-points/counter.md +1 -1
- package/agent-docs/extension-points/directory.md +1 -1
- package/agent-docs/extension-points/file-preview.md +1 -1
- package/agent-docs/extension-points/identity-source.md +1 -1
- package/agent-docs/extension-points/model-provider.md +4 -2
- package/agent-docs/extension-points/object-store.md +3 -1
- package/agent-docs/extension-points/sandbox.md +3 -3
- package/agent-docs/extension-points/secret-store.md +1 -1
- package/agent-docs/extension-points/web-fetch.md +1 -1
- package/agent-docs/extension-points/web-search.md +1 -1
- package/agent-docs/extensions.md +29 -4
- package/agent-docs/plugin-format.md +43 -3
- package/agent-docs/setup.md +46 -0
- package/agent-docs/skills.md +1 -1
- package/agent-docs/tool-naming.md +1 -1
- package/dist/agent-template.d.ts +15 -6
- package/dist/agent-template.js +32 -13
- package/dist/bootstrap.d.ts +15 -1
- package/dist/bootstrap.js +17 -1
- package/dist/cards.d.ts +56 -13
- package/dist/cards.js +90 -20
- package/dist/channel.d.ts +111 -48
- 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 +22 -0
- package/dist/config-ui.js +64 -4
- package/dist/connector-auth.d.ts +7 -2
- package/dist/connector-auth.js +29 -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 +135 -26
- package/dist/define-extension.d.ts +26 -12
- package/dist/define-extension.js +11 -4
- package/dist/device-protocol.d.ts +319 -0
- package/dist/device-protocol.js +559 -0
- package/dist/extension-point.d.ts +2 -0
- package/dist/extension-point.js +5 -2
- package/dist/file-preview.d.ts +1 -1
- package/dist/git-hosts.d.ts +44 -0
- package/dist/git-hosts.js +81 -0
- package/dist/hooks.d.ts +111 -21
- package/dist/hooks.js +5 -0
- package/dist/http-access.d.ts +52 -0
- package/dist/http-access.js +12 -0
- package/dist/identity.d.ts +22 -9
- package/dist/index.d.ts +21 -1
- package/dist/index.js +21 -1
- package/dist/marketplace.d.ts +26 -0
- package/dist/marketplace.js +43 -1
- package/dist/model-params.d.ts +41 -22
- package/dist/model-params.js +28 -15
- package/dist/model.d.ts +180 -71
- package/dist/model.js +71 -19
- package/dist/net.d.ts +52 -0
- package/dist/net.js +34 -0
- package/dist/permissions.d.ts +42 -20
- package/dist/permissions.js +97 -40
- package/dist/plugin-manifest.d.ts +45 -5
- package/dist/plugin-manifest.js +169 -6
- package/dist/plugin-package.d.ts +82 -38
- package/dist/plugin-package.js +61 -29
- package/dist/sandbox-linux-runtime-source.d.ts +15 -0
- package/dist/sandbox-linux-runtime-source.js +1421 -0
- package/dist/sandbox-native-runtime-source.d.ts +8 -0
- package/dist/sandbox-native-runtime-source.js +307 -0
- package/dist/sandbox-operation.d.ts +248 -0
- package/dist/sandbox-operation.js +245 -0
- package/dist/sandbox-runtime-source.d.ts +19 -0
- package/dist/sandbox-runtime-source.js +28 -0
- package/dist/sandbox.d.ts +201 -16
- package/dist/sandbox.js +89 -14
- package/dist/secret.d.ts +4 -1
- package/dist/secret.js +4 -1
- package/dist/setup-check.d.ts +115 -0
- package/dist/setup-check.js +142 -0
- package/dist/setup-guide-parse.d.ts +121 -0
- package/dist/setup-guide-parse.js +350 -0
- package/dist/setup-guide-render.d.ts +45 -0
- package/dist/setup-guide-render.js +351 -0
- package/dist/setup-guide.d.ts +94 -0
- package/dist/setup-guide.js +336 -0
- package/dist/skill-invocation.d.ts +4 -3
- package/dist/skill-invocation.js +5 -4
- package/dist/skill.d.ts +34 -21
- package/dist/skill.js +48 -31
- package/dist/storage.d.ts +52 -25
- package/dist/theme-assets.d.ts +39 -0
- package/dist/theme-assets.js +449 -0
- package/dist/theme-readability.d.ts +37 -0
- package/dist/theme-readability.js +145 -0
- package/dist/theme-tokens.generated.d.ts +279 -0
- package/dist/theme-tokens.generated.js +174 -0
- package/dist/theme.d.ts +152 -0
- package/dist/theme.js +392 -0
- package/dist/tool.d.ts +69 -26
- package/dist/tool.js +29 -9
- package/dist/ui-parts.d.ts +23 -0
- package/dist/ui-parts.js +337 -0
- package/dist/ui-resolve.d.ts +35 -0
- package/dist/ui-resolve.js +42 -0
- package/dist/ui-slots.d.ts +53 -0
- package/dist/ui-slots.js +238 -0
- package/dist/ui.d.ts +191 -79
- package/dist/ui.js +101 -27
- package/dist/url.d.ts +4 -1
- package/dist/url.js +4 -1
- package/package.json +7 -1
- package/schemas/bootstrap.v1.schema.json +6 -0
- package/schemas/connector-template.v1.schema.json +35 -0
- package/schemas/marketplace.v1.schema.json +14 -0
- package/schemas/plugin.v1.schema.json +115 -3
- package/schemas/theme.v1.schema.json +225 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { THEME_CONTRAST, THEME_SEPARATION } from "./theme-tokens.generated.js";
|
|
2
|
+
const HEX_RE = /^#[0-9A-F]{6}$/;
|
|
3
|
+
const LOOSE_HEX_RE = /^#[0-9A-Fa-f]{6}$/;
|
|
4
|
+
const RGBA_PARTS_RE = /^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(0|1|0?\.\d+)\)$/;
|
|
5
|
+
function luminance(hex) {
|
|
6
|
+
const ch = [1, 3, 5].map((i) => {
|
|
7
|
+
const c = Number.parseInt(hex.slice(i, i + 2), 16) / 255;
|
|
8
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
9
|
+
});
|
|
10
|
+
return 0.2126 * ch[0] + 0.7152 * ch[1] + 0.0722 * ch[2];
|
|
11
|
+
}
|
|
12
|
+
/** WCAG 2 contrast ratio of two #RRGGBB colors. */
|
|
13
|
+
export function contrastRatio(fg, bg) {
|
|
14
|
+
const [hi, lo] = [luminance(fg), luminance(bg)].sort((x, y) => y - x);
|
|
15
|
+
return (hi + 0.05) / (lo + 0.05);
|
|
16
|
+
}
|
|
17
|
+
/** OKLab lightness (x100) of a #RRGGBB color. */
|
|
18
|
+
export function oklabL(hex) {
|
|
19
|
+
const [r, g, b] = [1, 3, 5].map((i) => {
|
|
20
|
+
const c = Number.parseInt(hex.slice(i, i + 2), 16) / 255;
|
|
21
|
+
return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
22
|
+
});
|
|
23
|
+
const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
24
|
+
const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
25
|
+
const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
26
|
+
return (0.2104542553 * l + 0.793617785 * m - 0.0040720958 * s) * 100;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The opaque #RRGGBB of `color` drawn over the opaque `ground`: a hex color passes through, an
|
|
30
|
+
* rgba(...) color is alpha-blended (per channel, rounded), anything else (color-mix) is undefined.
|
|
31
|
+
*/
|
|
32
|
+
export function compositeOver(color, ground) {
|
|
33
|
+
if (HEX_RE.test(color))
|
|
34
|
+
return color;
|
|
35
|
+
const m = RGBA_PARTS_RE.exec(color);
|
|
36
|
+
if (!m || !HEX_RE.test(ground))
|
|
37
|
+
return undefined;
|
|
38
|
+
const a = Number(m[4]);
|
|
39
|
+
const hex = [1, 2, 3]
|
|
40
|
+
.map((i) => {
|
|
41
|
+
const fg = Number(m[i]);
|
|
42
|
+
const bg = Number.parseInt(ground.slice(2 * i - 1, 2 * i + 1), 16);
|
|
43
|
+
return Math.round(fg * a + bg * (1 - a))
|
|
44
|
+
.toString(16)
|
|
45
|
+
.padStart(2, "0");
|
|
46
|
+
})
|
|
47
|
+
.join("");
|
|
48
|
+
return `#${hex.toUpperCase()}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Evaluates the readability rules (every contrast pair and separation entry of the design tokens)
|
|
52
|
+
* on one merged scheme. An rgba(...) value is composited over the scheme's `bg` first, or over a
|
|
53
|
+
* pair's surface token; pairs with a color-mix value are skipped. `selected` must stand further
|
|
54
|
+
* from a surface than `hover` on the same surface. `rules` defaults to the built-in lists.
|
|
55
|
+
*/
|
|
56
|
+
export function checkThemeReadability(_scheme, merged, rules = { contrast: THEME_CONTRAST, separation: THEME_SEPARATION }) {
|
|
57
|
+
const issues = [];
|
|
58
|
+
// Hex case is not significant in CSS: evaluate `#rrggbb` like `#RRGGBB`.
|
|
59
|
+
const color = Object.fromEntries(Object.entries(merged.color).map(([n, v]) => [n, LOOSE_HEX_RE.test(v) ? v.toUpperCase() : v]));
|
|
60
|
+
const bg = color.bg ?? "";
|
|
61
|
+
// A value the rules read that cannot be evaluated is reported, never silently skipped. A
|
|
62
|
+
// color-mix value is legitimate (it derives) and is skipped; `bg` must be a plain hex ground.
|
|
63
|
+
const used = new Set(["bg"]);
|
|
64
|
+
for (const [fg, back, , surface] of rules.contrast) {
|
|
65
|
+
for (const n of [fg, back, surface])
|
|
66
|
+
if (n !== undefined)
|
|
67
|
+
used.add(n);
|
|
68
|
+
}
|
|
69
|
+
for (const [ground, surface] of rules.separation) {
|
|
70
|
+
used.add(ground);
|
|
71
|
+
used.add(surface);
|
|
72
|
+
}
|
|
73
|
+
for (const name of used) {
|
|
74
|
+
const v = color[name];
|
|
75
|
+
if (v === undefined || v.startsWith("color-mix("))
|
|
76
|
+
continue;
|
|
77
|
+
const ok = name === "bg" ? HEX_RE.test(v) : HEX_RE.test(v) || RGBA_PARTS_RE.test(v);
|
|
78
|
+
if (!ok) {
|
|
79
|
+
issues.push({ kind: "unevaluable", pair: name, ratio: Number.NaN, floor: 0, detail: v });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** The opaque value of a surface token: an rgba surface is composited over `bg`. */
|
|
83
|
+
const surfaceOf = (name) => {
|
|
84
|
+
const raw = color[name];
|
|
85
|
+
return raw === undefined ? undefined : compositeOver(raw, bg);
|
|
86
|
+
};
|
|
87
|
+
for (const [fg, back, floor, surface] of rules.contrast) {
|
|
88
|
+
const ground = surfaceOf(surface ?? "bg");
|
|
89
|
+
if (ground === undefined)
|
|
90
|
+
continue;
|
|
91
|
+
const rawA = color[fg];
|
|
92
|
+
const rawB = color[back];
|
|
93
|
+
if (rawA === undefined || rawB === undefined)
|
|
94
|
+
continue;
|
|
95
|
+
const a = compositeOver(rawA, ground);
|
|
96
|
+
const b = compositeOver(rawB, ground);
|
|
97
|
+
if (a === undefined || b === undefined)
|
|
98
|
+
continue;
|
|
99
|
+
const ratio = contrastRatio(a, b);
|
|
100
|
+
if (ratio + 1e-9 < floor) {
|
|
101
|
+
const composited = a !== rawA || b !== rawB ? ` (rgba composited over ${surface ?? "bg"})` : "";
|
|
102
|
+
issues.push({
|
|
103
|
+
kind: "contrast",
|
|
104
|
+
pair: `${fg} on ${back}${surface === undefined ? "" : ` over ${surface}`}`,
|
|
105
|
+
ratio,
|
|
106
|
+
floor,
|
|
107
|
+
detail: `${a} on ${b}${composited}`,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const delta = new Map();
|
|
112
|
+
for (const [ground, surface, floor] of rules.separation) {
|
|
113
|
+
const s = surfaceOf(surface);
|
|
114
|
+
const raw = color[ground];
|
|
115
|
+
const g = s === undefined || raw === undefined ? undefined : compositeOver(raw, s);
|
|
116
|
+
if (s === undefined || g === undefined)
|
|
117
|
+
continue;
|
|
118
|
+
const d = Math.abs(oklabL(g) - oklabL(s));
|
|
119
|
+
delta.set(`${ground}@${surface}`, d);
|
|
120
|
+
if (d + 1e-9 < floor) {
|
|
121
|
+
issues.push({
|
|
122
|
+
kind: "separation",
|
|
123
|
+
pair: `${ground} on ${surface}`,
|
|
124
|
+
ratio: d,
|
|
125
|
+
floor,
|
|
126
|
+
detail: `${g} on ${s}`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const [k, hover] of delta) {
|
|
131
|
+
if (!k.startsWith("hover@"))
|
|
132
|
+
continue;
|
|
133
|
+
const surface = k.slice("hover@".length);
|
|
134
|
+
const selected = delta.get(`selected@${surface}`);
|
|
135
|
+
if (selected !== undefined && selected <= hover) {
|
|
136
|
+
issues.push({
|
|
137
|
+
kind: "separation-order",
|
|
138
|
+
pair: `selected on ${surface}`,
|
|
139
|
+
ratio: selected,
|
|
140
|
+
floor: hover,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return issues;
|
|
145
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/** The built-in token values a theme overrides (design spec §2). */
|
|
2
|
+
export declare const THEME_TOKENS: {
|
|
3
|
+
readonly color: {
|
|
4
|
+
readonly bg: {
|
|
5
|
+
readonly dark: "#0A0A0A";
|
|
6
|
+
readonly light: "#FAF9F6";
|
|
7
|
+
};
|
|
8
|
+
readonly panel: {
|
|
9
|
+
readonly dark: "#111110";
|
|
10
|
+
readonly light: "#FFFFFF";
|
|
11
|
+
};
|
|
12
|
+
readonly "panel-2": {
|
|
13
|
+
readonly dark: "#0E0E0D";
|
|
14
|
+
readonly light: "#FCFBF9";
|
|
15
|
+
};
|
|
16
|
+
readonly sidebar: {
|
|
17
|
+
readonly dark: "#111110";
|
|
18
|
+
readonly light: "#F3F2EE";
|
|
19
|
+
};
|
|
20
|
+
readonly "sidebar-active": {
|
|
21
|
+
readonly dark: "#1A1A18";
|
|
22
|
+
readonly light: "rgba(26,26,24,0.09)";
|
|
23
|
+
};
|
|
24
|
+
readonly raised: {
|
|
25
|
+
readonly dark: "#141413";
|
|
26
|
+
readonly light: "#FFFFFF";
|
|
27
|
+
};
|
|
28
|
+
readonly selected: {
|
|
29
|
+
readonly dark: "#1F1F1D";
|
|
30
|
+
readonly light: "rgba(26,26,24,0.07)";
|
|
31
|
+
};
|
|
32
|
+
readonly hover: {
|
|
33
|
+
readonly dark: "#171716";
|
|
34
|
+
readonly light: "rgba(26,26,24,0.04)";
|
|
35
|
+
};
|
|
36
|
+
readonly "line-soft": {
|
|
37
|
+
readonly dark: "#1C1C1A";
|
|
38
|
+
readonly light: "#E8E7E2";
|
|
39
|
+
};
|
|
40
|
+
readonly line: {
|
|
41
|
+
readonly dark: "#2A2A28";
|
|
42
|
+
readonly light: "#D9D8D2";
|
|
43
|
+
};
|
|
44
|
+
readonly "line-strong": {
|
|
45
|
+
readonly dark: "#3A3A37";
|
|
46
|
+
readonly light: "#B5B5AE";
|
|
47
|
+
};
|
|
48
|
+
readonly "line-card": {
|
|
49
|
+
readonly dark: "rgba(255,255,255,0.08)";
|
|
50
|
+
readonly light: "rgba(26,26,24,0.07)";
|
|
51
|
+
};
|
|
52
|
+
readonly "scroll-thumb": {
|
|
53
|
+
readonly dark: "rgba(255,255,255,0.15)";
|
|
54
|
+
readonly light: "rgba(26,26,24,0.20)";
|
|
55
|
+
};
|
|
56
|
+
readonly ink: {
|
|
57
|
+
readonly dark: "#E6E6E3";
|
|
58
|
+
readonly light: "#1A1A18";
|
|
59
|
+
};
|
|
60
|
+
readonly muted: {
|
|
61
|
+
readonly dark: "#8E8E89";
|
|
62
|
+
readonly light: "#5E5E5A";
|
|
63
|
+
};
|
|
64
|
+
readonly faint: {
|
|
65
|
+
readonly dark: "#5A5A56";
|
|
66
|
+
readonly light: "#9A9A94";
|
|
67
|
+
};
|
|
68
|
+
readonly disabled: {
|
|
69
|
+
readonly dark: "#6E6E69";
|
|
70
|
+
readonly light: "#82827C";
|
|
71
|
+
};
|
|
72
|
+
readonly accent: {
|
|
73
|
+
readonly dark: "#FF6A13";
|
|
74
|
+
readonly light: "#CC4609";
|
|
75
|
+
};
|
|
76
|
+
readonly "accent-hover": {
|
|
77
|
+
readonly dark: "#FF8240";
|
|
78
|
+
readonly light: "#B83F08";
|
|
79
|
+
};
|
|
80
|
+
readonly "accent-press": {
|
|
81
|
+
readonly dark: "#E85A08";
|
|
82
|
+
readonly light: "#A33707";
|
|
83
|
+
};
|
|
84
|
+
readonly "on-accent": {
|
|
85
|
+
readonly dark: "#0A0A0A";
|
|
86
|
+
readonly light: "#FFFFFF";
|
|
87
|
+
};
|
|
88
|
+
readonly "accent-tint": {
|
|
89
|
+
readonly dark: "color-mix(in srgb, var(--cb-accent) 12%, transparent)";
|
|
90
|
+
readonly light: "color-mix(in srgb, var(--cb-accent) 12%, transparent)";
|
|
91
|
+
};
|
|
92
|
+
readonly "focus-ring": {
|
|
93
|
+
readonly dark: "rgba(255,106,19,.25)";
|
|
94
|
+
readonly light: "rgba(204,70,9,.18)";
|
|
95
|
+
};
|
|
96
|
+
readonly ok: {
|
|
97
|
+
readonly dark: "#3FD483";
|
|
98
|
+
readonly light: "#16803F";
|
|
99
|
+
};
|
|
100
|
+
readonly fail: {
|
|
101
|
+
readonly dark: "#FF5C52";
|
|
102
|
+
readonly light: "#C8302A";
|
|
103
|
+
};
|
|
104
|
+
readonly warn: {
|
|
105
|
+
readonly dark: "#F2C14B";
|
|
106
|
+
readonly light: "#8F6500";
|
|
107
|
+
};
|
|
108
|
+
readonly scrim: {
|
|
109
|
+
readonly dark: "rgba(0,0,0,.60)";
|
|
110
|
+
readonly light: "rgba(10,10,10,.25)";
|
|
111
|
+
};
|
|
112
|
+
readonly lightbox: {
|
|
113
|
+
readonly dark: "rgba(0,0,0,.88)";
|
|
114
|
+
readonly light: "rgba(10,10,10,.80)";
|
|
115
|
+
};
|
|
116
|
+
readonly "diff-add": {
|
|
117
|
+
readonly dark: "rgba(63,212,131,.08)";
|
|
118
|
+
readonly light: "rgba(22,128,63,.10)";
|
|
119
|
+
};
|
|
120
|
+
readonly "diff-del": {
|
|
121
|
+
readonly dark: "rgba(255,92,82,.08)";
|
|
122
|
+
readonly light: "rgba(207,34,46,.08)";
|
|
123
|
+
};
|
|
124
|
+
readonly "avatar-black": {
|
|
125
|
+
readonly dark: "#1C1C1A";
|
|
126
|
+
readonly light: "#1C1C1A";
|
|
127
|
+
};
|
|
128
|
+
readonly "avatar-white": {
|
|
129
|
+
readonly dark: "#F2F2EE";
|
|
130
|
+
readonly light: "#FFFFFF";
|
|
131
|
+
};
|
|
132
|
+
readonly "avatar-capybara-ground": {
|
|
133
|
+
readonly dark: "#3D2213";
|
|
134
|
+
readonly light: "#FBE3D2";
|
|
135
|
+
};
|
|
136
|
+
readonly "avatar-black-bear-ground": {
|
|
137
|
+
readonly dark: "#9C8468";
|
|
138
|
+
readonly light: "#E6D6C1";
|
|
139
|
+
};
|
|
140
|
+
readonly "avatar-black-bear-snout": {
|
|
141
|
+
readonly dark: "#C9A074";
|
|
142
|
+
readonly light: "#C49A6C";
|
|
143
|
+
};
|
|
144
|
+
readonly "avatar-panda-ground": {
|
|
145
|
+
readonly dark: "#5E9168";
|
|
146
|
+
readonly light: "#669D71";
|
|
147
|
+
};
|
|
148
|
+
readonly "avatar-elephant-ground": {
|
|
149
|
+
readonly dark: "#2A2838";
|
|
150
|
+
readonly light: "#E6E3F2";
|
|
151
|
+
};
|
|
152
|
+
readonly "avatar-elephant": {
|
|
153
|
+
readonly dark: "#9AA0A8";
|
|
154
|
+
readonly light: "#757B84";
|
|
155
|
+
};
|
|
156
|
+
readonly "avatar-elephant-ear": {
|
|
157
|
+
readonly dark: "#7D838C";
|
|
158
|
+
readonly light: "#5A6068";
|
|
159
|
+
};
|
|
160
|
+
readonly "avatar-fox-ground": {
|
|
161
|
+
readonly dark: "#3A2414";
|
|
162
|
+
readonly light: "#FCEBD9";
|
|
163
|
+
};
|
|
164
|
+
readonly "avatar-fox": {
|
|
165
|
+
readonly dark: "#F07A2E";
|
|
166
|
+
readonly light: "#D8601A";
|
|
167
|
+
};
|
|
168
|
+
readonly "avatar-fox-ear": {
|
|
169
|
+
readonly dark: "#8A3E16";
|
|
170
|
+
readonly light: "#7A3310";
|
|
171
|
+
};
|
|
172
|
+
readonly "avatar-owl-ground": {
|
|
173
|
+
readonly dark: "#2E2618";
|
|
174
|
+
readonly light: "#EFE6D4";
|
|
175
|
+
};
|
|
176
|
+
readonly "avatar-owl": {
|
|
177
|
+
readonly dark: "#B07D52";
|
|
178
|
+
readonly light: "#875A36";
|
|
179
|
+
};
|
|
180
|
+
readonly "avatar-owl-belly": {
|
|
181
|
+
readonly dark: "#D9B68C";
|
|
182
|
+
readonly light: "#D9B68C";
|
|
183
|
+
};
|
|
184
|
+
readonly "avatar-owl-eye": {
|
|
185
|
+
readonly dark: "#F5C542";
|
|
186
|
+
readonly light: "#F5C542";
|
|
187
|
+
};
|
|
188
|
+
readonly "avatar-beak": {
|
|
189
|
+
readonly dark: "#EE8A2A";
|
|
190
|
+
readonly light: "#EE8A2A";
|
|
191
|
+
};
|
|
192
|
+
readonly "avatar-penguin-ground": {
|
|
193
|
+
readonly dark: "#5F8AAD";
|
|
194
|
+
readonly light: "#6692B6";
|
|
195
|
+
};
|
|
196
|
+
readonly "avatar-rabbit-ground": {
|
|
197
|
+
readonly dark: "#3A2229";
|
|
198
|
+
readonly light: "#F8DDE3";
|
|
199
|
+
};
|
|
200
|
+
readonly "avatar-rabbit": {
|
|
201
|
+
readonly dark: "#B89A84";
|
|
202
|
+
readonly light: "#8F725C";
|
|
203
|
+
};
|
|
204
|
+
readonly "avatar-rabbit-pink": {
|
|
205
|
+
readonly dark: "#F2A7B5";
|
|
206
|
+
readonly light: "#F2A7B5";
|
|
207
|
+
};
|
|
208
|
+
readonly "avatar-turtle-ground": {
|
|
209
|
+
readonly dark: "#2E2A18";
|
|
210
|
+
readonly light: "#F2E8C9";
|
|
211
|
+
};
|
|
212
|
+
readonly "avatar-turtle": {
|
|
213
|
+
readonly dark: "#5FA548";
|
|
214
|
+
readonly light: "#4E8F3A";
|
|
215
|
+
};
|
|
216
|
+
readonly "avatar-turtle-shell": {
|
|
217
|
+
readonly dark: "#3B7330";
|
|
218
|
+
readonly light: "#2F5E24";
|
|
219
|
+
};
|
|
220
|
+
readonly "avatar-turtle-skin": {
|
|
221
|
+
readonly dark: "#A8C66C";
|
|
222
|
+
readonly light: "#9FBF62";
|
|
223
|
+
};
|
|
224
|
+
readonly "avatar-whale-ground": {
|
|
225
|
+
readonly dark: "#16283A";
|
|
226
|
+
readonly light: "#DCEFF5";
|
|
227
|
+
};
|
|
228
|
+
readonly "avatar-whale": {
|
|
229
|
+
readonly dark: "#5A92D6";
|
|
230
|
+
readonly light: "#3A72B5";
|
|
231
|
+
};
|
|
232
|
+
readonly "avatar-whale-belly": {
|
|
233
|
+
readonly dark: "#DCEAF5";
|
|
234
|
+
readonly light: "#FFFFFF";
|
|
235
|
+
};
|
|
236
|
+
readonly "avatar-whale-spout": {
|
|
237
|
+
readonly dark: "#8EC3E8";
|
|
238
|
+
readonly light: "#8EC3E8";
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
readonly shadow: {
|
|
242
|
+
readonly "shadow-1": {
|
|
243
|
+
readonly dark: "0 8px 24px rgba(0,0,0,.40)";
|
|
244
|
+
readonly light: "0 2px 8px rgba(10,10,10,.08)";
|
|
245
|
+
};
|
|
246
|
+
readonly "shadow-2": {
|
|
247
|
+
readonly dark: "0 16px 48px rgba(0,0,0,.50)";
|
|
248
|
+
readonly light: "0 8px 24px rgba(10,10,10,.12)";
|
|
249
|
+
};
|
|
250
|
+
readonly "shadow-sheet": {
|
|
251
|
+
readonly dark: "-16px 0 40px rgba(0,0,0,.40)";
|
|
252
|
+
readonly light: "-4px 0 16px rgba(10,10,10,.08)";
|
|
253
|
+
};
|
|
254
|
+
readonly "shadow-float": {
|
|
255
|
+
readonly dark: "0 8px 24px rgba(0,0,0,.45)";
|
|
256
|
+
readonly light: "0 8px 24px rgba(26,26,24,.08)";
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
readonly radius: {
|
|
260
|
+
readonly sm: 4;
|
|
261
|
+
readonly md: 8;
|
|
262
|
+
readonly bubble: 10;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
/** The built-in font stacks a theme's fonts go in front of: `mono` is `--cb-font`, `prose` `--cb-font-prose`. */
|
|
266
|
+
export declare const THEME_FONTS: {
|
|
267
|
+
readonly mono: "\"Sarasa Mono SC\", ui-monospace, monospace";
|
|
268
|
+
readonly prose: "\"Inter\", \"Source Han Sans SC\", system-ui, sans-serif";
|
|
269
|
+
};
|
|
270
|
+
/** The tokens a theme may override: no avatar colors, no color-mix values (they derive). */
|
|
271
|
+
export declare const THEME_OVERRIDABLE: {
|
|
272
|
+
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", "diff-add", "diff-del"];
|
|
273
|
+
readonly shadow: readonly ["shadow-1", "shadow-2", "shadow-sheet", "shadow-float"];
|
|
274
|
+
readonly radius: readonly ["sm", "md", "bubble"];
|
|
275
|
+
};
|
|
276
|
+
/** [foreground, background, floor] or, with a fourth element, the surface it sits on. */
|
|
277
|
+
export declare const THEME_CONTRAST: readonly (readonly [fg: string, bg: string, floor: number, over?: string])[];
|
|
278
|
+
/** [ground, surface, minimum OKLab lightness difference x100]. */
|
|
279
|
+
export declare const THEME_SEPARATION: readonly (readonly [ground: string, surface: string, floor: number])[];
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Generated by pnpm gen:tokens from docs/design/tokens.json; do not edit.
|
|
2
|
+
// biome-ignore-all format: token values stay verbatim (uppercase hex, rgba spelling)
|
|
3
|
+
/** The built-in token values a theme overrides (design spec §2). */
|
|
4
|
+
export const THEME_TOKENS = {
|
|
5
|
+
color: {
|
|
6
|
+
"bg": { dark: "#0A0A0A", light: "#FAF9F6" },
|
|
7
|
+
"panel": { dark: "#111110", light: "#FFFFFF" },
|
|
8
|
+
"panel-2": { dark: "#0E0E0D", light: "#FCFBF9" },
|
|
9
|
+
"sidebar": { dark: "#111110", light: "#F3F2EE" },
|
|
10
|
+
"sidebar-active": { dark: "#1A1A18", light: "rgba(26,26,24,0.09)" },
|
|
11
|
+
"raised": { dark: "#141413", light: "#FFFFFF" },
|
|
12
|
+
"selected": { dark: "#1F1F1D", light: "rgba(26,26,24,0.07)" },
|
|
13
|
+
"hover": { dark: "#171716", light: "rgba(26,26,24,0.04)" },
|
|
14
|
+
"line-soft": { dark: "#1C1C1A", light: "#E8E7E2" },
|
|
15
|
+
"line": { dark: "#2A2A28", light: "#D9D8D2" },
|
|
16
|
+
"line-strong": { dark: "#3A3A37", light: "#B5B5AE" },
|
|
17
|
+
"line-card": { dark: "rgba(255,255,255,0.08)", light: "rgba(26,26,24,0.07)" },
|
|
18
|
+
"scroll-thumb": { dark: "rgba(255,255,255,0.15)", light: "rgba(26,26,24,0.20)" },
|
|
19
|
+
"ink": { dark: "#E6E6E3", light: "#1A1A18" },
|
|
20
|
+
"muted": { dark: "#8E8E89", light: "#5E5E5A" },
|
|
21
|
+
"faint": { dark: "#5A5A56", light: "#9A9A94" },
|
|
22
|
+
"disabled": { dark: "#6E6E69", light: "#82827C" },
|
|
23
|
+
"accent": { dark: "#FF6A13", light: "#CC4609" },
|
|
24
|
+
"accent-hover": { dark: "#FF8240", light: "#B83F08" },
|
|
25
|
+
"accent-press": { dark: "#E85A08", light: "#A33707" },
|
|
26
|
+
"on-accent": { dark: "#0A0A0A", light: "#FFFFFF" },
|
|
27
|
+
"accent-tint": { dark: "color-mix(in srgb, var(--cb-accent) 12%, transparent)", light: "color-mix(in srgb, var(--cb-accent) 12%, transparent)" },
|
|
28
|
+
"focus-ring": { dark: "rgba(255,106,19,.25)", light: "rgba(204,70,9,.18)" },
|
|
29
|
+
"ok": { dark: "#3FD483", light: "#16803F" },
|
|
30
|
+
"fail": { dark: "#FF5C52", light: "#C8302A" },
|
|
31
|
+
"warn": { dark: "#F2C14B", light: "#8F6500" },
|
|
32
|
+
"scrim": { dark: "rgba(0,0,0,.60)", light: "rgba(10,10,10,.25)" },
|
|
33
|
+
"lightbox": { dark: "rgba(0,0,0,.88)", light: "rgba(10,10,10,.80)" },
|
|
34
|
+
"diff-add": { dark: "rgba(63,212,131,.08)", light: "rgba(22,128,63,.10)" },
|
|
35
|
+
"diff-del": { dark: "rgba(255,92,82,.08)", light: "rgba(207,34,46,.08)" },
|
|
36
|
+
"avatar-black": { dark: "#1C1C1A", light: "#1C1C1A" },
|
|
37
|
+
"avatar-white": { dark: "#F2F2EE", light: "#FFFFFF" },
|
|
38
|
+
"avatar-capybara-ground": { dark: "#3D2213", light: "#FBE3D2" },
|
|
39
|
+
"avatar-black-bear-ground": { dark: "#9C8468", light: "#E6D6C1" },
|
|
40
|
+
"avatar-black-bear-snout": { dark: "#C9A074", light: "#C49A6C" },
|
|
41
|
+
"avatar-panda-ground": { dark: "#5E9168", light: "#669D71" },
|
|
42
|
+
"avatar-elephant-ground": { dark: "#2A2838", light: "#E6E3F2" },
|
|
43
|
+
"avatar-elephant": { dark: "#9AA0A8", light: "#757B84" },
|
|
44
|
+
"avatar-elephant-ear": { dark: "#7D838C", light: "#5A6068" },
|
|
45
|
+
"avatar-fox-ground": { dark: "#3A2414", light: "#FCEBD9" },
|
|
46
|
+
"avatar-fox": { dark: "#F07A2E", light: "#D8601A" },
|
|
47
|
+
"avatar-fox-ear": { dark: "#8A3E16", light: "#7A3310" },
|
|
48
|
+
"avatar-owl-ground": { dark: "#2E2618", light: "#EFE6D4" },
|
|
49
|
+
"avatar-owl": { dark: "#B07D52", light: "#875A36" },
|
|
50
|
+
"avatar-owl-belly": { dark: "#D9B68C", light: "#D9B68C" },
|
|
51
|
+
"avatar-owl-eye": { dark: "#F5C542", light: "#F5C542" },
|
|
52
|
+
"avatar-beak": { dark: "#EE8A2A", light: "#EE8A2A" },
|
|
53
|
+
"avatar-penguin-ground": { dark: "#5F8AAD", light: "#6692B6" },
|
|
54
|
+
"avatar-rabbit-ground": { dark: "#3A2229", light: "#F8DDE3" },
|
|
55
|
+
"avatar-rabbit": { dark: "#B89A84", light: "#8F725C" },
|
|
56
|
+
"avatar-rabbit-pink": { dark: "#F2A7B5", light: "#F2A7B5" },
|
|
57
|
+
"avatar-turtle-ground": { dark: "#2E2A18", light: "#F2E8C9" },
|
|
58
|
+
"avatar-turtle": { dark: "#5FA548", light: "#4E8F3A" },
|
|
59
|
+
"avatar-turtle-shell": { dark: "#3B7330", light: "#2F5E24" },
|
|
60
|
+
"avatar-turtle-skin": { dark: "#A8C66C", light: "#9FBF62" },
|
|
61
|
+
"avatar-whale-ground": { dark: "#16283A", light: "#DCEFF5" },
|
|
62
|
+
"avatar-whale": { dark: "#5A92D6", light: "#3A72B5" },
|
|
63
|
+
"avatar-whale-belly": { dark: "#DCEAF5", light: "#FFFFFF" },
|
|
64
|
+
"avatar-whale-spout": { dark: "#8EC3E8", light: "#8EC3E8" },
|
|
65
|
+
},
|
|
66
|
+
shadow: {
|
|
67
|
+
"shadow-1": { dark: "0 8px 24px rgba(0,0,0,.40)", light: "0 2px 8px rgba(10,10,10,.08)" },
|
|
68
|
+
"shadow-2": { dark: "0 16px 48px rgba(0,0,0,.50)", light: "0 8px 24px rgba(10,10,10,.12)" },
|
|
69
|
+
"shadow-sheet": { dark: "-16px 0 40px rgba(0,0,0,.40)", light: "-4px 0 16px rgba(10,10,10,.08)" },
|
|
70
|
+
"shadow-float": { dark: "0 8px 24px rgba(0,0,0,.45)", light: "0 8px 24px rgba(26,26,24,.08)" },
|
|
71
|
+
},
|
|
72
|
+
radius: { sm: 4, md: 8, bubble: 10 },
|
|
73
|
+
};
|
|
74
|
+
/** The built-in font stacks a theme's fonts go in front of: `mono` is `--cb-font`, `prose` `--cb-font-prose`. */
|
|
75
|
+
export const THEME_FONTS = {
|
|
76
|
+
mono: "\"Sarasa Mono SC\", ui-monospace, monospace",
|
|
77
|
+
prose: "\"Inter\", \"Source Han Sans SC\", system-ui, sans-serif",
|
|
78
|
+
};
|
|
79
|
+
/** The tokens a theme may override: no avatar colors, no color-mix values (they derive). */
|
|
80
|
+
export const THEME_OVERRIDABLE = {
|
|
81
|
+
color: [
|
|
82
|
+
"bg",
|
|
83
|
+
"panel",
|
|
84
|
+
"panel-2",
|
|
85
|
+
"sidebar",
|
|
86
|
+
"sidebar-active",
|
|
87
|
+
"raised",
|
|
88
|
+
"selected",
|
|
89
|
+
"hover",
|
|
90
|
+
"line-soft",
|
|
91
|
+
"line",
|
|
92
|
+
"line-strong",
|
|
93
|
+
"line-card",
|
|
94
|
+
"scroll-thumb",
|
|
95
|
+
"ink",
|
|
96
|
+
"muted",
|
|
97
|
+
"faint",
|
|
98
|
+
"disabled",
|
|
99
|
+
"accent",
|
|
100
|
+
"accent-hover",
|
|
101
|
+
"accent-press",
|
|
102
|
+
"on-accent",
|
|
103
|
+
"focus-ring",
|
|
104
|
+
"ok",
|
|
105
|
+
"fail",
|
|
106
|
+
"warn",
|
|
107
|
+
"scrim",
|
|
108
|
+
"lightbox",
|
|
109
|
+
"diff-add",
|
|
110
|
+
"diff-del",
|
|
111
|
+
],
|
|
112
|
+
shadow: [
|
|
113
|
+
"shadow-1",
|
|
114
|
+
"shadow-2",
|
|
115
|
+
"shadow-sheet",
|
|
116
|
+
"shadow-float",
|
|
117
|
+
],
|
|
118
|
+
radius: ["sm", "md", "bubble"],
|
|
119
|
+
};
|
|
120
|
+
/** [foreground, background, floor] or, with a fourth element, the surface it sits on. */
|
|
121
|
+
export const THEME_CONTRAST = [
|
|
122
|
+
["ink", "bg", 4.5],
|
|
123
|
+
["muted", "bg", 4.5],
|
|
124
|
+
["muted", "panel", 4.5],
|
|
125
|
+
["muted", "sidebar", 4.5],
|
|
126
|
+
["muted", "panel-2", 4.5],
|
|
127
|
+
["muted", "raised", 4.5],
|
|
128
|
+
["muted", "selected", 4.5],
|
|
129
|
+
["muted", "hover", 4.5],
|
|
130
|
+
["ink", "hover", 4.5, "panel"],
|
|
131
|
+
["ink", "selected", 4.5, "panel"],
|
|
132
|
+
["muted", "hover", 4.5, "panel"],
|
|
133
|
+
["fail", "selected", 4.5, "panel"],
|
|
134
|
+
["accent", "selected", 3, "panel"],
|
|
135
|
+
["disabled", "bg", 3],
|
|
136
|
+
["disabled", "panel", 3],
|
|
137
|
+
["disabled", "hover", 3],
|
|
138
|
+
["disabled", "selected", 3],
|
|
139
|
+
["ink", "sidebar-active", 4.5],
|
|
140
|
+
["muted", "selected", 4.5, "sidebar"],
|
|
141
|
+
["muted", "hover", 4.5, "sidebar"],
|
|
142
|
+
["ink", "sidebar-active", 4.5, "sidebar"],
|
|
143
|
+
["on-accent", "accent", 4.5],
|
|
144
|
+
["fail", "bg", 4.5],
|
|
145
|
+
["warn", "bg", 4.5],
|
|
146
|
+
["fail", "panel", 4.5],
|
|
147
|
+
["warn", "panel", 4.5],
|
|
148
|
+
["accent", "bg", 3],
|
|
149
|
+
["line", "bg", 1],
|
|
150
|
+
["ink", "diff-add", 4.5],
|
|
151
|
+
["ink", "diff-del", 4.5],
|
|
152
|
+
["accent", "avatar-capybara-ground", 3],
|
|
153
|
+
["avatar-black", "avatar-black-bear-ground", 3],
|
|
154
|
+
["avatar-black", "avatar-panda-ground", 3],
|
|
155
|
+
["avatar-elephant", "avatar-elephant-ground", 3],
|
|
156
|
+
["avatar-fox", "avatar-fox-ground", 3],
|
|
157
|
+
["avatar-owl", "avatar-owl-ground", 3],
|
|
158
|
+
["avatar-black", "avatar-penguin-ground", 3],
|
|
159
|
+
["avatar-rabbit", "avatar-rabbit-ground", 3],
|
|
160
|
+
["avatar-turtle", "avatar-turtle-ground", 3],
|
|
161
|
+
["avatar-whale", "avatar-whale-ground", 3],
|
|
162
|
+
["avatar-white", "avatar-panda-ground", 3],
|
|
163
|
+
["avatar-white", "avatar-penguin-ground", 3],
|
|
164
|
+
];
|
|
165
|
+
/** [ground, surface, minimum OKLab lightness difference x100]. */
|
|
166
|
+
export const THEME_SEPARATION = [
|
|
167
|
+
["hover", "bg", 2.5],
|
|
168
|
+
["hover", "panel", 2.5],
|
|
169
|
+
["hover", "sidebar", 2.5],
|
|
170
|
+
["selected", "bg", 2.5],
|
|
171
|
+
["selected", "panel", 2.5],
|
|
172
|
+
["selected", "sidebar", 2.5],
|
|
173
|
+
["sidebar-active", "sidebar", 2.5],
|
|
174
|
+
];
|