How jinjutroy/paos works
Purpose and Runtime Shape
PAOS is a local-first TypeScript/Node 24 personal operating system. OpenClaw owns conversational orchestration and invokes PAOS through MCP; PAOS owns durable workflows, local state, APIs, and adapters. Primary executable entry points are the HTTP API, stdio MCP server, and scheduled-job worker: apps/api/src/index.ts, apps/mcp/src/index.ts, apps/worker/src/index.ts.
Edge Adapters and Control Boundaries
The API server exposes domain workflows over HTTP, while the MCP process maps OpenClaw/client tool calls into the same service layer. The worker independently consumes scheduled jobs; it is not an HTTP/MCP execution path. Adapter wiring is concentrated in apps/api/src/server.ts, apps/mcp/src/tools.ts, and apps/worker/src/worker.ts. OpenClaw registration/configuration lives outside application code in openclaw/mcp-server.paos.json and openclaw/openclaw.paos.example.json5.
Shared Platform Layer
Cross-cutting packages define configuration, redacted structured logging, domain errors, database access/migrations, and queue abstractions. This isolates modules from process environment and infrastructure implementation: packages/config/src/index.ts, packages/logging/src/index.ts, packages/core/src/errors.ts, packages/db/src/client.ts, packages/db/src/migrations.ts.
Durable Storage and Async Execution
PostgreSQL is the default durable repository backend for todos, projects, and calendar state; schema evolution is explicit in packages/db/migrations/001_initial.sql through packages/db/migrations/004_google_calendar_writes.sql. Redis is the default queue backend, supporting scheduled jobs, leases, retries, and dead-letter state; memory implementations provide short-lived/test alternatives. Key boundaries are packages/queue/src/redis-queue.ts, packages/queue/src/memory-queue.ts, and apps/worker/src/queue-worker.ts. Docker Compose provides PostgreSQL, Redis, and PAOS services: docker-compose.yml.
Personal Workflow Modules
Domain modules expose domain/service interfaces while selectively supply PostgreSQL runtime repositories:
• Todos and projects provide the core actionable-work records: packages/modules/todos/src/service.ts, packages/modules/todos/src/postgres-repository.ts, packages/modules/projects/src/service.ts, packages/modules/projects/src/postgres-repository.ts.
• Reminders schedule work through the queue: packages/modules/reminders/src/service.ts.
• Filesystem memory confines Markdown data to a configured root; journal and planning build personal notes and daily-plan workflows on that local boundary: packages/filesystem-memory/src/store.ts, packages/modules/journal/src/service.ts, packages/modules/planning/src/service.ts.
Planning and Calendar Flow
Planning reads project/todo work and daily-plan inputs to generate plans, calendar block proposals, and read-only adaptive intelligence such as capacity, workload, schedules, and conflicts. Its calendar handoff is proposal-oriented: packages/modules/planning/src/intelligence.ts, packages/modules/planning/src/plan-calendar.ts, packages/modules/calendar/src/service.ts. Calendar maintains a local event cache, normalizes/imports provider events, and supports agenda/free-time operations via packages/modules/calendar/src/postgres-repository.ts and packages/modules/calendar/src/google-sync.ts.
External-Action Safety Boundary
Google Calendar writes are deliberately split from external execution. PAOS prepares approval-gated write proposals and persists write records only after explicit confirmation plus a trusted connector result; it does not embed provider execution. This boundary is implemented in packages/modules/calendar/src/google-write.ts and packages/modules/calendar/src/google-write-repository.ts. Google Calendar, OpenClaw, and allowlisted Telegram are material external integrations; the verified deployment remains local-stack/live-owner verified rather than production-ready.
Main entry points: server.ts Adapter wiring · src/service.ts Journal and planning · client.ts PostgreSQL · src/service.ts Calendar
Components 21
Process adapters
Independent HTTP, MCP, and worker runtimes.
- HTTP API
apps/api/src/index.ts - stdio MCP server
apps/mcp/src/index.ts - Scheduled-job worker · Consumes queue jobs independently of request adapters.
apps/worker/src/index.ts - Adapter wiring · Maps HTTP and MCP calls to shared services.
apps/api/src/server.ts - Queue consumer
apps/worker/src/queue-worker.ts
Platform
Shared infrastructure boundaries.
- Runtime foundations · Environment isolation, redacted logs, and domain errors.
packages/config/src/index.ts - PostgreSQL · Default state for work records and calendar cache.
packages/db/src/client.ts - Database migrations · Explicit schema changes through Google Calendar writes.
packages/db/src/migrations.ts - Redis queue · Schedules jobs with leases, retries, and dead-letter state.
packages/queue/src/redis-queue.ts - Local stack · Runs PostgreSQL, Redis, and PAOS services.
docker-compose.yml
Personal workflows
Durable domain services and planning.
- Todos and projects · Core actionable-work records.
packages/modules/todos/src/service.ts - Reminders · Schedules reminder work through the queue.
packages/modules/reminders/src/service.ts - Filesystem memory · Confines local notes to a configured root.
packages/filesystem-memory/src/store.ts - Journal and planning · Builds notes, daily plans, and calendar proposals.
packages/modules/planning/src/service.ts - Planning intelligence · Computes capacity, workload, schedules, and conflicts.
packages/modules/planning/src/intelligence.ts - Calendar · Agenda and free-time operations over local event state.
packages/modules/calendar/src/service.ts - Calendar cache and sync · Normalizes and imports provider events into local state.
packages/modules/calendar/src/google-sync.ts
External integrations
Approval and provider boundaries.
- OpenClaw · Invokes PAOS tools through MCP.
- OpenClaw registration · Registers the PAOS MCP server outside application code.
openclaw/mcp-server.paos.json - Approval-gated writes · Persists writes only after explicit confirmation and trusted results.
packages/modules/calendar/src/google-write.ts - Google Calendar
Connections 24
- OpenClaw registration → OpenClaw: registers PAOS MCP
- OpenClaw → stdio MCP server: tool calls
- HTTP API → Adapter wiring: HTTP requests
- stdio MCP server → Adapter wiring: MCP tools
- Adapter wiring → Todos and projects: invokes
- Adapter wiring → Reminders: invokes
- Adapter wiring → Journal and planning: invokes
- Scheduled-job worker → Queue consumer: runs
- Queue consumer → Redis queue: consumes jobs
- Reminders → Redis queue: schedules jobs
- Todos and projects → PostgreSQL: persists
- Journal and planning → Todos and projects: reads work
- Journal and planning → Filesystem memory: reads daily inputs
- Journal and planning → Planning intelligence: uses
- Journal and planning → Calendar: submits proposals
- Calendar → Calendar cache and sync: uses
- Calendar cache and sync → PostgreSQL: caches events
- Calendar cache and sync → Google Calendar: imports events
- Calendar → Approval-gated writes: prepares confirmed writes
- Approval-gated writes → Google Calendar: trusted connector result
- Database migrations → PostgreSQL: evolves schema
- Local stack → PostgreSQL: runs
- Local stack → Redis queue: runs
- Runtime foundations → Adapter wiring: cross-cutting support