@cultured_computer/sight 0.8.4 → 0.10.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.
- package/CHANGELOG.md +49 -0
- package/README.md +207 -4
- package/dist/cli.js +584 -2
- package/dist/index.cjs +331 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +614 -27
- package/dist/index.d.ts +614 -27
- package/dist/index.js +327 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -292,12 +292,12 @@ declare const SpanInputV1Schema: z.ZodObject<{
|
|
|
292
292
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
293
293
|
error?: string | undefined;
|
|
294
294
|
name?: string | undefined;
|
|
295
|
+
model?: string | undefined;
|
|
295
296
|
turnIndex?: number | undefined;
|
|
296
297
|
startedAt?: string | undefined;
|
|
297
298
|
endedAt?: string | undefined;
|
|
298
299
|
contractVersion?: 1 | undefined;
|
|
299
300
|
durationMs?: number | undefined;
|
|
300
|
-
model?: string | undefined;
|
|
301
301
|
provider?: string | undefined;
|
|
302
302
|
tokensInput?: number | undefined;
|
|
303
303
|
tokensOutput?: number | undefined;
|
|
@@ -311,12 +311,12 @@ declare const SpanInputV1Schema: z.ZodObject<{
|
|
|
311
311
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
312
312
|
error?: string | undefined;
|
|
313
313
|
name?: string | undefined;
|
|
314
|
+
model?: string | undefined;
|
|
314
315
|
turnIndex?: number | undefined;
|
|
315
316
|
startedAt?: string | undefined;
|
|
316
317
|
endedAt?: string | undefined;
|
|
317
318
|
contractVersion?: 1 | undefined;
|
|
318
319
|
durationMs?: number | undefined;
|
|
319
|
-
model?: string | undefined;
|
|
320
320
|
provider?: string | undefined;
|
|
321
321
|
tokensInput?: number | undefined;
|
|
322
322
|
tokensOutput?: number | undefined;
|
|
@@ -385,6 +385,7 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
385
385
|
error: string | null;
|
|
386
386
|
status: "ok" | "error";
|
|
387
387
|
name: string;
|
|
388
|
+
model: string | null;
|
|
388
389
|
deploymentSlug: string;
|
|
389
390
|
sessionExternalId: string;
|
|
390
391
|
startedAt: string;
|
|
@@ -392,7 +393,6 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
392
393
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
393
394
|
contractVersion: 2;
|
|
394
395
|
durationMs: number | null;
|
|
395
|
-
model: string | null;
|
|
396
396
|
provider: string | null;
|
|
397
397
|
tokensInput: number | null;
|
|
398
398
|
tokensOutput: number | null;
|
|
@@ -412,6 +412,7 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
412
412
|
error: string | null;
|
|
413
413
|
status: "ok" | "error";
|
|
414
414
|
name: string;
|
|
415
|
+
model: string | null;
|
|
415
416
|
deploymentSlug: string;
|
|
416
417
|
sessionExternalId: string;
|
|
417
418
|
startedAt: string;
|
|
@@ -419,7 +420,6 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
419
420
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
420
421
|
contractVersion: 2;
|
|
421
422
|
durationMs: number | null;
|
|
422
|
-
model: string | null;
|
|
423
423
|
provider: string | null;
|
|
424
424
|
tokensInput: number | null;
|
|
425
425
|
tokensOutput: number | null;
|
|
@@ -439,6 +439,7 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
439
439
|
error: string | null;
|
|
440
440
|
status: "ok" | "error";
|
|
441
441
|
name: string;
|
|
442
|
+
model: string | null;
|
|
442
443
|
deploymentSlug: string;
|
|
443
444
|
sessionExternalId: string;
|
|
444
445
|
startedAt: string;
|
|
@@ -446,7 +447,6 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
446
447
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
447
448
|
contractVersion: 2;
|
|
448
449
|
durationMs: number | null;
|
|
449
|
-
model: string | null;
|
|
450
450
|
provider: string | null;
|
|
451
451
|
tokensInput: number | null;
|
|
452
452
|
tokensOutput: number | null;
|
|
@@ -466,6 +466,7 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
466
466
|
error: string | null;
|
|
467
467
|
status: "ok" | "error";
|
|
468
468
|
name: string;
|
|
469
|
+
model: string | null;
|
|
469
470
|
deploymentSlug: string;
|
|
470
471
|
sessionExternalId: string;
|
|
471
472
|
startedAt: string;
|
|
@@ -473,7 +474,6 @@ declare const SpanInputV2Schema: z.ZodEffects<z.ZodObject<{
|
|
|
473
474
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
474
475
|
contractVersion: 2;
|
|
475
476
|
durationMs: number | null;
|
|
476
|
-
model: string | null;
|
|
477
477
|
provider: string | null;
|
|
478
478
|
tokensInput: number | null;
|
|
479
479
|
tokensOutput: number | null;
|
|
@@ -548,6 +548,7 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
548
548
|
error: string | null;
|
|
549
549
|
status: "ok" | "error";
|
|
550
550
|
name: string;
|
|
551
|
+
model: string | null;
|
|
551
552
|
deploymentSlug: string;
|
|
552
553
|
sessionExternalId: string;
|
|
553
554
|
startedAt: string;
|
|
@@ -555,7 +556,6 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
555
556
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
556
557
|
contractVersion: 2;
|
|
557
558
|
durationMs: number | null;
|
|
558
|
-
model: string | null;
|
|
559
559
|
provider: string | null;
|
|
560
560
|
tokensInput: number | null;
|
|
561
561
|
tokensOutput: number | null;
|
|
@@ -575,6 +575,7 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
575
575
|
error: string | null;
|
|
576
576
|
status: "ok" | "error";
|
|
577
577
|
name: string;
|
|
578
|
+
model: string | null;
|
|
578
579
|
deploymentSlug: string;
|
|
579
580
|
sessionExternalId: string;
|
|
580
581
|
startedAt: string;
|
|
@@ -582,7 +583,6 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
582
583
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
583
584
|
contractVersion: 2;
|
|
584
585
|
durationMs: number | null;
|
|
585
|
-
model: string | null;
|
|
586
586
|
provider: string | null;
|
|
587
587
|
tokensInput: number | null;
|
|
588
588
|
tokensOutput: number | null;
|
|
@@ -602,6 +602,7 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
602
602
|
error: string | null;
|
|
603
603
|
status: "ok" | "error";
|
|
604
604
|
name: string;
|
|
605
|
+
model: string | null;
|
|
605
606
|
deploymentSlug: string;
|
|
606
607
|
sessionExternalId: string;
|
|
607
608
|
startedAt: string;
|
|
@@ -609,7 +610,6 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
609
610
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
610
611
|
contractVersion: 2;
|
|
611
612
|
durationMs: number | null;
|
|
612
|
-
model: string | null;
|
|
613
613
|
provider: string | null;
|
|
614
614
|
tokensInput: number | null;
|
|
615
615
|
tokensOutput: number | null;
|
|
@@ -629,6 +629,7 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
629
629
|
error: string | null;
|
|
630
630
|
status: "ok" | "error";
|
|
631
631
|
name: string;
|
|
632
|
+
model: string | null;
|
|
632
633
|
deploymentSlug: string;
|
|
633
634
|
sessionExternalId: string;
|
|
634
635
|
startedAt: string;
|
|
@@ -636,7 +637,6 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
636
637
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
637
638
|
contractVersion: 2;
|
|
638
639
|
durationMs: number | null;
|
|
639
|
-
model: string | null;
|
|
640
640
|
provider: string | null;
|
|
641
641
|
tokensInput: number | null;
|
|
642
642
|
tokensOutput: number | null;
|
|
@@ -706,12 +706,12 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
706
706
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
707
707
|
error?: string | undefined;
|
|
708
708
|
name?: string | undefined;
|
|
709
|
+
model?: string | undefined;
|
|
709
710
|
turnIndex?: number | undefined;
|
|
710
711
|
startedAt?: string | undefined;
|
|
711
712
|
endedAt?: string | undefined;
|
|
712
713
|
contractVersion?: 1 | undefined;
|
|
713
714
|
durationMs?: number | undefined;
|
|
714
|
-
model?: string | undefined;
|
|
715
715
|
provider?: string | undefined;
|
|
716
716
|
tokensInput?: number | undefined;
|
|
717
717
|
tokensOutput?: number | undefined;
|
|
@@ -725,12 +725,12 @@ declare const SpanInputSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
|
725
725
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
726
726
|
error?: string | undefined;
|
|
727
727
|
name?: string | undefined;
|
|
728
|
+
model?: string | undefined;
|
|
728
729
|
turnIndex?: number | undefined;
|
|
729
730
|
startedAt?: string | undefined;
|
|
730
731
|
endedAt?: string | undefined;
|
|
731
732
|
contractVersion?: 1 | undefined;
|
|
732
733
|
durationMs?: number | undefined;
|
|
733
|
-
model?: string | undefined;
|
|
734
734
|
provider?: string | undefined;
|
|
735
735
|
tokensInput?: number | undefined;
|
|
736
736
|
tokensOutput?: number | undefined;
|
|
@@ -802,6 +802,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
802
802
|
error: string | null;
|
|
803
803
|
status: "ok" | "error";
|
|
804
804
|
name: string;
|
|
805
|
+
model: string | null;
|
|
805
806
|
deploymentSlug: string;
|
|
806
807
|
sessionExternalId: string;
|
|
807
808
|
startedAt: string;
|
|
@@ -809,7 +810,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
809
810
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
810
811
|
contractVersion: 2;
|
|
811
812
|
durationMs: number | null;
|
|
812
|
-
model: string | null;
|
|
813
813
|
provider: string | null;
|
|
814
814
|
tokensInput: number | null;
|
|
815
815
|
tokensOutput: number | null;
|
|
@@ -829,6 +829,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
829
829
|
error: string | null;
|
|
830
830
|
status: "ok" | "error";
|
|
831
831
|
name: string;
|
|
832
|
+
model: string | null;
|
|
832
833
|
deploymentSlug: string;
|
|
833
834
|
sessionExternalId: string;
|
|
834
835
|
startedAt: string;
|
|
@@ -836,7 +837,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
836
837
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
837
838
|
contractVersion: 2;
|
|
838
839
|
durationMs: number | null;
|
|
839
|
-
model: string | null;
|
|
840
840
|
provider: string | null;
|
|
841
841
|
tokensInput: number | null;
|
|
842
842
|
tokensOutput: number | null;
|
|
@@ -856,6 +856,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
856
856
|
error: string | null;
|
|
857
857
|
status: "ok" | "error";
|
|
858
858
|
name: string;
|
|
859
|
+
model: string | null;
|
|
859
860
|
deploymentSlug: string;
|
|
860
861
|
sessionExternalId: string;
|
|
861
862
|
startedAt: string;
|
|
@@ -863,7 +864,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
863
864
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
864
865
|
contractVersion: 2;
|
|
865
866
|
durationMs: number | null;
|
|
866
|
-
model: string | null;
|
|
867
867
|
provider: string | null;
|
|
868
868
|
tokensInput: number | null;
|
|
869
869
|
tokensOutput: number | null;
|
|
@@ -883,6 +883,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
883
883
|
error: string | null;
|
|
884
884
|
status: "ok" | "error";
|
|
885
885
|
name: string;
|
|
886
|
+
model: string | null;
|
|
886
887
|
deploymentSlug: string;
|
|
887
888
|
sessionExternalId: string;
|
|
888
889
|
startedAt: string;
|
|
@@ -890,7 +891,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
890
891
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
891
892
|
contractVersion: 2;
|
|
892
893
|
durationMs: number | null;
|
|
893
|
-
model: string | null;
|
|
894
894
|
provider: string | null;
|
|
895
895
|
tokensInput: number | null;
|
|
896
896
|
tokensOutput: number | null;
|
|
@@ -960,12 +960,12 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
960
960
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
961
961
|
error?: string | undefined;
|
|
962
962
|
name?: string | undefined;
|
|
963
|
+
model?: string | undefined;
|
|
963
964
|
turnIndex?: number | undefined;
|
|
964
965
|
startedAt?: string | undefined;
|
|
965
966
|
endedAt?: string | undefined;
|
|
966
967
|
contractVersion?: 1 | undefined;
|
|
967
968
|
durationMs?: number | undefined;
|
|
968
|
-
model?: string | undefined;
|
|
969
969
|
provider?: string | undefined;
|
|
970
970
|
tokensInput?: number | undefined;
|
|
971
971
|
tokensOutput?: number | undefined;
|
|
@@ -979,12 +979,12 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
979
979
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
980
980
|
error?: string | undefined;
|
|
981
981
|
name?: string | undefined;
|
|
982
|
+
model?: string | undefined;
|
|
982
983
|
turnIndex?: number | undefined;
|
|
983
984
|
startedAt?: string | undefined;
|
|
984
985
|
endedAt?: string | undefined;
|
|
985
986
|
contractVersion?: 1 | undefined;
|
|
986
987
|
durationMs?: number | undefined;
|
|
987
|
-
model?: string | undefined;
|
|
988
988
|
provider?: string | undefined;
|
|
989
989
|
tokensInput?: number | undefined;
|
|
990
990
|
tokensOutput?: number | undefined;
|
|
@@ -1018,12 +1018,12 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1018
1018
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1019
1019
|
error?: string | undefined;
|
|
1020
1020
|
name?: string | undefined;
|
|
1021
|
+
model?: string | undefined;
|
|
1021
1022
|
turnIndex?: number | undefined;
|
|
1022
1023
|
startedAt?: string | undefined;
|
|
1023
1024
|
endedAt?: string | undefined;
|
|
1024
1025
|
contractVersion?: 1 | undefined;
|
|
1025
1026
|
durationMs?: number | undefined;
|
|
1026
|
-
model?: string | undefined;
|
|
1027
1027
|
provider?: string | undefined;
|
|
1028
1028
|
tokensInput?: number | undefined;
|
|
1029
1029
|
tokensOutput?: number | undefined;
|
|
@@ -1035,6 +1035,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1035
1035
|
error: string | null;
|
|
1036
1036
|
status: "ok" | "error";
|
|
1037
1037
|
name: string;
|
|
1038
|
+
model: string | null;
|
|
1038
1039
|
deploymentSlug: string;
|
|
1039
1040
|
sessionExternalId: string;
|
|
1040
1041
|
startedAt: string;
|
|
@@ -1042,7 +1043,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1042
1043
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1043
1044
|
contractVersion: 2;
|
|
1044
1045
|
durationMs: number | null;
|
|
1045
|
-
model: string | null;
|
|
1046
1046
|
provider: string | null;
|
|
1047
1047
|
tokensInput: number | null;
|
|
1048
1048
|
tokensOutput: number | null;
|
|
@@ -1071,12 +1071,12 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1071
1071
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1072
1072
|
error?: string | undefined;
|
|
1073
1073
|
name?: string | undefined;
|
|
1074
|
+
model?: string | undefined;
|
|
1074
1075
|
turnIndex?: number | undefined;
|
|
1075
1076
|
startedAt?: string | undefined;
|
|
1076
1077
|
endedAt?: string | undefined;
|
|
1077
1078
|
contractVersion?: 1 | undefined;
|
|
1078
1079
|
durationMs?: number | undefined;
|
|
1079
|
-
model?: string | undefined;
|
|
1080
1080
|
provider?: string | undefined;
|
|
1081
1081
|
tokensInput?: number | undefined;
|
|
1082
1082
|
tokensOutput?: number | undefined;
|
|
@@ -1088,6 +1088,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1088
1088
|
error: string | null;
|
|
1089
1089
|
status: "ok" | "error";
|
|
1090
1090
|
name: string;
|
|
1091
|
+
model: string | null;
|
|
1091
1092
|
deploymentSlug: string;
|
|
1092
1093
|
sessionExternalId: string;
|
|
1093
1094
|
startedAt: string;
|
|
@@ -1095,7 +1096,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1095
1096
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1096
1097
|
contractVersion: 2;
|
|
1097
1098
|
durationMs: number | null;
|
|
1098
|
-
model: string | null;
|
|
1099
1099
|
provider: string | null;
|
|
1100
1100
|
tokensInput: number | null;
|
|
1101
1101
|
tokensOutput: number | null;
|
|
@@ -1124,12 +1124,12 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1124
1124
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1125
1125
|
error?: string | undefined;
|
|
1126
1126
|
name?: string | undefined;
|
|
1127
|
+
model?: string | undefined;
|
|
1127
1128
|
turnIndex?: number | undefined;
|
|
1128
1129
|
startedAt?: string | undefined;
|
|
1129
1130
|
endedAt?: string | undefined;
|
|
1130
1131
|
contractVersion?: 1 | undefined;
|
|
1131
1132
|
durationMs?: number | undefined;
|
|
1132
|
-
model?: string | undefined;
|
|
1133
1133
|
provider?: string | undefined;
|
|
1134
1134
|
tokensInput?: number | undefined;
|
|
1135
1135
|
tokensOutput?: number | undefined;
|
|
@@ -1141,6 +1141,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1141
1141
|
error: string | null;
|
|
1142
1142
|
status: "ok" | "error";
|
|
1143
1143
|
name: string;
|
|
1144
|
+
model: string | null;
|
|
1144
1145
|
deploymentSlug: string;
|
|
1145
1146
|
sessionExternalId: string;
|
|
1146
1147
|
startedAt: string;
|
|
@@ -1148,7 +1149,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1148
1149
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1149
1150
|
contractVersion: 2;
|
|
1150
1151
|
durationMs: number | null;
|
|
1151
|
-
model: string | null;
|
|
1152
1152
|
provider: string | null;
|
|
1153
1153
|
tokensInput: number | null;
|
|
1154
1154
|
tokensOutput: number | null;
|
|
@@ -1177,12 +1177,12 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1177
1177
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1178
1178
|
error?: string | undefined;
|
|
1179
1179
|
name?: string | undefined;
|
|
1180
|
+
model?: string | undefined;
|
|
1180
1181
|
turnIndex?: number | undefined;
|
|
1181
1182
|
startedAt?: string | undefined;
|
|
1182
1183
|
endedAt?: string | undefined;
|
|
1183
1184
|
contractVersion?: 1 | undefined;
|
|
1184
1185
|
durationMs?: number | undefined;
|
|
1185
|
-
model?: string | undefined;
|
|
1186
1186
|
provider?: string | undefined;
|
|
1187
1187
|
tokensInput?: number | undefined;
|
|
1188
1188
|
tokensOutput?: number | undefined;
|
|
@@ -1194,6 +1194,7 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1194
1194
|
error: string | null;
|
|
1195
1195
|
status: "ok" | "error";
|
|
1196
1196
|
name: string;
|
|
1197
|
+
model: string | null;
|
|
1197
1198
|
deploymentSlug: string;
|
|
1198
1199
|
sessionExternalId: string;
|
|
1199
1200
|
startedAt: string;
|
|
@@ -1201,7 +1202,6 @@ declare const SpansBatchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1201
1202
|
spanType: "tool_call" | "custom" | "agent_call" | "llm_call" | "framework_step";
|
|
1202
1203
|
contractVersion: 2;
|
|
1203
1204
|
durationMs: number | null;
|
|
1204
|
-
model: string | null;
|
|
1205
1205
|
provider: string | null;
|
|
1206
1206
|
tokensInput: number | null;
|
|
1207
1207
|
tokensOutput: number | null;
|
|
@@ -2353,4 +2353,591 @@ type SightAiTelemetry = {
|
|
|
2353
2353
|
*/
|
|
2354
2354
|
declare function sightTelemetry(options?: SightAiTelemetryOptions): SightAiTelemetry;
|
|
2355
2355
|
|
|
2356
|
-
|
|
2356
|
+
/**
|
|
2357
|
+
* The serving client: a typed client for the Field API, the routes that put
|
|
2358
|
+
* a profile (a SOUL.md) at a name, serve it turn by turn and read its
|
|
2359
|
+
* record. It is separate from the capture API (`Sight`) and shares nothing
|
|
2360
|
+
* with it: its own key, its own requests, no process state.
|
|
2361
|
+
*
|
|
2362
|
+
* import { createFieldClient } from '@cultured_computer/sight';
|
|
2363
|
+
*
|
|
2364
|
+
* const field = createFieldClient({ apiKey: process.env.SIGHT_APP_KEY! });
|
|
2365
|
+
* await field.profiles.put('listener', soulMarkdown);
|
|
2366
|
+
* await field.conversations.start('listener', { conversation: 'c-1', user: 'u-1' });
|
|
2367
|
+
* const { reply } = await field.turns.send('listener', { conversation: 'c-1', message: 'Hi' });
|
|
2368
|
+
*
|
|
2369
|
+
* Every refused request throws a `FieldRefusal` carrying the HTTP status,
|
|
2370
|
+
* the refusal `code` and, when the answer has one, the `reason`. Nothing is
|
|
2371
|
+
* retried: a turn is not idempotent, and a refusal names what to do.
|
|
2372
|
+
*
|
|
2373
|
+
* Server-side only: the key it holds can rewrite the profile.
|
|
2374
|
+
*/
|
|
2375
|
+
/** The API host. Every machine call, capture and serving, goes to it. */
|
|
2376
|
+
declare const DEFAULT_FIELD_ENDPOINT = "https://api.cultured.computer";
|
|
2377
|
+
/**
|
|
2378
|
+
* Every refusal code the routes this client calls can answer: the
|
|
2379
|
+
* conversation and turn routes, the rate limit, the profile put and the
|
|
2380
|
+
* profile read. A refusal with no code (a 401, a 403 for a key that lacks a
|
|
2381
|
+
* permission, a 413) carries `code: null`.
|
|
2382
|
+
*/
|
|
2383
|
+
declare const FIELD_REFUSAL_CODES: readonly ["invalid_body", "forbidden", "not_enabled", "no_such_profile", "no_such_endpoint", "no_such_conversation", "conversation_unknown", "archived", "revoked", "link_inactive", "conversation_conflict", "opening_forbidden", "opening_conflict", "runtime_forbidden", "invalid_reasoning_effort", "invalid_max_output_tokens", "invalid_reply_check", "conversation_ended", "no_live_version", "no_owner", "model_unavailable", "daily_cap", "link_session_cap", "rate_limited", "turn_cap", "stale_turn_index", "record_gap", "busy", "interrupted", "not_connected", "budget", "provider_error", "provider_timeout", "turn_failed", "request_unknown", "request_conflict", "request_pending", "request_interrupted", "replay_expired", "put_in_progress", "scene_live", "precondition_failed", "invalid_consent", "invalid_safeguards", "invalid_scrub", "invalid_fallback", "invalid_scene", "not_a_soul_md", "not_a_scene"];
|
|
2384
|
+
type FieldRefusalCode = (typeof FIELD_REFUSAL_CODES)[number];
|
|
2385
|
+
/**
|
|
2386
|
+
* The reasoning efforts a profile or a conversation can ask for. `none`
|
|
2387
|
+
* asks for no reasoning. An effort is sent only where the model's
|
|
2388
|
+
* catalogue entry lists it; elsewhere it is left out.
|
|
2389
|
+
*/
|
|
2390
|
+
declare const FIELD_REASONING_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
2391
|
+
type FieldReasoningEffort = (typeof FIELD_REASONING_EFFORTS)[number];
|
|
2392
|
+
/**
|
|
2393
|
+
* Why a model finished a turn with no reply text, on a `provider_error`:
|
|
2394
|
+
* `empty_completion`, or `empty_completion_length` when the output limit
|
|
2395
|
+
* ended it before any reply text (a reasoning model that spent
|
|
2396
|
+
* `maxOutputTokens` reasoning).
|
|
2397
|
+
*/
|
|
2398
|
+
type FieldEmptyCompletionReason = 'empty_completion' | 'empty_completion_length';
|
|
2399
|
+
/**
|
|
2400
|
+
* Where a resolved runtime setting came from: the conversation's own
|
|
2401
|
+
* `runtime` (the request), the profile's, or the house default for the
|
|
2402
|
+
* model.
|
|
2403
|
+
*/
|
|
2404
|
+
type FieldRuntimeSource = 'request' | 'profile' | 'default';
|
|
2405
|
+
/** The sources the profile read names: no request is in play there. */
|
|
2406
|
+
type FieldProfileRuntimeSource = Extract<FieldRuntimeSource, 'profile' | 'default'>;
|
|
2407
|
+
/** Why an ended conversation ended, on a `conversation_ended` refusal. */
|
|
2408
|
+
type FieldEndedReason = 'idle' | 'turn_cap' | 'floor' | 'failed' | 'ended';
|
|
2409
|
+
/**
|
|
2410
|
+
* The served runtime record: what the reply call is sent. Every key is
|
|
2411
|
+
* optional; a key left out keeps the profile's value (or, on a profile,
|
|
2412
|
+
* the default).
|
|
2413
|
+
*/
|
|
2414
|
+
type FieldRuntime = {
|
|
2415
|
+
/** An OpenRouter model id the model catalogue routes, `vendor/model`. */
|
|
2416
|
+
model?: string;
|
|
2417
|
+
/** 0 to 2. Default 0.7. Sent unless the model's route takes none. */
|
|
2418
|
+
temperature?: number;
|
|
2419
|
+
/**
|
|
2420
|
+
* The reply's output budget in tokens: an integer from 256 to the
|
|
2421
|
+
* model's catalogue max_completion_tokens (16384 when it states none),
|
|
2422
|
+
* else `invalid_max_output_tokens`. A reasoning model's reasoning tokens
|
|
2423
|
+
* count inside it, with the answer. Default: the
|
|
2424
|
+
* smaller of 16384 and the model's catalogue max_completion_tokens;
|
|
2425
|
+
* 4096 when the catalogue says nothing of the model.
|
|
2426
|
+
*/
|
|
2427
|
+
maxOutputTokens?: number;
|
|
2428
|
+
/**
|
|
2429
|
+
* Default: `low` where the model's catalogue lists it, else the lowest
|
|
2430
|
+
* effort it lists; nothing when it lists none.
|
|
2431
|
+
*/
|
|
2432
|
+
reasoningEffort?: FieldReasoningEffort;
|
|
2433
|
+
};
|
|
2434
|
+
/** A fixed platform text you must show the person, before the reply. */
|
|
2435
|
+
type FieldNotice = {
|
|
2436
|
+
kind: string;
|
|
2437
|
+
text: string;
|
|
2438
|
+
};
|
|
2439
|
+
/** One frame of a turn, as the JSON answer collects it. */
|
|
2440
|
+
type FieldEventRecord = {
|
|
2441
|
+
event: string;
|
|
2442
|
+
data: unknown;
|
|
2443
|
+
};
|
|
2444
|
+
/**
|
|
2445
|
+
* A request the Field API refused: any answer that is not a 2xx. Branch on
|
|
2446
|
+
* `code`, not on the message.
|
|
2447
|
+
*/
|
|
2448
|
+
declare class FieldRefusal extends Error {
|
|
2449
|
+
readonly name = "FieldRefusal";
|
|
2450
|
+
/** The HTTP status. */
|
|
2451
|
+
readonly status: number;
|
|
2452
|
+
/**
|
|
2453
|
+
* The refusal's stable code, one of `FIELD_REFUSAL_CODES` from this
|
|
2454
|
+
* version; a newer API may answer a code this version does not list.
|
|
2455
|
+
* `null` when the answer carries none (401, a 403 for a missing
|
|
2456
|
+
* permission, 413, a 503 while the service drains).
|
|
2457
|
+
*/
|
|
2458
|
+
readonly code: FieldRefusalCode | (string & {}) | null;
|
|
2459
|
+
/**
|
|
2460
|
+
* Why, when the answer says: the ended reason of a `conversation_ended`,
|
|
2461
|
+
* or the empty-completion reason of a `provider_error`. Otherwise null.
|
|
2462
|
+
*/
|
|
2463
|
+
readonly reason: FieldEndedReason | FieldEmptyCompletionReason | (string & {}) | null;
|
|
2464
|
+
/** `Retry-After` in seconds, when the answer carries one (429, 503, a busy put). */
|
|
2465
|
+
readonly retryAfter: number | null;
|
|
2466
|
+
/** A failed turn still answers its notices; show them. Empty otherwise. */
|
|
2467
|
+
readonly notices: FieldNotice[];
|
|
2468
|
+
/** A failed turn's frames, collected before it failed. Empty otherwise. */
|
|
2469
|
+
readonly events: FieldEventRecord[];
|
|
2470
|
+
/** A failed turn's index, when the answer names one. */
|
|
2471
|
+
readonly turnIndex: number | null;
|
|
2472
|
+
/** The answer's body as sent: parsed JSON, or the text when it is not JSON. */
|
|
2473
|
+
readonly body: unknown;
|
|
2474
|
+
constructor(init: {
|
|
2475
|
+
status: number;
|
|
2476
|
+
message: string;
|
|
2477
|
+
code: string | null;
|
|
2478
|
+
reason: string | null;
|
|
2479
|
+
retryAfter: number | null;
|
|
2480
|
+
notices: FieldNotice[];
|
|
2481
|
+
events: FieldEventRecord[];
|
|
2482
|
+
turnIndex: number | null;
|
|
2483
|
+
body: unknown;
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
type FieldVersionRef = {
|
|
2487
|
+
id: string;
|
|
2488
|
+
contentHash: string;
|
|
2489
|
+
configHash: string;
|
|
2490
|
+
label: string;
|
|
2491
|
+
};
|
|
2492
|
+
type FieldLimits = {
|
|
2493
|
+
idleMinutes: number;
|
|
2494
|
+
turnsPerConversation: number;
|
|
2495
|
+
conversationsPerDay: number;
|
|
2496
|
+
};
|
|
2497
|
+
type FieldSafeguards = {
|
|
2498
|
+
crisis: boolean;
|
|
2499
|
+
disclosure: boolean;
|
|
2500
|
+
policy: string;
|
|
2501
|
+
};
|
|
2502
|
+
type FieldConnection = {
|
|
2503
|
+
openrouter: 'connected';
|
|
2504
|
+
via: 'project' | 'operator';
|
|
2505
|
+
} | {
|
|
2506
|
+
openrouter: 'missing';
|
|
2507
|
+
connect: string;
|
|
2508
|
+
};
|
|
2509
|
+
type FieldProfileLinks = {
|
|
2510
|
+
profile: string;
|
|
2511
|
+
conversations: string;
|
|
2512
|
+
turns: string;
|
|
2513
|
+
sessions: string;
|
|
2514
|
+
versions: string;
|
|
2515
|
+
reviews: string;
|
|
2516
|
+
};
|
|
2517
|
+
type FieldProfileEndpoint = {
|
|
2518
|
+
id: string;
|
|
2519
|
+
name: string;
|
|
2520
|
+
versionMode: 'live' | 'pinned';
|
|
2521
|
+
guestsAllowed: boolean;
|
|
2522
|
+
idleMinutes: number;
|
|
2523
|
+
turnsPerConversation: number;
|
|
2524
|
+
conversationsPerDay: number;
|
|
2525
|
+
};
|
|
2526
|
+
/** The answer to `profiles.put`. */
|
|
2527
|
+
type FieldProfilePut = {
|
|
2528
|
+
profile: string;
|
|
2529
|
+
floor: 'steer' | 'exit';
|
|
2530
|
+
outcome: 'created' | 'new version, pointer moved' | 'settings changed' | 'no change';
|
|
2531
|
+
/** What moved: `file`, `model`, `temperature`, `reasoningEffort`, a limit, ... */
|
|
2532
|
+
changed: string[];
|
|
2533
|
+
format: 'soul-md' | 'scene';
|
|
2534
|
+
dryRun?: true;
|
|
2535
|
+
replaced?: {
|
|
2536
|
+
id: string;
|
|
2537
|
+
label: string;
|
|
2538
|
+
};
|
|
2539
|
+
version: FieldVersionRef;
|
|
2540
|
+
endpoint: FieldProfileEndpoint;
|
|
2541
|
+
limits: FieldLimits;
|
|
2542
|
+
core: Array<{
|
|
2543
|
+
heading: string;
|
|
2544
|
+
chars: number;
|
|
2545
|
+
}>;
|
|
2546
|
+
detectors: {
|
|
2547
|
+
active: string[];
|
|
2548
|
+
classifier: string;
|
|
2549
|
+
} | {
|
|
2550
|
+
active: string[];
|
|
2551
|
+
note: string;
|
|
2552
|
+
};
|
|
2553
|
+
/** Parts of the file left out, each with why. Check it after every put. */
|
|
2554
|
+
refused: Array<{
|
|
2555
|
+
heading: string;
|
|
2556
|
+
reason: string;
|
|
2557
|
+
}>;
|
|
2558
|
+
runtime: {
|
|
2559
|
+
model: string;
|
|
2560
|
+
provider: 'openrouter';
|
|
2561
|
+
temperature: number;
|
|
2562
|
+
reasoningEffort?: FieldReasoningEffort;
|
|
2563
|
+
/** The output budget the saved version asks for; absent when it names none. */
|
|
2564
|
+
maxOutputTokens?: number;
|
|
2565
|
+
consent: boolean;
|
|
2566
|
+
fallback: string | null;
|
|
2567
|
+
fallbackNote?: string;
|
|
2568
|
+
};
|
|
2569
|
+
safeguards: FieldSafeguards;
|
|
2570
|
+
scrub: string;
|
|
2571
|
+
connection: FieldConnection;
|
|
2572
|
+
links: FieldProfileLinks;
|
|
2573
|
+
/** The `ETag` header: the live version's id, quoted. Send it as `ifMatch`. */
|
|
2574
|
+
etag: string | null;
|
|
2575
|
+
};
|
|
2576
|
+
/** The answer to `profiles.get`. */
|
|
2577
|
+
type FieldProfile = {
|
|
2578
|
+
profile: string;
|
|
2579
|
+
floor: 'steer' | 'exit';
|
|
2580
|
+
archived: boolean;
|
|
2581
|
+
archivedAt: string | null;
|
|
2582
|
+
version: {
|
|
2583
|
+
id: string;
|
|
2584
|
+
configHash: string;
|
|
2585
|
+
label: string;
|
|
2586
|
+
} | null;
|
|
2587
|
+
endpoint: (FieldProfileEndpoint & {
|
|
2588
|
+
revokedAt: string | null;
|
|
2589
|
+
}) | null;
|
|
2590
|
+
limits: FieldLimits | null;
|
|
2591
|
+
links: FieldProfileLinks;
|
|
2592
|
+
runtime: {
|
|
2593
|
+
model: string;
|
|
2594
|
+
provider: string;
|
|
2595
|
+
temperature: number;
|
|
2596
|
+
/**
|
|
2597
|
+
* The output budget the replies are sent with: the live version's own,
|
|
2598
|
+
* else the house default.
|
|
2599
|
+
*/
|
|
2600
|
+
maxOutputTokens?: number;
|
|
2601
|
+
maxOutputTokensSource?: FieldProfileRuntimeSource;
|
|
2602
|
+
/**
|
|
2603
|
+
* The effort the replies ask for: the live version's own, else the
|
|
2604
|
+
* house default; null when nothing is asked (the catalogue lists no
|
|
2605
|
+
* efforts).
|
|
2606
|
+
*/
|
|
2607
|
+
reasoningEffort?: FieldReasoningEffort | null;
|
|
2608
|
+
reasoningEffortSource?: FieldProfileRuntimeSource;
|
|
2609
|
+
readerModel: string | null;
|
|
2610
|
+
fallback: string | null;
|
|
2611
|
+
} | null;
|
|
2612
|
+
consent: boolean;
|
|
2613
|
+
safeguards: FieldSafeguards;
|
|
2614
|
+
scrub: string;
|
|
2615
|
+
connection: FieldConnection;
|
|
2616
|
+
/** The `ETag` header: the live version's id, quoted. Send it as `ifMatch`. */
|
|
2617
|
+
etag: string | null;
|
|
2618
|
+
};
|
|
2619
|
+
/** One session as the sessions list answers it. */
|
|
2620
|
+
type FieldSessionSummary = {
|
|
2621
|
+
id: string;
|
|
2622
|
+
/** Your own conversation id, as the start sent it. */
|
|
2623
|
+
conversation: string | null;
|
|
2624
|
+
runId: string;
|
|
2625
|
+
user: string | null;
|
|
2626
|
+
startedAt: string | null;
|
|
2627
|
+
endedAt: string | null;
|
|
2628
|
+
ended: boolean;
|
|
2629
|
+
endedReason: string | null;
|
|
2630
|
+
status: string;
|
|
2631
|
+
error?: string;
|
|
2632
|
+
turns: number;
|
|
2633
|
+
rehearsal: boolean;
|
|
2634
|
+
origin: 'observed' | 'constructed';
|
|
2635
|
+
opening: {
|
|
2636
|
+
turns: number;
|
|
2637
|
+
} | null;
|
|
2638
|
+
version: FieldVersionRef;
|
|
2639
|
+
flags: number;
|
|
2640
|
+
shapes: Record<string, number>;
|
|
2641
|
+
path: string;
|
|
2642
|
+
};
|
|
2643
|
+
/** The answer to `profiles.sessions`: one page, newest first. */
|
|
2644
|
+
type FieldSessionsPage = {
|
|
2645
|
+
profile: string;
|
|
2646
|
+
archived: boolean;
|
|
2647
|
+
limit: number;
|
|
2648
|
+
sessions: FieldSessionSummary[];
|
|
2649
|
+
/** Pass as `cursor` for the next page; null on the last page. */
|
|
2650
|
+
nextBefore: string | null;
|
|
2651
|
+
links: {
|
|
2652
|
+
profile: string;
|
|
2653
|
+
sessions: string;
|
|
2654
|
+
versions: string;
|
|
2655
|
+
};
|
|
2656
|
+
};
|
|
2657
|
+
/** One turn of a session's record. */
|
|
2658
|
+
type FieldSessionTurn = {
|
|
2659
|
+
index: number;
|
|
2660
|
+
at?: string;
|
|
2661
|
+
pending?: true;
|
|
2662
|
+
text: 'stored' | 'pending';
|
|
2663
|
+
message: string | null;
|
|
2664
|
+
reply: string | null;
|
|
2665
|
+
outcome: 'floor' | 'error' | 'reply';
|
|
2666
|
+
error?: string;
|
|
2667
|
+
version: FieldVersionRef | null;
|
|
2668
|
+
model: {
|
|
2669
|
+
id: string;
|
|
2670
|
+
provider: string;
|
|
2671
|
+
} | null;
|
|
2672
|
+
fallbackFrom?: string;
|
|
2673
|
+
sent?: {
|
|
2674
|
+
temperature: number | null;
|
|
2675
|
+
seed: number | null;
|
|
2676
|
+
reasoning?: {
|
|
2677
|
+
effort: string;
|
|
2678
|
+
};
|
|
2679
|
+
maxOutputTokens?: number;
|
|
2680
|
+
};
|
|
2681
|
+
detectors: Array<{
|
|
2682
|
+
statement: string;
|
|
2683
|
+
flagged: boolean;
|
|
2684
|
+
verdict: string;
|
|
2685
|
+
score: string | null;
|
|
2686
|
+
bar: number | null;
|
|
2687
|
+
phase: 'before' | 'after';
|
|
2688
|
+
steers: boolean;
|
|
2689
|
+
consequence?: string;
|
|
2690
|
+
entered?: {
|
|
2691
|
+
heading: string;
|
|
2692
|
+
replyTurn: number;
|
|
2693
|
+
};
|
|
2694
|
+
}>;
|
|
2695
|
+
entered: Array<{
|
|
2696
|
+
heading: string;
|
|
2697
|
+
detector: string;
|
|
2698
|
+
flaggedOnTurn: number | null;
|
|
2699
|
+
}>;
|
|
2700
|
+
shapes: Array<{
|
|
2701
|
+
shape: string;
|
|
2702
|
+
evidence: Record<string, unknown>;
|
|
2703
|
+
version: string | null;
|
|
2704
|
+
}>;
|
|
2705
|
+
moves: unknown[];
|
|
2706
|
+
floor?: unknown;
|
|
2707
|
+
notices?: FieldNotice[];
|
|
2708
|
+
storedHistoryTurns?: number;
|
|
2709
|
+
usage: {
|
|
2710
|
+
model: string | null;
|
|
2711
|
+
tokensIn: number | null;
|
|
2712
|
+
tokensOut: number | null;
|
|
2713
|
+
latencyMs: number | null;
|
|
2714
|
+
costUsd: number | null;
|
|
2715
|
+
} | null;
|
|
2716
|
+
};
|
|
2717
|
+
/** The answer to `sessions.get`: the header and its turns in order. */
|
|
2718
|
+
type FieldSessionRecord = {
|
|
2719
|
+
profile: string;
|
|
2720
|
+
session: Omit<FieldSessionSummary, 'path'> & {
|
|
2721
|
+
usage: {
|
|
2722
|
+
model: string | null;
|
|
2723
|
+
tokensIn: number | null;
|
|
2724
|
+
tokensOut: number | null;
|
|
2725
|
+
costUsd: number | null;
|
|
2726
|
+
};
|
|
2727
|
+
};
|
|
2728
|
+
text: 'stored';
|
|
2729
|
+
opening: {
|
|
2730
|
+
constructed: true;
|
|
2731
|
+
text: 'as-sent';
|
|
2732
|
+
turns: Array<{
|
|
2733
|
+
role: 'person' | 'assistant';
|
|
2734
|
+
text: string;
|
|
2735
|
+
}>;
|
|
2736
|
+
} | null;
|
|
2737
|
+
turns: FieldSessionTurn[];
|
|
2738
|
+
readsTruncated?: true;
|
|
2739
|
+
links: {
|
|
2740
|
+
profile: string;
|
|
2741
|
+
sessions: string;
|
|
2742
|
+
versions: string;
|
|
2743
|
+
};
|
|
2744
|
+
};
|
|
2745
|
+
/** The answer to `conversations.start`. */
|
|
2746
|
+
type FieldConversation = {
|
|
2747
|
+
runId: string;
|
|
2748
|
+
sessionId: string;
|
|
2749
|
+
version: number | null;
|
|
2750
|
+
/** The path of the session's record (`GET` it with the same key). */
|
|
2751
|
+
record: string;
|
|
2752
|
+
};
|
|
2753
|
+
/** The answer to `turns.send`. */
|
|
2754
|
+
type FieldTurnAnswer = {
|
|
2755
|
+
reply: string;
|
|
2756
|
+
/** Show these to the person, before the reply. Empty when none. */
|
|
2757
|
+
notices: FieldNotice[];
|
|
2758
|
+
/** Every other frame of the turn, in order. */
|
|
2759
|
+
events: FieldEventRecord[];
|
|
2760
|
+
turnIndex: number;
|
|
2761
|
+
};
|
|
2762
|
+
type FieldRunFrame = {
|
|
2763
|
+
runId: string;
|
|
2764
|
+
sessionId: string;
|
|
2765
|
+
model: string;
|
|
2766
|
+
provider: string;
|
|
2767
|
+
modelKey?: string;
|
|
2768
|
+
/** What the reply call sent; null when the route takes none. */
|
|
2769
|
+
temperature: number | null;
|
|
2770
|
+
seed: number | null;
|
|
2771
|
+
/** Present only when an effort was sent. */
|
|
2772
|
+
reasoning?: {
|
|
2773
|
+
effort: string;
|
|
2774
|
+
};
|
|
2775
|
+
/** The output budget the call sent (reasoning and answer together). */
|
|
2776
|
+
maxOutputTokens?: number;
|
|
2777
|
+
opening?: {
|
|
2778
|
+
turns: number;
|
|
2779
|
+
};
|
|
2780
|
+
/** The conversation's runtime override, as its start sent it. */
|
|
2781
|
+
override?: FieldRuntime;
|
|
2782
|
+
};
|
|
2783
|
+
type FieldReadFrame = {
|
|
2784
|
+
statement: string;
|
|
2785
|
+
score?: number;
|
|
2786
|
+
bar?: number;
|
|
2787
|
+
moment?: string;
|
|
2788
|
+
phase: string;
|
|
2789
|
+
};
|
|
2790
|
+
type FieldDoneFrame = {
|
|
2791
|
+
status: string;
|
|
2792
|
+
turnIndex: number;
|
|
2793
|
+
};
|
|
2794
|
+
type FieldErrorFrame = {
|
|
2795
|
+
message: string;
|
|
2796
|
+
code: FieldRefusalCode | (string & {});
|
|
2797
|
+
/** On a `provider_error` with no reply text: why. */
|
|
2798
|
+
reason?: FieldEmptyCompletionReason | (string & {});
|
|
2799
|
+
turnIndex?: number;
|
|
2800
|
+
};
|
|
2801
|
+
/**
|
|
2802
|
+
* One server-sent frame of a streamed turn, in order: `run`, then any
|
|
2803
|
+
* `notice` and `reads` before the first `delta`, the `delta`s, `events`,
|
|
2804
|
+
* and `done` or `error`. A frame this version does not know arrives as
|
|
2805
|
+
* `other`, with its name.
|
|
2806
|
+
*/
|
|
2807
|
+
type FieldTurnFrame = {
|
|
2808
|
+
event: 'run';
|
|
2809
|
+
data: FieldRunFrame;
|
|
2810
|
+
} | {
|
|
2811
|
+
event: 'notice';
|
|
2812
|
+
data: FieldNotice;
|
|
2813
|
+
} | {
|
|
2814
|
+
event: 'reads';
|
|
2815
|
+
data: FieldReadFrame[];
|
|
2816
|
+
} | {
|
|
2817
|
+
event: 'delta';
|
|
2818
|
+
data: {
|
|
2819
|
+
text: string;
|
|
2820
|
+
};
|
|
2821
|
+
} | {
|
|
2822
|
+
event: 'events';
|
|
2823
|
+
data: unknown[];
|
|
2824
|
+
} | {
|
|
2825
|
+
event: 'done';
|
|
2826
|
+
data: FieldDoneFrame;
|
|
2827
|
+
} | {
|
|
2828
|
+
event: 'error';
|
|
2829
|
+
data: FieldErrorFrame;
|
|
2830
|
+
} | {
|
|
2831
|
+
event: 'other';
|
|
2832
|
+
name: string;
|
|
2833
|
+
data: unknown;
|
|
2834
|
+
};
|
|
2835
|
+
type FieldClientOptions = {
|
|
2836
|
+
/** An App key (`studio:serve` and `profiles:write`). Keep it on a server. */
|
|
2837
|
+
apiKey: string;
|
|
2838
|
+
/** The API host. Default `https://api.cultured.computer`. */
|
|
2839
|
+
endpoint?: string;
|
|
2840
|
+
};
|
|
2841
|
+
/** Options of `profiles.put`. Each overrides the file's frontmatter for this put. */
|
|
2842
|
+
type FieldPutOptions = FieldRuntime & {
|
|
2843
|
+
/** A model id that answers when the model fails before its reply started, or `none`. */
|
|
2844
|
+
fallback?: string;
|
|
2845
|
+
consent?: boolean;
|
|
2846
|
+
/** `crisis`, `disclosure`, both, or `none`. */
|
|
2847
|
+
safeguards?: Array<'crisis' | 'disclosure'> | 'none';
|
|
2848
|
+
scrub?: 'identifiers-only' | 'standard';
|
|
2849
|
+
idleMinutes?: number;
|
|
2850
|
+
turnsPerConversation?: number;
|
|
2851
|
+
conversationsPerDay?: number;
|
|
2852
|
+
/** Answer what the put would do and store nothing. */
|
|
2853
|
+
dryRun?: boolean;
|
|
2854
|
+
/** Replace a live stepped scene with the file. */
|
|
2855
|
+
force?: boolean;
|
|
2856
|
+
/** A conditional put: the `etag` a read or the last put answered. */
|
|
2857
|
+
ifMatch?: string;
|
|
2858
|
+
signal?: AbortSignal;
|
|
2859
|
+
};
|
|
2860
|
+
type FieldStartOptions = {
|
|
2861
|
+
/** Your own id for the conversation, at most 200 characters. One per thread. */
|
|
2862
|
+
conversation: string;
|
|
2863
|
+
/**
|
|
2864
|
+
* Your own opaque, stable id for the person, at most 200 characters: a
|
|
2865
|
+
* hash or your internal id, never an email or a name. A conversation
|
|
2866
|
+
* belongs to the person it was started for.
|
|
2867
|
+
*/
|
|
2868
|
+
user: string;
|
|
2869
|
+
/**
|
|
2870
|
+
* This conversation's runtime, over the profile's. Only a key holding
|
|
2871
|
+
* `profiles:write` may send one (`runtime_forbidden` otherwise). A
|
|
2872
|
+
* repeated start must send the same (`opening_conflict` otherwise).
|
|
2873
|
+
*/
|
|
2874
|
+
runtime?: FieldRuntime;
|
|
2875
|
+
/** A constructed opening: earlier exchanges, the person first and the assistant last. */
|
|
2876
|
+
opening?: Array<{
|
|
2877
|
+
role: 'person' | 'assistant';
|
|
2878
|
+
text: string;
|
|
2879
|
+
}>;
|
|
2880
|
+
/** A signed 32-bit integer; each turn sends the seed plus its index where the route takes one. */
|
|
2881
|
+
seed?: number;
|
|
2882
|
+
signal?: AbortSignal;
|
|
2883
|
+
};
|
|
2884
|
+
type FieldTurnOptions = {
|
|
2885
|
+
conversation: string;
|
|
2886
|
+
message: string;
|
|
2887
|
+
/** The turn index you expect to be next; a stale one is refused with `stale_turn_index`. */
|
|
2888
|
+
resume?: {
|
|
2889
|
+
turnIndex: number;
|
|
2890
|
+
};
|
|
2891
|
+
signal?: AbortSignal;
|
|
2892
|
+
};
|
|
2893
|
+
type FieldSessionsOptions = {
|
|
2894
|
+
/** Your own conversation id, exact match. */
|
|
2895
|
+
conversation?: string;
|
|
2896
|
+
/** The `nextBefore` of the previous page. */
|
|
2897
|
+
cursor?: string;
|
|
2898
|
+
/** Default 50, at most 200. */
|
|
2899
|
+
limit?: number;
|
|
2900
|
+
/** A content hash, a config hash or a version id. */
|
|
2901
|
+
version?: string;
|
|
2902
|
+
ended?: boolean;
|
|
2903
|
+
signal?: AbortSignal;
|
|
2904
|
+
};
|
|
2905
|
+
type FieldClient = {
|
|
2906
|
+
profiles: {
|
|
2907
|
+
/** Put a SOUL.md at a name: creates the profile, or saves a new version or new settings. */
|
|
2908
|
+
put(name: string, soulMarkdown: string, options?: FieldPutOptions): Promise<FieldProfilePut>;
|
|
2909
|
+
/** Read a profile: its live version, runtime, limits, safeguards and connection. */
|
|
2910
|
+
get(name: string, options?: {
|
|
2911
|
+
signal?: AbortSignal;
|
|
2912
|
+
}): Promise<FieldProfile>;
|
|
2913
|
+
/** List a profile's served sessions, newest first, one page at a time. */
|
|
2914
|
+
sessions(name: string, options?: FieldSessionsOptions): Promise<FieldSessionsPage>;
|
|
2915
|
+
};
|
|
2916
|
+
conversations: {
|
|
2917
|
+
/** Start a conversation, or answer the running one under the same id. */
|
|
2918
|
+
start(profile: string, options: FieldStartOptions): Promise<FieldConversation>;
|
|
2919
|
+
};
|
|
2920
|
+
turns: {
|
|
2921
|
+
/** Serve one turn and answer it as one JSON body. Throws `FieldRefusal` when the turn fails. */
|
|
2922
|
+
send(profile: string, options: FieldTurnOptions): Promise<FieldTurnAnswer>;
|
|
2923
|
+
/**
|
|
2924
|
+
* Serve one turn as a stream of frames. A refusal before the stream
|
|
2925
|
+
* starts throws `FieldRefusal` from the loop; a failure once it has
|
|
2926
|
+
* started arrives as an `error` frame and ends the stream.
|
|
2927
|
+
*/
|
|
2928
|
+
stream(profile: string, options: FieldTurnOptions): AsyncGenerator<FieldTurnFrame, void, undefined>;
|
|
2929
|
+
};
|
|
2930
|
+
sessions: {
|
|
2931
|
+
/** Read one session's record, turn by turn. */
|
|
2932
|
+
get(id: string, options?: {
|
|
2933
|
+
signal?: AbortSignal;
|
|
2934
|
+
}): Promise<FieldSessionRecord>;
|
|
2935
|
+
};
|
|
2936
|
+
};
|
|
2937
|
+
/**
|
|
2938
|
+
* Create a serving client. It holds the key and the host, nothing else: no
|
|
2939
|
+
* state between calls, no retries, no timeout of its own (pass `signal`).
|
|
2940
|
+
*/
|
|
2941
|
+
declare function createFieldClient(options: FieldClientOptions): FieldClient;
|
|
2942
|
+
|
|
2943
|
+
export { type AlignmentProvenance, type CaptureTurnInput, type CapturedTurn, DEFAULT_FIELD_ENDPOINT, type EnvironmentEventInput, FIELD_REASONING_EFFORTS, FIELD_REFUSAL_CODES, type FieldClient, type FieldClientOptions, type FieldConnection, type FieldConversation, type FieldDoneFrame, type FieldEmptyCompletionReason, type FieldEndedReason, type FieldErrorFrame, type FieldEventRecord, type FieldLimits, type FieldNotice, type FieldProfile, type FieldProfileEndpoint, type FieldProfileLinks, type FieldProfilePut, type FieldProfileRuntimeSource, type FieldPutOptions, type FieldReadFrame, type FieldReasoningEffort, FieldRefusal, type FieldRefusalCode, type FieldRunFrame, type FieldRuntime, type FieldRuntimeSource, type FieldSafeguards, type FieldSessionRecord, type FieldSessionSummary, type FieldSessionTurn, type FieldSessionsOptions, type FieldSessionsPage, type FieldStartOptions, type FieldTurnAnswer, type FieldTurnFrame, type FieldTurnOptions, type FieldVersionRef, type OutcomeEventEmit, type OutcomeHook, type OutcomeResult, type PersonaConfig, Probe, type ProbeConfig, type ProbeConfigInput, SPAN_INTERVAL_KINDS, SPAN_PAYLOAD_STATES, SPAN_STATUSES, SPAN_TYPES, SPAN_V2_STATUSES, Probe as Sight, type SightAiTelemetry, type SightAiTelemetryOptions, type AlignmentProvenance as SightAlignmentProvenance, type CaptureTurnInput as SightCaptureTurnInput, type CapturedTurn as SightCapturedTurn, type ProbeConfig as SightConfig, type ProbeConfigInput as SightConfigInput, type EnvironmentEventInput as SightEnvironmentEventInput, type OutcomeEventEmit as SightOutcomeEventEmit, type OutcomeHook as SightOutcomeHook, type OutcomeResult as SightOutcomeResult, type PersonaConfig as SightPersonaConfig, type SpanInput as SightSpanInput, type SpanInputV2 as SightSpanInputV2, type SpansBatch as SightSpansBatch, type SpanInput, SpanInputSchema, type SpanInputV1, SpanInputV1Schema, type SpanInputV2, SpanInputV2Schema, type SpanInterval, type SpanIntervalKind, SpanIntervalSchema, type SpanPayload, SpanPayloadSchema, type SpanPayloadState, type SpanStatus, type SpanType, type SpansBatch, SpansBatchSchema, createFieldClient, sightTelemetry, wrapOpenAI };
|