@pixerate/editor 0.146.0 → 0.148.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +3 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/agent/index.cjs +36 -34
  4. package/dist/agent/index.js +7 -5
  5. package/dist/animation/index.cjs +5 -3
  6. package/dist/animation/index.js +4 -2
  7. package/dist/animation-editor/index.cjs +62 -60
  8. package/dist/animation-editor/index.js +6 -4
  9. package/dist/canvas/index.cjs +36 -34
  10. package/dist/canvas/index.js +19 -17
  11. package/dist/chart/index.cjs +88 -86
  12. package/dist/chart/index.js +7 -5
  13. package/dist/{chunk-WBJ6BG4R.js → chunk-2AQL4JHM.js} +6 -6
  14. package/dist/{chunk-HLMF3E53.cjs → chunk-2WDZI6QD.cjs} +15 -15
  15. package/dist/{chunk-ZNHB5RG6.js → chunk-37RLSNQ3.js} +2 -2
  16. package/dist/{chunk-5WOY52O6.cjs → chunk-4YQKRHMI.cjs} +8 -8
  17. package/dist/chunk-6ONMQ6WF.js +113 -0
  18. package/dist/{chunk-L434J57V.cjs → chunk-6QTON3VW.cjs} +16 -16
  19. package/dist/chunk-AA34BA7G.js +1913 -0
  20. package/dist/{chunk-QX25HWFL.js → chunk-AY65VQSU.js} +1 -1
  21. package/dist/{chunk-ONZJD2OD.cjs → chunk-BROJYMWU.cjs} +57 -153
  22. package/dist/{chunk-YM75DN54.js → chunk-DSZCDNTM.js} +1 -1
  23. package/dist/{chunk-PUR6BZFA.cjs → chunk-DVLMW3GB.cjs} +53 -53
  24. package/dist/{chunk-ALUWD3FG.js → chunk-EIUTJPEL.js} +1 -1
  25. package/dist/{chunk-X65C4DWV.js → chunk-EQ4SF4X4.js} +1 -1
  26. package/dist/{chunk-77SG47WT.js → chunk-FLOGD3QB.js} +1 -1
  27. package/dist/{chunk-AJSW5GMP.js → chunk-HVQVHUTV.js} +19 -115
  28. package/dist/{chunk-UR37VCIR.cjs → chunk-I4AHLP7F.cjs} +16 -35
  29. package/dist/chunk-IPJ3TEYR.cjs +113 -0
  30. package/dist/chunk-KY3FYKP3.js +52 -0
  31. package/dist/chunk-LEUZ4FRC.cjs +52 -0
  32. package/dist/{chunk-H6FX45CP.cjs → chunk-LIXLD433.cjs} +37 -37
  33. package/dist/{chunk-6GAYGQDC.js → chunk-O5ML2I6O.js} +3 -3
  34. package/dist/{chunk-KI2VBONS.js → chunk-OET45HIR.js} +2 -2
  35. package/dist/{chunk-XNZWATSB.cjs → chunk-QCEQIRJQ.cjs} +85 -85
  36. package/dist/{chunk-HRI3ZMDM.cjs → chunk-RHXW4TA5.cjs} +3 -3
  37. package/dist/{chunk-UUTTJK77.cjs → chunk-SUF6WRXR.cjs} +2 -2
  38. package/dist/{chunk-RN767PO6.js → chunk-SUVZJ2CP.js} +15 -34
  39. package/dist/{chunk-FLUTRPLY.cjs → chunk-TLMRGLQQ.cjs} +16 -16
  40. package/dist/{chunk-DAS7M4RY.js → chunk-UILRJQFD.js} +2 -2
  41. package/dist/chunk-UKCJ43YL.cjs +1913 -0
  42. package/dist/{chunk-XQ33O5BC.cjs → chunk-X35BV5YT.cjs} +44 -44
  43. package/dist/{chunk-6HMEHNWW.cjs → chunk-XTU6QO2W.cjs} +26 -26
  44. package/dist/{chunk-VM6JYWXQ.js → chunk-ZQUANEK4.js} +2 -2
  45. package/dist/cms/index.cjs +5 -3
  46. package/dist/cms/index.js +18 -16
  47. package/dist/color/contrast.d.cts +14 -0
  48. package/dist/color/contrast.d.ts +14 -0
  49. package/dist/color/convert.d.cts +30 -0
  50. package/dist/color/convert.d.ts +30 -0
  51. package/dist/color/dual.d.cts +98 -0
  52. package/dist/color/dual.d.ts +98 -0
  53. package/dist/color/format.d.cts +12 -0
  54. package/dist/color/format.d.ts +12 -0
  55. package/dist/color/gamut.d.cts +12 -0
  56. package/dist/color/gamut.d.ts +12 -0
  57. package/dist/color/harmony.d.cts +22 -0
  58. package/dist/color/harmony.d.ts +22 -0
  59. package/dist/color/index.cjs +115 -0
  60. package/dist/color/index.d.cts +18 -0
  61. package/dist/color/index.d.ts +18 -0
  62. package/dist/color/index.js +115 -0
  63. package/dist/color/mix.d.cts +11 -0
  64. package/dist/color/mix.d.ts +11 -0
  65. package/dist/color/named.d.cts +5 -0
  66. package/dist/color/named.d.ts +5 -0
  67. package/dist/color/parse.d.cts +11 -0
  68. package/dist/color/parse.d.ts +11 -0
  69. package/dist/color/picker.d.cts +52 -0
  70. package/dist/color/picker.d.ts +52 -0
  71. package/dist/color/recent.d.cts +8 -0
  72. package/dist/color/recent.d.ts +8 -0
  73. package/dist/color/tools.d.cts +15 -0
  74. package/dist/color/tools.d.ts +15 -0
  75. package/dist/color/types.d.cts +41 -0
  76. package/dist/color/types.d.ts +41 -0
  77. package/dist/color/vision.d.cts +36 -0
  78. package/dist/color/vision.d.ts +36 -0
  79. package/dist/effects/authoring-session.d.cts +25 -0
  80. package/dist/effects/authoring-session.d.ts +25 -0
  81. package/dist/effects/authoring-tools.d.cts +31 -0
  82. package/dist/effects/authoring-tools.d.ts +31 -0
  83. package/dist/effects/authoring.d.cts +152 -0
  84. package/dist/effects/authoring.d.ts +152 -0
  85. package/dist/effects/conformance.d.cts +2 -0
  86. package/dist/effects/conformance.d.ts +2 -0
  87. package/dist/effects/fake.d.cts +2 -0
  88. package/dist/effects/fake.d.ts +2 -0
  89. package/dist/effects/index.cjs +1216 -9
  90. package/dist/effects/index.d.cts +3 -0
  91. package/dist/effects/index.d.ts +3 -0
  92. package/dist/effects/index.js +1210 -3
  93. package/dist/effects/types.d.cts +9 -2
  94. package/dist/effects/types.d.ts +9 -2
  95. package/dist/effects/ui.d.cts +8 -0
  96. package/dist/effects/ui.d.ts +8 -0
  97. package/dist/export/index.cjs +6 -4
  98. package/dist/export/index.js +5 -3
  99. package/dist/extensions/index.cjs +10 -8
  100. package/dist/extensions/index.js +9 -7
  101. package/dist/gradient/controller.d.cts +109 -0
  102. package/dist/gradient/controller.d.ts +109 -0
  103. package/dist/gradient/editor.d.cts +38 -0
  104. package/dist/gradient/editor.d.ts +38 -0
  105. package/dist/gradient/index.cjs +1549 -0
  106. package/dist/gradient/index.d.cts +5 -0
  107. package/dist/gradient/index.d.ts +5 -0
  108. package/dist/gradient/index.js +1549 -0
  109. package/dist/gradient/model.d.cts +94 -0
  110. package/dist/gradient/model.d.ts +94 -0
  111. package/dist/gradient/tools.d.cts +11 -0
  112. package/dist/gradient/tools.d.ts +11 -0
  113. package/dist/gradient/types.d.cts +44 -0
  114. package/dist/gradient/types.d.ts +44 -0
  115. package/dist/image-editor/index.cjs +649 -647
  116. package/dist/image-editor/index.js +6 -4
  117. package/dist/index.cjs +19 -17
  118. package/dist/index.js +16 -14
  119. package/dist/paint-editor/color.d.cts +3 -13
  120. package/dist/paint-editor/color.d.ts +3 -13
  121. package/dist/paint-editor/index.cjs +23 -68
  122. package/dist/paint-editor/index.js +15 -60
  123. package/dist/vector/index.cjs +950 -948
  124. package/dist/vector/index.js +5 -3
  125. package/dist/video-editor/index.cjs +5 -3
  126. package/dist/video-editor/index.js +4 -2
  127. package/package.json +21 -1
  128. package/skills/README.md +2 -0
  129. package/skills/pixerate-color/SKILL.md +69 -0
  130. package/skills/pixerate-effect-authoring/SKILL.md +80 -0
  131. package/dist/chunk-45VRG4RB.js +0 -65
  132. package/dist/chunk-5FXOR7F2.cjs +0 -65
