githubnext/chopinPublic

Let's compose rich plans together

Give the room an agent to plan with

Three tools and a conversation. The planner reads the plan, edits it by block
against the revision it read, and asks the people in the room when the
repository cannot settle something — and the answer comes back attributed, so
it can write down who decided what.

The transcript is shared, like everything else here. One turn runs at a time,
but the composer stays live: a turn owns the plan, not the conversation, and
messages sent meanwhile queue in order with their author's name attached rather
than being refused. Every message reaches the model prefixed with its speaker's
handle, because a planner working with a group has to be able to say that Alice
preferred one thing and Bob raised another.

Two things about the SDK that are not obvious from its surface. `send` resolves
when a message is accepted, not when the turn is over — waiting on it alone
tears the handler down before the agent has said anything, so a turn ends on
`session.idle`. And everything worth reading lives under `event.data` rather
than on the event, which fails silently as empty text and tools all named
"tool".

Starting without a working agent is refused rather than degraded, since a
misconfigured one is discovered in seconds by asking and otherwise surfaces
when somebody types their first message. `AGENT=off` is the deliberate way to
run without one; tests use it, having no business spawning a language model.
KCKrzysztof Cieslak authored
735f346Patch
Parent1e12f9e
17 files changed+1262-29
StackedSplit
apps/server/src/agent/tools.ts+206 −0
apps/server/src/chat/service.ts+423 −0
apps/server/src/client.test.ts+1 −0
apps/server/src/config.ts+12 −0
apps/server/src/main.test.ts+7 −1
apps/server/src/main.ts+45 −1
apps/server/src/plan.test.ts+7 −1
apps/server/src/plan/service.ts+40 −1
apps/server/src/plan/snapshot.ts+4 −0
apps/server/src/questions/service.ts+5 −23
apps/web/src/app.tsx+23 −1
apps/web/src/chat/chat.tsx+196 −0
apps/web/src/chat/transcript.tsx+146 −0
apps/web/src/collab.test.ts+7 −1
apps/web/src/face.tsx+39 −0
packages/protocol/chat.d.ts+98 −0
packages/protocol/index.d.ts+3 −0