# refactor\(contracts\): keep RPC implementation exports private · PR \#10168 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/10168)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: cleanup-packages/contracts-internals

Target branch: cleanup-packages/client-internals

Head commit: e36f20d5472484276f6578e367a6179be22c8b48

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/10168)

[Commits](https://git.cafe/pingdotgg/t3code/pull/10168/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/10168/diffs?format=markdown)

## Description

---

Individual WebSocket RPC definitions are consumed through the assembled RPC group, not as separate package exports.

Keep those RPC implementation values and the runtime tool-lifecycle constant private. Preserve all Effect schemas, schema aliases, and exported types. This PR no longer rewrites schema aliases or their consumers.

Verification: contracts and consumer typechecks pass, existing contracts tests pass, and the integrated Knip gate passes. No existing tests were changed or removed.

Follows [#10167](https://github.com/pingdotgg/t3code/pull/10167).

<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. -->
> [!NOTE]
> ### Keep RPC implementation exports private in `contracts`
> Converts all exported RPC definition constants in [rpc.ts](https://github.com/pingdotgg/t3code/pull/10168/files#diff-64c16995299d1af309c72e94a298ffcb5c2ee5c65774cf0c73bf997358e9c266) and the `TOOL_LIFECYCLE_ITEM_TYPES` constant in [providerRuntime.ts](https://github.com/pingdotgg/t3code/pull/10168/files#diff-448aaf2dfbb7547d852cc74c6bba5caea16c3c782a5f9cfbf43da71648ec61f7) to module-private. Schema fields and behavior are unchanged; several `Rpc.make` calls were reformatted to a compact layout.
> - Risk: external consumers importing these constants by name will fail to compile. In-tree references must rely on the public RPC contract surface rather than the implementation constants.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized e36f20d.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->

Model: gpt-6 astra. Harness: Codex in T3 Code.

