@orq-ai/node 4.17.0-rc.28 → 4.17.0-rc.29

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 (154) hide show
  1. package/funcs/alertsCreate.d.ts +1 -1
  2. package/funcs/alertsCreate.js +1 -1
  3. package/funcs/alertsList.js +1 -0
  4. package/funcs/alertsList.js.map +1 -1
  5. package/funcs/alertsUpdate.d.ts +1 -1
  6. package/funcs/alertsUpdate.js +1 -1
  7. package/funcs/routerClassifyCreate.d.ts +3 -0
  8. package/funcs/routerClassifyCreate.d.ts.map +1 -1
  9. package/funcs/routerClassifyCreate.js +3 -0
  10. package/funcs/routerClassifyCreate.js.map +1 -1
  11. package/funcs/routerDecisionsCreate.d.ts +3 -0
  12. package/funcs/routerDecisionsCreate.d.ts.map +1 -1
  13. package/funcs/routerDecisionsCreate.js +3 -0
  14. package/funcs/routerDecisionsCreate.js.map +1 -1
  15. package/funcs/telemetryListCapabilities.js +2 -0
  16. package/funcs/telemetryListCapabilities.js.map +1 -1
  17. package/jsr.json +1 -1
  18. package/lib/config.d.ts +2 -2
  19. package/lib/config.js +2 -2
  20. package/models/components/alert.d.ts +3 -1
  21. package/models/components/alert.d.ts.map +1 -1
  22. package/models/components/alert.js +2 -0
  23. package/models/components/alert.js.map +1 -1
  24. package/models/components/alertquery.d.ts +16 -4
  25. package/models/components/alertquery.d.ts.map +1 -1
  26. package/models/components/alertquery.js +5 -0
  27. package/models/components/alertquery.js.map +1 -1
  28. package/models/components/alertscope.d.ts +13 -0
  29. package/models/components/alertscope.d.ts.map +1 -0
  30. package/models/components/alertscope.js +51 -0
  31. package/models/components/alertscope.js.map +1 -0
  32. package/models/components/alerttelemetrysource.d.ts +13 -0
  33. package/models/components/alerttelemetrysource.d.ts.map +1 -0
  34. package/models/components/alerttelemetrysource.js +50 -0
  35. package/models/components/alerttelemetrysource.js.map +1 -0
  36. package/models/components/alerttrigger.d.ts +8 -0
  37. package/models/components/alerttrigger.d.ts.map +1 -1
  38. package/models/components/alerttrigger.js +2 -0
  39. package/models/components/alerttrigger.js.map +1 -1
  40. package/models/components/audiocontentpartschema.d.ts +5 -5
  41. package/models/components/audiocontentpartschema.d.ts.map +1 -1
  42. package/models/components/audiocontentpartschema.js +6 -7
  43. package/models/components/audiocontentpartschema.js.map +1 -1
  44. package/models/components/classifyanswer.d.ts +2 -1
  45. package/models/components/classifyanswer.d.ts.map +1 -1
  46. package/models/components/classifyanswer.js +2 -0
  47. package/models/components/classifyanswer.js.map +1 -1
  48. package/models/components/classifyasset.d.ts +52 -0
  49. package/models/components/classifyasset.d.ts.map +1 -0
  50. package/models/components/classifyasset.js +75 -0
  51. package/models/components/classifyasset.js.map +1 -0
  52. package/models/components/classifybox.d.ts +25 -0
  53. package/models/components/classifybox.d.ts.map +1 -0
  54. package/models/components/classifybox.js +53 -0
  55. package/models/components/classifybox.js.map +1 -0
  56. package/models/components/classifyboxanswer.d.ts +16 -0
  57. package/models/components/classifyboxanswer.d.ts.map +1 -0
  58. package/models/components/classifyboxanswer.js +53 -0
  59. package/models/components/classifyboxanswer.js.map +1 -0
  60. package/models/components/classifychoiceanswer.d.ts +1 -1
  61. package/models/components/classifyscoreanswer.d.ts +1 -1
  62. package/models/components/createalertrequest.d.ts +6 -3
  63. package/models/components/createalertrequest.d.ts.map +1 -1
  64. package/models/components/createalertrequest.js +3 -1
  65. package/models/components/createalertrequest.js.map +1 -1
  66. package/models/components/index.d.ts +5 -0
  67. package/models/components/index.d.ts.map +1 -1
  68. package/models/components/index.js +5 -0
  69. package/models/components/index.js.map +1 -1
  70. package/models/components/reasoningpart.js +1 -1
  71. package/models/components/updatealertrequest.d.ts +4 -1
  72. package/models/components/updatealertrequest.d.ts.map +1 -1
  73. package/models/components/updatealertrequest.js.map +1 -1
  74. package/models/operations/alertlist.d.ts +9 -0
  75. package/models/operations/alertlist.d.ts.map +1 -1
  76. package/models/operations/alertlist.js +2 -0
  77. package/models/operations/alertlist.js.map +1 -1
  78. package/models/operations/createclassify.d.ts +118 -17
  79. package/models/operations/createclassify.d.ts.map +1 -1
  80. package/models/operations/createclassify.js +41 -5
  81. package/models/operations/createclassify.js.map +1 -1
  82. package/models/operations/createdecisions.d.ts +124 -23
  83. package/models/operations/createdecisions.d.ts.map +1 -1
  84. package/models/operations/createdecisions.js +48 -10
  85. package/models/operations/createdecisions.js.map +1 -1
  86. package/models/operations/createtool.js +4 -4
  87. package/models/operations/getalltools.js +4 -4
  88. package/models/operations/getv2humanevalsets.js +2 -2
  89. package/models/operations/getv2humanevalsetsid.js +2 -2
  90. package/models/operations/listdeploymentversions.js +1 -1
  91. package/models/operations/patchv2humanevalsetsid.js +2 -2
  92. package/models/operations/postv2feedbackevaluation.js +4 -4
  93. package/models/operations/postv2humanevalsets.js +2 -2
  94. package/models/operations/retrievetool.js +4 -4
  95. package/models/operations/runagent.js +1 -1
  96. package/models/operations/streamrunagent.js +1 -1
  97. package/models/operations/telemetrylistcapabilities.d.ts +16 -0
  98. package/models/operations/telemetrylistcapabilities.d.ts.map +1 -1
  99. package/models/operations/telemetrylistcapabilities.js +8 -0
  100. package/models/operations/telemetrylistcapabilities.js.map +1 -1
  101. package/models/operations/updatetool.js +4 -4
  102. package/package.json +1 -1
  103. package/sdk/alerts.d.ts +2 -2
  104. package/sdk/alerts.js +2 -2
  105. package/sdk/classify.d.ts +3 -0
  106. package/sdk/classify.d.ts.map +1 -1
  107. package/sdk/classify.js +3 -0
  108. package/sdk/classify.js.map +1 -1
  109. package/sdk/decisions.d.ts +3 -0
  110. package/sdk/decisions.d.ts.map +1 -1
  111. package/sdk/decisions.js +3 -0
  112. package/sdk/decisions.js.map +1 -1
  113. package/src/funcs/alertsCreate.ts +1 -1
  114. package/src/funcs/alertsList.ts +1 -0
  115. package/src/funcs/alertsUpdate.ts +1 -1
  116. package/src/funcs/routerClassifyCreate.ts +3 -0
  117. package/src/funcs/routerDecisionsCreate.ts +3 -0
  118. package/src/funcs/telemetryListCapabilities.ts +2 -0
  119. package/src/lib/config.ts +2 -2
  120. package/src/models/components/alert.ts +4 -1
  121. package/src/models/components/alertquery.ts +24 -4
  122. package/src/models/components/alertscope.ts +20 -0
  123. package/src/models/components/alerttelemetrysource.ts +22 -0
  124. package/src/models/components/alerttrigger.ts +9 -0
  125. package/src/models/components/audiocontentpartschema.ts +13 -9
  126. package/src/models/components/classifyanswer.ts +6 -0
  127. package/src/models/components/classifyasset.ts +81 -0
  128. package/src/models/components/classifybox.ts +49 -0
  129. package/src/models/components/classifyboxanswer.ts +39 -0
  130. package/src/models/components/classifychoiceanswer.ts +1 -1
  131. package/src/models/components/classifyscoreanswer.ts +1 -1
  132. package/src/models/components/createalertrequest.ts +8 -4
  133. package/src/models/components/index.ts +5 -0
  134. package/src/models/components/reasoningpart.ts +1 -1
  135. package/src/models/components/updatealertrequest.ts +4 -1
  136. package/src/models/operations/alertlist.ts +10 -0
  137. package/src/models/operations/createclassify.ts +169 -21
  138. package/src/models/operations/createdecisions.ts +197 -32
  139. package/src/models/operations/createtool.ts +4 -4
  140. package/src/models/operations/getalltools.ts +4 -4
  141. package/src/models/operations/getv2humanevalsets.ts +2 -2
  142. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  143. package/src/models/operations/listdeploymentversions.ts +1 -1
  144. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  145. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  146. package/src/models/operations/postv2humanevalsets.ts +2 -2
  147. package/src/models/operations/retrievetool.ts +4 -4
  148. package/src/models/operations/runagent.ts +1 -1
  149. package/src/models/operations/streamrunagent.ts +1 -1
  150. package/src/models/operations/telemetrylistcapabilities.ts +24 -0
  151. package/src/models/operations/updatetool.ts +4 -4
  152. package/src/sdk/alerts.ts +2 -2
  153. package/src/sdk/classify.ts +3 -0
  154. package/src/sdk/decisions.ts +3 -0
