editmamei 0.20.0 → 0.22.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 (65) hide show
  1. package/NOTICES.md +17 -1
  2. package/README.md +8 -7
  3. package/dist/api/extendscript/_helpers.js +1 -1
  4. package/dist/bin/editmamei-core-darwin-arm64 +0 -0
  5. package/dist/bin/editmamei-core-darwin-x64 +0 -0
  6. package/dist/bin/editmamei-core-win-x64.exe +0 -0
  7. package/dist/cli/config.js +3 -3
  8. package/dist/cli/install.js +2 -2
  9. package/dist/core/server.js +7 -7
  10. package/dist/core/settings.js +2 -2
  11. package/dist/core/tool-groups.js +91 -82
  12. package/dist/core/tool-tiers.js +91 -82
  13. package/dist/detection/landmark-detection-client.js +8 -0
  14. package/dist/detection/mesh-eye-correction.js +126 -0
  15. package/dist/detection/sam-segmenter.js +83 -0
  16. package/dist/index.js +2 -0
  17. package/dist/license/entitlement.js +52 -0
  18. package/dist/modules/ce/index.js +4 -4
  19. package/dist/perception/grounding-anchors.js +37 -0
  20. package/dist/perception/grounding-corners.js +93 -0
  21. package/dist/perception/grounding-edge-trace.js +90 -0
  22. package/dist/perception/grounding-extrema.js +41 -0
  23. package/dist/perception/grounding-gate.js +154 -0
  24. package/dist/perception/grounding-geometry.js +132 -0
  25. package/dist/perception/grounding-grid.js +34 -0
  26. package/dist/perception/grounding-landmarks.js +40 -0
  27. package/dist/perception/grounding-locate.js +341 -0
  28. package/dist/perception/grounding-resolver.js +202 -0
  29. package/dist/perception/grounding-review-crop.js +85 -0
  30. package/dist/perception/grounding-warp.js +182 -0
  31. package/dist/perception/sky-mask-transfer.js +50 -18
  32. package/dist/skills/editmamei-skill.zip +0 -0
  33. package/dist/tools/adjustment-tools.js +3 -3
  34. package/dist/tools/brush-tools.js +111 -23
  35. package/dist/tools/channel-compose-tools.js +241 -0
  36. package/dist/tools/detection-tools.js +1 -1
  37. package/dist/tools/diagnostics-tools.js +1 -1
  38. package/dist/tools/document-tools.js +6 -6
  39. package/dist/tools/filter-tools.js +476 -19
  40. package/dist/tools/group-tools.js +10 -10
  41. package/dist/tools/guide-tools.js +4 -4
  42. package/dist/tools/history-tools.js +4 -4
  43. package/dist/tools/image-placement-tools.js +1 -1
  44. package/dist/tools/image-tools.js +62 -19
  45. package/dist/tools/inspect-tools.js +2 -2
  46. package/dist/tools/layer-ordering-tools.js +1 -1
  47. package/dist/tools/layer-properties-tools.js +42 -23
  48. package/dist/tools/layer-tools.js +10 -10
  49. package/dist/tools/layer-transform-tools.js +80 -41
  50. package/dist/tools/overview-tools.js +42 -42
  51. package/dist/tools/path-tools.js +53 -10
  52. package/dist/tools/portrait-tools.js +3 -3
  53. package/dist/tools/preview-tools.js +7 -82
  54. package/dist/tools/retouch-tools.js +93 -25
  55. package/dist/tools/scene-tools.js +13 -13
  56. package/dist/tools/selection-tools.js +319 -40
  57. package/dist/tools/shape-tools.js +216 -0
  58. package/dist/tools/text-tools.js +1 -1
  59. package/dist/tools/transform-canvas-tools.js +2 -2
  60. package/dist/tools/vector-mask-tools.js +23 -8
  61. package/dist/version.js +1 -1
  62. package/package.json +1 -1
  63. package/dist/preview/coordinate-grid.js +0 -250
  64. package/dist/tools/object-tools.js +0 -193
  65. package/dist/tools/text-on-object-tools.js +0 -225
package/NOTICES.md CHANGED
@@ -83,10 +83,26 @@ above.
83
83
  diligence). Any upstream `NOTICE`/attribution terms (Apache-2.0 §4(d)) are
84
84
  preserved by reference to those sources.
85
85
  - Runs on-device via the same `onnxruntime-web` backend; the image never leaves the
86
- machine. Used by the Pro `photoshop_detect_landmarks` tool to locate the 468-point
86
+ machine. Used by the Pro `ps_detect_landmarks` tool to locate the 468-point
87
87
  face mesh (eyes, brows, lips, nose, jaw). Ships in the **Pro module**
