# refactor\(project\): share create and update inputs · PR \#10578 · pingdotgg/t3code

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

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

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: agents/mcp-shared/project-inputs

Target branch: agents/mcp-shared/model-selection

Head commit: 80736156baa52edd357468cb49a39fd3782d4ad0

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

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

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

## Description

---

Part 2/16 of the [shared-core and MCP stack](https://github.com/pingdotgg/t3code/stacks/10582). Based on [#10577](https://github.com/pingdotgg/t3code/pull/10577). Next: [#10580](https://github.com/pingdotgg/t3code/pull/10580).

Project create/update fields were separately defined by the RPC contract, service input types, and MCP tools. This exports ProjectCreatePayload and ProjectUpdatePayload from contracts, composes the existing ProjectMutation envelope from them, and derives ProjectService input types from the same payloads. MCP consumes them in its own layer.

Existing RPC fields and omitted/null/false behavior are preserved, including explicit undefined for internal RPC callers. No project service execution, authorization, or deletion behavior changes.

Validation: Contracts, project service and HTTP mapping suites: 20 tests passed. Independent server/contracts typechecks passed. The contract regression covers trimmed input and omitted/null/false values through the RPC envelope.

Layer size: 3 files, +69/-32. No MCP tools are introduced in this prerequisite.

Prepared with Codex in the OpenAI agent runtime.

<!-- 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]
> ### Extract `ProjectCreatePayload` and `ProjectUpdatePayload` schemas for shared project inputs
> - Splits the create and update field definitions out of the `ProjectMutation` union in [project.ts](https://github.com/pingdotgg/t3code/pull/10578/files#diff-8884ce1953b4cd4c0485483959ee19cfc087d42ff24c02d5f59af5957d80ec5f) into standalone exported `ProjectCreatePayload` and `ProjectUpdatePayload` schemas and inferred types.
> - Refactors `ProjectCreateInput` and `ProjectUpdateInput` in [ProjectService.ts](https://github.com/pingdotgg/t3code/pull/10578/files#diff-2d4902da35b90c0995e0574e3a79ff67533daf562ebe083ac15c843bd73e7a1e) to extend the shared payload contracts, keeping only `commandId` and `projectId` locally.
> - Adds tests in [project.test.ts](https://github.com/pingdotgg/t3code/pull/10578/files#diff-0c22633439ab1787d811ad232c392083a71b27b346235d2d0bb4a0ea8adee0a6) covering optional/nullable field behavior: omitted properties stay omitted, `false` and `null` are preserved, and explicitly-supplied `undefined` update properties remain present.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 8073615.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->
