IPC Contracts (#2276)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Modernizes IPC usage app-wide to new typed, namespaced contracts.
>
> - Refactors calls from `IpcClient` to `ipc.*` namespaces (system, app,
chat, github, git, version, languageModel, neon, visualEditing, context,
misc, capacitor, template, events, upgrade, agent, proposal)
> - Updates type imports from `"@/ipc/ipc_types"` to `"@/ipc/types"`
(e.g., `ListedApp`, security types) and adapts optional fields
> - Aligns method signatures to object params and new return shapes
(e.g., `getAppVersion` → `{ version }`); replaces various URL
opens/restarts/screenshots with `ipc.system.*`
> - Moves custom theme and theme generation ops to `ipc.template.*`;
adds maxOutputTokens in custom model dialogs; adjusts provider/model
management APIs
> - Switches GitHub/Vercel/Neon/Supabase/Capacitor connectors and
branching flows to new IPC endpoints; updates event subscriptions for
GitHub device flow
> - Normalizes logging/preview interactions and visual editing
apply/analyze via `ipc.misc`/`ipc.visualEditing`
>
> Potential follow-ups: verify all parameter objects and event handlers,
and update any remaining legacy imports.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7c574fe53296ba5c9a16d6b69d1008d06490534e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adopted the new typed IPC contracts across the app, replacing IpcClient
with namespaced ipc methods. Restored app output streaming via events,
added maxOutputTokens for custom model flows, migrated custom theme
operations to ipc.template, and fixed chat stream cancellation
lifecycle.
- **Refactors**
- Replaced IpcClient usage with ipc.* namespaces (system, app, chat,
github, git, version, languageModel, neon, visualEditing, context,
prompt, mcp, misc, capacitor, template, events, upgrade, agent,
proposal).
- Moved type imports from "@/ipc/ipc_types" to "@/ipc/types"; adjusted
renamed types and paths (e.g., ListedApp under "@/ipc/types/app",
security types under "@/ipc/types/security").
- Updated method signatures to use object params and new return shapes
(e.g., getAppVersion returns { version }).
- Subscribed to ipc.events.misc.onAppOutput in useRunApp to process app
output, restore preview URL updates, and handle HMR after API changes.
- Added missing maxOutputTokens in create/edit custom model dialogs;
small UI and hooks changes to align with new contracts.
- Fixed DeepLinkData typing by re-exporting a discriminated union for
correct type narrowing.
- Migrated custom themes and theme generation to ipc.template.*; added
CustomTheme and theme generation types.
- Moved methods to correct namespaces (e.g., takeScreenshot/restartDyad
→ system; checkProblems → misc).
- Emit chat:stream:end on stream cancellation for consistent renderer
cleanup.
- **Migration**
- Replace any remaining IpcClient references with ipc.*.
- Update type imports to "@/ipc/types" and adjust for changed/optional
fields (e.g., App lists use ListedApp; Collaborator.permissions and
VercelProject.framework may be optional).
- Verify callers for new parameter objects and result shapes; replace
runApp/restartApp callbacks with ipc.events.misc.onAppOutput
subscriptions.
<sup>Written for commit 7c574fe53296ba5c9a16d6b69d1008d06490534e.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2276">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
---------
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
正在显示
src/ipc/contracts/core.ts
0 → 100644
差异被折叠。
src/ipc/handlers/base.ts
0 → 100644
差异被折叠。
src/ipc/ipc_client.ts
deleted
100644 → 0
差异被折叠。
src/ipc/ipc_types.ts
deleted
100644 → 0
差异被折叠。
src/ipc/preload/channels.ts
0 → 100644
差异被折叠。
src/ipc/types/agent.ts
0 → 100644
差异被折叠。
src/ipc/types/app.ts
0 → 100644
差异被折叠。
src/ipc/types/capacitor.ts
0 → 100644
差异被折叠。
src/ipc/types/chat.ts
0 → 100644
差异被折叠。
src/ipc/types/context.ts
0 → 100644
差异被折叠。
src/ipc/types/github.ts
0 → 100644
差异被折叠。
src/ipc/types/help.ts
0 → 100644
差异被折叠。
src/ipc/types/import.ts
0 → 100644
差异被折叠。
src/ipc/types/index.ts
0 → 100644
差异被折叠。
src/ipc/types/language-model.ts
0 → 100644
差异被折叠。
src/ipc/types/mcp.ts
0 → 100644
差异被折叠。
src/ipc/types/misc.ts
0 → 100644
差异被折叠。
src/ipc/types/neon.ts
0 → 100644
差异被折叠。
src/ipc/types/prompts.ts
0 → 100644
差异被折叠。
src/ipc/types/proposals.ts
0 → 100644
差异被折叠。
src/ipc/types/security.ts
0 → 100644
差异被折叠。
src/ipc/types/settings.ts
0 → 100644
差异被折叠。
src/ipc/types/supabase.ts
0 → 100644
差异被折叠。
src/ipc/types/system.ts
0 → 100644
差异被折叠。
src/ipc/types/templates.ts
0 → 100644
差异被折叠。
src/ipc/types/upgrade.ts
0 → 100644
差异被折叠。
src/ipc/types/vercel.ts
0 → 100644
差异被折叠。
src/ipc/types/version.ts
0 → 100644
差异被折叠。
src/ipc/types/visual-editing.ts
0 → 100644
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
请
注册
或者
登录
后发表评论