88
88
  (`models/pro/`), not the CE tarball.
89
89
 
90
+ ### MobileSAM (`models/pro/mobile_sam_{encoder,decoder}.onnx`) — promptable segmentation (Pro)
91
+
92
+ - **Upstream:** MobileSAM ("Faster Segment Anything: Towards Lightweight SAM for
93
+ Mobile Applications", Zhang et al.; `ChaoningZhang/MobileSAM`) — a distilled
94
+ TinyViT image encoder paired with the Segment Anything prompt-mask decoder,
95
+ exported to ONNX (encoder + decoder). Redistributed here as an **FP16** build
96
+ converted from the FP32 ONNX export (halves the download; INT8 dynamic
97
+ quantization was evaluated and rejected — it collapsed the encoder to
98
+ whole-frame masks).
99
+ - **License:** Apache-2.0. Any upstream `NOTICE`/attribution terms (Apache-2.0
100
+ §4(d)) are preserved by reference to that source.
101
+ - Runs on-device via the same `onnxruntime-web` backend; the image never leaves the
102
+ machine. Used by the Pro `ps_select_object` tool to turn a box/point prompt into a
103
+ pixel-accurate organic selection. Ships in the **Pro module** (`models/pro/`), not
104
+ the CE tarball.
105
+
90
106
  ---
91
107
 
92
108
  ## Trademarks
package/README.md CHANGED
@@ -52,7 +52,7 @@ Prefer not to use a terminal? Claude Desktop users can install the one-click `.m
52
52
 
53
53
  ## A session, end to end
54
54
 
55
- The discovery chain is `photoshop_ping` (liveness), then `photoshop_overview` (the working method and capability map), then `tools/list` (the full schema-typed inventory). After that you just talk to your assistant:
55
+ The discovery chain is `ps_ping` (liveness), then `ps_overview` (the working method and capability map), then `tools/list` (the full schema-typed inventory). After that you just talk to your assistant:
56
56
 
57
57
  > _"Open my vacation photo."_
58
58
  > _"Make the sky more dramatic but keep the foreground natural."_
@@ -67,7 +67,7 @@ Your assistant composes those into tool calls, checks the result with previews a
67
67
  These are the choices that shape the surface, and the reason an AI assistant can drive it reliably rather than hopefully.
68
68
 
69
69
  - **Structured results, not prose.** Every tool declares an `outputSchema` and returns a typed JSON payload. Any tool that changes what is active reports the current document and layer back, so the model keeps an accurate picture of Photoshop's state between calls instead of re-deriving it.
70
- - **Guidance lives in the surface.** `photoshop_overview` returns the working method (assess, plan, enact, check, iterate) and `photoshop_list_capabilities` returns a live map of what exists. The model orients itself from the server rather than from guesswork or a stale prompt.
70
+ - **Guidance lives in the surface.** `ps_overview` returns the working method (assess, plan, enact, check, iterate) and `ps_list_capabilities` returns a live map of what exists. The model orients itself from the server rather than from guesswork or a stale prompt.
71
71
  - **Measure, don't eyeball.** A dedicated set of verification tools (histogram, region compare, layer-bounds diff, selection preview) lets the model check its own work numerically instead of trusting a thumbnail.
72
72
  - **On-device perception.** Local computer vision (ONNX) detects faces, objects, and scene regions and returns real document coordinates. The image stays on your machine for this step and is never sent to a cloud vision model.
73
73
  - **Non-destructive by default.** Adjustments are adjustment layers, and destructive pixel operations run on an auto-created duplicate. An edit is reversible by construction.
@@ -89,10 +89,11 @@ These are the choices that shape the surface, and the reason an AI assistant can
89
89
  | **Filters** | Community | `apply_filter` |
90
90
  | **Retouch** | Community | `retouch` |
91
91
  | **Layers** | Community | `create_layer` · `delete_layer` · `fill_layer` · `add_fill_layer` · `select_layer` · `move_layer_to_position` · `duplicate_layer` · `layer_via_copy` · `convert_to_smart_object` · `rasterize_layer` · `set_layer` · `merge` · `bake_layer` · `add_layer_style` · `transform_layer` · `create_group` · `move_layer_to_group` · `set_group_blend_mode` · `ungroup` · `delete_group` |
92
- | **Masks & paths** | Community | `layer_mask` · `create_clipping_mask` · `path` · `vector_mask` |
92
+ | **Masks & paths** | Community | `layer_mask` · `create_clipping_mask` · `path` · `vector_mask` · `apply_image` · `calculations` |
93
93
  | **Type** | Community | `create_text_layer` · `set_text` |
94
94
  | **Perception** | Community | `detect` · `scene` · `select_by_reference` |
95
- | **AI selection** | Pro | `select_subject` · `select_sky` · `select_subject_instance` |
95
+ | **AI selection** | Community | `select_subject` · `select_sky` |
96
+ | **AI selection** | Pro | `select_subject_instance` |
96
97
  | **Layers (warp)** | Pro | `warp_layer` · `warp_layer_mesh` |
97
98
  | **Face mesh** | Pro | `detect_landmarks` · `select_face_feature` |
98
99
  | **Templates** | Pro | `template_create_evidence` · `template_save` · `template_list` · `template_apply` · `template_verify` · `template_recall` · `template_delete` |
@@ -100,8 +101,8 @@ These are the choices that shape the surface, and the reason an AI assistant can
100
101
 
101
102
  ## Editions
102
103
 
103
- - **Community** is free and covers the everyday editing surface: documents, layers, selections, non-destructive adjustments, filters, masks, type, retouching, on-device perception, and the inspect/verify primitives.
104
- - **Pro** adds AI selection (Sensei-backed Select Subject and Select Sky), face-mesh perception, the reproducible-template system, custom mesh warp, and Photoshop Actions plus the scripting escape hatch.
104
+ - **Community** is free and covers the everyday editing surface: documents, layers, selections (including AI Select Subject and Select Sky), non-destructive adjustments, filters, masks, type, retouching, on-device perception, and the inspect/verify primitives.
105
+ - **Pro** adds Camera Raw develop, the grounded precision tools (warp, named-object masks, precision placement), subject-instance targeting, face-mesh perception, the reproducible-template system, and Photoshop Actions plus the scripting escape hatch.
105
106
 
106
107
  The split is detailed in [pro-features.md](https://github.com/editmamei/editmamei-wiki/blob/main/docs/pro-features.md). Pricing is at [editmamei.com](https://editmamei.com).
107
108
 
@@ -112,7 +113,7 @@ Settings live in `~/.editmamei/settings.json`, managed by the `editmamei config`
112
113
  ```bash
113
114
  editmamei config list
114
115
  editmamei config set telemetry.usage false # turn off anonymous usage telemetry
115
- editmamei config set photoshop_path "/path/to/Photoshop"
116
+ editmamei config set ps_path "/path/to/Photoshop"
116
117
  ```
117
118
 
118
119
  `PHOTOSHOP_PATH` (env var) overrides Photoshop auto-detection for a single run.
@@ -177,7 +177,7 @@ function getSelectionInfo() {
177
177
  // Skipping this restoration is what caused the 2026-06-07 hotfix:
178
178
  // every selection tool that inlines getSelectionInfo as its return
179
179
  // value left the document on a non-composite channel, breaking the
180
- // very next photoshop_create_layer_mask call.
180
+ // very next ps_layer_mask call.
181
181
  restoreCompositeChannel(doc);
182
182
  }
183
183
  }
Binary file
Binary file
@@ -36,10 +36,10 @@ const KEYS = {
36
36
  },
37
37
  coerce: coerceBool,
38
38
  },
39
- photoshop_path: {
40
- get: (s) => s.photoshop_path,
39
+ ps_path: {
40
+ get: (s) => s.ps_path,
41
41
  set: (s, v) => {
42
- s.photoshop_path = v;
42
+ s.ps_path = v;
43
43
  },
44
44
  coerce: coercePath,
45
45
  },
@@ -65,10 +65,10 @@ export async function runInstall(opts = {}) {
65
65
  out(` - Click "Upload skill"\n`);
66
66
  out(` - Choose the file at ${skillResult.destPath}\n`);
67
67
  out(` The skill auto-loads in any photo-editing conversation. It's a one-time upload.\n`);
68
- out(` 3. Then ask the AI: "Is Photoshop connected?" — it will call photoshop_ping and return your Photoshop version.\n`);
68
+ out(` 3. Then ask the AI: "Is Photoshop connected?" — it will call ps_ping and return your Photoshop version.\n`);
69
69
  }
