Skip to content

[#170] Rename ExternalPromptDefinition to PromptDefinition#214

Merged
bguidolim merged 2 commits intomainfrom
feature/170-rename-prompt-definition
Mar 4, 2026
Merged

[#170] Rename ExternalPromptDefinition to PromptDefinition#214
bguidolim merged 2 commits intomainfrom
feature/170-rename-prompt-definition

Conversation

@bguidolim
Copy link
Copy Markdown
Collaborator

@bguidolim bguidolim commented Mar 3, 2026

Summary

The TechPack protocol's declaredPrompts(context:) method returned [ExternalPromptDefinition] — a type defined in ExternalPack/, creating a dependency from the core protocol layer to the adapter layer. Since built-in packs were removed and all packs are now external, the External prefix on prompt types was misleading. This renames and moves the prompt types to TechPack/ where they belong.

Closes #170

Also closes #171 (won't-fix) — the External prefix 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

  • Move ExternalPromptDefinitionPromptDefinition, ExternalPromptTypePromptType, ExternalPromptOptionPromptOption from ExternalPackManifest.swift to new Sources/mcs/TechPack/PromptDefinition.swift
  • 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 (Swift 6 infers these automatically for value types)

Test plan

  • swift test passes locally (637 tests, 56 suites)
  • swiftformat --lint . and swiftlint pass without violations
  • No runtime behavior change — pure compile-time rename and move
Checklist for engine changes
  • Docs updated if behavior changed (docs/architecture.md — protocol signature example updated)

… 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
@bguidolim bguidolim enabled auto-merge (squash) March 3, 2026 23:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/ (ExternalPromptDefinitionPromptDefinition, etc.)
  • Update call sites in install/configure flow and test mocks to use the new prompt types
  • Update architecture docs and remove redundant explicit Sendable conformances 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.

@bguidolim bguidolim merged commit 199406b into main Mar 4, 2026
4 checks passed
@bguidolim bguidolim deleted the feature/170-rename-prompt-definition branch March 4, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants