@irogane/kaji 0.2.0-beta.11 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +112 -551
  2. package/dist/index.d.mts +253 -0
  3. package/dist/index.mjs +440 -0
  4. package/package.json +28 -166
  5. package/contracts/README.md +0 -14
  6. package/contracts/beta-core-v1.json +0 -52
  7. package/contracts/cli/init-cases-v1.json +0 -27
  8. package/contracts/errors/error-codes.json +0 -48
  9. package/contracts/errors/integration-recovery-v1.json +0 -127
  10. package/contracts/errors/provider-normalization.json +0 -111
  11. package/contracts/events/conformance-invalid.json +0 -20
  12. package/contracts/events/conformance.json +0 -511
  13. package/contracts/events/new-kaji-event-v1.schema.json +0 -1021
  14. package/contracts/events/stored-kaji-event-v1.schema.json +0 -1025
  15. package/contracts/feature-tiers-v1.json +0 -488
  16. package/contracts/integrations/abi-index-v1.json +0 -8
  17. package/contracts/integrations/conformance-invalid.json +0 -443
  18. package/contracts/integrations/conformance-valid.json +0 -121
  19. package/contracts/integrations/copy-provenance-v1.schema.json +0 -61
  20. package/contracts/integrations/echo-tool-abi-v1.json +0 -37
  21. package/contracts/integrations/github-api-conformance-v1.json +0 -644
  22. package/contracts/integrations/github-tool-abi-typescript-v1.json +0 -369
  23. package/contracts/integrations/github-tool-abi-v1.json +0 -146
  24. package/contracts/integrations/gmail-api-conformance-v1.json +0 -750
  25. package/contracts/integrations/gmail-tool-abi-v1.json +0 -62
  26. package/contracts/integrations/index.schema.json +0 -37
  27. package/contracts/integrations/manifest.schema.json +0 -119
  28. package/contracts/parity/expected-normalized.json +0 -4906
  29. package/contracts/parity/scenarios.json +0 -100
  30. package/contracts/parity/scenarios.schema.json +0 -214
  31. package/contracts/providers/cost-conformance.json +0 -112
  32. package/contracts/release/github-proof-v1.schema.json +0 -138
  33. package/contracts/release/gmail-proof-v1.schema.json +0 -138
  34. package/contracts/release/kaji-ts-consumer-handoff-v1.schema.json +0 -1289
  35. package/contracts/release/publisher-identity-receipt-v1.schema.json +0 -319
  36. package/contracts/release/typescript-onboarding-evidence-v1.schema.json +0 -740
  37. package/contracts/tools/conformance-invalid.json +0 -271
  38. package/contracts/tools/conformance-valid.json +0 -78
  39. package/contracts/tools/tool-schema-v1.schema.json +0 -18
  40. package/dist/anthropic.cjs +0 -1231
  41. package/dist/anthropic.cjs.map +0 -1
  42. package/dist/anthropic.d.cts +0 -26
  43. package/dist/anthropic.d.ts +0 -26
  44. package/dist/anthropic.js +0 -270
  45. package/dist/anthropic.js.map +0 -1
  46. package/dist/auth.cjs +0 -1507
  47. package/dist/auth.cjs.map +0 -1
  48. package/dist/auth.d.cts +0 -129
  49. package/dist/auth.d.ts +0 -129
  50. package/dist/auth.js +0 -1039
  51. package/dist/auth.js.map +0 -1
  52. package/dist/base-B9FRMcP8.d.cts +0 -140
  53. package/dist/base-nHQd1VtS.d.ts +0 -140
  54. package/dist/chunk-AAM33KAO.js +0 -4367
  55. package/dist/chunk-AAM33KAO.js.map +0 -1
  56. package/dist/chunk-KAJ6BM64.js +0 -153
  57. package/dist/chunk-KAJ6BM64.js.map +0 -1
  58. package/dist/chunk-KCAXIOZS.js +0 -308
  59. package/dist/chunk-KCAXIOZS.js.map +0 -1
  60. package/dist/chunk-LSJ4AVO2.js +0 -243
  61. package/dist/chunk-LSJ4AVO2.js.map +0 -1
  62. package/dist/chunk-TM7ZGOJX.js +0 -716
  63. package/dist/chunk-TM7ZGOJX.js.map +0 -1
  64. package/dist/cli/bin.d.ts +0 -2
  65. package/dist/cli/bin.js +0 -13
  66. package/dist/cli/bin.js.map +0 -1
  67. package/dist/cli/chunk-2RCWPRVY.js +0 -6277
  68. package/dist/cli/chunk-2RCWPRVY.js.map +0 -1
  69. package/dist/cli/chunk-SEBX54TR.js +0 -681
  70. package/dist/cli/chunk-SEBX54TR.js.map +0 -1
  71. package/dist/cli/index.d.ts +0 -232
  72. package/dist/cli/index.js +0 -11
  73. package/dist/cli/index.js.map +0 -1
  74. package/dist/cli/init-worker.d.ts +0 -2
  75. package/dist/cli/init-worker.js +0 -18
  76. package/dist/cli/init-worker.js.map +0 -1
  77. package/dist/cli/integration-copy-worker.js +0 -48
  78. package/dist/cli/integration-copy-worker.js.map +0 -1
  79. package/dist/cli/package-entry-cjs.cjs +0 -21
  80. package/dist/cli/package-entry-cjs.cjs.map +0 -1
  81. package/dist/cli/package-entry-cjs.d.cts +0 -2
  82. package/dist/cli/package-entry.d.ts +0 -2
  83. package/dist/cli/package-entry.js +0 -13
  84. package/dist/cli/package-entry.js.map +0 -1
  85. package/dist/context-BaFHrQHv.d.cts +0 -21
  86. package/dist/context-BaFHrQHv.d.ts +0 -21
  87. package/dist/context-C-YPY-GS.d.cts +0 -1538
  88. package/dist/context-C-YPY-GS.d.ts +0 -1538
  89. package/dist/index.cjs +0 -12346
  90. package/dist/index.cjs.map +0 -1
  91. package/dist/index.d.cts +0 -1560
  92. package/dist/index.d.ts +0 -1560
  93. package/dist/index.js +0 -7852
  94. package/dist/index.js.map +0 -1
  95. package/dist/integrations/github.cjs +0 -2092
  96. package/dist/integrations/github.cjs.map +0 -1
  97. package/dist/integrations/github.d.cts +0 -21
  98. package/dist/integrations/github.d.ts +0 -21
  99. package/dist/integrations/github.js +0 -2088
  100. package/dist/integrations/github.js.map +0 -1
  101. package/dist/integrations.cjs +0 -3370
  102. package/dist/integrations.cjs.map +0 -1
  103. package/dist/integrations.d.cts +0 -202
  104. package/dist/integrations.d.ts +0 -202
  105. package/dist/integrations.js +0 -2650
  106. package/dist/integrations.js.map +0 -1
  107. package/dist/observability-Cj--OkME.d.cts +0 -96
  108. package/dist/observability-Cj--OkME.d.ts +0 -96
  109. package/dist/openai.cjs +0 -1235
  110. package/dist/openai.cjs.map +0 -1
  111. package/dist/openai.d.cts +0 -32
  112. package/dist/openai.d.ts +0 -32
  113. package/dist/openai.js +0 -272
  114. package/dist/openai.js.map +0 -1
  115. package/dist/testing.cjs +0 -554
  116. package/dist/testing.cjs.map +0 -1
  117. package/dist/testing.d.cts +0 -43
  118. package/dist/testing.d.ts +0 -43
  119. package/dist/testing.js +0 -118
  120. package/dist/testing.js.map +0 -1
  121. package/registry/echo/index.ts +0 -53
  122. package/registry/echo/manifest.json +0 -53
  123. package/registry/github/LICENSE +0 -105
  124. package/registry/github/client.ts +0 -1727
  125. package/registry/github/index.ts +0 -263
  126. package/registry/github/manifest.json +0 -227
  127. package/registry/github/owner-fixtures.json +0 -10
  128. package/registry/github/tests/github.test.ts +0 -32
  129. package/registry/gmail/LICENSE +0 -105
  130. package/registry/gmail/client.ts +0 -548
  131. package/registry/gmail/index.ts +0 -165
  132. package/registry/gmail/manifest.json +0 -102
  133. package/registry/gmail/owner-fixtures.json +0 -10
  134. package/registry/gmail/tests/gmail.test.ts +0 -32
  135. package/registry/index.json +0 -21
  136. package/registry/index.schema.json +0 -37
  137. package/registry/schema.json +0 -119
