@lightspeed-ai/sdk 0.4.0 → 0.5.1

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,6 +1,62 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "definitions": {
4
+ "Attachment": {
5
+ "oneOf": [
6
+ {
7
+ "properties": {
8
+ "data": {
9
+ "$ref": "#/definitions/MediaDescriptor"
10
+ },
11
+ "kind": {
12
+ "const": "media",
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": [
17
+ "kind",
18
+ "data"
19
+ ],
20
+ "type": "object"
21
+ },
22
+ {
23
+ "properties": {
24
+ "data": {
25
+ "$ref": "#/definitions/FileAttachment"
26
+ },
27
+ "kind": {
28
+ "const": "file",
29
+ "type": "string"
30
+ }
31
+ },
32
+ "required": [
33
+ "kind",
34
+ "data"
35
+ ],
36
+ "type": "object"
37
+ }
38
+ ]
39
+ },
40
+ "AttachmentSource": {
41
+ "description": "Descriptive origin only; never an authority for resolving attachment bytes.",
42
+ "properties": {
43
+ "id": {
44
+ "type": "string"
45
+ },
46
+ "kind": {
47
+ "type": "string"
48
+ },
49
+ "path": {
50
+ "type": "string"
51
+ }
52
+ },
53
+ "required": [
54
+ "kind",
55
+ "id",
56
+ "path"
57
+ ],
58
+ "type": "object"
59
+ },
4
60
  "Attribution": {
5
61
  "description": "Who created a resource or authored bytes. An actor is whatever a key\nallowed to assert one said; core compares it and never resolves it.",
6
62
  "oneOf": [
@@ -383,6 +439,400 @@
383
439
  }
384
440
  ]
385
441
  },
442
+ "CloseCodeToolScopeRequest": {
443
+ "additionalProperties": false,
444
+ "description": "Close admission immediately. Cancellation additionally requests cleanup of\nadmitted work; closing a scope does not roll back any completed effects.",
445
+ "properties": {
446
+ "cancel_pending": {
447
+ "type": "boolean"
448
+ },
449
+ "execution_id": {
450
+ "type": "string"
451
+ }
452
+ },
453
+ "required": [
454
+ "execution_id",
455
+ "cancel_pending"
456
+ ],
457
+ "type": "object"
458
+ },
459
+ "CodeExecutionDescriptor": {
460
+ "additionalProperties": false,
461
+ "description": "Small, immutable input shared by code-execution orchestration and its runner.\n\nThe parent session owns the execution scope and its bindings. Possessing this\ndescriptor does not authorize tool calls. Validate it before loading artifacts\nor admitting an execution; deserialization alone is not validation.",
462
+ "properties": {
463
+ "catalog_ref": {
464
+ "description": "Immutable matched callable specifications and bindings in the same CAS.\nThis catalog is metadata, not an independent authorization database.",
465
+ "type": "string"
466
+ },
467
+ "execution_id": {
468
+ "description": "Stable identity of the session-owned execution scope.",
469
+ "type": "string"
470
+ },
471
+ "limits": {
472
+ "$ref": "#/definitions/CodeExecutionLimits"
473
+ },
474
+ "session_workflow_id": {
475
+ "description": "Parent session's composed workflow id, without a Temporal run id so the\nidentity remains stable across the parent's Continue-as-New transitions.",
476
+ "type": "string"
477
+ },
478
+ "source_ref": {
479
+ "description": "UTF-8 JavaScript source in the parent session's universe-scoped CAS.",
480
+ "type": "string"
481
+ }
482
+ },
483
+ "required": [
484
+ "execution_id",
485
+ "session_workflow_id",
486
+ "source_ref",
487
+ "catalog_ref",
488
+ "limits"
489
+ ],
490
+ "type": "object"
491
+ },
492
+ "CodeExecutionInterruption": {
493
+ "enum": [
494
+ "holder_cancelled",
495
+ "workflow_cancelled",
496
+ "preparation_failed",
497
+ "activity_failed",
498
+ "activity_timed_out"
499
+ ],
500
+ "type": "string"
501
+ },
502
+ "CodeExecutionLimits": {
503
+ "additionalProperties": false,
504
+ "description": "Explicit, positive budgets admitted for a single execution attempt.\n\nNo deployment defaults are implied. User-requested options may only narrow\nthese budgets. Engine limits must be enforced by the runner; call and payload\nlimits must also be enforced at the trusted session/bridge boundary. These\nbounds are not containment of native interpreter memory faults.",
505
+ "properties": {
506
+ "max_catalog_bytes": {
507
+ "format": "uint64",
508
+ "minimum": 1,
509
+ "type": "integer"
510
+ },
511
+ "max_memory_bytes": {
512
+ "description": "Interpreter-managed heap allocation budget.",
513
+ "format": "uint64",
514
+ "minimum": 1,
515
+ "type": "integer"
516
+ },
517
+ "max_output_bytes": {
518
+ "description": "Total serialized output bytes retained for the final script report.",
519
+ "format": "uint64",
520
+ "minimum": 1,
521
+ "type": "integer"
522
+ },
523
+ "max_outstanding_tool_calls": {
524
+ "description": "Outstanding bridge requests, including durable-promise waits. This does\nnot change the ordinary tool's own scheduling or concurrency policies.",
525
+ "format": "uint32",
526
+ "minimum": 1,
527
+ "type": "integer"
528
+ },
529
+ "max_request_bytes": {
530
+ "description": "Serialized JSON bytes in one guest tool request, before dispatch.",
531
+ "format": "uint64",
532
+ "minimum": 1,
533
+ "type": "integer"
534
+ },
535
+ "max_result_bytes": {
536
+ "description": "Serialized JSON bytes in one host completion, before entering the guest.\nLarger tool outputs require authorized artifact handles.",
537
+ "format": "uint64",
538
+ "minimum": 1,
539
+ "type": "integer"
540
+ },
541
+ "max_source_bytes": {
542
+ "format": "uint64",
543
+ "minimum": 1,
544
+ "type": "integer"
545
+ },
546
+ "max_stack_bytes": {
547
+ "description": "Interpreter-managed native stack budget, separate from its heap budget.",
548
+ "format": "uint64",
549
+ "minimum": 1,
550
+ "type": "integer"
551
+ },
552
+ "max_tool_calls": {
553
+ "format": "uint32",
554
+ "minimum": 1,
555
+ "type": "integer"
556
+ },
557
+ "timeout_ms": {
558
+ "description": "Total attempt time, including input loading, interpreter capacity waits,\nJavaScript evaluation, and time awaiting host calls.",
559
+ "format": "uint64",
560
+ "minimum": 1,
561
+ "type": "integer"
562
+ }
563
+ },
564
+ "required": [
565
+ "timeout_ms",
566
+ "max_memory_bytes",
567
+ "max_stack_bytes",
568
+ "max_source_bytes",
569
+ "max_catalog_bytes",
570
+ "max_request_bytes",
571
+ "max_result_bytes",
572
+ "max_output_bytes",
573
+ "max_tool_calls",
574
+ "max_outstanding_tool_calls"
575
+ ],
576
+ "type": "object"
577
+ },
578
+ "CodeExecutionPhase": {
579
+ "enum": [
580
+ "starting",
581
+ "preparing",
582
+ "running",
583
+ "finalizing",
584
+ "resolved",
585
+ "cancelled"
586
+ ],
587
+ "type": "string"
588
+ },
589
+ "CodeExecutionSnapshot": {
590
+ "description": "Queryable durable orchestration state; no JavaScript heap or raw outputs.",
591
+ "properties": {
592
+ "descriptor": {
593
+ "anyOf": [
594
+ {
595
+ "$ref": "#/definitions/CodeExecutionDescriptor"
596
+ },
597
+ {
598
+ "type": "null"
599
+ }
600
+ ]
601
+ },
602
+ "phase": {
603
+ "$ref": "#/definitions/CodeExecutionPhase"
604
+ },
605
+ "resolution": {
606
+ "anyOf": [
607
+ {
608
+ "$ref": "#/definitions/PromiseResolution"
609
+ },
610
+ {
611
+ "type": "null"
612
+ }
613
+ ]
614
+ },
615
+ "terminal": {
616
+ "anyOf": [
617
+ {
618
+ "$ref": "#/definitions/CodeExecutionTerminal"
619
+ },
620
+ {
621
+ "type": "null"
622
+ }
623
+ ]
624
+ }
625
+ },
626
+ "required": [
627
+ "phase"
628
+ ],
629
+ "type": "object"
630
+ },
631
+ "CodeExecutionTerminal": {
632
+ "oneOf": [
633
+ {
634
+ "properties": {
635
+ "kind": {
636
+ "const": "completed",
637
+ "type": "string"
638
+ },
639
+ "result": {
640
+ "$ref": "#/definitions/CodeRunActivityResult"
641
+ }
642
+ },
643
+ "required": [
644
+ "kind",
645
+ "result"
646
+ ],
647
+ "type": "object"
648
+ },
649
+ {
650
+ "properties": {
651
+ "error_ref": {
652
+ "type": "string"
653
+ },
654
+ "kind": {
655
+ "const": "rejected",
656
+ "type": "string"
657
+ }
658
+ },
659
+ "required": [
660
+ "kind",
661
+ "error_ref"
662
+ ],
663
+ "type": "object"
664
+ },
665
+ {
666
+ "properties": {
667
+ "kind": {
668
+ "const": "interrupted",
669
+ "type": "string"
670
+ },
671
+ "reason": {
672
+ "$ref": "#/definitions/CodeExecutionInterruption"
673
+ },
674
+ "result": {
675
+ "anyOf": [
676
+ {
677
+ "$ref": "#/definitions/CodeRunActivityResult"
678
+ },
679
+ {
680
+ "type": "null"
681
+ }
682
+ ]
683
+ }
684
+ },
685
+ "required": [
686
+ "kind",
687
+ "reason"
688
+ ],
689
+ "type": "object"
690
+ }
691
+ ]
692
+ },
693
+ "CodeRunActivityResult": {
694
+ "description": "Only the reference crosses the activity boundary. Script output and the\ncomplete code tool call report remain in the parent universe's CAS.",
695
+ "properties": {
696
+ "report_ref": {
697
+ "type": "string"
698
+ },
699
+ "succeeded": {
700
+ "type": "boolean"
701
+ }
702
+ },
703
+ "required": [
704
+ "report_ref",
705
+ "succeeded"
706
+ ],
707
+ "type": "object"
708
+ },
709
+ "CodeToolCallOutcome": {
710
+ "description": "Script-facing completion metadata. Session effects, model context, and\nactivity configuration remain private to the owning session.",
711
+ "properties": {
712
+ "attachments": {
713
+ "items": {
714
+ "$ref": "#/definitions/Attachment"
715
+ },
716
+ "type": "array"
717
+ },
718
+ "call_id": {
719
+ "$ref": "#/definitions/ToolCallId"
720
+ },
721
+ "error_ref": {
722
+ "type": [
723
+ "string",
724
+ "null"
725
+ ]
726
+ },
727
+ "output_ref": {
728
+ "type": [
729
+ "string",
730
+ "null"
731
+ ]
732
+ },
733
+ "request_id": {
734
+ "type": "string"
735
+ },
736
+ "status": {
737
+ "$ref": "#/definitions/CodeToolCallStatus"
738
+ }
739
+ },
740
+ "required": [
741
+ "request_id",
742
+ "call_id",
743
+ "status"
744
+ ],
745
+ "type": "object"
746
+ },
747
+ "CodeToolCallStatus": {
748
+ "enum": [
749
+ "pending",
750
+ "waiting",
751
+ "succeeded",
752
+ "failed",
753
+ "cancelled",
754
+ "unavailable"
755
+ ],
756
+ "type": "string"
757
+ },
758
+ "CodeToolRejection": {
759
+ "description": "Admission failures are successful protocol replies, distinct from transport\nfailures and the tool's own failed result. They never imply tool execution.",
760
+ "properties": {
761
+ "kind": {
762
+ "$ref": "#/definitions/CodeToolRejectionKind"
763
+ },
764
+ "message": {
765
+ "type": "string"
766
+ }
767
+ },
768
+ "required": [
769
+ "kind",
770
+ "message"
771
+ ],
772
+ "type": "object"
773
+ },
774
+ "CodeToolRejectionKind": {
775
+ "enum": [
776
+ "invalid_request",
777
+ "unknown_scope",
778
+ "scope_closed",
779
+ "conflict",
780
+ "unavailable",
781
+ "permission_denied",
782
+ "limit_exceeded",
783
+ "session_not_ready",
784
+ "internal"
785
+ ],
786
+ "type": "string"
787
+ },
788
+ "CodeToolScopeReport": {
789
+ "properties": {
790
+ "bindings": {
791
+ "additionalProperties": {
792
+ "$ref": "#/definitions/ToolName"
793
+ },
794
+ "description": "Exposed names keyed by the opaque handles accepted by invoke requests.",
795
+ "type": "object"
796
+ },
797
+ "calls": {
798
+ "additionalProperties": {
799
+ "$ref": "#/definitions/CodeToolCallOutcome"
800
+ },
801
+ "description": "Requests are keyed by execution-local request id, never arrival order.",
802
+ "type": "object"
803
+ },
804
+ "cancel_requested": {
805
+ "type": "boolean"
806
+ },
807
+ "closed": {
808
+ "type": "boolean"
809
+ },
810
+ "execution_id": {
811
+ "type": "string"
812
+ }
813
+ },
814
+ "required": [
815
+ "execution_id",
816
+ "closed",
817
+ "cancel_requested",
818
+ "bindings",
819
+ "calls"
820
+ ],
821
+ "type": "object"
822
+ },
823
+ "CodeToolScopeReportRequest": {
824
+ "additionalProperties": false,
825
+ "description": "Read an authoritative snapshot, including after a runner loses its waiters.",
826
+ "properties": {
827
+ "execution_id": {
828
+ "type": "string"
829
+ }
830
+ },
831
+ "required": [
832
+ "execution_id"
833
+ ],
834
+ "type": "object"
835
+ },
386
836
  "ContentRef": {
387
837
  "description": "Durable content identity and encoding. The payload stays in CAS; consumers\nproject it outside the harness rather than assuming every output is text.",
388
838
  "properties": {
@@ -675,6 +1125,66 @@
675
1125
  }
676
1126
  ]
677
1127
  },
1128
+ "FileAttachment": {
1129
+ "properties": {
1130
+ "content_ref": {
1131
+ "type": "string"
1132
+ },
1133
+ "handle": {
1134
+ "type": "string"
1135
+ },
1136
+ "media_type": {
1137
+ "type": [
1138
+ "string",
1139
+ "null"
1140
+ ]
1141
+ },
1142
+ "name": {
1143
+ "type": "string"
1144
+ },
1145
+ "source": {
1146
+ "anyOf": [
1147
+ {
1148
+ "$ref": "#/definitions/AttachmentSource"
1149
+ },
1150
+ {
1151
+ "type": "null"
1152
+ }
1153
+ ]
1154
+ }
1155
+ },
1156
+ "required": [
1157
+ "handle",
1158
+ "content_ref",
1159
+ "name"
1160
+ ],
1161
+ "type": "object"
1162
+ },
1163
+ "InvokeCodeToolRequest": {
1164
+ "additionalProperties": false,
1165
+ "description": "Small request forwarded by a trusted host after serializing guest arguments.\nIdentity is execution-local. Reusing it with different arguments or a\ndifferent binding is rejected by the session, including across RPC retries.",
1166
+ "properties": {
1167
+ "arguments_ref": {
1168
+ "type": "string"
1169
+ },
1170
+ "binding_id": {
1171
+ "type": "string"
1172
+ },
1173
+ "execution_id": {
1174
+ "type": "string"
1175
+ },
1176
+ "request_id": {
1177
+ "type": "string"
1178
+ }
1179
+ },
1180
+ "required": [
1181
+ "execution_id",
1182
+ "request_id",
1183
+ "binding_id",
1184
+ "arguments_ref"
1185
+ ],
1186
+ "type": "object"
1187
+ },
678
1188
  "MaintainChannelTypingInput": {
679
1189
  "description": "`maintain_channel_typing`: keep the provider's typing indicator up for\nthe conversation until the activity is cancelled.",
680
1190
  "properties": {
@@ -687,6 +1197,45 @@
687
1197
  ],
688
1198
  "type": "object"
689
1199
  },
