Skip to content

Commit 124aaac

Browse files
committed
chore: regenerate TypeScript SDK for unrendered template types
1 parent 817c3db commit 124aaac

6 files changed

Lines changed: 192 additions & 23 deletions

File tree

‎sdks/typescript/src/generated/models/control-summary.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export type ControlSummary = {
5050
* Whether the control was created from a template
5151
*/
5252
templateBacked: boolean;
53+
/**
54+
* Whether a template-backed control has been rendered. True for rendered templates, False for unrendered templates, None for non-template controls.
55+
*/
56+
templateRendered?: boolean | null | undefined;
5357
/**
5458
* Agent using this control
5559
*/
@@ -75,13 +79,15 @@ export const ControlSummary$inboundSchema: z.ZodMiniType<
7579
step_types: z.optional(z.nullable(z.array(types.string()))),
7680
tags: types.optional(z.array(types.string())),
7781
template_backed: z._default(types.boolean(), false),
82+
template_rendered: z.optional(z.nullable(types.boolean())),
7883
used_by_agent: z.optional(z.nullable(AgentRef$inboundSchema)),
7984
used_by_agents_count: z._default(types.number(), 0),
8085
}),
8186
z.transform((v) => {
8287
return remap$(v, {
8388
"step_types": "stepTypes",
8489
"template_backed": "templateBacked",
90+
"template_rendered": "templateRendered",
8591
"used_by_agent": "usedByAgent",
8692
"used_by_agents_count": "usedByAgentsCount",
8793
});

‎sdks/typescript/src/generated/models/control.ts‎

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,61 @@ import * as z from "zod/v4-mini";
66
import { safeParse } from "../lib/schemas.js";
77
import { Result as SafeParseResult } from "../types/fp.js";
88
import * as types from "../types/primitives.js";
9+
import { smartUnion } from "../types/smart-union.js";
910
import {
1011
ControlDefinitionOutput,
1112
ControlDefinitionOutput$inboundSchema,
1213
} from "./control-definition-output.js";
1314
import { SDKValidationError } from "./errors/sdk-validation-error.js";
15+
import {
16+
UnrenderedTemplateControl,
17+
UnrenderedTemplateControl$inboundSchema,
18+
} from "./unrendered-template-control.js";
19+
20+
export type ControlControl =
21+
| ControlDefinitionOutput
22+
| UnrenderedTemplateControl;
1423

1524
/**
1625
* A control with identity and configuration.
1726
*
1827
* @remarks
1928
*
20-
* Note: Only fully-configured controls (with valid ControlDefinition)
21-
* are returned from API endpoints. Unconfigured controls are filtered out.
29+
* For rendered controls (raw or template-backed), ``control`` is a
30+
* ``ControlDefinition``. For unrendered template controls, ``control``
31+
* is an ``UnrenderedTemplateControl``.
2232
*/
2333
export type Control = {
24-
/**
25-
* A control definition to evaluate agent interactions.
26-
*
27-
* @remarks
28-
*
29-
* This model contains only the logic and configuration.
30-
* Identity fields (id, name) are managed by the database.
31-
*/
32-
control: ControlDefinitionOutput;
34+
control: ControlDefinitionOutput | UnrenderedTemplateControl;
3335
id: number;
3436
name: string;
3537
};
3638

39+
/** @internal */
40+
export const ControlControl$inboundSchema: z.ZodMiniType<
41+
ControlControl,
42+
unknown
43+
> = smartUnion([
44+
ControlDefinitionOutput$inboundSchema,
45+
UnrenderedTemplateControl$inboundSchema,
46+
]);
47+
48+
export function controlControlFromJSON(
49+
jsonString: string,
50+
): SafeParseResult<ControlControl, SDKValidationError> {
51+
return safeParse(
52+
jsonString,
53+
(x) => ControlControl$inboundSchema.parse(JSON.parse(x)),
54+
`Failed to parse 'ControlControl' from JSON`,
55+
);
56+
}
57+
3758
/** @internal */
3859
export const Control$inboundSchema: z.ZodMiniType<Control, unknown> = z.object({
39-
control: ControlDefinitionOutput$inboundSchema,
60+
control: smartUnion([
61+
ControlDefinitionOutput$inboundSchema,
62+
UnrenderedTemplateControl$inboundSchema,
63+
]),
4064
id: types.number(),
4165
name: types.string(),
4266
});

‎sdks/typescript/src/generated/models/get-control-data-response.ts‎

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,59 @@
55
import * as z from "zod/v4-mini";
66
import { safeParse } from "../lib/schemas.js";
77
import { Result as SafeParseResult } from "../types/fp.js";
8+
import { smartUnion } from "../types/smart-union.js";
89
import {
910
ControlDefinitionOutput,
1011
ControlDefinitionOutput$inboundSchema,
1112
} from "./control-definition-output.js";
1213
import { SDKValidationError } from "./errors/sdk-validation-error.js";
14+
import {
15+
UnrenderedTemplateControl,
16+
UnrenderedTemplateControl$inboundSchema,
17+
} from "./unrendered-template-control.js";
18+
19+
/**
20+
* Control data payload (rendered control or unrendered template)
21+
*/
22+
export type GetControlDataResponseData =
23+
| ControlDefinitionOutput
24+
| UnrenderedTemplateControl;
1325

1426
export type GetControlDataResponse = {
1527
/**
16-
* A control definition to evaluate agent interactions.
17-
*
18-
* @remarks
19-
*
20-
* This model contains only the logic and configuration.
21-
* Identity fields (id, name) are managed by the database.
28+
* Control data payload (rendered control or unrendered template)
2229
*/
23-
data: ControlDefinitionOutput;
30+
data: ControlDefinitionOutput | UnrenderedTemplateControl;
2431
};
2532

33+
/** @internal */
34+
export const GetControlDataResponseData$inboundSchema: z.ZodMiniType<
35+
GetControlDataResponseData,
36+
unknown
37+
> = smartUnion([
38+
ControlDefinitionOutput$inboundSchema,
39+
UnrenderedTemplateControl$inboundSchema,
40+
]);
41+
42+
export function getControlDataResponseDataFromJSON(
43+
jsonString: string,
44+
): SafeParseResult<GetControlDataResponseData, SDKValidationError> {
45+
return safeParse(
46+
jsonString,
47+
(x) => GetControlDataResponseData$inboundSchema.parse(JSON.parse(x)),
48+
`Failed to parse 'GetControlDataResponseData' from JSON`,
49+
);
50+
}
51+
2652
/** @internal */
2753
export const GetControlDataResponse$inboundSchema: z.ZodMiniType<
2854
GetControlDataResponse,
2955
unknown
3056
> = z.object({
31-
data: ControlDefinitionOutput$inboundSchema,
57+
data: smartUnion([
58+
ControlDefinitionOutput$inboundSchema,
59+
UnrenderedTemplateControl$inboundSchema,
60+
]),
3261
});
3362

3463
export function getControlDataResponseFromJSON(

‎sdks/typescript/src/generated/models/get-control-response.ts‎

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,32 @@ import * as z from "zod/v4-mini";
66
import { safeParse } from "../lib/schemas.js";
77
import { Result as SafeParseResult } from "../types/fp.js";
88
import * as types from "../types/primitives.js";
9+
import { smartUnion } from "../types/smart-union.js";
910
import {
1011
ControlDefinitionOutput,
1112
ControlDefinitionOutput$inboundSchema,
1213
} from "./control-definition-output.js";
1314
import { SDKValidationError } from "./errors/sdk-validation-error.js";
15+
import {
16+
UnrenderedTemplateControl,
17+
UnrenderedTemplateControl$inboundSchema,
18+
} from "./unrendered-template-control.js";
19+
20+
/**
21+
* Control configuration data. A ControlDefinition for raw/rendered controls, an UnrenderedTemplateControl for unrendered templates, or None if not yet configured.
22+
*/
23+
export type GetControlResponseData =
24+
| ControlDefinitionOutput
25+
| UnrenderedTemplateControl;
1426

1527
/**
1628
* Response containing control details.
1729
*/
1830
export type GetControlResponse = {
1931
/**
20-
* Control configuration data (None if not yet configured)
32+
* Control configuration data. A ControlDefinition for raw/rendered controls, an UnrenderedTemplateControl for unrendered templates, or None if not yet configured.
2133
*/
22-
data?: ControlDefinitionOutput | null | undefined;
34+
data?: ControlDefinitionOutput | UnrenderedTemplateControl | null | undefined;
2335
/**
2436
* Control ID
2537
*/
@@ -30,12 +42,38 @@ export type GetControlResponse = {
3042
name: string;
3143
};
3244

45+
/** @internal */
46+
export const GetControlResponseData$inboundSchema: z.ZodMiniType<
47+
GetControlResponseData,
48+
unknown
49+
> = smartUnion([
50+
ControlDefinitionOutput$inboundSchema,
51+
UnrenderedTemplateControl$inboundSchema,
52+
]);
53+
54+
export function getControlResponseDataFromJSON(
55+
jsonString: string,
56+
): SafeParseResult<GetControlResponseData, SDKValidationError> {
57+
return safeParse(
58+
jsonString,
59+
(x) => GetControlResponseData$inboundSchema.parse(JSON.parse(x)),
60+
`Failed to parse 'GetControlResponseData' from JSON`,
61+
);
62+
}
63+
3364
/** @internal */
3465
export const GetControlResponse$inboundSchema: z.ZodMiniType<
3566
GetControlResponse,
3667
unknown
3768
> = z.object({
38-
data: z.optional(z.nullable(ControlDefinitionOutput$inboundSchema)),
69+
data: z.optional(
70+
z.nullable(
71+
smartUnion([
72+
ControlDefinitionOutput$inboundSchema,
73+
UnrenderedTemplateControl$inboundSchema,
74+
]),
75+
),
76+
),
3977
id: types.number(),
4078
name: types.string(),
4179
});

‎sdks/typescript/src/generated/models/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export * from "./template-definition-output.js";
8989
export * from "./template-parameter-definition.js";
9090
export * from "./template-value.js";
9191
export * from "./timeseries-bucket.js";
92+
export * from "./unrendered-template-control.js";
9293
export * from "./validate-control-data-request.js";
9394
export * from "./validate-control-data-response.js";
9495
export * from "./validation-error.js";
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3+
*/
4+
5+
import * as z from "zod/v4-mini";
6+
import { remap as remap$ } from "../lib/primitives.js";
7+
import { safeParse } from "../lib/schemas.js";
8+
import { Result as SafeParseResult } from "../types/fp.js";
9+
import * as types from "../types/primitives.js";
10+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
11+
import {
12+
TemplateDefinitionOutput,
13+
TemplateDefinitionOutput$inboundSchema,
14+
} from "./template-definition-output.js";
15+
import {
16+
TemplateValue,
17+
TemplateValue$inboundSchema,
18+
} from "./template-value.js";
19+
20+
/**
21+
* Stored state of a template control that hasn't been rendered yet.
22+
*
23+
* @remarks
24+
*
25+
* An unrendered template has a template definition and possibly partial
26+
* parameter values, but no concrete condition/action/execution fields.
27+
* It is always ``enabled=False`` and excluded from evaluation.
28+
*/
29+
export type UnrenderedTemplateControl = {
30+
/**
31+
* Unrendered templates are always disabled
32+
*/
33+
enabled: false;
34+
/**
35+
* Reusable template with typed parameters and a JSON definition template.
36+
*/
37+
template: TemplateDefinitionOutput;
38+
/**
39+
* Partial or empty parameter values
40+
*/
41+
templateValues?: { [k: string]: TemplateValue } | undefined;
42+
};
43+
44+
/** @internal */
45+
export const UnrenderedTemplateControl$inboundSchema: z.ZodMiniType<
46+
UnrenderedTemplateControl,
47+
unknown
48+
> = z.pipe(
49+
z.object({
50+
enabled: z._default(types.literal(false), false),
51+
template: TemplateDefinitionOutput$inboundSchema,
52+
template_values: types.optional(
53+
z.record(z.string(), TemplateValue$inboundSchema),
54+
),
55+
}),
56+
z.transform((v) => {
57+
return remap$(v, {
58+
"template_values": "templateValues",
59+
});
60+
}),
61+
);
62+
63+
export function unrenderedTemplateControlFromJSON(
64+
jsonString: string,
65+
): SafeParseResult<UnrenderedTemplateControl, SDKValidationError> {
66+
return safeParse(
67+
jsonString,
68+
(x) => UnrenderedTemplateControl$inboundSchema.parse(JSON.parse(x)),
69+
`Failed to parse 'UnrenderedTemplateControl' from JSON`,
70+
);
71+
}

0 commit comments

Comments
 (0)