@@ -1,1025 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://kaji.dev/contracts/events/stored-kaji-event-v1.schema.json",
4
- "title": "Stored Kaji event",
5
- "x-maxSerializedBytes": 1048576,
6
- "$defs": {
7
- "nonEmptyId": {
8
- "type": "string",
9
- "minLength": 1
10
- },
11
- "integrationRecoveryFields": {
12
- "oneOf": [
13
- { "properties": { "error_code": { "const": "INTEGRATION_AUTH_REQUIRED" }, "reason_code": { "const": "github_token_missing" }, "recovery_code": { "const": "CONFIGURE_GITHUB_TOKEN" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#github-token" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
14
- { "properties": { "error_code": { "const": "INTEGRATION_AUTH_REQUIRED" }, "reason_code": { "const": "gmail_grant_missing" }, "recovery_code": { "const": "CONNECT_GMAIL" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#gmail-grant" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
15
- { "properties": { "error_code": { "const": "INTEGRATION_AUTH_ERROR" }, "reason_code": { "const": "keychain_missing" }, "recovery_code": { "const": "RESTORE_KEYCHAIN" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#keychain-missing" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
16
- { "properties": { "error_code": { "const": "INTEGRATION_AUTH_ERROR" }, "reason_code": { "const": "keychain_locked" }, "recovery_code": { "const": "UNLOCK_KEYCHAIN" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#keychain-locked" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
17
- { "properties": { "error_code": { "const": "INTEGRATION_AUTH_ERROR" }, "reason_code": { "const": "keychain_corrupt" }, "recovery_code": { "const": "RESET_GMAIL_GRANT" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#keychain-corrupt" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
18
- { "properties": { "error_code": { "const": "INTEGRATION_AUTH_ERROR" }, "reason_code": { "const": "keychain_unsupported" }, "recovery_code": { "const": "USE_SUPPORTED_KEYCHAIN" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#keychain-unsupported" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
19
- { "properties": { "error_code": { "const": "INTEGRATION_AUTH_REQUIRED" }, "reason_code": { "const": "gmail_scope_drift" }, "recovery_code": { "const": "RECONNECT_GMAIL" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#gmail-scope-drift" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
20
- { "properties": { "error_code": { "const": "INTEGRATION_POLICY_REJECTED" }, "reason_code": { "const": "policy_rejected" }, "recovery_code": { "const": "REVIEW_INTEGRATION_POLICY" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#policy-rejected" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
21
- { "properties": { "error_code": { "const": "INTEGRATION_API_ERROR" }, "reason_code": { "const": "api_rejected" }, "recovery_code": { "const": "REVIEW_PROVIDER_REJECTION" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#api-rejected" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
22
- { "properties": { "error_code": { "const": "INTEGRATION_API_ERROR" }, "reason_code": { "const": "transient_read_failed" }, "recovery_code": { "const": "RETRY_INTEGRATION_READ" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#transient-read" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
23
- { "properties": { "error_code": { "const": "INTEGRATION_RATE_LIMITED" }, "reason_code": { "const": "rate_limited" }, "recovery_code": { "const": "RETRY_AFTER_RATE_LIMIT" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#rate-limited" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
24
- { "properties": { "error_code": { "const": "INTEGRATION_REDIRECT_REJECTED" }, "reason_code": { "const": "redirect_rejected" }, "recovery_code": { "const": "REJECT_PROVIDER_REDIRECT" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#redirect-rejected" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
25
- { "properties": { "error_code": { "const": "INTEGRATION_RESPONSE_LIMIT" }, "reason_code": { "const": "response_limit_exceeded" }, "recovery_code": { "const": "REDUCE_INTEGRATION_RESPONSE" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#response-limit" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
26
- { "properties": { "error_code": { "const": "TOOL_EXECUTION_FAILED" }, "reason_code": { "const": "github_mutation_unknown" }, "recovery_code": { "const": "RECONCILE_GITHUB_MUTATION" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#github-mutation-unknown" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] },
27
- { "properties": { "error_code": { "const": "TOOL_EXECUTION_FAILED" }, "reason_code": { "const": "gmail_mutation_unknown" }, "recovery_code": { "const": "RECONCILE_GMAIL_MUTATION" }, "doc_url": { "const": "https://kaji.dev/docs/integrations/recovery-v1#gmail-mutation-unknown" } }, "required": ["error_code", "reason_code", "recovery_code", "doc_url"] }
28
- ]
29
- },
30
- "safeInteger": {
31
- "type": "integer",
32
- "minimum": -9007199254740991,
33
- "maximum": 9007199254740991
34
- },
35
- "positiveInteger": {
36
- "allOf": [
37
- {
38
- "$ref": "#/$defs/safeInteger"
39
- },
40
- {
41
- "minimum": 1
42
- }
43
- ]
44
- },
45
- "nonNegativeInteger": {
46
- "allOf": [
47
- {
48
- "$ref": "#/$defs/safeInteger"
49
- },
50
- {
51
- "minimum": 0
52
- }
53
- ]
54
- },
55
- "jsonNumber": {
56
- "oneOf": [
57
- {
58
- "$ref": "#/$defs/safeInteger"
59
- },
60
- {
61
- "type": "number",
62
- "not": {
63
- "type": "integer"
64
- }
65
- }
66
- ]
67
- },
68
- "nonNegativeNumber": {
69
- "allOf": [
70
- {
71
- "$ref": "#/$defs/jsonNumber"
72
- },
73
- {
74
- "minimum": 0
75
- }
76
- ]
77
- },
78
- "jsonValue": {
79
- "oneOf": [
80
- {
81
- "type": "null"
82
- },
83
- {
84
- "type": "boolean"
85
- },
86
- {
87
- "$ref": "#/$defs/jsonNumber"
88
- },
89
- {
90
- "type": "string"
91
- },
92
- {
93
- "type": "array",
94
- "items": {
95
- "$ref": "#/$defs/jsonValue"
96
- }
97
- },
98
- {
99
- "type": "object",
100
- "additionalProperties": {
101
- "$ref": "#/$defs/jsonValue"
102
- }
103
- }
104
- ]
105
- },
106
- "jsonObject": {
107
- "type": "object",
108
- "additionalProperties": {
109
- "$ref": "#/$defs/jsonValue"
110
- }
111
- },
112
- "tokenUsage": {
113
- "type": "object",
114
- "properties": {
115
- "input": {
116
- "$ref": "#/$defs/nonNegativeInteger"
117
- },
118
- "output": {
119
- "$ref": "#/$defs/nonNegativeInteger"
120
- }
121
- },
122
- "required": [
123
- "input",
124
- "output"
125
- ],
126
- "additionalProperties": false
127
- },
128
- "base": {
129
- "type": "object",
130
- "properties": {
131
- "id": {
132
- "$ref": "#/$defs/nonEmptyId"
133
- },
134
- "version": {
135
- "const": "1.0"
136
- },
137
- "timestamp": {
138
- "$ref": "#/$defs/jsonNumber"
139
- },
140
- "session_id": {
141
- "$ref": "#/$defs/nonEmptyId"
142
- },
143
- "turn_id": {
144
- "$ref": "#/$defs/nonEmptyId"
145
- },
146
- "metadata": {
147
- "$ref": "#/$defs/jsonObject"
148
- },
149
- "sequence": {
150
- "$ref": "#/$defs/positiveInteger"
151
- }
152
- },
153
- "required": [
154
- "id",
155
- "version",
156
- "timestamp",
157
- "session_id",
158
- "sequence"
159
- ]
160
- },
161
- "sessionCreated": {
162
- "allOf": [
163
- {
164
- "$ref": "#/$defs/base"
165
- },
166
- {
167
- "type": "object",
168
- "properties": {
169
- "type": {
170
- "const": "session.created"
171
- }
172
- },
173
- "required": [
174
- "type"
175
- ]
176
- }
177
- ],
178
- "unevaluatedProperties": false
179
- },
180
- "sessionClosed": {
181
- "allOf": [
182
- {
183
- "$ref": "#/$defs/base"
184
- },
185
- {
186
- "type": "object",
187
- "properties": {
188
- "type": {
189
- "const": "session.closed"
190
- },
191
- "reason": {
192
- "type": [
193
- "string",
194
- "null"
195
- ]
196
- }
197
- },
198
- "required": [
199
- "type"
200
- ]
201
- }
202
- ],
203
- "unevaluatedProperties": false
204
- },
205
- "userMessage": {
206
- "allOf": [
207
- {
208
- "$ref": "#/$defs/base"
209
- },
210
- {
211
- "type": "object",
212
- "properties": {
213
- "type": {
214
- "const": "user.message"
215
- },
216
- "content": {
217
- "type": "string"
218
- }
219
- },
220
- "required": [
221
- "type",
222
- "content"
223
- ]
224
- }
225
- ],
226
- "unevaluatedProperties": false
227
- },
228
- "userAudioChunk": {
229
- "allOf": [
230
- {
231
- "$ref": "#/$defs/base"
232
- },
233
- {
234
- "type": "object",
235
- "properties": {
236
- "type": {
237
- "const": "user.audio.chunk"
238
- },
239
- "chunk_size_bytes": {
240
- "$ref": "#/$defs/safeInteger"
241
- }
242
- },
243
- "required": [
244
- "type",
245
- "chunk_size_bytes"
246
- ]
247
- }
248
- ],
249
- "unevaluatedProperties": false
250
- },
251
- "transcriptPartial": {
252
- "allOf": [
253
- {
254
- "$ref": "#/$defs/base"
255
- },
256
- {
257
- "type": "object",
258
- "properties": {
259
- "type": {
260
- "const": "transcript.partial"
261
- },
262
- "text": {
263
- "type": "string"
264
- }
265
- },
266
- "required": [
267
- "type",
268
- "text"
269
- ]
270
- }
271
- ],
272
- "unevaluatedProperties": false
273
- },
274
- "transcriptFinal": {
275
- "allOf": [
276
- {
277
- "$ref": "#/$defs/base"
278
- },
279
- {
280
- "type": "object",
281
- "properties": {
282
- "type": {
283
- "const": "transcript.final"
284
- },
285
- "text": {
286
- "type": "string"
287
- }
288
- },
289
- "required": [
290
- "type",
291
- "text"
292
- ]
293
- }
294
- ],
295
- "unevaluatedProperties": false
296
- },
297
- "memoryRetrievalStarted": {
298
- "allOf": [
299
- {
300
- "$ref": "#/$defs/base"
301
- },
302
- {
303
- "type": "object",
304
- "properties": {
305
- "type": {
306
- "const": "memory.retrieval.started"
307
- },
308
- "query": {
309
- "type": "string"
310
- }
311
- },
312
- "required": [
313
- "type",
314
- "query"
315
- ]
316
- }
317
- ],
318
- "unevaluatedProperties": false
319
- },
320
- "memoryRetrievalCompleted": {
321
- "allOf": [
322
- {
323
- "$ref": "#/$defs/base"
324
- },
325
- {
326
- "type": "object",
327
- "properties": {
328
- "type": {
329
- "const": "memory.retrieval.completed"
330
- },
331
- "query": {
332
- "type": "string"
333
- },
334
- "documents": {
335
- "type": "array",
336
- "items": {
337
- "$ref": "#/$defs/jsonObject"
338
- }
339
- }
340
- },
341
- "required": [
342
- "type",
343
- "query",
344
- "documents"
345
- ]
346
- }
347
- ],
348
- "unevaluatedProperties": false
349
- },
350
- "agentReasoningStarted": {
351
- "allOf": [
352
- {
353
- "$ref": "#/$defs/base"
354
- },
355
- {
356
- "type": "object",
357
- "properties": {
358
- "type": {
359
- "const": "agent.reasoning.started"
360
- }
361
- },
362
- "required": [
363
- "type"
364
- ]
365
- }
366
- ],
367
- "unevaluatedProperties": false
368
- },
369
- "agentMessageDelta": {
370
- "allOf": [
371
- {
372
- "$ref": "#/$defs/base"
373
- },
374
- {
375
- "type": "object",
376
- "properties": {
377
- "type": {
378
- "const": "agent.message.delta"
379
- },
380
- "delta": {
381
- "type": "string"
382
- }
383
- },
384
- "required": [
385
- "type",
386
- "delta"
387
- ]
388
- }
389
- ],
390
- "unevaluatedProperties": false
391
- },
392
- "agentMessageCompleted": {
393
- "allOf": [
394
- {
395
- "$ref": "#/$defs/base"
396
- },
397
- {
398
- "type": "object",
399
- "properties": {
400
- "type": {
401
- "const": "agent.message.completed"
402
- },
403
- "content": {
404
- "type": "string"
405
- },
406
- "tokens": {
407
- "oneOf": [
408
- { "$ref": "#/$defs/tokenUsage" },
409
- { "type": "null" }
410
- ]
411
- },
412
- "cost_usd": {
413
- "oneOf": [
414
- { "$ref": "#/$defs/nonNegativeNumber" },
415
- { "type": "null" }
416
- ]
417
- }
418
- },
419
- "required": [
420
- "type",
421
- "content"
422
- ]
423
- }
424
- ],
425
- "unevaluatedProperties": false
426
- },
427
- "agentTurnExhausted": {
428
- "allOf": [
429
- {
430
- "$ref": "#/$defs/base"
431
- },
432
- {
433
- "type": "object",
434
- "properties": {
435
- "type": {
436
- "const": "agent.turn.exhausted"
437
- },
438
- "max_iterations": {
439
- "$ref": "#/$defs/nonNegativeInteger"
440
- },
441
- "pending_tool_calls": {
442
- "type": "array",
443
- "items": {
444
- "$ref": "#/$defs/jsonObject"
445
- }
446
- },
447
- "reason": {
448
- "type": [
449
- "string",
450
- "null"
451
- ]
452
- }
453
- },
454
- "required": [
455
- "type",
456
- "max_iterations",
457
- "pending_tool_calls"
458
- ]
459
- }
460
- ],
461
- "unevaluatedProperties": false
462
- },
463
- "agentTurnFailed": {
464
- "allOf": [
465
- {
466
- "$ref": "#/$defs/base"
467
- },
468
- {
469
- "type": "object",
470
- "properties": {
471
- "type": {
472
- "const": "agent.turn.failed"
473
- },
474
- "turn_id": {
475
- "$ref": "#/$defs/nonEmptyId"
476
- },
477
- "error": {
478
- "type": "string",
479
- "minLength": 1,
480
- "maxLength": 200
481
- },
482
- "error_code": {
483
- "type": "string"
484
- },
485
- "phase": {
486
- "enum": [
487
- "queue",
488
- "provider_open",
489
- "provider_stream",
490
- "approval",
491
- "tool"
492
- ]
493
- },
494
- "retryable": {
495
- "type": "boolean"
496
- },
497
- "outcome": {
498
- "enum": [
499
- "not_started",
500
- "failed",
501
- "unknown"
502
- ]
503
- }
504
- },
505
- "required": [
506
- "type",
507
- "turn_id",
508
- "error"
509
- ]
510
- }
511
- ],
512
- "unevaluatedProperties": false
513
- },
514
- "toolCallRequested": {
515
- "allOf": [
516
- {
517
- "$ref": "#/$defs/base"
518
- },
519
- {
520
- "type": "object",
521
- "properties": {
522
- "type": {
523
- "const": "tool.call.requested"
524
- },
525
- "turn_id": {
526
- "$ref": "#/$defs/nonEmptyId"
527
- },
528
- "tool_name": {
529
- "$ref": "#/$defs/nonEmptyId"
530
- },
531
- "tool_args": {
532
- "$ref": "#/$defs/jsonObject",
533
- "x-maxSerializedBytes": 65536
534
- },
535
- "tool_call_id": {
536
- "$ref": "#/$defs/nonEmptyId"
537
- }
538
- },
539
- "required": [
540
- "type",
541
- "turn_id",
542
- "tool_name",
543
- "tool_args",
544
- "tool_call_id"
545
- ]
546
- }
547
- ],
548
- "unevaluatedProperties": false
549
- },
550
- "toolCallStarted": {
551
- "allOf": [
552
- {
553
- "$ref": "#/$defs/base"
554
- },
555
- {
556
- "type": "object",
557
- "properties": {
558
- "type": {
559
- "const": "tool.call.started"
560
- },
561
- "turn_id": {
562
- "$ref": "#/$defs/nonEmptyId"
563
- },
564
- "tool_name": {
565
- "$ref": "#/$defs/nonEmptyId"
566
- },
567
- "tool_call_id": {
568
- "$ref": "#/$defs/nonEmptyId"
569
- }
570
- },
571
- "required": [
572
- "type",
573
- "turn_id",
574
- "tool_name",
575
- "tool_call_id"
576
- ]
577
- }
578
- ],
579
- "unevaluatedProperties": false
580
- },
581
- "toolCallCompleted": {
582
- "allOf": [
583
- {
584
- "$ref": "#/$defs/base"
585
- },
586
- {
587
- "type": "object",
588
- "properties": {
589
- "type": {
590
- "const": "tool.call.completed"
591
- },
592
- "turn_id": {
593
- "$ref": "#/$defs/nonEmptyId"
594
- },
595
- "tool_name": {
596
- "$ref": "#/$defs/nonEmptyId"
597
- },
598
- "tool_call_id": {
599
- "$ref": "#/$defs/nonEmptyId"
600
- },
601
- "result": {
602
- "$ref": "#/$defs/jsonValue",
603
- "x-maxSerializedBytes": 65536
604
- },
605
- "tokens": {
606
- "oneOf": [
607
- { "$ref": "#/$defs/tokenUsage" },
608
- { "type": "null" }
609
- ]
610
- },
611
- "cost_usd": {
612
- "oneOf": [
613
- { "$ref": "#/$defs/nonNegativeNumber" },
614
- { "type": "null" }
615
- ]
616
- }
617
- },
618
- "required": [
619
- "type",
620
- "turn_id",
621
- "tool_name",
622
- "tool_call_id",
623
- "result"
624
- ]
625
- }
626
- ],
627
- "unevaluatedProperties": false
628
- },
629
- "toolCallFailed": {
630
- "allOf": [
631
- {
632
- "$ref": "#/$defs/base"
633
- },
634
- {
635
- "type": "object",
636
- "properties": {
637
- "type": {
638
- "const": "tool.call.failed"
639
- },
640
- "turn_id": {
641
- "$ref": "#/$defs/nonEmptyId"
642
- },
643
- "tool_name": {
644
- "$ref": "#/$defs/nonEmptyId"
645
- },
646
- "tool_call_id": {
647
- "$ref": "#/$defs/nonEmptyId"
648
- },
649
- "error": {
650
- "type": "string",
651
- "minLength": 1,
652
- "maxLength": 200
653
- },
654
- "error_code": {
655
- "type": "string"
656
- },
657
- "error_path": {
658
- "type": "string"
659
- },
660
- "retryable": {
661
- "type": "boolean"
662
- },
663
- "outcome": {
664
- "enum": [
665
- "not_started",
666
- "failed",
667
- "unknown"
668
- ]
669
- },
670
- "reason_code": {
671
- "type": "string"
672
- },
673
- "recovery_code": {
674
- "type": "string"
675
- },
676
- "doc_url": {
677
- "type": "string"
678
- }
679
- },
680
- "required": [
681
- "type",
682
- "turn_id",
683
- "tool_name",
684
- "tool_call_id",
685
- "error"
686
- ]
687
- },
688
- {
689
- "if": {
690
- "anyOf": [
691
- { "required": ["reason_code"] },
692
- { "required": ["recovery_code"] },
693
- { "required": ["doc_url"] }
694
- ]
695
- },
696
- "then": {
697
- "$ref": "#/$defs/integrationRecoveryFields"
698
- }
699
- }
700
- ],
701
- "unevaluatedProperties": false
702
- },
703
- "toolApprovalRequested": {
704
- "allOf": [
705
- {
706
- "$ref": "#/$defs/base"
707
- },
708
- {
709
- "type": "object",
710
- "properties": {
711
- "type": {
712
- "const": "tool.approval.requested"
713
- },
714
- "turn_id": {
715
- "$ref": "#/$defs/nonEmptyId"
716
- },
717
- "tool_name": {
718
- "$ref": "#/$defs/nonEmptyId"
719
- },
720
- "tool_call_id": {
721
- "$ref": "#/$defs/nonEmptyId"
722
- },
723
- "tool_args": {
724
- "$ref": "#/$defs/jsonObject",
725
- "x-maxSerializedBytes": 65536
726
- },
727
- "risk": {
728
- "enum": [
729
- "read",
730
- "write",
731
- "external_effect",
732
- "destructive",
733
- "admin"
734
- ]
735
- }
736
- },
737
- "required": [
738
- "type",
739
- "turn_id",
740
- "tool_name",
741
- "tool_call_id",
742
- "tool_args",
743
- "risk"
744
- ]
745
- }
746
- ],
747
- "unevaluatedProperties": false
748
- },
749
- "toolApprovalApproved": {
750
- "allOf": [
751
- {
752
- "$ref": "#/$defs/base"
753
- },
754
- {
755
- "type": "object",
756
- "properties": {
757
- "type": {
758
- "const": "tool.approval.approved"
759
- },
760
- "turn_id": {
761
- "$ref": "#/$defs/nonEmptyId"
762
- },
763
- "tool_name": {
764
- "$ref": "#/$defs/nonEmptyId"
765
- },
766
- "tool_call_id": {
767
- "$ref": "#/$defs/nonEmptyId"
768
- }
769
- },
770
- "required": [
771
- "type",
772
- "turn_id",
773
- "tool_name",
774
- "tool_call_id"
775
- ]
776
- }
777
- ],
778
- "unevaluatedProperties": false
779
- },
780
- "toolApprovalRejected": {
781
- "allOf": [
782
- {
783
- "$ref": "#/$defs/base"
784
- },
785
- {
786
- "type": "object",
787
- "properties": {
788
- "type": {
789
- "const": "tool.approval.rejected"
790
- },
791
- "turn_id": {
792
- "$ref": "#/$defs/nonEmptyId"
793
- },
794
- "tool_name": {
795
- "$ref": "#/$defs/nonEmptyId"
796
- },
797
- "tool_call_id": {
798
- "$ref": "#/$defs/nonEmptyId"
799
- },
800
- "error_code": {
801
- "enum": [
802
- "APPROVAL_REJECTED",
803
- "APPROVAL_TIMEOUT",
804
- "TURN_TIMEOUT",
805
- "TOOL_CANCELLED",
806
- "APPROVAL_UNAVAILABLE"
807
- ]
808
- },
809
- "reason": {
810
- "type": "string",
811
- "minLength": 1,
812
- "maxLength": 200,
813
- "pattern": "\\S"
814
- }
815
- },
816
- "required": [
817
- "type",
818
- "turn_id",
819
- "tool_name",
820
- "tool_call_id",
821
- "error_code",
822
- "reason"
823
- ]
824
- }
825
- ],
826
- "unevaluatedProperties": false
827
- },
828
- "workflowStarted": {
829
- "allOf": [
830
- {
831
- "$ref": "#/$defs/base"
832
- },
833
- {
834
- "type": "object",
835
- "properties": {
836
- "type": {
837
- "const": "workflow.started"
838
- },
839
- "workflow_name": {
840
- "type": "string"
841
- }
842
- },
843
- "required": [
844
- "type",
845
- "workflow_name"
846
- ]
847
- }
848
- ],
849
- "unevaluatedProperties": false
850
- },
851
- "workflowCompleted": {
852
- "allOf": [
853
- {
854
- "$ref": "#/$defs/base"
855
- },
856
- {
857
- "type": "object",
858
- "properties": {
859
- "type": {
860
- "const": "workflow.completed"
861
- },
862
- "workflow_name": {
863
- "type": "string"
864
- },
865
- "result": {
866
- "$ref": "#/$defs/jsonValue"
867
- }
868
- },
869
- "required": [
870
- "type",
871
- "workflow_name",
872
- "result"
873
- ]
874
- }
875
- ],
876
- "unevaluatedProperties": false
877
- },
878
- "workflowFailed": {
879
- "allOf": [
880
- {
881
- "$ref": "#/$defs/base"
882
- },
883
- {
884
- "type": "object",
885
- "properties": {
886
- "type": {
887
- "const": "workflow.failed"
888
- },
889
- "workflow_name": {
890
- "type": "string"
891
- },
892
- "error": {
893
- "type": "string"
894
- }
895
- },
896
- "required": [
897
- "type",
898
- "workflow_name",
899
- "error"
900
- ]
901
- }
902
- ],
903
- "unevaluatedProperties": false
904
- },
905
- "cancellationRequested": {
906
- "allOf": [
907
- {
908
- "$ref": "#/$defs/base"
909
- },
910
- {
911
- "type": "object",
912
- "properties": {
913
- "type": {
914
- "const": "cancellation.requested"
915
- },
916
- "reason": {
917
- "type": "string"
918
- }
919
- },
920
- "required": [
921
- "type",
922
- "reason"
923
- ]
924
- }
925
- ],
926
- "unevaluatedProperties": false
927
- },
928
- "cancellationCompleted": {
929
- "allOf": [
930
- {
931
- "$ref": "#/$defs/base"
932
- },
933
- {
934
- "type": "object",
935
- "properties": {
936
- "type": {
937
- "const": "cancellation.completed"
938
- }
939
- },
940
- "required": [
941
- "type"
942
- ]
943
- }
944
- ],
945
- "unevaluatedProperties": false
946
- }
947
- },
948
- "oneOf": [
949
- {
950
- "$ref": "#/$defs/sessionCreated"
951
- },
952
- {
953
- "$ref": "#/$defs/sessionClosed"
954
- },
955
- {
956
- "$ref": "#/$defs/userMessage"
957
- },
958
- {
959
- "$ref": "#/$defs/userAudioChunk"
960
- },
961
- {
962
- "$ref": "#/$defs/transcriptPartial"
963
- },
964
- {
965
- "$ref": "#/$defs/transcriptFinal"
966
- },
967
- {
968
- "$ref": "#/$defs/memoryRetrievalStarted"
969
- },
970
- {
971
- "$ref": "#/$defs/memoryRetrievalCompleted"
972
- },
973
- {
974
- "$ref": "#/$defs/agentReasoningStarted"
975
- },
976
- {
977
- "$ref": "#/$defs/agentMessageDelta"
978
- },
979
- {
980
- "$ref": "#/$defs/agentMessageCompleted"
981
- },
982
- {
983
- "$ref": "#/$defs/agentTurnExhausted"
984
- },
985
- {
986
- "$ref": "#/$defs/agentTurnFailed"
987
- },
988
- {
989
- "$ref": "#/$defs/toolCallRequested"
990
- },
991
- {
992
- "$ref": "#/$defs/toolCallStarted"
993
- },
994
- {
995
- "$ref": "#/$defs/toolCallCompleted"
996
- },
997
- {
998
- "$ref": "#/$defs/toolCallFailed"
999
- },
1000
- {
1001
- "$ref": "#/$defs/toolApprovalRequested"
1002
- },
1003
- {
1004
- "$ref": "#/$defs/toolApprovalApproved"
1005
- },
1006
- {
1007
- "$ref": "#/$defs/toolApprovalRejected"
1008
- },
1009
- {
1010
- "$ref": "#/$defs/workflowStarted"
1011
- },
1012
- {
1013
- "$ref": "#/$defs/workflowCompleted"
1014
- },
1015
- {
1016
- "$ref": "#/$defs/workflowFailed"
1017
- },
1018
- {
1019
- "$ref": "#/$defs/cancellationRequested"
1020
- },
1021
- {
1022
- "$ref": "#/$defs/cancellationCompleted"
1023
- }
1024
- ]
1025
- }