返回 DeepSeek-Reasonix
event.go
根目录 / internal / eventwire / event.go
1 package eventwire
2
3 import (
4 "reasonix/internal/event"
5 "reasonix/internal/provider"
6 )
7
8 // Event is the JSON-friendly form shared by event frontends.
9 // externalizable:"true" marks large string payloads the Remote protocol may
10 // offload via content refs without changing provider-visible semantics.
11 type Event struct {
12 RuntimeState *event.RuntimeStateSnapshot `json:"runtimeState,omitempty"`
13 Kind string `json:"kind"`
14 MessageID string `json:"messageId,omitempty"`
15 AttemptID string `json:"attemptId,omitempty"`
16 Source string `json:"source,omitempty"`
17 SessionID string `json:"sessionId,omitempty"`
18 RuntimeEpoch string `json:"runtimeEpoch,omitempty"`
19 SubmissionID string `json:"submissionId,omitempty"`
20 PromptID string `json:"promptId,omitempty"`
21 PromptKind string `json:"promptKind,omitempty"`
22 PromptLegacy bool `json:"promptLegacy,omitempty"`
23 TurnID string `json:"turnId,omitempty"`
24 Sequence uint64 `json:"seq,omitempty"`
25 Status string `json:"status,omitempty"`
26 Text string `json:"text,omitempty" externalizable:"true"`
27 Detail string `json:"detail,omitempty" externalizable:"true"`
28 Code string `json:"code,omitempty"`
29 Reasoning string `json:"reasoning,omitempty" externalizable:"true"`
30 MemoryCitations []MemoryCitation `json:"memoryCitations,omitempty"`
31 Level string `json:"level,omitempty"`
32 Tool *Tool `json:"tool,omitempty"`
33 ReadStatus *ReadStatus `json:"readStatus,omitempty"`
34 ReadPause *provider.ReadPause `json:"readPause,omitempty"`
35 ReadCompletion *provider.ReadCompletion `json:"readCompletion,omitempty"`
36 Usage *Usage `json:"usage,omitempty"`
37 Approval *Approval `json:"approval,omitempty"`
38 Ask *Ask `json:"ask,omitempty"`
39 MCPInteraction *MCPInteraction `json:"mcpInteraction,omitempty"`
40 Compaction *Compaction `json:"compaction,omitempty"`
41 Maintenance *ContextMaintenance `json:"maintenance,omitempty"`
42 SessionOperation *event.SessionOperationInfo `json:"sessionOperation,omitempty"`
43 Guardian *Guardian `json:"guardian,omitempty"`
44 DecisionReceipt *DecisionReceipt `json:"decisionReceipt,omitempty"`
45 Extension *ExtensionSurface `json:"extension,omitempty"`
46 Err string `json:"err,omitempty" externalizable:"true"`
47 Outcome string `json:"outcome,omitempty"`
48 Readiness *FinalReadiness `json:"readiness,omitempty"`
49 ProtocolRecovery *provider.ProtocolRecoveryAction `json:"protocolRecovery,omitempty"`
50 Diagnostic *provider.FailureDiagnostic `json:"diagnostic,omitempty"`
51 Receipt *CompletionReceipt `json:"receipt,omitempty"`
52 CheckpointTurn *int `json:"checkpointTurn,omitempty"`
53 Recovery *event.RecoveryStatus `json:"recovery,omitempty"`
54 RetryAttempt int `json:"retryAttempt,omitempty"`
55 RetryMax int `json:"retryMax,omitempty"`
56 RetryScope string `json:"retryScope,omitempty"` // "headers" | "stream" | "protocol"; omit for older clients
57 StreamAttempt *StreamAttempt `json:"streamAttempt,omitempty"`
58 // ItemID correlates Steer / TurnDone / unapplied-steer with a durable
59 // session-inbox entry. Empty for legacy text-only guidance.
60 ItemID string `json:"itemId,omitempty"`
61 // SessionPath routes frames emitted by detached Serve controllers. Older
62 // clients ignore the omitted/unknown field and keep single-session behavior.
63 SessionPath string `json:"sessionPath,omitempty"`
64 // SessionCurrent is set by Serve at publication time for frames belonging
65 // to its foreground controller. It lets all-session clients adopt an
66 // externally selected/recovered foreground without polling on every token.
67 SessionCurrent bool `json:"sessionCurrent,omitempty"`
68 // SessionReset distinguishes a fresh /new or /clear target from a resumed
69 // durable session when a different client rotates the foreground.
70 SessionReset bool `json:"sessionReset,omitempty"`
71 Workspace *WorkspaceChanged `json:"workspace,omitempty"`
72 // Phase is set on turn_phase events: working | checking | verifying | reviewing.
73 Phase string `json:"phase,omitempty"`
74 // Completion is set on completion_summary events (content-free quality summary).
75 Completion *CompletionSummary `json:"completion,omitempty"`
76 }
77
77 lines GO