Product Objects & Platform Boundaries
The product layer separates conversation, execution, and delivery
Users operate conversations, tasks, teams, schedules, and deliverables—not an agent loop, tool registry, or context window. aibuddy models these concepts as separate objects so work remains inspectable after a page closes, a connection drops, or a sandbox is released.
| Product object | What it retains | Relationship to execution |
|---|---|---|
| Chat | Continuing conversation, participants, and message timeline | Hosts ordinary agent turns and can contain Team member process and delivery |
| Task | Goal, messages, state, steps, and run configuration | Hosts one traceable execution; a Schedule can create or continue a Task |
| Team | Members, dependencies, and shared objective | Coordinates persistent members inside a conversation and returns results to its timeline |
| Schedule | Time rule, target kind, model, and run records | Creates a new Task or continues an owned parent Task when it fires |
| Project, Knowledge, Skill | File environment, formal source material, and reusable procedure | Constrain the work environment and available capabilities before execution |
| Delivery, Artifact | One delivery event and its durable files | Triggered by complete, separating results from messages and sandbox lifetime |
These objects are not a flat feature list. Chat and Task are execution hosts; Team and Schedule add coordination and time-based triggering; Project, Knowledge, and Skill supply resources; Delivery records what reached the user. The boundaries attach ownership, state, and recovery to specific records.
Deliverables leave the task sandbox after complete
A file written in a sandbox is still an execution artifact. Only after the agent calls complete with its paths does DeliveryService read the bytes, store them in platform file storage, and persist a Delivery event with Artifact indexes. Preview and download read that file storage after another ownership check, so they do not require the original sandbox to remain alive.
Materialization maintains four boundaries:
- It handles files, not directories presented as downloadable output.
- The current per-file materialization limit is 25 MiB. An oversized or unreadable file does not create an empty index that later returns 404.
- The same path under one execution host reuses a stable Artifact identity, updating current content instead of accumulating revisions indefinitely.
- The Delivery event is written last and only when at least one file was materialized.
Agent delivery and durable platform storage are therefore adjacent but distinct steps. Per-file persistence is best effort and does not rewrite already-completed agent work as an execution failure.
Shared core is reused through ports, not shared infrastructure
Web and Desktop share the React product surface, data contracts, Hono route assembly, and domain services. Differences live at each composition root, where the host supplies repository, file storage, authentication, queue, realtime transport, scheduler, sandbox, and MCP implementations.
The reuse goes beyond TypeScript types. The Desktop main process starts the same createApp used by Server over SQLite-backed services and a fixed local identity, then exposes it to the Renderer through loopback HTTP, SSE, and WebSocket. Web Server connects the same route tree to hosted identity, PostgreSQL, object storage, Redis, and workers. Route and service semantics can evolve together without pretending infrastructure failures are identical.
Web and Desktop fill the same ports differently
| Platform concern | Web | Desktop |
|---|---|---|
| Identity | Hosted session, resource ownership, and role checks | Fixed local-user; the owner of the local instance receives the admin role |
| Structured persistence | PostgreSQL | Local SQLite |
| File persistence | R2/S3-compatible object storage | Local file storage under the application data directory |
| API | createApp on the remote Server | The same createApp in the main process on loopback port 8003 |
| Agent execution | Server or worker execution using the current Node sandbox adapter | Main-process execution that can enter a selected local project |
| Realtime path | Task over SSE and Chat over WebSocket; Redis can provide cross-process buffering and distribution | Task over loopback SSE with replay and continuation from a main-process memory buffer; Chat over loopback WebSocket |
| MCP | Connect to server-reachable MCP services with server-side credential injection | Can launch local MCP child processes over stdio |
| Knowledge summary | Generated asynchronously when a summarizer is configured | No summarizer is currently wired; authored during review |
Desktop API keys are protected with Electron safeStorage before persistence; MCP environment variables remain part of the corresponding transport configuration. Web credential protection depends on server configuration and the deployment storage boundary. Both hosts still enforce ownership in the service layer; being local or inside a trusted network does not remove resource authorization.
Background execution shares a domain pipeline; hosts confirm completion
Schedule is a direct example of the port design. ScheduleService and createScheduleFireHandler own reloading current configuration, computing the next time, checking enabled state and quota, selecting a new or continuation Task, recording the fire, and decrementing runsRemaining after successful dispatch. The host supplies the scheduler and execution action.
A fully configured Web deployment uses Redis/BullMQ scheduling and worker execution. Its action returns a drainPromise, so the Schedule run moves from running to success or failed only after the task event stream drains. Desktop uses an interval scheduler in the main process and starts background work without requiring the Renderer to stay open.
The current Desktop Schedule adapter does not return the runInBackground completion promise to the shared fire pipeline. A dispatched run therefore does not immediately receive a terminal status; reconciliation marks an orphaned running record incomplete after process restart. This is a concrete host-completion parity gap, not capability already guaranteed by the shared Schedule model.
Platform consistency does not imply feature parity
The shared layer gives a Task, Delivery, or Knowledge state the same meaning on both hosts, but it does not erase host differences:
- Without Redis, some Web queue, lock, and stream-buffer behavior degrades to process-local implementations.
- Desktop Task-stream recovery covers Renderer disconnects while the main process remains alive. After reload, navigation, or dock closure, the client can replay buffered chunks and continue with live output; after the main process exits, recovery falls back to persisted messages. Ordinary Chat still does not accept the HITL-output and resume messages supported by the Web path.
- Prompt-version and some preference-management routes are not yet injected into the Desktop loopback API.
- Sandbox configuration includes Daytona and E2B variants, but the factory currently implements only the Node adapter.
- Knowledge summarization and Schedule completion confirmation retain the platform differences described above.
These limits belong explicitly in the composition root and product capability map. Shared interfaces make differences locatable and replaceable; they do not justify describing the two platforms as identical.
Implementation anchors
| Responsibility | Implementation |
|---|---|
| Shared product UI and client contracts | @aibuddy/app, @aibuddy/common |
| Shared HTTP route assembly | createApp in @aibuddy/http |
| Agent, Task, Schedule, and Delivery semantics | @aibuddy/core |
| Web repository and service composition | apps/server/src/service-registry.ts |
| Desktop service composition | registerAllHandlers |
| Desktop loopback API | startLocalApiServer |
| Desktop Task-stream recovery | createDesktopTaskStreamer, createInMemoryStreamBuffer |
| Deliverable materialization | DeliveryService |
| Platform-neutral schedule firing | ScheduleService, createScheduleFireHandler |
Related reading
- Quick Start for choosing the practical Web or Desktop path.
- Runtime & Lifecycles for work that continues across requests, waits, and recovery.
- Authentication & Identity for hosted identity, ownership, and local identity boundaries.
- Background Jobs for Web worker delivery, idempotency, and recovery.
- Architecture for package dependencies and platform composition roots.