70
70
  else {
71
- out(` 2. Then ask the AI: "Is Photoshop connected?" — it will call photoshop_ping and return your Photoshop version.\n`);
71
+ out(` 2. Then ask the AI: "Is Photoshop connected?" — it will call ps_ping and return your Photoshop version.\n`);
72
72
  }
73
73
  if (failed > 0) {
74
74
  out(`\n ${failed} client(s) failed — see lines above. Other clients were registered.\n`);
@@ -110,10 +110,10 @@ export class EditmameiServer {
110
110
  this.setupHandlers();
111
111
  }
112
112
  registerTools() {
113
- this.toolRegistry.register('photoshop_ping', {
113
+ this.toolRegistry.register('ps_ping', {
114
114
  tool: {
115
- name: 'photoshop_ping',
116
- description: 'Test connection to Photoshop and report session-start discovery signals. Read-only and idempotent. Call this once at the start of a session to confirm liveness before invoking any other tool. **If the user has given you an open-ended editing task, ALSO call `photoshop_overview` after this** — it returns the workflow contract + capabilities map + verification primitives so you can plan well. Returns `version` (folds the deleted photoshop_get_version), `custom_action_sets` (count of Action Sets loaded in the Photoshop Actions palette — non-zero means recorded workflows exist; if action tools are available in this build they will appear in `tools/list`), `user_templates` (count of saved Editmamei templates), and `open_documents` (names of documents already open in Photoshop, so the LLM does not have to ask which doc to edit).',
115
+ name: 'ps_ping',
116
+ description: 'Test connection to Photoshop and report session-start discovery signals. Read-only and idempotent. Call this once at the start of a session to confirm liveness before invoking any other tool. **If the user has given you an open-ended editing task, ALSO call `ps_overview` after this** — it returns the workflow contract + capabilities map + verification primitives so you can plan well. Returns `version` (folds the deleted photoshop_get_version), `custom_action_sets` (count of Action Sets loaded in the Photoshop Actions palette — non-zero means recorded workflows exist; if action tools are available in this build they will appear in `tools/list`), `user_templates` (count of saved Editmamei templates), and `open_documents` (names of documents already open in Photoshop, so the LLM does not have to ask which doc to edit).',
117
117
  inputSchema: {
118
118
  type: 'object',
119
119
  properties: {},
@@ -151,10 +151,10 @@ export class EditmameiServer {
151
151
  },
152
152
  handler: async () => await this.pingPhotoshop(),
153
153
  });
154
- this.toolRegistry.register('photoshop_list_capabilities', {
154
+ this.toolRegistry.register('ps_list_capabilities', {
155
155
  tool: {
156
- name: 'photoshop_list_capabilities',
157
- description: 'Live map of every tool this MCP exposes, grouped by capability — each group is a one-line purpose plus the tool names in it. Read-only and cheap. Reach for it to re-orient mid-session (what exists, what to reach for) when the overview brief has scrolled out of context, or to learn which tool names to look up. photoshop_overview tells you HOW to combine tools; this tells you WHAT exists, currently; tools/list has the full schema for any one you pick.',
156
+ name: 'ps_list_capabilities',
157
+ description: 'Live map of every tool this MCP exposes, grouped by capability — each group is a one-line purpose plus the tool names in it. Read-only and cheap. Reach for it to re-orient mid-session (what exists, what to reach for) when the overview brief has scrolled out of context, or to learn which tool names to look up. ps_overview tells you HOW to combine tools; this tells you WHAT exists, currently; tools/list has the full schema for any one you pick.',
158
158
  inputSchema: { type: 'object', properties: {} },
159
159
  outputSchema: {
160
160
  type: 'object',
@@ -252,7 +252,7 @@ export class EditmameiServer {
252
252
  }))
253
253
  .filter((g) => g.tools.length > 0);
254
254
  const text = `Editmamei exposes ${registered.length} tools across ${groups.length} capability groups. ` +
255
- `This is the live map of WHAT exists; photoshop_overview is HOW to combine them, and ` +
255
+ `This is the live map of WHAT exists; ps_overview is HOW to combine them, and ` +
256
256
  `tools/list has the full schema for any one tool.\n\n` +
257
257
  groups
258
258
  .map((g) => `${g.label} (${g.tools.length}) — ${g.purpose}\n ${g.tools.join(', ')}`)
@@ -19,7 +19,7 @@ function defaults(installId) {
19
19
  return {
20
20
  telemetry: { usage: true, diagnostics: false, install_id: installId },
21
21
  privacy: { send_previews_to_llm: true },
22
- photoshop_path: null,
22
+ ps_path: null,
23
23
  update_check: true,
24
24
  };
25
25
  }
@@ -43,7 +43,7 @@ function coerce(raw, installId) {
43
43
  ? p.send_previews_to_llm
44
44
  : base.privacy.send_previews_to_llm,
45
45
  },
46
- photoshop_path: typeof r.photoshop_path === 'string' ? r.photoshop_path : null,
46
+ ps_path: typeof r.ps_path === 'string' ? r.ps_path : null,
47
47
  update_check: typeof r.update_check === 'boolean' ? r.update_check : base.update_check,
48
48
  };
49
49
  }
@@ -81,88 +81,97 @@ export const GROUPS = {
81
81
  },
82
82
  };
83
83
  export const TOOL_GROUPS = {
84
- photoshop_ping: 'core',
85
- photoshop_overview: 'core',
86
- photoshop_undo: 'core',
87
- photoshop_redo: 'core',
88
- photoshop_list_capabilities: 'core',
89
- photoshop_report_problem: 'core',
90
- photoshop_inspect: 'inspect',
91
- photoshop_get_preview: 'inspect',
92
- photoshop_get_histogram: 'verify',
93
- photoshop_compare_regions: 'verify',
94
- photoshop_get_layer_bounds_diff: 'verify',
95
- photoshop_get_selection_preview: 'verify',
96
- photoshop_create_document: 'document',
97
- photoshop_open_document: 'document',
98
- photoshop_close_document: 'document',
99
- photoshop_save_psd: 'document',
100
- photoshop_export: 'document',
101
- photoshop_place_image: 'document',
102
- photoshop_resize_image: 'document',
103
- photoshop_crop_document: 'document',
104
- photoshop_convert_image_mode: 'document',
105
- photoshop_transform_canvas: 'document',
106
- photoshop_guides: 'document',
107
- photoshop_select: 'select',
108
- photoshop_modify_selection: 'select',
109
- photoshop_selection_channel: 'select',
110
- photoshop_select_subject: 'select_ai',
111
- photoshop_select_sky: 'select_ai',
112
- photoshop_select_subject_instance: 'select_ai',
113
- photoshop_add_adjustment_layer: 'adjust',
114
- photoshop_apply_adjustment: 'adjust',
115
- photoshop_apply_filter: 'filter',
116
- photoshop_retouch: 'retouch',
117
- photoshop_apply_brush_stroke: 'retouch',
118
- photoshop_create_layer: 'layers',
119
- photoshop_delete_layer: 'layers',
120
- photoshop_fill_layer: 'layers',
121
- photoshop_add_fill_layer: 'layers',
122
- photoshop_select_layer: 'layers',
123
- photoshop_move_layer_to_position: 'layers',
124
- photoshop_duplicate_layer: 'layers',
125
- photoshop_layer_via_copy: 'layers',
126
- photoshop_convert_to_smart_object: 'layers',
127
- photoshop_rasterize_layer: 'layers',
128
- photoshop_set_layer: 'layers',
129
- photoshop_merge: 'layers',
130
- photoshop_bake_layer: 'layers',
131
- photoshop_add_layer_style: 'layers',
132
- photoshop_transform_layer: 'layers',
133
- photoshop_warp_layer: 'layers',
134
- photoshop_warp_layer_mesh: 'layers',
135
- photoshop_create_group: 'layers',
136
- photoshop_move_layer_to_group: 'layers',
137
- photoshop_set_group_blend_mode: 'layers',
138
- photoshop_ungroup: 'layers',
139
- photoshop_delete_group: 'layers',
140
- photoshop_layer_mask: 'masks',
141
- photoshop_create_clipping_mask: 'masks',
142
- photoshop_release_clipping_mask: 'masks',
143
- photoshop_path: 'masks',
144
- photoshop_vector_mask: 'masks',
145
- photoshop_create_text_layer: 'type',
146
- photoshop_set_text: 'type',
147
- photoshop_detect: 'perception',
148
- photoshop_scene: 'perception',
149
- photoshop_select_by_reference: 'perception',
150
- photoshop_object: 'perception',
151
- photoshop_portrait_touchup: 'perception',
152
- photoshop_text_on_object: 'perception',
153
- photoshop_detect_landmarks: 'face',
154
- photoshop_select_face_feature: 'face',
155
- photoshop_stroke_face_contour: 'face',
156
- photoshop_template_create_evidence: 'templates',
157
- photoshop_template_save: 'templates',
158
- photoshop_template_list: 'templates',
159
- photoshop_template_apply: 'templates',
160
- photoshop_template_verify: 'templates',
161
- photoshop_template_recall: 'templates',
162
- photoshop_template_delete: 'templates',
163
- photoshop_list_actions: 'automation',
164
- photoshop_play_action: 'automation',
165
- photoshop_execute_script: 'automation',
84
+ ps_ping: 'core',
85
+ ps_overview: 'core',
86
+ ps_undo: 'core',
87
+ ps_redo: 'core',
88
+ ps_list_capabilities: 'core',
89
+ ps_report_problem: 'core',
90
+ ps_inspect: 'inspect',
91
+ ps_get_preview: 'inspect',
92
+ ps_get_histogram: 'verify',
93
+ ps_compare_regions: 'verify',
94
+ ps_get_layer_bounds_diff: 'verify',
95
+ ps_get_selection_preview: 'verify',
96
+ ps_create_document: 'document',
97
+ ps_open_document: 'document',
98
+ ps_close_document: 'document',
99
+ ps_save_psd: 'document',
100
+ ps_export: 'document',
101
+ ps_place_image: 'document',
102
+ ps_resize_image: 'document',
103
+ ps_crop_document: 'document',
104
+ ps_convert_image_mode: 'document',
105
+ ps_transform_canvas: 'document',
106
+ ps_guides: 'document',
107
+ ps_select: 'select',
108
+ ps_modify_selection: 'select',
109
+ ps_selection_channel: 'select',
110
+ ps_select_subject: 'select_ai',
111
+ ps_select_sky: 'select_ai',
112
+ ps_select_subject_instance: 'select_ai',
113
+ ps_select_object: 'select_ai',
114
+ ps_add_adjustment_layer: 'adjust',
115
+ ps_apply_adjustment: 'adjust',
116
+ ps_apply_filter: 'filter',
117
+ ps_apply_camera_raw: 'filter',
118
+ ps_retouch: 'retouch',
119
+ ps_apply_brush_stroke: 'retouch',
120
+ ps_create_layer: 'layers',
121
+ ps_delete_layer: 'layers',
122
+ ps_fill_layer: 'layers',
123
+ ps_add_fill_layer: 'layers',
124
+ ps_select_layer: 'layers',
125
+ ps_move_layer_to_position: 'layers',
126
+ ps_duplicate_layer: 'layers',
127
+ ps_copy_to_new_layer: 'layers',
128
+ ps_convert_to_smart_object: 'layers',
129
+ ps_rasterize_layer: 'layers',
130
+ ps_set_layer: 'layers',
131
+ ps_merge: 'layers',
132
+ ps_bake_layer: 'layers',
133
+ ps_add_layer_style: 'layers',
134
+ ps_transform_layer: 'layers',
135
+ ps_warp_layer: 'layers',
136
+ ps_warp_layer_mesh: 'layers',
137
+ ps_warp_layer_along: 'layers',
138
+ ps_warp_layer_region: 'layers',
139
+ ps_warp_layer_to: 'layers',
140
+ ps_create_group: 'layers',
141
+ ps_move_layer_to_group: 'layers',
142
+ ps_set_group_blend_mode: 'layers',
143
+ ps_ungroup: 'layers',
144
+ ps_delete_group: 'layers',
145
+ ps_layer_mask: 'masks',
146
+ ps_create_clipping_mask: 'masks',
147
+ ps_release_clipping_mask: 'masks',
148
+ ps_path: 'masks',
149
+ ps_vector_mask: 'masks',
150
+ ps_apply_image: 'masks',
151
+ ps_calculations: 'masks',
152
+ ps_shape: 'layers',
153
+ ps_create_text_layer: 'type',
154
+ ps_set_text: 'type',
155
+ ps_detect: 'perception',
156
+ ps_read_scene: 'perception',
157
+ ps_select_by_reference: 'perception',
158
+ ps_edit_object: 'perception',
159
+ ps_portrait_touchup: 'perception',
160
+ ps_add_text_to_object: 'perception',
161
+ ps_resolve_placement: 'perception',
162
+ ps_detect_landmarks: 'face',
163
+ ps_select_face_feature: 'face',
164
+ ps_stroke_face_contour: 'face',
165
+ ps_template_create_evidence: 'templates',
166
+ ps_template_save: 'templates',
167
+ ps_template_list: 'templates',
168
+ ps_template_apply: 'templates',
169
+ ps_template_verify: 'templates',
170
+ ps_template_recall: 'templates',
171
+ ps_template_delete: 'templates',
172
+ ps_list_actions: 'automation',
173
+ ps_play_action: 'automation',
174
+ ps_execute_script: 'automation',
166
175
  };
167
176
  export function groupOf(toolName) {
168
177
  const group = TOOL_GROUPS[toolName];
@@ -1,86 +1,95 @@
1
1
  export const TOOL_TIERS = {
2
- photoshop_ping: 'community',
3
- photoshop_list_capabilities: 'community',
4
- photoshop_report_problem: 'community',
5
- photoshop_list_actions: 'pro',
6
- photoshop_play_action: 'pro',
7
- photoshop_execute_script: 'pro',
8
- photoshop_add_adjustment_layer: 'community',
9
- photoshop_apply_adjustment: 'community',
10
- photoshop_create_document: 'community',
11
- photoshop_close_document: 'community',
12
- photoshop_open_document: 'community',
13
- photoshop_save_psd: 'community',
14
- photoshop_export: 'community',
15
- photoshop_apply_filter: 'community',
16
- photoshop_create_group: 'community',
17
- photoshop_move_layer_to_group: 'community',
18
- photoshop_set_group_blend_mode: 'community',
19
- photoshop_ungroup: 'community',
20
- photoshop_delete_group: 'community',
21
- photoshop_create_clipping_mask: 'community',
22
- photoshop_release_clipping_mask: 'dev',
23
- photoshop_undo: 'community',
24
- photoshop_redo: 'community',
25
- photoshop_place_image: 'community',
26
- photoshop_resize_image: 'community',
27
- photoshop_crop_document: 'community',
28
- photoshop_convert_image_mode: 'community',
29
- photoshop_move_layer_to_position: 'community',
30
- photoshop_convert_to_smart_object: 'community',
31
- photoshop_rasterize_layer: 'community',
32
- photoshop_set_layer: 'community',
33
- photoshop_duplicate_layer: 'community',
34
- photoshop_layer_via_copy: 'community',
35
- photoshop_merge: 'community',
36
- photoshop_bake_layer: 'community',
37
- photoshop_add_layer_style: 'community',
38
- photoshop_create_layer: 'community',
39
- photoshop_delete_layer: 'community',
40
- photoshop_create_text_layer: 'community',
41
- photoshop_fill_layer: 'community',
42
- photoshop_add_fill_layer: 'community',
43
- photoshop_select_layer: 'community',
44
- photoshop_transform_layer: 'community',
45
- photoshop_warp_layer: 'pro',
46
- photoshop_warp_layer_mesh: 'pro',
47
- photoshop_transform_canvas: 'community',
48
- photoshop_guides: 'community',
49
- photoshop_inspect: 'community',
50
- photoshop_overview: 'community',
51
- photoshop_get_preview: 'community',
52
- photoshop_get_layer_bounds_diff: 'community',
53
- photoshop_compare_regions: 'community',
54
- photoshop_get_histogram: 'community',
55
- photoshop_retouch: 'community',
56
- photoshop_apply_brush_stroke: 'dev',
57
- photoshop_detect: 'community',
58
- photoshop_object: 'dev',
59
- photoshop_portrait_touchup: 'dev',
60
- photoshop_text_on_object: 'dev',
61
- photoshop_detect_landmarks: 'pro',
62
- photoshop_select_face_feature: 'pro',
63
- photoshop_stroke_face_contour: 'dev',
64
- photoshop_scene: 'community',
65
- photoshop_select_by_reference: 'community',
66
- photoshop_select: 'community',
67
- photoshop_select_subject: 'pro',
68
- photoshop_select_sky: 'pro',
69
- photoshop_select_subject_instance: 'pro',
70
- photoshop_modify_selection: 'community',
71
- photoshop_get_selection_preview: 'community',
72
- photoshop_selection_channel: 'community',
73
- photoshop_layer_mask: 'community',
74
- photoshop_path: 'community',
75
- photoshop_vector_mask: 'community',
76
- photoshop_template_create_evidence: 'pro',
77
- photoshop_template_save: 'pro',
78
- photoshop_template_list: 'pro',
79
- photoshop_template_apply: 'pro',
80
- photoshop_template_verify: 'pro',
81
- photoshop_template_recall: 'pro',
82
- photoshop_template_delete: 'pro',
83
- photoshop_set_text: 'community',
2
+ ps_ping: 'community',
3
+ ps_list_capabilities: 'community',
4
+ ps_report_problem: 'community',
5
+ ps_list_actions: 'pro',
6
+ ps_play_action: 'pro',
7
+ ps_execute_script: 'pro',
8
+ ps_add_adjustment_layer: 'community',
9
+ ps_apply_adjustment: 'community',
10
+ ps_create_document: 'community',
11
+ ps_close_document: 'community',
12
+ ps_open_document: 'community',
13
+ ps_save_psd: 'community',
14
+ ps_export: 'community',
15
+ ps_apply_filter: 'community',
16
+ ps_create_group: 'community',
17
+ ps_move_layer_to_group: 'community',
18
+ ps_set_group_blend_mode: 'community',
19
+ ps_ungroup: 'community',
20
+ ps_delete_group: 'community',
21
+ ps_create_clipping_mask: 'community',
22
+ ps_release_clipping_mask: 'dev',
23
+ ps_undo: 'community',
24
+ ps_redo: 'community',
25
+ ps_place_image: 'community',
26
+ ps_resize_image: 'community',
27
+ ps_crop_document: 'community',
28
+ ps_convert_image_mode: 'community',
29
+ ps_move_layer_to_position: 'community',
30
+ ps_convert_to_smart_object: 'community',
31
+ ps_rasterize_layer: 'community',
32
+ ps_set_layer: 'community',
33
+ ps_duplicate_layer: 'community',
34
+ ps_copy_to_new_layer: 'community',
35
+ ps_merge: 'community',
36
+ ps_bake_layer: 'community',
37
+ ps_add_layer_style: 'community',
38
+ ps_create_layer: 'community',
39
+ ps_delete_layer: 'community',
40
+ ps_create_text_layer: 'community',
41
+ ps_fill_layer: 'community',
42
+ ps_add_fill_layer: 'community',
43
+ ps_select_layer: 'community',
44
+ ps_transform_layer: 'community',
45
+ ps_warp_layer: 'pro',
46
+ ps_warp_layer_mesh: 'pro',
47
+ ps_warp_layer_along: 'pro',
48
+ ps_warp_layer_region: 'pro',
49
+ ps_warp_layer_to: 'pro',
50
+ ps_apply_camera_raw: 'pro',
51
+ ps_transform_canvas: 'community',
52
+ ps_guides: 'community',
53
+ ps_inspect: 'community',
54
+ ps_overview: 'community',
55
+ ps_get_preview: 'community',
56
+ ps_get_layer_bounds_diff: 'community',
57
+ ps_compare_regions: 'community',
58
+ ps_get_histogram: 'community',
59
+ ps_retouch: 'community',
60
+ ps_apply_brush_stroke: 'dev',
61
+ ps_detect: 'community',
62
+ ps_edit_object: 'pro',
63
+ ps_portrait_touchup: 'dev',
64
+ ps_add_text_to_object: 'pro',
65
+ ps_detect_landmarks: 'pro',
66
+ ps_select_face_feature: 'pro',
67
+ ps_stroke_face_contour: 'dev',
68
+ ps_read_scene: 'community',
69
+ ps_select_by_reference: 'community',
70
+ ps_select: 'community',
71
+ ps_select_subject: 'community',
72
+ ps_select_sky: 'community',
73
+ ps_select_subject_instance: 'pro',
74
+ ps_select_object: 'pro',
75
+ ps_modify_selection: 'community',
76
+ ps_get_selection_preview: 'community',
77
+ ps_selection_channel: 'community',
78
+ ps_layer_mask: 'community',
79
+ ps_path: 'community',
80
+ ps_vector_mask: 'community',
81
+ ps_apply_image: 'community',
82
+ ps_calculations: 'community',
83
+ ps_shape: 'community',
84
+ ps_resolve_placement: 'pro',
85
+ ps_template_create_evidence: 'pro',
86
+ ps_template_save: 'pro',
87
+ ps_template_list: 'pro',
88
+ ps_template_apply: 'pro',
89
+ ps_template_verify: 'pro',
90
+ ps_template_recall: 'pro',
91
+ ps_template_delete: 'pro',
92
+ ps_set_text: 'community',
84
93
  };
85
94
  export function tierOf(toolName) {
86
95
  const tier = TOOL_TIERS[toolName];
@@ -1,6 +1,7 @@
1
1
  import { decodeJpeg as realDecodeJpeg } from './runtime.js';
2
2
  import { detectLandmarks as realDetectLandmarks, } from './landmark-detector.js';
3
3
  import { OnnxDetectionClient, } from './detection-client.js';
4
+ import { correctMeshEyes } from './mesh-eye-correction.js';
4
5
  const LANDMARK_BACKEND = 'facemesh-468';
5
6
  export class OnnxLandmarkDetectionClient {
6
7
  base;
@@ -20,11 +21,18 @@ export class OnnxLandmarkDetectionClient {
20
21
  const img = this.decodeJpeg(imagePath);
21
22
  const minScore = this.opts.minScore ?? 0.5;
22
23
  const lmOpts = { margin: this.opts.margin };
24
+ const correctEyes = this.opts.correctEyes ?? true;
23
25
  for (const face of result.faces) {
24
26
  try {
25
27
  const mesh = await this.detectLandmarks(img, face.bbox, lmOpts);
26
28
  if (mesh.score >= minScore) {
27
29
  face.features = { points: mesh.points, score: mesh.score, backend: LANDMARK_BACKEND };
30
+ if (correctEyes) {
31
+ const c = correctMeshEyes(img, face.features.points);
32
+ face.features.points = c.points;
33
+ if (c.correction)
34
+ face.features.eyeCorrection = c.correction;
35
+ }
28
36
  }
29
37
  }
30
38
  catch {