githubnext/chopinPublic

Let's compose rich plans together

Add durable background agent runtime #113

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