You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Absolute path instead of relative for files above xcodeproj
When the .icon file is at the repo root but the .xcodeproj is in a subdirectory (e.g. Xcode/Project.xcodeproj), the tool stores an absolute path with sourceTree = "<absolute>" instead of using sourceTree = SOURCE_ROOT with a relative path.
Using ../AppIcon.icon as the file_path fails with "path is outside the allowed base path" because the tool resolves relative to the repo root, not the xcodeproj.
Expected Behavior
Recognize .icon extension → set lastKnownFileType = folder.iconcomposer.icon
For files within the repo but above the xcodeproj directory, use sourceTree = SOURCE_ROOT with a path relative to the repo root (or sourceTree = "<group>" with a ../ relative path)
Thesis project at ~/Developer/toba/thesis has a working Icon Composer icon reference created by Xcode.
Impact
Without lastKnownFileType = folder.iconcomposer.icon, Xcode treats the .icon bundle as a generic folder resource copy. The icon is NOT compiled by the asset catalog compiler — the app falls back to a default/old icon. This is a build-correctness bug, not just cosmetic.
Verified Behavior
add_file with absolute path /Users/jason/.../AppIcon.icon → produces sourceTree = "<absolute>" with no lastKnownFileType
add_file with relative path ../AppIcon.icon (xcodeproj is in Xcode/ subdir) → fails: "path is outside the allowed base path"
lastKnownFileType = folder.iconcomposer.icon (tells Xcode this is an Icon Composer bundle)
sourceTree = SOURCE_ROOT with relative path = AppIcon.icon
No name field needed when path basename matches the display name
TODO
Add .icon → folder.iconcomposer.icon file type override in AddFileTool
Fix path resolution for files above xcodeproj but within repo root
Create CreateIconTool — generates .icon bundle from a PNG
Register create_icon in XcodeMCPServer and BuildMCPServer
Add tests for all changes (71 total: 20 AddFile, 12 CreateIcon, 6 IconManifest, 6 ExportIcon, 27 IconTools)
Run tests — all pass
Fix Scope
File type mapping: Add .icon → folder.iconcomposer.icon to the lastKnownFileType lookup table
Path resolution: When a file is inside the repo root but the xcodeproj is in a subdirectory, use sourceTree = SOURCE_ROOT with a path relative to the repo root, rather than falling back to absolute path or rejecting ../ paths
Summary of Changes
Bug fixes (dac-5qi)
.icon file type: Added folder.iconcomposer.icon override in AddFileTool.fileType(forExtension:) since XcodeProj's Xcode.filetype(extension:) doesn't know about .icon
Path resolution: When a file is above the xcodeproj but within the repo root (basePath), add_file now uses sourceTree = SOURCE_ROOT with a ../ relative path instead of falling back to absolute paths
set_icon_layer_position — scale and offset for layers/groups
set_icon_appearances — dark/tinted mode fill specializations
New: IconManifest Codable model
Full Codable representation of icon.json in Sources/Core/IconManifest.swift — groups, layers, fills (solid/gradient/automatic-gradient), shadows, translucency, positions, platform support, and dark mode specializations.
Files changed
Sources/Tools/Project/AddFileTool.swift — file type override + path resolution fix
Sources/Core/IconManifest.swift — new Codable model
Sources/Tools/Icon/ — 9 icon tools (new directory)
Problem
When using
add_fileto add an Icon Composer.iconfile to a project, two issues occur:1. Missing
lastKnownFileTypefor.iconfilesThe generated
PBXFileReferencehas nolastKnownFileType. It should befolder.iconcomposer.icon.Actual:
Expected (matches Xcode-generated reference):
2. Absolute path instead of relative for files above xcodeproj
When the
.iconfile is at the repo root but the.xcodeprojis in a subdirectory (e.g.Xcode/Project.xcodeproj), the tool stores an absolute path withsourceTree = "<absolute>"instead of usingsourceTree = SOURCE_ROOTwith a relative path.Using
../AppIcon.iconas the file_path fails with "path is outside the allowed base path" because the tool resolves relative to the repo root, not the xcodeproj.Expected Behavior
.iconextension → setlastKnownFileType = folder.iconcomposer.iconsourceTree = SOURCE_ROOTwith a path relative to the repo root (orsourceTree = "<group>"with a../relative path)Reproduction
Reference
Thesis project at
~/Developer/toba/thesishas a working Icon Composer icon reference created by Xcode.Impact
Without
lastKnownFileType = folder.iconcomposer.icon, Xcode treats the.iconbundle as a generic folder resource copy. The icon is NOT compiled by the asset catalog compiler — the app falls back to a default/old icon. This is a build-correctness bug, not just cosmetic.Verified Behavior
add_filewith absolute path/Users/jason/.../AppIcon.icon→ producessourceTree = "<absolute>"with nolastKnownFileTypeadd_filewith relative path../AppIcon.icon(xcodeproj is inXcode/subdir) → fails: "path is outside the allowed base path"add_filewith repo-relative pathAppIcon.icon→ same as Add 8 new LLDB debug tools (Tier 1 + Tier 2) #1The built app gets a 142KB
AppIcon.icnsthat is NOT derived from the.iconfile (icon rendering is wrong — still shows old padded icon).Correct Reference (from Thesis project, created by Xcode)
Key differences:
lastKnownFileType = folder.iconcomposer.icon(tells Xcode this is an Icon Composer bundle)sourceTree = SOURCE_ROOTwith relativepath = AppIcon.iconnamefield needed when path basename matches the display nameTODO
.icon→folder.iconcomposer.iconfile type override in AddFileToolCreateIconTool— generates.iconbundle from a PNGcreate_iconin XcodeMCPServer and BuildMCPServerFix Scope
.icon→folder.iconcomposer.iconto thelastKnownFileTypelookup tablesourceTree = SOURCE_ROOTwith a path relative to the repo root, rather than falling back to absolute path or rejecting../pathsSummary of Changes
Bug fixes (dac-5qi)
.iconfile type: Addedfolder.iconcomposer.iconoverride inAddFileTool.fileType(forExtension:)since XcodeProj'sXcode.filetype(extension:)doesn't know about.iconadd_filenow usessourceTree = SOURCE_ROOTwith a../relative path instead of falling back to absolute pathsNew: 9 icon tools in
Sources/Tools/Icon/Full Icon Composer tooling commensurate with ethbak/icon-composer-mcp:
create_icon— create .icon bundle from PNG with fill, effects, dark mode, project wiringexport_icon— render via ictool (moved from Utility/)read_icon— inspect bundle manifest and assetsadd_icon_layer— add layer to existing bundle (new group or existing)remove_icon_layer— remove layer/group with asset purgingset_icon_fill— solid, automatic-gradient, linear-gradient, or clearset_icon_effects— specular, shadow, translucency, blur, lighting, blend modeset_icon_layer_position— scale and offset for layers/groupsset_icon_appearances— dark/tinted mode fill specializationsNew:
IconManifestCodable modelFull Codable representation of
icon.jsoninSources/Core/IconManifest.swift— groups, layers, fills (solid/gradient/automatic-gradient), shadows, translucency, positions, platform support, and dark mode specializations.Files changed
Sources/Tools/Project/AddFileTool.swift— file type override + path resolution fixSources/Core/IconManifest.swift— new Codable modelSources/Tools/Icon/— 9 icon tools (new directory)Sources/Server/XcodeMCPServer.swift— register create_iconSources/Servers/Build/BuildMCPServer.swift— register create_iconTests/AddFileToolTests.swift— 4 new testsTests/CreateIconToolTests.swift— 12 new testsTests/IconManifestTests.swift— 6 new tests👾 This issue is managed by Jig. Edits made here will be overwritten.