Uh oh!
There was an error while loading. Please reload this page.
chore(main): extract tool-assembly + artifact-persistence from main.ts (arch R4) - #1246
Merged
Conversation
…arch R4)
Pure move of the tool-artifact persistence cluster out of main.ts:
persistToolArtifacts / snapshotReadImage / persistArchivedToolResult /
readArchivedToolResult, plus the internal resolveToolArtifactSourcePath /
isInsideOrSamePath path-safety helpers. createToolArtifactPersistence takes an
explicit { artifactStore, storeReadImage, safeSendToRenderer } deps object,
matching the house register*/create* DI style. Zero behavior change.Pure move of main.ts's module-scope tool-assembly block into tool-assembly.ts: assembleDesktopTools(deps) builds the sandbox / filesystem worker, the deferred capability groups (Rive, Office, browser, computer-use, agent orchestration), the WebSearch tool, the builtin + skill host surface, the deferred-group toolAvailability, and childAgentTools, and returns the 11 collections main.ts consumes downstream. main.ts keeps every call site plus the seams that must stay module-scoped: the backends.register ai-sdk closure (modelSupportsVision unchanged), systemPromptService, storeReadImage, and the onMainWindowClose cursor-overlay teardown (assigns a module let). Declaration order inside assembleDesktopTools preserves the original init order. main.ts 1903 -> 1656 (-247). Zero behavior change.
…urce (arch R4) Extend the main-process-contract-source-helpers aggregator with tool-assembly.ts and tool-artifact-persistence.ts so every combined-source consumer auto-covers the moved symbols. Switch three direct-main.ts readers to the combined source, keeping every assertion: agent-swarm-host-contract (buildParentAgentTools + buildDeferredToolGroupsFromCatalog), agent-team-collaboration-contract (childAgentTools + team tool builders), attachment-frontend-contract (snapshotReadImage). Relax the block-closer regexes in permission-response-ipc-boundary to tolerate the now-indented in-function brackets. registerIpc stays anchored in main.ts (main-process-wiring-contract untouched).
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 4 of notes/frontend-architecture-map-2026-07-19.md: main.ts 1903 → 1656 (−247).
tool-assembly.ts(277 L): the module-scope tool-assembly block (~L640-817) becomesassembleDesktopTools(deps)— sandbox/filesystem workers, agent/team/deferred/web-search/skill tools, computer-use host, product-binding assertion; 11 symbols returned to main.tool-artifact-persistence.ts(124 L):createToolArtifactPersistence(deps)DI factory (persist/snapshot/archive/read paths, containment checks).letwiring.Gates (merged tree): desktop 2744 · ui 196 · typecheck · check-dead-css · knip ×2 = 0. Implemented by an opus worktree agent; R5/R6 boundaries in the map shifted accordingly.