This document reflects the current structure after retirement. It is intended for developers entering the main Argos chat pipeline for the first time.
- Node.js
>= 24.14.1(24.14.1 recommended) - Bun
- Git
- An editor with TypeScript / React support (Tailwind IntelliSense, ES7+ React/Redux/React-Native snippets)
bun install
bun run installRuntime
bun run devCommon commands:
bun run dev
bun run dev:inspect
bun run start
bun run build
bun run typecheck
pnpm run format
pnpm run lint
pnpm testThe current main chat pipeline is not the legacy AgentPresenter, nor is it the renderer calling the presenter directly. Instead:
Renderer
-> renderer/api (SessionClient / ChatClient / ProviderClient / SettingsClient)
-> window.argos
-> shared/contracts/routes + shared/contracts/events
-> src/main/routes/*
-> presenter-backed hot path ports
-> agentSessionPresenter / agentRuntimePresenter / toolPresenter / llmProviderPresenter
If you see AgentPresenter, startStreamCompletion, or agentLoopHandler in old commits, those are retired implementations.
If you see useLegacyPresenter(), window.electron, or window.api in the current code, treat them as a compatibility layer, not as the default entry point for new features. The current default rules are documented in docs/ARCHITECTURE.md: new renderer-main capabilities go through renderer/api/*Client + window.argos + shared contracts; temporary legacy transport is only allowed inside src/renderer/api/legacy/**.
apps/
├── desktop/ # Electron app (this is where you usually start)
│ ├── src/
│ │ ├── main/ # main process
│ │ │ ├── appMain.ts # app entry (startApp())
│ │ │ ├── presenter/
│ │ │ │ ├── agentSessionPresenter/ # current session entry
│ │ │ │ ├── agentRuntimePresenter/ # current chat runtime
│ │ │ │ ├── toolPresenter/ # tool routing
│ │ │ │ │ └── agentTools/ # local agent tools
│ │ │ │ ├── llmProviderPresenter/ # provider management
│ │ │ │ │ └── acp/ # ACP helper
│ │ │ │ ├── mcpPresenter/ # MCP tools/runtime
│ │ │ │ ├── sessionPresenter/ # legacy data compatibility layer
│ │ │ │ └── ...
│ │ │ ├── lib/agentRuntime/ # shared runtime helpers
│ │ │ ├── eventbus.ts
│ │ │ └── events.ts
│ │ ├── renderer/ # React + TanStack Router app
│ │ │ ├── src/ # main renderer
│ │ │ ├── settings/ # settings renderer
│ │ │ ├── api/ # typed *Client boundary (renderer-main)
│ │ │ ├── floating/ # floating button renderer
│ │ │ └── browser/ # browser overlay renderer
│ │ ├── preload/ # secure IPC bridge
│ │ ├── shared/ # shared route + event contracts
│ │ ├── shadcn/ # shadcn/ui components
│ │ ├── resources/ # bundled assets, acp-registry, skills
│ │ └── test/ # Vitest suites (main + renderer)
│ ├── electron-builder.yml
│ ├── vite.config.ts # multi-env (main / preload / renderer)
│ └── package.json
└── daemon/ # background daemon (Bun) for shared backend logic
packages/
├── backend-core/ # shared backend logic
├── client-sdk/ # IPC bridge implementation
├── electron-adapter/ # Electron utilities
├── shared-contracts/ # shared route + event type contracts
└── shared/ # cross-package utilities
src/shared/contracts/routes.tssrc/shared/contracts/events.tssrc/preload/createBridge.tssrc/renderer/api/src/main/routes/index.tssrc/main/routes/sessions/sessionService.tssrc/main/routes/chat/chatService.tssrc/main/routes/providers/providerService.tssrc/main/presenter/agentSessionPresenter/index.tssrc/main/presenter/agentRuntimePresenter/index.ts
Look at these first:
src/main/presenter/agentSessionPresenter/index.tssrc/main/presenter/agentRuntimePresenter/process.tssrc/main/presenter/agentRuntimePresenter/dispatch.ts
Current active directories:
src/main/presenter/toolPresenter/agentTools/agentToolManager.ts- Corresponding handler:
agentFileSystemHandler.tsagentBashHandler.tschatSettingsTools.ts
- If permissions are involved, check
src/main/presenter/permission/
Look at these first:
src/main/presenter/llmProviderPresenter/index.tssrc/main/presenter/llmProviderPresenter/providers/acpProvider.tssrc/main/presenter/llmProviderPresenter/acp/
Look at these first:
src/main/presenter/agentSessionPresenter/legacyImportService.tssrc/main/presenter/sessionPresenter/index.tssrc/main/presenter/exporter/formats/
After making changes, run at minimum:
pnpm run format
pnpm run lint
bun run typecheckIf you changed the main-process chat pipeline, also run the relevant Vitest suites and execute:
node scripts/agent-cleanup-guard.mjsIf you changed the renderer-main boundary, additionally run:
pnpm run lint:architectureHistorical SDD documents and old architecture snapshots are no longer kept in docs/ long term. To compare with old implementations, use git log -- docs or git show <commit>:<path> to view the relevant commit.