@bubblydoo/photoshop-mcp 0.0.2

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 (88) hide show
  1. package/README.md +138 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +7049 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist-readmes/README.md +383 -0
  6. package/dist-runtime/runtime-code.cjs +17124 -0
  7. package/dist-runtime/runtime-code.d.cts +9 -0
  8. package/dist-schemas/@adobe-uxp-types/photoshop/src/index.d.ts +16 -0
  9. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/all-types.d.ts +65 -0
  10. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Actions.d.ts +230 -0
  11. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Channel.d.ts +120 -0
  12. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ColorSampler.d.ts +105 -0
  13. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Constants.d.ts +1648 -0
  14. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CoreModules.d.ts +922 -0
  15. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CountItem.d.ts +86 -0
  16. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Document.d.ts +931 -0
  17. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Guide.d.ts +105 -0
  18. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/HistoryState.d.ts +74 -0
  19. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ImagingModule.d.ts +559 -0
  20. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Layer.d.ts +1073 -0
  21. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/LayerComp.d.ts +219 -0
  22. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Objects.d.ts +7 -0
  23. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathItem.d.ts +243 -0
  24. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathPoint.d.ts +78 -0
  25. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Photoshop.d.ts +317 -0
  26. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Selection.d.ts +557 -0
  27. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/SubPathItem.d.ts +69 -0
  28. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/TextItem.d.ts +213 -0
  29. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Channels.d.ts +81 -0
  30. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/ColorSamplers.d.ts +97 -0
  31. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/CountItems.d.ts +130 -0
  32. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Documents.d.ts +95 -0
  33. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Guides.d.ts +76 -0
  34. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/HistoryStates.d.ts +56 -0
  35. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/LayerComps.d.ts +92 -0
  36. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Layers.d.ts +68 -0
  37. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathItems.d.ts +65 -0
  38. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathPoints.d.ts +50 -0
  39. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/SubPathItems.d.ts +50 -0
  40. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/TextFonts.d.ts +43 -0
  41. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Colors.d.ts +225 -0
  42. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ConversionOptions.d.ts +213 -0
  43. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ImagingBounds.d.ts +53 -0
  44. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/PathPointInfo.d.ts +84 -0
  45. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SaveOptions.d.ts +376 -0
  46. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SolidColor.d.ts +118 -0
  47. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SubPathInfo.d.ts +47 -0
  48. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/TextFont.d.ts +49 -0
  49. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Tool.d.ts +23 -0
  50. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/Preferences.d.ts +121 -0
  51. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesBase.d.ts +9 -0
  52. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesCursors.d.ts +37 -0
  53. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesFileHandling.d.ts +58 -0
  54. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGeneral.d.ts +77 -0
  55. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGuidesGridsAndSlices.d.ts +51 -0
  56. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesHistory.d.ts +69 -0
  57. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesInterface.d.ts +46 -0
  58. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesPerformance.d.ts +42 -0
  59. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTools.d.ts +44 -0
  60. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTransparencyAndGamut.d.ts +38 -0
  61. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesType.d.ts +44 -0
  62. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesUnitsAndRulers.d.ts +44 -0
  63. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/CharacterStyle.d.ts +254 -0
  64. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/ParagraphStyle.d.ts +114 -0
  65. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/TextWarpStyle.d.ts +48 -0
  66. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/ApplyImageTypes.d.ts +107 -0
  67. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/CalculationsTypes.d.ts +119 -0
  68. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/DocumentTypes.d.ts +80 -0
  69. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerCompTypes.d.ts +91 -0
  70. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerTypes.d.ts +153 -0
  71. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/SharedTypes.d.ts +6 -0
  72. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/TextTypes.d.ts +218 -0
  73. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/colorTypes.d.ts +61 -0
  74. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/unit.d.ts +45 -0
  75. package/dist-schemas/@adobe-uxp-types/uxp/src/index.d.ts +21 -0
  76. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/all-types.d.ts +3 -0
  77. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/dialog.d.ts +26 -0
  78. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/entrypoints.d.ts +385 -0
  79. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/host.d.ts +28 -0
  80. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/os.d.ts +56 -0
  81. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/other.d.ts +7 -0
  82. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/shell.d.ts +54 -0
  83. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/storage.d.ts +1216 -0
  84. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/versions.d.ts +18 -0
  85. package/dist-schemas/@bubblydoo/uxp-toolkit/dist/commands-library/index.d.ts +109 -0
  86. package/dist-schemas/@bubblydoo/uxp-toolkit/dist/index.d.ts +153 -0
  87. package/dist-schemas/@bubblydoo/uxp-toolkit/dist/psLayerRef-BJKcxKbm.d.ts +66 -0
  88. package/package.json +51 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Version information. To get an instance: require("uxp").versions.
3
+ * @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Versions/Versions/
4
+ */
5
+ interface Versions {
6
+ /**
7
+ * Returns the version of UXP.
8
+ * For example, uxp-6.0.0.
9
+ */
10
+ uxp: string;
11
+ /**
12
+ * Returns the version of the plugin.
13
+ * This matches the version as specified in your plugin's manifest.
14
+ */
15
+ plugin: string;
16
+ }
17
+
18
+ export const versions: Versions;
@@ -0,0 +1,109 @@
1
+ import { P as PsLayerRef, a as UTCommandModifying, b as UTCommandNonModifying } from '../psLayerRef-BJKcxKbm.js';
2
+ export { i as createMultiGetDocumentCommand } from '../psLayerRef-BJKcxKbm.js';
3
+ import 'photoshop';
4
+ import 'zod';
5
+
6
+ declare function createAddLayerToSelectionCommand(layerRef: PsLayerRef, previousLayerRef: PsLayerRef): UTCommandModifying<unknown>;
7
+
8
+ declare function createSelectLayerMaskCommand(layerId: number): UTCommandModifying<unknown>;
9
+ declare function createDeleteChannelAndApplyCommand(): UTCommandModifying<unknown>;
10
+
11
+ declare function createConvertModeCommand(depth: 8 | 16): UTCommandModifying<unknown>;
12
+
13
+ declare function createColorLookupAdjustmentLayerCommand(): UTCommandModifying<unknown>;
14
+
15
+ declare function createExpandFolderCommand(layerRef: PsLayerRef): UTCommandModifying<unknown>;
16
+
17
+ type LUTExportFormat = 'CUBE' | 'ICC' | '3DL' | 'CSP';
18
+ interface ExportLUTsOptions {
19
+ description?: string;
20
+ gridPoints?: number;
21
+ copyright?: string;
22
+ exportFormats?: LUTExportFormat[];
23
+ lowercaseExtension?: boolean;
24
+ }
25
+ declare function createExportLUTsCommand(path: string, options?: ExportLUTsOptions): UTCommandModifying<unknown>;
26
+
27
+ declare function createGetDocumentCommand(documentId: number): UTCommandNonModifying<{
28
+ title: string;
29
+ documentID: number;
30
+ visible: boolean;
31
+ hasBackgroundLayer: boolean;
32
+ }>;
33
+ declare function createGetDocumentHasBackgroundLayerCommand(documentId: number): UTCommandNonModifying<{
34
+ hasBackgroundLayer: boolean;
35
+ }>;
36
+
37
+ declare function createGetLayerCommand(layerRef: PsLayerRef): UTCommandNonModifying<{
38
+ name: string;
39
+ visible: boolean;
40
+ group: boolean;
41
+ layerSection: {
42
+ _value: "layerSectionStart" | "layerSectionEnd" | "layerSectionContent";
43
+ _enum: "layerSectionType";
44
+ };
45
+ layerKind: number;
46
+ itemIndex: number;
47
+ background: boolean;
48
+ mode: {
49
+ _enum: "blendMode";
50
+ _value: string;
51
+ };
52
+ layerID: number;
53
+ layerEffects?: Record<string, {
54
+ enabled?: boolean | undefined;
55
+ } | {
56
+ enabled: boolean;
57
+ }[]> | undefined;
58
+ }>;
59
+ declare function createGetBackgroundLayerCommand(docId: number): UTCommandNonModifying<{
60
+ name: string;
61
+ visible: boolean;
62
+ group: boolean;
63
+ layerSection: {
64
+ _value: "layerSectionStart" | "layerSectionEnd" | "layerSectionContent";
65
+ _enum: "layerSectionType";
66
+ };
67
+ layerKind: number;
68
+ itemIndex: number;
69
+ background: boolean;
70
+ mode: {
71
+ _enum: "blendMode";
72
+ _value: string;
73
+ };
74
+ layerID: number;
75
+ layerEffects?: Record<string, {
76
+ enabled?: boolean | undefined;
77
+ } | {
78
+ enabled: boolean;
79
+ }[]> | undefined;
80
+ }>;
81
+
82
+ declare function createHasVectorMaskCommand(layerId: number): UTCommandNonModifying<{
83
+ hasVectorMask: boolean;
84
+ }>;
85
+
86
+ declare function createLoadLayerMaskAsSelectionCommand(layerId: number): UTCommandModifying<unknown>;
87
+
88
+ declare function createRasterizeLayerStyleCommand(psLayerRef: PsLayerRef): UTCommandModifying<unknown>;
89
+
90
+ declare function createRasterizeVectorMaskCommand(): UTCommandModifying<unknown>;
91
+
92
+ declare function createDeleteChannelCommand(): UTCommandModifying<unknown>;
93
+
94
+ declare function createRenameLayerCommand(layerRef: PsLayerRef, newName: string): UTCommandModifying<unknown>;
95
+
96
+ declare function createRenderGridCommand(gridPoints: number): UTCommandModifying<unknown>;
97
+
98
+ declare function createSelectLayerCommand(layerRef: PsLayerRef): UTCommandModifying<unknown>;
99
+
100
+ type LUTFormatType = 'LUTFormatCUBE' | 'LUTFormat3DL' | 'LUTFormatCSP';
101
+ interface Set3DLUTColorLookupOptions {
102
+ lutPath: string;
103
+ lutFormat?: LUTFormatType;
104
+ profileBase64?: string;
105
+ lutFileDataBase64?: string;
106
+ }
107
+ declare function createSet3DLUTColorLookupCommand(options: Set3DLUTColorLookupOptions): UTCommandModifying<unknown>;
108
+
109
+ export { type ExportLUTsOptions, type LUTExportFormat, type LUTFormatType, type Set3DLUTColorLookupOptions, createAddLayerToSelectionCommand, createColorLookupAdjustmentLayerCommand, createConvertModeCommand, createDeleteChannelAndApplyCommand, createDeleteChannelCommand, createExpandFolderCommand, createExportLUTsCommand, createGetBackgroundLayerCommand, createGetDocumentCommand, createGetDocumentHasBackgroundLayerCommand, createGetLayerCommand, createHasVectorMaskCommand, createLoadLayerMaskAsSelectionCommand, createRasterizeLayerStyleCommand, createRasterizeVectorMaskCommand, createRenameLayerCommand, createRenderGridCommand, createSelectLayerCommand, createSelectLayerMaskCommand, createSet3DLUTColorLookupCommand };
@@ -0,0 +1,153 @@
1
+ import { c as createModifyingBatchPlayContext, P as PsLayerRef } from './psLayerRef-BJKcxKbm.js';
2
+ export { U as UTCommandBase, a as UTCommandModifying, b as UTCommandNonModifying, d as UTCommandResult, e as batchPlay, f as batchPlayCommand, g as batchPlayCommands, h as createCommand, i as createMultiGetDocumentCommand } from './psLayerRef-BJKcxKbm.js';
3
+ import * as photoshop from 'photoshop';
4
+ import { ExecutionContext, ExecuteAsModalOptions, Document, Layer } from 'photoshop';
5
+ import ErrorStackParser from 'error-stack-parser';
6
+ import { Entry, File, Folder } from 'uxp';
7
+ import { z } from 'zod';
8
+
9
+ type ExtendedExecutionContext = Omit<ExecutionContext, 'onCancel'> & ReturnType<typeof createModifyingBatchPlayContext> & {
10
+ signal: AbortSignal;
11
+ };
12
+ type OptionsWithoutCommandName = Omit<ExecuteAsModalOptions, 'commandName'>;
13
+ declare function executeAsModal<T>(commandName: string, fn: (executionContext: ExtendedExecutionContext) => Promise<T>, opts?: OptionsWithoutCommandName): Promise<T>;
14
+
15
+ interface SuspendHistoryContext {
16
+ }
17
+ declare function suspendHistory<T>(document: Document, historyStateName: string, fn: (context: SuspendHistoryContext) => Promise<T>): Promise<T>;
18
+
19
+ type CombinedFn<T> = (executionContext: ExtendedExecutionContext, suspendHistoryContext: SuspendHistoryContext) => Promise<T>;
20
+ declare function executeAsModalAndSuspendHistory<T>(commandName: string, document: Document, fn: CombinedFn<T>): Promise<T>;
21
+
22
+ declare function getFlattenedDomLayersList(layers: Layer[]): Layer[];
23
+
24
+ type Tree<TRef = unknown> = {
25
+ ref: TRef;
26
+ name: string;
27
+ children?: Tree<TRef>;
28
+ }[];
29
+
30
+ declare function photoshopDomLayersToTree(layers: Layer[]): Tree<Layer>;
31
+
32
+ type BasicStackFrame = Pick<ErrorStackParser.StackFrame, 'functionName' | 'fileName' | 'lineNumber' | 'columnNumber'>;
33
+ declare function parseUxpErrorSourcemaps(error: Error, opts?: {
34
+ unsourcemappedHeaderLines?: number;
35
+ }): Promise<BasicStackFrame[]>;
36
+ declare function getBasicStackFrameAbsoluteFilePath(frame: BasicStackFrame): Promise<string>;
37
+
38
+ declare function isFile(entry: Entry): entry is File;
39
+ declare function isFolder(entry: Entry): entry is Folder;
40
+
41
+ declare function openFileByPath(path: string): Promise<photoshop.Document>;
42
+
43
+ declare function flattenTree<T>(tree: Tree<T>): Tree<T>[0][];
44
+
45
+ interface LayerRef {
46
+ id: number;
47
+ docId: number;
48
+ }
49
+
50
+ declare function mapTree<TRef, TMappedRef>(tree: Tree<TRef>, mapFn: (node: TRef) => TMappedRef): Tree<TMappedRef>;
51
+
52
+ declare function mapTreeRef<TRef, TMappedRef>(tree: Tree<TRef>, mapFn: (node: TRef) => TMappedRef): Tree<TMappedRef>;
53
+
54
+ declare function photoshopGetApplicationInfo(): Promise<{
55
+ active: boolean;
56
+ autoShowHomeScreen: boolean;
57
+ available: number;
58
+ buildNumber: string;
59
+ documentArea: {
60
+ left: number;
61
+ top: number;
62
+ right: number;
63
+ bottom: number;
64
+ };
65
+ hostName: string;
66
+ hostVersion: {
67
+ versionMajor: number;
68
+ versionMinor: number;
69
+ versionFix: number;
70
+ };
71
+ localeInfo: {
72
+ decimalPoint: string;
73
+ };
74
+ osVersion: string;
75
+ panelList: {
76
+ ID: string;
77
+ name: string;
78
+ obscured: boolean;
79
+ visible: boolean;
80
+ }[];
81
+ }>;
82
+
83
+ declare function copyToClipboard(text: string): Promise<void>;
84
+ declare function readFromClipboard(): Promise<string>;
85
+
86
+ declare const uxpEntrypointsSchema: z.ZodObject<{
87
+ _pluginInfo: z.ZodObject<{
88
+ id: z.ZodString;
89
+ name: z.ZodString;
90
+ version: z.ZodString;
91
+ }, z.core.$strip>;
92
+ }, z.core.$strip>;
93
+
94
+ declare function getDocumentLayerDescriptors(documentId: number): Promise<{
95
+ docId: number;
96
+ name: string;
97
+ layerID: number;
98
+ visible: boolean;
99
+ group: boolean;
100
+ layerSection: {
101
+ _value: "layerSectionStart" | "layerSectionEnd" | "layerSectionContent";
102
+ _enum: "layerSectionType";
103
+ };
104
+ layerKind: number;
105
+ itemIndex: number;
106
+ background: boolean;
107
+ mode: {
108
+ _enum: "blendMode";
109
+ _value: string;
110
+ };
111
+ layerEffects?: Record<string, {
112
+ enabled?: boolean | undefined;
113
+ } | {
114
+ enabled: boolean;
115
+ }[]> | undefined;
116
+ }[]>;
117
+ type LayerDescriptor = Awaited<ReturnType<typeof getDocumentLayerDescriptors>>[number];
118
+
119
+ declare function getLayerEffects(layerRef: PsLayerRef): Promise<Record<string, boolean>>;
120
+
121
+ type UTLayerKind = 'pixel' | 'adjustment-layer' | 'text' | 'curves' | 'smartObject' | 'video' | 'group' | 'threeD' | 'gradientFill' | 'pattern' | 'solidColor' | 'background';
122
+ type UTBlendMode = 'normal' | 'dissolve' | 'darken' | 'multiply' | 'colorBurn' | 'linearBurn' | 'darkerColor' | 'lighten' | 'screen' | 'colorDodge' | 'linearDodge' | 'lighterColor' | 'overlay' | 'softLight' | 'hardLight' | 'vividLight' | 'linearLight' | 'pinLight' | 'hardMix' | 'difference' | 'exclusion' | 'blendSubtraction' | 'blendDivide' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'passThrough';
123
+ interface UTLayerBuilder {
124
+ name: string;
125
+ docId: number;
126
+ id: number;
127
+ visible: boolean;
128
+ kind: UTLayerKind;
129
+ blendMode: UTBlendMode;
130
+ effects: Record<string, boolean>;
131
+ isClippingMask: boolean;
132
+ background: boolean;
133
+ layers?: UTLayerBuilder[];
134
+ }
135
+ type UTLayer = Readonly<Omit<UTLayerBuilder, 'layers'>> & {
136
+ layers?: UTLayer[];
137
+ };
138
+ declare function photoshopLayerDescriptorsToUTLayers(layers: LayerDescriptor[]): UTLayer[];
139
+
140
+ type UTLayerPickKeys<TKey extends keyof Omit<UTLayer, 'layers'>> = Pick<Omit<UTLayer, 'layers'>, TKey> & {
141
+ layers?: UTLayerPickKeys<TKey>[];
142
+ };
143
+
144
+ type MinimalUTLayer = UTLayerPickKeys<'effects' | 'visible' | 'isClippingMask' | 'kind' | 'blendMode' | 'name'>;
145
+ declare function utLayersToText(tree: MinimalUTLayer[], depth?: number): string;
146
+
147
+ type UTLayerWithoutChildren = Omit<UTLayer, 'layers'>;
148
+ declare function utLayersToTree(layer: UTLayer[]): Tree<UTLayerWithoutChildren>;
149
+
150
+ declare function utLayerToDomLayer(layer: UTLayer): Layer;
151
+ declare function utLayersToDomLayers(layers: UTLayer[]): Layer[];
152
+
153
+ export { type BasicStackFrame, type ExtendedExecutionContext, type LayerDescriptor, type LayerRef, PsLayerRef, type SuspendHistoryContext, type Tree, type UTLayer, type UTLayerPickKeys, type UTLayerWithoutChildren, copyToClipboard, createModifyingBatchPlayContext, executeAsModal, executeAsModalAndSuspendHistory, flattenTree, getBasicStackFrameAbsoluteFilePath, getDocumentLayerDescriptors, getFlattenedDomLayersList, getLayerEffects, isFile, isFolder, mapTree, mapTreeRef, openFileByPath, parseUxpErrorSourcemaps, photoshopDomLayersToTree, photoshopGetApplicationInfo, photoshopLayerDescriptorsToUTLayers, readFromClipboard, suspendHistory, utLayerToDomLayer, utLayersToDomLayers, utLayersToText, utLayersToTree, uxpEntrypointsSchema };
@@ -0,0 +1,66 @@
1
+ import * as photoshop from 'photoshop';
2
+ import { action, ActionDescriptor } from 'photoshop';
3
+ import { z } from 'zod';
4
+
5
+ declare function createMultiGetDocumentCommand(docId: number): UTCommandNonModifying<{
6
+ list: {
7
+ name: string;
8
+ layerID: number;
9
+ visible: boolean;
10
+ group: boolean;
11
+ layerSection: {
12
+ _value: "layerSectionStart" | "layerSectionEnd" | "layerSectionContent";
13
+ _enum: "layerSectionType";
14
+ };
15
+ layerKind: number;
16
+ itemIndex: number;
17
+ background: boolean;
18
+ mode: {
19
+ _enum: "blendMode";
20
+ _value: string;
21
+ };
22
+ layerEffects?: Record<string, {
23
+ enabled?: boolean | undefined;
24
+ } | {
25
+ enabled: boolean;
26
+ }[]> | undefined;
27
+ }[];
28
+ }>;
29
+
30
+ type P = Parameters<typeof action.batchPlay>;
31
+ declare function batchPlay(actions: P[0], options?: P[1]): Promise<photoshop.ActionDescriptor[]>;
32
+
33
+ interface UTCommandBase<T> {
34
+ descriptor: ActionDescriptor;
35
+ schema: z.ZodSchema<T>;
36
+ }
37
+ interface UTCommandModifying<T> extends UTCommandBase<T> {
38
+ modifying: true;
39
+ }
40
+ interface UTCommandNonModifying<T> extends UTCommandBase<T> {
41
+ modifying: false;
42
+ }
43
+ declare function createCommand<TReturn, TModifying extends boolean>(obj: {
44
+ descriptor: ActionDescriptor;
45
+ schema: z.ZodSchema<TReturn>;
46
+ modifying: TModifying;
47
+ }): TModifying extends true ? UTCommandModifying<TReturn> : UTCommandNonModifying<TReturn>;
48
+ type UTCommandResult<C> = C extends UTCommandBase<infer T> ? T : never;
49
+ type BatchPlayOptions = Parameters<typeof batchPlay>[1];
50
+ declare function batchPlayCommandBase<T>(command: UTCommandBase<T>, options?: BatchPlayOptions): Promise<T>;
51
+ declare function batchPlayCommandsBase<TCommands extends Array<UTCommandBase<any>>>(commands: readonly [...TCommands], options?: BatchPlayOptions): Promise<{
52
+ [K in keyof TCommands]: UTCommandResult<TCommands[K]>;
53
+ }>;
54
+ declare function batchPlayCommand<T>(command: UTCommandNonModifying<T>, options?: BatchPlayOptions): Promise<T>;
55
+ declare function batchPlayCommands<TCommands extends Array<UTCommandNonModifying<any>>>(commands: readonly [...TCommands], options?: BatchPlayOptions): Promise<{ [K in keyof TCommands]: UTCommandResult<TCommands[K]>; }>;
56
+ declare function createModifyingBatchPlayContext(): {
57
+ batchPlayCommand: typeof batchPlayCommandBase;
58
+ batchPlayCommands: typeof batchPlayCommandsBase;
59
+ };
60
+
61
+ interface PsLayerRef {
62
+ id: number;
63
+ docId: number;
64
+ }
65
+
66
+ export { type PsLayerRef as P, type UTCommandBase as U, type UTCommandModifying as a, type UTCommandNonModifying as b, createModifyingBatchPlayContext as c, type UTCommandResult as d, batchPlay as e, batchPlayCommand as f, batchPlayCommands as g, createCommand as h, createMultiGetDocumentCommand as i };
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@bubblydoo/photoshop-mcp",
3
+ "type": "module",
4
+ "version": "0.0.2",
5
+ "description": "MCP server for Photoshop automation via Chrome DevTools Protocol",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ },
11
+ "./package.json": "./package.json"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "bin": {
17
+ "photoshop-mcp": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "dist-readmes",
22
+ "dist-runtime",
23
+ "dist-schemas"
24
+ ],
25
+ "dependencies": {
26
+ "@hono/mcp": "^0.2.3",
27
+ "@hono/node-server": "^1.19.9",
28
+ "@modelcontextprotocol/sdk": "^1.25.3",
29
+ "chrome-remote-interface": "^0.33.3",
30
+ "esbuild": "^0.27.0",
31
+ "hono": "^4.11.7",
32
+ "zod": "^3.25.0",
33
+ "@bubblydoo/uxp-cli-common": "0.0.2"
34
+ },
35
+ "devDependencies": {
36
+ "@types/chrome-remote-interface": "^0.33.0",
37
+ "@types/node": "^20.8.7",
38
+ "glob": "^13.0.0",
39
+ "tsup": "^8.3.5",
40
+ "tsx": "^4.21.0",
41
+ "typescript": "^5.8.3",
42
+ "@adobe-uxp-types/photoshop": "0.1.3",
43
+ "@adobe-uxp-types/uxp": "0.1.1",
44
+ "@bubblydoo/tsconfig": "0.0.3",
45
+ "@bubblydoo/uxp-toolkit": "0.0.11"
46
+ },
47
+ "scripts": {
48
+ "build": "tsup && tsup --config tsup-runtime.config.ts && tsx collect-schemas.ts && tsx collect-readmes.ts",
49
+ "dev": "tsx watch src/index.ts"
50
+ }
51
+ }