@pixerate/editor 0.81.0 → 0.82.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 (62) hide show
  1. package/dist/agent/index.cjs +36 -7
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.d.cts +5 -3
  4. package/dist/agent/index.d.ts +5 -3
  5. package/dist/agent/index.js +43 -14
  6. package/dist/agent/index.js.map +1 -1
  7. package/dist/animation-editor/index.d.cts +1 -1
  8. package/dist/animation-editor/index.d.ts +1 -1
  9. package/dist/bridge/index.d.cts +3 -3
  10. package/dist/bridge/index.d.ts +3 -3
  11. package/dist/{bridge-client-C5dRjrz5.d.ts → bridge-client-CMGfnjTl.d.ts} +1 -1
  12. package/dist/{bridge-client-C5OziCRK.d.cts → bridge-client-VpnICVxP.d.cts} +1 -1
  13. package/dist/canvas/index.cjs +235 -104
  14. package/dist/canvas/index.cjs.map +1 -1
  15. package/dist/canvas/index.d.cts +59 -1
  16. package/dist/canvas/index.d.ts +59 -1
  17. package/dist/canvas/index.js +234 -103
  18. package/dist/canvas/index.js.map +1 -1
  19. package/dist/capture-DFEMFmVt.d.cts +133 -0
  20. package/dist/capture-wwNGaW05.d.ts +133 -0
  21. package/dist/chart/index.d.cts +1 -1
  22. package/dist/chart/index.d.ts +1 -1
  23. package/dist/{chunk-K73CKYUM.cjs → chunk-EI2MOVQ3.cjs} +198 -3
  24. package/dist/chunk-EI2MOVQ3.cjs.map +1 -0
  25. package/dist/chunk-FURT6ZFZ.cjs +1 -0
  26. package/dist/chunk-FURT6ZFZ.cjs.map +1 -0
  27. package/dist/{chunk-GPWNYQ7R.js → chunk-O2W2SP3C.js} +197 -2
  28. package/dist/chunk-O2W2SP3C.js.map +1 -0
  29. package/dist/chunk-REOJJIY3.js +201 -0
  30. package/dist/chunk-REOJJIY3.js.map +1 -0
  31. package/dist/chunk-RJ2BFKEN.js +1 -0
  32. package/dist/chunk-RJ2BFKEN.js.map +1 -0
  33. package/dist/chunk-VJUVNERT.cjs +201 -0
  34. package/dist/chunk-VJUVNERT.cjs.map +1 -0
  35. package/dist/commands/index.d.cts +1 -1
  36. package/dist/commands/index.d.ts +1 -1
  37. package/dist/diagram/index.d.cts +1 -1
  38. package/dist/diagram/index.d.ts +1 -1
  39. package/dist/dom-capture-7Wvf6Tyg.d.ts +59 -0
  40. package/dist/dom-capture-GyYuE-zq.d.cts +59 -0
  41. package/dist/generation/index.d.cts +2 -2
  42. package/dist/generation/index.d.ts +2 -2
  43. package/dist/image-editor/index.cjs +97 -1
  44. package/dist/image-editor/index.cjs.map +1 -1
  45. package/dist/image-editor/index.d.cts +24 -2
  46. package/dist/image-editor/index.d.ts +24 -2
  47. package/dist/image-editor/index.js +96 -0
  48. package/dist/image-editor/index.js.map +1 -1
  49. package/dist/{registry-DIpIaCkH.d.cts → registry-BqA1AZt0.d.cts} +1 -1
  50. package/dist/{registry-7AZFuand.d.ts → registry-D-4fit9C.d.ts} +1 -1
  51. package/dist/tools/index.cjs +33 -4
  52. package/dist/tools/index.cjs.map +1 -1
  53. package/dist/tools/index.d.cts +4 -2
  54. package/dist/tools/index.d.ts +4 -2
  55. package/dist/tools/index.js +43 -14
  56. package/dist/video-editor/index.d.cts +1 -1
  57. package/dist/video-editor/index.d.ts +1 -1
  58. package/package.json +1 -1
  59. package/skills/pixerate-canvas/SKILL.md +1 -0
  60. package/skills/pixerate-image-editor/SKILL.md +1 -0
  61. package/dist/chunk-GPWNYQ7R.js.map +0 -1
  62. package/dist/chunk-K73CKYUM.cjs.map +0 -1
