Add durable background agent runtime #113MergedKrzysztof-Cieslakmerged 16 commits intomainfromrefs/pull/113/headConversationFiles changed136 files changed+26749-415StackedSplit.env.example+2 −0AGENTS.md+5 −3README.md+27 −12apps/server/src/agent/active-owner.test.ts+182 −0apps/server/src/agent/active-owner.ts+215 −0apps/server/src/agent/client.ts+351 −49apps/server/src/agent/hosted.test.ts+333 −3apps/server/src/agent/permissions.ts+46 −0apps/server/src/agent/planner.test.ts+24 −0apps/server/src/agent/planner.ts+25 −0apps/server/src/agent/runtime.test.ts+290 −0apps/server/src/agent/runtime.ts+222 −0apps/server/src/agent/tools.test.ts+259 −13apps/server/src/agent/tools.ts+117 −1apps/server/src/chat/address.test.ts+59 −1apps/server/src/chat/address.ts+74 −13apps/server/src/chat/hosted.test.ts+36 −0apps/server/src/chat/incoming.test.ts+46 −0apps/server/src/chat/incoming.ts+23 −0apps/server/src/chat/queue.test.ts+514 −12apps/server/src/chat/references.test.ts+578 −0apps/server/src/chat/references.ts+714 −0apps/server/src/chat/service.test.ts+156 −1apps/server/src/chat/service.ts+488 −63apps/server/src/config.test.ts+22 −0apps/server/src/config.ts+9 −1apps/server/src/jobs/browser.test.ts+155 −0apps/server/src/jobs/browser.ts+86 −0apps/server/src/jobs/document-summary.test.ts+251 −0apps/server/src/jobs/document-summary.ts+361 −0apps/server/src/jobs/registry.ts+225 −0apps/server/src/jobs/research-workspace.test.ts+550 −0apps/server/src/jobs/research-workspace.ts+1396 −0apps/server/src/jobs/runner.test.ts+816 −0apps/server/src/jobs/runner.ts+845 −0apps/server/src/jobs/service.test.ts+468 −0apps/server/src/jobs/service.ts+611 −0apps/server/src/jobs/summary-coordinator.ts+130 −0apps/server/src/main.ts+374 −26apps/server/src/mcp/hosted.ts+16 −1apps/server/src/plan/persistence.test.ts+96 −1apps/server/src/plan/service.ts+78 −9apps/server/src/research/routes.test.ts+373 −0apps/server/src/research/routes.ts+413 −0apps/server/src/research/service.test.ts+445 −0apps/server/src/research/service.ts+1072 −0apps/server/src/storage/contract.ts+770 −1apps/server/src/storage/memory/adapter.ts+30 −0apps/server/src/storage/memory/jobs.ts+472 −0apps/server/src/storage/memory/research.ts+576 −0apps/server/src/storage/model.ts+322 −0apps/server/src/storage/port.ts+65 −0apps/server/src/storage/postgres/adapter.test.ts+298 −0apps/server/src/storage/postgres/adapter.ts+63 −1apps/server/src/storage/postgres/jobs.ts+785 −0apps/server/src/storage/postgres/migrations.ts+12 −0apps/server/src/storage/postgres/migrations/004_background_jobs.sql+69 −0apps/server/src/storage/postgres/migrations/005_background_job_failures.sql+2 −0apps/server/src/storage/postgres/migrations/006_background_job_progress.sql+5 −0apps/server/src/storage/postgres/migrations/007_research_workspaces.sql+81 −0apps/server/src/storage/postgres/research.ts+975 −0apps/server/src/storage/progress.ts+101 −0apps/web/src/api.ts+126 −0apps/web/src/chat/chat.tsx+262 −17apps/web/src/chat/markdown.css+11 −0apps/web/src/chat/markdown.test.ts+121 −2apps/web/src/chat/markdown.tsx+42 −3apps/web/src/chat/model.test.ts+28 −0apps/web/src/chat/model.ts+2 −0apps/web/src/chat/reference-markdown.ts+178 −0apps/web/src/chat/reference-picker.test.ts+316 −0apps/web/src/chat/reference-picker.tsx+322 −0apps/web/src/chat/references.test.ts+339 −0apps/web/src/chat/references.ts+502 −0apps/web/src/chat/transcript.tsx+4 −2apps/web/src/decision-view-control.tsx+27 −2apps/web/src/decision-view.test.ts+39 −1apps/web/src/hosted.test.ts+11 −0apps/web/src/hosted.tsx+98 −28apps/web/src/navigation-chrome.test.ts+0 −3apps/web/src/navigation-shell.tsx+98 −6apps/web/src/navigation.css+53 −1apps/web/src/project-sidebar.tsx+102 −32apps/web/src/research-actions.tsx+99 −0apps/web/src/research-navigation.test.ts+87 −0apps/web/src/research-navigation.ts+128 −0apps/web/src/research-sidebar.test.ts+105 −0apps/web/src/research-workspace-model.test.ts+163 −0apps/web/src/research-workspace-model.ts+220 −0apps/web/src/research-workspace.css+597 −0apps/web/src/research-workspace.tsx+927 −0apps/web/src/room-workspace.tsx+106 −9apps/web/src/use-project-research.ts+140 −0apps/web/src/workspace-model.test.ts+13 −0apps/web/src/workspace-model.ts+14 −2apps/web/src/workspace.tsx+56 −8compose.yaml+2 −0docs/architecture.md+31 −17docs/background-jobs.md+696 −0docs/channels.md+17 −1docs/hosted-agent.md+49 −11docs/self-hosting.md+15 −6docs/storage.md+36 −16e2e/chat-references.e2e.ts+335 −0e2e/database.ts+375 −0e2e/document-navigation.e2e.ts+2 −2e2e/jobs.e2e.ts+50 −0e2e/playwright.config.ts+2 −0e2e/research-workspace.e2e.ts+237 −0e2e/responsive-workspace.e2e.ts+11 −2e2e/smoke.e2e.ts+9 −5packages/dialect/package.json+4 −0packages/dialect/src/chunk.test.ts+48 −0packages/dialect/src/chunk.ts+54 −0packages/dialect/src/index.ts+2 −0packages/editor/src/background-work.test.ts+156 −0packages/editor/src/background-work.tsx+234 −0packages/editor/src/decision-state.test.ts+2 −2packages/editor/src/decision-state.ts+1 −1packages/editor/src/index.ts+4 −0packages/editor/src/jobs.test.ts+155 −0packages/editor/src/jobs.ts+210 −0packages/editor/src/plan-editor.tsx+1 −0packages/editor/src/styles.css+79 −0packages/editor/src/threads.test.ts+7 −3packages/editor/src/threads.ts+9 −3packages/editor/src/toolbar/slash.tsx+11 −6packages/editor/src/widget-options.ts+1 −0packages/editor/src/widgets/enter.tsx+9 −9packages/protocol/chat.d.ts+40 −2packages/protocol/document-url.test.ts+104 −1packages/protocol/document-url.ts+36 −0packages/protocol/index.d.ts+10 −1packages/protocol/job.d.ts+88 −0packages/protocol/research.d.ts+75 −0scripts/compose.test.ts+2 −0