@@ -6,6 +6,11 @@ import * as z from "zod/v3";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ AlertTelemetrySource,
11
+ AlertTelemetrySource$inboundSchema,
12
+ AlertTelemetrySource$outboundSchema,
13
+ } from "./alerttelemetrysource.js";
9
14
  import {
10
15
  MonitorFilter,
11
16
  MonitorFilter$inboundSchema,
@@ -15,17 +20,26 @@ import {
15
20
 
16
21
  export type AlertQuery = {
17
22
  /**
18
- * Reporting API catalogue metric, e.g. `genai.cost` or
23
+ * Source-owned metric identifier. Trace metrics are validated against the
19
24
  *
20
25
  * @remarks
21
- * `genai.latency.avg`. Validated against the catalogue when the alert
22
- * is saved.
26
+ * Reporting catalogue; runtime metrics are validated against telemetry
27
+ * capabilities in the alert's scope.
23
28
  */
24
29
  metric: string;
25
30
  /**
26
- * Reporting filters combined with AND.
31
+ * Source-owned filters combined with AND.
27
32
  */
28
33
  filters?: Array<MonitorFilter> | undefined;
34
+ source?: AlertTelemetrySource | undefined;
35
+ /**
36
+ * Aggregation operation advertised by the selected metric capability.
37
+ *
38
+ * @remarks
39
+ * Existing trace queries may omit it; the server resolves their canonical
40
+ * Reporting operation.
41
+ */
42
+ operation?: string | undefined;
29
43
  };
30
44
 
31
45
  /** @internal */
@@ -36,11 +50,15 @@ export const AlertQuery$inboundSchema: z.ZodType<
36
50
  > = z.object({
37
51
  metric: z.string(),
38
52
  filters: z.array(MonitorFilter$inboundSchema).optional(),
53
+ source: AlertTelemetrySource$inboundSchema.optional(),
54
+ operation: z.string().optional(),
39
55
  });
40
56
  /** @internal */
41
57
  export type AlertQuery$Outbound = {
42
58
  metric: string;
43
59
  filters?: Array<MonitorFilter$Outbound> | undefined;
60
+ source?: string | undefined;
61
+ operation?: string | undefined;
44
62
  };
45
63
 
46
64
  /** @internal */
@@ -51,6 +69,8 @@ export const AlertQuery$outboundSchema: z.ZodType<
51
69
  > = z.object({
52
70
  metric: z.string(),
53
71
  filters: z.array(MonitorFilter$outboundSchema).optional(),
72
+ source: AlertTelemetrySource$outboundSchema.optional(),
73
+ operation: z.string().optional(),
54
74
  });
55
75
 
56
76
  export function alertQueryToJSON(alertQuery: AlertQuery): string {
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const AlertScope = {
9
+ AlertScopeUnspecified: "ALERT_SCOPE_UNSPECIFIED",
10
+ AlertScopeProject: "ALERT_SCOPE_PROJECT",
11
+ AlertScopeWorkspace: "ALERT_SCOPE_WORKSPACE",
12
+ } as const;
13
+ export type AlertScope = ClosedEnum<typeof AlertScope>;
14
+
15
+ /** @internal */
16
+ export const AlertScope$inboundSchema: z.ZodNativeEnum<typeof AlertScope> = z
17
+ .nativeEnum(AlertScope);
18
+ /** @internal */
19
+ export const AlertScope$outboundSchema: z.ZodNativeEnum<typeof AlertScope> =
20
+ AlertScope$inboundSchema;
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const AlertTelemetrySource = {
9
+ AlertTelemetrySourceUnspecified: "ALERT_TELEMETRY_SOURCE_UNSPECIFIED",
10
+ AlertTelemetrySourceTraces: "ALERT_TELEMETRY_SOURCE_TRACES",
11
+ AlertTelemetrySourceMetrics: "ALERT_TELEMETRY_SOURCE_METRICS",
12
+ } as const;
13
+ export type AlertTelemetrySource = ClosedEnum<typeof AlertTelemetrySource>;
14
+
15
+ /** @internal */
16
+ export const AlertTelemetrySource$inboundSchema: z.ZodNativeEnum<
17
+ typeof AlertTelemetrySource
18
+ > = z.nativeEnum(AlertTelemetrySource);
19
+ /** @internal */
20
+ export const AlertTelemetrySource$outboundSchema: z.ZodNativeEnum<
21
+ typeof AlertTelemetrySource
22
+ > = AlertTelemetrySource$inboundSchema;
@@ -8,6 +8,7 @@ import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import { AlertQuery, AlertQuery$inboundSchema } from "./alertquery.js";
11
12
 
12
13
  /**
13
14
  * Whether the breach is ongoing or recovered.
@@ -90,6 +91,13 @@ export type AlertTrigger = {
90
91
  * Number of evaluation events recorded on this trigger.
91
92
  */
92
93
  eventCount: number;
94
+ /**
95
+ * Query evaluated for this incident. Older incidents may omit it and
96
+ *
97
+ * @remarks
98
+ * inherit the alert's current query for display compatibility.
99
+ */
100
+ query?: AlertQuery | undefined;
93
101
  };
94
102
 
95
103
  /** @internal */
@@ -125,6 +133,7 @@ export const AlertTrigger$inboundSchema: z.ZodType<
125
133
  peak_value: z.number(),
126
134
  last_value: z.number(),
127
135
  event_count: z.number().int(),
136
+ query: AlertQuery$inboundSchema.optional(),
128
137
  }).transform((v) => {
129
138
  return remap$(v, {
130
139
  "trigger_id": "triggerId",
@@ -12,14 +12,16 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
12
  /**
13
13
  * The format of the encoded audio data. Currently supports `wav` and `mp3`.
14
14
  */
15
- export const Format = {
15
+ export const AudioContentPartSchemaFormat = {
16
16
  Mp3: "mp3",
17
17
  Wav: "wav",
18
18
  } as const;
19
19
  /**
20
20
  * The format of the encoded audio data. Currently supports `wav` and `mp3`.
21
21
  */
22
- export type Format = ClosedEnum<typeof Format>;
22
+ export type AudioContentPartSchemaFormat = ClosedEnum<
23
+ typeof AudioContentPartSchemaFormat
24
+ >;
23
25
 
24
26
  export type InputAudio = {
25
27
  /**
@@ -29,7 +31,7 @@ export type InputAudio = {
29
31
  /**
30
32
  * The format of the encoded audio data. Currently supports `wav` and `mp3`.
31
33
  */
32
- format: Format;
34
+ format: AudioContentPartSchemaFormat;
33
35
  };
34
36
 
35
37
  /**
@@ -41,11 +43,13 @@ export type AudioContentPartSchema = {
41
43
  };
42
44
 
43
45
  /** @internal */
44
- export const Format$inboundSchema: z.ZodNativeEnum<typeof Format> = z
45
- .nativeEnum(Format);
46
+ export const AudioContentPartSchemaFormat$inboundSchema: z.ZodNativeEnum<
47
+ typeof AudioContentPartSchemaFormat
48
+ > = z.nativeEnum(AudioContentPartSchemaFormat);
46
49
  /** @internal */
47
- export const Format$outboundSchema: z.ZodNativeEnum<typeof Format> =
48
- Format$inboundSchema;
50
+ export const AudioContentPartSchemaFormat$outboundSchema: z.ZodNativeEnum<
51
+ typeof AudioContentPartSchemaFormat
52
+ > = AudioContentPartSchemaFormat$inboundSchema;
49
53
 
50
54
  /** @internal */
51
55
  export const InputAudio$inboundSchema: z.ZodType<
@@ -54,7 +58,7 @@ export const InputAudio$inboundSchema: z.ZodType<
54
58
  unknown
55
59
  > = z.object({
56
60
  data: z.string(),
57
- format: Format$inboundSchema,
61
+ format: AudioContentPartSchemaFormat$inboundSchema,
58
62
  });
59
63
  /** @internal */
60
64
  export type InputAudio$Outbound = {
@@ -69,7 +73,7 @@ export const InputAudio$outboundSchema: z.ZodType<
69
73
  InputAudio
70
74
  > = z.object({
71
75
  data: z.string(),
72
- format: Format$outboundSchema,
76
+ format: AudioContentPartSchemaFormat$outboundSchema,
73
77
  });
74
78
 
75
79
  export function inputAudioToJSON(inputAudio: InputAudio): string {
@@ -6,6 +6,10 @@ import * as z from "zod/v3";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ ClassifyBoxAnswer,
11
+ ClassifyBoxAnswer$inboundSchema,
12
+ } from "./classifyboxanswer.js";
9
13
  import {
10
14
  ClassifyChoiceAnswer,
11
15
  ClassifyChoiceAnswer$inboundSchema,
@@ -27,6 +31,7 @@ import {
27
31
  * One answer to a classification question. The type selects the answer fields. A refusal contains only type.
28
32
  */
29
33
  export type ClassifyAnswer =
34
+ | ClassifyBoxAnswer
30
35
  | ClassifyChoiceAnswer
31
36
  | ClassifyNoulAnswer
32
37
  | ClassifyRefusalAnswer
@@ -38,6 +43,7 @@ export const ClassifyAnswer$inboundSchema: z.ZodType<
38
43
  z.ZodTypeDef,
39
44
  unknown
40
45
  > = z.union([
46
+ ClassifyBoxAnswer$inboundSchema,
41
47
  ClassifyChoiceAnswer$inboundSchema,
42
48
  ClassifyNoulAnswer$inboundSchema,
43
49
  ClassifyRefusalAnswer$inboundSchema,
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+
9
+ /**
10
+ * The image format.
11
+ */
12
+ export const Format = {
13
+ Png: "png",
14
+ Jpg: "jpg",
15
+ Jpeg: "jpeg",
16
+ } as const;
17
+ /**
18
+ * The image format.
19
+ */
20
+ export type Format = ClosedEnum<typeof Format>;
21
+
22
+ /**
23
+ * The asset type. Only image is supported.
24
+ */
25
+ export const ClassifyAssetType = {
26
+ Image: "image",
27
+ } as const;
28
+ /**
29
+ * The asset type. Only image is supported.
30
+ */
31
+ export type ClassifyAssetType = ClosedEnum<typeof ClassifyAssetType>;
32
+
33
+ export type ClassifyAsset = {
34
+ /**
35
+ * Standard base64 with padding, without whitespace or a data: prefix. PNG or JPEG still images, 256 to 1568 px per side, at most 16 MiB each.
36
+ */
37
+ dataBase64: string;
38
+ /**
39
+ * The image format.
40
+ */
41
+ format: Format;
42
+ /**
43
+ * The asset type. Only image is supported.
44
+ */
45
+ type?: ClassifyAssetType | undefined;
46
+ };
47
+
48
+ /** @internal */
49
+ export const Format$outboundSchema: z.ZodNativeEnum<typeof Format> = z
50
+ .nativeEnum(Format);
51
+
52
+ /** @internal */
53
+ export const ClassifyAssetType$outboundSchema: z.ZodNativeEnum<
54
+ typeof ClassifyAssetType
55
+ > = z.nativeEnum(ClassifyAssetType);
56
+
57
+ /** @internal */
58
+ export type ClassifyAsset$Outbound = {
59
+ data_base64: string;
60
+ format: string;
61
+ type?: string | undefined;
62
+ };
63
+
64
+ /** @internal */
65
+ export const ClassifyAsset$outboundSchema: z.ZodType<
66
+ ClassifyAsset$Outbound,
67
+ z.ZodTypeDef,
68
+ ClassifyAsset
69
+ > = z.object({
70
+ dataBase64: z.string(),
71
+ format: Format$outboundSchema,
72
+ type: ClassifyAssetType$outboundSchema.optional(),
73
+ }).transform((v) => {
74
+ return remap$(v, {
75
+ dataBase64: "data_base64",
76
+ });
77
+ });
78
+
79
+ export function classifyAssetToJSON(classifyAsset: ClassifyAsset): string {
80
+ return JSON.stringify(ClassifyAsset$outboundSchema.parse(classifyAsset));
81
+ }
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type ClassifyBox = {
11
+ /**
12
+ * Distance of the bottom edge from the top of the image, as a fraction of the image height.
13
+ */
14
+ bottom: number;
15
+ /**
16
+ * Distance of the left edge from the left of the image, as a fraction of the image width.
17
+ */
18
+ left: number;
19
+ /**
20
+ * Distance of the right edge from the left of the image, as a fraction of the image width.
21
+ */
22
+ right: number;
23
+ /**
24
+ * Distance of the top edge from the top of the image, as a fraction of the image height.
25
+ */
26
+ top: number;
27
+ };
28
+
29
+ /** @internal */
30
+ export const ClassifyBox$inboundSchema: z.ZodType<
31
+ ClassifyBox,
32
+ z.ZodTypeDef,
33
+ unknown
34
+ > = z.object({
35
+ bottom: z.number(),
36
+ left: z.number(),
37
+ right: z.number(),
38
+ top: z.number(),
39
+ });
40
+
41
+ export function classifyBoxFromJSON(
42
+ jsonString: string,
43
+ ): SafeParseResult<ClassifyBox, SDKValidationError> {
44
+ return safeParse(
45
+ jsonString,
46
+ (x) => ClassifyBox$inboundSchema.parse(JSON.parse(x)),
47
+ `Failed to parse 'ClassifyBox' from JSON`,
48
+ );
49
+ }
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import { ClassifyBox, ClassifyBox$inboundSchema } from "./classifybox.js";
10
+
11
+ export type ClassifyBoxAnswer = {
12
+ box: ClassifyBox;
13
+ /**
14
+ * How sure the model is of the answer it selected: on emulated chat models the largest value in probabilities, so it adds nothing the distribution does not; native providers return their own confidence value, which can sit below the largest probability. Present for choice, score and box answers.
15
+ */
16
+ confidence?: number | undefined;
17
+ type: "box";
18
+ };
19
+
20
+ /** @internal */
21
+ export const ClassifyBoxAnswer$inboundSchema: z.ZodType<
22
+ ClassifyBoxAnswer,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ box: ClassifyBox$inboundSchema,
27
+ confidence: z.number().optional(),
28
+ type: z.literal("box"),
29
+ });
30
+
31
+ export function classifyBoxAnswerFromJSON(
32
+ jsonString: string,
33
+ ): SafeParseResult<ClassifyBoxAnswer, SDKValidationError> {
34
+ return safeParse(
35
+ jsonString,
36
+ (x) => ClassifyBoxAnswer$inboundSchema.parse(JSON.parse(x)),
37
+ `Failed to parse 'ClassifyBoxAnswer' from JSON`,
38
+ );
39
+ }
@@ -13,7 +13,7 @@ export type ClassifyChoiceAnswer = {
13
13
  */
14
14
  choice: string;
15
15
  /**
16
- * How sure the model is of the answer it selected: on emulated chat models the largest value in probabilities, so it adds nothing the distribution does not; native providers return their own confidence value, which can sit below the largest probability. Present for choice and score answers.
16
+ * How sure the model is of the answer it selected: on emulated chat models the largest value in probabilities, so it adds nothing the distribution does not; native providers return their own confidence value, which can sit below the largest probability. Present for choice, score and box answers.
17
17
  */
18
18
  confidence?: number | undefined;
19
19
  /**
@@ -9,7 +9,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  export type ClassifyScoreAnswer = {
11
11
  /**
12
- * How sure the model is of the answer it selected: on emulated chat models the largest value in probabilities, so it adds nothing the distribution does not; native providers return their own confidence value, which can sit below the largest probability. Present for choice and score answers.
12
+ * How sure the model is of the answer it selected: on emulated chat models the largest value in probabilities, so it adds nothing the distribution does not; native providers return their own confidence value, which can sit below the largest probability. Present for choice, score and box answers.
13
13
  */
14
14
  confidence?: number | undefined;
15
15
  /**
@@ -19,6 +19,7 @@ import {
19
19
  AlertQuery$Outbound,
20
20
  AlertQuery$outboundSchema,
21
21
  } from "./alertquery.js";
22
+ import { AlertScope, AlertScope$outboundSchema } from "./alertscope.js";
22
23
 
23
24
  export type CreateAlertRequest = {
24
25
  /**
@@ -30,9 +31,9 @@ export type CreateAlertRequest = {
30
31
  */
31
32
  description?: string | undefined;
32
33
  /**
33
- * Project that owns the alert. Required.
34
+ * Project that owns a project alert. Empty for a workspace alert.
34
35
  */
35
- projectId: string;
36
+ projectId?: string | undefined;
36
37
  /**
37
38
  * UI signal preset the alert is created from. Defaults to `custom`.
38
39
  */
@@ -60,19 +61,21 @@ export type CreateAlertRequest = {
60
61
  * Display options for the alert activity chart.
61
62
  */
62
63
  display?: AlertDisplay | undefined;
64
+ scope?: AlertScope | undefined;
63
65
  };
64
66
 
65
67
  /** @internal */
66
68
  export type CreateAlertRequest$Outbound = {
67
69
  display_name: string;
68
70
  description?: string | undefined;
69
- project_id: string;
71
+ project_id?: string | undefined;
70
72
  signal?: string | undefined;
71
73
  query: AlertQuery$Outbound;
72
74
  condition: AlertCondition$Outbound;
73
75
  notifier_ids?: Array<string> | undefined;
74
76
  enabled?: boolean | undefined;
75
77
  display?: AlertDisplay$Outbound | undefined;
78
+ scope?: string | undefined;
76
79
  };
77
80
 
78
81
  /** @internal */
@@ -83,13 +86,14 @@ export const CreateAlertRequest$outboundSchema: z.ZodType<
83
86
  > = z.object({
84
87
  displayName: z.string(),
85
88
  description: z.string().optional(),
86
- projectId: z.string(),
89
+ projectId: z.string().optional(),
87
90
  signal: z.string().optional(),
88
91
  query: AlertQuery$outboundSchema,
89
92
  condition: AlertCondition$outboundSchema,
90
93
  notifierIds: z.array(z.string()).optional(),
91
94
  enabled: z.boolean().optional(),
92
95
  display: AlertDisplay$outboundSchema.optional(),
96
+ scope: AlertScope$outboundSchema.optional(),
93
97
  }).transform((v) => {
94
98
  return remap$(v, {
95
99
  displayName: "display_name",
@@ -31,6 +31,8 @@ export * from "./alertdisplay.js";
31
31
  export * from "./alertevidence.js";
32
32
  export * from "./alertquery.js";
33
33
  export * from "./alertrun.js";
34
+ export * from "./alertscope.js";
35
+ export * from "./alerttelemetrysource.js";
34
36
  export * from "./alerttrigger.js";
35
37
  export * from "./alerttriggerevent.js";
36
38
  export * from "./allprojectsscope.js";
@@ -85,6 +87,9 @@ export * from "./chunksservicelistresponse.js";
85
87
  export * from "./chunksservicesetenabledrequest.js";
86
88
  export * from "./chunksserviceupdaterequest.js";
87
89
  export * from "./classifyanswer.js";
90
+ export * from "./classifyasset.js";
91
+ export * from "./classifybox.js";
92
+ export * from "./classifyboxanswer.js";
88
93
  export * from "./classifycacheconfig.js";
89
94
  export * from "./classifychoiceanswer.js";
90
95
  export * from "./classifyinputtokensdetails.js";
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
40
40
  z.ZodTypeDef,
41
41
  unknown
42
42
  > = z.object({
43
- _id: z.string().default("reasoning_01m4zegtrp6vaqsfbygd7rac0n"),
43
+ _id: z.string().default("reasoning_01m50dv9x8vm9xxs8f8jwj2zq5"),
44
44
  metadata: z.record(z.any()).optional(),
45
45
  kind: z.literal("reasoning"),
46
46
  reasoning: z.string(),
@@ -34,7 +34,10 @@ export type UpdateAlertRequest = {
34
34
  */
35
35
  signal?: string | undefined;
36
36
  /**
37
- * Replacement query. Omit to keep the current query.
37
+ * Replacement query. Metric, operation, and filters may change within the
38
+ *
39
+ * @remarks
40
+ * current telemetry source. Source changes require creating a new alert.
38
41
  */
39
42
  query?: AlertQuery | undefined;
40
43
  /**
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import * as components from "../components/index.js";
7
8
 
8
9
  export type AlertListRequest = {
9
10
  /**
@@ -28,6 +29,13 @@ export type AlertListRequest = {
28
29
  * Restrict results to one project.
29
30
  */
30
31
  projectId?: string | undefined;
32
+ /**
33
+ * Restrict results by ownership boundary. Unspecified returns all alerts
34
+ *
35
+ * @remarks
36
+ * visible to the caller; non-admin callers never see workspace alerts.
37
+ */
38
+ scope?: components.AlertScope | undefined;
31
39
  };
32
40
 
33
41
  /** @internal */
@@ -36,6 +44,7 @@ export type AlertListRequest$Outbound = {
36
44
  starting_after?: string | undefined;
37
45
  ending_before?: string | undefined;
38
46
  project_id?: string | undefined;
47
+ scope?: string | undefined;
39
48
  };
40
49
 
41
50
  /** @internal */
@@ -48,6 +57,7 @@ export const AlertListRequest$outboundSchema: z.ZodType<
48
57
  startingAfter: z.string().optional(),
49
58
  endingBefore: z.string().optional(),
50
59
  projectId: z.string().optional(),
60
+ scope: components.AlertScope$outboundSchema.optional(),
51
61
  }).transform((v) => {
52
62
  return remap$(v, {
53
63
  startingAfter: "starting_after",