@@ -0,0 +1,201 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/tools/capture.ts
2
+ function unionCaptureRects(rects) {
3
+ let minX = Infinity;
4
+ let minY = Infinity;
5
+ let maxX = -Infinity;
6
+ let maxY = -Infinity;
7
+ for (const r of rects) {
8
+ if (!r) continue;
9
+ minX = Math.min(minX, r.x);
10
+ minY = Math.min(minY, r.y);
11
+ maxX = Math.max(maxX, r.x + r.width);
12
+ maxY = Math.max(maxY, r.y + r.height);
13
+ }
14
+ return minX === Infinity ? null : { x: minX, y: minY, width: maxX - minX, height: maxY - minY };
15
+ }
16
+ function captureOutputSize(rect, maxEdge, maxScale = 2) {
17
+ const longest = Math.max(rect.width, rect.height);
18
+ const scale = Math.min(maxScale, maxEdge / longest);
19
+ return {
20
+ width: Math.max(1, Math.round(rect.width * scale)),
21
+ height: Math.max(1, Math.round(rect.height * scale)),
22
+ scale
23
+ };
24
+ }
25
+ function toCapturedImageData(image, fallbackMimeType) {
26
+ if (typeof image !== "string") return image;
27
+ if (!image.startsWith("data:")) return { data: image, mimeType: fallbackMimeType };
28
+ const match = /^data:([^;,]*)(?:;[^,]*)?,(.*)$/s.exec(image);
29
+ if (!_optionalChain([match, 'optionalAccess', _ => _[1]]) || !match[2]) throw new Error("The surface returned an empty image; rendering may not be available in this environment.");
30
+ return { data: match[2], mimeType: match[1] };
31
+ }
32
+ var round = (n) => Math.round(n * 100) / 100;
33
+ var roundRect = (r) => ({ x: round(r.x), y: round(r.y), width: round(r.width), height: round(r.height) });
34
+ var pad = (r, p) => ({ x: r.x - p, y: r.y - p, width: r.width + 2 * p, height: r.height + 2 * p });
35
+ function regionsOf(surface) {
36
+ return [
37
+ ...surface.viewport ? ["viewport"] : [],
38
+ "content",
39
+ ...surface.selection ? ["selection"] : [],
40
+ ...surface.items ? [surface.items.region] : [],
41
+ "rect"
42
+ ];
43
+ }
44
+ function captureInputSchema(surface, options = {}) {
45
+ const regions = regionsOf(surface);
46
+ const units = surface.units;
47
+ const properties = {
48
+ region: {
49
+ type: "string",
50
+ enum: regions,
51
+ description: `What to capture (default ${regions[0]}): ` + [
52
+ surface.viewport ? '"viewport" is what is on screen now' : "",
53
+ '"content" is everything',
54
+ surface.selection ? '"selection" is the selected items' : "",
55
+ surface.items ? `"${surface.items.region}" is the ${surface.items.noun}s in "ids"` : "",
56
+ `"rect" is the area in "rect"`
57
+ ].filter(Boolean).join(", ") + "."
58
+ },
59
+ ...surface.items ? {
60
+ ids: {
61
+ type: "array",
62
+ items: { type: "string" },
63
+ minItems: 1,
64
+ description: `With region "${surface.items.region}": ids of the ${surface.items.noun}s to frame${surface.items.source ? ` (from ${surface.items.source})` : ""}.`
65
+ }
66
+ } : {},
67
+ rect: {
68
+ type: "object",
69
+ properties: {
70
+ x: { type: "number", description: `Left edge in ${units}.` },
71
+ y: { type: "number", description: `Top edge in ${units}.` },
72
+ width: { type: "number", exclusiveMinimum: 0, description: `Width in ${units}.` },
73
+ height: { type: "number", exclusiveMinimum: 0, description: `Height in ${units}.` }
74
+ },
75
+ required: ["x", "y", "width", "height"],
76
+ additionalProperties: false,
77
+ description: `With region "rect": the area to capture, in ${units}.`
78
+ },
79
+ padding: {
80
+ type: "number",
81
+ minimum: 0,
82
+ description: `Margin around content, selection${surface.items ? ` and ${surface.items.region}` : ""} regions, in ${units} (default ${_nullishCoalesce(options.defaultPadding, () => ( 16))}).`
83
+ },
84
+ maxEdge: {
85
+ type: "integer",
86
+ minimum: 64,
87
+ maximum: 4096,
88
+ description: `Longest side of the image in pixels (default ${_nullishCoalesce(options.defaultMaxEdge, () => ( 1024))}). Small regions are not enlarged beyond ${_nullishCoalesce(surface.maxScale, () => ( 2))} pixels per unit.`
89
+ },
90
+ format: { type: "string", enum: ["png", "jpeg"], description: "Image format (default png; jpeg is smaller for photos)." },
91
+ quality: { type: "number", minimum: 0.1, maximum: 1, description: "JPEG quality from 0.1 to 1 (default 0.85). Ignored for png." },
92
+ ...surface.overlays ? { includeOverlays: { type: "boolean", description: `Also draw ${surface.overlays} (default false).` } } : {}
93
+ };
94
+ return { type: "object", properties, additionalProperties: false };
95
+ }
96
+ function resolveCaptureRequest(surface, args, options = {}) {
97
+ const regions = regionsOf(surface);
98
+ const region = _nullishCoalesce(args.region, () => ( regions[0]));
99
+ if (!regions.includes(region)) throw new Error(`Unknown region "${region}". Use one of: ${regions.join(", ")}.`);
100
+ if (args.rect !== void 0 && region !== "rect") throw new Error(`"rect" only applies with region "rect"; drop it or set region to "rect".`);
101
+ if (args.ids !== void 0 && region !== _optionalChain([surface, 'access', _2 => _2.items, 'optionalAccess', _3 => _3.region])) {
102
+ throw new Error(`"ids" only applies with region "${_nullishCoalesce(_optionalChain([surface, 'access', _4 => _4.items, 'optionalAccess', _5 => _5.region]), () => ( "items"))}"; drop it or change the region.`);
103
+ }
104
+ const padding = typeof args.padding === "number" ? args.padding : _nullishCoalesce(options.defaultPadding, () => ( 16));
105
+ let rect;
106
+ let ids;
107
+ if (region === "viewport") {
108
+ rect = surface.viewport();
109
+ if (!rect) throw new Error('The view is not on screen (not mounted or zero size). Use region "content" instead.');
110
+ } else if (region === "content") {
111
+ const content = surface.content();
112
+ if (!content) throw new Error("There is nothing to capture: the surface is empty.");
113
+ rect = pad(content, padding);
114
+ } else if (region === "selection") {
115
+ const selection = surface.selection();
116
+ if (!selection.rect) throw new Error('Nothing is selected. Select something first, or use region "content".');
117
+ rect = pad(selection.rect, padding);
118
+ ids = selection.ids;
119
+ } else if (region === "rect") {
120
+ if (!args.rect) throw new Error(`Region "rect" needs "rect": {"x", "y", "width", "height"} in ${surface.units}.`);
121
+ rect = { x: args.rect.x, y: args.rect.y, width: args.rect.width, height: args.rect.height };
122
+ } else {
123
+ const items = surface.items;
124
+ const wanted = Array.isArray(args.ids) ? args.ids : [];
125
+ if (!wanted.length) throw new Error(`Region "${items.region}" needs "ids": the ${items.noun} ids to frame.`);
126
+ const found = items.bounds(wanted);
127
+ if (found.missing.length) {
128
+ throw new Error(
129
+ `Unknown ${items.noun} id(s): ${found.missing.join(", ")}.${items.source ? ` Read the current ids with ${items.source}.` : ""}`
130
+ );
131
+ }
132
+ if (!found.rect) throw new Error(`The ${items.noun}s ${wanted.join(", ")} have no size yet; try again once they are drawn.`);
133
+ rect = pad(found.rect, padding);
134
+ ids = wanted;
135
+ }
136
+ if (!(rect.width > 0) || !(rect.height > 0)) {
137
+ throw new Error(`The ${region} region is empty (${rect.width} \xD7 ${rect.height} ${surface.units}); capture a larger area.`);
138
+ }
139
+ const maxEdge = typeof args.maxEdge === "number" ? args.maxEdge : _nullishCoalesce(options.defaultMaxEdge, () => ( 1024));
140
+ const size = captureOutputSize(rect, maxEdge, _nullishCoalesce(surface.maxScale, () => ( 2)));
141
+ return {
142
+ region,
143
+ rect,
144
+ ...size,
145
+ format: args.format === "jpeg" ? "jpeg" : "png",
146
+ quality: typeof args.quality === "number" ? args.quality : 0.85,
147
+ includeOverlays: !!surface.overlays && args.includeOverlays === true,
148
+ ...ids ? { ids } : {}
149
+ };
150
+ }
151
+ function createCaptureTool(surface, options = {}) {
152
+ const title = _nullishCoalesce(options.title, () => ( "Capture a screenshot"));
153
+ const subject = _nullishCoalesce(options.subject, () => ( "the view"));
154
+ return {
155
+ name: _nullishCoalesce(options.name, () => ( "capture_view")),
156
+ title,
157
+ description: `Takes a screenshot of ${subject} so you can check how it looks, without changing anything. Captures the ${regionsOf(surface).join(", ")} region and returns the image plus the captured rect (in ${surface.units}) and the pixel scale, so a point (px, py) in the image is at (rect.x + px / scale, rect.y + py / scale).` + (surface.overlays ? ` Transient overlays (${surface.overlays}) are left out unless includeOverlays is true.` : ""),
158
+ inputSchema: captureInputSchema(surface, options),
159
+ annotations: { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
160
+ handler: async (args, context) => {
161
+ const { ids, ...request } = resolveCaptureRequest(surface, args, options);
162
+ const mimeType = request.format === "jpeg" ? "image/jpeg" : "image/png";
163
+ const image = toCapturedImageData(await surface.render({ ...request, signal: context.signal }), mimeType);
164
+ const rect = roundRect(request.rect);
165
+ const meta = {
166
+ region: request.region,
167
+ rect,
168
+ units: surface.units,
169
+ width: request.width,
170
+ height: request.height,
171
+ scale: round(request.scale),
172
+ mimeType: image.mimeType,
173
+ ...ids ? { ids } : {}
174
+ };
175
+ return {
176
+ content: [
177
+ { type: "image", data: image.data, mimeType: image.mimeType },
178
+ {
179
+ type: "text",
180
+ text: `Captured ${request.region} at ${request.width}\xD7${request.height} px: x ${rect.x}, y ${rect.y}, ${rect.width}\xD7${rect.height} ${surface.units} (${meta.scale} px per unit).`
181
+ }
182
+ ],
183
+ structuredContent: meta
184
+ };
185
+ }
186
+ };
187
+ }
188
+ function createCaptureToolProvider(surface, options = {}) {
189
+ return { id: _nullishCoalesce(options.id, () => ( "capture")), namespace: options.namespace, tools: [createCaptureTool(surface, options)] };
190
+ }
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ exports.unionCaptureRects = unionCaptureRects; exports.captureOutputSize = captureOutputSize; exports.toCapturedImageData = toCapturedImageData; exports.captureInputSchema = captureInputSchema; exports.resolveCaptureRequest = resolveCaptureRequest; exports.createCaptureTool = createCaptureTool; exports.createCaptureToolProvider = createCaptureToolProvider;
201
+ //# sourceMappingURL=chunk-VJUVNERT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-VJUVNERT.cjs","../src/tools/capture.ts"],"names":[],"mappings":"AAAA;AC8FO,SAAS,iBAAA,CAAkB,KAAA,EAAwE;AACzG,EAAA,IAAI,KAAA,EAAO,QAAA;AACX,EAAA,IAAI,KAAA,EAAO,QAAA;AACX,EAAA,IAAI,KAAA,EAAO,CAAA,QAAA;AACX,EAAA,IAAI,KAAA,EAAO,CAAA,QAAA;AACX,EAAA,IAAA,CAAA,MAAW,EAAA,GAAK,KAAA,EAAO;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AACe,QAAA;AACA,QAAA;AACC,QAAA;AACU,QAAA;AACV,QAAA;AACK,QAAA;AACtB,MAAA;AACO,MAAA;AACG,QAAA;AACoD,UAAA;AAC5D,UAAA;AACO,YAAA;AAC0E,YAAA;AACjF,UAAA;AACD,QAAA;AACmB,QAAA;AACpB,MAAA;AACD,IAAA;AACD,EAAA;AACD;AAGgI;AACjC,EAAA;AAC/F;ADvImG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-VJUVNERT.cjs","sourcesContent":[null,"import type { AgentTool, AgentToolProvider, McpToolResult } from './registry.js';\nimport type { JsonSchema } from './schema.js';\n\n/** A rectangle in a surface's own units (canvas units, image pixels, CSS pixels). */\nexport interface CaptureRect {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * What to capture: what is on screen (`viewport`), everything (`content`), the\n * selection, the bounds of some items by id (the surface's `items.region`,\n * e.g. `nodes`), or an explicit `rect`.\n */\nexport type CaptureRegion = 'viewport' | 'content' | 'selection' | 'rect' | (string & {});\n\nexport type CaptureFormat = 'png' | 'jpeg';\n\n/** What a surface is asked to draw. */\nexport interface CaptureRenderRequest {\n\t/** Region name the agent asked for. */\n\tregion: CaptureRegion;\n\t/** The area to draw, in surface units. */\n\trect: CaptureRect;\n\t/** Output size in pixels. */\n\twidth: number;\n\theight: number;\n\t/** Output pixels per surface unit (`width / rect.width`). */\n\tscale: number;\n\tformat: CaptureFormat;\n\t/** JPEG quality, 0-1. */\n\tquality: number;\n\t/** Draw selection boxes, presence cursors and other transient overlays too. */\n\tincludeOverlays: boolean;\n\tsignal?: AbortSignal;\n}\n\n/** A rendered image: base64 data with its MIME type, or a `data:` URL. */\nexport type CapturedImage = { data: string; mimeType: string } | string;\n\n/**\n * Something an agent can take a screenshot of. Bounds are in the surface's\n * own units; `render` draws a rectangle of it at a given pixel size.\n */\nexport interface CaptureSurface {\n\t/** Name of the coordinate space, used in the tool description and results (e.g. `canvas units`). */\n\tunits: string;\n\t/** What is on screen now. Omit when the surface has no viewport. */\n\tviewport?: () => CaptureRect | null;\n\t/** Bounds of everything, or `null` when the surface is empty. */\n\tcontent: () => CaptureRect | null;\n\t/** Bounds of the selection (`null` when nothing is selected) and the selected ids. */\n\tselection?: () => { rect: CaptureRect | null; ids?: string[] };\n\t/** Capture by item ids, e.g. canvas nodes. */\n\titems?: {\n\t\t/** Region name, e.g. `nodes`. */\n\t\tregion: string;\n\t\t/** Singular noun for messages, e.g. `node`. */\n\t\tnoun: string;\n\t\t/** Where the ids come from, for error messages (e.g. `get_editor_state`). */\n\t\tsource?: string;\n\t\t/** Bounds of the found items and the ids that were not found. */\n\t\tbounds: (ids: string[]) => { rect: CaptureRect | null; missing: string[] };\n\t};\n\t/** Describes the overlays `includeOverlays` adds; omit when the surface has none. */\n\toverlays?: string;\n\t/** Largest output pixels per surface unit (default 2). */\n\tmaxScale?: number;\n\trender: (request: CaptureRenderRequest) => CapturedImage | Promise<CapturedImage>;\n}\n\nexport interface CaptureToolOptions {\n\t/** Tool name (default `capture_view`). */\n\tname?: string;\n\t/** Tool title (default `Capture a screenshot`). */\n\ttitle?: string;\n\t/** What is being captured, for the description (default `the view`). */\n\tsubject?: string;\n\t/** Longest output side when the agent passes no `maxEdge` (default 1024). */\n\tdefaultMaxEdge?: number;\n\t/** Margin around `content`, `selection` and item regions when the agent passes no `padding` (default 16 units). */\n\tdefaultPadding?: number;\n}\n\nexport interface CaptureToolProviderOptions extends CaptureToolOptions {\n\t/** Provider id (unique per registry, default `capture`). */\n\tid?: string;\n\t/** Always prefix tool names with `<namespace>__`. */\n\tnamespace?: string;\n}\n\n/** Bounds of the capture: union of rects, `null` for none. */\nexport function unionCaptureRects(rects: readonly (CaptureRect | null | undefined)[]): CaptureRect | null {\n\tlet minX = Infinity;\n\tlet minY = Infinity;\n\tlet maxX = -Infinity;\n\tlet maxY = -Infinity;\n\tfor (const r of rects) {\n\t\tif (!r) continue;\n\t\tminX = Math.min(minX, r.x);\n\t\tminY = Math.min(minY, r.y);\n\t\tmaxX = Math.max(maxX, r.x + r.width);\n\t\tmaxY = Math.max(maxY, r.y + r.height);\n\t}\n\treturn minX === Infinity ? null : { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\n}\n\n/**\n * Output pixel size for `rect`: the longest side at most `maxEdge`, never more\n * than `maxScale` pixels per unit, at least 1 × 1.\n */\nexport function captureOutputSize(rect: CaptureRect, maxEdge: number, maxScale = 2): { width: number; height: number; scale: number } {\n\tconst longest = Math.max(rect.width, rect.height);\n\tconst scale = Math.min(maxScale, maxEdge / longest);\n\treturn {\n\t\twidth: Math.max(1, Math.round(rect.width * scale)),\n\t\theight: Math.max(1, Math.round(rect.height * scale)),\n\t\tscale\n\t};\n}\n\n/** Splits a `data:` URL or plain base64 into base64 data and MIME type. */\nexport function toCapturedImageData(image: CapturedImage, fallbackMimeType: string): { data: string; mimeType: string } {\n\tif (typeof image !== 'string') return image;\n\tif (!image.startsWith('data:')) return { data: image, mimeType: fallbackMimeType };\n\tconst match = /^data:([^;,]*)(?:;[^,]*)?,(.*)$/s.exec(image);\n\tif (!match?.[1] || !match[2]) throw new Error('The surface returned an empty image; rendering may not be available in this environment.');\n\treturn { data: match[2], mimeType: match[1] };\n}\n\nconst round = (n: number) => Math.round(n * 100) / 100;\nconst roundRect = (r: CaptureRect): CaptureRect => ({ x: round(r.x), y: round(r.y), width: round(r.width), height: round(r.height) });\nconst pad = (r: CaptureRect, p: number): CaptureRect => ({ x: r.x - p, y: r.y - p, width: r.width + 2 * p, height: r.height + 2 * p });\n\nfunction regionsOf(surface: CaptureSurface): string[] {\n\treturn [\n\t\t...(surface.viewport ? ['viewport'] : []),\n\t\t'content',\n\t\t...(surface.selection ? ['selection'] : []),\n\t\t...(surface.items ? [surface.items.region] : []),\n\t\t'rect'\n\t];\n}\n\n/** JSON Schema of the capture tool's arguments for a surface (only the options it supports). */\nexport function captureInputSchema(surface: CaptureSurface, options: CaptureToolOptions = {}): JsonSchema & { type: 'object' } {\n\tconst regions = regionsOf(surface);\n\tconst units = surface.units;\n\tconst properties: Record<string, JsonSchema> = {\n\t\tregion: {\n\t\t\ttype: 'string',\n\t\t\tenum: regions,\n\t\t\tdescription:\n\t\t\t\t`What to capture (default ${regions[0]}): ` +\n\t\t\t\t[\n\t\t\t\t\tsurface.viewport ? '\"viewport\" is what is on screen now' : '',\n\t\t\t\t\t'\"content\" is everything',\n\t\t\t\t\tsurface.selection ? '\"selection\" is the selected items' : '',\n\t\t\t\t\tsurface.items ? `\"${surface.items.region}\" is the ${surface.items.noun}s in \"ids\"` : '',\n\t\t\t\t\t`\"rect\" is the area in \"rect\"`\n\t\t\t\t]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.join(', ') +\n\t\t\t\t'.'\n\t\t},\n\t\t...(surface.items\n\t\t\t? {\n\t\t\t\t\tids: {\n\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\titems: { type: 'string' },\n\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\tdescription: `With region \"${surface.items.region}\": ids of the ${surface.items.noun}s to frame${surface.items.source ? ` (from ${surface.items.source})` : ''}.`\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t: {}),\n\t\trect: {\n\t\t\ttype: 'object',\n\t\t\tproperties: {\n\t\t\t\tx: { type: 'number', description: `Left edge in ${units}.` },\n\t\t\t\ty: { type: 'number', description: `Top edge in ${units}.` },\n\t\t\t\twidth: { type: 'number', exclusiveMinimum: 0, description: `Width in ${units}.` },\n\t\t\t\theight: { type: 'number', exclusiveMinimum: 0, description: `Height in ${units}.` }\n\t\t\t},\n\t\t\trequired: ['x', 'y', 'width', 'height'],\n\t\t\tadditionalProperties: false,\n\t\t\tdescription: `With region \"rect\": the area to capture, in ${units}.`\n\t\t},\n\t\tpadding: {\n\t\t\ttype: 'number',\n\t\t\tminimum: 0,\n\t\t\tdescription: `Margin around content, selection${surface.items ? ` and ${surface.items.region}` : ''} regions, in ${units} (default ${options.defaultPadding ?? 16}).`\n\t\t},\n\t\tmaxEdge: {\n\t\t\ttype: 'integer',\n\t\t\tminimum: 64,\n\t\t\tmaximum: 4096,\n\t\t\tdescription: `Longest side of the image in pixels (default ${options.defaultMaxEdge ?? 1024}). Small regions are not enlarged beyond ${surface.maxScale ?? 2} pixels per unit.`\n\t\t},\n\t\tformat: { type: 'string', enum: ['png', 'jpeg'], description: 'Image format (default png; jpeg is smaller for photos).' },\n\t\tquality: { type: 'number', minimum: 0.1, maximum: 1, description: 'JPEG quality from 0.1 to 1 (default 0.85). Ignored for png.' },\n\t\t...(surface.overlays\n\t\t\t? { includeOverlays: { type: 'boolean', description: `Also draw ${surface.overlays} (default false).` } }\n\t\t\t: {})\n\t};\n\treturn { type: 'object', properties, additionalProperties: false };\n}\n\n/**\n * Works out the rectangle and pixel size for a capture call, checking the\n * arguments against the surface. Throws an error that says how to fix the call.\n */\nexport function resolveCaptureRequest(\n\tsurface: CaptureSurface,\n\targs: Record<string, any>,\n\toptions: CaptureToolOptions = {}\n): Omit<CaptureRenderRequest, 'signal'> & { ids?: string[] } {\n\tconst regions = regionsOf(surface);\n\tconst region: string = args.region ?? regions[0];\n\tif (!regions.includes(region)) throw new Error(`Unknown region \"${region}\". Use one of: ${regions.join(', ')}.`);\n\tif (args.rect !== undefined && region !== 'rect') throw new Error(`\"rect\" only applies with region \"rect\"; drop it or set region to \"rect\".`);\n\tif (args.ids !== undefined && region !== surface.items?.region) {\n\t\tthrow new Error(`\"ids\" only applies with region \"${surface.items?.region ?? 'items'}\"; drop it or change the region.`);\n\t}\n\tconst padding = typeof args.padding === 'number' ? args.padding : (options.defaultPadding ?? 16);\n\tlet rect: CaptureRect | null;\n\tlet ids: string[] | undefined;\n\tif (region === 'viewport') {\n\t\trect = surface.viewport!();\n\t\tif (!rect) throw new Error('The view is not on screen (not mounted or zero size). Use region \"content\" instead.');\n\t} else if (region === 'content') {\n\t\tconst content = surface.content();\n\t\tif (!content) throw new Error('There is nothing to capture: the surface is empty.');\n\t\trect = pad(content, padding);\n\t} else if (region === 'selection') {\n\t\tconst selection = surface.selection!();\n\t\tif (!selection.rect) throw new Error('Nothing is selected. Select something first, or use region \"content\".');\n\t\trect = pad(selection.rect, padding);\n\t\tids = selection.ids;\n\t} else if (region === 'rect') {\n\t\tif (!args.rect) throw new Error(`Region \"rect\" needs \"rect\": {\"x\", \"y\", \"width\", \"height\"} in ${surface.units}.`);\n\t\trect = { x: args.rect.x, y: args.rect.y, width: args.rect.width, height: args.rect.height };\n\t} else {\n\t\tconst items = surface.items!;\n\t\tconst wanted = Array.isArray(args.ids) ? (args.ids as string[]) : [];\n\t\tif (!wanted.length) throw new Error(`Region \"${items.region}\" needs \"ids\": the ${items.noun} ids to frame.`);\n\t\tconst found = items.bounds(wanted);\n\t\tif (found.missing.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unknown ${items.noun} id(s): ${found.missing.join(', ')}.${items.source ? ` Read the current ids with ${items.source}.` : ''}`\n\t\t\t);\n\t\t}\n\t\tif (!found.rect) throw new Error(`The ${items.noun}s ${wanted.join(', ')} have no size yet; try again once they are drawn.`);\n\t\trect = pad(found.rect, padding);\n\t\tids = wanted;\n\t}\n\tif (!(rect.width > 0) || !(rect.height > 0)) {\n\t\tthrow new Error(`The ${region} region is empty (${rect.width} × ${rect.height} ${surface.units}); capture a larger area.`);\n\t}\n\tconst maxEdge = typeof args.maxEdge === 'number' ? args.maxEdge : (options.defaultMaxEdge ?? 1024);\n\tconst size = captureOutputSize(rect, maxEdge, surface.maxScale ?? 2);\n\treturn {\n\t\tregion,\n\t\trect,\n\t\t...size,\n\t\tformat: args.format === 'jpeg' ? 'jpeg' : 'png',\n\t\tquality: typeof args.quality === 'number' ? args.quality : 0.85,\n\t\tincludeOverlays: !!surface.overlays && args.includeOverlays === true,\n\t\t...(ids ? { ids } : {})\n\t};\n}\n\n/**\n * The `capture_view` agent tool for a surface: renders a region as an image\n * the model can look at. The result has the image and a text block, and\n * `structuredContent` with the captured `rect` (surface units), the pixel\n * size and `scale`, so a point in the image maps back with\n * `x = rect.x + px / scale`.\n */\nexport function createCaptureTool(surface: CaptureSurface, options: CaptureToolOptions = {}): AgentTool {\n\tconst title = options.title ?? 'Capture a screenshot';\n\tconst subject = options.subject ?? 'the view';\n\treturn {\n\t\tname: options.name ?? 'capture_view',\n\t\ttitle,\n\t\tdescription:\n\t\t\t`Takes a screenshot of ${subject} so you can check how it looks, without changing anything. ` +\n\t\t\t`Captures the ${regionsOf(surface).join(', ')} region and returns the image plus the captured rect (in ${surface.units}) and the pixel scale, ` +\n\t\t\t'so a point (px, py) in the image is at (rect.x + px / scale, rect.y + py / scale).' +\n\t\t\t(surface.overlays ? ` Transient overlays (${surface.overlays}) are left out unless includeOverlays is true.` : ''),\n\t\tinputSchema: captureInputSchema(surface, options),\n\t\tannotations: { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },\n\t\thandler: async (args, context): Promise<McpToolResult> => {\n\t\t\tconst { ids, ...request } = resolveCaptureRequest(surface, args, options);\n\t\t\tconst mimeType = request.format === 'jpeg' ? 'image/jpeg' : 'image/png';\n\t\t\tconst image = toCapturedImageData(await surface.render({ ...request, signal: context.signal }), mimeType);\n\t\t\tconst rect = roundRect(request.rect);\n\t\t\tconst meta = {\n\t\t\t\tregion: request.region,\n\t\t\t\trect,\n\t\t\t\tunits: surface.units,\n\t\t\t\twidth: request.width,\n\t\t\t\theight: request.height,\n\t\t\t\tscale: round(request.scale),\n\t\t\t\tmimeType: image.mimeType,\n\t\t\t\t...(ids ? { ids } : {})\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tcontent: [\n\t\t\t\t\t{ type: 'image', data: image.data, mimeType: image.mimeType },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\ttext: `Captured ${request.region} at ${request.width}×${request.height} px: x ${rect.x}, y ${rect.y}, ${rect.width}×${rect.height} ${surface.units} (${meta.scale} px per unit).`\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tstructuredContent: meta\n\t\t\t};\n\t\t}\n\t};\n}\n\n/** A provider with just the `capture_view` tool for a surface. */\nexport function createCaptureToolProvider(surface: CaptureSurface, options: CaptureToolProviderOptions = {}): AgentToolProvider {\n\treturn { id: options.id ?? 'capture', namespace: options.namespace, tools: [createCaptureTool(surface, options)] };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { a as CommandRegistry, P as Platform, b as CommandResult, c as CommandEntry, K as KeyboardEventLike, C as CommandSpec } from '../registry-CaR7LC6W.cjs';
2
2
  export { d as Chord, e as CommandErrorCode, f as CommandHistoryTarget, g as CommandListOptions, h as CommandParamsSchema, i as CommandRegistryError, j as CommandRegistryOptions, E as EffectiveChord, k as PLATFORMS, S as ShortcutBinding, l as ShortcutConflict, m as ShortcutInput, n as ShortcutMap, o as ShortcutMapOptions, p as ShortcutMatch, q as ShortcutResolveOptions, r as chordToString, s as codeFromKey, t as codeToKeyText, u as createCommandRegistry, v as defineCommand, w as detectPlatform, x as effectiveChord, y as effectiveChordKey, z as eventCode, A as formatShortcut, B as isEditableEventTarget, D as keyToCode, F as normalizeChord, G as parseChord, H as shortcutCode, I as toShortcutBindings } from '../registry-CaR7LC6W.cjs';
3
- import { A as AgentToolProvider } from '../registry-DIpIaCkH.cjs';
3
+ import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
4
4
  export { A as ArrangeCommandOptions, a as ArrangeCommandTarget, C as ComponentCommandOptions, b as ComponentCommandTarget, D as DEFAULT_HISTORY_SHORTCUTS, H as HistoryCommandOptions, c as HistoryCommandTarget, S as ShapeCommandOptions, d as ShapeCommandTarget, e as SpreadsheetCommandOptions, f as SpreadsheetCommandTarget, g as createArrangeCommands, h as createComponentCommands, i as createHistoryCommands, j as createShapeCommands, k as createSpreadsheetCommands, l as hasVariantCommands, m as matchHistoryShortcut } from '../builtins-c4w0eAYl.cjs';
5
5
  import '../schema-Di0CS6Pe.cjs';
6
6
  import '../types-DsiXGmjo.cjs';
@@ -1,6 +1,6 @@
1
1
  import { a as CommandRegistry, P as Platform, b as CommandResult, c as CommandEntry, K as KeyboardEventLike, C as CommandSpec } from '../registry-rVtFJjRM.js';
2
2
  export { d as Chord, e as CommandErrorCode, f as CommandHistoryTarget, g as CommandListOptions, h as CommandParamsSchema, i as CommandRegistryError, j as CommandRegistryOptions, E as EffectiveChord, k as PLATFORMS, S as ShortcutBinding, l as ShortcutConflict, m as ShortcutInput, n as ShortcutMap, o as ShortcutMapOptions, p as ShortcutMatch, q as ShortcutResolveOptions, r as chordToString, s as codeFromKey, t as codeToKeyText, u as createCommandRegistry, v as defineCommand, w as detectPlatform, x as effectiveChord, y as effectiveChordKey, z as eventCode, A as formatShortcut, B as isEditableEventTarget, D as keyToCode, F as normalizeChord, G as parseChord, H as shortcutCode, I as toShortcutBindings } from '../registry-rVtFJjRM.js';
3
- import { A as AgentToolProvider } from '../registry-7AZFuand.js';
3
+ import { a as AgentToolProvider } from '../registry-D-4fit9C.js';
4
4
  export { A as ArrangeCommandOptions, a as ArrangeCommandTarget, C as ComponentCommandOptions, b as ComponentCommandTarget, D as DEFAULT_HISTORY_SHORTCUTS, H as HistoryCommandOptions, c as HistoryCommandTarget, S as ShapeCommandOptions, d as ShapeCommandTarget, e as SpreadsheetCommandOptions, f as SpreadsheetCommandTarget, g as createArrangeCommands, h as createComponentCommands, i as createHistoryCommands, j as createShapeCommands, k as createSpreadsheetCommands, l as hasVariantCommands, m as matchHistoryShortcut } from '../builtins-CV1fDj64.js';
5
5
  import '../schema-Di0CS6Pe.js';
6
6
  import '../types-DsiXGmjo.js';
@@ -1,7 +1,7 @@
1
1
  import { f as MetaCarrier, M as MermaidDocument, e as EditOp, D as DiagramFamily, g as DiagramAdapter, S as SupportTier, h as Preamble, b as DiagramMeta, E as EdgePattern, A as ArrowHead, d as GraphEdge, i as AdapterParseContext, a as DiagramGraph, j as Diagnostic, G as GraphNode, P as Point, c as GraphGroup } from '../types-DYkjhzdz.cjs';
2
2
  export { k as DIRECTIONS, l as Direction } from '../types-DYkjhzdz.cjs';
3
3
  import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
4
- import { A as AgentToolProvider } from '../registry-DIpIaCkH.cjs';
4
+ import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
5
5
  import { g as PresenceStore, e as PresenceClock, d as PresenceActorInfo } from '../presence-Cb6WhcrQ.cjs';
6
6
  export { P as PRESENCE_COLORS, a as PerformanceQueue, c as PresenceActor, f as PresenceState, h as createInstantPresenceClock, r as realPresenceClock } from '../presence-Cb6WhcrQ.cjs';
7
7
  import '../types-DsiXGmjo.cjs';
@@ -1,7 +1,7 @@
1
1
  import { f as MetaCarrier, M as MermaidDocument, e as EditOp, D as DiagramFamily, g as DiagramAdapter, S as SupportTier, h as Preamble, b as DiagramMeta, E as EdgePattern, A as ArrowHead, d as GraphEdge, i as AdapterParseContext, a as DiagramGraph, j as Diagnostic, G as GraphNode, P as Point, c as GraphGroup } from '../types-DYkjhzdz.js';
2
2
  export { k as DIRECTIONS, l as Direction } from '../types-DYkjhzdz.js';
3
3
  import { H as HistoryManager } from '../HistoryManager-DWSLd6Tf.js';
4
- import { A as AgentToolProvider } from '../registry-7AZFuand.js';
4
+ import { a as AgentToolProvider } from '../registry-D-4fit9C.js';
5
5
  import { g as PresenceStore, e as PresenceClock, d as PresenceActorInfo } from '../presence-Cb6WhcrQ.js';
6
6
  export { P as PRESENCE_COLORS, a as PerformanceQueue, c as PresenceActor, f as PresenceState, h as createInstantPresenceClock, r as realPresenceClock } from '../presence-Cb6WhcrQ.js';
7
7
  import '../types-DsiXGmjo.js';
@@ -0,0 +1,59 @@
1
+ import { C as CaptureFormat, a as CapturedImage, b as CaptureSurface } from './capture-wwNGaW05.js';
2
+
3
+ interface RasterizeElementOptions {
4
+ /** CSS size of the drawn box (default: the element's client size). */
5
+ width?: number;
6
+ height?: number;
7
+ /** Output size in pixels (default: the CSS size). */
8
+ pixelWidth?: number;
9
+ pixelHeight?: number;
10
+ format?: CaptureFormat;
11
+ /** JPEG quality, 0-1 (default 0.85). */
12
+ quality?: number;
13
+ /** Fill behind the element (default: its computed background, else white for JPEG and transparent for PNG). */
14
+ background?: string;
15
+ /** Selectors of elements (and their subtrees) to leave out. */
16
+ exclude?: readonly string[];
17
+ /** Adjusts the styled clone before it is drawn (e.g. moves a viewport transform). */
18
+ prepare?: (clone: HTMLElement) => void;
19
+ }
20
+ /**
21
+ * Deep-clones `element` with every computed style inlined, so the copy looks
22
+ * the same outside the page's stylesheets (inside an SVG `<foreignObject>`).
23
+ * Elements matching `exclude` are left out, canvases become images, and
24
+ * same-origin images and form values are copied in.
25
+ */
26
+ declare function cloneElementWithStyles(element: Element, exclude?: readonly string[]): HTMLElement;
27
+ /** Wraps a styled clone in a standalone SVG of `width` × `height` CSS pixels. */
28
+ declare function elementToSvg(clone: Element, width: number, height: number): string;
29
+ /**
30
+ * Draws a DOM element into an image in the browser: its styled clone goes
31
+ * into an SVG `<foreignObject>`, which is drawn onto a canvas. Web fonts that
32
+ * are not installed locally fall back, pseudo-elements (`::before`) are not
33
+ * drawn, and cross-origin images come out blank. Returns a `data:` URL.
34
+ */
35
+ declare function rasterizeElement(element: HTMLElement, options?: RasterizeElementOptions): Promise<string>;
36
+ interface ElementCaptureSurfaceOptions {
37
+ /** The element to capture, or a getter (re-read on every call). */
38
+ element: HTMLElement | null | undefined | (() => HTMLElement | null | undefined);
39
+ /** Selectors left out of every capture (default none). */
40
+ exclude?: readonly string[];
41
+ /** Selectors of transient overlays, left out unless `includeOverlays` (default `CAPTURE_OVERLAY_SELECTORS`). */
42
+ overlaySelectors?: readonly string[];
43
+ /** Fill behind the element (default its computed background). */
44
+ background?: string;
45
+ /** Swaps the drawing step (tests, or a library such as html-to-image). */
46
+ rasterize?: (element: HTMLElement, options: RasterizeElementOptions) => Promise<CapturedImage>;
47
+ }
48
+ /** Overlays left out of captures by default: agent cursors and presence tags. */
49
+ declare const CAPTURE_OVERLAY_SELECTORS: readonly string[];
50
+ /** Elements marked `data-capture="exclude"` are never captured. */
51
+ declare const CAPTURE_EXCLUDE_SELECTOR = "[data-capture=\"exclude\"]";
52
+ /**
53
+ * A capture surface for any DOM element (a rich-text editor, a spreadsheet, a
54
+ * panel): units are CSS pixels from the element's top-left corner; `viewport`
55
+ * is its visible box and `content` its full scrollable area.
56
+ */
57
+ declare function createElementCaptureSurface(options: ElementCaptureSurfaceOptions): CaptureSurface;
58
+
59
+ export { CAPTURE_EXCLUDE_SELECTOR as C, type ElementCaptureSurfaceOptions as E, type RasterizeElementOptions as R, CAPTURE_OVERLAY_SELECTORS as a, createElementCaptureSurface as b, cloneElementWithStyles as c, elementToSvg as e, rasterizeElement as r };
@@ -0,0 +1,59 @@
1
+ import { C as CaptureFormat, a as CapturedImage, b as CaptureSurface } from './capture-DFEMFmVt.cjs';
2
+
3
+ interface RasterizeElementOptions {
4
+ /** CSS size of the drawn box (default: the element's client size). */
5
+ width?: number;
6
+ height?: number;
7
+ /** Output size in pixels (default: the CSS size). */
8
+ pixelWidth?: number;
9
+ pixelHeight?: number;
10
+ format?: CaptureFormat;
11
+ /** JPEG quality, 0-1 (default 0.85). */
12
+ quality?: number;
13
+ /** Fill behind the element (default: its computed background, else white for JPEG and transparent for PNG). */
14
+ background?: string;
15
+ /** Selectors of elements (and their subtrees) to leave out. */
16
+ exclude?: readonly string[];
17
+ /** Adjusts the styled clone before it is drawn (e.g. moves a viewport transform). */
18
+ prepare?: (clone: HTMLElement) => void;
19
+ }
20
+ /**
21
+ * Deep-clones `element` with every computed style inlined, so the copy looks
22
+ * the same outside the page's stylesheets (inside an SVG `<foreignObject>`).
23
+ * Elements matching `exclude` are left out, canvases become images, and
24
+ * same-origin images and form values are copied in.
25
+ */
26
+ declare function cloneElementWithStyles(element: Element, exclude?: readonly string[]): HTMLElement;
27
+ /** Wraps a styled clone in a standalone SVG of `width` × `height` CSS pixels. */
28
+ declare function elementToSvg(clone: Element, width: number, height: number): string;
29
+ /**
30
+ * Draws a DOM element into an image in the browser: its styled clone goes
31
+ * into an SVG `<foreignObject>`, which is drawn onto a canvas. Web fonts that
32
+ * are not installed locally fall back, pseudo-elements (`::before`) are not
33
+ * drawn, and cross-origin images come out blank. Returns a `data:` URL.
34
+ */
35
+ declare function rasterizeElement(element: HTMLElement, options?: RasterizeElementOptions): Promise<string>;
36
+ interface ElementCaptureSurfaceOptions {
37
+ /** The element to capture, or a getter (re-read on every call). */
38
+ element: HTMLElement | null | undefined | (() => HTMLElement | null | undefined);
39
+ /** Selectors left out of every capture (default none). */
40
+ exclude?: readonly string[];
41
+ /** Selectors of transient overlays, left out unless `includeOverlays` (default `CAPTURE_OVERLAY_SELECTORS`). */
42
+ overlaySelectors?: readonly string[];
43
+ /** Fill behind the element (default its computed background). */
44
+ background?: string;
45
+ /** Swaps the drawing step (tests, or a library such as html-to-image). */
46
+ rasterize?: (element: HTMLElement, options: RasterizeElementOptions) => Promise<CapturedImage>;
47
+ }
48
+ /** Overlays left out of captures by default: agent cursors and presence tags. */
49
+ declare const CAPTURE_OVERLAY_SELECTORS: readonly string[];
50
+ /** Elements marked `data-capture="exclude"` are never captured. */
51
+ declare const CAPTURE_EXCLUDE_SELECTOR = "[data-capture=\"exclude\"]";
52
+ /**
53
+ * A capture surface for any DOM element (a rich-text editor, a spreadsheet, a
54
+ * panel): units are CSS pixels from the element's top-left corner; `viewport`
55
+ * is its visible box and `content` its full scrollable area.
56
+ */
57
+ declare function createElementCaptureSurface(options: ElementCaptureSurfaceOptions): CaptureSurface;
58
+
59
+ export { CAPTURE_EXCLUDE_SELECTOR as C, type ElementCaptureSurfaceOptions as E, type RasterizeElementOptions as R, CAPTURE_OVERLAY_SELECTORS as a, createElementCaptureSurface as b, cloneElementWithStyles as c, elementToSvg as e, rasterizeElement as r };
@@ -1,7 +1,7 @@
1
1
  import { J as JsonSchema } from '../schema-Di0CS6Pe.cjs';
2
2
  export { S as SchemaValidationError, v as validateJsonSchema } from '../schema-Di0CS6Pe.cjs';
3
- import { A as AgentToolProvider } from '../registry-DIpIaCkH.cjs';
4
- export { b as AgentTool, M as McpToolDefinition, a as McpToolResult } from '../registry-DIpIaCkH.cjs';
3
+ import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
4
+ export { A as AgentTool, M as McpToolDefinition, b as McpToolResult } from '../registry-BqA1AZt0.cjs';
5
5
  import { T as Template, P as PromptValues } from '../tokens-D7yXvUU6.cjs';
6
6
  import { S as StorageAdapter } from '../storage-BpFfspHm.cjs';
7
7
  import { S as SourceMapSegment } from '../sourcemap-C8AH3MBQ.cjs';
@@ -1,7 +1,7 @@
1
1
  import { J as JsonSchema } from '../schema-Di0CS6Pe.js';
2
2
  export { S as SchemaValidationError, v as validateJsonSchema } from '../schema-Di0CS6Pe.js';
3
- import { A as AgentToolProvider } from '../registry-7AZFuand.js';
4
- export { b as AgentTool, M as McpToolDefinition, a as McpToolResult } from '../registry-7AZFuand.js';
3
+ import { a as AgentToolProvider } from '../registry-D-4fit9C.js';
4
+ export { A as AgentTool, M as McpToolDefinition, b as McpToolResult } from '../registry-D-4fit9C.js';
5
5
  import { T as Template, P as PromptValues } from '../tokens-D7yXvUU6.js';
6
6
  import { S as StorageAdapter } from '../storage-BpFfspHm.js';
7
7
  import { S as SourceMapSegment } from '../sourcemap-DA1Evhrv.js';
@@ -1,5 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4;
2
2
 
3
+ var _chunkVJUVNERTcjs = require('../chunk-VJUVNERT.cjs');
4
+
5
+
3
6
  var _chunkD6FH2YAXcjs = require('../chunk-D6FH2YAX.cjs');
4
7
 
5
8
  // src/image-editor/color.ts
@@ -4610,6 +4613,27 @@ var ImageEditorController = (_class3 = class {
4610
4613
  }
4611
4614
  return this.renderer.renderExport(source, this.state, options);
4612
4615
  }
4616
+ /**
4617
+ * Renders the edited image (adjustments, layers and, by default, annotations) in the
4618
+ * source image's own orientation and frame, ignoring crop, rotation and flips, so it lines
4619
+ * up with natural-pixel coordinates (selections, `select_region`). `scale` ≤ 1 shrinks it.
4620
+ * Returns `null` when no image is loaded.
4621
+ */
4622
+ async renderSourceView(options = {}) {
4623
+ const source = this.imageElement || this.state.sourceUrl;
4624
+ if (!source) return null;
4625
+ const { width, height } = this.state.imageDimensions;
4626
+ const k = Math.min(1, Math.max(0, _nullishCoalesce(options.scale, () => ( 1))));
4627
+ return this.renderer.renderExport(
4628
+ source,
4629
+ { ...this.state, crop: null, transform: { rotate: 0, flipH: false, flipV: false } },
4630
+ {
4631
+ width: Math.max(1, Math.round(width * k)),
4632
+ height: Math.max(1, Math.round(height * k)),
4633
+ includeAnnotations: options.includeAnnotations
4634
+ }
4635
+ );
4636
+ }
4613
4637
  async toDataURL(options = {}) {
4614
4638
  const canvas = await this.renderExport(options);
4615
4639
  const format = options.format || "image/png";
@@ -5357,6 +5381,76 @@ function createImageSelectionTools(controller) {
5357
5381
  return [getSelection, selectRegion, selectByColor, modify, refine, applyMask];
5358
5382
  }
5359
5383
 
5384
+ // src/image-editor/capture.ts
5385
+ var NO_CANVAS = "Rendering is not available in this environment.";
5386
+ function selectionShade(selection, doc) {
5387
+ const canvas = doc.createElement("canvas");
5388
+ canvas.width = selection.width;
5389
+ canvas.height = selection.height;
5390
+ const context = canvas.getContext("2d");
5391
+ if (!context) return null;
5392
+ const pixels = context.createImageData(selection.width, selection.height);
5393
+ for (let i = 0; i < selection.data.length; i++) {
5394
+ pixels.data[i * 4 + 3] = Math.round(150 * (1 - selection.data[i] / 255));
5395
+ }
5396
+ context.putImageData(pixels, 0, 0);
5397
+ return canvas;
5398
+ }
5399
+ async function renderImageRegion(controller, request) {
5400
+ const state = controller.getState();
5401
+ const k = Math.min(1, request.scale);
5402
+ const view = await controller.renderSourceView({ scale: k });
5403
+ if (!view) throw new Error("No image is loaded, so there is nothing to capture.");
5404
+ if (typeof document === "undefined") throw new Error(NO_CANVAS);
5405
+ const out = document.createElement("canvas");
5406
+ out.width = request.width;
5407
+ out.height = request.height;
5408
+ const context = out.getContext("2d");
5409
+ if (!context) throw new Error(NO_CANVAS);
5410
+ const { rect } = request;
5411
+ context.imageSmoothingEnabled = request.scale < 1;
5412
+ if (request.format === "jpeg") {
5413
+ context.fillStyle = "#ffffff";
5414
+ context.fillRect(0, 0, out.width, out.height);
5415
+ }
5416
+ const kx = view.width / state.imageDimensions.width;
5417
+ const ky = view.height / state.imageDimensions.height;
5418
+ context.drawImage(view, rect.x * kx, rect.y * ky, rect.width * kx, rect.height * ky, 0, 0, out.width, out.height);
5419
+ if (request.includeOverlays) {
5420
+ const s = request.scale;
5421
+ const selection = state.selection;
5422
+ if (_optionalChain([selection, 'optionalAccess', _80 => _80.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
5423
+ const shade = selectionShade(selection, document);
5424
+ if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
5425
+ }
5426
+ if (state.crop) {
5427
+ context.save();
5428
+ context.strokeStyle = "#ffd400";
5429
+ context.lineWidth = 2;
5430
+ context.setLineDash([6, 4]);
5431
+ context.strokeRect((state.crop.x - rect.x) * s, (state.crop.y - rect.y) * s, state.crop.width * s, state.crop.height * s);
5432
+ context.restore();
5433
+ }
5434
+ }
5435
+ const url = out.toDataURL(request.format === "jpeg" ? "image/jpeg" : "image/png", request.quality);
5436
+ if (!url.startsWith("data:image/") || url.indexOf(",") === url.length - 1) throw new Error(NO_CANVAS);
5437
+ return url;
5438
+ }
5439
+ function createImageCaptureSurface(controller) {
5440
+ const whole = () => {
5441
+ const { width, height } = controller.getState().imageDimensions;
5442
+ return width > 0 && height > 0 ? { x: 0, y: 0, width, height } : null;
5443
+ };
5444
+ return {
5445
+ units: "image pixels",
5446
+ content: whole,
5447
+ selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _81 => _81.getState, 'call', _82 => _82(), 'access', _83 => _83.selection, 'optionalAccess', _84 => _84.bounds]), () => ( null)) }),
5448
+ overlays: "a shade over unselected pixels and the crop box outline",
5449
+ maxScale: 8,
5450
+ render: (request) => renderImageRegion(controller, request)
5451
+ };
5452
+ }
5453
+
5360
5454
  // src/image-editor/edit-tools.ts
