Skip to content

Migrate consumers off responses/index.ts barrel and remove it #332

@cameroncooke

Description

@cameroncooke

Context

PR #321 (refactor 3/12) deleted src/utils/responses/index.ts and removed processToolResponse from next-steps-renderer.ts, but ~50 files still import from the barrel. This broke the docs:check pre-commit hook (and would break runtime) because the CLI loads all tools at boot.

PR #322 restored both the barrel and processToolResponse as a stopgap.

What needs to happen

  1. Migrate all ~50 consumers of src/utils/responses/index.ts to import directly from source modules:
    • createTextResponse from ../utils/validation.ts
    • createErrorResponse, ValidationError, SystemError, DependencyError, AxeError from ../utils/errors.ts
    • processToolResponse, renderNextStep, renderNextStepsSection from ../utils/responses/next-steps-renderer.ts
    • Types from ../../types/common.ts
  2. Delete src/utils/responses/index.ts once no consumers remain
  3. Confirm processToolResponse is still needed by tool-registry.ts and cli/output.ts, or refactor those call sites if the rendering pipeline has replaced it

Files importing from the barrel

src/utils/typed-tool-factory.ts
src/utils/tool-registry.ts
src/utils/simulator-utils.ts
src/cli/output.ts
src/runtime/tool-invoker.ts
src/integrations/xcode-tools-bridge/standalone.ts
src/integrations/xcode-tools-bridge/manager.ts
src/utils/debugger/ui-automation-guard.ts
src/mcp/tools/simulator/build_run_sim.ts
src/mcp/tools/simulator/get_sim_app_path.ts
src/mcp/tools/simulator/record_sim_video.ts
src/mcp/tools/device/build_run_device.ts
src/mcp/tools/device/get_device_app_path.ts
src/mcp/tools/device/test_device.ts
src/mcp/tools/macos/test_macos.ts
src/mcp/tools/macos/build_run_macos.ts
src/mcp/tools/project-discovery/list_schemes.ts
src/mcp/tools/project-discovery/show_build_settings.ts
src/mcp/tools/project-scaffolding/scaffold_ios_project.ts
src/mcp/tools/project-scaffolding/scaffold_macos_project.ts
src/mcp/tools/swift-package/*.ts
src/mcp/tools/debugging/*.ts
src/mcp/tools/ui-automation/*.ts
src/mcp/tools/utilities/clean.ts
src/mcp/tools/workflow-discovery/manage_workflows.ts
src/mcp/tools/xcode-ide/*.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions