@ellipsis-dev/sdk 0.36.0 → 0.38.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.
@@ -1,8 +1,49 @@
1
1
  {
2
2
  "$defs": {
3
+ "Cost": {
4
+ "description": "What something cost, in millicents.",
5
+ "properties": {
6
+ "charged": {
7
+ "default": 0,
8
+ "description": "What Ellipsis charged to credit, in millicents. It is everything except subscription tokens.",
9
+ "title": "Charged",
10
+ "type": "integer"
11
+ },
12
+ "cpu": {
13
+ "default": 0,
14
+ "description": "CPU spend in millicents.",
15
+ "title": "Cpu",
16
+ "type": "integer"
17
+ },
18
+ "fee": {
19
+ "default": 0,
20
+ "description": "Platform fee in millicents.",
21
+ "title": "Fee",
22
+ "type": "integer"
23
+ },
24
+ "llm": {
25
+ "$ref": "#/$defs/LlmCost",
26
+ "description": "LLM token cost, in total and by model, split by who paid."
27
+ },
28
+ "memory": {
29
+ "default": 0,
30
+ "description": "Memory spend in millicents.",
31
+ "title": "Memory",
32
+ "type": "integer"
33
+ },
34
+ "total": {
35
+ "default": 0,
36
+ "description": "Everything it cost, whoever paid, in millicents. It is the sum of llm.all.total, cpu, memory, and fee, and it is what the budget caps.",
37
+ "title": "Total",
38
+ "type": "integer"
39
+ }
40
+ },
41
+ "title": "Cost",
42
+ "type": "object"
43
+ },
3
44
  "EnvironmentOutputPayload": {
4
45
  "additionalProperties": true,
5
- "description": "environment_output: one chunk of output from preparing the environment,\nincluding the customer's own hooks. Many fire per turn; `chunk` orders them\nwithin a step.",
46
+ "description": "environment_output: one chunk of output from preparing the environment,\nincluding the customer's own hooks. Many fire per message; `chunk` orders\nthem within a step.",
6
47
  "properties": {
7
48
  "chunk": {
8
49
  "title": "Chunk",
@@ -132,141 +173,277 @@
132
173
  "title": "EnvironmentReadyPayload",
133
174
  "type": "object"
134
175
  },
135
- "MessageDeliveredPayload": {
136
- "additionalProperties": true,
137
- "description": "message_delivered: the agent started on the message.",
176
+ "ErrorReason": {
177
+ "description": "Why a message failed, was stopped, or was cancelled.",
178
+ "enum": [
179
+ "error",
180
+ "tool_call_failed",
181
+ "budget_hit",
182
+ "payment_required",
183
+ "blocked",
184
+ "contact_email_required",
185
+ "lifecycle_hook_failed",
186
+ "missing_repo_access",
187
+ "missing_token_permissions",
188
+ "missing_environment_variables",
189
+ "missing_github_integration",
190
+ "agent_unavailable",
191
+ "upstream_unavailable",
192
+ "unsupported_configuration",
193
+ "execution_disabled",
194
+ "interrupted",
195
+ "stopped"
196
+ ],
197
+ "title": "ErrorReason",
198
+ "type": "string"
199
+ },
200
+ "LlmCost": {
201
+ "description": "What LLM tokens cost, in total and by model.",
138
202
  "properties": {
139
- "message_id": {
140
- "title": "Message Id",
141
- "type": "string"
203
+ "all": {
204
+ "$ref": "#/$defs/LlmCostSplit",
205
+ "description": "Token cost across every model."
142
206
  },
143
- "turn_id": {
144
- "title": "Turn Id",
145
- "type": "string"
207
+ "by_model": {
208
+ "description": "Token cost for each model that used tokens.",
209
+ "items": {
210
+ "$ref": "#/$defs/ModelLlmCostSplit"
211
+ },
212
+ "title": "By Model",
213
+ "type": "array"
146
214
  }
147
215
  },
148
- "required": [
149
- "message_id",
150
- "turn_id"
151
- ],
152
- "title": "MessageDeliveredPayload",
216
+ "title": "LlmCost",
153
217
  "type": "object"
154
218
  },
155
- "MessageReceivedPayload": {
156
- "additionalProperties": true,
157
- "description": "message_received: a message landed in the session inbox and its turn was\ncreated. `turn_id` is the turn that will answer it.",
219
+ "LlmCostSplit": {
220
+ "description": "What LLM tokens cost, in millicents, split by who paid (Ellipsis credit or the user's own subscription).",
158
221
  "properties": {
159
- "author": {
160
- "anyOf": [
161
- {
162
- "type": "string"
163
- },
164
- {
165
- "type": "null"
166
- }
167
- ],
168
- "default": null,
169
- "title": "Author"
222
+ "claude_subscription": {
223
+ "default": 0,
224
+ "description": "Token cost paid by a Claude subscription, at Ellipsis rates, in millicents.",
225
+ "title": "Claude Subscription",
226
+ "type": "integer"
170
227
  },
171
- "body": {
172
- "title": "Body",
173
- "type": "string"
228
+ "codex_subscription": {
229
+ "default": 0,
230
+ "description": "Token cost paid by a Codex subscription, at Ellipsis rates, in millicents.",
231
+ "title": "Codex Subscription",
232
+ "type": "integer"
174
233
  },
175
- "closes_session": {
176
- "default": false,
177
- "title": "Closes Session",
178
- "type": "boolean"
234
+ "platform": {
235
+ "default": 0,
236
+ "description": "Token cost charged to Ellipsis credit, in millicents.",
237
+ "title": "Platform",
238
+ "type": "integer"
179
239
  },
180
- "message_id": {
181
- "title": "Message Id",
182
- "type": "string"
240
+ "total": {
241
+ "default": 0,
242
+ "description": "All token cost, in millicents. It is the sum of platform, claude_subscription, and codex_subscription.",
243
+ "title": "Total",
244
+ "type": "integer"
245
+ }
246
+ },
247
+ "title": "LlmCostSplit",
248
+ "type": "object"
249
+ },
250
+ "MessageEndedPayload": {
251
+ "additionalProperties": true,
252
+ "description": "message_ended: the message was answered, or its answer failed, was\nstopped, or was cancelled. `error` is the same object as the session's\n`error`, null when the message was answered. `cost` and `tokens` are what\nanswering it spent. Messages answered together report the spend once, on\nthe last of them.",
253
+ "properties": {
254
+ "cost": {
255
+ "$ref": "#/$defs/Cost"
183
256
  },
184
- "sender_attribution_id": {
257
+ "duration_ms": {
185
258
  "anyOf": [
186
259
  {
187
- "type": "string"
260
+ "type": "integer"
188
261
  },
189
262
  {
190
263
  "type": "null"
191
264
  }
192
265
  ],
193
266
  "default": null,
194
- "title": "Sender Attribution Id"
267
+ "title": "Duration Ms"
195
268
  },
196
- "sender_attribution_type": {
269
+ "error": {
197
270
  "anyOf": [
198
271
  {
199
- "type": "string"
272
+ "$ref": "#/$defs/SessionError"
200
273
  },
201
274
  {
202
275
  "type": "null"
203
276
  }
204
277
  ],
205
- "default": null,
206
- "title": "Sender Attribution Type"
278
+ "default": null
207
279
  },
208
- "turn_id": {
209
- "anyOf": [
210
- {
211
- "type": "string"
212
- },
213
- {
214
- "type": "null"
215
- }
216
- ],
217
- "default": null,
218
- "title": "Turn Id"
280
+ "message_id": {
281
+ "title": "Message Id",
282
+ "type": "string"
283
+ },
284
+ "status": {
285
+ "title": "Status",
286
+ "type": "string"
287
+ },
288
+ "tokens": {
289
+ "$ref": "#/$defs/Tokens"
219
290
  }
220
291
  },
221
292
  "required": [
222
293
  "message_id",
223
- "body"
294
+ "status"
224
295
  ],
225
- "title": "MessageReceivedPayload",
296
+ "title": "MessageEndedPayload",
297
+ "type": "object"
298
+ },
299
+ "MessageQueuedPayload": {
300
+ "additionalProperties": true,
301
+ "description": "message_queued: the message waits because the account already has\n`sessions_alive` sessions alive, its limit.",
302
+ "properties": {
303
+ "limit": {
304
+ "title": "Limit",
305
+ "type": "integer"
306
+ },
307
+ "message_id": {
308
+ "title": "Message Id",
309
+ "type": "string"
310
+ },
311
+ "sessions_alive": {
312
+ "title": "Sessions Alive",
313
+ "type": "integer"
314
+ }
315
+ },
316
+ "required": [
317
+ "message_id",
318
+ "sessions_alive",
319
+ "limit"
320
+ ],
321
+ "title": "MessageQueuedPayload",
226
322
  "type": "object"
227
323
  },
228
324
  "MessageRequeuedPayload": {
229
325
  "additionalProperties": true,
230
- "description": "message_requeued: a turn was interrupted before answering, so the\nmessage goes back to the inbox with a new queued turn.",
326
+ "description": "message_requeued: the agent was interrupted before answering, so the\nmessage goes back to the inbox and starts again on a fresh environment.",
327
+ "properties": {
328
+ "message_id": {
329
+ "title": "Message Id",
330
+ "type": "string"
331
+ }
332
+ },
333
+ "required": [
334
+ "message_id"
335
+ ],
336
+ "title": "MessageRequeuedPayload",
337
+ "type": "object"
338
+ },
339
+ "MessageStartedPayload": {
340
+ "additionalProperties": true,
341
+ "description": "message_started: the agent started on the message.",
231
342
  "properties": {
232
343
  "message_id": {
233
344
  "title": "Message Id",
234
345
  "type": "string"
346
+ }
347
+ },
348
+ "required": [
349
+ "message_id"
350
+ ],
351
+ "title": "MessageStartedPayload",
352
+ "type": "object"
353
+ },
354
+ "ModelLlmCostSplit": {
355
+ "description": "What one model's tokens cost, in millicents, split by who paid.",
356
+ "properties": {
357
+ "claude_subscription": {
358
+ "default": 0,
359
+ "description": "Token cost paid by a Claude subscription, at Ellipsis rates, in millicents.",
360
+ "title": "Claude Subscription",
361
+ "type": "integer"
235
362
  },
236
- "requeued_turn_id": {
237
- "anyOf": [
238
- {
239
- "type": "string"
240
- },
241
- {
242
- "type": "null"
243
- }
244
- ],
245
- "default": null,
246
- "title": "Requeued Turn Id"
363
+ "codex_subscription": {
364
+ "default": 0,
365
+ "description": "Token cost paid by a Codex subscription, at Ellipsis rates, in millicents.",
366
+ "title": "Codex Subscription",
367
+ "type": "integer"
247
368
  },
248
- "turn_id": {
249
- "title": "Turn Id",
369
+ "model": {
370
+ "description": "The model that used these tokens.",
371
+ "title": "Model",
250
372
  "type": "string"
373
+ },
374
+ "platform": {
375
+ "default": 0,
376
+ "description": "Token cost charged to Ellipsis credit, in millicents.",
377
+ "title": "Platform",
378
+ "type": "integer"
379
+ },
380
+ "total": {
381
+ "default": 0,
382
+ "description": "All token cost, in millicents. It is the sum of platform, claude_subscription, and codex_subscription.",
383
+ "title": "Total",
384
+ "type": "integer"
251
385
  }
252
386
  },
253
387
  "required": [
254
- "message_id",
255
- "turn_id"
388
+ "model"
256
389
  ],
257
- "title": "MessageRequeuedPayload",
390
+ "title": "ModelLlmCostSplit",
391
+ "type": "object"
392
+ },
393
+ "ModelTokenCounts": {
394
+ "description": "Token counts for one model.",
395
+ "properties": {
396
+ "cache_creation": {
397
+ "default": 0,
398
+ "description": "Tokens written to the prompt cache.",
399
+ "title": "Cache Creation",
400
+ "type": "integer"
401
+ },
402
+ "cache_read": {
403
+ "default": 0,
404
+ "description": "Tokens read from the prompt cache.",
405
+ "title": "Cache Read",
406
+ "type": "integer"
407
+ },
408
+ "input": {
409
+ "default": 0,
410
+ "description": "Input tokens used.",
411
+ "title": "Input",
412
+ "type": "integer"
413
+ },
414
+ "model": {
415
+ "description": "The model that used these tokens.",
416
+ "title": "Model",
417
+ "type": "string"
418
+ },
419
+ "output": {
420
+ "default": 0,
421
+ "description": "Output tokens used.",
422
+ "title": "Output",
423
+ "type": "integer"
424
+ },
425
+ "total": {
426
+ "default": 0,
427
+ "description": "All tokens used, including prompt cache reads and writes. Token cost is priced on this.",
428
+ "title": "Total",
429
+ "type": "integer"
430
+ }
431
+ },
432
+ "required": [
433
+ "model"
434
+ ],
435
+ "title": "ModelTokenCounts",
258
436
  "type": "object"
259
437
  },
260
438
  "SessionClosedPayload": {
261
439
  "additionalProperties": true,
262
- "description": "session_closed: the conversation closed permanently.",
440
+ "description": "session_closed: the session closed permanently.",
263
441
  "properties": {},
264
442
  "title": "SessionClosedPayload",
265
443
  "type": "object"
266
444
  },
267
- "TurnEndedPayload": {
268
- "additionalProperties": true,
269
- "description": "turn_ended: the turn reached its final status. `status`, `reason`, and\n`detail` match the turn on the session object.",
445
+ "SessionError": {
446
+ "description": "Why the last message failed, was stopped, or was cancelled. Cleared\nwhen the next message starts.",
270
447
  "properties": {
271
448
  "detail": {
272
449
  "anyOf": [
@@ -278,21 +455,24 @@
278
455
  }
279
456
  ],
280
457
  "default": null,
458
+ "description": "A human-readable explanation.",
281
459
  "title": "Detail"
282
460
  },
283
- "duration_ms": {
284
- "anyOf": [
285
- {
286
- "type": "integer"
287
- },
288
- {
289
- "type": "null"
290
- }
291
- ],
292
- "default": null,
293
- "title": "Duration Ms"
294
- },
295
461
  "reason": {
462
+ "$ref": "#/$defs/ErrorReason",
463
+ "description": "What went wrong."
464
+ }
465
+ },
466
+ "required": [
467
+ "reason"
468
+ ],
469
+ "title": "SessionError",
470
+ "type": "object"
471
+ },
472
+ "SessionMessage": {
473
+ "description": "One message sent to a session.",
474
+ "properties": {
475
+ "author": {
296
476
  "anyOf": [
297
477
  {
298
478
  "type": "string"
@@ -302,72 +482,135 @@
302
482
  }
303
483
  ],
304
484
  "default": null,
305
- "title": "Reason"
485
+ "description": "Display attribution of the message's sender.",
486
+ "title": "Author"
306
487
  },
307
- "status": {
308
- "title": "Status",
488
+ "body": {
489
+ "description": "The message text, with one `[Image #N]` placeholder per attached image.",
490
+ "title": "Body",
309
491
  "type": "string"
310
492
  },
311
- "turn_id": {
312
- "title": "Turn Id",
493
+ "created_at": {
494
+ "description": "When the message was received.",
495
+ "format": "date-time",
496
+ "title": "Created At",
313
497
  "type": "string"
314
498
  },
315
- "turn_index": {
316
- "title": "Turn Index",
499
+ "id": {
500
+ "description": "Unique identifier of the message.",
501
+ "title": "Id",
502
+ "type": "string"
503
+ },
504
+ "images": {
505
+ "description": "Images attached to the message, metadata only: index, media type, size. The bytes go to the model, never over the stream.",
506
+ "items": {
507
+ "$ref": "#/$defs/SessionMessageImage"
508
+ },
509
+ "title": "Images",
510
+ "type": "array"
511
+ },
512
+ "index": {
513
+ "description": "Position in the session, starting at 0.",
514
+ "title": "Index",
317
515
  "type": "integer"
516
+ },
517
+ "session_id": {
518
+ "description": "Identifier of the session the message belongs to.",
519
+ "title": "Session Id",
520
+ "type": "string"
318
521
  }
319
522
  },
320
523
  "required": [
321
- "turn_id",
322
- "turn_index",
323
- "status"
524
+ "id",
525
+ "session_id",
526
+ "index",
527
+ "body",
528
+ "created_at"
324
529
  ],
325
- "title": "TurnEndedPayload",
530
+ "title": "SessionMessage",
326
531
  "type": "object"
327
532
  },
328
- "TurnQueuedPayload": {
329
- "additionalProperties": true,
330
- "description": "turn_queued: the turn waits because the account already has\n`sessions_alive` sessions alive, its limit.",
533
+ "SessionMessageImage": {
534
+ "description": "One image on a message, metadata only. `index` is the N in the\n`[Image #N]` placeholder in the message body.",
331
535
  "properties": {
332
- "limit": {
333
- "title": "Limit",
536
+ "index": {
537
+ "description": "1-based position: the N in `[Image #N]`.",
538
+ "title": "Index",
334
539
  "type": "integer"
335
540
  },
336
- "sessions_alive": {
337
- "title": "Sessions Alive",
338
- "type": "integer"
339
- },
340
- "turn_id": {
341
- "title": "Turn Id",
541
+ "media_type": {
542
+ "description": "The image's MIME type.",
543
+ "title": "Media Type",
342
544
  "type": "string"
545
+ },
546
+ "size_bytes": {
547
+ "description": "Size of the decoded image, in bytes.",
548
+ "title": "Size Bytes",
549
+ "type": "integer"
343
550
  }
344
551
  },
345
552
  "required": [
346
- "turn_id",
347
- "sessions_alive",
348
- "limit"
553
+ "index",
554
+ "media_type",
555
+ "size_bytes"
349
556
  ],
350
- "title": "TurnQueuedPayload",
557
+ "title": "SessionMessageImage",
351
558
  "type": "object"
352
559
  },
353
- "TurnStartedPayload": {
354
- "additionalProperties": true,
355
- "description": "turn_started: the agent started on the turn's message.",
560
+ "TokenCounts": {
561
+ "description": "Token counts.",
356
562
  "properties": {
357
- "turn_id": {
358
- "title": "Turn Id",
359
- "type": "string"
563
+ "cache_creation": {
564
+ "default": 0,
565
+ "description": "Tokens written to the prompt cache.",
566
+ "title": "Cache Creation",
567
+ "type": "integer"
568
+ },
569
+ "cache_read": {
570
+ "default": 0,
571
+ "description": "Tokens read from the prompt cache.",
572
+ "title": "Cache Read",
573
+ "type": "integer"
574
+ },
575
+ "input": {
576
+ "default": 0,
577
+ "description": "Input tokens used.",
578
+ "title": "Input",
579
+ "type": "integer"
360
580
  },
361
- "turn_index": {
362
- "title": "Turn Index",
581
+ "output": {
582
+ "default": 0,
583
+ "description": "Output tokens used.",
584
+ "title": "Output",
585
+ "type": "integer"
586
+ },
587
+ "total": {
588
+ "default": 0,
589
+ "description": "All tokens used, including prompt cache reads and writes. Token cost is priced on this.",
590
+ "title": "Total",
363
591
  "type": "integer"
364
592
  }
365
593
  },
366
- "required": [
367
- "turn_id",
368
- "turn_index"
369
- ],
370
- "title": "TurnStartedPayload",
594
+ "title": "TokenCounts",
595
+ "type": "object"
596
+ },
597
+ "Tokens": {
598
+ "description": "Tokens used, in total and by model.",
599
+ "properties": {
600
+ "all": {
601
+ "$ref": "#/$defs/TokenCounts",
602
+ "description": "Token counts across every model."
603
+ },
604
+ "by_model": {
605
+ "description": "Token counts for each model that used tokens.",
606
+ "items": {
607
+ "$ref": "#/$defs/ModelTokenCounts"
608
+ },
609
+ "title": "By Model",
610
+ "type": "array"
611
+ }
612
+ },
613
+ "title": "Tokens",
371
614
  "type": "object"
372
615
  }
373
616
  },
@@ -383,39 +626,35 @@
383
626
  "environment_ready": {
384
627
  "$ref": "#/$defs/EnvironmentReadyPayload"
385
628
  },
386
- "message_delivered": {
387
- "$ref": "#/$defs/MessageDeliveredPayload"
629
+ "message": {
630
+ "$ref": "#/$defs/SessionMessage"
388
631
  },
389
- "message_received": {
390
- "$ref": "#/$defs/MessageReceivedPayload"
632
+ "message_ended": {
633
+ "$ref": "#/$defs/MessageEndedPayload"
634
+ },
635
+ "message_queued": {
636
+ "$ref": "#/$defs/MessageQueuedPayload"
391
637
  },
392
638
  "message_requeued": {
393
639
  "$ref": "#/$defs/MessageRequeuedPayload"
394
640
  },
641
+ "message_started": {
642
+ "$ref": "#/$defs/MessageStartedPayload"
643
+ },
395
644
  "session_closed": {
396
645
  "$ref": "#/$defs/SessionClosedPayload"
397
- },
398
- "turn_ended": {
399
- "$ref": "#/$defs/TurnEndedPayload"
400
- },
401
- "turn_queued": {
402
- "$ref": "#/$defs/TurnQueuedPayload"
403
- },
404
- "turn_started": {
405
- "$ref": "#/$defs/TurnStartedPayload"
406
646
  }
407
647
  },
408
648
  "required": [
409
649
  "environment_output",
410
650
  "environment_phase",
411
651
  "environment_ready",
412
- "message_delivered",
413
- "message_received",
652
+ "message",
653
+ "message_ended",
654
+ "message_queued",
414
655
  "message_requeued",
415
- "session_closed",
416
- "turn_ended",
417
- "turn_queued",
418
- "turn_started"
656
+ "message_started",
657
+ "session_closed"
419
658
  ],
420
659
  "title": "LifecyclePayloads",
421
660
  "type": "object"