braintrust 3.27.0 → 3.29.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 (54) hide show
  1. package/README.md +1 -1
  2. package/dev/dist/index.d.mts +879 -197
  3. package/dev/dist/index.d.ts +879 -197
  4. package/dev/dist/index.js +2960 -1865
  5. package/dev/dist/index.mjs +2217 -1122
  6. package/dist/apply-auto-instrumentation.js +345 -260
  7. package/dist/apply-auto-instrumentation.mjs +137 -52
  8. package/dist/auto-instrumentations/bundler/esbuild.cjs +124 -7
  9. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  10. package/dist/auto-instrumentations/bundler/next.cjs +124 -7
  11. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  12. package/dist/auto-instrumentations/bundler/rollup.cjs +124 -7
  13. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  14. package/dist/auto-instrumentations/bundler/vite.cjs +124 -7
  15. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  16. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +124 -7
  17. package/dist/auto-instrumentations/bundler/webpack.cjs +124 -7
  18. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  19. package/dist/auto-instrumentations/{chunk-ZNHTSSGI.mjs → chunk-AOIYCVEL.mjs} +34 -3
  20. package/dist/auto-instrumentations/{chunk-XEYKUBLY.mjs → chunk-DKTGDNA7.mjs} +91 -5
  21. package/dist/auto-instrumentations/{chunk-BW33ULMW.mjs → chunk-OMCZ3MV2.mjs} +1 -1
  22. package/dist/auto-instrumentations/hook.mjs +1186 -161
  23. package/dist/auto-instrumentations/index.cjs +34 -3
  24. package/dist/auto-instrumentations/index.mjs +1 -1
  25. package/dist/browser.d.mts +1388 -75
  26. package/dist/browser.d.ts +1388 -75
  27. package/dist/browser.js +3954 -1124
  28. package/dist/browser.mjs +3954 -1124
  29. package/dist/{chunk-MF7NU6BT.js → chunk-6Z5S7VOU.js} +175 -25
  30. package/dist/{chunk-CZM5JIQL.mjs → chunk-7FA6VP2S.mjs} +172 -22
  31. package/dist/{chunk-YKD22IMR.mjs → chunk-M6XPNJC4.mjs} +2102 -1113
  32. package/dist/{chunk-QRHGVBKU.js → chunk-XLLGRXGR.js} +3273 -2284
  33. package/dist/cli.js +6353 -1483
  34. package/dist/edge-light.d.mts +1 -1
  35. package/dist/edge-light.d.ts +1 -1
  36. package/dist/edge-light.js +3954 -1124
  37. package/dist/edge-light.mjs +3954 -1124
  38. package/dist/index.d.mts +1972 -659
  39. package/dist/index.d.ts +1972 -659
  40. package/dist/index.js +2453 -676
  41. package/dist/index.mjs +1973 -196
  42. package/dist/instrumentation/index.d.mts +738 -15
  43. package/dist/instrumentation/index.d.ts +738 -15
  44. package/dist/instrumentation/index.js +2791 -874
  45. package/dist/instrumentation/index.mjs +2791 -874
  46. package/dist/vitest-evals-reporter.js +16 -16
  47. package/dist/vitest-evals-reporter.mjs +2 -2
  48. package/dist/workerd.d.mts +1 -1
  49. package/dist/workerd.d.ts +1 -1
  50. package/dist/workerd.js +3954 -1124
  51. package/dist/workerd.mjs +3954 -1124
  52. package/package.json +2 -3
  53. package/util/dist/index.d.mts +1596 -109
  54. package/util/dist/index.d.ts +1596 -109
@@ -27,16 +27,108 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
27
27
  token: z.ZodString;
28
28
  function_ids: z.ZodArray<z.ZodUnknown, "many">;
29
29
  skip_logging: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
30
+ triggered_functions: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodObject<{
31
+ triggered_xact_id: z.ZodString;
32
+ completed_xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
33
+ idempotency_key: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
34
+ attempts: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
35
+ scope: z.ZodUnion<[z.ZodObject<{
36
+ type: z.ZodLiteral<"span">;
37
+ }, "strip", z.ZodTypeAny, {
38
+ type: "span";
39
+ }, {
40
+ type: "span";
41
+ }>, z.ZodObject<{
42
+ type: z.ZodLiteral<"trace">;
43
+ }, "strip", z.ZodTypeAny, {
44
+ type: "trace";
45
+ }, {
46
+ type: "trace";
47
+ }>, z.ZodObject<{
48
+ type: z.ZodLiteral<"group">;
49
+ key: z.ZodString;
50
+ value: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ value: string;
53
+ type: "group";
54
+ key: string;
55
+ }, {
56
+ value: string;
57
+ type: "group";
58
+ key: string;
59
+ }>]>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ triggered_xact_id: string;
62
+ attempts: number;
63
+ scope: {
64
+ type: "span";
65
+ } | {
66
+ type: "trace";
67
+ } | {
68
+ value: string;
69
+ type: "group";
70
+ key: string;
71
+ };
72
+ completed_xact_id?: string | null | undefined;
73
+ idempotency_key?: string | null | undefined;
74
+ }, {
75
+ triggered_xact_id: string;
76
+ scope: {
77
+ type: "span";
78
+ } | {
79
+ type: "trace";
80
+ } | {
81
+ value: string;
82
+ type: "group";
83
+ key: string;
84
+ };
85
+ completed_xact_id?: string | null | undefined;
86
+ idempotency_key?: string | null | undefined;
87
+ attempts?: number | undefined;
88
+ }>>, z.ZodNull]>>;
89
+ last_triggered_xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>>;
30
90
  }, "strip", z.ZodTypeAny, {
31
91
  status: "enabled";
32
92
  token: string;
33
93
  function_ids: unknown[];
34
94
  skip_logging?: boolean | null | undefined;
95
+ triggered_functions?: Record<string, {
96
+ triggered_xact_id: string;
97
+ attempts: number;
98
+ scope: {
99
+ type: "span";
100
+ } | {
101
+ type: "trace";
102
+ } | {
103
+ value: string;
104
+ type: "group";
105
+ key: string;
106
+ };
107
+ completed_xact_id?: string | null | undefined;
108
+ idempotency_key?: string | null | undefined;
109
+ }> | null | undefined;
110
+ last_triggered_xact_id?: string | number | null | undefined;
35
111
  }, {
36
112
  status: "enabled";
37
113
  token: string;
38
114
  function_ids: unknown[];
39
115
  skip_logging?: boolean | null | undefined;
116
+ triggered_functions?: Record<string, {
117
+ triggered_xact_id: string;
118
+ scope: {
119
+ type: "span";
120
+ } | {
121
+ type: "trace";
122
+ } | {
123
+ value: string;
124
+ type: "group";
125
+ key: string;
126
+ };
127
+ completed_xact_id?: string | null | undefined;
128
+ idempotency_key?: string | null | undefined;
129
+ attempts?: number | undefined;
130
+ }> | null | undefined;
131
+ last_triggered_xact_id?: string | number | null | undefined;
40
132
  }>, z.ZodObject<{
41
133
  status: z.ZodLiteral<"disabled">;
42
134
  }, "strip", z.ZodTypeAny, {
@@ -51,6 +143,22 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
51
143
  token: string;
52
144
  function_ids: unknown[];
53
145
  skip_logging?: boolean | null | undefined;
146
+ triggered_functions?: Record<string, {
147
+ triggered_xact_id: string;
148
+ attempts: number;
149
+ scope: {
150
+ type: "span";
151
+ } | {
152
+ type: "trace";
153
+ } | {
154
+ value: string;
155
+ type: "group";
156
+ key: string;
157
+ };
158
+ completed_xact_id?: string | null | undefined;
159
+ idempotency_key?: string | null | undefined;
160
+ }> | null | undefined;
161
+ last_triggered_xact_id?: string | number | null | undefined;
54
162
  } | {
55
163
  status: "disabled";
56
164
  } | null;
@@ -61,6 +169,22 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
61
169
  token: string;
62
170
  function_ids: unknown[];
63
171
  skip_logging?: boolean | null | undefined;
172
+ triggered_functions?: Record<string, {
173
+ triggered_xact_id: string;
174
+ scope: {
175
+ type: "span";
176
+ } | {
177
+ type: "trace";
178
+ } | {
179
+ value: string;
180
+ type: "group";
181
+ key: string;
182
+ };
183
+ completed_xact_id?: string | null | undefined;
184
+ idempotency_key?: string | null | undefined;
185
+ attempts?: number | undefined;
186
+ }> | null | undefined;
187
+ last_triggered_xact_id?: string | number | null | undefined;
64
188
  } | {
65
189
  status: "disabled";
66
190
  } | null;
@@ -77,26 +201,83 @@ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
77
201
  }, {
78
202
  kind: "state_enabled_force_rescore";
79
203
  }>, z.ZodObject<{
80
- kind: z.ZodLiteral<"add_triggered_functions">;
81
- triggered_function_ids: z.ZodArray<z.ZodUnknown, "many">;
204
+ kind: z.ZodLiteral<"trigger_functions">;
205
+ triggered_functions: z.ZodArray<z.ZodObject<{
206
+ function_id: z.ZodOptional<z.ZodUnknown>;
207
+ scope: z.ZodUnion<[z.ZodObject<{
208
+ type: z.ZodLiteral<"span">;
209
+ }, "strip", z.ZodTypeAny, {
210
+ type: "span";
211
+ }, {
212
+ type: "span";
213
+ }>, z.ZodObject<{
214
+ type: z.ZodLiteral<"trace">;
215
+ }, "strip", z.ZodTypeAny, {
216
+ type: "trace";
217
+ }, {
218
+ type: "trace";
219
+ }>]>;
220
+ idempotency_key: z.ZodOptional<z.ZodString>;
221
+ }, "strip", z.ZodTypeAny, {
222
+ scope: {
223
+ type: "span";
224
+ } | {
225
+ type: "trace";
226
+ };
227
+ idempotency_key?: string | undefined;
228
+ function_id?: unknown;
229
+ }, {
230
+ scope: {
231
+ type: "span";
232
+ } | {
233
+ type: "trace";
234
+ };
235
+ idempotency_key?: string | undefined;
236
+ function_id?: unknown;
237
+ }>, "many">;
82
238
  }, "strip", z.ZodTypeAny, {
83
- kind: "add_triggered_functions";
84
- triggered_function_ids: unknown[];
239
+ kind: "trigger_functions";
240
+ triggered_functions: {
241
+ scope: {
242
+ type: "span";
243
+ } | {
244
+ type: "trace";
245
+ };
246
+ idempotency_key?: string | undefined;
247
+ function_id?: unknown;
248
+ }[];
85
249
  }, {
86
- kind: "add_triggered_functions";
87
- triggered_function_ids: unknown[];
250
+ kind: "trigger_functions";
251
+ triggered_functions: {
252
+ scope: {
253
+ type: "span";
254
+ } | {
255
+ type: "trace";
256
+ };
257
+ idempotency_key?: string | undefined;
258
+ function_id?: unknown;
259
+ }[];
88
260
  }>, z.ZodObject<{
89
261
  kind: z.ZodLiteral<"complete_triggered_functions">;
90
262
  function_ids: z.ZodArray<z.ZodUnknown, "many">;
91
263
  triggered_xact_id: z.ZodString;
92
264
  }, "strip", z.ZodTypeAny, {
93
- function_ids: unknown[];
94
265
  kind: "complete_triggered_functions";
95
266
  triggered_xact_id: string;
96
- }, {
97
267
  function_ids: unknown[];
268
+ }, {
98
269
  kind: "complete_triggered_functions";
99
270
  triggered_xact_id: string;
271
+ function_ids: unknown[];
272
+ }>, z.ZodObject<{
273
+ kind: z.ZodLiteral<"mark_attempt_failed">;
274
+ function_ids: z.ZodArray<z.ZodUnknown, "many">;
275
+ }, "strip", z.ZodTypeAny, {
276
+ kind: "mark_attempt_failed";
277
+ function_ids: unknown[];
278
+ }, {
279
+ kind: "mark_attempt_failed";
280
+ function_ids: unknown[];
100
281
  }>]>;
101
282
  type AsyncScoringControlType = z.infer<typeof AsyncScoringControl>;
102
283
  declare const ObjectReference$1: z.ZodObject<{
@@ -552,13 +733,13 @@ declare const AnyModelParams: z.ZodObject<{
552
733
  verbosity?: "low" | "medium" | "high" | undefined;
553
734
  top_k?: number | undefined;
554
735
  stop_sequences?: string[] | undefined;
736
+ reasoning_enabled?: boolean | undefined;
737
+ reasoning_budget?: number | undefined;
555
738
  max_tokens_to_sample?: number | undefined;
556
739
  maxOutputTokens?: number | undefined;
557
740
  topP?: number | undefined;
558
741
  topK?: number | undefined;
559
742
  use_cache?: boolean | undefined;
560
- reasoning_enabled?: boolean | undefined;
561
- reasoning_budget?: number | undefined;
562
743
  }, {
563
744
  max_tokens: number;
564
745
  temperature?: number | undefined;
@@ -594,17 +775,43 @@ declare const AnyModelParams: z.ZodObject<{
594
775
  verbosity?: "low" | "medium" | "high" | undefined;
595
776
  top_k?: number | undefined;
596
777
  stop_sequences?: string[] | undefined;
778
+ reasoning_enabled?: boolean | undefined;
779
+ reasoning_budget?: number | undefined;
597
780
  max_tokens_to_sample?: number | undefined;
598
781
  maxOutputTokens?: number | undefined;
599
782
  topP?: number | undefined;
600
783
  topK?: number | undefined;
601
784
  use_cache?: boolean | undefined;
602
- reasoning_enabled?: boolean | undefined;
603
- reasoning_budget?: number | undefined;
604
785
  }>;
605
786
  type AnyModelParamsType = z.infer<typeof AnyModelParams>;
606
787
  declare const FunctionTypeEnum: z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>;
607
788
  type FunctionTypeEnumType = z.infer<typeof FunctionTypeEnum>;
789
+ declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
790
+ type: z.ZodLiteral<"function">;
791
+ id: z.ZodString;
792
+ version: z.ZodOptional<z.ZodString>;
793
+ }, "strip", z.ZodTypeAny, {
794
+ id: string;
795
+ type: "function";
796
+ version?: string | undefined;
797
+ }, {
798
+ id: string;
799
+ type: "function";
800
+ version?: string | undefined;
801
+ }>, z.ZodObject<{
802
+ type: z.ZodLiteral<"global">;
803
+ name: z.ZodString;
804
+ function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
805
+ }, "strip", z.ZodTypeAny, {
806
+ type: "global";
807
+ name: string;
808
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
809
+ }, {
810
+ type: "global";
811
+ name: string;
812
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
813
+ }>]>;
814
+ type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
608
815
  declare const ChatCompletionMessageParam: z.ZodUnion<[z.ZodObject<{
609
816
  content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
610
817
  text: z.ZodDefault<z.ZodString>;
@@ -1631,32 +1838,6 @@ declare const ChatCompletionTool: z.ZodObject<{
1631
1838
  type: "function";
1632
1839
  }>;
1633
1840
  type ChatCompletionToolType = z.infer<typeof ChatCompletionTool>;
1634
- declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
1635
- type: z.ZodLiteral<"function">;
1636
- id: z.ZodString;
1637
- version: z.ZodOptional<z.ZodString>;
1638
- }, "strip", z.ZodTypeAny, {
1639
- id: string;
1640
- type: "function";
1641
- version?: string | undefined;
1642
- }, {
1643
- id: string;
1644
- type: "function";
1645
- version?: string | undefined;
1646
- }>, z.ZodObject<{
1647
- type: z.ZodLiteral<"global">;
1648
- name: z.ZodString;
1649
- function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
1650
- }, "strip", z.ZodTypeAny, {
1651
- type: "global";
1652
- name: string;
1653
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
1654
- }, {
1655
- type: "global";
1656
- name: string;
1657
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
1658
- }>]>;
1659
- type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
1660
1841
  declare const DatasetSnapshot: z.ZodObject<{
1661
1842
  id: z.ZodString;
1662
1843
  dataset_id: z.ZodString;
@@ -1692,9 +1873,9 @@ declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
1692
1873
  git_diff: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1693
1874
  }, "strip", z.ZodTypeAny, {
1694
1875
  dirty?: boolean | null | undefined;
1876
+ tag?: string | null | undefined;
1695
1877
  commit?: string | null | undefined;
1696
1878
  branch?: string | null | undefined;
1697
- tag?: string | null | undefined;
1698
1879
  author_name?: string | null | undefined;
1699
1880
  author_email?: string | null | undefined;
1700
1881
  commit_message?: string | null | undefined;
@@ -1702,9 +1883,9 @@ declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
1702
1883
  git_diff?: string | null | undefined;
1703
1884
  }, {
1704
1885
  dirty?: boolean | null | undefined;
1886
+ tag?: string | null | undefined;
1705
1887
  commit?: string | null | undefined;
1706
1888
  branch?: string | null | undefined;
1707
- tag?: string | null | undefined;
1708
1889
  author_name?: string | null | undefined;
1709
1890
  author_email?: string | null | undefined;
1710
1891
  commit_message?: string | null | undefined;
@@ -2454,11 +2635,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2454
2635
  runtime: z.ZodEnum<["node", "python", "browser", "quickjs"]>;
2455
2636
  version: z.ZodString;
2456
2637
  }, "strip", z.ZodTypeAny, {
2457
- runtime: "node" | "python" | "browser" | "quickjs";
2458
2638
  version: string;
2459
- }, {
2460
2639
  runtime: "node" | "python" | "browser" | "quickjs";
2640
+ }, {
2461
2641
  version: string;
2642
+ runtime: "node" | "python" | "browser" | "quickjs";
2462
2643
  }>;
2463
2644
  location: z.ZodUnion<[z.ZodObject<{
2464
2645
  type: z.ZodLiteral<"experiment">;
@@ -2572,8 +2753,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2572
2753
  preview: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
2573
2754
  }, "strip", z.ZodTypeAny, {
2574
2755
  runtime_context: {
2575
- runtime: "node" | "python" | "browser" | "quickjs";
2576
2756
  version: string;
2757
+ runtime: "node" | "python" | "browser" | "quickjs";
2577
2758
  };
2578
2759
  location: {
2579
2760
  type: "experiment";
@@ -2607,8 +2788,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2607
2788
  preview?: string | null | undefined;
2608
2789
  }, {
2609
2790
  runtime_context: {
2610
- runtime: "node" | "python" | "browser" | "quickjs";
2611
2791
  version: string;
2792
+ runtime: "node" | "python" | "browser" | "quickjs";
2612
2793
  };
2613
2794
  location: {
2614
2795
  type: "experiment";
@@ -2646,11 +2827,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2646
2827
  runtime: z.ZodEnum<["node", "python", "browser", "quickjs"]>;
2647
2828
  version: z.ZodString;
2648
2829
  }, "strip", z.ZodTypeAny, {
2649
- runtime: "node" | "python" | "browser" | "quickjs";
2650
2830
  version: string;
2651
- }, {
2652
2831
  runtime: "node" | "python" | "browser" | "quickjs";
2832
+ }, {
2653
2833
  version: string;
2834
+ runtime: "node" | "python" | "browser" | "quickjs";
2654
2835
  }>;
2655
2836
  code: z.ZodString;
2656
2837
  code_hash: z.ZodOptional<z.ZodString>;
@@ -2658,16 +2839,16 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2658
2839
  code: string;
2659
2840
  type: "inline";
2660
2841
  runtime_context: {
2661
- runtime: "node" | "python" | "browser" | "quickjs";
2662
2842
  version: string;
2843
+ runtime: "node" | "python" | "browser" | "quickjs";
2663
2844
  };
2664
2845
  code_hash?: string | undefined;
2665
2846
  }, {
2666
2847
  code: string;
2667
2848
  type: "inline";
2668
2849
  runtime_context: {
2669
- runtime: "node" | "python" | "browser" | "quickjs";
2670
2850
  version: string;
2851
+ runtime: "node" | "python" | "browser" | "quickjs";
2671
2852
  };
2672
2853
  code_hash?: string | undefined;
2673
2854
  }>]>;
@@ -2677,8 +2858,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2677
2858
  type: "bundle";
2678
2859
  } & {
2679
2860
  runtime_context: {
2680
- runtime: "node" | "python" | "browser" | "quickjs";
2681
2861
  version: string;
2862
+ runtime: "node" | "python" | "browser" | "quickjs";
2682
2863
  };
2683
2864
  location: {
2684
2865
  type: "experiment";
@@ -2714,8 +2895,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2714
2895
  code: string;
2715
2896
  type: "inline";
2716
2897
  runtime_context: {
2717
- runtime: "node" | "python" | "browser" | "quickjs";
2718
2898
  version: string;
2899
+ runtime: "node" | "python" | "browser" | "quickjs";
2719
2900
  };
2720
2901
  code_hash?: string | undefined;
2721
2902
  };
@@ -2725,8 +2906,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2725
2906
  type: "bundle";
2726
2907
  } & {
2727
2908
  runtime_context: {
2728
- runtime: "node" | "python" | "browser" | "quickjs";
2729
2909
  version: string;
2910
+ runtime: "node" | "python" | "browser" | "quickjs";
2730
2911
  };
2731
2912
  location: {
2732
2913
  type: "experiment";
@@ -2762,8 +2943,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
2762
2943
  code: string;
2763
2944
  type: "inline";
2764
2945
  runtime_context: {
2765
- runtime: "node" | "python" | "browser" | "quickjs";
2766
2946
  version: string;
2947
+ runtime: "node" | "python" | "browser" | "quickjs";
2767
2948
  };
2768
2949
  code_hash?: string | undefined;
2769
2950
  };
@@ -3967,21 +4148,21 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
3967
4148
  node: string;
3968
4149
  variable: string;
3969
4150
  };
