Skip to content

Commit 661d5f9

Browse files
committed
add draft events
1 parent 366327c commit 661d5f9

File tree

1 file changed

+130
-0
lines changed

1 file changed

+130
-0
lines changed

docs/concepts/events.mdx

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Events in the protocol are categorized by their purpose:
2020
| Tool Call Events | Manage tool executions by agents |
2121
| State Management Events | Synchronize state between agents and UI |
2222
| Special Events | Support custom functionality |
23+
| Draft Events | Proposed events under development |
2324

2425
## Base Event Properties
2526

@@ -487,6 +488,135 @@ implementation across frontends and agents.
487488
| `name` | Name of the custom event |
488489
| `value` | Value associated with the event |
489490

491+
## Draft Events
492+
493+
These events are currently in draft status and may change before finalization. They represent proposed extensions to the protocol that are under active development and discussion.
494+
495+
### Activity Events
496+
497+
<span style={{backgroundColor: '#3b82f6', color: 'white', padding: '2px 6px', borderRadius: '4px', fontSize: '0.75em', fontWeight: 'bold'}}>DRAFT</span> [View Proposal](/drafts/activity-events)
498+
499+
Activity events represent ongoing agent progress between chat messages, allowing frameworks to surface fine-grained activity updates chronologically.
500+
501+
#### ActivitySnapshotEvent
502+
503+
Provides the complete activity state at a point in time.
504+
505+
| Property | Description |
506+
| -------------- | ---------------------------------------------------- |
507+
| `messageId` | Unique identifier for the ActivityMessage |
508+
| `activityType` | Activity type (e.g., "PLAN", "SEARCH", "SCRAPE") |
509+
| `content` | Complete activity state at this point |
510+
511+
#### ActivityDeltaEvent
512+
513+
Provides incremental updates to the activity state using JSON Patch operations.
514+
515+
| Property | Description |
516+
| -------------- | ---------------------------------------------------- |
517+
| `messageId` | Unique identifier for the ActivityMessage |
518+
| `activityType` | Activity type (e.g., "PLAN", "SEARCH", "SCRAPE") |
519+
| `patch` | JSON Patch operations (RFC 6902) to apply |
520+
521+
### Reasoning Events
522+
523+
<span style={{backgroundColor: '#3b82f6', color: 'white', padding: '2px 6px', borderRadius: '4px', fontSize: '0.75em', fontWeight: 'bold'}}>DRAFT</span> [View Proposal](/drafts/reasoning)
524+
525+
Reasoning events support LLM reasoning visibility and continuity, enabling chain-of-thought reasoning while maintaining privacy.
526+
527+
#### ReasoningStart
528+
529+
Marks the start of reasoning.
530+
531+
| Property | Description |
532+
| ------------------ | --------------------------------------- |
533+
| `messageId` | Unique identifier of this reasoning |
534+
| `encryptedContent` | Optional encrypted content |
535+
536+
#### ReasoningMessageStart
537+
538+
Signals the start of a reasoning message.
539+
540+
| Property | Description |
541+
| ----------- | ----------------------------------- |
542+
| `messageId` | Unique identifier of the message |
543+
| `role` | Role of the reasoning message |
544+
545+
#### ReasoningMessageContent
546+
547+
Represents a chunk of content in a streaming reasoning message.
548+
549+
| Property | Description |
550+
| ----------- | ------------------------------------ |
551+
| `messageId` | Matches ID from ReasoningMessageStart |
552+
| `delta` | Reasoning content chunk (non-empty) |
553+
554+
#### ReasoningMessageEnd
555+
556+
Signals the end of a reasoning message.
557+
558+
| Property | Description |
559+
| ----------- | ------------------------------------ |
560+
| `messageId` | Matches ID from ReasoningMessageStart |
561+
562+
#### ReasoningMessageChunk
563+
564+
A convenience event to auto start/close reasoning messages.
565+
566+
| Property | Description |
567+
| ----------- | ----------------------------------------- |
568+
| `messageId` | Optional message ID |
569+
| `delta` | Optional reasoning content chunk |
570+
571+
#### ReasoningEnd
572+
573+
Marks the end of reasoning.
574+
575+
| Property | Description |
576+
| ----------- | ----------------------------------- |
577+
| `messageId` | Unique identifier of this reasoning |
578+
579+
### Meta Events
580+
581+
<span style={{backgroundColor: '#3b82f6', color: 'white', padding: '2px 6px', borderRadius: '4px', fontSize: '0.75em', fontWeight: 'bold'}}>DRAFT</span> [View Proposal](/drafts/meta-events)
582+
583+
Meta events provide annotations and signals independent of agent runs, such as user feedback or external system events.
584+
585+
#### MetaEvent
586+
587+
A side-band annotation event that can occur anywhere in the stream.
588+
589+
| Property | Description |
590+
| ---------- | --------------------------------------------------------- |
591+
| `metaType` | Application-defined type (e.g., "thumbs_up", "tag") |
592+
| `payload` | Application-defined payload |
593+
594+
### Modified Lifecycle Events
595+
596+
<span style={{backgroundColor: '#3b82f6', color: 'white', padding: '2px 6px', borderRadius: '4px', fontSize: '0.75em', fontWeight: 'bold'}}>DRAFT</span> [View Proposal](/drafts/interrupts)
597+
598+
Extensions to existing lifecycle events to support interrupts and branching.
599+
600+
#### RunFinished (Extended)
601+
602+
The `RunFinished` event gains new fields to support interrupt-aware workflows.
603+
604+
| Property | Description |
605+
| ----------- | ---------------------------------------------------- |
606+
| `outcome` | Optional: "success" or "interrupt" |
607+
| `interrupt` | Optional: Contains interrupt details when paused |
608+
609+
<span style={{backgroundColor: '#3b82f6', color: 'white', padding: '2px 6px', borderRadius: '4px', fontSize: '0.75em', fontWeight: 'bold'}}>DRAFT</span> [View Proposal](/drafts/serialization)
610+
611+
#### RunStarted (Extended)
612+
613+
The `RunStarted` event gains new fields to support branching and input tracking.
614+
615+
| Property | Description |
616+
| ------------ | -------------------------------------------------- |
617+
| `parentRunId`| Optional: Parent run ID for branching/time travel |
618+
| `input` | Optional: The exact agent input for this run |
619+
490620
## Event Flow Patterns
491621

492622
Events in the protocol typically follow specific patterns:

0 commit comments

Comments
 (0)