CMP-1 Add durable custom agent builder - #25
Draft
ripgrim wants to merge 27 commits into
Draft
Conversation
|
@ripgrim is attempting to deploy a commit to the Comp AI - PoC Team on Vercel. A member of the Team first needs to authorize it. |
# Conflicts: # apps/app/components/app-icon-rail.tsx
# Conflicts: # apps/app/app/eve/v1/[...path]/route.ts # apps/app/components/app-icon-rail.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
this adds a private agent builder to the existing crm and turns the resulting drafts into durable, workspace-visible agents. a rep can start a chat, answer structured follow-up questions, review the generated files, deploy the agent, run it manually, inspect its activity, pause it, resume it, or delete it.
builder conversations stay private to their owner. live, paused, and archived agents are visible to workspace members. the creator or a workspace admin can manage them.
the branch is synced with current
main, including the newer currency, telemetry, landing, and organization routing work.product changes
/:org-slug/agents, private builder chats, team agent detail pages, loading states, redirects, and mobile navigationagent runtime
the eve process now separates record research, builder, and runner sessions instead of treating every conversation as the same kind of work.
agent_builderreceives the private conversation context, asks for missing information, writes revisioned artifacts, and saves a version-ready draftagent_runnerreceives an immutable deployed version plus run context, can query crm records, create crm activities, and records a final run resultapi and access
the api adds tRPC routes and services for agent definitions, versions, deployment, lifecycle changes, manual runs, activity history, conversations, submissions, feedback, attachments, sharing, unread state, and deletion.
database changes
there are six forward prisma migrations in this pr. production needs
bun run db:deploybefore the updated services start handling agent traffic.new tables:
agentDefinitionstores the agent identity, lifecycle status, creator, and current deployed versionagentVersionstores immutable instructions, manifest, model, sandbox policy, validation result, and deployment metadataagentBuilderArtifactstores revisioned files written during a builder conversationagentTriggerstores manual, schedule, event, and webhook trigger configurationagentRunstores execution state, input, result, token and cost metadata, idempotency, and errorsagentRunEventstores an ordered, append-only run timelineagentActionstores planned and completed external or crm effects with retry and idempotency metadataagentAuditEventstores lifecycle changes with actor, request, before, and after dataagentConversationSubmissionstores durable user commands and their delivery stateagentConversationAttachmentstores attachment bytes and metadata separately from the message jsonagentConversationSharestores revocable workspace share links by token hashagentConversationFeedbackstores per-user message ratingschanges to
agentConversation:sessionIdnullable so the conversation can exist before eve accepts the first submissionmigration behavior worth noting:
updatedAtbackfilled fromlastMessageAt/create agentsubmissions are classified as create commandsbytearows, then removed from message json while their safe metadata remainsenvironment and deployment
the only new environment variable is optional:
AGENT_PORTselects the self-hosted eve port and defaults to2000. if it is unset, the runtime uses the host-providedPORT, then falls back to2000there is no new secret. the feature continues to use the existing
DATABASE_URL,AGENT_URL,AGENT_BRIDGE_SECRET, andAI_GATEWAY_API_KEYsetup. the bridge remains an optional capability when its shared secret is absent.local development also changes slightly:
bun run devnow prepares the local database before starting dependent watchersALLOW_REMOTE_DB=1is set deliberatelyapps/agentuses a small start wrapper soAGENT_PORTand hostedPORTwork consistentlydevcommand;dev:headlesskeeps the previous no-ui behaviordependencies and shared ui
@pierre/diffsand@pierre/treesfor generated artifact reviewmotionfor the shared interaction animations@shadcn/reactand adds shared questionnaire, reasoning, shimmer, async action, skeleton swap, and table behavior inpackages/uichecks
check-types, lint, test: passingthe added tests cover conversation durability and concurrency, sharing, attachments, deletion, access visibility, agent lifecycle, runs, builder artifacts, custom runtime behavior, questionnaire transcripts, routing, and the relevant ui state helpers.