Commit 6265454
feat(setup): platform-aware wizard with manifest-driven workflow recommendations (#365)
* Add platform-aware setup wizard and mcp-json output
Introduce platform selection to the setup wizard, recommend workflows
per platform, and avoid prompting for a simulator when macOS is the only
platform selected. Add helpers and constants (SetupPlatform,
PLATFORM_WORKFLOWS, PLATFORM_OPTIONS, infer/derive/filter helpers), a
multi-select platform prompt, and make the setup flow platform-aware
(seed workflow defaults, filter simulators, preserve platform in
sessionDefaults). Add selectionToMcpConfigJson() and a --format mcp-json
option to print a ready-to-paste MCP client config JSON block
(runSetupWizard supports 'mcp-json' early-exit). Update tests
(createPlatformPrompter and four platform-aware cases) and CHANGELOG.md
to document the new behavior.
* test(setup): expand platform-aware setup wizard coverage
Add focused tests requested by the PR audit:
- Stale deviceId, simulatorId, and simulatorName are cleared when
re-running setup with macOS-only after a prior iOS-with-device config.
- YAML persistence for tvOS, watchOS, and visionOS single-platform
selections writes the correct platform string and selects a
platform-matching simulator from a multi-runtime simctl listing.
- Verify filterSimulatorsByPlatforms matches a SimRuntime-style
visionOS runtime via the xrOS keyword.
* refactor(cli/setup): consolidate platform string mappings
Replace three parallel string-literal cascades for SetupPlatform <-> session-defaults
platform conversion with two derived lookup tables, reusing the existing XcodePlatform
enum so the session-defaults platform value has a single source of truth.
Replace the inline visionOS/xrOS branch in filterSimulatorsByPlatforms with a
SIMULATOR_RUNTIME_KEYWORDS table so runtime keyword matching is data-driven.
* refactor(setup): derive workflow recommendations from manifest metadata
Add `targetPlatforms` to the workflow manifest schema and populate it on
all built-in workflows. The setup wizard now derives recommended
workflows from this manifest metadata instead of a hand-coded
`PLATFORM_WORKFLOWS` map, and splits the prompt into recommended vs
additional workflows so the default selection stays minimal (macos
and/or simulator) while non-recommended workflows remain reachable.
Custom workflows from `config.yaml` and the workflow-discovery entry
declare empty `targetPlatforms`; tests for schema, exposure, registry,
and the setup wizard cover required/empty/invalid metadata and the new
recommended/additional prompt flow.
* feat(device): support tvOS, watchOS, and visionOS device builds
Extract a shared `devicePlatformSchema` and reuse `mapDevicePlatform`
across `build_device`, `build_run_device`, `get_device_app_path`, and
`test_device` so each device tool accepts a `platform` argument and
threads it into the xcodebuild invocation and log prefix.
The schema preprocesses simulator-flavored session defaults
(e.g. `tvOS Simulator`) down to the matching device platform so a
session configured for a simulator runtime still produces a valid
device build target. Tests cover the new platform argument, the
simulator-to-device normalization, and the rejected `macOS` case.
* docs(agents): scope review focus to branch regressions
Add a guidance line to AGENTS.md and CLAUDE.md telling reviewers to
focus on behavior changes caused by the current branch and to ignore
known test flakes, environment setup issues, and nondeterministic tool
output churn unless explicitly asked to investigate them.
* ci: remove tool authoring guidance workflow
The reminder workflow posted a PR comment when tool contract files
changed, but org-level GITHUB_TOKEN policy blocks the comment write
and the check stays failing without surfacing useful information on
the PR. Authoring guidance is maintained in the docs site at
xcodebuildmcp.com/docs/tool-authoring.
* refactor(setup): persist wizard platform selection in setupPreferences
The setup wizard was writing the user's "which platforms does this
project target?" answer into sessionDefaults.platform, conflating UI
memory with a runtime tool-param default. It also relied on
sessionDefaults.simulatorPlatform (an internal cache) to recover the
non-macOS half of multi-platform selections, which silently reverted
[macOS, visionOS] to [macOS, iOS] on re-run.
Move wizard memory to a dedicated top-level setupPreferences.platforms
field. sessionDefaults.platform/simulatorPlatform are no longer touched
by setup; they remain agent-controlled session defaults. The mcp-json
output still seeds XCODEBUILDMCP_PLATFORM for fresh clients, since that
is an explicit env-var bootstrap, not internal state.
Follow-up #366 tracks moving simulatorPlatform out of sessionDefaults.
* refactor(setup): remove unused SESSION_DEFAULT_TO_SETUP_PLATFORM
The reverse mapping had a single consumer in the legacy
inferPlatformsFromExisting branch. After 82d3101 moved wizard memory
to setupPreferences.platforms, that lookup is gone and the constant is
dead. CodeQL flagged it.
---------
Co-authored-by: Ismar Iljazovic <ismar@gmail.com>1 parent e3f349c commit 6265454
37 files changed
Lines changed: 1277 additions & 181 deletions
File tree
- .github/workflows
- manifests/workflows
- src
- cli/commands
- __tests__
- core/manifest
- __tests__
- mcp/tools/device
- __tests__
- utils
- __tests__
- visibility/__tests__
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
0 commit comments