5361
5455
  var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
5362
5456
  var WRITE = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
@@ -5835,6 +5929,7 @@ function createImageEditorToolProvider(controller, options = {}) {
5835
5929
  setAdjustments,
5836
5930
  addLayer,
5837
5931
  renderPreview,
5932
+ _chunkVJUVNERTcjs.createCaptureTool.call(void 0, createImageCaptureSurface(controller), { subject: "the image (source orientation, before crop and rotation)", defaultPadding: 0 }),
5838
5933
  ...createImageSelectionTools(controller),
5839
5934
  ...createImageEditTools(controller)
5840
5935
  ]
@@ -6350,5 +6445,6 @@ function applyRegionBlur(imageData, regions, radius = 10) {
6350
6445
 
6351
6446
 
6352
6447
 
6353
- exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.BLEND_MODES = BLEND_MODES; exports.D65 = D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DIRECT_GAUSSIAN_MAX_SIGMA = DIRECT_GAUSSIAN_MAX_SIGMA; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LUMA_709 = LUMA_709; exports.MAX_KELVIN = MAX_KELVIN; exports.MIN_KELVIN = MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SelectionGesture = SelectionGesture; exports.TINT_SCALE = TINT_SCALE; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.adjustmentKindLabel = adjustmentKindLabel; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustments = applyAdjustments; exports.applyDepthMask = applyDepthMask; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyMatrix3 = applyMatrix3; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.blackWhiteGray = blackWhiteGray; exports.blendChannel = blendChannel; exports.blendImageData = blendImageData; exports.blendLum = blendLum; exports.blendPixel = blendPixel; exports.blendRgb = blendRgb; exports.borderCoverage = borderCoverage; exports.boxMean = boxMean; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = bradfordAdaptation; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.buildToneLut = buildToneLut; exports.calculateCropDrag = calculateCropDrag; exports.canvasCompositeOperation = canvasCompositeOperation; exports.canvasToImagePoint = canvasToImagePoint; exports.clampControlValue = clampControlValue; exports.clampCropToImage = clampCropToImage; exports.colorBalanceChannel = colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = combineSelections; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = computeSelectionBounds; exports.contractCoverage = contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.coverageToByte = coverageToByte; exports.createAdjustmentLayer = createAdjustmentLayer; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createSelectionMask = createSelectionMask; exports.curveLut = curveLut; exports.curveLutFromLevels = curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.decodeLayerMask = decodeLayerMask; exports.decodeSelectionRle = decodeSelectionRle; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.describeSelection = describeSelection; exports.deserializeSelection = deserializeSelection; exports.distanceTransform = distanceTransform; exports.edgeWidth = edgeWidth; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.encodeSelectionRle = encodeSelectionRle; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.expandCoverage = expandCoverage; exports.featherCoverage = featherCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayerControl = findLayerControl; exports.formatControlValue = formatControlValue; exports.fullSelection = fullSelection; exports.gaussianBlur = gaussianBlur; exports.getAnnotationBounds = getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = getCropCursor; exports.getRotatedSize = getRotatedSize; exports.getViewportMetrics = getViewportMetrics; exports.getViewportProjection = getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = greyMorphology; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.hashMaskContent = hashMaskContent; exports.hexToRgb = hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = hitTestAnnotation; exports.hitTestCrop = hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.hslToRgb = hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = hueRangeTables; exports.hueRangeWeight = hueRangeWeight; exports.hueSaturation = hueSaturation; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = imageToCanvasPoint; exports.insertCurvePoint = insertCurvePoint; exports.invertMatrix3 = invertMatrix3; exports.invertSelection = invertSelection; exports.isAdjustmentKind = isAdjustmentKind; exports.isBlendMode = isBlendMode; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.isSelectionEmpty = isSelectionEmpty; exports.isSelectionMode = isSelectionMode; exports.isSeparableBlendMode = isSeparableBlendMode; exports.kelvinToTemperature = kelvinToTemperature; exports.layerMaskCoverage = layerMaskCoverage; exports.layerMaskFromSelection = layerMaskFromSelection; exports.layerMaskKey = layerMaskKey; exports.levelsValue = levelsValue; exports.linearSrgbToXy = linearSrgbToXy; exports.linearToSrgb = linearToSrgb; exports.loadImageEditorDocument = loadImageEditorDocument; exports.magicWand = magicWand; exports.mapCropHandle = mapCropHandle; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.modifySelection = modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.mulMatrix3 = mulMatrix3; exports.neutralHueRange = neutralHueRange; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.normalizeAngle = normalizeAngle; exports.normalizeBlendMode = normalizeBlendMode; exports.normalizeLayerMask = normalizeLayerMask; exports.normalizeProcessVersion = normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.parseSelectionMode = parseSelectionMode; exports.photoFilterMatrix = photoFilterMatrix; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = posterizeValue; exports.projectImagePoint = projectImagePoint; exports.projectImageRect = projectImageRect; exports.projectMaskCoverage = projectMaskCoverage; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = rangeLightness; exports.readAdjustmentControls = readAdjustmentControls; exports.rectSelection = rectSelection; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.removeAlpha = removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.resizeSelection = resizeSelection; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = rgbToGray; exports.rgbToHsl = rgbToHsl; exports.sampleLut = sampleLut; exports.sampleToneLut = sampleToneLut; exports.selectionArea = selectionArea; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionFromPixels = selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = selectionToCoverage; exports.selectionToPixels = selectionToPixels; exports.selectionValueAt = selectionValueAt; exports.serializeSelection = serializeSelection; exports.setControlPath = setControlPath; exports.setLum = setLum; exports.shiftCoverage = shiftCoverage; exports.smoothCoverage = smoothCoverage; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = srgbToLinear; exports.tempTintToXy = tempTintToXy; exports.temperatureToKelvin = temperatureToKelvin; exports.toneCurve = toneCurve; exports.toneLuts = toneLuts; exports.toneRange = toneRange; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.updateLayerMaskProps = updateLayerMaskProps; exports.uvToXy = uvToXy; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.wbMatrix = wbMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.xyToTempTint = xyToTempTint; exports.xyToUv = xyToUv;
6448
+
6449
+ exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.BLEND_MODES = BLEND_MODES; exports.D65 = D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DIRECT_GAUSSIAN_MAX_SIGMA = DIRECT_GAUSSIAN_MAX_SIGMA; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LUMA_709 = LUMA_709; exports.MAX_KELVIN = MAX_KELVIN; exports.MIN_KELVIN = MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SelectionGesture = SelectionGesture; exports.TINT_SCALE = TINT_SCALE; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.adjustmentKindLabel = adjustmentKindLabel; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustments = applyAdjustments; exports.applyDepthMask = applyDepthMask; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyMatrix3 = applyMatrix3; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.blackWhiteGray = blackWhiteGray; exports.blendChannel = blendChannel; exports.blendImageData = blendImageData; exports.blendLum = blendLum; exports.blendPixel = blendPixel; exports.blendRgb = blendRgb; exports.borderCoverage = borderCoverage; exports.boxMean = boxMean; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = bradfordAdaptation; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.buildToneLut = buildToneLut; exports.calculateCropDrag = calculateCropDrag; exports.canvasCompositeOperation = canvasCompositeOperation; exports.canvasToImagePoint = canvasToImagePoint; exports.clampControlValue = clampControlValue; exports.clampCropToImage = clampCropToImage; exports.colorBalanceChannel = colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = combineSelections; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = computeSelectionBounds; exports.contractCoverage = contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.coverageToByte = coverageToByte; exports.createAdjustmentLayer = createAdjustmentLayer; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createSelectionMask = createSelectionMask; exports.curveLut = curveLut; exports.curveLutFromLevels = curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.decodeLayerMask = decodeLayerMask; exports.decodeSelectionRle = decodeSelectionRle; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.describeSelection = describeSelection; exports.deserializeSelection = deserializeSelection; exports.distanceTransform = distanceTransform; exports.edgeWidth = edgeWidth; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.encodeSelectionRle = encodeSelectionRle; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.expandCoverage = expandCoverage; exports.featherCoverage = featherCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayerControl = findLayerControl; exports.formatControlValue = formatControlValue; exports.fullSelection = fullSelection; exports.gaussianBlur = gaussianBlur; exports.getAnnotationBounds = getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = getCropCursor; exports.getRotatedSize = getRotatedSize; exports.getViewportMetrics = getViewportMetrics; exports.getViewportProjection = getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = greyMorphology; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.hashMaskContent = hashMaskContent; exports.hexToRgb = hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = hitTestAnnotation; exports.hitTestCrop = hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.hslToRgb = hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = hueRangeTables; exports.hueRangeWeight = hueRangeWeight; exports.hueSaturation = hueSaturation; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = imageToCanvasPoint; exports.insertCurvePoint = insertCurvePoint; exports.invertMatrix3 = invertMatrix3; exports.invertSelection = invertSelection; exports.isAdjustmentKind = isAdjustmentKind; exports.isBlendMode = isBlendMode; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.isSelectionEmpty = isSelectionEmpty; exports.isSelectionMode = isSelectionMode; exports.isSeparableBlendMode = isSeparableBlendMode; exports.kelvinToTemperature = kelvinToTemperature; exports.layerMaskCoverage = layerMaskCoverage; exports.layerMaskFromSelection = layerMaskFromSelection; exports.layerMaskKey = layerMaskKey; exports.levelsValue = levelsValue; exports.linearSrgbToXy = linearSrgbToXy; exports.linearToSrgb = linearToSrgb; exports.loadImageEditorDocument = loadImageEditorDocument; exports.magicWand = magicWand; exports.mapCropHandle = mapCropHandle; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.modifySelection = modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.mulMatrix3 = mulMatrix3; exports.neutralHueRange = neutralHueRange; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.normalizeAngle = normalizeAngle; exports.normalizeBlendMode = normalizeBlendMode; exports.normalizeLayerMask = normalizeLayerMask; exports.normalizeProcessVersion = normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.parseSelectionMode = parseSelectionMode; exports.photoFilterMatrix = photoFilterMatrix; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = posterizeValue; exports.projectImagePoint = projectImagePoint; exports.projectImageRect = projectImageRect; exports.projectMaskCoverage = projectMaskCoverage; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = rangeLightness; exports.readAdjustmentControls = readAdjustmentControls; exports.rectSelection = rectSelection; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.removeAlpha = removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.resizeSelection = resizeSelection; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = rgbToGray; exports.rgbToHsl = rgbToHsl; exports.sampleLut = sampleLut; exports.sampleToneLut = sampleToneLut; exports.selectionArea = selectionArea; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionFromPixels = selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = selectionToCoverage; exports.selectionToPixels = selectionToPixels; exports.selectionValueAt = selectionValueAt; exports.serializeSelection = serializeSelection; exports.setControlPath = setControlPath; exports.setLum = setLum; exports.shiftCoverage = shiftCoverage; exports.smoothCoverage = smoothCoverage; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = srgbToLinear; exports.tempTintToXy = tempTintToXy; exports.temperatureToKelvin = temperatureToKelvin; exports.toneCurve = toneCurve; exports.toneLuts = toneLuts; exports.toneRange = toneRange; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.updateLayerMaskProps = updateLayerMaskProps; exports.uvToXy = uvToXy; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.wbMatrix = wbMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.xyToTempTint = xyToTempTint; exports.xyToUv = xyToUv;
6354
6450
  //# sourceMappingURL=index.cjs.map