4151
+ purpose: "data" | "messages" | "control";
3970
4152
  target: {
3971
4153
  node: string;
3972
4154
  variable: string;
3973
4155
  };
3974
- purpose: "data" | "messages" | "control";
3975
4156
  }, {
3976
4157
  source: {
3977
4158
  node: string;
3978
4159
  variable: string;
3979
4160
  };
4161
+ purpose: "data" | "messages" | "control";
3980
4162
  target: {
3981
4163
  node: string;
3982
4164
  variable: string;
3983
4165
  };
3984
- purpose: "data" | "messages" | "control";
3985
4166
  }>>;
3986
4167
  }, "strip", z.ZodTypeAny, {
3987
4168
  type: "graph";
@@ -4161,11 +4342,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4161
4342
  node: string;
4162
4343
  variable: string;
4163
4344
  };
4345
+ purpose: "data" | "messages" | "control";
4164
4346
  target: {
4165
4347
  node: string;
4166
4348
  variable: string;
4167
4349
  };
4168
- purpose: "data" | "messages" | "control";
4169
4350
  }>;
4170
4351
  }, {
4171
4352
  type: "graph";
@@ -4345,11 +4526,11 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4345
4526
  node: string;
4346
4527
  variable: string;
4347
4528
  };
4529
+ purpose: "data" | "messages" | "control";
4348
4530
  target: {
4349
4531
  node: string;
4350
4532
  variable: string;
4351
4533
  };
4352
- purpose: "data" | "messages" | "control";
4353
4534
  }>;
4354
4535
  }>, z.ZodObject<{
4355
4536
  type: z.ZodLiteral<"remote_eval">;
@@ -4381,16 +4562,16 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4381
4562
  }, "strip", z.ZodTypeAny, {
4382
4563
  type: "global";
4383
4564
  name: string;
4384
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
4565
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4385
4566
  config?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
4386
4567
  }, {
4387
4568
  type: "global";
4388
4569
  name: string;
4389
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
4570
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4390
4571
  config?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
4391
4572
  }>, z.ZodObject<{
4392
4573
  type: z.ZodLiteral<"facet">;
4393
- preprocessor: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
4574
+ preprocessor: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
4394
4575
  type: z.ZodLiteral<"function">;
4395
4576
  id: z.ZodString;
4396
4577
  version: z.ZodOptional<z.ZodString>;
@@ -4409,12 +4590,21 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4409
4590
  }, "strip", z.ZodTypeAny, {
4410
4591
  type: "global";
4411
4592
  name: string;
4412
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
4593
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4413
4594
  }, {
4414
4595
  type: "global";
4415
4596
  name: string;
4416
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
4417
- }>, z.ZodNull]>, z.ZodUnknown>>;
4597
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4598
+ }>, z.ZodObject<{
4599
+ type: z.ZodLiteral<"inline">;
4600
+ code: z.ZodString;
4601
+ }, "strip", z.ZodTypeAny, {
4602
+ code: string;
4603
+ type: "inline";
4604
+ }, {
4605
+ code: string;
4606
+ type: "inline";
4607
+ }>, z.ZodNull]>>;
4418
4608
  prompt: z.ZodString;
4419
4609
  model: z.ZodOptional<z.ZodString>;
4420
4610
  embedding_model: z.ZodOptional<z.ZodString>;
@@ -4422,7 +4612,6 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4422
4612
  }, "strip", z.ZodTypeAny, {
4423
4613
  type: "facet";
4424
4614
  prompt: string;
4425
- model?: string | undefined;
4426
4615
  preprocessor?: {
4427
4616
  id: string;
4428
4617
  type: "function";
@@ -4430,14 +4619,17 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4430
4619
  } | {
4431
4620
  type: "global";
4432
4621
  name: string;
4433
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
4622
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4623
+ } | {
4624
+ code: string;
4625
+ type: "inline";
4434
4626
  } | null | undefined;
4435
4627
  embedding_model?: string | undefined;
4628
+ model?: string | undefined;
4436
4629
  no_match_pattern?: string | undefined;
4437
4630
  }, {
4438
4631
  type: "facet";
4439
4632
  prompt: string;
4440
- model?: string | undefined;
4441
4633
  preprocessor?: {
4442
4634
  id: string;
4443
4635
  type: "function";
@@ -4445,13 +4637,17 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4445
4637
  } | {
4446
4638
  type: "global";
4447
4639
  name: string;
4448
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
4640
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4641
+ } | {
4642
+ code: string;
4643
+ type: "inline";
4449
4644
  } | null | undefined;
4450
4645
  embedding_model?: string | undefined;
4646
+ model?: string | undefined;
4451
4647
  no_match_pattern?: string | undefined;
4452
4648
  }>, z.ZodObject<{
4453
4649
  type: z.ZodLiteral<"batched_facet">;
4454
- preprocessor: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
4650
+ preprocessor: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
4455
4651
  type: z.ZodLiteral<"function">;
4456
4652
  id: z.ZodString;
4457
4653
  version: z.ZodOptional<z.ZodString>;
@@ -4470,12 +4666,21 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4470
4666
  }, "strip", z.ZodTypeAny, {
4471
4667
  type: "global";
4472
4668
  name: string;
4473
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
4669
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4474
4670
  }, {
4475
4671
  type: "global";
4476
4672
  name: string;
4477
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
4478
- }>, z.ZodNull]>, z.ZodUnknown>>;
4673
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4674
+ }>, z.ZodObject<{
4675
+ type: z.ZodLiteral<"inline">;
4676
+ code: z.ZodString;
4677
+ }, "strip", z.ZodTypeAny, {
4678
+ code: string;
4679
+ type: "inline";
4680
+ }, {
4681
+ code: string;
4682
+ type: "inline";
4683
+ }>, z.ZodNull]>>;
4479
4684
  facets: z.ZodArray<z.ZodObject<{
4480
4685
  name: z.ZodString;
4481
4686
  prompt: z.ZodString;
@@ -4485,14 +4690,14 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4485
4690
  }, "strip", z.ZodTypeAny, {
4486
4691
  prompt: string;
4487
4692
  name: string;
4488
- model?: string | undefined;
4489
4693
  embedding_model?: string | undefined;
4694
+ model?: string | undefined;
4490
4695
  no_match_pattern?: string | undefined;
4491
4696
  }, {
4492
4697
  prompt: string;
4493
4698
  name: string;
4494
- model?: string | undefined;
4495
4699
  embedding_model?: string | undefined;
4700
+ model?: string | undefined;
4496
4701
  no_match_pattern?: string | undefined;
4497
4702
  }>, "many">;
4498
4703
  topic_maps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
@@ -4501,12 +4706,37 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4501
4706
  topic_map_data: z.ZodObject<{
4502
4707
  type: z.ZodLiteral<"topic_map">;
4503
4708
  source_facet: z.ZodString;
4709
+ source_facet_function: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
4710
+ type: z.ZodLiteral<"function">;
4711
+ id: z.ZodString;
4712
+ version: z.ZodOptional<z.ZodString>;
4713
+ }, "strip", z.ZodTypeAny, {
4714
+ id: string;
4715
+ type: "function";
4716
+ version?: string | undefined;
4717
+ }, {
4718
+ id: string;
4719
+ type: "function";
4720
+ version?: string | undefined;
4721
+ }>, z.ZodObject<{
4722
+ type: z.ZodLiteral<"global">;
4723
+ name: z.ZodString;
4724
+ function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
4725
+ }, "strip", z.ZodTypeAny, {
4726
+ type: "global";
4727
+ name: string;
4728
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4729
+ }, {
4730
+ type: "global";
4731
+ name: string;
4732
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4733
+ }>]>, z.ZodUnknown>>;
4504
4734
  embedding_model: z.ZodString;
4505
4735
  bundle_key: z.ZodOptional<z.ZodString>;
4506
4736
  report_key: z.ZodOptional<z.ZodString>;
4507
4737
  topic_names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4508
