Skip to content

refactor: modularize backend packages, DDD contracts, and leaf tool packages - #160

Merged
phantom5099 merged 3 commits into
mainfrom
codex/modular-packages-and-tools
Nov 29, 2026
Merged

phantom5099 merged 3 commits into
mainfrom
codex/modular-packages-and-tools

Conversation

@phantom5099

Copy link
Copy Markdown
Owner

Summary

  • Modularize backend monorepo & align DDD contracts: Split @codingcode/core into clean single-responsibility workspace packages under packages/codingcode/* with callee-owned command structs (ClaimTurnCommand, EnsureBaselineCommand, OfferMailboxCommand, SandboxConfig), narrow value objects (SessionLocator / SessionRef), and browser-clean @codingcode/sdk exports.
  • Extract @codingcode/mailbox from @codingcode/session: Move inter-agent mailbox queue out of session into an independent package (Queue.unbounded + OfferMailboxCommand).
  • Replace raw hook strings with HOOK_POINT constants: Define HOOK_POINT in @codingcode/hook, re-export from @codingcode/sdk, and replace all raw hook literals across backend packages and desktop UI.
  • Extract concrete tools out of @codingcode/tool (dsh-style acyclic DAG):
    • Narrow @codingcode/tool to pure registry/executor (ToolRegistryService, makeToolRegistryLayer, pure createToolCatalog) and remove SubagentToolHostService + global TOOLS_BY_NAME.
    • Extract domain tool packages without tool- prefix: @codingcode/fs, @codingcode/bash, @codingcode/web, @codingcode/self.
    • Move SpawnSubagentRequest / SubagentHandle and the 6 subagent tools directly into @codingcode/subagent (src/tools/), consuming SubagentRunRegistryService directly without circular dependencies.
    • Register all domain toolsets in packages/codingcode/app/src/layer.ts.

Verification

  • pnpm install --offline (32 workspace projects, zero cyclic workspace warnings)
  • pnpm exec tsc -b (0 errors)
  • pnpm exec vitest run (148 / 148 test files, 909 / 909 tests passed)
  • pnpm run lint (0 errors)
  • pnpm --filter @codingcode/app run bundle (dist/cli.bundle.js built cleanly)

@phantom5099
phantom5099 merged commit 88614a6 into main Nov 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant