[#170] Rename ExternalPromptDefinition to PromptDefinition#214
Merged
[#170] Rename ExternalPromptDefinition to PromptDefinition#214
Conversation
… TechPack/ - Move PromptDefinition, PromptType, PromptOption from ExternalPackManifest.swift to new TechPack/PromptDefinition.swift, dropping the External prefix - Update all references across 6 source files, 4 test files, and docs/architecture.md - Remove redundant explicit Sendable conformances flagged by SwiftFormat on touched files
- Add PromptDefinition.swift to TechPack/ section - Remove "prompts" from ExternalPackManifest.swift description
There was a problem hiding this comment.
Pull request overview
Renames and relocates prompt schema types so TechPack.declaredPrompts(context:) no longer depends on ExternalPack/ types, removing an adapter-layer dependency from the core protocol surface and making naming consistent now that all packs are external.
Changes:
- Move/rename prompt schema models to
TechPack/(ExternalPromptDefinition→PromptDefinition, etc.) - Update call sites in install/configure flow and test mocks to use the new prompt types
- Update architecture docs and remove redundant explicit
Sendableconformances on touched types
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/architecture.md | Updates the TechPack protocol example to return [PromptDefinition]. |
| Sources/mcs/TechPack/TechPack.swift | Changes declaredPrompts signature to use PromptDefinition and removes explicit Sendable on touched value types. |
| Sources/mcs/TechPack/PromptDefinition.swift | Introduces the renamed/moved prompt schema types (PromptDefinition, PromptType, PromptOption). |
| Sources/mcs/Install/CrossPackPromptResolver.swift | Updates cross-pack prompt grouping/deduplication to use the renamed prompt types. |
| Sources/mcs/ExternalPack/ExternalPackManifest.swift | Switches manifest prompts to [PromptDefinition]? and removes the old ExternalPrompt* type declarations. |
| Sources/mcs/ExternalPack/ExternalPackAdapter.swift | Updates declaredPrompts to return [PromptDefinition]. |
| Sources/mcs/ExternalPack/PromptExecutor.swift | Updates prompt execution APIs to accept PromptDefinition. |
| Sources/mcs/Export/ManifestBuilder.swift | Updates exported manifest prompt construction to use PromptDefinition. |
| Tests/MCSTests/PromptExecutorTests.swift | Updates prompt fixtures to use PromptDefinition. |
| Tests/MCSTests/ExternalPackManifestTests.swift | Updates prompt option assertions to PromptOption. |
| Tests/MCSTests/ExternalPackAdapterTests.swift | Updates adapter prompt fixtures to PromptDefinition. |
| Tests/MCSTests/CrossPackPromptResolverTests.swift | Updates mock packs and fixtures to use PromptDefinition/PromptOption. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
TechPackprotocol'sdeclaredPrompts(context:)method returned[ExternalPromptDefinition]— a type defined inExternalPack/, creating a dependency from the core protocol layer to the adapter layer. Since built-in packs were removed and all packs are now external, theExternalprefix on prompt types was misleading. This renames and moves the prompt types toTechPack/where they belong.Closes #170
Also closes #171 (won't-fix) — the
Externalprefix on other types (e.g.ExternalComponentDefinition,ExternalMCPServerConfig) still serves a purpose: distinguishing YAML schema types from internal engine types that share the same base name.Changes
ExternalPromptDefinition→PromptDefinition,ExternalPromptType→PromptType,ExternalPromptOption→PromptOptionfromExternalPackManifest.swiftto newSources/mcs/TechPack/PromptDefinition.swiftdocs/architecture.mdSendableconformances flagged by SwiftFormat on touched files (Swift 6 infers these automatically for value types)Test plan
swift testpasses locally (637 tests, 56 suites)swiftformat --lint .andswiftlintpass without violationsChecklist for engine changes
docs/architecture.md— protocol signature example updated)