4738
  generation_settings: z.ZodOptional<z.ZodObject<{
4509
- algorithm: z.ZodEnum<["hdbscan", "kmeans"]>;
4739
+ algorithm: z.ZodEnum<["hdbscan", "kmeans", "community"]>;
4510
4740
  dimension_reduction: z.ZodEnum<["umap", "pca", "none"]>;
4511
4741
  sample_size: z.ZodOptional<z.ZodNumber>;
4512
4742
  n_clusters: z.ZodOptional<z.ZodNumber>;
@@ -4515,7 +4745,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4515
4745
  hierarchy_threshold: z.ZodOptional<z.ZodNumber>;
4516
4746
  naming_model: z.ZodOptional<z.ZodString>;
4517
4747
  }, "strip", z.ZodTypeAny, {
4518
- algorithm: "hdbscan" | "kmeans";
4748
+ algorithm: "hdbscan" | "kmeans" | "community";
4519
4749
  dimension_reduction: "none" | "umap" | "pca";
4520
4750
  sample_size?: number | undefined;
4521
4751
  n_clusters?: number | undefined;
@@ -4524,7 +4754,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4524
4754
  hierarchy_threshold?: number | undefined;
4525
4755
  naming_model?: string | undefined;
4526
4756
  }, {
4527
- algorithm: "hdbscan" | "kmeans";
4757
+ algorithm: "hdbscan" | "kmeans" | "community";
4528
4758
  dimension_reduction: "none" | "umap" | "pca";
4529
4759
  sample_size?: number | undefined;
4530
4760
  n_clusters?: number | undefined;
@@ -4542,12 +4772,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4542
4772
  type: "topic_map";
4543
4773
  source_facet: string;
4544
4774
  embedding_model: string;
4545
- btql_filter?: string | undefined;
4775
+ source_facet_function?: {
4776
+ id: string;
4777
+ type: "function";
4778
+ version?: string | undefined;
4779
+ } | {
4780
+ type: "global";
4781
+ name: string;
4782
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4783
+ } | undefined;
4546
4784
  bundle_key?: string | undefined;
4547
4785
  report_key?: string | undefined;
4548
4786
  topic_names?: Record<string, string> | undefined;
4549
4787
  generation_settings?: {
4550
- algorithm: "hdbscan" | "kmeans";
4788
+ algorithm: "hdbscan" | "kmeans" | "community";
4551
4789
  dimension_reduction: "none" | "umap" | "pca";
4552
4790
  sample_size?: number | undefined;
4553
4791
  n_clusters?: number | undefined;
@@ -4559,17 +4797,26 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4559
4797
  disable_reconciliation?: boolean | undefined;
4560
4798
  reconcile_mode?: "evolve" | "names_only" | undefined;
4561
4799
  distance_threshold?: number | undefined;
4800
+ btql_filter?: string | undefined;
4562
4801
  automation_btql_filter?: string | undefined;
4563
4802
  }, {
4564
4803
  type: "topic_map";
4565
4804
  source_facet: string;
4566
4805
  embedding_model: string;
4567
- btql_filter?: string | undefined;
4806
+ source_facet_function?: {
4807
+ id: string;
4808
+ type: "function";
4809
+ version?: string | undefined;
4810
+ } | {
4811
+ type: "global";
4812
+ name: string;
4813
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4814
+ } | undefined;
4568
4815
  bundle_key?: string | undefined;
4569
4816
  report_key?: string | undefined;
4570
4817
  topic_names?: Record<string, string> | undefined;
4571
4818
  generation_settings?: {
4572
- algorithm: "hdbscan" | "kmeans";
4819
+ algorithm: "hdbscan" | "kmeans" | "community";
4573
4820
  dimension_reduction: "none" | "umap" | "pca";
4574
4821
  sample_size?: number | undefined;
4575
4822
  n_clusters?: number | undefined;
@@ -4581,6 +4828,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4581
4828
  disable_reconciliation?: boolean | undefined;
4582
4829
  reconcile_mode?: "evolve" | "names_only" | undefined;
4583
4830
  distance_threshold?: number | undefined;
4831
+ btql_filter?: string | undefined;
4584
4832
  automation_btql_filter?: string | undefined;
4585
4833
  }>;
4586
4834
  }, "strip", z.ZodTypeAny, {
@@ -4589,12 +4837,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4589
4837
  type: "topic_map";
4590
4838
  source_facet: string;
4591
4839
  embedding_model: string;
4592
- btql_filter?: string | undefined;
4840
+ source_facet_function?: {
4841
+ id: string;
4842
+ type: "function";
4843
+ version?: string | undefined;
4844
+ } | {
4845
+ type: "global";
4846
+ name: string;
4847
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4848
+ } | undefined;
4593
4849
  bundle_key?: string | undefined;
4594
4850
  report_key?: string | undefined;
4595
4851
  topic_names?: Record<string, string> | undefined;
4596
4852
  generation_settings?: {
4597
- algorithm: "hdbscan" | "kmeans";
4853
+ algorithm: "hdbscan" | "kmeans" | "community";
4598
4854
  dimension_reduction: "none" | "umap" | "pca";
4599
4855
  sample_size?: number | undefined;
4600
4856
  n_clusters?: number | undefined;
@@ -4606,6 +4862,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4606
4862
  disable_reconciliation?: boolean | undefined;
4607
4863
  reconcile_mode?: "evolve" | "names_only" | undefined;
4608
4864
  distance_threshold?: number | undefined;
4865
+ btql_filter?: string | undefined;
4609
4866
  automation_btql_filter?: string | undefined;
4610
4867
  };
4611
4868
  topic_map_id?: string | undefined;
@@ -4615,12 +4872,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4615
4872
  type: "topic_map";
4616
4873
  source_facet: string;
4617
4874
  embedding_model: string;
4618
- btql_filter?: string | undefined;
4875
+ source_facet_function?: {
4876
+ id: string;
4877
+ type: "function";
4878
+ version?: string | undefined;
4879
+ } | {
4880
+ type: "global";
4881
+ name: string;
4882
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4883
+ } | undefined;
4619
4884
  bundle_key?: string | undefined;
4620
4885
  report_key?: string | undefined;
4621
4886
  topic_names?: Record<string, string> | undefined;
4622
4887
  generation_settings?: {
4623
- algorithm: "hdbscan" | "kmeans";
4888
+ algorithm: "hdbscan" | "kmeans" | "community";
4624
4889
  dimension_reduction: "none" | "umap" | "pca";
4625
4890
  sample_size?: number | undefined;
4626
4891
  n_clusters?: number | undefined;
@@ -4632,6 +4897,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4632
4897
  disable_reconciliation?: boolean | undefined;
4633
4898
  reconcile_mode?: "evolve" | "names_only" | undefined;
4634
4899
  distance_threshold?: number | undefined;
4900
+ btql_filter?: string | undefined;
4635
4901
  automation_btql_filter?: string | undefined;
4636
4902
  };
4637
4903
  topic_map_id?: string | undefined;
@@ -4641,8 +4907,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4641
4907
  facets: {
4642
4908
  prompt: string;
4643
4909
  name: string;
4644
- model?: string | undefined;
4645
4910
  embedding_model?: string | undefined;
4911
+ model?: string | undefined;
4646
4912
  no_match_pattern?: string | undefined;
4647
4913
  }[];
4648
4914
  preprocessor?: {
@@ -4652,7 +4918,10 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4652
4918
  } | {
4653
4919
  type: "global";
4654
4920
  name: string;
4655
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
4921
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4922
+ } | {
4923
+ code: string;
4924
+ type: "inline";
4656
4925
  } | null | undefined;
4657
4926
  topic_maps?: Record<string, {
4658
4927
  function_name: string;
@@ -4660,12 +4929,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4660
4929
  type: "topic_map";
4661
4930
  source_facet: string;
4662
4931
  embedding_model: string;
4663
- btql_filter?: string | undefined;
4932
+ source_facet_function?: {
4933
+ id: string;
4934
+ type: "function";
4935
+ version?: string | undefined;
4936
+ } | {
4937
+ type: "global";
4938
+ name: string;
4939
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
4940
+ } | undefined;
4664
4941
  bundle_key?: string | undefined;
4665
4942
  report_key?: string | undefined;
4666
4943
  topic_names?: Record<string, string> | undefined;
4667
4944
  generation_settings?: {
4668
- algorithm: "hdbscan" | "kmeans";
4945
+ algorithm: "hdbscan" | "kmeans" | "community";
4669
4946
  dimension_reduction: "none" | "umap" | "pca";
4670
4947
  sample_size?: number | undefined;
4671
4948
  n_clusters?: number | undefined;
@@ -4677,6 +4954,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4677
4954
  disable_reconciliation?: boolean | undefined;
4678
4955
  reconcile_mode?: "evolve" | "names_only" | undefined;
4679
4956
  distance_threshold?: number | undefined;
4957
+ btql_filter?: string | undefined;
4680
4958
  automation_btql_filter?: string | undefined;
4681
4959
  };
4682
4960
  topic_map_id?: string | undefined;
@@ -4686,8 +4964,8 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4686
4964
  facets: {
4687
4965
  prompt: string;
4688
4966
  name: string;
4689
- model?: string | undefined;
4690
4967
  embedding_model?: string | undefined;
4968
+ model?: string | undefined;
4691
4969
  no_match_pattern?: string | undefined;
4692
4970
  }[];
4693
4971
  preprocessor?: {
@@ -4697,7 +4975,10 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4697
4975
  } | {
4698
4976
  type: "global";
4699
4977
  name: string;
4700
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
4978
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4979
+ } | {
4980
+ code: string;
4981
+ type: "inline";
4701
4982
  } | null | undefined;
4702
4983
  topic_maps?: Record<string, {
4703
4984
  function_name: string;
@@ -4705,12 +4986,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4705
4986
  type: "topic_map";
4706
4987
  source_facet: string;
4707
4988
  embedding_model: string;
4708
- btql_filter?: string | undefined;
4709
- bundle_key?: string | undefined;
4710
- report_key?: string | undefined;
4711
- topic_names?: Record<string, string> | undefined;
4712
- generation_settings?: {
4713
- algorithm: "hdbscan" | "kmeans";
4989
+ source_facet_function?: {
4990
+ id: string;
4991
+ type: "function";
4992
+ version?: string | undefined;
4993
+ } | {
4994
+ type: "global";
4995
+ name: string;
4996
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
4997
+ } | undefined;
4998
+ bundle_key?: string | undefined;
4999
+ report_key?: string | undefined;
5000
+ topic_names?: Record<string, string> | undefined;
5001
+ generation_settings?: {
5002
+ algorithm: "hdbscan" | "kmeans" | "community";
4714
5003
  dimension_reduction: "none" | "umap" | "pca";
4715
5004
  sample_size?: number | undefined;
4716
5005
  n_clusters?: number | undefined;
@@ -4722,6 +5011,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4722
5011
  disable_reconciliation?: boolean | undefined;
4723
5012
  reconcile_mode?: "evolve" | "names_only" | undefined;
4724
5013
  distance_threshold?: number | undefined;
5014
+ btql_filter?: string | undefined;
4725
5015
  automation_btql_filter?: string | undefined;
4726
5016
  };
4727
5017
  topic_map_id?: string | undefined;
@@ -4770,12 +5060,37 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4770
5060
  }>, z.ZodIntersection<z.ZodObject<{
4771
5061
  type: z.ZodLiteral<"topic_map">;
4772
5062
  source_facet: z.ZodString;
5063
+ source_facet_function: z.ZodOptional<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
5064
+ type: z.ZodLiteral<"function">;
5065
+ id: z.ZodString;
5066
+ version: z.ZodOptional<z.ZodString>;
5067
+ }, "strip", z.ZodTypeAny, {
5068
+ id: string;
5069
+ type: "function";
5070
+ version?: string | undefined;
5071
+ }, {
5072
+ id: string;
5073
+ type: "function";
5074
+ version?: string | undefined;
5075
+ }>, z.ZodObject<{
5076
+ type: z.ZodLiteral<"global">;
5077
+ name: z.ZodString;
5078
+ function_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["llm", "scorer", "task", "tool", "custom_view", "preprocessor", "facet", "classifier", "tag", "parameters", "sandbox"]>>>;
5079
+ }, "strip", z.ZodTypeAny, {
5080
+ type: "global";
5081
+ name: string;
5082
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
5083
+ }, {
5084
+ type: "global";
5085
+ name: string;
5086
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
5087
+ }>]>, z.ZodUnknown>>;
4773
5088
  embedding_model: z.ZodString;
4774
5089
  bundle_key: z.ZodOptional<z.ZodString>;
4775
5090
  report_key: z.ZodOptional<z.ZodString>;
4776
5091
  topic_names: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4777
5092
  generation_settings: z.ZodOptional<z.ZodObject<{
4778
- algorithm: z.ZodEnum<["hdbscan", "kmeans"]>;
5093
+ algorithm: z.ZodEnum<["hdbscan", "kmeans", "community"]>;
4779
5094
  dimension_reduction: z.ZodEnum<["umap", "pca", "none"]>;
4780
5095
  sample_size: z.ZodOptional<z.ZodNumber>;
4781
5096
  n_clusters: z.ZodOptional<z.ZodNumber>;
@@ -4784,7 +5099,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4784
5099
  hierarchy_threshold: z.ZodOptional<z.ZodNumber>;
4785
5100
  naming_model: z.ZodOptional<z.ZodString>;
4786
5101
  }, "strip", z.ZodTypeAny, {
4787
- algorithm: "hdbscan" | "kmeans";
5102
+ algorithm: "hdbscan" | "kmeans" | "community";
4788
5103
  dimension_reduction: "none" | "umap" | "pca";
4789
5104
  sample_size?: number | undefined;
4790
5105
  n_clusters?: number | undefined;
@@ -4793,7 +5108,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4793
5108
  hierarchy_threshold?: number | undefined;
4794
5109
  naming_model?: string | undefined;
4795
5110
  }, {
4796
- algorithm: "hdbscan" | "kmeans";
5111
+ algorithm: "hdbscan" | "kmeans" | "community";
4797
5112
  dimension_reduction: "none" | "umap" | "pca";
4798
5113
  sample_size?: number | undefined;
4799
5114
  n_clusters?: number | undefined;
@@ -4811,12 +5126,20 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4811
5126
  type: "topic_map";
4812
5127
  source_facet: string;
4813
5128
  embedding_model: string;
4814
- btql_filter?: string | undefined;
5129
+ source_facet_function?: {
5130
+ id: string;
5131
+ type: "function";
5132
+ version?: string | undefined;
5133
+ } | {
5134
+ type: "global";
5135
+ name: string;
5136
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
5137
+ } | undefined;
4815
5138
  bundle_key?: string | undefined;
4816
5139
  report_key?: string | undefined;
4817
5140
  topic_names?: Record<string, string> | undefined;
4818
5141
  generation_settings?: {
4819
- algorithm: "hdbscan" | "kmeans";
5142
+ algorithm: "hdbscan" | "kmeans" | "community";
4820
5143
  dimension_reduction: "none" | "umap" | "pca";
4821
5144
  sample_size?: number | undefined;
4822
5145
  n_clusters?: number | undefined;
@@ -4828,17 +5151,26 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4828
5151
  disable_reconciliation?: boolean | undefined;
4829
5152
  reconcile_mode?: "evolve" | "names_only" | undefined;
4830
5153
  distance_threshold?: number | undefined;
5154
+ btql_filter?: string | undefined;
4831
5155
  automation_btql_filter?: string | undefined;
4832
5156
  }, {
4833
5157
  type: "topic_map";
4834
5158
  source_facet: string;
4835
5159
  embedding_model: string;
4836
- btql_filter?: string | undefined;
5160
+ source_facet_function?: {
5161
+ id: string;
5162
+ type: "function";
5163
+ version?: string | undefined;
5164
+ } | {
5165
+ type: "global";
5166
+ name: string;
5167
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
5168
+ } | undefined;
4837
5169
  bundle_key?: string | undefined;
4838
5170
  report_key?: string | undefined;
4839
5171
  topic_names?: Record<string, string> | undefined;
4840
5172
  generation_settings?: {
4841
- algorithm: "hdbscan" | "kmeans";
5173
+ algorithm: "hdbscan" | "kmeans" | "community";
4842
5174
  dimension_reduction: "none" | "umap" | "pca";
4843
5175
  sample_size?: number | undefined;
4844
5176
  n_clusters?: number | undefined;
@@ -4850,6 +5182,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
4850
5182
  disable_reconciliation?: boolean | undefined;
4851
5183
  reconcile_mode?: "evolve" | "names_only" | undefined;
4852
5184
  distance_threshold?: number | undefined;
5185
+ btql_filter?: string | undefined;
4853
5186
  automation_btql_filter?: string | undefined;
4854
5187
  }>, z.ZodUnknown>]>;
4855
5188
  declare const PromptData: z.ZodObject<{
@@ -6217,6 +6550,15 @@ declare const PromptData: z.ZodObject<{
6217
6550
  type: "global";
6218
6551
  name: string;
6219
6552
  function_type?: "preprocessor" | undefined;
6553
+ }>, z.ZodObject<{
6554
+ type: z.ZodLiteral<"inline">;
6555
+ code: z.ZodString;
6556
+ }, "strip", z.ZodTypeAny, {
6557
+ code: string;
6558
+ type: "inline";
6559
+ }, {
6560
+ code: string;
6561
+ type: "inline";
6220
6562
  }>, z.ZodNull]>>;
6221
6563
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
6222
6564
  type: z.ZodLiteral<"function">;
@@ -6237,11 +6579,11 @@ declare const PromptData: z.ZodObject<{
6237
6579
  }, "strip", z.ZodTypeAny, {
6238
6580
  type: "global";
6239
6581
  name: string;
6240
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
6582
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
6241
6583
  }, {
6242
6584
  type: "global";
6243
6585
  name: string;
6244
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
6586
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
6245
6587
  }>]>, "many">, z.ZodNull]>>;
6246
6588
  template_format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["mustache", "nunjucks", "none"]>, z.ZodNull]>>;
6247
6589
  mcp: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
@@ -6519,6 +6861,18 @@ declare const PromptData: z.ZodObject<{
6519
6861
  type: "completion";
6520
6862
  content: string;
6521
6863
  } | null | undefined;
6864
+ preprocessor?: {
6865
+ id: string;
6866
+ type: "function";
6867
+ version?: string | undefined;
6868
+ } | {
6869
+ type: "global";
6870
+ name: string;
6871
+ function_type: "preprocessor";
6872
+ } | {
6873
+ code: string;
6874
+ type: "inline";
6875
+ } | null | undefined;
6522
6876
  origin?: {
6523
6877
  project_id?: string | undefined;
6524
6878
  prompt_id?: string | undefined;
@@ -6539,17 +6893,8 @@ declare const PromptData: z.ZodObject<{
6539
6893
  } | {
6540
6894
  type: "global";
6541
6895
  name: string;
6542
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
6896
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
6543
6897
  })[] | null | undefined;
6544
- preprocessor?: {
6545
- id: string;
6546
- type: "function";
6547
- version?: string | undefined;
6548
- } | {
6549
- type: "global";
6550
- name: string;
6551
- function_type: "preprocessor";
6552
- } | null | undefined;
6553
6898
  template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
6554
6899
  mcp?: Record<string, {
6555
6900
  id: string;
@@ -6793,6 +7138,18 @@ declare const PromptData: z.ZodObject<{
6793
7138
  type: "completion";
6794
7139
  content: string;
6795
7140
  } | null | undefined;
7141
+ preprocessor?: {
7142
+ id: string;
7143
+ type: "function";
7144
+ version?: string | undefined;
7145
+ } | {
7146
+ type: "global";
7147
+ name: string;
7148
+ function_type?: "preprocessor" | undefined;
7149
+ } | {
7150
+ code: string;
7151
+ type: "inline";
7152
+ } | null | undefined;
6796
7153
  origin?: {
6797
7154
  project_id?: string | undefined;
6798
7155
  prompt_id?: string | undefined;
@@ -6813,17 +7170,8 @@ declare const PromptData: z.ZodObject<{
6813
7170
  } | {
6814
7171
  type: "global";
6815
7172
  name: string;
6816
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
7173
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
6817
7174
  })[] | null | undefined;
6818
- preprocessor?: {
6819
- id: string;
6820
- type: "function";
6821
- version?: string | undefined;
6822
- } | {
6823
- type: "global";
6824
- name: string;
6825
- function_type?: "preprocessor" | undefined;
6826
- } | null | undefined;
6827
7175
  template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
6828
7176
  mcp?: Record<string, {
6829
7177
  id: string;
@@ -6843,10 +7191,10 @@ declare const GitMetadataSettings: z.ZodObject<{
6843
7191
  fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["commit", "branch", "tag", "dirty", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
6844
7192
  }, "strip", z.ZodTypeAny, {
6845
7193
  collect: "some" | "none" | "all";
6846
- fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
7194
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
6847
7195
  }, {
6848
7196
  collect: "some" | "none" | "all";
6849
- fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
7197
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
6850
7198
  }>;
6851
7199
  type GitMetadataSettingsType = z.infer<typeof GitMetadataSettings>;
6852
7200
  declare const IfExists: z.ZodEnum<["error", "ignore", "replace"]>;
@@ -8246,6 +8594,15 @@ declare const Prompt$1: z.ZodObject<{
8246
8594
  type: "global";
8247
8595
  name: string;
8248
8596
  function_type?: "preprocessor" | undefined;
8597
+ }>, z.ZodObject<{
8598
+ type: z.ZodLiteral<"inline">;
8599
+ code: z.ZodString;
8600
+ }, "strip", z.ZodTypeAny, {
8601
+ code: string;
8602
+ type: "inline";
8603
+ }, {
8604
+ code: string;
8605
+ type: "inline";
8249
8606
  }>, z.ZodNull]>>;
8250
8607
  tool_functions: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodObject<{
8251
8608
  type: z.ZodLiteral<"function">;
@@ -8266,11 +8623,11 @@ declare const Prompt$1: z.ZodObject<{
8266
8623
  }, "strip", z.ZodTypeAny, {
8267
8624
  type: "global";
8268
8625
  name: string;
8269
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
8626
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8270
8627
  }, {
8271
8628
  type: "global";
8272
8629
  name: string;
8273
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
8630
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8274
8631
  }>]>, "many">, z.ZodNull]>>;
8275
8632
  template_format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["mustache", "nunjucks", "none"]>, z.ZodNull]>>;
8276
8633
  mcp: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
@@ -8548,6 +8905,18 @@ declare const Prompt$1: z.ZodObject<{
8548
8905
  type: "completion";
8549
8906
  content: string;
8550
8907
  } | null | undefined;
8908
+ preprocessor?: {
8909
+ id: string;
8910
+ type: "function";
8911
+ version?: string | undefined;
8912
+ } | {
8913
+ type: "global";
8914
+ name: string;
8915
+ function_type: "preprocessor";
8916
+ } | {
8917
+ code: string;
8918
+ type: "inline";
8919
+ } | null | undefined;
8551
8920
  origin?: {
8552
8921
  project_id?: string | undefined;
8553
8922
  prompt_id?: string | undefined;
@@ -8568,17 +8937,8 @@ declare const Prompt$1: z.ZodObject<{
8568
8937
  } | {
8569
8938
  type: "global";
8570
8939
  name: string;
8571
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
8940
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
8572
8941
  })[] | null | undefined;
8573
- preprocessor?: {
8574
- id: string;
8575
- type: "function";
8576
- version?: string | undefined;
8577
- } | {
8578
- type: "global";
8579
- name: string;
8580
- function_type: "preprocessor";
8581
- } | null | undefined;
8582
8942
  template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
8583
8943
  mcp?: Record<string, {
8584
8944
  id: string;
@@ -8822,6 +9182,18 @@ declare const Prompt$1: z.ZodObject<{
8822
9182
  type: "completion";
8823
9183
  content: string;
8824
9184
  } | null | undefined;
9185
+ preprocessor?: {
9186
+ id: string;
9187
+ type: "function";
9188
+ version?: string | undefined;
9189
+ } | {
9190
+ type: "global";
9191
+ name: string;
9192
+ function_type?: "preprocessor" | undefined;
9193
+ } | {
9194
+ code: string;
9195
+ type: "inline";
9196
+ } | null | undefined;
8825
9197
  origin?: {
8826
9198
  project_id?: string | undefined;
8827
9199
  prompt_id?: string | undefined;
@@ -8842,17 +9214,8 @@ declare const Prompt$1: z.ZodObject<{
8842
9214
  } | {
8843
9215
  type: "global";
8844
9216
  name: string;
8845
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
9217
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
8846
9218
  })[] | null | undefined;
8847
- preprocessor?: {
8848
- id: string;
8849
- type: "function";
8850
- version?: string | undefined;
8851
- } | {
8852
- type: "global";
8853
- name: string;
8854
- function_type?: "preprocessor" | undefined;
8855
- } | null | undefined;
8856
9219
  template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
8857
9220
  mcp?: Record<string, {
8858
9221
  id: string;
@@ -8874,12 +9237,13 @@ declare const Prompt$1: z.ZodObject<{
8874
9237
  id: string;
8875
9238
  project_id: string;
8876
9239
  log_id: "p";
8877
- org_id: string;
8878
9240
  name: string;
8879
9241
  slug: string;
9242
+ org_id: string;
8880
9243
  created?: string | null | undefined;
8881
- metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
8882
9244
  description?: string | null | undefined;
9245
+ metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
9246
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
8883
9247
  tags?: string[] | null | undefined;
8884
9248
  prompt_data?: {
8885
9249
  options?: {
@@ -9112,6 +9476,18 @@ declare const Prompt$1: z.ZodObject<{
9112
9476
  type: "completion";
9113
9477
  content: string;
9114
9478
  } | null | undefined;
9479
+ preprocessor?: {
9480
+ id: string;
9481
+ type: "function";
9482
+ version?: string | undefined;
9483
+ } | {
9484
+ type: "global";
9485
+ name: string;
9486
+ function_type: "preprocessor";
9487
+ } | {
9488
+ code: string;
9489
+ type: "inline";
9490
+ } | null | undefined;
9115
9491
  origin?: {
9116
9492
  project_id?: string | undefined;
9117
9493
  prompt_id?: string | undefined;
@@ -9132,17 +9508,8 @@ declare const Prompt$1: z.ZodObject<{
9132
9508
  } | {
9133
9509
  type: "global";
9134
9510
  name: string;
9135
- function_type: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox";
9511
+ function_type: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox";
9136
9512
  })[] | null | undefined;
9137
- preprocessor?: {
9138
- id: string;
9139
- type: "function";
9140
- version?: string | undefined;
9141
- } | {
9142
- type: "global";
9143
- name: string;
9144
- function_type: "preprocessor";
9145
- } | null | undefined;
9146
9513
  template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
9147
9514
  mcp?: Record<string, {
9148
9515
  id: string;
@@ -9156,18 +9523,18 @@ declare const Prompt$1: z.ZodObject<{
9156
9523
  enabled_tools?: string[] | null | undefined;
9157
9524
  }> | null | undefined;
9158
9525
  } | null | undefined;
9159
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | null | undefined;
9160
9526
  }, {
9161
9527
  _xact_id: string;
9162
9528
  id: string;
9163
9529
  project_id: string;
9164
9530
  log_id: "p";
9165
- org_id: string;
9166
9531
  name: string;
9167
9532
  slug: string;
9533
+ org_id: string;
9168
9534
  created?: string | null | undefined;
9169
- metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
9170
9535
  description?: string | null | undefined;
9536
+ metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
9537
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
9171
9538
  tags?: string[] | null | undefined;
9172
9539
  prompt_data?: {
9173
9540
  options?: {
@@ -9400,6 +9767,18 @@ declare const Prompt$1: z.ZodObject<{
9400
9767
  type: "completion";
9401
9768
  content: string;
9402
9769
  } | null | undefined;
9770
+ preprocessor?: {
9771
+ id: string;
9772
+ type: "function";
9773
+ version?: string | undefined;
9774
+ } | {
9775
+ type: "global";
9776
+ name: string;
9777
+ function_type?: "preprocessor" | undefined;
9778
+ } | {
9779
+ code: string;
9780
+ type: "inline";
9781
+ } | null | undefined;
9403
9782
  origin?: {
9404
9783
  project_id?: string | undefined;
9405
9784
  prompt_id?: string | undefined;
@@ -9420,17 +9799,8 @@ declare const Prompt$1: z.ZodObject<{
9420
9799
  } | {
9421
9800
  type: "global";
9422
9801
  name: string;
9423
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | undefined;
9802
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
9424
9803
  })[] | null | undefined;
9425
- preprocessor?: {
9426
- id: string;
9427
- type: "function";
9428
- version?: string | undefined;
9429
- } | {
9430
- type: "global";
9431
- name: string;
9432
- function_type?: "preprocessor" | undefined;
9433
- } | null | undefined;
9434
9804
  template_format?: "none" | "mustache" | "nunjucks" | null | undefined;
9435
9805
  mcp?: Record<string, {
9436
9806
  id: string;
@@ -9444,7 +9814,6 @@ declare const Prompt$1: z.ZodObject<{
9444
9814
  enabled_tools?: string[] | null | undefined;
9445
9815
  }> | null | undefined;
9446
9816
  } | null | undefined;
9447
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | null | undefined;
9448
9817
  }>;
9449
9818
  type PromptType = z.infer<typeof Prompt$1>;
9450
9819
  declare const PromptSessionEvent: z.ZodObject<{
@@ -9468,11 +9837,11 @@ declare const PromptSessionEvent: z.ZodObject<{
9468
9837
  prompt_session_id: string;
9469
9838
  project_id: string;
9470
9839
  function_data?: unknown;
9471
- _pagination_key?: string | null | undefined;
9840
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
9472
9841
  tags?: string[] | null | undefined;
9842
+ _pagination_key?: string | null | undefined;
9473
9843
  completion?: unknown;
9474
9844
  prompt_data?: unknown;
9475
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | null | undefined;
9476
9845
  prompt_session_data?: unknown;
9477
9846
  object_data?: unknown;
9478
9847
  }, {
@@ -9482,11 +9851,11 @@ declare const PromptSessionEvent: z.ZodObject<{
9482
9851
  prompt_session_id: string;
9483
9852
  project_id: string;
9484
9853
  function_data?: unknown;
9485
- _pagination_key?: string | null | undefined;
9854
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
9486
9855
  tags?: string[] | null | undefined;
9856
+ _pagination_key?: string | null | undefined;
9487
9857
  completion?: unknown;
9488
9858
  prompt_data?: unknown;
9489
- function_type?: "tool" | "parameters" | "task" | "scorer" | "tag" | "llm" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | null | undefined;
9490
9859
  prompt_session_data?: unknown;
9491
9860
  object_data?: unknown;
9492
9861
  }>;
@@ -9520,12 +9889,12 @@ declare const SSEProgressEventData: z.ZodObject<{
9520
9889
  data: z.ZodString;
9521
9890
  }, "strip", z.ZodTypeAny, {
9522
9891
  id: string;
9523
- object_type: "prompt" | "tool" | "parameters" | "task" | "scorer" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | "workflow";
9892
+ object_type: "prompt" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "parameters" | "sandbox" | "workflow";
9524
9893
  name: string;
9525
9894
  data: string;
9526
9895
  event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
9527
- format: "code" | "llm" | "global" | "graph" | "topic_map";
9528
- output_type: "score" | "completion" | "any" | "facet" | "classification";
9896
+ format: "code" | "llm" | "global" | "topic_map" | "graph";
9897
+ output_type: "facet" | "score" | "completion" | "classification" | "any";
9529
9898
  origin?: {
9530
9899
  id: string;
9531
9900
  object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
@@ -9535,12 +9904,12 @@ declare const SSEProgressEventData: z.ZodObject<{
9535
9904
  } | null | undefined;
9536
9905
  }, {
9537
9906
  id: string;
9538
- object_type: "prompt" | "tool" | "parameters" | "task" | "scorer" | "custom_view" | "facet" | "preprocessor" | "classifier" | "sandbox" | "workflow";
9907
+ object_type: "prompt" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "parameters" | "sandbox" | "workflow";
9539
9908
  name: string;
9540
9909
  data: string;
9541
9910
  event: "done" | "error" | "text_delta" | "reasoning_delta" | "json_delta" | "progress" | "console" | "start";
9542
- format: "code" | "llm" | "global" | "graph" | "topic_map";
9543
- output_type: "score" | "completion" | "any" | "facet" | "classification";
9911
+ format: "code" | "llm" | "global" | "topic_map" | "graph";
9912
+ output_type: "facet" | "score" | "completion" | "classification" | "any";
9544
9913
  origin?: {
9545
9914
  id: string;
9546
9915
  object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
@@ -9659,7 +10028,6 @@ declare class LazyValue<T> {
9659
10028
  type TemplateFormat = "mustache" | "nunjucks" | "none";
9660
10029
 
9661
10030
  interface GlobalHookAsyncLocalStorage<T> {
9662
- enterWith(store: T): void;
9663
10031
  run<R>(store: T | undefined, callback: () => R): R;
9664
10032
  getStore(): T | undefined;
9665
10033
  }
@@ -9825,6 +10193,14 @@ interface PromptKey {
9825
10193
  */
9826
10194
  id?: string;
9827
10195
  }
10196
+ type PromptMemoryCacheEntry = {
10197
+ value: Prompt;
10198
+ resolvedOrgIdentity?: string;
10199
+ };
10200
+ type PromptDiskCacheEntry = {
10201
+ value: ReturnType<Prompt["_internalSerializeForCache"]>;
10202
+ resolvedOrgIdentity?: string;
10203
+ };
9828
10204
  /**
9829
10205
  * A configurable cache for Braintrust prompts with optional in-memory and filesystem storage.
9830
10206
  *
@@ -9833,10 +10209,19 @@ interface PromptKey {
9833
10209
  declare class PromptCache {
9834
10210
  private readonly memoryCache?;
9835
10211
  private readonly diskCache?;
10212
+ private readonly namespace?;
10213
+ private readonly expectedResolvedOrgIdentity?;
9836
10214
  constructor(options: {
9837
- memoryCache?: LRUCache<string, Prompt>;
9838
- diskCache?: DiskCache<Prompt>;
10215
+ memoryCache?: LRUCache<string, PromptMemoryCacheEntry>;
10216
+ diskCache?: DiskCache<PromptDiskCacheEntry>;
10217
+ namespace?: string;
10218
+ expectedResolvedOrgIdentity?: string;
9839
10219
  });
10220
+ /**
10221
+ * Returns a cache view that shares the same storage layers but isolates all
10222
+ * entries under the provided namespace.
10223
+ */
10224
+ withNamespace(namespace: string, expectedResolvedOrgIdentity?: string): PromptCache;
9840
10225
  /**
9841
10226
  * Retrieves a prompt from the cache.
9842
10227
  * First checks the in-memory LRU cache, then falls back to checking the disk cache if available.
@@ -9860,13 +10245,26 @@ interface ParametersKey {
9860
10245
  projectName?: string;
9861
10246
  id?: string;
9862
10247
  }
10248
+ type ParametersMemoryCacheEntry = {
10249
+ value: RemoteEvalParameters;
10250
+ resolvedOrgIdentity?: string;
10251
+ };
10252
+ type ParametersDiskCacheEntry = {
10253
+ value: ReturnType<RemoteEvalParameters["_internalSerializeForCache"]>;
10254
+ resolvedOrgIdentity?: string;
10255
+ };
9863
10256
  declare class ParametersCache {
9864
10257
  private readonly memoryCache?;
9865
10258
  private readonly diskCache?;
10259
+ private readonly namespace?;
10260
+ private readonly expectedResolvedOrgIdentity?;
9866
10261
  constructor(options: {
9867
- memoryCache?: LRUCache<string, RemoteEvalParameters>;
9868
- diskCache?: DiskCache<RemoteEvalParameters>;
10262
+ memoryCache?: LRUCache<string, ParametersMemoryCacheEntry>;
10263
+ diskCache?: DiskCache<ParametersDiskCacheEntry>;
10264
+ namespace?: string;
10265
+ expectedResolvedOrgIdentity?: string;
9869
10266
  });
10267
+ withNamespace(namespace: string, expectedResolvedOrgIdentity?: string): ParametersCache;
9870
10268
  get(key: ParametersKey): Promise<RemoteEvalParameters | undefined>;
9871
10269
  set(key: ParametersKey, value: RemoteEvalParameters): Promise<void>;
9872
10270
  }
@@ -11934,8 +12332,8 @@ declare const parametersRowSchema: z.ZodObject<{
11934
12332
  name: string;
11935
12333
  slug: string;
11936
12334
  function_type: "parameters";
11937
- metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
11938
12335
  description?: string | null | undefined;
12336
+ metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
11939
12337
  }, {
11940
12338
  _xact_id: string;
11941
12339
  id: string;
@@ -11948,8 +12346,8 @@ declare const parametersRowSchema: z.ZodObject<{
11948
12346
  name: string;
11949
12347
  slug: string;
11950
12348
  function_type: "parameters";
11951
- metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
11952
12349
  description?: string | null | undefined;
12350
+ metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
11953
12351
  }>;
11954
12352
  type ParametersRow = z.infer<typeof parametersRowSchema>;
11955
12353
 
@@ -12199,10 +12597,10 @@ declare const loginSchema: z.ZodObject<{
12199
12597
  fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["commit", "branch", "tag", "dirty", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
12200
12598
  }, "strip", z.ZodTypeAny, {
12201
12599
  collect: "some" | "none" | "all";
12202
- fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12600
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12203
12601
  }, {
12204
12602
  collect: "some" | "none" | "all";
12205
- fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12603
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12206
12604
  }>>>;
12207
12605
  debugLogLevel: z.ZodOptional<z.ZodEnum<["error", "warn", "info", "debug"]>>;
12208
12606
  debugLogLevelDisabled: z.ZodOptional<z.ZodBoolean>;
@@ -12216,7 +12614,7 @@ declare const loginSchema: z.ZodObject<{
12216
12614
  orgId?: string | null | undefined;
12217
12615
  gitMetadataSettings?: {
12218
12616
  collect: "some" | "none" | "all";
12219
- fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12617
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12220
12618
  } | null | undefined;
12221
12619
  debugLogLevel?: "error" | "warn" | "info" | "debug" | undefined;
12222
12620
  debugLogLevelDisabled?: boolean | undefined;
@@ -12230,14 +12628,23 @@ declare const loginSchema: z.ZodObject<{
12230
12628
  orgId?: string | null | undefined;
12231
12629
  gitMetadataSettings?: {
12232
12630
  collect: "some" | "none" | "all";
12233
- fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12631
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
12234
12632
  } | null | undefined;
12235
12633
  debugLogLevel?: "error" | "warn" | "info" | "debug" | undefined;
12236
12634
  debugLogLevelDisabled?: boolean | undefined;
12237
12635
  }>;
12238
12636
  type SerializedBraintrustState = z.infer<typeof loginSchema>;
12637
+ type ResolvedLoaderLoginOptions = Required<Pick<LoginOptions, "apiKey" | "appUrl" | "fetch">> & Pick<LoginOptions, "orgName"> & {
12638
+ forceLogin?: boolean;
12639
+ credentialCacheNamespace: string;
12640
+ existingState?: BraintrustState;
12641
+ };
12642
+ type LoaderCacheViews = {
12643
+ promptCache: PromptCache;
12644
+ parametersCache: ParametersCache;
12645
+ };
12646
+ type LoaderRequestState = Pick<BraintrustState, "appUrl" | "orgId" | "apiConn">;
12239
12647
  declare class BraintrustState {
12240
- private loginParams;
12241
12648
  id: string;
12242
12649
  currentExperiment: Experiment | undefined;
12243
12650
  currentLogger: Logger<false> | undefined;
@@ -12268,12 +12675,23 @@ declare class BraintrustState {
12268
12675
  private _otelFlushCallback;
12269
12676
  spanOriginEnvironment: SpanOriginEnvironment | undefined;
12270
12677
  private traceContextSigningSecret;
12678
+ private loaderLoginCache;
12679
+ private readonly loginParams;
12680
+ private activeLoginOrgNameSelector;
12271
12681
  constructor(loginParams: LoginOptions);
12272
12682
  /** @internal */
12273
12683
  _internalSetTraceContextSigningSecret(secret: string | undefined): void;
12274
12684
  /** @internal */
12275
12685
  _internalGetTraceContextSigningSecret(): string | undefined;
12276
12686
  resetLoginInfo(): void;
12687
+ /** @internal */
12688
+ _internalResolveLoaderLoginOptions({ apiKey, appUrl, orgName, fetch, forceLogin, }: Pick<LoginOptions, "apiKey" | "appUrl" | "orgName" | "fetch"> & {
12689
+ forceLogin?: boolean;
12690
+ }): Promise<ResolvedLoaderLoginOptions>;
12691
+ /** @internal */
12692
+ _internalGetLoaderCacheViews(loginOptions: ResolvedLoaderLoginOptions, requestState?: LoaderRequestState): LoaderCacheViews;
12693
+ /** @internal */
12694
+ _internalGetLoaderState({ apiKey, appUrl, orgName, fetch, forceLogin, existingState, }: ResolvedLoaderLoginOptions): Promise<LoaderRequestState>;
12277
12695
  resetIdGenState(): void;
12278
12696
  [RESET_CONTEXT_MANAGER_STATE](): void;
12279
12697
  get idGenerator(): IDGenerator;
@@ -12312,11 +12730,12 @@ declare class BraintrustState {
12312
12730
  toString(): string;
12313
12731
  }
12314
12732
  declare class HTTPConnection {
12733
+ private readonly classifyTransportErrors;
12315
12734
  base_url: string;
12316
12735
  token: string | null;
12317
12736
  headers: Record<string, string>;
12318
12737
  fetch: typeof globalThis.fetch;
12319
- constructor(base_url: string, fetch: typeof globalThis.fetch);
12738
+ constructor(base_url: string, fetch: typeof globalThis.fetch, classifyTransportErrors?: boolean);
12320
12739
  setFetch(fetch: typeof globalThis.fetch): void;
12321
12740
  ping(): Promise<boolean>;
12322
12741
  make_long_lived(): void;
@@ -13006,6 +13425,251 @@ declare class Prompt<HasId extends boolean = true, HasVersion extends boolean =
13006
13425
  }): PromptBlockDataType;
13007
13426
  private getParsedPromptData;
13008
13427
  static isPrompt(data: unknown): data is Prompt<boolean, boolean>;
13428
+ /** @internal */
13429
+ _internalSerializeForCache(): {
13430
+ metadata: {
13431
+ _xact_id: string;
13432
+ created: string;
13433
+ id: string;
13434
+ prompt_session_id: string;
13435
+ project_id: string;
13436
+ function_data?: unknown;
13437
+ function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | null | undefined;
13438
+ tags?: string[] | null | undefined;
13439
+ _pagination_key?: string | null | undefined;
13440
+ completion?: unknown;
13441
+ prompt_data?: unknown;
13442
+ prompt_session_data?: unknown;
13443
+ object_data?: unknown;
13444
+ } | PromptRowWithId<HasId, HasVersion>;
13445
+ defaults: Partial<Omit<z.objectOutputType<{
13446
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13447
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13448
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13449
+ temperature: z.ZodOptional<z.ZodNumber>;
13450
+ top_p: z.ZodOptional<z.ZodNumber>;
13451
+ max_tokens: z.ZodOptional<z.ZodNumber>;
13452
+ max_completion_tokens: z.ZodOptional<z.ZodNumber>;
13453
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
13454
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
13455
+ response_format: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
13456
+ type: z.ZodLiteral<"json_object">;
13457
+ }, "strip", z.ZodTypeAny, {
13458
+ type: "json_object";
13459
+ }, {
13460
+ type: "json_object";
13461
+ }>, z.ZodObject<{
13462
+ type: z.ZodLiteral<"json_schema">;
13463
+ json_schema: z.ZodObject<{
13464
+ name: z.ZodString;
13465
+ description: z.ZodOptional<z.ZodString>;
13466
+ schema: z.ZodOptional<z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodString]>>;
13467
+ strict: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
13468
+ }, "strip", z.ZodTypeAny, {
13469
+ name: string;
13470
+ description?: string | undefined;
13471
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13472
+ strict?: boolean | null | undefined;
13473
+ }, {
13474
+ name: string;
13475
+ description?: string | undefined;
13476
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13477
+ strict?: boolean | null | undefined;
13478
+ }>;
13479
+ }, "strip", z.ZodTypeAny, {
13480
+ type: "json_schema";
13481
+ json_schema: {
13482
+ name: string;
13483
+ description?: string | undefined;
13484
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13485
+ strict?: boolean | null | undefined;
13486
+ };
13487
+ }, {
13488
+ type: "json_schema";
13489
+ json_schema: {
13490
+ name: string;
13491
+ description?: string | undefined;
13492
+ schema?: string | z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13493
+ strict?: boolean | null | undefined;
13494
+ };
13495
+ }>, z.ZodObject<{
13496
+ type: z.ZodLiteral<"text">;
13497
+ }, "strip", z.ZodTypeAny, {
13498
+ type: "text";
13499
+ }, {
13500
+ type: "text";
13501
+ }>, z.ZodNull]>>;
13502
+ tool_choice: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodLiteral<"required">, z.ZodObject<{
13503
+ type: z.ZodLiteral<"function">;
13504
+ function: z.ZodObject<{
13505
+ name: z.ZodString;
13506
+ }, "strip", z.ZodTypeAny, {
13507
+ name: string;
13508
+ }, {
13509
+ name: string;
13510
+ }>;
13511
+ }, "strip", z.ZodTypeAny, {
13512
+ function: {
13513
+ name: string;
13514
+ };
13515
+ type: "function";
13516
+ }, {
13517
+ function: {
13518
+ name: string;
13519
+ };
13520
+ type: "function";
13521
+ }>]>>;
13522
+ function_call: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"none">, z.ZodObject<{
13523
+ name: z.ZodString;
13524
+ }, "strip", z.ZodTypeAny, {
13525
+ name: string;
13526
+ }, {
13527
+ name: string;
13528
+ }>]>>;
13529
+ n: z.ZodOptional<z.ZodNumber>;
13530
+ stop: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13531
+ reasoning_effort: z.ZodOptional<z.ZodEnum<["none", "minimal", "low", "medium", "high"]>>;
13532
+ verbosity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
13533
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13534
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13535
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13536
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13537
+ max_tokens: z.ZodNumber;
13538
+ temperature: z.ZodNumber;
13539
+ top_p: z.ZodOptional<z.ZodNumber>;
13540
+ top_k: z.ZodOptional<z.ZodNumber>;
13541
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13542
+ max_tokens_to_sample: z.ZodOptional<z.ZodNumber>;
13543
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13544
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13545
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13546
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13547
+ temperature: z.ZodOptional<z.ZodNumber>;
13548
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
13549
+ topP: z.ZodOptional<z.ZodNumber>;
13550
+ topK: z.ZodOptional<z.ZodNumber>;
13551
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13552
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13553
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13554
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13555
+ temperature: z.ZodOptional<z.ZodNumber>;
13556
+ topK: z.ZodOptional<z.ZodNumber>;
13557
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
13558
+ use_cache: z.ZodOptional<z.ZodBoolean>;
13559
+ reasoning_enabled: z.ZodOptional<z.ZodBoolean>;
13560
+ reasoning_budget: z.ZodOptional<z.ZodNumber>;
13561
+ }, z.ZodTypeAny, "passthrough"> | undefined, "response_format" | "reasoning_effort" | "use_cache"> & Omit<{
13562
+ max_tokens: number;
13563
+ temperature?: number | undefined;
13564
+ top_p?: number | undefined;
13565
+ max_completion_tokens?: number | undefined;
13566
+ frequency_penalty?: number | undefined;
13567
+ presence_penalty?: number | undefined;
13568
+ response_format?: {
13569
+ type: "json_object";
13570
+ } | {
13571
+ type: "json_schema";
13572
+ json_schema: {
13573
+ name: string;
13574
+ description?: string | undefined;
13575
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13576
+ strict?: boolean | null | undefined;
13577
+ };
13578
+ } | {
13579
+ type: "text";
13580
+ } | null | undefined;
13581
+ tool_choice?: "auto" | "none" | "required" | {
13582
+ function: {
13583
+ name: string;
13584
+ };
13585
+ type: "function";
13586
+ } | undefined;
13587
+ function_call?: "auto" | "none" | {
13588
+ name: string;
13589
+ } | undefined;
13590
+ n?: number | undefined;
13591
+ stop?: string[] | undefined;
13592
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | undefined;
13593
+ verbosity?: "low" | "medium" | "high" | undefined;
13594
+ top_k?: number | undefined;
13595
+ stop_sequences?: string[] | undefined;
13596
+ reasoning_enabled?: boolean | undefined;
13597
+ reasoning_budget?: number | undefined;
13598
+ max_tokens_to_sample?: number | undefined;
13599
+ maxOutputTokens?: number | undefined;
13600
+ topP?: number | undefined;
13601
+ topK?: number | undefined;
13602
+ use_cache?: boolean | undefined;
13603
+ }, "response_format" | "reasoning_effort" | "use_cache"> & {
13604
+ reasoning_effort?: CompiledPromptReasoningEffort;
13605
+ response_format?: {
13606
+ type: "json_object";
13607
+ } | {
13608
+ type: "text";
13609
+ } | (Omit<{
13610
+ type: "json_schema";
13611
+ json_schema: {
13612
+ name: string;
13613
+ description?: string | undefined;
13614
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13615
+ strict?: boolean | null | undefined;
13616
+ };
13617
+ }, "json_schema"> & {
13618
+ json_schema: Omit<{
13619
+ name: string;
13620
+ description?: string | undefined;
13621
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13622
+ strict?: boolean | null | undefined;
13623
+ }, "schema"> & {
13624
+ schema?: Record<string, unknown> | undefined;
13625
+ };
13626
+ }) | undefined;
13627
+ model: string;
13628
+ } & {
13629
+ max_tokens: number;
13630
+ temperature?: number | undefined;
13631
+ top_p?: number | undefined;
13632
+ max_completion_tokens?: number | undefined;
13633
+ frequency_penalty?: number | undefined;
13634
+ presence_penalty?: number | undefined;
13635
+ response_format?: {
13636
+ type: "json_object";
13637
+ } | {
13638
+ type: "json_schema";
13639
+ json_schema: {
13640
+ name: string;
13641
+ description?: string | undefined;
13642
+ schema?: string | z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
13643
+ strict?: boolean | null | undefined;
13644
+ };
13645
+ } | {
13646
+ type: "text";
13647
+ } | null | undefined;
13648
+ tool_choice?: "auto" | "none" | "required" | {
13649
+ function: {
13650
+ name: string;
13651
+ };
13652
+ type: "function";
13653
+ } | undefined;
13654
+ function_call?: "auto" | "none" | {
13655
+ name: string;
13656
+ } | undefined;
13657
+ n?: number | undefined;
13658
+ stop?: string[] | undefined;
13659
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | undefined;
13660
+ verbosity?: "low" | "medium" | "high" | undefined;
13661
+ top_k?: number | undefined;
13662
+ stop_sequences?: string[] | undefined;
13663
+ reasoning_enabled?: boolean | undefined;
13664
+ reasoning_budget?: number | undefined;
13665
+ max_tokens_to_sample?: number | undefined;
13666
+ maxOutputTokens?: number | undefined;
13667
+ topP?: number | undefined;
13668
+ topK?: number | undefined;
13669
+ use_cache?: boolean | undefined;
13670
+ } & ChatPrompt & CompletionPrompt>;
13671
+ noTrace: boolean;
13672
+ };
13009
13673
  static fromPromptData(name: string, promptData: PromptDataType): Prompt<false, false>;
13010
13674
  }
13011
13675
  declare class RemoteEvalParameters<HasId extends boolean = true, HasVersion extends boolean = true, T extends Record<string, unknown> = Record<string, unknown>> {
@@ -13019,6 +13683,24 @@ declare class RemoteEvalParameters<HasId extends boolean = true, HasVersion exte
13019
13683
  get version(): HasVersion extends true ? TransactionId : TransactionId | undefined;
13020
13684
  get schema(): Record<string, unknown>;
13021
13685
  get data(): T;
13686
+ /** @internal */
13687
+ _internalSerializeForCache(): {
13688
+ metadata: {
13689
+ _xact_id: string;
13690
+ id: string;
13691
+ project_id: string;
13692
+ function_data: {
13693
+ type: "parameters";
13694
+ __schema: Record<string, unknown>;
13695
+ data?: Record<string, unknown> | undefined;
13696
+ };
13697
+ name: string;
13698
+ slug: string;
13699
+ function_type: "parameters";
13700
+ description?: string | null | undefined;
13701
+ metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
13702
+ };
13703
+ };
13022
13704
  validate(data: unknown): boolean;
13023
13705
  static isParameters(x: unknown): x is RemoteEvalParameters<boolean, boolean, Record<string, unknown>>;
13024
13706
  }