返回 CodeWhale
event-v1.schema.json
根目录 / pet / schema / event-v1.schema.json
1 {
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://whalesong.local/schema/event-v1.json",
4 "title": "Whalesong normalized event v1",
5 "description": "Canonical normalized events. Import accepts missing optional normalized defaults; canonical output fills them. Category extension uses other + subtype. Additional source fields survive in raw subject to privacy. endTime >= startTime is additionally checked by the importer.",
6 "type": "object",
7 "required": [
8 "schemaVersion",
9 "id",
10 "traceId",
11 "name",
12 "startTime",
13 "endTime",
14 "agentId",
15 "category",
16 "status",
17 "attributes"
18 ],
19 "properties": {
20 "schemaVersion": {
21 "const": 1
22 },
23 "id": {
24 "type": "string",
25 "minLength": 1
26 },
27 "traceId": {
28 "type": "string",
29 "minLength": 1
30 },
31 "parentId": {
32 "type": "string"
33 },
34 "name": {
35 "type": "string",
36 "minLength": 1
37 },
38 "startTime": {
39 "type": "number",
40 "minimum": 0,
41 "description": "Milliseconds relative to the trace origin."
42 },
43 "endTime": {
44 "type": "number",
45 "minimum": 0,
46 "description": "Milliseconds; must be >= startTime. Equal endpoints encode a point event."
47 },
48 "openEnded": {
49 "type": "boolean",
50 "description": "The source duration is unknown. Display as onset-only."
51 },
52 "agentId": {
53 "type": "string"
54 },
55 "category": {
56 "enum": [
57 "reasoning",
58 "tool",
59 "memory",
60 "code",
61 "filesystem",
62 "network",
63 "browser",
64 "communication",
65 "agent",
66 "orchestration",
67 "error",
68 "human",
69 "other"
70 ]
71 },
72 "status": {
73 "enum": [
74 "pending",
75 "running",
76 "success",
77 "error",
78 "unknown"
79 ]
80 },
81 "attributes": {
82 "type": "object",
83 "additionalProperties": true
84 },
85 "payload": {},
86 "raw": {},
87 "links": {
88 "type": "array",
89 "items": {
90 "type": "object",
91 "required": [
92 "traceId",
93 "spanId"
94 ],
95 "properties": {
96 "traceId": {
97 "type": "string"
98 },
99 "spanId": {
100 "type": "string"
101 },
102 "attributes": {
103 "type": "object"
104 }
105 },
106 "additionalProperties": false
107 }
108 },
109 "agentType": {
110 "type": "string"
111 },
112 "parentAgentId": {
113 "type": "string"
114 },
115 "subtype": {
116 "type": "string"
117 },
118 "model": {
119 "type": "string"
120 },
121 "provider": {
122 "type": "string"
123 },
124 "tool": {
125 "type": "string"
126 },
127 "costCurrency": {
128 "type": "string"
129 },
130 "sourceId": {
131 "type": "string"
132 },
133 "targetId": {
134 "type": "string"
135 },
136 "targetType": {
137 "type": "string"
138 },
139 "inputTokens": {
140 "type": "number",
141 "minimum": 0
142 },
143 "outputTokens": {
144 "type": "number",
145 "minimum": 0
146 },
147 "cachedTokens": {
148 "type": "number",
149 "minimum": 0
150 },
151 "cost": {
152 "type": "number",
153 "minimum": 0
154 },
155 "latency": {
156 "type": "number",
157 "minimum": 0
158 },
159 "contextTokens": {
160 "type": "number",
161 "minimum": 0
162 },
163 "contextLimit": {
164 "type": "number",
165 "minimum": 0
166 },
167 "retry": {
168 "type": "number",
169 "minimum": 0
170 }
171 },
172 "additionalProperties": false
173 }
174
174 lines JSON