@@ -0,0 +1,115 @@
1
+ import {
2
+ DEFAULT_SCHEME_SURFACES,
3
+ HARMONY_KINDS,
4
+ NAMED_COLORS,
5
+ PICKER_HUE_BACKGROUND,
6
+ checkDualColorContrast,
7
+ checkPaletteColors,
8
+ colorHarmony,
9
+ contrastLevel,
10
+ contrastRatio,
11
+ createColorToolProvider,
12
+ deltaEOK,
13
+ deriveDualColor,
14
+ displayP3ToLinearSrgb,
15
+ dualColorsToCss,
16
+ dualPickerView,
17
+ formatColor,
18
+ formatDualColor,
19
+ formatHex,
20
+ hslToRgb,
21
+ hsvToRgb,
22
+ hueToWheel,
23
+ inSrgbGamut,
24
+ isColor,
25
+ isDualColor,
26
+ isSameInBothSchemes,
27
+ linearSrgbToDisplayP3,
28
+ linearToSrgb,
29
+ mixColors,
30
+ normalizeColor,
31
+ normalizeDualColor,
32
+ oklabToOklch,
33
+ oklabToRgb,
34
+ oklchToOklab,
35
+ parseColor,
36
+ parseDualColor,
37
+ pickerAlphaBackground,
38
+ pickerAreaBackground,
39
+ pickerKeyStep,
40
+ pickerStateFromAlpha,
41
+ pickerStateFromArea,
42
+ pickerStateFromColor,
43
+ pickerStateFromHue,
44
+ pickerStateToHex,
45
+ pushRecentColor,
46
+ readableTextColor,
47
+ relativeLuminance,
48
+ resolveColor,
49
+ rgbToHsl,
50
+ rgbToHsv,
51
+ rgbToOklab,
52
+ setDualColorSide,
53
+ simulateColorVision,
54
+ srgbToLinear,
55
+ toSrgbGamut,
56
+ wheelToHue
57
+ } from "../chunk-AA34BA7G.js";
58
+ import "../chunk-6ONMQ6WF.js";
59
+ export {
60
+ DEFAULT_SCHEME_SURFACES,
61
+ HARMONY_KINDS,
62
+ NAMED_COLORS,
63
+ PICKER_HUE_BACKGROUND,
64
+ checkDualColorContrast,
65
+ checkPaletteColors,
66
+ colorHarmony,
67
+ contrastLevel,
68
+ contrastRatio,
69
+ createColorToolProvider,
70
+ deltaEOK,
71
+ deriveDualColor,
72
+ displayP3ToLinearSrgb,
73
+ dualColorsToCss,
74
+ dualPickerView,
75
+ formatColor,
76
+ formatDualColor,
77
+ formatHex,
78
+ hslToRgb,
79
+ hsvToRgb,
80
+ hueToWheel,
81
+ inSrgbGamut,
82
+ isColor,
83
+ isDualColor,
84
+ isSameInBothSchemes,
85
+ linearSrgbToDisplayP3,
86
+ linearToSrgb,
87
+ mixColors,
88
+ normalizeColor,
89
+ normalizeDualColor,
90
+ oklabToOklch,
91
+ oklabToRgb,
92
+ oklchToOklab,
93
+ parseColor,
94
+ parseDualColor,
95
+ pickerAlphaBackground,
96
+ pickerAreaBackground,
97
+ pickerKeyStep,
98
+ pickerStateFromAlpha,
99
+ pickerStateFromArea,
100
+ pickerStateFromColor,
101
+ pickerStateFromHue,
102
+ pickerStateToHex,
103
+ pushRecentColor,
104
+ readableTextColor,
105
+ relativeLuminance,
106
+ resolveColor,
107
+ rgbToHsl,
108
+ rgbToHsv,
109
+ rgbToOklab,
110
+ setDualColorSide,
111
+ simulateColorVision,
112
+ srgbToLinear,
113
+ toSrgbGamut,
114
+ wheelToHue
115
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Colour mixing in OKLab (default), OKLCH, sRGB or linear sRGB with premultiplied alpha.
3
+ */
4
+ export interface MixColorsOptions {
5
+ space?: 'oklab' | 'oklch' | 'srgb' | 'srgb-linear';
6
+ }
7
+ /**
8
+ * Mixes two colours at position t (0 = from, 1 = to) with premultiplied alpha.
9
+ * Returns null if either colour cannot be parsed.
10
+ */
11
+ export declare function mixColors(from: unknown, to: unknown, t: number, options?: MixColorsOptions): string | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Colour mixing in OKLab (default), OKLCH, sRGB or linear sRGB with premultiplied alpha.
3
+ */
4
+ export interface MixColorsOptions {
5
+ space?: 'oklab' | 'oklch' | 'srgb' | 'srgb-linear';
6
+ }
7
+ /**
8
+ * Mixes two colours at position t (0 = from, 1 = to) with premultiplied alpha.
9
+ * Returns null if either colour cannot be parsed.
10
+ */
11
+ export declare function mixColors(from: unknown, to: unknown, t: number, options?: MixColorsOptions): string | null;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The 148 standard CSS named colours (CSS Color 4 / SVG 1.1) mapped to lowercase `#rrggbb`,
3
+ * plus `transparent` as `#00000000`.
4
+ */
5
+ export declare const NAMED_COLORS: Readonly<Record<string, string>>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The 148 standard CSS named colours (CSS Color 4 / SVG 1.1) mapped to lowercase `#rrggbb`,
3
+ * plus `transparent` as `#00000000`.
4
+ */
5
+ export declare const NAMED_COLORS: Readonly<Record<string, string>>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * CSS colour parsing for hex, rgb, hsl, oklab, oklch, Display P3 and CSS named colours.
3
+ */
4
+ import type { Rgba } from './types.cjs';
5
+ /**
6
+ * Parses any supported CSS colour string or token object into an unclamped Rgba structure.
7
+ * Returns null for unrecognised syntax or invalid values without throwing.
8
+ */
9
+ export declare function parseColor(input: unknown): Rgba | null;
10
+ /** Returns true when the input can be parsed as a valid colour. */
11
+ export declare function isColor(input: unknown): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * CSS colour parsing for hex, rgb, hsl, oklab, oklch, Display P3 and CSS named colours.
3
+ */
4
+ import type { Rgba } from './types.js';
5
+ /**
6
+ * Parses any supported CSS colour string or token object into an unclamped Rgba structure.
7
+ * Returns null for unrecognised syntax or invalid values without throwing.
8
+ */
9
+ export declare function parseColor(input: unknown): Rgba | null;
10
+ /** Returns true when the input can be parsed as a valid colour. */
11
+ export declare function isColor(input: unknown): boolean;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Pure, headless colour picker state and interaction model.
3
+ * DOM-free: shared across React and Svelte bindings.
4
+ */
5
+ import { type ColorValue, type ColorScheme } from './dual.cjs';
6
+ export interface ColorPickerState {
7
+ /** Hue angle: 0 <= h < 360 */
8
+ h: number;
9
+ /** Saturation: 0 <= s <= 1 */
10
+ s: number;
11
+ /** Value / brightness: 0 <= v <= 1 */
12
+ v: number;
13
+ /** Alpha: 0 <= alpha <= 1 */
14
+ alpha: number;
15
+ }
16
+ /**
17
+ * Derives picker state from any CSS colour string or existing state.
18
+ * Preserves hue and saturation from `previous` when the new colour is achromatic
19
+ * (grey or black), preventing sudden hue jumps when dragging near 0.
20
+ */
21
+ export declare function pickerStateFromColor(input: unknown, previous?: ColorPickerState): ColorPickerState | null;
22
+ /** Formats current picker state as a hex string (#rrggbb or #rrggbbaa). */
23
+ export declare function pickerStateToHex(state: ColorPickerState, forceAlpha?: boolean): string;
24
+ /** Updates saturation (x) and value (y) from normalized coordinates (0..1). */
25
+ export declare function pickerStateFromArea(state: ColorPickerState, x: number, y: number): ColorPickerState;
26
+ /** Updates hue from a normalized position t (0..1 -> 0..360°). */
27
+ export declare function pickerStateFromHue(state: ColorPickerState, t: number): ColorPickerState;
28
+ /** Updates alpha from a normalized position t (0..1). */
29
+ export declare function pickerStateFromAlpha(state: ColorPickerState, t: number): ColorPickerState;
30
+ /**
31
+ * Handles keyboard interaction for the 2D area, hue slider, and alpha slider.
32
+ * Arrow keys step by 1% (or 1° for hue), with Shift multiplying by 10.
33
+ * Home/End jump to min/max.
34
+ * Returns null if the key is not handled.
35
+ */
36
+ export declare function pickerKeyStep(state: ColorPickerState, target: 'area' | 'hue' | 'alpha', key: string, shift: boolean): ColorPickerState | null;
37
+ /** CSS background for the 2D area (white-to-transparent horizontal and transparent-to-black vertical over pure hue). */
38
+ export declare function pickerAreaBackground(state: ColorPickerState): string;
39
+ /** CSS background for the alpha strip gradient (transparent to opaque colour). */
40
+ export declare function pickerAlphaBackground(state: ColorPickerState): string;
41
+ /** CSS background gradient through all hues across the 360° spectrum. */
42
+ export declare const PICKER_HUE_BACKGROUND: string;
43
+ /**
44
+ * Computes the view information for editing a dual colour in a picker for the given scheme.
45
+ * Returns the colour for the active scheme, whether both halves are identical ('linked'),
46
+ * and the other scheme's colour.
47
+ */
48
+ export declare function dualPickerView(value: ColorValue, scheme: ColorScheme): {
49
+ color: string;
50
+ linked: boolean;
51
+ other: string;
52
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Pure, headless colour picker state and interaction model.
3
+ * DOM-free: shared across React and Svelte bindings.
4
+ */
5
+ import { type ColorValue, type ColorScheme } from './dual.js';
6
+ export interface ColorPickerState {
7
+ /** Hue angle: 0 <= h < 360 */
8
+ h: number;
9
+ /** Saturation: 0 <= s <= 1 */
10
+ s: number;
11
+ /** Value / brightness: 0 <= v <= 1 */
12
+ v: number;
13
+ /** Alpha: 0 <= alpha <= 1 */
14
+ alpha: number;
15
+ }
16
+ /**
17
+ * Derives picker state from any CSS colour string or existing state.
18
+ * Preserves hue and saturation from `previous` when the new colour is achromatic
19
+ * (grey or black), preventing sudden hue jumps when dragging near 0.
20
+ */
21
+ export declare function pickerStateFromColor(input: unknown, previous?: ColorPickerState): ColorPickerState | null;
22
+ /** Formats current picker state as a hex string (#rrggbb or #rrggbbaa). */
23
+ export declare function pickerStateToHex(state: ColorPickerState, forceAlpha?: boolean): string;
24
+ /** Updates saturation (x) and value (y) from normalized coordinates (0..1). */
25
+ export declare function pickerStateFromArea(state: ColorPickerState, x: number, y: number): ColorPickerState;
26
+ /** Updates hue from a normalized position t (0..1 -> 0..360°). */
27
+ export declare function pickerStateFromHue(state: ColorPickerState, t: number): ColorPickerState;
28
+ /** Updates alpha from a normalized position t (0..1). */
29
+ export declare function pickerStateFromAlpha(state: ColorPickerState, t: number): ColorPickerState;
30
+ /**
31
+ * Handles keyboard interaction for the 2D area, hue slider, and alpha slider.
32
+ * Arrow keys step by 1% (or 1° for hue), with Shift multiplying by 10.
33
+ * Home/End jump to min/max.
34
+ * Returns null if the key is not handled.
35
+ */
36
+ export declare function pickerKeyStep(state: ColorPickerState, target: 'area' | 'hue' | 'alpha', key: string, shift: boolean): ColorPickerState | null;
37
+ /** CSS background for the 2D area (white-to-transparent horizontal and transparent-to-black vertical over pure hue). */
38
+ export declare function pickerAreaBackground(state: ColorPickerState): string;
39
+ /** CSS background for the alpha strip gradient (transparent to opaque colour). */
40
+ export declare function pickerAlphaBackground(state: ColorPickerState): string;
41
+ /** CSS background gradient through all hues across the 360° spectrum. */
42
+ export declare const PICKER_HUE_BACKGROUND: string;
43
+ /**
44
+ * Computes the view information for editing a dual colour in a picker for the given scheme.
45
+ * Returns the colour for the active scheme, whether both halves are identical ('linked'),
46
+ * and the other scheme's colour.
47
+ */
48
+ export declare function dualPickerView(value: ColorValue, scheme: ColorScheme): {
49
+ color: string;
50
+ linked: boolean;
51
+ other: string;
52
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Recent colours history list manager.
3
+ */
4
+ /**
5
+ * Normalises a colour and pushes it to the front of a recents list, removing duplicates
6
+ * and trimming to `max` items. Returns the original list unchanged if the colour cannot be read.
7
+ */
8
+ export declare function pushRecentColor(list: readonly string[], color: string, max?: number): string[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Recent colours history list manager.
3
+ */
4
+ /**
5
+ * Normalises a colour and pushes it to the front of a recents list, removing duplicates
6
+ * and trimming to `max` items. Returns the original list unchanged if the colour cannot be read.
7
+ */
8
+ export declare function pushRecentColor(list: readonly string[], color: string, max?: number): string[];
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Agent tools for colour inspection, contrast verification, palette checking, harmonies, and mixing.
3
+ */
4
+ import type { AgentToolProvider } from '../tools/registry.cjs';
5
+ export interface ColorToolProviderOptions {
6
+ /** Provider id (unique per registry). Default 'color'. */
7
+ id?: string;
8
+ /** Tool-name prefix; defaults to provider id, '' for bare names. */
9
+ namespace?: string;
10
+ }
11
+ /**
12
+ * Creates an AgentToolProvider with colour inspection, contrast checks, palette checks,
13
+ * harmony suggestions, and colour mixing.
14
+ */
15
+ export declare function createColorToolProvider(options?: ColorToolProviderOptions): AgentToolProvider;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Agent tools for colour inspection, contrast verification, palette checking, harmonies, and mixing.
3
+ */
4
+ import type { AgentToolProvider } from '../tools/registry.js';
5
+ export interface ColorToolProviderOptions {
6
+ /** Provider id (unique per registry). Default 'color'. */
7
+ id?: string;
8
+ /** Tool-name prefix; defaults to provider id, '' for bare names. */
9
+ namespace?: string;
10
+ }
11
+ /**
12
+ * Creates an AgentToolProvider with colour inspection, contrast checks, palette checks,
13
+ * harmony suggestions, and colour mixing.
14
+ */
15
+ export declare function createColorToolProvider(options?: ColorToolProviderOptions): AgentToolProvider;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Core colour types: channel values, spaces, formats and vision deficiency modes.
3
+ */
4
+ /** sRGB, gamma-encoded. Channels are nominally 0–1 but may fall outside for wide-gamut input; alpha 0–1. */
5
+ export interface Rgba {
6
+ r: number;
7
+ g: number;
8
+ b: number;
9
+ a: number;
10
+ }
11
+ /** OKLab: l 0–1; a and b roughly −0.4–0.4; alpha 0–1. Same shape as `OklabColor` in `animation/color.ts`. */
12
+ export interface Oklab {
13
+ l: number;
14
+ a: number;
15
+ b: number;
16
+ alpha: number;
17
+ }
18
+ /** OKLCH: l 0–1, c ≥ 0 (≈0.4 max in practice), h in degrees 0–360 (NaN-free: use 0 when c is 0); alpha 0–1. */
19
+ export interface Oklch {
20
+ l: number;
21
+ c: number;
22
+ h: number;
23
+ alpha: number;
24
+ }
25
+ /** h in degrees 0–360; s, l 0–1; alpha 0–1. */
26
+ export interface Hsla {
27
+ h: number;
28
+ s: number;
29
+ l: number;
30
+ alpha: number;
31
+ }
32
+ /** h in degrees 0–360; s, v 0–1; alpha 0–1. */
33
+ export interface Hsva {
34
+ h: number;
35
+ s: number;
36
+ v: number;
37
+ alpha: number;
38
+ }
39
+ export type ColorFormat = 'hex' | 'rgb' | 'hsl' | 'oklch' | 'oklab' | 'p3';
40
+ export type ColorVision = 'normal' | 'protanopia' | 'deuteranopia' | 'tritanopia';
41
+ export type ContrastLevel = 'AAA' | 'AA' | 'fail';
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Core colour types: channel values, spaces, formats and vision deficiency modes.
3
+ */
4
+ /** sRGB, gamma-encoded. Channels are nominally 0–1 but may fall outside for wide-gamut input; alpha 0–1. */
5
+ export interface Rgba {
6
+ r: number;
7
+ g: number;
8
+ b: number;
9
+ a: number;
10
+ }
11
+ /** OKLab: l 0–1; a and b roughly −0.4–0.4; alpha 0–1. Same shape as `OklabColor` in `animation/color.ts`. */
12
+ export interface Oklab {
13
+ l: number;
14
+ a: number;
15
+ b: number;
16
+ alpha: number;
17
+ }
18
+ /** OKLCH: l 0–1, c ≥ 0 (≈0.4 max in practice), h in degrees 0–360 (NaN-free: use 0 when c is 0); alpha 0–1. */
19
+ export interface Oklch {
20
+ l: number;
21
+ c: number;
22
+ h: number;
23
+ alpha: number;
24
+ }
25
+ /** h in degrees 0–360; s, l 0–1; alpha 0–1. */
26
+ export interface Hsla {
27
+ h: number;
28
+ s: number;
29
+ l: number;
30
+ alpha: number;
31
+ }
32
+ /** h in degrees 0–360; s, v 0–1; alpha 0–1. */
33
+ export interface Hsva {
34
+ h: number;
35
+ s: number;
36
+ v: number;
37
+ alpha: number;
38
+ }
39
+ export type ColorFormat = 'hex' | 'rgb' | 'hsl' | 'oklch' | 'oklab' | 'p3';
40
+ export type ColorVision = 'normal' | 'protanopia' | 'deuteranopia' | 'tritanopia';
41
+ export type ContrastLevel = 'AAA' | 'AA' | 'fail';
@@ -0,0 +1,36 @@
1
+ import type { Rgba, ColorVision } from './types.cjs';
2
+ /** Simulates how a colour appears under protanopia, deuteranopia or tritanopia. */
3
+ export declare function simulateColorVision(c: Rgba, vision: ColorVision): Rgba;
4
+ export interface PaletteColorPair {
5
+ a: number;
6
+ b: number;
7
+ colors: [string, string];
8
+ distance: number;
9
+ }
10
+ export interface PaletteColorCheck {
11
+ /** No problems found. */
12
+ ok: boolean;
13
+ /** Per vision: the closest pair of colours and their OKLab distance. */
14
+ closest: Partial<Record<ColorVision, PaletteColorPair>>;
15
+ /** Contrast ratio of each colour against the surface (null when unreadable). */
16
+ contrast: (number | null)[];
17
+ /** Problems, as sentences. */
18
+ issues: string[];
19
+ /** Colours that could not be read; they are skipped. */
20
+ skipped: string[];
21
+ }
22
+ export interface PaletteColorCheckOptions {
23
+ /** The background surface behind the marks (default '#ffffff'). */
24
+ surface?: string;
25
+ /** Smallest OKLab distance two colours may have (default 0.08). */
26
+ minDistance?: number;
27
+ /** Smallest contrast ratio against the surface (default 1.5). */
28
+ minContrast?: number;
29
+ /** Visions to check (default all four). */
30
+ visions?: readonly ColorVision[];
31
+ }
32
+ /**
33
+ * Checks that palette colours can be distinguished under normal vision and CVD modes,
34
+ * and stand out from the surface background.
35
+ */
36
+ export declare function checkPaletteColors(colors: readonly string[], options?: PaletteColorCheckOptions): PaletteColorCheck;
@@ -0,0 +1,36 @@
1
+ import type { Rgba, ColorVision } from './types.js';
2
+ /** Simulates how a colour appears under protanopia, deuteranopia or tritanopia. */
3
+ export declare function simulateColorVision(c: Rgba, vision: ColorVision): Rgba;
4
+ export interface PaletteColorPair {
5
+ a: number;
6
+ b: number;
7
+ colors: [string, string];
8
+ distance: number;
9
+ }
10
+ export interface PaletteColorCheck {
11
+ /** No problems found. */
12
+ ok: boolean;
13
+ /** Per vision: the closest pair of colours and their OKLab distance. */
14
+ closest: Partial<Record<ColorVision, PaletteColorPair>>;
15
+ /** Contrast ratio of each colour against the surface (null when unreadable). */
16
+ contrast: (number | null)[];
17
+ /** Problems, as sentences. */
18
+ issues: string[];
19
+ /** Colours that could not be read; they are skipped. */
20
+ skipped: string[];
21
+ }
22
+ export interface PaletteColorCheckOptions {
23
+ /** The background surface behind the marks (default '#ffffff'). */
24
+ surface?: string;
25
+ /** Smallest OKLab distance two colours may have (default 0.08). */
26
+ minDistance?: number;
27
+ /** Smallest contrast ratio against the surface (default 1.5). */
28
+ minContrast?: number;
29
+ /** Visions to check (default all four). */
30
+ visions?: readonly ColorVision[];
31
+ }
32
+ /**
33
+ * Checks that palette colours can be distinguished under normal vision and CVD modes,
34
+ * and stand out from the surface background.
35
+ */
36
+ export declare function checkPaletteColors(colors: readonly string[], options?: PaletteColorCheckOptions): PaletteColorCheck;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Generic effect authoring session: controls values, keyframes, presets, timing, undo/redo
3
+ * and preview rendering for any effect provider.
4
+ */
5
+ import { HistoryManager } from '../history/HistoryManager.cjs';
6
+ import type { EffectAuthoringSession, EffectAuthoringSource } from './authoring.cjs';
7
+ import type { EffectProvider } from './types.cjs';
8
+ export interface GenericAuthoringOptions {
9
+ /** The provider whose `describe` and `createRenderer` the session uses. */
10
+ provider: EffectProvider;
11
+ /** Undo history to record into (default: a new HistoryManager). */
12
+ history?: HistoryManager;
13
+ /**
14
+ * Time source for playback: called with a frame callback, returns a cancel function.
15
+ * Default: requestAnimationFrame where it exists, else a 16 ms timer. Tests pass a manual one.
16
+ */
17
+ schedule?: (frame: (now: number) => void) => () => void;
18
+ /** Ms within which `setValue` calls on one control with no gesture merge (default 400). */
19
+ mergeWindowMs?: number;
20
+ }
21
+ /**
22
+ * Creates an effect authoring session with values, presets, keyframes, timing and undo
23
+ * over any provider. It has no source editing (`sourceLanguage: null`).
24
+ */
25
+ export declare function createEffectAuthoringSession(source: EffectAuthoringSource, options: GenericAuthoringOptions): Promise<EffectAuthoringSession>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Generic effect authoring session: controls values, keyframes, presets, timing, undo/redo
3
+ * and preview rendering for any effect provider.
4
+ */
5
+ import { HistoryManager } from '../history/HistoryManager.js';
6
+ import type { EffectAuthoringSession, EffectAuthoringSource } from './authoring.js';
7
+ import type { EffectProvider } from './types.js';
8
+ export interface GenericAuthoringOptions {
9
+ /** The provider whose `describe` and `createRenderer` the session uses. */
10
+ provider: EffectProvider;
11
+ /** Undo history to record into (default: a new HistoryManager). */
12
+ history?: HistoryManager;
13
+ /**
14
+ * Time source for playback: called with a frame callback, returns a cancel function.
15
+ * Default: requestAnimationFrame where it exists, else a 16 ms timer. Tests pass a manual one.
16
+ */
17
+ schedule?: (frame: (now: number) => void) => () => void;
18
+ /** Ms within which `setValue` calls on one control with no gesture merge (default 400). */
19
+ mergeWindowMs?: number;
20
+ }
21
+ /**
22
+ * Creates an effect authoring session with values, presets, keyframes, timing and undo
23
+ * over any provider. It has no source editing (`sourceLanguage: null`).
24
+ */
25
+ export declare function createEffectAuthoringSession(source: EffectAuthoringSource, options: GenericAuthoringOptions): Promise<EffectAuthoringSession>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Agent tools for authoring shaders and procedural effects: inspecting controls, setting values,
3
+ * applying presets, managing keyframes on animation tracks, playback timing, and previewing.
4
+ */
5
+ import type { AgentToolProvider } from '../tools/registry.cjs';
6
+ import type { EffectAuthoringSession } from './authoring.cjs';
7
+ export interface EffectAuthoringToolHost {
8
+ /**
9
+ * The open authoring session, or null when nothing is open (tools then refuse with a message
10
+ * explaining how to open one).
11
+ */
12
+ session(): EffectAuthoringSession | null;
13
+ /** Optional: a PNG data URL of the preview, for the `effect_authoring_view` tool. */
14
+ capture?(): Promise<string>;
15
+ /** Lets the tool list follow session opens, closes, or changes. */
16
+ subscribe?: (notify: () => void) => () => void;
17
+ }
18
+ export interface EffectAuthoringToolOptions {
19
+ /** Provider id (unique per registry). Default: 'effect-authoring'. */
20
+ id?: string;
21
+ /** Tool-name prefix (`<namespace>__<name>`); defaults to the provider id. */
22
+ namespace?: string;
23
+ /** Toolset title. */
24
+ title?: string;
25
+ /** Toolset description. */
26
+ description?: string;
27
+ /** Name of the agent skill documenting these tools. */
28
+ skill?: string;
29
+ }
30
+ /** Creates the agent tool provider for effect authoring. */
31
+ export declare function createEffectAuthoringToolProvider(host: EffectAuthoringToolHost, options?: EffectAuthoringToolOptions): AgentToolProvider;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Agent tools for authoring shaders and procedural effects: inspecting controls, setting values,
3
+ * applying presets, managing keyframes on animation tracks, playback timing, and previewing.
4
+ */
5
+ import type { AgentToolProvider } from '../tools/registry.js';
6
+ import type { EffectAuthoringSession } from './authoring.js';
7
+ export interface EffectAuthoringToolHost {
8
+ /**
9
+ * The open authoring session, or null when nothing is open (tools then refuse with a message
10
+ * explaining how to open one).
11
+ */
12
+ session(): EffectAuthoringSession | null;
13
+ /** Optional: a PNG data URL of the preview, for the `effect_authoring_view` tool. */
14
+ capture?(): Promise<string>;
15
+ /** Lets the tool list follow session opens, closes, or changes. */
16
+ subscribe?: (notify: () => void) => () => void;
17
+ }
18
+ export interface EffectAuthoringToolOptions {
19
+ /** Provider id (unique per registry). Default: 'effect-authoring'. */
20
+ id?: string;
21
+ /** Tool-name prefix (`<namespace>__<name>`); defaults to the provider id. */
22
+ namespace?: string;
23
+ /** Toolset title. */
24
+ title?: string;
25
+ /** Toolset description. */
26
+ description?: string;
27
+ /** Name of the agent skill documenting these tools. */
28
+ skill?: string;
29
+ }
30
+ /** Creates the agent tool provider for effect authoring. */
31
+ export declare function createEffectAuthoringToolProvider(host: EffectAuthoringToolHost, options?: EffectAuthoringToolOptions): AgentToolProvider;