1200
+ "MediaDescriptor": {
1201
+ "description": "A media asset named for a consumer that did not see it enter context: the\nparent of a sub-agent, an awaited promise's holder. Carries everything\nneeded to append a media entry without reading the bytes.",
1202
+ "properties": {
1203
+ "content_ref": {
1204
+ "type": "string"
1205
+ },
1206
+ "handle": {
1207
+ "description": "`media:` plus the first twelve hex characters of `content_ref`.",
1208
+ "type": "string"
1209
+ },
1210
+ "kind": {
1211
+ "$ref": "#/definitions/MediaKind"
1212
+ },
1213
+ "media_type": {
1214
+ "type": "string"
1215
+ },
1216
+ "name": {
1217
+ "type": [
1218
+ "string",
1219
+ "null"
1220
+ ]
1221
+ }
1222
+ },
1223
+ "required": [
1224
+ "handle",
1225
+ "content_ref",
1226
+ "media_type",
1227
+ "kind"
1228
+ ],
1229
+ "type": "object"
1230
+ },
1231
+ "MediaKind": {
1232
+ "description": "What a media entry is to the providers: an image block or a document block.",
1233
+ "enum": [
1234
+ "image",
1235
+ "document"
1236
+ ],
1237
+ "type": "string"
1238
+ },
690
1239
  "ModelConfig": {
691
1240
  "properties": {
692
1241
  "apiKind": {
@@ -706,6 +1255,47 @@
706
1255
  ],
707
1256
  "type": "object"
708
1257
  },
1258
+ "OpenCodeToolScopeRequest": {
1259
+ "additionalProperties": false,
1260
+ "description": "Trusted host request to open a scope beneath an admitted joined invocation.\nThe session resolves bindings itself; this allowlist can only narrow grants.",
1261
+ "properties": {
1262
+ "allowed_tools": {
1263
+ "default": null,
1264
+ "description": "A supplied set narrows logical tool identities; an empty set grants no\ntools. None selects all currently host-callable tools except the parent\noperation. Reopening an existing scope retains its original bindings.",
1265
+ "items": {
1266
+ "$ref": "#/definitions/ToolName"
1267
+ },
1268
+ "type": [
1269
+ "array",
1270
+ "null"
1271
+ ],
1272
+ "uniqueItems": true
1273
+ },
1274
+ "execution_id": {
1275
+ "type": "string"
1276
+ },
1277
+ "max_calls": {
1278
+ "format": "uint32",
1279
+ "minimum": 1,
1280
+ "type": "integer"
1281
+ },
1282
+ "max_in_flight": {
1283
+ "format": "uint32",
1284
+ "minimum": 1,
1285
+ "type": "integer"
1286
+ },
1287
+ "parent_invocation_id": {
1288
+ "$ref": "#/definitions/WorkflowToolInvocationId"
1289
+ }
1290
+ },
1291
+ "required": [
1292
+ "execution_id",
1293
+ "parent_invocation_id",
1294
+ "max_calls",
1295
+ "max_in_flight"
1296
+ ],
1297
+ "type": "object"
1298
+ },
709
1299
  "PrepareChannelMediaInput": {
710
1300
  "description": "`prepare_channel_media`: the connector downloads the provider file and\nstores it in the universe's CAS.",
711
1301
  "properties": {
@@ -853,6 +1443,9 @@
853
1443
  "ToolCallId": {
854
1444
  "type": "string"
855
1445
  },
1446
+ "ToolName": {
1447
+ "type": "string"
1448
+ },
856
1449
  "TranscriptionActivityResult": {
857
1450
  "oneOf": [
858
1451
  {
@@ -1232,6 +1825,6 @@
1232
1825
  "type": "object"
1233
1826
  }
1234
1827
  },
1235
- "description": "Envelope and start-on-call types of the fixed deliver_emission transport between sessions and receiver workflows.",
1828
+ "description": "Session emission, workflow-tool, and code tool invocation protocol types.",
1236
1829
  "title": "Lightspeed Workflow Contract"
1237
1830
  }